/opt/canhelp/apps/web/.next/cache/webpack/client-production
NameSizeModeActions
0.pack645019950644editdlrm
1.pack6228990644editdlrm
2.pack16053830644editdlrm
3.pack18294750644editdlrm
4.pack13724980644editdlrm
5.pack40780644editdlrm
6.pack18542550644editdlrm
7.pack11179260644editdlrm
8.pack38699010644editdlrm
9.pack40193500644editdlrm
10.pack10927090644editdlrm
11.pack361280644editdlrm
12.pack13004210644editdlrm
13.pack115880644editdlrm
14.pack40780644editdlrm
15.pack214033720644editdlrm
16.pack5411070644editdlrm
17.pack40780644editdlrm
18.pack2954110644editdlrm
19.pack222311380644editdlrm
20.pack2752970644editdlrm
21.pack54214750644editdlrm
index.pack34315280644editdlrm
index.pack.old34732550644editdlrm
Edit: /opt/canhelp/apps/web/.next/cache/webpack/client-production/15.pack (21403372B)
wpcà–F§webpack/lib/cache/PackFileCacheStrategyPackContentItems €`Rë ResolverCachePlugin|normal|default|alias=[|server-only$=|next/dist/compiled/server-only/index|client-only$=|next/dist/compiled/client-only/index|next/dist/compiled/client-only$=|next/dist/compiled/client-only/index|next/dist/compiled/server-only=|next/dist/compiled/server-only/index|/opt/canhelp/node_modules/next/head.js=|next/dist/client/components/noop-head|/opt/canhelp/node_modules/next/image.js=|next/dist/api/image|/opt/canhelp/node_modules/next/constants.js=|next/dist/api/constants|/opt/canhelp/node_modules/next/router.js=|next/dist/api/router|/opt/canhelp/node_modules/next/dynamic.js=|next/dist/api/app-dynamic|/opt/canhelp/node_modules/next/script.js=|next/dist/api/script|/opt/canhelp/node_modules/next/link.js=|next/dist/client/app-dir/link|/opt/canhelp/node_modules/next/form.js=|next/dist/client/app-dir/form|/opt/canhelp/node_modules/next/navigation.js=|next/dist/api/navigation|/opt/canhelp/node_modules/next/headers.js=|next/dist/api/headers|/opt/canhelp/node_modules/next/og.js=|next/dist/api/og|/opt/canhelp/node_modules/next/server.js=|next/dist/api/server|/opt/canhelp/node_modules/next/document.js=|next/dist/api/document|/opt/canhelp/node_modules/next/app.js=|next/dist/api/app|next=|/opt/canhelp/node_modules/next|]|fallback=[|assert=|/opt/canhelp/node_modules/next/dist/compiled/assert/assert.js|buffer=|/opt/canhelp/node_modules/next/dist/compiled/buffer/index.js|constants=|/opt/canhelp/node_modules/next/dist/compiled/constants-browserify/constants.json|crypto=|/opt/canhelp/node_modules/next/dist/compiled/crypto-browserify/index.js|domain=|/opt/canhelp/node_modules/next/dist/compiled/domain-browser/index.js|http=|/opt/canhelp/node_modules/next/dist/compiled/stream-http/index.js|https=|/opt/canhelp/node_modules/next/dist/compiled/https-browserify/index.js|os=|/opt/canhelp/node_modules/next/dist/compiled/os-browserify/browser.js|path=|/opt/canhelp/node_modules/next/dist/compiled/path-browserify/index.js|punycode=|/opt/canhelp/node_modules/next/dist/compiled/punycode/punycode.js|process=|/opt/canhelp/node_modules/next/dist/build/polyfills/process.js|querystring=|/opt/canhelp/node_modules/next/dist/compiled/querystring-es3/index.js|stream=|/opt/canhelp/node_modules/next/dist/compiled/stream-browserify/index.js|string_decoder=|/opt/canhelp/node_modules/next/dist/compiled/string_decoder/string_decoder.js|sys=|/opt/canhelp/node_modules/next/dist/compiled/util/util.js|timers=|/opt/canhelp/node_modules/next/dist/compiled/timers-browserify/main.js|tty=|/opt/canhelp/node_modules/next/dist/compiled/tty-browserify/index.js|util=|/opt/canhelp/node_modules/next/dist/compiled/util/util.js|vm=|/opt/canhelp/node_modules/next/dist/compiled/vm-browserify/index.js|zlib=|/opt/canhelp/node_modules/next/dist/compiled/browserify-zlib/index.js|events=|/opt/canhelp/node_modules/next/dist/compiled/events/events.js|setImmediate=|/opt/canhelp/node_modules/next/dist/compiled/setimmediate/setImmediate.js|]|dependencyType=|esm|path=|/opt/canhelp/apps/web|request=|/opt/canhelp/apps/web/src/components/ScrollToTopButton.tsxÜ ResolverCachePlugin|normal|default|alias=[|server-only$=|next/dist/compiled/server-only/index|client-only$=|next/dist/compiled/client-only/index|next/dist/compiled/client-only$=|next/dist/compiled/client-only/index|next/dist/compiled/server-only=|next/dist/compiled/server-only/index|/opt/canhelp/node_modules/next/head.js=|next/dist/client/components/noop-head|/opt/canhelp/node_modules/next/image.js=|next/dist/api/image|/opt/canhelp/node_modules/next/constants.js=|next/dist/api/constants|/opt/canhelp/node_modules/next/router.js=|next/dist/api/router|/opt/canhelp/node_modules/next/dynamic.js=|next/dist/api/app-dynamic|/opt/canhelp/node_modules/next/script.js=|next/dist/api/script|/opt/canhelp/node_modules/next/link.js=|next/dist/client/app-dir/link|/opt/canhelp/node_modules/next/form.js=|next/dist/client/app-dir/form|/opt/canhelp/node_modules/next/navigation.js=|next/dist/api/navigation|/opt/canhelp/node_modules/next/headers.js=|next/dist/api/headers|/opt/canhelp/node_modules/next/og.js=|next/dist/api/og|/opt/canhelp/node_modules/next/server.js=|next/dist/api/server|/opt/canhelp/node_modules/next/document.js=|next/dist/api/document|/opt/canhelp/node_modules/next/app.js=|next/dist/api/app|next=|/opt/canhelp/node_modules/next|]|fallback=[|assert=|/opt/canhelp/node_modules/next/dist/compiled/assert/assert.js|buffer=|/opt/canhelp/node_modules/next/dist/compiled/buffer/index.js|constants=|/opt/canhelp/node_modules/next/dist/compiled/constants-browserify/constants.json|crypto=|/opt/canhelp/node_modules/next/dist/compiled/crypto-browserify/index.js|domain=|/opt/canhelp/node_modules/next/dist/compiled/domain-browser/index.js|http=|/opt/canhelp/node_modules/next/dist/compiled/stream-http/index.js|https=|/opt/canhelp/node_modules/next/dist/compiled/https-browserify/index.js|os=|/opt/canhelp/node_modules/next/dist/compiled/os-browserify/browser.js|path=|/opt/canhelp/node_modules/next/dist/compiled/path-browserify/index.js|punycode=|/opt/canhelp/node_modules/next/dist/compiled/punycode/punycode.js|process=|/opt/canhelp/node_modules/next/dist/build/polyfills/process.js|querystring=|/opt/canhelp/node_modules/next/dist/compiled/querystring-es3/index.js|stream=|/opt/canhelp/node_modules/next/dist/compiled/stream-browserify/index.js|string_decoder=|/opt/canhelp/node_modules/next/dist/compiled/string_decoder/string_decoder.js|sys=|/opt/canhelp/node_modules/next/dist/compiled/util/util.js|timers=|/opt/canhelp/node_modules/next/dist/compiled/timers-browserify/main.js|tty=|/opt/canhelp/node_modules/next/dist/compiled/tty-browserify/index.js|util=|/opt/canhelp/node_modules/next/dist/compiled/util/util.js|vm=|/opt/canhelp/node_modules/next/dist/compiled/vm-browserify/index.js|zlib=|/opt/canhelp/node_modules/next/dist/compiled/browserify-zlib/index.js|events=|/opt/canhelp/node_modules/next/dist/compiled/events/events.js|setImmediate=|/opt/canhelp/node_modules/next/dist/compiled/setimmediate/setImmediate.js|]|dependencyType=|esm|path=|/opt/canhelp/apps/web|request=|/opt/canhelp/apps/web/src/app/chat/page.tsxá ResolverCachePlugin|normal|default|alias=[|server-only$=|next/dist/compiled/server-only/index|client-only$=|next/dist/compiled/client-only/index|next/dist/compiled/client-only$=|next/dist/compiled/client-only/index|next/dist/compiled/server-only=|next/dist/compiled/server-only/index|/opt/canhelp/node_modules/next/head.js=|next/dist/client/components/noop-head|/opt/canhelp/node_modules/next/image.js=|next/dist/api/image|/opt/canhelp/node_modules/next/constants.js=|next/dist/api/constants|/opt/canhelp/node_modules/next/router.js=|next/dist/api/router|/opt/canhelp/node_modules/next/dynamic.js=|next/dist/api/app-dynamic|/opt/canhelp/node_modules/next/script.js=|next/dist/api/script|/opt/canhelp/node_modules/next/link.js=|next/dist/client/app-dir/link|/opt/canhelp/node_modules/next/form.js=|next/dist/client/app-dir/form|/opt/canhelp/node_modules/next/navigation.js=|next/dist/api/navigation|/opt/canhelp/node_modules/next/headers.js=|next/dist/api/headers|/opt/canhelp/node_modules/next/og.js=|next/dist/api/og|/opt/canhelp/node_modules/next/server.js=|next/dist/api/server|/opt/canhelp/node_modules/next/document.js=|next/dist/api/document|/opt/canhelp/node_modules/next/app.js=|next/dist/api/app|next=|/opt/canhelp/node_modules/next|]|fallback=[|assert=|/opt/canhelp/node_modules/next/dist/compiled/assert/assert.js|buffer=|/opt/canhelp/node_modules/next/dist/compiled/buffer/index.js|constants=|/opt/canhelp/node_modules/next/dist/compiled/constants-browserify/constants.json|crypto=|/opt/canhelp/node_modules/next/dist/compiled/crypto-browserify/index.js|domain=|/opt/canhelp/node_modules/next/dist/compiled/domain-browser/index.js|http=|/opt/canhelp/node_modules/next/dist/compiled/stream-http/index.js|https=|/opt/canhelp/node_modules/next/dist/compiled/https-browserify/index.js|os=|/opt/canhelp/node_modules/next/dist/compiled/os-browserify/browser.js|path=|/opt/canhelp/node_modules/next/dist/compiled/path-browserify/index.js|punycode=|/opt/canhelp/node_modules/next/dist/compiled/punycode/punycode.js|process=|/opt/canhelp/node_modules/next/dist/build/polyfills/process.js|querystring=|/opt/canhelp/node_modules/next/dist/compiled/querystring-es3/index.js|stream=|/opt/canhelp/node_modules/next/dist/compiled/stream-browserify/index.js|string_decoder=|/opt/canhelp/node_modules/next/dist/compiled/string_decoder/string_decoder.js|sys=|/opt/canhelp/node_modules/next/dist/compiled/util/util.js|timers=|/opt/canhelp/node_modules/next/dist/compiled/timers-browserify/main.js|tty=|/opt/canhelp/node_modules/next/dist/compiled/tty-browserify/index.js|util=|/opt/canhelp/node_modules/next/dist/compiled/util/util.js|vm=|/opt/canhelp/node_modules/next/dist/compiled/vm-browserify/index.js|zlib=|/opt/canhelp/node_modules/next/dist/compiled/browserify-zlib/index.js|events=|/opt/canhelp/node_modules/next/dist/compiled/events/events.js|setImmediate=|/opt/canhelp/node_modules/next/dist/compiled/setimmediate/setImmediate.js|]|dependencyType=|esm|path=|/opt/canhelp/apps/web|request=|/opt/canhelp/apps/web/src/app/dashboard/page.tsxå ResolverCachePlugin|normal|default|alias=[|server-only$=|next/dist/compiled/server-only/index|client-only$=|next/dist/compiled/client-only/index|next/dist/compiled/client-only$=|next/dist/compiled/client-only/index|next/dist/compiled/server-only=|next/dist/compiled/server-only/index|/opt/canhelp/node_modules/next/head.js=|next/dist/client/components/noop-head|/opt/canhelp/node_modules/next/image.js=|next/dist/api/image|/opt/canhelp/node_modules/next/constants.js=|next/dist/api/constants|/opt/canhelp/node_modules/next/router.js=|next/dist/api/router|/opt/canhelp/node_modules/next/dynamic.js=|next/dist/api/app-dynamic|/opt/canhelp/node_modules/next/script.js=|next/dist/api/script|/opt/canhelp/node_modules/next/link.js=|next/dist/client/app-dir/link|/opt/canhelp/node_modules/next/form.js=|next/dist/client/app-dir/form|/opt/canhelp/node_modules/next/navigation.js=|next/dist/api/navigation|/opt/canhelp/node_modules/next/headers.js=|next/dist/api/headers|/opt/canhelp/node_modules/next/og.js=|next/dist/api/og|/opt/canhelp/node_modules/next/server.js=|next/dist/api/server|/opt/canhelp/node_modules/next/document.js=|next/dist/api/document|/opt/canhelp/node_modules/next/app.js=|next/dist/api/app|next=|/opt/canhelp/node_modules/next|]|fallback=[|assert=|/opt/canhelp/node_modules/next/dist/compiled/assert/assert.js|buffer=|/opt/canhelp/node_modules/next/dist/compiled/buffer/index.js|constants=|/opt/canhelp/node_modules/next/dist/compiled/constants-browserify/constants.json|crypto=|/opt/canhelp/node_modules/next/dist/compiled/crypto-browserify/index.js|domain=|/opt/canhelp/node_modules/next/dist/compiled/domain-browser/index.js|http=|/opt/canhelp/node_modules/next/dist/compiled/stream-http/index.js|https=|/opt/canhelp/node_modules/next/dist/compiled/https-browserify/index.js|os=|/opt/canhelp/node_modules/next/dist/compiled/os-browserify/browser.js|path=|/opt/canhelp/node_modules/next/dist/compiled/path-browserify/index.js|punycode=|/opt/canhelp/node_modules/next/dist/compiled/punycode/punycode.js|process=|/opt/canhelp/node_modules/next/dist/build/polyfills/process.js|querystring=|/opt/canhelp/node_modules/next/dist/compiled/querystring-es3/index.js|stream=|/opt/canhelp/node_modules/next/dist/compiled/stream-browserify/index.js|string_decoder=|/opt/canhelp/node_modules/next/dist/compiled/string_decoder/string_decoder.js|sys=|/opt/canhelp/node_modules/next/dist/compiled/util/util.js|timers=|/opt/canhelp/node_modules/next/dist/compiled/timers-browserify/main.js|tty=|/opt/canhelp/node_modules/next/dist/compiled/tty-browserify/index.js|util=|/opt/canhelp/node_modules/next/dist/compiled/util/util.js|vm=|/opt/canhelp/node_modules/next/dist/compiled/vm-browserify/index.js|zlib=|/opt/canhelp/node_modules/next/dist/compiled/browserify-zlib/index.js|events=|/opt/canhelp/node_modules/next/dist/compiled/events/events.js|setImmediate=|/opt/canhelp/node_modules/next/dist/compiled/setimmediate/setImmediate.js|]|dependencyType=|esm|path=|/opt/canhelp/apps/web|request=|/opt/canhelp/apps/web/src/app/notifications/page.tsxß ResolverCachePlugin|normal|default|alias=[|server-only$=|next/dist/compiled/server-only/index|client-only$=|next/dist/compiled/client-only/index|next/dist/compiled/client-only$=|next/dist/compiled/client-only/index|next/dist/compiled/server-only=|next/dist/compiled/server-only/index|/opt/canhelp/node_modules/next/head.js=|next/dist/client/components/noop-head|/opt/canhelp/node_modules/next/image.js=|next/dist/api/image|/opt/canhelp/node_modules/next/constants.js=|next/dist/api/constants|/opt/canhelp/node_modules/next/router.js=|next/dist/api/router|/opt/canhelp/node_modules/next/dynamic.js=|next/dist/api/app-dynamic|/opt/canhelp/node_modules/next/script.js=|next/dist/api/script|/opt/canhelp/node_modules/next/link.js=|next/dist/client/app-dir/link|/opt/canhelp/node_modules/next/form.js=|next/dist/client/app-dir/form|/opt/canhelp/node_modules/next/navigation.js=|next/dist/api/navigation|/opt/canhelp/node_modules/next/headers.js=|next/dist/api/headers|/opt/canhelp/node_modules/next/og.js=|next/dist/api/og|/opt/canhelp/node_modules/next/server.js=|next/dist/api/server|/opt/canhelp/node_modules/next/document.js=|next/dist/api/document|/opt/canhelp/node_modules/next/app.js=|next/dist/api/app|next=|/opt/canhelp/node_modules/next|]|fallback=[|assert=|/opt/canhelp/node_modules/next/dist/compiled/assert/assert.js|buffer=|/opt/canhelp/node_modules/next/dist/compiled/buffer/index.js|constants=|/opt/canhelp/node_modules/next/dist/compiled/constants-browserify/constants.json|crypto=|/opt/canhelp/node_modules/next/dist/compiled/crypto-browserify/index.js|domain=|/opt/canhelp/node_modules/next/dist/compiled/domain-browser/index.js|http=|/opt/canhelp/node_modules/next/dist/compiled/stream-http/index.js|https=|/opt/canhelp/node_modules/next/dist/compiled/https-browserify/index.js|os=|/opt/canhelp/node_modules/next/dist/compiled/os-browserify/browser.js|path=|/opt/canhelp/node_modules/next/dist/compiled/path-browserify/index.js|punycode=|/opt/canhelp/node_modules/next/dist/compiled/punycode/punycode.js|process=|/opt/canhelp/node_modules/next/dist/build/polyfills/process.js|querystring=|/opt/canhelp/node_modules/next/dist/compiled/querystring-es3/index.js|stream=|/opt/canhelp/node_modules/next/dist/compiled/stream-browserify/index.js|string_decoder=|/opt/canhelp/node_modules/next/dist/compiled/string_decoder/string_decoder.js|sys=|/opt/canhelp/node_modules/next/dist/compiled/util/util.js|timers=|/opt/canhelp/node_modules/next/dist/compiled/timers-browserify/main.js|tty=|/opt/canhelp/node_modules/next/dist/compiled/tty-browserify/index.js|util=|/opt/canhelp/node_modules/next/dist/compiled/util/util.js|vm=|/opt/canhelp/node_modules/next/dist/compiled/vm-browserify/index.js|zlib=|/opt/canhelp/node_modules/next/dist/compiled/browserify-zlib/index.js|events=|/opt/canhelp/node_modules/next/dist/compiled/events/events.js|setImmediate=|/opt/canhelp/node_modules/next/dist/compiled/setimmediate/setImmediate.js|]|dependencyType=|esm|path=|/opt/canhelp/apps/web|request=|/opt/canhelp/apps/web/src/app/pricing/page.tsxÝ ResolverCachePlugin|normal|default|alias=[|server-only$=|next/dist/compiled/server-only/index|client-only$=|next/dist/compiled/client-only/index|next/dist/compiled/client-only$=|next/dist/compiled/client-only/index|next/dist/compiled/server-only=|next/dist/compiled/server-only/index|/opt/canhelp/node_modules/next/head.js=|next/dist/client/components/noop-head|/opt/canhelp/node_modules/next/image.js=|next/dist/api/image|/opt/canhelp/node_modules/next/constants.js=|next/dist/api/constants|/opt/canhelp/node_modules/next/router.js=|next/dist/api/router|/opt/canhelp/node_modules/next/dynamic.js=|next/dist/api/app-dynamic|/opt/canhelp/node_modules/next/script.js=|next/dist/api/script|/opt/canhelp/node_modules/next/link.js=|next/dist/client/app-dir/link|/opt/canhelp/node_modules/next/form.js=|next/dist/client/app-dir/form|/opt/canhelp/node_modules/next/navigation.js=|next/dist/api/navigation|/opt/canhelp/node_modules/next/headers.js=|next/dist/api/headers|/opt/canhelp/node_modules/next/og.js=|next/dist/api/og|/opt/canhelp/node_modules/next/server.js=|next/dist/api/server|/opt/canhelp/node_modules/next/document.js=|next/dist/api/document|/opt/canhelp/node_modules/next/app.js=|next/dist/api/app|next=|/opt/canhelp/node_modules/next|]|fallback=[|assert=|/opt/canhelp/node_modules/next/dist/compiled/assert/assert.js|buffer=|/opt/canhelp/node_modules/next/dist/compiled/buffer/index.js|constants=|/opt/canhelp/node_modules/next/dist/compiled/constants-browserify/constants.json|crypto=|/opt/canhelp/node_modules/next/dist/compiled/crypto-browserify/index.js|domain=|/opt/canhelp/node_modules/next/dist/compiled/domain-browser/index.js|http=|/opt/canhelp/node_modules/next/dist/compiled/stream-http/index.js|https=|/opt/canhelp/node_modules/next/dist/compiled/https-browserify/index.js|os=|/opt/canhelp/node_modules/next/dist/compiled/os-browserify/browser.js|path=|/opt/canhelp/node_modules/next/dist/compiled/path-browserify/index.js|punycode=|/opt/canhelp/node_modules/next/dist/compiled/punycode/punycode.js|process=|/opt/canhelp/node_modules/next/dist/build/polyfills/process.js|querystring=|/opt/canhelp/node_modules/next/dist/compiled/querystring-es3/index.js|stream=|/opt/canhelp/node_modules/next/dist/compiled/stream-browserify/index.js|string_decoder=|/opt/canhelp/node_modules/next/dist/compiled/string_decoder/string_decoder.js|sys=|/opt/canhelp/node_modules/next/dist/compiled/util/util.js|timers=|/opt/canhelp/node_modules/next/dist/compiled/timers-browserify/main.js|tty=|/opt/canhelp/node_modules/next/dist/compiled/tty-browserify/index.js|util=|/opt/canhelp/node_modules/next/dist/compiled/util/util.js|vm=|/opt/canhelp/node_modules/next/dist/compiled/vm-browserify/index.js|zlib=|/opt/canhelp/node_modules/next/dist/compiled/browserify-zlib/index.js|events=|/opt/canhelp/node_modules/next/dist/compiled/events/events.js|setImmediate=|/opt/canhelp/node_modules/next/dist/compiled/setimmediate/setImmediate.js|]|dependencyType=|esm|path=|/opt/canhelp/apps/web|request=|/opt/canhelp/apps/web/src/app/admin/page.tsxè ResolverCachePlugin|normal|default|alias=[|server-only$=|next/dist/compiled/server-only/index|client-only$=|next/dist/compiled/client-only/index|next/dist/compiled/client-only$=|next/dist/compiled/client-only/index|next/dist/compiled/server-only=|next/dist/compiled/server-only/index|/opt/canhelp/node_modules/next/head.js=|next/dist/client/components/noop-head|/opt/canhelp/node_modules/next/image.js=|next/dist/api/image|/opt/canhelp/node_modules/next/constants.js=|next/dist/api/constants|/opt/canhelp/node_modules/next/router.js=|next/dist/api/router|/opt/canhelp/node_modules/next/dynamic.js=|next/dist/api/app-dynamic|/opt/canhelp/node_modules/next/script.js=|next/dist/api/script|/opt/canhelp/node_modules/next/link.js=|next/dist/client/app-dir/link|/opt/canhelp/node_modules/next/form.js=|next/dist/client/app-dir/form|/opt/canhelp/node_modules/next/navigation.js=|next/dist/api/navigation|/opt/canhelp/node_modules/next/headers.js=|next/dist/api/headers|/opt/canhelp/node_modules/next/og.js=|next/dist/api/og|/opt/canhelp/node_modules/next/server.js=|next/dist/api/server|/opt/canhelp/node_modules/next/document.js=|next/dist/api/document|/opt/canhelp/node_modules/next/app.js=|next/dist/api/app|next=|/opt/canhelp/node_modules/next|]|fallback=[|assert=|/opt/canhelp/node_modules/next/dist/compiled/assert/assert.js|buffer=|/opt/canhelp/node_modules/next/dist/compiled/buffer/index.js|constants=|/opt/canhelp/node_modules/next/dist/compiled/constants-browserify/constants.json|crypto=|/opt/canhelp/node_modules/next/dist/compiled/crypto-browserify/index.js|domain=|/opt/canhelp/node_modules/next/dist/compiled/domain-browser/index.js|http=|/opt/canhelp/node_modules/next/dist/compiled/stream-http/index.js|https=|/opt/canhelp/node_modules/next/dist/compiled/https-browserify/index.js|os=|/opt/canhelp/node_modules/next/dist/compiled/os-browserify/browser.js|path=|/opt/canhelp/node_modules/next/dist/compiled/path-browserify/index.js|punycode=|/opt/canhelp/node_modules/next/dist/compiled/punycode/punycode.js|process=|/opt/canhelp/node_modules/next/dist/build/polyfills/process.js|querystring=|/opt/canhelp/node_modules/next/dist/compiled/querystring-es3/index.js|stream=|/opt/canhelp/node_modules/next/dist/compiled/stream-browserify/index.js|string_decoder=|/opt/canhelp/node_modules/next/dist/compiled/string_decoder/string_decoder.js|sys=|/opt/canhelp/node_modules/next/dist/compiled/util/util.js|timers=|/opt/canhelp/node_modules/next/dist/compiled/timers-browserify/main.js|tty=|/opt/canhelp/node_modules/next/dist/compiled/tty-browserify/index.js|util=|/opt/canhelp/node_modules/next/dist/compiled/util/util.js|vm=|/opt/canhelp/node_modules/next/dist/compiled/vm-browserify/index.js|zlib=|/opt/canhelp/node_modules/next/dist/compiled/browserify-zlib/index.js|events=|/opt/canhelp/node_modules/next/dist/compiled/events/events.js|setImmediate=|/opt/canhelp/node_modules/next/dist/compiled/setimmediate/setImmediate.js|]|dependencyType=|esm|path=|/opt/canhelp/apps/web|request=|/opt/canhelp/apps/web/src/app/tasks/[id]/offer/page.tsxî ResolverCachePlugin|normal|default|alias=[|server-only$=|next/dist/compiled/server-only/index|client-only$=|next/dist/compiled/client-only/index|next/dist/compiled/client-only$=|next/dist/compiled/client-only/index|next/dist/compiled/server-only=|next/dist/compiled/server-only/index|/opt/canhelp/node_modules/next/head.js=|next/dist/client/components/noop-head|/opt/canhelp/node_modules/next/image.js=|next/dist/api/image|/opt/canhelp/node_modules/next/constants.js=|next/dist/api/constants|/opt/canhelp/node_modules/next/router.js=|next/dist/api/router|/opt/canhelp/node_modules/next/dynamic.js=|next/dist/api/app-dynamic|/opt/canhelp/node_modules/next/script.js=|next/dist/api/script|/opt/canhelp/node_modules/next/link.js=|next/dist/client/app-dir/link|/opt/canhelp/node_modules/next/form.js=|next/dist/client/app-dir/form|/opt/canhelp/node_modules/next/navigation.js=|next/dist/api/navigation|/opt/canhelp/node_modules/next/headers.js=|next/dist/api/headers|/opt/canhelp/node_modules/next/og.js=|next/dist/api/og|/opt/canhelp/node_modules/next/server.js=|next/dist/api/server|/opt/canhelp/node_modules/next/document.js=|next/dist/api/document|/opt/canhelp/node_modules/next/app.js=|next/dist/api/app|next=|/opt/canhelp/node_modules/next|]|fallback=[|assert=|/opt/canhelp/node_modules/next/dist/compiled/assert/assert.js|buffer=|/opt/canhelp/node_modules/next/dist/compiled/buffer/index.js|constants=|/opt/canhelp/node_modules/next/dist/compiled/constants-browserify/constants.json|crypto=|/opt/canhelp/node_modules/next/dist/compiled/crypto-browserify/index.js|domain=|/opt/canhelp/node_modules/next/dist/compiled/domain-browser/index.js|http=|/opt/canhelp/node_modules/next/dist/compiled/stream-http/index.js|https=|/opt/canhelp/node_modules/next/dist/compiled/https-browserify/index.js|os=|/opt/canhelp/node_modules/next/dist/compiled/os-browserify/browser.js|path=|/opt/canhelp/node_modules/next/dist/compiled/path-browserify/index.js|punycode=|/opt/canhelp/node_modules/next/dist/compiled/punycode/punycode.js|process=|/opt/canhelp/node_modules/next/dist/build/polyfills/process.js|querystring=|/opt/canhelp/node_modules/next/dist/compiled/querystring-es3/index.js|stream=|/opt/canhelp/node_modules/next/dist/compiled/stream-browserify/index.js|string_decoder=|/opt/canhelp/node_modules/next/dist/compiled/string_decoder/string_decoder.js|sys=|/opt/canhelp/node_modules/next/dist/compiled/util/util.js|timers=|/opt/canhelp/node_modules/next/dist/compiled/timers-browserify/main.js|tty=|/opt/canhelp/node_modules/next/dist/compiled/tty-browserify/index.js|util=|/opt/canhelp/node_modules/next/dist/compiled/util/util.js|vm=|/opt/canhelp/node_modules/next/dist/compiled/vm-browserify/index.js|zlib=|/opt/canhelp/node_modules/next/dist/compiled/browserify-zlib/index.js|events=|/opt/canhelp/node_modules/next/dist/compiled/events/events.js|setImmediate=|/opt/canhelp/node_modules/next/dist/compiled/setimmediate/setImmediate.js|]|dependencyType=|esm|path=|/opt/canhelp/apps/web|request=|/opt/canhelp/apps/web/src/app/tasks/[id]/TaskDetailClient.tsxâ ResolverCachePlugin|normal|default|alias=[|server-only$=|next/dist/compiled/server-only/index|client-only$=|next/dist/compiled/client-only/index|next/dist/compiled/client-only$=|next/dist/compiled/client-only/index|next/dist/compiled/server-only=|next/dist/compiled/server-only/index|/opt/canhelp/node_modules/next/head.js=|next/dist/client/components/noop-head|/opt/canhelp/node_modules/next/image.js=|next/dist/api/image|/opt/canhelp/node_modules/next/constants.js=|next/dist/api/constants|/opt/canhelp/node_modules/next/router.js=|next/dist/api/router|/opt/canhelp/node_modules/next/dynamic.js=|next/dist/api/app-dynamic|/opt/canhelp/node_modules/next/script.js=|next/dist/api/script|/opt/canhelp/node_modules/next/link.js=|next/dist/client/app-dir/link|/opt/canhelp/node_modules/next/form.js=|next/dist/client/app-dir/form|/opt/canhelp/node_modules/next/navigation.js=|next/dist/api/navigation|/opt/canhelp/node_modules/next/headers.js=|next/dist/api/headers|/opt/canhelp/node_modules/next/og.js=|next/dist/api/og|/opt/canhelp/node_modules/next/server.js=|next/dist/api/server|/opt/canhelp/node_modules/next/document.js=|next/dist/api/document|/opt/canhelp/node_modules/next/app.js=|next/dist/api/app|next=|/opt/canhelp/node_modules/next|]|fallback=[|assert=|/opt/canhelp/node_modules/next/dist/compiled/assert/assert.js|buffer=|/opt/canhelp/node_modules/next/dist/compiled/buffer/index.js|constants=|/opt/canhelp/node_modules/next/dist/compiled/constants-browserify/constants.json|crypto=|/opt/canhelp/node_modules/next/dist/compiled/crypto-browserify/index.js|domain=|/opt/canhelp/node_modules/next/dist/compiled/domain-browser/index.js|http=|/opt/canhelp/node_modules/next/dist/compiled/stream-http/index.js|https=|/opt/canhelp/node_modules/next/dist/compiled/https-browserify/index.js|os=|/opt/canhelp/node_modules/next/dist/compiled/os-browserify/browser.js|path=|/opt/canhelp/node_modules/next/dist/compiled/path-browserify/index.js|punycode=|/opt/canhelp/node_modules/next/dist/compiled/punycode/punycode.js|process=|/opt/canhelp/node_modules/next/dist/build/polyfills/process.js|querystring=|/opt/canhelp/node_modules/next/dist/compiled/querystring-es3/index.js|stream=|/opt/canhelp/node_modules/next/dist/compiled/stream-browserify/index.js|string_decoder=|/opt/canhelp/node_modules/next/dist/compiled/string_decoder/string_decoder.js|sys=|/opt/canhelp/node_modules/next/dist/compiled/util/util.js|timers=|/opt/canhelp/node_modules/next/dist/compiled/timers-browserify/main.js|tty=|/opt/canhelp/node_modules/next/dist/compiled/tty-browserify/index.js|util=|/opt/canhelp/node_modules/next/dist/compiled/util/util.js|vm=|/opt/canhelp/node_modules/next/dist/compiled/vm-browserify/index.js|zlib=|/opt/canhelp/node_modules/next/dist/compiled/browserify-zlib/index.js|events=|/opt/canhelp/node_modules/next/dist/compiled/events/events.js|setImmediate=|/opt/canhelp/node_modules/next/dist/compiled/setimmediate/setImmediate.js|]|dependencyType=|esm|path=|/opt/canhelp/apps/web|request=|/opt/canhelp/apps/web/src/app/users/[id]/page.tsxß ResolverCachePlugin|normal|default|alias=[|server-only$=|next/dist/compiled/server-only/index|client-only$=|next/dist/compiled/client-only/index|next/dist/compiled/client-only$=|next/dist/compiled/client-only/index|next/dist/compiled/server-only=|next/dist/compiled/server-only/index|/opt/canhelp/node_modules/next/head.js=|next/dist/client/components/noop-head|/opt/canhelp/node_modules/next/image.js=|next/dist/api/image|/opt/canhelp/node_modules/next/constants.js=|next/dist/api/constants|/opt/canhelp/node_modules/next/router.js=|next/dist/api/router|/opt/canhelp/node_modules/next/dynamic.js=|next/dist/api/app-dynamic|/opt/canhelp/node_modules/next/script.js=|next/dist/api/script|/opt/canhelp/node_modules/next/link.js=|next/dist/client/app-dir/link|/opt/canhelp/node_modules/next/form.js=|next/dist/client/app-dir/form|/opt/canhelp/node_modules/next/navigation.js=|next/dist/api/navigation|/opt/canhelp/node_modules/next/headers.js=|next/dist/api/headers|/opt/canhelp/node_modules/next/og.js=|next/dist/api/og|/opt/canhelp/node_modules/next/server.js=|next/dist/api/server|/opt/canhelp/node_modules/next/document.js=|next/dist/api/document|/opt/canhelp/node_modules/next/app.js=|next/dist/api/app|next=|/opt/canhelp/node_modules/next|]|fallback=[|assert=|/opt/canhelp/node_modules/next/dist/compiled/assert/assert.js|buffer=|/opt/canhelp/node_modules/next/dist/compiled/buffer/index.js|constants=|/opt/canhelp/node_modules/next/dist/compiled/constants-browserify/constants.json|crypto=|/opt/canhelp/node_modules/next/dist/compiled/crypto-browserify/index.js|domain=|/opt/canhelp/node_modules/next/dist/compiled/domain-browser/index.js|http=|/opt/canhelp/node_modules/next/dist/compiled/stream-http/index.js|https=|/opt/canhelp/node_modules/next/dist/compiled/https-browserify/index.js|os=|/opt/canhelp/node_modules/next/dist/compiled/os-browserify/browser.js|path=|/opt/canhelp/node_modules/next/dist/compiled/path-browserify/index.js|punycode=|/opt/canhelp/node_modules/next/dist/compiled/punycode/punycode.js|process=|/opt/canhelp/node_modules/next/dist/build/polyfills/process.js|querystring=|/opt/canhelp/node_modules/next/dist/compiled/querystring-es3/index.js|stream=|/opt/canhelp/node_modules/next/dist/compiled/stream-browserify/index.js|string_decoder=|/opt/canhelp/node_modules/next/dist/compiled/string_decoder/string_decoder.js|sys=|/opt/canhelp/node_modules/next/dist/compiled/util/util.js|timers=|/opt/canhelp/node_modules/next/dist/compiled/timers-browserify/main.js|tty=|/opt/canhelp/node_modules/next/dist/compiled/tty-browserify/index.js|util=|/opt/canhelp/node_modules/next/dist/compiled/util/util.js|vm=|/opt/canhelp/node_modules/next/dist/compiled/vm-browserify/index.js|zlib=|/opt/canhelp/node_modules/next/dist/compiled/browserify-zlib/index.js|events=|/opt/canhelp/node_modules/next/dist/compiled/events/events.js|setImmediate=|/opt/canhelp/node_modules/next/dist/compiled/setimmediate/setImmediate.js|]|dependencyType=|esm|path=|/opt/canhelp/apps/web|request=|/opt/canhelp/apps/web/src/app/profile/page.tsxã ResolverCachePlugin|normal|default|alias=[|server-only$=|next/dist/compiled/server-only/index|client-only$=|next/dist/compiled/client-only/index|next/dist/compiled/client-only$=|next/dist/compiled/client-only/index|next/dist/compiled/server-only=|next/dist/compiled/server-only/index|/opt/canhelp/node_modules/next/head.js=|next/dist/client/components/noop-head|/opt/canhelp/node_modules/next/image.js=|next/dist/api/image|/opt/canhelp/node_modules/next/constants.js=|next/dist/api/constants|/opt/canhelp/node_modules/next/router.js=|next/dist/api/router|/opt/canhelp/node_modules/next/dynamic.js=|next/dist/api/app-dynamic|/opt/canhelp/node_modules/next/script.js=|next/dist/api/script|/opt/canhelp/node_modules/next/link.js=|next/dist/client/app-dir/link|/opt/canhelp/node_modules/next/form.js=|next/dist/client/app-dir/form|/opt/canhelp/node_modules/next/navigation.js=|next/dist/api/navigation|/opt/canhelp/node_modules/next/headers.js=|next/dist/api/headers|/opt/canhelp/node_modules/next/og.js=|next/dist/api/og|/opt/canhelp/node_modules/next/server.js=|next/dist/api/server|/opt/canhelp/node_modules/next/document.js=|next/dist/api/document|/opt/canhelp/node_modules/next/app.js=|next/dist/api/app|next=|/opt/canhelp/node_modules/next|]|fallback=[|assert=|/opt/canhelp/node_modules/next/dist/compiled/assert/assert.js|buffer=|/opt/canhelp/node_modules/next/dist/compiled/buffer/index.js|constants=|/opt/canhelp/node_modules/next/dist/compiled/constants-browserify/constants.json|crypto=|/opt/canhelp/node_modules/next/dist/compiled/crypto-browserify/index.js|domain=|/opt/canhelp/node_modules/next/dist/compiled/domain-browser/index.js|http=|/opt/canhelp/node_modules/next/dist/compiled/stream-http/index.js|https=|/opt/canhelp/node_modules/next/dist/compiled/https-browserify/index.js|os=|/opt/canhelp/node_modules/next/dist/compiled/os-browserify/browser.js|path=|/opt/canhelp/node_modules/next/dist/compiled/path-browserify/index.js|punycode=|/opt/canhelp/node_modules/next/dist/compiled/punycode/punycode.js|process=|/opt/canhelp/node_modules/next/dist/build/polyfills/process.js|querystring=|/opt/canhelp/node_modules/next/dist/compiled/querystring-es3/index.js|stream=|/opt/canhelp/node_modules/next/dist/compiled/stream-browserify/index.js|string_decoder=|/opt/canhelp/node_modules/next/dist/compiled/string_decoder/string_decoder.js|sys=|/opt/canhelp/node_modules/next/dist/compiled/util/util.js|timers=|/opt/canhelp/node_modules/next/dist/compiled/timers-browserify/main.js|tty=|/opt/canhelp/node_modules/next/dist/compiled/tty-browserify/index.js|util=|/opt/canhelp/node_modules/next/dist/compiled/util/util.js|vm=|/opt/canhelp/node_modules/next/dist/compiled/vm-browserify/index.js|zlib=|/opt/canhelp/node_modules/next/dist/compiled/browserify-zlib/index.js|events=|/opt/canhelp/node_modules/next/dist/compiled/events/events.js|setImmediate=|/opt/canhelp/node_modules/next/dist/compiled/setimmediate/setImmediate.js|]|dependencyType=|esm|path=|/opt/canhelp/apps/web|request=|/opt/canhelp/apps/web/src/app/site/[slug]/page.tsxACompilation/modules|javascript/auto|/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-flight-client-module-loader.js!/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-swc-loader.js??ruleSet[1].rules[16].oneOf[6].use[1]!/opt/canhelp/apps/web/src/components/ScrollToTopButton.tsx|app-pages-browser2Compilation/modules|javascript/auto|/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-flight-client-module-loader.js!/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-swc-loader.js??ruleSet[1].rules[16].oneOf[6].use[1]!/opt/canhelp/apps/web/src/app/chat/page.tsx|app-pages-browser7Compilation/modules|javascript/auto|/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-flight-client-module-loader.js!/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-swc-loader.js??ruleSet[1].rules[16].oneOf[6].use[1]!/opt/canhelp/apps/web/src/app/dashboard/page.tsx|app-pages-browser;Compilation/modules|javascript/auto|/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-flight-client-module-loader.js!/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-swc-loader.js??ruleSet[1].rules[16].oneOf[6].use[1]!/opt/canhelp/apps/web/src/app/notifications/page.tsx|app-pages-browser5Compilation/modules|javascript/auto|/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-flight-client-module-loader.js!/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-swc-loader.js??ruleSet[1].rules[16].oneOf[6].use[1]!/opt/canhelp/apps/web/src/app/pricing/page.tsx|app-pages-browser3Compilation/modules|javascript/auto|/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-flight-client-module-loader.js!/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-swc-loader.js??ruleSet[1].rules[16].oneOf[6].use[1]!/opt/canhelp/apps/web/src/app/admin/page.tsx|app-pages-browser>Compilation/modules|javascript/auto|/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-flight-client-module-loader.js!/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-swc-loader.js??ruleSet[1].rules[16].oneOf[6].use[1]!/opt/canhelp/apps/web/src/app/tasks/[id]/offer/page.tsx|app-pages-browserDCompilation/modules|javascript/auto|/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-flight-client-module-loader.js!/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-swc-loader.js??ruleSet[1].rules[16].oneOf[6].use[1]!/opt/canhelp/apps/web/src/app/tasks/[id]/TaskDetailClient.tsx|app-pages-browser8Compilation/modules|javascript/auto|/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-flight-client-module-loader.js!/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-swc-loader.js??ruleSet[1].rules[16].oneOf[6].use[1]!/opt/canhelp/apps/web/src/app/users/[id]/page.tsx|app-pages-browser5Compilation/modules|javascript/auto|/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-flight-client-module-loader.js!/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-swc-loader.js??ruleSet[1].rules[16].oneOf[6].use[1]!/opt/canhelp/apps/web/src/app/profile/page.tsx|app-pages-browser9Compilation/modules|javascript/auto|/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-flight-client-module-loader.js!/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-swc-loader.js??ruleSet[1].rules[16].oneOf[6].use[1]!/opt/canhelp/apps/web/src/app/site/[slug]/page.tsx|app-pages-browserÈResolverCachePlugin|normal|default|alias=[|server-only$=|next/dist/compiled/server-only/index|client-only$=|next/dist/compiled/client-only/index|next/dist/compiled/client-only$=|next/dist/compiled/client-only/index|next/dist/compiled/server-only=|next/dist/compiled/server-only/index|/opt/canhelp/node_modules/next/head.js=|next/dist/client/components/noop-head|/opt/canhelp/node_modules/next/image.js=|next/dist/api/image|/opt/canhelp/node_modules/next/constants.js=|next/dist/api/constants|/opt/canhelp/node_modules/next/router.js=|next/dist/api/router|/opt/canhelp/node_modules/next/dynamic.js=|next/dist/api/app-dynamic|/opt/canhelp/node_modules/next/script.js=|next/dist/api/script|/opt/canhelp/node_modules/next/link.js=|next/dist/client/app-dir/link|/opt/canhelp/node_modules/next/form.js=|next/dist/client/app-dir/form|/opt/canhelp/node_modules/next/navigation.js=|next/dist/api/navigation|/opt/canhelp/node_modules/next/headers.js=|next/dist/api/headers|/opt/canhelp/node_modules/next/og.js=|next/dist/api/og|/opt/canhelp/node_modules/next/server.js=|next/dist/api/server|/opt/canhelp/node_modules/next/document.js=|next/dist/api/document|/opt/canhelp/node_modules/next/app.js=|next/dist/api/app|react$=|next/dist/compiled/react|react/compiler-runtime$=|next/dist/compiled/react/compiler-runtime|react/jsx-dev-runtime$=|next/dist/compiled/react/jsx-dev-runtime|react/jsx-runtime$=|next/dist/compiled/react/jsx-runtime|react-dom$=|next/dist/compiled/react-dom|react-dom/client$=|next/dist/compiled/react-dom/client|react-dom/server$=|next/dist/compiled/react-dom/server.browser|react-dom/server.browser$=|next/dist/compiled/react-dom/server.browser|react-dom/server.edge$=|next/dist/build/webpack/alias/react-dom-server.js|react-dom/static$=|next/dist/compiled/react-dom/static.browser|react-dom/static.browser$=|next/dist/compiled/react-dom/static.browser|react-dom/static.edge$=|next/dist/compiled/react-dom/static.edge|react-server-dom-webpack/client$=|next/dist/compiled/react-server-dom-webpack/client.browser|react-server-dom-webpack/server$=|next/dist/compiled/react-server-dom-webpack/server.browser|react-server-dom-webpack/server.node$=|next/dist/compiled/react-server-dom-webpack/server.node|react-server-dom-webpack/static$=|next/dist/compiled/react-server-dom-webpack/static.browser|@vercel/turbopack-ecmascript-runtime/browser/dev/hmr-client/hmr-client.ts=|next/dist/client/dev/noop-turbopack-hmr|next=|/opt/canhelp/node_modules/next|]|mainFields=[|0=|browser|1=|module|2=|main|]|fallback=[|assert=|/opt/canhelp/node_modules/next/dist/compiled/assert/assert.js|buffer=|/opt/canhelp/node_modules/next/dist/compiled/buffer/index.js|constants=|/opt/canhelp/node_modules/next/dist/compiled/constants-browserify/constants.json|crypto=|/opt/canhelp/node_modules/next/dist/compiled/crypto-browserify/index.js|domain=|/opt/canhelp/node_modules/next/dist/compiled/domain-browser/index.js|http=|/opt/canhelp/node_modules/next/dist/compiled/stream-http/index.js|https=|/opt/canhelp/node_modules/next/dist/compiled/https-browserify/index.js|os=|/opt/canhelp/node_modules/next/dist/compiled/os-browserify/browser.js|path=|/opt/canhelp/node_modules/next/dist/compiled/path-browserify/index.js|punycode=|/opt/canhelp/node_modules/next/dist/compiled/punycode/punycode.js|process=|/opt/canhelp/node_modules/next/dist/build/polyfills/process.js|querystring=|/opt/canhelp/node_modules/next/dist/compiled/querystring-es3/index.js|stream=|/opt/canhelp/node_modules/next/dist/compiled/stream-browserify/index.js|string_decoder=|/opt/canhelp/node_modules/next/dist/compiled/string_decoder/string_decoder.js|sys=|/opt/canhelp/node_modules/next/dist/compiled/util/util.js|timers=|/opt/canhelp/node_modules/next/dist/compiled/timers-browserify/main.js|tty=|/opt/canhelp/node_modules/next/dist/compiled/tty-browserify/index.js|util=|/opt/canhelp/node_modules/next/dist/compiled/util/util.js|vm=|/opt/canhelp/node_modules/next/dist/compiled/vm-browserify/index.js|zlib=|/opt/canhelp/node_modules/next/dist/compiled/browserify-zlib/index.js|events=|/opt/canhelp/node_modules/next/dist/compiled/events/events.js|setImmediate=|/opt/canhelp/node_modules/next/dist/compiled/setimmediate/setImmediate.js|]|dependencyType=|esm|path=|/opt/canhelp/apps/web/src/app/users/[id]|request=|@/components/UpgradePrompt=Compilation/modules|javascript/auto|/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-flight-client-module-loader.js!/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-swc-loader.js??ruleSet[1].rules[16].oneOf[6].use[1]!/opt/canhelp/apps/web/src/components/UpgradePrompt.tsx|app-pages-browserIFlagDependencyExportsPlugin|javascript/auto|/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-flight-client-module-loader.js!/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-swc-loader.js??ruleSet[1].rules[16].oneOf[6].use[1]!/opt/canhelp/apps/web/src/components/ScrollToTopButton.tsx|app-pages-browser:FlagDependencyExportsPlugin|javascript/auto|/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-flight-client-module-loader.js!/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-swc-loader.js??ruleSet[1].rules[16].oneOf[6].use[1]!/opt/canhelp/apps/web/src/app/chat/page.tsx|app-pages-browser?FlagDependencyExportsPlugin|javascript/auto|/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-flight-client-module-loader.js!/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-swc-loader.js??ruleSet[1].rules[16].oneOf[6].use[1]!/opt/canhelp/apps/web/src/app/dashboard/page.tsx|app-pages-browserCFlagDependencyExportsPlugin|javascript/auto|/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-flight-client-module-loader.js!/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-swc-loader.js??ruleSet[1].rules[16].oneOf[6].use[1]!/opt/canhelp/apps/web/src/app/notifications/page.tsx|app-pages-browser=FlagDependencyExportsPlugin|javascript/auto|/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-flight-client-module-loader.js!/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-swc-loader.js??ruleSet[1].rules[16].oneOf[6].use[1]!/opt/canhelp/apps/web/src/app/pricing/page.tsx|app-pages-browser;FlagDependencyExportsPlugin|javascript/auto|/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-flight-client-module-loader.js!/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-swc-loader.js??ruleSet[1].rules[16].oneOf[6].use[1]!/opt/canhelp/apps/web/src/app/admin/page.tsx|app-pages-browserFFlagDependencyExportsPlugin|javascript/auto|/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-flight-client-module-loader.js!/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-swc-loader.js??ruleSet[1].rules[16].oneOf[6].use[1]!/opt/canhelp/apps/web/src/app/tasks/[id]/offer/page.tsx|app-pages-browserLFlagDependencyExportsPlugin|javascript/auto|/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-flight-client-module-loader.js!/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-swc-loader.js??ruleSet[1].rules[16].oneOf[6].use[1]!/opt/canhelp/apps/web/src/app/tasks/[id]/TaskDetailClient.tsx|app-pages-browser@FlagDependencyExportsPlugin|javascript/auto|/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-flight-client-module-loader.js!/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-swc-loader.js??ruleSet[1].rules[16].oneOf[6].use[1]!/opt/canhelp/apps/web/src/app/users/[id]/page.tsx|app-pages-browser=FlagDependencyExportsPlugin|javascript/auto|/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-flight-client-module-loader.js!/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-swc-loader.js??ruleSet[1].rules[16].oneOf[6].use[1]!/opt/canhelp/apps/web/src/app/profile/page.tsx|app-pages-browserAFlagDependencyExportsPlugin|javascript/auto|/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-flight-client-module-loader.js!/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-swc-loader.js??ruleSet[1].rules[16].oneOf[6].use[1]!/opt/canhelp/apps/web/src/app/site/[slug]/page.tsx|app-pages-browserEFlagDependencyExportsPlugin|javascript/auto|/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-flight-client-module-loader.js!/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-swc-loader.js??ruleSet[1].rules[16].oneOf[6].use[1]!/opt/canhelp/apps/web/src/components/UpgradePrompt.tsx|app-pages-browserPCompilation/codeGeneration|javascript/auto|/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-flight-client-module-loader.js!/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-swc-loader.js??ruleSet[1].rules[16].oneOf[6].use[1]!/opt/canhelp/apps/web/src/components/ScrollToTopButton.tsx|app-pages-browser|webpackACompilation/codeGeneration|javascript/auto|/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-flight-client-module-loader.js!/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-swc-loader.js??ruleSet[1].rules[16].oneOf[6].use[1]!/opt/canhelp/apps/web/src/app/chat/page.tsx|app-pages-browser|webpackJCompilation/codeGeneration|javascript/auto|/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-flight-client-module-loader.js!/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-swc-loader.js??ruleSet[1].rules[16].oneOf[6].use[1]!/opt/canhelp/apps/web/src/app/notifications/page.tsx|app-pages-browser|webpackDCompilation/codeGeneration|javascript/auto|/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-flight-client-module-loader.js!/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-swc-loader.js??ruleSet[1].rules[16].oneOf[6].use[1]!/opt/canhelp/apps/web/src/app/pricing/page.tsx|app-pages-browser|webpackBCompilation/codeGeneration|javascript/auto|/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-flight-client-module-loader.js!/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-swc-loader.js??ruleSet[1].rules[16].oneOf[6].use[1]!/opt/canhelp/apps/web/src/app/admin/page.tsx|app-pages-browser|webpackMCompilation/codeGeneration|javascript/auto|/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-flight-client-module-loader.js!/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-swc-loader.js??ruleSet[1].rules[16].oneOf[6].use[1]!/opt/canhelp/apps/web/src/app/tasks/[id]/offer/page.tsx|app-pages-browser|webpackSCompilation/codeGeneration|javascript/auto|/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-flight-client-module-loader.js!/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-swc-loader.js??ruleSet[1].rules[16].oneOf[6].use[1]!/opt/canhelp/apps/web/src/app/tasks/[id]/TaskDetailClient.tsx|app-pages-browser|webpackDCompilation/codeGeneration|javascript/auto|/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-flight-client-module-loader.js!/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-swc-loader.js??ruleSet[1].rules[16].oneOf[6].use[1]!/opt/canhelp/apps/web/src/app/profile/page.tsx|app-pages-browser|webpackHCompilation/codeGeneration|javascript/auto|/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-flight-client-module-loader.js!/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-swc-loader.js??ruleSet[1].rules[16].oneOf[6].use[1]!/opt/canhelp/apps/web/src/app/site/[slug]/page.tsx|app-pages-browser|webpackWCompilation/codeGeneration|javascript/auto|/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-flight-client-module-loader.js!/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-swc-loader.js??ruleSet[1].rules[16].oneOf[6].use[1]!/opt/canhelp/apps/web/src/app/dashboard/page.tsx|app-pages-browser|36340017c5e22458|webpackXCompilation/codeGeneration|javascript/auto|/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-flight-client-module-loader.js!/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-swc-loader.js??ruleSet[1].rules[16].oneOf[6].use[1]!/opt/canhelp/apps/web/src/app/users/[id]/page.tsx|app-pages-browser|9d1cb189ee03921a|webpackœCompilation/assets|chunk7177œCompilation/assets|chunk8457œCompilation/assets|chunk5105œCompilation/assets|chunk6173œCompilation/assets|chunk6907œCompilation/assets|chunk3698œCompilation/assets|chunk2822œCompilation/assets|chunk6043œCompilation/assets|chunk7845œCompilation/assets|chunk6636›Compilation/assets|chunk488ÂMinifierWebpackPlugin|static/chunks/app/layout-5d19d5507a086b82.jsÅMinifierWebpackPlugin|static/chunks/app/chat/page-43739543edf4b221.jsÊMinifierWebpackPlugin|static/chunks/app/dashboard/page-25eb21a8055ce899.jsÎMinifierWebpackPlugin|static/chunks/app/notifications/page-b51c2a43707f3f3f.jsÈMinifierWebpackPlugin|static/chunks/app/pricing/page-ce88e35903daac54.jsÆMinifierWebpackPlugin|static/chunks/app/admin/page-e9ba4ab9642a9ffa.jsÑMinifierWebpackPlugin|static/chunks/app/tasks/[id]/offer/page-42b786154e7e0c1c.jsËMinifierWebpackPlugin|static/chunks/app/tasks/[id]/page-16e7d0631f64efe3.jsËMinifierWebpackPlugin|static/chunks/app/users/[id]/page-24d717eb2b96e533.jsÈMinifierWebpackPlugin|static/chunks/app/profile/page-af705879d5385b42.jsÌMinifierWebpackPlugin|static/chunks/app/site/[slug]/page-75f90b8df6f4a6a6.js²CssMinimizerPlugin|static/css/148c9e5813605805.cssÊRealContentHashPlugin|analyse|static/chunks/app/layout-5d19d5507a086b82.jsÍRealContentHashPlugin|analyse|static/chunks/app/chat/page-43739543edf4b221.jsÒRealContentHashPlugin|analyse|static/chunks/app/dashboard/page-25eb21a8055ce899.jsÖRealContentHashPlugin|analyse|static/chunks/app/notifications/page-b51c2a43707f3f3f.jsÐRealContentHashPlugin|analyse|static/chunks/app/pricing/page-ce88e35903daac54.jsÎRealContentHashPlugin|analyse|static/chunks/app/admin/page-e9ba4ab9642a9ffa.jsÙRealContentHashPlugin|analyse|static/chunks/app/tasks/[id]/offer/page-42b786154e7e0c1c.jsÓRealContentHashPlugin|analyse|static/chunks/app/tasks/[id]/page-16e7d0631f64efe3.jsÓRealContentHashPlugin|analyse|static/chunks/app/users/[id]/page-24d717eb2b96e533.jsÐRealContentHashPlugin|analyse|static/chunks/app/profile/page-af705879d5385b42.jsÔRealContentHashPlugin|analyse|static/chunks/app/site/[slug]/page-75f90b8df6f4a6a6.jsœRealContentHashPlugin|analyse|static/css/148c9e5813605805.css¥webpack/lib/cache/ResolverCachePlugin€€`_ResolverCachePluginCacheMiss‡context„path‡request…queryˆfragment†module‰directory„fileˆinternalŽfullySpecified“descriptionFilePath“descriptionFileData“descriptionFileRootŒrelativePath–__innerRequest_request›__innerRequest_relativePathŽ__innerRequest †issuer‹issuerLayerˆcompiler€‘app-pages-browser†clientº/opt/canhelp/apps/web/src/components/ScrollToTopButton.tsx€€ ¢/opt/canhelp/apps/web/package.json„name‡version‡private‡scriptsŒdependenciesdevDependenciesƒweb…0.1.0 ƒdev…build…start„lint‰typecheck”next dev --port 3000žNODE_ENV=production next buildŠnext start‰next lintŒtsc --noEmit` @canhelp/shared™@marsidev/react-turnstileŽ@types/leaflet‹better-auth‡leafletŠnanostores„next…react‰react-domreact-leaflet•react-leaflet-clustersocket.io-clientƒzod*†^1.5.0‡^1.9.21†^1.2.7†^1.9.4†^1.2.0‡^15.1.6‡^19.0.0ÿ†^5.0.0†^4.1.3†^4.8.1‡^3.24.1‹@types/nodeŒ@types/react@types/react-domŒautoprefixer‡postcss‹tailwindcssŠtypescriptˆ^22.10.7‡^19.0.6‡^19.0.3ˆ^10.4.20†^8.5.1‡^3.4.17†^5.7.3•/opt/canhelp/apps/webŠ./src/components/ScrollToTopButton.tsxÿÿšwebpack/lib/FileSystemInfoˆSnapshot@‰ €•mÿyB»€/opt/canhelp/apps/web/src/componentsˆsafeTime‰timestamp„hash!@=‚mÿyB0=‚mÿyBd4875009579cc90eý¡`Æ/opt/canhelp/apps/web/opt/canhelp/apps/web/src/components/package.json»/opt/canhelp/apps/web/opt/canhelp/apps/web/src/package.json·/opt/canhelp/apps/web/opt/canhelp/apps/web/package.json³/opt/canhelp/apps/web/opt/canhelp/apps/package.json®/opt/canhelp/apps/web/opt/canhelp/package.jsonŠ/opt/canhelp/apps/web/opt/package.jsonÏ/opt/canhelp/apps/web/opt/canhelp/apps/web/src/components/ScrollToTopButton.tsxÒ/opt/canhelp/apps/web/opt/canhelp/apps/web/src/components/ScrollToTopButton.tsx.jsÓ/opt/canhelp/apps/web/opt/canhelp/apps/web/src/components/ScrollToTopButton.tsx.mjsÓ/opt/canhelp/apps/web/opt/canhelp/apps/web/src/components/ScrollToTopButton.tsx.tsxÒ/opt/canhelp/apps/web/opt/canhelp/apps/web/src/components/ScrollToTopButton.tsx.tsÓ/opt/canhelp/apps/web/opt/canhelp/apps/web/src/components/ScrollToTopButton.tsx.jsxÔ/opt/canhelp/apps/web/opt/canhelp/apps/web/src/components/ScrollToTopButton.tsx.jsonÔ/opt/canhelp/apps/web/opt/canhelp/apps/web/src/components/ScrollToTopButton.tsx.wasm±/opt/canhelp/apps/web/src/components/package.jsonŠ/opt/canhelp/apps/web/src/package.json‰€ €•mÿyB¢™/opt/canhelp/apps/web/srcâ‘/opt/canhelp/appsŒ/opt/canhelp„/opt/æ!`–nuþyBP–nuþyBd1168d5d5ce4fcb8äˆã‡â†á…à„߃ˆ Œ€Ž«/opt/canhelp/apps/web/src/app/chat/page.tsx€€ ÏЗ./src/app/chat/page.tsxÿÿ@‰ °˜•mÿyB ýëÎìíî/¢/opt/canhelp/apps/web/src/app/chat/opt/canhelp/apps/web/src/appÓ!À<‚mÿyB°<‚mÿyBe3237a486d412addÑ!`–nuþyBP–nuþyBëÐtÿÿÿÏsÿÿÿÎrÿÿÿÍqÿÿÿÌpÿÿÿËoÿÿÿÊnÿÿÿÉmÿÿÿ Ä/opt/canhelp/apps/web/opt/canhelp/apps/web/src/app/chat/package.json¿/opt/canhelp/apps/web/opt/canhelp/apps/web/src/app/package.jsonÀ/opt/canhelp/apps/web/opt/canhelp/apps/web/src/app/chat/page.tsxÃ/opt/canhelp/apps/web/opt/canhelp/apps/web/src/app/chat/page.tsx.jsÄ/opt/canhelp/apps/web/opt/canhelp/apps/web/src/app/chat/page.tsx.mjsÄ/opt/canhelp/apps/web/opt/canhelp/apps/web/src/app/chat/page.tsx.tsxÃ/opt/canhelp/apps/web/opt/canhelp/apps/web/src/app/chat/page.tsx.tsÄ/opt/canhelp/apps/web/opt/canhelp/apps/web/src/app/chat/page.tsx.jsxÅ/opt/canhelp/apps/web/opt/canhelp/apps/web/src/app/chat/page.tsx.jsonÅ/opt/canhelp/apps/web/opt/canhelp/apps/web/src/app/chat/page.tsx.wasmƒ@€¯/opt/canhelp/apps/web/src/app/chat/package.jsonª/opt/canhelp/apps/web/src/app/package.jsonÎÀÁÂÃādÿÿÿ hÿÿÿ€iÿÿÿjÿÿÿ°/opt/canhelp/apps/web/src/app/dashboard/page.tsx€€ kÿÿÿ«¬œ./src/app/dashboard/page.tsxÿÿ@‰ °™•mÿyB ýiÿÿÿǪÈÉʁ/ݧ/opt/canhelp/apps/web/src/app/dashboard°!À<‚mÿyB°<‚mÿyBa43199c78776ee5e®!`–nuþyBP–nuþyBÈ­Qÿÿÿ¬Pÿÿÿ«OÿÿÿªNÿÿÿ©MÿÿÿšLÿÿÿ§KÿÿÿŠJÿÿÿ É/opt/canhelp/apps/web/opt/canhelp/apps/web/src/app/dashboard/package.jsonÝÅ/opt/canhelp/apps/web/opt/canhelp/apps/web/src/app/dashboard/page.tsxÈ/opt/canhelp/apps/web/opt/canhelp/apps/web/src/app/dashboard/page.tsx.jsÉ/opt/canhelp/apps/web/opt/canhelp/apps/web/src/app/dashboard/page.tsx.mjsÉ/opt/canhelp/apps/web/opt/canhelp/apps/web/src/app/dashboard/page.tsx.tsxÈ/opt/canhelp/apps/web/opt/canhelp/apps/web/src/app/dashboard/page.tsx.tsÉ/opt/canhelp/apps/web/opt/canhelp/apps/web/src/app/dashboard/page.tsx.jsxÊ/opt/canhelp/apps/web/opt/canhelp/apps/web/src/app/dashboard/page.tsx.jsonÊ/opt/canhelp/apps/web/opt/canhelp/apps/web/src/app/dashboard/page.tsx.wasmƒ@€Ž/opt/canhelp/apps/web/src/app/dashboard/package.jsonÞ­Ÿ ¡¢£Cÿÿÿ Gÿÿÿ€HÿÿÿIÿÿÿŽ/opt/canhelp/apps/web/src/app/notifications/page.tsx€€ JÿÿÿŠ‹ ./src/app/notifications/page.tsxÿÿ@‰ À™•mÿyB ýHÿÿÿЉ§š©/Œ«/opt/canhelp/apps/web/src/app/notifications!À<‚mÿyB°<‚mÿyBf69a1ab18715369e!`–nuþyBP–nuþyB§Œ0ÿÿÿ‹/ÿÿÿŠ.ÿÿÿ‰-ÿÿÿˆ,ÿÿÿ‡+ÿÿÿ†*ÿÿÿ…)ÿÿÿ Í/opt/canhelp/apps/web/opt/canhelp/apps/web/src/app/notifications/package.jsonŒÉ/opt/canhelp/apps/web/opt/canhelp/apps/web/src/app/notifications/page.tsxÌ/opt/canhelp/apps/web/opt/canhelp/apps/web/src/app/notifications/page.tsx.jsÍ/opt/canhelp/apps/web/opt/canhelp/apps/web/src/app/notifications/page.tsx.mjsÍ/opt/canhelp/apps/web/opt/canhelp/apps/web/src/app/notifications/page.tsx.tsxÌ/opt/canhelp/apps/web/opt/canhelp/apps/web/src/app/notifications/page.tsx.tsÍ/opt/canhelp/apps/web/opt/canhelp/apps/web/src/app/notifications/page.tsx.jsxÎ/opt/canhelp/apps/web/opt/canhelp/apps/web/src/app/notifications/page.tsx.jsonÎ/opt/canhelp/apps/web/opt/canhelp/apps/web/src/app/notifications/page.tsx.wasmƒ@€ž/opt/canhelp/apps/web/src/app/notifications/package.jsonœŒ~ÿÿÿÿÿÿ€‚"ÿÿÿ &ÿÿÿ€'ÿÿÿ(ÿÿÿ®/opt/canhelp/apps/web/src/app/pricing/page.tsx€€ )ÿÿÿiÿÿÿjÿÿÿš./src/app/pricing/page.tsxÿÿ@‰ š•mÿyB ý'ÿÿÿ…hÿÿÿ†‡ˆ/›¥/opt/canhelp/apps/web/src/app/pricingnÿÿÿ!À<‚mÿyB°<‚mÿyB1b8e646bb3f68dc0lÿÿÿ!`–nuþyBP–nuþyB†kÿÿÿÿÿÿjÿÿÿÿÿÿiÿÿÿ ÿÿÿhÿÿÿ ÿÿÿgÿÿÿ ÿÿÿfÿÿÿ ÿÿÿeÿÿÿ ÿÿÿdÿÿÿÿÿÿ Ç/opt/canhelp/apps/web/opt/canhelp/apps/web/src/app/pricing/package.json›Ã/opt/canhelp/apps/web/opt/canhelp/apps/web/src/app/pricing/page.tsxÆ/opt/canhelp/apps/web/opt/canhelp/apps/web/src/app/pricing/page.tsx.jsÇ/opt/canhelp/apps/web/opt/canhelp/apps/web/src/app/pricing/page.tsx.mjsÇ/opt/canhelp/apps/web/opt/canhelp/apps/web/src/app/pricing/page.tsx.tsxÆ/opt/canhelp/apps/web/opt/canhelp/apps/web/src/app/pricing/page.tsx.tsÇ/opt/canhelp/apps/web/opt/canhelp/apps/web/src/app/pricing/page.tsx.jsxÈ/opt/canhelp/apps/web/opt/canhelp/apps/web/src/app/pricing/page.tsx.jsonÈ/opt/canhelp/apps/web/opt/canhelp/apps/web/src/app/pricing/page.tsx.wasmƒ@€²/opt/canhelp/apps/web/src/app/pricing/package.jsonœkÿÿÿ]ÿÿÿ^ÿÿÿ_ÿÿÿ`ÿÿÿaÿÿÿÿÿÿ ÿÿÿ€ÿÿÿÿÿÿ¬/opt/canhelp/apps/web/src/app/admin/page.tsx€€ ÿÿÿHÿÿÿIÿÿÿ˜./src/app/admin/page.tsxÿÿ@‰ `ž•mÿyB ýÿÿÿdÿÿÿGÿÿÿeÿÿÿfÿÿÿgÿÿÿ/zÿÿÿ£/opt/canhelp/apps/web/src/app/adminMÿÿÿ!€<‚mÿyBp<‚mÿyB7ea578958b789a2aKÿÿÿ!`–nuþyBP–nuþyBeÿÿÿJÿÿÿîþÿÿIÿÿÿíþÿÿHÿÿÿìþÿÿGÿÿÿëþÿÿFÿÿÿêþÿÿEÿÿÿéþÿÿDÿÿÿèþÿÿCÿÿÿçþÿÿ Å/opt/canhelp/apps/web/opt/canhelp/apps/web/src/app/admin/package.jsonzÿÿÿÁ/opt/canhelp/apps/web/opt/canhelp/apps/web/src/app/admin/page.tsxÄ/opt/canhelp/apps/web/opt/canhelp/apps/web/src/app/admin/page.tsx.jsÅ/opt/canhelp/apps/web/opt/canhelp/apps/web/src/app/admin/page.tsx.mjsÅ/opt/canhelp/apps/web/opt/canhelp/apps/web/src/app/admin/page.tsx.tsxÄ/opt/canhelp/apps/web/opt/canhelp/apps/web/src/app/admin/page.tsx.tsÅ/opt/canhelp/apps/web/opt/canhelp/apps/web/src/app/admin/page.tsx.jsxÆ/opt/canhelp/apps/web/opt/canhelp/apps/web/src/app/admin/page.tsx.jsonÆ/opt/canhelp/apps/web/opt/canhelp/apps/web/src/app/admin/page.tsx.wasmƒ@€°/opt/canhelp/apps/web/src/app/admin/package.json{ÿÿÿJÿÿÿ<ÿÿÿ=ÿÿÿ>ÿÿÿ?ÿÿÿ@ÿÿÿàþÿÿ äþÿÿ€åþÿÿæþÿÿ·/opt/canhelp/apps/web/src/app/tasks/[id]/offer/page.tsx€€ çþÿÿ'ÿÿÿ(ÿÿÿ£./src/app/tasks/[id]/offer/page.tsxÿÿ@‰ À¢•mÿyB` ýåþÿÿCÿÿÿ&ÿÿÿDÿÿÿEÿÿÿFÿÿÿ/Yÿÿÿš/opt/canhelp/apps/web/src/app/tasks/[id]£/opt/canhelp/apps/web/src/app/tasks®/opt/canhelp/apps/web/src/app/tasks/[id]/offer*ÿÿÿ!@=‚mÿyB0=‚mÿyB5241955dc860c2f7(ÿÿÿ!`–nuþyBP–nuþyBBÿÿÿ'ÿÿÿËþÿÿ&ÿÿÿÊþÿÿ%ÿÿÿÉþÿÿ$ÿÿÿÈþÿÿ#ÿÿÿÇþÿÿ"ÿÿÿÆþÿÿ!ÿÿÿÅþÿÿ ÿÿÿÄþÿÿÿÿÿÃþÿÿÿÿÿÂþÿÿ` Ð/opt/canhelp/apps/web/opt/canhelp/apps/web/src/app/tasks/[id]/offer/package.jsonÊ/opt/canhelp/apps/web/opt/canhelp/apps/web/src/app/tasks/[id]/package.jsonÅ/opt/canhelp/apps/web/opt/canhelp/apps/web/src/app/tasks/package.jsonSÿÿÿÌ/opt/canhelp/apps/web/opt/canhelp/apps/web/src/app/tasks/[id]/offer/page.tsxÏ/opt/canhelp/apps/web/opt/canhelp/apps/web/src/app/tasks/[id]/offer/page.tsx.jsÐ/opt/canhelp/apps/web/opt/canhelp/apps/web/src/app/tasks/[id]/offer/page.tsx.mjsÐ/opt/canhelp/apps/web/opt/canhelp/apps/web/src/app/tasks/[id]/offer/page.tsx.tsxÏ/opt/canhelp/apps/web/opt/canhelp/apps/web/src/app/tasks/[id]/offer/page.tsx.tsÐ/opt/canhelp/apps/web/opt/canhelp/apps/web/src/app/tasks/[id]/offer/page.tsx.jsxÑ/opt/canhelp/apps/web/opt/canhelp/apps/web/src/app/tasks/[id]/offer/page.tsx.jsonÑ/opt/canhelp/apps/web/opt/canhelp/apps/web/src/app/tasks/[id]/offer/page.tsx.wasm…@€»/opt/canhelp/apps/web/src/app/tasks/[id]/offer/package.json @€ µ/opt/canhelp/apps/web/src/app/tasks/[id]/package.json°/opt/canhelp/apps/web/src/app/tasks/package.jsonQÿÿÿ ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ‚Žþÿÿ žþÿÿ€¹þÿÿºþÿÿœ/opt/canhelp/apps/web/src/app/tasks/[id]/TaskDetailClient.tsx€€ »þÿÿûþÿÿüþÿÿ©./src/app/tasks/[id]/TaskDetailClient.tsxÿÿ@‰ À¢•mÿyB` ý¹þÿÿÿÿÿúþÿÿÿÿÿÿÿÿÿÿÿ/-ÿÿÿÔÕÿÿÿ!=‚mÿyBð<‚mÿyB09b8ebebd960407aÿþÿÿ!`–nuþyBP–nuþyBÿÿÿþþÿÿ¢þÿÿýþÿÿ¡þÿÿüþÿÿ þÿÿûþÿÿŸþÿÿúþÿÿžþÿÿùþÿÿþÿÿøþÿÿœþÿÿ÷þÿÿ›þÿÿöþÿÿšþÿÿ`ÙÚ.ÿÿÿúþÿÿûþÿÿüþÿÿýþÿÿþþÿÿÒ/opt/canhelp/apps/web/opt/canhelp/apps/web/src/app/tasks/[id]/TaskDetailClient.tsxÕ/opt/canhelp/apps/web/opt/canhelp/apps/web/src/app/tasks/[id]/TaskDetailClient.tsx.jsÖ/opt/canhelp/apps/web/opt/canhelp/apps/web/src/app/tasks/[id]/TaskDetailClient.tsx.mjsÖ/opt/canhelp/apps/web/opt/canhelp/apps/web/src/app/tasks/[id]/TaskDetailClient.tsx.tsxÕ/opt/canhelp/apps/web/opt/canhelp/apps/web/src/app/tasks/[id]/TaskDetailClient.tsx.tsÖ/opt/canhelp/apps/web/opt/canhelp/apps/web/src/app/tasks/[id]/TaskDetailClient.tsx.jsx×/opt/canhelp/apps/web/opt/canhelp/apps/web/src/app/tasks/[id]/TaskDetailClient.tsx.json×/opt/canhelp/apps/web/opt/canhelp/apps/web/src/app/tasks/[id]/TaskDetailClient.tsx.wasmÞß1ÿÿÿÿÿÿ˜þÿÿ œþÿÿ€þÿÿžþÿÿ±/opt/canhelp/apps/web/src/app/users/[id]/page.tsx€€ Ÿþÿÿßþÿÿàþÿÿ./src/app/users/[id]/page.tsxÿÿ@‰ p²•mÿyB` ýþÿÿûþÿÿÞþÿÿüþÿÿýþÿÿþþÿÿ/ÿÿÿ£/opt/canhelp/apps/web/src/app/usersš/opt/canhelp/apps/web/src/app/users/[id]ãþÿÿ!@=‚mÿyB0=‚mÿyBcb0965a070fc2217áþÿÿ!`–nuþyBP–nuþyBûþÿÿàþÿÿ„þÿÿßþÿÿƒþÿÿÞþÿÿ‚þÿÿÝþÿÿþÿÿÜþÿÿ€þÿÿÛþÿÿþÿÿÚþÿÿ~þÿÿÙþÿÿ}þÿÿØþÿÿ|þÿÿ` Ê/opt/canhelp/apps/web/opt/canhelp/apps/web/src/app/users/[id]/package.jsonÅ/opt/canhelp/apps/web/opt/canhelp/apps/web/src/app/users/package.jsonÿÿÿÆ/opt/canhelp/apps/web/opt/canhelp/apps/web/src/app/users/[id]/page.tsxÉ/opt/canhelp/apps/web/opt/canhelp/apps/web/src/app/users/[id]/page.tsx.jsÊ/opt/canhelp/apps/web/opt/canhelp/apps/web/src/app/users/[id]/page.tsx.mjsÊ/opt/canhelp/apps/web/opt/canhelp/apps/web/src/app/users/[id]/page.tsx.tsxÉ/opt/canhelp/apps/web/opt/canhelp/apps/web/src/app/users/[id]/page.tsx.tsÊ/opt/canhelp/apps/web/opt/canhelp/apps/web/src/app/users/[id]/page.tsx.jsxË/opt/canhelp/apps/web/opt/canhelp/apps/web/src/app/users/[id]/page.tsx.jsonË/opt/canhelp/apps/web/opt/canhelp/apps/web/src/app/users/[id]/page.tsx.wasm„@€ µ/opt/canhelp/apps/web/src/app/users/[id]/package.json°/opt/canhelp/apps/web/src/app/users/package.jsonÿÿÿÝþÿÿÏþÿÿÐþÿÿÑþÿÿÒþÿÿÓþÿÿ‚sþÿÿ wþÿÿ€xþÿÿyþÿÿ®/opt/canhelp/apps/web/src/app/profile/page.tsx€€ zþÿÿºþÿÿ»þÿÿš./src/app/profile/page.tsxÿÿ@‰ `²•mÿyB ýxþÿÿÖþÿÿ¹þÿÿ×þÿÿØþÿÿÙþÿÿ/ìþÿÿ¥/opt/canhelp/apps/web/src/app/profile¿þÿÿ!=‚mÿyBð<‚mÿyB876a1add9ad74706œþÿÿ!`–nuþyBP–nuþyB×þÿÿŒþÿÿ`þÿÿ»þÿÿ_þÿÿºþÿÿ^þÿÿ¹þÿÿ]þÿÿžþÿÿ\þÿÿ·þÿÿ[þÿÿ¶þÿÿZþÿÿµþÿÿYþÿÿ Ç/opt/canhelp/apps/web/opt/canhelp/apps/web/src/app/profile/package.jsonìþÿÿÃ/opt/canhelp/apps/web/opt/canhelp/apps/web/src/app/profile/page.tsxÆ/opt/canhelp/apps/web/opt/canhelp/apps/web/src/app/profile/page.tsx.jsÇ/opt/canhelp/apps/web/opt/canhelp/apps/web/src/app/profile/page.tsx.mjsÇ/opt/canhelp/apps/web/opt/canhelp/apps/web/src/app/profile/page.tsx.tsxÆ/opt/canhelp/apps/web/opt/canhelp/apps/web/src/app/profile/page.tsx.tsÇ/opt/canhelp/apps/web/opt/canhelp/apps/web/src/app/profile/page.tsx.jsxÈ/opt/canhelp/apps/web/opt/canhelp/apps/web/src/app/profile/page.tsx.jsonÈ/opt/canhelp/apps/web/opt/canhelp/apps/web/src/app/profile/page.tsx.wasmƒ@€²/opt/canhelp/apps/web/src/app/profile/package.jsoníþÿÿŒþÿÿ®þÿÿ¯þÿÿ°þÿÿ±þÿÿ²þÿÿRþÿÿ Vþÿÿ€WþÿÿXþÿÿ²/opt/canhelp/apps/web/src/app/site/[slug]/page.tsx€€ Yþÿÿ™þÿÿšþÿÿž./src/app/site/[slug]/page.tsxÿÿ@‰ ÀŠ•mÿyB` ýWþÿÿµþÿÿ˜þÿÿ¶þÿÿ·þÿÿžþÿÿ/Ëþÿÿ©/opt/canhelp/apps/web/src/app/site/[slug]¢/opt/canhelp/apps/web/src/app/siteþÿÿ!=‚mÿyBð<‚mÿyBa6cd3045533192e1›þÿÿ!`–nuþyBP–nuþyBµþÿÿšþÿÿ>þÿÿ™þÿÿ=þÿÿ˜þÿÿ<þÿÿ—þÿÿ;þÿÿ–þÿÿ:þÿÿ•þÿÿ9þÿÿ”þÿÿ8þÿÿ“þÿÿ7þÿÿ’þÿÿ6þÿÿ` Ë/opt/canhelp/apps/web/opt/canhelp/apps/web/src/app/site/[slug]/package.jsonÄ/opt/canhelp/apps/web/opt/canhelp/apps/web/src/app/site/package.jsonÈþÿÿÇ/opt/canhelp/apps/web/opt/canhelp/apps/web/src/app/site/[slug]/page.tsxÊ/opt/canhelp/apps/web/opt/canhelp/apps/web/src/app/site/[slug]/page.tsx.jsË/opt/canhelp/apps/web/opt/canhelp/apps/web/src/app/site/[slug]/page.tsx.mjsË/opt/canhelp/apps/web/opt/canhelp/apps/web/src/app/site/[slug]/page.tsx.tsxÊ/opt/canhelp/apps/web/opt/canhelp/apps/web/src/app/site/[slug]/page.tsx.tsË/opt/canhelp/apps/web/opt/canhelp/apps/web/src/app/site/[slug]/page.tsx.jsxÌ/opt/canhelp/apps/web/opt/canhelp/apps/web/src/app/site/[slug]/page.tsx.jsonÌ/opt/canhelp/apps/web/opt/canhelp/apps/web/src/app/site/[slug]/page.tsx.wasm„@€ ¶/opt/canhelp/apps/web/src/app/site/[slug]/package.json¯/opt/canhelp/apps/web/src/app/site/package.jsonÈþÿÿ—þÿÿ‰þÿÿŠþÿÿ‹þÿÿŒþÿÿþÿÿ‚˜webpack/lib/NormalModule«webpack/lib/util/registerExternalSerializer™webpack-sources/RawSourceç/* __next_internal_client_entry_do_not_use__ ScrollToTopButton auto */ import { jsx as _jsx } from "react/jsx-runtime"; import { useEffect, useState } from 'react'; export function ScrollToTopButton() { const [visible, setVisible] = useState(false); useEffect(()=>{ const onScroll = ()=>{ setVisible(window.scrollY > 200); }; window.addEventListener('scroll', onScroll); return ()=>window.removeEventListener('scroll', onScroll); }, []); return /*#__PURE__*/ _jsx("button", { className: "scroll-to-top-btn".concat(visible ? ' visible' : ''), "aria-label": "Back to top", onClick: ()=>window.scrollTo({ top: 0, behavior: 'smooth' }), children: /*#__PURE__*/ _jsx("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /*#__PURE__*/ _jsx("path", { d: "M10 16V4M10 4L4 10M10 4L16 10", stroke: "white", strokeWidth: "2.8", strokeLinecap: "round", strokeLinejoin: "round" }) }) }); } ‹exportsTypeŽsideEffectFree‰namespace  javascript/auto)þÿÿqþÿÿ…aliasŠmainFieldsˆfallback`$Œserver-only$Œclient-only$Ÿnext/dist/compiled/client-only$žnext/dist/compiled/server-onlyŠ/opt/canhelp/node_modules/next/head.js§/opt/canhelp/node_modules/next/image.js«/opt/canhelp/node_modules/next/constants.jsš/opt/canhelp/node_modules/next/router.js©/opt/canhelp/node_modules/next/dynamic.jsš/opt/canhelp/node_modules/next/script.jsŠ/opt/canhelp/node_modules/next/link.jsŠ/opt/canhelp/node_modules/next/form.js¬/opt/canhelp/node_modules/next/navigation.js©/opt/canhelp/node_modules/next/headers.js€/opt/canhelp/node_modules/next/og.jsš/opt/canhelp/node_modules/next/server.jsª/opt/canhelp/node_modules/next/document.js¥/opt/canhelp/node_modules/next/app.js†react$—react/compiler-runtime$–react/jsx-dev-runtime$’react/jsx-runtime$Šreact-dom$‘react-dom/client$‘react-dom/server$™react-dom/server.browser$–react-dom/server.edge$‘react-dom/static$™react-dom/static.browser$–react-dom/static.edge$ react-server-dom-webpack/client$ react-server-dom-webpack/server$¥react-server-dom-webpack/server.node$ react-server-dom-webpack/static$É@vercel/turbopack-ecmascript-runtime/browser/dev/hmr-client/hmr-client.ts"þÿÿ€next/dist/compiled/server-only/index€next/dist/compiled/client-only/indexÿþ¥next/dist/client/components/noop-head“next/dist/api/image—next/dist/api/constants”next/dist/api/router™next/dist/api/app-dynamic”next/dist/api/scriptnext/dist/client/app-dir/linknext/dist/client/app-dir/form˜next/dist/api/navigation•next/dist/api/headersnext/dist/api/og”next/dist/api/server–next/dist/api/document‘next/dist/api/app˜next/dist/compiled/react©next/dist/compiled/react/compiler-runtimešnext/dist/compiled/react/jsx-dev-runtime€next/dist/compiled/react/jsx-runtimeœnext/dist/compiled/react-dom£next/dist/compiled/react-dom/client«next/dist/compiled/react-dom/server.browserÿ±next/dist/build/webpack/alias/react-dom-server.js«next/dist/compiled/react-dom/static.browserÿšnext/dist/compiled/react-dom/static.edgeºnext/dist/compiled/react-server-dom-webpack/client.browserºnext/dist/compiled/react-server-dom-webpack/server.browser·next/dist/compiled/react-server-dom-webpack/server.nodeºnext/dist/compiled/react-server-dom-webpack/static.browser§next/dist/client/dev/noop-turbopack-hmrž/opt/canhelp/node_modules/next‡browserÎýÿÿ„main`†assert†buffer‰constants†crypto†domain„http…https‚osÀýÿÿˆpunycode‡process‹querystring†streamŽstring_decoderƒsys†timersƒtty„util‚vm„zlib†eventsŒsetImmediateœ/opt/canhelp/node_modules/next/dist/compiled/assert/assert.jsŒ/opt/canhelp/node_modules/next/dist/compiled/buffer/index.jsÐ/opt/canhelp/node_modules/next/dist/compiled/constants-browserify/constants.jsonÇ/opt/canhelp/node_modules/next/dist/compiled/crypto-browserify/index.jsÄ/opt/canhelp/node_modules/next/dist/compiled/domain-browser/index.jsÁ/opt/canhelp/node_modules/next/dist/compiled/stream-http/index.jsÆ/opt/canhelp/node_modules/next/dist/compiled/https-browserify/index.jsÅ/opt/canhelp/node_modules/next/dist/compiled/os-browserify/browser.jsÅ/opt/canhelp/node_modules/next/dist/compiled/path-browserify/index.jsÁ/opt/canhelp/node_modules/next/dist/compiled/punycode/punycode.jsŸ/opt/canhelp/node_modules/next/dist/build/polyfills/process.jsÅ/opt/canhelp/node_modules/next/dist/compiled/querystring-es3/index.jsÇ/opt/canhelp/node_modules/next/dist/compiled/stream-browserify/index.jsÍ/opt/canhelp/node_modules/next/dist/compiled/string_decoder/string_decoder.js¹/opt/canhelp/node_modules/next/dist/compiled/util/util.jsÆ/opt/canhelp/node_modules/next/dist/compiled/timers-browserify/main.jsÄ/opt/canhelp/node_modules/next/dist/compiled/tty-browserify/index.jsýÃ/opt/canhelp/node_modules/next/dist/compiled/vm-browserify/index.jsÅ/opt/canhelp/node_modules/next/dist/compiled/browserify-zlib/index.jsœ/opt/canhelp/node_modules/next/dist/compiled/events/events.jsÉ/opt/canhelp/node_modules/next/dist/compiled/setimmediate/setImmediate.js„`‰cacheable†parsedfileDependencies“contextDependencies“missingDependencies‘buildDependencies‘valueDependenciesôýÿÿ†assetsŠassetsInfoƒrsc†strictexportsArgument”topLevelDeclarationsˆsnapshot ˜webpack/lib/util/LazySetÝ/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-flight-client-module-loader.jsÌ/opt/canhelp/node_modules/next/dist/build/webpack/loaders/next-swc-loader.js ™webpack/DefinePlugin_hashˆad32b5945098ddbd8587305c„type‰actionIds‹isClientRef—ýÿÿ  “__webpack_exports__‘ScrollToTopButton •mÿyB •ýÿÿàýÿÿ·webpack/lib/dependencies/HarmonyCompatibilityDependency dÿÿýšwebpack/lib/dependencies/ConstDependency€aGw bGw€`x@€ `,¶webpack/lib/dependencies/HarmonyExportHeaderDependency A¬æ A¥æ a" ºwebpack/lib/dependencies/HarmonyImportSideEffectDependency‘react/jsx-runtimeÿ bGw¥ýÿÿ¥ýÿÿ `,¹webpack/lib/dependencies/HarmonyExportSpecifierDependency`ïï a"¹webpack/lib/dependencies/HarmonyImportSpecifierDependencya ˆuseStateþ Aíõ   êžýÿÿžýÿÿý b"* ‰useEffectþ A   ú™ýÿÿ™ýÿÿþ `  ƒjsx„_jsx A   ôììþ c   úû A  ðèèþ c $ ö÷ Aëï  ìääþ c$(  4ª/* __next_internal_client_entry_do_not_use__ default auto */ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime"; import { useState, useEffect, useRef, useCallback, Suspense } from 'react'; import { useRouter, useSearchParams } from 'next/navigation'; import Link from 'next/link'; import { useSession } from '@/lib/auth'; import { useLocale } from '@/context/locale'; import { getChatRooms, getMessages, getDailyUsage } from '@/lib/api'; import { formatShortName } from '@/lib/formatName'; import { io } from 'socket.io-client'; const API_URL = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; function ChatPageInner() { var _session_user, _activeRoom_task, _activeRoom_otherUser, _activeRoom_otherUser1, _activeRoom_otherUser2; const router = useRouter(); const searchParams = useSearchParams(); const { data: session, isPending } = useSession(); const { t, locale } = useLocale(); const [rooms, setRooms] = useState([]); const [loadingRooms, setLoadingRooms] = useState(true); const [activeRoomId, setActiveRoomId] = useState(null); const [messages, setMessages] = useState([]); const [loadingMessages, setLoadingMessages] = useState(false); const [input, setInput] = useState(''); const [connected, setConnected] = useState(false); const [msgLimit, setMsgLimit] = useState(null); const [uploadingImage, setUploadingImage] = useState(false); const [lightboxUrl, setLightboxUrl] = useState(null); const socketRef = useRef(null); const messagesEndRef = useRef(null); const inputRef = useRef(null); const fileInputRef = useRef(null); useEffect(()=>{ if (!isPending && !session) router.push('/login'); }, [ session, isPending ]); // Load chat rooms useEffect(()=>{ if (!session) return; getChatRooms().then((data)=>{ setRooms(data); const roomParam = searchParams.get('room'); if (roomParam) setActiveRoomId(roomParam); }).catch((err)=>console.error('[chat] getChatRooms error:', err)).finally(()=>setLoadingRooms(false)); getDailyUsage().then((u)=>setMsgLimit({ left: u.messagesLeft, sent: u.messagesSent })).catch((err)=>console.error('[chat] getDailyUsage error:', err)); }, [ session ]); // Setup Socket.IO useEffect(()=>{ if (!session) return; const socket = io(API_URL, { withCredentials: true, transports: [ 'websocket', 'polling' ] }); socketRef.current = socket; socket.on('connect', ()=>setConnected(true)); socket.on('disconnect', ()=>setConnected(false)); socket.on('new_message', (msg)=>{ setMessages((prev)=>{ // avoid duplicate if we get it back from our own send if (prev.some((m)=>m.message.id === msg.id)) return prev; var _session_user_name, _session_user_image; // sender info: only known for current user; others show placeholder (? avatar) const sender = session.user && session.user.id === msg.senderId ? { id: session.user.id, name: (_session_user_name = session.user.name) !== null && _session_user_name !== void 0 ? _session_user_name : '', image: (_session_user_image = session.user.image) !== null && _session_user_image !== void 0 ? _session_user_image : undefined } : null; return [ ...prev, { message: msg, sender } ]; }); // Update lastMessage in rooms list and bubble room to top setRooms((prev)=>{ const updated = prev.map((r)=>{ var _msg_translations, _msg_imageUrl; return r.room.id === msg.roomId ? { ...r, lastMessage: { body: msg.body, createdAt: msg.createdAt, translations: (_msg_translations = msg.translations) !== null && _msg_translations !== void 0 ? _msg_translations : null, imageUrl: (_msg_imageUrl = msg.imageUrl) !== null && _msg_imageUrl !== void 0 ? _msg_imageUrl : null } } : r; }); return updated.sort((a, b)=>{ var _a_lastMessage, _b_lastMessage; const aTime = ((_a_lastMessage = a.lastMessage) === null || _a_lastMessage === void 0 ? void 0 : _a_lastMessage.createdAt) ? new Date(a.lastMessage.createdAt).getTime() : new Date(a.room.createdAt).getTime(); const bTime = ((_b_lastMessage = b.lastMessage) === null || _b_lastMessage === void 0 ? void 0 : _b_lastMessage.createdAt) ? new Date(b.lastMessage.createdAt).getTime() : new Date(b.room.createdAt).getTime(); return bTime - aTime; }); }); }); socket.on('message_translated', (param)=>{ let { id, roomId, translations } = param; setMessages((prev)=>prev.map((m)=>m.message.id === id ? { ...m, message: { ...m.message, translations } } : m)); // Also update lastMessage in sidebar if this is the last message of that room if (roomId) { setRooms((prev)=>prev.map((r)=>r.room.id === roomId && r.lastMessage ? { ...r, lastMessage: { ...r.lastMessage, translations } } : r)); } }); return ()=>{ socket.disconnect(); socketRef.current = null; }; }, [ session ]); // Join room and load messages when activeRoomId changes useEffect(()=>{ var _socketRef_current, _socketRef_current1; if (!activeRoomId) return; setLoadingMessages(true); setMessages([]); getMessages(activeRoomId).then(setMessages).catch((err)=>console.error('[chat] getMessages error:', err)).finally(()=>setLoadingMessages(false)); (_socketRef_current = socketRef.current) === null || _socketRef_current === void 0 ? void 0 : _socketRef_current.emit('join_room', activeRoomId); (_socketRef_current1 = socketRef.current) === null || _socketRef_current1 === void 0 ? void 0 : _socketRef_current1.emit('mark_read', activeRoomId); }, [ activeRoomId ]); // Focus input when active room changes useEffect(()=>{ if (!activeRoomId) return; const t = setTimeout(()=>{ var _inputRef_current; return (_inputRef_current = inputRef.current) === null || _inputRef_current === void 0 ? void 0 : _inputRef_current.focus(); }, 50); return ()=>clearTimeout(t); }, [ activeRoomId ]); // Auto-scroll on new messages (within container only) useEffect(()=>{ var _messagesEndRef_current; (_messagesEndRef_current = messagesEndRef.current) === null || _messagesEndRef_current === void 0 ? void 0 : _messagesEndRef_current.scrollIntoView({ behavior: 'smooth', block: 'nearest' }); }, [ messages ]); // Close lightbox on Escape useEffect(()=>{ const onKey = (e)=>{ if (e.key === 'Escape') setLightboxUrl(null); }; window.addEventListener('keydown', onKey); return ()=>window.removeEventListener('keydown', onKey); }, []); const sendMessage = useCallback(()=>{ const body = input.trim(); if (!body || !activeRoomId || !socketRef.current) return; if (msgLimit && msgLimit.left !== null && msgLimit.left <= 0) return; socketRef.current.emit('send_message', { roomId: activeRoomId, body, locale }); setInput(''); // decrement local counter setMsgLimit((prev)=>prev && prev.left !== null ? { ...prev, left: prev.left - 1, sent: prev.sent + 1 } : prev); }, [ input, activeRoomId, msgLimit ]); const uploadAndSendImage = useCallback(async (file)=>{ if (!activeRoomId || !socketRef.current) return; setUploadingImage(true); try { const formData = new FormData(); formData.append('file', file); const res = await fetch("".concat(API_URL, "/api/uploads"), { method: 'POST', credentials: 'include', body: formData }); if (!res.ok) throw new Error('Upload failed'); const { url } = await res.json(); socketRef.current.emit('send_message', { roomId: activeRoomId, body: '', imageUrl: url, locale }); } catch (_) { // silent } finally{ setUploadingImage(false); if (fileInputRef.current) fileInputRef.current.value = ''; } }, [ activeRoomId, locale ]); const handleKeyDown = (e)=>{ if (e.key === 'Enter' && !e.shiftKey) { e.preventDefault(); sendMessage(); } }; const LOCALE_TAG = { ru: 'ru-RU', en: 'en-US', el: 'el-GR' }; var _LOCALE_TAG_locale; const localeTag = (_LOCALE_TAG_locale = LOCALE_TAG[locale]) !== null && _LOCALE_TAG_locale !== void 0 ? _LOCALE_TAG_locale : 'el-GR'; function fmtMsgTime(iso) { const d = new Date(iso); const now = new Date(); const diffMin = Math.floor((now.getTime() - d.getTime()) / 60000); if (diffMin < 1) return t('chat.just_now'); if (diffMin < 60) return "".concat(diffMin).concat(t('chat.min_ago')); if (d.toDateString() === now.toDateString()) return d.toLocaleTimeString(localeTag, { hour: '2-digit', minute: '2-digit' }); return d.toLocaleDateString(localeTag, { day: '2-digit', month: '2-digit' }); } if (isPending || loadingRooms) { return /*#__PURE__*/ _jsx("div", { className: "text-center py-20 text-white", children: t('common.loading') }); } const activeRoom = rooms.find((r)=>r.room.id === activeRoomId); const currentUserId = session === null || session === void 0 ? void 0 : (_session_user = session.user) === null || _session_user === void 0 ? void 0 : _session_user.id; var _activeRoom_task_title; return /*#__PURE__*/ _jsxs("div", { className: "max-w-5xl mx-auto px-4 py-6 h-[calc(100vh-80px)] flex gap-4", children: [ /*#__PURE__*/ _jsxs("div", { className: "w-72 flex-shrink-0 bg-white rounded-xl border border-gray-200 overflow-hidden flex flex-col", children: [ /*#__PURE__*/ _jsxs("div", { className: "p-4 border-b border-gray-100", children: [ /*#__PURE__*/ _jsx("h1", { className: "font-bold text-gray-900 text-lg", children: t('nav.chat') }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-1.5 mt-1", children: [ /*#__PURE__*/ _jsx("span", { className: "w-2 h-2 rounded-full ".concat(connected ? 'bg-green-400' : 'bg-gray-300') }), /*#__PURE__*/ _jsx("span", { className: "text-xs text-gray-400", children: connected ? t('chat.connected') : t('chat.disconnected') }) ] }) ] }), /*#__PURE__*/ _jsx("div", { className: "flex-1 overflow-y-auto", children: rooms.length === 0 ? /*#__PURE__*/ _jsx("div", { className: "p-6 text-center text-gray-400 text-sm", children: t('chat.no_rooms') }) : rooms.map((param)=>{ let { room, task, otherUser, lastMessage } = param; var _lastMessage_translations; var _task_title; const roomLabel = (_task_title = task === null || task === void 0 ? void 0 : task.title) !== null && _task_title !== void 0 ? _task_title : formatShortName(otherUser === null || otherUser === void 0 ? void 0 : otherUser.firstName, otherUser === null || otherUser === void 0 ? void 0 : otherUser.lastName, otherUser === null || otherUser === void 0 ? void 0 : otherUser.name) || t('chat.direct_chat'); const roomSub = task ? formatShortName(otherUser === null || otherUser === void 0 ? void 0 : otherUser.firstName, otherUser === null || otherUser === void 0 ? void 0 : otherUser.lastName, otherUser === null || otherUser === void 0 ? void 0 : otherUser.name) || '' : t('chat.direct_chat'); var _lastMessage_translations_locale; return /*#__PURE__*/ _jsxs("button", { onClick: ()=>{ setActiveRoomId(room.id); setTimeout(()=>{ var _inputRef_current; return (_inputRef_current = inputRef.current) === null || _inputRef_current === void 0 ? void 0 : _inputRef_current.focus(); }, 50); }, className: "w-full text-left px-4 py-3 border-b border-gray-50 hover:bg-gray-50 transition ".concat(activeRoomId === room.id ? 'bg-green-50 border-l-2 border-l-green-500' : ''), children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-start justify-between gap-1", children: [ /*#__PURE__*/ _jsx("p", { className: "text-sm font-medium text-gray-800 line-clamp-1 flex-1", children: roomLabel }), lastMessage && /*#__PURE__*/ _jsx("span", { className: "text-[10px] text-gray-400 shrink-0 mt-0.5", children: fmtMsgTime(lastMessage.createdAt) }) ] }), lastMessage ? /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-0.5 line-clamp-1", children: lastMessage.imageUrl && !lastMessage.body ? '📷' : (_lastMessage_translations_locale = (_lastMessage_translations = lastMessage.translations) === null || _lastMessage_translations === void 0 ? void 0 : _lastMessage_translations[locale]) !== null && _lastMessage_translations_locale !== void 0 ? _lastMessage_translations_locale : lastMessage.body }) : task ? /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-0.5 line-clamp-1", children: roomSub }) : null ] }, room.id); }) }) ] }), /*#__PURE__*/ _jsx("div", { className: "flex-1 bg-white rounded-xl border border-gray-200 flex flex-col overflow-hidden", children: !activeRoomId ? /*#__PURE__*/ _jsx("div", { className: "flex-1 flex items-center justify-center text-gray-400 text-sm", children: t('chat.select') }) : /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx("div", { className: "px-5 py-4 border-b border-gray-100", children: /*#__PURE__*/ _jsx("p", { className: "font-semibold text-gray-800 text-sm", children: (_activeRoom_task_title = activeRoom === null || activeRoom === void 0 ? void 0 : (_activeRoom_task = activeRoom.task) === null || _activeRoom_task === void 0 ? void 0 : _activeRoom_task.title) !== null && _activeRoom_task_title !== void 0 ? _activeRoom_task_title : formatShortName(activeRoom === null || activeRoom === void 0 ? void 0 : (_activeRoom_otherUser = activeRoom.otherUser) === null || _activeRoom_otherUser === void 0 ? void 0 : _activeRoom_otherUser.firstName, activeRoom === null || activeRoom === void 0 ? void 0 : (_activeRoom_otherUser1 = activeRoom.otherUser) === null || _activeRoom_otherUser1 === void 0 ? void 0 : _activeRoom_otherUser1.lastName, activeRoom === null || activeRoom === void 0 ? void 0 : (_activeRoom_otherUser2 = activeRoom.otherUser) === null || _activeRoom_otherUser2 === void 0 ? void 0 : _activeRoom_otherUser2.name) || t('chat.direct_chat') }) }), (activeRoom === null || activeRoom === void 0 ? void 0 : activeRoom.task) && /*#__PURE__*/ _jsxs(Link, { href: "/tasks/".concat(activeRoom.task.id), className: "flex items-center gap-3 mx-5 mt-4 px-4 py-3 bg-green-50 border border-green-200 rounded-xl hover:bg-green-100 transition group", children: [ /*#__PURE__*/ _jsx("div", { className: "w-8 h-8 rounded-lg bg-green-600 flex items-center justify-center flex-shrink-0", children: /*#__PURE__*/ _jsxs("svg", { className: "w-4 h-4 text-white", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", children: [ /*#__PURE__*/ _jsx("path", { d: "M16 4h2a2 2 0 012 2v14a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2h2" }), /*#__PURE__*/ _jsx("rect", { x: "8", y: "2", width: "8", height: "4", rx: "1", ry: "1" }) ] }) }), /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-500 font-medium", children: t('chat.linked_task') }), /*#__PURE__*/ _jsx("p", { className: "text-sm font-semibold text-gray-800 truncate group-hover:underline", children: activeRoom.task.title }) ] }), /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-gray-400 flex-shrink-0", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", children: /*#__PURE__*/ _jsx("polyline", { points: "9 18 15 12 9 6" }) }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex-1 overflow-y-auto px-5 py-4 space-y-3", children: [ loadingMessages ? /*#__PURE__*/ _jsx("div", { className: "text-center text-gray-400 text-sm py-10", children: t('common.loading') }) : messages.length === 0 ? /*#__PURE__*/ _jsx("div", { className: "text-center text-gray-400 text-sm py-10", children: t('chat.no_messages') }) : messages.map((param)=>{ let { message, sender } = param; var _sender_name_, _sender_name, _message_translations; const isMe = message.senderId === currentUserId; var _sender_name__toUpperCase, _message_translations_locale; return /*#__PURE__*/ _jsxs("div", { className: "flex gap-2.5 ".concat(isMe ? 'flex-row-reverse' : ''), children: [ /*#__PURE__*/ _jsx("div", { className: "w-8 h-8 rounded-full bg-green-100 flex-shrink-0 flex items-center justify-center text-green-700 text-xs font-bold overflow-hidden", children: (sender === null || sender === void 0 ? void 0 : sender.image) ? /*#__PURE__*/ _jsx("img", { src: sender.image, alt: sender.name, className: "w-full h-full object-cover" }) : (_sender_name__toUpperCase = sender === null || sender === void 0 ? void 0 : (_sender_name = sender.name) === null || _sender_name === void 0 ? void 0 : (_sender_name_ = _sender_name[0]) === null || _sender_name_ === void 0 ? void 0 : _sender_name_.toUpperCase()) !== null && _sender_name__toUpperCase !== void 0 ? _sender_name__toUpperCase : '?' }), /*#__PURE__*/ _jsxs("div", { className: "max-w-[70%] ".concat(isMe ? 'items-end' : 'items-start', " flex flex-col gap-1"), children: [ !isMe && /*#__PURE__*/ _jsx("span", { className: "text-xs text-gray-400 px-1", children: formatShortName(sender === null || sender === void 0 ? void 0 : sender.firstName, sender === null || sender === void 0 ? void 0 : sender.lastName, sender === null || sender === void 0 ? void 0 : sender.name) }), message.imageUrl ? /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setLightboxUrl("".concat(API_URL).concat(message.imageUrl)), className: "block focus:outline-none", children: /*#__PURE__*/ _jsx("img", { src: "".concat(API_URL).concat(message.imageUrl), alt: "photo", className: "rounded-2xl max-w-[240px] max-h-[320px] object-cover cursor-pointer hover:opacity-90 transition" }) }) : /*#__PURE__*/ _jsx("div", { className: "px-4 py-2 rounded-2xl text-sm leading-relaxed ".concat(isMe ? 'bg-green-600 text-white rounded-tr-sm' : 'bg-gray-100 text-gray-800 rounded-tl-sm'), children: (_message_translations_locale = (_message_translations = message.translations) === null || _message_translations === void 0 ? void 0 : _message_translations[locale]) !== null && _message_translations_locale !== void 0 ? _message_translations_locale : message.body }), /*#__PURE__*/ _jsx("span", { className: "text-xs text-gray-300 px-1", children: new Date(message.createdAt).toLocaleTimeString(localeTag, { hour: '2-digit', minute: '2-digit' }) }) ] }) ] }, message.id); }), /*#__PURE__*/ _jsx("div", { ref: messagesEndRef }) ] }), lightboxUrl && /*#__PURE__*/ _jsx("div", { className: "fixed inset-0 z-50 flex items-center justify-center bg-black/80 backdrop-blur-sm", onClick: ()=>setLightboxUrl(null), children: /*#__PURE__*/ _jsxs("div", { className: "relative max-w-[90vw] max-h-[90vh]", onClick: (e)=>e.stopPropagation(), children: [ /*#__PURE__*/ _jsx("img", { src: lightboxUrl, alt: "photo", className: "max-w-[90vw] max-h-[90vh] rounded-2xl object-contain shadow-2xl" }), /*#__PURE__*/ _jsx("button", { onClick: ()=>setLightboxUrl(null), className: "absolute -top-3 -right-3 w-8 h-8 bg-white rounded-full flex items-center justify-center shadow-lg hover:bg-gray-100 transition", "aria-label": "Close", children: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-gray-700", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" }) }) }), /*#__PURE__*/ _jsx("a", { href: lightboxUrl, download: true, target: "_blank", rel: "noreferrer", className: "absolute -bottom-3 -right-3 w-8 h-8 bg-white rounded-full flex items-center justify-center shadow-lg hover:bg-gray-100 transition", "aria-label": "Download", onClick: (e)=>e.stopPropagation(), children: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-gray-700", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4 16v2a2 2 0 002 2h12a2 2 0 002-2v-2M7 10l5 5 5-5M12 15V3" }) }) }) ] }) }), /*#__PURE__*/ _jsxs("div", { className: "px-4 py-3 border-t border-gray-100", children: [ " ", /*#__PURE__*/ _jsx("input", { ref: fileInputRef, type: "file", accept: "image/jpeg,image/png,image/gif,image/webp", className: "hidden", onChange: (e)=>{ var _e_target_files; const file = (_e_target_files = e.target.files) === null || _e_target_files === void 0 ? void 0 : _e_target_files[0]; if (file) uploadAndSendImage(file); } }), " ", msgLimit && msgLimit.left !== null && msgLimit.left <= 0 && /*#__PURE__*/ _jsxs("div", { className: "mb-2 flex items-center gap-2 bg-red-50 border border-red-200 rounded-xl px-3 py-2", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-red-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 9v2m0 4h.01M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z" }) }), /*#__PURE__*/ _jsx("span", { className: "text-xs text-red-700 flex-1", children: t('chat.limit_reached', 'Daily message limit reached') }), /*#__PURE__*/ _jsx(Link, { href: "/pricing", className: "text-xs font-medium text-red-700 underline", children: t('dashboard.plan.upgrade', 'Upgrade plan') }) ] }), msgLimit && msgLimit.left !== null && msgLimit.left > 0 && msgLimit.left <= Math.ceil((msgLimit.left + msgLimit.sent) * 0.2) && /*#__PURE__*/ _jsxs("div", { className: "mb-2 flex items-center gap-2 bg-amber-50 border border-amber-200 rounded-xl px-3 py-2", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-amber-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 9v2m0 4h.01M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z" }) }), /*#__PURE__*/ _jsx("span", { className: "text-xs text-amber-700 flex-1", children: t('chat.limit_warning', '{n} messages left today').replace('{n}', String(msgLimit.left)) }), /*#__PURE__*/ _jsx(Link, { href: "/pricing", className: "text-xs font-medium text-amber-700 underline", children: t('dashboard.plan.upgrade', 'Upgrade plan') }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-2 items-end", children: [ /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>{ var _fileInputRef_current; return (_fileInputRef_current = fileInputRef.current) === null || _fileInputRef_current === void 0 ? void 0 : _fileInputRef_current.click(); }, disabled: uploadingImage || !connected || !!(msgLimit && msgLimit.left !== null && msgLimit.left <= 0), className: "h-10 w-10 text-gray-400 hover:text-gray-500 disabled:opacity-40 disabled:cursor-not-allowed flex-shrink-0 flex items-center justify-center rounded-xl hover:bg-gray-50 transition", title: "Send photo", children: uploadingImage ? /*#__PURE__*/ _jsxs("svg", { className: "w-5 h-5 animate-spin", fill: "none", viewBox: "0 0 24 24", children: [ /*#__PURE__*/ _jsx("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }), /*#__PURE__*/ _jsx("path", { className: "opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8v8H4z" }) ] }) : /*#__PURE__*/ _jsxs("svg", { className: "w-5 h-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: [ /*#__PURE__*/ _jsx("rect", { x: "3", y: "3", width: "18", height: "18", rx: "3", ry: "3" }), /*#__PURE__*/ _jsx("circle", { cx: "8.5", cy: "8.5", r: "1.5" }), /*#__PURE__*/ _jsx("polyline", { points: "21 15 16 10 5 21" }) ] }) }), /*#__PURE__*/ _jsx("textarea", { ref: inputRef, value: input, onChange: (e)=>setInput(e.target.value), onKeyDown: handleKeyDown, rows: 1, placeholder: t('chat.placeholder'), disabled: !!(msgLimit && msgLimit.left !== null && msgLimit.left <= 0), className: "flex-1 border border-gray-300 rounded-xl px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 resize-none max-h-32 disabled:bg-gray-50 disabled:text-gray-400", style: { minHeight: '40px' } }), /*#__PURE__*/ _jsx("button", { onClick: sendMessage, disabled: !input.trim() || !connected || !!(msgLimit && msgLimit.left !== null && msgLimit.left <= 0), className: "h-10 w-10 bg-green-600 text-white rounded-xl hover:bg-green-700 disabled:opacity-40 disabled:cursor-not-allowed flex-shrink-0 flex items-center justify-center", children: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 12h14M12 5l7 7-7 7" }) }) }) ] }) ] }) ] }) }) ] }); } export default function ChatPage() { return /*#__PURE__*/ _jsx(Suspense, { fallback: /*#__PURE__*/ _jsx("div", { className: "text-center py-20 text-white", children: "..." }), children: /*#__PURE__*/ _jsx(ChatPageInner, {}) }); } ` 6ÿÿÿ7ÿÿÿ  8ÿÿÿbýÿÿÙýÿÿ±þ À ÁÂÃŽwebpack/DefinePlugin process.env.NEXT_PUBLIC_API_URLØ"https://api.canhelp.gr"45f60c08e34c84ba Æ^ýÿÿ  Ç ChatPageInner‡API_URL‰*default*ˆChatPage •mÿyBËýÿÿÑýÿÿ `  dÿÿý€ `=@“ a=@“€ A”ß `K€ Aà `=€ A; `€ A<d `(€ Ae’ `-€ A“Ø `E€ AÙ  `3€ A 3 `&á ADc b /0 Ag~ b J A#©1ª A©1ª @®@¶ @„³³ a=@“YýÿÿYýÿÿ `Knext/navigationÿ `=‰next/linkÿ `Š@/lib/authÿ `(@/context/localeÿ `-‰@/lib/apiÿ `E@/lib/formatNameÿ `3 PýÿÿPýÿÿ `&±webpack/lib/dependencies/PureExpressionDependencya AD~ ‡default  `J ‰useRouterþ A'   ùêêý c   useSearchParamsþ ADS  úååþ c( ŠuseSessionþ A€Š  õääþ c)3 ‰useLocaleþ Aš±  ðááþ c# Ž AÓÛ  ì/ýÿÿ/ýÿÿþ c& ‹Š A   è+ýÿÿ+ýÿÿþ c,4 ‡† AIQ  ä'ýÿÿ'ýÿÿþ c,4 ƒ‚ A}…  à#ýÿÿ#ýÿÿþ c$, ÿÿÿ~ÿÿÿ AœÅ  Üýÿÿýÿÿþ c2: {ÿÿÿzÿÿÿ Aìô  Øýÿÿýÿÿþ c& wÿÿÿvÿÿÿ A (  Ôýÿÿýÿÿþ c&. sÿÿÿrÿÿÿ AU]  Ðýÿÿýÿÿþ c$, oÿÿÿnÿÿÿ A•  Ìýÿÿýÿÿþ c08 kÿÿÿjÿÿÿ AÐØ  È ýÿÿ ýÿÿþ c*2 †useRefþ Aöü  Ãýÿÿýÿÿþ c ûú A%  ¿ýÿÿýÿÿþ c! ÷ö ABH  »þüÿÿþüÿÿþ c óò Aio  ·úüÿÿúüÿÿþ c \ÿÿÿ[ÿÿÿ A{„  ³öüÿÿöüÿÿþ c  XÿÿÿWÿÿÿ A  ¯òüÿÿòüÿÿþ c&&  ŒgetChatRoomsþ AKW  ªþ c(( getDailyUsageþ Akx  ¥˜˜þ c-- JÿÿÿIÿÿÿ Ak t   ¡äüÿÿäüÿÿþ c55  ‚ioþ A° ²   œ ãüÿÿãüÿÿþ c77 Aÿÿÿ@ÿÿÿ A…Ž  ˜ÛüÿÿÛüÿÿþ @†@†`  ‹getMessagesþ A0;  “††þ @‹@‹` 8ÿÿÿ7ÿÿÿ AOX  ÒüÿÿÒüÿÿþ @’@’`  4ÿÿÿ3ÿÿÿ Aêó  ‹ÎüÿÿÎüÿÿþ @@`  0ÿÿÿ/ÿÿÿ ALU  ‡ÊüÿÿÊüÿÿþ @§@§`  ‹useCallbackþ AVa  ‚ÅüÿÿÅüÿÿþ @®`@®`# ûú Aò!ý!  ~ÿÿÿÁüÿÿÁüÿÿþ @Ã`@Ã`* (ÿÿÿ)ÿÿÿ AÍ)Ñ)  zÿÿÿÿÿÿÿÿÿþ @ý`@ý`! „jsxs…_jsxs Ax+}+  tÿÿÿÿÿÿÿÿÿþ @`@` úû A, ,  pÿÿÿ ÿÿÿ ÿÿÿþ @`@` ö÷ AÎ,Ó,  lÿÿÿÿÿÿÿÿÿþ @ `"@ `' ÿÿÿÿÿÿ An-r-  hÿÿÿÿÿÿÿÿÿþ @`*@`. îï AK.P.  dÿÿÿÿÿÿÿÿÿþ @`*@`/ ÿÿÿÿÿÿ A/ /  `ÿÿÿüþÿÿüþÿÿþ @`2@`6  ÿÿÿ ÿÿÿ Aì/ð/  \ÿÿÿøþÿÿøþÿÿþ @`2@`6 ÿÿÿÿÿÿ An1r1  Xÿÿÿôþÿÿôþÿÿþ @ `"@ `& ÿÿÿÿÿÿ Aþ12  Tÿÿÿðþÿÿðþÿÿþ @"`E@"`I formatShortNameþ A'464  OÿÿÿDÿÿÿDÿÿÿþ C)š)· ûú A_5n5  Kÿÿÿ@ÿÿÿ@ÿÿÿþ @*`3@*`B ÑÒ AÜ6á6  Gÿÿÿãþÿÿãþÿÿþ @,`1@,`6 ÍÎ Aó9ø9  Cÿÿÿßþÿÿßþÿÿþ @6`2@6`7 íþÿÿîþÿÿ AÍ:Ñ:  ?ÿÿÿÛþÿÿÛþÿÿþ @9`:@9`> éþÿÿêþÿÿ A <<  ;ÿÿÿ×þÿÿ×þÿÿþ @=`I@=`M åþÿÿæþÿÿ Až=¢=  7ÿÿÿÓþÿÿÓþÿÿþ @C`@@C`D áþÿÿâþÿÿ AÕ?Ù?  3ÿÿÿÏþÿÿÏþÿÿþ @F`>@F`B ÝþÿÿÞþÿÿ AbAfA  /ÿÿÿËþÿÿËþÿÿþ @P`@P` ÙþÿÿÚþÿÿ ABB  +ÿÿÿÇþÿÿÇþÿÿþ @R`8@R`< ±² AÖBÛB  'ÿÿÿÃþÿÿÃþÿÿþ @U`#@U`( ˆFragment‰_Fragment AÜBåB 4!ÿÿÿœþÿÿœþÿÿþ @U`)@U`2 ËþÿÿÌþÿÿ A/C3C  ÿÿÿ¹þÿÿ¹þÿÿþ @W`&@W`* ÇþÿÿÈþÿÿ AŸCÂC  ÿÿÿµþÿÿµþÿÿþ @Y`4@Y`8 ÅÄ AQE`E  ÿÿÿ ÿÿÿ ÿÿÿþ C[5[D ›œ AhHmH  ÿÿÿ­þÿÿ­þÿÿþ @^`s@^`x  ÿÿÿ„Link AnHrH 4 ÿÿÿùþÿÿùþÿÿþ @^`y@^`} ¶þÿÿ·þÿÿ AœIÁI  ÿÿÿ€þÿÿ€þÿÿþ @b`.@b`2 Ž AˆJJ  ÿÿÿ þÿÿ þÿÿþ @d`<@d`A ®þÿÿ¯þÿÿ A»L¿L  ÿÿÿœþÿÿœþÿÿþ @m`:@m`> ªþÿÿ«þÿÿ A¬M°M  üþÿÿ˜þÿÿ˜þÿÿþ @p`:@p`> ‚ƒ AçOìO  øþÿÿ”þÿÿ”þÿÿþ @{`.@{`3 ¢þÿÿ£þÿÿ AP¡P  ôþÿÿþÿÿþÿÿþ @~`6@~`: žþÿÿŸþÿÿ A³Q·Q  ðþÿÿŒþÿÿŒþÿÿþ @‚`6@‚`: šþÿÿ›þÿÿ A+S/S  ìþÿÿˆþÿÿˆþÿÿþ @ˆ`.@ˆ`2 –þÿÿ—þÿÿ A U$U  èþÿÿ„þÿÿ„þÿÿþ @`<@`@ nÿÿÿoÿÿÿ AV#V  äþÿÿ€þÿÿ€þÿÿþ @–`&@–`+ Žþÿÿþÿÿ AêVîV  àþÿÿ|þÿÿ|þÿÿþ @™`@@™`D Šþÿÿ‹þÿÿ AßWãW  Üþÿÿxþÿÿxþÿÿþ @œ`K@œ`O bÿÿÿcÿÿÿ AXZ]Z  Øþÿÿtþÿÿtþÿÿþ @€`9@€`> ‚þÿÿƒþÿÿ A@[D[  Ôþÿÿpþÿÿpþÿÿþ @§`:@§`> ~þÿÿþÿÿ A—\›\  Ðþÿÿlþÿÿlþÿÿþ C©‰© VÿÿÿWÿÿÿ Aˆ__  Ìþÿÿhþÿÿhþÿÿþ @¯`:@¯`? vþÿÿwþÿÿ A¬`°`  Èþÿÿdþÿÿdþÿÿþ @²`K@²`O tÿÿÿsÿÿÿ A^ama  Äþÿÿ¹þÿÿ¹þÿÿþ @Ž`B@Ž`Q nþÿÿoþÿÿ A»b¿b  Àþÿÿ\þÿÿ\þÿÿþ @¶`U@¶`Y jþÿÿkþÿÿ AEdId  ŒþÿÿXþÿÿXþÿÿþ @º`P@º`T fþÿÿgþÿÿ A6f:f  žþÿÿTþÿÿTþÿÿþ @¿`G@¿`K bþÿÿcþÿÿ Aàhäh  ŽþÿÿPþÿÿPþÿÿþ @Ã`B@Ã`F ^þÿÿ_þÿÿ Aìkðk  °þÿÿLþÿÿLþÿÿþ @Ï`.@Ï`2 Zþÿÿ[þÿÿ AÄlÈl  ¬þÿÿHþÿÿHþÿÿþ @Ô`5@Ô`9 2ÿÿÿ3ÿÿÿ AÀmÅm  šþÿÿDþÿÿDþÿÿþ @×`4@×`9 RþÿÿSþÿÿ AÁnÅn  €þÿÿ@þÿÿ@þÿÿþ @Û`2@Û`6 NþÿÿOþÿÿ App   þÿÿ<þÿÿ<þÿÿþ @à`2@à`6 JþÿÿKþÿÿ Ažq¢q  œþÿÿ8þÿÿ8þÿÿþ @ä`@@ä`D FþÿÿGþÿÿ A>sBs  ˜þÿÿ4þÿÿ4þÿÿþ @ê`D@ê`H BþÿÿCþÿÿ AÜtàt  ”þÿÿ0þÿÿ0þÿÿþ @ñ`2@ñ`6 >þÿÿ?þÿÿ AUwYw  þÿÿ,þÿÿ,þÿÿþ @ù`@@ù`D :þÿÿ;þÿÿ Aóx÷x  Œþÿÿ(þÿÿ(þÿÿþ @ÿ`D@ÿ`H ÿÿÿÿÿÿ A{ {  ˆþÿÿ$þÿÿ$þÿÿþ @ `&@ `+ 2þÿÿ3þÿÿ Aí{ñ{  „þÿÿ þÿÿ þÿÿþ @ `.@ `2  ÿÿÿ ÿÿÿ A:?  €þÿÿþÿÿþÿÿþ @`j@`o *þÿÿ+þÿÿ A3€7€  |þÿÿþÿÿþÿÿþ @`6@`: &þÿÿ'þÿÿ Aف݁  xþÿÿþÿÿþÿÿþ @"`D@"`H "þÿÿ#þÿÿ A¢ƒŠƒ  tþÿÿþÿÿþÿÿþ @(`6@(`: þÿÿþÿÿ Aքڄ  pþÿÿ þÿÿ þÿÿþ @,`6@,`:_ÿÿÿ`ÿÿÿ Aۄ߄ 4mþÿÿZþÿÿZþÿÿþ @,`;@,`? óþÿÿôþÿÿ A ‡‡  iþÿÿþÿÿþÿÿþ C3®3³ þÿÿþÿÿ Aˆ ˆ  eþÿÿþÿÿþÿÿþ @6`6@6`: þÿÿþÿÿ A°‰Ž‰  aþÿÿýýÿÿýýÿÿþ @<`D@<`H  þÿÿ þÿÿ Ay‹}‹  ]þÿÿùýÿÿùýÿÿþ @B`6@B`: þÿÿþÿÿ AьՌ  Yþÿÿõýÿÿõýÿÿþ @F`6@F`:HÿÿÿIÿÿÿ A֌ڌ 4VþÿÿCþÿÿCþÿÿþ @F`;@F`? ÜþÿÿÝþÿÿ AˆŽŽ  Rþÿÿîýÿÿîýÿÿþ @M`.@M`3 üýÿÿýýÿÿ ADH  Nþÿÿêýÿÿêýÿÿþ @P`6@P`: ÔþÿÿÕþÿÿ A““  Jþÿÿæýÿÿæýÿÿþ @Y`U@Y`Z ôýÿÿõýÿÿ A}””  Fþÿÿâýÿÿâýÿÿþ @^`B@^`F ðýÿÿñýÿÿ A·–»–  BþÿÿÞýÿÿÞýÿÿþ @f`B@f`F ÈþÿÿÉþÿÿ Aa˜f˜  >þÿÿÚýÿÿÚýÿÿþ @l`?@l`D èýÿÿéýÿÿ ABšFš  :þÿÿÖýÿÿÖýÿÿþ @s`B@s`F äýÿÿåýÿÿ AWœ[œ  6þÿÿÒýÿÿÒýÿÿþ @{`B@{`F àýÿÿáýÿÿ A©­  2þÿÿÎýÿÿÎýÿÿþ @€`B@€`F ÜýÿÿÝýÿÿ A Ÿ Ÿ  .þÿÿÊýÿÿÊýÿÿþ @†`6@†`: ØýÿÿÙýÿÿ A££  *þÿÿÆýÿÿÆýÿÿþ @“`6@“`: ÔýÿÿÕýÿÿ A¥¥  &þÿÿÂýÿÿÂýÿÿþ @—`D@—`H ÐýÿÿÑýÿÿ AŠƊ  "þÿÿŸýÿÿŸýÿÿþ @`H@`Lêýÿÿþÿÿ @®@¶ ËýÿÿÌýÿÿ AR©V©   þÿÿžýÿÿžýÿÿý @¯`@¯` ˆSuspenseþ AW©_© 4úZûÿÿZûÿÿþ @¯`@¯`& ÁýÿÿÂýÿÿ Aƒ©‡©  ö¯ýÿÿ¯ýÿÿþ @°` @°`$ œýÿÿŸýÿÿ Aªª  ò«ýÿÿ«ýÿÿþ @Ž` @Ž`$   ÉÞ/* __next_internal_client_entry_do_not_use__ default auto */ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime"; import { useEffect, useState } from 'react'; import { useRouter, useSearchParams } from 'next/navigation'; import Link from 'next/link'; import { useSession } from '@/lib/auth'; import { useLocale } from '@/context/locale'; import { getMyTasks, getMyOffers, getMyReviews, getNotifications, getMyDashboard, getSpecialistFomoDashboard, getCustomerFomoDashboard, getMySpecialistCards, applyMyReferral } from '@/lib/api'; import { formatPrice, taskTitle } from '@/lib/taskLocale'; import { PlanBadge } from '@/components/PlanBadge'; import { UsageMeter } from '@/components/UsageMeter'; /** Extract the quoted task title from a stored notification body (any locale) */ function extractNotifParam(body) { if (!body) return null; const m = body.match(/[«""](.+?)[»""]/); var _m_; return (_m_ = m === null || m === void 0 ? void 0 : m[1]) !== null && _m_ !== void 0 ? _m_ : null; } function PlanBlock(param) { let { dashboard, t } = param; const plan = dashboard.plan; const expiry = dashboard.planExpiration; const usage = dashboard.usage; const stats = dashboard.stats; const expiryPct = expiry ? Math.max(0, Math.min(100, Math.round(expiry.daysLeft / 30 * 100))) : 100; const expiryColor = expiry ? expiry.daysLeft <= 3 ? 'bg-red-500' : expiry.daysLeft <= 7 ? 'bg-amber-400' : 'bg-green-400' : 'bg-green-400'; return /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-2xl border border-gray-200 p-5 mb-6", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between mb-4", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2", children: [ /*#__PURE__*/ _jsx("h2", { className: "font-semibold text-gray-800 text-sm", children: t('dashboard.plan.title', 'My Plan') }), plan ? /*#__PURE__*/ _jsx(PlanBadge, { tier: plan.tier, size: "sm" }) : /*#__PURE__*/ _jsx("span", { className: "text-xs text-gray-400", children: t('dashboard.plan.no_plan', 'Free') }) ] }), /*#__PURE__*/ _jsx(Link, { href: "/pricing", className: "text-xs font-medium text-green-600 hover:underline", children: (plan === null || plan === void 0 ? void 0 : plan.tier) === 'ultimate' ? null : t('dashboard.plan.upgrade', 'Upgrade') }) ] }), expiry && /*#__PURE__*/ _jsxs("div", { className: "mb-4", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex justify-between text-xs text-gray-500 mb-1", children: [ /*#__PURE__*/ _jsx("span", { children: t('dashboard.plan.expires', 'Expires in {n} days').replace('{n}', String(expiry.daysLeft)) }), /*#__PURE__*/ _jsxs("span", { children: [ expiry.daysLeft, " ", t('pricing.days', 'days') ] }) ] }), /*#__PURE__*/ _jsx("div", { className: "h-1.5 rounded-full bg-gray-100", children: /*#__PURE__*/ _jsx("div", { className: "h-full rounded-full transition-all ".concat(expiryColor), style: { width: "".concat(expiryPct, "%") } }) }) ] }), (usage.messagesSent !== undefined || usage.ordersMade !== undefined) && /*#__PURE__*/ _jsxs("div", { className: "space-y-2 mb-4", children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs font-medium text-gray-500 uppercase tracking-wide", children: t('dashboard.plan.limits', 'Daily limits') }), /*#__PURE__*/ _jsx(UsageMeter, { current: usage.messagesSent, limit: usage.messagesLeft !== null ? usage.messagesSent + usage.messagesLeft : null, label: t('dashboard.plan.messages', 'Messages') }), /*#__PURE__*/ _jsx(UsageMeter, { current: usage.ordersMade, limit: usage.ordersLeft !== null ? usage.ordersMade + usage.ordersLeft : null, label: t('dashboard.plan.orders', 'Orders') }) ] }), Object.keys(stats).length > 0 && /*#__PURE__*/ _jsx("div", { className: "grid grid-cols-2 gap-2", children: Object.entries(stats).map((param)=>{ let [key, val] = param; return /*#__PURE__*/ _jsxs("div", { className: "bg-gray-50 rounded-xl px-3 py-2 text-center", children: [ /*#__PURE__*/ _jsx("p", { className: "text-lg font-bold text-gray-800", children: val }), /*#__PURE__*/ _jsx("p", { className: "text-[10px] text-gray-400 uppercase tracking-wide", children: t("dashboard.stats.".concat(key), key) }) ] }, key); }) }) ] }); } export default function DashboardPage() { var _session_user, _fomoData_topCategories; const { data: session, isPending } = useSession(); const router = useRouter(); const searchParams = useSearchParams(); const { t, locale } = useLocale(); const [tasks, setTasks] = useState([]); const [offers, setOffers] = useState([]); const [myReviews, setMyReviews] = useState([]); const [invitations, setInvitations] = useState([]); const [loading, setLoading] = useState(true); const [dashboard, setDashboard] = useState(null); const [fomoData, setFomoData] = useState(null); const [hasHelperCard, setHasHelperCard] = useState(null); useEffect(()=>{ if (!isPending && !session) router.push('/login'); }, [ session, isPending ]); // Apply pending referral code after Google OAuth redirect (?ref=CODE) useEffect(()=>{ if (!session) return; const refCode = searchParams.get('ref'); if (!refCode) return; applyMyReferral(refCode).catch(()=>{}); // Remove the ref param from the URL without reloading const params = new URLSearchParams(searchParams.toString()); params.delete('ref'); const newUrl = params.toString() ? "?".concat(params.toString()) : window.location.pathname; router.replace(newUrl); }, [ session ]); // Detect whether the user has completed their helper profile (has a card). // Used to show the getting-started onboarding card to users who haven't yet. useEffect(()=>{ if (!session) return; getMySpecialistCards().then((param)=>{ let { cards } = param; return setHasHelperCard(cards.length > 0); }).catch(()=>setHasHelperCard(null)); }, [ session ]); useEffect(()=>{ if (!session) return; Promise.all([ getMyTasks(), getMyOffers(), getMyReviews(), getNotifications(), getMyDashboard() ]).then((param)=>{ let [t, o, r, notifs, dash] = param; setTasks(t); setOffers(o); setMyReviews(r); setInvitations(notifs.filter((n)=>n.type === 'task_invite')); setDashboard(dash); }).catch(()=>{}).finally(()=>setLoading(false)); }, [ session ]); useEffect(()=>{ var _session_user; if (!session) return; const role = (_session_user = session.user) === null || _session_user === void 0 ? void 0 : _session_user.role; if (role === 'specialist') { getSpecialistFomoDashboard().then(setFomoData).catch(()=>{}); } else { getCustomerFomoDashboard().then(setFomoData).catch(()=>{}); } }, [ session ]); if (isPending || loading) return /*#__PURE__*/ _jsx("div", { className: "text-center py-20 text-white", children: t('common.loading') }); const dateLocale = locale === 'ru' ? 'ru-RU' : locale === 'uk' ? 'uk-UA' : locale === 'en' ? 'en-US' : 'el-GR'; const activeTasks = tasks.filter((task)=>task.status !== 'completed' && task.status !== 'cancelled'); const completedTasks = tasks.filter((task)=>task.status === 'completed' || task.status === 'cancelled'); const activeOffers = offers.filter((row)=>{ const offer = row.offer || row; const task = row.task; return offer.status !== 'other_accepted' && (task === null || task === void 0 ? void 0 : task.status) !== 'completed' && (task === null || task === void 0 ? void 0 : task.status) !== 'cancelled'; }); const completedOffers = offers.filter((row)=>{ const offer = row.offer || row; const task = row.task; return offer.status === 'other_accepted' || (task === null || task === void 0 ? void 0 : task.status) === 'completed' || (task === null || task === void 0 ? void 0 : task.status) === 'cancelled'; }); function TaskCard(param) { let { task } = param; var _task_offerCount; const offerCount = (_task_offerCount = task.offerCount) !== null && _task_offerCount !== void 0 ? _task_offerCount : 0; var _task_declinedCount; const declinedCount = (_task_declinedCount = task.declinedCount) !== null && _task_declinedCount !== void 0 ? _task_declinedCount : 0; const activeOfferCount = offerCount - declinedCount; return /*#__PURE__*/ _jsx(Link, { href: "/tasks/".concat(task.id), className: "block bg-white rounded-xl border border-gray-200 p-4 hover:shadow-sm hover:border-green-300 transition", children: /*#__PURE__*/ _jsxs("div", { className: "flex justify-between items-start", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ _jsx("p", { className: "font-medium text-gray-900 truncate", children: taskTitle(task, locale) }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-1", children: new Date(task.createdAt).toLocaleDateString(dateLocale) }), offerCount > 0 && /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 mt-1.5", children: [ /*#__PURE__*/ _jsxs("span", { className: "text-xs text-green-600 font-medium", children: [ "\uD83D\uDCBC ", offerCount, " ", t('dashboard.offers_count', 'offers') ] }), declinedCount > 0 && /*#__PURE__*/ _jsxs("span", { className: "text-xs text-red-400", children: [ "✕ ", declinedCount, " ", t('dashboard.declined_count', 'declined') ] }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "ml-3 text-right shrink-0", children: [ /*#__PURE__*/ _jsx("span", { className: "text-xs px-2 py-0.5 rounded-full ".concat(task.status === 'open' ? 'bg-green-100 text-green-700' : task.status === 'in_progress' ? 'bg-green-100 text-green-700' : task.status === 'completed' ? 'bg-gray-100 text-gray-600' : 'bg-red-100 text-red-600'), children: t("task.status.".concat(task.status), task.status) }), task.budget && /*#__PURE__*/ _jsxs("p", { className: "text-sm font-bold text-green-600 mt-1", children: [ formatPrice(task.budget), "€" ] }) ] }) ] }) }); } function OfferCard(param) { let { row } = param; var _myReviews_find; const offer = row.offer || row; const task = row.task; var _myReviews_find_review; const reviewReceived = (task === null || task === void 0 ? void 0 : task.status) === 'completed' && offer.status === 'accepted' ? (_myReviews_find_review = (_myReviews_find = myReviews.find((r)=>{ var _r_review; return ((_r_review = r.review) === null || _r_review === void 0 ? void 0 : _r_review.taskId) === (task === null || task === void 0 ? void 0 : task.id); })) === null || _myReviews_find === void 0 ? void 0 : _myReviews_find.review) !== null && _myReviews_find_review !== void 0 ? _myReviews_find_review : null : null; return /*#__PURE__*/ _jsxs(Link, { href: task ? "/tasks/".concat(task.id) : '#', className: "block bg-white rounded-xl border border-gray-200 p-4 hover:shadow-sm hover:border-green-300 transition", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex justify-between items-start", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ _jsx("p", { className: "font-medium text-gray-900 truncate", children: (task === null || task === void 0 ? void 0 : task.title) || t('chat.task_fallback') }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-1", children: new Date(offer.createdAt).toLocaleDateString(dateLocale) }) ] }), /*#__PURE__*/ _jsxs("div", { className: "ml-3 text-right shrink-0", children: [ /*#__PURE__*/ _jsxs("p", { className: "font-bold text-green-600", children: [ formatPrice(offer.price), "€" ] }), /*#__PURE__*/ _jsx("span", { className: "text-xs px-2 py-0.5 rounded-full mt-1 inline-block ".concat(offer.status === 'accepted' ? 'bg-green-100 text-green-700' : offer.status === 'declined' ? 'bg-red-100 text-red-700' : offer.status === 'other_accepted' ? 'bg-green-100 text-green-600' : 'bg-gray-100 text-gray-700'), children: t("offer.status.".concat(offer.status), offer.status) }) ] }) ] }), reviewReceived && /*#__PURE__*/ _jsxs("div", { className: "mt-3 pt-3 border-t border-gray-100 flex items-center gap-2", children: [ /*#__PURE__*/ _jsx("div", { className: "flex gap-0.5", children: [ 1, 2, 3, 4, 5 ].map((star)=>/*#__PURE__*/ _jsx("span", { className: "text-sm ".concat(star <= reviewReceived.rating ? 'text-yellow-400' : 'text-gray-200'), children: "★" }, star)) }), /*#__PURE__*/ _jsxs("span", { className: "text-sm font-semibold text-gray-700", children: [ reviewReceived.rating, "/5" ] }), reviewReceived.comment && /*#__PURE__*/ _jsx("span", { className: "text-xs text-gray-500 truncate", children: reviewReceived.comment }) ] }), (task === null || task === void 0 ? void 0 : task.status) === 'completed' && offer.status === 'accepted' && !reviewReceived && /*#__PURE__*/ _jsx("p", { className: "mt-2 text-xs text-gray-400", children: t('dashboard.review_pending') }) ] }); } const isSpecialist = (session === null || session === void 0 ? void 0 : (_session_user = session.user) === null || _session_user === void 0 ? void 0 : _session_user.role) === 'specialist'; var _fomoData_missedCount; return /*#__PURE__*/ _jsxs("div", { className: "max-w-5xl mx-auto px-4 py-8", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex justify-between items-center mb-8", children: [ /*#__PURE__*/ _jsx("h1", { className: "text-2xl font-bold text-white", children: t('dashboard.title') }), /*#__PURE__*/ _jsx(Link, { href: "/tasks/new", className: "bg-green-600 text-white px-4 py-2 rounded-lg text-sm font-medium hover:bg-green-700", children: t('dashboard.new_task') }) ] }), hasHelperCard === false && /*#__PURE__*/ _jsxs("div", { className: "mb-6 bg-white rounded-2xl border border-gray-200 overflow-hidden", children: [ /*#__PURE__*/ _jsxs("div", { className: "px-5 pt-5 pb-3", children: [ /*#__PURE__*/ _jsx("h2", { className: "text-lg font-bold text-gray-900", children: t('dashboard.onboarding.title') }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-500 mt-1", children: t('dashboard.onboarding.subtitle') }) ] }), /*#__PURE__*/ _jsxs("div", { className: "grid sm:grid-cols-2 gap-3 p-5 pt-2", children: [ /*#__PURE__*/ _jsxs(Link, { href: "/specialist-setup", className: "group flex flex-col rounded-xl border-2 border-green-500 bg-green-50 p-4 hover:bg-green-100 transition", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 mb-1", children: [ /*#__PURE__*/ _jsx("span", { className: "text-xl", children: "\uD83D\uDEE0" }), /*#__PURE__*/ _jsx("span", { className: "font-semibold text-gray-800", children: t('dashboard.onboarding.helper.title') }) ] }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-green-700/80 mb-3 flex-1", children: t('dashboard.onboarding.helper.desc') }), /*#__PURE__*/ _jsxs("span", { className: "inline-flex items-center gap-1 text-sm font-semibold text-green-700", children: [ t('dashboard.onboarding.helper.cta'), " →" ] }) ] }), /*#__PURE__*/ _jsxs(Link, { href: "/tasks/new", className: "group flex flex-col rounded-xl border border-gray-200 bg-gray-50 p-4 hover:bg-gray-100 transition", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 mb-1", children: [ /*#__PURE__*/ _jsx("span", { className: "text-xl", children: "\uD83D\uDCDD" }), /*#__PURE__*/ _jsx("span", { className: "font-semibold text-gray-800", children: t('dashboard.onboarding.requester.title') }) ] }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-500 mb-3 flex-1", children: t('dashboard.onboarding.requester.desc') }), /*#__PURE__*/ _jsxs("span", { className: "inline-flex items-center gap-1 text-sm font-semibold text-gray-700", children: [ t('dashboard.onboarding.requester.cta'), " →" ] }) ] }) ] }) ] }), dashboard && /*#__PURE__*/ _jsx(PlanBlock, { dashboard: dashboard, t: t }), fomoData && (isSpecialist ? (fomoData.missedCount > 0 || fomoData.missedEarnings > 0) && /*#__PURE__*/ _jsxs("div", { className: "mb-6 bg-amber-50 border border-amber-200 rounded-xl px-5 py-4 flex items-start gap-3", children: [ /*#__PURE__*/ _jsx("div", { className: "shrink-0 mt-0.5", children: /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5 text-amber-500", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 9v2m0 4h.01M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z" }) }) }), /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ _jsxs("p", { className: "text-base font-semibold text-amber-800", children: [ t('fomo.specialist_missed', 'You missed {n} tasks').replace('{n}', String((_fomoData_missedCount = fomoData.missedCount) !== null && _fomoData_missedCount !== void 0 ? _fomoData_missedCount : 0)), fomoData.missedEarnings > 0 && /*#__PURE__*/ _jsxs("span", { className: "ml-1 text-amber-600", children: [ "for €", fomoData.missedEarnings ] }) ] }), ((_fomoData_topCategories = fomoData.topCategories) === null || _fomoData_topCategories === void 0 ? void 0 : _fomoData_topCategories.length) > 0 && /*#__PURE__*/ _jsxs("p", { className: "text-sm text-amber-600 mt-0.5", children: [ t('fomo.top_categories', 'Categories'), ": ", fomoData.topCategories.slice(0, 3).join(', ') ] }) ] }), /*#__PURE__*/ _jsx(Link, { href: "/pricing", className: "shrink-0 text-xs font-medium text-amber-700 bg-amber-100 px-3 py-1.5 rounded-lg hover:bg-amber-200 transition", children: t('dashboard.plan.upgrade') }) ] }) : fomoData.totalTasks > 0 && /*#__PURE__*/ _jsx("div", { className: "mb-6 bg-green-50 border border-green-200 rounded-xl px-5 py-4", children: /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between gap-4 flex-wrap", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3", children: [ /*#__PURE__*/ _jsx("div", { className: "shrink-0 bg-green-100 rounded-xl p-2", children: /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5 text-green-600", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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" }) }) }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("p", { className: "text-base font-semibold text-gray-800", children: [ fomoData.totalOffers, " ", t('fomo.offers_received', 'offers received') ] }), fomoData.avgOffersPerTask > 0 && /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-500", children: t('fomo.avg_offers', 'Average {n}/task').replace('{n}', Number(fomoData.avgOffersPerTask).toFixed(1)) }) ] }) ] }), fomoData.completionRate !== undefined && /*#__PURE__*/ _jsxs("div", { className: "text-right", children: [ /*#__PURE__*/ _jsxs("p", { className: "text-2xl font-bold text-green-700", children: [ Math.round(fomoData.completionRate * 100), "%" ] }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-400", children: t('fomo.completion_rate', 'completed') }) ] }) ] }) })), isSpecialist && /*#__PURE__*/ _jsxs(Link, { href: "/tasks", className: "flex items-center justify-between gap-4 bg-green-600 text-white rounded-xl px-5 py-4 mb-8 hover:bg-green-700 transition", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-4", children: [ /*#__PURE__*/ _jsx("div", { className: "shrink-0 bg-white/20 rounded-xl p-2.5", children: /*#__PURE__*/ _jsxs("svg", { className: "w-6 h-6 text-white", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ _jsx("circle", { cx: "11", cy: "11", r: "7" }), /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M21 21l-4.35-4.35" }) ] }) }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "font-semibold text-base", children: t('find_tasks.title') }), /*#__PURE__*/ _jsx("p", { className: "text-green-100 text-sm mt-0.5", children: t('find_tasks.banner_hint') }) ] }) ] }), /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5 shrink-0 text-white/70", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 5l7 7-7 7" }) }) ] }), /*#__PURE__*/ _jsxs("div", { className: "grid md:grid-cols-2 gap-8", children: [ /*#__PURE__*/ _jsxs("div", { className: "space-y-8", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("h2", { className: "text-lg font-semibold text-white mb-4", children: [ t('dashboard.my_tasks'), " ", /*#__PURE__*/ _jsxs("span", { className: "text-white/60 font-normal text-base", children: [ "(", activeTasks.length, ")" ] }) ] }), activeTasks.length === 0 ? /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6 text-center text-gray-500", children: [ /*#__PURE__*/ _jsx("p", { children: t('dashboard.tasks.empty') }), /*#__PURE__*/ _jsx(Link, { href: "/tasks/new", className: "text-green-600 hover:underline text-sm mt-2 inline-block", children: t('dashboard.tasks.empty.cta') }) ] }) : /*#__PURE__*/ _jsx("div", { className: "space-y-3", children: activeTasks.map((task)=>/*#__PURE__*/ _jsx(TaskCard, { task: task }, task.id)) }) ] }), completedTasks.length > 0 && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("h2", { className: "text-lg font-semibold text-white/70 mb-4", children: [ t('dashboard.completed_tasks'), " ", /*#__PURE__*/ _jsxs("span", { className: "font-normal text-base text-white/50", children: [ "(", completedTasks.length, ")" ] }) ] }), /*#__PURE__*/ _jsx("div", { className: "space-y-3 opacity-75", children: completedTasks.map((task)=>/*#__PURE__*/ _jsx(TaskCard, { task: task }, task.id)) }) ] }) ] }), /*#__PURE__*/ _jsx("div", { className: "space-y-8", children: isSpecialist ? /*#__PURE__*/ _jsxs(_Fragment, { children: [ invitations.length > 0 && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("h2", { className: "text-lg font-semibold text-white mb-4", children: [ t('dashboard.invitations'), " ", /*#__PURE__*/ _jsxs("span", { className: "text-white/60 font-normal text-base", children: [ "(", invitations.length, ")" ] }) ] }), /*#__PURE__*/ _jsx("div", { className: "space-y-3", children: invitations.map((inv)=>/*#__PURE__*/ _jsxs(Link, { href: inv.referenceId ? "/tasks/".concat(inv.referenceId) : '/tasks', className: "flex items-start gap-3 p-4 rounded-xl border transition cursor-pointer ".concat(inv.isRead ? 'bg-white/90 border-white/20 hover:bg-white' : 'bg-white border-amber-300 shadow-sm hover:bg-amber-50'), children: [ /*#__PURE__*/ _jsx("span", { className: "text-2xl", children: "\uD83D\uDCCB" }), /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ _jsx("p", { className: "font-medium truncate ".concat(inv.isRead ? 'text-gray-600' : 'text-gray-900'), children: t('notif.type.task_invite', inv.title) }), inv.body && /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-500 mt-0.5 truncate", children: (()=>{ const title = extractNotifParam(inv.body); const tpl = t('notif.body.task_invite', ''); return title && tpl ? tpl.replace('{title}', title) : inv.body; })() }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-1", children: new Date(inv.createdAt).toLocaleDateString(dateLocale) }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex flex-col items-end gap-1.5 shrink-0", children: [ !inv.isRead && /*#__PURE__*/ _jsx("span", { className: "w-2 h-2 bg-amber-400 rounded-full mt-2" }), /*#__PURE__*/ _jsx("span", { className: "text-xs text-gray-400", children: "→" }) ] }) ] }, inv.id)) }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("h2", { className: "text-lg font-semibold text-white mb-4", children: [ t('dashboard.my_offers'), " ", /*#__PURE__*/ _jsxs("span", { className: "text-white/60 font-normal text-base", children: [ "(", activeOffers.length, ")" ] }) ] }), activeOffers.length === 0 ? /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6 text-center text-gray-500", children: [ /*#__PURE__*/ _jsx("p", { children: t('dashboard.offers.empty') }), /*#__PURE__*/ _jsx(Link, { href: "/tasks", className: "text-green-600 hover:underline text-sm mt-2 inline-block", children: t('dashboard.offers.empty.cta') }) ] }) : /*#__PURE__*/ _jsx("div", { className: "space-y-3", children: activeOffers.map((row)=>/*#__PURE__*/ _jsx(OfferCard, { row: row }, (row.offer || row).id)) }) ] }), completedOffers.length > 0 && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("h2", { className: "text-lg font-semibold text-white/70 mb-4", children: [ t('dashboard.completed_offers'), " ", /*#__PURE__*/ _jsxs("span", { className: "font-normal text-base text-white/50", children: [ "(", completedOffers.length, ")" ] }) ] }), /*#__PURE__*/ _jsx("div", { className: "space-y-3 opacity-75", children: completedOffers.map((row)=>/*#__PURE__*/ _jsx(OfferCard, { row: row }, (row.offer || row).id)) }) ] }) ] }) : /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs(Link, { href: "/specialists", className: "flex items-center justify-between gap-4 bg-green-600 text-white rounded-xl px-5 py-4 hover:bg-green-700 transition", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-4", children: [ /*#__PURE__*/ _jsx("div", { className: "shrink-0 bg-white/20 rounded-xl p-2.5", children: /*#__PURE__*/ _jsx("svg", { className: "w-6 h-6 text-white", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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" }) }) }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "font-semibold text-base", children: t('dashboard.customer.specialists_title') }), /*#__PURE__*/ _jsx("p", { className: "text-green-100 text-sm mt-0.5", children: t('dashboard.customer.specialists_hint') }) ] }) ] }), /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5 shrink-0 text-white/70", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 5l7 7-7 7" }) }) ] }), /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-5", children: [ /*#__PURE__*/ _jsx("h2", { className: "text-base font-semibold text-gray-800 mb-4", children: t('dashboard.customer.how_title') }), /*#__PURE__*/ _jsx("div", { className: "space-y-3", children: [ { num: '1', text: t('dashboard.customer.step1'), icon: 'M12 4v16m8-8H4' }, { num: '2', text: t('dashboard.customer.step2'), icon: 'M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z' }, { num: '3', text: t('dashboard.customer.step3'), icon: 'M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z' } ].map((param)=>{ let { num, text, icon } = param; return /*#__PURE__*/ _jsxs("div", { className: "flex items-start gap-3", children: [ /*#__PURE__*/ _jsx("span", { className: "shrink-0 w-7 h-7 rounded-full bg-green-100 text-green-600 text-sm font-bold flex items-center justify-center", children: num }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-600 pt-1", children: text }) ] }, num); }) }), /*#__PURE__*/ _jsxs(Link, { href: "/tasks/new", className: "mt-4 inline-block text-sm font-medium text-green-600 hover:underline", children: [ tasks.length > 0 ? t('dashboard.tasks.add_new') : t('dashboard.tasks.empty.cta'), " →" ] }) ] }) ] }) }) ] }) ] }); } `ýüÿÿþüÿÿ  ÿüÿÿ)ûÿÿÄûÿÿxýÿÿþ‡ýÿÿ ˆýÿÿ‰ýÿÿŠýÿÿ‹ýÿÿ780cd924025a0537ýÿÿ'ûÿÿ  ýÿÿ ‘extractNotifParam‰PlanBlockÉýÿÿDashboardPage •mÿyB¹ûÿÿŸûÿÿ `  dÿÿý€ `=@“ a=@“€ A”À `,€ AÁþ `=€ Aÿ `€ AE `(€ AFs `-€ At5 @Á€ A6p `:€ Aq€ `3€ A¥Ú `5 A2²Þ A#²Þ a|@Œ @Üýÿÿýÿÿ a=@“%ûÿÿ%ûÿÿ `,ÌýÿÿÌýÿÿ `=ÍýÿÿÍýÿÿ `ÎýÿÿÎýÿÿ `(ÏýÿÿÏýÿÿ `-ÐýÿÿÐýÿÿ @Á@/lib/taskLocaleÿ `: –@/components/PlanBadgeÿ `3 —@/components/UsageMeterÿ `5 ]þÿÿ^þÿÿ Aóø   Ìýÿÿnýÿÿnýÿÿý c XþÿÿYþÿÿ A{€  ûjýÿÿjýÿÿþ c TþÿÿUþÿÿ A   ÷fýÿÿfýÿÿþ c"' týÿÿuýÿÿ Aš¬  óbýÿÿbýÿÿþ c"*". pýÿÿqýÿÿ A§«  ï^ýÿÿ^ýÿÿþ c&1&5 ‰PlanBadgeþ A¬µ 4ê ããþ c&6&? gýÿÿhýÿÿ AD H   æUýÿÿUýÿÿþ c)/)3 cýÿÿdýÿÿ AX \   âQýÿÿQýÿÿþ c/"/& ­ýÿÿ€þÿÿ A] a  4Þžýÿÿžýÿÿþ c/'/+ 7þÿÿ8þÿÿ AÞ ã   ÚIýÿÿIýÿÿþ c6$6) 3þÿÿ4þÿÿ AN S   ÖEýÿÿEýÿÿþ c9"9' SýÿÿTýÿÿ A    ÒAýÿÿAýÿÿþ c<*<. +þÿÿ,þÿÿ Aß ä   Î=ýÿÿ=ýÿÿþ c?*?/ KýÿÿLýÿÿ ALP  Ê9ýÿÿ9ýÿÿþ cH"H& GýÿÿHýÿÿ AÏÓ  Æ5ýÿÿ5ýÿÿþ cJ0J4 þÿÿ þÿÿ Ay~  Â1ýÿÿ1ýÿÿþ cSbSg ?ýÿÿ@ýÿÿ Aó÷  Ÿ-ýÿÿ-ýÿÿþ cV"V& ;ýÿÿ<ýÿÿ Aæê  º)ýÿÿ)ýÿÿþ cZ"Z& ŠUsageMeterþ Aëõ 4µ °°þ cZ'Z1 2ýÿÿ3ýÿÿ A!  ± ýÿÿ ýÿÿþ c_"_&ø÷ A", 4® ©©þ c_'_1 +ýÿÿ,ýÿÿ A‚†  ªýÿÿýÿÿþ cf;f? þÿÿþÿÿ AY^  Šýÿÿýÿÿþ cj)j. #ýÿÿ$ýÿÿ A   ¢ýÿÿýÿÿþ cm*m. ýÿÿ ýÿÿ AÚÞ  ž ýÿÿ ýÿÿþ cq*q.oÿÿÿiýÿÿ a|@Œ výÿÿuýÿÿ Aа   eýÿÿZýÿÿZýÿÿý c~)~3 fýÿÿeýÿÿ AÇÐ  ûRýÿÿRýÿÿþ c hýÿÿgýÿÿ Aíü  ÷NýÿÿNýÿÿþ @€`@€`( nýÿÿmýÿÿ A#  óPýÿÿPýÿÿþ @`@`# þüÿÿýüÿÿ AEM  ïžúÿÿžúÿÿþ @‚`@‚`& úüÿÿùüÿÿ As{  ëšúÿÿšúÿÿþ @ƒ` @ƒ`( öüÿÿõüÿÿ A§¯  ç–úÿÿ–úÿÿþ @„`&@„`. òüÿÿñüÿÿ Aßç  ã’úÿÿ’úÿÿþ @…`*@…`2 îüÿÿíüÿÿ A  ߎúÿÿŽúÿÿþ @†`"@†`* êüÿÿéüÿÿ AEM  ÛŠúÿÿŠúÿÿþ @‡`&@‡`. æüÿÿåüÿÿ Ay  ׆úÿÿ†úÿÿþ @ˆ`$@ˆ`, âüÿÿáüÿÿ A·¿  Ó‚úÿÿ‚úÿÿþ @‰`.@‰`6 äüÿÿãüÿÿ AËÔ  Ï~úÿÿ~úÿÿþ @Š@Š`  àüÿÿßüÿÿ A™¢  Ëzúÿÿzúÿÿþ @‘@‘`  applyMyReferralþ A-  Æ%ýÿÿ%ýÿÿþ @•@•` ×üÿÿÖüÿÿ A4=  Âqúÿÿqúÿÿþ @ @ `  ”getMySpecialistCardsþ Aj~  œýÿÿýÿÿþ @¢@¢` ÎüÿÿÍüÿÿ A> G   ¹húÿÿhúÿÿþ @©@©`  ŠgetMyTasksþ AŽ ˜   Žýÿÿýÿÿþ @¬` @¬` ‹getMyOffersþ Aš ³   ¯ýÿÿýÿÿþ @­` @­` ŒgetMyReviewsþ AÃ Ï   ª ýÿÿ ýÿÿþ @®` @®` getNotificationsþ Aß ï   ¥ýÿÿýÿÿþ @¯` @¯` ŽgetMyDashboardþ Aÿ !   ÿüÿÿÿüÿÿþ @°` @°` ±üÿÿ°üÿÿ At"}"  œKúÿÿKúÿÿþ @Œ@Œ`  šgetSpecialistFomoDashboardþ Af#€#  —öüÿÿöüÿÿþ @Á` @Á`& ˜getCustomerFomoDashboardþ AÁ#Ù#  ’ñüÿÿñüÿÿþ @Ã` @Ã`$ šüÿÿ©üÿÿ A[$_$  Ž–üÿÿ–üÿÿþ @È`3@È`7 €üÿÿ¥üÿÿ A“*—*  Š’üÿÿ’üÿÿþ @à`@à`!Aÿÿÿæýÿÿ A˜*œ* 4‡àüÿÿàüÿÿþ @à`"@à`& yýÿÿzýÿÿ Ar+w+  ƒ‹üÿÿ‹üÿÿþ @ã`$@ã`) uýÿÿvýÿÿ Aþ+,  ÿÿÿ‡üÿÿ‡üÿÿþ @æ`"@æ`' •üÿÿ–üÿÿ A,”,  {ÿÿÿƒüÿÿƒüÿÿþ @é`*@é`. ‰taskTitleþ A- -  vÿÿÿÿÿÿÿÿÿþ @ë`*@ë`3 Œüÿÿüÿÿ Ay-}-  rÿÿÿzüÿÿzüÿÿþ @í`*@í`. dýÿÿeýÿÿ AŒ.‘.  nÿÿÿvüÿÿvüÿÿþ @ñ`<@ñ`A `ýÿÿaýÿÿ AF/K/  jÿÿÿrüÿÿrüÿÿþ @ô`2@ô`7 \ýÿÿ]ýÿÿ At1y1  fÿÿÿnüÿÿnüÿÿþ @ý`G@ý`L XýÿÿYýÿÿ AÝ3â3  bÿÿÿjüÿÿjüÿÿþ @ `"@ `' xüÿÿyüÿÿ Ay4}4  ^ÿÿÿfüÿÿfüÿÿþ @ `*@ `. PýÿÿQýÿÿ Ae6j6  Zÿÿÿbüÿÿbüÿÿþ @`9@`> ‹formatPriceþ A7!7  Uÿÿÿåþÿÿåþÿÿþ @`$@`/ GýÿÿHýÿÿ A;;  QÿÿÿYüÿÿYüÿÿþ @(`@(`"ÿÿÿ­ýÿÿ A;!; 4Nÿÿÿ§üÿÿ§üÿÿþ @(`#@(`' @ýÿÿAýÿÿ A<<  JÿÿÿRüÿÿRüÿÿþ @,`@,`# <ýÿÿ=ýÿÿ A®<³<  FÿÿÿNüÿÿNüÿÿþ @/`&@/`+ \üÿÿ]üÿÿ AL=P=  BÿÿÿJüÿÿJüÿÿþ @2`.@2`2 XüÿÿYüÿÿ A>…>  >ÿÿÿFüÿÿFüÿÿþ @6`.@6`2 0ýÿÿ1ýÿÿ AÄ?É?  :ÿÿÿBüÿÿBüÿÿþ @<`&@<`+ ,ýÿÿ-ýÿÿ Al@q@  6ÿÿÿ>üÿÿ>üÿÿþ @?`.@?`3 ÜÛ AA'A  2ÿÿÿÂþÿÿÂþÿÿþ @B`(@B`3 HüÿÿIüÿÿ AÚAÞA  .ÿÿÿ6üÿÿ6üÿÿþ @F`.@F`2  ýÿÿ!ýÿÿ AIDND  *ÿÿÿ2üÿÿ2üÿÿþ @N`0@N`5 @üÿÿAüÿÿ AûDÿD  &ÿÿÿ.üÿÿ.üÿÿþ @Q`&@Q`* <üÿÿ=üÿÿ ANFRF  "ÿÿÿ*üÿÿ*üÿÿþ @Y`8@Y`< ýÿÿýÿÿ A‚G‡G  ÿÿÿ&üÿÿ&üÿÿþ @^`&@^`+ 4üÿÿ5üÿÿ AÞHâH  ÿÿÿ"üÿÿ"üÿÿþ @e`@@e`D 0üÿÿ1üÿÿ AUJYJ  ÿÿÿüÿÿüÿÿþ Ckk¡ ýÿÿ ýÿÿ AL L  ÿÿÿüÿÿüÿÿþ @t`@t` ýÿÿýÿÿ AuLzL  ÿÿÿüÿÿüÿÿþ @w`@w` $üÿÿ%üÿÿ AM M   ÿÿÿüÿÿüÿÿþ @z`"@z`&  üÿÿ!üÿÿ AÉMÍM  ÿÿÿüÿÿüÿÿþ @~`"@~`&œþÿÿbýÿÿ AÎMÒM 4ÿÿÿ\üÿÿ\üÿÿþ @~`'@~`+ õüÿÿöüÿÿ A$O)O  ÿþÿÿüÿÿüÿÿþ @…`5@…`: ñüÿÿòüÿÿ AÐOÕO  ûþÿÿüÿÿüÿÿþ @ˆ`"@ˆ`' üÿÿüÿÿ AbPfP  ÷þÿÿÿûÿÿÿûÿÿþ @‹`*@‹`.  üÿÿüÿÿ AQQUQ  óþÿÿûûÿÿûûÿÿþ @`*@`. åüÿÿæüÿÿ AfRkR  ïþÿÿ÷ûÿÿ÷ûÿÿþ @•`"@•`' áüÿÿâüÿÿ A SS  ëþÿÿóûÿÿóûÿÿþ @˜`*@˜`/¢þÿÿGýÿÿ ASS 4èþÿÿAüÿÿAüÿÿþ @˜`0@˜`4 ÚüÿÿÛüÿÿ AHTMT  äþÿÿìûÿÿìûÿÿþ @œ`2@œ`7 úûÿÿûûÿÿ AUU  àþÿÿèûÿÿèûÿÿþ @Ÿ`:@Ÿ`> öûÿÿ÷ûÿÿ A!V%V  Üþÿÿäûÿÿäûÿÿþ @£`:@£`> òûÿÿóûÿÿ AžW¢W  Øþÿÿàûÿÿàûÿÿþ @©`2@©`6 ÊüÿÿËüÿÿ AžXœX  ÔþÿÿÜûÿÿÜûÿÿþ @­`2@­`7 ÆüÿÿÇüÿÿ A¶Z»Z  ÐþÿÿØûÿÿØûÿÿþ @¶`*@¶`/‡þÿÿ,ýÿÿ AŒZÀZ 4Íþÿÿ&üÿÿ&üÿÿþ @¶`0@¶`4 ¿üÿÿÀüÿÿ Aæ[ë[  ÉþÿÿÑûÿÿÑûÿÿþ @º`2@º`7 ßûÿÿàûÿÿ A¶\º\  ÅþÿÿÍûÿÿÍûÿÿþ @œ`:@œ`> ÛûÿÿÜûÿÿ AŸ]Â]  ÁþÿÿÉûÿÿÉûÿÿþ @Á`:@Á`> ×ûÿÿØûÿÿ A>_B_  œþÿÿÅûÿÿÅûÿÿþ @Ç`2@Ç`6 ¯üÿÿ°üÿÿ AW`\`  ¹þÿÿÁûÿÿÁûÿÿþ @Ë`2@Ë`7 ÏûÿÿÐûÿÿ AŠbªb  µþÿÿœûÿÿœûÿÿþ @Ø`'@Ø`+ §üÿÿšüÿÿ Avc{c  ±þÿÿ¹ûÿÿ¹ûÿÿþ @Ü`s@Ü`x ÇûÿÿÈûÿÿ A6d:d  ­þÿÿµûÿÿµûÿÿþ @ß`"@ß`& ÃûÿÿÄûÿÿ Aªd®d  ©þÿÿ±ûÿÿ±ûÿÿþ @á`0@á`4 ¿ûÿÿÀûÿÿ Aéeíe  ¥þÿÿ­ûÿÿ­ûÿÿþ @ç`4@ç`8 —üÿÿ˜üÿÿ Aegjg  ¡þÿÿ©ûÿÿ©ûÿÿþ @î`"@î`' “üÿÿ”üÿÿ A÷güg  þÿÿ¥ûÿÿ¥ûÿÿþ @ñ`*@ñ`/ üÿÿüÿÿ A¿iÄi  ™þÿÿ¡ûÿÿ¡ûÿÿþ @õ`Q@õ`V ‹üÿÿŒüÿÿ All  •þÿÿûÿÿûÿÿþ Cþ¿þÄ «ûÿÿ¬ûÿÿ Aúmþm  ‘þÿÿ™ûÿÿ™ûÿÿþ @`"@`&Hþÿÿíüÿÿ Aÿmn 4Žþÿÿçûÿÿçûÿÿþ @`'@`+ €ûÿÿ¥ûÿÿ Afojo  Šþÿÿ’ûÿÿ’ûÿÿþ @`:@`> |üÿÿ}üÿÿ Aøoýo  †þÿÿŽûÿÿŽûÿÿþ @`(@`- xüÿÿyüÿÿ A¡pŠp  ‚þÿÿŠûÿÿŠûÿÿþ @`&@`+ ˜ûÿÿ™ûÿÿ AHqLq  ~þÿÿ†ûÿÿ†ûÿÿþ @`.@`2 ”ûÿÿ•ûÿÿ Aéqíq  zþÿÿ‚ûÿÿ‚ûÿÿþ @`<@`@ ûÿÿ‘ûÿÿ Apsts  vþÿÿ~ûÿÿ~ûÿÿþ @`@@`D hüÿÿiüÿÿ A¢u§u  rþÿÿzûÿÿzûÿÿþ @%`.@%`3 düÿÿeüÿÿ Avv  nþÿÿvûÿÿvûÿÿþ @'`6@'`; „ûÿÿ…ûÿÿ AExIx  jþÿÿrûÿÿrûÿÿþ @/`W@/`[ \üÿÿ]üÿÿ A:z?z  fþÿÿnûÿÿnûÿÿþ @7`O@7`T XüÿÿYüÿÿ AÔzÙz  bþÿÿjûÿÿjûÿÿþ @:`.@:`3 xûÿÿyûÿÿ A\|`|  ^þÿÿfûÿÿfûÿÿþ @A`.@A`2 PüÿÿQüÿÿ AÅ}Ê}  Zþÿÿbûÿÿbûÿÿþ @J`*@J`/þÿÿ¶üÿÿ AË}Ï} 4Wþÿÿ°ûÿÿ°ûÿÿþ @J`0@J`4 IüÿÿJüÿÿ AÇ~Ì~  Sþÿÿ[ûÿÿ[ûÿÿþ @N`"@N`' iûÿÿjûÿÿ Abf  OþÿÿWûÿÿWûÿÿþ @Q`*@Q`. AüÿÿBüÿÿ Aü€  KþÿÿSûÿÿSûÿÿþ @S`8@S`= aûÿÿbûÿÿ A’–  GþÿÿOûÿÿOûÿÿþ @Z`6@Z`: ]ûÿÿ^ûÿÿ A€‚š‚  CþÿÿKûÿÿKûÿÿþ @_`6@_`: 5üÿÿ6üÿÿ A=„B„  ?þÿÿGûÿÿGûÿÿþ @g`*@g`/ UûÿÿVûÿÿ Aª„®„  ;þÿÿCûÿÿCûÿÿþ @i`2@i`6 QûÿÿRûÿÿ AŠ…ª…  7þÿÿ?ûÿÿ?ûÿÿþ @m`2@m`6 MûÿÿNûÿÿ A‡‡  3þÿÿ;ûÿÿ;ûÿÿþ @u`"@u`& IûÿÿJûÿÿ A?ˆCˆ  /þÿÿ7ûÿÿ7ûÿÿþ @{`0@{`4 !üÿÿ"üÿÿ AS‰X‰  +þÿÿ3ûÿÿ3ûÿÿþ @ƒ`@ƒ` üÿÿüÿÿ A؉݉  'þÿÿ/ûÿÿ/ûÿÿþ @†`"@†`' üÿÿüÿÿ AeŠjŠ  #þÿÿ+ûÿÿ+ûÿÿþ @‰`*@‰`/ üÿÿüÿÿ AҊ׊  þÿÿ'ûÿÿ'ûÿÿþ @‹`2@‹`7 üÿÿüÿÿ A Œ%Œ  þÿÿ#ûÿÿ#ûÿÿþ @`:@`?  üÿÿüÿÿ A‡ŽŒŽ  þÿÿûÿÿûÿÿþ @š`M@š`R -ûÿÿ.ûÿÿ Aƒ‡  þÿÿûÿÿûÿÿþ @`:@`> )ûÿÿ*ûÿÿ ANR  þÿÿûÿÿûÿÿþ @ `:@ `>Æýÿÿküÿÿ ASW 4 þÿÿeûÿÿeûÿÿþ @ `?@ `C "ûÿÿ#ûÿÿ Aÿ‘’  þÿÿûÿÿûÿÿþ @Š`7@Š`; ûÿÿûÿÿ A¥’©’  þÿÿ ûÿÿ ûÿÿþ @š`X@š`\ öûÿÿ÷ûÿÿ Aړߓ  þÿÿûÿÿûÿÿþ @®`G@®`L òûÿÿóûÿÿ AG”L”  üýÿÿûÿÿûÿÿþ @°`2@°`7 îûÿÿïûÿÿ AŸ•€•  øýÿÿûÿÿûÿÿþ @µ`:@µ`? ûÿÿûÿÿ Aî—ò—  ôýÿÿüúÿÿüúÿÿþ @¿`2@¿`6  ûÿÿ ûÿÿ A¢˜Š˜  ðýÿÿøúÿÿøúÿÿþ @Á`[@Á`_ ûÿÿûÿÿ Aã™ç™  ìýÿÿôúÿÿôúÿÿþ @É`"@É`& Þûÿÿßûÿÿ A`šeš  èýÿÿðúÿÿðúÿÿþ @Ë`?@Ë`D -üÿÿ.üÿÿ Afšoš 4äýÿÿìúÿÿìúÿÿþ @Ë`E@Ë`N Öûÿÿ×ûÿÿ Aãšèš  àýÿÿèúÿÿèúÿÿþ @Í`H@Í`M ÒûÿÿÓûÿÿ AX›]›  Üýÿÿäúÿÿäúÿÿþ @Ï`6@Ï`; ÎûÿÿÏûÿÿ AœœÂœ  Øýÿÿàúÿÿàúÿÿþ @Ô`>@Ô`C îúÿÿïúÿÿ A1Ÿ5Ÿ  ÔýÿÿÜúÿÿÜúÿÿþ @Þ`6@Þ`: ÆûÿÿÇûÿÿ Aޟ㟠 ÐýÿÿØúÿÿØúÿÿþ @à`[@à``‡ýÿÿ,üÿÿ AäŸèŸ 4Íýÿÿ&ûÿÿ&ûÿÿþ @à`a@à`e ãúÿÿäúÿÿ Aò¡ö¡  ÉýÿÿÑúÿÿÑúÿÿþ @ä`F@ä`J »ûÿÿŒûÿÿ A+£0£  ÅýÿÿÍúÿÿÍúÿÿþ @è`F@è`K ÛúÿÿÜúÿÿ A)€-€  ÁýÿÿÉúÿÿÉúÿÿþ @ë`N@ë`R ×úÿÿØúÿÿ Aç¥ë¥  œýÿÿÅúÿÿÅúÿÿþ @ï`Z@ï`^ ÓúÿÿÔúÿÿ A ©©  ¹ýÿÿÁúÿÿÁúÿÿþ @÷`N@÷`R «ûÿÿ¬ûÿÿ A ««  µýÿÿœúÿÿœúÿÿþ @ý`F@ý`K ËúÿÿÌúÿÿ A3¬7¬  ±ýÿÿ¹úÿÿ¹úÿÿþ @`]@`a ÇúÿÿÈúÿÿ AL­P­  ­ýÿÿµúÿÿµúÿÿþ @`N@`R Ÿûÿÿ ûÿÿ Aæ¯ë¯  ©ýÿÿ±úÿÿ±úÿÿþ @`.@`3 ›ûÿÿœûÿÿ A[°`°  ¥ýÿÿ­úÿÿ­úÿÿþ @`6@`; —ûÿÿ˜ûÿÿ AŸ±Ã±  ¡ýÿÿ©úÿÿ©úÿÿþ @`>@`C “ûÿÿ”ûÿÿ AOŽTŽ  ýÿÿ¥úÿÿ¥úÿÿþ @`R@`W ³úÿÿŽúÿÿ AWµ[µ  ™ýÿÿ¡úÿÿ¡úÿÿþ @"`>@"`B ¯úÿÿ°úÿÿ A/¶3¶  •ýÿÿúÿÿúÿÿþ @%`>@%`BLýÿÿñûÿÿ A4¶8¶ 4’ýÿÿëúÿÿëúÿÿþ @%`C@%`G šúÿÿ©úÿÿ Aõ·ù·  Žýÿÿ–úÿÿ–úÿÿþ @+`;@+`? €úÿÿ¥úÿÿ A£ž§ž  Šýÿÿ’úÿÿ’úÿÿþ @-`\@-`` |ûÿÿ}ûÿÿ Aþ¹º  †ýÿÿŽúÿÿŽúÿÿþ @3`L@3`Q xûÿÿyûÿÿ Asºxº  ‚ýÿÿŠúÿÿŠúÿÿþ @5`6@5`; tûÿÿuûÿÿ Aà»å»  ~ýÿÿ†úÿÿ†úÿÿþ @:`>@:`C ”úÿÿ•úÿÿ AXŸ\Ÿ  zýÿÿ‚úÿÿ‚úÿÿþ @D`6@D`: úÿÿ‘úÿÿ A¿¿  výÿÿ~úÿÿ~úÿÿþ @F`_@F`c hûÿÿiûÿÿ AkÀpÀ  rýÿÿzúÿÿzúÿÿþ @M`+@M`0йûÿÿ AqÀzÀ 4oýÿÿwúÿÿwúÿÿþ @M`1@M`: aûÿÿbûÿÿ AÔÀÙÀ  kýÿÿsúÿÿsúÿÿþ @O`.@O`3"ýÿÿÇûÿÿ AÚÀÞÀ 4hýÿÿÁúÿÿÁúÿÿþ @O`4@O`8 Zûÿÿ[ûÿÿ A'Â,  dýÿÿlúÿÿlúÿÿþ @S`6@S`; zúÿÿ{úÿÿ AþÂà  `ýÿÿhúÿÿhúÿÿþ @V`>@V`B vúÿÿwúÿÿ AÀÃÄà  \ýÿÿdúÿÿdúÿÿþ @X`L@X`P rúÿÿsúÿÿ A£Å§Å  Xýÿÿ`úÿÿ`úÿÿþ @^`P@^`T JûÿÿKûÿÿ AJÈOÈ  Týÿÿ\úÿÿ\úÿÿþ @e`>@e`C júÿÿkúÿÿ AßÈãÈ  PýÿÿXúÿÿXúÿÿþ @g`F@g`J fúÿÿgúÿÿ A?ÊCÊ  LýÿÿTúÿÿTúÿÿþ @k`F@k`J búÿÿcúÿÿ AVÌZÌ  HýÿÿPúÿÿPúÿÿþ @s`6@s`: ^úÿÿ_úÿÿ AýÍÎ  DýÿÿLúÿÿLúÿÿþ @y`D@y`H 6ûÿÿ7ûÿÿ A±Ï¶Ï  @ýÿÿHúÿÿHúÿÿþ @`.@`3 VúÿÿWúÿÿ A‡Ð‹Ð  <ýÿÿDúÿÿDúÿÿþ @„`6@„`: RúÿÿSúÿÿ A³Ñ·Ñ  8ýÿÿ@úÿÿ@úÿÿþ @ˆ`6@ˆ`: *ûÿÿ+ûÿÿ AY×^×  4ýÿÿ<úÿÿ<úÿÿþ @œ`E@œ`J JúÿÿKúÿÿ AGØKØ  0ýÿÿ8úÿÿ8úÿÿþ @Ÿ`F@Ÿ`J FúÿÿGúÿÿ AÙÙÝÙ  ,ýÿÿ4úÿÿ4úÿÿþ @£`F@£`J ûÿÿûÿÿ AÐÛÕÛ  (ýÿÿ0úÿÿ0úÿÿþ @«`6@«`;ßüÿÿ„ûÿÿ AÖÛÚÛ 4%ýÿÿ~úÿÿ~úÿÿþ @«`<@«`@   ÂM/* __next_internal_client_entry_do_not_use__ default auto */ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { useEffect, useState } from 'react'; import { useRouter } from 'next/navigation'; import { useSession } from '@/lib/auth'; import { useLocale } from '@/context/locale'; import { getNotifications, markAllRead, markRead, dismissNotification } from '@/lib/api'; function NotifIcon(param) { let { type } = param; const cls = 'w-5 h-5'; switch(type){ case 'new_offer': return /*#__PURE__*/ _jsxs("svg", { className: cls, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", children: [ /*#__PURE__*/ _jsx("rect", { x: "2", y: "7", width: "20", height: "14", rx: "2" }), /*#__PURE__*/ _jsx("path", { d: "M16 21V5a2 2 0 00-2-2h-4a2 2 0 00-2 2v16" }) ] }); case 'offer_accepted': return /*#__PURE__*/ _jsxs("svg", { className: cls, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", children: [ /*#__PURE__*/ _jsx("circle", { cx: "12", cy: "12", r: "10" }), /*#__PURE__*/ _jsx("polyline", { points: "9 12 11 14 15 10" }) ] }); case 'offer_declined': return /*#__PURE__*/ _jsxs("svg", { className: cls, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", children: [ /*#__PURE__*/ _jsx("circle", { cx: "12", cy: "12", r: "10" }), /*#__PURE__*/ _jsx("line", { x1: "15", y1: "9", x2: "9", y2: "15" }), /*#__PURE__*/ _jsx("line", { x1: "9", y1: "9", x2: "15", y2: "15" }) ] }); case 'task_completed': return /*#__PURE__*/ _jsx("svg", { className: cls, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", children: /*#__PURE__*/ _jsx("polyline", { points: "20 6 9 17 4 12" }) }); case 'task_cancelled': return /*#__PURE__*/ _jsxs("svg", { className: cls, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", children: [ /*#__PURE__*/ _jsx("path", { d: "M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z" }), /*#__PURE__*/ _jsx("line", { x1: "12", y1: "9", x2: "12", y2: "13" }), /*#__PURE__*/ _jsx("line", { x1: "12", y1: "17", x2: "12.01", y2: "17" }) ] }); case 'new_message': return /*#__PURE__*/ _jsx("svg", { className: cls, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", children: /*#__PURE__*/ _jsx("path", { d: "M21 15a2 2 0 01-2 2H7l-4 4V5a2 2 0 012-2h14a2 2 0 012 2z" }) }); case 'new_review': return /*#__PURE__*/ _jsx("svg", { className: cls, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", children: /*#__PURE__*/ _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" }) }); case 'task_invite': return /*#__PURE__*/ _jsxs("svg", { className: cls, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", children: [ /*#__PURE__*/ _jsx("path", { d: "M16 4h2a2 2 0 012 2v14a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2h2" }), /*#__PURE__*/ _jsx("rect", { x: "8", y: "2", width: "8", height: "4", rx: "1", ry: "1" }) ] }); default: return /*#__PURE__*/ _jsxs("svg", { className: cls, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", children: [ /*#__PURE__*/ _jsx("path", { d: "M18 8A6 6 0 006 8c0 7-3 9-3 9h18s-3-2-3-9" }), /*#__PURE__*/ _jsx("path", { d: "M13.73 21a2 2 0 01-3.46 0" }) ] }); } } const typeColor = { new_offer: 'bg-green-100 text-green-600', offer_accepted: 'bg-green-100 text-green-600', offer_declined: 'bg-red-100 text-red-600', task_completed: 'bg-emerald-100 text-emerald-600', task_cancelled: 'bg-amber-100 text-amber-600', new_message: 'bg-purple-100 text-purple-600', new_review: 'bg-yellow-100 text-yellow-600', task_invite: 'bg-indigo-100 text-indigo-600', referral_reward: 'bg-cyan-100 text-cyan-700', specialist_card_submitted: 'bg-amber-100 text-amber-700', specialist_card_approved: 'bg-green-100 text-green-700', specialist_card_rejected: 'bg-rose-100 text-rose-700' }; /** Extract the quoted task title from a stored body string (any locale) */ function extractParam(body) { if (!body) return null; const m = body.match(/[«""](.+?)[»""]/); var _m_; return (_m_ = m === null || m === void 0 ? void 0 : m[1]) !== null && _m_ !== void 0 ? _m_ : null; } /** Extract rating number from a stored review body */ function extractRating(body) { if (!body) return null; const m = body.match(/(\d+)\s*[★\*]/); var _m_; return (_m_ = m === null || m === void 0 ? void 0 : m[1]) !== null && _m_ !== void 0 ? _m_ : null; } /** Extract first integer from text (for referral days, etc.) */ function extractNumber(body) { if (!body) return null; const m = body.match(/(\d+)/); var _m_; return (_m_ = m === null || m === void 0 ? void 0 : m[1]) !== null && _m_ !== void 0 ? _m_ : null; } export default function NotificationsPage() { const { data: session, isPending } = useSession(); const router = useRouter(); const { t, locale } = useLocale(); const [notifications, setNotifications] = useState([]); const [loading, setLoading] = useState(true); useEffect(()=>{ if (!isPending && !session) router.push('/login'); }, [ session, isPending ]); useEffect(()=>{ if (!session) return; getNotifications().then(setNotifications).catch(()=>{}).finally(()=>setLoading(false)); }, [ session ]); async function handleMarkAll() { await markAllRead(); setNotifications((prev)=>prev.map((n)=>({ ...n, isRead: true }))); } async function handleMark(id) { await markRead(id); setNotifications((prev)=>prev.map((n)=>n.id === id ? { ...n, isRead: true } : n)); } async function handleDismiss(e, id) { e.stopPropagation(); await dismissNotification(id).catch(()=>{}); setNotifications((prev)=>prev.filter((n)=>n.id !== id)); } if (isPending || loading) return /*#__PURE__*/ _jsx("div", { className: "text-center py-20 text-white", children: t('common.loading') }); function relativeTime(dateStr) { const diff = Date.now() - new Date(dateStr).getTime(); const sec = Math.floor(diff / 1000); const min = Math.floor(sec / 60); const hrs = Math.floor(min / 60); const days = Math.floor(hrs / 24); if (locale === 'ru') { if (sec < 60) return 'тПлькП чтП'; if (min < 60) return "".concat(min, " ЌОМ. МазаЎ"); if (hrs < 24) return "".concat(hrs, " ч. МазаЎ"); if (days === 1) return 'вчера'; if (days < 7) return "".concat(days, " ЎМ. МазаЎ"); } else if (locale === 'uk') { if (sec < 60) return 'щПйМП'; if (min < 60) return "".concat(min, " хв. тПЌу"); if (hrs < 24) return "".concat(hrs, " гПЎ. тПЌу"); if (days === 1) return 'вчПра'; if (days < 7) return "".concat(days, " ЎМ. тПЌу"); } else if (locale === 'en') { if (sec < 60) return 'just now'; if (min < 60) return "".concat(min, "m ago"); if (hrs < 24) return "".concat(hrs, "h ago"); if (days === 1) return 'yesterday'; if (days < 7) return "".concat(days, "d ago"); } else { if (sec < 60) return 'Όόλις τώρα'; if (min < 60) return "".concat(min, " λ. πριΜ"); if (hrs < 24) return "".concat(hrs, " ω. πριΜ"); if (days === 1) return 'χΞες'; if (days < 7) return "".concat(days, " ÎŒ. πριΜ"); } return new Date(dateStr).toLocaleDateString(dateLocale, { day: 'numeric', month: 'short', year: days > 365 ? 'numeric' : undefined }); } const unreadCount = notifications.filter((n)=>!n.isRead).length; const dateLocale = locale === 'ru' ? 'ru-RU' : locale === 'uk' ? 'uk-UA' : locale === 'en' ? 'en-US' : 'el-GR'; return /*#__PURE__*/ _jsxs("div", { className: "max-w-2xl mx-auto px-4 py-8", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex justify-between items-center mb-6", children: [ /*#__PURE__*/ _jsxs("h1", { className: "text-2xl font-bold text-white", children: [ t('notif.title'), " ", unreadCount > 0 && /*#__PURE__*/ _jsxs("span", { className: "text-white/70 font-normal text-xl", children: [ "(", unreadCount, ")" ] }) ] }), unreadCount > 0 && /*#__PURE__*/ _jsx("button", { onClick: handleMarkAll, className: "text-sm text-white/80 hover:text-white hover:underline transition", children: t('notif.mark_all') }) ] }), notifications.length === 0 ? /*#__PURE__*/ _jsx("div", { className: "text-center py-20 text-white/60", children: t('notif.empty') }) : /*#__PURE__*/ _jsx("div", { className: "space-y-2", children: notifications.map((n)=>{ const link = n.type === 'referral_reward' ? '/profile?tab=referral' : n.referenceId ? n.type === 'new_message' ? "/chat?room=".concat(n.referenceId) : "/tasks/".concat(n.referenceId) : null; const handleClick = async ()=>{ if (!n.isRead) await handleMark(n.id); if (link) router.push(link); }; var _typeColor_n_type; return /*#__PURE__*/ _jsxs("div", { onClick: handleClick, className: "flex items-start gap-3 p-4 rounded-xl border transition ".concat(link ? 'cursor-pointer' : 'cursor-default', " ").concat(n.isRead ? 'bg-white/90 border-white/20 hover:bg-white' : 'bg-white border-green-300 shadow-sm hover:bg-green-50'), children: [ /*#__PURE__*/ _jsx("div", { className: "p-2.5 rounded-xl flex-shrink-0 ".concat((_typeColor_n_type = typeColor[n.type]) !== null && _typeColor_n_type !== void 0 ? _typeColor_n_type : 'bg-gray-100 text-gray-500'), children: /*#__PURE__*/ _jsx(NotifIcon, { type: n.type }) }), /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ _jsx("p", { className: "font-medium ".concat(n.isRead ? 'text-gray-600' : 'text-gray-900'), children: t("notif.type.".concat(n.type), t('notif.type.generic', 'Notification')) }), n.body && /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-500 mt-0.5 truncate", children: (()=>{ if (n.type === 'new_message') return n.body; if (n.type === 'new_review') { const rating = extractRating(n.body); const tpl = t("notif.body.new_review", ''); return rating && tpl ? tpl.replace('{rating}', rating) : n.body; } if (n.type === 'referral_reward') { const days = extractNumber(n.body); const plan = extractParam(n.body); const tpl = t('notif.body.referral_reward', ''); if (tpl && days && plan) return tpl.replace('{days}', days).replace('{plan}', plan); return tpl || n.body; } const title = extractParam(n.body); const tpl = t("notif.body.".concat(n.type), ''); if (tpl && title) return tpl.replace('{title}', title); return tpl || n.body; })() }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-1", children: relativeTime(n.createdAt) }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex flex-col items-end gap-2 shrink-0", onClick: (e)=>e.stopPropagation(), children: [ /*#__PURE__*/ _jsx("button", { onClick: (e)=>handleDismiss(e, n.id), className: "p-1 rounded-md text-gray-300 hover:text-red-400 hover:bg-red-50 transition", title: t('common.delete', 'Delete'), children: /*#__PURE__*/ _jsxs("svg", { className: "w-4 h-4", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", children: [ /*#__PURE__*/ _jsx("line", { x1: "18", y1: "6", x2: "6", y2: "18" }), /*#__PURE__*/ _jsx("line", { x1: "6", y1: "6", x2: "18", y2: "18" }) ] }) }), /*#__PURE__*/ _jsx("div", { className: "flex items-center gap-1.5", children: !n.isRead && /*#__PURE__*/ _jsx("span", { className: "w-2 h-2 bg-green-500 rounded-full" }) }) ] }) ] }, n.id); }) }) ] }); } `}ùÿÿ€ùÿÿ ùÿÿ«÷ÿÿgøÿÿúùÿÿþ úÿÿ  úÿÿ úÿÿ úÿÿ úÿÿ0e97ee16a0fc0fa5úÿÿ©÷ÿÿ  úÿÿ ‰NotifIconŒextractParamextractRatingextractNumber‰typeColorHúÿÿ‘NotificationsPage •mÿyBYøÿÿ^øÿÿ  dÿÿý€ a=| b=|€ `}@© `,€ AªÖ `,€ A×ÿ `(€ A- `-€ A.‡ `Y A!aM A!aM @ß@² `Búÿÿúÿÿ b=|¬÷ÿÿ¬÷ÿÿ `,SúÿÿSúÿÿ `,VúÿÿVúÿÿ `(WúÿÿWúÿÿ `-XúÿÿXúÿÿ `Y ëúÿÿìúÿÿ A&+   Zúÿÿüùÿÿüùÿÿý c ! &  úÿÿ úÿÿ Apt  ûøùÿÿøùÿÿþ c"& úÿÿúÿÿ Adh  ÷ôùÿÿôùÿÿþ c"& Þúÿÿßúÿÿ A27  óðùÿÿðùÿÿþ c"!"& þùÿÿÿùÿÿ A|€  ïìùÿÿìùÿÿþ c+"+& úùÿÿûùÿÿ A+/  ëèùÿÿèùÿÿþ c0"0& ÒúÿÿÓúÿÿ Aêï  çäùÿÿäùÿÿþ c6!6& òùÿÿóùÿÿ A4 8   ãàùÿÿàùÿÿþ c?"?& îùÿÿïùÿÿ Aã ç   ßÜùÿÿÜùÿÿþ cD"D& êùÿÿëùÿÿ A± µ   ÛØùÿÿØùÿÿþ cJ"J& æùÿÿçùÿÿ AŸ    ×ÔùÿÿÔùÿÿþ cS!S% âùÿÿãùÿÿ Añ õ   ÓÐùÿÿÐùÿÿþ c[([, ºúÿÿ»úÿÿ A” ™   ÏÌùÿÿÌùÿÿþ c`!`& ÚùÿÿÛùÿÿ AÞâ  ËÈùÿÿÈùÿÿþ ci"i& Öùÿÿ×ùÿÿ A˜œ  ÇÄùÿÿÄùÿÿþ cl"l& ÒùÿÿÓùÿÿ Agk  ÃÀùÿÿÀùÿÿþ cr"r& ÎùÿÿÏùÿÿ Avz  ¿ŒùÿÿŒùÿÿþ c{!{% ÊùÿÿËùÿÿ A©­  »žùÿÿžùÿÿþ @ƒ`(@ƒ`, ÆùÿÿÇùÿÿ Aim  ·ŽùÿÿŽùÿÿþ @ˆ`!@ˆ`% ÂùÿÿÃùÿÿ Aœ   ³°ùÿÿ°ùÿÿþ @`(@`, šúÿÿ›úÿÿ A‹  ¯¬ùÿÿ¬ùÿÿþ @•`!@•`& ºùÿÿ»ùÿÿ AÕÙ  «šùÿÿšùÿÿþ @ž`"@ž`& ¶ùÿÿ·ùÿÿ A~‚  §€ùÿÿ€ùÿÿþ @¡`"@¡`& Žúÿÿúÿÿ AÂÇ  £ ùÿÿ ùÿÿþ @¬`!@¬`& ®ùÿÿ¯ùÿÿ A   Ÿœùÿÿœùÿÿþ @µ`"@µ`& ªùÿÿ«ùÿÿ Aœ   ›˜ùÿÿ˜ùÿÿþ @ž`"@ž`&{ÿÿÿôùÿÿ @ß@² úÿÿúÿÿ AX!b!   ðùÿÿåùÿÿåùÿÿý @à`)@à`3 ñùÿÿðùÿÿ Ay!‚!  ûÝùÿÿÝùÿÿþ @á`@á` ýùÿÿüùÿÿ A !©!  ÷ßùÿÿßùÿÿþ @â`@â`# ùÿÿŒùÿÿ AÛ!ã!  ó-÷ÿÿ-÷ÿÿþ @ã`.@ã`6 ‰ùÿÿˆùÿÿ A ""  ï)÷ÿÿ)÷ÿÿþ @ä`"@ä`* ‹ùÿÿŠùÿÿ A"("  ë%÷ÿÿ%÷ÿÿþ @å@å`  ‡ùÿÿ†ùÿÿ A¢"«"  ç!÷ÿÿ!÷ÿÿþ @ë@ë`  ÈüÿÿÇüÿÿ AØ"è"  ãÍùÿÿÍùÿÿþ @í@í` ‹markAllReadþ A„##  ÞÈùÿÿÈùÿÿþ @ò`@ò` ˆmarkReadþ AN$V$  ÙÃùÿÿÃùÿÿþ @ù`@ù` “dismissNotificationþ AJ%]%  ÔŸùÿÿŸùÿÿþ @`@`! uùÿÿvùÿÿ Aë%ï%  Ðcùÿÿcùÿÿþ @`3@`7 MúÿÿNúÿÿ AÌ-Ñ-  Ì_ùÿÿ_ùÿÿþ @/`@/` IúÿÿJúÿÿ A;.@.  È[ùÿÿ[ùÿÿþ @2`@2` EúÿÿFúÿÿ AÍ.Ò.  ÄWùÿÿWùÿÿþ @5`"@5`' AúÿÿBúÿÿ AÏ/Ô/  ÀSùÿÿSùÿÿþ @:`=@:`B aùÿÿbùÿÿ A…1‰1  ŒOùÿÿOùÿÿþ @D`5@D`9 ]ùÿÿ^ùÿÿ AÔ2Ø2  žKùÿÿKùÿÿþ @K`7@K`; YùÿÿZùÿÿ Aj3n3  ŽGùÿÿGùÿÿþ @N`@N`# 1úÿÿ2úÿÿ A¹5Ÿ5  °CùÿÿCùÿÿþ @W`)@W`. QùÿÿRùÿÿ AU7Y7  ¬?ùÿÿ?ùÿÿþ @[`*@[`. MùÿÿNùÿÿ At8x8  š;ùÿÿ;ùÿÿþ @]`8@]`< %úÿÿ&úÿÿ A$9)9  €7ùÿÿ7ùÿÿþ @a`*@a`/ EùÿÿFùÿÿ AÎ9Ò9   3ùÿÿ3ùÿÿþ @d`2@d`6 AùÿÿBùÿÿ A1;5;  œ/ùÿÿ/ùÿÿþ @h`<@h`@ =ùÿÿ>ùÿÿ AòAöA  ˜+ùÿÿ+ùÿÿþ @~`2@~`6 úÿÿúÿÿ A.C3C  ”'ùÿÿ'ùÿÿþ @„`*@„`/ 5ùÿÿ6ùÿÿ A3D7D  #ùÿÿ#ùÿÿþ @ˆ`2@ˆ`6  úÿÿúÿÿ A E¥E  Œùÿÿùÿÿþ @Œ`@@Œ`E -ùÿÿ.ùÿÿ AìGðG  ˆùÿÿùÿÿþ @•`>@•`B )ùÿÿ*ùÿÿ AbIfI  „ùÿÿùÿÿþ @›`>@›`B %ùÿÿ&ùÿÿ ALKPK  €ùÿÿùÿÿþ @€`2@€`6 !ùÿÿ"ùÿÿ A÷KûK  |ÿÿÿùÿÿùÿÿþ @Š`M@Š`Q   œz/* __next_internal_client_entry_do_not_use__ default auto */ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime"; import { useState, useEffect } from 'react'; import Link from 'next/link'; import { useRouter } from 'next/navigation'; import { useSession } from '@/lib/auth'; import { useLocale } from '@/context/locale'; import { getPlans, getMyDashboard, previewPlanChange, purchasePlan } from '@/lib/api'; import { PlanBadge } from '@/components/PlanBadge'; const FEATURE_ROWS = [ { key: 'maxMessagesPerDay', labelKey: 'pricing.feat.messages', format: (v)=>v === null ? '∞' : String(v) }, { key: 'maxOrdersPerDay', labelKey: 'pricing.feat.orders', format: (v)=>v === null ? '∞' : String(v) }, { key: 'canContactAll', labelKey: 'pricing.feat.contact_all' }, { key: 'canViewPhone', labelKey: 'pricing.feat.view_phone' }, { key: 'canShowContactInfo', labelKey: 'pricing.feat.show_contact' }, { key: 'hasFavorites', labelKey: 'pricing.feat.favorites' }, { key: 'hasVerifiedBadge', labelKey: 'pricing.feat.verified_badge' }, { key: 'hasGoogleCalendar', labelKey: 'pricing.feat.google_calendar' }, { key: 'hasPersonalSite', labelKey: 'pricing.feat.personal_site' }, { key: 'hasAutoResponse', labelKey: 'pricing.feat.auto_response' }, { key: 'hasAutoMatch', labelKey: 'pricing.feat.auto_match' }, { key: 'highlightedReviews', labelKey: 'pricing.feat.highlighted_reviews' }, { key: 'maxCards', labelKey: 'pricing.feat.cards', format: (v)=>v === null ? '∞' : String(v) }, { key: 'notifyNewTasks', labelKey: 'pricing.feat.notify_tasks' }, { key: 'canUploadVideo', labelKey: 'pricing.feat.video' } ]; function CheckIcon() { return /*#__PURE__*/ _jsx("svg", { viewBox: "0 0 20 20", fill: "currentColor", className: "w-5 h-5 text-green-500 mx-auto", children: /*#__PURE__*/ _jsx("path", { fillRule: "evenodd", d: "M16.704 4.153a.75.75 0 01.143 1.052l-8 10.5a.75.75 0 01-1.127.075l-4.5-4.5a.75.75 0 011.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 011.05-.143z", clipRule: "evenodd" }) }); } function XIcon() { return /*#__PURE__*/ _jsx("svg", { viewBox: "0 0 20 20", fill: "currentColor", className: "w-4 h-4 text-gray-300 mx-auto", children: /*#__PURE__*/ _jsx("path", { d: "M6.28 5.22a.75.75 0 00-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 101.06 1.06L10 11.06l3.72 3.72a.75.75 0 101.06-1.06L11.06 10l3.72-3.72a.75.75 0 00-1.06-1.06L10 8.94 6.28 5.22z" }) }); } const tierOrder = [ 'free', 'pro', 'ultimate' ]; const tierHeaderColors = { free: 'bg-gray-50 border-gray-200', pro: 'bg-green-50 border-green-200', ultimate: 'bg-gradient-to-br from-amber-50 to-yellow-50 border-amber-300' }; const tierPriceColors = { free: 'text-gray-700', pro: 'text-green-700', ultimate: 'text-amber-600' }; const tierBtnColors = { free: 'bg-gray-100 text-gray-700 hover:bg-gray-200', pro: 'bg-green-600 text-white hover:bg-green-700', ultimate: 'bg-gradient-to-r from-amber-500 to-yellow-500 text-white hover:from-amber-600 hover:to-yellow-600' }; export default function PricingPage() { const { data: session } = useSession(); const { t } = useLocale(); const router = useRouter(); const [plans, setPlans] = useState([]); const [currentPlanId, setCurrentPlanId] = useState(null); const [loading, setLoading] = useState(true); const [confirmPlan, setConfirmPlan] = useState(null); const [preview, setPreview] = useState(null); const [previewLoading, setPreviewLoading] = useState(false); const [purchasing, setPurchasing] = useState(false); // Fetch plans with abort to prevent stale race conditions useEffect(()=>{ let aborted = false; setLoading(true); getPlans().then((data)=>{ if (!aborted) setPlans(data.sort((a, b)=>tierOrder.indexOf(a.tier) - tierOrder.indexOf(b.tier))); }).catch(()=>{}).finally(()=>{ if (!aborted) setLoading(false); }); return ()=>{ aborted = true; }; }, []); const fetchCurrentPlan = ()=>{ if (!session) return; getMyDashboard().then((d)=>{ var _d_plan; var _d_plan_id; return setCurrentPlanId((_d_plan_id = (_d_plan = d.plan) === null || _d_plan === void 0 ? void 0 : _d_plan.id) !== null && _d_plan_id !== void 0 ? _d_plan_id : null); }).catch(()=>{}); }; useEffect(fetchCurrentPlan, [ session ]); // Refresh active plan when admin widget changes it useEffect(()=>{ const handler = ()=>fetchCurrentPlan(); window.addEventListener('canhelp:plan-changed', handler); document.addEventListener('visibilitychange', handler); return ()=>{ window.removeEventListener('canhelp:plan-changed', handler); document.removeEventListener('visibilitychange', handler); }; }, [ session ]); async function handleSelectPlan(plan) { if (!session) { router.push('/sign-in'); return; } setConfirmPlan(plan); setPreview(null); setPreviewLoading(true); try { const p = await previewPlanChange(plan.id); setPreview(p); } catch (e) { setConfirmPlan(null); } finally{ setPreviewLoading(false); } } async function handleConfirm() { if (!confirmPlan || !preview) return; setPurchasing(true); try { const result = await purchasePlan(confirmPlan.id, preview.canPayFromBalance); if (result.url && result.params) { const form = document.createElement('form'); form.method = 'POST'; form.action = result.url; Object.entries(result.params).forEach((param)=>{ let [k, v] = param; const inp = document.createElement('input'); inp.type = 'hidden'; inp.name = k; inp.value = v; form.appendChild(inp); }); document.body.appendChild(form); form.submit(); return; } setCurrentPlanId(confirmPlan.id); setConfirmPlan(null); setPreview(null); } catch (e) { // ignore } finally{ setPurchasing(false); } } const visibleFeatures = FEATURE_ROWS; return /*#__PURE__*/ _jsxs("main", { className: "min-h-screen py-12 px-4", children: [ /*#__PURE__*/ _jsxs("div", { className: "max-w-5xl mx-auto", children: [ /*#__PURE__*/ _jsxs("div", { className: "text-center mb-10", children: [ /*#__PURE__*/ _jsx("h1", { className: "text-4xl font-bold text-white mb-3", children: t('pricing.title', 'Pricing') }), /*#__PURE__*/ _jsx("p", { className: "text-white/70 text-lg", children: t('pricing.subtitle') }) ] }), loading ? /*#__PURE__*/ _jsx("div", { className: "text-center text-white/60 py-20", children: t('common.loading', 'Loading...') }) : /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx("div", { className: "grid grid-cols-1 md:grid-cols-3 gap-6 mb-12", children: plans.map((plan)=>{ const isCurrentPlan = plan.id === currentPlanId; const isFree = plan.tier === 'free'; return /*#__PURE__*/ _jsxs("div", { className: "rounded-2xl border-2 p-6 bg-white flex flex-col transition ".concat(isCurrentPlan ? 'ring-2 ring-green-500 ring-offset-2' : '', " ").concat(plan.tier === 'ultimate' ? 'border-amber-300 shadow-lg shadow-amber-100' : 'border-gray-200'), children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 mb-4", children: [ /*#__PURE__*/ _jsx(PlanBadge, { tier: plan.tier, size: "md" }), isCurrentPlan && /*#__PURE__*/ _jsx("span", { className: "text-xs font-medium text-green-600 bg-green-50 border border-green-200 px-2 py-0.5 rounded-full", children: t('pricing.current_plan', 'Your plan') }), plan.tier === 'pro' && !isCurrentPlan && /*#__PURE__*/ _jsx("span", { className: "text-xs font-medium text-green-600 bg-green-50 border border-green-100 px-2 py-0.5 rounded-full", children: t('pricing.popular', 'Popular') }) ] }), /*#__PURE__*/ _jsx("h2", { className: "text-xl font-bold text-gray-900 mb-1", children: plan.name }), /*#__PURE__*/ _jsx("p", { className: "text-gray-500 text-sm mb-4 min-h-[40px]", children: plan.description }), /*#__PURE__*/ _jsxs("div", { className: "text-3xl font-extrabold mb-1 ".concat(tierPriceColors[plan.tier]), children: [ isFree ? t('pricing.free', 'Free') : /*#__PURE__*/ _jsxs(_Fragment, { children: [ plan.oldPrice && /*#__PURE__*/ _jsxs("span", { className: "text-lg font-normal text-gray-400 line-through mr-2", children: [ "€", plan.oldPrice ] }), "€", plan.price ] }), !isFree && /*#__PURE__*/ _jsxs("span", { className: "text-base font-normal text-gray-400", children: [ "/", t('pricing.per_month', 'month') ] }) ] }), plan.durationDays && !isFree && /*#__PURE__*/ _jsxs("p", { className: "text-xs text-gray-400 mb-5", children: [ t('pricing.duration', 'Duration'), ": ", plan.durationDays, " ", t('pricing.days', 'days') ] }), isFree && /*#__PURE__*/ _jsx("div", { className: "mb-5" }), /*#__PURE__*/ _jsx("div", { className: "mt-auto", children: isCurrentPlan ? /*#__PURE__*/ _jsx("div", { className: "w-full py-2.5 text-center text-sm font-semibold text-green-700 bg-green-50 border border-green-200 rounded-xl", children: t('pricing.your_plan', 'Current plan') }) : isFree ? /*#__PURE__*/ _jsx("div", { className: "w-full py-2.5 text-center text-sm font-medium text-gray-400 bg-gray-50 border border-gray-200 rounded-xl", children: t('pricing.free_default', 'Default') }) : /*#__PURE__*/ _jsxs("button", { onClick: ()=>handleSelectPlan(plan), className: "block w-full py-2.5 text-center text-sm font-semibold rounded-xl transition ".concat(tierBtnColors[plan.tier]), children: [ t('pricing.choose', 'Choose'), " ", plan.name ] }) }) ] }, plan.id); }) }), /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-2xl border border-gray-200 overflow-hidden", children: [ /*#__PURE__*/ _jsx("div", { className: "px-6 py-4 border-b border-gray-100", children: /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-gray-900", children: t('pricing.compare', 'Feature comparison') }) }), /*#__PURE__*/ _jsx("div", { className: "overflow-x-auto", children: /*#__PURE__*/ _jsxs("table", { className: "w-full text-sm", children: [ /*#__PURE__*/ _jsx("thead", { children: /*#__PURE__*/ _jsxs("tr", { className: "border-b border-gray-100", children: [ /*#__PURE__*/ _jsx("th", { className: "text-left px-6 py-3 text-gray-500 font-medium w-1/2", children: t('pricing.feature', 'Feature') }), plans.map((plan)=>/*#__PURE__*/ _jsx("th", { className: "text-center px-4 py-3 font-medium text-gray-700", children: /*#__PURE__*/ _jsxs("div", { className: "flex flex-col items-center gap-1", children: [ /*#__PURE__*/ _jsx(PlanBadge, { tier: plan.tier, size: "sm" }), /*#__PURE__*/ _jsx("span", { className: "text-xs text-gray-400", children: plan.tier === 'free' ? t('pricing.free', 'Free') : "€".concat(plan.price) }) ] }) }, plan.id)) ] }) }), /*#__PURE__*/ _jsx("tbody", { children: visibleFeatures.map((param)=>{ let { key, labelKey, format } = param; return /*#__PURE__*/ _jsxs("tr", { className: "border-b border-gray-50 hover:bg-gray-50/50 transition", children: [ /*#__PURE__*/ _jsx("td", { className: "px-6 py-3 text-gray-600", children: t(labelKey, labelKey) }), plans.map((plan)=>{ const val = plan[key]; let cell; if (format) { cell = /*#__PURE__*/ _jsx("span", { className: "text-gray-700 font-medium", children: format(val) }); } else if (typeof val === 'boolean') { cell = val ? /*#__PURE__*/ _jsx(CheckIcon, {}) : /*#__PURE__*/ _jsx(XIcon, {}); } else { cell = /*#__PURE__*/ _jsx("span", { className: "text-gray-700", children: val === null ? '∞' : String(val !== null && val !== void 0 ? val : '—') }); } return /*#__PURE__*/ _jsx("td", { className: "text-center px-4 py-3", children: cell }, plan.id); }) ] }, key); }) }) ] }) }) ] }), /*#__PURE__*/ _jsx("p", { className: "text-center text-white/50 text-sm mt-8", children: t('pricing.faq_note', 'Payment is deducted from your CanHelp balance. Top up is available in Payments.') }) ] }) ] }), confirmPlan && /*#__PURE__*/ _jsx("div", { className: "fixed inset-0 z-50 flex items-center justify-center bg-black/50 px-4", children: /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-2xl shadow-2xl w-full max-w-md p-6", children: [ /*#__PURE__*/ _jsx("h2", { className: "text-lg font-bold text-gray-900 mb-4", children: t('pricing.confirm.title', 'Confirm plan selection') }), previewLoading ? /*#__PURE__*/ _jsx("div", { className: "py-10 text-center text-gray-400", children: t('common.loading', 'Loading...') }) : preview ? /*#__PURE__*/ _jsxs("div", { className: "space-y-3 text-sm text-gray-700", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex justify-between", children: [ /*#__PURE__*/ _jsx("span", { className: "text-gray-500", children: t('pricing.confirm.plan', 'Plan') }), /*#__PURE__*/ _jsx("span", { className: "font-semibold", children: confirmPlan.name }) ] }), preview.type === 'upgrade' && Number(preview.prorated) > 0 && /*#__PURE__*/ _jsxs("div", { className: "flex justify-between", children: [ /*#__PURE__*/ _jsx("span", { className: "text-gray-500", children: t('pricing.confirm.prorated', 'Prorated credit') }), /*#__PURE__*/ _jsxs("span", { className: "text-green-600 font-medium", children: [ "−€", preview.prorated ] }) ] }), preview.type !== 'downgrade' && /*#__PURE__*/ _jsxs("div", { className: "flex justify-between", children: [ /*#__PURE__*/ _jsx("span", { className: "text-gray-500", children: t('pricing.confirm.effective_price', 'To pay') }), /*#__PURE__*/ _jsxs("span", { className: "font-bold text-gray-900", children: [ "€", preview.effectivePrice ] }) ] }), preview.type !== 'downgrade' && /*#__PURE__*/ _jsxs("div", { className: "flex justify-between", children: [ /*#__PURE__*/ _jsx("span", { className: "text-gray-500", children: t('pricing.confirm.your_balance', 'Your balance') }), /*#__PURE__*/ _jsxs("span", { className: preview.canPayFromBalance ? 'text-green-600' : 'text-red-500', children: [ "€", preview.currentBalance ] }) ] }), preview.type === 'downgrade' && /*#__PURE__*/ _jsxs("div", { className: "bg-orange-50 border border-orange-200 rounded-xl p-3 text-orange-800 text-xs", children: [ t('pricing.confirm.downgrade_info', 'The switch to the new plan will happen automatically after the current period ends.'), preview.scheduledDate && /*#__PURE__*/ _jsxs(_Fragment, { children: [ " ", new Date(preview.scheduledDate).toLocaleDateString('ru-RU') ] }) ] }), preview.type !== 'downgrade' && !preview.canPayFromBalance && /*#__PURE__*/ _jsxs("div", { className: "bg-red-50 border border-red-200 rounded-xl p-3 text-red-700 text-xs", children: [ t('pricing.confirm.insufficient', 'Insufficient balance.'), ' ', /*#__PURE__*/ _jsx(Link, { href: "/payment", className: "underline font-medium", onClick: ()=>setConfirmPlan(null), children: t('pricing.confirm.top_up', 'Top up') }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-3 pt-2", children: [ /*#__PURE__*/ _jsx("button", { onClick: ()=>{ setConfirmPlan(null); setPreview(null); }, className: "flex-1 py-2.5 rounded-xl border border-gray-200 text-sm font-medium text-gray-600 hover:bg-gray-50 transition", children: t('common.cancel', 'Cancel') }), (preview.type === 'downgrade' || preview.canPayFromBalance) && /*#__PURE__*/ _jsx("button", { onClick: handleConfirm, disabled: purchasing, className: "flex-1 py-2.5 rounded-xl text-sm font-semibold text-white transition ".concat(preview.type === 'downgrade' ? 'bg-orange-500 hover:bg-orange-600' : tierBtnColors[confirmPlan.tier].replace('block w-full', '').trim(), " disabled:opacity-50"), children: purchasing ? t('common.loading', 'Loading...') : preview.type === 'downgrade' ? t('pricing.confirm.schedule_downgrade', 'Schedule switch') : t('pricing.confirm.pay', 'Pay') }) ] }) ] }) : null ] }) }) ] }); } `_øÿÿbøÿÿ cøÿÿöÿÿj÷ÿÿÜøÿÿþëøÿÿ ìøÿÿíøÿÿîøÿÿïøÿÿ80c09722397d80f6óøÿÿ‹öÿÿ  ôøÿÿ ‰CheckIcon…XIconŒFEATURE_ROWS‰tierOrdertierHeaderColorstierPriceColorstierBtnColors(ùÿÿ‹PricingPage •mÿyBZ÷ÿÿ_÷ÿÿ  dÿÿý€ `=@“ a=@“€ A”À `,€ AÁÞ `€ Aß  `,€ A 4 `(€ A5b `-€ Ac¹ `V€ Aºí `3 AÑ €z A €z at@! `kâøÿÿâøÿÿ a=@“ˆöÿÿˆöÿÿ `,1ùÿÿ1ùÿÿ `.ùÿÿ.ùÿÿ `,1ùÿÿ1ùÿÿ `(2ùÿÿ2ùÿÿ `-3ùÿÿ3ùÿÿ `Veûÿÿeûÿÿ `3 éøÿÿêøÿÿ A    4ùÿÿÖøÿÿÖøÿÿý cKK äøÿÿåøÿÿ A©­  ûÒøÿÿÒøÿÿþ cO O$ àøÿÿáøÿÿ AÙ Ý    +ùÿÿÍøÿÿÍøÿÿý cWW ÛøÿÿÜøÿÿ Aw {   ûÉøÿÿÉøÿÿþ c[ [$ Ak ”  $ùÿÿ c`dÉ"ùÿÿ at@! /ùÿÿ.ùÿÿ A   ùÿÿùÿÿùÿÿý cuu( /ùÿÿ.ùÿÿ A(1  ûùÿÿùÿÿþ cvv ùÿÿùÿÿ AHQ  ÷ùÿÿùÿÿþ cww »øÿÿºøÿÿ As{  ó[öÿÿ[öÿÿþ cxx& ·øÿÿ¶øÿÿ A¯·  ïWöÿÿWöÿÿþ cy.y6 ³øÿÿ²øÿÿ Aáé  ëSöÿÿSöÿÿþ cz"z* ¯øÿÿ®øÿÿ A#  çOöÿÿOöÿÿþ c{*{2 «øÿÿªøÿÿ AMU  ãKöÿÿKöÿÿþ c|"|* §øÿÿŠøÿÿ A•  ßGöÿÿGöÿÿþ c}0}8 £øÿÿ¢øÿÿ AÆÎ  ÛCöÿÿCöÿÿþ c~(~0 ¥øÿÿ€øÿÿ A#  ×?öÿÿ?öÿÿþ @€@€`  ˆgetPlansþ Aiq  Òêøÿÿêøÿÿþ @ƒ@ƒ` æûÿÿåûÿÿ Aâð  Îæøÿÿæøÿÿþ @Ž@Ž` ˜øÿÿ—øÿÿ A   Ê2öÿÿ2öÿÿþ @”@”`  ”øÿÿ“øÿÿ A~‡  Æ.öÿÿ.öÿÿþ @˜@˜`  ‘previewPlanChangeþ A,  ÁÙøÿÿÙøÿÿþ @¬`@¬`- ŒpurchasePlanþ Ar~  ŒÔøÿÿÔøÿÿþ @ž`!@ž`- gùÿÿhùÿÿ ARW  žyøÿÿyøÿÿþ @Ó`@Ó` cùÿÿdùÿÿ AŸÃ  Žuøÿÿuøÿÿþ @Ö`@Ö` _ùÿÿ`ùÿÿ A;@  °qøÿÿqøÿÿþ @Ù`"@Ù`' øÿÿ€øÿÿ AÐÔ  ¬møÿÿmøÿÿþ @Ü`*@Ü`. {øÿÿ|øÿÿ AÀÄ  šiøÿÿiøÿÿþ @à`*@à`. wøÿÿxøÿÿ AÍÑ  €eøÿÿeøÿÿþ @æ`,@æ`0 OùÿÿPùÿÿ AŒ‘   aøÿÿaøÿÿþ @é`'@é`, žùÿÿŸùÿÿ A’› 4œ]øÿÿ]øÿÿþ @é`-@é`6 køÿÿløÿÿ Aíñ  ˜YøÿÿYøÿÿþ @ë`*@ë`. CùÿÿDùÿÿ Aj!o!  ”UøÿÿUøÿÿþ @ð`9@ð`> ?ùÿÿ@ùÿÿ A# #  QøÿÿQøÿÿþ @ó`:@ó`? _øÿÿ`øÿÿ Aî#ò#  ŒMøÿÿMøÿÿþ @ö`B@ö`F ïúÿÿîúÿÿ Aó#ü# 4ˆÓúÿÿÓúÿÿþ @ö`G@ö`P WøÿÿXøÿÿ A%%  „EøÿÿEøÿÿþ @ú`S@ú`W SøÿÿTøÿÿ AØ&Ü&  €AøÿÿAøÿÿþ @þ`k@þ`o OøÿÿPøÿÿ AÂ(Æ(  |ÿÿÿ=øÿÿ=øÿÿþ @`:@`> KøÿÿLøÿÿ Aà)ä)  xÿÿÿ9øÿÿ9øÿÿþ @`:@`> #ùÿÿ$ùÿÿ A+ +  tÿÿÿ5øÿÿ5øÿÿþ @ `:@ `? ùÿÿ ùÿÿ A8,=,  pÿÿÿ1øÿÿ1øÿÿþ @`g@`lÐpùÿÿ A>,G, 4mÿÿÿ.øÿÿ.øÿÿþ @`m@`v ùÿÿùÿÿ Aê,ï,  iÿÿÿ*øÿÿ*øÿÿþ @`[@`` ùÿÿùÿÿ A,010  eÿÿÿ&øÿÿ&øÿÿþ @`M@`R ùÿÿùÿÿ AŽ2¹2  aÿÿÿ"øÿÿ"øÿÿþ @%`Z@%`_ 0øÿÿ1øÿÿ A[5_5  ]ÿÿÿøÿÿøÿÿþ @/`D@/`H ,øÿÿ-øÿÿ A66  Yÿÿÿøÿÿøÿÿþ @2`:@2`> (øÿÿ)øÿÿ AÁ6Å6  Uÿÿÿøÿÿøÿÿþ @4`X@4`\ $øÿÿ%øÿÿ A0848  Qÿÿÿøÿÿøÿÿþ @7`L@7`P üøÿÿýøÿÿ A9”9  Mÿÿÿøÿÿøÿÿþ @:`C@:`H øøÿÿùøÿÿ A =%=  Iÿÿÿ øÿÿ øÿÿþ @H`*@H`/ øÿÿøÿÿ A÷=û=  Eÿÿÿøÿÿøÿÿþ @K`2@K`6 øÿÿøÿÿ Až>¢>  Aÿÿÿøÿÿøÿÿþ @M`@@M`D øÿÿøÿÿ Aç?ë?  =ÿÿÿþ÷ÿÿþ÷ÿÿþ @R`2@R`6 èøÿÿéøÿÿ A{@€@  9ÿÿÿú÷ÿÿú÷ÿÿþ @T`@@T`E øÿÿ øÿÿ AKAOA  5ÿÿÿö÷ÿÿö÷ÿÿþ @W`>@W`B àøÿÿáøÿÿ A§A¬A  1ÿÿÿò÷ÿÿò÷ÿÿþ @X`L@X`Q øÿÿøÿÿ A¢BŠB  -ÿÿÿî÷ÿÿî÷ÿÿþ @[`J@[`N ü÷ÿÿý÷ÿÿ A7D;D  )ÿÿÿê÷ÿÿê÷ÿÿþ @_`\@_`` ÔøÿÿÕøÿÿ A"E'E  %ÿÿÿæ÷ÿÿæ÷ÿÿþ @a`\@a`a ô÷ÿÿõ÷ÿÿ AVFZF  !ÿÿÿâ÷ÿÿâ÷ÿÿþ @d`Z@d`^•„úÿÿ A[FdF 4ÿÿÿiúÿÿiúÿÿþ @d`_@d`h í÷ÿÿî÷ÿÿ AÎGÒG  ÿÿÿÛ÷ÿÿÛ÷ÿÿþ @h`Z@h`^ é÷ÿÿê÷ÿÿ AK K  ÿÿÿ×÷ÿÿ×÷ÿÿþ @r`>@r`B ÁøÿÿÂøÿÿ AL#L  ÿÿÿÓ÷ÿÿÓ÷ÿÿþ @u`M@u`R á÷ÿÿâ÷ÿÿ ACMGM  ÿÿÿÏ÷ÿÿÏ÷ÿÿþ @x`N@x`R Ý÷ÿÿÞ÷ÿÿ APP   ÿÿÿË÷ÿÿË÷ÿÿþ @€`]@€`a Ù÷ÿÿÚ÷ÿÿ A RR  ÿÿÿÇ÷ÿÿÇ÷ÿÿþ @…`c@…`g Õ÷ÿÿÖ÷ÿÿ A1R5R  ÿÿÿÃ÷ÿÿÃ÷ÿÿþ C…‡…‹ Ñ÷ÿÿÒ÷ÿÿ AìRðR  þþÿÿ¿÷ÿÿ¿÷ÿÿþ @‡`]@‡`a Í÷ÿÿÎ÷ÿÿ AìTðT  úþÿÿ»÷ÿÿ»÷ÿÿþ @Œ`Y@Œ`] É÷ÿÿÊ÷ÿÿ A%X)X  öþÿÿ·÷ÿÿ·÷ÿÿþ @š`*@š`. Å÷ÿÿÆ÷ÿÿ AŽYžY  òþÿÿ³÷ÿÿ³÷ÿÿþ @¢`)@¢`- øÿÿžøÿÿ AMZRZ  îþÿÿ¯÷ÿÿ¯÷ÿÿþ @€`(@€`- œ÷ÿÿŸ÷ÿÿ AøZüZ  êþÿÿ«÷ÿÿ«÷ÿÿþ @§`&@§`* ¹÷ÿÿº÷ÿÿ A\\  æþÿÿ§÷ÿÿ§÷ÿÿþ @«`7@«`; ‘øÿÿ’øÿÿ A×\Ü\  âþÿÿ£÷ÿÿ£÷ÿÿþ @®`5@®`: øÿÿŽøÿÿ A†]‹]  ÞþÿÿŸ÷ÿÿŸ÷ÿÿþ @±`.@±`3 ­÷ÿÿ®÷ÿÿ AB^F^  Úþÿÿ›÷ÿÿ›÷ÿÿþ @Ž`6@Ž`: ©÷ÿÿª÷ÿÿ AS_W_  Öþÿÿ—÷ÿÿ—÷ÿÿþ @ž`6@ž`: øÿÿ‚øÿÿ AÒ`×`  Òþÿÿ“÷ÿÿ“÷ÿÿþ @Ÿ`l@Ÿ`q ¡÷ÿÿ¢÷ÿÿ AŽa’a  Îþÿÿ÷ÿÿ÷ÿÿþ @Á`6@Á`: yøÿÿzøÿÿ A®b³b  Êþÿÿ‹÷ÿÿ‹÷ÿÿþ @Å`6@Å`; uøÿÿvøÿÿ A³džd  Æþÿÿ‡÷ÿÿ‡÷ÿÿþ @Î`N@Î`S •÷ÿÿ–÷ÿÿ Aoese  Âþÿÿƒ÷ÿÿƒ÷ÿÿþ @Ñ`6@Ñ`: møÿÿnøÿÿ Af’f  Ÿþÿÿ÷ÿÿ÷ÿÿþ @Õ`6@Õ`; iøÿÿjøÿÿ A”h™h  ºþÿÿ{÷ÿÿ{÷ÿÿþ @Þ`N@Þ`S ‰÷ÿÿŠ÷ÿÿ APiTi  ¶þÿÿw÷ÿÿw÷ÿÿþ @á`6@á`: aøÿÿbøÿÿ Aqjvj  ²þÿÿs÷ÿÿs÷ÿÿþ @å`6@å`; ]øÿÿ^øÿÿ Aœl¡l  ®þÿÿo÷ÿÿo÷ÿÿþ @î`N@î`S YøÿÿZøÿÿ AMnRn  ªþÿÿk÷ÿÿk÷ÿÿþ @ò`O@ò`T ÿÿÿªøÿÿ ASn\n 4§þÿÿh÷ÿÿh÷ÿÿþ @ò`U@ò`^ RøÿÿSøÿÿ AHpMp  £þÿÿd÷ÿÿd÷ÿÿþ @ú`l@ú`q r÷ÿÿs÷ÿÿ AÄqÈq  Ÿþÿÿ`÷ÿÿ`÷ÿÿþ @ÿ`6@ÿ`: Œ÷ÿÿ³øÿÿ AÉqÍq 4›þÿÿ­÷ÿÿ­÷ÿÿþ @ÿ`;@ÿ`? FøÿÿGøÿÿ A­s²s  —þÿÿX÷ÿÿX÷ÿÿþ @`.@`3 f÷ÿÿg÷ÿÿ Adtht  “þÿÿT÷ÿÿT÷ÿÿþ @ `6@ `: b÷ÿÿc÷ÿÿ Aww  þÿÿP÷ÿÿP÷ÿÿþ @`u@`y   Þ;/* __next_internal_client_entry_do_not_use__ default auto */ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime"; import { useState, useEffect, useRef } from 'react'; import { useRouter } from 'next/navigation'; import Link from 'next/link'; import { useSession } from '@/lib/auth'; import { useLocale } from '@/context/locale'; import * as api from '@/lib/api'; import { request } from '@/lib/api'; import { formatShortName } from '@/lib/formatName'; import { formatPrice } from '@/lib/taskLocale'; import { CategoryIcon } from '@/components/CategoryIcon'; const TEMPLATE_VARS = { 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' ] }; const TEMPLATE_HINT_VARS = Array.from(new Set(Object.values(TEMPLATE_VARS).flat())); const DEFAULT_CATEGORY_ICON_PRESETS = [ { 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 getCatLabel(row, locale) { if (!row) return ''; if (locale === 'en') return row.namesEn || row.namesEl || row.slug || ''; if (locale === 'ru') return row.namesRu || row.namesEl || row.slug || ''; if (locale === 'uk') return row.namesUk || row.namesEl || row.slug || ''; return row.namesEl || row.namesEn || row.slug || ''; } function getLocLabel(row, locale) { if (!row) return ''; if (locale === 'en') return row.nameEn || row.nameEl || row.slug || ''; if (locale === 'ru') return row.nameRu || row.nameEl || row.slug || ''; if (locale === 'uk') return row.nameUk || row.nameEl || row.slug || ''; return row.nameEl || row.nameEn || row.slug || ''; } function CategoryIconPicker(param) { let { value, onChange, onUpload, uploading, error, presets } = param; return /*#__PURE__*/ _jsxs("div", { className: "space-y-2", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 rounded-xl border border-gray-200 bg-white px-3 py-2", children: [ /*#__PURE__*/ _jsx("div", { className: "flex h-12 w-12 items-center justify-center rounded-lg bg-green-50", children: /*#__PURE__*/ _jsx(CategoryIcon, { icon: value, alt: "category icon", className: "h-9 w-9 object-contain text-3xl leading-none", fallback: "\uD83D\uDCE6" }) }), /*#__PURE__*/ _jsx("input", { value: value, onChange: (e)=>onChange(e.target.value), className: "flex-1 border-0 bg-transparent p-0 text-sm outline-none ring-0", placeholder: "/category-icons/package.svg" }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2", children: [ /*#__PURE__*/ _jsxs("label", { className: "inline-flex cursor-pointer items-center rounded-lg border px-3 py-1.5 text-xs font-medium transition ".concat(uploading ? 'border-gray-200 bg-gray-100 text-gray-400' : 'border-green-300 bg-green-50 text-green-700 hover:bg-green-100'), children: [ uploading ? 'Uploading...' : 'Upload SVG', /*#__PURE__*/ _jsx("input", { type: "file", accept: ".svg,image/svg+xml", className: "hidden", disabled: uploading, onChange: async (e)=>{ var _e_target_files; const file = (_e_target_files = e.target.files) === null || _e_target_files === void 0 ? void 0 : _e_target_files[0]; if (!file) return; await onUpload(file); e.target.value = ''; } }) ] }), /*#__PURE__*/ _jsx("span", { className: "text-xs text-gray-500", children: "or choose from presets" }) ] }), /*#__PURE__*/ _jsx("p", { className: "text-[11px] text-gray-500", children: "Preset source: /public/category-icons/presets.json" }), error ? /*#__PURE__*/ _jsx("p", { className: "text-xs text-red-600", children: error }) : null, /*#__PURE__*/ _jsx("div", { className: "grid grid-cols-2 gap-2 sm:grid-cols-3 lg:grid-cols-4", children: presets.map((preset)=>{ const active = value === preset.value; return /*#__PURE__*/ _jsxs("button", { type: "button", onClick: ()=>onChange(preset.value), className: "flex h-20 flex-col items-center justify-center gap-1 rounded-lg border px-2 transition ".concat(active ? 'border-green-500 bg-green-50 shadow-sm' : 'border-gray-200 bg-white hover:border-green-300 hover:bg-green-50'), "aria-label": preset.label, title: preset.label, children: [ /*#__PURE__*/ _jsx(CategoryIcon, { icon: preset.value, alt: preset.label, className: "h-8 w-8 object-contain text-3xl leading-none", fallback: "\uD83D\uDCE6" }), /*#__PURE__*/ _jsx("span", { className: "max-w-full truncate text-[11px] font-medium text-gray-600 leading-tight", children: preset.label }) ] }, preset.value); }) }) ] }); } function AdminCatPicker(param) { let { catRows, locale, selected, onAdd, addLabel } = param; const [open, setOpen] = useState(false); const [search, setSearch] = useState(''); const [expandedParent, setExpandedParent] = useState(null); const ref = useRef(null); useEffect(()=>{ function h(e) { if (ref.current && !ref.current.contains(e.target)) { setOpen(false); setSearch(''); } } document.addEventListener('mousedown', h); return ()=>document.removeEventListener('mousedown', h); }, []); const parents = catRows.filter((r)=>!r.parentId); const lowerSearch = search.toLowerCase(); const matchesSearch = (r)=>{ var _r_slug; return !search || getCatLabel(r, locale).toLowerCase().includes(lowerSearch) || ((_r_slug = r.slug) !== null && _r_slug !== void 0 ? _r_slug : '').toLowerCase().includes(lowerSearch); }; return /*#__PURE__*/ _jsxs("div", { className: "relative", ref: ref, children: [ /*#__PURE__*/ _jsxs("button", { type: "button", onClick: ()=>setOpen((v)=>!v), className: "w-full flex items-center gap-1.5 px-3 py-1.5 text-xs transition-colors ".concat(open ? '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: [ /*#__PURE__*/ _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: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4 6h16M4 10h16M4 14h16M4 18h16" }) }), /*#__PURE__*/ _jsx("span", { className: "flex-1 text-left truncate", children: addLabel }), /*#__PURE__*/ _jsx("svg", { className: "w-3 h-3 text-gray-400 shrink-0 transition-transform ".concat(open ? 'rotate-180' : ''), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19 9l-7 7-7-7" }) }) ] }), open && /*#__PURE__*/ _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: [ /*#__PURE__*/ _jsx("div", { className: "sticky top-0 bg-white px-3 py-2 border-b border-gray-100", children: /*#__PURE__*/ _jsx("input", { autoFocus: true, value: search, onChange: (e)=>setSearch(e.target.value), placeholder: "ППОск...", className: "w-full text-xs border border-gray-200 rounded-lg px-2.5 py-1.5 focus:outline-none focus:ring-2 focus:ring-blue-300" }) }), parents.map((parent)=>{ const children = catRows.filter((r)=>r.parentId === parent.id); const parentLabel = getCatLabel(parent, locale); const isExpanded = expandedParent === parent.id; const matchingChildren = children.filter((c)=>!selected.includes(c.slug) && matchesSearch(c)); const parentAvail = !selected.includes(parent.slug) && matchesSearch(parent); const hasChildren = children.length > 0; if (!parentAvail && matchingChildren.length === 0 && search) return null; return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _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: ()=>{ if (hasChildren && !search) { setExpandedParent(isExpanded ? null : parent.id); } else if (parentAvail) { onAdd(parent.slug); setOpen(false); setSearch(''); } }, children: [ parent.icon ? /*#__PURE__*/ _jsx(CategoryIcon, { icon: parent.icon, alt: parentLabel, className: "h-5 w-5 shrink-0 object-contain text-sm leading-none", fallback: "\uD83D\uDCE6" }) : null, /*#__PURE__*/ _jsx("span", { className: "flex-1 font-medium", children: parentLabel }), hasChildren && !search ? /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5 text-gray-400 shrink-0 transition-transform ".concat(isExpanded ? 'rotate-90' : ''), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 5l7 7-7 7" }) }) : null ] }), (isExpanded || !!search) && matchingChildren.map((child)=>/*#__PURE__*/ _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: ()=>{ onAdd(child.slug); setOpen(false); setSearch(''); }, children: [ /*#__PURE__*/ _jsx("span", { className: "w-1.5 h-1.5 rounded-full bg-gray-300 shrink-0" }), /*#__PURE__*/ _jsx("span", { className: "flex-1", children: getCatLabel(child, locale) }) ] }, child.id)) ] }, parent.id); }) ] }) ] }); } function AdminLocPicker(param) { let { locRows, locale, selected, onAdd, addLabel } = param; const [open, setOpen] = useState(false); const [search, setSearch] = useState(''); const [expandedCity, setExpandedCity] = useState(null); const ref = useRef(null); useEffect(()=>{ function h(e) { if (ref.current && !ref.current.contains(e.target)) { setOpen(false); setSearch(''); } } document.addEventListener('mousedown', h); return ()=>document.removeEventListener('mousedown', h); }, []); const cities = locRows.filter((r)=>!r.parentId); const lowerSearch = search.toLowerCase(); const matchesSearch = (r)=>{ var _r_slug; return !search || getLocLabel(r, locale).toLowerCase().includes(lowerSearch) || ((_r_slug = r.slug) !== null && _r_slug !== void 0 ? _r_slug : '').toLowerCase().includes(lowerSearch); }; return /*#__PURE__*/ _jsxs("div", { className: "relative", ref: ref, children: [ /*#__PURE__*/ _jsxs("button", { type: "button", onClick: ()=>setOpen((v)=>!v), className: "w-full flex items-center gap-1.5 px-3 py-1.5 text-xs transition-colors ".concat(open ? '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: [ /*#__PURE__*/ _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: [ /*#__PURE__*/ _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" }), /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 11a3 3 0 11-6 0 3 3 0 016 0z" }) ] }), /*#__PURE__*/ _jsx("span", { className: "flex-1 text-left truncate", children: addLabel }), /*#__PURE__*/ _jsx("svg", { className: "w-3 h-3 text-gray-400 shrink-0 transition-transform ".concat(open ? 'rotate-180' : ''), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19 9l-7 7-7-7" }) }) ] }), open && /*#__PURE__*/ _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: [ /*#__PURE__*/ _jsx("div", { className: "sticky top-0 bg-white px-3 py-2 border-b border-gray-100", children: /*#__PURE__*/ _jsx("input", { autoFocus: true, value: search, onChange: (e)=>setSearch(e.target.value), placeholder: "ППОск...", className: "w-full text-xs border border-gray-200 rounded-lg px-2.5 py-1.5 focus:outline-none focus:ring-2 focus:ring-blue-300" }) }), cities.map((city)=>{ const districts = locRows.filter((r)=>r.parentId === city.id); const cityLabel = getLocLabel(city, locale); const isExpanded = expandedCity === city.id; const hasDistricts = districts.length > 0; const matchingDistricts = districts.filter((d)=>!selected.includes(d.slug) && matchesSearch(d)); const cityAvail = !selected.includes(city.slug) && matchesSearch(city); if (!cityAvail && matchingDistricts.length === 0 && search) return null; return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _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: ()=>{ if (hasDistricts && !search) { setExpandedCity(isExpanded ? null : city.id); } else if (cityAvail) { onAdd(city.slug); setOpen(false); setSearch(''); } }, children: [ /*#__PURE__*/ _jsx("svg", { className: "w-3 h-3 text-gray-300 shrink-0", fill: "currentColor", viewBox: "0 0 24 24", children: /*#__PURE__*/ _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" }) }), /*#__PURE__*/ _jsx("span", { className: "flex-1 font-medium", children: cityLabel }), hasDistricts && !search ? /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5 text-gray-400 shrink-0 transition-transform ".concat(isExpanded ? 'rotate-90' : ''), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 5l7 7-7 7" }) }) : null ] }), (isExpanded || !!search) && matchingDistricts.map((d)=>/*#__PURE__*/ _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: ()=>{ onAdd(d.slug); setOpen(false); setSearch(''); }, children: [ /*#__PURE__*/ _jsx("span", { className: "w-1.5 h-1.5 rounded-full bg-gray-300 shrink-0" }), /*#__PURE__*/ _jsx("span", { className: "flex-1", children: getLocLabel(d, locale) }) ] }, d.id)) ] }, city.id); }) ] }) ] }); } export default function AdminPage() { var _session_user, _stats_tokensByMonth; const router = useRouter(); const { data: session, isPending } = useSession(); const { t, locale } = useLocale(); const [tab, setTab] = useState('stats'); const [sidebarCollapsed, setSidebarCollapsed] = useState(false); useEffect(()=>{ setSidebarCollapsed(window.innerWidth < 1024); }, []); // Stats const [stats, setStats] = useState(null); // Users const [users, setUsers] = useState([]); const [usersPage, setUsersPage] = useState(1); const [usersTotal, setUsersTotal] = useState(0); const [usersQ, setUsersQ] = useState(''); const [usersQInput, setUsersQInput] = useState(''); const [usersRole, setUsersRole] = useState(''); // Tasks const [tasks, setTasks] = useState([]); const [tasksPage, setTasksPage] = useState(1); const [tasksTotal, setTasksTotal] = useState(0); const [tasksQ, setTasksQ] = useState(''); const [tasksQInput, setTasksQInput] = useState(''); const [tasksStatus, setTasksStatus] = useState(''); // Reports const [reports, setReports] = useState([]); const [reportsPage, setReportsPage] = useState(1); const [reportsTotal, setReportsTotal] = useState(0); const [pendingReportsCount, setPendingReportsCount] = useState(0); // Specialist card moderation const [moderationCards, setModerationCards] = useState([]); const [moderationCardsPage, setModerationCardsPage] = useState(1); const [moderationCardsTotal, setModerationCardsTotal] = useState(0); const [moderationCardsLoading, setModerationCardsLoading] = useState(false); const [pendingCardsCount, setPendingCardsCount] = useState(0); // Support tickets const [supportTickets, setSupportTickets] = useState([]); const [supportPage, setSupportPage] = useState(1); const [supportTotal, setSupportTotal] = useState(0); const [supportStatus, setSupportStatus] = useState(''); const [supportType, setSupportType] = useState(''); const [supportQ, setSupportQ] = useState(''); const [supportQInput, setSupportQInput] = useState(''); const [supportReplyId, setSupportReplyId] = useState(null); const [supportReplyText, setSupportReplyText] = useState(''); const [supportReplySaving, setSupportReplySaving] = useState(false); // AI Logs const [logs, setLogs] = useState([]); const [logsPage, setLogsPage] = useState(1); const [logsTotal, setLogsTotal] = useState(0); // Activity Logs const [activityLog, setActivityLog] = useState([]); const [activityTotal, setActivityTotal] = useState(0); const [activityPage, setActivityPage] = useState(1); const [activityEvent, setActivityEvent] = useState(''); const [activityUserId, setActivityUserId] = useState(''); const [activityDateFrom, setActivityDateFrom] = useState(''); const [activityDateTo, setActivityDateTo] = useState(''); const [activityEventTypes, setActivityEventTypes] = useState([]); // Mail Logs const [mailLog, setMailLog] = useState([]); const [mailTotal, setMailTotal] = useState(0); const [mailPage, setMailPage] = useState(1); const [mailEvent, setMailEvent] = useState(''); const [mailDateFrom, setMailDateFrom] = useState(''); const [mailDateTo, setMailDateTo] = useState(''); const [mailEventTypes, setMailEventTypes] = useState([]); // Logs sub-tab const [logsSubTab, setLogsSubTab] = useState('ai'); // Notification Logs const [notifLogs, setNotifLogs] = useState([]); const [notifLogsPage, setNotifLogsPage] = useState(1); const [notifLogsTotal, setNotifLogsTotal] = useState(0); const [notifLogsType, setNotifLogsType] = useState(''); const [notifLogsTypes, setNotifLogsTypes] = useState([]); const [notifLogsDateFrom, setNotifLogsDateFrom] = useState(''); const [notifLogsDateTo, setNotifLogsDateTo] = useState(''); // Notification stats chart const [notifsByDay, setNotifsByDay] = useState([]); const [mailByDay, setMailByDay] = useState([]); // Balance archive const [balanceRows, setBalanceRows] = useState([]); const [balanceTotal, setBalanceTotal] = useState(0); const [balancePage, setBalancePage] = useState(1); const [balanceUserId, setBalanceUserId] = useState(''); const [balanceKind, setBalanceKind] = useState(''); const [topUpSaving, setTopUpSaving] = useState(false); const [withdrawSaving, setWithdrawSaving] = useState(false); // User edit modal const [editUser, setEditUser] = useState(null); const [editUserSaving, setEditUserSaving] = useState(false); const [verifyingEmail, setVerifyingEmail] = useState(false); const [editUserTab, setEditUserTab] = useState('profile'); const [balanceModal, setBalanceModal] = useState(null); const [skillInput, setSkillInput] = useState(''); const [editUserCards, setEditUserCards] = useState([]); const [editUserCardsLoading, setEditUserCardsLoading] = useState(false); const [cardSkillInputs, setCardSkillInputs] = useState({}); const [cardSaving, setCardSaving] = useState({}); const [cardCatSelects, setCardCatSelects] = useState({}); const [cardLocSelects, setCardLocSelects] = useState({}); // Plans const [planRows, setPlanRows] = useState([]); const [planForm, setPlanForm] = useState(null); const [planSaving, setPlanSaving] = useState(false); // Locations const [locRows, setLocRows] = useState([]); const [locForm, setLocForm] = useState(null); const [locSaving, setLocSaving] = useState(false); const [locExpanded, setLocExpanded] = useState(new Set()); // Categories const [catRows, setCatRows] = useState([]); const [catForm, setCatForm] = useState(null); const [catSaving, setCatSaving] = useState(false); const [catExpanded, setCatExpanded] = useState(new Set()); const [catIconUploading, setCatIconUploading] = useState(false); const [catIconError, setCatIconError] = useState(null); const [categoryIconPresets, setCategoryIconPresets] = useState(DEFAULT_CATEGORY_ICON_PRESETS); // Category Skills const [catSkillsExpanded, setCatSkillsExpanded] = useState(new Set()); const [catSkillsCache, setCatSkillsCache] = useState({}); const [catSkillsLoading, setCatSkillsLoading] = useState(new Set()); const [skillForm, setSkillForm] = useState(null); const [skillSaving, setSkillSaving] = useState(false); // Settings const [settingsTab, setSettingsTab] = useState('general'); const [generalForm, setGeneralForm] = useState({ siteName: 'CanHelp', siteUrl: '', contactEmail: '', supportPhone: '' }); const [generalSaving, setGeneralSaving] = useState(false); const [generalSaved, setGeneralSaved] = useState(false); const [smtpForm, setSmtpForm] = useState({ host: '', port: '587', username: '', password: '', fromName: 'CanHelp', fromEmail: '', encryption: 'tls' }); const [smtpSaving, setSmtpSaving] = useState(false); const [smtpSaved, setSmtpSaved] = useState(false); const [testEmailSending, setTestEmailSending] = useState(false); const [testEmailResult, setTestEmailResult] = useState(null); const [notifTemplates, setNotifTemplates] = useState({ email_verification: { subject: 'ППЎтверЎОте ваш email — {{siteName}}', body: '' }, registration_success: { subject: 'ДПбрП пПжалПвать в {{siteName}}!', body: '' }, password_reset: { subject: 'ВПсстаМПвлеМОе парПля — {{siteName}}', body: '' }, new_offer: { subject: 'НПвПе преЎлПжеМОе пП вашей заЎаче «{{taskTitle}}»', body: '' }, new_task: { subject: 'НПвая заЎача: {{taskTitle}}', body: '' }, offer_accepted: { subject: 'Ваше преЎлПжеМОе прОМятП: {{taskTitle}}', body: '

Ваше преЎлПжеМОе прОМятП! 🎉

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

ЗаказчОк прОМял ваше преЎлПжеМОе Ма выпПлМеМОе заЎачО:

{{taskTitle}}

СуЌЌа: {{price}}€

Открыть чат →' }, new_message: { subject: 'НПвПе сППбщеМОе Пт {{senderName}}', body: '

НПвПе сППбщеМОе

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

ВаЌ МапОсал(а) {{senderName}}:

"{{preview}}"

ОтветОть →' }, offer_declined: { subject: 'Ваше преЎлПжеМОе ПтклПМеМП: {{taskTitle}}', body: '

Ваше преЎлПжеМОе ПтклПМеМП

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

К сПжалеМОю, заказчОк ПтклПМОл ваше преЎлПжеМОе Ма:

{{taskTitle}}

НайтО ЎругОе заказы →' }, offer_other_accepted: { subject: 'ВыбраМ ЎругПй ОспПлМОтель: {{taskTitle}}', body: '

ВыбраМ ЎругПй ОспПлМОтель

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

ЗаказчОк выбрал ЎругПгП ОспПлМОтеля Ўля заЎаМОя:

{{taskTitle}}

НайтО ЎругОе заказы →' }, task_updated: { subject: 'ЗаЎаМОе ПбМПвлеМП: {{taskTitle}}', body: '

ЗаЎаМОе ПбМПвлеМП

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

ЗаказчОк ПбМПвОл ЎеталО заЎаМОя:

{{taskTitle}}

СЌПтреть заказ →' }, deadline_reminder: { subject: 'ЗаЎаМОе Остекает завтра: {{taskTitle}}', body: '

НапПЌОМаМОе П ЎеЎлайМе

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

Ваше заЎаМОе Остекает через 24 часа. ОбМПвОте ЎеЎлайМ, ОМаче заЎаМОе буЎет автПЌатОческО сМятП с публОкацОО.

{{taskTitle}}

РеЎактОрПвать заЎаМОе →' }, task_archived: { subject: 'ЗаЎаМОе сМятП с публОкацОО: {{taskTitle}}', body: '

ЗаЎаМОе перевеЎеМП в черМПвОк

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

Ваше заЎаМОе ОстеклП О былП автПЌатОческО перевеЎеМП в черМПвОк. ОбМПвОте ЎеЎлайМ, чтПбы ПпублОкПвать егП сМПва.

{{taskTitle}}

РеЎактОрПвать заЎаМОе →' }, referral_reward: { subject: 'Вы пПлучОлО реферальМую МаграЎу — {{siteName}}', body: '

Вы пПлучОлО реферальМую МаграЎу! 🎁

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

Друг зарегОстрОрПвался пП вашей реферальМПй ссылке. На ваш аккауМт ЎПбавлеМП {{days}} ЎМей ЎПступа к плаМу {{planName}}!

+{{days}} ЎМей — {{planName}}

ПерейтО к аккауМту →' }, referral_reward_el: { subject: 'Λάβατε αΜταΌοιβή παραποΌπής — {{siteName}}', body: '

Λάβατε αΜταΌοιβή παραποΌπής! 🎁

Γεια {{userName}},

ΈΜας φίλος εγγράφηκε χρησιΌοποιώΜτας τοΜ σύΜΎεσΌο παραποΌπής σας. ΣτοΜ λογαριασΌό σας προστέΞηκαΜ {{days}} ηΌέρες πρόσβασης στο πλάΜο {{planName}}!

+{{days}} ηΌέρες — {{planName}}

Δες τοΜ λογαριασΌό σου →' }, referral_reward_en: { subject: 'You received a referral reward — {{siteName}}', body: '

You received a referral reward! 🎁

Hi {{userName}},

A friend registered using your referral link. {{days}} days of {{planName}} access have been added to your account!

+{{days}} days — {{planName}}

View your account →' }, referral_reward_ru: { subject: 'Вы пПлучОлО реферальМую МаграЎу — {{siteName}}', body: '

Вы пПлучОлО реферальМую МаграЎу! 🎁

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

Друг зарегОстрОрПвался пП вашей реферальМПй ссылке. На ваш аккауМт ЎПбавлеМП {{days}} ЎМей ЎПступа к плаМу {{planName}}!

+{{days}} ЎМей — {{planName}}

ПерейтО к аккауМту →' } }); const [editingTemplate, setEditingTemplate] = useState(null); const [templateLocale, setTemplateLocale] = useState('el'); const [templateSaving, setTemplateSaving] = useState(false); const [templateTranslating, setTemplateTranslating] = useState(false); const [ePayForm, setEPayForm] = useState({ merchantId: '', apiUser: '', apiPassword: '', environment: 'test', confirmationUrl: '', cancelUrl: '', enabled: false }); const [ePaySaving, setEPaySaving] = useState(false); const [ePaySaved, setEPaySaved] = useState(false); const [referralForm, setReferralForm] = useState({ enabled: false, planId: '', days: '30' }); const [referralSaving, setReferralSaving] = useState(false); const [referralSaved, setReferralSaved] = useState(false); const [seoForm, setSeoForm] = useState({ maintenanceMode: false, indexingEnabled: true, headScripts: '', siteTitleEl: '', siteTitleEn: '', siteTitleRu: '', siteTitleUk: '', siteDescriptionEl: '', siteDescriptionEn: '', siteDescriptionRu: '', siteDescriptionUk: '' }); const [seoSaving, setSeoSaving] = useState(false); const [seoSaved, setSeoSaved] = useState(false); const [seoLangTab, setSeoLangTab] = useState('el'); const [socialForm, setSocialForm] = useState({ telegram: '', instagram: '', facebook: '', twitter: '', youtube: '', tiktok: '', whatsapp: '', viber: '' }); const [socialSaving, setSocialSaving] = useState(false); const [socialSaved, setSocialSaved] = useState(false); const [telegramForm, setTelegramForm] = useState({ botToken: '', adminChatId: '', channelIdEl: '', channelIdEn: '', channelIdRu: '', channelIdUk: '', notifyRegistrations: false, postNewTasks: false }); const [telegramSaving, setTelegramSaving] = useState(false); const [telegramSaved, setTelegramSaved] = useState(false); const [testingTelegramAdmin, setTestingTelegramAdmin] = useState(false); const [testingTelegramChannel, setTestingTelegramChannel] = useState(false); const [testResultTelegramAdmin, setTestResultTelegramAdmin] = useState(null); const [testResultTelegramChannel, setTestResultTelegramChannel] = useState(null); const [testingLocale, setTestingLocale] = useState(null); const [testResultChannels, setTestResultChannels] = useState({}); const [verifyingTelegramToken, setVerifyingTelegramToken] = useState(false); const [verifyResultTelegramToken, setVerifyResultTelegramToken] = useState(null); // Backup const [backupAutoEnabled, setBackupAutoEnabled] = useState(false); const [backupAutoSaving, setBackupAutoSaving] = useState(false); const [backupTables, setBackupTables] = useState([]); const [backupTablesLoading, setBackupTablesLoading] = useState(false); const [backupStoredFiles, setBackupStoredFiles] = useState([]); const [backupExporting, setBackupExporting] = useState(false); const [backupImporting, setBackupImporting] = useState(null); const [backupRestoring, setBackupRestoring] = useState(null); const [backupMsg, setBackupMsg] = useState(null); const [backupMsgError, setBackupMsgError] = useState(false); const setBackupSuccess = (msg)=>{ setBackupMsg(msg); setBackupMsgError(false); }; const setBackupError = (msg)=>{ setBackupMsg(msg); setBackupMsgError(true); }; // ─── Translations state ─────────────────────────────────────────────────── const [transStats, setTransStats] = useState(null); const [transStatsLoading, setTransStatsLoading] = useState(false); const [transLang, setTransLang] = useState('uk'); const [transFromLang, setTransFromLang] = useState('el'); const [transTableTranslating, setTransTableTranslating] = useState({}); const [transMsg, setTransMsg] = useState(null); const [transPreview, setTransPreview] = useState(null); // ─── Referrals state ───────────────────────────────────────────────────── const [referralsData, setReferralsData] = useState(null); const [referralsLoading, setReferralsLoading] = useState(false); const [referralsExpanded, setReferralsExpanded] = useState(new Set()); // ─── Push state ────────────────────────────────────────────────────────── const [pushMode, setPushMode] = useState('broadcast'); const [pushTargetUserId, setPushTargetUserId] = useState(''); const [pushTitle, setPushTitle] = useState(''); const [pushBody, setPushBody] = useState(''); const [pushType, setPushType] = useState('general'); const [pushReferenceId, setPushReferenceId] = useState(''); const [pushOnlyActive, setPushOnlyActive] = useState(true); const [pushSending, setPushSending] = useState(false); const [pushResult, setPushResult] = useState(null); const [pushError, setPushError] = useState(null); const [loading, setLoading] = useState(false); const isAdmin = !isPending && session && ((_session_user = session.user) === null || _session_user === void 0 ? void 0 : _session_user.role) === 'admin'; useEffect(()=>{ var _session_user; if (!isPending && !session) router.push('/login'); if (!isPending && session && ((_session_user = session.user) === null || _session_user === void 0 ? void 0 : _session_user.role) !== 'admin') router.push('/'); }, [ session, isPending ]); useEffect(()=>{ if (!isAdmin) return; api.getAdminStats().then(setStats).catch(()=>{}); api.getAdminNotifStats().then(setNotifsByDay).catch(()=>{}); api.getAdminMailStats().then(setMailByDay).catch(()=>{}); api.getAdminReports(1, 'pending').then((d)=>setPendingReportsCount(d.total)).catch(()=>{}); api.getAdminSpecialistCards(1, 'pending').then((d)=>setPendingCardsCount(d.total)).catch(()=>{}); }, [ isAdmin ]); useEffect(()=>{ if (!isAdmin || tab !== 'users') return; setLoading(true); api.getAdminUsers(usersPage, usersQ || undefined, usersRole || undefined).then((d)=>{ setUsers(d.data); setUsersTotal(d.total); }).catch(()=>{}).finally(()=>setLoading(false)); }, [ isAdmin, tab, usersPage, usersQ, usersRole ]); useEffect(()=>{ if (!isAdmin || tab !== 'tasks') return; setLoading(true); api.getAdminTasks(tasksPage, tasksQ || undefined, tasksStatus || undefined).then((d)=>{ setTasks(d.data); setTasksTotal(d.total); }).catch(()=>{}).finally(()=>setLoading(false)); }, [ isAdmin, tab, tasksPage, tasksQ, tasksStatus ]); useEffect(()=>{ if (!isAdmin || tab !== 'reports') return; setLoading(true); api.getAdminReports(reportsPage).then((d)=>{ setReports(d.data); setReportsTotal(d.total); }).catch(()=>{}).finally(()=>setLoading(false)); }, [ isAdmin, tab, reportsPage ]); useEffect(()=>{ if (!isAdmin || tab !== 'moderation') return; setModerationCardsLoading(true); api.getAdminSpecialistCards(moderationCardsPage, 'review').then((d)=>{ setModerationCards(d.data); setModerationCardsTotal(d.total); }).catch(()=>{}).finally(()=>setModerationCardsLoading(false)); }, [ isAdmin, tab, moderationCardsPage ]); useEffect(()=>{ if (!isAdmin || tab !== 'support') return; setLoading(true); const params = { page: String(supportPage), limit: '30' }; if (supportStatus) params.status = supportStatus; if (supportType) params.type = supportType; if (supportQ) params.q = supportQ; api.getAdminSupportTickets(params).then((d)=>{ setSupportTickets(d.data); setSupportTotal(d.total); }).catch(()=>{}).finally(()=>setLoading(false)); }, [ isAdmin, tab, supportPage, supportStatus, supportType, supportQ ]); useEffect(()=>{ if (!isAdmin || tab !== 'balances') return; setLoading(true); api.getAdminBalanceHistory({ page: balancePage, userId: balanceUserId || undefined, kind: balanceKind || undefined }).then((d)=>{ setBalanceRows(d.data); setBalanceTotal(d.total); }).catch(()=>{}).finally(()=>setLoading(false)); }, [ isAdmin, tab, balancePage, balanceUserId, balanceKind ]); useEffect(()=>{ if (!isAdmin || tab !== 'logs') return; if (logsSubTab === 'ai') { setLoading(true); api.getAdminAiLogs(logsPage).then((d)=>{ setLogs(d.data); setLogsTotal(d.total); }).catch(()=>{}).finally(()=>setLoading(false)); } else if (logsSubTab === 'activity') { api.getAdminActivityLogs({ page: activityPage, event: activityEvent || undefined, userId: activityUserId || undefined, dateFrom: activityDateFrom || undefined, dateTo: activityDateTo || undefined }).then((d)=>{ var _d_eventTypes; setActivityLog(d.data); setActivityTotal(d.total); if ((_d_eventTypes = d.eventTypes) === null || _d_eventTypes === void 0 ? void 0 : _d_eventTypes.length) setActivityEventTypes(d.eventTypes); }).catch(()=>{}); } else if (logsSubTab === 'mail') { api.getAdminMailLogs({ page: mailPage, event: mailEvent || undefined, dateFrom: mailDateFrom || undefined, dateTo: mailDateTo || undefined }).then((d)=>{ var _d_eventTypes; setMailLog(d.data); setMailTotal(d.total); if ((_d_eventTypes = d.eventTypes) === null || _d_eventTypes === void 0 ? void 0 : _d_eventTypes.length) setMailEventTypes(d.eventTypes); }).catch(()=>{}); } else if (logsSubTab === 'notifications') { api.getAdminNotifLogs({ page: notifLogsPage, type: notifLogsType || undefined, dateFrom: notifLogsDateFrom || undefined, dateTo: notifLogsDateTo || undefined }).then((d)=>{ var _d_notifTypes; setNotifLogs(d.data); setNotifLogsTotal(d.total); if ((_d_notifTypes = d.notifTypes) === null || _d_notifTypes === void 0 ? void 0 : _d_notifTypes.length) setNotifLogsTypes(d.notifTypes); }).catch(()=>{}); } }, [ isAdmin, tab, logsSubTab, logsPage, activityPage, activityEvent, activityUserId, activityDateFrom, activityDateTo, mailPage, mailEvent, mailDateFrom, mailDateTo, notifLogsPage, notifLogsType, notifLogsDateFrom, notifLogsDateTo ]); useEffect(()=>{ setActivityPage(1); }, [ activityEvent, activityUserId, activityDateFrom, activityDateTo ]); useEffect(()=>{ setMailPage(1); }, [ mailEvent, mailDateFrom, mailDateTo ]); useEffect(()=>{ setNotifLogsPage(1); }, [ notifLogsType, notifLogsDateFrom, notifLogsDateTo ]); useEffect(()=>{ if (!isAdmin || tab !== 'plans') return; api.getAdminPlans().then(setPlanRows).catch(()=>{}); }, [ isAdmin, tab ]); useEffect(()=>{ if (!isAdmin || tab !== 'translations') return; setTransStatsLoading(true); api.getTranslationsStats().then((d)=>setTransStats(d.tables)).catch(()=>{}).finally(()=>setTransStatsLoading(false)); }, [ isAdmin, tab ]); useEffect(()=>{ if (!isAdmin || tab !== 'backup') return; request('/admin/backup/settings').then((d)=>setBackupAutoEnabled(!!d.autoEnabled)).catch(()=>{}); setBackupTablesLoading(true); request('/admin/backup/tables').then((d)=>setBackupTables(d.tables || [])).catch(()=>{}).finally(()=>setBackupTablesLoading(false)); request('/admin/backup/list').then((d)=>setBackupStoredFiles(d.files || [])).catch(()=>{}); }, [ isAdmin, tab ]); useEffect(()=>{ if (!isAdmin || tab !== 'referrals') return; setReferralsLoading(true); api.getAdminReferrals().then((d)=>setReferralsData(d)).catch(()=>{}).finally(()=>setReferralsLoading(false)); }, [ isAdmin, tab ]); // Load plans when users tab opens (for plan selector in edit modal) useEffect(()=>{ if (!isAdmin || tab !== 'users') return; if (planRows.length === 0) api.getAdminPlans().then(setPlanRows).catch(()=>{}); }, [ isAdmin, tab ]); // Reset page when filters change useEffect(()=>{ setUsersPage(1); }, [ usersQ, usersRole ]); useEffect(()=>{ setTasksPage(1); }, [ tasksQ, tasksStatus ]); useEffect(()=>{ setBalancePage(1); }, [ balanceUserId, balanceKind ]); async function sendAdminPush() { if (!pushTitle.trim()) return; if (pushMode === 'user' && !pushTargetUserId.trim()) { setPushError('УкажОте ID пПльзПвателя'); return; } setPushSending(true); setPushError(null); setPushResult(null); try { const payload = { title: pushTitle.trim(), body: pushBody.trim() || undefined, type: pushType.trim() || undefined, referenceId: pushReferenceId.trim() || undefined }; if (pushMode === 'broadcast') { const res = await api.adminBroadcastPush({ ...payload, onlyActive: pushOnlyActive }); setPushResult(res); } else { const res = await api.adminSendPushToUser(pushTargetUserId.trim(), payload); setPushResult(res); } } catch (err) { setPushError((err === null || err === void 0 ? void 0 : err.message) || 'Не уЎалПсь ПтправОть push'); } finally{ setPushSending(false); } } async function toggleUser(id, isActive) { const fn = isActive ? api.deactivateUser : api.activateUser; const updated = await fn(id).catch(()=>null); if (updated) setUsers((prev)=>prev.map((u)=>u.id === id ? updated : u)); } async function changeRole(id, role) { const updated = await api.changeUserRole(id, role).catch(()=>null); if (updated) setUsers((prev)=>prev.map((u)=>u.id === id ? updated : u)); } function openEditUser(u) { setEditUserTab('profile'); setSkillInput(''); setBalanceModal(null); setEditUserCards([]); setCardSkillInputs({}); setCardSaving({}); setCardCatSelects({}); setCardLocSelects({}); setEditUser({ ...u, topUpAmount: '', topUpDescription: '', withdrawAmount: '', withdrawDescription: '' }); api.getAdminUser(u.id).then((fresh)=>setEditUser((prev)=>prev && prev.id === fresh.id ? { ...fresh, topUpAmount: '', topUpDescription: '', withdrawAmount: '', withdrawDescription: '' } : prev)).catch(()=>{}); } function describeFcmFailure(key, message) { if (!key) return message || 'FCM прОМял 0 сППбщеМОй'; if (key === 'THIRD_PARTY_AUTH_ERROR') { return 'ОшОбка APNs/Firebase iOS: прПверьте Apple APNs Auth Key (.p8) О связку Firebase прПекта Ўля iOS-прОлПжеМОя'; } if (key === 'UNREGISTERED') { return 'ТПкеМ устрПйства бПльше Ме валОЎеМ'; } if (key === 'INVALID_ARGUMENT') { return 'НекПрректМый тПкеМ ОлО payload'; } if (key === 'REQUEST_FAILED') { return message || 'FCM request failed before response'; } return message ? "".concat(key, ": ").concat(message) : key; } async function saveEditUser() { if (!editUser) return; setEditUserSaving(true); try { var _editUser_languages, _editUser_showContactInfo, _editUser_notifyNewTasks, _editUser_notifMessages, _editUser_skills, _editUser_siteSettings; const updated = await api.updateAdminUser(editUser.id, { firstName: editUser.firstName, lastName: editUser.lastName, phone: editUser.phone || null, bio: editUser.bio || null, role: editUser.role, planId: editUser.planId || null, isActive: editUser.isActive, locale: editUser.locale, languages: (_editUser_languages = editUser.languages) !== null && _editUser_languages !== void 0 ? _editUser_languages : [], personalSiteSlug: editUser.personalSiteSlug || null, showContactInfo: (_editUser_showContactInfo = editUser.showContactInfo) !== null && _editUser_showContactInfo !== void 0 ? _editUser_showContactInfo : false, notifyNewTasks: (_editUser_notifyNewTasks = editUser.notifyNewTasks) !== null && _editUser_notifyNewTasks !== void 0 ? _editUser_notifyNewTasks : false, notifMessages: (_editUser_notifMessages = editUser.notifMessages) !== null && _editUser_notifMessages !== void 0 ? _editUser_notifMessages : true, skills: (_editUser_skills = editUser.skills) !== null && _editUser_skills !== void 0 ? _editUser_skills : [], siteSettings: (_editUser_siteSettings = editUser.siteSettings) !== null && _editUser_siteSettings !== void 0 ? _editUser_siteSettings : {} }); await Promise.all(editUserCards.map((card)=>{ var _card_skills, _card_categories, _card_locations; return api.adminUpdateSpecialistCard(card.id, { title: card.title, description: card.description || null, skills: (_card_skills = card.skills) !== null && _card_skills !== void 0 ? _card_skills : [], categories: (_card_categories = card.categories) !== null && _card_categories !== void 0 ? _card_categories : [], locations: (_card_locations = card.locations) !== null && _card_locations !== void 0 ? _card_locations : [], publicationStatus: card.publicationStatus, isActive: card.isActive }).catch(()=>null); })); setUsers((prev)=>prev.map((u)=>u.id === editUser.id ? updated : u)); setEditUser(null); } catch (e) {} finally{ setEditUserSaving(false); } } async function verifyEmail() { if (!editUser) return; setVerifyingEmail(true); try { const updated = await api.verifyAdminUserEmail(editUser.id); setEditUser((u)=>u ? { ...u, emailVerified: updated.emailVerified } : u); setUsers((prev)=>prev.map((u)=>u.id === editUser.id ? { ...u, emailVerified: updated.emailVerified } : u)); } catch (e) {} finally{ setVerifyingEmail(false); } } async function handleAdminTopUp() { if (!editUser) return; const amount = Number(editUser.topUpAmount); if (!amount || amount <= 0) return; setTopUpSaving(true); try { const result = await api.adminTopUpUserBalance(editUser.id, { amount, description: editUser.topUpDescription || undefined }); setUsers((prev)=>prev.map((u)=>u.id === editUser.id ? result.user : u)); setEditUser((prev)=>prev ? { ...prev, ...result.user, topUpAmount: '', topUpDescription: '' } : prev); if (tab === 'balances') { api.getAdminBalanceHistory({ page: balancePage, userId: balanceUserId || undefined, kind: balanceKind || undefined }).then((d)=>{ setBalanceRows(d.data); setBalanceTotal(d.total); }).catch(()=>{}); } } catch (e) { // ignore } finally{ setTopUpSaving(false); } } async function handleAdminWithdraw() { if (!editUser) return; const amount = Number(editUser.withdrawAmount); if (!amount || amount <= 0) return; setWithdrawSaving(true); try { const result = await api.adminWithdrawUserBalance(editUser.id, { amount, description: editUser.withdrawDescription || undefined }); setUsers((prev)=>prev.map((u)=>u.id === editUser.id ? result.user : u)); setEditUser((prev)=>prev ? { ...prev, ...result.user, withdrawAmount: '', withdrawDescription: '' } : prev); if (tab === 'balances') { api.getAdminBalanceHistory({ page: balancePage, userId: balanceUserId || undefined, kind: balanceKind || undefined }).then((d)=>{ setBalanceRows(d.data); setBalanceTotal(d.total); }).catch(()=>{}); } } catch (e) { // ignore } finally{ setWithdrawSaving(false); } } async function saveCard(cardId) { const card = editUserCards.find((c)=>c.id === cardId); if (!card) return; setCardSaving((prev)=>({ ...prev, [cardId]: true })); try { var _card_skills, _card_categories, _card_locations; const updated = await api.adminUpdateSpecialistCard(cardId, { title: card.title, description: card.description || null, skills: (_card_skills = card.skills) !== null && _card_skills !== void 0 ? _card_skills : [], categories: (_card_categories = card.categories) !== null && _card_categories !== void 0 ? _card_categories : [], locations: (_card_locations = card.locations) !== null && _card_locations !== void 0 ? _card_locations : [], publicationStatus: card.publicationStatus, isActive: card.isActive }); setEditUserCards((prev)=>prev.map((c)=>c.id === cardId ? updated : c)); } catch (e) {} finally{ setCardSaving((prev)=>({ ...prev, [cardId]: false })); } } async function updateModerationCard(cardId, publicationStatus) { const updated = await api.adminUpdateSpecialistCard(cardId, { publicationStatus, isActive: publicationStatus === 'active' }).catch(()=>null); if (!updated) return; setModerationCards((prev)=>prev.map((card)=>card.id === cardId ? updated : card)); if ((editUser === null || editUser === void 0 ? void 0 : editUser.id) === updated.specialistId) { setEditUserCards((prev)=>prev.map((card)=>card.id === cardId ? updated : card)); } api.getAdminReports(1, 'pending').then((d)=>setPendingReportsCount(d.total)).catch(()=>{}); api.getAdminSpecialistCards(1, 'pending').then((d)=>setPendingCardsCount(d.total)).catch(()=>{}); } async function cancelTask(id) { const updated = await api.cancelTaskAdmin(id).catch(()=>null); if (updated) { const task = updated.task || updated; setTasks((prev)=>prev.map((row)=>{ const t = row.task || row; return t.id === id ? { ...row, task: task } : row; })); } } async function deleteTask(id, title) { if (!window.confirm("".concat(t('admin.tasks.delete.confirm'), '\n"').concat(title, '"'))) return; const ok = await api.deleteTaskAdmin(id).catch(()=>null); if (ok) setTasks((prev)=>prev.filter((row)=>{ var _row_task; return (((_row_task = row.task) === null || _row_task === void 0 ? void 0 : _row_task.id) || row.id) !== id; })); } async function handleReport(id, status) { const updated = await api.updateReportStatus(id, status).catch(()=>null); if (updated) setReports((prev)=>prev.map((r)=>r.id === id ? { ...r, ...updated } : r)); } // Locations useEffect(()=>{ if (!isAdmin || tab !== 'locations') return; api.getAdminLocations().then(setLocRows).catch(()=>{}); }, [ isAdmin, tab ]); function openAddLoc(parentId) { setLocForm({ parentId: parentId !== null && parentId !== void 0 ? parentId : null, slug: '', nameEl: '', nameEn: '', nameRu: '', nameUk: '', order: 0, isActive: true }); } function openEditLoc(loc) { var _loc_names, _loc_names1, _loc_names2, _loc_names3; var _loc_parentId, _loc_nameEl, _ref, _loc_nameEn, _ref1, _loc_nameRu, _ref2, _loc_nameUk, _ref3, _loc_order, _loc_isActive; setLocForm({ id: loc.id, parentId: (_loc_parentId = loc.parentId) !== null && _loc_parentId !== void 0 ? _loc_parentId : null, slug: loc.slug, nameEl: (_ref = (_loc_nameEl = loc.nameEl) !== null && _loc_nameEl !== void 0 ? _loc_nameEl : (_loc_names = loc.names) === null || _loc_names === void 0 ? void 0 : _loc_names.el) !== null && _ref !== void 0 ? _ref : '', nameEn: (_ref1 = (_loc_nameEn = loc.nameEn) !== null && _loc_nameEn !== void 0 ? _loc_nameEn : (_loc_names1 = loc.names) === null || _loc_names1 === void 0 ? void 0 : _loc_names1.en) !== null && _ref1 !== void 0 ? _ref1 : '', nameRu: (_ref2 = (_loc_nameRu = loc.nameRu) !== null && _loc_nameRu !== void 0 ? _loc_nameRu : (_loc_names2 = loc.names) === null || _loc_names2 === void 0 ? void 0 : _loc_names2.ru) !== null && _ref2 !== void 0 ? _ref2 : '', nameUk: (_ref3 = (_loc_nameUk = loc.nameUk) !== null && _loc_nameUk !== void 0 ? _loc_nameUk : (_loc_names3 = loc.names) === null || _loc_names3 === void 0 ? void 0 : _loc_names3.uk) !== null && _ref3 !== void 0 ? _ref3 : '', order: (_loc_order = loc.order) !== null && _loc_order !== void 0 ? _loc_order : 0, isActive: (_loc_isActive = loc.isActive) !== null && _loc_isActive !== void 0 ? _loc_isActive : true }); } async function saveLoc() { if (!locForm) return; setLocSaving(true); try { if (locForm.id) { const updated = await api.updateLocation(locForm.id, locForm); setLocRows((prev)=>prev.map((r)=>r.id === locForm.id ? updated : r)); } else { const created = await api.createLocation({ slug: locForm.slug, nameEl: locForm.nameEl, nameEn: locForm.nameEn, nameRu: locForm.nameRu, nameUk: locForm.nameUk, parentId: locForm.parentId, order: locForm.order }); setLocRows((prev)=>[ ...prev, created ]); } setLocForm(null); } catch (e) { // ignore } finally{ setLocSaving(false); } } async function deleteLoc(id, name) { if (!window.confirm("".concat(t('admin.loc.delete.confirm'), '\n"').concat(name, '"'))) return; const ok = await api.deleteLocation(id).catch(()=>null); if (ok) setLocRows((prev)=>prev.filter((r)=>r.id !== id)); } function toggleLocExpand(id) { setLocExpanded((prev)=>{ const next = new Set(prev); next.has(id) ? next.delete(id) : next.add(id); return next; }); } // Categories useEffect(()=>{ if (!isAdmin || tab !== 'categories') return; api.getAdminCategories().then(setCatRows).catch(()=>{}); }, [ isAdmin, tab ]); useEffect(()=>{ if (!isAdmin) return; fetch('/category-icons/presets.json').then((res)=>res.ok ? res.json() : Promise.reject(new Error('Failed to load presets'))).then((data)=>{ if (!Array.isArray(data)) return; const cleaned = data.filter((x)=>!!x && typeof x === 'object' && typeof x.value === 'string' && typeof x.label === 'string').filter((x)=>x.value.startsWith('/category-icons/')); if (cleaned.length > 0) setCategoryIconPresets(cleaned); }).catch(()=>{}); }, [ isAdmin ]); function openAddCat(parentId) { setCatIconError(null); setCatForm({ parentId: parentId !== null && parentId !== void 0 ? parentId : null, slug: '', icon: '/category-icons/package.svg', namesEl: '', namesEn: '', namesRu: '', namesUk: '', order: 0, isActive: true }); } function openEditCat(cat) { var _cat_names, _cat_names1, _cat_names2, _cat_names3; const selectedIcon = typeof cat.icon === 'string' ? cat.icon : ''; const knownPreset = new Set(categoryIconPresets.map((p)=>p.value)); const normalizedIcon = selectedIcon.startsWith('/category-icons/') && !knownPreset.has(selectedIcon) ? '/category-icons/package.svg' : selectedIcon || '/category-icons/package.svg'; setCatIconError(null); var _cat_parentId, _cat_namesEl, _ref, _cat_namesEn, _ref1, _cat_namesRu, _ref2, _cat_namesUk, _ref3, _cat_order, _cat_isActive; setCatForm({ id: cat.id, parentId: (_cat_parentId = cat.parentId) !== null && _cat_parentId !== void 0 ? _cat_parentId : null, slug: cat.slug, icon: normalizedIcon, namesEl: (_ref = (_cat_namesEl = cat.namesEl) !== null && _cat_namesEl !== void 0 ? _cat_namesEl : (_cat_names = cat.names) === null || _cat_names === void 0 ? void 0 : _cat_names.el) !== null && _ref !== void 0 ? _ref : '', namesEn: (_ref1 = (_cat_namesEn = cat.namesEn) !== null && _cat_namesEn !== void 0 ? _cat_namesEn : (_cat_names1 = cat.names) === null || _cat_names1 === void 0 ? void 0 : _cat_names1.en) !== null && _ref1 !== void 0 ? _ref1 : '', namesRu: (_ref2 = (_cat_namesRu = cat.namesRu) !== null && _cat_namesRu !== void 0 ? _cat_namesRu : (_cat_names2 = cat.names) === null || _cat_names2 === void 0 ? void 0 : _cat_names2.ru) !== null && _ref2 !== void 0 ? _ref2 : '', namesUk: (_ref3 = (_cat_namesUk = cat.namesUk) !== null && _cat_namesUk !== void 0 ? _cat_namesUk : (_cat_names3 = cat.names) === null || _cat_names3 === void 0 ? void 0 : _cat_names3.uk) !== null && _ref3 !== void 0 ? _ref3 : '', order: (_cat_order = cat.order) !== null && _cat_order !== void 0 ? _cat_order : 0, isActive: (_cat_isActive = cat.isActive) !== null && _cat_isActive !== void 0 ? _cat_isActive : true }); } async function uploadCategoryIcon(file) { if (file.type !== 'image/svg+xml') { setCatIconError('Only SVG files are allowed'); return; } setCatIconUploading(true); setCatIconError(null); try { const fd = new FormData(); fd.append('file', file); const base = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; const res = await fetch("".concat(base, "/api/uploads"), { method: 'POST', credentials: 'include', body: fd }); if (!res.ok) { const err = await res.json().catch(()=>({ error: 'Upload failed' })); throw new Error(err.error || 'Upload failed'); } const data = await res.json(); setCatForm((f)=>f ? { ...f, icon: data.url } : f); } catch (err) { setCatIconError((err === null || err === void 0 ? void 0 : err.message) || 'Upload failed'); } finally{ setCatIconUploading(false); } } async function saveCat() { if (!catForm) return; setCatSaving(true); try { if (catForm.id) { const updated = await api.updateCategory(catForm.id, catForm); setCatRows((prev)=>prev.map((r)=>r.id === catForm.id ? updated : r)); } else { const created = await api.createCategory({ slug: catForm.slug, icon: catForm.icon, namesEl: catForm.namesEl, namesEn: catForm.namesEn, namesRu: catForm.namesRu, namesUk: catForm.namesUk, parentId: catForm.parentId, order: catForm.order }); setCatRows((prev)=>[ ...prev, created ]); } setCatForm(null); } catch (e) { // ignore } finally{ setCatSaving(false); } } async function deleteCat(id, name) { if (!window.confirm("".concat(t('admin.cat.delete.confirm'), '\n"').concat(name, '"'))) return; const ok = await api.deleteCategory(id).catch(()=>null); if (ok) setCatRows((prev)=>prev.filter((r)=>r.id !== id)); } function toggleCatExpand(id) { setCatExpanded((prev)=>{ const next = new Set(prev); next.has(id) ? next.delete(id) : next.add(id); return next; }); } async function toggleCatSkills(cat) { const id = cat.id; const slug = cat.slug; setCatSkillsExpanded((prev)=>{ const next = new Set(prev); if (next.has(id)) { next.delete(id); return next; } next.add(id); return next; }); if (!catSkillsCache[slug]) { setCatSkillsLoading((prev)=>new Set(prev).add(id)); try { const skills = await api.getAdminSkills(slug); setCatSkillsCache((prev)=>({ ...prev, [slug]: skills })); } catch (e) {} finally{ setCatSkillsLoading((prev)=>{ const n = new Set(prev); n.delete(id); return n; }); } } } function openAddSkill(catSlug) { setSkillForm({ catSlug, nameEl: '', nameEn: '', nameRu: '', nameUk: '', order: 0 }); } function openEditSkill(skill, catSlug) { var _skill_nameEl, _skill_nameEn, _skill_nameRu, _skill_nameUk, _skill_order; setSkillForm({ id: skill.id, catSlug, nameEl: (_skill_nameEl = skill.nameEl) !== null && _skill_nameEl !== void 0 ? _skill_nameEl : '', nameEn: (_skill_nameEn = skill.nameEn) !== null && _skill_nameEn !== void 0 ? _skill_nameEn : '', nameRu: (_skill_nameRu = skill.nameRu) !== null && _skill_nameRu !== void 0 ? _skill_nameRu : '', nameUk: (_skill_nameUk = skill.nameUk) !== null && _skill_nameUk !== void 0 ? _skill_nameUk : '', order: (_skill_order = skill.order) !== null && _skill_order !== void 0 ? _skill_order : 0 }); } async function saveSkill() { if (!skillForm) return; setSkillSaving(true); try { if (skillForm.id) { const updated = await api.updateSkill(skillForm.id, { nameEl: skillForm.nameEl, nameEn: skillForm.nameEn, nameRu: skillForm.nameRu, nameUk: skillForm.nameUk, order: skillForm.order }); setCatSkillsCache((prev)=>{ var _prev_skillForm_catSlug; return { ...prev, [skillForm.catSlug]: ((_prev_skillForm_catSlug = prev[skillForm.catSlug]) !== null && _prev_skillForm_catSlug !== void 0 ? _prev_skillForm_catSlug : []).map((s)=>s.id === skillForm.id ? updated : s) }; }); } else { const created = await api.createSkill({ categorySlug: skillForm.catSlug, nameEl: skillForm.nameEl, nameEn: skillForm.nameEn, nameRu: skillForm.nameRu, nameUk: skillForm.nameUk, order: skillForm.order }); setCatSkillsCache((prev)=>{ var _prev_skillForm_catSlug; return { ...prev, [skillForm.catSlug]: [ ...(_prev_skillForm_catSlug = prev[skillForm.catSlug]) !== null && _prev_skillForm_catSlug !== void 0 ? _prev_skillForm_catSlug : [], created ] }; }); } setSkillForm(null); } catch (e) {} finally{ setSkillSaving(false); } } async function deleteSkill(skill, catSlug) { if (!skill._skipConfirm && !window.confirm('УЎалОть Мавык "'.concat(skill.nameEl, '"?'))) return; const ok = skill._skipConfirm ? true : await api.deleteSkill(skill.id).catch(()=>null); if (ok) { setCatSkillsCache((prev)=>{ var _prev_catSlug; return { ...prev, [catSlug]: ((_prev_catSlug = prev[catSlug]) !== null && _prev_catSlug !== void 0 ? _prev_catSlug : []).filter((s)=>s.id !== skill.id) }; }); } } function openAddPlan() { setPlanForm({ 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: false, isActive: true, order: 0, notifyNewTasks: false, canContactFreePlan: false, canContactProPlan: true, canContactAll: false, canShowContactInfo: false, canViewPhone: false, canUploadVideo: false, hasFavorites: false, hasGoogleCalendar: false, hasVerifiedBadge: false, highlightedReviews: false, hasPersonalSite: false, hasCanHelpNowStatus: false, hasNeedHelpStatus: false, hasAutoResponse: false, hasAutoMatch: false, hasPriceList: false, receiveInstantDispatchFree: false, receiveInstantDispatchPro: false }); } function openEditPlan(plan) { var _plan_description, _plan_role, _plan_tier, _plan_price, _plan_oldPrice, _plan_currency, _plan_searchBoost, _plan_offersMultiplier, _plan_features, _plan_isDefault, _plan_isActive, _plan_order, _plan_notifyNewTasks, _plan_canContactFreePlan, _plan_canContactProPlan, _plan_canContactAll, _plan_canShowContactInfo, _plan_canViewPhone, _plan_canUploadVideo, _plan_hasFavorites, _plan_hasGoogleCalendar, _plan_hasVerifiedBadge, _plan_highlightedReviews, _plan_hasPersonalSite, _plan_hasCanHelpNowStatus, _plan_hasNeedHelpStatus, _plan_hasAutoResponse, _plan_hasAutoMatch, _plan_hasPriceList, _plan_receiveInstantDispatchFree, _plan_receiveInstantDispatchPro; setPlanForm({ id: plan.id, name: plan.name, description: (_plan_description = plan.description) !== null && _plan_description !== void 0 ? _plan_description : '', role: (_plan_role = plan.role) !== null && _plan_role !== void 0 ? _plan_role : 'customer', tier: (_plan_tier = plan.tier) !== null && _plan_tier !== void 0 ? _plan_tier : 'free', price: (_plan_price = plan.price) !== null && _plan_price !== void 0 ? _plan_price : '0', oldPrice: (_plan_oldPrice = plan.oldPrice) !== null && _plan_oldPrice !== void 0 ? _plan_oldPrice : '', currency: (_plan_currency = plan.currency) !== null && _plan_currency !== void 0 ? _plan_currency : 'EUR', maxTasks: plan.maxTasks != null ? String(plan.maxTasks) : '', maxOffers: plan.maxOffers != null ? String(plan.maxOffers) : '', maxCards: plan.maxCards != null ? String(plan.maxCards) : '', maxMessagesPerDay: plan.maxMessagesPerDay != null ? String(plan.maxMessagesPerDay) : '', maxOrdersPerDay: plan.maxOrdersPerDay != null ? String(plan.maxOrdersPerDay) : '', maxSkills: plan.maxSkills != null ? String(plan.maxSkills) : '', durationDays: plan.durationDays != null ? String(plan.durationDays) : '', searchBoost: (_plan_searchBoost = plan.searchBoost) !== null && _plan_searchBoost !== void 0 ? _plan_searchBoost : 0, offersMultiplier: (_plan_offersMultiplier = plan.offersMultiplier) !== null && _plan_offersMultiplier !== void 0 ? _plan_offersMultiplier : '1.00', features: ((_plan_features = plan.features) !== null && _plan_features !== void 0 ? _plan_features : []).join('\n'), isDefault: (_plan_isDefault = plan.isDefault) !== null && _plan_isDefault !== void 0 ? _plan_isDefault : false, isActive: (_plan_isActive = plan.isActive) !== null && _plan_isActive !== void 0 ? _plan_isActive : true, order: (_plan_order = plan.order) !== null && _plan_order !== void 0 ? _plan_order : 0, notifyNewTasks: (_plan_notifyNewTasks = plan.notifyNewTasks) !== null && _plan_notifyNewTasks !== void 0 ? _plan_notifyNewTasks : false, canContactFreePlan: (_plan_canContactFreePlan = plan.canContactFreePlan) !== null && _plan_canContactFreePlan !== void 0 ? _plan_canContactFreePlan : false, canContactProPlan: (_plan_canContactProPlan = plan.canContactProPlan) !== null && _plan_canContactProPlan !== void 0 ? _plan_canContactProPlan : true, canContactAll: (_plan_canContactAll = plan.canContactAll) !== null && _plan_canContactAll !== void 0 ? _plan_canContactAll : false, canShowContactInfo: (_plan_canShowContactInfo = plan.canShowContactInfo) !== null && _plan_canShowContactInfo !== void 0 ? _plan_canShowContactInfo : false, canViewPhone: (_plan_canViewPhone = plan.canViewPhone) !== null && _plan_canViewPhone !== void 0 ? _plan_canViewPhone : false, canUploadVideo: (_plan_canUploadVideo = plan.canUploadVideo) !== null && _plan_canUploadVideo !== void 0 ? _plan_canUploadVideo : false, hasFavorites: (_plan_hasFavorites = plan.hasFavorites) !== null && _plan_hasFavorites !== void 0 ? _plan_hasFavorites : false, hasGoogleCalendar: (_plan_hasGoogleCalendar = plan.hasGoogleCalendar) !== null && _plan_hasGoogleCalendar !== void 0 ? _plan_hasGoogleCalendar : false, hasVerifiedBadge: (_plan_hasVerifiedBadge = plan.hasVerifiedBadge) !== null && _plan_hasVerifiedBadge !== void 0 ? _plan_hasVerifiedBadge : false, highlightedReviews: (_plan_highlightedReviews = plan.highlightedReviews) !== null && _plan_highlightedReviews !== void 0 ? _plan_highlightedReviews : false, hasPersonalSite: (_plan_hasPersonalSite = plan.hasPersonalSite) !== null && _plan_hasPersonalSite !== void 0 ? _plan_hasPersonalSite : false, hasCanHelpNowStatus: (_plan_hasCanHelpNowStatus = plan.hasCanHelpNowStatus) !== null && _plan_hasCanHelpNowStatus !== void 0 ? _plan_hasCanHelpNowStatus : false, hasNeedHelpStatus: (_plan_hasNeedHelpStatus = plan.hasNeedHelpStatus) !== null && _plan_hasNeedHelpStatus !== void 0 ? _plan_hasNeedHelpStatus : false, hasAutoResponse: (_plan_hasAutoResponse = plan.hasAutoResponse) !== null && _plan_hasAutoResponse !== void 0 ? _plan_hasAutoResponse : false, hasAutoMatch: (_plan_hasAutoMatch = plan.hasAutoMatch) !== null && _plan_hasAutoMatch !== void 0 ? _plan_hasAutoMatch : false, hasPriceList: (_plan_hasPriceList = plan.hasPriceList) !== null && _plan_hasPriceList !== void 0 ? _plan_hasPriceList : false, receiveInstantDispatchFree: (_plan_receiveInstantDispatchFree = plan.receiveInstantDispatchFree) !== null && _plan_receiveInstantDispatchFree !== void 0 ? _plan_receiveInstantDispatchFree : false, receiveInstantDispatchPro: (_plan_receiveInstantDispatchPro = plan.receiveInstantDispatchPro) !== null && _plan_receiveInstantDispatchPro !== void 0 ? _plan_receiveInstantDispatchPro : false }); } async function savePlan() { if (!planForm) return; setPlanSaving(true); try { const payload = { name: planForm.name, description: planForm.description || undefined, role: planForm.role, tier: planForm.tier, price: planForm.price, oldPrice: planForm.oldPrice || null, currency: planForm.currency, maxTasks: planForm.maxTasks ? Number(planForm.maxTasks) : null, maxOffers: planForm.maxOffers ? Number(planForm.maxOffers) : null, maxCards: planForm.maxCards ? Number(planForm.maxCards) : null, maxMessagesPerDay: planForm.maxMessagesPerDay ? Number(planForm.maxMessagesPerDay) : null, maxOrdersPerDay: planForm.maxOrdersPerDay ? Number(planForm.maxOrdersPerDay) : null, maxSkills: planForm.maxSkills ? Number(planForm.maxSkills) : null, durationDays: planForm.durationDays ? Number(planForm.durationDays) : null, notifyNewTasks: planForm.notifyNewTasks, searchBoost: planForm.searchBoost, offersMultiplier: planForm.offersMultiplier, canContactFreePlan: planForm.canContactFreePlan, canContactProPlan: planForm.canContactProPlan, canContactAll: planForm.canContactAll, canShowContactInfo: planForm.canShowContactInfo, canViewPhone: planForm.canViewPhone, canUploadVideo: planForm.canUploadVideo, hasFavorites: planForm.hasFavorites, hasGoogleCalendar: planForm.hasGoogleCalendar, hasVerifiedBadge: planForm.hasVerifiedBadge, highlightedReviews: planForm.highlightedReviews, hasPersonalSite: planForm.hasPersonalSite, hasCanHelpNowStatus: planForm.hasCanHelpNowStatus, hasNeedHelpStatus: planForm.hasNeedHelpStatus, hasAutoResponse: planForm.hasAutoResponse, hasAutoMatch: planForm.hasAutoMatch, hasPriceList: planForm.hasPriceList, receiveInstantDispatchFree: planForm.receiveInstantDispatchFree, receiveInstantDispatchPro: planForm.receiveInstantDispatchPro, features: planForm.features ? planForm.features.split('\n').map((s)=>s.trim()).filter(Boolean) : [], isDefault: planForm.isDefault, isActive: planForm.isActive, order: planForm.order }; if (planForm.id) { const updated = await api.updatePlan(planForm.id, payload); setPlanRows((prev)=>prev.map((r)=>r.id === planForm.id ? updated : r)); } else { const created = await api.createPlan(payload); setPlanRows((prev)=>[ ...prev, created ]); } // If set as default — refresh all to sync isDefault flags if (planForm.isDefault) { api.getAdminPlans().then(setPlanRows).catch(()=>{}); } setPlanForm(null); } catch (e) { // ignore } finally{ setPlanSaving(false); } } async function deletePlan(id, name) { if (!window.confirm('Delete plan "'.concat(name, '"?'))) return; const ok = await api.deletePlan(id).catch(()=>null); if (ok) setPlanRows((prev)=>prev.filter((r)=>r.id !== id)); } // Settings useEffect(()=>{ if (!isAdmin || tab !== 'settings') return; if (planRows.length === 0) api.getAdminPlans().then(setPlanRows).catch(()=>{}); api.getAdminSettings().then((kv)=>{ var _kv_generalsiteName, _kv_generalsiteUrl, _kv_generalcontactEmail, _kv_generalsupportPhone; setGeneralForm({ siteName: (_kv_generalsiteName = kv['general.siteName']) !== null && _kv_generalsiteName !== void 0 ? _kv_generalsiteName : 'CanHelp', siteUrl: (_kv_generalsiteUrl = kv['general.siteUrl']) !== null && _kv_generalsiteUrl !== void 0 ? _kv_generalsiteUrl : '', contactEmail: (_kv_generalcontactEmail = kv['general.contactEmail']) !== null && _kv_generalcontactEmail !== void 0 ? _kv_generalcontactEmail : '', supportPhone: (_kv_generalsupportPhone = kv['general.supportPhone']) !== null && _kv_generalsupportPhone !== void 0 ? _kv_generalsupportPhone : '' }); var _kv_smtphost, _kv_smtpport, _kv_smtpusername, _kv_smtppassword, _kv_smtpfromName, _kv_smtpfromEmail, _kv_smtpencryption; setSmtpForm({ host: (_kv_smtphost = kv['smtp.host']) !== null && _kv_smtphost !== void 0 ? _kv_smtphost : '', port: (_kv_smtpport = kv['smtp.port']) !== null && _kv_smtpport !== void 0 ? _kv_smtpport : '587', username: (_kv_smtpusername = kv['smtp.username']) !== null && _kv_smtpusername !== void 0 ? _kv_smtpusername : '', password: (_kv_smtppassword = kv['smtp.password']) !== null && _kv_smtppassword !== void 0 ? _kv_smtppassword : '', fromName: (_kv_smtpfromName = kv['smtp.fromName']) !== null && _kv_smtpfromName !== void 0 ? _kv_smtpfromName : 'CanHelp', fromEmail: (_kv_smtpfromEmail = kv['smtp.fromEmail']) !== null && _kv_smtpfromEmail !== void 0 ? _kv_smtpfromEmail : '', encryption: (_kv_smtpencryption = kv['smtp.encryption']) !== null && _kv_smtpencryption !== void 0 ? _kv_smtpencryption : 'tls' }); var _kv_paymentepaymerchantId, _kv_paymentepayapiUser, _kv_paymentepayapiPassword, _kv_paymentepayenvironment, _kv_paymentepayconfirmationUrl, _kv_paymentepaycancelUrl; setEPayForm({ merchantId: (_kv_paymentepaymerchantId = kv['payment.epay.merchantId']) !== null && _kv_paymentepaymerchantId !== void 0 ? _kv_paymentepaymerchantId : '', apiUser: (_kv_paymentepayapiUser = kv['payment.epay.apiUser']) !== null && _kv_paymentepayapiUser !== void 0 ? _kv_paymentepayapiUser : '', apiPassword: (_kv_paymentepayapiPassword = kv['payment.epay.apiPassword']) !== null && _kv_paymentepayapiPassword !== void 0 ? _kv_paymentepayapiPassword : '', environment: (_kv_paymentepayenvironment = kv['payment.epay.environment']) !== null && _kv_paymentepayenvironment !== void 0 ? _kv_paymentepayenvironment : 'test', confirmationUrl: (_kv_paymentepayconfirmationUrl = kv['payment.epay.confirmationUrl']) !== null && _kv_paymentepayconfirmationUrl !== void 0 ? _kv_paymentepayconfirmationUrl : '', cancelUrl: (_kv_paymentepaycancelUrl = kv['payment.epay.cancelUrl']) !== null && _kv_paymentepaycancelUrl !== void 0 ? _kv_paymentepaycancelUrl : '', enabled: kv['payment.epay.enabled'] === 'true' }); var _kv_referral_plan_id, _ref, _ref1, _kv_referral_days, _ref2, _ref3; setReferralForm({ enabled: kv['referral_enabled'] === 'true', planId: (_ref1 = (_ref = (_kv_referral_plan_id = kv['referral_plan_id']) !== null && _kv_referral_plan_id !== void 0 ? _kv_referral_plan_id : kv['referral_customer_plan_id']) !== null && _ref !== void 0 ? _ref : kv['referral_specialist_plan_id']) !== null && _ref1 !== void 0 ? _ref1 : '', days: (_ref3 = (_ref2 = (_kv_referral_days = kv['referral_days']) !== null && _kv_referral_days !== void 0 ? _kv_referral_days : kv['referral_customer_days']) !== null && _ref2 !== void 0 ? _ref2 : kv['referral_specialist_days']) !== null && _ref3 !== void 0 ? _ref3 : '30' }); var _kv_seoheadScripts, _kv_seositeTitleel, _ref4, _kv_seositeTitleen, _kv_seositeTitleru, _kv_seositeTitleuk, _kv_seositeDescriptionel, _ref5, _kv_seositeDescriptionen, _kv_seositeDescriptionru, _kv_seositeDescriptionuk; setSeoForm({ maintenanceMode: kv['seo.maintenanceMode'] === 'true', indexingEnabled: kv['seo.indexingEnabled'] !== 'false', headScripts: (_kv_seoheadScripts = kv['seo.headScripts']) !== null && _kv_seoheadScripts !== void 0 ? _kv_seoheadScripts : '', siteTitleEl: (_ref4 = (_kv_seositeTitleel = kv['seo.siteTitle.el']) !== null && _kv_seositeTitleel !== void 0 ? _kv_seositeTitleel : kv['seo.siteTitle']) !== null && _ref4 !== void 0 ? _ref4 : '', siteTitleEn: (_kv_seositeTitleen = kv['seo.siteTitle.en']) !== null && _kv_seositeTitleen !== void 0 ? _kv_seositeTitleen : '', siteTitleRu: (_kv_seositeTitleru = kv['seo.siteTitle.ru']) !== null && _kv_seositeTitleru !== void 0 ? _kv_seositeTitleru : '', siteTitleUk: (_kv_seositeTitleuk = kv['seo.siteTitle.uk']) !== null && _kv_seositeTitleuk !== void 0 ? _kv_seositeTitleuk : '', siteDescriptionEl: (_ref5 = (_kv_seositeDescriptionel = kv['seo.siteDescription.el']) !== null && _kv_seositeDescriptionel !== void 0 ? _kv_seositeDescriptionel : kv['seo.siteDescription']) !== null && _ref5 !== void 0 ? _ref5 : '', siteDescriptionEn: (_kv_seositeDescriptionen = kv['seo.siteDescription.en']) !== null && _kv_seositeDescriptionen !== void 0 ? _kv_seositeDescriptionen : '', siteDescriptionRu: (_kv_seositeDescriptionru = kv['seo.siteDescription.ru']) !== null && _kv_seositeDescriptionru !== void 0 ? _kv_seositeDescriptionru : '', siteDescriptionUk: (_kv_seositeDescriptionuk = kv['seo.siteDescription.uk']) !== null && _kv_seositeDescriptionuk !== void 0 ? _kv_seositeDescriptionuk : '' }); var _kv_socialtelegram, _kv_socialinstagram, _kv_socialfacebook, _kv_socialtwitter, _kv_socialyoutube, _kv_socialtiktok, _kv_socialwhatsapp, _kv_socialviber; setSocialForm({ telegram: (_kv_socialtelegram = kv['social.telegram']) !== null && _kv_socialtelegram !== void 0 ? _kv_socialtelegram : '', instagram: (_kv_socialinstagram = kv['social.instagram']) !== null && _kv_socialinstagram !== void 0 ? _kv_socialinstagram : '', facebook: (_kv_socialfacebook = kv['social.facebook']) !== null && _kv_socialfacebook !== void 0 ? _kv_socialfacebook : '', twitter: (_kv_socialtwitter = kv['social.twitter']) !== null && _kv_socialtwitter !== void 0 ? _kv_socialtwitter : '', youtube: (_kv_socialyoutube = kv['social.youtube']) !== null && _kv_socialyoutube !== void 0 ? _kv_socialyoutube : '', tiktok: (_kv_socialtiktok = kv['social.tiktok']) !== null && _kv_socialtiktok !== void 0 ? _kv_socialtiktok : '', whatsapp: (_kv_socialwhatsapp = kv['social.whatsapp']) !== null && _kv_socialwhatsapp !== void 0 ? _kv_socialwhatsapp : '', viber: (_kv_socialviber = kv['social.viber']) !== null && _kv_socialviber !== void 0 ? _kv_socialviber : '' }); var _kv_telegrambotToken, _kv_telegramadminChatId, _kv_telegramchannelIdel, _kv_telegramchannelIden, _kv_telegramchannelIdru, _kv_telegramchannelIduk; setTelegramForm({ botToken: (_kv_telegrambotToken = kv['telegram.botToken']) !== null && _kv_telegrambotToken !== void 0 ? _kv_telegrambotToken : '', adminChatId: (_kv_telegramadminChatId = kv['telegram.adminChatId']) !== null && _kv_telegramadminChatId !== void 0 ? _kv_telegramadminChatId : '', channelIdEl: (_kv_telegramchannelIdel = kv['telegram.channelId.el']) !== null && _kv_telegramchannelIdel !== void 0 ? _kv_telegramchannelIdel : '', channelIdEn: (_kv_telegramchannelIden = kv['telegram.channelId.en']) !== null && _kv_telegramchannelIden !== void 0 ? _kv_telegramchannelIden : '', channelIdRu: (_kv_telegramchannelIdru = kv['telegram.channelId.ru']) !== null && _kv_telegramchannelIdru !== void 0 ? _kv_telegramchannelIdru : '', channelIdUk: (_kv_telegramchannelIduk = kv['telegram.channelId.uk']) !== null && _kv_telegramchannelIduk !== void 0 ? _kv_telegramchannelIduk : '', notifyRegistrations: kv['telegram.notifyRegistrations'] === 'true', postNewTasks: kv['telegram.postNewTasks'] === 'true' }); }).catch(()=>{}); api.getAdminEmailTemplates().then((rows)=>{ const map = {}; for (const r of rows)map[r.key] = { subject: r.subject, body: r.body }; setNotifTemplates((prev)=>({ ...prev, ...map })); }).catch(()=>{}); }, [ isAdmin, tab ]); async function saveGeneralSettings() { setGeneralSaving(true); try { await api.updateAdminSettings({ 'general.siteName': generalForm.siteName, 'general.siteUrl': generalForm.siteUrl, 'general.contactEmail': generalForm.contactEmail, 'general.supportPhone': generalForm.supportPhone }); setGeneralSaved(true); setTimeout(()=>setGeneralSaved(false), 2500); } catch (e) {} finally{ setGeneralSaving(false); } } async function saveSmtpSettings() { setSmtpSaving(true); try { await api.updateAdminSettings({ 'smtp.host': smtpForm.host, 'smtp.port': smtpForm.port, 'smtp.username': smtpForm.username, 'smtp.password': smtpForm.password, 'smtp.fromName': smtpForm.fromName, 'smtp.fromEmail': smtpForm.fromEmail, 'smtp.encryption': smtpForm.encryption }); setSmtpSaved(true); setTimeout(()=>setSmtpSaved(false), 2500); } catch (e) {} finally{ setSmtpSaving(false); } } async function autoTranslateTemplate(key) { const localeKey = "".concat(key, "_").concat(templateLocale); var _notifTemplates_localeKey, _ref; const current = (_ref = (_notifTemplates_localeKey = notifTemplates[localeKey]) !== null && _notifTemplates_localeKey !== void 0 ? _notifTemplates_localeKey : notifTemplates[key]) !== null && _ref !== void 0 ? _ref : { subject: '', body: '' }; if (!current.subject && !current.body) return; setTemplateTranslating(true); try { // СПхраМяеЌ ОсхПЎМый язык в БД (еслО ещё Ме сПхраМёМ) await api.updateAdminEmailTemplate(localeKey, current); // ПеревПЎОЌ Ма ПстальМые языкО const results = await api.translateAdminEmailTemplate({ subject: current.subject, body: current.body, fromLocale: templateLocale }); // ОбМПвляеЌ state setNotifTemplates((prev)=>{ const next = { ...prev, [localeKey]: current }; for (const [loc, tpl] of Object.entries(results)){ next["".concat(key, "_").concat(loc)] = tpl; } return next; }); // СПхраМяеЌ кажЎый перевПЎ в БД await Promise.all(Object.entries(results).map((param)=>{ let [loc, tpl] = param; return api.updateAdminEmailTemplate("".concat(key, "_").concat(loc), tpl); })); } catch (e) {} finally{ setTemplateTranslating(false); } } async function saveTemplate(key) { const localeKey = "".concat(key, "_").concat(templateLocale); setTemplateSaving(true); try { var _notifTemplates_localeKey; await api.updateAdminEmailTemplate(localeKey, (_notifTemplates_localeKey = notifTemplates[localeKey]) !== null && _notifTemplates_localeKey !== void 0 ? _notifTemplates_localeKey : { subject: '', body: '' }); setEditingTemplate(null); } catch (e) {} finally{ setTemplateSaving(false); } } async function saveEPaySettings() { setEPaySaving(true); try { await api.updateAdminSettings({ 'payment.epay.merchantId': ePayForm.merchantId, 'payment.epay.apiUser': ePayForm.apiUser, 'payment.epay.apiPassword': ePayForm.apiPassword, 'payment.epay.environment': ePayForm.environment, 'payment.epay.confirmationUrl': ePayForm.confirmationUrl, 'payment.epay.cancelUrl': ePayForm.cancelUrl, 'payment.epay.enabled': String(ePayForm.enabled) }); setEPaySaved(true); setTimeout(()=>setEPaySaved(false), 2500); } catch (e) {} finally{ setEPaySaving(false); } } async function saveReferralSettings() { setReferralSaving(true); try { await api.updateAdminSettings({ 'referral_enabled': String(referralForm.enabled), 'referral_plan_id': referralForm.planId, 'referral_days': referralForm.days }); setReferralSaved(true); setTimeout(()=>setReferralSaved(false), 2500); } catch (e) {} finally{ setReferralSaving(false); } } async function saveSeoSettings() { setSeoSaving(true); try { await api.updateAdminSettings({ 'seo.maintenanceMode': String(seoForm.maintenanceMode), 'seo.indexingEnabled': String(seoForm.indexingEnabled), 'seo.headScripts': seoForm.headScripts, 'seo.siteTitle.el': seoForm.siteTitleEl, 'seo.siteTitle.en': seoForm.siteTitleEn, 'seo.siteTitle.ru': seoForm.siteTitleRu, 'seo.siteTitle.uk': seoForm.siteTitleUk, 'seo.siteDescription.el': seoForm.siteDescriptionEl, 'seo.siteDescription.en': seoForm.siteDescriptionEn, 'seo.siteDescription.ru': seoForm.siteDescriptionRu, 'seo.siteDescription.uk': seoForm.siteDescriptionUk }); setSeoSaved(true); setTimeout(()=>setSeoSaved(false), 2500); } catch (e) {} finally{ setSeoSaving(false); } } async function saveSocialSettings() { setSocialSaving(true); try { await api.updateAdminSettings({ 'social.telegram': socialForm.telegram, 'social.instagram': socialForm.instagram, 'social.facebook': socialForm.facebook, 'social.twitter': socialForm.twitter, 'social.youtube': socialForm.youtube, 'social.tiktok': socialForm.tiktok, 'social.whatsapp': socialForm.whatsapp, 'social.viber': socialForm.viber }); setSocialSaved(true); setTimeout(()=>setSocialSaved(false), 2500); } catch (e) {} finally{ setSocialSaving(false); } } async function saveTelegramSettings() { setTelegramSaving(true); try { await api.updateAdminSettings({ 'telegram.botToken': telegramForm.botToken, 'telegram.adminChatId': telegramForm.adminChatId, 'telegram.channelId.el': telegramForm.channelIdEl, 'telegram.channelId.en': telegramForm.channelIdEn, 'telegram.channelId.ru': telegramForm.channelIdRu, 'telegram.channelId.uk': telegramForm.channelIdUk, 'telegram.notifyRegistrations': String(telegramForm.notifyRegistrations), 'telegram.postNewTasks': String(telegramForm.postNewTasks) }); setTelegramSaved(true); setTimeout(()=>setTelegramSaved(false), 2500); } catch (e) {} finally{ setTelegramSaving(false); } } async function testTelegram(type) { const chatIdMap = { admin: telegramForm.adminChatId, el: telegramForm.channelIdEl, en: telegramForm.channelIdEn, ru: telegramForm.channelIdRu, uk: telegramForm.channelIdUk }; var _chatIdMap_type; const chatId = (_chatIdMap_type = chatIdMap[type]) !== null && _chatIdMap_type !== void 0 ? _chatIdMap_type : ''; if (type === 'admin') { setTestingTelegramAdmin(true); setTestResultTelegramAdmin(null); } else { setTestingLocale(type); setTestResultChannels((p)=>{ const n = { ...p }; delete n[type]; return n; }); } try { const res = await api.testTelegramConnection(telegramForm.botToken, chatId); var _res_error; const result = { ok: res.ok, msg: res.ok ? res.botName ? "@".concat(res.botName) : t('admin.settings.telegram.test_ok') : (_res_error = res.error) !== null && _res_error !== void 0 ? _res_error : t('admin.settings.telegram.test_fail') }; if (type === 'admin') setTestResultTelegramAdmin(result); else setTestResultChannels((p)=>({ ...p, [type]: result })); } catch (e) { const result = { ok: false, msg: t('admin.settings.telegram.test_fail') }; if (type === 'admin') setTestResultTelegramAdmin(result); else setTestResultChannels((p)=>({ ...p, [type]: result })); } finally{ if (type === 'admin') setTestingTelegramAdmin(false); else setTestingLocale(null); } } async function verifyTelegramToken() { setVerifyingTelegramToken(true); setVerifyResultTelegramToken(null); try { const res = await api.verifyTelegramToken(telegramForm.botToken); var _res_error; setVerifyResultTelegramToken({ ok: res.ok, msg: res.ok ? "@".concat(res.botName) : (_res_error = res.error) !== null && _res_error !== void 0 ? _res_error : t('admin.settings.telegram.test_fail') }); } catch (e) { setVerifyResultTelegramToken({ ok: false, msg: t('admin.settings.telegram.test_fail') }); } finally{ setVerifyingTelegramToken(false); } } if (isPending) return /*#__PURE__*/ _jsx("div", { className: "text-center py-20 text-gray-500", children: t('common.loading') }); const dateLocale = locale === 'ru' ? 'ru-RU' : locale === 'en' ? 'en-US' : 'el-GR'; const catName = (id)=>{ const cat = catRows.find((c)=>c.id === id); if (!cat) return id; if (locale === 'en') return cat.namesEn || cat.namesEl; if (locale === 'ru') return cat.namesRu || cat.namesEl; if (locale === 'uk') return cat.namesUk || cat.namesEl; return cat.namesEl || cat.namesEn || id; }; const locName = (id)=>{ const loc = locRows.find((l)=>l.id === id); if (!loc) return id; if (locale === 'en') return loc.nameEn || loc.nameEl; if (locale === 'ru') return loc.nameRu || loc.nameEl; if (locale === 'uk') return loc.nameUk || loc.nameEl; return loc.nameEl || loc.nameEn || id; }; const TABS = [ { key: 'stats', label: t('admin.tab.stats'), icon: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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: t('admin.tab.users'), icon: /*#__PURE__*/ _jsxs("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M17 21v-2a4 4 0 00-4-4H5a4 4 0 00-4 4v2" }), /*#__PURE__*/ _jsx("circle", { cx: "9", cy: "7", r: "4" }), /*#__PURE__*/ _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: t('admin.tab.tasks'), icon: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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: t('admin.tab.reports'), badge: pendingReportsCount || undefined, icon: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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: t('admin.tab.moderation'), badge: pendingCardsCount || undefined, icon: /*#__PURE__*/ _jsxs("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ _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" }), /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 20h12" }) ] }) }, { key: 'categories', label: t('admin.tab.categories'), icon: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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: t('admin.tab.locations'), icon: /*#__PURE__*/ _jsxs("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ _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" }), /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 11a3 3 0 11-6 0 3 3 0 016 0z" }) ] }) }, { key: 'balances', label: t('admin.tab.balances', 'Balance'), icon: /*#__PURE__*/ _jsxs("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ _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" }), /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M20 12h-6m0 0a2 2 0 100 4h6v-8h-6a2 2 0 100 4z" }) ] }) }, { key: 'plans', label: t('admin.tab.plans'), icon: /*#__PURE__*/ _jsxs("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ _jsx("rect", { x: "1", y: "4", width: "22", height: "16", rx: "2", ry: "2" }), /*#__PURE__*/ _jsx("line", { x1: "1", y1: "10", x2: "23", y2: "10" }) ] }) }, { key: 'logs', label: t('admin.tab.logs'), icon: /*#__PURE__*/ _jsxs("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ _jsx("polyline", { points: "4 17 10 11 4 5" }), /*#__PURE__*/ _jsx("line", { x1: "12", y1: "19", x2: "20", y2: "19" }) ] }) }, { key: 'settings', label: t('admin.tab.settings'), icon: /*#__PURE__*/ _jsxs("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ _jsx("circle", { cx: "12", cy: "12", r: "3" }), /*#__PURE__*/ _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: t('admin.tab.support', 'Support'), icon: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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: t('admin.tab.push', 'Push'), icon: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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: t('admin.tab.backup', 'Backup'), icon: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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: t('admin.tab.translations', 'Translations'), icon: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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: t('admin.tab.dbcheck', 'DB check'), icon: /*#__PURE__*/ _jsxs("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ _jsx("ellipse", { cx: "12", cy: "5", rx: "9", ry: "3" }), /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M21 12c0 1.66-4.03 3-9 3S3 13.66 3 12" }), /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M3 5v14c0 1.66 4.03 3 9 3s9-1.34 9-3V5" }), /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 12l2 2 4-4" }) ] }) }, { key: 'referrals', label: t('admin.tab.referrals', 'Referrals'), icon: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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" }) }) } ]; const statusColors = { 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' }; const reportStatusColors = { pending: 'bg-yellow-100 text-yellow-700', reviewed: 'bg-green-100 text-green-700', dismissed: 'bg-gray-100 text-gray-500' }; const reasonColors = { 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' }; const cardStatus = (card)=>{ var _card_publicationStatus; return (_card_publicationStatus = card.publicationStatus) !== null && _card_publicationStatus !== void 0 ? _card_publicationStatus : card.isActive ? 'active' : 'inactive'; }; const pendingModerationCards = moderationCards.filter((card)=>cardStatus(card) === 'pending'); const activeModerationCards = moderationCards.filter((card)=>cardStatus(card) === 'active'); var _stats_totalCostUsd, _planForm_oldPrice, _pushResult_tokensFound, _pushResult_usersWithoutTokens, _pushResult_usersConfigBlocked, _pushResult_usersAuthFailed, _pushResult_usersAllFailed, _pushResult_usersWithoutTokens1, _pushResult_usersConfigBlocked1, _pushResult_usersAuthFailed1, _pushResult_usersAllFailed1, _referralsData_totalReferrers, _referralsData_totalReferrals, _referralsData_activeRewards, _editUser_firstName, _editUser_lastName, _editUser_phone, _editUser_bio, _editUser_planId, _editUser_locale, _editUser_balance, _editUser_showContactInfo, _editUser_notifyNewTasks, _editUser_notifMessages, _editUser_personalSiteSlug, _editUser_siteSettings, _siteTheme, _editUser_skills, _editUser_balance1, _editUser_topUpAmount, _editUser_withdrawAmount, _editUser_topUpDescription, _editUser_withdrawDescription; return /*#__PURE__*/ _jsx("div", { className: "min-h-screen bg-gray-50", children: /*#__PURE__*/ _jsxs("div", { className: "max-w-7xl mx-auto px-4 py-8", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between mb-6", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-7 h-7 text-yellow-500", fill: "currentColor", viewBox: "0 0 24 24", children: /*#__PURE__*/ _jsx("path", { d: "M5 16L3 5l5.5 5L12 4l3.5 6L21 5l-2 11H5zm0 3a1 1 0 000 2h14a1 1 0 000-2H5z" }) }), /*#__PURE__*/ _jsx("h1", { className: "text-2xl font-bold text-gray-900", children: t('admin.title') }) ] }), /*#__PURE__*/ _jsxs(Link, { href: "/", className: "flex items-center gap-1.5 text-sm text-gray-500 hover:text-green-600 transition", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 19l-7-7 7-7" }) }), t('admin.back_home') ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-6", children: [ /*#__PURE__*/ _jsx("aside", { className: "shrink-0 transition-all duration-200 ".concat(sidebarCollapsed ? 'w-12' : 'w-52'), children: /*#__PURE__*/ _jsxs("nav", { className: "bg-white rounded-xl border border-gray-200 overflow-hidden", children: [ /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setSidebarCollapsed((v)=>!v), title: sidebarCollapsed ? 'РазверМуть ЌеМю' : 'СверМуть ЌеМю', 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: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 transition-transform duration-200 ".concat(sidebarCollapsed ? 'rotate-180' : ''), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 19l-7-7 7-7" }) }) }), TABS.map((param)=>{ let { key, label, icon, badge } = param; return /*#__PURE__*/ _jsxs("button", { onClick: ()=>setTab(key), title: sidebarCollapsed ? label : undefined, className: "w-full flex items-center py-3 text-sm font-medium text-left transition ".concat(tab === key ? 'bg-green-50 text-green-700 border-r-2 border-green-600' : 'text-gray-600 hover:bg-gray-50 hover:text-gray-900', " ").concat(sidebarCollapsed ? 'justify-center px-3' : 'gap-3 px-4'), children: [ /*#__PURE__*/ _jsx("span", { className: "w-4 h-4 flex-shrink-0 flex items-center justify-center", children: icon }), !sidebarCollapsed && /*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-2 min-w-0", children: [ /*#__PURE__*/ _jsx("span", { children: label }), badge ? /*#__PURE__*/ _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: badge }) : null ] }) ] }, key); }) ] }) }), /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-0", children: [ tab === 'stats' && /*#__PURE__*/ _jsxs("div", { className: "space-y-6", children: [ /*#__PURE__*/ _jsx("div", { className: "grid grid-cols-2 md:grid-cols-5 gap-4", children: [ { label: t('admin.stats.users'), value: stats === null || stats === void 0 ? void 0 : stats.userCount, icon: /*#__PURE__*/ _jsx("svg", { className: "w-8 h-8", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ _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: t('admin.stats.specialists'), value: stats === null || stats === void 0 ? void 0 : stats.specialistCount, icon: /*#__PURE__*/ _jsxs("svg", { className: "w-8 h-8", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: [ /*#__PURE__*/ _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" }), /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 12a3 3 0 11-6 0 3 3 0 016 0z" }) ] }), color: 'text-purple-600' }, { label: t('admin.stats.tasks'), value: stats === null || stats === void 0 ? void 0 : stats.taskCount, icon: /*#__PURE__*/ _jsx("svg", { className: "w-8 h-8", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ _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: t('admin.stats.offers'), value: stats === null || stats === void 0 ? void 0 : stats.offerCount, icon: /*#__PURE__*/ _jsx("svg", { className: "w-8 h-8", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ _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: t('admin.stats.reviews'), value: stats === null || stats === void 0 ? void 0 : stats.reviewCount, icon: /*#__PURE__*/ _jsx("svg", { className: "w-8 h-8", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ _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((param)=>{ let { label, value, icon, color } = param; return /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-5", children: [ /*#__PURE__*/ _jsx("div", { className: "mb-2 ".concat(color), children: icon }), /*#__PURE__*/ _jsx("div", { className: "text-3xl font-bold ".concat(color), children: value !== null && value !== void 0 ? value : '—' }), /*#__PURE__*/ _jsx("div", { className: "text-sm text-gray-500 mt-1", children: label }) ] }, label); }) }), (stats === null || stats === void 0 ? void 0 : stats.tasksByDay) && /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between mb-4", children: [ /*#__PURE__*/ _jsx("h2", { className: "font-semibold text-gray-800", children: t('admin.stats.activity_30d') }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-4 text-xs text-gray-500", children: [ /*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-1.5", children: [ /*#__PURE__*/ _jsx("span", { className: "w-3 h-0.5 bg-green-500 inline-block rounded" }), t('admin.stats.users_label') ] }), /*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-1.5", children: [ /*#__PURE__*/ _jsx("span", { className: "w-3 h-0.5 bg-purple-400 inline-block rounded" }), t('admin.stats.specialists_label') ] }), /*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-1.5", children: [ /*#__PURE__*/ _jsx("span", { className: "w-3 h-0.5 bg-green-500 inline-block rounded" }), t('admin.stats.tasks_label') ] }) ] }) ] }), /*#__PURE__*/ _jsx(AdminAreaChart, { series: [ { data: stats.usersByDay, color: '#3b82f6', fill: '#3b82f615', label: t('admin.stats.users_label') }, { data: stats.specialistsByDay, color: '#a855f7', fill: '#a855f710', label: t('admin.stats.specialists_label') }, { data: stats.tasksByDay, color: '#22c55e', fill: '#22c55e10', label: t('admin.stats.tasks_label') } ] }) ] }), (stats === null || stats === void 0 ? void 0 : stats.tasksByStatus) && /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ _jsx("h2", { className: "font-semibold text-gray-800 mb-5", children: t('admin.stats.tasks_by_status') }), /*#__PURE__*/ _jsx("div", { className: "space-y-3", children: (()=>{ const total = stats.tasksByStatus.reduce((s, r)=>s + Number(r.count), 0) || 1; const statusMeta = { open: { label: t('admin.task_status.open'), bg: 'bg-green-50', bar: 'bg-green-500' }, in_progress: { label: t('admin.task_status.in_progress'), bg: 'bg-green-50', bar: 'bg-green-500' }, completed: { label: t('admin.task_status.completed'), bg: 'bg-gray-50', bar: 'bg-gray-400' }, cancelled: { label: t('admin.task_status.cancelled'), bg: 'bg-red-50', bar: 'bg-red-400' }, draft: { label: t('admin.task_status.draft'), bg: 'bg-yellow-50', bar: 'bg-yellow-400' } }; const order = [ 'open', 'in_progress', 'completed', 'draft', 'cancelled' ]; const sorted = [ ...stats.tasksByStatus ].sort((a, b)=>order.indexOf(a.status) - order.indexOf(b.status)); return sorted.map((param)=>{ let { status, count: c } = param; var _statusMeta_status; const meta = (_statusMeta_status = statusMeta[status]) !== null && _statusMeta_status !== void 0 ? _statusMeta_status : { label: status, bg: 'bg-gray-50', bar: 'bg-gray-300' }; const pct = Math.round(Number(c) / total * 100); return /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 px-3 py-2 rounded-lg ".concat(meta.bg), children: [ /*#__PURE__*/ _jsx("span", { className: "text-sm text-gray-600 w-28 shrink-0", children: meta.label }), /*#__PURE__*/ _jsx("div", { className: "flex-1 bg-gray-200 rounded-full h-2 overflow-hidden", children: /*#__PURE__*/ _jsx("div", { className: "h-full rounded-full ".concat(meta.bar, " transition-all"), style: { width: "".concat(pct, "%") } }) }), /*#__PURE__*/ _jsx("span", { className: "text-sm font-semibold text-gray-700 w-8 text-right", children: c }), /*#__PURE__*/ _jsxs("span", { className: "text-xs text-gray-400 w-8", children: [ pct, "%" ] }) ] }, status); }); })() }) ] }), notifsByDay.length > 0 && /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between mb-4", children: [ /*#__PURE__*/ _jsx("h2", { className: "font-semibold text-gray-800", children: t('admin.stats.notif_chart_title') }), /*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-1.5 text-xs text-gray-500", children: [ /*#__PURE__*/ _jsx("span", { className: "w-3 h-0.5 bg-orange-500 inline-block rounded" }), t('admin.stats.notif_label') ] }) ] }), /*#__PURE__*/ _jsx(AdminAreaChart, { series: [ { data: notifsByDay, color: '#f97316', fill: '#f9731615', label: t('admin.stats.notif_label') } ] }) ] }), mailByDay.length > 0 && /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between mb-4", children: [ /*#__PURE__*/ _jsx("h2", { className: "font-semibold text-gray-800", children: t('admin.stats.mail_chart_title') }), /*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-1.5 text-xs text-gray-500", children: [ /*#__PURE__*/ _jsx("span", { className: "w-3 h-0.5 bg-sky-500 inline-block rounded" }), t('admin.stats.mail_label') ] }) ] }), /*#__PURE__*/ _jsx(AdminAreaChart, { series: [ { data: mailByDay, color: '#0ea5e9', fill: '#0ea5e915', label: t('admin.stats.mail_label') } ] }) ] }), stats && /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6 space-y-5", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between", children: [ /*#__PURE__*/ _jsx("h2", { className: "font-semibold text-gray-800", children: t('admin.stats.tokens_title') }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-4 text-xs text-gray-500", children: [ /*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-1.5", children: [ /*#__PURE__*/ _jsx("span", { className: "w-3 h-0.5 bg-violet-500 inline-block rounded" }), t('admin.stats.tokens_out') ] }), /*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-1.5", children: [ /*#__PURE__*/ _jsx("span", { className: "w-3 h-0.5 bg-sky-500 inline-block rounded" }), t('admin.stats.tokens_in') ] }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "grid grid-cols-3 gap-4", children: [ /*#__PURE__*/ _jsxs("div", { className: "rounded-lg bg-violet-50 border border-violet-100 px-4 py-3", children: [ /*#__PURE__*/ _jsx("div", { className: "text-xs text-violet-600 mb-1", children: t('admin.stats.tokens_out_label') }), /*#__PURE__*/ _jsx("div", { className: "text-2xl font-bold text-violet-700", children: Number(stats.totalOutputTokens).toLocaleString() }) ] }), /*#__PURE__*/ _jsxs("div", { className: "rounded-lg bg-sky-50 border border-sky-100 px-4 py-3", children: [ /*#__PURE__*/ _jsx("div", { className: "text-xs text-sky-600 mb-1", children: t('admin.stats.tokens_in_label') }), /*#__PURE__*/ _jsx("div", { className: "text-2xl font-bold text-sky-700", children: Number(stats.totalInputTokens).toLocaleString() }) ] }), /*#__PURE__*/ _jsxs("div", { className: "rounded-lg bg-emerald-50 border border-emerald-100 px-4 py-3", children: [ /*#__PURE__*/ _jsx("div", { className: "text-xs text-emerald-600 mb-1", children: t('admin.stats.cost_label') }), /*#__PURE__*/ _jsxs("div", { className: "text-2xl font-bold text-emerald-700", children: [ "$", Number((_stats_totalCostUsd = stats.totalCostUsd) !== null && _stats_totalCostUsd !== void 0 ? _stats_totalCostUsd : 0).toFixed(4) ] }) ] }) ] }), ((_stats_tokensByMonth = stats.tokensByMonth) === null || _stats_tokensByMonth === void 0 ? void 0 : _stats_tokensByMonth.length) > 0 && /*#__PURE__*/ _jsx(AdminMonthChart, { dateLocale: dateLocale, series: [ { data: stats.tokensByMonth.map((r)=>({ month: r.month, count: Number(r.output) })), color: '#8b5cf6', fill: '#8b5cf610', label: t('admin.stats.tokens_out_label') }, { data: stats.tokensByMonth.map((r)=>({ month: r.month, count: Number(r.input) })), color: '#0ea5e9', fill: '#0ea5e915', label: t('admin.stats.tokens_in_label') } ] }) ] }) ] }), tab === 'users' && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("div", { className: "flex gap-3 mb-4", children: [ /*#__PURE__*/ _jsxs("form", { className: "flex gap-2 flex-1", onSubmit: (e)=>{ e.preventDefault(); setUsersQ(usersQInput); }, children: [ /*#__PURE__*/ _jsx("input", { value: usersQInput, onChange: (e)=>setUsersQInput(e.target.value), placeholder: t('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" }), /*#__PURE__*/ _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: t('tasks.search.btn') }) ] }), /*#__PURE__*/ _jsxs("select", { value: usersRole, onChange: (e)=>setUsersRole(e.target.value), className: "border border-gray-300 rounded-lg px-3 py-2 text-sm", children: [ /*#__PURE__*/ _jsx("option", { value: "", children: t('admin.filter.all_roles') }), /*#__PURE__*/ _jsx("option", { value: "user", children: t('admin.user_edit.role.user') }), /*#__PURE__*/ _jsx("option", { value: "admin", children: t('profile.role.admin') }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 overflow-hidden", children: [ /*#__PURE__*/ _jsxs("table", { className: "w-full text-sm", children: [ /*#__PURE__*/ _jsx("thead", { className: "bg-gray-50 text-left", children: /*#__PURE__*/ _jsxs("tr", { children: [ /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.col.user') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.col.email') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.col.role') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.col.plan', 'Plan') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.col.registered') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.col.status') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3" }) ] }) }), /*#__PURE__*/ _jsx("tbody", { className: "divide-y divide-gray-100", children: loading ? /*#__PURE__*/ _jsx("tr", { children: /*#__PURE__*/ _jsx("td", { colSpan: 6, className: "px-4 py-8 text-center text-gray-400", children: t('common.loading') }) }) : users.length === 0 ? /*#__PURE__*/ _jsx("tr", { children: /*#__PURE__*/ _jsx("td", { colSpan: 6, className: "px-4 py-8 text-center text-gray-400", children: "—" }) }) : users.map((u)=>{ var _planRows_find; var _planRows_find_name; return /*#__PURE__*/ _jsxs("tr", { className: "hover:bg-gray-50", children: [ /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 font-medium text-gray-800", children: formatShortName(u.firstName, u.lastName, u.name) }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-gray-500", children: u.email }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3", children: /*#__PURE__*/ _jsx("span", { className: "px-2 py-0.5 rounded-full text-xs font-medium ".concat(u.role === 'admin' ? 'bg-red-100 text-red-700' : u.role === 'specialist' ? 'bg-green-100 text-green-700' : 'bg-gray-100 text-gray-600'), children: t("profile.role.".concat(u.role)) || u.role }) }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-gray-400 text-xs", children: u.planId ? (_planRows_find_name = (_planRows_find = planRows.find((p)=>p.id === u.planId)) === null || _planRows_find === void 0 ? void 0 : _planRows_find.name) !== null && _planRows_find_name !== void 0 ? _planRows_find_name : /*#__PURE__*/ _jsxs("span", { className: "font-mono", children: [ u.planId.slice(0, 8), "
" ] }) : /*#__PURE__*/ _jsx("span", { className: "text-gray-300", children: "—" }) }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-gray-400", children: new Date(u.createdAt).toLocaleDateString(dateLocale) }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3", children: /*#__PURE__*/ _jsx("span", { className: "px-2 py-0.5 rounded-full text-xs font-medium ".concat(u.isActive !== false ? 'bg-green-100 text-green-700' : 'bg-red-100 text-red-600'), children: u.isActive !== false ? t('admin.users.active') : t('admin.users.inactive') }) }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-right", children: /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-end gap-1.5", children: [ /*#__PURE__*/ _jsx("button", { onClick: ()=>openEditUser(u), 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: /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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" }) }) }), u.role !== 'admin' && /*#__PURE__*/ _jsx("button", { onClick: ()=>toggleUser(u.id, u.isActive !== false), className: "text-xs px-3 py-1 rounded-lg font-medium ".concat(u.isActive !== false ? 'bg-red-50 text-red-600 hover:bg-red-100' : 'bg-green-50 text-green-600 hover:bg-green-100'), children: u.isActive !== false ? t('admin.users.deactivate') : t('admin.users.activate') }) ] }) }) ] }, u.id); }) }) ] }), /*#__PURE__*/ _jsx(Pagination, { page: usersPage, total: usersTotal, limit: 20, onChange: setUsersPage, totalLabel: t('admin.pagination.total') }) ] }) ] }), tab === 'balances' && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("div", { className: "flex flex-wrap gap-3 mb-4", children: [ /*#__PURE__*/ _jsx("input", { value: balanceUserId, onChange: (e)=>setBalanceUserId(e.target.value), placeholder: t('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" }), /*#__PURE__*/ _jsxs("select", { value: balanceKind, onChange: (e)=>setBalanceKind(e.target.value), className: "border border-gray-300 rounded-lg px-3 py-2 text-sm", children: [ /*#__PURE__*/ _jsx("option", { value: "", children: t('admin.balance.filter.all', 'All operations') }), /*#__PURE__*/ _jsx("option", { value: "topup", children: t('admin.balance.kind.topup', 'Top-up') }), /*#__PURE__*/ _jsx("option", { value: "plan_purchase", children: t('admin.balance.kind.plan_purchase', 'Plan charge') }), /*#__PURE__*/ _jsx("option", { value: "admin_topup", children: t('admin.balance.kind.admin_topup', 'Admin top-up') }), /*#__PURE__*/ _jsx("option", { value: "admin_adjustment", children: t('admin.balance.kind.admin_adjustment', 'Adjustment') }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 overflow-hidden", children: [ /*#__PURE__*/ _jsxs("table", { className: "w-full text-sm", children: [ /*#__PURE__*/ _jsx("thead", { className: "bg-gray-50 text-left", children: /*#__PURE__*/ _jsxs("tr", { children: [ /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.col.user') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.balance.col.operation', 'Operation') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.balance.col.amount', 'Amount') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.balance.col.result', 'Balance') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.balance.col.description', 'Description') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.balance.col.date', 'Date') }) ] }) }), /*#__PURE__*/ _jsx("tbody", { className: "divide-y divide-gray-100", children: loading ? /*#__PURE__*/ _jsx("tr", { children: /*#__PURE__*/ _jsx("td", { colSpan: 6, className: "px-4 py-8 text-center text-gray-400", children: t('common.loading') }) }) : balanceRows.length === 0 ? /*#__PURE__*/ _jsx("tr", { children: /*#__PURE__*/ _jsx("td", { colSpan: 6, className: "px-4 py-8 text-center text-gray-400", children: t('admin.balance.empty', 'No records yet') }) }) : balanceRows.map((row)=>{ const isCredit = row.direction === 'credit'; const kindLabel = row.kind === 'topup' ? t('admin.balance.kind.topup', 'Top-up') : row.kind === 'plan_purchase' ? t('admin.balance.kind.plan_purchase', 'Plan charge') : row.kind === 'admin_topup' ? t('admin.balance.kind.admin_topup', 'Admin top-up') : t('admin.balance.kind.admin_adjustment', 'Adjustment'); return /*#__PURE__*/ _jsxs("tr", { className: "hover:bg-gray-50 align-top", children: [ /*#__PURE__*/ _jsxs("td", { className: "px-4 py-3", children: [ /*#__PURE__*/ _jsx("div", { className: "font-medium text-gray-800", children: row.userName || '—' }), /*#__PURE__*/ _jsx("div", { className: "text-xs text-gray-500 mt-0.5", children: row.userEmail || row.userId }) ] }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3", children: /*#__PURE__*/ _jsx("span", { className: "inline-flex rounded-full px-2 py-0.5 text-xs font-medium ".concat(isCredit ? 'bg-emerald-50 text-emerald-700' : 'bg-rose-50 text-rose-700'), children: kindLabel }) }), /*#__PURE__*/ _jsxs("td", { className: "px-4 py-3 font-semibold ".concat(isCredit ? 'text-emerald-700' : 'text-rose-700'), children: [ isCredit ? '+' : '-', Number(row.amount).toFixed(2), " ", row.currency ] }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-gray-600", children: /*#__PURE__*/ _jsxs("div", { children: [ Number(row.balanceBefore).toFixed(2), " → ", Number(row.balanceAfter).toFixed(2), " ", row.currency ] }) }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-gray-500 max-w-sm", children: row.description || '—' }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-gray-500 whitespace-nowrap", children: new Date(row.createdAt).toLocaleString(dateLocale) }) ] }, row.id); }) }) ] }), /*#__PURE__*/ _jsx(Pagination, { page: balancePage, total: balanceTotal, limit: 50, onChange: setBalancePage, totalLabel: t('admin.pagination.total') }) ] }) ] }), tab === 'tasks' && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("div", { className: "flex gap-3 mb-4", children: [ /*#__PURE__*/ _jsxs("form", { className: "flex gap-2 flex-1", onSubmit: (e)=>{ e.preventDefault(); setTasksQ(tasksQInput); }, children: [ /*#__PURE__*/ _jsx("input", { value: tasksQInput, onChange: (e)=>setTasksQInput(e.target.value), placeholder: t('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" }), /*#__PURE__*/ _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: t('tasks.search.btn') }) ] }), /*#__PURE__*/ _jsxs("select", { value: tasksStatus, onChange: (e)=>setTasksStatus(e.target.value), className: "border border-gray-300 rounded-lg px-3 py-2 text-sm", children: [ /*#__PURE__*/ _jsx("option", { value: "", children: t('admin.filter.all_statuses') }), [ 'open', 'in_progress', 'completed', 'cancelled', 'draft' ].map((s)=>/*#__PURE__*/ _jsx("option", { value: s, children: t("task.status.".concat(s), s) }, s)) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 overflow-hidden", children: [ /*#__PURE__*/ _jsxs("table", { className: "w-full text-sm", children: [ /*#__PURE__*/ _jsx("thead", { className: "bg-gray-50 text-left", children: /*#__PURE__*/ _jsxs("tr", { children: [ /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.col.title') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.col.customer') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.col.status') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.col.budget') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.col.created') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3" }) ] }) }), /*#__PURE__*/ _jsx("tbody", { className: "divide-y divide-gray-100", children: loading ? /*#__PURE__*/ _jsx("tr", { children: /*#__PURE__*/ _jsx("td", { colSpan: 6, className: "px-4 py-8 text-center text-gray-400", children: t('common.loading') }) }) : tasks.length === 0 ? /*#__PURE__*/ _jsx("tr", { children: /*#__PURE__*/ _jsx("td", { colSpan: 6, className: "px-4 py-8 text-center text-gray-400", children: "—" }) }) : tasks.map((row)=>{ const task = row.task || row; const customer = row.customer; var _customer_name, _statusColors_task_status; return /*#__PURE__*/ _jsxs("tr", { className: "hover:bg-gray-50", children: [ /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 font-medium text-gray-800 max-w-xs", children: /*#__PURE__*/ _jsx(Link, { href: "/tasks/".concat(task.id), className: "hover:text-green-600 truncate block", target: "_blank", children: locale === 'en' && task.titleEn || locale === 'ru' && task.titleRu || locale === 'uk' && task.titleUk || task.titleEl || task.title }) }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-gray-500 text-xs", children: (_customer_name = customer === null || customer === void 0 ? void 0 : customer.name) !== null && _customer_name !== void 0 ? _customer_name : '—' }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3", children: /*#__PURE__*/ _jsx("span", { className: "px-2 py-0.5 rounded-full text-xs font-medium ".concat((_statusColors_task_status = statusColors[task.status]) !== null && _statusColors_task_status !== void 0 ? _statusColors_task_status : 'bg-gray-100 text-gray-600'), children: t("task.status.".concat(task.status), task.status) }) }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-gray-500", children: task.budget ? "".concat(formatPrice(task.budget), "€") : '—' }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-gray-400", children: new Date(task.createdAt).toLocaleDateString(dateLocale) }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-right", children: /*#__PURE__*/ _jsxs("div", { className: "flex gap-1.5 justify-end", children: [ task.status !== 'cancelled' && task.status !== 'completed' && /*#__PURE__*/ _jsx("button", { onClick: ()=>cancelTask(task.id), className: "text-xs px-2.5 py-1 rounded-lg font-medium bg-yellow-50 text-yellow-700 hover:bg-yellow-100", children: t('admin.tasks.cancel') }), /*#__PURE__*/ _jsx("button", { onClick: ()=>deleteTask(task.id, locale === 'en' && task.titleEn || locale === 'ru' && task.titleRu || locale === 'uk' && task.titleUk || task.titleEl || task.title), className: "text-xs px-2.5 py-1 rounded-lg font-medium bg-red-50 text-red-600 hover:bg-red-100", children: t('admin.tasks.delete') }) ] }) }) ] }, task.id); }) }) ] }), /*#__PURE__*/ _jsx(Pagination, { page: tasksPage, total: tasksTotal, limit: 20, onChange: setTasksPage, totalLabel: t('admin.pagination.total') }) ] }) ] }), tab === 'categories' && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("div", { className: "flex justify-between items-center mb-4", children: [ /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-500", children: t('admin.cat.hint') }), /*#__PURE__*/ _jsxs("button", { onClick: ()=>openAddCat(null), className: "px-4 py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700", children: [ "+ ", t('admin.cat.add_root') ] }) ] }), catForm && /*#__PURE__*/ _jsxs("div", { className: "bg-green-50 border border-green-200 rounded-xl p-5 mb-4", children: [ /*#__PURE__*/ _jsxs("h3", { className: "font-semibold text-gray-800 mb-4", children: [ catForm.id ? t('admin.cat.edit') : t('admin.cat.new'), catForm.parentId && /*#__PURE__*/ _jsxs("span", { className: "text-xs text-gray-400 ml-2", children: [ "(", t('admin.cat.subcategory'), ")" ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "grid grid-cols-2 md:grid-cols-3 gap-3 mb-3", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.cat.slug') }), /*#__PURE__*/ _jsx("input", { value: catForm.slug, onChange: (e)=>setCatForm((f)=>f && { ...f, slug: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm", placeholder: "e.g. repairs" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.cat.icon') }), /*#__PURE__*/ _jsx(CategoryIconPicker, { value: catForm.icon, onChange: (icon)=>setCatForm((f)=>f && { ...f, icon }), onUpload: uploadCategoryIcon, uploading: catIconUploading, error: catIconError, presets: categoryIconPresets }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.cat.order') }), /*#__PURE__*/ _jsx("input", { type: "number", value: catForm.order, onChange: (e)=>setCatForm((f)=>f && { ...f, order: Number(e.target.value) }), className: "w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: [ t('admin.cat.name_el'), " \uD83C\uDDEC\uD83C\uDDF7" ] }), /*#__PURE__*/ _jsx("input", { value: catForm.namesEl, onChange: (e)=>setCatForm((f)=>f && { ...f, namesEl: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: [ t('admin.cat.name_en'), " \uD83C\uDDEC\uD83C\uDDE7" ] }), /*#__PURE__*/ _jsx("input", { value: catForm.namesEn, onChange: (e)=>setCatForm((f)=>f && { ...f, namesEn: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: [ t('admin.cat.name_ru'), " \uD83C\uDDF7\uD83C\uDDFA" ] }), /*#__PURE__*/ _jsx("input", { value: catForm.namesRu, onChange: (e)=>setCatForm((f)=>f && { ...f, namesRu: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: [ t('admin.cat.name_uk'), " \uD83C\uDDFA\uD83C\uDDE6" ] }), /*#__PURE__*/ _jsx("input", { value: catForm.namesUk, onChange: (e)=>setCatForm((f)=>f && { ...f, namesUk: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }) ] }), catForm.id && /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-2 text-sm text-gray-700 mb-3", children: [ /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: catForm.isActive, onChange: (e)=>setCatForm((f)=>f && { ...f, isActive: e.target.checked }) }), t('admin.cat.active') ] }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-2", children: [ /*#__PURE__*/ _jsx("button", { onClick: saveCat, disabled: catSaving, className: "px-4 py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700 disabled:opacity-50", children: catSaving ? t('common.saving') : t('common.save') }), /*#__PURE__*/ _jsx("button", { onClick: ()=>setCatForm(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: t('common.cancel') }) ] }) ] }), /*#__PURE__*/ _jsx("div", { className: "bg-white rounded-xl border border-gray-200 divide-y divide-gray-100", children: catRows.length === 0 ? /*#__PURE__*/ _jsx("div", { className: "px-4 py-8 text-center text-gray-400", children: t('admin.cat.empty') }) : /*#__PURE__*/ _jsx(CatTree, { rows: catRows, parentId: null, depth: 0, locale: locale, expanded: catExpanded, onToggle: toggleCatExpand, onEdit: openEditCat, onDelete: deleteCat, onAddChild: openAddCat, skillsExpanded: catSkillsExpanded, skillsCache: catSkillsCache, skillsLoading: catSkillsLoading, onToggleSkills: toggleCatSkills, skillForm: skillForm, skillSaving: skillSaving, onOpenAddSkill: openAddSkill, onOpenEditSkill: openEditSkill, onSaveSkill: saveSkill, onDeleteSkill: deleteSkill, onCancelSkillForm: ()=>setSkillForm(null), onSkillFormChange: setSkillForm, t: t }) }) ] }), tab === 'locations' && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("div", { className: "flex justify-between items-center mb-4", children: [ /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-500", children: t('admin.loc.hint') }), /*#__PURE__*/ _jsxs("button", { onClick: ()=>openAddLoc(null), className: "px-4 py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700", children: [ "+ ", t('admin.loc.add_city') ] }) ] }), locForm && /*#__PURE__*/ _jsxs("div", { className: "bg-green-50 border border-green-200 rounded-xl p-5 mb-4", children: [ /*#__PURE__*/ _jsxs("h3", { className: "font-semibold text-gray-800 mb-4", children: [ locForm.id ? t('admin.loc.edit') : t('admin.loc.new'), locForm.parentId && /*#__PURE__*/ _jsxs("span", { className: "text-xs text-gray-400 ml-2", children: [ "(", t('admin.loc.district'), ")" ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "grid grid-cols-2 md:grid-cols-4 gap-3 mb-3", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.cat.slug') }), /*#__PURE__*/ _jsx("input", { value: locForm.slug, onChange: (e)=>setLocForm((f)=>f && { ...f, slug: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm", placeholder: "e.g. athens-center" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: [ t('admin.cat.name_el'), " \uD83C\uDDEC\uD83C\uDDF7" ] }), /*#__PURE__*/ _jsx("input", { value: locForm.nameEl, onChange: (e)=>setLocForm((f)=>f && { ...f, nameEl: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: [ t('admin.cat.name_en'), " \uD83C\uDDEC\uD83C\uDDE7" ] }), /*#__PURE__*/ _jsx("input", { value: locForm.nameEn, onChange: (e)=>setLocForm((f)=>f && { ...f, nameEn: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: [ t('admin.cat.name_ru'), " \uD83C\uDDF7\uD83C\uDDFA" ] }), /*#__PURE__*/ _jsx("input", { value: locForm.nameRu, onChange: (e)=>setLocForm((f)=>f && { ...f, nameRu: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: [ t('admin.cat.name_uk'), " \uD83C\uDDFA\uD83C\uDDE6" ] }), /*#__PURE__*/ _jsx("input", { value: locForm.nameUk, onChange: (e)=>setLocForm((f)=>f && { ...f, nameUk: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-4 mb-3", children: [ /*#__PURE__*/ _jsxs("div", { className: "w-24", children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.cat.order') }), /*#__PURE__*/ _jsx("input", { type: "number", value: locForm.order, onChange: (e)=>setLocForm((f)=>f && { ...f, order: Number(e.target.value) }), className: "w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), locForm.id && /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-2 text-sm text-gray-700 mt-4", children: [ /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: locForm.isActive, onChange: (e)=>setLocForm((f)=>f && { ...f, isActive: e.target.checked }) }), t('admin.cat.active') ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-2", children: [ /*#__PURE__*/ _jsx("button", { onClick: saveLoc, disabled: locSaving, className: "px-4 py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700 disabled:opacity-50", children: locSaving ? t('common.saving') : t('common.save') }), /*#__PURE__*/ _jsx("button", { onClick: ()=>setLocForm(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: t('common.cancel') }) ] }) ] }), /*#__PURE__*/ _jsx("div", { className: "bg-white rounded-xl border border-gray-200 divide-y divide-gray-100", children: locRows.length === 0 ? /*#__PURE__*/ _jsx("div", { className: "px-4 py-8 text-center text-gray-400", children: t('admin.loc.empty') }) : /*#__PURE__*/ _jsx(LocTree, { rows: locRows, parentId: null, depth: 0, locale: locale, expanded: locExpanded, onToggle: toggleLocExpand, onEdit: openEditLoc, onDelete: deleteLoc, onAddChild: openAddLoc, t: t }) }) ] }), tab === 'reports' && /*#__PURE__*/ _jsxs("div", { className: "space-y-3", children: [ loading ? /*#__PURE__*/ _jsx("div", { className: "text-center py-10 text-gray-400", children: t('common.loading') }) : reports.length === 0 ? /*#__PURE__*/ _jsx("div", { className: "text-center py-10 text-gray-400", children: t('admin.reports.none') }) : reports.map((r)=>{ var _r_targetId; var _reportStatusColors_r_status, _reasonColors_r_reason; return /*#__PURE__*/ _jsx("div", { className: "bg-white rounded-xl border border-gray-200 p-5", children: /*#__PURE__*/ _jsxs("div", { className: "flex items-start justify-between gap-4", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 flex-wrap mb-2", children: [ /*#__PURE__*/ _jsx("span", { className: "px-2 py-0.5 rounded-full text-xs font-medium ".concat((_reportStatusColors_r_status = reportStatusColors[r.status]) !== null && _reportStatusColors_r_status !== void 0 ? _reportStatusColors_r_status : 'bg-gray-100 text-gray-500'), children: r.status }), /*#__PURE__*/ _jsx("span", { className: "px-2 py-0.5 rounded-full text-xs font-medium ".concat((_reasonColors_r_reason = reasonColors[r.reason]) !== null && _reasonColors_r_reason !== void 0 ? _reasonColors_r_reason : 'bg-gray-100 text-gray-600'), children: r.reason }), /*#__PURE__*/ _jsxs("span", { className: "text-xs text-gray-400", children: [ r.targetType === 'task' ? t('admin.reports.target.task') : t('admin.reports.target.user'), ":", ' ', r.targetTitle ? /*#__PURE__*/ _jsx(Link, { href: r.targetType === 'task' ? "/tasks/".concat(r.targetId) : "/users/".concat(r.targetId), className: "text-green-600 hover:underline font-medium", target: "_blank", children: r.targetTitle }) : /*#__PURE__*/ _jsxs("span", { className: "font-mono", children: [ "#", (_r_targetId = r.targetId) === null || _r_targetId === void 0 ? void 0 : _r_targetId.slice(0, 8) ] }) ] }) ] }), r.reporterName && /*#__PURE__*/ _jsxs("p", { className: "text-xs text-gray-400 mb-1", children: [ t('admin.col.reporter'), ": ", /*#__PURE__*/ _jsx("span", { className: "font-medium text-gray-600", children: r.reporterName }) ] }), r.description && /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-700", children: r.description }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-1.5", children: new Date(r.createdAt).toLocaleString(dateLocale) }) ] }), r.status === 'pending' && /*#__PURE__*/ _jsxs("div", { className: "flex gap-2 flex-shrink-0", children: [ /*#__PURE__*/ _jsx("button", { onClick: ()=>handleReport(r.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: t('admin.reports.reviewed') }), /*#__PURE__*/ _jsx("button", { onClick: ()=>handleReport(r.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: t('admin.reports.dismiss') }) ] }) ] }) }, r.id); }), /*#__PURE__*/ _jsx(Pagination, { page: reportsPage, total: reportsTotal, limit: 20, onChange: setReportsPage, totalLabel: t('admin.pagination.total') }) ] }), tab === 'moderation' && /*#__PURE__*/ _jsxs("div", { className: "space-y-6", children: [ /*#__PURE__*/ _jsxs("div", { className: "grid md:grid-cols-2 gap-4", children: [ /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-5", children: [ /*#__PURE__*/ _jsx("div", { className: "text-sm text-gray-500", children: t('admin.moderation.pending_count', 'Pending') }), /*#__PURE__*/ _jsx("div", { className: "text-3xl font-bold text-gray-900 mt-1", children: pendingModerationCards.length }), /*#__PURE__*/ _jsx("div", { className: "text-xs text-gray-400 mt-1", children: t('admin.moderation.pending_hint', 'New proposals waiting for approval') }) ] }), /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-5", children: [ /*#__PURE__*/ _jsx("div", { className: "text-sm text-gray-500", children: t('admin.moderation.active_count', 'Active') }), /*#__PURE__*/ _jsx("div", { className: "text-3xl font-bold text-gray-900 mt-1", children: activeModerationCards.length }), /*#__PURE__*/ _jsx("div", { className: "text-xs text-gray-400 mt-1", children: t('admin.moderation.active_hint', 'Visible cards that can be blocked') }) ] }) ] }), moderationCardsLoading ? /*#__PURE__*/ _jsx("div", { className: "text-center py-10 text-gray-400", children: t('common.loading') }) : moderationCards.length === 0 ? /*#__PURE__*/ _jsx("div", { className: "text-center py-10 text-gray-400", children: t('admin.moderation.none', 'No specialist cards found') }) : /*#__PURE__*/ _jsxs("div", { className: "space-y-6", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-gray-800 mb-3", children: t('admin.moderation.pending_title', 'Pending approval') }), /*#__PURE__*/ _jsx("div", { className: "space-y-3", children: pendingModerationCards.length === 0 ? /*#__PURE__*/ _jsx("div", { className: "text-sm text-gray-400 bg-white border border-dashed border-gray-200 rounded-xl p-4", children: t('admin.moderation.pending_empty', 'No pending proposals right now') }) : pendingModerationCards.map((card)=>{ var _card_specialistName, _ref; return /*#__PURE__*/ _jsx("div", { className: "bg-white rounded-xl border border-gray-200 p-4", children: /*#__PURE__*/ _jsxs("div", { className: "flex flex-wrap items-start justify-between gap-3", children: [ /*#__PURE__*/ _jsxs("div", { className: "min-w-0 flex-1", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 flex-wrap mb-1", children: [ /*#__PURE__*/ _jsx("span", { className: "px-2 py-0.5 rounded-full text-xs font-medium bg-yellow-100 text-yellow-700", children: t('admin.moderation.pending', 'Pending') }), /*#__PURE__*/ _jsx("span", { className: "text-sm font-semibold text-gray-800 truncate", children: card.title }) ] }), /*#__PURE__*/ _jsx("div", { className: "text-xs text-gray-500 mb-2", children: /*#__PURE__*/ _jsx(Link, { href: "/users/".concat(card.specialistId), className: "hover:text-green-600 hover:underline font-medium", children: (_ref = (_card_specialistName = card.specialistName) !== null && _card_specialistName !== void 0 ? _card_specialistName : card.specialistEmail) !== null && _ref !== void 0 ? _ref : card.specialistId }) }), card.description && /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-700 line-clamp-3", children: card.description }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-2 flex-shrink-0", children: [ /*#__PURE__*/ _jsx("button", { onClick: ()=>updateModerationCard(card.id, 'active'), className: "px-3 py-1.5 rounded-lg text-xs font-medium bg-green-600 text-white hover:bg-green-700", children: t('admin.moderation.approve', 'Approve') }), /*#__PURE__*/ _jsx("button", { onClick: ()=>updateModerationCard(card.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: t('admin.moderation.block', 'Block') }) ] }) ] }) }, card.id); }) }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-gray-800 mb-3", children: t('admin.moderation.active_title', 'Active cards') }), /*#__PURE__*/ _jsx("div", { className: "space-y-3", children: activeModerationCards.length === 0 ? /*#__PURE__*/ _jsx("div", { className: "text-sm text-gray-400 bg-white border border-dashed border-gray-200 rounded-xl p-4", children: t('admin.moderation.active_empty', 'No active cards found') }) : activeModerationCards.map((card)=>{ var _card_specialistName, _ref; return /*#__PURE__*/ _jsx("div", { className: "bg-white rounded-xl border border-gray-200 p-4", children: /*#__PURE__*/ _jsxs("div", { className: "flex flex-wrap items-start justify-between gap-3", children: [ /*#__PURE__*/ _jsxs("div", { className: "min-w-0 flex-1", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 flex-wrap mb-1", children: [ /*#__PURE__*/ _jsx("span", { className: "px-2 py-0.5 rounded-full text-xs font-medium bg-green-100 text-green-700", children: t('admin.moderation.active', 'Active') }), /*#__PURE__*/ _jsx("span", { className: "text-sm font-semibold text-gray-800 truncate", children: card.title }) ] }), /*#__PURE__*/ _jsx("div", { className: "text-xs text-gray-500 mb-2", children: /*#__PURE__*/ _jsx(Link, { href: "/users/".concat(card.specialistId), className: "hover:text-green-600 hover:underline font-medium", children: (_ref = (_card_specialistName = card.specialistName) !== null && _card_specialistName !== void 0 ? _card_specialistName : card.specialistEmail) !== null && _ref !== void 0 ? _ref : card.specialistId }) }), card.description && /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-700 line-clamp-3", children: card.description }) ] }), /*#__PURE__*/ _jsx("button", { onClick: ()=>updateModerationCard(card.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: t('admin.moderation.block', 'Block') }) ] }) }, card.id); }) }) ] }), /*#__PURE__*/ _jsx(Pagination, { page: moderationCardsPage, total: moderationCardsTotal, limit: 20, onChange: setModerationCardsPage, totalLabel: t('admin.pagination.total') }) ] }) ] }), tab === 'logs' && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("div", { className: "flex gap-1 bg-gray-100 rounded-xl p-1 mb-5 w-fit", children: [ { key: 'ai', label: t('admin.logs.subtab.ai') }, { key: 'activity', label: t('admin.logs.subtab.activity') }, { key: 'mail', label: t('admin.logs.subtab.mail') }, { key: 'notifications', label: t('admin.logs.subtab.notifications') } ].map((param)=>{ let { key, label } = param; return /*#__PURE__*/ _jsx("button", { onClick: ()=>setLogsSubTab(key), className: "px-4 py-1.5 rounded-lg text-sm font-medium transition-colors ".concat(logsSubTab === key ? 'bg-white text-gray-900 shadow-sm' : 'text-gray-500 hover:text-gray-700'), children: label }, key); }) }), logsSubTab === 'ai' && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("div", { className: "flex justify-between items-center mb-4", children: [ /*#__PURE__*/ _jsxs("p", { className: "text-sm text-gray-500", children: [ t('admin.pagination.total'), ": ", logsTotal ] }), /*#__PURE__*/ _jsxs("button", { onClick: ()=>{ setLogsPage(1); api.getAdminAiLogs(1).then((d)=>{ setLogs(d.data); setLogsTotal(d.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: [ /*#__PURE__*/ _jsxs("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ _jsx("polyline", { points: "23 4 23 10 17 10" }), /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M20.49 15a9 9 0 11-2.12-9.36L23 10" }) ] }), t('common.refresh') ] }) ] }), loading ? /*#__PURE__*/ _jsx("div", { className: "text-center py-10 text-gray-400", children: t('common.loading') }) : logs.length === 0 ? /*#__PURE__*/ _jsx("div", { className: "text-center py-10 text-gray-400", children: t('admin.logs.empty') }) : /*#__PURE__*/ _jsx("div", { className: "overflow-x-auto rounded-xl border border-gray-200", children: /*#__PURE__*/ _jsxs("table", { className: "w-full text-sm", children: [ /*#__PURE__*/ _jsx("thead", { className: "bg-gray-50 text-gray-500 text-xs uppercase", children: /*#__PURE__*/ _jsxs("tr", { children: [ /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 text-left", children: t('admin.logs.date') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 text-left", children: t('admin.logs.provider') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 text-left", children: t('admin.logs.model') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 text-left", children: t('admin.logs.action') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 text-left", children: t('admin.logs.langs') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 text-right", children: t('admin.logs.in') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 text-right", children: t('admin.logs.out') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 text-right", children: t('admin.logs.total') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 text-right", children: t('admin.logs.ms') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 text-center", children: t('admin.logs.status') }) ] }) }), /*#__PURE__*/ _jsx("tbody", { className: "divide-y divide-gray-100", children: logs.map((log)=>{ var _log_inputTokens, _log_outputTokens, _log_totalTokens, _log_durationMs, _log_error; return /*#__PURE__*/ _jsxs("tr", { className: "bg-white hover:bg-gray-50", children: [ /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-gray-500 whitespace-nowrap", children: new Date(log.createdAt).toLocaleString(dateLocale) }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3", children: /*#__PURE__*/ _jsx("span", { className: "px-2 py-0.5 rounded-full text-xs font-medium ".concat(log.provider === 'anthropic' ? 'bg-purple-100 text-purple-700' : 'bg-green-100 text-green-700'), children: log.provider }) }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-gray-600 font-mono text-xs", children: log.model }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-gray-600", children: log.action }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-gray-500", children: log.fromLocale && log.toLocale ? "".concat(log.fromLocale, " → ").concat(log.toLocale) : '—' }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-right text-gray-600", children: (_log_inputTokens = log.inputTokens) !== null && _log_inputTokens !== void 0 ? _log_inputTokens : '—' }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-right text-gray-600", children: (_log_outputTokens = log.outputTokens) !== null && _log_outputTokens !== void 0 ? _log_outputTokens : '—' }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-right font-medium", children: (_log_totalTokens = log.totalTokens) !== null && _log_totalTokens !== void 0 ? _log_totalTokens : '—' }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-right text-gray-500", children: (_log_durationMs = log.durationMs) !== null && _log_durationMs !== void 0 ? _log_durationMs : '—' }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-center", children: log.success ? /*#__PURE__*/ _jsx("span", { className: "text-green-600 flex justify-center", children: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("polyline", { points: "20 6 9 17 4 12" }) }) }) : /*#__PURE__*/ _jsx("span", { className: "text-red-500 flex justify-center", title: (_log_error = log.error) !== null && _log_error !== void 0 ? _log_error : '', children: /*#__PURE__*/ _jsxs("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: [ /*#__PURE__*/ _jsx("line", { x1: "18", y1: "6", x2: "6", y2: "18" }), /*#__PURE__*/ _jsx("line", { x1: "6", y1: "6", x2: "18", y2: "18" }) ] }) }) }) ] }, log.id); }) }) ] }) }), /*#__PURE__*/ _jsx(Pagination, { page: logsPage, total: logsTotal, limit: 50, onChange: setLogsPage, totalLabel: t('admin.pagination.total') }) ] }), logsSubTab === 'activity' && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-4 mb-4 flex flex-wrap gap-3 items-end", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-500 mb-1", children: t('admin.activity.event') }), /*#__PURE__*/ _jsxs("select", { value: activityEvent, onChange: (e)=>setActivityEvent(e.target.value), className: "border border-gray-300 rounded-lg px-3 py-1.5 text-sm min-w-[180px]", children: [ /*#__PURE__*/ _jsx("option", { value: "", children: t('admin.activity.all_events') }), activityEventTypes.map((ev)=>/*#__PURE__*/ _jsx("option", { value: ev, children: ev }, ev)) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-500 mb-1", children: t('admin.activity.from') }), /*#__PURE__*/ _jsx("input", { type: "date", value: activityDateFrom, onChange: (e)=>setActivityDateFrom(e.target.value), className: "border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-500 mb-1", children: t('admin.activity.to') }), /*#__PURE__*/ _jsx("input", { type: "date", value: activityDateTo, onChange: (e)=>setActivityDateTo(e.target.value), className: "border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), (activityEvent || activityDateFrom || activityDateTo || activityUserId) && /*#__PURE__*/ _jsxs("button", { onClick: ()=>{ setActivityEvent(''); setActivityDateFrom(''); setActivityDateTo(''); setActivityUserId(''); }, 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: [ /*#__PURE__*/ _jsxs("svg", { className: "w-3 h-3", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: [ /*#__PURE__*/ _jsx("line", { x1: "18", y1: "6", x2: "6", y2: "18" }), /*#__PURE__*/ _jsx("line", { x1: "6", y1: "6", x2: "18", y2: "18" }) ] }), t('admin.activity.reset') ] }), /*#__PURE__*/ _jsxs("p", { className: "text-xs text-gray-400 self-end ml-auto", children: [ t('admin.activity.total'), ": ", activityTotal ] }) ] }), activityLog.length === 0 ? /*#__PURE__*/ _jsx("div", { className: "text-center py-10 text-gray-400", children: t('admin.activity.empty') }) : /*#__PURE__*/ _jsx("div", { className: "space-y-2", children: activityLog.map((entry)=>/*#__PURE__*/ _jsx(ActivityLogRow, { entry: entry, dateLocale: dateLocale, onFilterUser: (id)=>{ setActivityUserId(id); setActivityEvent(''); }, t: t }, entry.id)) }), /*#__PURE__*/ _jsx(Pagination, { page: activityPage, total: activityTotal, limit: 50, onChange: setActivityPage, totalLabel: t('admin.pagination.total') }) ] }), logsSubTab === 'mail' && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-4 mb-4 flex flex-wrap gap-3 items-end", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-500 mb-1", children: t('admin.mail.event') }), /*#__PURE__*/ _jsxs("select", { value: mailEvent, onChange: (e)=>setMailEvent(e.target.value), className: "border border-gray-300 rounded-lg px-3 py-1.5 text-sm min-w-[200px]", children: [ /*#__PURE__*/ _jsx("option", { value: "", children: t('admin.mail.all_events') }), mailEventTypes.map((ev)=>/*#__PURE__*/ _jsx("option", { value: ev, children: t("admin.event.".concat(ev.replace(/\./g, '_')), ev) }, ev)) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-500 mb-1", children: t('admin.mail.from') }), /*#__PURE__*/ _jsx("input", { type: "date", value: mailDateFrom, onChange: (e)=>setMailDateFrom(e.target.value), className: "border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-500 mb-1", children: t('admin.mail.to') }), /*#__PURE__*/ _jsx("input", { type: "date", value: mailDateTo, onChange: (e)=>setMailDateTo(e.target.value), className: "border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), (mailEvent || mailDateFrom || mailDateTo) && /*#__PURE__*/ _jsxs("button", { onClick: ()=>{ setMailEvent(''); setMailDateFrom(''); setMailDateTo(''); }, 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: [ /*#__PURE__*/ _jsxs("svg", { className: "w-3 h-3", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: [ /*#__PURE__*/ _jsx("line", { x1: "18", y1: "6", x2: "6", y2: "18" }), /*#__PURE__*/ _jsx("line", { x1: "6", y1: "6", x2: "18", y2: "18" }) ] }), t('admin.mail.reset') ] }), /*#__PURE__*/ _jsxs("p", { className: "text-xs text-gray-400 self-end ml-auto", children: [ t('admin.mail.total'), ": ", mailTotal ] }) ] }), mailLog.length === 0 ? /*#__PURE__*/ _jsx("div", { className: "text-center py-10 text-gray-400", children: t('admin.mail.empty') }) : /*#__PURE__*/ _jsx("div", { className: "overflow-x-auto rounded-xl border border-gray-200", children: /*#__PURE__*/ _jsxs("table", { className: "w-full text-sm", children: [ /*#__PURE__*/ _jsx("thead", { className: "bg-gray-50 text-gray-500 text-xs uppercase", children: /*#__PURE__*/ _jsxs("tr", { children: [ /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 text-left", children: t('admin.logs.date') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 text-left", children: t('admin.mail.recipient') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 text-left", children: t('admin.mail.event') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 text-left", children: t('admin.mail.provider') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 text-left", children: t('admin.mail.details') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 text-center", children: t('admin.mail.status') }) ] }) }), /*#__PURE__*/ _jsx("tbody", { className: "divide-y divide-gray-100", children: mailLog.map((entry)=>{ const details = parseLogDetails(entry.details); const provider = typeof (details === null || details === void 0 ? void 0 : details.provider) === 'string' ? details.provider : '—'; const recipient = typeof (details === null || details === void 0 ? void 0 : details.to) === 'string' ? details.to : entry.userEmail || '—'; const subject = typeof (details === null || details === void 0 ? void 0 : details.subject) === 'string' ? details.subject : ''; const error = typeof (details === null || details === void 0 ? void 0 : details.error) === 'string' ? details.error : ''; const success = entry.event === 'email.sent' || entry.event === 'admin.email.test.sent'; return /*#__PURE__*/ _jsxs("tr", { className: "bg-white hover:bg-gray-50 align-top", children: [ /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-gray-500 whitespace-nowrap", children: new Date(entry.createdAt).toLocaleString(dateLocale) }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-gray-700", children: recipient }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3", children: /*#__PURE__*/ _jsx("span", { className: "px-2 py-0.5 rounded-full text-xs font-medium bg-sky-50 text-sky-700", children: t("admin.event.".concat(entry.event.replace(/\./g, '_')), entry.event) }) }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-gray-600", children: provider }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-gray-600 max-w-md", children: /*#__PURE__*/ _jsx("div", { className: "truncate", title: subject || error || undefined, children: subject || error || '—' }) }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-center", children: success ? /*#__PURE__*/ _jsx("span", { className: "text-green-600 inline-flex justify-center", title: t('admin.mail.success'), children: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("polyline", { points: "20 6 9 17 4 12" }) }) }) : /*#__PURE__*/ _jsx("span", { className: "text-red-500 inline-flex justify-center", title: error || t('admin.mail.failed'), children: /*#__PURE__*/ _jsxs("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: [ /*#__PURE__*/ _jsx("line", { x1: "18", y1: "6", x2: "6", y2: "18" }), /*#__PURE__*/ _jsx("line", { x1: "6", y1: "6", x2: "18", y2: "18" }) ] }) }) }) ] }, entry.id); }) }) ] }) }), /*#__PURE__*/ _jsx(Pagination, { page: mailPage, total: mailTotal, limit: 50, onChange: setMailPage, totalLabel: t('admin.pagination.total') }) ] }), logsSubTab === 'notifications' && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-4 mb-4 flex flex-wrap gap-3 items-end", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-500 mb-1", children: t('admin.notif_logs.type') }), /*#__PURE__*/ _jsxs("select", { value: notifLogsType, onChange: (e)=>setNotifLogsType(e.target.value), className: "border border-gray-300 rounded-lg px-3 py-1.5 text-sm min-w-[200px]", children: [ /*#__PURE__*/ _jsx("option", { value: "", children: t('admin.filter.all') }), notifLogsTypes.map((tp)=>/*#__PURE__*/ _jsx("option", { value: tp, children: tp }, tp)) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-500 mb-1", children: t('admin.activity.from') }), /*#__PURE__*/ _jsx("input", { type: "date", value: notifLogsDateFrom, onChange: (e)=>setNotifLogsDateFrom(e.target.value), className: "border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-500 mb-1", children: t('admin.activity.to') }), /*#__PURE__*/ _jsx("input", { type: "date", value: notifLogsDateTo, onChange: (e)=>setNotifLogsDateTo(e.target.value), className: "border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), (notifLogsType || notifLogsDateFrom || notifLogsDateTo) && /*#__PURE__*/ _jsxs("button", { onClick: ()=>{ setNotifLogsType(''); setNotifLogsDateFrom(''); setNotifLogsDateTo(''); }, 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: [ /*#__PURE__*/ _jsxs("svg", { className: "w-3 h-3", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: [ /*#__PURE__*/ _jsx("line", { x1: "18", y1: "6", x2: "6", y2: "18" }), /*#__PURE__*/ _jsx("line", { x1: "6", y1: "6", x2: "18", y2: "18" }) ] }), t('admin.activity.reset') ] }), /*#__PURE__*/ _jsxs("p", { className: "text-xs text-gray-400 self-end ml-auto", children: [ t('admin.pagination.total'), ": ", notifLogsTotal ] }) ] }), notifLogs.length === 0 ? /*#__PURE__*/ _jsx("div", { className: "text-center py-10 text-gray-400", children: t('admin.notif_logs.empty') }) : /*#__PURE__*/ _jsx("div", { className: "overflow-x-auto rounded-xl border border-gray-200", children: /*#__PURE__*/ _jsxs("table", { className: "w-full text-sm", children: [ /*#__PURE__*/ _jsx("thead", { className: "bg-gray-50 text-gray-500 text-xs uppercase", children: /*#__PURE__*/ _jsxs("tr", { children: [ /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 text-left", children: t('admin.logs.date') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 text-left", children: t('admin.col.user') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 text-left", children: t('admin.notif_logs.type') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 text-left", children: t('admin.notif_logs.title') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 text-center", children: t('admin.notif_logs.read') }) ] }) }), /*#__PURE__*/ _jsx("tbody", { className: "divide-y divide-gray-100", children: notifLogs.map((n)=>{ var _n_recipientName, _ref; return /*#__PURE__*/ _jsxs("tr", { className: "bg-white hover:bg-gray-50", children: [ /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-gray-500 whitespace-nowrap", children: new Date(n.createdAt).toLocaleString(dateLocale) }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-gray-700", children: (_ref = (_n_recipientName = n.recipientName) !== null && _n_recipientName !== void 0 ? _n_recipientName : n.recipientEmail) !== null && _ref !== void 0 ? _ref : n.recipientId }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3", children: /*#__PURE__*/ _jsx("span", { className: "px-2 py-0.5 rounded-full text-xs font-medium bg-green-50 text-green-700", children: n.type }) }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-gray-600 max-w-xs truncate", children: n.title }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-center", children: n.isRead ? /*#__PURE__*/ _jsx("span", { className: "text-green-600 flex justify-center", children: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("polyline", { points: "20 6 9 17 4 12" }) }) }) : /*#__PURE__*/ _jsx("span", { className: "text-gray-400 flex justify-center", children: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("circle", { cx: "12", cy: "12", r: "10" }) }) }) }) ] }, n.id); }) }) ] }) }), /*#__PURE__*/ _jsx(Pagination, { page: notifLogsPage, total: notifLogsTotal, limit: 50, onChange: setNotifLogsPage, totalLabel: t('admin.pagination.total') }) ] }) ] }), tab === 'plans' && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between mb-4", children: [ /*#__PURE__*/ _jsxs("h2", { className: "text-lg font-semibold text-gray-800 flex items-center gap-2", children: [ /*#__PURE__*/ _jsxs("svg", { className: "w-5 h-5 text-green-600", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: [ /*#__PURE__*/ _jsx("rect", { x: "1", y: "4", width: "22", height: "16", rx: "2", ry: "2" }), /*#__PURE__*/ _jsx("line", { x1: "1", y1: "10", x2: "23", y2: "10" }) ] }), t('admin.plans.title') ] }), /*#__PURE__*/ _jsx("button", { onClick: openAddPlan, className: "bg-green-600 text-white text-sm px-4 py-2 rounded-lg hover:bg-green-700 font-medium", children: t('admin.plans.add') }) ] }), planForm && /*#__PURE__*/ _jsxs("div", { className: "bg-white border border-gray-200 rounded-xl p-5 mb-4 space-y-3", children: [ /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-gray-800", children: planForm.id ? t('admin.plans.form.edit') : t('admin.plans.form.new') }), /*#__PURE__*/ _jsxs("div", { className: "grid grid-cols-2 gap-3", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.name') }), /*#__PURE__*/ _jsx("input", { value: planForm.name, onChange: (e)=>setPlanForm({ ...planForm, name: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.price') }), /*#__PURE__*/ _jsx("input", { type: "number", min: "0", step: "0.01", value: planForm.price, onChange: (e)=>setPlanForm({ ...planForm, price: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.old_price') }), /*#__PURE__*/ _jsx("input", { type: "number", min: "0", step: "0.01", value: (_planForm_oldPrice = planForm.oldPrice) !== null && _planForm_oldPrice !== void 0 ? _planForm_oldPrice : '', onChange: (e)=>setPlanForm({ ...planForm, oldPrice: e.target.value }), placeholder: "—", className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.tier') }), /*#__PURE__*/ _jsxs("select", { value: planForm.tier, onChange: (e)=>setPlanForm({ ...planForm, tier: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400", children: [ /*#__PURE__*/ _jsx("option", { value: "free", children: t('admin.plans.form.tier.free') }), /*#__PURE__*/ _jsx("option", { value: "pro", children: t('admin.plans.form.tier.pro') }), /*#__PURE__*/ _jsx("option", { value: "ultimate", children: t('admin.plans.form.tier.ultimate') }) ] }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.description') }), /*#__PURE__*/ _jsx("input", { value: planForm.description, onChange: (e)=>setPlanForm({ ...planForm, description: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ _jsx("p", { className: "text-xs font-semibold text-gray-500 uppercase tracking-wide pt-1", children: t('admin.plans.form.section.limits') }), /*#__PURE__*/ _jsxs("div", { className: "grid grid-cols-3 gap-3", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.max_tasks') }), /*#__PURE__*/ _jsx("input", { type: "number", min: "0", placeholder: "∞", value: planForm.maxTasks, onChange: (e)=>setPlanForm({ ...planForm, maxTasks: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.max_offers') }), /*#__PURE__*/ _jsx("input", { type: "number", min: "0", placeholder: "∞", value: planForm.maxOffers, onChange: (e)=>setPlanForm({ ...planForm, maxOffers: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.max_cards') }), /*#__PURE__*/ _jsx("input", { type: "number", min: "0", placeholder: "∞", value: planForm.maxCards, onChange: (e)=>setPlanForm({ ...planForm, maxCards: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.max_messages_day') }), /*#__PURE__*/ _jsx("input", { type: "number", min: "0", placeholder: "∞", value: planForm.maxMessagesPerDay, onChange: (e)=>setPlanForm({ ...planForm, maxMessagesPerDay: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.max_orders_day') }), /*#__PURE__*/ _jsx("input", { type: "number", min: "0", placeholder: "∞", value: planForm.maxOrdersPerDay, onChange: (e)=>setPlanForm({ ...planForm, maxOrdersPerDay: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.max_skills') }), /*#__PURE__*/ _jsx("input", { type: "number", min: "0", placeholder: "∞", value: planForm.maxSkills, onChange: (e)=>setPlanForm({ ...planForm, maxSkills: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.duration_days') }), /*#__PURE__*/ _jsx("input", { type: "number", min: "0", placeholder: "∞", value: planForm.durationDays, onChange: (e)=>setPlanForm({ ...planForm, durationDays: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }) ] }), /*#__PURE__*/ _jsx("p", { className: "text-xs font-semibold text-gray-500 uppercase tracking-wide pt-1", children: t('admin.plans.form.section.boost') }), /*#__PURE__*/ _jsxs("div", { className: "grid grid-cols-2 gap-3", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.search_boost') }), /*#__PURE__*/ _jsx("input", { type: "number", min: "0", value: planForm.searchBoost, onChange: (e)=>setPlanForm({ ...planForm, searchBoost: Number(e.target.value) }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.offers_multiplier') }), /*#__PURE__*/ _jsx("input", { type: "number", min: "0", step: "0.01", value: planForm.offersMultiplier, onChange: (e)=>setPlanForm({ ...planForm, offersMultiplier: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.features') }), /*#__PURE__*/ _jsx("textarea", { rows: 3, value: planForm.features, onChange: (e)=>setPlanForm({ ...planForm, features: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 resize-none" }) ] }), /*#__PURE__*/ _jsx("p", { className: "text-xs font-semibold text-gray-500 uppercase tracking-wide pt-1", children: t('admin.plans.form.section.contact') }), /*#__PURE__*/ _jsx("div", { className: "grid grid-cols-2 gap-2", children: [ [ 'canContactFreePlan', t('admin.plans.form.can_contact_free') ], [ 'canContactProPlan', t('admin.plans.form.can_contact_pro') ], [ 'canContactAll', t('admin.plans.form.can_contact_all') ], [ 'canShowContactInfo', t('admin.plans.form.can_show_contact') ], [ 'canViewPhone', t('admin.plans.form.can_view_phone') ] ].map((param)=>{ let [key, label] = param; return /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-2 cursor-pointer text-sm text-gray-700", children: [ /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: planForm[key], onChange: (e)=>setPlanForm({ ...planForm, [key]: e.target.checked }), className: "w-4 h-4 rounded text-green-600" }), label ] }, key); }) }), /*#__PURE__*/ _jsx("p", { className: "text-xs font-semibold text-gray-500 uppercase tracking-wide pt-1", children: t('admin.plans.form.section.features') }), /*#__PURE__*/ _jsx("div", { className: "grid grid-cols-2 gap-2", children: [ [ 'notifyNewTasks', t('admin.plans.form.notify') ], [ 'canUploadVideo', t('admin.plans.form.upload_video') ], [ 'hasFavorites', t('admin.plans.form.favorites') ], [ 'hasGoogleCalendar', t('admin.plans.form.google_calendar') ], [ 'hasVerifiedBadge', t('admin.plans.form.verified_badge') ], [ 'highlightedReviews', t('admin.plans.form.highlighted_reviews') ], [ 'hasPersonalSite', t('admin.plans.form.personal_site') ], [ 'hasCanHelpNowStatus', t('admin.plans.form.can_help_now') ], [ 'hasNeedHelpStatus', t('admin.plans.form.need_help') ], [ 'hasAutoResponse', t('admin.plans.form.auto_response') ], [ 'hasAutoMatch', t('admin.plans.form.auto_match') ], [ 'hasPriceList', t('admin.plans.form.price_list') ], [ 'receiveInstantDispatchFree', t('admin.plans.form.instant_dispatch_free') ], [ 'receiveInstantDispatchPro', t('admin.plans.form.instant_dispatch_pro') ] ].map((param)=>{ let [key, label] = param; return /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-2 cursor-pointer text-sm text-gray-700", children: [ /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: planForm[key], onChange: (e)=>setPlanForm({ ...planForm, [key]: e.target.checked }), className: "w-4 h-4 rounded text-green-600" }), label ] }, key); }) }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-6 pt-1", children: [ /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-2 cursor-pointer text-sm text-gray-700", children: [ /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: planForm.isDefault, onChange: (e)=>setPlanForm({ ...planForm, isDefault: e.target.checked }), className: "w-4 h-4 rounded text-green-600" }), t('admin.plans.form.default') ] }), /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-2 cursor-pointer text-sm text-gray-700", children: [ /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: planForm.isActive, onChange: (e)=>setPlanForm({ ...planForm, isActive: e.target.checked }), className: "w-4 h-4 rounded text-green-600" }), t('admin.plans.form.active') ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2", children: [ /*#__PURE__*/ _jsx("label", { className: "text-xs text-gray-600", children: t('admin.plans.form.order') }), /*#__PURE__*/ _jsx("input", { type: "number", value: planForm.order, onChange: (e)=>setPlanForm({ ...planForm, order: Number(e.target.value) }), className: "w-16 border border-gray-300 rounded-lg px-2 py-1 text-sm focus:outline-none" }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-2 pt-1", children: [ /*#__PURE__*/ _jsx("button", { onClick: savePlan, disabled: planSaving || !planForm.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: planSaving ? '...' : t('common.save') }), /*#__PURE__*/ _jsx("button", { onClick: ()=>setPlanForm(null), className: "px-4 py-2 rounded-lg text-sm font-medium text-gray-600 hover:bg-gray-100", children: t('common.cancel') }) ] }) ] }), /*#__PURE__*/ _jsx("div", { className: "bg-white rounded-xl border border-gray-200 overflow-hidden", children: planRows.length === 0 ? /*#__PURE__*/ _jsx("div", { className: "px-4 py-8 text-center text-gray-400 text-sm", children: t('admin.plans.empty') }) : /*#__PURE__*/ _jsx("div", { className: "divide-y divide-gray-100", children: planRows.sort((a, b)=>{ var _a_order, _b_order; return ((_a_order = a.order) !== null && _a_order !== void 0 ? _a_order : 0) - ((_b_order = b.order) !== null && _b_order !== void 0 ? _b_order : 0); }).map((plan)=>{ var _plan_features; return /*#__PURE__*/ _jsxs("div", { className: "flex items-start gap-4 px-4 py-4 ".concat(!plan.isActive ? 'opacity-50' : ''), children: [ /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 flex-wrap", children: [ /*#__PURE__*/ _jsx("span", { className: "font-semibold text-gray-900", children: plan.name }), plan.isDefault && /*#__PURE__*/ _jsx("span", { className: "bg-green-100 text-green-700 text-xs px-2 py-0.5 rounded-full font-medium", children: t('admin.plans.badge.default') }), !plan.isActive && /*#__PURE__*/ _jsx("span", { className: "bg-gray-100 text-gray-500 text-xs px-2 py-0.5 rounded-full", children: t('admin.plans.badge.inactive') }) ] }), plan.description && /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-500 mt-0.5", children: plan.description }), /*#__PURE__*/ _jsxs("div", { className: "flex flex-wrap gap-3 mt-1 text-xs text-gray-500", children: [ /*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-1.5 font-semibold text-gray-800", children: [ plan.oldPrice && /*#__PURE__*/ _jsxs("span", { className: "font-normal text-gray-400 line-through", children: [ plan.oldPrice, " ", plan.currency ] }), /*#__PURE__*/ _jsxs("span", { children: [ plan.price, " ", plan.currency ] }) ] }), plan.maxTasks != null && /*#__PURE__*/ _jsxs("span", { children: [ t('admin.plans.tasks'), ": ", plan.maxTasks ] }), plan.maxOffers != null && /*#__PURE__*/ _jsxs("span", { children: [ t('admin.plans.offers'), ": ", plan.maxOffers ] }), plan.maxCards != null && /*#__PURE__*/ _jsxs("span", { children: [ t('admin.plans.cards'), ": ", plan.maxCards ] }), plan.notifyNewTasks && /*#__PURE__*/ _jsxs("span", { className: "text-green-700 flex items-center gap-1", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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" }) }), t('admin.plans.notify_tasks') ] }) ] }), ((_plan_features = plan.features) !== null && _plan_features !== void 0 ? _plan_features : []).length > 0 && /*#__PURE__*/ _jsx("ul", { className: "mt-1.5 space-y-0.5", children: plan.features.map((f, i)=>/*#__PURE__*/ _jsxs("li", { className: "text-xs text-gray-600 flex items-center gap-1.5", children: [ /*#__PURE__*/ _jsx("span", { className: "text-green-500", children: /*#__PURE__*/ _jsx("svg", { className: "w-3 h-3", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("polyline", { points: "20 6 9 17 4 12" }) }) }), " ", f ] }, i)) }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-1 shrink-0", children: [ !plan.isDefault && /*#__PURE__*/ _jsx("button", { onClick: ()=>api.updatePlan(plan.id, { isDefault: true }).then(()=>api.getAdminPlans().then(setPlanRows)).catch(()=>{}), className: "text-xs px-2 py-1 rounded-lg bg-green-50 text-green-600 hover:bg-green-100 font-medium", title: t('admin.plans.make_default'), children: /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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" }) }) }), /*#__PURE__*/ _jsx("button", { onClick: ()=>openEditPlan(plan), className: "text-xs px-2 py-1 rounded-lg bg-gray-100 text-gray-600 hover:bg-gray-200 font-medium", children: t('common.edit') }), /*#__PURE__*/ _jsx("button", { onClick: ()=>deletePlan(plan.id, plan.name), className: "text-xs px-2 py-1 rounded-lg bg-red-50 text-red-600 hover:bg-red-100 font-medium", children: t('common.delete') }) ] }) ] }, plan.id); }) }) }) ] }), tab === 'settings' && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _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((st)=>{ const labels = { general: t('admin.settings.tab.general'), smtp: t('admin.settings.tab.smtp'), notifications: t('admin.settings.tab.notifications'), payment: t('admin.settings.tab.payment'), referral: t('admin.settings.tab.referral'), seo: t('admin.settings.tab.seo'), socials: t('admin.settings.tab.socials'), telegram: t('admin.settings.tab.telegram') }; return /*#__PURE__*/ _jsx("button", { onClick: ()=>setSettingsTab(st), className: "px-4 py-2 rounded-lg text-sm font-medium transition ".concat(settingsTab === st ? 'bg-green-600 text-white shadow-sm' : 'text-gray-600 hover:bg-gray-100'), children: labels[st] }, st); }) }), settingsTab === 'general' && /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6 max-w-lg", children: [ /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-gray-800 mb-5", children: t('admin.settings.general.title') }), /*#__PURE__*/ _jsxs("div", { className: "space-y-4", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.general.site_name') }), /*#__PURE__*/ _jsx("input", { value: generalForm.siteName, onChange: (e)=>setGeneralForm((f)=>({ ...f, siteName: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400", placeholder: "CanHelp" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.general.site_url') }), /*#__PURE__*/ _jsx("input", { value: generalForm.siteUrl, onChange: (e)=>setGeneralForm((f)=>({ ...f, siteUrl: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400", placeholder: "https://canhelp.com" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.general.contact_email') }), /*#__PURE__*/ _jsx("input", { type: "email", value: generalForm.contactEmail, onChange: (e)=>setGeneralForm((f)=>({ ...f, contactEmail: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400", placeholder: "contact@canhelp.com" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.general.support_phone') }), /*#__PURE__*/ _jsx("input", { value: generalForm.supportPhone, onChange: (e)=>setGeneralForm((f)=>({ ...f, supportPhone: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400", placeholder: "+30 21 000 0000" }) ] }), /*#__PURE__*/ _jsx("button", { onClick: saveGeneralSettings, disabled: generalSaving, 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: generalSaving ? t('admin.settings.saving') : generalSaved ? t('admin.settings.saved') : t('common.save') }) ] }) ] }), settingsTab === 'smtp' && /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6 max-w-lg", children: [ /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-gray-800 mb-1", children: t('admin.settings.smtp.title') }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-400 mb-5", children: t('admin.settings.smtp.hint') }), /*#__PURE__*/ _jsxs("div", { className: "space-y-4", children: [ /*#__PURE__*/ _jsxs("div", { className: "grid grid-cols-3 gap-3", children: [ /*#__PURE__*/ _jsxs("div", { className: "col-span-2", children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.smtp.host') }), /*#__PURE__*/ _jsx("input", { value: smtpForm.host, onChange: (e)=>setSmtpForm((f)=>({ ...f, host: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400", placeholder: "smtp.gmail.com" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.smtp.port') }), /*#__PURE__*/ _jsx("input", { value: smtpForm.port, onChange: (e)=>setSmtpForm((f)=>({ ...f, port: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400", placeholder: "587" }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.smtp.encryption') }), /*#__PURE__*/ _jsxs("select", { value: smtpForm.encryption, onChange: (e)=>setSmtpForm((f)=>({ ...f, encryption: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400", children: [ /*#__PURE__*/ _jsx("option", { value: "none", children: t('admin.settings.smtp.enc.none') }), /*#__PURE__*/ _jsx("option", { value: "tls", children: "STARTTLS (587)" }), /*#__PURE__*/ _jsx("option", { value: "ssl", children: "SSL/TLS (465)" }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.smtp.username') }), /*#__PURE__*/ _jsx("input", { value: smtpForm.username, onChange: (e)=>setSmtpForm((f)=>({ ...f, username: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400", placeholder: "user@gmail.com", autoComplete: "off" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.smtp.password') }), /*#__PURE__*/ _jsx("input", { type: "password", value: smtpForm.password, onChange: (e)=>setSmtpForm((f)=>({ ...f, password: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400", autoComplete: "new-password", placeholder: "••••••••••••" }) ] }), /*#__PURE__*/ _jsxs("div", { className: "grid grid-cols-2 gap-3", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.smtp.from_name') }), /*#__PURE__*/ _jsx("input", { value: smtpForm.fromName, onChange: (e)=>setSmtpForm((f)=>({ ...f, fromName: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400", placeholder: "CanHelp" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.smtp.from_email') }), /*#__PURE__*/ _jsx("input", { type: "email", value: smtpForm.fromEmail, onChange: (e)=>setSmtpForm((f)=>({ ...f, fromEmail: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400", placeholder: "noreply@canhelp.com" }) ] }) ] }), /*#__PURE__*/ _jsx("button", { onClick: saveSmtpSettings, disabled: smtpSaving, 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: smtpSaving ? t('admin.settings.saving') : smtpSaved ? t('admin.settings.saved') : t('common.save') }), /*#__PURE__*/ _jsx("button", { onClick: async ()=>{ setTestEmailSending(true); setTestEmailResult(null); try { const res = await api.sendTestEmail(); setTestEmailResult("✓ Sent to ".concat(res.to)); } catch (e) { setTestEmailResult("✗ Error: ".concat(e.message)); } finally{ setTestEmailSending(false); setTimeout(()=>setTestEmailResult(null), 5000); } }, disabled: testEmailSending, 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: testEmailSending ? t('admin.settings.smtp.sending') : /*#__PURE__*/ _jsxs("span", { className: "flex items-center justify-center gap-2", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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" }) }), t('admin.settings.smtp.test') ] }) }), testEmailResult && /*#__PURE__*/ _jsx("p", { className: "text-sm text-center font-medium ".concat(testEmailResult.startsWith('✓') ? 'text-green-600' : 'text-red-500'), children: testEmailResult }) ] }) ] }), settingsTab === 'payment' && /*#__PURE__*/ _jsxs("div", { className: "space-y-6 max-w-lg", children: [ /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between mb-5", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3", children: [ /*#__PURE__*/ _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" }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-gray-800", children: "ePay — Piraeus Bank" }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400", children: "ГреческОй платёжМый шлюз" }) ] }) ] }), /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-2 cursor-pointer", children: [ /*#__PURE__*/ _jsx("span", { className: "text-sm text-gray-500", children: t('admin.settings.active') }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setEPayForm((f)=>({ ...f, enabled: !f.enabled })), className: "relative w-10 h-6 rounded-full p-0 transition-colors cursor-pointer ".concat(ePayForm.enabled ? 'bg-green-600' : 'bg-gray-300'), children: /*#__PURE__*/ _jsx("span", { className: "absolute left-0 top-1 w-4 h-4 bg-white rounded-full shadow transition-transform ".concat(ePayForm.enabled ? 'translate-x-5' : 'translate-x-1') }) }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "space-y-4", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.env.label') }), /*#__PURE__*/ _jsxs("select", { value: ePayForm.environment, onChange: (e)=>setEPayForm((f)=>({ ...f, environment: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm", children: [ /*#__PURE__*/ _jsx("option", { value: "test", children: t('admin.settings.env.test') }), /*#__PURE__*/ _jsx("option", { value: "production", children: t('admin.settings.env.prod') }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.merchant_id') }), /*#__PURE__*/ _jsx("input", { value: ePayForm.merchantId, onChange: (e)=>setEPayForm((f)=>({ ...f, merchantId: e.target.value })), placeholder: t('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" }) ] }), /*#__PURE__*/ _jsxs("div", { className: "grid grid-cols-2 gap-3", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: "API User" }), /*#__PURE__*/ _jsx("input", { value: ePayForm.apiUser, onChange: (e)=>setEPayForm((f)=>({ ...f, apiUser: e.target.value })), autoComplete: "off", className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: "API Password" }), /*#__PURE__*/ _jsx("input", { type: "password", value: ePayForm.apiPassword, onChange: (e)=>setEPayForm((f)=>({ ...f, apiPassword: e.target.value })), autoComplete: "new-password", className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: "Confirmation URL (webhook)" }), /*#__PURE__*/ _jsx("input", { value: ePayForm.confirmationUrl, onChange: (e)=>setEPayForm((f)=>({ ...f, confirmationUrl: e.target.value })), placeholder: "https://yoursite.com/api/payments/epay/confirm", className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: "Cancel URL" }), /*#__PURE__*/ _jsx("input", { value: ePayForm.cancelUrl, onChange: (e)=>setEPayForm((f)=>({ ...f, cancelUrl: e.target.value })), placeholder: "https://yoursite.com/payment/cancelled", className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 mt-5", children: [ /*#__PURE__*/ _jsx("button", { onClick: saveEPaySettings, disabled: ePaySaving, className: "px-5 py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700 disabled:opacity-50", children: ePaySaving ? t('admin.settings.saving') : t('common.save') }), ePaySaved && /*#__PURE__*/ _jsx("span", { className: "text-sm text-green-600", children: t('admin.settings.saved') }) ] }) ] }), /*#__PURE__*/ _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: [ /*#__PURE__*/ _jsxs("svg", { className: "w-4 h-4 shrink-0 mt-0.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ _jsx("circle", { cx: "12", cy: "12", r: "10" }), /*#__PURE__*/ _jsx("line", { x1: "12", y1: "8", x2: "12", y2: "12" }), /*#__PURE__*/ _jsx("line", { x1: "12", y1: "16", x2: "12.01", y2: "16" }) ] }), /*#__PURE__*/ _jsx("span", { children: t('admin.settings.payment.hint') }) ] }) ] }), settingsTab === 'notifications' && /*#__PURE__*/ _jsxs("div", { className: "space-y-3 max-w-2xl", children: [ /*#__PURE__*/ _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: [ /*#__PURE__*/ _jsxs("svg", { className: "w-4 h-4 shrink-0 mt-0.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ _jsx("circle", { cx: "12", cy: "12", r: "10" }), /*#__PURE__*/ _jsx("line", { x1: "12", y1: "8", x2: "12", y2: "12" }), /*#__PURE__*/ _jsx("line", { x1: "12", y1: "16", x2: "12.01", y2: "16" }) ] }), /*#__PURE__*/ _jsxs("p", { children: [ t('admin.notif.vars_hint'), ' ', TEMPLATE_HINT_VARS.map((name)=>{ const v = "{{".concat(name, "}}"); return /*#__PURE__*/ _jsx("code", { className: "mx-0.5 bg-green-100 text-gray-800 px-1.5 py-0.5 rounded text-xs font-mono", children: v }, v); }) ] }) ] }), [ { key: 'email_verification', label: t('admin.notif.email_verification'), icon: /*#__PURE__*/ _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: /*#__PURE__*/ _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: t('admin.notif.registration_success'), icon: /*#__PURE__*/ _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: /*#__PURE__*/ _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: t('admin.notif.password_reset'), icon: /*#__PURE__*/ _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: /*#__PURE__*/ _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: t('admin.notif.new_offer'), icon: /*#__PURE__*/ _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: /*#__PURE__*/ _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: t('admin.notif.new_task'), icon: /*#__PURE__*/ _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: /*#__PURE__*/ _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: t('admin.notif.offer_accepted'), icon: /*#__PURE__*/ _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: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" }) }) }, { key: 'new_message', label: t('admin.notif.new_message'), icon: /*#__PURE__*/ _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: /*#__PURE__*/ _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: t('admin.notif.offer_declined'), icon: /*#__PURE__*/ _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: /*#__PURE__*/ _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: t('admin.notif.offer_other_accepted'), icon: /*#__PURE__*/ _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: /*#__PURE__*/ _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: t('admin.notif.task_updated'), icon: /*#__PURE__*/ _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: /*#__PURE__*/ _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: t('admin.notif.deadline_reminder'), icon: /*#__PURE__*/ _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: /*#__PURE__*/ _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: t('admin.notif.task_archived'), icon: /*#__PURE__*/ _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: /*#__PURE__*/ _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: t('admin.notif.referral_reward'), icon: /*#__PURE__*/ _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: /*#__PURE__*/ _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" }) }) }, // ── Plan / subscription emails ───────────────────────────── { key: 'plan_activated', label: t('admin.email_template.plan_activated'), icon: /*#__PURE__*/ _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: /*#__PURE__*/ _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: t('admin.email_template.plan_upgraded'), icon: /*#__PURE__*/ _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: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 10l7-7m0 0l7 7m-7-7v18" }) }) }, { key: 'plan_downgrade_scheduled', label: t('admin.email_template.plan_downgrade_scheduled'), icon: /*#__PURE__*/ _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: /*#__PURE__*/ _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: t('admin.email_template.plan_downgrade_applied'), icon: /*#__PURE__*/ _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: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19 14l-7 7m0 0l-7-7m7 7V3" }) }) }, { key: 'plan_renewal_reminder', label: t('admin.email_template.plan_renewal_reminder'), icon: /*#__PURE__*/ _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: /*#__PURE__*/ _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: t('admin.email_template.plan_insufficient_funds'), icon: /*#__PURE__*/ _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: /*#__PURE__*/ _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((param)=>{ let { key, label, icon } = param; const localeKey = "".concat(key, "_").concat(templateLocale); var _notifTemplates_localeKey, _ref; const tmpl = (_ref = (_notifTemplates_localeKey = notifTemplates[localeKey]) !== null && _notifTemplates_localeKey !== void 0 ? _notifTemplates_localeKey : notifTemplates[key]) !== null && _ref !== void 0 ? _ref : { subject: '', body: '' }; const isEditing = editingTemplate === key; var _TEMPLATE_VARS_key; const templateVars = (_TEMPLATE_VARS_key = TEMPLATE_VARS[key]) !== null && _TEMPLATE_VARS_key !== void 0 ? _TEMPLATE_VARS_key : []; return /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 overflow-hidden", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 px-5 py-4 cursor-pointer hover:bg-gray-50 select-none", onClick: ()=>setEditingTemplate(isEditing ? null : key), children: [ /*#__PURE__*/ _jsx("span", { className: "text-xl shrink-0", children: icon }), /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ _jsx("div", { className: "font-medium text-gray-800 text-sm", children: label }), tmpl.subject ? /*#__PURE__*/ _jsxs("div", { className: "text-xs text-gray-400 mt-0.5 truncate", children: [ t('admin.notif.tmpl.subject_label'), ": ", tmpl.subject ] }) : /*#__PURE__*/ _jsx("div", { className: "text-xs text-gray-300 mt-0.5 italic", children: t('admin.notif.tmpl.not_set') }) ] }), /*#__PURE__*/ _jsx("span", { className: "text-gray-400 transition-transform ".concat(isEditing ? 'rotate-90' : ''), children: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("polyline", { points: "9 18 15 12 9 6" }) }) }) ] }), isEditing && /*#__PURE__*/ _jsxs("div", { className: "px-5 pb-5 border-t border-gray-100 pt-4 space-y-3", children: [ /*#__PURE__*/ _jsx("div", { className: "flex gap-1 pb-2", children: [ 'el', 'en', 'uk', 'ru' ].map((loc)=>/*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setTemplateLocale(loc), className: "px-3 py-1 text-xs font-medium rounded-md transition-colors ".concat(templateLocale === loc ? 'bg-green-600 text-white' : 'bg-gray-100 text-gray-600 hover:bg-gray-200'), children: loc === 'el' ? 'ΕλληΜικά' : loc === 'en' ? 'English' : loc === 'uk' ? 'УкраїМська' : 'РусскОй' }, loc)) }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.notif.tmpl.subject_label') }), /*#__PURE__*/ _jsx("input", { value: tmpl.subject, onChange: (e)=>setNotifTemplates((prev)=>{ var _prev_localeKey; return { ...prev, [localeKey]: { ...(_prev_localeKey = prev[localeKey]) !== null && _prev_localeKey !== void 0 ? _prev_localeKey : { subject: '', body: '' }, subject: e.target.value } }; }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.notif.tmpl.body_label') }), /*#__PURE__*/ _jsx("textarea", { rows: 7, value: tmpl.body, onChange: (e)=>setNotifTemplates((prev)=>{ var _prev_localeKey; return { ...prev, [localeKey]: { ...(_prev_localeKey = prev[localeKey]) !== null && _prev_localeKey !== void 0 ? _prev_localeKey : { subject: '', body: '' }, body: e.target.value } }; }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 font-mono resize-y", placeholder: "

УважаеЌый {{userName}},

..." }) ] }), templateVars.length > 0 && /*#__PURE__*/ _jsxs("div", { className: "rounded-lg border border-amber-200 bg-amber-50 px-3 py-2", children: [ /*#__PURE__*/ _jsx("div", { className: "text-xs font-medium text-amber-800 mb-1", children: t('admin.notif.vars_hint') }), /*#__PURE__*/ _jsx("div", { className: "flex flex-wrap gap-1.5", children: templateVars.map((name)=>{ const variable = "{{".concat(name, "}}"); return /*#__PURE__*/ _jsx("code", { className: "bg-amber-100 text-amber-900 px-1.5 py-0.5 rounded text-xs font-mono", children: variable }, variable); }) }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-2 flex-wrap", children: [ /*#__PURE__*/ _jsx("button", { onClick: ()=>saveTemplate(key), disabled: templateSaving || templateTranslating, className: "px-4 py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700 disabled:opacity-50", children: templateSaving ? t('admin.notif.tmpl.saving') : t('admin.notif.tmpl.save') }), /*#__PURE__*/ _jsxs("button", { onClick: ()=>autoTranslateTemplate(key), disabled: templateSaving || templateTranslating, 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: [ /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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" }) }), templateTranslating ? t('admin.notif.tmpl.translating') : t('admin.notif.tmpl.translate') ] }), /*#__PURE__*/ _jsx("button", { onClick: ()=>setEditingTemplate(null), className: "px-4 py-2 bg-gray-100 text-gray-700 rounded-lg text-sm font-medium hover:bg-gray-200", children: t('admin.notif.tmpl.close') }) ] }) ] }) ] }, key); }) ] }), settingsTab === 'referral' && /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6 max-w-lg space-y-5", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-gray-800", children: t('admin.settings.referral.title') }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-400 mt-1", children: t('admin.settings.referral.hint') }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "text-sm font-medium text-gray-700", children: t('admin.settings.referral.enabled_label') }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400", children: t('admin.settings.referral.enabled_hint') }) ] }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setReferralForm((f)=>({ ...f, enabled: !f.enabled })), className: "relative w-10 h-6 rounded-full p-0 transition-colors cursor-pointer ".concat(referralForm.enabled ? 'bg-green-600' : 'bg-gray-300'), children: /*#__PURE__*/ _jsx("span", { className: "absolute left-0 top-1 w-4 h-4 bg-white rounded-full shadow transition-transform ".concat(referralForm.enabled ? 'translate-x-5' : 'translate-x-1') }) }) ] }), /*#__PURE__*/ _jsxs("div", { className: "border border-gray-100 rounded-lg p-4 space-y-4", children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs font-semibold text-gray-500 uppercase tracking-wide", children: t('admin.settings.referral.shared_section') }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.referral.plan_label') }), /*#__PURE__*/ _jsxs("select", { value: referralForm.planId, onChange: (e)=>setReferralForm((f)=>({ ...f, planId: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400", children: [ /*#__PURE__*/ _jsx("option", { value: "", children: t('admin.settings.referral.no_plan') }), planRows.map((p)=>/*#__PURE__*/ _jsx("option", { value: p.id, children: p.name }, p.id)) ] }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-1", children: t('admin.settings.referral.plan_hint') }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.referral.days_label') }), /*#__PURE__*/ _jsx("input", { type: "number", min: "1", max: "365", value: referralForm.days, onChange: (e)=>setReferralForm((f)=>({ ...f, days: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-1", children: t('admin.settings.referral.days_hint') }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3", children: [ /*#__PURE__*/ _jsx("button", { onClick: saveReferralSettings, disabled: referralSaving, className: "px-5 py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700 disabled:opacity-50", children: referralSaving ? t('admin.settings.saving') : t('common.save') }), referralSaved && /*#__PURE__*/ _jsx("span", { className: "text-sm text-green-600", children: t('admin.settings.saved') }) ] }) ] }), settingsTab === 'socials' && /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6 max-w-lg space-y-5", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-gray-800 mb-1", children: t('admin.settings.socials.title') }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400", children: t('admin.settings.socials.hint') }) ] }), [ { key: 'telegram', label: 'Telegram', placeholder: 'https://t.me/yourname', icon: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", viewBox: "0 0 24 24", fill: "currentColor", children: /*#__PURE__*/ _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: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", viewBox: "0 0 24 24", fill: "currentColor", children: /*#__PURE__*/ _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: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", viewBox: "0 0 24 24", fill: "currentColor", children: /*#__PURE__*/ _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: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", viewBox: "0 0 24 24", fill: "currentColor", children: /*#__PURE__*/ _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: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", viewBox: "0 0 24 24", fill: "currentColor", children: /*#__PURE__*/ _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: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", viewBox: "0 0 24 24", fill: "currentColor", children: /*#__PURE__*/ _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: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", viewBox: "0 0 24 24", fill: "currentColor", children: /*#__PURE__*/ _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: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", viewBox: "0 0 24 24", fill: "currentColor", children: /*#__PURE__*/ _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((param)=>{ let { key, label, placeholder, icon } = param; return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("label", { className: "block text-sm font-medium text-gray-700 mb-1 flex items-center gap-2", children: [ /*#__PURE__*/ _jsx("span", { className: "".concat(socialForm[key] ? 'text-green-600' : 'text-gray-300'), children: icon }), label, !socialForm[key] && /*#__PURE__*/ _jsx("span", { className: "text-xs font-normal text-gray-400 ml-auto", children: "Ме запПлМеМП" }) ] }), /*#__PURE__*/ _jsx("input", { type: "url", value: socialForm[key], onChange: (e)=>setSocialForm((f)=>({ ...f, [key]: e.target.value })), placeholder: placeholder, className: "w-full border rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 ".concat(socialForm[key] ? 'border-green-300 bg-green-50/30' : 'border-gray-300') }) ] }, key); }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 pt-2", children: [ /*#__PURE__*/ _jsx("button", { onClick: saveSocialSettings, disabled: socialSaving, className: "px-5 py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700 disabled:opacity-50", children: socialSaving ? t('admin.settings.saving') : t('common.save') }), socialSaved && /*#__PURE__*/ _jsx("span", { className: "text-sm text-green-600", children: t('admin.settings.saved') }) ] }) ] }), settingsTab === 'seo' && /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6 max-w-lg space-y-6", children: [ /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-gray-800", children: t('admin.settings.seo.title') }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "text-sm font-medium text-gray-700", children: t('admin.settings.seo.maintenance_label') }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-0.5", children: t('admin.settings.seo.maintenance_hint') }) ] }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setSeoForm((f)=>({ ...f, maintenanceMode: !f.maintenanceMode })), className: "relative w-10 h-6 rounded-full p-0 transition-colors cursor-pointer flex-shrink-0 ".concat(seoForm.maintenanceMode ? 'bg-red-500' : 'bg-gray-300'), children: /*#__PURE__*/ _jsx("span", { className: "absolute left-0 top-1 w-4 h-4 bg-white rounded-full shadow transition-transform ".concat(seoForm.maintenanceMode ? 'translate-x-5' : 'translate-x-1') }) }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "text-sm font-medium text-gray-700", children: t('admin.settings.seo.indexing_label') }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-0.5", children: t('admin.settings.seo.indexing_hint') }) ] }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setSeoForm((f)=>({ ...f, indexingEnabled: !f.indexingEnabled })), className: "relative w-10 h-6 rounded-full p-0 transition-colors cursor-pointer flex-shrink-0 ".concat(seoForm.indexingEnabled ? 'bg-green-600' : 'bg-gray-300'), children: /*#__PURE__*/ _jsx("span", { className: "absolute left-0 top-1 w-4 h-4 bg-white rounded-full shadow transition-transform ".concat(seoForm.indexingEnabled ? 'translate-x-5' : 'translate-x-1') }) }) ] }), /*#__PURE__*/ _jsx("div", { className: "space-y-4", children: /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("p", { className: "text-sm font-medium text-gray-700 mb-2", children: [ t('admin.settings.seo.site_title_label'), " / ", t('admin.settings.seo.site_description_label') ] }), /*#__PURE__*/ _jsx("div", { className: "flex gap-1 mb-3", children: [ { code: 'el', flag: '🇬🇷', label: 'EL' }, { code: 'en', flag: '🇬🇧', label: 'EN' }, { code: 'ru', flag: '🇷🇺', label: 'RU' }, { code: 'uk', flag: '🇺🇊', label: 'UK' } ].map((param)=>{ let { code, flag, label } = param; return /*#__PURE__*/ _jsxs("button", { type: "button", onClick: ()=>setSeoLangTab(code), className: "flex items-center gap-1 px-3 py-1.5 rounded-lg text-sm font-medium transition-colors ".concat(seoLangTab === code ? 'bg-green-600 text-white' : 'bg-gray-100 text-gray-600 hover:bg-gray-200'), children: [ flag, " ", label ] }, code); }) }), /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-500 mb-1", children: t('admin.settings.seo.site_title_label') }), /*#__PURE__*/ _jsx("input", { value: seoForm["siteTitle".concat(seoLangTab.charAt(0).toUpperCase() + seoLangTab.slice(1))], onChange: (e)=>setSeoForm((f)=>({ ...f, ["siteTitle".concat(seoLangTab.charAt(0).toUpperCase() + seoLangTab.slice(1))]: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 mb-3", placeholder: seoLangTab === 'el' ? 'CanHelp — ΚάΞε άΜΞρωπος έχει κάτι Μα προσφέρει' : seoLangTab === 'en' ? 'CanHelp — Everyone has something valuable to offer' : seoLangTab === 'ru' ? 'CanHelp — КажЎый челПвек ЌПжет чеЌ-тП пПЌПчь' : 'CanHelp — КПжеМ Ќає МавОчку, яка ЌПже ЎПпПЌПгтО іМшПЌу' }), /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-500 mb-1", children: t('admin.settings.seo.site_description_label') }), /*#__PURE__*/ _jsx("textarea", { rows: 3, value: seoForm["siteDescription".concat(seoLangTab.charAt(0).toUpperCase() + seoLangTab.slice(1))], onChange: (e)=>setSeoForm((f)=>({ ...f, ["siteDescription".concat(seoLangTab.charAt(0).toUpperCase() + seoLangTab.slice(1))]: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 resize-none", placeholder: seoLangTab === 'el' ? 'Η ελληΜική πλατφόρΌα για online αΜάΞεση εργασιώΜ...' : seoLangTab === 'en' ? 'The Greek platform for online task delegation...' : seoLangTab === 'ru' ? 'Греческая платфПрЌа Ўля ПМлайМ-пПОска спецОалОстПв...' : 'Грецька платфПрЌа Ўля пПшуку фахівців ПМлайМ...' }) ] }) }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.seo.head_scripts_label') }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mb-2", children: t('admin.settings.seo.head_scripts_hint') }), /*#__PURE__*/ _jsx("textarea", { rows: 6, value: seoForm.headScripts, onChange: (e)=>setSeoForm((f)=>({ ...f, headScripts: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm font-mono focus:outline-none focus:ring-2 focus:ring-blue-400 resize-y", placeholder: '\n', spellCheck: false }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3", children: [ /*#__PURE__*/ _jsx("button", { onClick: saveSeoSettings, disabled: seoSaving, className: "px-5 py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700 disabled:opacity-50", children: seoSaving ? t('admin.settings.saving') : t('common.save') }), seoSaved && /*#__PURE__*/ _jsx("span", { className: "text-sm text-green-600", children: t('admin.settings.saved') }) ] }) ] }), settingsTab === 'telegram' && /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6 max-w-lg space-y-6", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-gray-800 mb-1", children: t('admin.settings.telegram.title') }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400", children: t('admin.settings.telegram.help') }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.telegram.bot_token') }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-2", children: [ /*#__PURE__*/ _jsx("input", { type: "text", value: telegramForm.botToken, onChange: (e)=>{ setTelegramForm((f)=>({ ...f, botToken: e.target.value })); setVerifyResultTelegramToken(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" }), /*#__PURE__*/ _jsx("button", { onClick: verifyTelegramToken, disabled: verifyingTelegramToken || !telegramForm.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: verifyingTelegramToken ? '...' : t('admin.settings.telegram.verify') }) ] }), verifyResultTelegramToken && /*#__PURE__*/ _jsx("p", { className: "text-xs mt-1 font-medium ".concat(verifyResultTelegramToken.ok ? 'text-green-600' : 'text-red-500'), children: verifyResultTelegramToken.ok ? "✓ ".concat(verifyResultTelegramToken.msg) : "✗ ".concat(verifyResultTelegramToken.msg) }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.telegram.admin_chat_id') }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-2", children: [ /*#__PURE__*/ _jsx("input", { type: "text", value: telegramForm.adminChatId, onChange: (e)=>setTelegramForm((f)=>({ ...f, adminChatId: e.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" }), /*#__PURE__*/ _jsx("button", { onClick: ()=>testTelegram('admin'), disabled: testingTelegramAdmin || !telegramForm.botToken || !telegramForm.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: testingTelegramAdmin ? '...' : t('admin.settings.telegram.test') }) ] }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-1", children: t('admin.settings.telegram.admin_chat_hint') }), testResultTelegramAdmin && /*#__PURE__*/ _jsx("p", { className: "text-xs mt-1 font-medium ".concat(testResultTelegramAdmin.ok ? 'text-green-600' : 'text-red-500'), children: testResultTelegramAdmin.ok ? "✓ ".concat(testResultTelegramAdmin.msg) : "✗ ".concat(testResultTelegramAdmin.msg) }) ] }), /*#__PURE__*/ _jsxs("div", { className: "space-y-3", children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700", children: t('admin.settings.telegram.channels_title') }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 -mt-2", children: t('admin.settings.telegram.channel_hint') }), [ { locale: 'el', flag: '🇬🇷', label: 'ΕλληΜικά', field: 'channelIdEl' }, { locale: 'en', flag: '🇬🇧', label: 'English', field: 'channelIdEn' }, { locale: 'ru', flag: '🇷🇺', label: 'РусскОй', field: 'channelIdRu' }, { locale: 'uk', flag: '🇺🇊', label: 'УкраїМська', field: 'channelIdUk' } ].map((param)=>{ let { locale: loc, flag, label, field } = param; return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-1.5 mb-1", children: [ /*#__PURE__*/ _jsx("span", { className: "text-base leading-none", children: flag }), /*#__PURE__*/ _jsx("span", { className: "text-xs font-medium text-gray-600", children: label }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-2", children: [ /*#__PURE__*/ _jsx("input", { type: "text", value: telegramForm[field], onChange: (e)=>setTelegramForm((f)=>({ ...f, [field]: e.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" }), /*#__PURE__*/ _jsx("button", { onClick: ()=>testTelegram(loc), disabled: testingLocale === loc || !telegramForm.botToken || !telegramForm[field], className: "px-3 py-2 border border-gray-300 rounded-lg text-sm hover:bg-gray-50 disabled:opacity-40 flex-shrink-0", children: testingLocale === loc ? '...' : t('admin.settings.telegram.test') }) ] }), testResultChannels[loc] && /*#__PURE__*/ _jsx("p", { className: "text-xs mt-1 font-medium ".concat(testResultChannels[loc].ok ? 'text-green-600' : 'text-red-500'), children: testResultChannels[loc].ok ? "✓ ".concat(testResultChannels[loc].msg) : "✗ ".concat(testResultChannels[loc].msg) }) ] }, loc); }) ] }), /*#__PURE__*/ _jsxs("div", { className: "space-y-4", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "text-sm font-medium text-gray-700", children: t('admin.settings.telegram.notify_registrations') }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-0.5", children: t('admin.settings.telegram.notify_registrations_hint') }) ] }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setTelegramForm((f)=>({ ...f, notifyRegistrations: !f.notifyRegistrations })), className: "relative w-10 h-6 rounded-full transition-colors cursor-pointer flex-shrink-0 p-0 border-0 outline-none ".concat(telegramForm.notifyRegistrations ? 'bg-green-600' : 'bg-gray-300'), children: /*#__PURE__*/ _jsx("span", { className: "absolute top-1 left-0 w-4 h-4 bg-white rounded-full shadow transition-transform ".concat(telegramForm.notifyRegistrations ? 'translate-x-5' : 'translate-x-1') }) }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "text-sm font-medium text-gray-700", children: t('admin.settings.telegram.post_new_tasks') }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-0.5", children: t('admin.settings.telegram.post_new_tasks_hint') }) ] }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setTelegramForm((f)=>({ ...f, postNewTasks: !f.postNewTasks })), className: "relative w-10 h-6 rounded-full transition-colors cursor-pointer flex-shrink-0 p-0 border-0 outline-none ".concat(telegramForm.postNewTasks ? 'bg-green-600' : 'bg-gray-300'), children: /*#__PURE__*/ _jsx("span", { className: "absolute top-1 left-0 w-4 h-4 bg-white rounded-full shadow transition-transform ".concat(telegramForm.postNewTasks ? 'translate-x-5' : 'translate-x-1') }) }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 pt-2", children: [ /*#__PURE__*/ _jsx("button", { onClick: saveTelegramSettings, disabled: telegramSaving, className: "px-5 py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700 disabled:opacity-50", children: telegramSaving ? t('admin.settings.saving') : t('common.save') }), telegramSaved && /*#__PURE__*/ _jsx("span", { className: "text-sm text-green-600", children: t('admin.settings.saved') }) ] }) ] }) ] }), tab === 'support' && /*#__PURE__*/ _jsxs("div", { className: "space-y-4", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex flex-wrap gap-3 mb-2", children: [ /*#__PURE__*/ _jsxs("form", { className: "flex gap-2", onSubmit: (e)=>{ e.preventDefault(); setSupportQ(supportQInput); setSupportPage(1); }, children: [ /*#__PURE__*/ _jsx("input", { value: supportQInput, onChange: (e)=>setSupportQInput(e.target.value), placeholder: t('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" }), /*#__PURE__*/ _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: t('admin.search', 'Search') }), supportQ && /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>{ setSupportQInput(''); setSupportQ(''); setSupportPage(1); }, className: "text-sm text-gray-500 hover:text-gray-700 px-2", children: "✕" }) ] }), /*#__PURE__*/ _jsxs("select", { value: supportStatus, onChange: (e)=>{ setSupportStatus(e.target.value); setSupportPage(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: [ /*#__PURE__*/ _jsx("option", { value: "", children: t('admin.support.all_statuses', 'All statuses') }), /*#__PURE__*/ _jsx("option", { value: "open", children: t('admin.support.status.open', 'Open') }), /*#__PURE__*/ _jsx("option", { value: "in_progress", children: t('admin.support.status.in_progress', 'In progress') }), /*#__PURE__*/ _jsx("option", { value: "resolved", children: t('admin.support.status.resolved', 'Resolved') }), /*#__PURE__*/ _jsx("option", { value: "closed", children: t('admin.support.status.closed', 'Closed') }) ] }), /*#__PURE__*/ _jsxs("select", { value: supportType, onChange: (e)=>{ setSupportType(e.target.value); setSupportPage(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: [ /*#__PURE__*/ _jsx("option", { value: "", children: t('admin.support.all_types', 'All types') }), /*#__PURE__*/ _jsxs("option", { value: "bug", children: [ "\uD83D\uDC1B ", t('support.type.bug', 'Bug') ] }), /*#__PURE__*/ _jsxs("option", { value: "suggestion", children: [ "\uD83D\uDCA1 ", t('support.type.suggestion', 'Suggestion') ] }), /*#__PURE__*/ _jsxs("option", { value: "other", children: [ "\uD83D\uDCAC ", t('support.type.other', 'Other') ] }) ] }), /*#__PURE__*/ _jsxs("span", { className: "ml-auto text-sm text-gray-400 self-center", children: [ supportTotal, " ", t('admin.pagination.total', 'total') ] }) ] }), loading ? /*#__PURE__*/ _jsx("div", { className: "text-center py-10 text-gray-400", children: t('common.loading') }) : supportTickets.length === 0 ? /*#__PURE__*/ _jsx("div", { className: "text-center py-10 text-gray-400", children: t('admin.support.none', 'No tickets') }) : supportTickets.map((ticket)=>{ const typeColors = { bug: 'bg-red-100 text-red-700', suggestion: 'bg-green-100 text-green-700', other: 'bg-gray-100 text-gray-600' }; const statusColors2 = { 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' }; const typeIcons = { bug: '🐛', suggestion: '💡', other: '💬' }; const isReplying = supportReplyId === ticket.id; var _typeColors_ticket_type, _statusColors2_ticket_status; return /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-5", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-start justify-between gap-4 mb-3", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 flex-wrap mb-1", children: [ /*#__PURE__*/ _jsxs("span", { className: "px-2 py-0.5 rounded-full text-xs font-medium ".concat((_typeColors_ticket_type = typeColors[ticket.type]) !== null && _typeColors_ticket_type !== void 0 ? _typeColors_ticket_type : 'bg-gray-100 text-gray-600'), children: [ typeIcons[ticket.type], " ", ticket.type ] }), /*#__PURE__*/ _jsx("span", { className: "px-2 py-0.5 rounded-full text-xs font-medium ".concat((_statusColors2_ticket_status = statusColors2[ticket.status]) !== null && _statusColors2_ticket_status !== void 0 ? _statusColors2_ticket_status : 'bg-gray-100 text-gray-500'), children: ticket.status }), /*#__PURE__*/ _jsxs("span", { className: "text-xs text-gray-400", children: [ "#", ticket.id.slice(0, 8) ] }) ] }), /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-gray-900 text-sm", children: ticket.subject }), ticket.userName && /*#__PURE__*/ _jsxs("p", { className: "text-xs text-gray-400 mt-0.5", children: [ ticket.userName, " \xb7 ", ticket.userEmail ] }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-0.5", children: new Date(ticket.createdAt).toLocaleString(dateLocale) }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-2 flex-shrink-0", children: [ ticket.status !== 'closed' && /*#__PURE__*/ _jsx("button", { onClick: ()=>{ setSupportReplyId(isReplying ? null : ticket.id); setSupportReplyText(ticket.adminReply || ''); }, className: "text-xs px-3 py-1.5 rounded-lg font-medium bg-green-50 text-green-700 hover:bg-green-100", children: isReplying ? t('admin.support.cancel', 'Cancel') : t('admin.support.reply', 'Reply') }), ticket.status === 'open' && /*#__PURE__*/ _jsx("button", { onClick: ()=>api.setSupportTicketStatus(ticket.id, 'closed').then(()=>setSupportTickets((prev)=>prev.map((t)=>t.id === ticket.id ? { ...t, status: 'closed' } : t))), className: "text-xs px-3 py-1.5 rounded-lg font-medium bg-gray-100 text-gray-600 hover:bg-gray-200", children: t('admin.support.close', 'Close') }) ] }) ] }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-700 whitespace-pre-wrap bg-gray-50 rounded-lg p-3 mb-3", children: ticket.body }), ticket.adminReply && !isReplying && /*#__PURE__*/ _jsxs("div", { className: "bg-green-50 border border-green-100 rounded-lg p-3 mb-2", children: [ /*#__PURE__*/ _jsxs("p", { className: "text-xs font-medium text-green-600 mb-1", children: [ t('admin.support.your_reply', 'Your reply'), ":" ] }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-800 whitespace-pre-wrap", children: ticket.adminReply }) ] }), isReplying && /*#__PURE__*/ _jsxs("div", { className: "space-y-2 mt-2", children: [ /*#__PURE__*/ _jsx("textarea", { rows: 3, value: supportReplyText, onChange: (e)=>setSupportReplyText(e.target.value), placeholder: t('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" }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-2 items-center", children: [ /*#__PURE__*/ _jsxs("select", { id: "status-".concat(ticket.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: [ /*#__PURE__*/ _jsx("option", { value: "open", children: t('admin.support.status.open', 'Open') }), /*#__PURE__*/ _jsx("option", { value: "in_progress", children: t('admin.support.status.in_progress', 'In progress') }), /*#__PURE__*/ _jsx("option", { value: "resolved", children: t('admin.support.status.resolved', 'Resolved') }), /*#__PURE__*/ _jsx("option", { value: "closed", children: t('admin.support.status.closed', 'Closed') }) ] }), /*#__PURE__*/ _jsx("button", { disabled: supportReplySaving || !supportReplyText.trim(), onClick: async ()=>{ const statusEl = document.getElementById("status-".concat(ticket.id)); setSupportReplySaving(true); try { const updated = await api.replyToSupportTicket(ticket.id, { adminReply: supportReplyText, status: statusEl === null || statusEl === void 0 ? void 0 : statusEl.value }); setSupportTickets((prev)=>prev.map((t)=>t.id === ticket.id ? { ...t, ...updated } : t)); setSupportReplyId(null); } catch (e) {} finally{ setSupportReplySaving(false); } }, 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: supportReplySaving ? '...' : t('admin.support.send_reply', 'Send') }) ] }) ] }) ] }, ticket.id); }), /*#__PURE__*/ _jsx(Pagination, { page: supportPage, total: supportTotal, limit: 30, onChange: setSupportPage, totalLabel: t('admin.pagination.total') }) ] }), tab === 'push' && /*#__PURE__*/ _jsxs("div", { className: "space-y-4", children: [ /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-5 space-y-4", children: [ /*#__PURE__*/ _jsx("h2", { className: "text-lg font-semibold text-gray-800", children: "Push-рассылка" }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-2", children: [ /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setPushMode('broadcast'), className: "px-3 py-1.5 text-sm rounded-lg border ".concat(pushMode === 'broadcast' ? 'bg-green-600 text-white border-green-600' : 'bg-white text-gray-700 border-gray-300'), children: "ВсеЌ пПльзПвателяЌ" }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setPushMode('user'), className: "px-3 py-1.5 text-sm rounded-lg border ".concat(pushMode === 'user' ? 'bg-green-600 text-white border-green-600' : 'bg-white text-gray-700 border-gray-300'), children: "КПМкретМПЌу пПльзПвателю" }) ] }), pushMode === 'user' && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "text-sm text-gray-600 block mb-1", children: "User ID" }), /*#__PURE__*/ _jsx("input", { value: pushTargetUserId, onChange: (e)=>setPushTargetUserId(e.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" }) ] }), pushMode === 'broadcast' && /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-2 text-sm text-gray-700", children: [ /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: pushOnlyActive, onChange: (e)=>setPushOnlyActive(e.target.checked) }), "ТПлькП актОвМыЌ пПльзПвателяЌ" ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "text-sm text-gray-600 block mb-1", children: "ЗагПлПвПк" }), /*#__PURE__*/ _jsx("input", { value: pushTitle, onChange: (e)=>setPushTitle(e.target.value), placeholder: "НапрОЌер: НПвые заЎачО ряЎПЌ с ваЌО", className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "text-sm text-gray-600 block mb-1", children: "Текст" }), /*#__PURE__*/ _jsx("textarea", { rows: 3, value: pushBody, onChange: (e)=>setPushBody(e.target.value), placeholder: "КПрПткОй текст увеЎПЌлеМОя", className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 resize-none" }) ] }), /*#__PURE__*/ _jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-3", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "text-sm text-gray-600 block mb-1", children: "ТОп" }), /*#__PURE__*/ _jsx("input", { value: pushType, onChange: (e)=>setPushType(e.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" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "text-sm text-gray-600 block mb-1", children: "Reference ID (ПпцОПМальМП)" }), /*#__PURE__*/ _jsx("input", { value: pushReferenceId, onChange: (e)=>setPushReferenceId(e.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" }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3", children: [ /*#__PURE__*/ _jsx("button", { type: "button", onClick: sendAdminPush, disabled: pushSending || !pushTitle.trim() || pushMode === 'user' && !pushTargetUserId.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: pushSending ? 'Отправка...' : 'ОтправОть Push' }), pushError && /*#__PURE__*/ _jsx("span", { className: "text-sm text-red-600", children: pushError }) ] }) ] }), pushResult && /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-5", children: [ /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-gray-800 mb-3", children: "Результат" }), 'usersTotal' in pushResult ? /*#__PURE__*/ _jsxs("div", { className: "grid grid-cols-2 md:grid-cols-5 gap-3 text-sm", children: [ /*#__PURE__*/ _jsxs("div", { className: "rounded-lg bg-gray-50 border border-gray-200 px-3 py-2", children: [ /*#__PURE__*/ _jsx("div", { className: "text-gray-500", children: "ППльзПвателей" }), /*#__PURE__*/ _jsx("div", { className: "text-gray-900 font-semibold", children: pushResult.usersTotal }) ] }), /*#__PURE__*/ _jsxs("div", { className: "rounded-lg bg-gray-50 border border-gray-200 px-3 py-2", children: [ /*#__PURE__*/ _jsx("div", { className: "text-gray-500", children: "ППлучОлО" }), /*#__PURE__*/ _jsx("div", { className: "text-gray-900 font-semibold", children: pushResult.usersWithSent }) ] }), /*#__PURE__*/ _jsxs("div", { className: "rounded-lg bg-gray-50 border border-gray-200 px-3 py-2", children: [ /*#__PURE__*/ _jsx("div", { className: "text-gray-500", children: "ОтправлеМП push" }), /*#__PURE__*/ _jsx("div", { className: "text-gray-900 font-semibold", children: pushResult.pushesSent }) ] }), /*#__PURE__*/ _jsxs("div", { className: "rounded-lg bg-gray-50 border border-gray-200 px-3 py-2", children: [ /*#__PURE__*/ _jsx("div", { className: "text-gray-500", children: "НевалОЎМые тПкеМы" }), /*#__PURE__*/ _jsx("div", { className: "text-gray-900 font-semibold", children: pushResult.invalidTokens }) ] }), /*#__PURE__*/ _jsxs("div", { className: "rounded-lg bg-gray-50 border border-gray-200 px-3 py-2", children: [ /*#__PURE__*/ _jsx("div", { className: "text-gray-500", children: "ОшОбкО пП userId" }), /*#__PURE__*/ _jsx("div", { className: "text-gray-900 font-semibold", children: pushResult.failedUsers.length }) ] }) ] }) : /*#__PURE__*/ _jsxs("div", { className: "grid grid-cols-2 md:grid-cols-4 gap-3 text-sm", children: [ /*#__PURE__*/ _jsxs("div", { className: "rounded-lg bg-gray-50 border border-gray-200 px-3 py-2", children: [ /*#__PURE__*/ _jsx("div", { className: "text-gray-500", children: "User ID" }), /*#__PURE__*/ _jsx("div", { className: "text-gray-900 font-mono text-xs break-all", children: pushResult.targetUserId }) ] }), /*#__PURE__*/ _jsxs("div", { className: "rounded-lg bg-gray-50 border border-gray-200 px-3 py-2", children: [ /*#__PURE__*/ _jsx("div", { className: "text-gray-500", children: "ТПкеМПв МайЎеМП" }), /*#__PURE__*/ _jsx("div", { className: "text-gray-900 font-semibold", children: (_pushResult_tokensFound = pushResult.tokensFound) !== null && _pushResult_tokensFound !== void 0 ? _pushResult_tokensFound : 0 }) ] }), /*#__PURE__*/ _jsxs("div", { className: "rounded-lg bg-gray-50 border border-gray-200 px-3 py-2", children: [ /*#__PURE__*/ _jsx("div", { className: "text-gray-500", children: "ОтправлеМП push" }), /*#__PURE__*/ _jsx("div", { className: "text-gray-900 font-semibold", children: pushResult.sent }) ] }), /*#__PURE__*/ _jsxs("div", { className: "rounded-lg bg-gray-50 border border-gray-200 px-3 py-2", children: [ /*#__PURE__*/ _jsx("div", { className: "text-gray-500", children: "НевалОЎМые тПкеМы" }), /*#__PURE__*/ _jsx("div", { className: "text-gray-900 font-semibold", children: pushResult.invalidTokens }) ] }) ] }), 'usersTotal' in pushResult ? /*#__PURE__*/ _jsx(_Fragment, { children: ((_pushResult_usersWithoutTokens = pushResult.usersWithoutTokens) !== null && _pushResult_usersWithoutTokens !== void 0 ? _pushResult_usersWithoutTokens : 0) > 0 || ((_pushResult_usersConfigBlocked = pushResult.usersConfigBlocked) !== null && _pushResult_usersConfigBlocked !== void 0 ? _pushResult_usersConfigBlocked : 0) > 0 || ((_pushResult_usersAuthFailed = pushResult.usersAuthFailed) !== null && _pushResult_usersAuthFailed !== void 0 ? _pushResult_usersAuthFailed : 0) > 0 || ((_pushResult_usersAllFailed = pushResult.usersAllFailed) !== null && _pushResult_usersAllFailed !== void 0 ? _pushResult_usersAllFailed : 0) > 0 ? /*#__PURE__*/ _jsxs("div", { className: "mt-3 rounded-lg border border-amber-200 bg-amber-50 px-3 py-2 text-xs text-amber-900", children: [ /*#__PURE__*/ _jsxs("div", { children: [ "ДОагМПстОка: без тПкеМПв — ", (_pushResult_usersWithoutTokens1 = pushResult.usersWithoutTokens) !== null && _pushResult_usersWithoutTokens1 !== void 0 ? _pushResult_usersWithoutTokens1 : 0, ", FCM Ме МастрПеМ — ", (_pushResult_usersConfigBlocked1 = pushResult.usersConfigBlocked) !== null && _pushResult_usersConfigBlocked1 !== void 0 ? _pushResult_usersConfigBlocked1 : 0, ", ПшОбка auth FCM — ", (_pushResult_usersAuthFailed1 = pushResult.usersAuthFailed) !== null && _pushResult_usersAuthFailed1 !== void 0 ? _pushResult_usersAuthFailed1 : 0, ", FCM send failed — ", (_pushResult_usersAllFailed1 = pushResult.usersAllFailed) !== null && _pushResult_usersAllFailed1 !== void 0 ? _pushResult_usersAllFailed1 : 0 ] }), pushResult.failedReasonStats && Object.keys(pushResult.failedReasonStats).length > 0 ? /*#__PURE__*/ _jsxs("div", { className: "mt-1", children: [ "КПЎы ПшОбПк FCM: ", Object.entries(pushResult.failedReasonStats).map((param)=>{ let [key, count] = param; return "".concat(key, ": ").concat(count); }).join(', ') ] }) : null, pushResult.failedReasonSample ? /*#__PURE__*/ _jsxs("div", { className: "mt-1", children: [ "ПрОЌер ПшОбкО: ", describeFcmFailure(pushResult.failedReasonStats ? Object.keys(pushResult.failedReasonStats)[0] : null, pushResult.failedReasonSample) ] }) : null ] }) : null }) : /*#__PURE__*/ _jsx(_Fragment, { children: pushResult.reason ? /*#__PURE__*/ _jsxs("div", { className: "mt-3 rounded-lg border border-amber-200 bg-amber-50 px-3 py-2 text-xs text-amber-900", children: [ /*#__PURE__*/ _jsxs("div", { children: [ "ДОагМПстОка: ", pushResult.reason === 'no_tokens' ? 'у пПльзПвателя Мет push-тПкеМПв' : pushResult.reason === 'fcm_not_configured' ? 'FCM Ме МастрПеМ Ма API (переЌеММые FCM_*)' : pushResult.reason === 'fcm_auth_failed' ? 'ПшОбка автПрОзацОО FCM (service account)' : describeFcmFailure(pushResult.failureKey, pushResult.failureMessage) ] }), pushResult.failureKey ? /*#__PURE__*/ _jsxs("div", { className: "mt-1", children: [ "КПЎ FCM: ", pushResult.failureKey ] }) : null, pushResult.failureMessage ? /*#__PURE__*/ _jsxs("div", { className: "mt-1", children: [ "СППбщеМОе FCM: ", pushResult.failureMessage ] }) : null ] }) : null }) ] }) ] }), tab === 'backup' && /*#__PURE__*/ _jsxs("div", { className: "space-y-6", children: [ /*#__PURE__*/ _jsxs("h2", { className: "text-lg font-semibold text-gray-800 flex items-center gap-2", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5 text-green-600", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ _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" }) }), t('admin.backup.title', 'Backup') ] }), backupMsg && /*#__PURE__*/ _jsxs("div", { className: "".concat(backupMsgError ? '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: [ /*#__PURE__*/ _jsx("span", { children: backupMsg }), /*#__PURE__*/ _jsx("button", { onClick: ()=>setBackupMsg(null), className: "".concat(backupMsgError ? 'text-red-500 hover:text-red-700' : 'text-green-500 hover:text-green-700', " ml-4"), children: "\xd7" }) ] }), /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-5 flex items-center justify-between", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "font-medium text-gray-800 text-sm", children: t('admin.backup.autoBackup', 'Auto Backup') }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-500 mt-0.5", children: t('admin.backup.autoBackupDesc', 'Create a backup every day automatically') }) ] }), /*#__PURE__*/ _jsx("button", { disabled: backupAutoSaving, onClick: async ()=>{ setBackupAutoSaving(true); try { await request('/admin/backup/settings', { method: 'PUT', body: JSON.stringify({ autoEnabled: !backupAutoEnabled }) }); setBackupAutoEnabled((v)=>!v); } catch (e) {} setBackupAutoSaving(false); }, className: "relative w-11 h-6 rounded-full transition-colors ".concat(backupAutoEnabled ? 'bg-green-600' : 'bg-gray-300', " ").concat(backupAutoSaving ? 'opacity-50' : ''), children: /*#__PURE__*/ _jsx("span", { className: "absolute top-0.5 left-0.5 w-5 h-5 rounded-full bg-white shadow transition-transform ".concat(backupAutoEnabled ? 'translate-x-5' : 'translate-x-0') }) }) ] }), /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-5", children: [ /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-gray-800 text-sm mb-4", children: t('admin.backup.title', 'Database Backup') }), /*#__PURE__*/ _jsxs("div", { className: "flex flex-wrap gap-3", children: [ /*#__PURE__*/ _jsxs("button", { disabled: backupExporting, onClick: async ()=>{ setBackupExporting(true); try { const BASE = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; const res = await fetch("".concat(BASE, "/api/admin/backup/export"), { credentials: 'include' }); if (!res.ok) throw new Error('Export failed'); const blob = await res.blob(); const url = URL.createObjectURL(blob); const a = document.createElement('a'); a.href = url; a.download = "backup_".concat(new Date().toISOString().slice(0, 10), ".sql.gz"); a.click(); URL.revokeObjectURL(url); setBackupSuccess(t('admin.backup.exportSuccess', 'Export successful')); } catch (e) { setBackupError(e.message || 'Error'); } setBackupExporting(false); }, 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: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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" }) }), backupExporting ? t('admin.backup.exporting', 'Exporting...') : t('admin.backup.exportAll', 'Export Full DB') ] }), /*#__PURE__*/ _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 ".concat(backupImporting === 'full' ? 'opacity-50 pointer-events-none' : ''), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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" }) }), backupImporting === 'full' ? t('admin.backup.importing', 'Importing...') : t('admin.backup.importAll', 'Import Full DB'), /*#__PURE__*/ _jsx("input", { type: "file", accept: ".sql.gz,.gz", className: "hidden", onChange: async (e)=>{ var _e_target_files; const file = (_e_target_files = e.target.files) === null || _e_target_files === void 0 ? void 0 : _e_target_files[0]; if (!file) return; if (!window.confirm(t('admin.backup.restoreConfirm', 'Restore from this backup?'))) return; setBackupImporting('full'); try { const fd = new FormData(); fd.append('file', file); const BASE = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; const res = await fetch("".concat(BASE, "/api/admin/backup/import"), { method: 'POST', credentials: 'include', body: fd }); if (!res.ok) throw new Error('Import failed'); setBackupSuccess(t('admin.backup.importSuccess', 'Import successful')); } catch (err) { setBackupError(err.message || 'Error'); } setBackupImporting(null); e.target.value = ''; } }) ] }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-5", children: [ /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-gray-800 text-sm mb-4", children: t('admin.backup.storedBackups', 'Stored Backups') }), backupStoredFiles.length === 0 ? /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-400", children: t('admin.backup.noStoredBackups', 'No stored backups') }) : /*#__PURE__*/ _jsx("div", { className: "space-y-2", children: backupStoredFiles.map((f)=>/*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between py-2 px-3 bg-gray-50 rounded-lg border border-gray-100", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "text-sm font-medium text-gray-800", children: f.name === 'backup_today' ? t('admin.backup.today', 'Today') : t('admin.backup.yesterday', 'Yesterday') }), /*#__PURE__*/ _jsxs("p", { className: "text-xs text-gray-400", children: [ t('admin.backup.size', 'Size'), ": ", (f.size / 1024).toFixed(1), " KB \xb7 ", t('admin.backup.date', 'Date'), ": ", new Date(f.date).toLocaleString() ] }) ] }), /*#__PURE__*/ _jsx("button", { disabled: backupRestoring === f.name, onClick: async ()=>{ if (!window.confirm(t('admin.backup.restoreConfirm', 'Restore from this backup?'))) return; setBackupRestoring(f.name); try { await request('/admin/backup/restore', { method: 'POST', body: JSON.stringify({ name: f.name }) }); setBackupSuccess(t('admin.backup.restoreSuccess', 'Restore successful')); } catch (err) { setBackupError(err.message || 'Error'); } setBackupRestoring(null); }, className: "text-sm text-green-600 hover:text-gray-800 font-medium disabled:opacity-50", children: backupRestoring === f.name ? t('admin.backup.restoring', 'Restoring...') : t('admin.backup.restore', 'Restore') }) ] }, f.name)) }) ] }), /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-5", children: [ /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-gray-800 text-sm mb-4", children: t('admin.backup.tables', 'Tables') }), backupTablesLoading ? /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 text-sm text-gray-400", children: [ /*#__PURE__*/ _jsxs("svg", { className: "w-4 h-4 animate-spin", fill: "none", viewBox: "0 0 24 24", children: [ /*#__PURE__*/ _jsx("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }), /*#__PURE__*/ _jsx("path", { className: "opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8v8z" }) ] }), t('common.loading', 'Loading...') ] }) : backupTables.length === 0 ? /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-400", children: t('admin.noData', 'No data') }) : /*#__PURE__*/ _jsx("div", { className: "overflow-x-auto", children: /*#__PURE__*/ _jsx("table", { className: "w-full text-sm", children: /*#__PURE__*/ _jsx("tbody", { className: "divide-y divide-gray-100", children: backupTables.map((tbl)=>/*#__PURE__*/ _jsxs("tr", { className: "hover:bg-gray-50", children: [ /*#__PURE__*/ _jsx("td", { className: "py-2 pr-4 font-mono text-gray-700", children: tbl }), /*#__PURE__*/ _jsx("td", { className: "py-2 text-right", children: /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-end gap-2", children: [ /*#__PURE__*/ _jsx("button", { onClick: async ()=>{ try { const BASE = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; const res = await fetch("".concat(BASE, "/api/admin/backup/export/").concat(tbl), { credentials: 'include' }); if (!res.ok) throw new Error('Export failed'); const blob = await res.blob(); const url = URL.createObjectURL(blob); const a = document.createElement('a'); a.href = url; a.download = "".concat(tbl, "_").concat(new Date().toISOString().slice(0, 10), ".sql.gz"); a.click(); URL.revokeObjectURL(url); } catch (err) { setBackupError(err.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: t('admin.backup.exportTable', 'Export') }), /*#__PURE__*/ _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: [ backupImporting === tbl ? t('admin.backup.importing', 'Importing...') : t('admin.backup.importTable', 'Import'), /*#__PURE__*/ _jsx("input", { type: "file", accept: ".sql.gz,.gz", className: "hidden", onChange: async (e)=>{ var _e_target_files; const file = (_e_target_files = e.target.files) === null || _e_target_files === void 0 ? void 0 : _e_target_files[0]; if (!file) return; if (!window.confirm(t('admin.backup.restoreConfirm', 'Restore from this backup?'))) return; setBackupImporting(tbl); try { const fd = new FormData(); fd.append('file', file); const BASE = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; const res = await fetch("".concat(BASE, "/api/admin/backup/import/").concat(tbl), { method: 'POST', credentials: 'include', body: fd }); if (!res.ok) { const errData = await res.json().catch(()=>({ error: 'Import failed' })); throw new Error(errData.error || 'Import failed'); } setBackupSuccess(t('admin.backup.importSuccess', 'Import successful')); } catch (err) { setBackupError(err.message || 'Error'); } setBackupImporting(null); e.target.value = ''; } }) ] }) ] }) }) ] }, tbl)) }) }) }) ] }) ] }), tab === 'translations' && /*#__PURE__*/ _jsxs("div", { className: "space-y-6", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("h2", { className: "text-base font-semibold text-gray-900", children: "ПеревПЎы" }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-500 mt-0.5", children: "АвтПЌатОческОй перевПЎ прПпущеММых зМачеМОй пП таблОцаЌ" }) ] }), /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-4 flex flex-wrap gap-4 items-end", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: "ИстПчМОк" }), /*#__PURE__*/ _jsxs("select", { value: transFromLang, onChange: (e)=>setTransFromLang(e.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: [ /*#__PURE__*/ _jsx("option", { value: "el", children: "\uD83C\uDDEC\uD83C\uDDF7 Greek" }), /*#__PURE__*/ _jsx("option", { value: "en", children: "\uD83C\uDDEC\uD83C\uDDE7 English" }), /*#__PURE__*/ _jsx("option", { value: "ru", children: "\uD83C\uDDF7\uD83C\uDDFA Russian" }), /*#__PURE__*/ _jsx("option", { value: "uk", children: "\uD83C\uDDFA\uD83C\uDDE6 Ukrainian" }) ] }) ] }), /*#__PURE__*/ _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: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M13 7l5 5-5 5M6 12h12" }) }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: "ПеревестО Ма" }), /*#__PURE__*/ _jsxs("select", { value: transLang, onChange: (e)=>setTransLang(e.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: [ /*#__PURE__*/ _jsx("option", { value: "el", children: "\uD83C\uDDEC\uD83C\uDDF7 Greek" }), /*#__PURE__*/ _jsx("option", { value: "en", children: "\uD83C\uDDEC\uD83C\uDDE7 English" }), /*#__PURE__*/ _jsx("option", { value: "ru", children: "\uD83C\uDDF7\uD83C\uDDFA Russian" }), /*#__PURE__*/ _jsx("option", { value: "uk", children: "\uD83C\uDDFA\uD83C\uDDE6 Ukrainian" }) ] }) ] }), /*#__PURE__*/ _jsx("div", { className: "ml-auto self-end", children: /*#__PURE__*/ _jsxs("span", { className: "text-sm font-semibold text-gray-700 flex items-center gap-2", children: [ { el: '🇬🇷', en: '🇬🇧', ru: '🇷🇺', uk: '🇺🇊' }[transFromLang], " ", transFromLang.toUpperCase(), /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-gray-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M13 7l5 5-5 5M6 12h12" }) }), { el: '🇬🇷', en: '🇬🇧', ru: '🇷🇺', uk: '🇺🇊' }[transLang], " ", transLang.toUpperCase() ] }) }) ] }), transMsg && /*#__PURE__*/ _jsx("div", { className: "text-sm px-4 py-2 rounded-lg ".concat(transMsg.error ? 'bg-red-50 text-red-700' : 'bg-green-50 text-green-700'), children: transMsg.text }), transStatsLoading ? /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 text-sm text-gray-400 py-6", children: [ /*#__PURE__*/ _jsxs("svg", { className: "w-4 h-4 animate-spin", fill: "none", viewBox: "0 0 24 24", children: [ /*#__PURE__*/ _jsx("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }), /*#__PURE__*/ _jsx("path", { className: "opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8v8z" }) ] }), "Загрузка " ] }) : /*#__PURE__*/ _jsx("div", { className: "grid gap-4 sm:grid-cols-2 lg:grid-cols-3", children: (transStats !== null && transStats !== void 0 ? transStats : []).map((tbl)=>{ const isTasks = tbl.name === 'tasks'; // For tasks: total missing across all langs (tasks may miss multiple langs each) const totalMissingAllLangs = Object.values(tbl.missing).reduce((a, b)=>a + b, 0); var _tbl_missing_transLang; const missingCount = isTasks ? totalMissingAllLangs : (_tbl_missing_transLang = tbl.missing[transLang]) !== null && _tbl_missing_transLang !== void 0 ? _tbl_missing_transLang : 0; const isTranslating = !!transTableTranslating[tbl.name]; const anyTranslating = Object.values(transTableTranslating).some(Boolean); return /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-5 flex flex-col", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-start justify-between", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "font-semibold text-gray-900 text-sm", children: tbl.label }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-0.5", children: tbl.name }) ] }), /*#__PURE__*/ _jsx("span", { className: "text-xs font-semibold px-2 py-0.5 rounded-full ".concat(missingCount > 0 ? 'bg-red-100 text-red-700' : 'bg-green-100 text-green-700'), children: missingCount > 0 ? "".concat(missingCount, " missing") : 'Complete' }) ] }), /*#__PURE__*/ _jsxs("p", { className: "text-xs text-gray-500 mt-3", children: [ "ВсегП: ", tbl.total, isTasks && ' · с языка ПрОгОМала Ма все ПстальМые' ] }), /*#__PURE__*/ _jsx("div", { className: "mt-2 flex flex-wrap gap-1", children: [ 'el', 'en', 'ru', 'uk' ].map((lang)=>{ var _tbl_missing_lang; const cnt = (_tbl_missing_lang = tbl.missing[lang]) !== null && _tbl_missing_lang !== void 0 ? _tbl_missing_lang : 0; const isClickable = isTasks && cnt > 0; return /*#__PURE__*/ _jsxs("button", { type: "button", disabled: !isClickable, onClick: isClickable ? async ()=>{ setTransPreview({ lang, loading: true, rows: [] }); try { const d = await api.getTasksTranslationPreview(lang, 50); setTransPreview({ lang, loading: false, rows: d.rows }); } catch (e) { setTransPreview({ lang, loading: false, rows: [] }); } } : undefined, className: "text-xs px-2 py-0.5 rounded-full border transition ".concat(cnt > 0 ? 'border-red-200 bg-red-50 text-red-600' + (isClickable ? ' cursor-pointer hover:bg-red-100' : '') : 'border-green-200 bg-green-50 text-green-600 cursor-default'), children: [ lang, ": ", cnt > 0 ? "-".concat(cnt) : '✓' ] }, lang); }) }), /*#__PURE__*/ _jsx("div", { className: "mt-4 mt-auto pt-4", children: missingCount === 0 ? /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-1.5 text-xs text-emerald-600", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" }) }), "Все перевПЎы запПлМеМы" ] }) : /*#__PURE__*/ _jsx("button", { disabled: anyTranslating, onClick: async ()=>{ if (!isTasks && transFromLang === transLang) { setTransMsg({ text: 'ИсхПЎМый О целевПй язык сПвпаЎают', error: true }); return; } setTransTableTranslating((prev)=>({ ...prev, [tbl.name]: true })); setTransMsg(null); try { const res = isTasks ? await api.autoTranslateTasks(500) : tbl.name === 'email_templates' ? await api.autoTranslateEmailTemplates(transLang, transFromLang) : await api.autoTranslate(tbl.name, transLang, transFromLang, 500); setTransMsg({ text: "".concat(tbl.label, ": translated ").concat(res.translated, " of ").concat(res.total) + (res.failed > 0 ? " \xb7 errors: ".concat(res.failed) : ''), error: res.failed > 0 && res.translated === 0 }); api.getTranslationsStats().then((d)=>setTransStats(d.tables)).catch(()=>{}); } catch (err) { const msg = (err === null || err === void 0 ? void 0 : err.response) ? await err.response.text().catch(()=>err.message) : err.message || 'Error'; setTransMsg({ text: "Error: ".concat(msg), error: true }); } finally{ setTransTableTranslating((prev)=>{ const n = { ...prev }; delete n[tbl.name]; return n; }); } }, 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: isTranslating ? /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs("svg", { className: "w-3.5 h-3.5 animate-spin flex-shrink-0", fill: "none", viewBox: "0 0 24 24", children: [ /*#__PURE__*/ _jsx("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }), /*#__PURE__*/ _jsx("path", { className: "opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8v8z" }) ] }), "Translating..." ] }) : isTasks ? /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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 ", missingCount ] }) : /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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 ", missingCount, " \xb7 ", { el: '🇬🇷', en: '🇬🇧', ru: '🇷🇺', uk: '🇺🇊' }[transFromLang], " ", transFromLang.toUpperCase(), /*#__PURE__*/ _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: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M13 7l5 5-5 5M6 12h12" }) }), { el: '🇬🇷', en: '🇬🇧', ru: '🇷🇺', uk: '🇺🇊' }[transLang], " ", transLang.toUpperCase() ] }) }) }) ] }, tbl.name); }) }) ] }), tab === 'dbcheck' && /*#__PURE__*/ _jsx(DbCheckTab, {}), tab === 'referrals' && /*#__PURE__*/ _jsxs("div", { className: "space-y-6", children: [ /*#__PURE__*/ _jsx("div", { className: "grid grid-cols-3 gap-4", children: [ { label: 'РеферерПв', value: (_referralsData_totalReferrers = referralsData === null || referralsData === void 0 ? void 0 : referralsData.totalReferrers) !== null && _referralsData_totalReferrers !== void 0 ? _referralsData_totalReferrers : '—', color: 'text-green-600' }, { label: 'ПрОглашеМОй', value: (_referralsData_totalReferrals = referralsData === null || referralsData === void 0 ? void 0 : referralsData.totalReferrals) !== null && _referralsData_totalReferrals !== void 0 ? _referralsData_totalReferrals : '—', color: 'text-purple-600' }, { label: 'АктОвМых МаграЎ', value: (_referralsData_activeRewards = referralsData === null || referralsData === void 0 ? void 0 : referralsData.activeRewards) !== null && _referralsData_activeRewards !== void 0 ? _referralsData_activeRewards : '—', color: 'text-green-600' } ].map((param)=>{ let { label, value, color } = param; return /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-2xl border border-gray-200 p-5 text-center", children: [ /*#__PURE__*/ _jsx("div", { className: "text-3xl font-bold ".concat(color), children: value }), /*#__PURE__*/ _jsx("div", { className: "text-xs text-gray-500 mt-1", children: label }) ] }, label); }) }), /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-2xl border border-gray-200 overflow-hidden", children: [ /*#__PURE__*/ _jsxs("div", { className: "px-5 py-4 border-b border-gray-100 flex items-center justify-between", children: [ /*#__PURE__*/ _jsx("h2", { className: "font-semibold text-gray-800", children: "ДеревП рефералПв" }), /*#__PURE__*/ _jsxs("button", { onClick: ()=>{ setReferralsLoading(true); api.getAdminReferrals().then(setReferralsData).catch(()=>{}).finally(()=>setReferralsLoading(false)); }, className: "text-xs text-green-600 hover:underline flex items-center gap-1", children: [ referralsLoading && /*#__PURE__*/ _jsxs("svg", { className: "w-3 h-3 animate-spin", fill: "none", viewBox: "0 0 24 24", children: [ /*#__PURE__*/ _jsx("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }), /*#__PURE__*/ _jsx("path", { className: "opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8v8z" }) ] }), "ОбМПвОть" ] }) ] }), referralsLoading && !referralsData ? /*#__PURE__*/ _jsx("div", { className: "flex justify-center py-16", children: /*#__PURE__*/ _jsxs("svg", { className: "w-6 h-6 animate-spin text-purple-600", fill: "none", viewBox: "0 0 24 24", children: [ /*#__PURE__*/ _jsx("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }), /*#__PURE__*/ _jsx("path", { className: "opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8v8z" }) ] }) }) : !referralsData || referralsData.tree.length === 0 ? /*#__PURE__*/ _jsx("div", { className: "py-16 text-center text-sm text-gray-400", children: "Нет ЎаММых П рефералах" }) : /*#__PURE__*/ _jsx("div", { className: "divide-y divide-gray-100", children: referralsData.tree.map((node)=>{ var _node_referrer, _node_referrer1; var _node_referrer_id; const rid = (_node_referrer_id = (_node_referrer = node.referrer) === null || _node_referrer === void 0 ? void 0 : _node_referrer.id) !== null && _node_referrer_id !== void 0 ? _node_referrer_id : 'unknown'; const isExpanded = referralsExpanded.has(rid); var _node_referrer_firstName, _node_referrer_lastName; const referrerName = node.referrer ? "".concat((_node_referrer_firstName = node.referrer.firstName) !== null && _node_referrer_firstName !== void 0 ? _node_referrer_firstName : '', " ").concat((_node_referrer_lastName = node.referrer.lastName) !== null && _node_referrer_lastName !== void 0 ? _node_referrer_lastName : '').trim() || node.referrer.email : '(уЎалёМ)'; return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("button", { className: "w-full flex items-center gap-3 px-5 py-3.5 hover:bg-gray-50 text-left transition-colors", onClick: ()=>setReferralsExpanded((prev)=>{ const next = new Set(prev); next.has(rid) ? next.delete(rid) : next.add(rid); return next; }), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-gray-400 flex-shrink-0 transition-transform ".concat(isExpanded ? 'rotate-90' : ''), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 5l7 7-7 7" }) }), /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ _jsx("span", { className: "font-medium text-sm text-gray-900", children: referrerName }), node.referrer && /*#__PURE__*/ _jsx("span", { className: "ml-2 text-xs text-gray-400", children: node.referrer.email }) ] }), ((_node_referrer1 = node.referrer) === null || _node_referrer1 === void 0 ? void 0 : _node_referrer1.referralCode) && /*#__PURE__*/ _jsx("code", { className: "text-xs bg-gray-100 text-gray-600 px-2 py-0.5 rounded font-mono", children: node.referrer.referralCode }), /*#__PURE__*/ _jsxs("span", { className: "ml-3 text-xs font-semibold text-purple-700 bg-purple-50 px-2 py-0.5 rounded-full", children: [ node.referees.length, " реф." ] }) ] }), isExpanded && /*#__PURE__*/ _jsx("div", { className: "bg-gray-50 border-t border-gray-100", children: /*#__PURE__*/ _jsxs("table", { className: "w-full text-xs", children: [ /*#__PURE__*/ _jsx("thead", { children: /*#__PURE__*/ _jsxs("tr", { className: "border-b border-gray-200", children: [ /*#__PURE__*/ _jsx("th", { className: "text-left px-10 py-2 font-semibold text-gray-500", children: "ПрОглашёММый" }), /*#__PURE__*/ _jsx("th", { className: "text-left px-3 py-2 font-semibold text-gray-500", children: "Email" }), /*#__PURE__*/ _jsx("th", { className: "text-center px-3 py-2 font-semibold text-gray-500", children: "+ЎМей" }), /*#__PURE__*/ _jsx("th", { className: "text-center px-3 py-2 font-semibold text-gray-500", children: "Истекает" }), /*#__PURE__*/ _jsx("th", { className: "text-center px-3 py-2 font-semibold text-gray-500", children: "Дата" }) ] }) }), /*#__PURE__*/ _jsx("tbody", { children: node.referees.map((referee)=>{ var _referee_firstName, _referee_lastName; const refName = "".concat((_referee_firstName = referee.firstName) !== null && _referee_firstName !== void 0 ? _referee_firstName : '', " ").concat((_referee_lastName = referee.lastName) !== null && _referee_lastName !== void 0 ? _referee_lastName : '').trim() || referee.email; const expiresAt = new Date(referee.expiresAt); const createdAt = new Date(referee.createdAt); const isActive = expiresAt > new Date(); return /*#__PURE__*/ _jsxs("tr", { className: "border-b border-gray-100 last:border-0 hover:bg-white transition-colors", children: [ /*#__PURE__*/ _jsx("td", { className: "px-10 py-2.5 font-medium text-gray-800", children: refName }), /*#__PURE__*/ _jsx("td", { className: "px-3 py-2.5 text-gray-500", children: referee.email }), /*#__PURE__*/ _jsx("td", { className: "px-3 py-2.5 text-center", children: /*#__PURE__*/ _jsxs("span", { className: "font-semibold text-green-700", children: [ "+", referee.daysAdded ] }) }), /*#__PURE__*/ _jsx("td", { className: "px-3 py-2.5 text-center", children: /*#__PURE__*/ _jsx("span", { className: "px-1.5 py-0.5 rounded text-xs font-medium ".concat(isActive ? 'bg-green-100 text-green-700' : 'bg-gray-100 text-gray-500'), children: expiresAt.toLocaleDateString('ru-RU', { day: '2-digit', month: '2-digit', year: '2-digit' }) }) }), /*#__PURE__*/ _jsx("td", { className: "px-3 py-2.5 text-center text-gray-400", children: createdAt.toLocaleDateString('ru-RU', { day: '2-digit', month: '2-digit', year: '2-digit' }) }) ] }, referee.id); }) }) ] }) }) ] }, rid); }) }) ] }) ] }), transPreview && /*#__PURE__*/ _jsx("div", { className: "fixed inset-0 z-50 flex items-center justify-center bg-black/50 px-4", onClick: ()=>setTransPreview(null), children: /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-2xl shadow-xl w-full max-w-3xl max-h-[80vh] flex flex-col", onClick: (e)=>e.stopPropagation(), children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between px-6 py-4 border-b border-gray-100 flex-shrink-0", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("h3", { className: "font-semibold text-gray-900", children: [ "ЗаЎачО без перевПЎа: ", /*#__PURE__*/ _jsx("span", { className: "uppercase font-bold text-red-600", children: transPreview.lang }) ] }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-0.5", children: "ППказаМы первые 50 запОсей" }) ] }), /*#__PURE__*/ _jsx("button", { onClick: ()=>setTransPreview(null), className: "text-gray-400 hover:text-gray-600 p-1", children: /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" }) }) }) ] }), /*#__PURE__*/ _jsx("div", { className: "overflow-y-auto flex-1 px-6 py-4", children: transPreview.loading ? /*#__PURE__*/ _jsx("div", { className: "flex justify-center py-12", children: /*#__PURE__*/ _jsxs("svg", { className: "w-6 h-6 animate-spin text-purple-600", fill: "none", viewBox: "0 0 24 24", children: [ /*#__PURE__*/ _jsx("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }), /*#__PURE__*/ _jsx("path", { className: "opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8v8z" }) ] }) }) : transPreview.rows.length === 0 ? /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-500 text-center py-12", children: "Нет заЎач без перевПЎа" }) : /*#__PURE__*/ _jsxs("table", { className: "w-full text-xs border-collapse", children: [ /*#__PURE__*/ _jsx("thead", { children: /*#__PURE__*/ _jsxs("tr", { className: "border-b border-gray-200", children: [ /*#__PURE__*/ _jsx("th", { className: "text-left py-2 pr-3 font-semibold text-gray-600 w-[35%]", children: "ОрОгОМал (title)" }), /*#__PURE__*/ _jsx("th", { className: "text-center py-2 px-2 font-semibold text-gray-600", children: "orig" }), [ 'el', 'en', 'ru', 'uk' ].map((l)=>/*#__PURE__*/ _jsx("th", { className: "text-center py-2 px-2 font-semibold text-gray-600 w-[14%]", children: l }, l)) ] }) }), /*#__PURE__*/ _jsx("tbody", { children: transPreview.rows.map((row)=>/*#__PURE__*/ _jsxs("tr", { className: "border-b border-gray-100 hover:bg-gray-50", children: [ /*#__PURE__*/ _jsx("td", { className: "py-2 pr-3 text-gray-800 truncate max-w-[200px]", title: row.title, children: row.title }), /*#__PURE__*/ _jsx("td", { className: "py-2 px-2 text-center", children: /*#__PURE__*/ _jsx("span", { className: "uppercase font-semibold text-purple-700 bg-purple-50 px-1.5 py-0.5 rounded", children: row.originalLocale }) }), [ [ 'el', row.titleEl ], [ 'en', row.titleEn ], [ 'ru', row.titleRu ], [ 'uk', row.titleUk ] ].map((param)=>{ let [l, val] = param; return /*#__PURE__*/ _jsx("td", { className: "py-2 px-2 text-center", title: val !== null && val !== void 0 ? val : '', children: val ? /*#__PURE__*/ _jsx("span", { className: "text-emerald-600 font-semibold", children: "✓" }) : /*#__PURE__*/ _jsx("span", { className: "text-red-500 font-semibold", children: "✗" }) }, l); }) ] }, row.id)) }) ] }) }) ] }) }), editUser && /*#__PURE__*/ _jsx("div", { className: "fixed inset-0 z-50 flex items-center justify-center bg-black/50 px-4", children: /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-2xl shadow-xl w-full max-w-4xl max-h-[90vh] flex flex-col", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between px-6 py-4 border-b border-gray-100 flex-shrink-0", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("h2", { className: "text-base font-semibold text-gray-900", children: t('admin.user_edit.title') }), /*#__PURE__*/ _jsxs("p", { className: "text-xs text-gray-400 mt-0.5", children: [ editUser.email, " \xb7 ID: ", editUser.id ] }) ] }), /*#__PURE__*/ _jsx("button", { onClick: ()=>setEditUser(null), className: "text-gray-400 hover:text-gray-600 text-2xl leading-none", children: "\xd7" }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex flex-1 min-h-0", children: [ /*#__PURE__*/ _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: t('admin.user_edit.tab.profile') }, { id: 'account', label: t('admin.user_edit.tab.account') }, { id: 'balance', label: t('admin.user_edit.tab.balance') }, { id: 'settings', label: t('admin.user_edit.tab.settings') }, { id: 'site', label: t('admin.user_edit.tab.site') }, { id: 'specialist', label: t('admin.user_edit.tab.specialist') } ].map((item)=>/*#__PURE__*/ _jsx("button", { onClick: ()=>{ setEditUserTab(item.id); if (item.id === 'specialist' && editUser) { setEditUserCardsLoading(true); const loadCards = api.getAdminUserSpecialistCards(editUser.id).then(setEditUserCards).catch(()=>{}); const loadCats = catRows.length === 0 ? api.getAdminCategories().then(setCatRows).catch(()=>{}) : Promise.resolve(); const loadLocs = locRows.length === 0 ? api.getAdminLocations().then(setLocRows).catch(()=>{}) : Promise.resolve(); Promise.all([ loadCards, loadCats, loadLocs ]).finally(()=>setEditUserCardsLoading(false)); } }, className: "w-full text-left px-3 py-2.5 text-sm rounded-lg transition-colors ".concat(editUserTab === item.id ? 'bg-green-50 text-green-700 font-medium' : 'text-gray-600 hover:bg-gray-50'), children: item.label }, item.id)) }), /*#__PURE__*/ _jsxs("div", { className: "flex-1 overflow-y-auto p-6", children: [ editUserTab === 'profile' && /*#__PURE__*/ _jsxs("div", { className: "space-y-4", children: [ /*#__PURE__*/ _jsxs("div", { className: "p-3 bg-gray-50 rounded-lg text-xs text-gray-500 space-y-0.5", children: [ /*#__PURE__*/ _jsxs("p", { children: [ /*#__PURE__*/ _jsxs("span", { className: "font-medium", children: [ t('admin.user_edit.registered'), ":" ] }), " ", new Date(editUser.createdAt).toLocaleDateString(dateLocale) ] }), editUser.lastSeenAt && /*#__PURE__*/ _jsxs("p", { children: [ /*#__PURE__*/ _jsxs("span", { className: "font-medium", children: [ t('admin.user_edit.last_seen'), ":" ] }), " ", new Date(editUser.lastSeenAt).toLocaleDateString(dateLocale) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "grid grid-cols-2 gap-3", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.user_edit.first_name') }), /*#__PURE__*/ _jsx("input", { value: (_editUser_firstName = editUser.firstName) !== null && _editUser_firstName !== void 0 ? _editUser_firstName : '', onChange: (e)=>setEditUser((u)=>({ ...u, firstName: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.user_edit.last_name') }), /*#__PURE__*/ _jsx("input", { value: (_editUser_lastName = editUser.lastName) !== null && _editUser_lastName !== void 0 ? _editUser_lastName : '', onChange: (e)=>setEditUser((u)=>({ ...u, lastName: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.user_edit.phone') }), /*#__PURE__*/ _jsx("input", { value: (_editUser_phone = editUser.phone) !== null && _editUser_phone !== void 0 ? _editUser_phone : '', onChange: (e)=>setEditUser((u)=>({ ...u, phone: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.user_edit.bio') }), /*#__PURE__*/ _jsx("textarea", { value: (_editUser_bio = editUser.bio) !== null && _editUser_bio !== void 0 ? _editUser_bio : '', onChange: (e)=>setEditUser((u)=>({ ...u, bio: e.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" }) ] }) ] }), editUserTab === 'account' && /*#__PURE__*/ _jsxs("div", { className: "space-y-4", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.user_edit.email') }), /*#__PURE__*/ _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: editUser.email }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between rounded-lg border px-3 py-2 bg-gray-50", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2", children: [ editUser.emailVerified ? /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-green-500 shrink-0", viewBox: "0 0 20 20", fill: "currentColor", children: /*#__PURE__*/ _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" }) }) : /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-red-400 shrink-0", viewBox: "0 0 20 20", fill: "currentColor", children: /*#__PURE__*/ _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" }) }), /*#__PURE__*/ _jsx("span", { className: "text-sm font-medium ".concat(editUser.emailVerified ? 'text-green-700' : 'text-red-600'), children: editUser.emailVerified ? t('admin.user_edit.email_verified') : t('admin.user_edit.email_not_verified') }) ] }), !editUser.emailVerified && /*#__PURE__*/ _jsx("button", { onClick: verifyEmail, disabled: verifyingEmail, className: "text-xs px-3 py-1 rounded-md bg-green-600 text-white hover:bg-green-700 disabled:opacity-50 transition-colors", children: verifyingEmail ? '...' : t('admin.user_edit.verify_email_btn') }) ] }), /*#__PURE__*/ _jsxs("div", { className: "grid grid-cols-2 gap-3", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.user_edit.role') }), /*#__PURE__*/ _jsxs("select", { value: editUser.role, onChange: (e)=>setEditUser((u)=>({ ...u, role: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm", children: [ /*#__PURE__*/ _jsx("option", { value: "user", children: t('admin.user_edit.role.user') }), /*#__PURE__*/ _jsx("option", { value: "admin", children: t('admin.user_edit.role.admin') }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.user_edit.plan') }), /*#__PURE__*/ _jsxs("select", { value: (_editUser_planId = editUser.planId) !== null && _editUser_planId !== void 0 ? _editUser_planId : '', onChange: (e)=>setEditUser((u)=>({ ...u, planId: e.target.value || null })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm", children: [ /*#__PURE__*/ _jsx("option", { value: "", children: t('admin.user_edit.no_plan') }), planRows.map((p)=>/*#__PURE__*/ _jsx("option", { value: p.id, children: p.name }, p.id)) ] }) ] }) ] }), editUser.planExpiresAt && /*#__PURE__*/ _jsxs("p", { className: "text-xs text-gray-500", children: [ t('admin.user_edit.plan_expires'), ": ", new Date(editUser.planExpiresAt).toLocaleDateString(dateLocale) ] }), /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-2 cursor-pointer", children: [ /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: editUser.isActive !== false, onChange: (e)=>setEditUser((u)=>({ ...u, isActive: e.target.checked })), className: "w-4 h-4 rounded border-gray-300 text-green-600" }), /*#__PURE__*/ _jsx("span", { className: "text-sm text-gray-700", children: t('admin.user_edit.active') }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.user_edit.interface_lang') }), /*#__PURE__*/ _jsxs("select", { value: (_editUser_locale = editUser.locale) !== null && _editUser_locale !== void 0 ? _editUser_locale : 'el', onChange: (e)=>setEditUser((u)=>({ ...u, locale: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm", children: [ /*#__PURE__*/ _jsx("option", { value: "el", children: "ΕλληΜικά" }), /*#__PURE__*/ _jsx("option", { value: "en", children: "English" }), /*#__PURE__*/ _jsx("option", { value: "ru", children: "РусскОй" }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: t('admin.user_edit.comm_languages') }), /*#__PURE__*/ _jsx("div", { className: "flex gap-5", children: [ 'el', 'en', 'uk', 'ru' ].map((lang)=>{ var _editUser_languages; return /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-1.5 cursor-pointer", children: [ /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: ((_editUser_languages = editUser.languages) !== null && _editUser_languages !== void 0 ? _editUser_languages : []).includes(lang), onChange: (e)=>{ var _editUser_languages; const langs = (_editUser_languages = editUser.languages) !== null && _editUser_languages !== void 0 ? _editUser_languages : []; setEditUser((u)=>({ ...u, languages: e.target.checked ? [ ...langs.filter((l)=>l !== lang), lang ] : langs.filter((l)=>l !== lang) })); }, className: "w-4 h-4 rounded border-gray-300 text-green-600" }), /*#__PURE__*/ _jsx("span", { className: "text-sm text-gray-700", children: lang === 'el' ? 'ΕλληΜικά' : lang === 'en' ? 'English' : lang === 'uk' ? 'УкраїМська' : 'РусскОй' }) ] }, lang); }) }) ] }) ] }), editUserTab === 'balance' && /*#__PURE__*/ _jsxs("div", { className: "space-y-6", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between p-5 bg-gray-50 rounded-xl border border-gray-200", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("div", { className: "text-xs text-gray-500 mb-1", children: t('admin.user_edit.balance') }), /*#__PURE__*/ _jsxs("div", { className: "text-2xl font-bold text-gray-900", children: [ Number((_editUser_balance = editUser.balance) !== null && _editUser_balance !== void 0 ? _editUser_balance : 0).toFixed(2), " EUR" ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-2", children: [ /*#__PURE__*/ _jsxs("button", { onClick: ()=>setBalanceModal('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: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M12 4v16m8-8H4" }) }), t('admin.balance.topup.btn') ] }), /*#__PURE__*/ _jsxs("button", { onClick: ()=>setBalanceModal('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: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M20 12H4" }) }), t('admin.balance.withdraw.btn') ] }) ] }) ] }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-center text-gray-400", children: t('admin.balance.modal_hint') }) ] }), editUserTab === 'settings' && /*#__PURE__*/ _jsx("div", { className: "space-y-4", children: /*#__PURE__*/ _jsxs("div", { className: "space-y-3 pt-1 divide-y divide-gray-100", children: [ /*#__PURE__*/ _jsxs("label", { className: "flex items-center justify-between cursor-pointer py-2", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("div", { className: "text-sm font-medium text-gray-700", children: t('admin.user_edit.show_contact_info') }), /*#__PURE__*/ _jsx("div", { className: "text-xs text-gray-400", children: t('admin.user_edit.show_contact_info.hint') }) ] }), /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: (_editUser_showContactInfo = editUser.showContactInfo) !== null && _editUser_showContactInfo !== void 0 ? _editUser_showContactInfo : false, onChange: (e)=>setEditUser((u)=>({ ...u, showContactInfo: e.target.checked })), className: "w-4 h-4 rounded border-gray-300 text-green-600" }) ] }), /*#__PURE__*/ _jsxs("label", { className: "flex items-center justify-between cursor-pointer py-2", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("div", { className: "text-sm font-medium text-gray-700", children: t('admin.user_edit.notify_new_tasks') }), /*#__PURE__*/ _jsx("div", { className: "text-xs text-gray-400", children: t('admin.user_edit.notify_new_tasks.hint') }) ] }), /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: (_editUser_notifyNewTasks = editUser.notifyNewTasks) !== null && _editUser_notifyNewTasks !== void 0 ? _editUser_notifyNewTasks : false, onChange: (e)=>setEditUser((u)=>({ ...u, notifyNewTasks: e.target.checked })), className: "w-4 h-4 rounded border-gray-300 text-green-600" }) ] }), /*#__PURE__*/ _jsxs("label", { className: "flex items-center justify-between cursor-pointer py-2", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("div", { className: "text-sm font-medium text-gray-700", children: t('admin.user_edit.notif_messages') }), /*#__PURE__*/ _jsx("div", { className: "text-xs text-gray-400", children: t('admin.user_edit.notif_messages.hint') }) ] }), /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: (_editUser_notifMessages = editUser.notifMessages) !== null && _editUser_notifMessages !== void 0 ? _editUser_notifMessages : true, onChange: (e)=>setEditUser((u)=>({ ...u, notifMessages: e.target.checked })), className: "w-4 h-4 rounded border-gray-300 text-green-600" }) ] }) ] }) }), editUserTab === 'site' && /*#__PURE__*/ _jsxs("div", { className: "space-y-4", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.user_edit.personal_site_slug') }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2", children: [ /*#__PURE__*/ _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: [ /*#__PURE__*/ _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/" }), /*#__PURE__*/ _jsx("input", { value: (_editUser_personalSiteSlug = editUser.personalSiteSlug) !== null && _editUser_personalSiteSlug !== void 0 ? _editUser_personalSiteSlug : '', onChange: (e)=>setEditUser((u)=>({ ...u, personalSiteSlug: e.target.value || null })), placeholder: "my-username", className: "flex-1 px-3 py-2 text-sm focus:outline-none" }) ] }), editUser.personalSiteSlug && /*#__PURE__*/ _jsx("a", { href: "/site/".concat(editUser.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: /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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" }) }) }) ] }) ] }), editUser.personalSiteSlug && /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx("h4", { className: "text-sm font-semibold text-gray-800 pt-3 border-t border-gray-100", children: t('profile.site.visible_title') }), /*#__PURE__*/ _jsx("div", { className: "space-y-1", children: [ { key: 'showBio', label: t('profile.site.visible.bio') }, { key: 'showRating', label: t('profile.site.visible.rating') }, { key: 'showServices', label: t('profile.site.visible.services') }, { key: 'showPortfolio', label: t('profile.site.visible.portfolio') }, { key: 'showReviews', label: t('profile.site.visible.reviews') }, { key: 'showPhone', label: t('profile.site.visible.contacts') }, { key: 'showFullLastName', label: t('profile.site.visible.full_last_name') }, { key: 'showStatus', label: t('profile.site.visible.status') } ].map((item)=>{ var _editUser_siteSettings; return /*#__PURE__*/ _jsxs("label", { className: "flex items-center justify-between cursor-pointer py-1.5", children: [ /*#__PURE__*/ _jsx("span", { className: "text-sm text-gray-700", children: item.label }), /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: ((_editUser_siteSettings = editUser.siteSettings) !== null && _editUser_siteSettings !== void 0 ? _editUser_siteSettings : {})[item.key] !== false, onChange: (e)=>setEditUser((u)=>{ var _u_siteSettings; return { ...u, siteSettings: { ...(_u_siteSettings = u.siteSettings) !== null && _u_siteSettings !== void 0 ? _u_siteSettings : {}, [item.key]: e.target.checked } }; }), className: "w-4 h-4 rounded border-gray-300 text-green-600" }) ] }, item.key); }) }), /*#__PURE__*/ _jsxs("div", { className: "pt-2", children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1.5", children: t('profile.site.theme') }), /*#__PURE__*/ _jsxs("select", { value: (_siteTheme = ((_editUser_siteSettings = editUser.siteSettings) !== null && _editUser_siteSettings !== void 0 ? _editUser_siteSettings : {}).siteTheme) !== null && _siteTheme !== void 0 ? _siteTheme : 'dark', onChange: (e)=>setEditUser((u)=>{ var _u_siteSettings; return { ...u, siteSettings: { ...(_u_siteSettings = u.siteSettings) !== null && _u_siteSettings !== void 0 ? _u_siteSettings : {}, siteTheme: e.target.value } }; }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm", children: [ /*#__PURE__*/ _jsx("option", { value: "dark", children: t('profile.site.theme.dark') }), /*#__PURE__*/ _jsx("option", { value: "light", children: t('profile.site.theme.light') }) ] }) ] }) ] }) ] }), editUserTab === 'specialist' && /*#__PURE__*/ _jsxs("div", { className: "space-y-6", children: [ (()=>{ if ((editUser === null || editUser === void 0 ? void 0 : editUser.role) === 'specialist') return null; var _editUser_bio; const bio = String((_editUser_bio = editUser === null || editUser === void 0 ? void 0 : editUser.bio) !== null && _editUser_bio !== void 0 ? _editUser_bio : '').trim(); const publishedCards = (editUserCards !== null && editUserCards !== void 0 ? editUserCards : []).filter((c)=>{ var _c_publicationStatus; return ((_c_publicationStatus = c.publicationStatus) !== null && _c_publicationStatus !== void 0 ? _c_publicationStatus : c.isActive ? 'active' : 'inactive') === 'active'; }); const hasPublishedCard = publishedCards.length > 0; const hasCategories = publishedCards.some((c)=>{ var _c_categories; var _c_categories_length; return ((_c_categories_length = (_c_categories = c.categories) === null || _c_categories === void 0 ? void 0 : _c_categories.length) !== null && _c_categories_length !== void 0 ? _c_categories_length : 0) > 0; }); const hasLocations = publishedCards.some((c)=>{ var _c_locations; var _c_locations_length; return ((_c_locations_length = (_c_locations = c.locations) === null || _c_locations === void 0 ? void 0 : _c_locations.length) !== null && _c_locations_length !== void 0 ? _c_locations_length : 0) > 0; }); const missing = []; if (!bio) missing.push(t('admin.user_edit.visibility_requirements.bio', 'Fill in bio')); if (!hasPublishedCard) missing.push(t('admin.user_edit.visibility_requirements.published_card', 'Publish at least one card')); if (!hasCategories) missing.push(t('admin.user_edit.visibility_requirements.categories', 'Add a category in a published card')); if (!hasLocations) missing.push(t('admin.user_edit.visibility_requirements.locations', 'Add a location in a published card')); if (missing.length === 0) return null; return /*#__PURE__*/ _jsxs("div", { className: "rounded-xl border border-amber-300 bg-amber-50 p-3", children: [ /*#__PURE__*/ _jsx("p", { className: "text-sm font-semibold text-amber-900", children: t('admin.user_edit.visibility_requirements.title', 'Profile is not yet visible in Offers') }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-amber-800 mt-1", children: t('admin.user_edit.visibility_requirements.hint', 'Visibility requirements to complete:') }), /*#__PURE__*/ _jsx("ul", { className: "mt-2 text-xs text-amber-900 list-disc pl-5 space-y-0.5", children: missing.map((m)=>/*#__PURE__*/ _jsx("li", { children: m }, m)) }) ] }); })(), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: t('admin.user_edit.skills') }), /*#__PURE__*/ _jsx("div", { className: "flex flex-wrap gap-1.5 mb-2 min-h-[28px]", children: ((_editUser_skills = editUser.skills) !== null && _editUser_skills !== void 0 ? _editUser_skills : []).map((s)=>/*#__PURE__*/ _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, /*#__PURE__*/ _jsx("button", { onClick: ()=>setEditUser((u)=>{ var _u_skills; return { ...u, skills: ((_u_skills = u.skills) !== null && _u_skills !== void 0 ? _u_skills : []).filter((x)=>x !== s) }; }), className: "text-gray-400 hover:text-green-700 leading-none", children: "\xd7" }) ] }, s)) }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-2", children: [ /*#__PURE__*/ _jsx("input", { value: skillInput, onChange: (e)=>setSkillInput(e.target.value), onKeyDown: (e)=>{ if ((e.key === 'Enter' || e.key === ',') && skillInput.trim()) { e.preventDefault(); const val = skillInput.trim().replace(/,$/, ''); var _editUser_skills; if (val && !((_editUser_skills = editUser.skills) !== null && _editUser_skills !== void 0 ? _editUser_skills : []).includes(val)) { setEditUser((u)=>{ var _u_skills; return { ...u, skills: [ ...(_u_skills = u.skills) !== null && _u_skills !== void 0 ? _u_skills : [], val ] }; }); } setSkillInput(''); } }, placeholder: t('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" }), /*#__PURE__*/ _jsx("button", { onClick: ()=>{ const val = skillInput.trim(); var _editUser_skills; if (val && !((_editUser_skills = editUser.skills) !== null && _editUser_skills !== void 0 ? _editUser_skills : []).includes(val)) { setEditUser((u)=>{ var _u_skills; return { ...u, skills: [ ...(_u_skills = u.skills) !== null && _u_skills !== void 0 ? _u_skills : [], val ] }; }); } setSkillInput(''); }, className: "px-3 py-2 bg-green-600 text-white rounded-lg text-sm hover:bg-green-700", children: t('common.add') }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "border-t border-gray-100 pt-4", children: [ /*#__PURE__*/ _jsx("div", { className: "text-sm font-medium text-gray-700 mb-3", children: t('admin.user_edit.specialist_cards') }), editUserCardsLoading ? /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 py-2", children: t('common.loading') }) : editUserCards.length === 0 ? /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 py-4 text-center", children: t('admin.user_edit.no_cards') }) : /*#__PURE__*/ _jsx("div", { className: "space-y-4", children: editUserCards.map((card)=>{ var _card_title, _card_description, _card_skills, _cardSkillInputs_card_id, _card_categories, _card_categories1, _card_locations, _card_locations1; return /*#__PURE__*/ _jsxs("div", { className: "border border-gray-200 bg-gray-50 rounded-xl p-4 space-y-3", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3", children: [ /*#__PURE__*/ _jsx("input", { value: (_card_title = card.title) !== null && _card_title !== void 0 ? _card_title : '', onChange: (e)=>setEditUserCards((prev)=>prev.map((c)=>c.id === card.id ? { ...c, title: e.target.value } : c)), placeholder: t('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" }), /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-1.5 cursor-pointer flex-shrink-0", children: [ /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: card.isActive !== false, onChange: (e)=>setEditUserCards((prev)=>prev.map((c)=>c.id === card.id ? { ...c, isActive: e.target.checked } : c)), className: "w-4 h-4 rounded border-gray-300 text-green-600" }), /*#__PURE__*/ _jsx("span", { className: "text-xs text-gray-600", children: t('admin.user_edit.published') }) ] }) ] }), /*#__PURE__*/ _jsx("textarea", { value: (_card_description = card.description) !== null && _card_description !== void 0 ? _card_description : '', onChange: (e)=>setEditUserCards((prev)=>prev.map((c)=>c.id === card.id ? { ...c, description: e.target.value } : c)), rows: 3, placeholder: t('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" }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("div", { className: "text-xs font-medium text-gray-500 mb-1.5", children: t('admin.user_edit.skills') }), /*#__PURE__*/ _jsx("div", { className: "flex flex-wrap gap-1.5 mb-1.5 min-h-[24px]", children: ((_card_skills = card.skills) !== null && _card_skills !== void 0 ? _card_skills : []).map((s)=>/*#__PURE__*/ _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, /*#__PURE__*/ _jsx("button", { onClick: ()=>setEditUserCards((prev)=>prev.map((c)=>{ var _c_skills; return c.id === card.id ? { ...c, skills: ((_c_skills = c.skills) !== null && _c_skills !== void 0 ? _c_skills : []).filter((x)=>x !== s) } : c; })), className: "text-gray-400 hover:text-green-700 leading-none", children: "\xd7" }) ] }, s)) }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-2", children: [ /*#__PURE__*/ _jsx("input", { value: (_cardSkillInputs_card_id = cardSkillInputs[card.id]) !== null && _cardSkillInputs_card_id !== void 0 ? _cardSkillInputs_card_id : '', onChange: (e)=>setCardSkillInputs((prev)=>({ ...prev, [card.id]: e.target.value })), onKeyDown: (e)=>{ var _cardSkillInputs_card_id; if ((e.key === 'Enter' || e.key === ',') && ((_cardSkillInputs_card_id = cardSkillInputs[card.id]) !== null && _cardSkillInputs_card_id !== void 0 ? _cardSkillInputs_card_id : '').trim()) { e.preventDefault(); var _cardSkillInputs_card_id1; const val = ((_cardSkillInputs_card_id1 = cardSkillInputs[card.id]) !== null && _cardSkillInputs_card_id1 !== void 0 ? _cardSkillInputs_card_id1 : '').trim().replace(/,$/, ''); var _card_skills; if (val && !((_card_skills = card.skills) !== null && _card_skills !== void 0 ? _card_skills : []).includes(val)) { setEditUserCards((prev)=>prev.map((c)=>{ var _c_skills; return c.id === card.id ? { ...c, skills: [ ...(_c_skills = c.skills) !== null && _c_skills !== void 0 ? _c_skills : [], val ] } : c; })); } setCardSkillInputs((prev)=>({ ...prev, [card.id]: '' })); } }, placeholder: t('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" }), /*#__PURE__*/ _jsx("button", { onClick: ()=>{ var _cardSkillInputs_card_id; const val = ((_cardSkillInputs_card_id = cardSkillInputs[card.id]) !== null && _cardSkillInputs_card_id !== void 0 ? _cardSkillInputs_card_id : '').trim(); var _card_skills; if (val && !((_card_skills = card.skills) !== null && _card_skills !== void 0 ? _card_skills : []).includes(val)) { setEditUserCards((prev)=>prev.map((c)=>{ var _c_skills; return c.id === card.id ? { ...c, skills: [ ...(_c_skills = c.skills) !== null && _c_skills !== void 0 ? _c_skills : [], val ] } : c; })); } setCardSkillInputs((prev)=>({ ...prev, [card.id]: '' })); }, className: "px-2.5 py-1.5 bg-green-600 text-white rounded-lg text-xs hover:bg-green-700", children: "+" }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("div", { className: "text-xs font-medium text-gray-500 mb-1.5", children: t('admin.user_edit.categories') }), /*#__PURE__*/ _jsx("div", { className: "flex flex-wrap gap-1.5 mb-1.5 min-h-[24px]", children: ((_card_categories = card.categories) !== null && _card_categories !== void 0 ? _card_categories : []).map((slug)=>{ var _catRows_find; return /*#__PURE__*/ _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: [ getCatLabel((_catRows_find = catRows.find((c)=>c.slug === slug)) !== null && _catRows_find !== void 0 ? _catRows_find : { slug }, locale), /*#__PURE__*/ _jsx("button", { onClick: ()=>setEditUserCards((prev)=>prev.map((c)=>{ var _c_categories; return c.id === card.id ? { ...c, categories: ((_c_categories = c.categories) !== null && _c_categories !== void 0 ? _c_categories : []).filter((x)=>x !== slug) } : c; })), className: "text-purple-400 hover:text-purple-700 leading-none", children: "\xd7" }) ] }, slug); }) }), /*#__PURE__*/ _jsx(AdminCatPicker, { catRows: catRows, locale: locale, selected: (_card_categories1 = card.categories) !== null && _card_categories1 !== void 0 ? _card_categories1 : [], onAdd: (id)=>setEditUserCards((prev)=>prev.map((c)=>{ var _c_categories; return c.id === card.id ? { ...c, categories: [ ...(_c_categories = c.categories) !== null && _c_categories !== void 0 ? _c_categories : [], id ] } : c; })), addLabel: t('admin.user_edit.add_category') }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("div", { className: "text-xs font-medium text-gray-500 mb-1.5", children: t('admin.user_edit.locations') }), /*#__PURE__*/ _jsx("div", { className: "flex flex-wrap gap-1.5 mb-1.5 min-h-[24px]", children: ((_card_locations = card.locations) !== null && _card_locations !== void 0 ? _card_locations : []).map((slug)=>{ var _locRows_find; return /*#__PURE__*/ _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: [ getLocLabel((_locRows_find = locRows.find((l)=>l.slug === slug)) !== null && _locRows_find !== void 0 ? _locRows_find : { slug }, locale), /*#__PURE__*/ _jsx("button", { onClick: ()=>setEditUserCards((prev)=>prev.map((c)=>{ var _c_locations; return c.id === card.id ? { ...c, locations: ((_c_locations = c.locations) !== null && _c_locations !== void 0 ? _c_locations : []).filter((x)=>x !== slug) } : c; })), className: "text-green-400 hover:text-green-700 leading-none", children: "\xd7" }) ] }, slug); }) }), /*#__PURE__*/ _jsx(AdminLocPicker, { locRows: locRows, locale: locale, selected: (_card_locations1 = card.locations) !== null && _card_locations1 !== void 0 ? _card_locations1 : [], onAdd: (id)=>setEditUserCards((prev)=>prev.map((c)=>{ var _c_locations; return c.id === card.id ? { ...c, locations: [ ...(_c_locations = c.locations) !== null && _c_locations !== void 0 ? _c_locations : [], id ] } : c; })), addLabel: t('admin.user_edit.add_location') }) ] }), /*#__PURE__*/ _jsx("div", { className: "flex justify-end pt-1", children: /*#__PURE__*/ _jsx("button", { onClick: ()=>saveCard(card.id), disabled: cardSaving[card.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: cardSaving[card.id] ? '...' : t('common.save') }) }) ] }, card.id); }) }) ] }) ] }) ] }) ] }), editUserTab !== 'balance' ? /*#__PURE__*/ _jsxs("div", { className: "border-t border-gray-100 px-6 py-4 flex gap-3 flex-shrink-0", children: [ /*#__PURE__*/ _jsx("button", { onClick: saveEditUser, disabled: editUserSaving, className: "flex-1 bg-green-600 hover:bg-green-700 text-white py-2 rounded-lg text-sm font-semibold disabled:opacity-50", children: editUserSaving ? '...' : t('common.save') }), /*#__PURE__*/ _jsx("button", { onClick: ()=>setEditUser(null), className: "flex-1 bg-gray-100 hover:bg-gray-200 text-gray-700 py-2 rounded-lg text-sm font-medium", children: t('common.cancel') }) ] }) : /*#__PURE__*/ _jsx("div", { className: "border-t border-gray-100 px-6 py-4 flex-shrink-0", children: /*#__PURE__*/ _jsx("button", { onClick: ()=>setEditUser(null), className: "w-full bg-gray-100 hover:bg-gray-200 text-gray-700 py-2 rounded-lg text-sm font-medium", children: t('common.close') }) }) ] }) }), editUser && balanceModal && /*#__PURE__*/ _jsx("div", { className: "fixed inset-0 z-[60] flex items-center justify-center bg-black/40 px-4", children: /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-2xl shadow-2xl p-6 w-full max-w-sm border-t-4 ".concat(balanceModal === 'topup' ? 'border-emerald-500' : 'border-rose-500'), children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between mb-4", children: [ /*#__PURE__*/ _jsx("h3", { className: "text-base font-semibold ".concat(balanceModal === 'topup' ? 'text-emerald-900' : 'text-rose-900'), children: balanceModal === 'topup' ? t('admin.balance.topup.title') : t('admin.balance.withdraw.title') }), /*#__PURE__*/ _jsx("button", { onClick: ()=>setBalanceModal(null), className: "text-gray-400 hover:text-gray-600 text-2xl leading-none", children: "\xd7" }) ] }), /*#__PURE__*/ _jsxs("p", { className: "text-xs text-gray-500 mb-4", children: [ t('admin.user_edit.balance'), ": ", /*#__PURE__*/ _jsxs("span", { className: "font-semibold text-gray-700", children: [ Number((_editUser_balance1 = editUser.balance) !== null && _editUser_balance1 !== void 0 ? _editUser_balance1 : 0).toFixed(2), " EUR" ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "space-y-3", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium mb-1 ".concat(balanceModal === 'topup' ? 'text-emerald-800' : 'text-rose-800'), children: balanceModal === 'topup' ? t('admin.balance.topup.amount') : t('admin.balance.withdraw.amount') }), /*#__PURE__*/ _jsx("input", { type: "number", min: "0.01", step: "0.01", value: balanceModal === 'topup' ? (_editUser_topUpAmount = editUser.topUpAmount) !== null && _editUser_topUpAmount !== void 0 ? _editUser_topUpAmount : '' : (_editUser_withdrawAmount = editUser.withdrawAmount) !== null && _editUser_withdrawAmount !== void 0 ? _editUser_withdrawAmount : '', onChange: (e)=>setEditUser((u)=>balanceModal === 'topup' ? { ...u, topUpAmount: e.target.value } : { ...u, withdrawAmount: e.target.value }), className: "w-full border rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 ".concat(balanceModal === 'topup' ? 'border-emerald-300 focus:ring-emerald-400' : 'border-rose-300 focus:ring-rose-400') }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium mb-1 ".concat(balanceModal === 'topup' ? 'text-emerald-800' : 'text-rose-800'), children: balanceModal === 'topup' ? t('admin.balance.topup.description') : t('admin.balance.withdraw.description') }), /*#__PURE__*/ _jsx("input", { value: balanceModal === 'topup' ? (_editUser_topUpDescription = editUser.topUpDescription) !== null && _editUser_topUpDescription !== void 0 ? _editUser_topUpDescription : '' : (_editUser_withdrawDescription = editUser.withdrawDescription) !== null && _editUser_withdrawDescription !== void 0 ? _editUser_withdrawDescription : '', onChange: (e)=>setEditUser((u)=>balanceModal === 'topup' ? { ...u, topUpDescription: e.target.value } : { ...u, withdrawDescription: e.target.value }), placeholder: balanceModal === 'topup' ? t('admin.balance.topup.description.placeholder') : t('admin.balance.withdraw.description.placeholder'), className: "w-full border rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 ".concat(balanceModal === 'topup' ? 'border-emerald-300 focus:ring-emerald-400' : 'border-rose-300 focus:ring-rose-400') }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-2 mt-5", children: [ /*#__PURE__*/ _jsx("button", { onClick: async ()=>{ if (balanceModal === 'topup') { await handleAdminTopUp(); } else { await handleAdminWithdraw(); } setBalanceModal(null); }, disabled: balanceModal === 'topup' ? topUpSaving || !Number(editUser.topUpAmount) : withdrawSaving || !Number(editUser.withdrawAmount), className: "flex-1 text-white py-2 rounded-lg text-sm font-semibold disabled:opacity-50 ".concat(balanceModal === 'topup' ? 'bg-emerald-600 hover:bg-emerald-700' : 'bg-rose-600 hover:bg-rose-700'), children: (balanceModal === 'topup' ? topUpSaving : withdrawSaving) ? t('common.loading') : balanceModal === 'topup' ? t('admin.balance.topup.submit') : t('admin.balance.withdraw.submit') }), /*#__PURE__*/ _jsx("button", { onClick: ()=>setBalanceModal(null), className: "flex-1 bg-gray-100 hover:bg-gray-200 text-gray-700 py-2 rounded-lg text-sm font-medium", children: t('common.cancel') }) ] }) ] }) }) ] }) ] }) ] }) }); } // ─── DbCheckTab ───────────────────────────────────────────────────────────── function DbCheckTab() { // ── Skill duplicates ────────────────────────────────────────────────────── const [dedupLoading, setDedupLoading] = useState(false); const [dedupGroups, setDedupGroups] = useState(null); const [keepIds, setKeepIds] = useState({}); const [merging, setMerging] = useState(null); function gk(group) { var _group__nameEl, _group_, _group_1; var _group__nameEl_toLowerCase_trim; return (_group__nameEl_toLowerCase_trim = (_group_ = group[0]) === null || _group_ === void 0 ? void 0 : (_group__nameEl = _group_.nameEl) === null || _group__nameEl === void 0 ? void 0 : _group__nameEl.toLowerCase().trim()) !== null && _group__nameEl_toLowerCase_trim !== void 0 ? _group__nameEl_toLowerCase_trim : (_group_1 = group[0]) === null || _group_1 === void 0 ? void 0 : _group_1.id; } async function findDuplicates() { setDedupLoading(true); setDedupGroups(null); setKeepIds({}); try { const groups = await api.getSkillDedup() // all categories ; setDedupGroups(groups); const auto = {}; groups.forEach((group)=>{ const best = [ ...group ].sort((a, b)=>{ var _b_usageCount, _a_usageCount; return ((_b_usageCount = b.usageCount) !== null && _b_usageCount !== void 0 ? _b_usageCount : 0) - ((_a_usageCount = a.usageCount) !== null && _a_usageCount !== void 0 ? _a_usageCount : 0); })[0]; auto[gk(group)] = best.id; }); setKeepIds(auto); } catch (e) { setDedupGroups([]); } finally{ setDedupLoading(false); } } async function mergeGroup(key, group) { const keepId = keepIds[key]; if (!keepId) return; const deleteIds = group.filter((s)=>s.id !== keepId).map((s)=>s.id); if (!deleteIds.length) return; setMerging(key); try { await api.mergeSkillDuplicates(keepId, deleteIds); setDedupGroups((prev)=>prev ? prev.filter((g)=>gk(g) !== key) : prev); } catch (e) {} finally{ setMerging(null); } } async function mergeAll() { if (!(dedupGroups === null || dedupGroups === void 0 ? void 0 : dedupGroups.length)) return; setMerging('__all__'); for (const group of [ ...dedupGroups ]){ const key = gk(group); const keepId = keepIds[key]; if (!keepId) continue; const deleteIds = group.filter((s)=>s.id !== keepId).map((s)=>s.id); if (!deleteIds.length) continue; try { await api.mergeSkillDuplicates(keepId, deleteIds); setDedupGroups((prev)=>prev ? prev.filter((g)=>gk(g) !== key) : prev); } catch (e) {} } setMerging(null); } var _dedupGroups_reduce; const totalDuplicates = (_dedupGroups_reduce = dedupGroups === null || dedupGroups === void 0 ? void 0 : dedupGroups.reduce((acc, g)=>acc + g.length - 1, 0)) !== null && _dedupGroups_reduce !== void 0 ? _dedupGroups_reduce : 0; return /*#__PURE__*/ _jsxs("div", { className: "space-y-6", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("h2", { className: "text-base font-semibold text-gray-900", children: "ПрПверка базы ЎаММых" }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-500 mt-0.5", children: "ДОагМПстОка О ОсправлеМОе прПблеЌ в базе ЎаММых" }) ] }), /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 overflow-hidden", children: [ /*#__PURE__*/ _jsxs("div", { className: "px-5 py-4 border-b border-gray-100 flex items-center justify-between", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("h3", { className: "text-sm font-semibold text-gray-800", children: "ДублОкаты МавыкПв" }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-0.5", children: "ППОск МавыкПв с ПЎОМакПвыЌ ОЌеМеЌ в ПЎМПй категПрОО. ПрО ПбъеЎОМеМОО — ссылкО в картПчках спецОалОстПв ПбМПвляются автПЌатОческО." }) ] }), /*#__PURE__*/ _jsxs("button", { onClick: findDuplicates, disabled: dedupLoading, 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: [ /*#__PURE__*/ _jsxs("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ _jsx("circle", { cx: "11", cy: "11", r: "8" }), /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M21 21l-4.35-4.35" }) ] }), dedupLoading ? 'Ищу ' : 'НайтО ЎублОкаты' ] }) ] }), dedupGroups !== null && /*#__PURE__*/ _jsx("div", { className: "p-5", children: dedupGroups.length === 0 ? /*#__PURE__*/ _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: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" }) }), "ДублОкатПв Ме МайЎеМП — база в пПряЎке" ] }) : /*#__PURE__*/ _jsxs("div", { className: "space-y-3", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between", children: [ /*#__PURE__*/ _jsxs("p", { className: "text-sm text-green-700 font-semibold", children: [ "НайЎеМП ", dedupGroups.length, " групп \xb7 ", totalDuplicates, " лОшМОх запОсей" ] }), /*#__PURE__*/ _jsx("button", { onClick: mergeAll, disabled: merging === '__all__', 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: merging === '__all__' ? 'ОбъеЎОМяю ' : "ОбъеЎОМОть все (".concat(dedupGroups.length, ")") }) ] }), dedupGroups.map((group)=>{ var _group_, _group_1; const key = gk(group); return /*#__PURE__*/ _jsxs("div", { className: "bg-white border border-orange-200 rounded-xl overflow-hidden shadow-sm", children: [ /*#__PURE__*/ _jsxs("div", { className: "px-4 py-2.5 bg-orange-50 border-b border-orange-100 flex items-center justify-between gap-3", children: [ /*#__PURE__*/ _jsxs("div", { className: "min-w-0", children: [ /*#__PURE__*/ _jsxs("span", { className: "text-sm font-semibold text-orange-800", children: [ "\xab", (_group_ = group[0]) === null || _group_ === void 0 ? void 0 : _group_.nameEl, "\xbb" ] }), /*#__PURE__*/ _jsx("span", { className: "ml-2 text-xs text-green-600 font-mono", children: (_group_1 = group[0]) === null || _group_1 === void 0 ? void 0 : _group_1.categorySlug }), /*#__PURE__*/ _jsxs("span", { className: "ml-2 text-xs text-orange-400", children: [ group.length, " варОаМта" ] }) ] }), /*#__PURE__*/ _jsx("button", { onClick: ()=>mergeGroup(key, group), disabled: !!merging, 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: merging === key ? 'ОбъеЎОМяю ' : 'ОбъеЎОМОть' }) ] }), /*#__PURE__*/ _jsx("div", { className: "divide-y divide-gray-50", children: group.map((skill)=>/*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-3 px-4 py-2.5 cursor-pointer hover:bg-gray-50 transition", children: [ /*#__PURE__*/ _jsx("input", { type: "radio", name: "dedup-global-".concat(key), checked: keepIds[key] === skill.id, onChange: ()=>setKeepIds((prev)=>({ ...prev, [key]: skill.id })), className: "accent-amber-600 shrink-0" }), /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 flex-wrap", children: [ /*#__PURE__*/ _jsx("span", { className: "text-sm font-medium text-gray-800", children: skill.nameEl }), skill.nameEn && skill.nameEn !== skill.nameEl && /*#__PURE__*/ _jsxs("span", { className: "text-xs text-gray-400", children: [ "EN: ", skill.nameEn ] }), skill.nameRu && skill.nameRu !== skill.nameEl && /*#__PURE__*/ _jsxs("span", { className: "text-xs text-gray-400", children: [ "RU: ", skill.nameRu ] }), skill.nameUk && /*#__PURE__*/ _jsxs("span", { className: "text-xs text-gray-400", children: [ "UK: ", skill.nameUk ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 mt-0.5", children: [ /*#__PURE__*/ _jsx("span", { className: "text-[11px] font-semibold ".concat(skill.usageCount > 0 ? 'text-green-600' : 'text-gray-400'), children: skill.usageCount > 0 ? "".concat(skill.usageCount, " ОспПльзПваМОй") : 'Ме ОспПльзПвался' }), /*#__PURE__*/ _jsxs("span", { className: "text-[11px] text-gray-300", children: [ "order: ", skill.order ] }), keepIds[key] === skill.id && /*#__PURE__*/ _jsx("span", { className: "text-[11px] font-bold text-amber-600 uppercase", children: "← ПставОть" }) ] }) ] }) ] }, skill.id)) }) ] }, key); }) ] }) }) ] }) ] }); } function LocTree(param) { let { rows, parentId, depth, locale, expanded, onToggle, onEdit, onDelete, onAddChild, t } = param; const children = rows.filter((r)=>{ var _r_parentId; return ((_r_parentId = r.parentId) !== null && _r_parentId !== void 0 ? _r_parentId : null) === parentId; }); if (children.length === 0) return null; return /*#__PURE__*/ _jsx(_Fragment, { children: children.sort((a, b)=>{ var _a_order, _b_order; return ((_a_order = a.order) !== null && _a_order !== void 0 ? _a_order : 0) - ((_b_order = b.order) !== null && _b_order !== void 0 ? _b_order : 0); }).map((loc)=>{ const hasChildren = rows.some((r)=>r.parentId === loc.id); const isOpen = expanded.has(loc.id); const name = (locale === 'en' ? loc.nameEn : locale === 'ru' ? loc.nameRu : locale === 'uk' ? loc.nameUk : loc.nameEl) || loc.nameEl || loc.slug; return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 px-4 py-3 hover:bg-gray-50 ".concat(!loc.isActive ? 'opacity-50' : ''), style: { paddingLeft: "".concat(16 + depth * 24, "px") }, children: [ /*#__PURE__*/ _jsx("button", { onClick: ()=>hasChildren && onToggle(loc.id), className: "w-5 h-5 flex items-center justify-center text-gray-400 rounded ".concat(hasChildren ? 'hover:bg-gray-200 cursor-pointer' : 'cursor-default'), children: hasChildren ? isOpen ? /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("polyline", { points: "6 9 12 15 18 9" }) }) : /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("polyline", { points: "9 18 15 12 9 6" }) }) : /*#__PURE__*/ _jsx("span", { className: "w-3.5 h-3.5 block" }) }), depth === 0 ? /*#__PURE__*/ _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: /*#__PURE__*/ _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" }) }) : /*#__PURE__*/ _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: [ /*#__PURE__*/ _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" }), /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 11a3 3 0 11-6 0 3 3 0 016 0z" }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ _jsx("span", { className: "font-medium text-gray-800 text-sm", children: name }), /*#__PURE__*/ _jsx("span", { className: "ml-2 text-xs text-gray-400", children: loc.nameEn }), /*#__PURE__*/ _jsxs("span", { className: "ml-1.5 font-mono text-xs text-gray-300", children: [ "/", loc.slug ] }) ] }), /*#__PURE__*/ _jsx("span", { className: "px-2 py-0.5 rounded-full text-xs font-medium ".concat(loc.isActive ? 'bg-green-100 text-green-700' : 'bg-gray-100 text-gray-500'), children: loc.isActive ? t('admin.cat.active') : t('admin.cat.inactive') }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-1 flex-shrink-0", children: [ depth === 0 && /*#__PURE__*/ _jsx("button", { onClick: ()=>onAddChild(loc.id), className: "text-xs px-2 py-1 rounded-lg bg-green-50 text-green-600 hover:bg-green-100 font-medium", title: t('admin.loc.add_district'), children: "+" }), /*#__PURE__*/ _jsx("button", { onClick: ()=>onEdit(loc), className: "text-xs px-2 py-1 rounded-lg bg-gray-100 text-gray-600 hover:bg-gray-200 font-medium", children: t('common.edit') }), /*#__PURE__*/ _jsx("button", { onClick: ()=>onDelete(loc.id, name), className: "text-xs px-2 py-1 rounded-lg bg-red-50 text-red-600 hover:bg-red-100 font-medium", children: t('common.delete') }) ] }) ] }), hasChildren && isOpen && /*#__PURE__*/ _jsx(LocTree, { rows: rows, parentId: loc.id, depth: depth + 1, locale: locale, expanded: expanded, onToggle: onToggle, onEdit: onEdit, onDelete: onDelete, onAddChild: onAddChild, t: t }) ] }, loc.id); }) }); } function CatTree(param) { let { rows, parentId, depth, locale, expanded, onToggle, onEdit, onDelete, onAddChild, skillsExpanded, skillsCache, skillsLoading, onToggleSkills, skillForm, skillSaving, onOpenAddSkill, onOpenEditSkill, onSaveSkill, onDeleteSkill, onCancelSkillForm, onSkillFormChange, t } = param; const children = rows.filter((r)=>{ var _r_parentId; return ((_r_parentId = r.parentId) !== null && _r_parentId !== void 0 ? _r_parentId : null) === parentId; }); if (children.length === 0) return null; return /*#__PURE__*/ _jsx(_Fragment, { children: children.sort((a, b)=>{ var _a_order, _b_order; return ((_a_order = a.order) !== null && _a_order !== void 0 ? _a_order : 0) - ((_b_order = b.order) !== null && _b_order !== void 0 ? _b_order : 0); }).map((cat)=>{ var _cat_names; const hasChildren = rows.some((r)=>r.parentId === cat.id); const isOpen = expanded.has(cat.id); const skillsOpen = skillsExpanded.has(cat.id); const isLoadingSkills = skillsLoading.has(cat.id); var _skillsCache_cat_slug; const skills = (_skillsCache_cat_slug = skillsCache[cat.slug]) !== null && _skillsCache_cat_slug !== void 0 ? _skillsCache_cat_slug : []; const name = (locale === 'en' ? cat.namesEn : locale === 'ru' ? cat.namesRu : locale === 'uk' ? cat.namesUk : cat.namesEl) || cat.namesEl || cat.slug; return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 px-4 py-3 hover:bg-gray-50 ".concat(!cat.isActive ? 'opacity-50' : ''), style: { paddingLeft: "".concat(16 + depth * 24, "px") }, children: [ /*#__PURE__*/ _jsx("button", { onClick: ()=>hasChildren && onToggle(cat.id), className: "w-5 h-5 flex items-center justify-center text-gray-400 rounded ".concat(hasChildren ? 'hover:bg-gray-200 cursor-pointer' : 'cursor-default'), children: hasChildren ? isOpen ? /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("polyline", { points: "6 9 12 15 18 9" }) }) : /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("polyline", { points: "9 18 15 12 9 6" }) }) : /*#__PURE__*/ _jsx("span", { className: "w-3.5 h-3.5 block" }) }), /*#__PURE__*/ _jsx("span", { className: "w-10 h-10 flex items-center justify-center rounded-xl bg-green-50", children: /*#__PURE__*/ _jsx(CategoryIcon, { icon: cat.icon, alt: name, className: "h-7 w-7 object-contain text-2xl leading-none", fallback: "\uD83D\uDCE6" }) }), /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ _jsx("span", { className: "font-medium text-gray-800 text-sm", children: name }), /*#__PURE__*/ _jsx("span", { className: "ml-2 text-xs text-gray-400", children: cat.namesEn || ((_cat_names = cat.names) === null || _cat_names === void 0 ? void 0 : _cat_names.en) }), /*#__PURE__*/ _jsxs("span", { className: "ml-1.5 font-mono text-xs text-gray-300", children: [ "/", cat.slug ] }) ] }), /*#__PURE__*/ _jsx("span", { className: "px-2 py-0.5 rounded-full text-xs font-medium ".concat(cat.isActive ? 'bg-green-100 text-green-700' : 'bg-gray-100 text-gray-500'), children: cat.isActive ? t('admin.cat.active') : t('admin.cat.inactive') }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-1 flex-shrink-0", children: [ /*#__PURE__*/ _jsxs("button", { onClick: ()=>onToggleSkills(cat), className: "text-xs px-2 py-1 rounded-lg font-medium flex items-center gap-1 ".concat(skillsOpen ? 'bg-amber-100 text-amber-700' : 'bg-amber-50 text-amber-600 hover:bg-amber-100'), title: "НавыкО", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-3 h-3", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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" }) }), skillsCache[cat.slug] ? skillsCache[cat.slug].length : t('admin.cat.skills', 'Skills') ] }), /*#__PURE__*/ _jsx("button", { onClick: ()=>onAddChild(cat.id), className: "text-xs px-2 py-1 rounded-lg bg-green-50 text-green-600 hover:bg-green-100 font-medium", title: t('admin.cat.add_child'), children: "+" }), /*#__PURE__*/ _jsx("button", { onClick: ()=>onEdit(cat), className: "text-xs px-2 py-1 rounded-lg bg-gray-100 text-gray-600 hover:bg-gray-200 font-medium", children: t('common.edit') }), /*#__PURE__*/ _jsx("button", { onClick: ()=>onDelete(cat.id, name), className: "text-xs px-2 py-1 rounded-lg bg-red-50 text-red-600 hover:bg-red-100 font-medium", children: t('common.delete') }) ] }) ] }), skillsOpen && /*#__PURE__*/ _jsx(SkillsPanel, { cat: cat, locale: locale, depth: depth, t: t, skills: skills, isLoading: isLoadingSkills, skillForm: skillForm, skillSaving: skillSaving, onOpenAddSkill: onOpenAddSkill, onOpenEditSkill: onOpenEditSkill, onSaveSkill: onSaveSkill, onDeleteSkill: onDeleteSkill, onCancelSkillForm: onCancelSkillForm, onSkillFormChange: onSkillFormChange }), hasChildren && isOpen && /*#__PURE__*/ _jsx(CatTree, { rows: rows, parentId: cat.id, depth: depth + 1, locale: locale, expanded: expanded, onToggle: onToggle, onEdit: onEdit, onDelete: onDelete, onAddChild: onAddChild, skillsExpanded: skillsExpanded, skillsCache: skillsCache, skillsLoading: skillsLoading, onToggleSkills: onToggleSkills, skillForm: skillForm, skillSaving: skillSaving, onOpenAddSkill: onOpenAddSkill, onOpenEditSkill: onOpenEditSkill, onSaveSkill: onSaveSkill, onDeleteSkill: onDeleteSkill, onCancelSkillForm: onCancelSkillForm, onSkillFormChange: onSkillFormChange, t: t }) ] }, cat.id); }) }); } // ─── SkillsPanel ──────────────────────────────────────────────────────────── // Self-contained component for the skill list + edit form + dedup panel per category const SKILL_LANG_LABELS = { nameEl: '🇬🇷 EL', nameEn: '🇬🇧 EN', nameRu: '🇷🇺 RU', nameUk: '🇺🇊 UK' }; function SkillForm(param) { let { form, saving, onSave, onCancel, onChange } = param; var _form_nameEl; var _form_order; return /*#__PURE__*/ _jsxs("div", { className: "bg-white border border-amber-200 rounded-xl p-4 shadow-sm", children: [ /*#__PURE__*/ _jsx("div", { className: "grid grid-cols-2 gap-3 mb-3", children: [ 'nameEl', 'nameEn', 'nameRu', 'nameUk' ].map((field, i)=>{ var _form_field; return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-[11px] font-semibold text-gray-500 mb-1 uppercase tracking-wide", children: SKILL_LANG_LABELS[field] }), /*#__PURE__*/ _jsx("input", { value: (_form_field = form[field]) !== null && _form_field !== void 0 ? _form_field : '', onChange: (e)=>onChange({ ...form, [field]: e.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: i === 0, placeholder: field === 'nameUk' ? 'МеПбПвʌязкПвП' : '' }) ] }, field); }) }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 pt-1 border-t border-gray-100", children: [ /*#__PURE__*/ _jsx("label", { className: "text-xs text-gray-400 font-medium", children: "ППряЎПк" }), /*#__PURE__*/ _jsx("input", { type: "number", value: (_form_order = form.order) !== null && _form_order !== void 0 ? _form_order : 0, onChange: (e)=>onChange({ ...form, order: Number(e.target.value) }), className: "w-16 border border-gray-200 rounded-lg px-2 py-1 text-xs text-center" }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-2 ml-auto", children: [ /*#__PURE__*/ _jsx("button", { onClick: onCancel, className: "px-3 py-1.5 bg-gray-100 text-gray-600 rounded-lg text-xs font-medium hover:bg-gray-200 transition", children: "ОтЌеМа" }), /*#__PURE__*/ _jsx("button", { onClick: onSave, disabled: saving || !((_form_nameEl = form.nameEl) === null || _form_nameEl === void 0 ? void 0 : _form_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: saving ? 'СПхраМяю ' : 'СПхраМОть' }) ] }) ] }) ] }); } function SkillsPanel(param) { let { cat, locale, depth, t, skills, isLoading, skillForm, skillSaving, onOpenAddSkill, onOpenEditSkill, onSaveSkill, onDeleteSkill, onCancelSkillForm, onSkillFormChange } = param; const showAddForm = (skillForm === null || skillForm === void 0 ? void 0 : skillForm.catSlug) === cat.slug && !(skillForm === null || skillForm === void 0 ? void 0 : skillForm.id); return /*#__PURE__*/ _jsxs("div", { className: "border-t border-amber-100 bg-gradient-to-b from-amber-50/60 to-white", style: { paddingLeft: "".concat(16 + depth * 24 + 36, "px"), paddingRight: '16px', paddingTop: '14px', paddingBottom: '14px' }, children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 mb-3", children: [ /*#__PURE__*/ _jsx("span", { className: "text-xs font-bold text-amber-700 uppercase tracking-wider", children: "НавыкО" }), /*#__PURE__*/ _jsxs("span", { className: "text-xs text-amber-500 font-mono", children: [ "/", cat.slug ] }), /*#__PURE__*/ _jsxs("span", { className: "ml-1 text-xs text-amber-400", children: [ "(", skills.length, ")" ] }), /*#__PURE__*/ _jsx("div", { className: "ml-auto", children: /*#__PURE__*/ _jsxs("button", { onClick: ()=>{ onCancelSkillForm(); onOpenAddSkill(cat.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: [ /*#__PURE__*/ _jsxs("svg", { className: "w-3 h-3", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: [ /*#__PURE__*/ _jsx("line", { x1: "12", y1: "5", x2: "12", y2: "19" }), /*#__PURE__*/ _jsx("line", { x1: "5", y1: "12", x2: "19", y2: "12" }) ] }), "ДПбавОть" ] }) }) ] }), isLoading ? /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 py-3 text-xs text-gray-400", children: [ /*#__PURE__*/ _jsxs("svg", { className: "w-3.5 h-3.5 animate-spin", fill: "none", viewBox: "0 0 24 24", children: [ /*#__PURE__*/ _jsx("circle", { cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4", className: "opacity-25" }), /*#__PURE__*/ _jsx("path", { fill: "currentColor", d: "M4 12a8 8 0 018-8v8z", className: "opacity-75" }) ] }), "Загрузка " ] }) : /*#__PURE__*/ _jsxs("div", { className: "space-y-1", children: [ skills.length === 0 && !showAddForm && /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 italic py-2", children: "НавыкО Ме ЎПбавлеМы" }), skills.map((skill)=>{ const isEditingThis = (skillForm === null || skillForm === void 0 ? void 0 : skillForm.id) === skill.id; const skillName = locale === 'en' ? skill.nameEn : locale === 'ru' ? skill.nameRu : locale === 'uk' ? skill.nameUk || skill.nameEn : skill.nameEl; return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 rounded-lg px-3 py-2 group transition ".concat(isEditingThis ? 'bg-amber-50 border border-amber-200' : 'bg-white border border-gray-100 hover:border-amber-200 hover:bg-amber-50/30'), children: [ /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ _jsx("span", { className: "text-sm font-medium text-gray-800", children: skillName }), locale !== 'en' && skill.nameEn && /*#__PURE__*/ _jsx("span", { className: "ml-2 text-xs text-gray-400", children: skill.nameEn }), locale !== 'ru' && skill.nameRu && skill.nameRu !== skill.nameEl && /*#__PURE__*/ _jsx("span", { className: "ml-1.5 text-xs text-gray-300", children: skill.nameRu }) ] }), skill.order > 0 && /*#__PURE__*/ _jsxs("span", { className: "text-[10px] text-gray-300 font-mono", children: [ "#", skill.order ] }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-1 transition-opacity ".concat(isEditingThis ? 'opacity-100' : 'opacity-0 group-hover:opacity-100'), children: [ /*#__PURE__*/ _jsx("button", { onClick: ()=>isEditingThis ? onCancelSkillForm() : (onCancelSkillForm(), onOpenEditSkill(skill, cat.slug)), className: "text-xs px-2 py-0.5 rounded-md font-medium transition ".concat(isEditingThis ? 'bg-amber-100 text-amber-700' : 'bg-gray-100 text-gray-600 hover:bg-amber-100 hover:text-amber-700'), children: isEditingThis ? '✕' : t('common.edit') }), /*#__PURE__*/ _jsx("button", { onClick: ()=>onDeleteSkill(skill, cat.slug), className: "text-xs px-2 py-0.5 rounded-md bg-red-50 text-red-600 hover:bg-red-100 transition", children: t('common.delete') }) ] }) ] }), isEditingThis && /*#__PURE__*/ _jsx("div", { className: "mt-1 mb-1 ml-0", children: /*#__PURE__*/ _jsx(SkillForm, { form: skillForm, saving: skillSaving, onSave: onSaveSkill, onCancel: onCancelSkillForm, onChange: onSkillFormChange }) }) ] }, skill.id); }), showAddForm && /*#__PURE__*/ _jsx("div", { className: "mt-2", children: /*#__PURE__*/ _jsx(SkillForm, { form: skillForm, saving: skillSaving, onSave: onSaveSkill, onCancel: onCancelSkillForm, onChange: onSkillFormChange }) }) ] }) ] }); } function Pagination(param) { let { page, total, limit, onChange, totalLabel } = param; const pages = Math.ceil(total / limit); if (pages <= 1) return null; return /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between px-4 py-3 border-t border-gray-100 text-sm text-gray-500", children: [ /*#__PURE__*/ _jsxs("span", { children: [ totalLabel, ": ", total ] }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-1", children: [ /*#__PURE__*/ _jsx("button", { onClick: ()=>onChange(page - 1), disabled: page === 1, className: "px-3 py-1 rounded-lg border border-gray-200 disabled:opacity-40 hover:bg-gray-50", children: "←" }), /*#__PURE__*/ _jsxs("span", { className: "px-3 py-1", children: [ page, " / ", pages ] }), /*#__PURE__*/ _jsx("button", { onClick: ()=>onChange(page + 1), disabled: page >= pages, className: "px-3 py-1 rounded-lg border border-gray-200 disabled:opacity-40 hover:bg-gray-50", children: "→" }) ] }) ] }); } // ── Activity log helpers ────────────────────────────────────────────────── function parseLogDetails(details) { try { return details ? JSON.parse(details) : null; } catch (e) { return null; } } const EVENT_META = { 'user.login': { icon: /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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: /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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: /*#__PURE__*/ _jsxs("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ _jsx("circle", { cx: "12", cy: "12", r: "10" }), /*#__PURE__*/ _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: /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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: /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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: /*#__PURE__*/ _jsxs("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ _jsx("circle", { cx: "12", cy: "12", r: "10" }), /*#__PURE__*/ _jsx("line", { x1: "15", y1: "9", x2: "9", y2: "15" }), /*#__PURE__*/ _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: /*#__PURE__*/ _jsxs("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ _jsx("polyline", { points: "3 6 5 6 21 6" }), /*#__PURE__*/ _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: /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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: /*#__PURE__*/ _jsxs("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ _jsx("line", { x1: "18", y1: "6", x2: "6", y2: "18" }), /*#__PURE__*/ _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: /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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 ActivityLogRow(param) { let { entry, dateLocale, onFilterUser, t } = param; var _EVENT_META_entry_event; const meta = (_EVENT_META_entry_event = EVENT_META[entry.event]) !== null && _EVENT_META_entry_event !== void 0 ? _EVENT_META_entry_event : { icon: /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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: entry.event, color: 'bg-gray-50 text-gray-700 border-gray-200' }; const details = parseLogDetails(entry.details); return /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 px-4 py-3 flex items-start gap-3", children: [ /*#__PURE__*/ _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 ".concat(meta.color), children: [ meta.icon, " ", t(meta.labelKey, meta.labelKey) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 flex-wrap", children: [ entry.userName && /*#__PURE__*/ _jsx("button", { onClick: ()=>entry.userId && onFilterUser(entry.userId), className: "text-sm font-medium text-gray-800 hover:text-green-600", children: entry.userName }), entry.userEmail && /*#__PURE__*/ _jsx("span", { className: "text-xs text-gray-400", children: entry.userEmail }) ] }), details && Object.keys(details).length > 0 && /*#__PURE__*/ _jsx("div", { className: "mt-1 flex flex-wrap gap-2", children: Object.entries(details).map((param)=>{ let [k, v] = param; return /*#__PURE__*/ _jsxs("span", { className: "text-xs bg-gray-100 text-gray-600 px-2 py-0.5 rounded", children: [ k, ": ", /*#__PURE__*/ _jsx("span", { className: "font-medium", children: String(v) }) ] }, k); }) }), entry.ipAddress && /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-0.5", children: entry.ipAddress }) ] }), /*#__PURE__*/ _jsx("time", { className: "shrink-0 text-xs text-gray-400 whitespace-nowrap", children: new Date(entry.createdAt).toLocaleString(dateLocale) }) ] }); } const MONTH_NAMES = [ 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec' ]; function AdminMonthChart(param) { let { series, dateLocale = 'en-US' } = param; // Collect all unique months from all series, sorted const monthSet = new Set(); series.forEach((s)=>s.data.forEach((r)=>monthSet.add(r.month))); const months = Array.from(monthSet).sort(); if (months.length === 0) return null; // Build lookup maps const seriesVals = series.map((s)=>{ const map = {}; s.data.forEach((r)=>{ map[r.month] = Number(r.count); }); return months.map((m)=>{ var _map_m; return (_map_m = map[m]) !== null && _map_m !== void 0 ? _map_m : 0; }); }); const allVals = seriesVals.flat(); const maxVal = Math.max(...allVals, 1); const W = 700; const H = 160; const padL = maxVal >= 1000000 ? 50 : maxVal >= 10000 ? 44 : maxVal >= 1000 ? 40 : 36; const padB = 24; const chartH = H - padB; const totalBars = months.length * series.length; const groupW = (W - padL - 8) / months.length; const barW = Math.max(4, Math.min(20, groupW / series.length - 2)); const yTicks = [ 0, Math.round(maxVal / 3), Math.round(maxVal * 2 / 3), maxVal ]; function barX(mi, si) { const groupStart = padL + mi * groupW + (groupW - series.length * (barW + 1)) / 2; return groupStart + si * (barW + 1); } function barHeight(v) { return v / maxVal * chartH; } return /*#__PURE__*/ _jsx("div", { className: "overflow-x-auto", children: /*#__PURE__*/ _jsxs("svg", { viewBox: "0 0 ".concat(W, " ").concat(H + 14), className: "w-full", style: { minWidth: Math.max(360, months.length * 40) }, children: [ yTicks.map((v, i)=>{ const y = chartH - v / maxVal * chartH; return /*#__PURE__*/ _jsxs("g", { children: [ /*#__PURE__*/ _jsx("line", { x1: padL, y1: y, x2: W - 4, y2: y, stroke: "#f3f4f6", strokeWidth: 1 }), /*#__PURE__*/ _jsx("text", { x: padL - 5, y: y + 3.5, textAnchor: "end", fontSize: 9, fill: "#9ca3af", children: fmtYLabel(v) }) ] }, i); }), months.map((m, mi)=>series.map((s, si)=>{ const v = seriesVals[si][mi]; const bh = barHeight(v); const x = barX(mi, si); return /*#__PURE__*/ _jsx("rect", { x: x, y: chartH - bh, width: barW, height: bh, fill: s.color, opacity: 0.8, rx: 2 }, "bar-".concat(mi, "-").concat(si)); })), months.map((m, mi)=>{ const [yr, mo] = m.slice(0, 7).split('-').map(Number); const d = new Date(Date.UTC(yr, mo - 1, 2)); const label = new Intl.DateTimeFormat(dateLocale, { month: 'short' }).format(d) + (mi === 0 || mo === 1 ? " ".concat(yr) : ''); const cx = padL + mi * groupW + groupW / 2; return /*#__PURE__*/ _jsx("text", { x: cx, y: H + 12, textAnchor: "middle", fontSize: 9, fill: "#9ca3af", children: label }, "xl-".concat(mi)); }), /*#__PURE__*/ _jsx("line", { x1: padL, y1: chartH, x2: W - 4, y2: chartH, stroke: "#e5e7eb", strokeWidth: 1 }) ] }) }); } function getLast30Days() { const days = []; for(let i = 29; i >= 0; i--){ const d = new Date(Date.now() - i * 86400000); days.push(d.toISOString().slice(0, 10)); } return days; } function smoothPath(pts) { if (pts.length < 2) return ''; let d = "M ".concat(pts[0][0].toFixed(1), " ").concat(pts[0][1].toFixed(1)); for(let i = 1; i < pts.length; i++){ const cpx = ((pts[i - 1][0] + pts[i][0]) / 2).toFixed(1); d += " C ".concat(cpx, " ").concat(pts[i - 1][1].toFixed(1), " ").concat(cpx, " ").concat(pts[i][1].toFixed(1), " ").concat(pts[i][0].toFixed(1), " ").concat(pts[i][1].toFixed(1)); } return d; } function fmtYLabel(v) { if (v >= 1000000) return "".concat(+(v / 1000000).toFixed(1), "M"); if (v >= 1000) return "".concat(Math.round(v / 1000), "K"); return String(v); } function AdminAreaChart(param) { let { series, days: daysProp } = param; const days = daysProp !== null && daysProp !== void 0 ? daysProp : getLast30Days(); const seriesVals = series.map((s)=>{ const map = {}; s.data.forEach((r)=>{ map[r.day] = Number(r.count); }); return days.map((d)=>{ var _map_d; return (_map_d = map[d]) !== null && _map_d !== void 0 ? _map_d : 0; }); }); const allVals = seriesVals.flat(); const maxVal = Math.max(...allVals, 1); const W = 700; const H = 160; const padL = maxVal >= 10000 ? 44 : maxVal >= 1000 ? 40 : 36; const padB = 22; const chartW = W - padL - 4; const chartH = H - padB; const stepX = chartW / (days.length - 1); function pts(vals) { return vals.map((v, i)=>[ padL + i * stepX, chartH - v / maxVal * chartH ]); } function areaPath(vals) { const points = pts(vals); const line = smoothPath(points); if (!line) return ''; const lastX = points[points.length - 1][0].toFixed(1); return "".concat(line, " L ").concat(lastX, " ").concat(chartH.toFixed(1), " L ").concat(padL.toFixed(1), " ").concat(chartH.toFixed(1), " Z"); } // Y-axis: 4 labels (0, 1/3, 2/3, max) const yTicks = [ 0, Math.round(maxVal / 3), Math.round(maxVal * 2 / 3), maxVal ]; // X-axis: every 7 days + last const xTicks = days.map((d, i)=>({ i, label: d.slice(8) })).filter((_, i)=>i % 7 === 0 || i === days.length - 1); return /*#__PURE__*/ _jsx("div", { className: "overflow-x-auto", children: /*#__PURE__*/ _jsxs("svg", { viewBox: "0 0 ".concat(W, " ").concat(H + 12), className: "w-full", style: { minWidth: 360 }, children: [ yTicks.map((v, i)=>{ const y = chartH - v / maxVal * chartH; return /*#__PURE__*/ _jsxs("g", { children: [ /*#__PURE__*/ _jsx("line", { x1: padL, y1: y, x2: W - 4, y2: y, stroke: "#f3f4f6", strokeWidth: 1 }), /*#__PURE__*/ _jsx("text", { x: padL - 5, y: y + 3.5, textAnchor: "end", fontSize: 9, fill: "#9ca3af", children: fmtYLabel(v) }) ] }, i); }), xTicks.map((param)=>{ let { i } = param; const x = padL + i * stepX; return /*#__PURE__*/ _jsx("line", { x1: x, y1: 0, x2: x, y2: chartH, stroke: "#f9fafb", strokeWidth: 1 }, "vg-".concat(i)); }), xTicks.map((param)=>{ let { i, label } = param; return /*#__PURE__*/ _jsx("text", { x: padL + i * stepX, y: H + 10, textAnchor: "middle", fontSize: 9, fill: "#9ca3af", children: label }, i); }), series.map((s, si)=>/*#__PURE__*/ _jsx("path", { d: areaPath(seriesVals[si]), fill: s.fill }, "fill-".concat(si))), series.map((s, si)=>/*#__PURE__*/ _jsx("path", { d: smoothPath(pts(seriesVals[si])), fill: "none", stroke: s.color, strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round" }, "line-".concat(si))), series.map((s, si)=>{ const points = pts(seriesVals[si]); const last = points[points.length - 1]; return /*#__PURE__*/ _jsx("g", { children: /*#__PURE__*/ _jsx("circle", { cx: last[0], cy: last[1], r: 4, fill: "white", stroke: s.color, strokeWidth: 2 }) }, "dot-".concat(si)); }), /*#__PURE__*/ _jsx("line", { x1: padL, y1: chartH, x2: W - 4, y2: chartH, stroke: "#e5e7eb", strokeWidth: 1 }) ] }) }); } ` öÿÿ£öÿÿ €öÿÿÎôÿÿÌõÿÿ÷ÿÿþ,÷ÿÿ -÷ÿÿ.÷ÿÿ/÷ÿÿl÷ÿÿ0÷ÿÿm÷ÿÿab947bd5ab5627234÷ÿÿÌôÿÿ  5÷ÿÿ `‹getCatLabel‹getLocLabel’CategoryIconPickerŽAdminCatPickerŽAdminLocPickerŠDbCheckTab‡LocTree‡CatTree‰SkillForm‹SkillsPanelŠPaginationparseLogDetailsŽActivityLogRowAdminMonthChartgetLast30DaysŠsmoothPath‰fmtYLabelŽAdminAreaChartTEMPLATE_VARS’TEMPLATE_HINT_VARSDEFAULT_CATEGORY_ICON_PRESETS[÷ÿÿ‰AdminPage‘SKILL_LANG_LABELSŠEVENT_META‹MONTH_NAMES •mÿyB«õÿÿ°õÿÿ ` dÿÿý€ `=@“ a=@“€ A”È `4€ AÉõ `,€ Aö `€ A< `(€ A=j `-€ AkŒ `!€ A± `$€ A²å `3€ Aæ `/€ AO c 9 Aþv°ü  Aïv°ü  @Ö@+3÷ÿÿ A™8ž8 @¹`@¹`80 AŒ8Ó8 @¹`@¹`S/÷ÿÿ A€7 Ÿ7  @Ý!`Q@Ý!`p0 A£7 º7  @Ý!`QAÝ!‹+÷ÿÿ AMQ lQ  @"`Y@"`x0 ApQ ‡Q  @"`YA"“'÷ÿÿ Aù‚ ƒ  @§"`mA§"Œ0 Aƒ 3ƒ  @§"`mA§"§#÷ÿÿ A– 8–  @Ë"`uAË"”0 A<– S–  @Ë"`uAË"¯ @ðøöÿÿøöÿÿ a=@“žôÿÿžôÿÿ `4E÷ÿÿE÷ÿÿ `,F÷ÿÿF÷ÿÿ `G÷ÿÿG÷ÿÿ `(H÷ÿÿH÷ÿÿ `-I÷ÿÿI÷ÿÿ `!H÷ÿÿH÷ÿÿ `$ I÷ÿÿI÷ÿÿ `3 wùÿÿwùÿÿ `/` ™@/components/CategoryIconÿ c 9 ×÷ÿÿØ÷ÿÿ Aµ º    F÷ÿÿèöÿÿèöÿÿý @P`@P` Ò÷ÿÿÓ÷ÿÿ A!!  ûäöÿÿäöÿÿþ @S`@S` òöÿÿóöÿÿ AÊ!Î!  ÷àöÿÿàöÿÿþ @V`"@V`& îöÿÿïöÿÿ Ap"t"  óÜöÿÿÜöÿÿþ @X`0@X`4 ŒCategoryIconþ Au"" 4î` ééþ @X`5@X`A åöÿÿæöÿÿ AÁ#Å#  êÓöÿÿÓöÿÿþ @_`"@_`& œ÷ÿÿŸ÷ÿÿ A3%8%  æÏöÿÿÏöÿÿþ @g`@g` ¹÷ÿÿº÷ÿÿ A¶%»%  âËöÿÿËöÿÿþ @j`"@j`' ÙöÿÿÚöÿÿ Ak'o'  ÞÇöÿÿÇöÿÿþ @n`*@n`. ÕöÿÿÖöÿÿ Aš*ž*  ÚÃöÿÿÃöÿÿþ @}`"@}`& ÑöÿÿÒöÿÿ As+w+  Ö¿öÿÿ¿öÿÿþ @ƒ`@ƒ` ÍöÿÿÎöÿÿ A8,<,  Ò»öÿÿ»öÿÿþ @‡`"@‡`& ÉöÿÿÊöÿÿ AÈ,Ì,  ηöÿÿ·öÿÿþ @‹`@‹` ¡÷ÿÿ¢÷ÿÿ A¿-Ä-  ʳöÿÿ³öÿÿþ @`)@`. ÁöÿÿÂöÿÿ Aã/ç/  Ưöÿÿ¯öÿÿþ @–`*@–`.ÔÓ Aè/ô/ 4Ã` ŸŸþ @–`/@–`; ºöÿÿ»öÿÿ A=1A1  ¿šöÿÿšöÿÿþ @œ`*@œ`. «öÿÿªöÿÿ A 33   ÷ÿÿJôÿÿJôÿÿý @©`@©`$ Šöÿÿ¥öÿÿ A<3D3  ûFôÿÿFôÿÿþ @ª` @ª`( ¢öÿÿ¡öÿÿ Az3‚3  ÷BôÿÿBôÿÿþ @«`0@«`8 7÷ÿÿ6÷ÿÿ Aš3 3  ó>ôÿÿ>ôÿÿþ @¬`@¬`  öÿÿŸöÿÿ A¬3µ3  ï:ôÿÿ:ôÿÿþ @­@­`  }÷ÿÿ~÷ÿÿ Ag6l6  ëöÿÿöÿÿþ @œ`@œ` y÷ÿÿz÷ÿÿ AÕ6Ú6  ç‹öÿÿ‹öÿÿþ @Á`@Á` ™öÿÿšöÿÿ A‰88  ã‡öÿÿ‡öÿÿþ @Æ`"@Æ`& •öÿÿ–öÿÿ AŒ9À9  ߃öÿÿƒöÿÿþ @Ì`0@Ì`4 ‘öÿÿ’öÿÿ AÊ:Î:  Ûöÿÿöÿÿþ @Ò`"@Ò`& öÿÿŽöÿÿ A~;‚;  ×{öÿÿ{öÿÿþ @Ö`"@Ö`& ‰öÿÿŠöÿÿ Aæ<ê<  Ówöÿÿwöÿÿþ @Ü`0@Ü`4 a÷ÿÿb÷ÿÿ A> >  Ïsöÿÿsöÿÿþ @ä`"@ä`' öÿÿ‚öÿÿ Aþ>?  Ëoöÿÿoöÿÿþ @ç`"@ç`& }öÿÿ~öÿÿ A›?Ÿ?  Çköÿÿköÿÿþ @é`0@é`4 U÷ÿÿV÷ÿÿ ADD  Ãgöÿÿgöÿÿþ @ù`-@ù`2 Q÷ÿÿR÷ÿÿ AuDzD  ¿cöÿÿcöÿÿþ @û`.@û`3 qöÿÿröÿÿ AÜGàG  »_öÿÿ_öÿÿþ @`D@`H„ƒ AáGíG 4ž` nÿÿÿnÿÿÿþ @`I@`U jöÿÿköÿÿ A‹II  ŽXöÿÿXöÿÿþ @`6@`: föÿÿgöÿÿ A€JšJ  °TöÿÿTöÿÿþ @`O@`S böÿÿcöÿÿ AL‘L  ¬PöÿÿPöÿÿþ @`D@`H :÷ÿÿ;÷ÿÿ A‚N‡N  šLöÿÿLöÿÿþ @ `h@ `m Zöÿÿ[öÿÿ AõPùP  €HöÿÿHöÿÿþ @)`:@)`> VöÿÿWöÿÿ AÙQÝQ   DöÿÿDöÿÿþ @,`:@,`> GöÿÿFöÿÿ AT#T   öÿÿæóÿÿæóÿÿý @<`@<`$ BöÿÿAöÿÿ ALTTT  ûâóÿÿâóÿÿþ @=` @=`( >öÿÿ=öÿÿ A†TŽT  ÷ÞóÿÿÞóÿÿþ @>`,@>`4 ÓöÿÿÒöÿÿ AŠT¬T  óÚóÿÿÚóÿÿþ @?`@?` <öÿÿ;öÿÿ AžTÁT  ïÖóÿÿÖóÿÿþ @@@@`  ÷ÿÿ÷ÿÿ ArWwW  ë+öÿÿ+öÿÿþ @P`@P` ÷ÿÿ÷ÿÿ AàWåW  ç'öÿÿ'öÿÿþ @T`@T` ÷ÿÿ÷ÿÿ A”Y™Y  ã#öÿÿ#öÿÿþ @Y`"@Y`' 1öÿÿ2öÿÿ AæZêZ  ßöÿÿöÿÿþ @``*@``. -öÿÿ.öÿÿ A(\,\  Ûöÿÿöÿÿþ @e`*@e`. )öÿÿ*öÿÿ Aa]e]  ×öÿÿöÿÿþ @l`"@l`& %öÿÿ&öÿÿ A^^  Óöÿÿöÿÿþ @p`"@p`& !öÿÿ"öÿÿ A}__  Ïöÿÿöÿÿþ @v`0@v`4 ùöÿÿúöÿÿ A›` `  Ë öÿÿ öÿÿþ @~`"@~`' öÿÿöÿÿ A•a™a  Çöÿÿöÿÿþ @`"@`& öÿÿöÿÿ A2b6b  Ãöÿÿöÿÿþ @ƒ`0@ƒ`4 íöÿÿîöÿÿ A˜ff  ¿ÿõÿÿÿõÿÿþ @“`-@“`2 éöÿÿêöÿÿ Aýfg  »ûõÿÿûõÿÿþ @•`.@•`3  öÿÿ öÿÿ AOjSj  ·÷õÿÿ÷õÿÿþ @¢`6@¢`: öÿÿöÿÿ A~k‚k  ³óõÿÿóõÿÿþ @Š`D@Š`H öÿÿöÿÿ Aîlòl  ¯ïõÿÿïõÿÿþ @ª`6@ª`: ýõÿÿþõÿÿ An n  «ëõÿÿëõÿÿþ @®`P@®`T ùõÿÿúõÿÿ Aïoóo  §çõÿÿçõÿÿþ @Ž`D@Ž`H ÑöÿÿÒöÿÿ Aáqæq  £ãõÿÿãõÿÿþ @Œ`e@Œ`j ñõÿÿòõÿÿ APtTt  Ÿßõÿÿßõÿÿþ @Å`:@Å`> íõÿÿîõÿÿ A4u8u  ›ÛõÿÿÛõÿÿþ @È`:@È`>«þÿÿ7öÿÿ @Ö@+ 9öÿÿ8öÿÿ AUw^w   3öÿÿ$öÿÿ$öÿÿý @Ø`@Ø` ?öÿÿ>öÿÿ A‹w•w  û$öÿÿ$öÿÿþ @Ù`)@Ù`3 @öÿÿ?öÿÿ A³wŒw  ÷"öÿÿ"öÿÿþ @Ú`@Ú`# ÐõÿÿÏõÿÿ AÚwâw  ópóÿÿpóÿÿþ @Û`@Û`" ÌõÿÿËõÿÿ A!x)x  ïlóÿÿlóÿÿþ @Ü`4@Ü`< ÎõÿÿÍõÿÿ A6x?x  ëhóÿÿhóÿÿþ @Ý@Ý`  ÄõÿÿÃõÿÿ AŽxŒx  çdóÿÿdóÿÿþ @á`@á`& Àõÿÿ¿õÿÿ Aïx÷x  ã`óÿÿ`óÿÿþ @ã`@ã`& Œõÿÿ»õÿÿ A#y+y  ß\óÿÿ\óÿÿþ @ä`&@ä`. žõÿÿ·õÿÿ AXy`y  ÛXóÿÿXóÿÿþ @å`(@å`0 Žõÿÿ³õÿÿ A…yy  ×TóÿÿTóÿÿþ @æ` @æ`( °õÿÿ¯õÿÿ AœyÅy  ÓPóÿÿPóÿÿþ @ç`*@ç`2 ¬õÿÿ«õÿÿ Añyùy  ÏLóÿÿLóÿÿþ @è`&@è`. šõÿÿ§õÿÿ A*z2z  ËHóÿÿHóÿÿþ @ê`@ê`& €õÿÿ£õÿÿ A^zfz  ÇDóÿÿDóÿÿþ @ë`&@ë`.  õÿÿŸõÿÿ A“z›z  Ã@óÿÿ@óÿÿþ @ì`(@ì`0 œõÿÿ›õÿÿ AÀzÈz  ¿<óÿÿ<óÿÿþ @í` @í`( ˜õÿÿ—õÿÿ Aøz{  »8óÿÿ8óÿÿþ @î`*@î`2 ”õÿÿ“õÿÿ A0{8{  ·4óÿÿ4óÿÿþ @ï`*@ï`2 õÿÿõÿÿ Ao{w{  ³0óÿÿ0óÿÿþ @ñ`"@ñ`* Œõÿÿ‹õÿÿ A§{¯{  ¯,óÿÿ,óÿÿþ @ò`*@ò`2 ˆõÿÿ‡õÿÿ Aà{è{  «(óÿÿ(óÿÿþ @ó`,@ó`4 „õÿÿƒõÿÿ A'|/|  §$óÿÿ$óÿÿþ @ô`:@ô`B €õÿÿõÿÿ Aˆ||  £ óÿÿ óÿÿþ @ö`2@ö`: |õÿÿ{õÿÿ AÐ|Ø|  Ÿóÿÿóÿÿþ @÷`:@÷`B xõÿÿwõÿÿ A}!}  ›óÿÿóÿÿþ @ø`<@ø`D tõÿÿsõÿÿ Af}n}  —óÿÿóÿÿþ @ù`@@ù`H põÿÿoõÿÿ A­}µ}  “óÿÿóÿÿþ @ú`6@ú`> lõÿÿkõÿÿ A~ ~   óÿÿ óÿÿþ @ü`0@ü`8 hõÿÿgõÿÿ A9~A~  ‹óÿÿóÿÿþ @ý`*@ý`2 dõÿÿcõÿÿ Ar~z~  ‡óÿÿóÿÿþ @þ`,@þ`4 `õÿÿ_õÿÿ A­~µ~  ƒóÿÿóÿÿþ @ÿ`.@ÿ`6 \õÿÿ[õÿÿ Aå~í~  ÿÿÿüòÿÿüòÿÿþ @`*@`2 XõÿÿWõÿÿ A  {ÿÿÿøòÿÿøòÿÿþ @`$@`, TõÿÿSõÿÿ AS[  wÿÿÿôòÿÿôòÿÿþ @`.@`6 PõÿÿOõÿÿ A‘™  sÿÿÿðòÿÿðòÿÿþ @`0@`8 LõÿÿKõÿÿ AÕÝ  oÿÿÿìòÿÿìòÿÿþ @`4@`< HõÿÿGõÿÿ A€#€  kÿÿÿèòÿÿèòÿÿþ @`8@`@ DõÿÿCõÿÿ AW€_€  gÿÿÿäòÿÿäòÿÿþ @`@`$ @õÿÿ?õÿÿ A‰€‘€  cÿÿÿàòÿÿàòÿÿþ @`$@`, <õÿÿ;õÿÿ AŒ€Ä€  _ÿÿÿÜòÿÿÜòÿÿþ @ `&@ `. 8õÿÿ7õÿÿ A  [ÿÿÿØòÿÿØòÿÿþ @ `*@ `2 4õÿÿ3õÿÿ ADL  WÿÿÿÔòÿÿÔòÿÿþ @ `.@ `6 0õÿÿ/õÿÿ A}…  SÿÿÿÐòÿÿÐòÿÿþ @ `,@ `4 ,õÿÿ+õÿÿ AžÀ  OÿÿÿÌòÿÿÌòÿÿþ @`.@`6 (õÿÿ'õÿÿ Aöþ  KÿÿÿÈòÿÿÈòÿÿþ @`0@`8 $õÿÿ#õÿÿ A8‚@‚  GÿÿÿÄòÿÿÄòÿÿþ @`4@`<  õÿÿõÿÿ Av‚~‚  CÿÿÿÀòÿÿÀòÿÿþ @`0@`8 õÿÿõÿÿ AŒ‚Ä‚  ?ÿÿÿŒòÿÿŒòÿÿþ @`8@`@ õÿÿõÿÿ Aý‚ƒ  ;ÿÿÿžòÿÿžòÿÿþ @`"@`* õÿÿõÿÿ A1ƒ9ƒ  7ÿÿÿŽòÿÿŽòÿÿþ @`&@`. õÿÿõÿÿ Abƒjƒ  3ÿÿÿ°òÿÿ°òÿÿþ @`$@`,  õÿÿ õÿÿ A•ƒƒ  /ÿÿÿ¬òÿÿ¬òÿÿþ @`&@`. õÿÿõÿÿ Aσ׃  +ÿÿÿšòÿÿšòÿÿþ @`,@`4 õÿÿõÿÿ A„ „  'ÿÿÿ€òÿÿ€òÿÿþ @`(@`0 õÿÿÿôÿÿ AC„K„  #ÿÿÿ òÿÿ òÿÿþ @`0@`8 üôÿÿûôÿÿ A„•„  ÿÿÿœòÿÿœòÿÿþ @`(@`0 øôÿÿ÷ôÿÿ A܄ä„  ÿÿÿ˜òÿÿ˜òÿÿþ @`&@`. ôôÿÿóôÿÿ A… …  ÿÿÿ”òÿÿ”òÿÿþ @`.@`6 ðôÿÿïôÿÿ AU…]…  ÿÿÿòÿÿòÿÿþ @ `0@ `8 ìôÿÿëôÿÿ A…˜…  ÿÿÿŒòÿÿŒòÿÿþ @!`.@!`6 èôÿÿçôÿÿ A΅օ   ÿÿÿˆòÿÿˆòÿÿþ @"`0@"`8 äôÿÿãôÿÿ A††  ÿÿÿ„òÿÿ„òÿÿþ @#`6@#`> àôÿÿßôÿÿ AR†Z†  ÿÿÿ€òÿÿ€òÿÿþ @$`2@$`: ÜôÿÿÛôÿÿ Aª†²†  ÿþÿÿ|òÿÿ|òÿÿþ @&`*@&`2 Øôÿÿ×ôÿÿ Aކæ†  ûþÿÿxòÿÿxòÿÿþ @'`&@'`. ÔôÿÿÓôÿÿ A-‡5‡  ÷þÿÿtòÿÿtòÿÿþ @)`*@)`2 ÐôÿÿÏôÿÿ Ag‡o‡  óþÿÿpòÿÿpòÿÿþ @*`,@*`4 ÌôÿÿËôÿÿ Až‡Š‡  ïþÿÿlòÿÿlòÿÿþ @+`*@+`2 ÈôÿÿÇôÿÿ Aهᇠ ëþÿÿhòÿÿhòÿÿþ @,`.@,`6 ÄôÿÿÃôÿÿ Aˆˆ  çþÿÿdòÿÿdòÿÿþ @-`*@-`2 Àôÿÿ¿ôÿÿ AIˆQˆ  ãþÿÿ`òÿÿ`òÿÿþ @.`*@.`2 Œôÿÿ»ôÿÿ AŠˆ’ˆ  ßþÿÿ\òÿÿ\òÿÿþ @/`0@/`8 žôÿÿ·ôÿÿ Aֈވ  ÛþÿÿXòÿÿXòÿÿþ @1`$@1`, Žôÿÿ³ôÿÿ A‰‰  ×þÿÿTòÿÿTòÿÿþ @2`0@2`8 °ôÿÿ¯ôÿÿ AW‰_‰  ÓþÿÿPòÿÿPòÿÿþ @3`0@3`8 ¬ôÿÿ«ôÿÿ A’‰š‰  ÏþÿÿLòÿÿLòÿÿþ @4`*@4`2 šôÿÿ§ôÿÿ AӉۉ  ËþÿÿHòÿÿHòÿÿþ @5`,@5`4 €ôÿÿ£ôÿÿ A ŠŠ  ÇþÿÿDòÿÿDòÿÿþ @6`(@6`0  ôÿÿŸôÿÿ AGŠOŠ  Ãþÿÿ@òÿÿ@òÿÿþ @7`.@7`6 œôÿÿ›ôÿÿ A‘ЙР ¿þÿÿ<òÿÿ<òÿÿþ @8`<@8`D ˜ôÿÿ—ôÿÿ AԊ܊  »þÿÿ8òÿÿ8òÿÿþ @9`2@9`: ”ôÿÿ“ôÿÿ A ‹‹  ·þÿÿ4òÿÿ4òÿÿþ @:`(@:`0 ôÿÿôÿÿ AH‹P‹  ³þÿÿ0òÿÿ0òÿÿþ @;`0@;`8 Œôÿÿ‹ôÿÿ A†‹Ž‹  ¯þÿÿ,òÿÿ,òÿÿþ @<`0@<`8 ˆôÿÿ‡ôÿÿ Aŋ͋  «þÿÿ(òÿÿ(òÿÿþ @>`$@>`, „ôÿÿƒôÿÿ A÷‹ÿ‹  §þÿÿ$òÿÿ$òÿÿþ @?`$@?`, €ôÿÿôÿÿ A/Œ7Œ  £þÿÿ òÿÿ òÿÿþ @@`(@@`0 |ôÿÿ{ôÿÿ AsŒ{Œ  Ÿþÿÿòÿÿòÿÿþ @B`"@B`* xôÿÿwôÿÿ A£Œ«Œ  ›þÿÿòÿÿòÿÿþ @C`"@C`* tôÿÿsôÿÿ Aٌጠ —þÿÿòÿÿòÿÿþ @D`&@D`. pôÿÿoôÿÿ A  “þÿÿòÿÿòÿÿþ @E`*@E`2 lôÿÿkôÿÿ A]e  þÿÿ òÿÿ òÿÿþ @G`"@G`* hôÿÿgôÿÿ A•  ‹þÿÿòÿÿòÿÿþ @H`"@H`* dôÿÿcôÿÿ AÍˍ  ‡þÿÿòÿÿòÿÿþ @I`&@I`. `ôÿÿ_ôÿÿ AþŽ  ƒþÿÿòÿÿòÿÿþ @J`*@J`2 \ôÿÿ[ôÿÿ AGŽOŽ  þÿÿüñÿÿüñÿÿþ @K`4@K`< XôÿÿWôÿÿ A„ŽŒŽ  {þÿÿøñÿÿøñÿÿþ @L`,@L`4 TôÿÿSôÿÿ AΎ֎  wþÿÿôñÿÿôñÿÿþ @M`:@M`B PôÿÿOôÿÿ ADL  sþÿÿðñÿÿðñÿÿþ @O`6@O`> LôÿÿKôÿÿ A‰‘  oþÿÿìñÿÿìñÿÿþ @P`0@P`8 HôÿÿGôÿÿ Aˏӏ  kþÿÿèñÿÿèñÿÿþ @Q`4@Q`< DôÿÿCôÿÿ A  gþÿÿäñÿÿäñÿÿþ @R`&@R`. @ôÿÿ?ôÿÿ A@H  cþÿÿàñÿÿàñÿÿþ @S`*@S`2 <ôÿÿ;ôÿÿ A‹“  _þÿÿÜñÿÿÜñÿÿþ @U`*@U`2 8ôÿÿ7ôÿÿ AʐҐ  [þÿÿØñÿÿØñÿÿþ @V`*@V`2 4ôÿÿ3ôÿÿ Ap‘x‘  WþÿÿÔñÿÿÔñÿÿþ @\`.@\`6 0ôÿÿ/ôÿÿ A­‘µ‘  SþÿÿÐñÿÿÐñÿÿþ @]`,@]`4 ,ôÿÿ+ôÿÿ Aâ‘ê‘  OþÿÿÌñÿÿÌñÿÿþ @^`$@^`, (ôÿÿ'ôÿÿ AŸ’Æ’  KþÿÿÈñÿÿÈñÿÿþ @g`(@g`0 $ôÿÿ#ôÿÿ Aõ’ý’  GþÿÿÄñÿÿÄñÿÿþ @h`&@h`.  ôÿÿôÿÿ A:“B“  CþÿÿÀñÿÿÀñÿÿþ @i`4@i`< ôÿÿôÿÿ A}“…“  ?þÿÿŒñÿÿŒñÿÿþ @j`2@j`: ôÿÿôÿÿ Aœ“Å“  ;þÿÿžñÿÿžñÿÿþ @k`0@k`8 ôÿÿôÿÿ Að·ø·  7þÿÿŽñÿÿŽñÿÿþ @­`2@­`: ôÿÿôÿÿ A0ž8ž  3þÿÿ°ñÿÿ°ñÿÿþ @®`0@®`8  ôÿÿ ôÿÿ Apžxž  /þÿÿ¬ñÿÿ¬ñÿÿþ @¯`0@¯`8 ôÿÿôÿÿ A»žÃž  +þÿÿšñÿÿšñÿÿþ @°`:@°`B ôÿÿôÿÿ Aðžøž  'þÿÿ€ñÿÿ€ñÿÿþ @±`$@±`, ôÿÿÿóÿÿ AٹṠ #þÿÿ ñÿÿ ñÿÿþ @º`(@º`0 üóÿÿûóÿÿ Aºº  þÿÿœñÿÿœñÿÿþ @»`&@»`. øóÿÿ÷óÿÿ AMºUº  þÿÿ˜ñÿÿ˜ñÿÿþ @Œ`,@Œ`4 ôóÿÿóóÿÿ AϺ׺  þÿÿ”ñÿÿ”ñÿÿþ @Á`0@Á`8 ðóÿÿïóÿÿ A»»  þÿÿñÿÿñÿÿþ @Â`.@Â`6 ìóÿÿëóÿÿ AA»I»  þÿÿŒñÿÿŒñÿÿþ @Ã`"@Ã`* èóÿÿçóÿÿ A±Œ¹Œ   þÿÿˆñÿÿˆñÿÿþ @Ð`&@Ð`. äóÿÿãóÿÿ AæŒîŒ  þÿÿ„ñÿÿ„ñÿÿþ @Ñ`$@Ñ`, àóÿÿßóÿÿ Aœ'œ  þÿÿ€ñÿÿ€ñÿÿþ @Ò`(@Ò`0 ÜóÿÿÛóÿÿ AWœ_œ  ÿýÿÿ|ñÿÿ|ñÿÿþ @Ó`(@Ó`0 Øóÿÿ×óÿÿ A?ŸGŸ  ûýÿÿxñÿÿxñÿÿþ @Ý`,@Ý`4 ÔóÿÿÓóÿÿ AzŸ‚Ÿ  ÷ýÿÿtñÿÿtñÿÿþ @Þ`*@Þ`2 ÐóÿÿÏóÿÿ A·Ÿ¿Ÿ  óýÿÿpñÿÿpñÿÿþ @ß`,@ß`4 ÌóÿÿËóÿÿ AͿտ  ïýÿÿlñÿÿlñÿÿþ @é`0@é`8 ÈóÿÿÇóÿÿ A ÀÀ  ëýÿÿhñÿÿhñÿÿþ @ê`.@ê`6 ÄóÿÿÃóÿÿ AYÀaÀ  çýÿÿdñÿÿdñÿÿþ @ë`<@ë`D Àóÿÿ¿óÿÿ AªÀ²À  ãýÿÿ`ñÿÿ`ñÿÿþ @ì`@@ì`H Œóÿÿ»óÿÿ AýÀÁ  ßýÿÿ\ñÿÿ\ñÿÿþ @í`B@í`J žóÿÿ·óÿÿ ASÁ[Á  ÛýÿÿXñÿÿXñÿÿþ @î`F@î`N Žóÿÿ³óÿÿ A‘Á™Á  ×ýÿÿTñÿÿTñÿÿþ @ï`.@ï`6 °óÿÿ¯óÿÿ AÙÁáÁ  ÓýÿÿPñÿÿPñÿÿþ @ð`8@ð`@ ¬óÿÿ«óÿÿ A'Â/  ÏýÿÿLñÿÿLñÿÿþ @ñ`@@ñ`H šóÿÿ§óÿÿ A~†Â  ËýÿÿHñÿÿHñÿÿþ @ò`F@ò`N €óÿÿ£óÿÿ AÒÂÚ  ÇýÿÿDñÿÿDñÿÿþ @ô`6@ô`>  óÿÿŸóÿÿ AÃà  Ãýÿÿ@ñÿÿ@ñÿÿþ @õ`4@õ`< œóÿÿ›óÿÿ ATÃ\à  ¿ýÿÿ<ñÿÿ<ñÿÿþ @ö`,@ö`4 ˜óÿÿ—óÿÿ AœÃ€Ã  »ýÿÿ8ñÿÿ8ñÿÿþ @÷`:@÷`B ”óÿÿ“óÿÿ AãÃëà  ·ýÿÿ4ñÿÿ4ñÿÿþ @ø`6@ø`> óÿÿóÿÿ A#Ä+Ä  ³ýÿÿ0ñÿÿ0ñÿÿþ @ù`2@ù`: Œóÿÿ‹óÿÿ AfÄnÄ  ¯ýÿÿ,ñÿÿ,ñÿÿþ @ú`2@ú`: ˆóÿÿ‡óÿÿ AšÄ°Ä  «ýÿÿ(ñÿÿ(ñÿÿþ @û`2@û`: „óÿÿƒóÿÿ AÞÄæÄ  §ýÿÿ$ñÿÿ$ñÿÿþ @ü`&@ü`. €óÿÿóÿÿ AÅ&Å  £ýÿÿ ñÿÿ ñÿÿþ @ý`0@ý`8 |óÿÿ{óÿÿ AzƂÆ  Ÿýÿÿñÿÿñÿÿþ @`(@`0 xóÿÿwóÿÿ AÀÆÈÆ  ›ýÿÿñÿÿñÿÿþ @`6@`> tóÿÿsóÿÿ A÷ÆÿÆ  —ýÿÿñÿÿñÿÿþ @ `&@ `. póÿÿoóÿÿ A5Ç=Ç  “ýÿÿñÿÿñÿÿþ @ `.@ `6 lóÿÿkóÿÿ AƒÇ‹Ç  ýÿÿ ñÿÿ ñÿÿþ @ `>@ `F hóÿÿgóÿÿ AµÇœÇ  ‹ýÿÿñÿÿñÿÿþ @ `$@ `, dóÿÿcóÿÿ AñÇùÇ  ‡ýÿÿñÿÿñÿÿþ @ `,@ `4 `óÿÿ_óÿÿ A€ÈˆÈ  ƒýÿÿñÿÿñÿÿþ @`.@`6 \óÿÿ[óÿÿ AÄÈÌÈ  ýÿÿüðÿÿüðÿÿþ @`4@`< XóÿÿWóÿÿ A ÉÉ  {ýÿÿøðÿÿøðÿÿþ @`6@`> TóÿÿSóÿÿ A•ɝÉ  wýÿÿôðÿÿôðÿÿþ @`$@`, PóÿÿOóÿÿ AàÉèÉ  sýÿÿððÿÿððÿÿþ @`4@`< LóÿÿKóÿÿ AÊÊ  oýÿÿìðÿÿìðÿÿþ @`&@`. HóÿÿGóÿÿ AFÊNÊ  kýÿÿèðÿÿèðÿÿþ @`$@`, DóÿÿCóÿÿ AxʀÊ  gýÿÿäðÿÿäðÿÿþ @`$@`, @óÿÿ?óÿÿ A¿ÊÇÊ  cýÿÿàðÿÿàðÿÿþ @`2@`: <óÿÿ;óÿÿ AýÊË  _ýÿÿÜðÿÿÜðÿÿþ @`0@`8 8óÿÿ7óÿÿ A7Ë?Ë  [ýÿÿØðÿÿØðÿÿþ @`*@`2 4óÿÿ3óÿÿ ApËxË  WýÿÿÔðÿÿÔðÿÿþ @`(@`0 0óÿÿ/óÿÿ AŠË®Ë  SýÿÿÐðÿÿÐðÿÿþ @`&@`. ,óÿÿ+óÿÿ AØËàË  OýÿÿÌðÿÿÌðÿÿþ @`"@`* .óÿÿ-óÿÿ A‹Ì”Ì  KýÿÿÈðÿÿÈðÿÿþ @@`  *óÿÿ)óÿÿ AÑÍÚÍ  GýÿÿÄðÿÿÄðÿÿþ @'@'`  getAdminStatsƒapi AÎÎ  AÎ Î  @ýÿÿmóÿÿmóÿÿý @)@)` ’getAdminNotifStatsù AAÎWÎ  AAÎDÎ  :ýÿÿgóÿÿgóÿÿý @*@*` ‘getAdminMailStatsó A†Î›Î  A†Î‰Î  4ýÿÿaóÿÿaóÿÿý @+@+` getAdminReportsí AÈÎÛÎ  AÈÎËÎ  .ýÿÿ[óÿÿ[óÿÿý @,@,` —getAdminSpecialistCardsç A,ÏGÏ  A,Ï/Ï  (ýÿÿUóÿÿUóÿÿý @-@-`# óÿÿóÿÿ A³ÏŒÏ  $ýÿÿ¡ðÿÿ¡ðÿÿþ @1@1`  getAdminUsersÝ AÐ'Ð  AÐÐ  ýÿÿKóÿÿKóÿÿý @4@4` ýòÿÿüòÿÿ AOÑXÑ  ýÿÿ—ðÿÿ—ðÿÿþ @?@?`  getAdminTasksÓ A²ÑÃÑ  A²ÑµÑ  ýÿÿAóÿÿAóÿÿý @B@B` óòÿÿòòÿÿ AïÒøÒ  ýÿÿðÿÿðÿÿþ @M@M`  ÜÊ ATÓgÓ  ATÓWÓ   ýÿÿ8óÿÿ8óÿÿý @P@P` êòÿÿéòÿÿ AGÔPÔ  ýÿÿ„ðÿÿ„ðÿÿþ @Y@Y`  ÙÁ AŸÔÙÔ  AŸÔÁÔ  ýÿÿ/óÿÿ/óÿÿý @\@\`# áòÿÿàòÿÿ AòÕûÕ  þüÿÿ{ðÿÿ{ðÿÿþ @e@e`  –getAdminSupportTickets· AS×m×  AS×V×  øüÿÿ%óÿÿ%óÿÿý @o@o`" ×òÿÿÖòÿÿ AØ–Ø  ôüÿÿqðÿÿqðÿÿþ @{@{`  –getAdminBalanceHistory­ AóØ Ù  AóØöØ  îüÿÿóÿÿóÿÿý @~@~`" ÍòÿÿÌòÿÿ A—Ú Ú  êüÿÿgðÿÿgðÿÿþ @@`  ŽgetAdminAiLogs£ A$Û6Û  A$Û'Û  äüÿÿóÿÿóÿÿý @‘` @‘` ”getAdminActivityLogs AÜ&Ü  AÜÜ  Þüÿÿ óÿÿ óÿÿý @–` @–`$ getAdminMailLogs— A§Þ»Þ  A§ÞªÞ  Øüÿÿóÿÿóÿÿý @£` @£`  ‘getAdminNotifLogs‘ Aôà á  Aôà÷à  Òüÿÿÿòÿÿÿòÿÿý @¯` @¯`! ±òÿÿ°òÿÿ A€ä­ä  ÎüÿÿKðÿÿKðÿÿþ @Î@Î`  ­òÿÿ¬òÿÿ AEåNå  ÊüÿÿGðÿÿGðÿÿþ @Ö@Ö`  ©òÿÿšòÿÿ AŸåÇå  ÆüÿÿCðÿÿCðÿÿþ @Ý@Ý`  ¥òÿÿ€òÿÿ AJæSæ  Âüÿÿ?ðÿÿ?ðÿÿþ @ä@ä`  getAdminPlans{ÿÿÿ A“æ€æ  A“æ–æ  Œüÿÿéòÿÿéòÿÿý @æ@æ` ›òÿÿšòÿÿ Aúæç  žüÿÿ5ðÿÿ5ðÿÿþ @ë@ë`  ”getTranslationsStatsqÿÿÿ Anç†ç  Ançqç  ²üÿÿßòÿÿßòÿÿý @î@î`  ‘òÿÿòÿÿ Aèè  ®üÿÿ+ðÿÿ+ðÿÿþ @ó@ó`  õïÿÿôïÿÿ A`ègè  ªüÿÿ×òÿÿ×òÿÿþ @õ@õ` ñïÿÿðïÿÿ Aðè÷è  ŠüÿÿÓòÿÿÓòÿÿþ @÷@÷` íïÿÿìïÿÿ A}é„é  ¢üÿÿÏòÿÿÏòÿÿþ @ø@ø` òÿÿ€òÿÿ A êê  žüÿÿðÿÿðÿÿþ @ý@ý`  ‘getAdminReferralsWÿÿÿ A{êê  A{ê~ê  ˜üÿÿÅòÿÿÅòÿÿý @@` wòÿÿvòÿÿ Adëmë  ”üÿÿðÿÿðÿÿþ @@`  ÒNÿÿÿ AÈëÙë  AÈëËë  üÿÿŒòÿÿŒòÿÿý @`#@`4 nòÿÿmòÿÿ AUì^ì  ‹üÿÿðÿÿðÿÿþ @@`  jòÿÿiòÿÿ AµìŸì  ‡üÿÿðÿÿðÿÿþ @@`  fòÿÿeòÿÿ Aí í  ƒüÿÿðÿÿðÿÿþ @@`  ’adminBroadcastPush<ÿÿÿ Að$ð  Aðð  }üÿÿªòÿÿªòÿÿý @1`"@1`8 “adminSendPushToUser6ÿÿÿ Aåðüð  Aåðèð  wüÿÿ€òÿÿ€òÿÿý @7`"@7`9 ŽdeactivateUser0ÿÿÿ Anò€ò  Anòqò  qüÿÿžòÿÿžòÿÿý @A`@A`0 ŒactivateUser*ÿÿÿ Aƒò“ò  Aƒò†ò  küÿÿ˜òÿÿ˜òÿÿý @A`3@A`C ŽchangeUserRole$ÿÿÿ Ajó|ó  Ajómó  eüÿÿ’òÿÿ’òÿÿý @F`@F`0 ŒgetAdminUserÿÿÿ AÁõÑõ  AÁõÄõ  _üÿÿŒòÿÿŒòÿÿý @Y@Y` updateAdminUserÿÿÿ Aùú û  Aùúüú  Yüÿÿ†òÿÿ†òÿÿý @v`"@v`5 ™adminUpdateSpecialistCardÿÿÿ A &  A    Süÿÿ€òÿÿ€òÿÿý @‰`@‰`4 ”verifyAdminUserEmail ÿÿÿ A  A   Müÿÿzòÿÿzòÿÿý @`"@`: •adminTopUpUserBalanceÿÿÿ AÂÛ  AÂÅ  Güÿÿtòÿÿtòÿÿý @°`!@°`: Sÿÿÿÿÿÿ Aµ Ï   Aµ ž   Büÿÿoòÿÿoòÿÿý @Œ`@Œ`* ˜adminWithdrawUserBalanceûþÿÿ Ay •   Ay |   <üÿÿiòÿÿiòÿÿý @Ñ`!@Ñ`= Hÿÿÿöþÿÿ Ax’  Ax{  7üÿÿdòÿÿdòÿÿý @Ý`@Ý`* Þñþÿÿ Aœ¹  AœŸ  2üÿÿ_òÿÿ_òÿÿý @õ`"@õ`? Ùìþÿÿ A`}  A`c  -üÿÿZòÿÿZòÿÿý @`@`; ùþÿÿçþÿÿ AJ]  AJM  (üÿÿUòÿÿUòÿÿý @@` úþÿÿâþÿÿ A®É  A®±  #üÿÿPòÿÿPòÿÿý @@`# cancelTaskAdminÜþÿÿ AXk  AX[  üÿÿJòÿÿJòÿÿý @`@`1 deleteTaskAdminÖþÿÿ A‡š  A‡Š  üÿÿDòÿÿDòÿÿý @"`@"`, ’updateReportStatusÐþÿÿ Aåû  Aåè  üÿÿ>òÿÿ>òÿÿý @)`@)`4 ðñÿÿïñÿÿ AÌÕ   üÿÿŠïÿÿŠïÿÿþ @0@0`  ‘getAdminLocationsÆþÿÿ A.  A  üÿÿ4òÿÿ4òÿÿý @2@2` ŽupdateLocationÀþÿÿ A¢%Ž%  A¢%¥%  üÿÿ.òÿÿ.òÿÿý @W`&@W`8 ŽcreateLocationºþÿÿ A\&n&  A\&_&  ûûÿÿ(òÿÿ(òÿÿý @Z`&@Z`8 ŽdeleteLocationŽþÿÿ Av)ˆ)  Av)y)  õûÿÿ"òÿÿ"òÿÿý @q`@q`+ ÔñÿÿÓñÿÿ AÏ*Ø*  ñûÿÿnïÿÿnïÿÿþ @|@|`  ’getAdminCategoriesªþÿÿ A+3+  A+ +  ëûÿÿòÿÿòÿÿý @~@~` ÊñÿÿÉñÿÿ Aˆ+‘+  çûÿÿdïÿÿdïÿÿþ @ƒ@ƒ`  ŽupdateCategory þÿÿ A<¢<  A<“<  áûÿÿòÿÿòÿÿý @Õ`&@Õ`8 ŽcreateCategoryšþÿÿ AJ=\=  AJ=M=  Ûûÿÿòÿÿòÿÿý @Ø`&@Ø`8 ŽdeleteCategory”þÿÿ A”@Š@  A”@—@  Õûÿÿòÿÿòÿÿý @ð`@ð`+ ŽgetAdminSkillsŽþÿÿ AÑCãC  AÑCÔC  Ïûÿÿüñÿÿüñÿÿý @ `%@ `7 ‹updateSkillˆþÿÿ AïIþI  AïIòI  Éûÿÿöñÿÿöñÿÿý @2`&@2`5 ‹createSkill‚þÿÿ AæLõL  AæLéL  Ãûÿÿðñÿÿðñÿÿý @A`&@A`5 ‹deleteSkill|þÿÿ AJQYQ  AJQMQ  œûÿÿêñÿÿêñÿÿý @[`5@[`D ŠupdatePlanvþÿÿ Aty‚y  Atywy  ·ûÿÿäñÿÿäñÿÿý @ì`&@ì`4 ŠcreatePlanpþÿÿ A-z;z  A-z0z  ±ûÿÿÞñÿÿÞñÿÿý @ï`&@ï`4 ïþÿÿkþÿÿ AP{a{  AP{S{  ¬ûÿÿÙñÿÿÙñÿÿý @÷`@÷`! ŠdeletePlaneþÿÿ A«|¹|  A«|®|  ŠûÿÿÓñÿÿÓñÿÿý @`@`' …ñÿÿ„ñÿÿ A-}6}  ¢ûÿÿïÿÿïÿÿþ @@`  àþÿÿ\þÿÿ A”}¥}  A”}—}  ûÿÿÊñÿÿÊñÿÿý @`#@`4 getAdminSettingsVþÿÿ AÑ}å}  AÑ}Ô}  —ûÿÿÄñÿÿÄñÿÿý @ @ ` –getAdminEmailTemplatesPþÿÿ AŸŸ¹Ÿ  AŸŸ¢Ÿ  ‘ûÿÿŸñÿÿŸñÿÿý @P@P`" “updateAdminSettingsJþÿÿ A¡§¡  A¡“¡  ‹ûÿÿžñÿÿžñÿÿý @b`@b`) úEþÿÿ Aƣݣ  Aƣɣ  †ûÿÿ³ñÿÿ³ñÿÿý @q`@q`) ˜updateAdminEmailTemplate?þÿÿ Ayš•š  Ayš|š  €ûÿÿ­ñÿÿ­ñÿÿý @‹`@‹`. ›translateAdminEmailTemplate9þÿÿ Aùš©  Aùšüš  zûÿÿ§ñÿÿ§ñÿÿý @`"@`A ô4þÿÿ A׫ó«  A׫Ú«  uûÿÿ¢ñÿÿ¢ñÿÿý @ `@ `3 ï/þÿÿ A`­|­  A`­c­  pûÿÿñÿÿñÿÿý @«`@«`. ß*þÿÿ A8¯O¯  A8¯;¯  kûÿÿ˜ñÿÿ˜ñÿÿý @·`@·`) Ú%þÿÿ A?²V²  A?²B²  fûÿÿ“ñÿÿ“ñÿÿý @É`@É`) Õ þÿÿ A/ŽFŽ  A/Ž2Ž  aûÿÿŽñÿÿŽñÿÿý @×`@×`) Ðþÿÿ A'ž>ž  A'ž*ž  \ûÿÿ‰ñÿÿ‰ñÿÿý @í`@í`) Ëþÿÿ A »7»  A »#»  Wûÿÿ„ñÿÿ„ñÿÿý @ `@ `) –testTelegramConnectionþÿÿ A‡Á¡Á  A‡ÁŠÁ  Qûÿÿ~ñÿÿ~ñÿÿý @( `@( `8 “verifyTelegramToken þÿÿ AeÆ|Æ  AeÆhÆ  Kûÿÿxñÿÿxñÿÿý @F `@F `5 /ñÿÿ0ñÿÿ AÒÈÖÈ  Gûÿÿñÿÿñÿÿþ @U `(@U `, +ñÿÿ,ñÿÿ AÞÌâÌ  Cûÿÿñÿÿñÿÿþ @n ` @n `$ 'ñÿÿ(ñÿÿ AÔÍØÍ  ?ûÿÿñÿÿñÿÿþ @t `(@t `, ÿñÿÿòÿÿ AŽÏ¹Ï  ;ûÿÿñÿÿñÿÿþ @~ ` @~ `% ñÿÿ ñÿÿ AÁÐÅÐ  7ûÿÿ ñÿÿ ñÿÿþ @… `"@… `& ñÿÿñÿÿ A°ÑŽÑ  3ûÿÿ ñÿÿ ñÿÿþ @Š `"@Š `& ñÿÿñÿÿ A\Ò`Ò  /ûÿÿñÿÿñÿÿþ @ `"@ `& ñÿÿñÿÿ AÊÓÎÓ  +ûÿÿñÿÿñÿÿþ @š ` @š `$ ñÿÿñÿÿ AÀÔÄÔ  'ûÿÿýðÿÿýðÿÿþ @  `(@  `,  ñÿÿ ñÿÿ AŽÖžÖ  #ûÿÿùðÿÿùðÿÿþ @« ` @« `$ ñÿÿñÿÿ Aª×®×  ûÿÿõðÿÿõðÿÿþ @± `(@± `, ßñÿÿàñÿÿ A‡ÙŒÙ  ûÿÿñðÿÿñðÿÿþ @Œ ` @Œ `% ÿðÿÿñÿÿ A”Ú˜Ú  ûÿÿíðÿÿíðÿÿþ @à `"@à `& ûðÿÿüðÿÿ AÒÛÖÛ  ûÿÿéðÿÿéðÿÿþ @È `"@È `& ÷ðÿÿøðÿÿ A"Ý&Ý  ûÿÿåðÿÿåðÿÿþ @Ó ` @Ó `$ óðÿÿôðÿÿ AÞÞ   ûÿÿáðÿÿáðÿÿþ @Ù `(@Ù `, ËñÿÿÌñÿÿ A?àDà  ûÿÿÝðÿÿÝðÿÿþ @ã ` @ã `% ëðÿÿìðÿÿ ALáPá  ûÿÿÙðÿÿÙðÿÿþ @ê `"@ê `& çðÿÿèðÿÿ Afâjâ  ÿúÿÿÕðÿÿÕðÿÿþ @ï `"@ï `& ¿ñÿÿÀñÿÿ AÕãÚã  ûúÿÿÑðÿÿÑðÿÿþ @ú ` @ú `% ßðÿÿàðÿÿ Aâäæä  ÷úÿÿÍðÿÿÍðÿÿþ @ `"@ `& ÛðÿÿÜðÿÿ Aîåòå  óúÿÿÉðÿÿÉðÿÿþ @ `"@ `& ³ñÿÿŽñÿÿ AZç_ç  ïúÿÿÅðÿÿÅðÿÿþ @ ` @ `% ÓðÿÿÔðÿÿ Agèkè  ëúÿÿÁðÿÿÁðÿÿþ @ `"@ `& ÏðÿÿÐðÿÿ A|é€é  çúÿÿœðÿÿœðÿÿþ @ `"@ `& §ñÿÿšñÿÿ A¿êÄê  ãúÿÿ¹ðÿÿ¹ðÿÿþ @, ` @, `% ÇðÿÿÈðÿÿ AÌëÐë  ßúÿÿµðÿÿµðÿÿþ @3 `"@3 `& ÃðÿÿÄðÿÿ AJìNì  Ûúÿÿ±ðÿÿ±ðÿÿþ @6 `"@6 `& ›ñÿÿœñÿÿ A–í›í  ×úÿÿ­ðÿÿ­ðÿÿþ @B ` @B `% »ðÿÿŒðÿÿ A£î§î  Óúÿÿ©ðÿÿ©ðÿÿþ @I `"@I `& ·ðÿÿžðÿÿ AQïUï  Ïúÿÿ¥ðÿÿ¥ðÿÿþ @N `"@N `& ³ðÿÿŽðÿÿ Aéòíò  Ëúÿÿ¡ðÿÿ¡ðÿÿþ @Y ` @Y `$ ¯ðÿÿ°ðÿÿ Aßóãó  Çúÿÿðÿÿðÿÿþ @_ `(@_ `, «ðÿÿ¬ðÿÿ A¡õ¥õ  Ãúÿÿ™ðÿÿ™ðÿÿþ @i ` @i `$ §ðÿÿšðÿÿ A—ö›ö  ¿úÿÿ•ðÿÿ•ðÿÿþ @o `(@o `, £ðÿÿ€ðÿÿ A+ø/ø  »úÿÿ‘ðÿÿ‘ðÿÿþ @y ` @y `$ Ÿðÿÿ ðÿÿ A!ù%ù  ·úÿÿðÿÿðÿÿþ @ `(@ `, ›ðÿÿœðÿÿ A™úú  ³úÿÿ‰ðÿÿ‰ðÿÿþ @‰ ` @‰ `$ —ðÿÿ˜ðÿÿ Aû“û  ¯úÿÿ…ðÿÿ…ðÿÿþ @ `(@ `, oñÿÿpñÿÿ A0ý5ý  «úÿÿðÿÿðÿÿþ @™ ` @™ `% ðÿÿðÿÿ A=þAþ  §úÿÿ}ðÿÿ}ðÿÿþ @  `"@  `& ‹ðÿÿŒðÿÿ A ÿÿ  £úÿÿyðÿÿyðÿÿþ @Š `"@Š `& ‡ðÿÿˆðÿÿ Aúÿþÿ  Ÿúÿÿuðÿÿuðÿÿþ @« `"@« `& ƒðÿÿ„ðÿÿ Aèì  ›úÿÿqðÿÿqðÿÿþ @° `"@° `& ðÿÿ€ðÿÿ AHL  —úÿÿmðÿÿmðÿÿþ @» ` @» `$ {ðÿÿ|ðÿÿ A>B  “úÿÿiðÿÿiðÿÿþ @Á `(@Á `, wðÿÿxðÿÿ Aë ï   úÿÿeðÿÿeðÿÿþ @ã `@ã ` OñÿÿPñÿÿ AG L   ‹úÿÿaðÿÿaðÿÿþ @å ` @å `% KñÿÿLñÿÿ A Ç   ‡úÿÿ]ðÿÿ]ðÿÿþ @è `@è `# GñÿÿHñÿÿ A`e  ƒúÿÿYðÿÿYðÿÿþ @ë `&@ë `+ gðÿÿhðÿÿ A   úÿÿUðÿÿUðÿÿþ @î `.@î `2 cðÿÿdðÿÿ A  {úÿÿQðÿÿQðÿÿþ @ò `<@ò `@ _ðÿÿ`ðÿÿ A  wúÿÿMðÿÿMðÿÿþ @ö `.@ö `2 7ñÿÿ8ñÿÿ A16  súÿÿIðÿÿIðÿÿþ @ü `&@ü `+ ¥ðÿÿœñÿÿ A7; 4oúÿÿ–ðÿÿ–ðÿÿþ @ü `,@ü `0 SðÿÿTðÿÿ A6:  kúÿÿAðÿÿAðÿÿþ @ `.@ `2 OðÿÿPðÿÿ A–š  gúÿÿ=ðÿÿ=ðÿÿþ @ `<@ `@ 'ñÿÿ(ñÿÿ Adi  cúÿÿ9ðÿÿ9ðÿÿþ @ `@ `# GðÿÿHðÿÿ Aæê  _úÿÿ5ðÿÿ5ðÿÿþ @ `&@ `* ñÿÿ ñÿÿ A¥ª  [úÿÿ1ðÿÿ1ðÿÿþ @ `4@ `9 ?ðÿÿ@ðÿÿ A{  Wúÿÿ-ðÿÿ-ðÿÿþ @ `2@ `6 ;ðÿÿ<ðÿÿ Az~  Súÿÿ)ðÿÿ)ðÿÿþ @ `@@ `D 7ðÿÿ8ðÿÿ AZ^  Oúÿÿ%ðÿÿ%ðÿÿþ @$ `D@$ `H ñÿÿñÿÿ A‡Œ  Kúÿÿ!ðÿÿ!ðÿÿþ @- `=@- `B /ðÿÿ0ðÿÿ Aû ÿ   Gúÿÿðÿÿðÿÿþ @2 `>@2 `B ñÿÿñÿÿ AM"R"  Cúÿÿðÿÿðÿÿþ @6 `S@6 `X 'ðÿÿ(ðÿÿ AE#I#  ?úÿÿðÿÿðÿÿþ @9 `F@9 `J #ðÿÿ$ðÿÿ A*$.$  ;úÿÿðÿÿðÿÿþ @< `N@< `R ûðÿÿüðÿÿ A' '  7úÿÿ ðÿÿ ðÿÿþ @H `&@H `+ ÷ðÿÿøðÿÿ A¶'»'  3úÿÿ ðÿÿ ðÿÿþ @K `A@K `F ðÿÿðÿÿ Ag(k(  /úÿÿðÿÿðÿÿþ @N `6@N `: ðÿÿðÿÿ AT*X*  +úÿÿðÿÿðÿÿþ @T `H@T `L ðÿÿðÿÿ A.,2,  'úÿÿýïÿÿýïÿÿþ @Z `P@Z `T çðÿÿèðÿÿ A°/µ/  #úÿÿùïÿÿùïÿÿþ @e `H@e `M ðÿÿðÿÿ AÉ1Í1  úÿÿõïÿÿõïÿÿþ @l `J@l `N ðÿÿðÿÿ A<5@5  úÿÿñïÿÿñïÿÿþ @q `J@q `N ÿïÿÿðÿÿ AÚ8Þ8  úÿÿíïÿÿíïÿÿþ @} `H@} `L ûïÿÿüïÿÿ AŽ:ž:  úÿÿéïÿÿéïÿÿþ @ƒ `P@ƒ `T ÷ïÿÿøïÿÿ Ah>l>  úÿÿåïÿÿåïÿÿþ @Ž `H@Ž `L óïÿÿôïÿÿ AB@F@   úÿÿáïÿÿáïÿÿþ @” `P@” `T ïïÿÿðïÿÿ ADD  úÿÿÝïÿÿÝïÿÿþ @Ÿ `H@Ÿ `L ëïÿÿìïÿÿ AðEôE  úÿÿÙïÿÿÙïÿÿþ @¥ `P@¥ `T ÃðÿÿÄðÿÿ A J%J  ÿùÿÿÕïÿÿÕïÿÿþ @¯ `E@¯ `J ãïÿÿäïÿÿ A&K*K  ûùÿÿÑïÿÿÑïÿÿþ @² `F@² `J ßïÿÿàïÿÿ A_LcL  ÷ùÿÿÍïÿÿÍïÿÿþ @¶ `F@¶ `J ÛïÿÿÜïÿÿ AÒMÖM  óùÿÿÉïÿÿÉïÿÿþ @º `F@º `J ³ðÿÿŽðÿÿ APP  ïùÿÿÅïÿÿÅïÿÿþ @ `z@ ` ¯ðÿÿ°ðÿÿ AQQ  ëùÿÿÁïÿÿÁïÿÿþ @Å `>@Å `C ÏïÿÿÐïÿÿ AþQR  çùÿÿœïÿÿœïÿÿþ @È `F@È `J §ðÿÿšðÿÿ AWS\S  ãùÿÿ¹ïÿÿ¹ïÿÿþ @Ì `F@Ì `K £ðÿÿ€ðÿÿ AgTlT  ßùÿÿµïÿÿµïÿÿþ @Ï `N@Ï `S ÃïÿÿÄïÿÿ A‰UU  Ûùÿÿ±ïÿÿ±ïÿÿþ @Ò `V@Ò `Z ›ðÿÿœðÿÿ AŠW«W  ×ùÿÿ­ïÿÿ­ïÿÿþ @Ø `N@Ø `S »ïÿÿŒïÿÿ AÈXÌX  Óùÿÿ©ïÿÿ©ïÿÿþ @Û `V@Û `Z “ðÿÿ”ðÿÿ AìZñZ  Ïùÿÿ¥ïÿÿ¥ïÿÿþ @á `N@á `S ³ïÿÿŽïÿÿ A\\  Ëùÿÿ¡ïÿÿ¡ïÿÿþ @ä `V@ä `Z ¯ïÿÿ°ïÿÿ Aý^_  Çùÿÿïÿÿïÿÿþ @î `>@î `B ‡ðÿÿˆðÿÿ Aïeôe  Ãùÿÿ™ïÿÿ™ïÿÿþ @ `}A ‚ §ïÿÿšïÿÿ AÝfáf  ¿ùÿÿ•ïÿÿ•ïÿÿþ @ `>@ `B £ïÿÿ€ïÿÿ Ah"h  »ùÿÿ‘ïÿÿ‘ïÿÿþ @ `>@ `B {ðÿÿ|ðÿÿ A^xcx  ·ùÿÿïÿÿïÿÿþ @? `Q@? `V ›ïÿÿœïÿÿ A—y›y  ³ùÿÿ‰ïÿÿ‰ïÿÿþ @B `R@B `V —ïÿÿ˜ïÿÿ A{{  ¯ùÿÿ…ïÿÿ…ïÿÿþ @F `R@F `V “ïÿÿ”ïÿÿ A||  «ùÿÿïÿÿïÿÿþ @H ``@H `d ïÿÿïÿÿ A£~§~  §ùÿÿ}ïÿÿ}ïÿÿþ @O `R@O `V gðÿÿhðÿÿ A)€.€  £ùÿÿyïÿÿyïÿÿþ @S `R@S `W cðÿÿdðÿÿ A „„  Ÿùÿÿuïÿÿuïÿÿþ @a `P@a `U _ðÿÿ`ðÿÿ Aù„þ„  ›ùÿÿqïÿÿqïÿÿþ @d `>@d `C ïÿÿ€ïÿÿ A÷…û…  —ùÿÿmïÿÿmïÿÿþ @g `F@g `J WðÿÿXðÿÿ AU‡Z‡  “ùÿÿiïÿÿiïÿÿþ @k `F@k `K wïÿÿxïÿÿ Auˆyˆ  ùÿÿeïÿÿeïÿÿþ @n `N@n `R sïÿÿtïÿÿ AĊȊ  ‹ùÿÿaïÿÿaïÿÿþ @v `>@v `B KðÿÿLðÿÿ Aêï  ‡ùÿÿ]ïÿÿ]ïÿÿþ @‚ `N@‚ `S GðÿÿHðÿÿ A؎ݎ  ƒùÿÿYïÿÿYïÿÿþ @… `>@… `C gïÿÿhïÿÿ A֏ڏ  ùÿÿUïÿÿUïÿÿþ @ˆ `F@ˆ `J ?ðÿÿ@ðÿÿ A3‘8‘  {ùÿÿQïÿÿQïÿÿþ @Œ `F@Œ `K _ïÿÿ`ïÿÿ AS’W’  wùÿÿMïÿÿMïÿÿþ @ `N@ `R [ïÿÿ\ïÿÿ Až”¢”  sùÿÿIïÿÿIïÿÿþ @— `>@— `B 3ðÿÿ4ðÿÿ A²—·—  oùÿÿEïÿÿEïÿÿþ @£ `?@£ `D /ðÿÿ0ðÿÿ Aª˜¯˜  kùÿÿAïÿÿAïÿÿþ @Š `>@Š `C OïÿÿPïÿÿ A£™§™  gùÿÿ=ïÿÿ=ïÿÿþ @© `F@© `J 'ðÿÿ(ðÿÿ Aüš›  cùÿÿ9ïÿÿ9ïÿÿþ @­ `F@­ `K #ðÿÿ$ðÿÿ A œœ  _ùÿÿ5ïÿÿ5ïÿÿþ @° `N@° `S CïÿÿDïÿÿ A.2  [ùÿÿ1ïÿÿ1ïÿÿþ @³ `V@³ `Z ðÿÿðÿÿ AKŸPŸ  Wùÿÿ-ïÿÿ-ïÿÿþ @¹ `N@¹ `S ;ïÿÿ<ïÿÿ Am q   Sùÿÿ)ïÿÿ)ïÿÿþ @Œ `V@Œ `Z ðÿÿðÿÿ AX£]£  Oùÿÿ%ïÿÿ%ïÿÿþ @Æ `>@Æ `C ðÿÿðÿÿ AF€K€  Kùÿÿ!ïÿÿ!ïÿÿþ @É `F@É `K /ïÿÿ0ïÿÿ Ap¥t¥  Gùÿÿïÿÿïÿÿþ @Ì `N@Ì `R +ïÿÿ,ïÿÿ AïŠóŠ  Cùÿÿïÿÿïÿÿþ @Ð `N@Ð `R ðÿÿðÿÿ Aôšùš  ?ùÿÿïÿÿïÿÿþ @Ö `F@Ö `K #ïÿÿ$ïÿÿ Aªª  ;ùÿÿïÿÿïÿÿþ @Ù `N@Ù `R ïÿÿ ïÿÿ A“«—«  7ùÿÿ ïÿÿ ïÿÿþ @Ý `N@Ý `R ÷ïÿÿøïÿÿ A”­™­  3ùÿÿ ïÿÿ ïÿÿþ @ã `F@ã `K ïÿÿïÿÿ AÀ®Ä®  /ùÿÿïÿÿïÿÿþ @æ `N@æ `R ïïÿÿðïÿÿ A:°?°  +ùÿÿïÿÿïÿÿþ @ê `N@ê `S ïÿÿïÿÿ AZŽ^Ž  'ùÿÿýîÿÿýîÿÿþ Cõ Çõ Ë çïÿÿèïÿÿ Aâ»ç»  #ùÿÿùîÿÿùîÿÿþ @ `A@ `F ãïÿÿäïÿÿ AWŒ\Œ  ùÿÿõîÿÿõîÿÿþ @ `6@ `; ßïÿÿàïÿÿ A&œ+œ  ùÿÿñîÿÿñîÿÿþ @ `>@ `C ÿîÿÿïÿÿ A(¿,¿  ùÿÿíîÿÿíîÿÿþ @ `F@ `J ûîÿÿüîÿÿ A›ÁŸÁ  ùÿÿéîÿÿéîÿÿþ @" `F@" `J ÓïÿÿÔïÿÿ AÕÃÚà  ùÿÿåîÿÿåîÿÿþ @) `>@) `C óîÿÿôîÿÿ AŠÅŽÅ   ùÿÿáîÿÿáîÿÿþ @. `F@. `J ïîÿÿðîÿÿ AÆÆÊÆ  ùÿÿÝîÿÿÝîÿÿþ @2 `F@2 `J ëîÿÿìîÿÿ A È È  ùÿÿÙîÿÿÙîÿÿþ @6 `F@6 `J ÃïÿÿÄïÿÿ AøÉýÉ  ÿøÿÿÕîÿÿÕîÿÿþ @> `6@> `; ¿ïÿÿÀïÿÿ AòÊ÷Ê  ûøÿÿÑîÿÿÑîÿÿþ @A `>@A `C ßîÿÿàîÿÿ AÚËÞË  ÷øÿÿÍîÿÿÍîÿÿþ @D `F@D `J ·ïÿÿžïÿÿ AÌ¢Ì  óøÿÿÉîÿÿÉîÿÿþ @F `T@F `Y ×îÿÿØîÿÿ AIÍMÍ  ïøÿÿÅîÿÿÅîÿÿþ @H `R@H `V ÓîÿÿÔîÿÿ AÐÎÔÎ  ëøÿÿÁîÿÿÁîÿÿþ @L `R@L `V ÏîÿÿÐîÿÿ AXÐ\Ð  çøÿÿœîÿÿœîÿÿþ @P `R@P `V ËîÿÿÌîÿÿ AßÑãÑ  ãøÿÿ¹îÿÿ¹îÿÿþ @T `R@T `V ÇîÿÿÈîÿÿ AnÓrÓ  ßøÿÿµîÿÿµîÿÿþ @X `R@X `V ÃîÿÿÄîÿÿ AûÔÿÔ  Ûøÿÿ±îÿÿ±îÿÿþ @\ `R@\ `V ¿îÿÿÀîÿÿ A„ÖˆÖ  ×øÿÿ­îÿÿ­îÿÿþ @` `R@` `V »îÿÿŒîÿÿ A:Ø>Ø  Óøÿÿ©îÿÿ©îÿÿþ @f `F@f `J ·îÿÿžîÿÿ A ÙÙ  Ïøÿÿ¥îÿÿ¥îÿÿþ @h `^@h `b ³îÿÿŽîÿÿ ApÙtÙ  Ëøÿÿ¡îÿÿ¡îÿÿþ @i `X@i `\ ¯îÿÿ°îÿÿ ALÛPÛ  Çøÿÿîÿÿîÿÿþ @n `d@n `h «îÿÿ¬îÿÿ A±ÛµÛ  Ãøÿÿ™îÿÿ™îÿÿþ @o `X@o `\ ƒïÿÿ„ïÿÿ AmÞrÞ  ¿øÿÿ•îÿÿ•îÿÿþ @w `U@w `Z £îÿÿ€îÿÿ A„ßˆß  »øÿÿ‘îÿÿ‘îÿÿþ @z `V@z `Z ¡ïÿÿ ïÿÿ Aeàtà  ·øÿÿ æîÿÿæîÿÿþ @| `V@| `e ›îÿÿœîÿÿ A8á<á  ³øÿÿ‰îÿÿ‰îÿÿþ @~ `V@~ `Z —îÿÿ˜îÿÿ A·â»â  ¯øÿÿ…îÿÿ…îÿÿþ @‚ `V@‚ `Z “îÿÿ”îÿÿ AŒãã  «øÿÿîÿÿîÿÿþ @„ `d@„ `h îÿÿîÿÿ A-æ1æ  §øÿÿ}îÿÿ}îÿÿþ @‰ `V@‰ `Z gïÿÿhïÿÿ Aüçè  £øÿÿyîÿÿyîÿÿþ C‹ H‹ M ‡îÿÿˆîÿÿ ACêGê  Ÿøÿÿuîÿÿuîÿÿþ @‘ `_@‘ `c ƒîÿÿ„îÿÿ A ìì  ›øÿÿqîÿÿqîÿÿþ @– `V@– `Z îÿÿ€îÿÿ A¹íœí  —øÿÿmîÿÿmîÿÿþ @š `V@š `Z {îÿÿ|îÿÿ AŽî’î  “øÿÿiîÿÿiîÿÿþ @œ `d@œ `h wîÿÿxîÿÿ Aññ  øÿÿeîÿÿeîÿÿþ @¡ `V@¡ `Z OïÿÿPïÿÿ Aøñýñ  ‹øÿÿaîÿÿaîÿÿþ @£ `d@£ `i oîÿÿpîÿÿ AIóMó  ‡øÿÿ]îÿÿ]îÿÿþ @Š `b@Š `f kîÿÿlîÿÿ Aõõ  ƒøÿÿYîÿÿYîÿÿþ @© `p@© `t gîÿÿhîÿÿ AÇ÷Ë÷  øÿÿUîÿÿUîÿÿþ @¯ `t@¯ `x cîÿÿdîÿÿ A-û1û  {øÿÿQîÿÿQîÿÿþ @¶ `x@¶ `| _îÿÿ`îÿÿ A|€  wøÿÿMîÿÿMîÿÿþ @Ä `>@Ä `B 7ïÿÿ8ïÿÿ A!  søÿÿIîÿÿIîÿÿþ @Ï `D@Ï `I 3ïÿÿ4ïÿÿ A‘–  oøÿÿEîÿÿEîÿÿþ @Ñ `6@Ñ `; SîÿÿTîÿÿ Ajn  køÿÿAîÿÿAîÿÿþ @Ô `>@Ô `B +ïÿÿ,ïÿÿ AÌÑ  gøÿÿ=îÿÿ=îÿÿþ @Ú `>@Ú `C KîÿÿLîÿÿ A…‰  cøÿÿ9îÿÿ9îÿÿþ @ß `F@ß `J GîÿÿHîÿÿ AÕ Ù   _øÿÿ5îÿÿ5îÿÿþ @ã `F@ã `J CîÿÿDîÿÿ A" &   [øÿÿ1îÿÿ1îÿÿþ @ç `F@ç `J ?îÿÿ@îÿÿ A„ ˆ   Wøÿÿ-îÿÿ-îÿÿþ @ë `F@ë `J ;îÿÿ<îÿÿ Aã ç   Søÿÿ)îÿÿ)îÿÿþ @ï `F@ï `J ïÿÿïÿÿ Aü  Oøÿÿ%îÿÿ%îÿÿþ @÷ `6@÷ `; ïÿÿïÿÿ Aöû  Køÿÿ!îÿÿ!îÿÿþ @ú `>@ú `C /îÿÿ0îÿÿ AÞâ  Gøÿÿîÿÿîÿÿþ @ý `F@ý `J ïÿÿïÿÿ A¡Š  Cøÿÿîÿÿîÿÿþ @ÿ `T@ÿ `Y 'îÿÿ(îÿÿ AMQ  ?øÿÿîÿÿîÿÿþ @`R@`V #îÿÿ$îÿÿ AÔØ  ;øÿÿîÿÿîÿÿþ @`R@`V îÿÿ îÿÿ Auy  7øÿÿ îÿÿ îÿÿþ @ `R@ `V îÿÿîÿÿ A  3øÿÿ îÿÿ îÿÿþ @ `R@ `V îÿÿîÿÿ A¬°  /øÿÿîÿÿîÿÿþ @`R@`V îÿÿîÿÿ AQU  +øÿÿîÿÿîÿÿþ @`R@`V îÿÿîÿÿ A˜œ  'øÿÿýíÿÿýíÿÿþ @`F@`J  îÿÿ îÿÿ Aim  #øÿÿùíÿÿùíÿÿþ @`^@`b îÿÿîÿÿ AÎÒ  øÿÿõíÿÿõíÿÿþ @`X@`\ îÿÿîÿÿ A° Ž   øÿÿñíÿÿñíÿÿþ @$`j@$`n ÿíÿÿîÿÿ A!!  øÿÿííÿÿííÿÿþ @%`X@%`\ ×îÿÿØîÿÿ A4%9%  øÿÿéíÿÿéíÿÿþ @-`U@-`Z ÓîÿÿÔîÿÿ AU&Z&  øÿÿåíÿÿåíÿÿþ @0`V@0`[ óíÿÿôíÿÿ A}''   øÿÿáíÿÿáíÿÿþ @3`^@3`b ïíÿÿðíÿÿ A+)/)  øÿÿÝíÿÿÝíÿÿþ @7`^@7`b ëíÿÿìíÿÿ Au+y+  øÿÿÙíÿÿÙíÿÿþ @=`V@=`Z çíÿÿèíÿÿ AJ,N,  ÿ÷ÿÿÕíÿÿÕíÿÿþ @?`d@?`h ¿îÿÿÀîÿÿ A—.œ.  û÷ÿÿÑíÿÿÑíÿÿþ @D`V@D`[ ßíÿÿàíÿÿ A2#2  ÷÷ÿÿÍíÿÿÍíÿÿþ @M`V@M`Z ·îÿÿžîÿÿ A33  ó÷ÿÿÉíÿÿÉíÿÿþ @O`d@O`i ×íÿÿØíÿÿ Až6Œ6  ï÷ÿÿÅíÿÿÅíÿÿþ @Y`V@Y`Z ÓíÿÿÔíÿÿ AO8S8  ë÷ÿÿÁíÿÿÁíÿÿþ @]`V@]`Z ÏíÿÿÐíÿÿ Ah;l;  ç÷ÿÿœíÿÿœíÿÿþ @g`>@g`B §îÿÿšîÿÿ A >>  ã÷ÿÿ¹íÿÿ¹íÿÿþ @r`A@r`F £îÿÿ€îÿÿ A€>…>  ß÷ÿÿµíÿÿµíÿÿþ @t`6@t`; Ÿîÿÿ îÿÿ AO?T?  Û÷ÿÿ±íÿÿ±íÿÿþ @w`>@w`C ¿íÿÿÀíÿÿ AQAUA  ×÷ÿÿ­íÿÿ­íÿÿþ @~`F@~`J »íÿÿŒíÿÿ AÄCÈC  Ó÷ÿÿ©íÿÿ©íÿÿþ @„`F@„`J “îÿÿ”îÿÿ AþEF  Ï÷ÿÿ¥íÿÿ¥íÿÿþ @‹`>@‹`C ³íÿÿŽíÿÿ A·G»G  Ë÷ÿÿ¡íÿÿ¡íÿÿþ @`F@`J ¯íÿÿ°íÿÿ A J€J  Ç÷ÿÿíÿÿíÿÿþ @š`Q@š`U ‡îÿÿˆîÿÿ A L¥L  Ã÷ÿÿ™íÿÿ™íÿÿþ @¢`6@¢`; ƒîÿÿ„îÿÿ AšMŸM  ¿÷ÿÿ•íÿÿ•íÿÿþ @¥`>@¥`C £íÿÿ€íÿÿ A‚N†N  »÷ÿÿ‘íÿÿ‘íÿÿþ @š`F@š`J {îÿÿ|îÿÿ AEOJO  ·÷ÿÿíÿÿíÿÿþ @ª`T@ª`Y ›íÿÿœíÿÿ AñOõO  ³÷ÿÿ‰íÿÿ‰íÿÿþ @¬`R@¬`V —íÿÿ˜íÿÿ AyQ}Q  ¯÷ÿÿ…íÿÿ…íÿÿþ @°`R@°`V “íÿÿ”íÿÿ ASS  «÷ÿÿíÿÿíÿÿþ @Ž`R@Ž`V íÿÿíÿÿ AT‘T  §÷ÿÿ}íÿÿ}íÿÿþ @ž`R@ž`V ‹íÿÿŒíÿÿ AVV  £÷ÿÿyíÿÿyíÿÿþ @Œ`R@Œ`V ‡íÿÿˆíÿÿ A W€W  Ÿ÷ÿÿuíÿÿuíÿÿþ @À`R@À`V ƒíÿÿ„íÿÿ AVYZY  ›÷ÿÿqíÿÿqíÿÿþ @Æ`F@Æ`J íÿÿ€íÿÿ A'Z+Z  —÷ÿÿmíÿÿmíÿÿþ @È`^@È`b {íÿÿ|íÿÿ AŒZZ  “÷ÿÿiíÿÿiíÿÿþ @É`X@É`\ wíÿÿxíÿÿ Ah\l\  ÷ÿÿeíÿÿeíÿÿþ @Î`d@Î`h síÿÿtíÿÿ AÍ\Ñ\  ‹÷ÿÿaíÿÿaíÿÿþ @Ï`X@Ï`\ KîÿÿLîÿÿ A ``  ‡÷ÿÿ]íÿÿ]íÿÿþ @Ø`U@Ø`Z kíÿÿlíÿÿ A!a%a  ƒ÷ÿÿYíÿÿYíÿÿþ @Û`V@Û`Z gíÿÿhíÿÿ Abb  ÷ÿÿUíÿÿUíÿÿþ @Ý`d@Ý`h ýÿÿ©îÿÿ Ab"b 4|÷ÿÿ£íÿÿ£íÿÿþ @Ý`i@Ý`m `íÿÿaíÿÿ AJeNe  x÷ÿÿNíÿÿNíÿÿþ @ä`V@ä`Z \íÿÿ]íÿÿ A[g_g  t÷ÿÿJíÿÿJíÿÿþ @è`V@è`Z XíÿÿYíÿÿ A0h4h  p÷ÿÿFíÿÿFíÿÿþ @ê`d@ê`h TíÿÿUíÿÿ Aôjøj  l÷ÿÿBíÿÿBíÿÿþ @ï`V@ï`Z àðÿÿßðÿÿ Aákìk  h÷ÿÿ ÆïÿÿÆïÿÿþ @ñ`n@ñ`y LíÿÿMíÿÿ Ašl¬l  d÷ÿÿ:íÿÿ:íÿÿþ @ó`V@ó`Z HíÿÿIíÿÿ AWn[n  `÷ÿÿ6íÿÿ6íÿÿþ @÷`V@÷`Z  îÿÿ!îÿÿ A7os  T÷ÿÿ*íÿÿ*íÿÿþ @`b@`f 8íÿÿ9íÿÿ Auxyx  P÷ÿÿ&íÿÿ&íÿÿþ @`>@`B îÿÿîÿÿ A{{  L÷ÿÿ"íÿÿ"íÿÿþ @`F@`K  îÿÿ îÿÿ AŒ{‘{  H÷ÿÿíÿÿíÿÿþ @`6@`; ,íÿÿ-íÿÿ Ar|v|  D÷ÿÿíÿÿíÿÿþ @`>@`B îÿÿîÿÿ Aš}Ÿ}  @÷ÿÿíÿÿíÿÿþ @#`>@#`C îÿÿîÿÿ Ag€l€  <÷ÿÿíÿÿíÿÿþ @-`A@-`F üíÿÿýíÿÿ A^c  8÷ÿÿíÿÿíÿÿþ @0`>@0`C øíÿÿùíÿÿ A؂݂  4÷ÿÿ íÿÿ íÿÿþ @4`Z@4`_ ôíÿÿõíÿÿ A›… …  0÷ÿÿíÿÿíÿÿþ @>`>@>`C ðíÿÿñíÿÿ A†¢†  ,÷ÿÿíÿÿíÿÿþ @A`F@A`K íÿÿíÿÿ AB‡F‡  (÷ÿÿþìÿÿþìÿÿþ @C`N@C`R  íÿÿ íÿÿ AňɈ  $÷ÿÿúìÿÿúìÿÿþ @G`N@G`R äíÿÿåíÿÿ A•ŒšŒ   ÷ÿÿöìÿÿöìÿÿþ @R`F@R`K íÿÿíÿÿ A:>  ÷ÿÿòìÿÿòìÿÿþ @T`N@T`R íÿÿíÿÿ AœŽÁŽ  ÷ÿÿîìÿÿîìÿÿþ @X`N@X`R ØíÿÿÙíÿÿ A““  ÷ÿÿêìÿÿêìÿÿþ @e`F@e`K øìÿÿùìÿÿ AŸ““  ÷ÿÿæìÿÿæìÿÿþ @g`N@g`R ôìÿÿõìÿÿ AB•F•   ÷ÿÿâìÿÿâìÿÿþ @k`N@k`R ÌíÿÿÍíÿÿ A™™  ÷ÿÿÞìÿÿÞìÿÿþ @v`F@v`K ÈíÿÿÉíÿÿ AŽ™¹™  ÷ÿÿÚìÿÿÚìÿÿþ @x`N@x`S èìÿÿéìÿÿ A0œ4œ  ÷ÿÿÖìÿÿÖìÿÿþ @`N@`R ÀíÿÿÁíÿÿ A¥ŸªŸ  üöÿÿÒìÿÿÒìÿÿþ @‰`F@‰`K Œíÿÿœíÿÿ AJ O   øöÿÿÎìÿÿÎìÿÿþ @‹`N@‹`S ÜìÿÿÝìÿÿ AƢʢ  ôöÿÿÊìÿÿÊìÿÿþ @’`N@’`R Žíÿÿµíÿÿ A;Š@Š  ðöÿÿÆìÿÿÆìÿÿþ @œ`F@œ`K °íÿÿ±íÿÿ AàŠåŠ  ìöÿÿÂìÿÿÂìÿÿþ @ž`N@ž`S ÐìÿÿÑìÿÿ A\©`©  èöÿÿŸìÿÿŸìÿÿþ @¥`N@¥`R šíÿÿ©íÿÿ AѬÖ¬  äöÿÿºìÿÿºìÿÿþ @¯`F@¯`K €íÿÿ¥íÿÿ Av­{­  àöÿÿ¶ìÿÿ¶ìÿÿþ @±`N@±`S ÄìÿÿÅìÿÿ Aò¯ö¯  Üöÿÿ²ìÿÿ²ìÿÿþ @ž`N@ž`R œíÿÿíÿÿ AÖ³Û³  Øöÿÿ®ìÿÿ®ìÿÿþ @Ä`L@Ä`Q Œìÿÿœìÿÿ AâŽæŽ  Ôöÿÿªìÿÿªìÿÿþ @Ç`F@Ç`J ”íÿÿ•íÿÿ A#ž(ž  ÐöÿÿŠìÿÿŠìÿÿþ @Ò`>@Ò`C Žìÿÿµìÿÿ A¹ ¹  Ìöÿÿ¢ìÿÿ¢ìÿÿþ @Õ`F@Õ`J °ìÿÿ±ìÿÿ Aa»e»  Èöÿÿžìÿÿžìÿÿþ @Û`F@Û`J ¬ìÿÿ­ìÿÿ A ŸŸ  Äöÿÿšìÿÿšìÿÿþ @ä`6@ä`: šìÿÿ©ìÿÿ AóŸ÷Ÿ  Àöÿÿ–ìÿÿ–ìÿÿþ @æ`[@æ`_ €ìÿÿ¥ìÿÿ Añ¿õ¿  Œöÿÿ’ìÿÿ’ìÿÿþ @é`?@é`C |íÿÿ}íÿÿ A,Ç1Ç  žöÿÿŽìÿÿŽìÿÿþ @`E@`J xíÿÿyíÿÿ A¡ÇŠÇ  ŽöÿÿŠìÿÿŠìÿÿþ @`6@`; ˜ìÿÿ™ìÿÿ A‡È‹È  °öÿÿ†ìÿÿ†ìÿÿþ @ `>@ `B píÿÿqíÿÿ A¯ÉŽÉ  ¬öÿÿ‚ìÿÿ‚ìÿÿþ @ `>@ `C líÿÿmíÿÿ A|ÌÌ  šöÿÿ~ìÿÿ~ìÿÿþ @`A@`F híÿÿiíÿÿ AsÍxÍ  €öÿÿzìÿÿzìÿÿþ @`>@`C díÿÿeíÿÿ AíÎòÎ   öÿÿvìÿÿvìÿÿþ @`Z@`_ `íÿÿaíÿÿ A­Ñ²Ñ  œöÿÿrìÿÿrìÿÿþ @(`>@(`C \íÿÿ]íÿÿ A¯ÒŽÒ  ˜öÿÿnìÿÿnìÿÿþ @+`F@+`K |ìÿÿ}ìÿÿ ATÓXÓ  ”öÿÿjìÿÿjìÿÿþ @-`N@-`R xìÿÿyìÿÿ A×ÔÛÔ  öÿÿfìÿÿfìÿÿþ @1`N@1`R PíÿÿQíÿÿ A­Ø²Ø  Œöÿÿbìÿÿbìÿÿþ @<`F@<`K LíÿÿMíÿÿ ARÙWÙ  ˆöÿÿ^ìÿÿ^ìÿÿþ @>`N@>`S lìÿÿmìÿÿ AÎÛÒÛ  „öÿÿZìÿÿZìÿÿþ @E`N@E`R DíÿÿEíÿÿ AAßFß  €öÿÿVìÿÿVìÿÿþ @O`F@O`K @íÿÿAíÿÿ Aæßëß  |öÿÿRìÿÿRìÿÿþ @Q`N@Q`S `ìÿÿaìÿÿ Abâfâ  xöÿÿNìÿÿNìÿÿþ @X`N@X`R 8íÿÿ9íÿÿ AÕåÚå  töÿÿJìÿÿJìÿÿþ @b`F@b`K 4íÿÿ5íÿÿ Azææ  pöÿÿFìÿÿFìÿÿþ @d`N@d`S TìÿÿUìÿÿ Aöèúè  löÿÿBìÿÿBìÿÿþ @k`N@k`R ,íÿÿ-íÿÿ Aiìnì  höÿÿ>ìÿÿ>ìÿÿþ @u`F@u`K (íÿÿ)íÿÿ Aíí  döÿÿ:ìÿÿ:ìÿÿþ @w`N@w`S HìÿÿIìÿÿ AŠïŽï  `öÿÿ6ìÿÿ6ìÿÿþ @~`N@~`R  íÿÿ!íÿÿ A^ócó  \öÿÿ2ìÿÿ2ìÿÿþ @Š`>@Š`C íÿÿíÿÿ ARôWô  Xöÿÿ.ìÿÿ.ìÿÿþ @`F@`K <ìÿÿ=ìÿÿ AFõJõ  Töÿÿ*ìÿÿ*ìÿÿþ @`N@`R 8ìÿÿ9ìÿÿ AÊöÎö  Pöÿÿ&ìÿÿ&ìÿÿþ @”`N@”`R íÿÿíÿÿ A¥úªú  Löÿÿ"ìÿÿ"ìÿÿþ @Ÿ`T@Ÿ`Y 0ìÿÿ1ìÿÿ AÉûÍû  Höÿÿìÿÿìÿÿþ @¢`N@¢`R íÿÿ íÿÿ AÃÿÈÿ  Döÿÿìÿÿìÿÿþ @¯`>@¯`C (ìÿÿ)ìÿÿ A¥©  @öÿÿìÿÿìÿÿþ @²`F@²`J $ìÿÿ%ìÿÿ A  <öÿÿìÿÿìÿÿþ @ž`F@ž`J  ìÿÿ!ìÿÿ A¬°  8öÿÿìÿÿìÿÿþ @Á`6@Á`: ìÿÿìÿÿ A“—  4öÿÿ ìÿÿ ìÿÿþ @Ã`[@Ã`_ ìÿÿìÿÿ A‘•  0öÿÿìÿÿìÿÿþ @Æ`?@Æ`C ðìÿÿñìÿÿ A    ,öÿÿìÿÿìÿÿþ @Õ`C@Õ`H ìÿÿìÿÿ AÕ Ù   (öÿÿþëÿÿþëÿÿþ @Ø`@@Ø`D  ìÿÿ ìÿÿ AÙ Ý   $öÿÿúëÿÿúëÿÿþ @Û`R@Û`V ìÿÿ ìÿÿ A³·   öÿÿöëÿÿöëÿÿþ @á`A@á`E àìÿÿáìÿÿ Av{  öÿÿòëÿÿòëÿÿþ @ã`H@ã`M ÜìÿÿÝìÿÿ Aty  öÿÿîëÿÿîëÿÿþ @æ`F@æ`K ØìÿÿÙìÿÿ Arw  öÿÿêëÿÿêëÿÿþ @é`N@é`S øëÿÿùëÿÿ A €  öÿÿæëÿÿæëÿÿþ @ì`V@ì`Z ôëÿÿõëÿÿ Aïó   öÿÿâëÿÿâëÿÿþ @ð`V@ð`Z ÌìÿÿÍìÿÿ A&+  öÿÿÞëÿÿÞëÿÿþ @ô`V@ô`[ ìëÿÿíëÿÿ AÁÅ  öÿÿÚëÿÿÚëÿÿþ @ú`n@ú`r‘ûÿÿ.íÿÿ AÆÊ 4öÿÿ(ìÿÿ(ìÿÿþ @ú`s@ú`w ÁìÿÿÂìÿÿ AAF  ýõÿÿÓëÿÿÓëÿÿþ @ÿ`c@ÿ`h œìÿÿŸìÿÿ A_ d   ùõÿÿÏëÿÿÏëÿÿþ @ ``@ `e ÝëÿÿÞëÿÿ A."2"  õõÿÿËëÿÿËëÿÿþ @`V@`Z ÙëÿÿÚëÿÿ AJ$N$  ñõÿÿÇëÿÿÇëÿÿþ @`_@`c ÕëÿÿÖëÿÿ A¬%°%  íõÿÿÃëÿÿÃëÿÿþ @`N@`R ­ìÿÿ®ìÿÿ AÃ'È'  éõÿÿ¿ëÿÿ¿ëÿÿþ @``@`e ÍëÿÿÎëÿÿ AË(Ï(  åõÿÿ»ëÿÿ»ëÿÿþ @"`N@"`R ÉëÿÿÊëÿÿ Aô*ø*  áõÿÿ·ëÿÿ·ëÿÿþ @'`N@'`R ÅëÿÿÆëÿÿ AF.J.  Ýõÿÿ³ëÿÿ³ëÿÿþ @2`6@2`: ìÿÿžìÿÿ Ae0j0  Ùõÿÿ¯ëÿÿ¯ëÿÿþ @;`F@;`K ™ìÿÿšìÿÿ A11  Õõÿÿ«ëÿÿ«ëÿÿþ @>`6@>`; •ìÿÿ–ìÿÿ Aï1ô1  Ñõÿÿ§ëÿÿ§ëÿÿþ @A`>@A`C µëÿÿ¶ëÿÿ Aõ2ù2  Íõÿÿ£ëÿÿ£ëÿÿþ @D`F@D`J ±ëÿÿ²ëÿÿ AZ4^4  ÉõÿÿŸëÿÿŸëÿÿþ @H`F@H`J ­ëÿÿ®ëÿÿ AŸ5Â5  Åõÿÿ›ëÿÿ›ëÿÿþ @L`F@L`J …ìÿÿ†ìÿÿ A£7š7  Áõÿÿ—ëÿÿ—ëÿÿþ @R`>@R`C ¥ëÿÿŠëÿÿ A©8­8  œõÿÿ“ëÿÿ“ëÿÿþ @U`F@U`J ¡ëÿÿ¢ëÿÿ A ::  ¹õÿÿëÿÿëÿÿþ @Y`F@Y`J ëÿÿžëÿÿ Ao;s;  µõÿÿ‹ëÿÿ‹ëÿÿþ @]`F@]`J ™ëÿÿšëÿÿ AŒ=À=  ±õÿÿ‡ëÿÿ‡ëÿÿþ @e`O@e`S •ëÿÿ–ëÿÿ AÈ>Ì>  ­õÿÿƒëÿÿƒëÿÿþ @h`Z@h`^ mìÿÿnìÿÿ AÙ?Þ?  ©õÿÿëÿÿëÿÿþ @k`;@k`@ iìÿÿjìÿÿ A¢@§@  ¥õÿÿ{ëÿÿ{ëÿÿþ @n`>@n`C ‰ëÿÿŠëÿÿ A7A;A  ¡õÿÿwëÿÿwëÿÿþ @p`F@p`J …ëÿÿ†ëÿÿ A¯B³B  õÿÿsëÿÿsëÿÿþ @t`F@t`J ëÿÿ‚ëÿÿ A‹CC  ™õÿÿoëÿÿoëÿÿþ @v`z@v`~ }ëÿÿ~ëÿÿ AåEéE  •õÿÿkëÿÿkëÿÿþ @{`U@{`Y UìÿÿVìÿÿ AÐFÕF  ‘õÿÿgëÿÿgëÿÿþ @}`\@}`a QìÿÿRìÿÿ AHH  õÿÿcëÿÿcëÿÿþ @€`Z@€`_ MìÿÿNìÿÿ ANISI  ‰õÿÿ_ëÿÿ_ëÿÿþ @ƒ`b@ƒ`g mëÿÿnëÿÿ AžJŒJ  …õÿÿ[ëÿÿ[ëÿÿþ @†`j@†`n iëÿÿjëÿÿ AÝLáL  õÿÿWëÿÿWëÿÿþ @Š`j@Š`n eëÿÿfëÿÿ AoOsO  }õÿÿSëÿÿSëÿÿþ @`b@`f aëÿÿbëÿÿ AnPrP  yõÿÿOëÿÿOëÿÿþ @’`p@’`tûÿÿ£ìÿÿ AsPwP 4võÿÿëÿÿëÿÿþ @’`u@’`y Zëÿÿ[ëÿÿ AóS÷S  rõÿÿHëÿÿHëÿÿþ @˜`v@˜`z 2ìÿÿ3ìÿÿ ANVSV  nõÿÿDëÿÿDëÿÿþ @ž`Z@ž`_ RëÿÿSëÿÿ A’W–W  jõÿÿ@ëÿÿ@ëÿÿþ @¡`b@¡`f NëÿÿOëÿÿ A2Z6Z  fõÿÿ<ëÿÿ<ëÿÿþ @Š`b@Š`f &ìÿÿ'ìÿÿ A__  bõÿÿ8ëÿÿ8ëÿÿþ @Ž`>@Ž`C FëÿÿGëÿÿ A€_š_  ^õÿÿ4ëÿÿ4ëÿÿþ @¶`F@¶`J BëÿÿCëÿÿ Aaa  Zõÿÿ0ëÿÿ0ëÿÿþ @º`F@º`J >ëÿÿ?ëÿÿ Aòaöa  Võÿÿ,ëÿÿ,ëÿÿþ @Œ`y@Œ`} :ëÿÿ;ëÿÿ AAdEd  Rõÿÿ(ëÿÿ(ëÿÿþ @Á`U@Á`Y ìÿÿìÿÿ A,e1e  Nõÿÿ$ëÿÿ$ëÿÿþ @Ã`\@Ã`a ìÿÿìÿÿ Apfuf  Jõÿÿ ëÿÿ ëÿÿþ @Æ`Z@Æ`_  ìÿÿ ìÿÿ Aªg¯g  Fõÿÿëÿÿëÿÿþ @É`b@É`g *ëÿÿ+ëÿÿ Aii  Bõÿÿëÿÿëÿÿþ @Ì`j@Ì`n &ëÿÿ'ëÿÿ A5k9k  >õÿÿëÿÿëÿÿþ @Ð`j@Ð`n "ëÿÿ#ëÿÿ AÇmËm  :õÿÿëÿÿëÿÿþ @Ö`b@Ö`f ëÿÿëÿÿ AÆnÊn  6õÿÿ ëÿÿ ëÿÿþ @Ø`p@Ø`tÃúÿÿ`ìÿÿ AËnÏn 43õÿÿZëÿÿZëÿÿþ @Ø`u@Ø`y ëÿÿëÿÿ AKrOr  /õÿÿëÿÿëÿÿþ @Þ`v@Þ`z ëÿÿëÿÿ AŠtªt  +õÿÿëÿÿëÿÿþ @ä`Z@ä`^ ëÿÿëÿÿ AŸxÂx  'õÿÿýêÿÿýêÿÿþ @ð`>@ð`B çëÿÿèëÿÿ Ax{}{  #õÿÿùêÿÿùêÿÿþ @û`@@û`E ëÿÿëÿÿ Aí{ñ{  õÿÿõêÿÿõêÿÿþ @ý`6@ý`: ëÿÿëÿÿ Auy  õÿÿñêÿÿñêÿÿþ @`E@`I ÛëÿÿÜëÿÿ Aæƒëƒ  õÿÿíêÿÿíêÿÿþ @`M@`R ×ëÿÿØëÿÿ Ak„p„  õÿÿéêÿÿéêÿÿþ @`>@`C ÓëÿÿÔëÿÿ Ai…n…  õÿÿåêÿÿåêÿÿþ @`F@`K ÏëÿÿÐëÿÿ AˇЇ   õÿÿáêÿÿáêÿÿþ @&`F@&`K !øÿÿÅ÷ÿÿ Ažˆʈ  Ažˆ»ˆ  õÿÿ3ëÿÿ3ëÿÿý @)`@@)`R ÆëÿÿÇëÿÿ A`‹e‹  õÿÿØêÿÿØêÿÿþ @0`N@0`S æêÿÿçêÿÿ AύӍ  þôÿÿÔêÿÿÔêÿÿþ @7`V@7`Z âêÿÿãêÿÿ AëŽïŽ  úôÿÿÐêÿÿÐêÿÿþ @:`V@:`Z Þêÿÿßêÿÿ A‹’’  öôÿÿÌêÿÿÌêÿÿþ @F`H@F`L ÚêÿÿÛêÿÿ A€“š“  òôÿÿÈêÿÿÈêÿÿþ @I`W@I`[ Öêÿÿ×êÿÿ A«”¯”  îôÿÿÄêÿÿÄêÿÿþ @L`C@L`G ®ëÿÿ¯ëÿÿ Ay•~•  êôÿÿÀêÿÿÀêÿÿþ @N`L@N`Q ÎêÿÿÏêÿÿ Am–q–  æôÿÿŒêÿÿŒêÿÿþ @Q`J@Q`N Šëÿÿ§ëÿÿ AN—S—  âôÿÿžêÿÿžêÿÿþ @S`X@S`] ÆêÿÿÇêÿÿ A˜˜  ÞôÿÿŽêÿÿŽêÿÿþ @U`V@U`Z ÂêÿÿÃêÿÿ AЙޙ  Úôÿÿ°êÿÿ°êÿÿþ @Y`V@Y`Z Ÿêÿÿ¿êÿÿ A››  Öôÿÿ¬êÿÿ¬êÿÿþ @]`V@]`Z ºêÿÿ»êÿÿ AŸœ£œ  Òôÿÿšêÿÿšêÿÿþ @a`V@a`Z ¶êÿÿ·êÿÿ A)ž-ž  Îôÿÿ€êÿÿ€êÿÿþ @e`V@e`Z ²êÿÿ³êÿÿ A²Ÿ¶Ÿ  Êôÿÿ êÿÿ êÿÿþ @i`V@i`Z ®êÿÿ¯êÿÿ A9¡=¡  Æôÿÿœêÿÿœêÿÿþ @m`V@m`Z ªêÿÿ«êÿÿ AÁ¢Å¢  Âôÿÿ˜êÿÿ˜êÿÿþ @q`V@q`Z Šêÿÿ§êÿÿ AK€O€  Ÿôÿÿ”êÿÿ”êÿÿþ @u`V@u`Z ¢êÿÿ£êÿÿ AÒ¥Ö¥  ºôÿÿêÿÿêÿÿþ @y`V@y`Z žêÿÿŸêÿÿ Ašš  ¶ôÿÿŒêÿÿŒêÿÿþ @€`J@€`N vëÿÿwëÿÿ Aâ©ç©  ²ôÿÿˆêÿÿˆêÿÿþ @„`Y@„`^ –êÿÿ—êÿÿ A««  ®ôÿÿ„êÿÿ„êÿÿþ @‡`Z@‡`^ ’êÿÿ“êÿÿ AÚ¬Þ¬  ªôÿÿ€êÿÿ€êÿÿþ @‹`Z@‹`^ Žêÿÿêÿÿ A·­»­  Šôÿÿ|êÿÿ|êÿÿþ @`h@`l Šêÿÿ‹êÿÿ A%°)°  ¢ôÿÿxêÿÿxêÿÿþ @’`Z@’`^ †êÿÿ‡êÿÿ Aȱ̱  žôÿÿtêÿÿtêÿÿþ @–`Z@–`^ ‚êÿÿƒêÿÿ AZ³^³  šôÿÿpêÿÿpêÿÿþ @š`Z@š`^ ~êÿÿêÿÿ A>µBµ  –ôÿÿlêÿÿlêÿÿþ @ž`Z@ž`^ zêÿÿ{êÿÿ A6·:·  ’ôÿÿhêÿÿhêÿÿþ @¢`Z@¢`^ vêÿÿwêÿÿ A2¹6¹  Žôÿÿdêÿÿdêÿÿþ @Š`Z@Š`^ rêÿÿsêÿÿ A(»,»  Šôÿÿ`êÿÿ`êÿÿþ @ª`Z@ª`^ nêÿÿoêÿÿ Aœ œ  †ôÿÿ\êÿÿ\êÿÿþ @®`Z@®`^ jêÿÿkêÿÿ AŸŸ  ‚ôÿÿXêÿÿXêÿÿþ @°`v@°`z fêÿÿgêÿÿ A¿¿  ~ôÿÿTêÿÿTêÿÿþ @²`l@²`p bêÿÿcêÿÿ A­Á±Á  zôÿÿPêÿÿPêÿÿþ @ž`p@ž`t ^êÿÿ_êÿÿ AJÃNà  vôÿÿLêÿÿLêÿÿþ @Œ`c@Œ`g 6ëÿÿ7ëÿÿ AñÄöÄ  rôÿÿHêÿÿHêÿÿþ @¿`l@¿`q VêÿÿWêÿÿ AêÇîÇ  nôÿÿDêÿÿDêÿÿþ @Æ`j@Æ`n RêÿÿSêÿÿ AhÊlÊ  jôÿÿ@êÿÿ@êÿÿþ @Ì`j@Ì`n NêÿÿOêÿÿ AÍÏÑÏ  fôÿÿ<êÿÿ<êÿÿþ @Ý`>@Ý`B &ëÿÿ'ëÿÿ A0Ò5Ò  bôÿÿ8êÿÿ8êÿÿþ @æ`S@æ`X "ëÿÿ#ëÿÿ AµÒºÒ  ^ôÿÿ4êÿÿ4êÿÿþ @è`>@è`C ëÿÿëÿÿ AßÓäÓ  Zôÿÿ0êÿÿ0êÿÿþ @ë`F@ë`K >êÿÿ?êÿÿ A„ÔˆÔ  Vôÿÿ,êÿÿ,êÿÿþ @í`N@í`R ëÿÿëÿÿ A ÖÖ  Rôÿÿ(êÿÿ(êÿÿþ @ñ`N@ñ`S 6êÿÿ7êÿÿ A*Ø.Ø  Nôÿÿ$êÿÿ$êÿÿþ @ö`V@ö`Z 2êÿÿ3êÿÿ AÆÙÊÙ  Jôÿÿ êÿÿ êÿÿþ @ú`s@ú`w  ëÿÿ ëÿÿ A,Ü1Ü  Fôÿÿêÿÿêÿÿþ @`F@`K *êÿÿ+êÿÿ AÑÜÕÜ  Bôÿÿêÿÿêÿÿþ @`N@`R &êÿÿ'êÿÿ AYÞ]Þ  >ôÿÿêÿÿêÿÿþ @`N@`R þêÿÿÿêÿÿ Aáá  :ôÿÿêÿÿêÿÿþ @`F@`K êÿÿêÿÿ A¿áÃá  6ôÿÿ êÿÿ êÿÿþ @`N@`R êÿÿêÿÿ AEãIã  2ôÿÿêÿÿêÿÿþ @`N@`R òêÿÿóêÿÿ AMæRæ  .ôÿÿêÿÿêÿÿþ C‘– îêÿÿïêÿÿ A”é™é  *ôÿÿêÿÿêÿÿþ @'`N@'`S êÿÿêÿÿ Aìì  &ôÿÿüéÿÿüéÿÿþ @.`V@.`Z  êÿÿ êÿÿ Aî î  "ôÿÿøéÿÿøéÿÿþ @4`V@4`Z âêÿÿãêÿÿ AZñ_ñ  ôÿÿôéÿÿôéÿÿþ @?`F@?`K êÿÿêÿÿ AKôOô  ôÿÿðéÿÿðéÿÿþ @I`Y@I`] þéÿÿÿéÿÿ AVõZõ  ôÿÿìéÿÿìéÿÿþ @L`C@L`G úéÿÿûéÿÿ Aöö  ôÿÿèéÿÿèéÿÿþ @N`e@N`i öéÿÿ÷éÿÿ Aùù  ôÿÿäéÿÿäéÿÿþ @X`>@X`B ÎêÿÿÏêÿÿ Alûqû   ôÿÿàéÿÿàéÿÿþ @a`O@a`T ÊêÿÿËêÿÿ Añûöû  ôÿÿÜéÿÿÜéÿÿþ @c`>@c`C ÆêÿÿÇêÿÿ Aý ý  ôÿÿØéÿÿØéÿÿþ @f`F@f`K æéÿÿçéÿÿ AÀýÄý  þóÿÿÔéÿÿÔéÿÿþ @h`N@h`R Ÿêÿÿ¿êÿÿ AEÿJÿ  úóÿÿÐéÿÿÐéÿÿþ @l`N@l`S Þéÿÿßéÿÿ AZ^  öóÿÿÌéÿÿÌéÿÿþ @q`V@q`Z ÚéÿÿÛéÿÿ Aîò  òóÿÿÈéÿÿÈéÿÿþ @u`o@u`s ²êÿÿ³êÿÿ A†‹  îóÿÿÄéÿÿÄéÿÿþ @}`F@}`K ÒéÿÿÓéÿÿ A+/  êóÿÿÀéÿÿÀéÿÿþ @`N@`R ÎéÿÿÏéÿÿ A¯³  æóÿÿŒéÿÿŒéÿÿþ @ƒ`N@ƒ`R Šêÿÿ§êÿÿ Ah m   âóÿÿžéÿÿžéÿÿþ @‹`F@‹`K ÆéÿÿÇéÿÿ A    ÞóÿÿŽéÿÿŽéÿÿþ @`N@`R ÂéÿÿÃéÿÿ A “   Úóÿÿ°éÿÿ°éÿÿþ @‘`N@‘`R šêÿÿ›êÿÿ Aqv  Öóÿÿ¬éÿÿ¬éÿÿþ @™`s@™`x –êÿÿ—êÿÿ AUZ  Òóÿÿšéÿÿšéÿÿþ @¡`N@¡`S ¶éÿÿ·éÿÿ AÂÆ  Îóÿÿ€éÿÿ€éÿÿþ @š`V@š`Z ²éÿÿ³éÿÿ AÈÌ  Êóÿÿ éÿÿ éÿÿþ @®`V@®`Z Šêÿÿ‹êÿÿ A  Æóÿÿœéÿÿœéÿÿþ @¹`F@¹`K ªéÿÿ«éÿÿ Aü  Âóÿÿ˜éÿÿ˜éÿÿþ @Ã`U@Ã`Y Šéÿÿ§éÿÿ A  Ÿóÿÿ”éÿÿ”éÿÿþ @Æ`C@Æ`G ~êÿÿêÿÿ AÑÖ  ºóÿÿéÿÿéÿÿþ @È`L@È`Q žéÿÿŸéÿÿ AÅÉ  ¶óÿÿŒéÿÿŒéÿÿþ @Ë`J@Ë`N vêÿÿwêÿÿ AŠ «   ²óÿÿˆéÿÿˆéÿÿþ @Í`X@Í`] –éÿÿ—éÿÿ AZ!^!  ®óÿÿ„éÿÿ„éÿÿþ @Ï`V@Ï`Z ’éÿÿ“éÿÿ Aâ"æ"  ªóÿÿ€éÿÿ€éÿÿþ @Ó`V@Ó`Z Žéÿÿéÿÿ Ao$s$  Šóÿÿ|éÿÿ|éÿÿþ @×`V@×`Z Šéÿÿ‹éÿÿ Aø%ü%  ¢óÿÿxéÿÿxéÿÿþ @Û`V@Û`Z †éÿÿ‡éÿÿ A„'ˆ'  žóÿÿtéÿÿtéÿÿþ @ß`V@ß`Z ‚éÿÿƒéÿÿ A))  šóÿÿpéÿÿpéÿÿþ @ã`V@ã`Z ~éÿÿéÿÿ AW+[+  –óÿÿléÿÿléÿÿþ @ê`J@ê`N VêÿÿWêÿÿ A³0ž0  ’óÿÿhéÿÿhéÿÿþ @ó`Y@ó`^ véÿÿwéÿÿ Aé1í1  Žóÿÿdéÿÿdéÿÿþ @ö`Z@ö`^ réÿÿséÿÿ A·3»3  Šóÿÿ`éÿÿ`éÿÿþ @ú`Z@ú`^ néÿÿoéÿÿ AH5L5  †óÿÿ\éÿÿ\éÿÿþ @þ`Z@þ`^ jéÿÿkéÿÿ A%6)6  ‚óÿÿXéÿÿXéÿÿþ @`h@`l féÿÿgéÿÿ A|8€8  ~óÿÿTéÿÿTéÿÿþ @`Z@`^ béÿÿcéÿÿ A ::  zóÿÿPéÿÿPéÿÿþ @ `Z@ `^ ^éÿÿ_éÿÿ A;;  vóÿÿLéÿÿLéÿÿþ @ `h@ `l Zéÿÿ[éÿÿ Af=j=  róÿÿHéÿÿHéÿÿþ @`Z@`^ VéÿÿWéÿÿ AY>]>  nóÿÿDéÿÿDéÿÿþ @`r@`v RéÿÿSéÿÿ AÔ?Ø?  jóÿÿ@éÿÿ@éÿÿþ @`l@`p NéÿÿOéÿÿ AnBrB  fóÿÿ<éÿÿ<éÿÿþ @`p@`t JéÿÿKéÿÿ A DD  bóÿÿ8éÿÿ8éÿÿþ @ `c@ `g "êÿÿ#êÿÿ AŒE‘E  ^óÿÿ4éÿÿ4éÿÿþ @#`l@#`q BéÿÿCéÿÿ A…H‰H  Zóÿÿ0éÿÿ0éÿÿþ @*`j@*`n >éÿÿ?éÿÿ AKK  Vóÿÿ,éÿÿ,éÿÿþ @0`j@0`n :éÿÿ;éÿÿ AjPnP  Róÿÿ(éÿÿ(éÿÿþ @A`>@A`B êÿÿêÿÿ AÒR×R  Nóÿÿ$éÿÿ$éÿÿþ @J`X@J`] êÿÿêÿÿ AWS\S  Jóÿÿ éÿÿ éÿÿþ @L`>@L`C  êÿÿ êÿÿ AT†T  Fóÿÿéÿÿéÿÿþ @O`F@O`K *éÿÿ+éÿÿ A&U*U  Bóÿÿéÿÿéÿÿþ @Q`N@Q`R êÿÿêÿÿ A°VµV  >óÿÿéÿÿéÿÿþ @U`N@U`S "éÿÿ#éÿÿ AÍXÑX  :óÿÿéÿÿéÿÿþ @Z`V@Z`Z éÿÿéÿÿ A\Z`Z  6óÿÿ éÿÿ éÿÿþ @^`o@^`s öéÿÿ÷éÿÿ AÂ\Ç\  2óÿÿéÿÿéÿÿþ @f`F@f`K éÿÿéÿÿ Ag]k]  .óÿÿéÿÿéÿÿþ @h`N@h`R éÿÿéÿÿ Aï^ó^  *óÿÿéÿÿéÿÿþ @l`N@l`R êéÿÿëéÿÿ A²a·a  &óÿÿüèÿÿüèÿÿþ @t`F@t`K  éÿÿ éÿÿ AWb[b  "óÿÿøèÿÿøèÿÿþ @v`N@v`R éÿÿéÿÿ AÝcác  óÿÿôèÿÿôèÿÿþ @z`N@z`R Þéÿÿßéÿÿ A×fÜf  óÿÿðèÿÿðèÿÿþ C‚‚† ÚéÿÿÛéÿÿ AÉiÎi  óÿÿìèÿÿìèÿÿþ @Š`N@Š`S úèÿÿûèÿÿ A6l:l  óÿÿèèÿÿèèÿÿþ @‘`V@‘`Z öèÿÿ÷èÿÿ A@`B féÿÿgéÿÿ A®³  ¢òÿÿxèÿÿxèÿÿþ @`A@`F béÿÿcéÿÿ A#ž(ž  žòÿÿtèÿÿtèÿÿþ @`6@`; ^éÿÿ_éÿÿ A ŸŸ  šòÿÿpèÿÿpèÿÿþ @`>@`C Zéÿÿ[éÿÿ A     –òÿÿlèÿÿlèÿÿþ @!`F@!`K zèÿÿ{èÿÿ A_¢c¢  ’òÿÿhèÿÿhèÿÿþ @(`N@(`R vèÿÿwèÿÿ AԀ؀  Žòÿÿdèÿÿdèÿÿþ @0`N@0`R rèÿÿsèÿÿ Aͧѧ  Šòÿÿ`èÿÿ`èÿÿþ @;`>@;`B JéÿÿKéÿÿ Aà©å©  †òÿÿ\èÿÿ\èÿÿþ @B`B@B`G jèÿÿkèÿÿ Aݪ᪠ ‚òÿÿXèÿÿXèÿÿþ @E`>@E`B BéÿÿCéÿÿ A=¬B¬  ~òÿÿTèÿÿTèÿÿþ @I`>@I`C >éÿÿ?éÿÿ A+­0­  zòÿÿPèÿÿPèÿÿþ @L`F@L`K ^èÿÿ_èÿÿ AЭÔ­  vòÿÿLèÿÿLèÿÿþ @N`N@N`R Zèÿÿ[èÿÿ AZ¯^¯  ròÿÿHèÿÿHèÿÿþ @R`N@R`R 2éÿÿ3éÿÿ Aî²ó²  nòÿÿDèÿÿDèÿÿþ @\`F@\`K RèÿÿSèÿÿ A“³—³  jòÿÿ@èÿÿ@èÿÿþ @^`N@^`R NèÿÿOèÿÿ Aµ"µ  fòÿÿ<èÿÿ<èÿÿþ @b`N@b`R &éÿÿ'éÿÿ Aš¹­¹  bòÿÿ8èÿÿ8èÿÿþ @o`F@o`K FèÿÿGèÿÿ AMºQº  ^òÿÿ4èÿÿ4èÿÿþ @q`N@q`R BèÿÿCèÿÿ Aܻ໠ Zòÿÿ0èÿÿ0èÿÿþ @u`N@u`R éÿÿéÿÿ AÁ"Á  Vòÿÿ,èÿÿ,èÿÿþ @ƒ`F@ƒ`K :èÿÿ;èÿÿ AÂÁÆÁ  Ròÿÿ(èÿÿ(èÿÿþ @…`N@…`R éÿÿéÿÿ ALÃQà  Nòÿÿ$èÿÿ$èÿÿþ @‰`N@‰`S 2èÿÿ3èÿÿ A†ÆŠÆ  Jòÿÿ èÿÿ èÿÿþ @‘`V@‘`Z .èÿÿ/èÿÿ A ÈÈ  Fòÿÿèÿÿèÿÿþ @•`V@•`Z *èÿÿ+èÿÿ AŒÉÉ  Bòÿÿèÿÿèÿÿþ @™`V@™`Z éÿÿéÿÿ AkÌpÌ  >òÿÿèÿÿèÿÿþ @£`>@£`C "èÿÿ#èÿÿ AÍÍ  :òÿÿèÿÿèÿÿþ @¥`F@¥`J èÿÿèÿÿ AqÎuÎ  6òÿÿ èÿÿ èÿÿþ @©`F@©`J èÿÿèÿÿ AÃÑÇÑ  2òÿÿèÿÿèÿÿþ @³`>@³`B òèÿÿóèÿÿ A'Ó,Ó  .òÿÿèÿÿèÿÿþ @·`>@·`C îèÿÿïèÿÿ AÔÔ  *òÿÿèÿÿèÿÿþ @º`F@º`K èÿÿèÿÿ AºÔŸÔ  &òÿÿüçÿÿüçÿÿþ @Œ`N@Œ`R  èÿÿ èÿÿ AIÖMÖ  "òÿÿøçÿÿøçÿÿþ @À`N@À`R âèÿÿãèÿÿ AÝÚâÚ  òÿÿôçÿÿôçÿÿþ @Í`F@Í`K èÿÿèÿÿ A‚Û†Û  òÿÿðçÿÿðçÿÿþ @Ï`N@Ï`R þçÿÿÿçÿÿ AÝÝ  òÿÿìçÿÿìçÿÿþ @Ó`N@Ó`R Öèÿÿ×èÿÿ Ašá­á  òÿÿèçÿÿèçÿÿþ @à`F@à`K öçÿÿ÷çÿÿ AMâQâ  òÿÿäçÿÿäçÿÿþ @â`N@â`R òçÿÿóçÿÿ AÜãàã   òÿÿàçÿÿàçÿÿþ @æ`N@æ`R ÊèÿÿËèÿÿ Apèuè  òÿÿÜçÿÿÜçÿÿþ @ó`F@ó`K êçÿÿëçÿÿ Aéé  òÿÿØçÿÿØçÿÿþ @õ`N@õ`R æçÿÿççÿÿ A«ê¯ê  þñÿÿÔçÿÿÔçÿÿþ @ù`N@ù`R Ÿèÿÿ¿èÿÿ AQïVï  úñÿÿÐçÿÿÐçÿÿþ @`F@`K Þçÿÿßçÿÿ Aöïúï  öñÿÿÌçÿÿÌçÿÿþ @`N@`R ÚçÿÿÛçÿÿ AŠñŽñ  òñÿÿÈçÿÿÈçÿÿþ @ `N@ `R ²èÿÿ³èÿÿ A,ö1ö  îñÿÿÄçÿÿÄçÿÿþ @`F@`K ÒçÿÿÓçÿÿ AÑöÕö  êñÿÿÀçÿÿÀçÿÿþ @`N@`R ÎçÿÿÏçÿÿ Aaøeø  æñÿÿŒçÿÿŒçÿÿþ @`N@`R Šèÿÿ§èÿÿ A÷üüü  âñÿÿžçÿÿžçÿÿþ @,`F@,`K ÆçÿÿÇçÿÿ Aœý ý  ÞñÿÿŽçÿÿŽçÿÿþ @.`N@.`R ÂçÿÿÃçÿÿ A/ÿ3ÿ  Úñÿÿ°çÿÿ°çÿÿþ @2`N@2`R Ÿçÿÿ¿çÿÿ A,0  Öñÿÿ¬çÿÿ¬çÿÿþ @A`>@A`B –èÿÿ—èÿÿ A”  Òñÿÿšçÿÿšçÿÿþ @E`>@E`C ’èÿÿ“èÿÿ A}‚  Îñÿÿ€çÿÿ€çÿÿþ @H`F@H`K ²çÿÿ³çÿÿ A"&  Êñÿÿ çÿÿ çÿÿþ @J`N@J`R ®çÿÿ¯çÿÿ AŽž  Æñÿÿœçÿÿœçÿÿþ @N`N@N`R †èÿÿ‡èÿÿ A    Âñÿÿ˜çÿÿ˜çÿÿþ @Z`F@Z`K Šçÿÿ§çÿÿ A¥ ©   Ÿñÿÿ”çÿÿ”çÿÿþ @\`N@\`R ¢çÿÿ£çÿÿ A<@  ºñÿÿçÿÿçÿÿþ @``N@``R zèÿÿ{èÿÿ A=B  ¶ñÿÿŒçÿÿŒçÿÿþ @o`>@o`C šçÿÿ›çÿÿ AÒÖ  ²ñÿÿˆçÿÿˆçÿÿþ @q`F@q`J –çÿÿ—çÿÿ A@D  ®ñÿÿ„çÿÿ„çÿÿþ @u`F@u`J ’çÿÿ“çÿÿ Aàä  ªñÿÿ€çÿÿ€çÿÿþ @€`>@€`B Žçÿÿçÿÿ AEI  Šñÿÿ|çÿÿ|çÿÿþ @„`>@„`B fèÿÿgèÿÿ A‘"–"  ¢ñÿÿxçÿÿxçÿÿþ @`M@`R †çÿÿ‡çÿÿ A¿#Ã#  žñÿÿtçÿÿtçÿÿþ @ `N@ `R ‚çÿÿƒçÿÿ A ((  šñÿÿpçÿÿpçÿÿþ @®`>@®`B ~çÿÿçÿÿ As)w)  –ñÿÿlçÿÿlçÿÿþ @²`>@²`B VèÿÿWèÿÿ A ;;  ’ñÿÿhçÿÿhçÿÿþ @ï`M@ï`R vçÿÿwçÿÿ A:<><  Žñÿÿdçÿÿdçÿÿþ @ò`N@ò`R NèÿÿOèÿÿ Aˆ@@  Šñÿÿ`çÿÿ`çÿÿþ @`>@`C JèÿÿKèÿÿ A|AA  †ñÿÿ\çÿÿ\çÿÿþ @`F@`K jçÿÿkçÿÿ AªB®B  ‚ñÿÿXçÿÿXçÿÿþ @`N@`R BèÿÿCèÿÿ A±F¶F  ~ñÿÿTçÿÿTçÿÿþ @`F@`K bçÿÿcçÿÿ AßGãG  zñÿÿPçÿÿPçÿÿþ @`N@`R :èÿÿ;èÿÿ AãKèK  vñÿÿLçÿÿLçÿÿþ @!`F@!`K Zçÿÿ[çÿÿ AêLîL  rñÿÿHçÿÿHçÿÿþ @$`N@$`R VçÿÿWçÿÿ A^NbN  nñÿÿDçÿÿDçÿÿþ @(`N@(`R .èÿÿ/èÿÿ AŽR“R  jñÿÿ@çÿÿ@çÿÿþ @5`>@5`C NçÿÿOçÿÿ AuSyS  fñÿÿ<çÿÿ<çÿÿþ @8`F@8`J JçÿÿKçÿÿ AÙUÝU  bñÿÿ8çÿÿ8çÿÿþ @>`F@>`J FçÿÿGçÿÿ AfXjX  ^ñÿÿ4çÿÿ4çÿÿþ @G`6@G`: BçÿÿCçÿÿ AEYIY  Zñÿÿ0çÿÿ0çÿÿþ @I`\@I`` >çÿÿ?çÿÿ AMZQZ  Vñÿÿ,çÿÿ,çÿÿþ @L`?@L`C èÿÿèÿÿ Aì\ñ\  Rñÿÿ(çÿÿ(çÿÿþ @S`I@S`N èÿÿèÿÿ A^!^  Nñÿÿ$çÿÿ$çÿÿþ @V`J@V`O èÿÿèÿÿ A&_+_  Jñÿÿ çÿÿ çÿÿþ @Y`R@Y`W .çÿÿ/çÿÿ A[`_`  Fñÿÿçÿÿçÿÿþ @\`Z@\`^ *çÿÿ+çÿÿ Abb  Bñÿÿçÿÿçÿÿþ @``l@``p &çÿÿ'çÿÿ Aïcóc  >ñÿÿçÿÿçÿÿþ @d`l@d`p "çÿÿ#çÿÿ AXf\f  :ñÿÿçÿÿçÿÿþ @j`f@j`j úçÿÿûçÿÿ AÔgÙg  6ñÿÿ çÿÿ çÿÿþ @n`R@n`W öçÿÿ÷çÿÿ Aii  2ñÿÿçÿÿçÿÿþ @q`Z@q`_ òçÿÿóçÿÿ AŠjj  .ñÿÿçÿÿçÿÿþ @t`s@t`x îçÿÿïçÿÿ AÕmÚm  *ñÿÿçÿÿçÿÿþ @|`b@|`g êçÿÿëçÿÿ ABqGq  &ñÿÿüæÿÿüæÿÿþ @…`s@…`x æçÿÿççÿÿ Aìsñs  "ñÿÿøæÿÿøæÿÿþ @Œ`t@Œ`y âçÿÿãçÿÿ A—vœv  ñÿÿôæÿÿôæÿÿþ @“`s@“`x Þçÿÿßçÿÿ A>yCy  ñÿÿðæÿÿðæÿÿþ @š`q@š`v þæÿÿÿæÿÿ A‘z•z  ñÿÿìæÿÿìæÿÿþ @`b@`f úæÿÿûæÿÿ A-}1}  ñÿÿèæÿÿèæÿÿþ @£`p@£`t öæÿÿ÷æÿÿ A‚‚  ñÿÿäæÿÿäæÿÿþ C®¿®Ã ÎçÿÿÏçÿÿ Aò‚÷‚   ñÿÿàæÿÿàæÿÿþ @°`z@°` îæÿÿïæÿÿ AL„P„  ñÿÿÜæÿÿÜæÿÿþ @³`b@³`f êæÿÿëæÿÿ A@…D…  ñÿÿØæÿÿØæÿÿþ @µ`p@µ`t ææÿÿçæÿÿ Aò‡ö‡  þðÿÿÔæÿÿÔæÿÿþ @»`t@»`x Ÿçÿÿ¿çÿÿ A÷‹ü‹  úðÿÿÐæÿÿÐæÿÿþ @Ç`J@Ç`O Þæÿÿßæÿÿ A  öðÿÿÌæÿÿÌæÿÿþ @Ê`e@Ê`i 9õÿÿ°óÿÿ A  A‚  ñðÿÿçÿÿçÿÿý @Ë`U@Ë`c /ôÿÿ«óÿÿ AQŽbŽ  AQŽTŽ  ìðÿÿçÿÿçÿÿý @Í`X@Í`i ÐæÿÿÑæÿÿ A  èðÿÿŸæÿÿŸæÿÿþ @Ð``@Ð`d ÌæÿÿÍæÿÿ AV’Z’  äðÿÿºæÿÿºæÿÿþ @Ö`d@Ö`h ÈæÿÿÉæÿÿ AU”Y”  àðÿÿ¶æÿÿ¶æÿÿþ @Û`R@Û`V ÄæÿÿÅæÿÿ Aw–{–  Üðÿÿ²æÿÿ²æÿÿþ @à`R@à`V œçÿÿçÿÿ Agšlš  Øðÿÿ®æÿÿ®æÿÿþ @î`D@î`I Œæÿÿœæÿÿ Aܚàš  Ôðÿÿªæÿÿªæÿÿþ @ð`6@ð`: žæÿÿ¹æÿÿ A]¡a¡  ÐðÿÿŠæÿÿŠæÿÿþ @`E@`I çÿÿ‘çÿÿ AΣÓ£  Ìðÿÿ¢æÿÿ¢æÿÿþ @ `S@ `X °æÿÿ±æÿÿ Aŀɀ  Èðÿÿžæÿÿžæÿÿþ @`>@`B ˆçÿÿ‰çÿÿ AŠ Š  Äðÿÿšæÿÿšæÿÿþ @`>@`C „çÿÿ…çÿÿ AèŠíŠ  Àðÿÿ–æÿÿ–æÿÿþ @`F@`K €æÿÿ¥æÿÿ A§‘§  Œðÿÿ’æÿÿ’æÿÿþ @`N@`R  æÿÿ¡æÿÿ A"©&©  žðÿÿŽæÿÿŽæÿÿþ @`N@`R xçÿÿyçÿÿ A,­1­  ŽðÿÿŠæÿÿŠæÿÿþ @(`F@(`K ˜æÿÿ™æÿÿ AÑ­Õ­  °ðÿÿ†æÿÿ†æÿÿþ @*`N@*`R ”æÿÿ•æÿÿ Ae¯i¯  ¬ðÿÿ‚æÿÿ‚æÿÿþ @.`N@.`R lçÿÿmçÿÿ Ay³~³  šðÿÿ~æÿÿ~æÿÿþ @9`F@9`K Œæÿÿæÿÿ AŽ"Ž  €ðÿÿzæÿÿzæÿÿþ @;`N@;`R ˆæÿÿ‰æÿÿ A·µ»µ   ðÿÿvæÿÿvæÿÿþ @?`N@?`R `çÿÿaçÿÿ A(º-º  œðÿÿræÿÿræÿÿþ @K`F@K`K €æÿÿæÿÿ AͺѺ  ˜ðÿÿnæÿÿnæÿÿþ @M`N@M`R |æÿÿ}æÿÿ AfŒjŒ  ”ðÿÿjæÿÿjæÿÿþ @Q`N@Q`R xæÿÿyæÿÿ A€À„À  ðÿÿfæÿÿfæÿÿþ @\`F@\`J PçÿÿQçÿÿ AüÃÄ  Œðÿÿbæÿÿbæÿÿþ @f`P@f`U pæÿÿqæÿÿ AóÄ÷Ä  ˆðÿÿ^æÿÿ^æÿÿþ @i`>@i`B læÿÿmæÿÿ A2Æ6Æ  „ðÿÿZæÿÿZæÿÿþ @m`>@m`B DçÿÿEçÿÿ AiÇnÇ  €ðÿÿVæÿÿVæÿÿþ @q`>@q`C @çÿÿAçÿÿ AJÈOÈ  |ðÿÿRæÿÿRæÿÿþ @t`F@t`K <çÿÿ=çÿÿ APÉUÉ  xðÿÿNæÿÿNæÿÿþ @w`N@w`S \æÿÿ]æÿÿ AbÊfÊ  tðÿÿJæÿÿJæÿÿþ @z`V@z`Z XæÿÿYæÿÿ AÌÌ  pðÿÿFæÿÿFæÿÿþ @~`V@~`Z 0çÿÿ1çÿÿ AjÐoÐ  lðÿÿBæÿÿBæÿÿþ @‰`N@‰`S PæÿÿQæÿÿ AÑ#Ñ  hðÿÿ>æÿÿ>æÿÿþ @‹`V@‹`Z LæÿÿMæÿÿ AÌÒÐÒ  dðÿÿ:æÿÿ:æÿÿþ @`V@`Z $çÿÿ%çÿÿ A×’×  `ðÿÿ6æÿÿ6æÿÿþ @œ`F@œ`K DæÿÿEæÿÿ A2Ø6Ø  \ðÿÿ2æÿÿ2æÿÿþ @ž`N@ž`R çÿÿçÿÿ AÅÙÊÙ  Xðÿÿ.æÿÿ.æÿÿþ @¢`N@¢`S <æÿÿ=æÿÿ AÝÝ  Tðÿÿ*æÿÿ*æÿÿþ @ª`V@ª`Z 8æÿÿ9æÿÿ AÞ¡Þ  Pðÿÿ&æÿÿ&æÿÿþ @®`V@®`Z 4æÿÿ5æÿÿ Aàà  Lðÿÿ"æÿÿ"æÿÿþ @²`V@²`Z  çÿÿ çÿÿ Avâ{â  Hðÿÿæÿÿæÿÿþ @º`F@º`K ,æÿÿ-æÿÿ Aãã  Dðÿÿæÿÿæÿÿþ @Œ`N@Œ`R (æÿÿ)æÿÿ A¬ä°ä  @ðÿÿæÿÿæÿÿþ @À`N@À`R çÿÿçÿÿ Aéé  <ðÿÿæÿÿæÿÿþ @Ì`F@Ì`K  æÿÿ!æÿÿ Aµé¹é  8ðÿÿæÿÿæÿÿþ @Î`N@Î`R æÿÿæÿÿ AFëJë  4ðÿÿ æÿÿ æÿÿþ @Ò`N@Ò`R ôæÿÿõæÿÿ Að ð  0ðÿÿæÿÿæÿÿþ @ß`F@ß`K ðæÿÿñæÿÿ A ññ  ,ðÿÿæÿÿæÿÿþ @â`N@â`S æÿÿæÿÿ AÂñÆñ  (ðÿÿþåÿÿþåÿÿþ @ä`V@ä`Z  æÿÿ æÿÿ Atóxó  $ðÿÿúåÿÿúåÿÿþ @è`V@è`Z äæÿÿåæÿÿ AÐ÷Õ÷   ðÿÿöåÿÿöåÿÿþ @ó`N@ó`S æÿÿæÿÿ A…ø‰ø  ðÿÿòåÿÿòåÿÿþ @õ`V@õ`Z æÿÿæÿÿ A8ú<ú  ðÿÿîåÿÿîåÿÿþ @ù`V@ù`Z üåÿÿýåÿÿ Anÿrÿ  ðÿÿêåÿÿêåÿÿþ @`F@`J øåÿÿùåÿÿ A  ðÿÿæåÿÿæåÿÿþ @ `F@ `J sendTestEmailÉòÿÿ AÅÖ  AÅÈ   ðÿÿ7æÿÿ7æÿÿý @`V@`g ÊæÿÿËæÿÿ AV[  ðÿÿÜåÿÿÜåÿÿþ CŠ êåÿÿëåÿÿ Ay }   ðÿÿØåÿÿØåÿÿþ @ `R@ `V æåÿÿçåÿÿ A± µ   þïÿÿÔåÿÿÔåÿÿþ @&``@&`d âåÿÿãåÿÿ AJN  úïÿÿÐåÿÿÐåÿÿþ @0`Y@0`] ºæÿÿ»æÿÿ A޹  öïÿÿÌåÿÿÌåÿÿþ @8`S@8`X ¶æÿÿ·æÿÿ A†‹  òïÿÿÈåÿÿÈåÿÿþ @;`>@;`C ²æÿÿ³æÿÿ AŒ‘  îïÿÿÄåÿÿÄåÿÿþ @>`F@>`K ®æÿÿ¯æÿÿ A¢§  êïÿÿÀåÿÿÀåÿÿþ @A`N@A`S ÎåÿÿÏåÿÿ AÁÅ  æïÿÿŒåÿÿŒåÿÿþ @D`V@D`Z Šæÿÿ§æÿÿ A”  âïÿÿžåÿÿžåÿÿþ @H`V@H`[ ÆåÿÿÇåÿÿ ATX  ÞïÿÿŽåÿÿŽåÿÿþ @J`^@J`b ÂåÿÿÃåÿÿ A   Úïÿÿ°åÿÿ°åÿÿþ @N`^@N`b šæÿÿ›æÿÿ AÆË  Öïÿÿ¬åÿÿ¬åÿÿþ @V`N@V`S ºåÿÿ»åÿÿ Aöú  Òïÿÿšåÿÿšåÿÿþ @Y`V@Y`Z ¶åÿÿ·åÿÿ AˆŒ  Îïÿÿ€åÿÿ€åÿÿþ @]`V@]`Z ²åÿÿ³åÿÿ AÂ"Æ"  Êïÿÿ åÿÿ åÿÿþ @d`d@d`h Šæÿÿ‹æÿÿ AŸ%€%  Æïÿÿœåÿÿœåÿÿþ @l`F@l`K †æÿÿ‡æÿÿ A˜&&  Âïÿÿ˜åÿÿ˜åÿÿþ @o`N@o`S Šåÿÿ§åÿÿ AM'Q'  Ÿïÿÿ”åÿÿ”åÿÿþ @q`V@q`Z ~æÿÿæÿÿ Aú(ÿ(  ºïÿÿåÿÿåÿÿþ @u`V@u`[ žåÿÿŸåÿÿ AZ,^,  ¶ïÿÿŒåÿÿŒåÿÿþ @}`^@}`b šåÿÿ›åÿÿ Aû-ÿ-  ²ïÿÿˆåÿÿˆåÿÿþ @`^@`b ræÿÿsæÿÿ AŽ0¹0  ®ïÿÿ„åÿÿ„åÿÿþ @‰`N@‰`S ’åÿÿ“åÿÿ Ai1m1  ªïÿÿ€åÿÿ€åÿÿþ @‹`V@‹`Z Žåÿÿåÿÿ A33  Šïÿÿ|åÿÿ|åÿÿþ @`V@`Z fæÿÿgæÿÿ AŽ7“7  ¢ïÿÿxåÿÿxåÿÿþ @š`N@š`S bæÿÿcæÿÿ A¬8±8  žïÿÿtåÿÿtåÿÿþ @`V@`[ ‚åÿÿƒåÿÿ Aq9u9  šïÿÿpåÿÿpåÿÿþ @Ÿ`^@Ÿ`b ~åÿÿåÿÿ A+;/;  –ïÿÿlåÿÿlåÿÿþ @£`^@£`b VæÿÿWæÿÿ AÚ?ß?  ’ïÿÿhåÿÿhåÿÿþ @®`V@®`[ våÿÿwåÿÿ AŸ@£@  Žïÿÿdåÿÿdåÿÿþ @°`^@°`b råÿÿsåÿÿ A]BaB  Šïÿÿ`åÿÿ`åÿÿþ @Ž`^@Ž`b JæÿÿKæÿÿ AH H  †ïÿÿ\åÿÿ\åÿÿþ @Â`N@Â`S jåÿÿkåÿÿ A¹HœH  ‚ïÿÿXåÿÿXåÿÿþ @Ä`V@Ä`Z fåÿÿgåÿÿ AeJiJ  ~ïÿÿTåÿÿTåÿÿþ @È`V@È`Z >æÿÿ?æÿÿ AöNûN  zïÿÿPåÿÿPåÿÿþ @Ó`N@Ó`S ^åÿÿ_åÿÿ A«O¯O  vïÿÿLåÿÿLåÿÿþ @Õ`V@Õ`Z Zåÿÿ[åÿÿ AGQKQ  rïÿÿHåÿÿHåÿÿþ @Ù`V@Ù`Z 2æÿÿ3æÿÿ A5V:V  nïÿÿDåÿÿDåÿÿþ @æ`F@æ`K RåÿÿSåÿÿ AAWEW  jïÿÿ@åÿÿ@åÿÿþ @é`N@é`R NåÿÿOåÿÿ AíYñY  fïÿÿ<åÿÿ<åÿÿþ @ï`[@ï`_ &æÿÿ'æÿÿ A1\6\  bïÿÿ8åÿÿ8åÿÿþ @÷`>@÷`C "æÿÿ#æÿÿ Ai]n]  ^ïÿÿ4åÿÿ4åÿÿþ @ú`F@ú`K BåÿÿCåÿÿ A¬_°_  Zïÿÿ0åÿÿ0åÿÿþ @`N@`R >åÿÿ?åÿÿ A7a;a  Vïÿÿ,åÿÿ,åÿÿþ @`N@`R :åÿÿ;åÿÿ Acc  Rïÿÿ(åÿÿ(åÿÿþ @ `N@ `R 6åÿÿ7åÿÿ AZe^e  Nïÿÿ$åÿÿ$åÿÿþ @`F@`J æÿÿæÿÿ A'g,g  Jïÿÿ åÿÿ åÿÿþ @`Y@`^  æÿÿ æÿÿ Aúgÿg  Fïÿÿåÿÿåÿÿþ @`>@`C æÿÿæÿÿ A7iïÿÿåÿÿåÿÿþ @(`N@(`R "åÿÿ#åÿÿ Am m  :ïÿÿåÿÿåÿÿþ @-`N@-`R åÿÿåÿÿ AÜnàn  6ïÿÿ åÿÿ åÿÿþ @3`N@3`R öåÿÿ÷åÿÿ A(q-q  2ïÿÿåÿÿåÿÿþ @;`F@;`K åÿÿåÿÿ A?sCs  .ïÿÿåÿÿåÿÿþ @A`Y@A`] åÿÿåÿÿ Aw"w  *ïÿÿåÿÿåÿÿþ @N`L@N`P åÿÿåÿÿ A'y+y  &ïÿÿüäÿÿüäÿÿþ @T`T@T`X  åÿÿ åÿÿ A|ƒ|  "ïÿÿøäÿÿøäÿÿþ @^`L@^`P åÿÿåÿÿ A‰~~  ïÿÿôäÿÿôäÿÿþ @d`T@d`X åÿÿåÿÿ Až¢  ïÿÿðäÿÿðäÿÿþ @n`L@n`P þäÿÿÿäÿÿ Ašƒ¬ƒ  ïÿÿìäÿÿìäÿÿþ @t`T@t`X úäÿÿûäÿÿ A‡‡  ïÿÿèäÿÿèäÿÿþ @~`L@~`P öäÿÿ÷äÿÿ A ‰‰  ïÿÿääÿÿääÿÿþ @„`T@„`X òäÿÿóäÿÿ APŒTŒ   ïÿÿàäÿÿàäÿÿþ @Ž`L@Ž`P îäÿÿïäÿÿ A[Ž_Ž  ïÿÿÜäÿÿÜäÿÿþ @”`T@”`X êäÿÿëäÿÿ A‘Ƒ  ïÿÿØäÿÿØäÿÿþ @ž`L@ž`P æäÿÿçäÿÿ A̓Г  þîÿÿÔäÿÿÔäÿÿþ @€`T@€`X âäÿÿãäÿÿ AŒ–À–  úîÿÿÐäÿÿÐäÿÿþ @®`L@®`P Þäÿÿßäÿÿ AŘɘ  öîÿÿÌäÿÿÌäÿÿþ @Ž`T@Ž`X ÚäÿÿÛäÿÿ Aœœ  òîÿÿÈäÿÿÈäÿÿþ @Ÿ`L@Ÿ`P Öäÿÿ×äÿÿ Ažž  îîÿÿÄäÿÿÄäÿÿþ @Ä`T@Ä`X ÒäÿÿÓäÿÿ AQ¡U¡  êîÿÿÀäÿÿÀäÿÿþ @Î`L@Î`P ÎäÿÿÏäÿÿ A[£_£  æîÿÿŒäÿÿŒäÿÿþ @Ô`T@Ô`X ÊäÿÿËäÿÿ A§ §  âîÿÿžäÿÿžäÿÿþ @Þ`L@Þ`P ÆäÿÿÇäÿÿ A©©  ÞîÿÿŽäÿÿŽäÿÿþ @ä`T@ä`X ÂäÿÿÃäÿÿ Au¬y¬  Úîÿÿ°äÿÿ°äÿÿþ @î`L@î`P Ÿäÿÿ¿äÿÿ A€®„®  Öîÿÿ¬äÿÿ¬äÿÿþ @ô`T@ô`X ºäÿÿ»äÿÿ A‘±•±  Òîÿÿšäÿÿšäÿÿþ @þ`L@þ`P ¶äÿÿ·äÿÿ A™³³  Îîÿÿ€äÿÿ€äÿÿþ @`T@`X ²äÿÿ³äÿÿ Aß¶ã¶  Êîÿÿ äÿÿ äÿÿþ @`L@`P ®äÿÿ¯äÿÿ Aëžïž  Æîÿÿœäÿÿœäÿÿþ @`T@`X ªäÿÿ«äÿÿ Aœœ  Âîÿÿ˜äÿÿ˜äÿÿþ @`L@`P Šäÿÿ§äÿÿ A¿¿  Ÿîÿÿ”äÿÿ”äÿÿþ @%`T@%`X ¢äÿÿ£äÿÿ A4Â8  ºîÿÿäÿÿäÿÿþ @/`L@/`P žäÿÿŸäÿÿ A>ÄBÄ  ¶îÿÿŒäÿÿŒäÿÿþ @5`T@5`X šäÿÿ›äÿÿ A\Ç`Ç  ²îÿÿˆäÿÿˆäÿÿþ @?`L@?`P –äÿÿ—äÿÿ AgÉkÉ  ®îÿÿ„äÿÿ„äÿÿþ @E`T@E`X ’äÿÿ“äÿÿ AŸÌÂÌ  ªîÿÿ€äÿÿ€äÿÿþ @O`L@O`P Žäÿÿäÿÿ AÈÎÌÎ  Šîÿÿ|äÿÿ|äÿÿþ @U`T@U`X Šäÿÿ‹äÿÿ AáÑåÑ  ¢îÿÿxäÿÿxäÿÿþ @_`L@_`P †äÿÿ‡äÿÿ AìÓðÓ  žîÿÿtäÿÿtäÿÿþ @e`T@e`X ‚äÿÿƒäÿÿ A¬×°×  šîÿÿpäÿÿpäÿÿþ @o`L@o`P ~äÿÿäÿÿ AŽÙžÙ  –îÿÿläÿÿläÿÿþ @u`T@u`X VåÿÿWåÿÿ AÅàÊà  ’îÿÿhäÿÿhäÿÿþ @‡`I@‡`N RåÿÿSåÿÿ Aãáèá  Žîÿÿdäÿÿdäÿÿþ @Š`J@Š`O räÿÿsäÿÿ A¥ã©ã  Šîÿÿ`äÿÿ`äÿÿþ @Ž`R@Ž`V JåÿÿKåÿÿ A åå  †îÿÿ\äÿÿ\äÿÿþ @’`R@’`W jäÿÿkäÿÿ A.æ2æ  ‚îÿÿXäÿÿXäÿÿþ @•`Z@•`^ BåÿÿCåÿÿ AÕçÚç  ~îÿÿTäÿÿTäÿÿþ @™`i@™`n bäÿÿcäÿÿ A©ê­ê  zîÿÿPäÿÿPäÿÿþ @ `_@ `c ^äÿÿ_äÿÿ Aäìèì  vîÿÿLäÿÿLäÿÿþ @Š`R@Š`V Zäÿÿ[äÿÿ Aòíöí  rîÿÿHäÿÿHäÿÿþ @š``@š`d VäÿÿWäÿÿ ADðHð  nîÿÿDäÿÿDäÿÿþ @®`d@®`h .åÿÿ/åÿÿ Azòò  jîÿÿ@äÿÿ@äÿÿþ @µ`W@µ`\ NäÿÿOäÿÿ A§ó«ó  fîÿÿ<äÿÿ<äÿÿþ @ž`R@ž`V JäÿÿKäÿÿ Aöö  bîÿÿ8äÿÿ8äÿÿþ @¿`c@¿`g "åÿÿ#åÿÿ A¬ù±ù  ^îÿÿ4äÿÿ4äÿÿþ @Æ`R@Æ`W BäÿÿCäÿÿ Aiúmú  Zîÿÿ0äÿÿ0äÿÿþ @È`Z@È`^ >äÿÿ?äÿÿ A,ü0ü  Vîÿÿ,äÿÿ,äÿÿþ @Ì`Z@Ì`^ åÿÿåÿÿ AGL  Rîÿÿ(äÿÿ(äÿÿþ @ß`R@ß`W 6äÿÿ7äÿÿ A  Nîÿÿ$äÿÿ$äÿÿþ @á`Z@á`^ 2äÿÿ3äÿÿ AÄÈ  Jîÿÿ äÿÿ äÿÿþ @å`Z@å`^  åÿÿ åÿÿ Aåê  Fîÿÿäÿÿäÿÿþ @ú`m@ú`r *äÿÿ+äÿÿ A15  Bîÿÿäÿÿäÿÿþ @ý`Z@ý`^ &äÿÿ'äÿÿ Aäè  >îÿÿäÿÿäÿÿþ @`Z@`^ "äÿÿ#äÿÿ AÃÇ  :îÿÿäÿÿäÿÿþ @`i@`m úäÿÿûäÿÿ AÏÔ  6îÿÿ äÿÿ äÿÿþ @ `R@ `W äÿÿäÿÿ A÷û  2îÿÿäÿÿäÿÿþ @`Z@`^ òäÿÿóäÿÿ A  .îÿÿäÿÿäÿÿþ @`Z@`_ äÿÿäÿÿ AºŸ  *îÿÿäÿÿäÿÿþ @`b@`f äÿÿäÿÿ AV!Z!  &îÿÿüãÿÿüãÿÿþ @!`p@!`t  äÿÿ äÿÿ A‚%†%  "îÿÿøãÿÿøãÿÿþ @*`Z@*`^ âäÿÿãäÿÿ Aì)ñ)  îÿÿôãÿÿôãÿÿþ @8`T@8`Y Þäÿÿßäÿÿ Aí*ò*  îÿÿðãÿÿðãÿÿþ @;`>@;`C þãÿÿÿãÿÿ A‚+†+  îÿÿìãÿÿìãÿÿþ @=`F@=`J úãÿÿûãÿÿ Aà,ä,  îÿÿèãÿÿèãÿÿþ @A`F@A`J ÒäÿÿÓäÿÿ Aœ.¡.  îÿÿäãÿÿäãÿÿþ @G`>@G`C ÎäÿÿÏäÿÿ A•/š/   îÿÿàãÿÿàãÿÿþ @J`F@J`K îãÿÿïãÿÿ A:0>0  îÿÿÜãÿÿÜãÿÿþ @L`N@L`R êãÿÿëãÿÿ AÅ1É1  îÿÿØãÿÿØãÿÿþ @P`N@P`R æãÿÿçãÿÿ AŽ3ž3  þíÿÿÔãÿÿÔãÿÿþ @V`F@V`J âãÿÿããÿÿ A†6Š6  úíÿÿÐãÿÿÐãÿÿþ @]`T@]`X ºäÿÿ»äÿÿ A–8›8  öíÿÿÌãÿÿÌãÿÿþ @c`>@c`C ÚãÿÿÛãÿÿ A9¡9  òíÿÿÈãÿÿÈãÿÿþ @f`F@f`J ²äÿÿ³äÿÿ A#;(;  îíÿÿÄãÿÿÄãÿÿþ @j`F@j`K ÒãÿÿÓãÿÿ AÈ;Ì;  êíÿÿÀãÿÿÀãÿÿþ @l`N@l`R ªäÿÿ«äÿÿ A_=d=  æíÿÿŒãÿÿŒãÿÿþ @p`N@p`S ÊãÿÿËãÿÿ A±@µ@  âíÿÿžãÿÿžãÿÿþ @x`V@x`Z ÆãÿÿÇãÿÿ AHBLB  ÞíÿÿŽãÿÿŽãÿÿþ @|`h@|`l ÂãÿÿÃãÿÿ AEDID  Úíÿÿ°ãÿÿ°ãÿÿþ @‚`N@‚`R šäÿÿ›äÿÿ A6F;F  Öíÿÿ¬ãÿÿ¬ãÿÿþ @ˆ`F@ˆ`K ºãÿÿ»ãÿÿ AÛFßF  Òíÿÿšãÿÿšãÿÿþ @Š`N@Š`R ¶ãÿÿ·ãÿÿ ArHvH  Îíÿÿ€ãÿÿ€ãÿÿþ @Ž`N@Ž`R ²ãÿÿ³ãÿÿ A›LŸL  Êíÿÿ ãÿÿ ãÿÿþ @™`N@™`R Šäÿÿ‹äÿÿ AíNòN  Æíÿÿœãÿÿœãÿÿþ @¡`>@¡`C ªãÿÿ«ãÿÿ AÜOàO  Âíÿÿ˜ãÿÿ˜ãÿÿþ @€`F@€`J Šãÿÿ§ãÿÿ AhRlR  Ÿíÿÿ”ãÿÿ”ãÿÿþ @ª`W@ª`[ ~äÿÿäÿÿ A‰TŽT  ºíÿÿãÿÿãÿÿþ @²`S@²`X zäÿÿ{äÿÿ AŠUU  ¶íÿÿŒãÿÿŒãÿÿþ @µ`>@µ`C šãÿÿ›ãÿÿ AV#V  ²íÿÿˆãÿÿˆãÿÿþ @·`F@·`J –ãÿÿ—ãÿÿ AW…W  ®íÿÿ„ãÿÿ„ãÿÿþ @»`F@»`J ’ãÿÿ“ãÿÿ AŸZ£Z  ªíÿÿ€ãÿÿ€ãÿÿþ @Æ`L@Æ`P Žãÿÿãÿÿ A÷[û[  Šíÿÿ|ãÿÿ|ãÿÿþ @Ê`T@Ê`X Šãÿÿ‹ãÿÿ Aò`ö`  ¢íÿÿxãÿÿxãÿÿþ @Ó`L@Ó`P †ãÿÿ‡ãÿÿ AJbNb  žíÿÿtãÿÿtãÿÿþ @×`T@×`X ‚ãÿÿƒãÿÿ A\h`h  šíÿÿpãÿÿpãÿÿþ @à`L@à`P ~ãÿÿãÿÿ AŽiži  –íÿÿlãÿÿlãÿÿþ @ä`T@ä`X zãÿÿ{ãÿÿ AOmSm  ’íÿÿhãÿÿhãÿÿþ @í`L@í`P vãÿÿwãÿÿ A§n«n  Žíÿÿdãÿÿdãÿÿþ @ñ`T@ñ`X rãÿÿsãÿÿ AÅqÉq  Šíÿÿ`ãÿÿ`ãÿÿþ @ú`L@ú`P nãÿÿoãÿÿ As!s  †íÿÿ\ãÿÿ\ãÿÿþ @þ`T@þ`X jãÿÿkãÿÿ Aövúv  ‚íÿÿXãÿÿXãÿÿþ @`L@`P fãÿÿgãÿÿ ANxRx  ~íÿÿTãÿÿTãÿÿþ @ `T@ `X bãÿÿcãÿÿ A||  zíÿÿPãÿÿPãÿÿþ @`L@`P ^ãÿÿ_ãÿÿ A\}`}  víÿÿLãÿÿLãÿÿþ @`T@`X Zãÿÿ[ãÿÿ A4„8„  ríÿÿHãÿÿHãÿÿþ @!`L@!`P VãÿÿWãÿÿ AŒ……  níÿÿDãÿÿDãÿÿþ @%`T@%`X .äÿÿ/äÿÿ A<A  jíÿÿ@ãÿÿ@ãÿÿþ @,`I@,`N *äÿÿ+äÿÿ Aٍލ  fíÿÿ<ãÿÿ<ãÿÿþ @.`J@.`O JãÿÿKãÿÿ A  bíÿÿ8ãÿÿ8ãÿÿþ @1`R@1`V FãÿÿGãÿÿ A‘‘  ^íÿÿ4ãÿÿ4ãÿÿþ @6`f@6`j BãÿÿCãÿÿ A““  Zíÿÿ0ãÿÿ0ãÿÿþ @<`J@<`N äÿÿäÿÿ A«—°—  Víÿÿ,ãÿÿ,ãÿÿþ @I`>@I`C :ãÿÿ;ãÿÿ AŸ˜£˜  Ríÿÿ(ãÿÿ(ãÿÿþ @L`F@L`J 6ãÿÿ7ãÿÿ A#›'›  Níÿÿ$ãÿÿ$ãÿÿþ @R`U@R`Y äÿÿäÿÿ A@E  Jíÿÿ ãÿÿ ãÿÿþ @Z`O@Z`T .ãÿÿ/ãÿÿ AAžEž  Fíÿÿãÿÿãÿÿþ @]`>@]`B äÿÿäÿÿ AzŸŸ  Bíÿÿãÿÿãÿÿþ @a`>@a`C äÿÿäÿÿ As x   >íÿÿãÿÿãÿÿþ @d`F@d`K "ãÿÿ#ãÿÿ A¡¡  :íÿÿãÿÿãÿÿþ @f`N@f`R ãÿÿãÿÿ A¢¢Š¢  6íÿÿ ãÿÿ ãÿÿþ @j`N@j`R ãÿÿãÿÿ A—€›€  2íÿÿãÿÿãÿÿþ @p`F@p`J ãÿÿãÿÿ Aƒ§‡§  .íÿÿãÿÿãÿÿþ @w`T@w`X îãÿÿïãÿÿ A–©›©  *íÿÿãÿÿãÿÿþ @}`>@}`C êãÿÿëãÿÿ Aª”ª  &íÿÿüâÿÿüâÿÿþ @€`F@€`K  ãÿÿ ãÿÿ A4«8«  "íÿÿøâÿÿøâÿÿþ @‚`N@‚`R ãÿÿãÿÿ A»¬¿¬  íÿÿôâÿÿôâÿÿþ @†`N@†`R ãÿÿãÿÿ A­®±®  íÿÿðâÿÿðâÿÿþ @Œ`F@Œ`J þâÿÿÿâÿÿ A›±Ÿ±  íÿÿìâÿÿìâÿÿþ @“`T@“`X úâÿÿûâÿÿ A®³²³  íÿÿèâÿÿèâÿÿþ @™`>@™`B ÒãÿÿÓãÿÿ ATŽYŽ  íÿÿäâÿÿäâÿÿþ @›`L@›`Q ÎãÿÿÏãÿÿ AñŽöŽ   íÿÿàâÿÿàâÿÿþ @`J@`O îâÿÿïâÿÿ A··»·  íÿÿÜâÿÿÜâÿÿþ @¥`J@¥`N ÆãÿÿÇãÿÿ A«¿°¿  íÿÿØâÿÿØâÿÿþ @Ÿ`Y@Ÿ`^ æâÿÿçâÿÿ AAÄEÄ  þìÿÿÔâÿÿÔâÿÿþ @Ê`J@Ê`N ââÿÿãâÿÿ AÉÅÍÅ  úìÿÿÐâÿÿÐâÿÿþ @Î`J@Î`N Þâÿÿßâÿÿ AÒÊÖÊ  öìÿÿÌâÿÿÌâÿÿþ @×`J@×`N ÚâÿÿÛâÿÿ A`ÌdÌ  òìÿÿÈâÿÿÈâÿÿþ @Û`J@Û`N ²ãÿÿ³ãÿÿ AeÒjÒ  îìÿÿÄâÿÿÄâÿÿþ @è`>@è`C ÒâÿÿÓâÿÿ AúÒþÒ  êìÿÿÀâÿÿÀâÿÿþ @ê`F@ê`J ÎâÿÿÏâÿÿ AtÔxÔ  æìÿÿŒâÿÿŒâÿÿþ @î`F@î`J ÊâÿÿËâÿÿ A×ÕÛÕ  âìÿÿžâÿÿžâÿÿþ @ò`F@ò`J ¢ãÿÿ£ãÿÿ A[Ú`Ú  ÞìÿÿŽâÿÿŽâÿÿþ @ÿ`>@ÿ`C ÂâÿÿÃâÿÿ AJÛNÛ  Úìÿÿ°âÿÿ°âÿÿþ @`F@`J Ÿâÿÿ¿âÿÿ AÂÝÆÝ  Öìÿÿ¬âÿÿ¬âÿÿþ @`R@`V –ãÿÿ—ãÿÿ Aäßéß  Òìÿÿšâÿÿšâÿÿþ @`T@`Y ’ãÿÿ“ãÿÿ Aåàêà  Îìÿÿ€âÿÿ€âÿÿþ @`>@`C ²âÿÿ³âÿÿ Azá~á  Êìÿÿ âÿÿ âÿÿþ @`F@`J ®âÿÿ¯âÿÿ AÝâáâ  Æìÿÿœâÿÿœâÿÿþ @`F@`J †ãÿÿ‡ãÿÿ A”ä™ä  Âìÿÿ˜âÿÿ˜âÿÿþ @`>@`C Šâÿÿ§âÿÿ A)å-å  Ÿìÿÿ”âÿÿ”âÿÿþ @!`F@!`J ~ãÿÿãÿÿ AŸæ€æ  ºìÿÿâÿÿâÿÿþ @%`F@%`K žâÿÿŸâÿÿ A™çç  ¶ìÿÿŒâÿÿŒâÿÿþ @(`N@(`R šâÿÿ›âÿÿ Aœì ì  ²ìÿÿˆâÿÿˆâÿÿþ @5`N@5`R –âÿÿ—âÿÿ Aûïÿï  ®ìÿÿ„âÿÿ„âÿÿþ @=`c@=`g nãÿÿoãÿÿ ATòYò  ªìÿÿ€âÿÿ€âÿÿþ @C`>@C`C Žâÿÿâÿÿ Aéòíò  Šìÿÿ|âÿÿ|âÿÿþ @E`F@E`J fãÿÿgãÿÿ Acôhô  ¢ìÿÿxâÿÿxâÿÿþ @I`F@I`K †âÿÿ‡âÿÿ A]õaõ  žìÿÿtâÿÿtâÿÿþ @L`N@L`R ‚âÿÿƒâÿÿ A`ùdù  šìÿÿpâÿÿpâÿÿþ @V`N@V`R ~âÿÿâÿÿ A¿üÃü  –ìÿÿlâÿÿlâÿÿþ @^`F@^`J zâÿÿ{âÿÿ A@þDþ  ’ìÿÿhâÿÿhâÿÿþ @b`a@b`e RãÿÿSãÿÿ A‘ –   Žìÿÿdâÿÿdâÿÿþ @h`>@h`C râÿÿsâÿÿ Ar v   Šìÿÿ`âÿÿ`âÿÿþ @k`F@k`J nâÿÿoâÿÿ Aè ì   †ìÿÿ\âÿÿ\âÿÿþ @o`F@o`J FãÿÿGãÿÿ AJ O   ‚ìÿÿXâÿÿXâÿÿþ @Ž`Q@Ž`V BãÿÿCãÿÿ A÷ ü   ~ìÿÿTâÿÿTâÿÿþ @`R@`W bâÿÿcâÿÿ A) -   zìÿÿPâÿÿPâÿÿþ @“`Z@“`^ ^âÿÿ_âÿÿ A¶ º   vìÿÿLâÿÿLâÿÿþ @—`Z@—`^ 6ãÿÿ7ãÿÿ AØ Ý   rìÿÿHâÿÿHâÿÿþ @`R@`W VâÿÿWâÿÿ Aö ú   nìÿÿDâÿÿDâÿÿþ @ `Z@ `^ RâÿÿSâÿÿ Ao s   jìÿÿ@âÿÿ@âÿÿþ @ª`Z@ª`^ NâÿÿOâÿÿ AB F   fìÿÿ<âÿÿ<âÿÿþ @²`m@²`q &ãÿÿ'ãÿÿ Ay ~   bìÿÿ8âÿÿ8âÿÿþ @»`>@»`C "ãÿÿ#ãÿÿ AZ _   ^ìÿÿ4âÿÿ4âÿÿþ @Ÿ`F@Ÿ`K ãÿÿãÿÿ Ak p   Zìÿÿ0âÿÿ0âÿÿþ @Á`N@Á`S >âÿÿ?âÿÿ A ! $!   Vìÿÿ,âÿÿ,âÿÿþ @Ã`V@Ã`Z :âÿÿ;âÿÿ AÒ" Ö"   Rìÿÿ(âÿÿ(âÿÿþ @Ç`V@Ç`Z 6âÿÿ7âÿÿ A% %   Nìÿÿ$âÿÿ$âÿÿþ @Í`N@Í`R 2âÿÿ3âÿÿ AW( [(   Jìÿÿ âÿÿ âÿÿþ @Ô`\@Ô``  ãÿÿ ãÿÿ A£* š*   Fìÿÿâÿÿâÿÿþ @Ú`F@Ú`K ãÿÿãÿÿ AŽ+ ¹+   Bìÿÿâÿÿâÿÿþ @Ý`N@Ý`S &âÿÿ'âÿÿ Ai, m,   >ìÿÿâÿÿâÿÿþ @ß`V@ß`Z "âÿÿ#âÿÿ A. .   :ìÿÿâÿÿâÿÿþ @ã`V@ã`Z âÿÿâÿÿ AB0 F0   6ìÿÿ âÿÿ âÿÿþ @é`N@é`R âÿÿâÿÿ A3 ƒ3   2ìÿÿâÿÿâÿÿþ @ð`\@ð`` òâÿÿóâÿÿ A%6 *6   .ìÿÿâÿÿâÿÿþ @ø`>@ø`C âÿÿâÿÿ A7 7   *ìÿÿâÿÿâÿÿþ @û`F@û`J âÿÿâÿÿ A¥9 ©9   &ìÿÿüáÿÿüáÿÿþ @`W@`[ æâÿÿçâÿÿ Aÿ; <   "ìÿÿøáÿÿøáÿÿþ @ `C@ `H ââÿÿãâÿÿ A°< µ<   ìÿÿôáÿÿôáÿÿþ @`6@`; Þâÿÿßâÿÿ A‰= Ž=   ìÿÿðáÿÿðáÿÿþ @`>@`C þáÿÿÿáÿÿ AÓ? ×?   ìÿÿìáÿÿìáÿÿþ @`F@`J úáÿÿûáÿÿ AKB OB   ìÿÿèáÿÿèáÿÿþ @`F@`J öáÿÿ÷áÿÿ A6D :D   ìÿÿäáÿÿäáÿÿþ @$`R@$`V ÎâÿÿÏâÿÿ AœG ÂG    ìÿÿàáÿÿàáÿÿþ @0`>@0`C îáÿÿïáÿÿ AjJ nJ   ìÿÿÜáÿÿÜáÿÿþ @8`F@8`J êáÿÿëáÿÿ AºK ŸK   ìÿÿØáÿÿØáÿÿþ @<`F@<`J æáÿÿçáÿÿ AM M   þëÿÿÔáÿÿÔáÿÿþ @@`F@@`J âáÿÿãáÿÿ AeN iN   úëÿÿÐáÿÿÐáÿÿþ @D`F@D`J Þáÿÿßáÿÿ AŒO ÀO   öëÿÿÌáÿÿÌáÿÿþ @H`F@H`J ¶âÿÿ·âÿÿ AnQ sQ   òëÿÿÈáÿÿÈáÿÿþ @N`>@N`C Öáÿÿ×áÿÿ AT T   îëÿÿÄáÿÿÄáÿÿþ @V`F@V`J ®âÿÿ¯âÿÿ AaU fU   êëÿÿÀáÿÿÀáÿÿþ @Z`F@Z`K ªâÿÿ«âÿÿ AsW xW   æëÿÿŒáÿÿŒáÿÿþ @a`F@a`K Šâÿÿ§âÿÿ AšY ŸY   âëÿÿžáÿÿžáÿÿþ @h`F@h`K ¢âÿÿ£âÿÿ A\ \   ÞëÿÿŽáÿÿŽáÿÿþ @q`>@q`C ÂáÿÿÃáÿÿ A²^ ¶^   Úëÿÿ°áÿÿ°áÿÿþ @{`@@{`D Ÿáÿÿ¿áÿÿ Aœ_ Á_   Öëÿÿ¬áÿÿ¬áÿÿþ @~`Y@~`] –âÿÿ—âÿÿ A7f áÿÿ>áÿÿþ @ `R@ `V ”replyToSupportTicket!îÿÿ AÁ› ٛ   AÁ› ě   bëÿÿáÿÿáÿÿý @ `f@ `~ FáÿÿGáÿÿ A6€ :€   ^ëÿÿ4áÿÿ4áÿÿþ @3 `6@3 `: âÿÿâÿÿ AOŠ TŠ   Zëÿÿ0áÿÿ0áÿÿþ @< `@@< `E âÿÿâÿÿ A§ §   Vëÿÿ,áÿÿ,áÿÿþ @? `6@? `; :áÿÿ;áÿÿ Aø§ ü§   Rëÿÿ(áÿÿ(áÿÿþ @B `>@B `B âÿÿâÿÿ A+© 0©   Nëÿÿ$áÿÿ$áÿÿþ @F `>@F `C 2áÿÿ3áÿÿ A ª ª   Jëÿÿ áÿÿ áÿÿþ @I `F@I `J .áÿÿ/áÿÿ A”¬ ˜¬   Fëÿÿáÿÿáÿÿþ @O `F@O `J âÿÿâÿÿ A¯ ”¯   Bëÿÿáÿÿáÿÿþ @W `U@W `Z &áÿÿ'áÿÿ A$° (°   >ëÿÿáÿÿáÿÿþ @Y `F@Y `J "áÿÿ#áÿÿ Aq± u±   :ëÿÿáÿÿáÿÿþ @] `F@] `J úáÿÿûáÿÿ A[Ž `Ž   6ëÿÿ áÿÿ áÿÿþ @e `Z@e `_ áÿÿáÿÿ Abµ fµ   2ëÿÿáÿÿáÿÿþ @h `F@h `J òáÿÿóáÿÿ AÀ· Å·   .ëÿÿáÿÿáÿÿþ @p `>@p `C áÿÿáÿÿ AUž Yž   *ëÿÿáÿÿáÿÿþ @r `F@r `J áÿÿáÿÿ A€¹ š¹   &ëÿÿüàÿÿüàÿÿþ @v `F@v `J æáÿÿçáÿÿ AvŒ {Œ   "ëÿÿøàÿÿøàÿÿþ @~ `>@~ `C áÿÿáÿÿ A œ œ   ëÿÿôàÿÿôàÿÿþ @€ `F@€ `J áÿÿáÿÿ AVŸ ZŸ   ëÿÿðàÿÿðàÿÿþ @„ `F@„ `J ÚáÿÿÛáÿÿ AqÁ vÁ   ëÿÿìàÿÿìàÿÿþ @ `>@ `C Öáÿÿ×áÿÿ An s   ëÿÿèàÿÿèàÿÿþ @ `F@ `K öàÿÿ÷àÿÿ Aà à   ëÿÿäàÿÿäàÿÿþ @’ `N@’ `R òàÿÿóàÿÿ A|Ä €Ä    ëÿÿààÿÿààÿÿþ @– `N@– `R ÊáÿÿËáÿÿ A•Ç šÇ   ëÿÿÜàÿÿÜàÿÿþ @ž `F@ž `K êàÿÿëàÿÿ A:È >È   ëÿÿØàÿÿØàÿÿþ @  `N@  `R æàÿÿçàÿÿ AºÉ ŸÉ   þêÿÿÔàÿÿÔàÿÿþ @€ `N@€ `R Ÿáÿÿ¿áÿÿ A+Í 0Í   úêÿÿÐàÿÿÐàÿÿþ @® `>@® `C Þàÿÿßàÿÿ AÎ Î   öêÿÿÌàÿÿÌàÿÿþ @± `F@± `J ÚàÿÿÛàÿÿ AÑ Ñ   òêÿÿÈàÿÿÈàÿÿþ @ž `S@ž `W ²áÿÿ³áÿÿ AÓ !Ó   îêÿÿÄàÿÿÄàÿÿþ @À `D@À `I ÒàÿÿÓàÿÿ A Ô Ô   êêÿÿÀàÿÿÀàÿÿþ @à `>@à `B ªáÿÿ«áÿÿ ASÕ XÕ   æêÿÿŒàÿÿŒàÿÿþ @Ç `[@Ç `` Šáÿÿ§áÿÿ AXÖ ]Ö   âêÿÿžàÿÿžàÿÿþ @Ê `F@Ê `K ÆàÿÿÇàÿÿ A~× ‚×   ÞêÿÿŽàÿÿŽàÿÿþ @Í `N@Í `R ÂàÿÿÃàÿÿ AÜØ àØ   Úêÿÿ°àÿÿ°àÿÿþ @Ñ `N@Ñ `R šáÿÿ›áÿÿ A¿Ú ÄÚ   Öêÿÿ¬àÿÿ¬àÿÿþ @× `F@× `K ºàÿÿ»àÿÿ AåÛ éÛ   Òêÿÿšàÿÿšàÿÿþ @Ú `N@Ú `R ¶àÿÿ·àÿÿ A>Ý BÝ   Îêÿÿ€àÿÿ€àÿÿþ @Þ `N@Þ `R Žáÿÿáÿÿ A$ß )ß   Êêÿÿ àÿÿ àÿÿþ @ä `F@ä `K ®àÿÿ¯àÿÿ AJà Nà   Æêÿÿœàÿÿœàÿÿþ @ç `N@ç `R ªàÿÿ«àÿÿ Aªá ®á   Âêÿÿ˜àÿÿ˜àÿÿþ @ë `N@ë `R ‚áÿÿƒáÿÿ Aã ’ã   Ÿêÿÿ”àÿÿ”àÿÿþ @ñ `F@ñ `K ¢àÿÿ£àÿÿ A³ä ·ä   ºêÿÿàÿÿàÿÿþ @ô `N@ô `R žàÿÿŸàÿÿ Aæ æ   ¶êÿÿŒàÿÿŒàÿÿþ @ø `N@ø `R váÿÿwáÿÿ Aûç è   ²êÿÿˆàÿÿˆàÿÿþ @þ `F@þ `K –àÿÿ—àÿÿ A!é %é   ®êÿÿ„àÿÿ„àÿÿþ @!`N@!`R ’àÿÿ“àÿÿ A‚ê †ê   ªêÿÿ€àÿÿ€àÿÿþ @!`N@!`R jáÿÿkáÿÿ AŸì €ì   Šêÿÿ|àÿÿ|àÿÿþ @ !`C@ !`H fáÿÿgáÿÿ A€í ©í   ¢êÿÿxàÿÿxàÿÿþ @!`F@!`K †àÿÿ‡àÿÿ AÊî Îî   žêÿÿtàÿÿtàÿÿþ @!`N@!`R ‚àÿÿƒàÿÿ A"ð &ð   šêÿÿpàÿÿpàÿÿþ @!`N@!`R Záÿÿ[áÿÿ Aò ò   –êÿÿlàÿÿlàÿÿþ @!`F@!`K zàÿÿ{àÿÿ A;ó ?ó   ’êÿÿhàÿÿhàÿÿþ @!`N@!`R vàÿÿwàÿÿ A›ô Ÿô   Žêÿÿdàÿÿdàÿÿþ @#!`N@#!`R NáÿÿOáÿÿ Aèö íö   Šêÿÿ`àÿÿ`àÿÿþ @)!`F@)!`K nàÿÿoàÿÿ Aø ø   †êÿÿ\àÿÿ\àÿÿþ @,!`N@,!`R jàÿÿkàÿÿ Anù rù   ‚êÿÿXàÿÿXàÿÿþ @0!`N@0!`R BáÿÿCáÿÿ AKû Pû   ~êÿÿTàÿÿTàÿÿþ @6!`F@6!`K bàÿÿcàÿÿ Aqü uü   zêÿÿPàÿÿPàÿÿþ @9!`N@9!`R ^àÿÿ_àÿÿ AÓý ×ý   vêÿÿLàÿÿLàÿÿþ @=!`N@=!`R Zàÿÿ[àÿÿ A7 ;   rêÿÿHàÿÿHàÿÿþ @E!`[@E!`_ …áÿÿ†áÿÿ A< E  4nêÿÿDàÿÿDàÿÿþ @E!``@E!`i .áÿÿ/áÿÿ A     jêÿÿ@àÿÿ@àÿÿþ CF!ÃF!È *áÿÿ+áÿÿ AD I   fêÿÿ<àÿÿ<àÿÿþ @I!`J@I!`O &áÿÿ'áÿÿ A¬ ±   bêÿÿ8àÿÿ8àÿÿþ CU!¡U!Š "áÿÿ#áÿÿ AM R   ^êÿÿ4àÿÿ4àÿÿþ @_!`j@_!`o BàÿÿCàÿÿ A_ c   Zêÿÿ0àÿÿ0àÿÿþ @h!`C@h!`Gèoáÿÿ Ad m  4Wêÿÿ-àÿÿ-àÿÿþ @h!`H@h!`Q áÿÿáÿÿ AÑ Ö   Sêÿÿ)àÿÿ)àÿÿþ @i!``@i!`e áÿÿáÿÿ A     Oêÿÿ%àÿÿ%àÿÿþ @l!`J@l!`O áÿÿáÿÿ A  %   Kêÿÿ!àÿÿ!àÿÿþ @r!`b@r!`g  áÿÿ áÿÿ Ah m   Gêÿÿàÿÿàÿÿþ @y!`f@y!`k áÿÿáÿÿ Aã è   Cêÿÿàÿÿàÿÿþ @‡!`B@‡!`G áÿÿáÿÿ A” ™   ?êÿÿàÿÿàÿÿþ @Š!`6@Š!`; #àÿÿ$àÿÿ AŽ ’   ;êÿÿàÿÿàÿÿþ @!`>@!`B àÿÿ àÿÿ A_ c   7êÿÿ àÿÿ àÿÿþ @“!`L@“!`P ÷àÿÿøàÿÿ Aå! ê!   3êÿÿ àÿÿ àÿÿþ @œ!`C@œ!`H àÿÿàÿÿ A`# d#   /êÿÿàÿÿàÿÿþ @Ÿ!`>@Ÿ!`B àÿÿàÿÿ A)$ -$   +êÿÿàÿÿàÿÿþ @¢!`>@¢!`B ëàÿÿìàÿÿ AF& K&   'êÿÿýßÿÿýßÿÿþ @©!`6@©!`; çàÿÿèàÿÿ AV' ['   #êÿÿùßÿÿùßÿÿþ @¬!`>@¬!`C àÿÿàÿÿ Aë' ï'   êÿÿõßÿÿõßÿÿþ @®!`F@®!`J àÿÿàÿÿ AW) [)   êÿÿñßÿÿñßÿÿþ @²!`F@²!`J ÿßÿÿàÿÿ A?+ C+   êÿÿíßÿÿíßÿÿþ @ž!`>@ž!`B ^Ýÿÿ]Ýÿÿ AŒ, Ã,   êÿÿ@àÿÿ@àÿÿþ @œ!`B@œ!`I ÷ßÿÿøßÿÿ AÇ0 Ë0   êÿÿåßÿÿåßÿÿþ @È!`L@È!`P ÏàÿÿÐàÿÿ Aš2 ­2    êÿÿáßÿÿáßÿÿþ @Î!`6@Î!`; ïßÿÿðßÿÿ A–3 š3   êÿÿÝßÿÿÝßÿÿþ @Ñ!`>@Ñ!`B ÇàÿÿÈàÿÿ Aé4 î4   êÿÿÙßÿÿÙßÿÿþ @Õ!`>@Õ!`C ÃàÿÿÄàÿÿ AÕ5 Ú5   ÿéÿÿÕßÿÿÕßÿÿþ @Ø!`F@Ø!`K ãßÿÿäßÿÿ A®? ²?   ûéÿÿÑßÿÿÑßÿÿþ @ñ!`N@ñ!`R ßßÿÿàßÿÿ AÎA ÒA   ÷éÿÿÍßÿÿÍßÿÿþ @÷!`\@÷!`` ·àÿÿžàÿÿ A#E (E   óéÿÿÉßÿÿÉßÿÿþ @"`F@"`K ×ßÿÿØßÿÿ AÜF àF   ïéÿÿÅßÿÿÅßÿÿþ @"`N@"`R ÓßÿÿÔßÿÿ AüH I   ëéÿÿÁßÿÿÁßÿÿþ @ "`\@ "`` ÏßÿÿÐßÿÿ AëK ïK   çéÿÿœßÿÿœßÿÿþ @"`N@"`R §àÿÿšàÿÿ AlX qX   ãéÿÿ¹ßÿÿ¹ßÿÿþ @2"`6@2"`; ÇßÿÿÈßÿÿ AZY ^Y   ßéÿÿµßÿÿµßÿÿþ @5"`>@5"`B ÃßÿÿÄßÿÿ AÕZ ÙZ   Ûéÿÿ±ßÿÿ±ßÿÿþ @9"`_@9"`c ¿ßÿÿÀßÿÿ Añ[ õ[   ×éÿÿ­ßÿÿ­ßÿÿþ @<"`C@<"`G —àÿÿ˜àÿÿ A²\ ·\   Óéÿÿ©ßÿÿ©ßÿÿþ @>"`g@>"`l “àÿÿ”àÿÿ Aú] ÿ]   Ïéÿÿ¥ßÿÿ¥ßÿÿþ @A"`N@A"`S ³ßÿÿŽßÿÿ A¯^ ³^   Ëéÿÿ¡ßÿÿ¡ßÿÿþ @C"`V@C"`Z ‹àÿÿŒàÿÿ A—` œ`   Çéÿÿßÿÿßÿÿþ @G"`V@G"`[ «ßÿÿ¬ßÿÿ A€e še   Ãéÿÿ™ßÿÿ™ßÿÿþ @U"`N@U"`R  Ýÿÿ Ýÿÿ A h 'h   ¿éÿÿìßÿÿìßÿÿþ @["`R@["`Y àÿÿ€àÿÿ AFo Ko   »éÿÿ‘ßÿÿ‘ßÿÿþ @o"`6@o"`; Ÿßÿÿ ßÿÿ A4p 8p   ·éÿÿßÿÿßÿÿþ @r"`>@r"`B wàÿÿxàÿÿ A•q šq   ³éÿÿ‰ßÿÿ‰ßÿÿþ @v"`T@v"`Y sàÿÿtàÿÿ Ašr Ÿr   ¯éÿÿ…ßÿÿ…ßÿÿþ @y"`F@y"`K “ßÿÿ”ßÿÿ A:t >t   «éÿÿßÿÿßÿÿþ @~"`N@~"`R ßÿÿßÿÿ AÔv Øv   §éÿÿ}ßÿÿ}ßÿÿþ @†"`N@†"`R ‹ßÿÿŒßÿÿ A€y šy   £éÿÿyßÿÿyßÿÿþ @"`_@"`c ‡ßÿÿˆßÿÿ AŠz ªz   Ÿéÿÿußÿÿußÿÿþ @’"`C@’"`G ƒßÿÿ„ßÿÿ AR{ V{   ›éÿÿqßÿÿqßÿÿþ @”"`L@”"`P ßÿÿ€ßÿÿ A| |   —éÿÿmßÿÿmßÿÿþ @–"`P@–"`T WàÿÿXàÿÿ Aæ| ë|   “éÿÿißÿÿißÿÿþ @˜"`l@˜"`q wßÿÿxßÿÿ Aý} ~   éÿÿeßÿÿeßÿÿþ @›"`V@›"`Z sßÿÿtßÿÿ A‚ †   ‹éÿÿaßÿÿaßÿÿþ @Ÿ"`V@Ÿ"`Z KàÿÿLàÿÿ A]€ b€   ‡éÿÿ]ßÿÿ]ßÿÿþ @¡"`d@¡"`i kßÿÿlßÿÿ A¬ °   ƒéÿÿYßÿÿYßÿÿþ @€"`b@€"`f CàÿÿDàÿÿ AŒŒ ÁŒ   éÿÿUßÿÿUßÿÿþ @º"`b@º"`g cßÿÿdßÿÿ AN R   {éÿÿQßÿÿQßÿÿþ @Ÿ"`j@Ÿ"`n ;àÿÿ<àÿÿ Aš£ Ÿ£   wéÿÿMßÿÿMßÿÿþ @í"`H@í"`M 7àÿÿ8àÿÿ AK€ P€   séÿÿIßÿÿIßÿÿþ @ð"`6@ð"`; WßÿÿXßÿÿ AЀ Ô€   oéÿÿEßÿÿEßÿÿþ @ò"`>@ò"`B SßÿÿTßÿÿ AŠ Š   kéÿÿAßÿÿAßÿÿþ @ö"`>@ö"`B +àÿÿ,àÿÿ AЧ «§   géÿÿ=ßÿÿ=ßÿÿþ @ü"`6@ü"`; 'àÿÿ(àÿÿ A³š žš   céÿÿ9ßÿÿ9ßÿÿþ @ÿ"`>@ÿ"`C GßÿÿHßÿÿ AH© L©   _éÿÿ5ßÿÿ5ßÿÿþ @#`F@#`J àÿÿ àÿÿ A¢ª §ª   [éÿÿ1ßÿÿ1ßÿÿþ @#`F@#`K ?ßÿÿ@ßÿÿ AŸ¬ ¬   Wéÿÿ-ßÿÿ-ßÿÿþ @ #`N@ #`R ;ßÿÿ<ßÿÿ A!® %®   Séÿÿ)ßÿÿ)ßÿÿþ @#`N@#`R 7ßÿÿ8ßÿÿ A†¯ Н   Oéÿÿ%ßÿÿ%ßÿÿþ @#`N@#`R 3ßÿÿ4ßÿÿ Aë° ï°   Kéÿÿ!ßÿÿ!ßÿÿþ @#`N@#`R /ßÿÿ0ßÿÿ A$³ (³   Géÿÿßÿÿßÿÿþ @#`>@#`B +ßÿÿ,ßÿÿ Aµ µ   Céÿÿßÿÿßÿÿþ @$#`L@$#`P àÿÿàÿÿ A±¶ ¶¶   ?éÿÿßÿÿßÿÿþ @*#`>@*#`C #ßÿÿ$ßÿÿ AF· J·   ;éÿÿßÿÿßÿÿþ @,#`F@,#`J ûßÿÿüßÿÿ A€ž ©ž   7éÿÿ ßÿÿ ßÿÿþ @0#`F@0#`K ßÿÿßÿÿ Ažº Œº   3éÿÿ ßÿÿ ßÿÿþ @5#`N@5#`R ßÿÿßÿÿ AŒ Œ   /éÿÿßÿÿßÿÿþ @9#`N@9#`R ßÿÿßÿÿ A€œ „œ   +éÿÿßÿÿßÿÿþ @=#`N@=#`R ßÿÿßÿÿ AåŸ éŸ   'éÿÿýÞÿÿýÞÿÿþ @A#`N@A#`R  ßÿÿ ßÿÿ AÁ "Á   #éÿÿùÞÿÿùÞÿÿþ @I#`>@I#`B ãßÿÿäßÿÿ AËÁ ÐÁ   éÿÿõÞÿÿõÞÿÿþ @K#`L@K#`Q ßÿÿßÿÿ A@Å DÅ   éÿÿñÞÿÿñÞÿÿþ @V#`J@V#`N ÿÞÿÿßÿÿ AXÇ \Ç   éÿÿíÞÿÿíÞÿÿþ @\#`X@\#`\ ûÞÿÿüÞÿÿ AŽÌ ’Ì   éÿÿéÞÿÿéÞÿÿþ @o#`B@o#`F ÓßÿÿÔßÿÿ AÿÍ Î   éÿÿåÞÿÿåÞÿÿþ @s#`J@s#`O ÏßÿÿÐßÿÿ AñÎ öÎ    éÿÿáÞÿÿáÞÿÿþ @v#`>@v#`C ïÞÿÿðÞÿÿ AiÐ mÐ   éÿÿÝÞÿÿÝÞÿÿþ @{#`F@{#`J ëÞÿÿìÞÿÿ AÃÒ ÇÒ   éÿÿÙÞÿÿÙÞÿÿþ @ƒ#`F@ƒ#`J çÞÿÿèÞÿÿ AÕ Õ   ÿèÿÿÕÞÿÿÕÞÿÿþ @Œ#`;@Œ#`? ¿ßÿÿÀßÿÿ AÁÙ ÆÙ   ûèÿÿÑÞÿÿÑÞÿÿþ @–#`E@–#`J »ßÿÿŒßÿÿ AÕÚ ÚÚ   ÷èÿÿÍÞÿÿÍÞÿÿþ @™#`F@™#`K ·ßÿÿžßÿÿ AåÛ êÛ   óèÿÿÉÞÿÿÉÞÿÿþ @œ#`N@œ#`S ×ÞÿÿØÞÿÿ AšÜ žÜ   ïèÿÿÅÞÿÿÅÞÿÿþ @ž#`V@ž#`Z ÓÞÿÿÔÞÿÿ A&Þ *Þ   ëèÿÿÁÞÿÿÁÞÿÿþ @¢#`V@¢#`Z ÏÞÿÿÐÞÿÿ A+à /à   çèÿÿœÞÿÿœÞÿÿþ @š#`N@š#`R §ßÿÿšßÿÿ AŠâ «â   ãèÿÿ¹Þÿÿ¹Þÿÿþ @®#`F@®#`K ÇÞÿÿÈÞÿÿ A)å -å   ßèÿÿµÞÿÿµÞÿÿþ @¶#`F@¶#`J Ÿßÿÿ ßÿÿ Aé é   Ûèÿÿ±Þÿÿ±Þÿÿþ @Á#`U@Á#`Z šgetTasksTranslationPreview”ëÿÿ A‹ì ©ì   A‹ì Žì   Õèÿÿßÿÿßÿÿý @Ë#`\@Ë#`z ¹ÞÿÿºÞÿÿ Aõ õ   Ñèÿÿ§Þÿÿ§Þÿÿþ @â#`F@â#`J ‘ßÿÿ’ßÿÿ A×õ Üõ   Íèÿÿ£Þÿÿ£Þÿÿþ @ä#`i@ä#`n ±Þÿÿ²Þÿÿ A÷ ÷   ÉèÿÿŸÞÿÿŸÞÿÿþ @ç#`R@ç#`V ­Þÿÿ®Þÿÿ AOù Sù   Åèÿÿ›Þÿÿ›Þÿÿþ @í#``@í#`d ©ÞÿÿªÞÿÿ Aü ü   Áèÿÿ—Þÿÿ—Þÿÿþ @õ#`O@õ#`S ’autoTranslateTaskszëÿÿ A® Ä   A® ±   »èÿÿèÞÿÿèÞÿÿý @$`d@$`z ›autoTranslateEmailTemplatestëÿÿ Aó    Aó ö   µèÿÿâÞÿÿâÞÿÿý C$©$È autoTranslatenëÿÿ A5 F   A5 8   ¯èÿÿÜÞÿÿÜÞÿÿý C$ë$ü ÷ëÿÿiëÿÿ Aœ Õ   Aœ À   ªèÿÿ×Þÿÿ×Þÿÿý @ $`H@ $`` jßÿÿkßÿÿ A8 =   Šèÿÿ|Þÿÿ|Þÿÿþ @$`h@$`m4þÿÿ»ßÿÿ A> G  4£èÿÿyÞÿÿyÞÿÿþ @$`n@$`w cßÿÿdßÿÿ Añ ö   ŸèÿÿuÞÿÿuÞÿÿþ @$`V@$`[ ƒÞÿÿ„Þÿÿ Aó ÷   ›èÿÿqÞÿÿqÞÿÿþ @#$`^@#$`b Þÿÿ€Þÿÿ A     —èÿÿmÞÿÿmÞÿÿþ @+$`^@+$`b WßÿÿXßÿÿ AJ O   “èÿÿiÞÿÿiÞÿÿþ @4$`]@4$`b!þÿÿšßÿÿ AP Y  4èÿÿfÞÿÿfÞÿÿþ @4$`c@4$`l tÞÿÿuÞÿÿ A    ŒèÿÿbÞÿÿbÞÿÿþ @6$`V@6$`Z pÞÿÿqÞÿÿ Ae i   ˆèÿÿ^Þÿÿ^Þÿÿþ @<$`d@<$`h HßÿÿIßÿÿ Aû    „èÿÿZÞÿÿZÞÿÿþ @E$`S@E$`Xþÿÿ™ßÿÿ A   4èÿÿWÞÿÿWÞÿÿþ @E$`Y@E$`b eÞÿÿfÞÿÿ AŽ ž   }èÿÿSÞÿÿSÞÿÿþ @G$`V@G$`Z aÞÿÿbÞÿÿ A    yèÿÿOÞÿÿOÞÿÿþ @M$`d@M$`h ]Þÿÿ^Þÿÿ Ae% i%   uèÿÿKÞÿÿKÞÿÿþ @^$`V@^$`Z YÞÿÿZÞÿÿ AÐ' Ô'   qèÿÿGÞÿÿGÞÿÿþ @d$`d@d$`h UÞÿÿVÞÿÿ AÀ. Ä.   mèÿÿCÞÿÿCÞÿÿþ @|$`C@|$`G -ßÿÿ.ßÿÿ A/ /   ièÿÿ?Þÿÿ?Þÿÿþ @}$`E@}$`J MÞÿÿNÞÿÿ AÌ/ Ð/   eèÿÿ;Þÿÿ;Þÿÿþ @€$`6@€$`: %ßÿÿ&ßÿÿ Ae7 j7   aèÿÿ7Þÿÿ7Þÿÿþ @”$`E@”$`J EÞÿÿFÞÿÿ Ax8 |8   ]èÿÿ3Þÿÿ3Þÿÿþ @—$`F@—$`J AÞÿÿBÞÿÿ AÀ9 Ä9   Yèÿÿ/Þÿÿ/Þÿÿþ @›$`F@›$`J ßÿÿßÿÿ AŒ; Á;   Uèÿÿ+Þÿÿ+Þÿÿþ @£$`6@£$`; ßÿÿßÿÿ A·< Œ<   Qèÿÿ'Þÿÿ'Þÿÿþ @Š$`>@Š$`C 5Þÿÿ6Þÿÿ AÓ= ×=   Mèÿÿ#Þÿÿ#Þÿÿþ @©$`F@©$`J  ßÿÿßÿÿ A!? &?   IèÿÿÞÿÿÞÿÿþ @­$`F@­$`K «ëÿÿëÿÿ A@ .@   A@ @   DèÿÿqÞÿÿqÞÿÿý @°$`@@°$`U ßÿÿßÿÿ AñA öA   @èÿÿÞÿÿÞÿÿþ @Ž$`b@Ž$`g $Þÿÿ%Þÿÿ A¹C œC   <èÿÿÞÿÿÞÿÿþ @¹$`V@¹$`Z  Þÿÿ!Þÿÿ A“F —F   8èÿÿÞÿÿÞÿÿþ @Á$`V@Á$`Z ÞÿÿÞÿÿ A5J 9J   4èÿÿ Þÿÿ Þÿÿþ @Í$`c@Í$`g ôÞÿÿõÞÿÿ AëJ ðJ   0èÿÿÞÿÿÞÿÿþ @Ï$`L@Ï$`Q ÞÿÿÞÿÿ A‡L ‹L   ,èÿÿÞÿÿÞÿÿþ @Ô$`J@Ô$`N ÞÿÿÞÿÿ AO O   (èÿÿþÝÿÿþÝÿÿþ @Ü$`J@Ü$`N  Þÿÿ Þÿÿ A@Q DQ   $èÿÿúÝÿÿúÝÿÿþ @ã$`w@ã$`{ Þÿÿ Þÿÿ ARR VR    èÿÿöÝÿÿöÝÿÿþ @æ$`C@æ$`G àÞÿÿáÞÿÿ A˜W W   èÿÿòÝÿÿòÝÿÿþ @ï$`M@ï$`R ÜÞÿÿÝÞÿÿ A=X BX   èÿÿîÝÿÿîÝÿÿþ @ñ$`N@ñ$`S üÝÿÿýÝÿÿ Aš[ ž[   èÿÿêÝÿÿêÝÿÿþ @ù$`V@ù$`Z øÝÿÿùÝÿÿ AB^ F^   èÿÿæÝÿÿæÝÿÿþ @ÿ$`d@ÿ$`h ÐÞÿÿÑÞÿÿ Au` z`    èÿÿâÝÿÿâÝÿÿþ @%`V@%`[ ðÝÿÿñÝÿÿ A£a §a   èÿÿÞÝÿÿÞÝÿÿþ @%`^@%`b ìÝÿÿíÝÿÿ Adc hc   èÿÿÚÝÿÿÚÝÿÿþ @ %`o@ %`s èÝÿÿéÝÿÿ Af f   èÿÿÖÝÿÿÖÝÿÿþ C%Ì%Ð ÀÞÿÿÁÞÿÿ A×g Üg   üçÿÿÒÝÿÿÒÝÿÿþ @%`V@%`[ àÝÿÿáÝÿÿ A'k +k   øçÿÿÎÝÿÿÎÝÿÿþ @%`\@%`` žÞÿÿ¹Þÿÿ Al l   ôçÿÿÊÝÿÿÊÝÿÿþ @!%`\@!%`a ØÝÿÿÙÝÿÿ A+m /m   ðçÿÿÆÝÿÿÆÝÿÿþ @$%`Z@$%`^ °Þÿÿ±Þÿÿ A£m šm   ìçÿÿÂÝÿÿÂÝÿÿþ @%%`h@%%`m ÐÝÿÿÑÝÿÿ Aòn ön   èçÿÿŸÝÿÿŸÝÿÿþ @(%`f@(%`j ÌÝÿÿÍÝÿÿ AÑp Õp   äçÿÿºÝÿÿºÝÿÿþ @,%`f@,%`j ÈÝÿÿÉÝÿÿ Ašr ¬r   àçÿÿ¶Ýÿÿ¶Ýÿÿþ @0%`f@0%`j ÄÝÿÿÅÝÿÿ At …t   Üçÿÿ²Ýÿÿ²Ýÿÿþ @4%`f@4%`j ÀÝÿÿÁÝÿÿ A]v av   Øçÿÿ®Ýÿÿ®Ýÿÿþ @8%`f@8%`j ŒÝÿÿœÝÿÿ A!y %y   ÔçÿÿªÝÿÿªÝÿÿþ @?%`Z@?%`^ ”Þÿÿ•Þÿÿ A€} …}   ÐçÿÿŠÝÿÿŠÝÿÿþ @F%`i@F%`n ŽÝÿÿµÝÿÿ A     Ìçÿÿ¢Ýÿÿ¢Ýÿÿþ @I%`j@I%`n °Ýÿÿ±Ýÿÿ Aè€ ì€   ÈçÿÿžÝÿÿžÝÿÿþ @M%`j@M%`n ¬Ýÿÿ­Ýÿÿ A¿‚    ÄçÿÿšÝÿÿšÝÿÿþ @Q%`j@Q%`n „Þÿÿ…Þÿÿ Aʃ σ   Àçÿÿ–Ýÿÿ–Ýÿÿþ @S%`x@S%`} €Ýÿÿ¥Ýÿÿ AS‡ W‡   Œçÿÿ’Ýÿÿ’Ýÿÿþ @[%`j@[%`n  Ýÿÿ¡Ýÿÿ A^ˆ bˆ   žçÿÿŽÝÿÿŽÝÿÿþ @]%`x@]%`| œÝÿÿÝÿÿ AíŒ ñŒ   ŽçÿÿŠÝÿÿŠÝÿÿþ @f%`j@f%`n ˜Ýÿÿ™Ýÿÿ A>” B”   °çÿÿ†Ýÿÿ†Ýÿÿþ @}%`>@}%`B pÞÿÿqÞÿÿ AG• L•   ¬çÿÿ‚Ýÿÿ‚Ýÿÿþ @€%`<@€%`A lÞÿÿmÞÿÿ A– •–   šçÿÿ~Ýÿÿ~Ýÿÿþ @„%`:@„%`? hÞÿÿiÞÿÿ A®— ³—   €çÿÿzÝÿÿzÝÿÿþ @‡%`B@‡%`G dÞÿÿeÞÿÿ AK˜ P˜    çÿÿvÝÿÿvÝÿÿþ @‰%`J@‰%`O „Ýÿÿ…Ýÿÿ AŸ™ ™   œçÿÿrÝÿÿrÝÿÿþ @%`R@%`V €ÝÿÿÝÿÿ A»› ¿›   ˜çÿÿnÝÿÿnÝÿÿþ @“%`J@“%`N |Ýÿÿ}Ýÿÿ AŒ    ”çÿÿjÝÿÿjÝÿÿþ @™%`B@™%`F xÝÿÿyÝÿÿ Aµž ¹ž   çÿÿfÝÿÿfÝÿÿþ @œ%`P@œ%`T tÝÿÿuÝÿÿ A¥  ©    ŒçÿÿbÝÿÿbÝÿÿþ @¢%`T@¢%`X pÝÿÿqÝÿÿ A £ £   ˆçÿÿ^Ýÿÿ^Ýÿÿþ @«%`:@«%`> lÝÿÿmÝÿÿ AØ£ Ü£   „çÿÿZÝÿÿZÝÿÿþ @­%`_@­%`c DÞÿÿEÞÿÿ AŽ€ “€   €çÿÿVÝÿÿVÝÿÿþ @¯%`L@¯%`Q dÝÿÿeÝÿÿ A*Š .Š   |çÿÿRÝÿÿRÝÿÿþ @Ž%`J@Ž%`N `ÝÿÿaÝÿÿ A€š šš   xçÿÿNÝÿÿNÝÿÿþ @Œ%`J@Œ%`N \Ýÿÿ]Ýÿÿ AЪ Ôª   tçÿÿJÝÿÿJÝÿÿþ @Ã%`d@Ã%`h 4Þÿÿ5Þÿÿ Aà« å«   pçÿÿFÝÿÿFÝÿÿþ @Æ%`C@Æ%`H TÝÿÿUÝÿÿ Aج ܬ   lçÿÿBÝÿÿBÝÿÿþ @É%`F@É%`J ,Þÿÿ-Þÿÿ A<­ A­   hçÿÿ>Ýÿÿ>Ýÿÿþ @Ê%`T@Ê%`Y LÝÿÿMÝÿÿ AO® S®   dçÿÿ:Ýÿÿ:Ýÿÿþ @Í%`R@Í%`V HÝÿÿIÝÿÿ Aé¯ í¯   `çÿÿ6Ýÿÿ6Ýÿÿþ @Ñ%`R@Ñ%`V DÝÿÿEÝÿÿ Aù² ý²   \çÿÿ2Ýÿÿ2Ýÿÿþ @Ú%`]@Ú%`a @ÝÿÿAÝÿÿ ADµ Hµ   Xçÿÿ.Ýÿÿ.Ýÿÿþ @á%`F@á%`J ÞÿÿÞÿÿ Aŵ ʵ   Tçÿÿ*Ýÿÿ*Ýÿÿþ @â%`q@â%`v 8Ýÿÿ9Ýÿÿ Aõ¶ ù¶   Pçÿÿ&Ýÿÿ&Ýÿÿþ @å%`V@å%`Z 4Ýÿÿ5Ýÿÿ Aëž ïž   Lçÿÿ"Ýÿÿ"Ýÿÿþ @ê%`V@ê%`Z 0Ýÿÿ1Ýÿÿ A̹ й   HçÿÿÝÿÿÝÿÿþ @ì%`d@ì%`h ,Ýÿÿ-Ýÿÿ A- 1   DçÿÿÝÿÿÝÿÿþ @&`a@&`e (Ýÿÿ)Ýÿÿ AžÃ ¢Ã   @çÿÿÝÿÿÝÿÿþ @&`n@&`r $Ýÿÿ%Ýÿÿ AóÄ ÷Ä   <çÿÿÝÿÿÝÿÿþ @ &`c@ &`g  Ýÿÿ!Ýÿÿ AæÈ êÈ   8çÿÿÝÿÿÝÿÿþ @&`:@&`> øÝÿÿùÝÿÿ A§É ¬É   4çÿÿ Ýÿÿ Ýÿÿþ @&`<@&`A ôÝÿÿõÝÿÿ A¥Ê ªÊ   0çÿÿÝÿÿÝÿÿþ @&`:@&`? ðÝÿÿñÝÿÿ AÃË ÈË   ,çÿÿÝÿÿÝÿÿþ @!&`B@!&`G ÝÿÿÝÿÿ A`Ì dÌ   (çÿÿþÜÿÿþÜÿÿþ @#&`J@#&`N èÝÿÿéÝÿÿ AÐÍ ÕÍ   $çÿÿúÜÿÿúÜÿÿþ @'&`J@'&`O Ýÿÿ Ýÿÿ A¿Ð ÃÐ    çÿÿöÜÿÿöÜÿÿþ @1&`B@1&`F àÝÿÿáÝÿÿ AÂÒ ÇÒ   çÿÿòÜÿÿòÜÿÿþ @8&`:@8&`? ÝÿÿÝÿÿ A¡Ó ¥Ó   çÿÿîÜÿÿîÜÿÿþ @;&`B@;&`F üÜÿÿýÜÿÿ AÜ Ü   çÿÿêÜÿÿêÜÿÿþ @V&`T@V&`X ›getAdminUserSpecialistCardsÍéÿÿ AöÝ Þ   AöÝ ùÝ   çÿÿ;Ýÿÿ;Ýÿÿý @[&`Z@[&`y ëÿÿÈéÿÿ A¹Þ ÏÞ   A¹Þ ŒÞ    çÿÿ6Ýÿÿ6Ýÿÿý @\&`pA\&† üêÿÿÃéÿÿ Avß ‹ß   Avß yß   çÿÿ1Ýÿÿ1Ýÿÿý @]&`pA]&… ÄÝÿÿÅÝÿÿ A2ä 7ä   çÿÿÖÜÿÿÖÜÿÿþ @i&`B@i&`G ÀÝÿÿÁÝÿÿ AMå Rå   üæÿÿÒÜÿÿÒÜÿÿþ @l&`g@l&`l ŒÝÿÿœÝÿÿ ARæ Wæ   øæÿÿÎÜÿÿÎÜÿÿþ @o&`R@o&`W žÝÿÿ¹Ýÿÿ A¡ç Šç   ôæÿÿÊÜÿÿÊÜÿÿþ @r&`Z@r&`_ ŽÝÿÿµÝÿÿ Alè qè   ðæÿÿÆÜÿÿÆÜÿÿþ @t&`b@t&`g °Ýÿÿ±Ýÿÿ AÝì âì   ìæÿÿÂÜÿÿÂÜÿÿþ @&`q@&`v ¬Ýÿÿ­Ýÿÿ Aší ­í   èæÿÿŸÜÿÿŸÜÿÿþ @&`b@&`g šÝÿÿ©Ýÿÿ A‹ò ò   äæÿÿºÜÿÿºÜÿÿþ @Ž&`R@Ž&`W €Ýÿÿ¥Ýÿÿ Aµó ºó   àæÿÿ¶Üÿÿ¶Üÿÿþ @‘&`Z@‘&`_ ÄÜÿÿÅÜÿÿ A‚ô †ô   Üæÿÿ²Üÿÿ²Üÿÿþ @“&`b@“&`f ÀÜÿÿÁÜÿÿ Aaö eö   Øæÿÿ®Üÿÿ®Üÿÿþ @—&`b@—&`f ˜Ýÿÿ™Ýÿÿ A1û 6û   ÔæÿÿªÜÿÿªÜÿÿþ @¡&`Z@¡&`_ žÜÿÿ¹Üÿÿ Aþû ü   ÐæÿÿŠÜÿÿŠÜÿÿþ @£&`b@£&`f ŽÜÿÿµÜÿÿ AÜý àý   Ìæÿÿ¢Üÿÿ¢Üÿÿþ @§&`b@§&`f ŒÝÿÿÝÿÿ A0 5   ÈæÿÿžÜÿÿžÜÿÿþ @³&`R@³&`W ¬Üÿÿ­Üÿÿ Aí ñ   ÄæÿÿšÜÿÿšÜÿÿþ @µ&`Z@µ&`^ šÜÿÿ©Üÿÿ A§ «   Àæÿÿ–Üÿÿ–Üÿÿþ @¹&`Z@¹&`^ €ÝÿÿÝÿÿ A    Œæÿÿ’Üÿÿ’Üÿÿþ @Ã&`R@Ã&`W  Üÿÿ¡Üÿÿ AÐ Ô   žæÿÿŽÜÿÿŽÜÿÿþ @Å&`Z@Å&`^ œÜÿÿÜÿÿ Aˆ Œ   ŽæÿÿŠÜÿÿŠÜÿÿþ @É&`Z@É&`^ tÝÿÿuÝÿÿ Aè í   °æÿÿ†Üÿÿ†Üÿÿþ @Ö&`g@Ö&`l pÝÿÿqÝÿÿ Aí ò   ¬æÿÿ‚Üÿÿ‚Üÿÿþ @Ù&`R@Ù&`W Üÿÿ‘Üÿÿ Aª ®   šæÿÿ~Üÿÿ~Üÿÿþ @Û&`Z@Û&`^ ŒÜÿÿÜÿÿ Ad h   €æÿÿzÜÿÿzÜÿÿþ @ß&`Z@ß&`^ dÝÿÿeÝÿÿ AË Ð    æÿÿvÜÿÿvÜÿÿþ @å&`R@å&`W `ÝÿÿaÝÿÿ A' ,   œæÿÿrÜÿÿrÜÿÿþ @è&`Z@è&`_ €ÜÿÿÜÿÿ Aƒ ‡   ˜æÿÿnÜÿÿnÜÿÿþ @ë&`{@ë&` |Üÿÿ}Üÿÿ Ac g   ”æÿÿjÜÿÿjÜÿÿþ @ï&`p@ï&`t xÜÿÿyÜÿÿ Aê î   æÿÿfÜÿÿfÜÿÿþ @ô&`g@ô&`k tÜÿÿuÜÿÿ AÈ Ì   ŒæÿÿbÜÿÿbÜÿÿþ @ø&`p@ø&`t pÜÿÿqÜÿÿ A$ $   ˆæÿÿ^Üÿÿ^Üÿÿþ @þ&`b@þ&`f lÜÿÿmÜÿÿ A ' '   „æÿÿZÜÿÿZÜÿÿþ @'`u@'`y DÝÿÿEÝÿÿ A„* ‰*   €æÿÿVÜÿÿVÜÿÿþ @ '`R@ '`W @ÝÿÿAÝÿÿ A®+ ³+   |æÿÿRÜÿÿRÜÿÿþ @'`Z@'`_ `ÜÿÿaÜÿÿ A{, ,   xæÿÿNÜÿÿNÜÿÿþ @'`b@'`f 8Ýÿÿ9Ýÿÿ AT. Y.   tæÿÿJÜÿÿJÜÿÿþ @'`b@'`g XÜÿÿYÜÿÿ A2 2   pæÿÿFÜÿÿFÜÿÿþ @'`j@'`n TÜÿÿUÜÿÿ AÙ3 Ý3   læÿÿBÜÿÿBÜÿÿþ @!'`j@!'`n ,Ýÿÿ-Ýÿÿ Að6 õ6   hæÿÿ>Üÿÿ>Üÿÿþ @)'`Z@)'`_ LÜÿÿMÜÿÿ Aœ7 Á7   dæÿÿ:Üÿÿ:Üÿÿþ @+'`b@+'`f $Ýÿÿ%Ýÿÿ A–9 ›9   `æÿÿ6Üÿÿ6Üÿÿþ @/'`b@/'`g DÜÿÿEÜÿÿ A©= ­=   \æÿÿ2Üÿÿ2Üÿÿþ @7'`j@7'`n @ÜÿÿAÜÿÿ Aˆ? Œ?   Xæÿÿ.Üÿÿ.Üÿÿþ @;'`|A;'€ ÝÿÿÝÿÿ A9C >C   Tæÿÿ*Üÿÿ*Üÿÿþ @E'`l@E'`q ÝÿÿÝÿÿ A7F K   HæÿÿÜÿÿÜÿÿþ @Y'`Z@Y'`^ Ýÿÿ Ýÿÿ AfM kM   DæÿÿÜÿÿÜÿÿþ @_'`R@_'`W (Üÿÿ)Üÿÿ A#N 'N   @æÿÿÜÿÿÜÿÿþ @a'`Z@a'`^ ÝÿÿÝÿÿ AæO ëO   <æÿÿÜÿÿÜÿÿþ @e'`Z@e'`_  Üÿÿ!Üÿÿ A³S ·S   8æÿÿÜÿÿÜÿÿþ @m'`b@m'`f ÜÿÿÜÿÿ APU TU   4æÿÿ Üÿÿ Üÿÿþ @q'`b@q'`f ÜÿÿÜÿÿ AìV ðV   0æÿÿÜÿÿÜÿÿþ @u'`b@u'`f ðÜÿÿñÜÿÿ AªY ¯Y   ,æÿÿÜÿÿÜÿÿþ @}'`R@}'`W ÜÿÿÜÿÿ AgZ kZ   (æÿÿþÛÿÿþÛÿÿþ @'`Z@'`^  Üÿÿ Üÿÿ A*\ .\   $æÿÿúÛÿÿúÛÿÿþ @ƒ'`Z@ƒ'`^ äÜÿÿåÜÿÿ Aš_ Ÿ_    æÿÿöÛÿÿöÛÿÿþ @Œ'`i@Œ'`n ÜÿÿÜÿÿ Aa a   æÿÿòÛÿÿòÛÿÿþ @'`j@'`n ÜÿÿÜÿÿ A‰i i   æÿÿîÛÿÿîÛÿÿþ @Ÿ'`j@Ÿ'`n ØÜÿÿÙÜÿÿ An n   æÿÿêÛÿÿêÛÿÿþ @«'`g@«'`l ÔÜÿÿÕÜÿÿ A o %o   æÿÿæÛÿÿæÛÿÿþ @®'`R@®'`W ÐÜÿÿÑÜÿÿ A†p ‹p    æÿÿâÛÿÿâÛÿÿþ @±'`Z@±'`_ ðÛÿÿñÛÿÿ ASq Wq   æÿÿÞÛÿÿÞÛÿÿþ @³'`b@³'`f ÈÜÿÿÉÜÿÿ As s   æÿÿÚÛÿÿÚÛÿÿþ @·'`b@·'`g ÄÜÿÿÅÜÿÿ Aýv w   æÿÿÖÛÿÿÖÛÿÿþ @À'`Z@À'`_ ÀÜÿÿÁÜÿÿ A3x 8x   üåÿÿÒÛÿÿÒÛÿÿþ @Ã'`b@Ã'`g àÛÿÿáÛÿÿ Ajz nz   øåÿÿÎÛÿÿÎÛÿÿþ @Ç'`j@Ç'`n ÜÛÿÿÝÛÿÿ AÂ| Æ|   ôåÿÿÊÛÿÿÊÛÿÿþ @Ì'`x@Ì'`| ŽÜÿÿµÜÿÿ A    ðåÿÿÆÛÿÿÆÛÿÿþ @Ö'`b@Ö'`g ÔÛÿÿÕÛÿÿ A:ƒ >ƒ   ìåÿÿÂÛÿÿÂÛÿÿþ @Ú'`j@Ú'`n ÐÛÿÿÑÛÿÿ A’… –…   èåÿÿŸÛÿÿŸÛÿÿþ @ß'`x@ß'`| ÌÛÿÿÍÛÿÿ AõŠ ùŠ   äåÿÿºÛÿÿºÛÿÿþ @í'`R@í'`V ÈÛÿÿÉÛÿÿ A    àåÿÿ¶Ûÿÿ¶Ûÿÿþ @ó'`h@ó'`l  Üÿÿ¡Üÿÿ A؍ ݍ   Üåÿÿ²Ûÿÿ²Ûÿÿþ @õ'`X@õ'`] œÜÿÿÜÿÿ A    Øåÿÿ®Ûÿÿ®Ûÿÿþ @ø'`V@ø'`[ ˜Üÿÿ™Üÿÿ A^ c   ÔåÿÿªÛÿÿªÛÿÿþ @û'`^@û'`c žÛÿÿ¹Ûÿÿ A3‘ 7‘   ÐåÿÿŠÛÿÿŠÛÿÿþ @ý'`f@ý'`j ŽÛÿÿµÛÿÿ A“ “   Ìåÿÿ¢Ûÿÿ¢Ûÿÿþ @(`f@(`j °Ûÿÿ±Ûÿÿ AŸ• £•   ÈåÿÿžÛÿÿžÛÿÿþ @(`^@(`b ˆÜÿÿ‰Üÿÿ A’š —š   ÄåÿÿšÛÿÿšÛÿÿþ @(`V@(`[ „Üÿÿ…Üÿÿ Aé› î›   Àåÿÿ–Ûÿÿ–Ûÿÿþ @(`^@(`c €Ûÿÿ¥Ûÿÿ AŸœ œ   Œåÿÿ’Ûÿÿ’Ûÿÿþ @(`f@(`j  Ûÿÿ¡Ûÿÿ AŠž ªž   žåÿÿŽÛÿÿŽÛÿÿþ @(`f@(`j œÛÿÿÛÿÿ A(¡ ,¡   ŽåÿÿŠÛÿÿŠÛÿÿþ @!(`^@!(`b tÜÿÿuÜÿÿ AŠ Š   °åÿÿ†Ûÿÿ†Ûÿÿþ @,(`V@,(`[ pÜÿÿqÜÿÿ Am§ r§   ¬åÿÿ‚Ûÿÿ‚Ûÿÿþ @/(`^@/(`c Ûÿÿ‘Ûÿÿ ABš Fš   šåÿÿ~Ûÿÿ~Ûÿÿþ @1(`f@1(`j ŒÛÿÿÛÿÿ A(ª ,ª   €åÿÿzÛÿÿzÛÿÿþ @5(`f@5(`j ˆÛÿÿ‰Ûÿÿ A𬠬¬    åÿÿvÛÿÿvÛÿÿþ @;(`^@;(`b `ÜÿÿaÜÿÿ Af² k²   œåÿÿrÛÿÿrÛÿÿþ @I(`d@I(`i \Üÿÿ]Üÿÿ Ak³ p³   ˜åÿÿnÛÿÿnÛÿÿþ @L(`R@L(`W |Ûÿÿ}Ûÿÿ A(Ž ,Ž   ”åÿÿjÛÿÿjÛÿÿþ @N(`Z@N(`^ TÜÿÿUÜÿÿ Aïµ ôµ   åÿÿfÛÿÿfÛÿÿþ @R(`Z@R(`_ PÜÿÿQÜÿÿ A2· 7·   ŒåÿÿbÛÿÿbÛÿÿþ @U(`b@U(`g pÛÿÿqÛÿÿ Aïž óž   ˆåÿÿ^Ûÿÿ^Ûÿÿþ @X(`j@X(`n lÛÿÿmÛÿÿ A» »   „åÿÿZÛÿÿZÛÿÿþ @\(`j@\(`n hÛÿÿiÛÿÿ AŠÀ ªÀ   €åÿÿVÛÿÿVÛÿÿþ @g(`Ag(ƒ dÛÿÿeÛÿÿ Afà jà   |åÿÿRÛÿÿRÛÿÿþ @l(`p@l(`t `ÛÿÿaÛÿÿ AÆ Æ   xåÿÿNÛÿÿNÛÿÿþ @r(`t@r(`x 8Üÿÿ9Üÿÿ AÊ „Ê   tåÿÿJÛÿÿJÛÿÿþ @}(`o@}(`tûÿÿ‰Üÿÿ A…Ê ŽÊ  4qåÿÿGÛÿÿGÛÿÿþ @}(`u@}(`~ UÛÿÿVÛÿÿ A@Ë DË   måÿÿCÛÿÿCÛÿÿþ @(`Z@(`^ QÛÿÿRÛÿÿ AÍ Í   iåÿÿ?Ûÿÿ?Ûÿÿþ @ƒ(`Z@ƒ(`^ )Üÿÿ*Üÿÿ AðÛ õÛ   eåÿÿ;Ûÿÿ;Ûÿÿþ @š(`i@š(`n IÛÿÿJÛÿÿ AmÝ qÝ   aåÿÿ7Ûÿÿ7Ûÿÿþ @«(`j@«(`n EÛÿÿFÛÿÿ A?ß Cß   ]åÿÿ3Ûÿÿ3Ûÿÿþ @¯(`j@¯(`n ÜÿÿÜÿÿ Asè xè   Yåÿÿ/Ûÿÿ/Ûÿÿþ @Â(`Z@Â(`_ =Ûÿÿ>Ûÿÿ A£é §é   Uåÿÿ+Ûÿÿ+Ûÿÿþ @Å(`b@Å(`f ÜÿÿÜÿÿ A|ë ë   Qåÿÿ'Ûÿÿ'Ûÿÿþ @É(`b@É(`g 5Ûÿÿ6Ûÿÿ AÛò ßò   Måÿÿ#Ûÿÿ#Ûÿÿþ @×(`j@×(`n 1Ûÿÿ2Ûÿÿ A¬ô °ô   IåÿÿÛÿÿÛÿÿþ @Û(`j@Û(`n  Üÿÿ Üÿÿ Aãø èø   EåÿÿÛÿÿÛÿÿþ @ç(`j@ç(`o ÜÿÿÜÿÿ A $   AåÿÿÛÿÿÛÿÿþ @)`]@)`b %Ûÿÿ&Ûÿÿ Aq u   =åÿÿÛÿÿÛÿÿþ @)`^@)`b !Ûÿÿ"Ûÿÿ Ao s   9åÿÿÛÿÿÛÿÿþ @ )`^@ )`b ÛÿÿÛÿÿ Ac g   5åÿÿ Ûÿÿ Ûÿÿþ @)`^@)`b ÛÿÿÛÿÿ A† Š   1åÿÿÛÿÿÛÿÿþ @)`}A) ñÛÿÿòÛÿÿ Aã è   -åÿÿÛÿÿÛÿÿþ @)`R@)`W ÛÿÿÛÿÿ A  €   )åÿÿÿÚÿÿÿÚÿÿþ @)`Z@)`^  ÛÿÿÛÿÿ A[ _   %åÿÿûÚÿÿûÚÿÿþ @)`Z@)`^ åÛÿÿæÛÿÿ AÈ Í   !åÿÿ÷Úÿÿ÷Úÿÿþ C)Ø)Ý ÛÿÿÛÿÿ AÆ Ê   åÿÿóÚÿÿóÚÿÿþ @#)`j@#)`n ÝÛÿÿÞÛÿÿ A% *   åÿÿïÚÿÿïÚÿÿþ @1)`Z@1)`_ ýÚÿÿþÚÿÿ A[ _   åÿÿëÚÿÿëÚÿÿþ @4)`b@4)`f ùÚÿÿúÚÿÿ A$+ (+   åÿÿçÚÿÿçÚÿÿþ @N)`b@N)`f ÑÛÿÿÒÛÿÿ A6 #6    åÿÿãÚÿÿãÚÿÿþ @g)`R@g)`W ñÚÿÿòÚÿÿ AO7 S7    åÿÿßÚÿÿßÚÿÿþ @j)`Z@j)`^ íÚÿÿîÚÿÿ A#9 '9   åÿÿÛÚÿÿÛÚÿÿþ @n)`q@n)`u éÚÿÿêÚÿÿ A’: –:   åÿÿ×Úÿÿ×Úÿÿþ @q)`|Aq)€ åÚÿÿæÚÿÿ Aú; þ;   ýäÿÿÓÚÿÿÓÚÿÿþ @t)`_@t)`c œÛÿÿŸÛÿÿ A7> <>   ùäÿÿÏÚÿÿÏÚÿÿþ @x)`i@x)`n ¹ÛÿÿºÛÿÿ Aµ? º?   õäÿÿËÚÿÿËÚÿÿþ @{)`j@{)`o ÙÚÿÿÚÚÿÿ A(A ,A   ñäÿÿÇÚÿÿÇÚÿÿþ @~)`r@~)`v ±Ûÿÿ²Ûÿÿ A‰F ŽF   íäÿÿÃÚÿÿÃÚÿÿþ @‡)`r@‡)`w ÑÚÿÿÒÚÿÿ A5H 9H   éäÿÿ¿Úÿÿ¿Úÿÿþ @Š)`z@Š)`~ ÍÚÿÿÎÚÿÿ APM TM   åäÿÿ»Úÿÿ»Úÿÿþ @“)`z@“)`~ ÉÚÿÿÊÚÿÿ AøP üP   áäÿÿ·Úÿÿ·Úÿÿþ @›)`j@›)`n ¡Ûÿÿ¢Ûÿÿ A­V ²V   Ýäÿÿ³Úÿÿ³Úÿÿþ @¥)`j@¥)`o ÁÚÿÿÂÚÿÿ AšW žW   Ùäÿÿ¯Úÿÿ¯Úÿÿþ @§)`r@§)`v œÚÿÿŸÚÿÿ A¯Y ³Y   Õäÿÿ«Úÿÿ«Úÿÿþ @«)`r@«)`v •Ûÿÿ–Ûÿÿ A>[ C[   Ñäÿÿ§Úÿÿ§Úÿÿþ C­)à­)å µÚÿÿ¶Úÿÿ Aœ]  ]   Íäÿÿ£Úÿÿ£Úÿÿþ C±)‚±)† ÛÿÿŽÛÿÿ A‘e –e   ÉäÿÿŸÚÿÿŸÚÿÿþ @¿)`r@¿)`w ­Úÿÿ®Úÿÿ Ag g   Åäÿÿ›Úÿÿ›Úÿÿþ @Â)`z@Â)`~ ©ÚÿÿªÚÿÿ Ac| g|   Áäÿÿ—Úÿÿ—Úÿÿþ @ä)`z@ä)`~ Ûÿÿ‚Ûÿÿ A‘Œ –Œ   œäÿÿ“Úÿÿ“Úÿÿþ @*`j@*`o ¡Úÿÿ¢Úÿÿ A~ ‚   ¹äÿÿÚÿÿÚÿÿþ @*`r@*`v ÚÿÿžÚÿÿ A— ›   µäÿÿ‹Úÿÿ‹Úÿÿþ @*`r@*`v uÛÿÿvÛÿÿ A-’ 2’   ±äÿÿ‡Úÿÿ‡Úÿÿþ C * *† •Úÿÿ–Úÿÿ A– –   ­äÿÿƒÚÿÿƒÚÿÿþ C*‚*† ‘Úÿÿ’Úÿÿ A‚ž †ž   ©äÿÿÚÿÿÚÿÿþ @ *`r@ *`v iÛÿÿjÛÿÿ Aš š   ¥äÿÿ{Úÿÿ{Úÿÿþ @2*`j@2*`o ‰ÚÿÿŠÚÿÿ Aõš ùš   ¡äÿÿwÚÿÿwÚÿÿþ @4*`r@4*`v …Úÿÿ†Úÿÿ A « «   äÿÿsÚÿÿsÚÿÿþ @8*`r@8*`v ]Ûÿÿ^Ûÿÿ AŸ­ €­   ™äÿÿoÚÿÿoÚÿÿþ C<*<*† }Úÿÿ~Úÿÿ Aq± u±   •äÿÿkÚÿÿkÚÿÿþ CB*‚B*† yÚÿÿzÚÿÿ Aê¹ î¹   ‘äÿÿgÚÿÿgÚÿÿþ @Q*`r@Q*`v uÚÿÿvÚÿÿ Afà jà   äÿÿcÚÿÿcÚÿÿþ @c*`j@c*`n qÚÿÿrÚÿÿ ApÄ tÄ   ‰äÿÿ_Úÿÿ_Úÿÿþ @e*`x@e*`| IÛÿÿJÛÿÿ A[Ë `Ë   …äÿÿ[Úÿÿ[Úÿÿþ @x*`V@x*`[ iÚÿÿjÚÿÿ AbÌ fÌ   äÿÿWÚÿÿWÚÿÿþ @{*`B@{*`F eÚÿÿfÚÿÿ A¬Î °Î   }äÿÿSÚÿÿSÚÿÿþ @*`B@*`F aÚÿÿbÚÿÿ A¯Ð ³Ð   yäÿÿOÚÿÿOÚÿÿþ @‡*`?@‡*`C ]Úÿÿ^Úÿÿ AtÑ xÑ   uäÿÿKÚÿÿKÚÿÿþ @‰*`H@‰*`L YÚÿÿZÚÿÿ AãÓ çÓ   qäÿÿGÚÿÿGÚÿÿþ @’*`J@’*`N 1Ûÿÿ2Ûÿÿ AŠÔ «Ô   mäÿÿCÚÿÿCÚÿÿþ @”*`<@”*`A -Ûÿÿ.Ûÿÿ AåÕ êÕ   iäÿÿ?Úÿÿ?Úÿÿþ @—*`:@—*`? MÚÿÿNÚÿÿ A×Ö ÛÖ   eäÿÿ;Úÿÿ;Úÿÿþ @š*`B@š*`F IÚÿÿJÚÿÿ A¥Ø ©Ø   aäÿÿ7Úÿÿ7Úÿÿþ @ž*`B@ž*`F !Ûÿÿ"Ûÿÿ A¬Ú ±Ú   ]äÿÿ3Úÿÿ3Úÿÿþ @¥*`:@¥*`? ÛÿÿÛÿÿ AÜ !Ü   Yäÿÿ/Úÿÿ/Úÿÿþ @ª*`B@ª*`G ÛÿÿÛÿÿ AÝÞ âÞ   Uäÿÿ+Úÿÿ+Úÿÿþ @³*`:@³*`? ÛÿÿÛÿÿ A²ß ·ß   Qäÿÿ'Úÿÿ'Úÿÿþ @¶*`B@¶*`G 5Úÿÿ6Úÿÿ AOà Sà   Mäÿÿ#Úÿÿ#Úÿÿþ @ž*`J@ž*`N 1Úÿÿ2Úÿÿ AIâ Mâ   IäÿÿÚÿÿÚÿÿþ @Œ*`J@Œ*`N  Ûÿÿ Ûÿÿ A8é =é   EäÿÿÚÿÿÚÿÿþ @Ì*`B@Ì*`G )Úÿÿ*Úÿÿ AÕé Ùé   AäÿÿÚÿÿÚÿÿþ @Î*`J@Î*`N %Úÿÿ&Úÿÿ AÙë Ýë   =äÿÿÚÿÿÚÿÿþ @Ò*`J@Ò*`N ýÚÿÿþÚÿÿ A8ó =ó   9äÿÿÚÿÿÚÿÿþ @â*`:@â*`? ÚÿÿÚÿÿ Aô ô   5äÿÿ Úÿÿ Úÿÿþ @å*`B@å*`F ÚÿÿÚÿÿ AÁù Åù   1äÿÿÚÿÿÚÿÿþ @ò*`B@ò*`F  Úÿÿ Úÿÿ A—ý Ÿý    `Úÿÿ©×ÿÿ©×ÿÿý @+`,@+`4 ÚÿÿÚÿÿ AÒý Úý   û¥×ÿÿ¥×ÿÿþ @+`*@+`2 ÚÿÿÚÿÿ Aþ þ   ÷¡×ÿÿ¡×ÿÿþ @ +`"@ +`* ýÙÿÿüÙÿÿ A4þ <þ   ó×ÿÿ×ÿÿþ @ +`"@ +`* getSkillDedupÙæÿÿ Aû   Aûþ  íGÚÿÿGÚÿÿý @+`!@+`2 ”mergeSkillDuplicatesÓæÿÿ A  A  çAÚÿÿAÚÿÿý @0+`@0+`* úÎæÿÿ AÏç  AÏÒ  â<Úÿÿ<Úÿÿý @B+`@B+`. ÏÚÿÿÐÚÿÿ A¶ »   ÞáÙÿÿáÙÿÿþ @J+`@J+` ËÚÿÿÌÚÿÿ A    ÚÝÙÿÿÝÙÿÿþ @M+`@M+` ëÙÿÿìÙÿÿ A` d   ÖÙÙÿÿÙÙÿÿþ @O+`"@O+`& çÙÿÿèÙÿÿ A, 0   ÒÕÙÿÿÕÙÿÿþ @S+`"@S+`& ¿ÚÿÿÀÚÿÿ A" '   ÎÑÙÿÿÑÙÿÿþ @Y+`@Y+` »ÚÿÿŒÚÿÿ AÈ Í   ÊÍÙÿÿÍÙÿÿþ @\+`"@\+`' ·ÚÿÿžÚÿÿ A •   ÆÉÙÿÿÉÙÿÿþ @_+`*@_+`/ ×ÙÿÿØÙÿÿ Aý   ÂÅÙÿÿÅÙÿÿþ @a+`2@a+`6 ÓÙÿÿÔÙÿÿ A  ŸÁÙÿÿÁÙÿÿþ @e+`2@e+`6 «Úÿÿ¬Úÿÿ A¬±  ºœÙÿÿœÙÿÿþ @k+`*@k+`/ §ÚÿÿšÚÿÿ Ach  ¶¹Ùÿÿ¹Ùÿÿþ @p+`2@p+`7 ÇÙÿÿÈÙÿÿ A   ²µÙÿÿµÙÿÿþ @w+`:@w+`> ÃÙÿÿÄÙÿÿ A04  ®±Ùÿÿ±Ùÿÿþ @|+`:@|+`> ¿ÙÿÿÀÙÿÿ A“—  ª­Ùÿÿ­Ùÿÿþ @ˆ+`:@ˆ+`> —Úÿÿ˜Úÿÿ A  Š©Ùÿÿ©Ùÿÿþ @Š+`K@Š+`P ·ÙÿÿžÙÿÿ A  ¢¥Ùÿÿ¥Ùÿÿþ @+`.@+`2 ³ÙÿÿŽÙÿÿ A…  ž¡Ùÿÿ¡Ùÿÿþ @“+`<@“+`@ ‹ÚÿÿŒÚÿÿ A*/  šÙÿÿÙÿÿþ @›+`+@›+`0 ‡ÚÿÿˆÚÿÿ AÃÈ  –™Ùÿÿ™Ùÿÿþ @ž+`.@ž+`3 ƒÚÿÿ„Úÿÿ AŒ‘  ’•Ùÿÿ•Ùÿÿþ @¡+`6@¡+`; £Ùÿÿ€Ùÿÿ A    Ž‘Ùÿÿ‘Ùÿÿþ @«+`6@«+`: {Úÿÿ|Úÿÿ A<#A#  ŠÙÿÿÙÿÿþ @¶+`9@¶+`> wÚÿÿxÚÿÿ A6$;$  †‰Ùÿÿ‰Ùÿÿþ @¹+`:@¹+`? sÚÿÿtÚÿÿ A]%b%  ‚…Ùÿÿ…Ùÿÿþ @Œ+`B@Œ+`G oÚÿÿpÚÿÿ AH&M&  ~ÿÿÿÙÿÿÙÿÿþ @¿+`J@¿+`O ÙÿÿÙÿÿ A))  zÿÿÿ}Ùÿÿ}Ùÿÿþ @Ç+`J@Ç+`N gÚÿÿhÚÿÿ AŒ*Á*  vÿÿÿyÙÿÿyÙÿÿþ @Ë+`J@Ë+`O ‡ÙÿÿˆÙÿÿ AZ-^-  rÿÿÿuÙÿÿuÙÿÿþ @Ô+`B@Ô+`F ƒÙÿÿ„Ùÿÿ A0"0  nÿÿÿqÙÿÿqÙÿÿþ @Ü+`:@Ü+`> [Úÿÿ\Úÿÿ AÝ0â0  jÿÿÿmÙÿÿmÙÿÿþ @Þ+`[@Þ+`` {Ùÿÿ|Ùÿÿ A22  fÿÿÿiÙÿÿiÙÿÿþ @á+`J@á+`N SÚÿÿTÚÿÿ AŠ55  bÿÿÿeÙÿÿeÙÿÿþ @ë+`J@ë+`O OÚÿÿPÚÿÿ A”6™6  ^ÿÿÿaÙÿÿaÙÿÿþ @î+`R@î+`W oÙÿÿpÙÿÿ AÉ7Í7  Zÿÿÿ]Ùÿÿ]Ùÿÿþ @ñ+`Z@ñ+`^ GÚÿÿHÚÿÿ Aš9Ÿ9  VÿÿÿYÙÿÿYÙÿÿþ Cõ+‹õ+ CÚÿÿDÚÿÿ Ad<i<  RÿÿÿUÙÿÿUÙÿÿþ Cü+‹ü+ ?Úÿÿ@Úÿÿ A ??  NÿÿÿQÙÿÿQÙÿÿþ @,`j@,`o ;Úÿÿ<Úÿÿ A/B4B  JÿÿÿMÙÿÿMÙÿÿþ @ ,`R@ ,`W [Ùÿÿ\Ùÿÿ AaCeC  FÿÿÿIÙÿÿIÙÿÿþ @,`Z@,`^ 3Úÿÿ4Úÿÿ A‰EŽE  BÿÿÿEÙÿÿEÙÿÿþ @,`Z@,`_ SÙÿÿTÙÿÿ AEHIH  >ÿÿÿAÙÿÿAÙÿÿþ @,`w@,`{ OÙÿÿPÙÿÿ AÕMÙM   šÙÿÿ<Ùÿÿ<Ùÿÿý @7,`@7,`ôøÿÿ{Úÿÿ AÚMãM 4ü9Ùÿÿ9Ùÿÿþ @7,`@7,`' #Úÿÿ$Úÿÿ A&P+P  ø5Ùÿÿ5Ùÿÿþ @?,`!@?,`& Úÿÿ Úÿÿ AsPxP  ô1Ùÿÿ1Ùÿÿþ @A,`"@A,`' ?Ùÿÿ@Ùÿÿ AÚQÞQ  ð-Ùÿÿ-Ùÿÿþ @G,`*@G,`. ;Ùÿÿ<Ùÿÿ ABSFS  ì)Ùÿÿ)Ùÿÿþ @J,`O@J,`S 7Ùÿÿ8Ùÿÿ AšT¬T  è%Ùÿÿ%Ùÿÿþ @P,`<@P,`@ 3Ùÿÿ4Ùÿÿ AVUZU  ä!Ùÿÿ!Ùÿÿþ @S,`3@S,`7 /Ùÿÿ0Ùÿÿ AŒVÀV  àÙÿÿÙÿÿþ @Y,`<@Y,`@ +Ùÿÿ,Ùÿÿ AjWnW  ÜÙÿÿÙÿÿþ @\,`3@\,`7 'Ùÿÿ(Ùÿÿ A7X;X  ØÙÿÿÙÿÿþ @`,`8@`,`< #Ùÿÿ$Ùÿÿ A˜YœY  ÔÙÿÿÙÿÿþ @f,`8@f,`< ûÙÿÿüÙÿÿ A%[*[  Ð Ùÿÿ Ùÿÿþ @k,`/@k,`4 ÙÿÿÙÿÿ A­\±\  Ì Ùÿÿ Ùÿÿþ @r,`2@r,`6 ÙÿÿÙÿÿ A^^  ÈÙÿÿÙÿÿþ @w,`2@w,`6 ïÙÿÿðÙÿÿ Aˆ__  ÄÙÿÿÙÿÿþ @~,`*@~,`/ ÙÿÿÙÿÿ A2`6`  ÀýØÿÿýØÿÿþ @,`2@,`6  Ùÿÿ Ùÿÿ A*a.a  ŒùØÿÿùØÿÿþ @…,`2@…,`6 ãÙÿÿäÙÿÿ A!b&b  žõØÿÿõØÿÿþ @‰,`2@‰,`7 ÙÿÿÙÿÿ Aåcéc  ŽñØÿÿñØÿÿþ @’,`*@’,`. ÛÙÿÿÜÙÿÿ AVe[e  °íØÿÿíØÿÿþ @–,`*@–,`/ ûØÿÿüØÿÿ Aff  ¬éØÿÿéØÿÿþ @™,`A@™,`E ÷ØÿÿøØÿÿ AÜgàg  šåØÿÿåØÿÿþ @Ÿ,`2@Ÿ,`6 óØÿÿôØÿÿ AWi[i  €áØÿÿáØÿÿþ @€,`2@€,`6 ïØÿÿðØÿÿ AVkZk   ÝØÿÿÝØÿÿþ @­,`;@­,`? ëØÿÿìØÿÿ AŽo’o   6ÙÿÿØØÿÿØØÿÿý @Å,`@Å,`øÿÿÚÿÿ A“oœo 4üÕØÿÿÕØÿÿþ @Å,`@Å,`' ¿ÙÿÿÀÙÿÿ A7s{  رØÿÿ±Øÿÿþ @ó,`*@ó,`. ¿ØÿÿÀØÿÿ Añ{õ{  Ô­Øÿÿ­Øÿÿþ @õ,`8@õ,`<ÒáÿÿÑáÿÿ Aö{| 4Ñ` ŒáÿÿŒáÿÿþ @õ,`=@õ,`I ”Ùÿÿ•Ùÿÿ Ar}w}  ÍŠØÿÿŠØÿÿþ @ü,`*@ü,`/ ŽØÿÿµØÿÿ A~ ~  É¢Øÿÿ¢Øÿÿþ @ÿ,`2@ÿ,`6 °Øÿÿ±Øÿÿ A  ÅžØÿÿžØÿÿþ @-`2@-`6 ˆÙÿÿ‰Ùÿÿ Ae€j€  ÁšØÿÿšØÿÿþ @-`2@-`7 šØÿÿ©Øÿÿ A)‚-‚  œ–Øÿÿ–Øÿÿþ @-`*@-`. €ÙÿÿÙÿÿ AšƒŸƒ  ¹’Øÿÿ’Øÿÿþ @-`*@-`/ |Ùÿÿ}Ùÿÿ AN„S„  µŽØÿÿŽØÿÿþ @-`2@-`7 œØÿÿØÿÿ A.†2†  ±ŠØÿÿŠØÿÿþ @-`:@-`> ˜Øÿÿ™Øÿÿ Aևڇ  ­†Øÿÿ†Øÿÿþ @"-`H@"-`L ”Øÿÿ•Øÿÿ AÁŠŊ  ©‚Øÿÿ‚Øÿÿþ @+-`2@+-`6 Øÿÿ‘Øÿÿ AŒ…Œ  ¥~Øÿÿ~Øÿÿþ @1-`2@1-`6 ŒØÿÿØÿÿ AüŽ  ¡zØÿÿzØÿÿþ @6-`2@6-`6 ˆØÿÿ‰Øÿÿ Aðô  vØÿÿvØÿÿþ @?-`0@?-`4 „Øÿÿ…Øÿÿ Aö’ú’  ™rØÿÿrØÿÿþ @O-`;@O-`? \Ùÿÿ]Ùÿÿ AA™F™   ËØÿÿmØÿÿmØÿÿý @x-`@x-` {Øÿÿ|Øÿÿ AΙҙ  ûiØÿÿiØÿÿþ @{-`@{-` SÙÿÿTÙÿÿ A› ›  ÷eØÿÿeØÿÿþ @„-`)@„-`. sØÿÿtØÿÿ Ax›|›  óaØÿÿaØÿÿþ @†-`*@†-`. oØÿÿpØÿÿ AŽœ’œ  ï]Øÿÿ]Øÿÿþ @Š-`*@Š-`. GÙÿÿHÙÿÿ Aџ֟  ëYØÿÿYØÿÿþ @˜-`@˜-` gØÿÿhØÿÿ Ar v   çUØÿÿUØÿÿþ @›-`"@›-`& cØÿÿdØÿÿ A0¡4¡  ãQØÿÿQØÿÿþ @Ÿ-`"@Ÿ-`& ;Ùÿÿ<Ùÿÿ A5£:£  ßMØÿÿMØÿÿþ @š-`"@š-`' [Øÿÿ\Øÿÿ Aˣϣ  ÛIØÿÿIØÿÿþ @«-`*@«-`. WØÿÿXØÿÿ A¥ ¥  ×EØÿÿEØÿÿþ @°-`*@°-`. /Ùÿÿ0Ùÿÿ A©©   žØÿÿ@Øÿÿ@Øÿÿý @À-`@À-` *Ùÿÿ+Ùÿÿ Anªsª  û<Øÿÿ<Øÿÿþ @É-`@É-` JØÿÿKØÿÿ Aöªúª  ÷8Øÿÿ8Øÿÿþ @Ì-`"@Ì-`& "Ùÿÿ#Ùÿÿ Aʫϫ  ó4Øÿÿ4Øÿÿþ @Ð-`"@Ð-`' ÙÿÿÙÿÿ A߬ä¬  ï0Øÿÿ0Øÿÿþ @×-`"@×-`' >Øÿÿ?Øÿÿ A®®  ë,Øÿÿ,Øÿÿþ @ß-`"@ß-`& ÙÿÿÙÿÿ A®†®  ç(Øÿÿ(Øÿÿþ @á-`0@á-`5 ÙÿÿÙÿÿ AG°L°  ã$Øÿÿ$Øÿÿþ @è-`.@è-`3 2Øÿÿ3Øÿÿ AÔ±ر  ß Øÿÿ Øÿÿþ @ï-`6@ï-`: .Øÿÿ/Øÿÿ A³³  ÛØÿÿØÿÿþ @õ-`6@õ-`: ÙÿÿÙÿÿ A8µ=µ  רÿÿØÿÿþ @.`&@.`+ ÙÿÿÙÿÿ AÖµÛµ  ÓØÿÿØÿÿþ @.`"@.`' "Øÿÿ#Øÿÿ Aƶʶ  ÏØÿÿØÿÿþ @ .`*@ .`. ØÿÿØÿÿ A@žDž  Ë Øÿÿ Øÿÿþ @.`*@.`. öØÿÿ÷Øÿÿ Aš¹Ÿ¹  ÇØÿÿØÿÿþ @.`@.`$ ØÿÿØÿÿ A6º:º  ÃØÿÿØÿÿþ @.`I@.`M îØÿÿïØÿÿ A]ŒbŒ  ¿ØÿÿØÿÿþ @&.`-@&.`2 êØÿÿëØÿÿ AŒnj  »ü×ÿÿü×ÿÿþ @(.`.@(.`3 æØÿÿçØÿÿ A6Ÿ;Ÿ  ·ø×ÿÿø×ÿÿþ @+.`6@+.`; ØÿÿØÿÿ A¿¿  ³ô×ÿÿô×ÿÿþ @..`>@..`B ØÿÿØÿÿ ATÀXÀ  ¯ð×ÿÿð×ÿÿþ @2.`a@2.`e þ×ÿÿÿ×ÿÿ AÁÁÅÁ  «ì×ÿÿì×ÿÿþ C6.‚6.† ÖØÿÿרÿÿ APÃUà  §è×ÿÿè×ÿÿþ @<.`I@<.`N ÒØÿÿÓØÿÿ A÷ÄüÄ  £ä×ÿÿä×ÿÿþ @C.`6@C.`; ò×ÿÿó×ÿÿ A!Æ%Æ  Ÿà×ÿÿà×ÿÿþ @F.`>@F.`B î×ÿÿï×ÿÿ AžÈ¢È  ›Ü×ÿÿÜ×ÿÿþ @K.`>@K.`B ê×ÿÿë×ÿÿ A ËË  —Ø×ÿÿØ×ÿÿþ @T.`?@T.`C æ×ÿÿç×ÿÿ A•Ë™Ë  “Ô×ÿÿÔ×ÿÿþ @V.`<@V.`@ â×ÿÿã×ÿÿ AºÍŸÍ  Ð×ÿÿÐ×ÿÿþ @a.`1@a.`5 Þ×ÿÿß×ÿÿ A#Î'Î  ‹Ì×ÿÿÌ×ÿÿþ @c.`0@c.`4 ¶Øÿÿ·Øÿÿ A]ÐbÐ   %ØÿÿÇ×ÿÿÇ×ÿÿý @t.`@t.` ±Øÿÿ²Øÿÿ A ÑÑ  ûÃ×ÿÿÃ×ÿÿþ @w.`@w.` ­Øÿÿ®Øÿÿ AÇÑÌÑ  ÷¿×ÿÿ¿×ÿÿþ @~.`@~.` Í×ÿÿÎ×ÿÿ A=ÒAÒ  ó»×ÿÿ»×ÿÿþ @.`"@.`& ¥ØÿÿŠØÿÿ AŒÓ‘Ó  ï·×ÿÿ·×ÿÿþ @‡.`"@‡.`' Å×ÿÿÆ×ÿÿ A«Ô¯Ô  ë³×ÿÿ³×ÿÿþ @.`"@.`& Á×ÿÿÂ×ÿÿ A4×8×  ¯×ÿÿ¯×ÿÿþ @€.`@€.`  œ×ÿÿŸ×ÿÿ AØ Ø  «×ÿÿ«×ÿÿþ @ª.`$@ª.`( ¹×ÿÿº×ÿÿ A¶ÙºÙ  §×ÿÿ§×ÿÿþ @Ž.`@Ž.`  µ×ÿÿ¶×ÿÿ AŠÚŽÚ  £×ÿÿ£×ÿÿþ @º.`$@º.`( ØÿÿŽØÿÿ AÜ"Ü  Ÿ×ÿÿŸ×ÿÿþ @Ä.`@Ä.`! ­×ÿÿ®×ÿÿ AÝÝ  ›×ÿÿ›×ÿÿþ @Ë.`@Ë.`" ©×ÿÿª×ÿÿ AŸÝ£Ý  —×ÿÿ—×ÿÿþ @Ð.`@Ð.`" ¥×ÿÿŠ×ÿÿ A ßß  “×ÿÿ“×ÿÿþ @Ü.`@Ü.`  ¡×ÿÿ¢×ÿÿ AÞßâß  ×ÿÿ×ÿÿþ @â.`$@â.`( ×ÿÿž×ÿÿ AXá\á  ‹×ÿÿ‹×ÿÿþ @ì.`@ì.`  ™×ÿÿš×ÿÿ A,â0â  ‡×ÿÿ‡×ÿÿþ @ò.`$@ò.`( qØÿÿrØÿÿ A§ã¬ã  ƒ×ÿÿƒ×ÿÿþ @ü.`@ü.`! ‘×ÿÿ’×ÿÿ AŽä’ä  ×ÿÿ×ÿÿþ @/`@/`" ×ÿÿŽ×ÿÿ A)å-å  {×ÿÿ{×ÿÿþ @/`@/`" ‰×ÿÿŠ×ÿÿ Aßåãå  w×ÿÿw×ÿÿþ @/`@/`" aØÿÿbØÿÿ ADçIç  s×ÿÿs×ÿÿþ @/`@/`! ×ÿÿ‚×ÿÿ A+è/è  o×ÿÿo×ÿÿþ @!/`@!/`" }×ÿÿ~×ÿÿ A›èŸè  k×ÿÿk×ÿÿþ @$/`@$/`" y×ÿÿz×ÿÿ ADêHê  g×ÿÿg×ÿÿþ @//`@//`  u×ÿÿv×ÿÿ Aëë  c×ÿÿc×ÿÿþ @5/`$@5/`( MØÿÿNØÿÿ A#ì(ì  _×ÿÿ_×ÿÿþ @=/`@=/`! m×ÿÿn×ÿÿ A íí  [×ÿÿ[×ÿÿþ @D/`@D/`" i×ÿÿj×ÿÿ AÀíÄí  W×ÿÿW×ÿÿþ @J/`@J/`" e×ÿÿf×ÿÿ Aï ï  S×ÿÿS×ÿÿþ @V/`@V/`  a×ÿÿb×ÿÿ Aðïôï  O×ÿÿO×ÿÿþ @\/`$@\/`( ]×ÿÿ^×ÿÿ AŸò£ò   š×ÿÿJ×ÿÿJ×ÿÿý @j/`@j/`  X×ÿÿY×ÿÿ Asówó  ûF×ÿÿF×ÿÿþ @p/`$@p/`( 0Øÿÿ1Øÿÿ A0õ5õ  ÷B×ÿÿB×ÿÿþ @z/`@z/` ,Øÿÿ-Øÿÿ AÏõÔõ  ó>×ÿÿ>×ÿÿþ @}/`@}/` (Øÿÿ)Øÿÿ A3÷8÷  ï:×ÿÿ:×ÿÿþ @…/`@…/` $Øÿÿ%Øÿÿ A­÷²÷  ë6×ÿÿ6×ÿÿþ @ˆ/`"@ˆ/`' D×ÿÿE×ÿÿ Adøhø  ç2×ÿÿ2×ÿÿþ @‹/`<@‹/`@ @×ÿÿA×ÿÿ AÉùÍù  ã.×ÿÿ.×ÿÿþ @/`=@/`A <×ÿÿ=×ÿÿ A÷úûú  ß*×ÿÿ*×ÿÿþ @–/`P@–/`T ØÿÿØÿÿ Aïûôû  Û&×ÿÿ&×ÿÿþ @š/`1@š/`6 4×ÿÿ5×ÿÿ Aýý  ×"×ÿÿ"×ÿÿþ @Ÿ/`2@Ÿ/`6 0×ÿÿ1×ÿÿ Asþwþ  Ó×ÿÿ×ÿÿþ @§/`5@§/`9 ,×ÿÿ-×ÿÿ AGÿKÿ  Ï×ÿÿ×ÿÿþ @­/`@­/` A+±@Ž/@Á/ &×ÿÿ'×ÿÿ A†Š   q×ÿÿ×ÿÿ×ÿÿý @ë/`@ë/` ý×ÿÿþ×ÿÿ AÚß  û×ÿÿ×ÿÿþ @í/` @í/`% ù×ÿÿú×ÿÿ AGL  ÷ ×ÿÿ ×ÿÿþ @ö/`)@ö/`. ×ÿÿ×ÿÿ A¢Š  ó×ÿÿ×ÿÿþ @ø/`*@ø/`. ×ÿÿ×ÿÿ A    ï×ÿÿ×ÿÿþ @0`*@0`. ×ÿÿ×ÿÿ A– š   ëÿÖÿÿÿÖÿÿþ @0`-@0`1  ×ÿÿ×ÿÿ Aîò  çûÖÿÿûÖÿÿþ @ 0`)@ 0`-  ×ÿÿ ×ÿÿ A?C  ã÷Öÿÿ÷Öÿÿþ @)0`@)0`" ×ÿÿ×ÿÿ A04   P×ÿÿòÖÿÿòÖÿÿý @z0`@z0` Ü×ÿÿÝ×ÿÿ A„‰  ûîÖÿÿîÖÿÿþ @|0` @|0`% Ø×ÿÿÙ×ÿÿ AÓØ  ÷êÖÿÿêÖÿÿþ @…0`)@…0`. øÖÿÿùÖÿÿ A.2  óæÖÿÿæÖÿÿþ @‡0`*@‡0`. ôÖÿÿõÖÿÿ AŒ  ïâÖÿÿâÖÿÿþ @0`*@0`. ðÖÿÿñÖÿÿ AÊ!Î!  ëÞÖÿÿÞÖÿÿþ @0`)@0`- ìÖÿÿíÖÿÿ Af#j#  çÚÖÿÿÚÖÿÿþ @š0`)@š0`- èÖÿÿéÖÿÿ AÊ$Î$  ãÖÖÿÿÖÖÿÿþ @±0`2@±0`6 äÖÿÿåÖÿÿ A’%–%  ßÒÖÿÿÒÖÿÿþ @µ0`2@µ0`6 àÖÿÿáÖÿÿ A€'š'  ÛÎÖÿÿÎÖÿÿþ @À0`)@À0`- ÜÖÿÿÝÖÿÿ Aà'ä'  ×ÊÖÿÿÊÖÿÿþ @Á0`0@Á0`4 ØÖÿÿÙÖÿÿ A`)d)  ÓÆÖÿÿÆÖÿÿþ @Ë0`@Ë0`"   Ê3/* __next_internal_client_entry_do_not_use__ default auto */ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { useState, useEffect } from 'react'; import { useRouter, useParams } from 'next/navigation'; import Link from 'next/link'; import { useSession } from '@/lib/auth'; import { useLocale } from '@/context/locale'; import { getTask, createOffer, getLocations } from '@/lib/api'; import { shortName } from '@/lib/formatName'; import { formatPrice, taskTitle, taskDescription } from '@/lib/taskLocale'; export default function MakeOfferPage() { const { id } = useParams(); const router = useRouter(); const { data: session, isPending } = useSession(); const { t, locale } = useLocale(); const [task, setTask] = useState(null); const [loading, setLoading] = useState(true); const [rawLocs, setRawLocs] = useState([]); const [submitting, setSubmitting] = useState(false); const [error, setError] = useState(''); const locMap = rawLocs.reduce((acc, city)=>{ var _city_names, _city_names1; var _city_names_locale, _ref; acc[city.slug] = (_ref = (_city_names_locale = (_city_names = city.names) === null || _city_names === void 0 ? void 0 : _city_names[locale]) !== null && _city_names_locale !== void 0 ? _city_names_locale : (_city_names1 = city.names) === null || _city_names1 === void 0 ? void 0 : _city_names1.el) !== null && _ref !== void 0 ? _ref : city.slug; var _city_children; for (const d of (_city_children = city.children) !== null && _city_children !== void 0 ? _city_children : []){ var _d_names, _d_names1; var _d_names_locale, _ref1; acc[d.slug] = (_ref1 = (_d_names_locale = (_d_names = d.names) === null || _d_names === void 0 ? void 0 : _d_names[locale]) !== null && _d_names_locale !== void 0 ? _d_names_locale : (_d_names1 = d.names) === null || _d_names1 === void 0 ? void 0 : _d_names1.el) !== null && _ref1 !== void 0 ? _ref1 : d.slug; } return acc; }, {}); useEffect(()=>{ if (!isPending && !session) router.push('/login'); }, [ session, isPending ]); useEffect(()=>{ if (!id) return; getTask(id).then((data)=>setTask(data)).catch(()=>router.push("/tasks/".concat(id))).finally(()=>setLoading(false)); getLocations().then((locs)=>setRawLocs(locs)).catch(()=>{}); }, [ id ]); async function handleSubmit(e) { e.preventDefault(); setError(''); setSubmitting(true); const form = new FormData(e.currentTarget); try { await createOffer({ taskId: id, price: Number(form.get('price')), message: form.get('message') || undefined }); router.push("/tasks/".concat(id)); } catch (err) { setError(err.message || t('common.error')); } finally{ setSubmitting(false); } } if (isPending || loading) { return /*#__PURE__*/ _jsx("div", { className: "text-center py-20 text-white", children: t('common.loading') }); } var _task_task; const taskData = (_task_task = task === null || task === void 0 ? void 0 : task.task) !== null && _task_task !== void 0 ? _task_task : task; const customer = task === null || task === void 0 ? void 0 : task.customer; const customerName = (customer === null || customer === void 0 ? void 0 : customer.name) ? shortName(customer.name) : null; var _taskData_title, _locMap_taskData_location; return /*#__PURE__*/ _jsxs("div", { className: "max-w-xl mx-auto px-4 py-10", children: [ /*#__PURE__*/ _jsxs(Link, { href: "/tasks/".concat(id), className: "inline-flex items-center gap-1.5 text-sm text-white/70 hover:text-white mb-8 transition", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 19l-7-7 7-7" }) }), (_taskData_title = taskData === null || taskData === void 0 ? void 0 : taskData.title) !== null && _taskData_title !== void 0 ? _taskData_title : t('common.back_home', 'Back') ] }), /*#__PURE__*/ _jsx("h1", { className: "text-2xl font-bold text-white mb-1", children: t('task.offer.btn') }), customerName && /*#__PURE__*/ _jsxs("p", { className: "text-sm text-white/60 mb-6", children: [ t('common.from'), " ", customerName ] }), taskData && /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-4 mb-6 shadow-sm", children: [ /*#__PURE__*/ _jsx("p", { className: "font-semibold text-gray-900 text-sm line-clamp-2", children: taskTitle(taskData, locale) }), taskDescription(taskData, locale) && /*#__PURE__*/ _jsx("p", { className: "text-gray-500 text-xs mt-1 line-clamp-2", children: taskDescription(taskData, locale) }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-4 mt-2", children: [ taskData.budget && /*#__PURE__*/ _jsxs("span", { className: "text-xs text-gray-500", children: [ "\uD83D\uDCB0 ", t('task.budget'), ": ", /*#__PURE__*/ _jsxs("strong", { className: "text-gray-900", children: [ formatPrice(taskData.budget), "€" ] }) ] }), taskData.budgetNegotiable && !taskData.budget && /*#__PURE__*/ _jsxs("span", { className: "text-xs text-gray-500", children: [ "\uD83D\uDCAC ", t('task.budget_negotiable') ] }), taskData.location && /*#__PURE__*/ _jsxs("span", { className: "text-xs text-gray-500", children: [ "\uD83D\uDCCD ", (_locMap_taskData_location = locMap[taskData.location]) !== null && _locMap_taskData_location !== void 0 ? _locMap_taskData_location : taskData.location ] }) ] }) ] }), /*#__PURE__*/ _jsxs("form", { onSubmit: handleSubmit, className: "bg-white rounded-2xl border border-gray-100 p-6 shadow-sm space-y-5", children: [ error && /*#__PURE__*/ _jsx("div", { className: "bg-red-50 text-red-700 p-3 rounded-lg text-sm", children: error }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("label", { className: "block text-sm font-medium text-gray-700 mb-1.5", children: [ t('offer.price'), " (€) ", /*#__PURE__*/ _jsx("span", { className: "text-red-500", children: "*" }) ] }), /*#__PURE__*/ _jsxs("div", { className: "relative", children: [ /*#__PURE__*/ _jsx("span", { className: "absolute left-3 top-1/2 -translate-y-1/2 text-gray-400 font-medium select-none", children: "€" }), /*#__PURE__*/ _jsx("input", { name: "price", type: "number", required: true, min: 1, step: 1, placeholder: t('offer.price.placeholder'), className: "w-full border border-gray-200 rounded-xl pl-8 pr-3 py-3 focus:outline-none focus:ring-2 focus:ring-blue-400 text-xl font-bold text-gray-900" }) ] }), (taskData === null || taskData === void 0 ? void 0 : taskData.budget) && /*#__PURE__*/ _jsxs("p", { className: "text-xs text-gray-400 mt-1.5", children: [ t('offer.customer_budget'), ": ", /*#__PURE__*/ _jsxs("strong", { children: [ formatPrice(taskData.budget), "€" ] }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("label", { className: "block text-sm font-medium text-gray-700 mb-1.5", children: [ t('offer.message'), /*#__PURE__*/ _jsxs("span", { className: "text-gray-400 font-normal ml-1", children: [ "(", t('offer.optional'), ")" ] }) ] }), /*#__PURE__*/ _jsx("textarea", { name: "message", rows: 5, maxLength: 2000, placeholder: t('offer.message.placeholder'), className: "w-full border border-gray-200 rounded-xl px-3 py-2.5 focus:outline-none focus:ring-2 focus:ring-blue-400 resize-none text-sm text-gray-700" }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-3 pt-1", children: [ /*#__PURE__*/ _jsx("button", { type: "submit", disabled: submitting, className: "flex-1 bg-green-600 text-white py-3 rounded-xl font-semibold hover:bg-green-700 disabled:opacity-50 disabled:cursor-not-allowed transition", children: submitting ? t('offer.submitting') : t('task.offer.btn') }), /*#__PURE__*/ _jsx(Link, { href: "/tasks/".concat(id), className: "px-5 py-3 rounded-xl border border-gray-200 text-gray-600 hover:bg-gray-50 font-medium text-sm flex items-center transition", children: t('common.cancel') }) ] }) ] }) ] }); } `ÖÿÿÖÿÿ  ÖÿÿDÔÿÿeÕÿÿ“Öÿÿþ¢Öÿÿ £Öÿÿ€Öÿÿ¥ÖÿÿŠÖÿÿe9696e098f1dc5afªÖÿÿBÔÿÿ  «Öÿÿ æÖÿÿMakeOfferPage •mÿyBZÕÿÿaÕÿÿ `  dÿÿý€ a=| b=|€ `}@© `,€ Aªá `7€ Aâÿ `€ A( `(€ A)V `-€ AW– `?€ A—Ä `-€ AÅ `K A Á3 AÁ3 @þ `@žÖÿÿžÖÿÿ b=|DÔÿÿDÔÿÿ `,ëÖÿÿëÖÿÿ `7ìÖÿÿìÖÿÿ `íÖÿÿíÖÿÿ `(îÖÿÿîÖÿÿ `-ïÖÿÿïÖÿÿ `?ðÖÿÿðÖÿÿ `- ÙÿÿÙÿÿ `KÛòÖÿÿ @þ ‰useParamsþ ANW   íÖÿÿÞÖÿÿÞÖÿÿý c   îÖÿÿíÖÿÿ Anw  ûÚÖÿÿÚÖÿÿþ c   õÖÿÿôÖÿÿ A€®  ÷ÚÖÿÿÚÖÿÿþ c ) 3 öÖÿÿõÖÿÿ AÌÕ  óØÖÿÿØÖÿÿþ c# †Öÿÿ…Öÿÿ Aõý  ï&Ôÿÿ&Ôÿÿþ c$ ‚ÖÿÿÖÿÿ A'/  ë"Ôÿÿ"Ôÿÿþ c"* ~Öÿÿ}Öÿÿ AYa  çÔÿÿÔÿÿþ c"* zÖÿÿyÖÿÿ A—  ãÔÿÿÔÿÿþ c(0 vÖÿÿuÖÿÿ AŸÆ  ßÔÿÿÔÿÿþ c& xÖÿÿwÖÿÿ Aü  ÛÔÿÿÔÿÿþ c   tÖÿÿsÖÿÿ Aˆ  ×ÔÿÿÔÿÿþ c&&  ‡getTaskþ A°·  Ò¹Öÿÿ¹Öÿÿþ c(( ŒgetLocationsþ A- 9   ÍŽÖÿÿŽÖÿÿþ c)) ‹createOfferþ AN Y   ȯÖÿÿ¯Öÿÿþ c33 fÖÿÿgÖÿÿ Aõ ù   ÄTÖÿÿTÖÿÿþ c@@! ‰shortNameþ AÊ Ó   ¿šÖÿÿšÖÿÿþ cH_Hh 9×ÿÿ:×ÿÿ A8=  »KÖÿÿKÖÿÿþ cJJ 5×ÿÿ6×ÿÿ A§¬  ·GÖÿÿGÖÿÿþ cMM £Öÿÿš×ÿÿ A­± 4³”Öÿÿ”Öÿÿþ cM M$ QÖÿÿRÖÿÿ A•™  ¯?Öÿÿ?Öÿÿþ cQ"Q& MÖÿÿNÖÿÿ A­±  «;Öÿÿ;Öÿÿþ cW0W4 IÖÿÿJÖÿÿ A‰  §7Öÿÿ7Öÿÿþ c`` !×ÿÿ"×ÿÿ A?D  £3Öÿÿ3Öÿÿþ cd*d/ ×ÿÿ×ÿÿ AIN  Ÿ/Öÿÿ/Öÿÿþ cl&l+ =Öÿÿ>Öÿÿ Aòö  ›+Öÿÿ+Öÿÿþ co"o& šÙÿÿ§Ùÿÿ Aw€  — ¯Øÿÿ¯Øÿÿþ cq"q+ taskDescriptionþ A¿Î  ’ ªØÿÿªØÿÿþ css# 0Öÿÿ1Öÿÿ Aòö  ŽÖÿÿÖÿÿþ csGsK ÷ö An}  Š ¢Øÿÿ¢Øÿÿþ cu"u1 ×ÿÿ×ÿÿ AÊÏ  †ÖÿÿÖÿÿþ cw"w' ×ÿÿ×ÿÿ A}‚  ‚ÖÿÿÖÿÿþ cz=zB üÖÿÿýÖÿÿ AÄÉ  ~ÿÿÿÖÿÿÖÿÿþ @€`2@€`7 ¬Ùÿÿ«Ùÿÿ Az…  zÿÿÿ ’Øÿÿ’Øÿÿþ @ƒ`,@ƒ`7 ôÖÿÿõÖÿÿ A¶»  vÿÿÿÖÿÿÖÿÿþ @‰`[@‰`` ðÖÿÿñÖÿÿ A,1  rÿÿÿÖÿÿÖÿÿþ @`?@`D ìÖÿÿíÖÿÿ ALQ  nÿÿÿþÕÿÿþÕÿÿþ @›`@›`  Öÿÿ Öÿÿ A-1  jÿÿÿúÕÿÿúÕÿÿþ @Ÿ`+@Ÿ`/ äÖÿÿåÖÿÿ Añö  fÿÿÿöÕÿÿöÕÿÿþ @£`"@£`' àÖÿÿáÖÿÿ AN S   bÿÿÿòÕÿÿòÕÿÿþ @¥`*@¥`/ ÖÿÿÖÿÿ A}!!  ^ÿÿÿîÕÿÿîÕÿÿþ @ª`2@ª`6 ØÖÿÿÙÖÿÿ A˜""  ZÿÿÿêÕÿÿêÕÿÿþ @°`*@°`/ øÕÿÿùÕÿÿ A<#@#  VÿÿÿæÕÿÿæÕÿÿþ @³`2@³`6 ôÕÿÿõÕÿÿ A`$d$  RÿÿÿâÕÿÿâÕÿÿþ @·`2@·`6 ÌÖÿÿÍÖÿÿ Ah'm'  NÿÿÿÞÕÿÿÞÕÿÿþ @Â`s@Â`x ÈÖÿÿÉÖÿÿ Aˆ((  JÿÿÿÚÕÿÿÚÕÿÿþ @Ç`2@Ç`7 xÙÿÿwÙÿÿ Aú()  Fÿÿÿ ^Øÿÿ^Øÿÿþ @É`,@É`7 ÀÖÿÿÁÖÿÿ A.*3*  BÿÿÿÒÕÿÿÒÕÿÿþ @Ñ`"@Ñ`' ŒÖÿÿœÖÿÿ A‹**  >ÿÿÿÎÕÿÿÎÕÿÿþ @Ó`*@Ó`/ žÖÿÿ¹Öÿÿ A+”+  :ÿÿÿÊÕÿÿÊÕÿÿþ @×`2@×`7 ØÕÿÿÙÕÿÿ A‡-‹-  6ÿÿÿÆÕÿÿÆÕÿÿþ @á`*@á`. °Öÿÿ±Öÿÿ A/¢/  2ÿÿÿÂÕÿÿÂÕÿÿþ @ê`"@ê`' ÐÕÿÿÑÕÿÿ A0040  .ÿÿÿŸÕÿÿŸÕÿÿþ @í`*@í`. ÌÕÿÿÍÕÿÿ A 22  *ÿÿÿºÕÿÿºÕÿÿþ @ó`*@ó`.sÿÿÿ×ÿÿ A22 4'ÿÿÿÖÿÿÖÿÿþ @ó`/@ó`3   Z|/* __next_internal_client_entry_do_not_use__ default auto */ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime"; import { useState, useEffect } from 'react'; import Link from 'next/link'; import { useRouter } from 'next/navigation'; import { useSession } from '@/lib/auth'; import { useLocale } from '@/context/locale'; import { getOffers, acceptOffer, declineOffer, completeTask, createReview, getMyOffers, getTaskReviews, getTaskInvite, dismissNotification, getOrCreateDirectRoom, updateTask, getTaskStats, runAutoMatch, getMyDashboard } from '@/lib/api'; import { taskTitle, taskDescription, formatPrice } from '@/lib/taskLocale'; import { shortName } from '@/lib/formatName'; import { PlanBadge } from '@/components/PlanBadge'; const statusColors = { open: 'bg-green-100 text-green-700', in_progress: 'bg-green-100 text-green-700', completed: 'bg-gray-100 text-gray-700', cancelled: 'bg-red-100 text-red-700', draft: 'bg-yellow-100 text-yellow-700' }; export default function TaskDetailClient(param) { let { taskId, initialTask, initialCustomer, catMap = {}, locMap = {} } = param; var _session_user, _acceptedOffer_specialist; const { data: session } = useSession(); const { t, locale } = useLocale(); const router = useRouter(); const [task, setTask] = useState(initialTask); const [customer] = useState(initialCustomer); const [offers, setOffers] = useState([]); const [offersLoaded, setOffersLoaded] = useState(false); const [myOffer, setMyOffer] = useState(null); const [myOfferLoaded, setMyOfferLoaded] = useState(false); const [myReview, setMyReview] = useState(null); const [myReviewLoaded, setMyReviewLoaded] = useState(false); const [reviewTargetId, setReviewTargetId] = useState(null); const [reviewRating, setReviewRating] = useState(5); const [reviewComment, setReviewComment] = useState(''); const [reviewSubmitting, setReviewSubmitting] = useState(false); const [reviewDone, setReviewDone] = useState(false); const [invite, setInvite] = useState(null); const [inviteLoaded, setInviteLoaded] = useState(false); const [inviteDeclining, setInviteDeclining] = useState(false); const [msgLoading, setMsgLoading] = useState(false); const [lightboxIndex, setLightboxIndex] = useState(null); // FOMO stats + auto-match const [taskStats, setTaskStats] = useState(null); const [autoMatchResults, setAutoMatchResults] = useState(null); const [autoMatchLoading, setAutoMatchLoading] = useState(false); const [hasAutoMatch, setHasAutoMatch] = useState(false); // Edit task state const [editing, setEditing] = useState(false); const [editSaving, setEditSaving] = useState(false); const [editForm, setEditForm] = useState(null); // Keyboard navigation for lightbox useEffect(()=>{ const handler = (e)=>{ if (e.key === 'Escape') setLightboxIndex(null); if (e.key === 'ArrowLeft') setLightboxIndex((prev)=>prev !== null && prev > 0 ? prev - 1 : prev); if (e.key === 'ArrowRight') setLightboxIndex((prev)=>{ if (prev === null) return prev; const imgs = task.images; return imgs && prev < imgs.length - 1 ? prev + 1 : prev; }); }; window.addEventListener('keydown', handler); return ()=>window.removeEventListener('keydown', handler); }, [ task.images ]); const dateLocale = locale === 'ru' ? 'ru-RU' : locale === 'uk' ? 'uk-UA' : locale === 'en' ? 'en-US' : 'el-GR'; const currentUserId = session === null || session === void 0 ? void 0 : (_session_user = session.user) === null || _session_user === void 0 ? void 0 : _session_user.id; const isOwner = currentUserId === task.customerId; const loginRedirectHref = "/login?redirect=".concat(encodeURIComponent("/tasks/".concat(taskId))); // Load offers if owner useEffect(()=>{ if (!isOwner || offersLoaded) return; getOffers(taskId).then((data)=>{ setOffers(data); setOffersLoaded(true); }).catch(()=>setOffersLoaded(true)); }, [ isOwner, taskId, offersLoaded ]); // Load task stats + dashboard features for owner useEffect(()=>{ if (!isOwner) return; getTaskStats(taskId).then(setTaskStats).catch(()=>{}); getMyDashboard().then((d)=>{ var _d_features; return setHasAutoMatch(!!((_d_features = d.features) === null || _d_features === void 0 ? void 0 : _d_features.hasAutoMatch)); }).catch(()=>{}); }, [ isOwner, taskId ]); // Load specialist's own offer useEffect(()=>{ if (!currentUserId || isOwner || myOfferLoaded) return; getMyOffers().then((rows)=>{ const found = rows.find((r)=>{ var _r_task; return ((_r_task = r.task) === null || _r_task === void 0 ? void 0 : _r_task.id) === taskId; }); var _found_offer; setMyOffer((_found_offer = found === null || found === void 0 ? void 0 : found.offer) !== null && _found_offer !== void 0 ? _found_offer : null); setMyOfferLoaded(true); }).catch(()=>setMyOfferLoaded(true)); }, [ currentUserId, isOwner, taskId, myOfferLoaded ]); // Load task invite for specialist useEffect(()=>{ if (!currentUserId || isOwner || inviteLoaded) return; getTaskInvite(taskId).then((rows)=>{ var _rows_; setInvite((_rows_ = rows[0]) !== null && _rows_ !== void 0 ? _rows_ : null); setInviteLoaded(true); }).catch(()=>setInviteLoaded(true)); }, [ currentUserId, isOwner, taskId, inviteLoaded ]); // Load review for specialist when task completed useEffect(()=>{ if (!currentUserId || isOwner || myReviewLoaded || task.status !== 'completed') return; getTaskReviews(taskId).then((rows)=>{ const found = rows.find((r)=>r.targetId === currentUserId); setMyReview(found !== null && found !== void 0 ? found : null); setMyReviewLoaded(true); }).catch(()=>setMyReviewLoaded(true)); }, [ currentUserId, isOwner, taskId, task.status, myReviewLoaded ]); async function handleAccept(offerId) { const updated = await acceptOffer(offerId).catch(()=>null); if (updated) { setOffers((prev)=>prev.map((r)=>r.offer.id === offerId ? { ...r, offer: updated } : r)); setTask((t)=>({ ...t, status: 'in_progress' })); } } async function handleDecline(offerId) { const updated = await declineOffer(offerId).catch(()=>null); if (updated) { setOffers((prev)=>prev.map((r)=>r.offer.id === offerId ? { ...r, offer: updated } : r)); } } async function handleComplete() { if (!window.confirm(t('task.complete.confirm'))) return; const updated = await completeTask(taskId).catch(()=>null); if (updated) setTask((t)=>({ ...t, status: 'completed' })); } async function handleReview(e) { e.preventDefault(); if (!reviewTargetId) return; setReviewSubmitting(true); const ok = await createReview({ taskId, targetId: reviewTargetId, rating: reviewRating, comment: reviewComment || undefined }).catch(()=>null); setReviewSubmitting(false); if (ok) { setReviewDone(true); setReviewTargetId(null); } } async function handleMessage(otherUserId) { setMsgLoading(true); try { const { room } = await getOrCreateDirectRoom(otherUserId); router.push("/chat?room=".concat(room.id)); } catch (e) {} setMsgLoading(false); } function handleEditOpen() { var _task_budgetNegotiable, _task_category, _task_location, _task_district, _task_street, _task_houseNumber, _task_timeSlot, _task_confidentialNote; setEditForm({ title: task.title, description: task.description, budget: task.budget ? Number(task.budget) : '', budgetNegotiable: (_task_budgetNegotiable = task.budgetNegotiable) !== null && _task_budgetNegotiable !== void 0 ? _task_budgetNegotiable : false, category: (_task_category = task.category) !== null && _task_category !== void 0 ? _task_category : '', location: (_task_location = task.location) !== null && _task_location !== void 0 ? _task_location : '', district: (_task_district = task.district) !== null && _task_district !== void 0 ? _task_district : '', street: (_task_street = task.street) !== null && _task_street !== void 0 ? _task_street : '', houseNumber: (_task_houseNumber = task.houseNumber) !== null && _task_houseNumber !== void 0 ? _task_houseNumber : '', timeSlot: (_task_timeSlot = task.timeSlot) !== null && _task_timeSlot !== void 0 ? _task_timeSlot : '', confidentialNote: (_task_confidentialNote = task.confidentialNote) !== null && _task_confidentialNote !== void 0 ? _task_confidentialNote : '', deadline: task.deadline ? new Date(task.deadline).toISOString().slice(0, 10) : '', expiresAt: task.expiresAt ? new Date(task.expiresAt).toISOString().slice(0, 10) : '', status: task.status === 'draft' ? 'draft' : 'open' }); setEditing(true); } async function handleEditSave(e) { e.preventDefault(); if (!editForm) return; setEditSaving(true); try { const payload = { title: editForm.title, description: editForm.description, budgetNegotiable: editForm.budgetNegotiable, status: editForm.status }; if (editForm.budget !== '' && editForm.budget > 0) payload.budget = Number(editForm.budget); if (editForm.category) payload.category = editForm.category; if (editForm.location) payload.location = editForm.location; if (editForm.district) payload.district = editForm.district; if (editForm.street) payload.street = editForm.street; if (editForm.houseNumber) payload.houseNumber = editForm.houseNumber; if (editForm.timeSlot) payload.timeSlot = editForm.timeSlot; if (editForm.confidentialNote !== undefined) payload.confidentialNote = editForm.confidentialNote; if (editForm.deadline) payload.deadline = new Date(editForm.deadline).toISOString(); if (editForm.expiresAt) payload.expiresAt = new Date(editForm.expiresAt).toISOString(); const updated = await updateTask(taskId, payload); setTask((prev)=>({ ...prev, ...updated })); setEditing(false); } catch (err) { alert((err === null || err === void 0 ? void 0 : err.message) || t('common.error')); } finally{ setEditSaving(false); } } const acceptedOffer = offers.find((r)=>r.offer.status === 'accepted'); var _catMap_task_category, _locMap_task_location; return /*#__PURE__*/ _jsxs("div", { className: "max-w-4xl mx-auto px-4 py-8", children: [ /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6 mb-6", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex justify-between items-start gap-4 mb-4", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [ /*#__PURE__*/ _jsx("span", { className: "text-xs font-medium px-2 py-1 rounded-full ".concat(statusColors[task.status]), children: t("task.status.".concat(task.status), task.status) }), task.category && /*#__PURE__*/ _jsx("span", { className: "text-xs font-medium text-green-600 bg-green-50 px-2 py-1 rounded-full", children: (_catMap_task_category = catMap[task.category]) !== null && _catMap_task_category !== void 0 ? _catMap_task_category : task.category }), isOwner && /*#__PURE__*/ _jsx("span", { className: "text-xs text-gray-400 bg-gray-100 px-2 py-1 rounded-full", children: t('task.yours') }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 shrink-0", children: [ isOwner && (task.status === 'draft' || task.status === 'open') && /*#__PURE__*/ _jsxs("button", { onClick: handleEditOpen, className: "flex items-center gap-1.5 text-xs font-medium text-green-600 bg-green-50 hover:bg-green-100 px-3 py-1.5 rounded-lg transition", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M16.862 4.487l1.687-1.688a1.875 1.875 0 112.652 2.652L10.582 16.07a4.5 4.5 0 01-1.897 1.13L6 18l.8-2.685a4.5 4.5 0 011.13-1.897l8.932-8.931zm0 0L19.5 7.125" }) }), t('task.edit') ] }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-400", children: new Date(task.createdAt).toLocaleDateString(dateLocale) }) ] }) ] }), /*#__PURE__*/ _jsx("h1", { className: "text-2xl font-bold text-gray-900 mb-4", children: taskTitle(task, locale) }), /*#__PURE__*/ _jsx("p", { className: "text-gray-700 whitespace-pre-wrap mb-6", children: taskDescription(task, locale) }), /*#__PURE__*/ _jsxs("div", { className: "grid grid-cols-2 md:grid-cols-4 gap-4 p-4 bg-gray-50 rounded-lg", children: [ task.budget && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-500", children: t('task.budget') }), /*#__PURE__*/ _jsxs("p", { className: "font-bold text-green-600 text-lg", children: [ task.budget, "€" ] }), task.budgetNegotiable && /*#__PURE__*/ _jsx("p", { className: "text-xs text-green-600 mt-0.5", children: t('task.budget_negotiable') }) ] }), !task.budget && task.budgetNegotiable && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-500", children: t('task.budget') }), /*#__PURE__*/ _jsx("p", { className: "font-medium text-green-600", children: t('task.budget_negotiable') }) ] }), task.location && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-500", children: t('task.location') }), /*#__PURE__*/ _jsxs("p", { className: "font-medium", children: [ "\uD83D\uDCCD ", (_locMap_task_location = locMap[task.location]) !== null && _locMap_task_location !== void 0 ? _locMap_task_location : task.location ] }) ] }), task.deadline && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-500", children: t('task.deadline') }), /*#__PURE__*/ _jsx("p", { className: "font-medium", children: new Date(task.deadline).toLocaleDateString(dateLocale) }), task.timeSlot && task.timeSlot !== '' && /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-500 mt-0.5", children: t("create.field.time_slot.".concat(task.timeSlot), task.timeSlot) }) ] }), !task.deadline && task.timeSlot && task.timeSlot !== '' && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-500", children: t('task.time_slot') }), /*#__PURE__*/ _jsx("p", { className: "font-medium", children: t("create.field.time_slot.".concat(task.timeSlot), task.timeSlot) }) ] }), task.expiresAt && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-500", children: t('task.expires_at') }), /*#__PURE__*/ _jsx("p", { className: "font-medium", children: new Date(task.expiresAt).toLocaleDateString(dateLocale) }) ] }), customer && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-500", children: t('task.customer') }), /*#__PURE__*/ _jsxs(Link, { href: "/users/".concat(customer.id), className: "flex items-center gap-2 mt-1 group", children: [ /*#__PURE__*/ _jsx("div", { className: "w-8 h-8 rounded-full overflow-hidden bg-green-100 shrink-0 flex items-center justify-center", children: customer.image ? /*#__PURE__*/ _jsx("img", { src: customer.image, alt: shortName(customer.name), className: "w-full h-full object-cover" }) : /*#__PURE__*/ _jsx("span", { className: "text-green-600 font-semibold text-xs", children: shortName(customer.name).charAt(0).toUpperCase() }) }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "font-medium text-gray-900 group-hover:text-green-600 leading-none", children: shortName(customer.name) }), customer.rating && /*#__PURE__*/ _jsxs("p", { className: "text-xs text-yellow-500 leading-none mt-0.5", children: [ "★ ", Number(customer.rating).toFixed(1) ] }) ] }) ] }) ] }) ] }), task.images && task.images.length > 0 && /*#__PURE__*/ _jsx("div", { className: "mt-4", children: /*#__PURE__*/ _jsx("div", { className: "flex flex-wrap gap-2", children: task.images.map((url, i)=>/*#__PURE__*/ _jsx("button", { onClick: ()=>setLightboxIndex(i), className: "block w-24 h-24 rounded-lg overflow-hidden border border-gray-200 hover:opacity-90 hover:border-green-300 transition", children: /*#__PURE__*/ _jsx("img", { src: url, alt: "", className: "w-full h-full object-cover" }) }, i)) }) }), lightboxIndex !== null && task.images && /*#__PURE__*/ _jsx("div", { className: "fixed inset-0 z-50 flex items-center justify-center bg-black/85", onClick: ()=>setLightboxIndex(null), children: /*#__PURE__*/ _jsxs("div", { className: "relative max-w-4xl w-full mx-4", onClick: (e)=>e.stopPropagation(), children: [ /*#__PURE__*/ _jsx("img", { src: task.images[lightboxIndex], alt: "", className: "w-full max-h-[80vh] object-contain rounded-lg" }), /*#__PURE__*/ _jsx("button", { onClick: ()=>setLightboxIndex(null), className: "absolute -top-10 right-0 text-white/80 hover:text-white p-2", children: /*#__PURE__*/ _jsx("svg", { className: "w-6 h-6", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" }) }) }), lightboxIndex > 0 && /*#__PURE__*/ _jsx("button", { onClick: ()=>setLightboxIndex(lightboxIndex - 1), className: "absolute left-0 top-1/2 -translate-y-1/2 -translate-x-12 text-white/80 hover:text-white p-2", children: /*#__PURE__*/ _jsx("svg", { className: "w-8 h-8", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 19l-7-7 7-7" }) }) }), lightboxIndex < task.images.length - 1 && /*#__PURE__*/ _jsx("button", { onClick: ()=>setLightboxIndex(lightboxIndex + 1), className: "absolute right-0 top-1/2 -translate-y-1/2 translate-x-12 text-white/80 hover:text-white p-2", children: /*#__PURE__*/ _jsx("svg", { className: "w-8 h-8", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 5l7 7-7 7" }) }) }), task.images.length > 1 && /*#__PURE__*/ _jsxs("p", { className: "text-white/60 text-sm text-center mt-3", children: [ lightboxIndex + 1, " / ", task.images.length ] }) ] }) }), (isOwner || (myOffer === null || myOffer === void 0 ? void 0 : myOffer.status) === 'accepted') && (task.district || task.street || task.confidentialNote) && /*#__PURE__*/ _jsxs("div", { className: "mt-4 p-3 bg-yellow-50 border border-yellow-200 rounded-lg space-y-2", children: [ /*#__PURE__*/ _jsxs("p", { className: "text-xs font-medium text-yellow-700 flex items-center gap-1", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z" }) }), t('task.confidential') ] }), (task.district || task.street) && /*#__PURE__*/ _jsxs("p", { className: "text-sm text-yellow-800", children: [ "\uD83D\uDCCD ", [ task.district, task.street, task.houseNumber ].filter(Boolean).join(', ') ] }), task.confidentialNote && /*#__PURE__*/ _jsx("p", { className: "text-sm text-yellow-800", children: task.confidentialNote }) ] }), /*#__PURE__*/ _jsxs("div", { className: "mt-6 flex flex-wrap gap-3", children: [ !session && !isOwner && task.status === 'open' && /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx(Link, { href: loginRedirectHref, className: "bg-green-600 text-white px-6 py-3 rounded-xl font-semibold hover:bg-green-700", children: t('task.make_offer', 'Send offer') }), /*#__PURE__*/ _jsxs(Link, { href: loginRedirectHref, className: "flex items-center gap-2 bg-green-50 text-green-600 border border-green-200 px-4 py-2.5 rounded-xl font-medium hover:bg-green-100", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }), t('chat.write_customer', 'Write to customer') ] }) ] }), isOwner && task.status === 'in_progress' && /*#__PURE__*/ _jsx("button", { onClick: handleComplete, className: "bg-green-600 text-white px-6 py-3 rounded-xl font-semibold hover:bg-green-700", children: t('task.complete') }), isOwner && (acceptedOffer === null || acceptedOffer === void 0 ? void 0 : (_acceptedOffer_specialist = acceptedOffer.specialist) === null || _acceptedOffer_specialist === void 0 ? void 0 : _acceptedOffer_specialist.id) && /*#__PURE__*/ _jsxs("button", { onClick: ()=>handleMessage(acceptedOffer.specialist.id), disabled: msgLoading, className: "flex items-center gap-2 bg-green-50 text-green-600 border border-green-200 px-4 py-2.5 rounded-xl font-medium hover:bg-green-100 disabled:opacity-50", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }), t('chat.write_specialist') ] }), isOwner && task.status === 'completed' && acceptedOffer && !reviewDone && /*#__PURE__*/ _jsx("button", { onClick: ()=>{ var _acceptedOffer_specialist; var _acceptedOffer_specialist_id; return setReviewTargetId((_acceptedOffer_specialist_id = (_acceptedOffer_specialist = acceptedOffer.specialist) === null || _acceptedOffer_specialist === void 0 ? void 0 : _acceptedOffer_specialist.id) !== null && _acceptedOffer_specialist_id !== void 0 ? _acceptedOffer_specialist_id : null); }, className: "bg-yellow-500 text-white px-6 py-3 rounded-xl font-semibold hover:bg-yellow-600", children: t('review.leave') }), reviewDone && /*#__PURE__*/ _jsx("span", { className: "text-green-600 font-medium py-3", children: t('review.done') }) ] }), reviewTargetId && /*#__PURE__*/ _jsxs("form", { onSubmit: handleReview, className: "mt-6 border-t border-gray-100 pt-6 space-y-4", children: [ /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-gray-800", children: t('review.leave') }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "text-sm font-medium text-gray-700 mb-2", children: t('review.rating') }), /*#__PURE__*/ _jsx("div", { className: "flex gap-1", children: [ 1, 2, 3, 4, 5 ].map((star)=>/*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setReviewRating(star), className: "text-2xl transition ".concat(star <= reviewRating ? 'text-yellow-400' : 'text-gray-300'), children: "★" }, star)) }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('review.comment') }), /*#__PURE__*/ _jsx("textarea", { value: reviewComment, onChange: (e)=>setReviewComment(e.target.value), rows: 3, maxLength: 2000, placeholder: t('review.comment.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" }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-3", children: [ /*#__PURE__*/ _jsx("button", { type: "submit", disabled: reviewSubmitting, className: "bg-green-600 text-white px-5 py-2 rounded-xl font-semibold hover:bg-green-700 disabled:opacity-50", children: reviewSubmitting ? t('review.submitting') : t('review.submit') }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setReviewTargetId(null), className: "px-5 py-2 rounded-xl border border-gray-200 text-gray-600 hover:bg-gray-50", children: t('common.cancel') }) ] }) ] }) ] }), isOwner && /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between mb-4 flex-wrap gap-2", children: [ /*#__PURE__*/ _jsxs("h2", { className: "text-lg font-bold text-gray-900", children: [ t('task.offers'), " (", offers.length, ")" ] }), taskStats && /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 text-xs text-gray-500", children: [ taskStats.totalViews > 0 && /*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-1", children: [ /*#__PURE__*/ _jsxs("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: [ /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 12a3 3 0 11-6 0 3 3 0 016 0z" }), /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z" }) ] }), taskStats.totalViews ] }), taskStats.offerCount > 0 && /*#__PURE__*/ _jsxs("span", { className: "font-medium text-green-600", children: [ "⚡ ", taskStats.offerCount, " ", t('task.offers').toLowerCase() ] }) ] }), hasAutoMatch && task.status === 'open' && /*#__PURE__*/ _jsxs("button", { onClick: async ()=>{ setAutoMatchLoading(true); try { const res = await runAutoMatch(taskId); var _res_matches; setAutoMatchResults((_res_matches = res.matches) !== null && _res_matches !== void 0 ? _res_matches : []); } catch (e) {} finally{ setAutoMatchLoading(false); } }, disabled: autoMatchLoading, className: "flex items-center gap-1.5 text-xs font-medium bg-purple-50 text-purple-700 border border-purple-200 px-3 py-1.5 rounded-lg hover:bg-purple-100 transition disabled:opacity-50", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M13 10V3L4 14h7v7l9-11h-7z" }) }), autoMatchLoading ? t('common.loading') : t('task.auto_match', 'Auto match') ] }) ] }), autoMatchResults && autoMatchResults.length > 0 && /*#__PURE__*/ _jsxs("div", { className: "mb-4 p-3 bg-purple-50 rounded-xl border border-purple-100", children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs font-medium text-purple-700 mb-2", children: t('task.auto_match_results', 'Top specialists') }), /*#__PURE__*/ _jsx("div", { className: "space-y-2", children: autoMatchResults.slice(0, 5).map((s)=>{ var _s_name_, _s_name; var _s_firstName; return /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between gap-2", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2", children: [ /*#__PURE__*/ _jsx("div", { className: "w-7 h-7 rounded-full bg-purple-100 flex items-center justify-center text-purple-700 text-xs font-bold overflow-hidden", children: s.image ? /*#__PURE__*/ _jsx("img", { src: s.image, alt: "", className: "w-full h-full object-cover" }) : (_s_name = s.name) === null || _s_name === void 0 ? void 0 : (_s_name_ = _s_name[0]) === null || _s_name_ === void 0 ? void 0 : _s_name_.toUpperCase() }), /*#__PURE__*/ _jsx("span", { className: "text-sm text-gray-800", children: (_s_firstName = s.firstName) !== null && _s_firstName !== void 0 ? _s_firstName : s.name }), s.rating && /*#__PURE__*/ _jsxs("span", { className: "text-xs text-yellow-500", children: [ "★", Number(s.rating).toFixed(1) ] }) ] }), /*#__PURE__*/ _jsx("button", { onClick: ()=>handleMessage(s.id), className: "text-xs text-green-600 hover:underline", children: t('chat.write_btn') }) ] }, s.id); }) }) ] }), !offersLoaded ? /*#__PURE__*/ _jsx("p", { className: "text-gray-400 text-sm", children: t('common.loading') }) : offers.length === 0 ? /*#__PURE__*/ _jsx("p", { className: "text-gray-500 text-sm", children: t('task.offers.none') }) : /*#__PURE__*/ _jsx("div", { className: "space-y-4", children: offers.map((row)=>{ var _specialist_name_, _specialist_name; const offer = row.offer; const specialist = row.specialist; var _specialist_name__toUpperCase; return /*#__PURE__*/ _jsxs("div", { className: "border border-gray-100 rounded-xl p-4", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex justify-between items-start gap-4", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-start gap-3", children: [ /*#__PURE__*/ _jsx("div", { className: "w-10 h-10 rounded-full bg-green-100 flex-shrink-0 flex items-center justify-center text-green-700 font-bold overflow-hidden", children: (specialist === null || specialist === void 0 ? void 0 : specialist.image) ? /*#__PURE__*/ _jsx("img", { src: specialist.image, alt: specialist.name, className: "w-full h-full object-cover" }) : (_specialist_name__toUpperCase = specialist === null || specialist === void 0 ? void 0 : (_specialist_name = specialist.name) === null || _specialist_name === void 0 ? void 0 : (_specialist_name_ = _specialist_name[0]) === null || _specialist_name_ === void 0 ? void 0 : _specialist_name_.toUpperCase()) !== null && _specialist_name__toUpperCase !== void 0 ? _specialist_name__toUpperCase : '?' }), /*#__PURE__*/ _jsxs("div", { children: [ specialist && /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-1.5", children: [ /*#__PURE__*/ _jsx(Link, { href: "/users/".concat(specialist.id), className: "font-medium text-gray-900 hover:text-green-600", children: shortName(specialist.name) }), specialist.planTier && specialist.planTier !== 'free' && /*#__PURE__*/ _jsx(PlanBadge, { tier: specialist.planTier }), specialist.hasVerifiedBadge && /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5 text-gray-500", viewBox: "0 0 24 24", fill: "currentColor", children: /*#__PURE__*/ _jsx("path", { d: "M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z" }) }) ] }), offer.message && /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-600 mt-1", children: offer.message }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "text-right shrink-0", children: [ /*#__PURE__*/ _jsxs("p", { className: "text-lg font-bold text-green-600", children: [ formatPrice(offer.price), "€" ] }), /*#__PURE__*/ _jsx("span", { className: "text-xs px-2 py-0.5 rounded-full ".concat(offer.status === 'accepted' ? 'bg-green-100 text-green-700' : offer.status === 'declined' ? 'bg-red-100 text-red-700' : 'bg-gray-100 text-gray-700'), children: t("offer.status.".concat(offer.status), offer.status) }) ] }) ] }), offer.status === 'pending' && task.status === 'open' && /*#__PURE__*/ _jsxs("div", { className: "flex gap-2 mt-3 pt-3 border-t border-gray-50", children: [ /*#__PURE__*/ _jsx("button", { onClick: ()=>handleAccept(offer.id), className: "flex-1 bg-green-600 text-white py-2 rounded-lg text-sm font-semibold hover:bg-green-700", children: t('offer.accept') }), /*#__PURE__*/ _jsx("button", { onClick: ()=>handleDecline(offer.id), className: "flex-1 bg-gray-100 text-gray-700 py-2 rounded-lg text-sm font-semibold hover:bg-gray-200", children: t('offer.decline') }) ] }) ] }, offer.id); }) }) ] }), !isOwner && session && invite && inviteLoaded && task.status === 'open' && !myOffer && /*#__PURE__*/ _jsx("div", { className: "rounded-xl border border-green-200 bg-green-50 p-5", children: /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between gap-4 flex-wrap gap-y-3", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3", children: [ /*#__PURE__*/ _jsx("div", { className: "w-10 h-10 rounded-full bg-green-100 flex items-center justify-center shrink-0", children: /*#__PURE__*/ _jsx("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", strokeWidth: 1.5, stroke: "currentColor", className: "w-5 h-5 text-green-600", children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M21.75 6.75v10.5a2.25 2.25 0 0 1-2.25 2.25h-15a2.25 2.25 0 0 1-2.25-2.25V6.75m19.5 0A2.25 2.25 0 0 0 19.5 4.5h-15a2.25 2.25 0 0 0-2.25 2.25m19.5 0v.243a2.25 2.25 0 0 1-1.07 1.916l-7.5 4.615a2.25 2.25 0 0 1-2.36 0L3.32 8.91a2.25 2.25 0 0 1-1.07-1.916V6.75" }) }) }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "font-semibold text-gray-900 text-sm", children: t('task.invite.banner_title') }), /*#__PURE__*/ _jsx("p", { className: "text-gray-500 text-sm mt-0.5", children: t('task.invite.banner_hint') }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-2 shrink-0", children: [ /*#__PURE__*/ _jsx(Link, { href: "/tasks/".concat(taskId, "/offer"), className: "bg-green-600 text-white px-4 py-2 rounded-lg text-sm font-semibold hover:bg-green-700 transition", children: t('task.invite.accept') }), /*#__PURE__*/ _jsx("button", { onClick: async ()=>{ if (!invite) return; setInviteDeclining(true); await dismissNotification(invite.id).catch(()=>{}); setInvite(null); setInviteDeclining(false); }, disabled: inviteDeclining, className: "border border-gray-300 bg-white text-gray-600 px-4 py-2 rounded-lg text-sm font-medium hover:bg-gray-50 disabled:opacity-50 transition", children: t('task.invite.decline') }) ] }) ] }) }), !isOwner && session && myOfferLoaded && /*#__PURE__*/ _jsxs("div", { className: "space-y-4", children: [ task.status === 'completed' && (myOffer === null || myOffer === void 0 ? void 0 : myOffer.status) === 'accepted' && /*#__PURE__*/ _jsxs("div", { className: "bg-green-50 border border-green-200 rounded-xl p-5 flex items-center gap-4", children: [ /*#__PURE__*/ _jsx("span", { className: "text-3xl", children: "\uD83C\uDF89" }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "font-bold text-green-800 text-lg", children: "ЗаЎаМОе завершеМП!" }), /*#__PURE__*/ _jsx("p", { className: "text-green-700 text-sm", children: "ЗаказчОк ПтЌетОл заЎаМОе как выпПлМеММПе." }) ] }), /*#__PURE__*/ _jsxs("button", { onClick: ()=>handleMessage(task.customerId), disabled: msgLoading, className: "ml-auto flex items-center gap-2 bg-white text-green-600 border border-green-200 px-4 py-2 rounded-xl text-sm font-medium hover:bg-green-50 disabled:opacity-50", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }), t('chat.write_customer') ] }) ] }), (myOffer || task.status === 'open' && !invite || task.status !== 'open') && /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ _jsx("h2", { className: "text-lg font-bold text-gray-900 mb-4", children: "МПё преЎлПжеМОе" }), myOffer ? /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-start justify-between gap-4", children: [ /*#__PURE__*/ _jsxs("div", { className: "space-y-1", children: [ myOffer.message && /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-600", children: myOffer.message }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400", children: new Date(myOffer.createdAt).toLocaleString(dateLocale) }) ] }), /*#__PURE__*/ _jsxs("div", { className: "text-right shrink-0", children: [ /*#__PURE__*/ _jsxs("p", { className: "text-xl font-bold text-green-600", children: [ formatPrice(myOffer.price), "€" ] }), /*#__PURE__*/ _jsx("span", { className: "text-xs px-2 py-0.5 rounded-full font-medium ".concat(myOffer.status === 'accepted' ? 'bg-green-100 text-green-700' : myOffer.status === 'declined' ? 'bg-red-100 text-red-700' : 'bg-yellow-100 text-yellow-700'), children: myOffer.status === 'accepted' ? '✓ ПрОМятП' : myOffer.status === 'declined' ? '✗ ОтклПМеМП' : '⏳ На рассЌПтреМОО' }) ] }) ] }), myOffer.status === 'accepted' && task.status === 'in_progress' && /*#__PURE__*/ _jsx("div", { className: "mt-3 pt-3 border-t border-gray-100", children: /*#__PURE__*/ _jsxs("button", { onClick: ()=>handleMessage(task.customerId), disabled: msgLoading, className: "flex items-center gap-2 bg-green-50 text-green-600 border border-green-200 px-4 py-2 rounded-xl text-sm font-medium hover:bg-green-100 disabled:opacity-50", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }), t('chat.write_customer') ] }) }) ] }) : task.status === 'open' && !invite ? /*#__PURE__*/ _jsxs("div", { className: "space-y-3", children: [ taskStats && taskStats.offerCount > 0 && /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 p-2.5 bg-amber-50 rounded-lg border border-amber-100", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-amber-500 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M13 10V3L4 14h7v7l9-11h-7z" }) }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-amber-700", children: t('fomo.already_offered', '\u0423\u0436\u0435 {n} \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0441\u0442\u043e\u0432 \u043e\u0442\u043a\u043b\u0438\u043a\u043d\u0443\u043b\u0438\u0441\u044c').replace('{n}', String(taskStats.offerCount)) }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between", children: [ /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-500", children: t('task.no_offer_yet', '\u0412\u044b \u0435\u0449\u0451 \u043d\u0435 \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u043b\u0438 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u0435') }), /*#__PURE__*/ _jsx(Link, { href: "/tasks/".concat(taskId, "/offer"), className: "bg-green-600 text-white px-4 py-2 rounded-lg text-sm font-semibold hover:bg-green-700", children: t('task.make_offer', '\u041e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u0435') }) ] }) ] }) : null ] }), task.status === 'completed' && (myOffer === null || myOffer === void 0 ? void 0 : myOffer.status) === 'accepted' && /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ _jsx("h2", { className: "text-lg font-bold text-gray-900 mb-4", children: "ОцеМка заказчОка" }), !myReviewLoaded ? /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-400", children: "Загрузка..." }) : myReview ? /*#__PURE__*/ _jsxs("div", { className: "space-y-3", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-1", children: [ [ 1, 2, 3, 4, 5 ].map((star)=>/*#__PURE__*/ _jsx("span", { className: "text-2xl ".concat(star <= myReview.rating ? 'text-yellow-400' : 'text-gray-200'), children: "★" }, star)), /*#__PURE__*/ _jsxs("span", { className: "ml-2 text-lg font-bold text-gray-800", children: [ myReview.rating, "/5" ] }) ] }), myReview.comment && /*#__PURE__*/ _jsx("p", { className: "text-gray-700 text-sm leading-relaxed", children: myReview.comment }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400", children: new Date(myReview.createdAt).toLocaleDateString(dateLocale) }) ] }) : /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-500", children: "ЗаказчОк ещё Ме ПставОл ПцеМку." }) ] }) ] }), editing && editForm && /*#__PURE__*/ _jsx("div", { className: "fixed inset-0 z-50 flex items-start justify-center bg-black/50 overflow-y-auto py-8 px-4", children: /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-2xl w-full max-w-2xl shadow-xl", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between px-6 py-4 border-b border-gray-100", children: [ /*#__PURE__*/ _jsx("h2", { className: "text-lg font-bold text-gray-900", children: t('task.edit') }), /*#__PURE__*/ _jsx("button", { onClick: ()=>setEditing(false), className: "text-gray-400 hover:text-gray-600 p-1", children: /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" }) }) }) ] }), /*#__PURE__*/ _jsxs("form", { onSubmit: handleEditSave, className: "p-6 space-y-4", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: [ t('create.field.title'), " *" ] }), /*#__PURE__*/ _jsx("input", { type: "text", required: true, minLength: 5, maxLength: 200, value: editForm.title, onChange: (e)=>setEditForm((p)=>({ ...p, title: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: [ t('create.field.description'), " *" ] }), /*#__PURE__*/ _jsx("textarea", { required: true, minLength: 20, value: editForm.description, onChange: (e)=>setEditForm((p)=>({ ...p, description: e.target.value })), rows: 4, 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" }) ] }), /*#__PURE__*/ _jsxs("div", { className: "grid grid-cols-2 gap-4", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('create.field.budget') }), /*#__PURE__*/ _jsx("input", { type: "number", min: 1, value: editForm.budget, onChange: (e)=>setEditForm((p)=>({ ...p, budget: e.target.value })), placeholder: "€", className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ _jsx("div", { className: "flex items-end pb-2", children: /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-2 cursor-pointer", children: [ /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: editForm.budgetNegotiable, onChange: (e)=>setEditForm((p)=>({ ...p, budgetNegotiable: e.target.checked })), className: "w-4 h-4 rounded text-green-600" }), /*#__PURE__*/ _jsx("span", { className: "text-sm text-gray-700", children: t('create.field.budget_negotiable') }) ] }) }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('create.field.deadline') }), /*#__PURE__*/ _jsx("input", { type: "date", value: editForm.deadline, onChange: (e)=>setEditForm((p)=>({ ...p, deadline: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('create.field.expires_at') }), /*#__PURE__*/ _jsx("input", { type: "date", value: editForm.expiresAt, onChange: (e)=>setEditForm((p)=>({ ...p, expiresAt: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ _jsxs("div", { className: "grid grid-cols-3 gap-3", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('create.field.address.district') }), /*#__PURE__*/ _jsx("input", { type: "text", value: editForm.district, onChange: (e)=>setEditForm((p)=>({ ...p, district: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('create.field.address.street') }), /*#__PURE__*/ _jsx("input", { type: "text", value: editForm.street, onChange: (e)=>setEditForm((p)=>({ ...p, street: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('create.field.address.house') }), /*#__PURE__*/ _jsx("input", { type: "text", value: editForm.houseNumber, onChange: (e)=>setEditForm((p)=>({ ...p, houseNumber: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('create.field.confidential') }), /*#__PURE__*/ _jsx("textarea", { value: editForm.confidentialNote, onChange: (e)=>setEditForm((p)=>({ ...p, confidentialNote: e.target.value })), rows: 2, 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" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('task.status_label', 'Status') }), /*#__PURE__*/ _jsxs("select", { value: editForm.status, onChange: (e)=>setEditForm((p)=>({ ...p, status: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400", children: [ /*#__PURE__*/ _jsx("option", { value: "open", children: t('task.status.open') }), /*#__PURE__*/ _jsx("option", { value: "draft", children: t('task.status.draft') }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-3 pt-2", children: [ /*#__PURE__*/ _jsx("button", { type: "submit", disabled: editSaving, className: "flex-1 bg-green-600 text-white py-2.5 rounded-xl font-semibold hover:bg-green-700 disabled:opacity-50 transition", children: editSaving ? t('common.saving', '...') : t('common.save') }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setEditing(false), className: "px-6 py-2.5 rounded-xl border border-gray-200 text-gray-600 hover:bg-gray-50 transition", children: t('common.cancel') }) ] }) ] }) ] }) }) ] }); } `Õÿÿ Õÿÿ  Õÿÿ5ÓÿÿTÔÿÿ„Õÿÿþ“Õÿÿ ”Õÿÿ•Õÿÿ–Õÿÿ—Õÿÿb1949299fa81c2b0›Õÿÿ3Óÿÿ  œÕÿÿ ŒstatusColorsÖÕÿÿTaskDetailClient •mÿyBvÔÿÿzÔÿÿ `  dÿÿý€ `=@“ a=@“€ A”À `,€ AÁÞ `€ Aß  `,€ A 4 `(€ A5b `-€ AcP @í€ AQœ `K€ AÊ `-€ AËþ `3 A°{ Aó°{ a@Õ @8ŒÕÿÿŒÕÿÿ a=@“2Óÿÿ2Óÿÿ `,ÛÕÿÿÛÕÿÿ `ØÕÿÿØÕÿÿ `,ÛÕÿÿÛÕÿÿ `(ÜÕÿÿÜÕÿÿ `-ÝÕÿÿÝÕÿÿ @í Øÿÿ Øÿÿ `K ÝÕÿÿÝÕÿÿ `-  Øÿÿ Øÿÿ `3ØßÕÿÿ a@Õ ìÕÿÿëÕÿÿ AÉÓ   ÛÕÿÿÐÕÿÿÐÕÿÿý c( ìÕÿÿëÕÿÿ Añú  ûÎÕÿÿÎÕÿÿþ c# ØÕÿÿ×Õÿÿ A  ÷ÄÕÿÿÄÕÿÿþ c xÕÿÿwÕÿÿ A:B  óÓÿÿÓÿÿþ c$ tÕÿÿsÕÿÿ Ahp  ïÓÿÿÓÿÿþ c pÕÿÿoÕÿÿ A£«  ëÓÿÿÓÿÿþ c ( lÕÿÿkÕÿÿ AÝå  ç Óÿÿ Óÿÿþ c,4 hÕÿÿgÕÿÿ A  ãÓÿÿÓÿÿþ c"* dÕÿÿcÕÿÿ ANV  ßÓÿÿÓÿÿþ c.6 `Õÿÿ_Õÿÿ Aƒ‹  ÛÓÿÿÓÿÿþ c$, \Õÿÿ[Õÿÿ AÃË  ×üÒÿÿüÒÿÿþ c08 XÕÿÿWÕÿÿ A   ÓøÒÿÿøÒÿÿþ c 0 8 TÕÿÿSÕÿÿ A@H  ÏôÒÿÿôÒÿÿþ c!,!4 PÕÿÿOÕÿÿ A{ƒ  ËðÒÿÿðÒÿÿþ c"."6 LÕÿÿKÕÿÿ AœÅ  ÇìÒÿÿìÒÿÿþ c#4#< HÕÿÿGÕÿÿ Aöþ  ÃèÒÿÿèÒÿÿþ c$($0 DÕÿÿCÕÿÿ A'/  ¿äÒÿÿäÒÿÿþ c% %( @Õÿÿ?Õÿÿ Ack  »àÒÿÿàÒÿÿþ c&,&4 <Õÿÿ;Õÿÿ AŠ®  ·ÜÒÿÿÜÒÿÿþ c'2': 8Õÿÿ7Õÿÿ Aßç  ³ØÒÿÿØÒÿÿþ c(((0 4Õÿÿ3Õÿÿ A &   ¯ÔÒÿÿÔÒÿÿþ c).)6 0Õÿÿ/Õÿÿ As {   «ÐÒÿÿÐÒÿÿþ c+&+. ,Õÿÿ+Õÿÿ A· ¿   §ÌÒÿÿÌÒÿÿþ c,4,< (Õÿÿ'Õÿÿ Aû    £ÈÒÿÿÈÒÿÿþ c-4-< $Õÿÿ#Õÿÿ A8 @   ŸÄÒÿÿÄÒÿÿþ c.,.4  ÕÿÿÕÿÿ A‚ Š   ›ÀÒÿÿÀÒÿÿþ c0"0* ÕÿÿÕÿÿ A» à   —ŒÒÿÿŒÒÿÿþ c1(10 ÕÿÿÕÿÿ Að ø   “žÒÿÿžÒÿÿþ c2$2, ÕÿÿÕÿÿ A, 5   ŽÒÿÿŽÒÿÿþ c44  ÕÿÿÕÿÿ A‚‹  ‹°Òÿÿ°Òÿÿþ cHH  ‰getOffersþ AÈÑ  †[Õÿÿ[Õÿÿþ cJJ  Õÿÿ Õÿÿ A×à  ‚§Òÿÿ§Òÿÿþ cTT  ŒgetTaskStatsþ A   }ÿÿÿRÕÿÿRÕÿÿþ cVV NØÿÿMØÿÿ ALZ  yÿÿÿNÕÿÿNÕÿÿþ cWW ÕÿÿÿÔÿÿ AƒŒ  uÿÿÿšÒÿÿšÒÿÿþ c``  7Øÿÿ6Øÿÿ AÛæ  qÿÿÿFÕÿÿFÕÿÿþ cbb øÔÿÿ÷Ôÿÿ AU^  mÿÿÿ’Òÿÿ’Òÿÿþ crr  getTaskInviteþ A¬¹  hÿÿÿ=Õÿÿ=Õÿÿþ ctt ïÔÿÿîÔÿÿ A*3  dÿÿÿ‰Òÿÿ‰Òÿÿþ @€@€`  ŽgetTaskReviewsþ A¢°  _ÿÿÿ4Õÿÿ4Õÿÿþ @‚@‚` ‹acceptOfferþ Any  Zÿÿÿ/Õÿÿ/Õÿÿþ @`@`) ŒdeclineOfferþ A#/  Uÿÿÿ*Õÿÿ*Õÿÿþ @œ`@œ`* ŒcompleteTaskþ AŸ«  Pÿÿÿ%Õÿÿ%Õÿÿþ @Š`@Š`* ŒcreateReviewþ AÝé  Kÿÿÿ Õÿÿ Õÿÿþ @°`@°`% •getOrCreateDirectRoomþ Až³  FÿÿÿÕÿÿÕÿÿþ @¿`#@¿`8 ŠupdateTaskþ A£+­+  AÿÿÿÕÿÿÕÿÿþ @í`"@í`, ©ÕÿÿªÕÿÿ A§-¬-  =ÿÿÿ»Ôÿÿ»Ôÿÿþ @û`@û` ¥ÕÿÿŠÕÿÿ A..  9ÿÿÿ·Ôÿÿ·Ôÿÿþ @þ`@þ` ¡Õÿÿ¢Õÿÿ Aµ.º.  5ÿÿÿ³Ôÿÿ³Ôÿÿþ @`"@`' ÕÿÿžÕÿÿ Ad/i/  1ÿÿÿ¯Ôÿÿ¯Ôÿÿþ @`*@`/ œÔÿÿŸÔÿÿ A!0%0  -ÿÿÿ«Ôÿÿ«Ôÿÿþ @`2@`6 ¹ÔÿÿºÔÿÿ A„1ˆ1  )ÿÿÿ§Ôÿÿ§Ôÿÿþ @ `C@ `G µÔÿÿ¶Ôÿÿ A+3/3  %ÿÿÿ£Ôÿÿ£Ôÿÿþ @`=@`A ÕÿÿŽÕÿÿ A~4ƒ4  !ÿÿÿŸÔÿÿŸÔÿÿþ @`*@`/ ‰ÕÿÿŠÕÿÿ A|55  ÿÿÿ›Ôÿÿ›Ôÿÿþ @`t@`y ©ÔÿÿªÔÿÿ Añ6õ6  ÿÿÿ—Ôÿÿ—Ôÿÿþ @`:@`> ¥ÔÿÿŠÔÿÿ A8¡8  ÿÿÿ“Ôÿÿ“Ôÿÿþ @"`H@"`L ¡Ôÿÿ¢Ôÿÿ A<;@;  ÿÿÿÔÿÿÔÿÿþ @+`2@+`6 ÔÿÿžÔÿÿ Aº<Ÿ<   ÿÿÿ‹Ôÿÿ‹Ôÿÿþ @3`"@3`& ØÿÿØÿÿ A5=>=   ÿÿÿ×ÿÿ×ÿÿþ @5`"@5`+ •Ôÿÿ–Ôÿÿ A‡=‹=  ÿÿÿƒÔÿÿƒÔÿÿþ @7`"@7`& \þÿÿ[þÿÿ A>>  ÿÿÿ×ÿÿ×ÿÿþ @9`"@9`1 iÕÿÿjÕÿÿ AZ>_>  ýþÿÿ{Ôÿÿ{Ôÿÿþ @;`"@;`' eÕÿÿfÕÿÿ A,?1?  ùþÿÿwÔÿÿwÔÿÿþ @>`9@>`> …Ôÿÿ†Ôÿÿ A™??  õþÿÿsÔÿÿsÔÿÿþ @@`2@@`6 ]Õÿÿ^Õÿÿ AŽ@“@  ñþÿÿoÔÿÿoÔÿÿþ @D`2@D`7 }Ôÿÿ~Ôÿÿ A,B0B  íþÿÿkÔÿÿkÔÿÿþ @K`K@K`O UÕÿÿVÕÿÿ A–C›C  éþÿÿgÔÿÿgÔÿÿþ @Q`S@Q`X uÔÿÿvÔÿÿ ADD  åþÿÿcÔÿÿcÔÿÿþ @S`2@S`6 qÔÿÿrÔÿÿ AøDüD  áþÿÿ_Ôÿÿ_Ôÿÿþ @W`2@W`6 IÕÿÿJÕÿÿ AGFLF  Ýþÿÿ[Ôÿÿ[Ôÿÿþ @]`;@]`@ iÔÿÿjÔÿÿ AŽFžF  ÙþÿÿWÔÿÿWÔÿÿþ @_`2@_`6 AÕÿÿBÕÿÿ A«G°G  ÕþÿÿSÔÿÿSÔÿÿþ @c`2@c`7 =Õÿÿ>Õÿÿ AêIïI  ÑþÿÿOÔÿÿOÔÿÿþ @l`;@l`@ ]Ôÿÿ^Ôÿÿ AWJ[J  ÍþÿÿKÔÿÿKÔÿÿþ @n`2@n`6 YÔÿÿZÔÿÿ ANKRK  ÉþÿÿGÔÿÿGÔÿÿþ @r`2@r`6 UÔÿÿVÔÿÿ AˆLŒL  ÅþÿÿCÔÿÿCÔÿÿþ @v`[@v`_ -Õÿÿ.Õÿÿ A)N.N  Áþÿÿ?Ôÿÿ?Ôÿÿþ @|`e@|`j MÔÿÿNÔÿÿ A–NšN  œþÿÿ;Ôÿÿ;Ôÿÿþ @~`2@~`6 IÔÿÿJÔÿÿ AŽO’O  ¹þÿÿ7Ôÿÿ7Ôÿÿþ @‚`2@‚`6 !Õÿÿ"Õÿÿ AõPúP  µþÿÿ3Ôÿÿ3Ôÿÿþ @ˆ`<@ˆ`A AÔÿÿBÔÿÿ AbQfQ  ±þÿÿ/Ôÿÿ/Ôÿÿþ @Š`2@Š`6 =Ôÿÿ>Ôÿÿ A[R_R  ­þÿÿ+Ôÿÿ+Ôÿÿþ @Ž`2@Ž`6 ÕÿÿÕÿÿ A²S·S  ©þÿÿ'Ôÿÿ'Ôÿÿþ @”`6@”`; 5Ôÿÿ6Ôÿÿ AT#T  ¥þÿÿ#Ôÿÿ#Ôÿÿþ @–`2@–`6  ÕÿÿÕÿÿ AUU  ¡þÿÿÔÿÿÔÿÿþ @š`2@š`7 {ÔÿÿrÕÿÿ AU U 4þÿÿlÔÿÿlÔÿÿþ @š`8@š`< )Ôÿÿ*Ôÿÿ A8V %Ôÿÿ&Ôÿÿ A9W=W  •þÿÿÔÿÿÔÿÿþ @ `Y@ `] ¿ýÿÿŸýÿÿ AÉWÒW  ‘þÿÿ hÔÿÿhÔÿÿþ @¢`9@¢`B ÔÿÿÔÿÿ A‚X†X  þÿÿ Ôÿÿ Ôÿÿþ @€`C@€`G ·ýÿÿ¶ýÿÿ A6Y?Y  ‰þÿÿ `Ôÿÿ`Ôÿÿþ @Š`>@Š`G ñÔÿÿòÔÿÿ AZ Z  …þÿÿÔÿÿÔÿÿþ @©`:@©`? ÔÿÿÔÿÿ A‘Z•Z  þÿÿÿÓÿÿÿÓÿÿþ @«`B@«`F «ýÿÿªýÿÿ Ag[p[  }þÿÿ TÔÿÿTÔÿÿþ @­`B@­`K åÔÿÿæÔÿÿ A \\  yþÿÿ÷Óÿÿ÷Óÿÿþ @¯`U@¯`Z ÔÿÿÔÿÿ AR_V_  uþÿÿóÓÿÿóÓÿÿþ @Ÿ`K@Ÿ`O ÔÿÿÔÿÿ A»_¿_  qþÿÿïÓÿÿïÓÿÿþ @À`0@À`4 ýÓÿÿþÓÿÿ AV`Z`  mþÿÿëÓÿÿëÓÿÿþ @Â`N@Â`R ùÓÿÿúÓÿÿ Aa”a  iþÿÿçÓÿÿçÓÿÿþ @Å`<@Å`@ õÓÿÿöÓÿÿ Ac!c  eþÿÿãÓÿÿãÓÿÿþ @Í`K@Í`O ÍÔÿÿÎÔÿÿ Aþcd  aþÿÿßÓÿÿßÓÿÿþ @Ð`0@Ð`5 íÓÿÿîÓÿÿ Aëdïd  ]þÿÿÛÓÿÿÛÓÿÿþ @Ô`.@Ô`2 éÓÿÿêÓÿÿ Af f  Yþÿÿ×Óÿÿ×Óÿÿþ @Ù`.@Ù`2 åÓÿÿæÓÿÿ A g$g  UþÿÿÓÓÿÿÓÓÿÿþ @Ü`<@Ü`@ áÓÿÿâÓÿÿ A˜hœh  QþÿÿÏÓÿÿÏÓÿÿþ @â`@@â`D ÝÓÿÿÞÓÿÿ A/j3j  MþÿÿËÓÿÿËÓÿÿþ @é`C@é`G ÙÓÿÿÚÓÿÿ A`kdk  IþÿÿÇÓÿÿÇÓÿÿþ @ì`<@ì`@ ÕÓÿÿÖÓÿÿ AØlÜl  EþÿÿÃÓÿÿÃÓÿÿþ @ò`@@ò`D ÑÓÿÿÒÓÿÿ Anƒn  Aþÿÿ¿Óÿÿ¿Óÿÿþ @ù`X@ù`\ ÍÓÿÿÎÓÿÿ A°oŽo  =þÿÿ»Óÿÿ»Óÿÿþ @ü`<@ü`@ ÉÓÿÿÊÓÿÿ A(q,q  9þÿÿ·Óÿÿ·Óÿÿþ @`@@`D ¡Ôÿÿ¢Ôÿÿ AŒrÁr  5þÿÿ³Óÿÿ³Óÿÿþ @ `H@ `M ÔÿÿžÔÿÿ APuUu  1þÿÿ¯Óÿÿ¯Óÿÿþ C¿Ä ™ÔÿÿšÔÿÿ Avv  -þÿÿ«Óÿÿ«Óÿÿþ @`*@`/ ¹ÓÿÿºÓÿÿ Aìvðv  )þÿÿ§Óÿÿ§Óÿÿþ @`2@`6 µÓÿÿ¶Óÿÿ Ajxnx  %þÿÿ£Óÿÿ£Óÿÿþ @ `@@ `D ÔÿÿŽÔÿÿ AŽz¹z  !þÿÿŸÓÿÿŸÓÿÿþ @)`L@)`Q ­Óÿÿ®Óÿÿ Aù|ý|  þÿÿ›Óÿÿ›Óÿÿþ @4`C@4`G …Ôÿÿ†Ôÿÿ Aþ}~  þÿÿ—Óÿÿ—Óÿÿþ @:`"@:`' Ôÿÿ‚Ôÿÿ AÍ~Ò~  þÿÿ“Óÿÿ“Óÿÿþ @=`\@=`a ÐÔÿÿÑÔÿÿ AÓ~Ü~ 4þÿÿÓÿÿÓÿÿþ @=`b@=`k ÓÿÿžÓÿÿ A>B   þÿÿ‹Óÿÿ‹Óÿÿþ @?`2@?`6lÿÿÿßÔÿÿ ACG 4 þÿÿÙÓÿÿÙÓÿÿþ @?`7@?`; rÔÿÿsÔÿÿ A¿€Ä€  þÿÿ„Óÿÿ„Óÿÿþ @D`2@D`7eÿÿÿØÔÿÿ Aŀɀ 4þÿÿÒÓÿÿÒÓÿÿþ @D`8@D`< ÓÿÿÓÿÿ A3‚7‚  ÿýÿÿ}Óÿÿ}Óÿÿþ @H`:@H`> ‹ÓÿÿŒÓÿÿ A݃რ ûýÿÿyÓÿÿyÓÿÿþ @N`H@N`L ‡ÓÿÿˆÓÿÿ A‡‡  ÷ýÿÿuÓÿÿuÓÿÿþ @Y`V@Y`Z _Ôÿÿ`Ôÿÿ A-‰2‰  óýÿÿqÓÿÿqÓÿÿþ C^^  Óÿÿ€Óÿÿ AïŠóŠ  ïýÿÿmÓÿÿmÓÿÿþ @c`2@c`6 {Óÿÿ|Óÿÿ AiŒmŒ  ëýÿÿiÓÿÿiÓÿÿþ @i`@@i`D wÓÿÿxÓÿÿ A  çýÿÿeÓÿÿeÓÿÿþ @r`t@r`x sÓÿÿtÓÿÿ A`’d’  ãýÿÿaÓÿÿaÓÿÿþ @{`8@{`< KÔÿÿLÔÿÿ A}“‚“  ßýÿÿ]Óÿÿ]Óÿÿþ @`4@`9 kÓÿÿlÓÿÿ A^”b”  ÛýÿÿYÓÿÿYÓÿÿþ @…`*@…`. CÔÿÿDÔÿÿ A;•@•  ×ýÿÿUÓÿÿUÓÿÿþ @‰`*@‰`/ cÓÿÿdÓÿÿ A𕬕  ÓýÿÿQÓÿÿQÓÿÿþ @‹`2@‹`6 _Óÿÿ`Óÿÿ A°–Ž–  ÏýÿÿMÓÿÿMÓÿÿþ @`2@`6 [Óÿÿ\Óÿÿ Aa˜e˜  ËýÿÿIÓÿÿIÓÿÿþ @—`D@—`H 3Ôÿÿ4Ôÿÿ A£ššš  ÇýÿÿEÓÿÿEÓÿÿþ @ `*@ `/ SÓÿÿTÓÿÿ A››  ÃýÿÿAÓÿÿAÓÿÿþ @¢`2@¢`6 OÓÿÿPÓÿÿ A#œ'œ  ¿ýÿÿ=Óÿÿ=Óÿÿþ @Š`2@Š`6 'Ôÿÿ(Ôÿÿ AО՞  »ýÿÿ9Óÿÿ9Óÿÿþ @°`*@°`/ GÓÿÿHÓÿÿ AvŸzŸ  ·ýÿÿ5Óÿÿ5Óÿÿþ @³`2@³`6 CÓÿÿDÓÿÿ Af¡j¡  ³ýÿÿ1Óÿÿ1Óÿÿþ @¹`2@¹`6 ÔÿÿÔÿÿ A££š£  ¯ýÿÿ-Óÿÿ-Óÿÿþ @Å`%@Å`* ÔÿÿÔÿÿ A=€B€  «ýÿÿ)Óÿÿ)Óÿÿþ @È`"@È`' ÔÿÿÔÿÿ A÷€ü€  §ýÿÿ%Óÿÿ%Óÿÿþ @Ë`*@Ë`/ ÔÿÿÔÿÿ A³ŠžŠ  £ýÿÿ!Óÿÿ!Óÿÿþ @Ô`7@Ô`<  Ôÿÿ Ôÿÿ A˜§§  ŸýÿÿÓÿÿÓÿÿþ @×`N@×`S ÔÿÿÔÿÿ Adšiš  ›ýÿÿÓÿÿÓÿÿþ @Ú`:@Ú`? 'Óÿÿ(Óÿÿ AIªMª  —ýÿÿÓÿÿÓÿÿþ @á`B@á`F #Óÿÿ$Óÿÿ Aѫի  “ýÿÿÓÿÿÓÿÿþ @æ`B@æ`F ûÓÿÿüÓÿÿ A°®µ®  ýÿÿ Óÿÿ Óÿÿþ @ð`N@ð`S ÷ÓÿÿøÓÿÿ A±!±  ‹ýÿÿ Óÿÿ Óÿÿþ @û`T@û`Y ŒrunAutoMatchþ A²²  †ýÿÿ[Óÿÿ[Óÿÿþ @ÿ`:@ÿ`F ÓÿÿÓÿÿ A(µ,µ  ‚ýÿÿÓÿÿÓÿÿþ @ `2@ `6 ÓÿÿÓÿÿ A€¶š¶  ~ýÿÿüÒÿÿüÒÿÿþ @`@@`D æÓÿÿçÓÿÿ A¹¹  zýÿÿøÒÿÿøÒÿÿþ @`U@`Z ÓÿÿÓÿÿ AйԹ  výÿÿôÒÿÿôÒÿÿþ @`*@`. ÓÿÿÓÿÿ A׺ۺ  rýÿÿðÒÿÿðÒÿÿþ @!`*@!`. ÚÓÿÿÛÓÿÿ AŒŒ  nýÿÿìÒÿÿìÒÿÿþ @&`9@&`> ÖÓÿÿ×Óÿÿ AôŒùŒ  jýÿÿèÒÿÿèÒÿÿþ @)`:@)`? öÒÿÿ÷Òÿÿ Aלۜ  fýÿÿäÒÿÿäÒÿÿþ @,`B@,`F òÒÿÿóÒÿÿ AûŸÿŸ  býÿÿàÒÿÿàÒÿÿþ @.`Z@.`^ îÒÿÿïÒÿÿ AJÁNÁ  ^ýÿÿÜÒÿÿÜÒÿÿþ @4`B@4`F ÆÓÿÿÇÓÿÿ AÖÂÛ  ZýÿÿØÒÿÿØÒÿÿþ @8`N@8`S æÒÿÿçÒÿÿ A.Å2Å  VýÿÿÔÒÿÿÔÒÿÿþ @A`:@A`> âÒÿÿãÒÿÿ AqÇuÇ  RýÿÿÐÒÿÿÐÒÿÿþ @L`2@L`6 ÞÒÿÿßÒÿÿ A,È0È  NýÿÿÌÒÿÿÌÒÿÿþ @O`=@O`A ÚÒÿÿÛÒÿÿ AÓÈ×È  JýÿÿÈÒÿÿÈÒÿÿþ @R`'@R`+ ²Óÿÿ³Óÿÿ ApÊuÊ  FýÿÿÄÒÿÿÄÒÿÿþ @Y`1@Y`6 ®Óÿÿ¯Óÿÿ A1Ë6Ë  BýÿÿÀÒÿÿÀÒÿÿþ @\`2@\`7 ªÓÿÿ«Óÿÿ A ÌÌ  >ýÿÿŒÒÿÿŒÒÿÿþ @_`:@_`? ÊÒÿÿËÒÿÿ AíÌñÌ  :ýÿÿžÒÿÿžÒÿÿþ @b`B@b`F ÆÒÿÿÇÒÿÿ AZÎ^Î  6ýÿÿŽÒÿÿŽÒÿÿþ Cdd¡ žÓÿÿŸÓÿÿ A³ÑžÑ  2ýÿÿ°Òÿÿ°Òÿÿþ @j`B@j`G šÓÿÿ›Óÿÿ A^ÒcÒ  .ýÿÿ¬Òÿÿ¬Òÿÿþ @l`X@l`] ºÒÿÿ»Òÿÿ AsÓwÓ  *ýÿÿšÒÿÿšÒÿÿþ @o`R@o`V‰þÿÿüÓÿÿ AxÓ|Ó 4'ýÿÿöÒÿÿöÒÿÿþ @o`W@o`[ QüÿÿPüÿÿ AÆÔÏÔ  #ýÿÿ úÒÿÿúÒÿÿþ @r`R@r`[ ¯Òÿÿ°Òÿÿ AŽÕžÕ  ýÿÿÒÿÿÒÿÿþ Ct‹t ?Õÿÿ>Õÿÿ A¹ÕÂÕ 4ýÿÿ #Õÿÿ#Õÿÿþ Ctt™ §ÒÿÿšÒÿÿ AáÖåÖ  ýÿÿ•Òÿÿ•Òÿÿþ @w`q@w`u £Òÿÿ€Òÿÿ A{ØØ  ýÿÿ‘Òÿÿ‘Òÿÿþ @{``@{`d ŸÒÿÿ Òÿÿ AxÚ|Ú  ýÿÿÒÿÿÒÿÿþ @`[@`_ wÓÿÿxÓÿÿ A‘Ü–Ü   ýÿÿ‰Òÿÿ‰Òÿÿþ @‰`:@‰`? sÓÿÿtÓÿÿ ApÝuÝ  ýÿÿ…Òÿÿ…Òÿÿþ @Œ`B@Œ`G #Öÿÿ"Öÿÿ AdÞoÞ  ýÿÿ Õÿÿ Õÿÿþ @`<@`G ÒÿÿÒÿÿ Arßvß  ÿüÿÿ}Òÿÿ}Òÿÿþ @“`B@“`F gÓÿÿhÓÿÿ AQâVâ  ûüÿÿyÒÿÿyÒÿÿþ @›`j@›`o ‡ÒÿÿˆÒÿÿ A1ã5ã  ÷üÿÿuÒÿÿuÒÿÿþ @ž`:@ž`> ƒÒÿÿ„Òÿÿ Aãäçä  óüÿÿqÒÿÿqÒÿÿþ @£`:@£`> Òÿÿ€Òÿÿ A¿çÃç  ïüÿÿmÒÿÿmÒÿÿþ @°`q@°`u WÓÿÿXÓÿÿ AFèKè  ëüÿÿiÒÿÿiÒÿÿþ @²`(@²`- SÓÿÿTÓÿÿ A÷èüè  çüÿÿeÒÿÿeÒÿÿþ @µ`&@µ`+ sÒÿÿtÒÿÿ Ažé¢é  ãüÿÿaÒÿÿaÒÿÿþ @ž`.@ž`2 oÒÿÿpÒÿÿ Ahêlê  ßüÿÿ]Òÿÿ]Òÿÿþ @º`<@º`@ kÒÿÿlÒÿÿ A>ìBì  ÛüÿÿYÒÿÿYÒÿÿþ @Á`@@Á`D CÓÿÿDÓÿÿ Aªî¯î  ×üÿÿUÒÿÿUÒÿÿþ @È`.@È`3 cÒÿÿdÒÿÿ Aï#ï  ÓüÿÿQÒÿÿQÒÿÿþ @Ê`6@Ê`: _Òÿÿ`Òÿÿ A?ðCð  ÏüÿÿMÒÿÿMÒÿÿþ @Î`6@Î`: 7Óÿÿ8Óÿÿ AÉñÎñ  ËüÿÿIÒÿÿIÒÿÿþ @Ö`&@Ö`+ WÒÿÿXÒÿÿ Alòpò  ÇüÿÿEÒÿÿEÒÿÿþ @Ù`.@Ù`2&þÿÿ™Óÿÿ Aqòuò 4Äüÿÿ“Òÿÿ“Òÿÿþ @Ù`3@Ù`7 PÒÿÿQÒÿÿ Aòóöó  Àüÿÿ>Òÿÿ>Òÿÿþ @Þ`.@Þ`2 ÒØÿÿÑØÿÿ Aéôüô  Œüÿÿ‘Òÿÿ‘Òÿÿþ @â`.@â`A $Óÿÿ%Óÿÿ AÐ÷Õ÷  žüÿÿ6Òÿÿ6Òÿÿþ @ï`B@ï`G  Óÿÿ!Óÿÿ A¹øŸø  Žüÿÿ2Òÿÿ2Òÿÿþ Cò–ò› @ÒÿÿAÒÿÿ A‡ù‹ù  °üÿÿ.Òÿÿ.Òÿÿþ @õ`*@õ`. ÓÿÿÓÿÿ APúUú  ¬üÿÿ*Òÿÿ*Òÿÿþ @ù`*@ù`/ 8Òÿÿ9Òÿÿ AœúÁú  šüÿÿ&Òÿÿ&Òÿÿþ @û`2@û`6 4Òÿÿ5Òÿÿ AÁûÅû  €üÿÿ"Òÿÿ"Òÿÿþ @ÿ`2@ÿ`6  Óÿÿ Óÿÿ A ýý   üÿÿÒÿÿÒÿÿþ @`*@`/ ,Òÿÿ-Òÿÿ AËþÏþ  œüÿÿÒÿÿÒÿÿþ @ `2@ `6 (Òÿÿ)Òÿÿ AEI  ˜üÿÿÒÿÿÒÿÿþ @`@@`D ÓÿÿÓÿÿ A"  ”üÿÿÒÿÿÒÿÿþ @`n@`s  Òÿÿ!Òÿÿ AÏÓ  üÿÿÒÿÿÒÿÿþ @`*@`. øÒÿÿùÒÿÿ A¿Ä  Œüÿÿ Òÿÿ Òÿÿþ @"`4@"`9wþÿÿIÓÿÿ AÅÎ 4‰üÿÿÒÿÿÒÿÿþ @"`:@"`C ñÒÿÿòÒÿÿ A05  …üÿÿÒÿÿÒÿÿþ @$`2@$`7 íÒÿÿîÒÿÿ A   üÿÿÿÑÿÿÿÑÿÿþ @'`:@'`?  ÒÿÿÒÿÿ Aòö  }üÿÿûÑÿÿûÑÿÿþ @*`U@*`Y  Òÿÿ Òÿÿ A&*  yüÿÿ÷Ñÿÿ÷Ñÿÿþ @.`B@.`F áÒÿÿâÒÿÿ AÚ ß   uüÿÿóÑÿÿóÑÿÿþ @4`:@4`? ÝÒÿÿÞÒÿÿ A¹ Ÿ   qüÿÿïÑÿÿïÑÿÿþ @7`B@7`G ÕÿÿŒÕÿÿ A­ ž   müÿÿsÔÿÿsÔÿÿþ @:`<@:`G ùÑÿÿúÑÿÿ Aœ Á   iüÿÿçÑÿÿçÑÿÿþ @>`B@>`F õÑÿÿöÑÿÿ Aöú  eüÿÿãÑÿÿãÑÿÿþ @F`t@F`x ÍÒÿÿÎÒÿÿ A¢  aüÿÿßÑÿÿßÑÿÿþ @H`@@H`E íÑÿÿîÑÿÿ A•™  ]üÿÿÛÑÿÿÛÑÿÿþ @M`>@M`B éÑÿÿêÑÿÿ AW[  Yüÿÿ×Ñÿÿ×Ñÿÿþ @S`L@S`P ÁÒÿÿÂÒÿÿ A‹  UüÿÿÓÑÿÿÓÑÿÿþ @^`S@^`X œÒÿÿŸÒÿÿ AY^  QüÿÿÏÑÿÿÏÑÿÿþ @a`[@a`` ÝÑÿÿÞÑÿÿ AY]  MüÿÿËÑÿÿËÑÿÿþ @d`:@d`> ÙÑÿÿÚÑÿÿ A  IüÿÿÇÑÿÿÇÑÿÿþ @j`H@j`L ÕÑÿÿÖÑÿÿ A²¶  EüÿÿÃÑÿÿÃÑÿÿþ @p`:@p`> ­Òÿÿ®Òÿÿ Aóø  Aüÿÿ¿Ñÿÿ¿Ñÿÿþ @v`2@v`7 ÍÑÿÿÎÑÿÿ AÈÌ  =üÿÿ»Ñÿÿ»Ñÿÿþ @y`:@y`> ÉÑÿÿÊÑÿÿ A!‘!  9üÿÿ·Ñÿÿ·Ñÿÿþ @}`:@}`>˜ýÿÿ Óÿÿ A’!–! 46üÿÿÒÿÿÒÿÿþ @}`?@}`C žÒÿÿŸÒÿÿ Aä$é$  2üÿÿ°Ñÿÿ°Ñÿÿþ Cˆ–ˆ› ŸÑÿÿ¿Ñÿÿ A–%š%  .üÿÿ¬Ñÿÿ¬Ñÿÿþ @‹`*@‹`. ºÑÿÿ»Ñÿÿ A&“&  *üÿÿšÑÿÿšÑÿÿþ @`<@`@ ’Òÿÿ“Òÿÿ AQ'V'  &üÿÿ€Ñÿÿ€Ñÿÿþ @’`:@’`? ŽÒÿÿÒÿÿ Aö'û'  "üÿÿ Ñÿÿ Ñÿÿþ @•`2@•`7 ®Ñÿÿ¯Ñÿÿ Aû)ÿ)  üÿÿœÑÿÿœÑÿÿþ @ž`H@ž`L †Òÿÿ‡Òÿÿ AS+X+  üÿÿ˜Ñÿÿ˜Ñÿÿþ @¢`:@¢`? ŠÑÿÿ§Ñÿÿ Ay-}-  üÿÿ”Ñÿÿ”Ñÿÿþ @«`F@«`J ¢Ñÿÿ£Ñÿÿ A~.‚.  üÿÿÑÿÿÑÿÿþ @¯`2@¯`6 žÑÿÿŸÑÿÿ AŒ/À/  üÿÿŒÑÿÿŒÑÿÿþ @Ž`/@Ž`3 šÑÿÿ›Ñÿÿ Aû0ÿ0   üÿÿˆÑÿÿˆÑÿÿþ @Œ`1@Œ`5 rÒÿÿsÒÿÿ Aš1­1  üÿÿ„Ñÿÿ„Ñÿÿþ @Ÿ`(@Ÿ`- nÒÿÿoÒÿÿ AO2T2  üÿÿ€Ñÿÿ€Ñÿÿþ @Á`&@Á`+ ŽÑÿÿÑÿÿ A#3'3  þûÿÿ|Ñÿÿ|Ñÿÿþ @Ä`.@Ä`2 ŠÑÿÿ‹Ñÿÿ A44  úûÿÿxÑÿÿxÑÿÿþ @È`.@È`2 †Ñÿÿ‡Ñÿÿ Aú4þ4  öûÿÿtÑÿÿtÑÿÿþ @Ë`<@Ë`@ ‚ÑÿÿƒÑÿÿ Ar6v6  òûÿÿpÑÿÿpÑÿÿþ @Ñ`@@Ñ`D ZÒÿÿ[Òÿÿ A%8*8  îûÿÿlÑÿÿlÑÿÿþ @Ú`&@Ú`+ VÒÿÿWÒÿÿ Aù8þ8  êûÿÿhÑÿÿhÑÿÿþ @Þ`.@Þ`3 RÒÿÿSÒÿÿ An9s9  æûÿÿdÑÿÿdÑÿÿþ @à`6@à`; rÑÿÿsÑÿÿ A,;0;  âûÿÿ`Ñÿÿ`Ñÿÿþ @ç`6@ç`: JÒÿÿKÒÿÿ AÊ>Ï>  Þûÿÿ\Ñÿÿ\Ñÿÿþ @õ`.@õ`3 FÒÿÿGÒÿÿ A??D?  ÚûÿÿXÑÿÿXÑÿÿþ @÷`6@÷`; fÑÿÿgÑÿÿ AAA  ÖûÿÿTÑÿÿTÑÿÿþ @þ`6@þ`: >Òÿÿ?Òÿÿ A|DD  ÒûÿÿPÑÿÿPÑÿÿþ @ `.@ `3 :Òÿÿ;Òÿÿ A:E?E  ÎûÿÿLÑÿÿLÑÿÿþ @`6@`; ZÑÿÿ[Ñÿÿ A¿EÃE  ÊûÿÿHÑÿÿHÑÿÿþ @`>@`B VÑÿÿWÑÿÿ AG G  ÆûÿÿDÑÿÿDÑÿÿþ @`>@`B RÑÿÿSÑÿÿ AÑJÕJ  Âûÿÿ@Ñÿÿ@Ñÿÿþ @!`6@!`: *Òÿÿ+Òÿÿ AqKvK  Ÿûÿÿ<Ñÿÿ<Ñÿÿþ @#`D@#`I JÑÿÿKÑÿÿ AeLiL  ºûÿÿ8Ñÿÿ8Ñÿÿþ @&`B@&`F FÑÿÿGÑÿÿ AJONO  ¶ûÿÿ4Ñÿÿ4Ñÿÿþ @/`B@/`F ÒÿÿÒÿÿ AVQ[Q  ²ûÿÿ0Ñÿÿ0Ñÿÿþ @8`.@8`3 >Ñÿÿ?Ñÿÿ AËQÏQ  ®ûÿÿ,Ñÿÿ,Ñÿÿþ @:`6@:`: :Ñÿÿ;Ñÿÿ AõRùR  ªûÿÿ(Ñÿÿ(Ñÿÿþ @>`6@>`: ÒÿÿÒÿÿ AçUìU  Šûÿÿ$Ñÿÿ$Ñÿÿþ @I`.@I`3 2Ñÿÿ3Ñÿÿ A\V`V  ¢ûÿÿ Ñÿÿ Ñÿÿþ @K`6@K`: .Ñÿÿ/Ñÿÿ AˆWŒW  žûÿÿÑÿÿÑÿÿþ @O`6@O`: ÒÿÿÒÿÿ A|ZZ  šûÿÿÑÿÿÑÿÿþ @Z`.@Z`3 ÒÿÿÒÿÿ A:[?[  –ûÿÿÑÿÿÑÿÿþ @]`6@]`; "Ñÿÿ#Ñÿÿ A¿[Ã[  ’ûÿÿÑÿÿÑÿÿþ @_`>@_`B ÑÿÿÑÿÿ A]]  Žûÿÿ Ñÿÿ Ñÿÿþ @c`>@c`B öÑÿÿ÷Ñÿÿ A[```  ŠûÿÿÑÿÿÑÿÿþ @n`6@n`; ÑÿÿÑÿÿ Aà`ä`  †ûÿÿÑÿÿÑÿÿþ @p`>@p`B ÑÿÿÑÿÿ A0b4b  ‚ûÿÿÑÿÿÑÿÿþ @t`>@t`B êÑÿÿëÑÿÿ Ave{e  ~ûÿÿüÐÿÿüÐÿÿþ @`6@`;  Ñÿÿ Ñÿÿ Aûeÿe  zûÿÿøÐÿÿøÐÿÿþ @`>@`B ÑÿÿÑÿÿ AJgNg  vûÿÿôÐÿÿôÐÿÿþ @…`>@…`B ÞÑÿÿßÑÿÿ AÛjàj  rûÿÿðÐÿÿðÐÿÿþ @’`.@’`3 þÐÿÿÿÐÿÿ APkTk  nûÿÿìÐÿÿìÐÿÿþ @”`6@”`: úÐÿÿûÐÿÿ A~l‚l  jûÿÿèÐÿÿèÐÿÿþ @˜`6@˜`: ÒÑÿÿÓÑÿÿ AŠoo  fûÿÿäÐÿÿäÐÿÿþ @£`.@£`3 òÐÿÿóÐÿÿ Aÿop  bûÿÿàÐÿÿàÐÿÿþ @¥`6@¥`: ÊÑÿÿËÑÿÿ A/q4q  ^ûÿÿÜÐÿÿÜÐÿÿþ @©`6@©`; êÐÿÿëÐÿÿ A¹sœs  ZûÿÿØÐÿÿØÐÿÿþ @±`>@±`B æÐÿÿçÐÿÿ AÓt×t  VûÿÿÔÐÿÿÔÐÿÿþ @µ`>@µ`B ŸÑÿÿ¿Ñÿÿ Av†v  RûÿÿÐÐÿÿÐÐÿÿþ @œ`.@œ`3 ÞÐÿÿßÐÿÿ A8w{ if (!id) return; Promise.all([ getUserProfile(id, locale), getUserReviews(id), getUserRating(id), getCategories().catch(()=>[]), getLocations().catch(()=>[]) ]).then((param)=>{ let [u, r, rt, cats, locs] = param; setUser(u); setReviews(r); setRating(rt.avg); setCatMap(new Map(flattenTree(cats).map((c)=>[ c.slug, c ]))); setLocMap(new Map(flattenTree(locs).map((l)=>[ l.slug, l ]))); if (u.role === 'specialist' || u.role === 'admin') { getSpecialistCards(id, locale).then((cards)=>{ setSpecialistCards(cards); cards.forEach((c)=>{ getPriceList(c.id, locale).then((pl)=>{ if (pl.length > 0) setPriceLists((prev)=>({ ...prev, [c.id]: pl })); }).catch(()=>{}); }); }).catch(()=>{}); } }).catch(()=>{}).finally(()=>setLoading(false)); }, [ id, locale ]); // Load favorite status when session available useEffect(()=>{ var _session_user; if (!session || !id) return; getSpecialistFavorites().then((rows)=>setIsFavorite(rows.some((r)=>{ var _r_specialist; return ((_r_specialist = r.specialist) === null || _r_specialist === void 0 ? void 0 : _r_specialist.id) === id; }))).catch(()=>{}); // Check if current user can message this person const myId = (_session_user = session.user) === null || _session_user === void 0 ? void 0 : _session_user.id; if (myId && myId !== id) { getCanMessage(id).then(setCanMsg).catch(()=>{}); } }, [ session, id ]); async function toggleFavorite() { if (!session) { router.push('/register'); return; } setFavLoading(true); try { if (isFavorite) { await removeSpecialistFavorite(id); setIsFavorite(false); } else { await addSpecialistFavorite(id); setIsFavorite(true); } } catch (e) {} setFavLoading(false); } async function handleMessage() { if (!session) { router.push('/login'); return; } setMsgLoading(true); try { const { room } = await getOrCreateDirectRoom(id); router.push("/chat?room=".concat(room.id)); } catch (e) {} setMsgLoading(false); } useEffect(()=>{ if (!id) return; const monthKey = "".concat(availYear, "-").concat(String(availMonth + 1).padStart(2, '0')); getSpecialistAvailability(id, monthKey).then((rows)=>{ setAvailMap((prev)=>{ const next = { ...prev }; rows.forEach((r)=>{ next[r.date] = r.status; }); return next; }); }).catch(()=>{}); }, [ id, availYear, availMonth ]); if (loading) return /*#__PURE__*/ _jsx("div", { className: "text-center py-20 text-white", children: t('common.loading') }); if (!user) return /*#__PURE__*/ _jsx("div", { className: "text-center py-20 text-white/70", children: t('common.error') }); var _user_firstName_, _user_lastName_; const initials = "".concat((_user_firstName_ = (_user_firstName = user.firstName) === null || _user_firstName === void 0 ? void 0 : _user_firstName[0]) !== null && _user_firstName_ !== void 0 ? _user_firstName_ : '').concat((_user_lastName_ = (_user_lastName = user.lastName) === null || _user_lastName === void 0 ? void 0 : _user_lastName[0]) !== null && _user_lastName_ !== void 0 ? _user_lastName_ : '').toUpperCase() || ((_user_name = user.name) === null || _user_name === void 0 ? void 0 : (_user_name_ = _user_name[0]) === null || _user_name_ === void 0 ? void 0 : _user_name_.toUpperCase()) || '?'; const displayName = formatShortName(user.firstName, user.lastName, user.name); const profileBackgroundImage = typeof ((_user_siteSettings = user.siteSettings) === null || _user_siteSettings === void 0 ? void 0 : _user_siteSettings.profileBackgroundImage) === 'string' && user.siteSettings.profileBackgroundImage.trim().length > 0 ? user.siteSettings.profileBackgroundImage : null; return /*#__PURE__*/ _jsxs("div", { className: "max-w-3xl mx-auto px-4 py-10", children: [ /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6 mb-6", children: [ /*#__PURE__*/ _jsxs("div", { className: "relative -mx-6 -mt-6 mb-5 h-44 overflow-hidden rounded-t-xl", style: { backgroundImage: profileBackgroundImage ? "linear-gradient(135deg, rgba(21, 128, 61, 0.45), rgba(22, 163, 74, 0.65)), url(".concat(profileBackgroundImage, ")") : 'linear-gradient(135deg, #22c55e 0%, #16a34a 45%, #166534 100%)', backgroundSize: 'cover', backgroundPosition: 'center' }, children: [ /*#__PURE__*/ _jsx("div", { className: "absolute inset-0 bg-gradient-to-b from-black/10 to-black/30" }), /*#__PURE__*/ _jsxs("div", { className: "relative h-full w-full p-5 flex items-end justify-between", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 min-w-0", children: [ /*#__PURE__*/ _jsx("div", { className: "w-14 h-14 rounded-full bg-white/20 border border-white/40 overflow-hidden flex items-center justify-center text-white text-xl font-bold backdrop-blur-sm", children: user.image ? /*#__PURE__*/ _jsx("img", { src: user.image, alt: displayName, className: "w-full h-full object-cover" }) : initials }), /*#__PURE__*/ _jsxs("div", { className: "min-w-0", children: [ /*#__PURE__*/ _jsx("p", { className: "text-white text-lg font-bold truncate", children: displayName }), /*#__PURE__*/ _jsxs("p", { className: "text-white/85 text-xs", children: [ t('profile.member_since'), " ", new Date(user.createdAt).toLocaleDateString(dateLocale) ] }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "shrink-0", children: [ user.planTier && user.planTier !== 'free' && /*#__PURE__*/ _jsx(PlanBadge, { tier: user.planTier, verified: user.hasVerifiedBadge, size: "sm" }), user.hasVerifiedBadge && user.planTier === 'free' && /*#__PURE__*/ _jsx(PlanBadge, { tier: "free", verified: true, size: "sm" }) ] }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-start gap-5", children: [ /*#__PURE__*/ _jsx("div", { className: "w-20 h-20 rounded-full bg-green-100 flex-shrink-0 flex items-center justify-center text-green-700 text-2xl font-bold overflow-hidden border-2 border-gray-100", children: user.image ? /*#__PURE__*/ _jsx("img", { src: user.image, alt: displayName, className: "w-full h-full object-cover" }) : initials }), /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 flex-wrap mb-1", children: [ /*#__PURE__*/ _jsx("h1", { className: "text-xl font-bold text-gray-900", children: displayName }), user.planTier && user.planTier !== 'free' && /*#__PURE__*/ _jsx(PlanBadge, { tier: user.planTier, verified: user.hasVerifiedBadge, size: "sm" }), user.hasVerifiedBadge && user.planTier === 'free' && /*#__PURE__*/ _jsx(PlanBadge, { tier: "free", verified: true, size: "sm" }), Array.isArray(user.activeStatuses) && user.activeStatuses.includes('can_help_now') && /*#__PURE__*/ _jsxs("span", { className: "inline-flex items-center gap-1 text-xs font-medium text-green-700 bg-green-50 border border-green-200 px-2 py-0.5 rounded-full", children: [ /*#__PURE__*/ _jsx("span", { className: "w-1.5 h-1.5 rounded-full bg-green-500 animate-pulse" }), t('status.can_help_now', 'Available now') ] }), Array.isArray(user.activeStatuses) && user.activeStatuses.includes('need_help') && /*#__PURE__*/ _jsxs("span", { className: "inline-flex items-center gap-1 text-xs font-medium text-green-700 bg-green-50 border border-green-200 px-2 py-0.5 rounded-full", children: [ /*#__PURE__*/ _jsx("span", { className: "w-1.5 h-1.5 rounded-full bg-green-500" }), t('status.need_help', 'Need help') ] }), (session ? ((_session_user = session.user) === null || _session_user === void 0 ? void 0 : _session_user.id) !== id : true) && /*#__PURE__*/ _jsxs("div", { className: "ml-auto flex items-center gap-2", children: [ !session ? // Guest — show button that leads to registration /*#__PURE__*/ _jsxs("a", { href: "/register", className: "flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-sm font-medium bg-green-50 text-green-600 border border-green-200 hover:bg-green-100 transition", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }), /*#__PURE__*/ _jsx("span", { children: t('chat.write_btn', 'Write') }) ] }) : (canMsg === null || canMsg === void 0 ? void 0 : canMsg.allowed) === false ? /*#__PURE__*/ _jsx(UpgradePrompt, { feature: t('chat.write_btn', 'Write'), requiredTier: "pro", variant: "inline", t: t }) : /*#__PURE__*/ _jsxs("button", { onClick: handleMessage, disabled: msgLoading, className: "flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-sm font-medium bg-green-50 text-green-600 border border-green-200 hover:bg-green-100 transition disabled:opacity-50", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }), /*#__PURE__*/ _jsx("span", { children: t('chat.write_btn') }) ] }), /*#__PURE__*/ _jsxs("button", { onClick: toggleFavorite, disabled: favLoading, title: isFavorite ? t('specialist.unfavorite') : t('specialist.favorite'), className: "flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-sm font-medium transition disabled:opacity-50 ".concat(isFavorite ? 'bg-pink-50 text-pink-600 border border-pink-200 hover:bg-pink-100' : 'bg-gray-50 text-gray-600 border border-gray-200 hover:bg-gray-100'), children: [ /*#__PURE__*/ _jsx("span", { children: isFavorite ? '❀' : '🀍' }), /*#__PURE__*/ _jsx("span", { children: isFavorite ? t('specialist.unfavorite') : t('specialist.favorite') }) ] }) ] }) ] }), rating && /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-1.5 mb-2", children: [ /*#__PURE__*/ _jsx("span", { className: "text-yellow-400 text-lg", children: "★" }), /*#__PURE__*/ _jsx("span", { className: "font-semibold text-gray-800", children: Number(rating).toFixed(1) }), /*#__PURE__*/ _jsxs("span", { className: "text-sm text-gray-400", children: [ "(", reviews.length, " ", t('profile.reviews').toLowerCase(), ")" ] }) ] }), /*#__PURE__*/ _jsxs("p", { className: "text-sm text-gray-400", children: [ t('profile.member_since'), " ", new Date(user.createdAt).toLocaleDateString(dateLocale), user.lastSeenAt && /*#__PURE__*/ _jsxs("span", { className: "ml-2", children: [ "\xb7 ", formatLastSeen(user.lastSeenAt, t) ] }) ] }) ] }) ] }), user.bio && /*#__PURE__*/ _jsx("p", { className: "mt-4 text-gray-700 text-sm leading-relaxed border-t border-gray-100 pt-4", children: user.bio }), user.phone && /*#__PURE__*/ _jsxs("div", { className: "mt-4 border-t border-gray-100 pt-4 flex items-center gap-2", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M3 5a2 2 0 012-2h3.28a1 1 0 01.948.684l1.498 4.493a1 1 0 01-.502 1.21l-2.257 1.13a11.042 11.042 0 005.516 5.516l1.13-2.257a1 1 0 011.21-.502l4.493 1.498a1 1 0 01.684.949V19a2 2 0 01-2 2h-1C9.716 21 3 14.284 3 6V5z" }) }), /*#__PURE__*/ _jsx("a", { href: "tel:".concat(user.phone), className: "text-sm font-medium text-gray-700 hover:text-green-600", children: user.phone }) ] }), user.personalSiteSlug && /*#__PURE__*/ _jsxs("div", { className: "mt-3 flex items-center gap-2", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _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" }) }), /*#__PURE__*/ _jsxs("a", { href: "/site/".concat(user.personalSiteSlug), target: "_blank", rel: "noopener noreferrer", className: "text-sm text-green-600 hover:underline", children: [ "canhelp.gr/site/", user.personalSiteSlug ] }) ] }), user.languages && user.languages.length > 0 && /*#__PURE__*/ _jsxs("div", { className: "mt-4 border-t border-gray-100 pt-4", children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs font-medium text-gray-500 mb-2 uppercase tracking-wide", children: t('profile.languages') }), /*#__PURE__*/ _jsx("div", { className: "flex flex-wrap gap-2", children: user.languages.map((code)=>{ const langMap = { el: { flag: '🇬🇷', label: 'ΕλληΜικά' }, en: { flag: '🇬🇧', label: 'English' }, ru: { flag: '🇷🇺', label: 'РусскОй' }, uk: { flag: '🇺🇊', label: 'УкраїМська' }, de: { flag: '🇩🇪', label: 'Deutsch' }, fr: { flag: '🇫🇷', label: 'Français' }, it: { flag: '🇮🇹', label: 'Italiano' }, es: { flag: '🇪🇞', label: 'Español' }, ar: { flag: '🇞🇊', label: 'العرؚية' }, zh: { flag: '🇚🇳', label: 'äž­æ–‡' } }; const lang = langMap[code]; if (!lang) return null; return /*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-1.5 bg-indigo-50 text-indigo-700 text-sm px-3 py-1 rounded-full border border-indigo-100", children: [ /*#__PURE__*/ _jsx("span", { children: lang.flag }), /*#__PURE__*/ _jsx("span", { children: lang.label }) ] }, code); }) }) ] }), user.skills && user.skills.length > 0 && specialistCards.length === 0 && /*#__PURE__*/ _jsxs("div", { className: "mt-4 border-t border-gray-100 pt-4", children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs font-medium text-gray-500 mb-2 uppercase tracking-wide", children: t('profile.skills.label') }), /*#__PURE__*/ _jsx("div", { className: "flex flex-wrap gap-2", children: user.skills.map((skill)=>/*#__PURE__*/ _jsx("span", { className: "bg-green-50 text-green-700 text-sm px-3 py-1 rounded-full", children: skill }, skill)) }) ] }), user.role === 'specialist' && user.specialistCategories && user.specialistCategories.length > 0 && specialistCards.length === 0 && /*#__PURE__*/ _jsxs("div", { className: "mt-4 border-t border-gray-100 pt-4", children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs font-medium text-gray-500 mb-2 uppercase tracking-wide", children: t('user.categories') }), /*#__PURE__*/ _jsx("div", { className: "flex flex-wrap gap-2", children: user.specialistCategories.map((slug)=>/*#__PURE__*/ _jsx("span", { className: "bg-purple-50 text-purple-700 text-sm px-3 py-1 rounded-full", children: slug }, slug)) }) ] }), user.role === 'specialist' && user.specialistLocations && user.specialistLocations.length > 0 && specialistCards.length === 0 && /*#__PURE__*/ _jsxs("div", { className: "mt-4 border-t border-gray-100 pt-4", children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs font-medium text-gray-500 mb-2 uppercase tracking-wide", children: t('user.work_area') }), /*#__PURE__*/ _jsx("div", { className: "flex flex-wrap gap-2", children: user.specialistLocations.map((slug)=>/*#__PURE__*/ _jsxs("span", { className: "bg-emerald-50 text-emerald-700 text-sm px-3 py-1 rounded-full", children: [ "\uD83D\uDCCD ", slug ] }, slug)) }) ] }) ] }), user.role === 'specialist' && /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6 mb-6", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between mb-4", children: [ /*#__PURE__*/ _jsxs("h2", { className: "font-bold text-gray-900 text-lg", children: [ "\uD83D\uDCC5 ", t('nav.schedule') ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 text-xs text-gray-500", children: [ /*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-1.5", children: [ /*#__PURE__*/ _jsx("span", { className: "w-3 h-3 rounded bg-emerald-200 border border-emerald-400 inline-block" }), t('schedule.available') ] }), /*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-1.5", children: [ /*#__PURE__*/ _jsx("span", { className: "w-3 h-3 rounded bg-red-200 border border-red-400 inline-block" }), t('schedule.busy') ] }) ] }) ] }), /*#__PURE__*/ _jsx(ReadOnlyCalendar, { year: availYear, month: availMonth, availMap: availMap, today: today, onPrev: ()=>{ if (availMonth === 0) { setAvailYear((y)=>y - 1); setAvailMonth(11); } else setAvailMonth((m)=>m - 1); }, onNext: ()=>{ if (availMonth === 11) { setAvailYear((y)=>y + 1); setAvailMonth(0); } else setAvailMonth((m)=>m + 1); } }) ] }), (user.role === 'specialist' || user.role === 'admin') && specialistCards.length > 0 && /*#__PURE__*/ _jsxs("div", { className: "space-y-4 mb-6", children: [ /*#__PURE__*/ _jsx("h2", { className: "font-bold text-white text-lg", children: t('nav.specialists') }), specialistCards.map((card)=>{ var _priceLists_card_id; return /*#__PURE__*/ _jsx(PublicCardView, { card: card, locale: locale, catMap: catMap, locMap: locMap, t: t, priceList: (_priceLists_card_id = priceLists[card.id]) !== null && _priceLists_card_id !== void 0 ? _priceLists_card_id : [] }, card.id); }) ] }), /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ _jsxs("h2", { className: "font-bold text-gray-900 text-lg mb-4", children: [ t('profile.reviews'), reviews.length > 0 && /*#__PURE__*/ _jsxs("span", { className: "text-gray-400 font-normal text-base ml-2", children: [ "(", reviews.length, ")" ] }) ] }), reviews.length === 0 ? /*#__PURE__*/ _jsx("p", { className: "text-gray-500 text-sm", children: t('profile.no_reviews') }) : /*#__PURE__*/ _jsx("div", { className: "space-y-4", children: reviews.map((param)=>{ let { review, author } = param; var _author_name_, _author_name; var _author_name__toUpperCase, _shortName; return /*#__PURE__*/ _jsx("div", { className: "border-b border-gray-50 pb-4 last:border-0 last:pb-0", children: /*#__PURE__*/ _jsxs("div", { className: "flex items-start gap-3", children: [ /*#__PURE__*/ _jsx("div", { className: "w-8 h-8 rounded-full bg-gray-100 flex-shrink-0 flex items-center justify-center text-gray-600 text-sm font-bold overflow-hidden", children: (author === null || author === void 0 ? void 0 : author.image) ? /*#__PURE__*/ _jsx("img", { src: author.image, alt: author.name, className: "w-full h-full object-cover" }) : (_author_name__toUpperCase = author === null || author === void 0 ? void 0 : (_author_name = author.name) === null || _author_name === void 0 ? void 0 : (_author_name_ = _author_name[0]) === null || _author_name_ === void 0 ? void 0 : _author_name_.toUpperCase()) !== null && _author_name__toUpperCase !== void 0 ? _author_name__toUpperCase : '?' }), /*#__PURE__*/ _jsxs("div", { className: "flex-1", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 mb-1", children: [ /*#__PURE__*/ _jsx("span", { className: "text-sm font-medium text-gray-800", children: (_shortName = shortName(author === null || author === void 0 ? void 0 : author.name)) !== null && _shortName !== void 0 ? _shortName : '—' }), /*#__PURE__*/ _jsxs("span", { className: "text-yellow-400", children: [ '★'.repeat(review.rating), '☆'.repeat(5 - review.rating) ] }) ] }), review.comment && /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-600", children: review.comment }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-1", children: new Date(review.createdAt).toLocaleDateString(dateLocale) }) ] }) ] }) }, review.id); }) }) ] }) ] }); } function ReadOnlyCalendar(param) { let { year, month, availMap, today, onPrev, onNext } = param; const { locale, t } = useLocale(); var _WEEK_DAYS_BY_LOCALE_locale; const weekDays = (_WEEK_DAYS_BY_LOCALE_locale = WEEK_DAYS_BY_LOCALE[locale]) !== null && _WEEK_DAYS_BY_LOCALE_locale !== void 0 ? _WEEK_DAYS_BY_LOCALE_locale : WEEK_DAYS_BY_LOCALE.ru; var _MONTHS_BY_LOCALE_locale; const months = (_MONTHS_BY_LOCALE_locale = MONTHS_BY_LOCALE[locale]) !== null && _MONTHS_BY_LOCALE_locale !== void 0 ? _MONTHS_BY_LOCALE_locale : MONTHS_BY_LOCALE.ru; const firstDay = new Date(year, month, 1); const startDow = (firstDay.getDay() + 6) % 7; const daysInMonth = new Date(year, month + 1, 0).getDate(); const prevMonthDays = new Date(year, month, 0).getDate(); const cells = []; for(let i = startDow - 1; i >= 0; i--){ cells.push({ day: prevMonthDays - i, cur: false, dateKey: '' }); } for(let d = 1; d <= daysInMonth; d++){ const dateKey = "".concat(year, "-").concat(String(month + 1).padStart(2, '0'), "-").concat(String(d).padStart(2, '0')); cells.push({ day: d, cur: true, dateKey }); } const remainder = cells.length % 7; if (remainder !== 0) { for(let d = 1; d <= 7 - remainder; d++){ cells.push({ day: d, cur: false, dateKey: '' }); } } const monthPrefix = "".concat(year, "-").concat(String(month + 1).padStart(2, '0')); const availCount = Object.entries(availMap).filter((param)=>{ let [k, v] = param; return k.startsWith(monthPrefix) && k >= today && v === 'available'; }).length; return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between mb-3", children: [ /*#__PURE__*/ _jsx("button", { onClick: onPrev, className: "w-7 h-7 rounded-lg hover:bg-gray-100 flex items-center justify-center text-gray-500", children: "‹" }), /*#__PURE__*/ _jsxs("div", { className: "text-center", children: [ /*#__PURE__*/ _jsxs("span", { className: "font-medium text-gray-800 text-sm", children: [ months[month], " ", year ] }), availCount > 0 && /*#__PURE__*/ _jsxs("span", { className: "ml-2 text-xs text-emerald-600", children: [ availCount, " ", t('schedule.free_days') ] }) ] }), /*#__PURE__*/ _jsx("button", { onClick: onNext, className: "w-7 h-7 rounded-lg hover:bg-gray-100 flex items-center justify-center text-gray-500", children: "›" }) ] }), /*#__PURE__*/ _jsx("div", { className: "grid grid-cols-7 mb-1", children: weekDays.map((d)=>/*#__PURE__*/ _jsx("div", { className: "text-center text-xs text-gray-400 py-1", children: d }, d)) }), /*#__PURE__*/ _jsx("div", { className: "grid grid-cols-7 gap-0.5", children: cells.map((cell, idx)=>{ if (!cell.cur) { return /*#__PURE__*/ _jsx("div", { className: "h-9 flex items-center justify-center text-xs text-gray-200", children: cell.day }, "e-".concat(idx)); } const status = availMap[cell.dateKey]; const isPast = cell.dateKey < today; const isToday = cell.dateKey === today; let cls = 'h-9 flex items-center justify-center rounded-lg text-sm font-medium '; if (isPast) { cls += 'text-gray-200 '; } else if (status === 'available') { cls += 'bg-emerald-100 border border-emerald-300 text-emerald-700 '; } else if (status === 'busy') { cls += 'bg-red-100 border border-red-300 text-red-600 '; } else { cls += 'text-gray-500 '; } if (isToday) cls += 'ring-2 ring-blue-400 ring-offset-1 '; return /*#__PURE__*/ _jsx("div", { className: cls, children: cell.day }, cell.dateKey); }) }) ] }); } // ─── Public card view ───────────────────────────────────────────────────────── function flattenTree(nodes) { return nodes.flatMap((n)=>{ var _n_children; return [ n, ...flattenTree((_n_children = n.children) !== null && _n_children !== void 0 ? _n_children : []) ]; }); } function PublicCardView(param) { let { card, locale, catMap, locMap, t, priceList } = param; const [lightbox, setLightbox] = useState(null); const [expandedAreas, setExpandedAreas] = useState([]); const locById = new Map(); for (const node of locMap.values()){ if (node === null || node === void 0 ? void 0 : node.id) locById.set(node.id, node); } const getLocName = (loc, fallback)=>{ var _loc_names, _loc_names1; return (loc === null || loc === void 0 ? void 0 : (_loc_names = loc.names) === null || _loc_names === void 0 ? void 0 : _loc_names[locale]) || (loc === null || loc === void 0 ? void 0 : (_loc_names1 = loc.names) === null || _loc_names1 === void 0 ? void 0 : _loc_names1.el) || fallback; }; const locationGroups = (()=>{ const grouped = new Map(); var _card_locations; for (const slug of (_card_locations = card.locations) !== null && _card_locations !== void 0 ? _card_locations : []){ const loc = locMap.get(slug); if (!loc) { if (!grouped.has(slug)) { grouped.set(slug, { root: { slug, names: { el: slug } }, rootSlug: slug, districts: [], districtSlugs: new Set() }); } continue; } let root = loc; const seenIds = new Set(); while((root === null || root === void 0 ? void 0 : root.parentId) && locById.has(root.parentId) && !seenIds.has(root.parentId)){ seenIds.add(root.parentId); root = locById.get(root.parentId); } var _root_slug; const rootSlug = (_root_slug = root === null || root === void 0 ? void 0 : root.slug) !== null && _root_slug !== void 0 ? _root_slug : slug; if (!grouped.has(rootSlug)) { grouped.set(rootSlug, { root, rootSlug, districts: [], districtSlugs: new Set() }); } const group = grouped.get(rootSlug); if (loc.slug !== rootSlug && !group.districtSlugs.has(loc.slug)) { group.districtSlugs.add(loc.slug); group.districts.push(loc); } } return Array.from(grouped.values()); })(); var _lightbox_title; return /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 overflow-hidden", children: [ /*#__PURE__*/ _jsxs("div", { className: "px-5 py-4 border-b border-gray-100", children: [ /*#__PURE__*/ _jsx("h3", { className: "font-bold text-gray-900", children: card.title }), card.description && /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-600 mt-1", children: card.description }) ] }), /*#__PURE__*/ _jsxs("div", { className: "p-5 space-y-4", children: [ card.skills && card.skills.length > 0 && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs font-semibold text-gray-500 uppercase tracking-wide mb-2", children: t('card.skills') }), /*#__PURE__*/ _jsx("div", { className: "flex flex-wrap gap-2", children: card.skills.map((s)=>/*#__PURE__*/ _jsx("span", { className: "bg-green-50 text-green-700 text-sm px-3 py-1 rounded-full", children: s }, s)) }) ] }), card.categories && card.categories.length > 0 && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs font-semibold text-gray-500 uppercase tracking-wide mb-2", children: t('card.categories') }), /*#__PURE__*/ _jsx("div", { className: "flex flex-wrap gap-2", children: card.categories.map((s)=>{ var _cat_names, _cat_names1; const cat = catMap.get(s); const name = cat ? ((_cat_names = cat.names) === null || _cat_names === void 0 ? void 0 : _cat_names[locale]) || ((_cat_names1 = cat.names) === null || _cat_names1 === void 0 ? void 0 : _cat_names1.el) || s : s; return /*#__PURE__*/ _jsxs("span", { className: "bg-purple-50 text-purple-700 text-sm px-3 py-1 rounded-full", children: [ (cat === null || cat === void 0 ? void 0 : cat.icon) ? /*#__PURE__*/ _jsx("span", { className: "mr-1 inline-flex align-middle", children: /*#__PURE__*/ _jsx(CategoryIcon, { icon: cat.icon, alt: name, className: isCategoryIconUrl(cat.icon) ? 'h-4 w-4 object-contain' : 'text-sm leading-none', fallback: "\uD83D\uDCE6" }) }) : null, name ] }, s); }) }) ] }), card.locations && card.locations.length > 0 && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs font-semibold text-gray-500 uppercase tracking-wide mb-2", children: t('user.work_area') }), /*#__PURE__*/ _jsxs("div", { className: "space-y-2", children: [ /*#__PURE__*/ _jsx("div", { className: "flex flex-wrap gap-2", children: locationGroups.map((group)=>{ const expanded = expandedAreas.includes(group.rootSlug); const canExpand = group.districts.length > 0; return /*#__PURE__*/ _jsxs("button", { type: "button", onClick: ()=>{ if (!canExpand) return; setExpandedAreas((prev)=>prev.includes(group.rootSlug) ? prev.filter((slug)=>slug !== group.rootSlug) : [ ...prev, group.rootSlug ]); }, className: "inline-flex items-center gap-1.5 text-sm px-3 py-1.5 rounded-full border transition ".concat(expanded ? 'bg-emerald-100 text-emerald-800 border-emerald-300' : 'bg-emerald-50 text-emerald-700 border-emerald-200 hover:bg-emerald-100', " ").concat(canExpand ? 'cursor-pointer' : 'cursor-default'), children: [ /*#__PURE__*/ _jsx("span", { children: "\uD83D\uDCCD" }), /*#__PURE__*/ _jsx("span", { children: getLocName(group.root, group.rootSlug) }), canExpand && /*#__PURE__*/ _jsx("span", { className: "text-[11px] font-semibold px-1.5 py-0.5 rounded-full bg-white/80 text-emerald-700 border border-emerald-200", children: expanded ? '−' : "+".concat(group.districts.length) }) ] }, group.rootSlug); }) }), locationGroups.filter((group)=>expandedAreas.includes(group.rootSlug) && group.districts.length > 0).map((group)=>/*#__PURE__*/ _jsxs("div", { className: "rounded-xl border border-emerald-100 bg-emerald-50/40 p-3", children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs text-emerald-700 font-medium mb-2", children: getLocName(group.root, group.rootSlug) }), /*#__PURE__*/ _jsx("div", { className: "flex flex-wrap gap-1.5", children: group.districts.map((district)=>/*#__PURE__*/ _jsx("span", { className: "text-xs px-2.5 py-1 rounded-full bg-white border border-emerald-200 text-emerald-700", children: getLocName(district, district.slug) }, district.slug)) }) ] }, "".concat(group.rootSlug, "-children"))) ] }) ] }), priceList.length > 0 && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs font-semibold text-gray-500 uppercase tracking-wide mb-3", children: t('profile.card.tab.pricelist') }), /*#__PURE__*/ _jsx("div", { className: "space-y-3", children: priceList.map((group)=>/*#__PURE__*/ _jsxs("div", { className: "border border-gray-200 rounded-xl overflow-hidden", children: [ /*#__PURE__*/ _jsx("div", { className: "bg-gray-50 px-4 py-2 border-b border-gray-200", children: /*#__PURE__*/ _jsx("span", { className: "font-semibold text-sm text-gray-800", children: group.title }) }), /*#__PURE__*/ _jsx("div", { className: "divide-y divide-gray-100", children: group.items.map((item)=>/*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 px-4 py-2.5 text-sm", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ _jsx("p", { className: "font-medium text-gray-800", children: item.name }), item.description && /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-500", children: item.description }) ] }), (item.price || item.unit) && /*#__PURE__*/ _jsxs("span", { className: "text-green-700 font-semibold whitespace-nowrap", children: [ item.price ? "€".concat(item.price) : '', item.unit ? " ".concat(item.unit) : '' ] }) ] }, item.id)) }) ] }, group.id)) }) ] }), card.portfolio && card.portfolio.length > 0 && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs font-semibold text-gray-500 uppercase tracking-wide mb-2", children: t('card.portfolio') }), /*#__PURE__*/ _jsx("div", { className: "grid grid-cols-2 sm:grid-cols-3 gap-3", children: card.portfolio.map((item)=>{ var _item_title; return /*#__PURE__*/ _jsxs("button", { type: "button", onClick: ()=>setLightbox(item), className: "group relative rounded-xl overflow-hidden border border-gray-200 bg-gray-50 text-left", children: [ /*#__PURE__*/ _jsx("img", { src: item.imageUrl, alt: (_item_title = item.title) !== null && _item_title !== void 0 ? _item_title : '', className: "w-full aspect-square object-cover group-hover:scale-105 transition-transform duration-200" }), item.title && /*#__PURE__*/ _jsx("div", { className: "px-2 py-1.5", children: /*#__PURE__*/ _jsx("p", { className: "text-xs font-medium text-gray-700 truncate", children: item.title }) }) ] }, item.id); }) }) ] }) ] }), lightbox && /*#__PURE__*/ _jsx("div", { className: "fixed inset-0 z-50 flex items-center justify-center bg-black/80 px-4", onClick: ()=>setLightbox(null), children: /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-2xl overflow-hidden max-w-lg w-full shadow-2xl", onClick: (e)=>e.stopPropagation(), children: [ /*#__PURE__*/ _jsx("img", { src: lightbox.imageUrl, alt: (_lightbox_title = lightbox.title) !== null && _lightbox_title !== void 0 ? _lightbox_title : '', className: "w-full max-h-[60vh] object-contain bg-gray-900" }), (lightbox.title || lightbox.description) && /*#__PURE__*/ _jsxs("div", { className: "p-4", children: [ lightbox.title && /*#__PURE__*/ _jsx("p", { className: "font-semibold text-gray-800 mb-1", children: lightbox.title }), lightbox.description && /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-600", children: lightbox.description }) ] }), /*#__PURE__*/ _jsx("div", { className: "flex justify-end px-4 pb-4", children: /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setLightbox(null), className: "text-sm text-gray-500 hover:text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-100", children: t('card.close') }) }) ] }) }) ] }); } `ÐÿÿÐÿÿ ÐÿÿFÎÿÿ®Ïÿÿ•Ðÿÿþ€Ðÿÿ ¥ÐÿÿŠÐÿÿ§ÐÿÿšÐÿÿ57457809b34ebfd9¬ÐÿÿDÎÿÿ  ­Ðÿÿ ReadOnlyCalendar‹flattenTreeŽPublicCardViewMONTHS_BY_LOCALE“WEEK_DAYS_BY_LOCALEãÐÿÿUserProfilePage •mÿyBŸÏÿÿ¥Ïÿÿ `  dÿÿý€ a=| b=|€ `}@© `,€ Aªá `7€ Aâ `-€ A8 `(€ A9L @€ AMˆ `;€ A‰Ç `>€ AÈþ `6€ Aÿ2 `3€ A3 c L A\ ²² AM ²² al@( @ã—Ðÿÿ—Ðÿÿ b=|=Îÿÿ=Îÿÿ `,äÐÿÿäÐÿÿ `7éÐÿÿéÐÿÿ `-æÐÿÿæÐÿÿ `(éÐÿÿéÐÿÿ @š@/components/UpgradePromptÿ `;èÐÿÿèÐÿÿ `> ”@/lib/formatLastSeenÿ `6 ÓÿÿÓÿÿ `3` ÙÿÿÙÿÿ c LÓçÐÿÿ al@( õùÿÿôùÿÿ Añ ú    ãÐÿÿÔÐÿÿÔÐÿÿý cnn ôÐÿÿóÐÿÿ A !   ûÖÐÿÿÖÐÿÿþ coo# ëÐÿÿêÐÿÿ AC M   ÷ÐÐÿÿÐÐÿÿþ cpp( ÜÐÿÿÛÐÿÿ Ad m   óÈÐÿÿÈÐÿÿþ cqq |Ðÿÿ{Ðÿÿ A •   ïÎÿÿÎÿÿþ crr$ xÐÿÿwÐÿÿ A¿ Ç   ëÎÿÿÎÿÿþ cs"s* tÐÿÿsÐÿÿ Aí õ   çÎÿÿÎÿÿþ ct t( pÐÿÿoÐÿÿ A '   ãÎÿÿÎÿÿþ cu"u* lÐÿÿkÐÿÿ Aa i   ß Îÿÿ Îÿÿþ cv2v: hÐÿÿgÐÿÿ A— Ÿ   ÛÎÿÿÎÿÿþ cw(w0 dÐÿÿcÐÿÿ AÅ Í   ×ÎÿÿÎÿÿþ cx x( `Ðÿÿ_Ðÿÿ Aú    ÓÎÿÿÎÿÿþ cy y( \Ðÿÿ[Ðÿÿ A7 ?   ÏüÍÿÿüÍÿÿþ cz(z0 XÐÿÿWÐÿÿ Ap x   ËøÍÿÿøÍÿÿþ c{({0 TÐÿÿSÐÿÿ A© ±   ÇôÍÿÿôÍÿÿþ c|(|0 PÐÿÿOÐÿÿ AÚ â   ÃðÍÿÿðÍÿÿþ c} }( LÐÿÿKÐÿÿ A@ H   ¿ìÍÿÿìÍÿÿþ @€`&@€`. HÐÿÿGÐÿÿ A…    »èÍÿÿèÍÿÿþ @`(@`0 DÐÿÿCÐÿÿ AÃ Ë   ·äÍÿÿäÍÿÿþ @‚`$@‚`, FÐÿÿEÐÿÿ A‚‹  ³àÍÿÿàÍÿÿþ @…@…`  ŽgetUserProfileþ AÍÛ  ®‹Ðÿÿ‹Ðÿÿþ @ˆ` @ˆ` ŽgetUserReviewsþ Aõ  ©†Ðÿÿ†Ðÿÿþ @‰` @‰` getUserRatingþ A"  €ÐÿÿÐÿÿþ @Š` @Š` getCategoriesþ A4A  Ÿ|Ðÿÿ|Ðÿÿþ @‹` @‹` ÃùÿÿÂùÿÿ A_k  ›xÐÿÿxÐÿÿþ @Œ` @Œ` ’getSpecialistCardsþ Ap‚  –sÐÿÿsÐÿÿþ @›`@›`" ŒgetPriceListþ A  ‘nÐÿÿnÐÿÿþ @ž`@ž`$  ÐÿÿÐÿÿ A  ºÍÿÿºÍÿÿþ @­@­`  –getSpecialistFavoritesþ Af|  ˆeÐÿÿeÐÿÿþ @°@°` getCanMessageþ AMZ  ƒ`Ðÿÿ`Ðÿÿþ @·` @·` ˜removeSpecialistFavoriteþ A–®  ~ÿÿÿ[Ðÿÿ[Ðÿÿþ @Å`@Å`. •addSpecialistFavoriteþ A  yÿÿÿVÐÿÿVÐÿÿþ @È`@È`+ 6ûÿÿ5ûÿÿ AZo  uÿÿÿRÐÿÿRÐÿÿþ @Õ`#@Õ`8 ÐÿÿÐÿÿ Aìõ  qÿÿÿžÍÿÿžÍÿÿþ @Ú@Ú`  ™getSpecialistAvailabilityþ Aš  lÿÿÿIÐÿÿIÐÿÿþ @Ý@Ý`! ÐÿÿÐÿÿ A=A  hÿÿÿîÏÿÿîÏÿÿþ @í`&@í`* üÏÿÿýÏÿÿ AÐÔ  dÿÿÿêÏÿÿêÏÿÿþ @ñ`$@ñ`( úÐÿÿùÐÿÿ Aåô  `ÿÿÿ?Ðÿÿ?Ðÿÿþ @÷`@÷`' ÐÐÿÿÑÐÿÿ Ak!p!  \ÿÿÿâÏÿÿâÏÿÿþ @ù`@ù` ÌÐÿÿÍÐÿÿ AÛ!à!  XÿÿÿÞÏÿÿÞÏÿÿþ @ü`@ü` ÈÐÿÿÉÐÿÿ Az""  TÿÿÿÚÏÿÿÚÏÿÿþ @ÿ`"@ÿ`' èÏÿÿéÏÿÿ Aã$ç$  PÿÿÿÖÏÿÿÖÏÿÿþ @`*@`. ÀÐÿÿÁÐÿÿ A€%©%  LÿÿÿÒÏÿÿÒÏÿÿþ @ `*@ `/ ŒÐÿÿœÐÿÿ Ay&~&  HÿÿÿÎÏÿÿÎÏÿÿþ @ `2@ `7 ÜÏÿÿÝÏÿÿ AL'P'  DÿÿÿÊÏÿÿÊÏÿÿþ @`:@`> ØÏÿÿÙÏÿÿ A†(Š(  @ÿÿÿÆÏÿÿÆÏÿÿþ @`U@`Y °Ðÿÿ±Ðÿÿ A#*(*  <ÿÿÿÂÏÿÿÂÏÿÿþ @`:@`? ÐÏÿÿÑÏÿÿ Aö*ú*  8ÿÿÿŸÏÿÿŸÏÿÿþ @`B@`F šÐÿÿ©Ðÿÿ A6,;,  4ÿÿÿºÏÿÿºÏÿÿþ @`B@`G €Ðÿÿ¥Ðÿÿ AE/J/  0ÿÿÿ¶Ïÿÿ¶Ïÿÿþ @+`2@+`7 ÄÏÿÿÅÏÿÿ A.020  ,ÿÿÿ²Ïÿÿ²Ïÿÿþ @.`g@.`k TÒÿÿSÒÿÿ A30<0 4(ÿÿÿ 8Òÿÿ8Òÿÿþ @.`l@.`u ŒÏÿÿœÏÿÿ A°1Ž1  $ÿÿÿªÏÿÿªÏÿÿþ @3`o@3`søLÒÿÿ Aµ1Ÿ1 4!ÿÿÿ 1Òÿÿ1Òÿÿþ @3`t@3`} ‘Ðÿÿ’Ðÿÿ A3•3  ÿÿÿ£Ïÿÿ£Ïÿÿþ @>`"@>`' ±Ïÿÿ²Ïÿÿ A*4.4  ÿÿÿŸÏÿÿŸÏÿÿþ @A`*@A`. ­Ïÿÿ®Ïÿÿ AI5M5  ÿÿÿ›Ïÿÿ›Ïÿÿþ @C`E@C`I …Ðÿÿ†Ðÿÿ A†6‹6  ÿÿÿ—Ïÿÿ—Ïÿÿþ @I`*@I`/ Ðÿÿ‚Ðÿÿ A0757   ÿÿÿ“Ïÿÿ“Ïÿÿþ @L`2@L`7 ¡Ïÿÿ¢Ïÿÿ A 88   ÿÿÿÏÿÿÏÿÿþ @O`:@O`> ÏÿÿžÏÿÿ AR9V9  ÿÿÿ‹Ïÿÿ‹Ïÿÿþ @S`g@S`kÙ-Òÿÿ AW9`9 4ÿÿÿ ÒÿÿÒÿÿþ @S`l@S`u –Ïÿÿ—Ïÿÿ AÔ:Ø:  þþÿÿ„Ïÿÿ„Ïÿÿþ @X`o@X`sÒ&Òÿÿ AÙ:â: 4ûþÿÿ  Òÿÿ Òÿÿþ @X`t@X`} kÐÿÿlÐÿÿ A_<d<  ÷þÿÿ}Ïÿÿ}Ïÿÿþ C]]• ‹ÏÿÿŒÏÿÿ Aª=®=  óþÿÿyÏÿÿyÏÿÿþ @``B@``F cÐÿÿdÐÿÿ A·?Œ?  ïþÿÿuÏÿÿuÏÿÿþ Cff’ ƒÏÿÿ„Ïÿÿ AAA  ëþÿÿqÏÿÿqÏÿÿþ @i`B@i`F [Ðÿÿ\Ðÿÿ A&C+C  çþÿÿmÏÿÿmÏÿÿþ Co¹oŸ WÐÿÿXÐÿÿ A‚D‡D  ãþÿÿiÏÿÿiÏÿÿþ @s`B@s`G wÏÿÿxÏÿÿ ADFHF  ßþÿÿeÏÿÿeÏÿÿþ @w`J@w`N sÏÿÿtÏÿÿ ANHRH  ÛþÿÿaÏÿÿaÏÿÿþ @}`X@}`\ oÏÿÿpÏÿÿ AÊJÎJ  ×þÿÿ]Ïÿÿ]Ïÿÿþ @ƒ`J@ƒ`N kÏÿÿlÏÿÿ AMLQL  ÓþÿÿYÏÿÿYÏÿÿþ C‡”‡˜ UpgradePromptþ ARL_L 4ÎþÿÿÃþÿÿÃþÿÿþ C‡™‡Š >Ðÿÿ?Ðÿÿ AÞMãM  ÊþÿÿPÏÿÿPÏÿÿþ @Œ`G@Œ`L ^Ïÿÿ_Ïÿÿ A PP  ÆþÿÿLÏÿÿLÏÿÿþ @‘`J@‘`N ZÏÿÿ[Ïÿÿ ARR  ÂþÿÿHÏÿÿHÏÿÿþ @—`X@—`\ VÏÿÿWÏÿÿ A’T–T  ŸþÿÿDÏÿÿDÏÿÿþ @`J@`N .Ðÿÿ/Ðÿÿ AòU÷U  ºþÿÿ@Ïÿÿ@Ïÿÿþ @¢`B@¢`G NÏÿÿOÏÿÿ AþXY  ¶þÿÿ<Ïÿÿ<Ïÿÿþ @š`J@š`N JÏÿÿKÏÿÿ AúYþY  ²þÿÿ8Ïÿÿ8Ïÿÿþ @«`J@«`N "Ðÿÿ#Ðÿÿ A5\:\  ®þÿÿ4Ïÿÿ4Ïÿÿþ @Ž`<@Ž`A BÏÿÿCÏÿÿ A] ]  ªþÿÿ0Ïÿÿ0Ïÿÿþ @·`:@·`> >Ïÿÿ?Ïÿÿ A^^  Šþÿÿ,Ïÿÿ,Ïÿÿþ @»`:@»`> ÐÿÿÐÿÿ A;_@_  ¢þÿÿ(Ïÿÿ(Ïÿÿþ @¿`:@¿`? ÐÿÿÐÿÿ Ab b  žþÿÿ$Ïÿÿ$Ïÿÿþ @Ë`2@Ë`7 ÐÿÿÐÿÿ AœcÂc  šþÿÿ Ïÿÿ Ïÿÿþ @Ñ`M@Ñ`R ŽformatLastSeenþ AœdËd  •þÿÿ þÿÿþÿÿþ @Õ`4@Õ`B )Ïÿÿ*Ïÿÿ A3f7f  ‘þÿÿÏÿÿÏÿÿþ @Þ`.@Þ`2 ÐÿÿÐÿÿ A!g&g  þÿÿÏÿÿÏÿÿþ @â`0@â`5 !Ïÿÿ"Ïÿÿ Aßgãg  ‰þÿÿÏÿÿÏÿÿþ @å`*@å`. ÏÿÿÏÿÿ A@iDi  …þÿÿ Ïÿÿ Ïÿÿþ @ë`8@ë`< ÏÿÿÏÿÿ A4k8k  þÿÿÏÿÿÏÿÿþ @ñ`*@ñ`. ñÏÿÿòÏÿÿ A§l¬l  }þÿÿÏÿÿÏÿÿþ @ø`;@ø`@ ÏÿÿÏÿÿ AGmKm  yþÿÿÿÎÿÿÿÎÿÿþ @û`*@û`.  ÏÿÿÏÿÿ Ašn¬n  uþÿÿûÎÿÿûÎÿÿþ @`8@`< åÏÿÿæÏÿÿ App  qþÿÿ÷Îÿÿ÷Îÿÿþ @`*@`/ áÏÿÿâÏÿÿ A“r˜r  mþÿÿóÎÿÿóÎÿÿþ @`Q@`V ÏÿÿÏÿÿ A9s=s  iþÿÿïÎÿÿïÎÿÿþ @`*@`. ýÎÿÿþÎÿÿ A=tAt  eþÿÿëÎÿÿëÎÿÿþ @`*@`. ÕÏÿÿÖÏÿÿ A~ ~  aþÿÿçÎÿÿçÎÿÿþ @I`9@I`> õÎÿÿöÎÿÿ A*.  ]þÿÿãÎÿÿãÎÿÿþ @L`:@L`> ñÎÿÿòÎÿÿ Açë  YþÿÿßÎÿÿßÎÿÿþ @O`:@O`> ÉÏÿÿÊÏÿÿ A¡Š  UþÿÿÛÎÿÿÛÎÿÿþ @X`k@X`p éÎÿÿêÎÿÿ AG‚K‚  Qþÿÿ×Îÿÿ×Îÿÿþ @[`*@[`. åÎÿÿæÎÿÿ ANƒRƒ  MþÿÿÓÎÿÿÓÎÿÿþ @_`*@_`. áÎÿÿâÎÿÿ Aðƒôƒ  IþÿÿÏÎÿÿÏÎÿÿþ @a`Q@a`U ¹ÏÿÿºÏÿÿ A̅х  EþÿÿËÎÿÿËÎÿÿþ Ch¥hª ÙÎÿÿÚÎÿÿ Ar†v†  AþÿÿÇÎÿÿÇÎÿÿþ @k`*@k`. ÕÎÿÿÖÎÿÿ At‡x‡  =þÿÿÃÎÿÿÃÎÿÿþ @o`*@o`. ÑÎÿÿÒÎÿÿ A#ˆ'ˆ  9þÿÿ¿Îÿÿ¿Îÿÿþ @q`^@q`b ©ÏÿÿªÏÿÿ Aý‰Š  5þÿÿ»Îÿÿ»Îÿÿþ Cx£xš ÉÎÿÿÊÎÿÿ A£Š§Š  1þÿÿ·Îÿÿ·Îÿÿþ @{`*@{`. ÅÎÿÿÆÎÿÿ A€‹š‹  -þÿÿ³Îÿÿ³Îÿÿþ @`*@`. ÏÿÿžÏÿÿ ARŒWŒ  )þÿÿ¯Îÿÿ¯Îÿÿþ @`]@`b ™ÏÿÿšÏÿÿ AzŽŽ  %þÿÿ«Îÿÿ«Îÿÿþ @`8@`= •Ïÿÿ–Ïÿÿ A  !þÿÿ§Îÿÿ§Îÿÿþ @`"@`' ‘Ïÿÿ’Ïÿÿ AÏȏ  þÿÿ£Îÿÿ£Îÿÿþ @“`*@“`/ ÏÿÿŽÏÿÿ A"‘'‘  þÿÿŸÎÿÿŸÎÿÿþ @š`*@š`/ ‰ÏÿÿŠÏÿÿ Aë‘ð‘  þÿÿ›Îÿÿ›Îÿÿþ @`2@`7 ©ÎÿÿªÎÿÿ A¹’œ’  þÿÿ—Îÿÿ—Îÿÿþ @ `:@ `> Ïÿÿ‚Ïÿÿ AC”H”   þÿÿ“Îÿÿ“Îÿÿþ @Š`2@Š`7 ¡Îÿÿ¢Îÿÿ A••   þÿÿÎÿÿÎÿÿþ @©`:@©`> ÎÿÿžÎÿÿ Að–ô–  þÿÿ‹Îÿÿ‹Îÿÿþ @³`"@³`& uÏÿÿvÏÿÿ A˜šš  þÿÿ‡Îÿÿ‡Îÿÿþ @Ç`q@Ç`v •Îÿÿ–Îÿÿ A››  ýýÿÿƒÎÿÿƒÎÿÿþ @Ê`"@Ê`& ‘Îÿÿ’Îÿÿ AAœEœ  ùýÿÿÎÿÿÎÿÿþ @Ð`-@Ð`1 iÏÿÿjÏÿÿ A7ž<ž  õýÿÿ{Îÿÿ{Îÿÿþ @Û`@Û` eÏÿÿfÏÿÿ Aў֞  ñýÿÿwÎÿÿwÎÿÿþ @Þ`"@Þ`' aÏÿÿbÏÿÿ AÀŸÅŸ  íýÿÿsÎÿÿsÎÿÿþ @â`@@â`E Îÿÿ‚Îÿÿ A„¡ˆ¡  éýÿÿoÎÿÿoÎÿÿþ @ì`9@ì`= }Îÿÿ~Îÿÿ A-¢1¢  åýÿÿkÎÿÿkÎÿÿþ @ï`'@ï`+ yÎÿÿzÎÿÿ A•£™£  áýÿÿgÎÿÿgÎÿÿþ @õ`1@õ`5 QÏÿÿRÏÿÿ A>€C€  ÝýÿÿcÎÿÿcÎÿÿþ @÷`8@÷`= qÎÿÿrÎÿÿ Aü€¥  Ùýÿÿ_Îÿÿ_Îÿÿþ @ú`6@ú`: mÎÿÿnÎÿÿ AIŠMŠ  Õýÿÿ[Îÿÿ[Îÿÿþ Cü…ü‰ EÏÿÿFÏÿÿ A"©'©  ÑýÿÿWÎÿÿWÎÿÿþ @`6@`; AÏÿÿBÏÿÿ Aè©í©  ÍýÿÿSÎÿÿSÎÿÿþ @`>@`C aÎÿÿbÎÿÿ Aܪઠ ÉýÿÿOÎÿÿOÎÿÿþ @`F@`J û÷ÿÿú÷ÿÿ A««Ž«  Åýÿÿ€Îÿÿ€Îÿÿþ @ `T@ `] 5Ïÿÿ6Ïÿÿ Aª¬¯¬  ÁýÿÿGÎÿÿGÎÿÿþ @ `F@ `K UÎÿÿVÎÿÿ AH¯L¯  œýÿÿCÎÿÿCÎÿÿþ @`P@`T QÎÿÿRÎÿÿ Ak°o°  ¹ýÿÿ?Îÿÿ?Îÿÿþ @`>@`B ®Îÿÿ­Îÿÿ A2³;³   ˜ÎÿÿÎÿÿÎÿÿý @+`@+`# $Ïÿÿ%Ïÿÿ AĹɹ  û6Îÿÿ6Îÿÿþ @S`@S`  Ïÿÿ!Ïÿÿ Aºº  ÷2Îÿÿ2Îÿÿþ @U`@U` @ÎÿÿAÎÿÿ A“º—º  ó.Îÿÿ.Îÿÿþ @X`"@X`& ÏÿÿÏÿÿ A§»¬»  ï*Îÿÿ*Îÿÿþ @]`"@]`' ÏÿÿÏÿÿ A6Œ;Œ  ë&Îÿÿ&Îÿÿþ @``*@``/ ÏÿÿÏÿÿ AŜʜ  ç"Îÿÿ"Îÿÿþ @h`<@h`A 0Îÿÿ1Îÿÿ Aw¿{¿  ãÎÿÿÎÿÿþ @r`"@r`& ,Îÿÿ-Îÿÿ A€ÀšÀ  ßÎÿÿÎÿÿþ @y`@y` (Îÿÿ)Îÿÿ A Á$Á  ÛÎÿÿÎÿÿþ @{`:@{`> $Îÿÿ%Îÿÿ AäÁèÁ  ×ÎÿÿÎÿÿþ @€`@€`  Îÿÿ!Îÿÿ A®Â²Â  ÓÎÿÿÎÿÿþ @„`-@„`1 ÎÿÿÎÿÿ AôÆøÆ  Ï Îÿÿ Îÿÿþ @—`)@—`-  Îÿÿ Îÿÿ AÉ‰É   cÎÿÿ¬Ëÿÿ¬Ëÿÿý @¬`$@¬`, ÎÿÿÎÿÿ A¿ÉÇÉ  ûšËÿÿšËÿÿþ @­`.@­`6 ëÎÿÿìÎÿÿ AQÓVÓ  ÷ýÍÿÿýÍÿÿþ @ä`@ä` çÎÿÿèÎÿÿ AßÓäÓ  óùÍÿÿùÍÿÿþ @ç`@ç` ÎÿÿÎÿÿ AmÔqÔ  ïõÍÿÿõÍÿÿþ @ê`"@ê`& ÎÿÿÎÿÿ A3Õ7Õ  ëñÍÿÿñÍÿÿþ @î`6@î`: ÛÎÿÿÜÎÿÿ AÖ Ö  çíÍÿÿíÍÿÿþ @ô`@ô` ×ÎÿÿØÎÿÿ AšÖ­Ö  ãéÍÿÿéÍÿÿþ @÷`K@÷`P ÷ÍÿÿøÍÿÿ A× ×  ßåÍÿÿåÍÿÿþ @ù`*@ù`. óÍÿÿôÍÿÿ AØ Ø  ÛáÍÿÿáÍÿÿþ @ý`*@ý`. ïÍÿÿðÍÿÿ A£Ø§Ø  ×ÝÍÿÿÝÍÿÿþ @ÿ`M@ÿ`Q ÇÎÿÿÈÎÿÿ A%Ú*Ú  ÓÙÍÿÿÙÍÿÿþ @`S@`X çÍÿÿèÍÿÿ A‚Ú†Ú  ÏÕÍÿÿÕÍÿÿþ @`*@`. ãÍÿÿäÍÿÿ A†ÛŠÛ  ËÑÍÿÿÑÍÿÿþ @ `*@ `. »ÎÿÿŒÎÿÿ AÍÝÒÝ  ÇÍÍÿÿÍÍÿÿþ @`9@`> ÛÍÿÿÜÍÿÿ AôÞøÞ  ÃÉÍÿÿÉÍÿÿþ @`q@`u ×ÍÿÿØÍÿÿ A§ß«ß  ¿ÅÍÿÿÅÍÿÿþ @`H@`L éÖÿÿèÖÿÿ A¬ßžß 4»` ÓÖÿÿÓÖÿÿþ @`M@`Y ‘isCategoryIconUrlþ A~àà  ¶` ÎÖÿÿÎÖÿÿþ @`?@`P ŠÎÿÿ§Îÿÿ AÑâÖâ  ²žÍÿÿžÍÿÿþ @%`Q@%`V ÆÍÿÿÇÍÿÿ A.ã2ã  ®ŽÍÿÿŽÍÿÿþ @'`*@'`. žÎÿÿŸÎÿÿ A1ä6ä  ª°Íÿÿ°Íÿÿþ @+`*@+`/ ŸÍÿÿ¿Íÿÿ AÖäÚä  Š¬Íÿÿ¬Íÿÿþ @.`2@.`6 –Îÿÿ—Îÿÿ Aæ„æ  ¢šÍÿÿšÍÿÿþ @3`A@3`F ¶Íÿÿ·Íÿÿ AÚêÞê  ž€Íÿÿ€Íÿÿþ @>`B@>`F ²Íÿÿ³Íÿÿ AŽëžë  š Íÿÿ Íÿÿþ @A`B@A`F ®Íÿÿ¯Íÿÿ A³ì·ì  –œÍÿÿœÍÿÿþ @D`O@D`S †Îÿÿ‡Îÿÿ AŠïï  ’˜Íÿÿ˜Íÿÿþ CL€L© ŠÍÿÿ§Íÿÿ Aƒð‡ð  Ž”Íÿÿ”Íÿÿþ @O`>@O`B ¢Íÿÿ£Íÿÿ AÒñÖñ  АÍÿÿÍÿÿþ @S`>@S`B žÍÿÿŸÍÿÿ A¥ò©ò  †ŒÍÿÿŒÍÿÿþ @U`l@U`p vÎÿÿwÎÿÿ Ajõoõ  ‚ˆÍÿÿˆÍÿÿþ @``:@``? –Íÿÿ—Íÿÿ AÇõËõ  ~ÿÿÿ„Íÿÿ„Íÿÿþ @b`*@b`. ’Íÿÿ“Íÿÿ AÖöÚö  zÿÿÿ€Íÿÿ€Íÿÿþ @f`*@f`. jÎÿÿkÎÿÿ Ak÷p÷  vÿÿÿ|Íÿÿ|Íÿÿþ @h`O@h`T ŠÍÿÿ‹Íÿÿ APøTø  rÿÿÿxÍÿÿxÍÿÿþ @k`:@k`> †Íÿÿ‡Íÿÿ Aùù  nÿÿÿtÍÿÿtÍÿÿþ @m`H@m`L ‚ÍÿÿƒÍÿÿ Anúrú  jÿÿÿpÍÿÿpÍÿÿþ @r`:@r`> ZÎÿÿ[Îÿÿ A3û8û  fÿÿÿlÍÿÿlÍÿÿþ @t``@t`e VÎÿÿWÎÿÿ ABüGü  bÿÿÿhÍÿÿhÍÿÿþ @w`J@w`O vÍÿÿwÍÿÿ ALýPý  ^ÿÿÿdÍÿÿdÍÿÿþ @z`R@z`V rÍÿÿsÍÿÿ AÒþÖþ  Zÿÿÿ`Íÿÿ`Íÿÿþ @~`f@~`j JÎÿÿKÎÿÿ AÝâ  Vÿÿÿ\Íÿÿ\Íÿÿþ @„`g@„`l FÎÿÿGÎÿÿ Ažœ  RÿÿÿXÍÿÿXÍÿÿþ @“`Q@“`V fÍÿÿgÍÿÿ A  NÿÿÿTÍÿÿTÍÿÿþ @•`*@•`. bÍÿÿcÍÿÿ A  JÿÿÿPÍÿÿPÍÿÿþ @™`*@™`. :Îÿÿ;Îÿÿ A/4  FÿÿÿLÍÿÿLÍÿÿþ @`9@`> ZÍÿÿ[Íÿÿ A»¿  BÿÿÿHÍÿÿHÍÿÿþ @¢`:@¢`> VÍÿÿWÍÿÿ A£ §   >ÿÿÿDÍÿÿDÍÿÿþ @§`H@§`L RÍÿÿSÍÿÿ AC G   :ÿÿÿ@Íÿÿ@Íÿÿþ @©`H@©`L NÍÿÿOÍÿÿ A}    6ÿÿÿ<Íÿÿ<Íÿÿþ @¶`&@¶`* &Îÿÿ'Îÿÿ AFK  2ÿÿÿ8Íÿÿ8Íÿÿþ @¹`(@¹`- FÍÿÿGÍÿÿ A48  .ÿÿÿ4Íÿÿ4Íÿÿþ @œ`&@œ`* ÎÿÿÎÿÿ A¿Ä  *ÿÿÿ0Íÿÿ0Íÿÿþ @Â`R@Â`W >Íÿÿ?Íÿÿ Adh  &ÿÿÿ,Íÿÿ,Íÿÿþ @Å`@@Å`D :Íÿÿ;Íÿÿ Ajn  "ÿÿÿ(Íÿÿ(Íÿÿþ @É`F@É`J 6Íÿÿ7Íÿÿ A„ˆ  ÿÿÿ$Íÿÿ$Íÿÿþ @Ï`&@Ï`* 2Íÿÿ3Íÿÿ A   ÿÿÿ Íÿÿ Íÿÿþ @Ñ`4@Ñ`8   ’/* __next_internal_client_entry_do_not_use__ default auto */ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime"; import { useState, useEffect, useRef, Suspense } from 'react'; import { useRouter, useSearchParams } from 'next/navigation'; import { useSession, authClient } from '@/lib/auth'; import { useLocale } from '@/context/locale'; import * as api from '@/lib/api'; import { CategoryIcon, isCategoryIconUrl } from '@/components/CategoryIcon'; function SpecialistCardEditor(param) { let { card, isOpen, onToggle, onUpdate, onDelete, categories, locationTree, catLocale, locale, hasPriceList, visibilityIssues = [], moderationNotice = null } = param; const { t } = useLocale(); const hasVisibilityIssues = visibilityIssues.length > 0; const [cardTab, setCardTab] = useState('main'); const [saving, setSaving] = useState(false); const [savedOk, setSavedOk] = useState(false); const [localTitle, setLocalTitle] = useState(card.title); var _card_descriptionEl; const [localDescEl, setLocalDescEl] = useState((_card_descriptionEl = card.descriptionEl) !== null && _card_descriptionEl !== void 0 ? _card_descriptionEl : ''); var _card_descriptionEn; const [localDescEn, setLocalDescEn] = useState((_card_descriptionEn = card.descriptionEn) !== null && _card_descriptionEn !== void 0 ? _card_descriptionEn : ''); var _card_descriptionRu; const [localDescRu, setLocalDescRu] = useState((_card_descriptionRu = card.descriptionRu) !== null && _card_descriptionRu !== void 0 ? _card_descriptionRu : ''); var _card_descriptionUk; const [localDescUk, setLocalDescUk] = useState((_card_descriptionUk = card.descriptionUk) !== null && _card_descriptionUk !== void 0 ? _card_descriptionUk : ''); var _card_skills; const [localSkills, setLocalSkills] = useState((_card_skills = card.skills) !== null && _card_skills !== void 0 ? _card_skills : []); const [skillInput, setSkillInput] = useState(''); var _card_categories; const [localCategories, setLocalCategories] = useState((_card_categories = card.categories) !== null && _card_categories !== void 0 ? _card_categories : []); var _card_locations; const [localLocations, setLocalLocations] = useState((_card_locations = card.locations) !== null && _card_locations !== void 0 ? _card_locations : []); var _card_publicationStatus; const [localPublicationStatus, setLocalPublicationStatus] = useState((_card_publicationStatus = card.publicationStatus) !== null && _card_publicationStatus !== void 0 ? _card_publicationStatus : card.isActive ? 'active' : 'inactive'); const [apiSkillSugs, setApiSkillSugs] = useState([]); var _card_portfolio; const [portfolio, setPortfolio] = useState((_card_portfolio = card.portfolio) !== null && _card_portfolio !== void 0 ? _card_portfolio : []); const [portfolioUploading, setPortfolioUploading] = useState(false); const [editingItem, setEditingItem] = useState(null); const [editTitle, setEditTitle] = useState(''); const [editDesc, setEditDesc] = useState(''); const portfolioFileRef = useRef(null); // Price list state const [priceList, setPriceList] = useState([]); const [priceListLoading, setPriceListLoading] = useState(false); const [newGroupTitle, setNewGroupTitle] = useState(''); const [addingGroupId, setAddingGroupId] = useState(null); const [newItem, setNewItem] = useState({ name: '', description: '', price: '', unit: '' }); const [editingGroupId, setEditingGroupId] = useState(null); const [editGroupTitle, setEditGroupTitle] = useState(''); useEffect(()=>{ if (cardTab !== 'pricelist' || priceList.length > 0 || priceListLoading) return; setPriceListLoading(true); api.getPriceList(card.id, locale).then(setPriceList).catch(()=>{}).finally(()=>setPriceListLoading(false)); }, [ cardTab, locale ]); async function handleAddGroup() { if (!newGroupTitle.trim()) return; const group = await api.createPriceListGroup(card.id, { title: newGroupTitle.trim(), locale: [ 'el', 'en', 'ru', 'uk' ].includes(locale) ? locale : 'el', autoTranslate: true }); setPriceList((prev)=>[ ...prev, group ]); setNewGroupTitle(''); } async function handleDeleteGroup(groupId) { await api.deletePriceListGroup(groupId); setPriceList((prev)=>prev.filter((g)=>g.id !== groupId)); } async function handleSaveGroupTitle(groupId) { const updated = await api.updatePriceListGroup(groupId, { title: editGroupTitle.trim(), locale: [ 'el', 'en', 'ru', 'uk' ].includes(locale) ? locale : 'el', autoTranslate: true }); setPriceList((prev)=>prev.map((g)=>g.id === groupId ? { ...g, title: updated.title } : g)); setEditingGroupId(null); } async function handleAddItem(groupId) { if (!newItem.name.trim()) return; const item = await api.createPriceListItem(groupId, { name: newItem.name.trim(), description: newItem.description.trim() || null, price: newItem.price.trim() || null, unit: newItem.unit.trim() || null, locale: [ 'el', 'en', 'ru', 'uk' ].includes(locale) ? locale : 'el', autoTranslate: true }); setPriceList((prev)=>prev.map((g)=>g.id === groupId ? { ...g, items: [ ...g.items, item ] } : g)); setNewItem({ name: '', description: '', price: '', unit: '' }); setAddingGroupId(null); } async function handleDeleteItem(itemId, groupId) { await api.deletePriceListItem(itemId); setPriceList((prev)=>prev.map((g)=>g.id === groupId ? { ...g, items: g.items.filter((i)=>i.id !== itemId) } : g)); } useEffect(()=>{ if (cardTab !== 'skills') return; api.getSkillSuggestions(localCategories.length > 0 ? localCategories : undefined).then(setApiSkillSugs).catch(()=>setApiSkillSugs([])); }, [ localCategories, cardTab ]); const lbl = (ru, en, el)=>locale === 'ru' ? ru : locale === 'en' ? en : el; async function saveAll() { setSaving(true); try { const activeLocale = [ 'el', 'en', 'ru', 'uk' ].includes(locale) ? locale : 'el'; const cap = activeLocale.charAt(0).toUpperCase() + activeLocale.slice(1); const descField = "description".concat(cap); const descValue = { el: localDescEl, en: localDescEn, ru: localDescRu, uk: localDescUk }[activeLocale] || null; const updated = await api.updateSpecialistCard(card.id, { title: localTitle, [descField]: descValue, descriptionLocale: activeLocale, autoTranslate: !!descValue, skills: localSkills, categories: localCategories, locations: localLocations, publicationStatus: localPublicationStatus, isActive: localPublicationStatus === 'active' }); onUpdate({ ...updated, portfolio }); setSavedOk(true); setTimeout(()=>setSavedOk(false), 2000); } catch (e) {} finally{ setSaving(false); } } async function updatePublicationStatus(next) { setLocalPublicationStatus(next); try { await api.updateSpecialistCard(card.id, { publicationStatus: next, isActive: next === 'active' }); } catch (e) {} } function addSkill(s) { const trimmed = s.trim(); if (trimmed && !localSkills.includes(trimmed)) setLocalSkills([ ...localSkills, trimmed ]); setSkillInput(''); } function toggleCategory(slug) { let childSlugs = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : []; if (localCategories.includes(slug)) { setLocalCategories(localCategories.filter((c)=>c !== slug && !childSlugs.includes(c))); } else { setLocalCategories([ ...new Set([ ...localCategories, slug, ...childSlugs ]) ]); } } function toggleLocation(slug) { let childSlugs = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : []; if (localLocations.includes(slug)) { setLocalLocations(localLocations.filter((c)=>c !== slug && !childSlugs.includes(c))); } else { setLocalLocations([ ...new Set([ ...localLocations, slug, ...childSlugs ]) ]); } } async function handlePortfolioUpload(e) { var _e_target_files; const file = (_e_target_files = e.target.files) === null || _e_target_files === void 0 ? void 0 : _e_target_files[0]; if (!file) return; setPortfolioUploading(true); try { const form = new FormData(); form.append('file', file); form.append('cardId', card.id); const res = await fetch("".concat(process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000', "/api/portfolio"), { method: 'POST', credentials: 'include', body: form }); if (!res.ok) throw new Error('Upload failed'); const item = await res.json(); const next = [ ...portfolio, item ]; setPortfolio(next); onUpdate({ ...card, portfolio: next }); } catch (e) {} finally{ setPortfolioUploading(false); if (portfolioFileRef.current) portfolioFileRef.current.value = ''; } } async function handlePortfolioDelete(id) { try { await api.deletePortfolioItem(id); const next = portfolio.filter((p)=>p.id !== id); setPortfolio(next); onUpdate({ ...card, portfolio: next }); } catch (e) {} } async function handlePortfolioSave(id) { try { const item = await api.updatePortfolioItem(id, { title: editTitle, description: editDesc }); setPortfolio((prev)=>prev.map((p)=>p.id === id ? item : p)); setEditingItem(null); } catch (e) {} } const cardTabs = [ { id: 'main', label: t('profile.card.tab.main') }, { id: 'categories', label: t('profile.card.tab.categories') }, { id: 'skills', label: t('profile.card.tab.skills') }, { id: 'geography', label: t('profile.card.tab.geography') }, { id: 'pricelist', label: t('profile.card.tab.pricelist'), hidden: !hasPriceList }, { id: 'portfolio', label: t('profile.card.tab.portfolio') } ]; const pendingReviewNotice = localPublicationStatus === 'pending' ? { title: t('profile.card.review_pending', 'Pending approval'), body: t('profile.card.review_pending_hint', 'Your card is being reviewed by the admin team.'), tone: 'amber' } : null; const effectiveModerationNotice = moderationNotice !== null && moderationNotice !== void 0 ? moderationNotice : pendingReviewNotice; return /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 overflow-hidden", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 px-4 py-3 border-b border-gray-100 ".concat(hasVisibilityIssues ? 'bg-amber-50' : ''), children: [ /*#__PURE__*/ _jsxs("button", { type: "button", onClick: onToggle, className: "flex-1 flex items-center gap-3 text-left", children: [ /*#__PURE__*/ _jsx("span", { className: "text-sm font-semibold text-gray-800 flex-1", children: localTitle || card.title }), hasVisibilityIssues && /*#__PURE__*/ _jsx("span", { className: "inline-flex items-center justify-center w-5 h-5 rounded-full bg-amber-500 text-white text-xs font-bold", title: t('profile.card.visibility_issue', 'Card is not shown in offers'), children: "!" }), /*#__PURE__*/ _jsx("span", { className: "text-gray-400 text-xs", children: isOpen ? '▲' : 'â–Œ' }) ] }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>updatePublicationStatus(localPublicationStatus === 'active' ? 'inactive' : localPublicationStatus === 'pending' ? 'inactive' : 'pending'), className: "px-3 py-1.5 rounded-lg text-xs font-medium whitespace-nowrap ".concat(localPublicationStatus === 'active' ? 'bg-red-50 text-red-700 hover:bg-red-100' : localPublicationStatus === 'pending' ? 'bg-amber-50 text-amber-700 hover:bg-amber-100' : 'bg-green-50 text-green-700 hover:bg-green-100'), children: localPublicationStatus === 'active' ? t('profile.card.unpublish', 'Unpublish') : localPublicationStatus === 'pending' ? t('profile.card.withdraw_review', 'Withdraw request') : t('profile.card.submit_review', 'Submit for review') }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: onDelete, className: "text-red-400 hover:text-red-600 text-sm px-1 flex-shrink-0", title: t('profile.card.delete'), children: "\uD83D\uDDD1" }) ] }), isOpen && /*#__PURE__*/ _jsxs("div", { children: [ hasVisibilityIssues && /*#__PURE__*/ _jsxs("div", { className: "mx-4 mt-4 mb-2 rounded-lg border border-amber-300 bg-amber-50 p-3", children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs font-semibold text-amber-900", children: t('profile.card.visibility_issue', 'Card is not shown in offers') }), /*#__PURE__*/ _jsx("ul", { className: "mt-1.5 list-disc pl-4 text-xs text-amber-900 space-y-0.5", children: visibilityIssues.map((issue)=>/*#__PURE__*/ _jsx("li", { children: issue }, issue)) }) ] }), effectiveModerationNotice && /*#__PURE__*/ _jsxs("div", { className: "mx-4 mt-4 mb-2 rounded-lg border p-3 ".concat(effectiveModerationNotice.tone === 'green' ? 'border-green-300 bg-green-50' : effectiveModerationNotice.tone === 'red' ? 'border-red-300 bg-red-50' : 'border-amber-300 bg-amber-50'), children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs font-semibold ".concat(effectiveModerationNotice.tone === 'green' ? 'text-green-900' : effectiveModerationNotice.tone === 'red' ? 'text-red-900' : 'text-amber-900'), children: effectiveModerationNotice.title }), effectiveModerationNotice.body && /*#__PURE__*/ _jsx("p", { className: "mt-1 text-xs ".concat(effectiveModerationNotice.tone === 'green' ? 'text-green-800' : effectiveModerationNotice.tone === 'red' ? 'text-red-800' : 'text-amber-800'), children: effectiveModerationNotice.body }) ] }), /*#__PURE__*/ _jsx("div", { className: "flex overflow-x-auto border-b border-gray-100 bg-gray-50 gap-0", children: cardTabs.filter((t)=>!t.hidden).map((t)=>/*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setCardTab(t.id), className: "px-4 py-2.5 text-xs font-medium whitespace-nowrap border-b-2 transition -mb-px ".concat(cardTab === t.id ? 'border-green-500 text-green-600 bg-white' : 'border-transparent text-gray-500 hover:text-gray-700'), children: t.label }, t.id)) }), /*#__PURE__*/ _jsxs("div", { className: "p-4", children: [ cardTab === 'main' && /*#__PURE__*/ _jsxs("div", { className: "space-y-3", children: [ /*#__PURE__*/ _jsx("input", { value: localTitle, onChange: (e)=>setLocalTitle(e.target.value), maxLength: 200, placeholder: t('profile.cards.new_title'), 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" }), (()=>{ const activeLocale = [ 'el', 'en', 'ru', 'uk' ].includes(locale) ? locale : 'el'; const descMap = { el: [ localDescEl, setLocalDescEl ], en: [ localDescEn, setLocalDescEn ], ru: [ localDescRu, setLocalDescRu ], uk: [ localDescUk, setLocalDescUk ] }; const [val, setVal] = descMap[activeLocale]; const flags = { el: '🇬🇷', en: '🇬🇧', ru: '🇷🇺', uk: '🇺🇊' }; const otherLocales = [ 'el', 'en', 'ru', 'uk' ].filter((l)=>l !== activeLocale); const otherHasContent = otherLocales.some((l)=>descMap[l][0]); return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-1.5 text-xs font-medium text-gray-500 mb-1", children: [ flags[activeLocale], " ", t('profile.card.description', 'Description') ] }), /*#__PURE__*/ _jsx("textarea", { value: val, onChange: (e)=>setVal(e.target.value), rows: 4, maxLength: 2000, placeholder: t('profile.bio.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" }), val && /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-1", children: t('profile.card.desc_auto_translate', 'Will be automatically translated into other languages on save') }), otherHasContent && /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-1.5 mt-1.5", children: [ /*#__PURE__*/ _jsx("span", { className: "text-xs text-gray-400", children: t('profile.card.desc_translated', 'Translations available:') }), otherLocales.map((l)=>/*#__PURE__*/ _jsx("span", { className: "text-xs px-1.5 py-0.5 rounded-full ".concat(descMap[l][0] ? 'bg-green-50 text-green-600' : 'bg-gray-100 text-gray-400'), children: flags[l] }, l)) ] }) ] }); })() ] }), cardTab === 'skills' && /*#__PURE__*/ _jsxs("div", { className: "space-y-3", children: [ localSkills.length > 0 && /*#__PURE__*/ _jsx("div", { className: "flex flex-wrap gap-2", children: localSkills.map((s)=>/*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-1.5 bg-green-50 text-green-700 text-sm px-3 py-1 rounded-full", children: [ s, /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setLocalSkills(localSkills.filter((x)=>x !== s)), className: "text-gray-400 hover:text-green-700 leading-none", children: "\xd7" }) ] }, s)) }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-2", children: [ /*#__PURE__*/ _jsx("input", { value: skillInput, onChange: (e)=>setSkillInput(e.target.value), onKeyDown: (e)=>{ if (e.key === 'Enter') { e.preventDefault(); addSkill(skillInput); } }, placeholder: t('profile.card.skill.add'), 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" }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>addSkill(skillInput), className: "px-3 py-2 bg-gray-100 hover:bg-gray-200 rounded-lg text-sm font-medium", children: "+" }) ] }), apiSkillSugs.length > 0 && /*#__PURE__*/ _jsx("div", { className: "flex flex-wrap gap-1.5", children: apiSkillSugs.map((s)=>{ var _s_names_catLocale; return (_s_names_catLocale = s.names[catLocale]) !== null && _s_names_catLocale !== void 0 ? _s_names_catLocale : s.names.el; }).filter((name, i, arr)=>arr.indexOf(name) === i && !localSkills.includes(name)).slice(0, 16).map((name)=>/*#__PURE__*/ _jsxs("button", { type: "button", onClick: ()=>addSkill(name), className: "text-xs px-2.5 py-1 border border-gray-200 rounded-full text-gray-500 hover:border-green-400 hover:text-green-600 transition", children: [ "+ ", name ] }, name)) }) ] }), cardTab === 'categories' && /*#__PURE__*/ _jsx("div", { className: "space-y-3", children: categories.map((cat)=>{ var _cat_names, _cat_names1; var _cat_names_catLocale, _ref; const catName = (_ref = (_cat_names_catLocale = (_cat_names = cat.names) === null || _cat_names === void 0 ? void 0 : _cat_names[catLocale]) !== null && _cat_names_catLocale !== void 0 ? _cat_names_catLocale : (_cat_names1 = cat.names) === null || _cat_names1 === void 0 ? void 0 : _cat_names1.el) !== null && _ref !== void 0 ? _ref : cat.slug; var _cat_children; const children = (_cat_children = cat.children) !== null && _cat_children !== void 0 ? _cat_children : []; const childSlugs = children.map((c)=>c.slug); return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-2.5 cursor-pointer", children: [ /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: localCategories.includes(cat.slug), onChange: ()=>toggleCategory(cat.slug, childSlugs), className: "w-4 h-4 rounded border-gray-300 text-green-600 focus:ring-blue-400" }), /*#__PURE__*/ _jsxs("span", { className: "text-sm font-medium text-gray-800 inline-flex items-center gap-1", children: [ cat.icon && /*#__PURE__*/ _jsx(CategoryIcon, { icon: cat.icon, alt: catName, className: isCategoryIconUrl(cat.icon) ? 'h-4 w-4 object-contain' : 'text-sm leading-none', fallback: "\uD83D\uDCE6" }), catName ] }) ] }), children.length > 0 && /*#__PURE__*/ _jsx("div", { className: "ml-6 mt-2 space-y-2", children: children.map((sub)=>{ var _sub_names, _sub_names1; var _sub_names_catLocale, _ref; const subName = (_ref = (_sub_names_catLocale = (_sub_names = sub.names) === null || _sub_names === void 0 ? void 0 : _sub_names[catLocale]) !== null && _sub_names_catLocale !== void 0 ? _sub_names_catLocale : (_sub_names1 = sub.names) === null || _sub_names1 === void 0 ? void 0 : _sub_names1.el) !== null && _ref !== void 0 ? _ref : sub.slug; return /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-2.5 cursor-pointer", children: [ /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: localCategories.includes(sub.slug), onChange: ()=>toggleCategory(sub.slug), className: "w-4 h-4 rounded border-gray-300 text-green-600 focus:ring-blue-400" }), /*#__PURE__*/ _jsx("span", { className: "text-sm text-gray-600", children: subName }) ] }, sub.id); }) }) ] }, cat.id); }) }), cardTab === 'geography' && /*#__PURE__*/ _jsx("div", { className: "space-y-3", children: locationTree.map((city)=>{ var _city_names, _city_names1; var _city_names_catLocale, _ref; const cityName = (_ref = (_city_names_catLocale = (_city_names = city.names) === null || _city_names === void 0 ? void 0 : _city_names[catLocale]) !== null && _city_names_catLocale !== void 0 ? _city_names_catLocale : (_city_names1 = city.names) === null || _city_names1 === void 0 ? void 0 : _city_names1.el) !== null && _ref !== void 0 ? _ref : city.slug; var _city_children; const districts = (_city_children = city.children) !== null && _city_children !== void 0 ? _city_children : []; const districtSlugs = districts.map((d)=>d.slug); return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-2.5 cursor-pointer", children: [ /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: localLocations.includes(city.slug), onChange: ()=>toggleLocation(city.slug, districtSlugs), className: "w-4 h-4 rounded border-gray-300 text-green-600 focus:ring-blue-400" }), /*#__PURE__*/ _jsx("span", { className: "text-sm font-medium text-gray-800", children: cityName }) ] }), districts.length > 0 && /*#__PURE__*/ _jsx("div", { className: "ml-6 mt-2 space-y-2", children: districts.map((d)=>{ var _d_names, _d_names1; var _d_names_catLocale, _ref; const dName = (_ref = (_d_names_catLocale = (_d_names = d.names) === null || _d_names === void 0 ? void 0 : _d_names[catLocale]) !== null && _d_names_catLocale !== void 0 ? _d_names_catLocale : (_d_names1 = d.names) === null || _d_names1 === void 0 ? void 0 : _d_names1.el) !== null && _ref !== void 0 ? _ref : d.slug; return /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-2.5 cursor-pointer", children: [ /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: localLocations.includes(d.slug), onChange: ()=>toggleLocation(d.slug), className: "w-4 h-4 rounded border-gray-300 text-green-600 focus:ring-blue-400" }), /*#__PURE__*/ _jsx("span", { className: "text-sm text-gray-600", children: dName }) ] }, d.id); }) }) ] }, city.id); }) }), cardTab === 'pricelist' && /*#__PURE__*/ _jsx("div", { className: "space-y-4", children: priceListLoading ? /*#__PURE__*/ _jsx("div", { className: "text-center py-6 text-gray-400 text-sm", children: t('common.loading', 'Loading...') }) : /*#__PURE__*/ _jsxs(_Fragment, { children: [ priceList.length === 0 && /*#__PURE__*/ _jsx("div", { className: "text-center py-6 text-gray-400 text-sm border-2 border-dashed border-gray-200 rounded-xl", children: t('profile.card.pricelist.empty') }), priceList.map((group)=>/*#__PURE__*/ _jsxs("div", { className: "border border-gray-200 rounded-xl overflow-hidden", children: [ /*#__PURE__*/ _jsx("div", { className: "flex items-center gap-2 bg-gray-50 px-4 py-2.5 border-b border-gray-200", children: editingGroupId === group.id ? /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx("input", { value: editGroupTitle, onChange: (e)=>setEditGroupTitle(e.target.value), className: "flex-1 border border-gray-300 rounded-lg px-3 py-1.5 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400", onKeyDown: (e)=>{ if (e.key === 'Enter') handleSaveGroupTitle(group.id); }, autoFocus: true }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>handleSaveGroupTitle(group.id), className: "px-3 py-1.5 bg-green-600 text-white rounded-lg text-xs font-medium hover:bg-green-700", children: t('profile.card.pricelist.save_group') }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setEditingGroupId(null), className: "px-2 py-1.5 text-gray-500 hover:text-gray-700 text-xs", children: "✕" }) ] }) : /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx("span", { className: "flex-1 font-semibold text-sm text-gray-800", children: group.title }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>{ setEditingGroupId(group.id); setEditGroupTitle(group.title); }, className: "text-gray-400 hover:text-green-600 text-xs px-2 py-1 rounded hover:bg-green-50", children: "✏" }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>handleDeleteGroup(group.id), className: "text-gray-400 hover:text-red-500 text-xs px-2 py-1 rounded hover:bg-red-50", children: t('profile.card.pricelist.delete_group') }) ] }) }), /*#__PURE__*/ _jsx("div", { className: "divide-y divide-gray-100", children: group.items.map((item)=>/*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 px-4 py-2.5 text-sm group", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ _jsx("p", { className: "font-medium text-gray-800 truncate", children: item.name }), item.description && /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-500 truncate", children: item.description }) ] }), (item.price || item.unit) && /*#__PURE__*/ _jsxs("span", { className: "text-green-700 font-semibold text-sm whitespace-nowrap", children: [ item.price ? "€".concat(item.price) : '', item.unit ? " ".concat(item.unit) : '' ] }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>handleDeleteItem(item.id, group.id), className: "opacity-0 group-hover:opacity-100 text-red-400 hover:text-red-600 text-xs px-1 transition", children: t('profile.card.pricelist.delete_item') }) ] }, item.id)) }), addingGroupId === group.id ? /*#__PURE__*/ _jsxs("div", { className: "p-3 bg-green-50 border-t border-green-100 space-y-2", children: [ /*#__PURE__*/ _jsx("input", { placeholder: t('profile.card.pricelist.item_name'), value: newItem.name, onChange: (e)=>setNewItem((p)=>({ ...p, name: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }), /*#__PURE__*/ _jsx("input", { placeholder: t('profile.card.pricelist.item_desc'), value: newItem.description, onChange: (e)=>setNewItem((p)=>({ ...p, description: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-2", children: [ /*#__PURE__*/ _jsx("input", { placeholder: t('profile.card.pricelist.item_price'), value: newItem.price, onChange: (e)=>setNewItem((p)=>({ ...p, price: e.target.value })), className: "w-28 border border-gray-300 rounded-lg px-3 py-1.5 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }), /*#__PURE__*/ _jsx("input", { placeholder: t('profile.card.pricelist.item_unit'), value: newItem.unit, onChange: (e)=>setNewItem((p)=>({ ...p, unit: e.target.value })), className: "flex-1 border border-gray-300 rounded-lg px-3 py-1.5 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-2", children: [ /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>handleAddItem(group.id), className: "px-4 py-1.5 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700", children: t('profile.card.pricelist.save_item') }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>{ setAddingGroupId(null); setNewItem({ name: '', description: '', price: '', unit: '' }); }, className: "px-3 py-1.5 text-gray-500 hover:text-gray-700 text-sm", children: "✕" }) ] }) ] }) : /*#__PURE__*/ _jsx("div", { className: "px-4 py-2 border-t border-gray-100", children: /*#__PURE__*/ _jsxs("button", { type: "button", onClick: ()=>setAddingGroupId(group.id), className: "text-green-600 hover:text-gray-800 text-sm font-medium", children: [ "+ ", t('profile.card.pricelist.add_item') ] }) }) ] }, group.id)), /*#__PURE__*/ _jsxs("div", { className: "flex gap-2 pt-1", children: [ /*#__PURE__*/ _jsx("input", { placeholder: t('profile.card.pricelist.group_title'), value: newGroupTitle, onChange: (e)=>setNewGroupTitle(e.target.value), onKeyDown: (e)=>{ if (e.key === 'Enter') handleAddGroup(); }, 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" }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: handleAddGroup, className: "px-4 py-2 bg-green-600 hover:bg-green-700 text-white rounded-lg text-sm font-medium", children: t('profile.card.pricelist.add_group') }) ] }) ] }) }), cardTab === 'portfolio' && /*#__PURE__*/ _jsxs("div", { className: "space-y-3", children: [ portfolio.length < 20 && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>{ var _portfolioFileRef_current; return (_portfolioFileRef_current = portfolioFileRef.current) === null || _portfolioFileRef_current === void 0 ? void 0 : _portfolioFileRef_current.click(); }, disabled: portfolioUploading, className: "flex items-center gap-2 px-4 py-2 bg-green-600 hover:bg-green-700 text-white rounded-lg text-sm font-medium disabled:opacity-50", children: portfolioUploading ? /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx("span", { className: "w-4 h-4 border-2 border-white border-t-transparent rounded-full animate-spin" }), t('profile.card.photo.uploading') ] }) : /*#__PURE__*/ _jsxs(_Fragment, { children: [ "\uD83D\uDCF7 ", t('profile.card.photo.add') ] }) }), /*#__PURE__*/ _jsx("input", { ref: portfolioFileRef, type: "file", accept: "image/jpeg,image/png,image/webp", className: "hidden", onChange: handlePortfolioUpload }) ] }), portfolio.length === 0 ? /*#__PURE__*/ _jsx("div", { className: "text-center py-8 text-gray-400 text-sm border-2 border-dashed border-gray-200 rounded-xl", children: t('profile.card.photo.empty') }) : /*#__PURE__*/ _jsx("div", { className: "grid grid-cols-2 sm:grid-cols-3 gap-3", children: portfolio.map((item)=>{ var _item_title; return /*#__PURE__*/ _jsxs("div", { className: "group relative rounded-xl overflow-hidden border border-gray-200 bg-gray-50", children: [ /*#__PURE__*/ _jsx("img", { src: item.imageUrl, alt: (_item_title = item.title) !== null && _item_title !== void 0 ? _item_title : '', className: "w-full aspect-square object-cover" }), /*#__PURE__*/ _jsxs("div", { className: "absolute inset-0 bg-black/0 group-hover:bg-black/50 transition-all flex flex-col justify-between p-2", children: [ /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>handlePortfolioDelete(item.id), className: "self-end opacity-0 group-hover:opacity-100 transition w-7 h-7 rounded-full bg-red-500 text-white text-sm flex items-center justify-center hover:bg-red-600", children: "\xd7" }), /*#__PURE__*/ _jsxs("button", { type: "button", onClick: ()=>{ setEditingItem(item); var _item_title; setEditTitle((_item_title = item.title) !== null && _item_title !== void 0 ? _item_title : ''); var _item_description; setEditDesc((_item_description = item.description) !== null && _item_description !== void 0 ? _item_description : ''); }, className: "opacity-0 group-hover:opacity-100 transition text-xs text-white bg-black/50 hover:bg-black/70 rounded-lg px-2 py-1", children: [ "✏ ", t('profile.card.item.edit') ] }) ] }), item.title && /*#__PURE__*/ _jsx("div", { className: "px-2 py-1.5", children: /*#__PURE__*/ _jsx("p", { className: "text-xs font-medium text-gray-700 truncate", children: item.title }) }) ] }, item.id); }) }) ] }), cardTab !== 'portfolio' && cardTab !== 'pricelist' && /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 mt-4 pt-4 border-t border-gray-100", children: [ /*#__PURE__*/ _jsx("button", { type: "button", disabled: saving, onClick: saveAll, className: "px-5 py-2 bg-green-600 hover:bg-green-700 text-white rounded-lg text-sm font-semibold disabled:opacity-50", children: saving ? '...' : t('profile.card.save') }), savedOk && /*#__PURE__*/ _jsxs("span", { className: "text-sm text-green-600", children: [ "✓ ", t('profile.card.saved') ] }) ] }) ] }) ] }), editingItem && /*#__PURE__*/ _jsx("div", { className: "fixed inset-0 z-50 flex items-center justify-center bg-black/50 px-4", children: /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-2xl shadow-xl p-6 w-full max-w-md", children: [ /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-gray-800 mb-4", children: t('profile.card.item.edit') }), /*#__PURE__*/ _jsx("img", { src: editingItem.imageUrl, alt: "", className: "w-full h-40 object-cover rounded-xl mb-4" }), /*#__PURE__*/ _jsxs("div", { className: "space-y-3", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('profile.card.item.title') }), /*#__PURE__*/ _jsx("input", { value: editTitle, onChange: (e)=>setEditTitle(e.target.value), maxLength: 200, 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" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('profile.card.item.desc') }), /*#__PURE__*/ _jsx("textarea", { value: editDesc, onChange: (e)=>setEditDesc(e.target.value), rows: 3, maxLength: 1000, 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" }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-3 mt-5", children: [ /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>handlePortfolioSave(editingItem.id), className: "flex-1 bg-green-600 hover:bg-green-700 text-white py-2 rounded-lg text-sm font-medium", children: t('profile.card.item.save') }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setEditingItem(null), className: "flex-1 bg-gray-100 hover:bg-gray-200 text-gray-700 py-2 rounded-lg text-sm font-medium", children: t('profile.card.item.cancel') }) ] }) ] }) }) ] }); } // ─── AutoResponseTab ─────────────────────────────────────────────────────── function AutoResponseTab(param) { let { categories, locationTree, loaded, onLoad, settings, saving, saved, onSave, t, catLocale } = param; const { useEffect: _ue, useState: _us } = { useEffect, useState }; const [enabled, setEnabled] = _us(false); const [minBudget, setMinBudget] = _us(''); const [maxBudget, setMaxBudget] = _us(''); const [defaultPrice, setDefaultPrice] = _us(''); const [defaultMessage, setDefaultMessage] = _us(''); const [maxPerDay, setMaxPerDay] = _us(''); const [selCategories, setSelCategories] = _us([]); const [selLocations, setSelLocations] = _us([]); _ue(()=>{ onLoad(); }, []); _ue(()=>{ if (!settings) return; setEnabled(settings.enabled); setMinBudget(settings.minBudget != null ? String(settings.minBudget) : ''); setMaxBudget(settings.maxBudget != null ? String(settings.maxBudget) : ''); setDefaultPrice(settings.defaultPrice != null ? String(settings.defaultPrice) : ''); var _settings_defaultMessage; setDefaultMessage((_settings_defaultMessage = settings.defaultMessage) !== null && _settings_defaultMessage !== void 0 ? _settings_defaultMessage : ''); setMaxPerDay(settings.maxAutoOffersPerDay != null ? String(settings.maxAutoOffersPerDay) : ''); var _settings_categories; setSelCategories((_settings_categories = settings.categories) !== null && _settings_categories !== void 0 ? _settings_categories : []); var _settings_locations; setSelLocations((_settings_locations = settings.locations) !== null && _settings_locations !== void 0 ? _settings_locations : []); }, [ settings ]); if (!loaded) return /*#__PURE__*/ _jsx("div", { className: "text-center py-10 text-white/60", children: t('common.loading') }); const flatLocations = []; function flatten(nodes) { for (const n of nodes){ var _n_children; flatLocations.push({ id: n.id, name: n.name }); if ((_n_children = n.children) === null || _n_children === void 0 ? void 0 : _n_children.length) flatten(n.children); } } flatten(locationTree); return /*#__PURE__*/ _jsxs("div", { className: "space-y-4", children: [ /*#__PURE__*/ _jsx("div", { className: "bg-white rounded-xl border border-gray-200 p-5", children: /*#__PURE__*/ _jsxs("label", { className: "flex items-center justify-between cursor-pointer", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "font-medium text-gray-800", children: t('auto_response.title', 'Auto response') }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-0.5", children: t('auto_response.desc', 'Automatically respond to matching tasks') }) ] }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setEnabled((v)=>!v), className: "relative inline-flex h-6 w-11 items-center rounded-full transition-colors ".concat(enabled ? 'bg-green-500' : 'bg-gray-300'), children: /*#__PURE__*/ _jsx("span", { className: "inline-block h-4 w-4 transform rounded-full bg-white shadow transition-transform ".concat(enabled ? 'translate-x-6' : 'translate-x-1') }) }) ] }) }), /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-5 space-y-4", children: [ /*#__PURE__*/ _jsx("h3", { className: "font-medium text-gray-800 text-sm", children: t('auto_response.budget_range', 'Task budget') }), /*#__PURE__*/ _jsxs("div", { className: "grid grid-cols-2 gap-3", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs text-gray-500 mb-1", children: t('auto_response.min_budget', 'Min €') }), /*#__PURE__*/ _jsx("input", { type: "number", min: "0", value: minBudget, onChange: (e)=>setMinBudget(e.target.value), placeholder: "0", 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" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs text-gray-500 mb-1", children: t('auto_response.max_budget', 'Max €') }), /*#__PURE__*/ _jsx("input", { type: "number", min: "0", value: maxBudget, onChange: (e)=>setMaxBudget(e.target.value), placeholder: "∞", className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs text-gray-500 mb-1", children: t('auto_response.default_price', 'Default price €') }), /*#__PURE__*/ _jsx("input", { type: "number", min: "0", value: defaultPrice, onChange: (e)=>setDefaultPrice(e.target.value), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs text-gray-500 mb-1", children: t('auto_response.max_per_day', 'Max auto-offers/day') }), /*#__PURE__*/ _jsx("input", { type: "number", min: "1", max: "50", value: maxPerDay, onChange: (e)=>setMaxPerDay(e.target.value), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-5", children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs text-gray-500 mb-1", children: t('auto_response.default_message', 'Auto-response text') }), /*#__PURE__*/ _jsx("textarea", { value: defaultMessage, onChange: (e)=>setDefaultMessage(e.target.value), rows: 4, maxLength: 2000, placeholder: t('auto_response.message_placeholder', 'Hello! I can help with this task...'), 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" }) ] }), categories.length > 0 && /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-5", children: [ /*#__PURE__*/ _jsx("h3", { className: "font-medium text-gray-800 text-sm mb-3", children: t('auto_response.categories', 'Task categories') }), /*#__PURE__*/ _jsx("div", { className: "flex flex-wrap gap-2 max-h-40 overflow-y-auto", children: categories.flatMap((cat)=>{ var _cat_children; return [ cat, ...(_cat_children = cat.children) !== null && _cat_children !== void 0 ? _cat_children : [] ]; }).map((cat)=>{ var _cat_names, _cat_names1; var _cat_names_catLocale, _ref; const name = (_ref = (_cat_names_catLocale = (_cat_names = cat.names) === null || _cat_names === void 0 ? void 0 : _cat_names[catLocale]) !== null && _cat_names_catLocale !== void 0 ? _cat_names_catLocale : (_cat_names1 = cat.names) === null || _cat_names1 === void 0 ? void 0 : _cat_names1.el) !== null && _ref !== void 0 ? _ref : cat.slug; const sel = selCategories.includes(cat.slug); return /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setSelCategories(sel ? selCategories.filter((c)=>c !== cat.slug) : [ ...selCategories, cat.slug ]), className: "px-3 py-1.5 rounded-lg text-xs border transition ".concat(sel ? 'bg-green-600 border-green-600 text-white' : 'bg-white border-gray-300 text-gray-700 hover:border-green-400'), children: name }, cat.slug); }) }) ] }), /*#__PURE__*/ _jsx("button", { type: "button", disabled: saving, onClick: ()=>onSave({ enabled, minBudget: minBudget ? Number(minBudget) : null, maxBudget: maxBudget ? Number(maxBudget) : null, defaultPrice: defaultPrice ? Number(defaultPrice) : null, defaultMessage: defaultMessage || null, maxAutoOffersPerDay: maxPerDay ? Number(maxPerDay) : null, categories: selCategories.length > 0 ? selCategories : null, locations: selLocations.length > 0 ? selLocations : null }), className: "w-full bg-green-600 text-white py-3 rounded-xl font-semibold hover:bg-green-700 disabled:opacity-50", children: saving ? t('common.loading') : saved ? t('auto_response.saved', 'Saved ✓') : t('common.save') }) ] }); } export default function ProfilePage() { return /*#__PURE__*/ _jsx(Suspense, { fallback: null, children: /*#__PURE__*/ _jsx(ProfilePageInner, {}) }); } function ProfilePageInner() { var _user_firstName, _user_lastName, _dashData_features, _dashData_features1, _dashData_features2, _user_plan, _user_plan1, _user_plan2, _dashData_features3, _dashData_features4, _dashData_plan, _dashData_plan1, _user_plan3; const router = useRouter(); const searchParams = useSearchParams(); const { data: session, isPending } = useSession(); const { t, locale } = useLocale(); const validTabs = [ 'info', 'finance', 'cards', 'notifications', 'reviews', 'referral', 'auto_response', 'site' ]; var _searchParams_get; const initialTab = (_searchParams_get = searchParams.get('tab')) !== null && _searchParams_get !== void 0 ? _searchParams_get : 'info'; const [activeTab, setActiveTab] = useState(validTabs.includes(initialTab) ? initialTab : 'info'); const [user, setUser] = useState(null); const [loading, setLoading] = useState(true); const [saving, setSaving] = useState(false); const [saved, setSaved] = useState(false); const [error, setError] = useState(''); const [formData, setFormData] = useState({ firstName: '', lastName: '', phone: '', bio: '', locale: 'el' }); const [selectedLanguages, setSelectedLanguages] = useState([]); // Specialist cards const [cards, setCards] = useState([]); const [maxCards, setMaxCards] = useState(1); const [cardsLoading, setCardsLoading] = useState(false); const [cardNotifications, setCardNotifications] = useState([]); const [openCardId, setOpenCardId] = useState(null); const [creatingCard, setCreatingCard] = useState(false); const [newCardTitle, setNewCardTitle] = useState(''); const [showNewCardForm, setShowNewCardForm] = useState(false); const [showUpgradeModal, setShowUpgradeModal] = useState(false); // Reference data const [categories, setCategories] = useState([]); const [locationTree, setLocationTree] = useState([]); // Become specialist const [becomingSpecialist, setBecomingSpecialist] = useState(false); const [avatarUploading, setAvatarUploading] = useState(false); const [backgroundUploading, setBackgroundUploading] = useState(false); const fileRef = useRef(null); const backgroundFileRef = useRef(null); // Notification preferences const [notifyNewTasks, setNotifyNewTasks] = useState(false); const [notifMessages, setNotifMessages] = useState(true); const [notifySaving, setNotifySaving] = useState(false); const [notifySaved, setNotifySaved] = useState(false); // Email verification resend const [resendState, setResendState] = useState('idle'); // Referral info const [referralCode, setReferralCode] = useState(null); const [referralCount, setReferralCount] = useState(0); const [referralCopied, setReferralCopied] = useState(false); const [referralLoaded, setReferralLoaded] = useState(false); // Balance top-up modal const [showTopUpModal, setShowTopUpModal] = useState(false); const [topUpAmount, setTopUpAmount] = useState(10); const [topUpLoading, setTopUpLoading] = useState(false); const [topUpError, setTopUpError] = useState(''); const [balanceHistory, setBalanceHistory] = useState([]); const [planHistory, setPlanHistory] = useState([]); // Plan data + statuses const [dashData, setDashData] = useState(null); const [myStatuses, setMyStatuses] = useState([]); const [statusToggling, setStatusToggling] = useState(null); const [personalSiteSlug, setPersonalSiteSlug] = useState(''); const [slugSaving, setSlugSaving] = useState(false); const [slugSaved, setSlugSaved] = useState(false); const [slugCopied, setSlugCopied] = useState(false); const [slugError, setSlugError] = useState(''); const [showContactInfo, setShowContactInfo] = useState(false); const [siteSettings, setSiteSettings] = useState({}); const [siteSettingsSaving, setSiteSettingsSaving] = useState(false); const [siteStats, setSiteStats] = useState(null); const [siteStatsLoading, setSiteStatsLoading] = useState(false); const [autoResponse, setAutoResponse] = useState(null); const [arLoaded, setArLoaded] = useState(false); const [arSaving, setArSaving] = useState(false); const [arSaved, setArSaved] = useState(false); async function handleTopUp() { const amount = Number(topUpAmount); if (!amount || amount < 1) return; setTopUpLoading(true); setTopUpError(''); try { const { url, params } = await api.initiateTopUp(amount); // Build and auto-submit form to ePay const form = document.createElement('form'); form.method = 'POST'; form.action = url; Object.entries(params).forEach((param)=>{ let [k, v] = param; const input = document.createElement('input'); input.type = 'hidden'; input.name = k; input.value = v; form.appendChild(input); }); document.body.appendChild(form); form.submit(); } catch (e) { setTopUpError((e === null || e === void 0 ? void 0 : e.message) || t('profile.balance.topup.error')); setTopUpLoading(false); } } async function handleResendVerification() { if (!(user === null || user === void 0 ? void 0 : user.email) || resendState !== 'idle') return; setResendState('sending'); const callbackURL = "".concat(window.location.origin, "/profile"); const result = await authClient.sendVerificationEmail({ email: user.email, callbackURL }); if (result === null || result === void 0 ? void 0 : result.error) { setResendState('idle'); } else { setResendState('sent'); } } useEffect(()=>{ if (activeTab !== 'referral' || referralLoaded) return; api.getMyReferralInfo().then((r)=>{ setReferralCode(r.referralCode); setReferralCount(r.referralCount); }).catch(()=>{}).finally(()=>setReferralLoaded(true)); }, [ activeTab ]); // Reviews const [myReviews, setMyReviews] = useState(null); const [reviewsLoading, setReviewsLoading] = useState(false); const [myRating, setMyRating] = useState(null); useEffect(()=>{ if (activeTab !== 'reviews' || myReviews !== null || reviewsLoading) return; setReviewsLoading(true); api.getMyReviews().then(setMyReviews).catch(()=>setMyReviews([])).finally(()=>setReviewsLoading(false)); }, [ activeTab ]); useEffect(()=>{ if (activeTab !== 'site' || siteStats !== null || siteStatsLoading) return; setSiteStatsLoading(true); api.getSiteStats().then((res)=>setSiteStats(res.days)).catch(()=>setSiteStats([])).finally(()=>setSiteStatsLoading(false)); }, [ activeTab ]); useEffect(()=>{ if (!isPending && !session) router.push('/login'); }, [ session, isPending ]); useEffect(()=>{ if (!session) return; Promise.all([ api.request('/users/me'), api.getCategories(), api.getLocations(), api.getMyDashboard().catch(()=>null), api.getMyStatuses().catch(()=>[]), api.getBalanceHistory(8).catch(()=>[]), api.getPlanHistory(20).catch(()=>[]) ]).then((param)=>{ let [u, cats, locs, dash, statusRes, history, phist] = param; setUser(u); var _u_firstName, _u_lastName, _u_phone, _u_bio, _u_locale; setFormData({ firstName: (_u_firstName = u.firstName) !== null && _u_firstName !== void 0 ? _u_firstName : '', lastName: (_u_lastName = u.lastName) !== null && _u_lastName !== void 0 ? _u_lastName : '', phone: (_u_phone = u.phone) !== null && _u_phone !== void 0 ? _u_phone : '', bio: (_u_bio = u.bio) !== null && _u_bio !== void 0 ? _u_bio : '', locale: (_u_locale = u.locale) !== null && _u_locale !== void 0 ? _u_locale : 'el' }); var _u_languages; setSelectedLanguages((_u_languages = u.languages) !== null && _u_languages !== void 0 ? _u_languages : []); var _u_notifyNewTasks; setNotifyNewTasks((_u_notifyNewTasks = u.notifyNewTasks) !== null && _u_notifyNewTasks !== void 0 ? _u_notifyNewTasks : false); var _u_notifMessages; setNotifMessages((_u_notifMessages = u.notifMessages) !== null && _u_notifMessages !== void 0 ? _u_notifMessages : true); setCategories(cats); setLocationTree(locs); setDashData(dash); setMyStatuses((statusRes !== null && statusRes !== void 0 ? statusRes : []).filter((s)=>s.isActive).map((s)=>s.statusType)); setBalanceHistory(history); setPlanHistory(phist); var _u_personalSiteSlug; setPersonalSiteSlug((_u_personalSiteSlug = u.personalSiteSlug) !== null && _u_personalSiteSlug !== void 0 ? _u_personalSiteSlug : ''); var _u_showContactInfo; setShowContactInfo((_u_showContactInfo = u.showContactInfo) !== null && _u_showContactInfo !== void 0 ? _u_showContactInfo : false); var _u_siteSettings; setSiteSettings((_u_siteSettings = u.siteSettings) !== null && _u_siteSettings !== void 0 ? _u_siteSettings : {}); loadCards(); api.getUserRating(u.id).then((r)=>setMyRating(r.avg)).catch(()=>{}); }).catch(()=>{}).finally(()=>setLoading(false)); }, [ session ]); async function loadCards() { setCardsLoading(true); try { const { cards: c, maxCards: m } = await api.getMySpecialistCards(); setCards(c); setMaxCards(m); setOpenCardId((prev)=>{ var _c_; var _c__id; return prev && c.some((card)=>card.id === prev) ? prev : (_c__id = (_c_ = c[0]) === null || _c_ === void 0 ? void 0 : _c_.id) !== null && _c__id !== void 0 ? _c__id : null; }); api.getNotifications().then((rows)=>setCardNotifications(rows.filter((row)=>[ 'specialist_card_submitted', 'specialist_card_approved', 'specialist_card_rejected' ].includes(row.type)))).catch(()=>setCardNotifications([])); } catch (e) {} finally{ setCardsLoading(false); } } async function handleSubmit(e) { e.preventDefault(); setError(''); setSaving(true); try { const updated = await api.request('/users/me', { method: 'PATCH', body: JSON.stringify({ firstName: formData.firstName, lastName: formData.lastName, phone: formData.phone || undefined, bio: formData.bio || undefined, bioLocale: formData.locale, autoTranslateBio: true, locale: formData.locale, languages: selectedLanguages, showContactInfo }) }); setUser(updated); setSaved(true); setTimeout(()=>setSaved(false), 2500); } catch (err) { setError(err.message || t('common.error')); } finally{ setSaving(false); } } async function handleBecomeSpecialist() { setBecomingSpecialist(true); setError(''); try { const updated = await api.request('/users/me/become-specialist', { method: 'POST' }); setUser(updated); setActiveTab('cards'); loadCards(); } catch (err) { setError(err.message || t('common.error')); } finally{ setBecomingSpecialist(false); } } async function handleSaveSiteSlug() { setSlugSaving(true); setSlugError(''); try { const updated = await api.request('/users/me', { method: 'PATCH', body: JSON.stringify({ personalSiteSlug: personalSiteSlug || null }) }); setUser(updated); var _updated_personalSiteSlug; setPersonalSiteSlug((_updated_personalSiteSlug = updated.personalSiteSlug) !== null && _updated_personalSiteSlug !== void 0 ? _updated_personalSiteSlug : ''); setSlugSaved(true); setTimeout(()=>setSlugSaved(false), 2500); } catch (err) { var _err_code; const code = (_err_code = err === null || err === void 0 ? void 0 : err.code) !== null && _err_code !== void 0 ? _err_code : ''; if (code === 'SLUG_TAKEN' || err.message === 'This URL is already taken') { setSlugError(t('profile.site.slug_taken', 'This address is already taken')); } else { setSlugError(err.message || t('common.error')); } } finally{ setSlugSaving(false); } } async function handleSaveSiteSettings(newSettings) { setSiteSettings(newSettings); setSiteSettingsSaving(true); try { await api.request('/users/me', { method: 'PATCH', body: JSON.stringify({ siteSettings: newSettings }) }); } catch (e) {} finally{ setSiteSettingsSaving(false); } } async function handleAvatarChange(e) { var _e_target_files; const file = (_e_target_files = e.target.files) === null || _e_target_files === void 0 ? void 0 : _e_target_files[0]; if (!file) return; setAvatarUploading(true); try { const form = new FormData(); form.append('file', file); const res = await fetch("".concat(process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000', "/api/uploads"), { method: 'POST', credentials: 'include', body: form }); if (!res.ok) throw new Error('Upload failed'); const { url } = await res.json(); const fullUrl = "".concat(process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000').concat(url); await api.request('/users/me', { method: 'PATCH', body: JSON.stringify({ image: fullUrl }) }); setUser((prev)=>({ ...prev, image: fullUrl })); } catch (e) { setError(t('profile.upload.error')); } finally{ setAvatarUploading(false); } } async function handleBackgroundChange(e) { var _e_target_files; const file = (_e_target_files = e.target.files) === null || _e_target_files === void 0 ? void 0 : _e_target_files[0]; if (!file) return; setBackgroundUploading(true); try { const form = new FormData(); form.append('file', file); const res = await fetch("".concat(process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000', "/api/uploads"), { method: 'POST', credentials: 'include', body: form }); if (!res.ok) throw new Error('Upload failed'); const { url } = await res.json(); const fullUrl = "".concat(process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000').concat(url); const nextSettings = { ...siteSettings, profileBackgroundImage: fullUrl }; await api.request('/users/me', { method: 'PATCH', body: JSON.stringify({ siteSettings: nextSettings }) }); setSiteSettings(nextSettings); setSaved(true); setTimeout(()=>setSaved(false), 2500); } catch (e) { setError(t('profile.upload.error')); } finally{ setBackgroundUploading(false); if (backgroundFileRef.current) backgroundFileRef.current.value = ''; } } async function handleRemoveBackground() { setBackgroundUploading(true); try { const nextSettings = { ...siteSettings, profileBackgroundImage: null }; await api.request('/users/me', { method: 'PATCH', body: JSON.stringify({ siteSettings: nextSettings }) }); setSiteSettings(nextSettings); setSaved(true); setTimeout(()=>setSaved(false), 2500); } catch (e) { setError(t('profile.upload.error')); } finally{ setBackgroundUploading(false); } } async function handleCreateCard() { if (!newCardTitle.trim()) return; setCreatingCard(true); try { const card = await api.createSpecialistCard({ title: newCardTitle.trim() }); setCards((prev)=>[ ...prev, card ]); setOpenCardId(card.id); setNewCardTitle(''); setShowNewCardForm(false); } catch (err) { setError(err.message || t('common.error')); } finally{ setCreatingCard(false); } } async function handleDeleteCard(id) { if (!confirm(t('profile.cards.delete_confirm'))) return; try { await api.deleteSpecialistCard(id); setCards((prev)=>{ var _next_; const next = prev.filter((c)=>c.id !== id); var _next__id; if (openCardId === id) setOpenCardId((_next__id = (_next_ = next[0]) === null || _next_ === void 0 ? void 0 : _next_.id) !== null && _next__id !== void 0 ? _next__id : null); return next; }); } catch (err) { setError(err.message || t('common.error')); } } if (isPending || loading) { return /*#__PURE__*/ _jsx("div", { className: "text-center py-20 text-white", children: t('common.loading') }); } const catLocale = locale === 'en' ? 'en' : locale === 'ru' ? 'ru' : locale === 'uk' ? 'uk' : 'el'; const dateLocale = locale === 'en' ? 'en-US' : locale === 'ru' ? 'ru-RU' : 'el-GR'; const isSpecialist = (user === null || user === void 0 ? void 0 : user.role) === 'specialist'; const isAdmin = (user === null || user === void 0 ? void 0 : user.role) === 'admin'; const showSpecialistTabs = isSpecialist || isAdmin; var _user_firstName_, _user_lastName_; const initials = user ? "".concat((_user_firstName_ = (_user_firstName = user.firstName) === null || _user_firstName === void 0 ? void 0 : _user_firstName[0]) !== null && _user_firstName_ !== void 0 ? _user_firstName_ : '').concat((_user_lastName_ = (_user_lastName = user.lastName) === null || _user_lastName === void 0 ? void 0 : _user_lastName[0]) !== null && _user_lastName_ !== void 0 ? _user_lastName_ : '').toUpperCase() : '?'; const hasAutoResponse = !!(dashData === null || dashData === void 0 ? void 0 : (_dashData_features = dashData.features) === null || _dashData_features === void 0 ? void 0 : _dashData_features.hasAutoResponse); var _formData_bio, _ref; const profileBio = String((_ref = (_formData_bio = formData.bio) !== null && _formData_bio !== void 0 ? _formData_bio : user === null || user === void 0 ? void 0 : user.bio) !== null && _ref !== void 0 ? _ref : '').trim(); const publishedCards = cards.filter((c)=>{ var _c_publicationStatus; return ((_c_publicationStatus = c.publicationStatus) !== null && _c_publicationStatus !== void 0 ? _c_publicationStatus : c.isActive ? 'active' : 'inactive') === 'active'; }); const hasPublishedCard = publishedCards.length > 0; const hasCardCategories = publishedCards.some((c)=>{ var _c_categories; var _c_categories_length; return ((_c_categories_length = (_c_categories = c.categories) === null || _c_categories === void 0 ? void 0 : _c_categories.length) !== null && _c_categories_length !== void 0 ? _c_categories_length : 0) > 0; }); const hasCardLocations = publishedCards.some((c)=>{ var _c_locations; var _c_locations_length; return ((_c_locations_length = (_c_locations = c.locations) === null || _c_locations === void 0 ? void 0 : _c_locations.length) !== null && _c_locations_length !== void 0 ? _c_locations_length : 0) > 0; }); const moderationNoticeByCardId = cardNotifications.reduce((acc, row)=>{ if (!row.referenceId || acc[row.referenceId]) return acc; const tone = row.type === 'specialist_card_approved' ? 'green' : row.type === 'specialist_card_rejected' ? 'red' : 'amber'; const localizedTitle = row.type === 'specialist_card_approved' ? t('profile.card.review_approved', 'Card approved') : row.type === 'specialist_card_rejected' ? t('profile.card.review_rejected', 'Card rejected') : t('profile.card.review_pending', 'Pending approval'); const localizedBody = row.type === 'specialist_card_approved' ? t('profile.card.review_approved_hint', 'Your card is now visible in offers.') : row.type === 'specialist_card_rejected' ? t('profile.card.review_rejected_hint', 'Your card was not approved. Please update it and submit again.') : t('profile.card.review_pending_hint', 'Your card is being reviewed by the admin team.'); acc[row.referenceId] = { title: localizedTitle, body: localizedBody, tone }; return acc; }, {}); const listingMissing = []; if (!profileBio) listingMissing.push(t('profile.listing_requirements.bio', 'Add a short bio in the main profile section')); if (!hasPublishedCard) listingMissing.push(t('profile.listing_requirements.published_card', 'Publish at least one card')); if (!hasCardCategories) listingMissing.push(t('profile.listing_requirements.categories', 'Add at least one category to the published card')); if (!hasCardLocations) listingMissing.push(t('profile.listing_requirements.locations', 'Add at least one location to the published card')); const tabNeedsAttention = { info: !profileBio, cards: listingMissing.length > 0 }; const tabIcons = { info: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15.75 6a3.75 3.75 0 11-7.5 0 3.75 3.75 0 017.5 0zM4.501 20.118a7.5 7.5 0 0114.998 0A17.933 17.933 0 0112 21.75c-2.676 0-5.216-.584-7.499-1.632z" }) }), finance: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 6v12m-3-2.818l.879.659c1.171.879 3.07.879 4.242 0 1.172-.879 1.172-2.303 0-3.182C13.536 12.219 12.768 12 12 12c-.725 0-1.45-.22-2.003-.659-1.106-.879-1.106-2.303 0-3.182s2.9-.879 4.006 0l.415.33M21 12a9 9 0 11-18 0 9 9 0 0118 0z" }) }), cards: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M20.25 14.15v4.073a2.25 2.25 0 01-2.25 2.25h-12a2.25 2.25 0 01-2.25-2.25V6a2.25 2.25 0 012.25-2.25h4.073M15.75 3h5.25v5.25M15.75 3l-9 9" }) }), notifications: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M14.857 17.082a23.848 23.848 0 005.454-1.31A8.967 8.967 0 0118 9.75v-.7V9A6 6 0 006 9v.75a8.967 8.967 0 01-2.312 6.022c1.733.64 3.56 1.085 5.455 1.31m5.714 0a24.255 24.255 0 01-5.714 0m5.714 0a3 3 0 11-5.714 0" }) }), reviews: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M11.48 3.499a.562.562 0 011.04 0l2.125 5.111a.563.563 0 00.475.345l5.518.442c.499.04.701.663.321.988l-4.204 3.602a.563.563 0 00-.182.557l1.285 5.385a.562.562 0 01-.84.61l-4.725-2.885a.562.562 0 00-.586 0L6.982 20.54a.562.562 0 01-.84-.61l1.285-5.386a.562.562 0 00-.182-.557l-4.204-3.602a.562.562 0 01.321-.988l5.518-.442a.563.563 0 00.475-.345L11.48 3.5z" }) }), referral: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M13.19 8.688a4.5 4.5 0 011.242 7.244l-4.5 4.5a4.5 4.5 0 01-6.364-6.364l1.757-1.757m13.35-.622l1.757-1.757a4.5 4.5 0 00-6.364-6.364l-4.5 4.5a4.5 4.5 0 001.242 7.244" }) }), auto_response: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9.813 15.904L9 18.75l-.813-2.846a4.5 4.5 0 00-3.09-3.09L2.25 12l2.846-.813a4.5 4.5 0 003.09-3.09L9 5.25l.813 2.846a4.5 4.5 0 003.09 3.09L15.75 12l-2.846.813a4.5 4.5 0 00-3.09 3.09z" }) }), site: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 21a9.004 9.004 0 008.716-6.747M12 21a9.004 9.004 0 01-8.716-6.747M12 21c2.485 0 4.5-4.03 4.5-9S14.485 3 12 3m0 18c-2.485 0-4.5-4.03-4.5-9S9.515 3 12 3m0 0a8.997 8.997 0 017.843 4.582M12 3a8.997 8.997 0 00-7.843 4.582m15.686 0A11.953 11.953 0 0112 10.5c-2.998 0-5.74-1.1-7.843-2.918m15.686 0A8.959 8.959 0 0121 12c0 .778-.099 1.533-.284 2.253m0 0A17.919 17.919 0 0112 16.5c-3.162 0-6.133-.815-8.716-2.247m0 0A9.015 9.015 0 013 12c0-1.605.42-3.113 1.157-4.418" }) }) }; const tabs = showSpecialistTabs ? [ { id: 'info', label: t('profile.tab.info') }, { id: 'cards', label: t('profile.tab.cards') }, { id: 'notifications', label: t('profile.tab.notifications') }, { id: 'reviews', label: t('profile.tab.reviews') }, { id: 'finance', label: t('profile.tab.finance') }, { id: 'referral', label: t('profile.tab.referral') }, ...hasAutoResponse ? [ { id: 'auto_response', label: t('profile.tab.auto_response', 'Auto response') } ] : [], ...(dashData === null || dashData === void 0 ? void 0 : (_dashData_features1 = dashData.features) === null || _dashData_features1 === void 0 ? void 0 : _dashData_features1.hasPersonalSite) ? [ { id: 'site', label: t('profile.tab.site') } ] : [] ] : [ { id: 'info', label: t('profile.tab.info') }, { id: 'cards', label: t('profile.tab.cards') }, { id: 'notifications', label: t('profile.tab.notifications') }, { id: 'reviews', label: t('profile.tab.reviews') }, { id: 'finance', label: t('profile.tab.finance') }, { id: 'referral', label: t('profile.tab.referral') }, ...(dashData === null || dashData === void 0 ? void 0 : (_dashData_features2 = dashData.features) === null || _dashData_features2 === void 0 ? void 0 : _dashData_features2.hasPersonalSite) ? [ { id: 'site', label: t('profile.tab.site') } ] : [] ]; var _user_lastName1, _user_name, _user_balance, _user_plan_features, _user_plan_name; return /*#__PURE__*/ _jsxs("div", { className: "max-w-4xl mx-auto px-4 py-8", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-4 mb-6", children: [ /*#__PURE__*/ _jsx("div", { className: "w-14 h-14 rounded-full flex-shrink-0 overflow-hidden border-2 border-white/40 flex items-center justify-center text-green-700 text-xl font-bold bg-green-100 cursor-pointer", onClick: ()=>{ var _fileRef_current; setActiveTab('info'); (_fileRef_current = fileRef.current) === null || _fileRef_current === void 0 ? void 0 : _fileRef_current.click(); }, title: t('profile.photo.change'), children: (user === null || user === void 0 ? void 0 : user.image) ? /*#__PURE__*/ _jsx("img", { src: user.image, alt: user.name, className: "w-full h-full object-cover" }) : initials }), /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ _jsx("h1", { className: "text-xl font-bold text-white leading-tight", children: (user === null || user === void 0 ? void 0 : user.firstName) ? "".concat(user.firstName, " ").concat((_user_lastName1 = user.lastName) !== null && _user_lastName1 !== void 0 ? _user_lastName1 : '').trim() : (_user_name = user === null || user === void 0 ? void 0 : user.name) !== null && _user_name !== void 0 ? _user_name : t('nav.profile') }), myRating && /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-1 mt-0.5", children: [ /*#__PURE__*/ _jsx("span", { className: "text-yellow-300", children: "★" }), /*#__PURE__*/ _jsx("span", { className: "font-semibold text-white text-sm", children: Number(myRating).toFixed(1) }), myReviews !== null && myReviews.length > 0 && /*#__PURE__*/ _jsxs("span", { className: "text-white/60 text-xs", children: [ "(", myReviews.length, ")" ] }) ] }) ] }) ] }), !cardsLoading && cards.length === 0 && /*#__PURE__*/ _jsx("div", { className: "mb-6 rounded-2xl border border-amber-300 bg-amber-50/95 p-4 sm:p-5 shadow-sm", children: /*#__PURE__*/ _jsxs("div", { className: "flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "text-sm font-semibold text-amber-950", children: t('profile.cards.empty', 'No offers yet') }), /*#__PURE__*/ _jsx("p", { className: "text-xs leading-relaxed text-amber-800 mt-1 max-w-2xl", children: t('profile.cards.empty_hint', 'СПзЎайте первую картПчку, чтПбы пПказать услугО клОеМтаЌ.') }) ] }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>{ setActiveTab('cards'); setShowNewCardForm(true); }, className: "inline-flex items-center justify-center rounded-xl bg-amber-600 px-4 py-2 text-sm font-semibold text-white transition hover:bg-amber-700", children: t('profile.cards.create_first') }) ] }) }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-6 items-start", children: [ tabs.length > 1 && /*#__PURE__*/ _jsx("aside", { className: "w-52 shrink-0 hidden sm:block", children: /*#__PURE__*/ _jsx("nav", { className: "rounded-2xl overflow-hidden bg-white/10 backdrop-blur-sm", children: tabs.map((tab)=>/*#__PURE__*/ _jsxs("button", { type: "button", onClick: ()=>setActiveTab(tab.id), className: "w-full text-left px-4 py-3 text-sm font-medium transition border-b border-white/10 last:border-0 flex items-center gap-3 ".concat(activeTab === tab.id ? 'bg-white text-green-700' : 'text-white/80 hover:bg-white/10 hover:text-white'), children: [ tabIcons[tab.id], /*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-1.5", children: [ tab.label, tabNeedsAttention[tab.id] && /*#__PURE__*/ _jsx("span", { className: "inline-flex items-center justify-center w-4 h-4 rounded-full bg-amber-500 text-white text-[10px] font-bold", children: "!" }) ] }) ] }, tab.id)) }) }), /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-0", children: [ tabs.length > 1 && /*#__PURE__*/ _jsx("div", { className: "flex sm:hidden bg-white/15 backdrop-blur rounded-xl p-1 mb-4 gap-1 overflow-x-auto", children: tabs.map((tab)=>/*#__PURE__*/ _jsxs("button", { type: "button", onClick: ()=>setActiveTab(tab.id), className: "flex-1 min-w-fit px-3 py-2 text-xs font-medium rounded-lg transition whitespace-nowrap flex flex-col items-center gap-0.5 ".concat(activeTab === tab.id ? 'bg-white text-green-700 shadow-sm' : 'text-white/80 hover:text-white hover:bg-white/10'), children: [ tabIcons[tab.id], /*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-1.5", children: [ tab.label, tabNeedsAttention[tab.id] && /*#__PURE__*/ _jsx("span", { className: "inline-flex items-center justify-center w-4 h-4 rounded-full bg-amber-500 text-white text-[10px] font-bold", children: "!" }) ] }) ] }, tab.id)) }), activeTab === 'cards' && /*#__PURE__*/ _jsxs("div", { className: "space-y-4", children: [ error && /*#__PURE__*/ _jsx("div", { className: "bg-red-50 text-red-700 p-3 rounded-lg text-sm", children: error }), listingMissing.length > 0 && /*#__PURE__*/ _jsxs("div", { className: "bg-amber-50 border border-amber-300 rounded-xl p-4", children: [ /*#__PURE__*/ _jsx("p", { className: "text-sm font-semibold text-amber-900", children: t('profile.listing_requirements.title', 'Your profile is not shown yet in offers') }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-amber-800 mt-1", children: t('profile.listing_requirements.hint', 'To make the card visible, complete these conditions:') }), /*#__PURE__*/ _jsx("ul", { className: "mt-2 list-disc pl-5 text-xs text-amber-900 space-y-0.5", children: listingMissing.map((item)=>/*#__PURE__*/ _jsx("li", { children: item }, item)) }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between", children: [ /*#__PURE__*/ _jsxs("p", { className: "text-sm text-white/70", children: [ t('profile.cards.count'), ": ", cards.length, " / ", maxCards === null ? '∞' : maxCards ] }), /*#__PURE__*/ _jsxs("button", { type: "button", onClick: ()=>{ if (maxCards !== null && cards.length >= maxCards) { setShowUpgradeModal(true); } else { setShowNewCardForm(true); } }, className: "flex items-center gap-1.5 text-sm font-medium text-white hover:text-white/80", children: [ "+ ", t('profile.cards.add') ] }) ] }), showNewCardForm && /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-green-200 p-4 space-y-3", children: [ /*#__PURE__*/ _jsx("p", { className: "text-sm font-medium text-gray-800", children: t('profile.cards.new_title') }), /*#__PURE__*/ _jsx("input", { value: newCardTitle, onChange: (e)=>setNewCardTitle(e.target.value), onKeyDown: (e)=>{ if (e.key === 'Enter') handleCreateCard(); }, maxLength: 200, placeholder: t('profile.cards.placeholder'), autoFocus: true, 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" }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-2", children: [ /*#__PURE__*/ _jsx("button", { type: "button", onClick: handleCreateCard, disabled: creatingCard || !newCardTitle.trim(), className: "px-4 py-2 bg-green-600 hover:bg-green-700 text-white rounded-lg text-sm font-medium disabled:opacity-50", children: creatingCard ? '...' : t('profile.cards.create') }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>{ setShowNewCardForm(false); setNewCardTitle(''); }, className: "px-4 py-2 bg-gray-100 hover:bg-gray-200 text-gray-700 rounded-lg text-sm font-medium", children: t('profile.cards.cancel') }) ] }) ] }), cardsLoading && /*#__PURE__*/ _jsx("div", { className: "text-center py-10 text-white/70", children: t('common.loading') }), !cardsLoading && cards.length === 0 && !showNewCardForm && /*#__PURE__*/ _jsxs("div", { className: "text-center py-14 border-2 border-dashed border-white/30 rounded-xl", children: [ /*#__PURE__*/ _jsx("p", { className: "text-white/70 text-sm mb-3", children: t('profile.cards.empty') }), /*#__PURE__*/ _jsxs("button", { type: "button", onClick: ()=>setShowNewCardForm(true), className: "text-sm text-white font-medium hover:underline", children: [ "+ ", t('profile.cards.create_first') ] }) ] }), cards.map((card)=>{ var _dashData_features; const cardIssues = []; if (!profileBio) { cardIssues.push(t('profile.listing_requirements.bio', 'Add a short bio in the main profile section')); } var _card_publicationStatus; const publicationStatus = (_card_publicationStatus = card.publicationStatus) !== null && _card_publicationStatus !== void 0 ? _card_publicationStatus : card.isActive ? 'active' : 'inactive'; if (publicationStatus === 'pending') { cardIssues.push(t('profile.listing_requirements.review_pending', 'Card is under review')); } else if (publicationStatus !== 'active') { cardIssues.push(t('profile.listing_requirements.card_inactive', 'Make the card active')); } if (!card.categories || card.categories.length === 0) { cardIssues.push(t('profile.listing_requirements.categories', 'Add at least one category to the active card')); } if (!card.locations || card.locations.length === 0) { cardIssues.push(t('profile.listing_requirements.locations', 'Add at least one location to the active card')); } var _moderationNoticeByCardId_card_id; return /*#__PURE__*/ _jsx(SpecialistCardEditor, { card: card, isOpen: openCardId === card.id, onToggle: ()=>setOpenCardId(card.id), onUpdate: (updated)=>setCards((prev)=>prev.map((c)=>c.id === updated.id ? updated : c)), onDelete: ()=>handleDeleteCard(card.id), categories: categories, locationTree: locationTree, catLocale: catLocale, locale: locale, hasPriceList: !!(dashData === null || dashData === void 0 ? void 0 : (_dashData_features = dashData.features) === null || _dashData_features === void 0 ? void 0 : _dashData_features.hasPriceList), visibilityIssues: cardIssues, moderationNotice: (_moderationNoticeByCardId_card_id = moderationNoticeByCardId[card.id]) !== null && _moderationNoticeByCardId_card_id !== void 0 ? _moderationNoticeByCardId_card_id : null }, card.id); }) ] }), activeTab === 'site' && /*#__PURE__*/ _jsxs("div", { className: "space-y-5", children: [ /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6 space-y-4", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("h2", { className: "font-semibold text-gray-800 mb-1", children: t('profile.site.title') }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400", children: t('profile.site_slug_hint') }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-500 mb-1.5", children: t('profile.site.url_label') }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 flex-wrap", children: [ /*#__PURE__*/ _jsx("span", { className: "text-sm text-gray-400 shrink-0", children: "canhelp.gr/site/" }), /*#__PURE__*/ _jsx("input", { value: personalSiteSlug, onChange: (e)=>setPersonalSiteSlug(e.target.value.toLowerCase().replace(/[^a-z0-9_-]/g, '')), placeholder: "my-slug", maxLength: 50, className: "flex-1 min-w-32 border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 flex-wrap", children: [ /*#__PURE__*/ _jsx("button", { type: "button", onClick: handleSaveSiteSlug, disabled: slugSaving, className: "px-5 py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700 disabled:opacity-50", children: slugSaving ? t('profile.saving') : t('common.save') }), slugSaved && /*#__PURE__*/ _jsxs("span", { className: "text-sm text-green-600", children: [ "✓ ", t('profile.saved') ] }), personalSiteSlug && /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs("button", { type: "button", onClick: ()=>{ navigator.clipboard.writeText("".concat(window.location.origin, "/site/").concat(personalSiteSlug)); setSlugCopied(true); setTimeout(()=>setSlugCopied(false), 2000); }, className: "px-3 py-2 border border-gray-300 rounded-lg text-sm text-gray-600 hover:bg-gray-50 flex items-center gap-1.5", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z" }) }), slugCopied ? t('profile.site.copied') : t('profile.site.copy') ] }), /*#__PURE__*/ _jsxs("a", { href: "/site/".concat(personalSiteSlug), target: "_blank", rel: "noopener noreferrer", className: "px-3 py-2 border border-green-200 bg-green-50 rounded-lg text-sm text-green-600 hover:bg-green-100 flex items-center gap-1.5", children: [ t('profile.site_open'), /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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" }) }) ] }) ] }) ] }), slugError && /*#__PURE__*/ _jsx("p", { className: "text-xs text-red-500", children: slugError }) ] }), /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between mb-4", children: [ /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-gray-800", children: t('profile.site.visible_title') }), siteSettingsSaving && /*#__PURE__*/ _jsx("span", { className: "text-xs text-gray-400", children: t('profile.saving', 'Saving...') }) ] }), /*#__PURE__*/ _jsx("div", { className: "space-y-3", children: [ { key: 'showBio', label: t('profile.site.visible.bio', 'Biography') }, { key: 'showRating', label: t('profile.site.visible.rating', 'Rating and reviews') }, { key: 'showReviews', label: t('profile.site.visible.reviews', 'Reviews section') }, { key: 'showServices', label: t('profile.site.visible.services', 'Service cards') }, { key: 'showPriceList', label: t('profile.site.visible.price_list', 'Price list') }, { key: 'showPortfolio', label: t('profile.site.visible.portfolio', 'Portfolio') }, { key: 'showPhone', label: t('profile.site.visible.contacts', 'Contact phone') }, { key: 'showFullLastName', label: t('profile.site.visible.full_last_name', 'Show full last name') }, { key: 'showStatus', label: t('profile.site.visible.status', 'Status "Available now"') } ].map((param)=>{ let { key, label } = param; const checked = siteSettings[key] !== false // undefined = true by default ; return /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-3 cursor-pointer group", children: [ /*#__PURE__*/ _jsx("div", { className: "w-5 h-5 rounded border-2 flex items-center justify-center transition shrink-0 ".concat(checked ? 'bg-green-600 border-green-600' : 'bg-white border-gray-300 group-hover:border-green-400'), onClick: ()=>{ const next = { ...siteSettings, [key]: !checked }; handleSaveSiteSettings(next); }, children: checked && /*#__PURE__*/ _jsx("svg", { className: "w-3 h-3 text-white", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 3, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4.5 12.75l6 6 9-13.5" }) }) }), /*#__PURE__*/ _jsx("span", { className: "text-sm text-gray-700 select-none", onClick: ()=>{ const next = { ...siteSettings, [key]: !checked }; handleSaveSiteSettings(next); }, children: label }) ] }, key); }) }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-4", children: t('profile.site.edit_bio_hint', 'Name and photo are always visible') }), /*#__PURE__*/ _jsxs("div", { className: "mt-6 pt-4 border-t border-gray-100", children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: t('profile.site.theme', 'Theme') }), /*#__PURE__*/ _jsx("div", { className: "flex gap-3", children: [ { value: 'dark', label: t('profile.site.theme.dark', 'Dark'), icon: '🌙' }, { value: 'light', label: t('profile.site.theme.light', 'Light'), icon: '☀' } ].map((opt)=>{ var _siteSettings_siteTheme; const selected = ((_siteSettings_siteTheme = siteSettings.siteTheme) !== null && _siteSettings_siteTheme !== void 0 ? _siteSettings_siteTheme : 'dark') === opt.value; return /*#__PURE__*/ _jsxs("button", { onClick: ()=>handleSaveSiteSettings({ ...siteSettings, siteTheme: opt.value }), className: "flex-1 flex items-center justify-center gap-2 px-4 py-2.5 rounded-xl border-2 text-sm font-medium transition ".concat(selected ? 'border-green-500 bg-green-50 text-green-700' : 'border-gray-200 bg-white text-gray-500 hover:border-gray-300'), children: [ /*#__PURE__*/ _jsx("span", { children: opt.icon }), opt.label ] }, opt.value); }) }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ _jsx("div", { className: "flex items-center justify-between mb-4", children: /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-gray-800", children: t('profile.site.stats.title', 'Site analytics') }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-0.5", children: t('profile.site.stats.days', 'last 30 days') }) ] }) }), !personalSiteSlug ? /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-400 py-4 text-center", children: t('profile.site.stats.no_slug', 'Set your site URL to view statistics') }) : siteStatsLoading || siteStats === null ? /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-400 py-4 text-center", children: t('profile.site.stats.loading', 'Loading analytics...') }) : (()=>{ const totalViews = siteStats.reduce((s, d)=>s + d.views, 0); const totalUnique = siteStats.reduce((s, d)=>s + d.unique, 0); const totalMessages = siteStats.reduce((s, d)=>s + d.messages, 0); // Area chart helpers const days = siteStats.map((d)=>d.date); const seriesDef = [ { vals: siteStats.map((d)=>d.views), color: '#3b82f6', fill: '#3b82f615', label: t('profile.site.stats.views', 'Views') }, { vals: siteStats.map((d)=>d.unique), color: '#8b5cf6', fill: '#8b5cf610', label: t('profile.site.stats.unique', 'Unique') }, { vals: siteStats.map((d)=>d.messages), color: '#10b981', fill: '#10b98110', label: t('profile.site.stats.messages', 'Messages') } ]; const maxVal = Math.max(...seriesDef.flatMap((s)=>s.vals), 1); const W = 580; const H = 160; const padL = 36; const padB = 22; const chartW = W - padL - 4; const chartH = H - padB; const stepX = chartW / (days.length - 1); function pts(vals) { return vals.map((v, i)=>[ padL + i * stepX, chartH - v / maxVal * chartH ]); } function smoothPath(points) { if (points.length < 2) return ''; let d = "M ".concat(points[0][0].toFixed(1), " ").concat(points[0][1].toFixed(1)); for(let i = 1; i < points.length; i++){ const cpx = ((points[i - 1][0] + points[i][0]) / 2).toFixed(1); d += " C ".concat(cpx, " ").concat(points[i - 1][1].toFixed(1), " ").concat(cpx, " ").concat(points[i][1].toFixed(1), " ").concat(points[i][0].toFixed(1), " ").concat(points[i][1].toFixed(1)); } return d; } function areaPath(vals) { const points = pts(vals); const line = smoothPath(points); if (!line) return ''; const lastX = points[points.length - 1][0].toFixed(1); return "".concat(line, " L ").concat(lastX, " ").concat(chartH.toFixed(1), " L ").concat(padL.toFixed(1), " ").concat(chartH.toFixed(1), " Z"); } function fmtY(v) { return v >= 1000 ? "".concat(Math.round(v / 1000), "K") : String(v); } const yTicks = [ 0, Math.round(maxVal / 3), Math.round(maxVal * 2 / 3), maxVal ]; const xTicks = days.map((d, i)=>({ i, label: d.slice(8) })).filter((_, i)=>i % 7 === 0 || i === days.length - 1); return /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx("div", { className: "grid grid-cols-3 gap-3 mb-5", children: [ { label: t('profile.site.stats.total_views', 'Views'), value: totalViews, color: 'text-green-600', bg: 'bg-green-50' }, { label: t('profile.site.stats.total_unique', 'Unique visitors'), value: totalUnique, color: 'text-violet-600', bg: 'bg-violet-50' }, { label: t('profile.site.stats.total_messages', 'Messages'), value: totalMessages, color: 'text-emerald-600', bg: 'bg-emerald-50' } ].map((card)=>/*#__PURE__*/ _jsxs("div", { className: "".concat(card.bg, " rounded-xl p-3 text-center"), children: [ /*#__PURE__*/ _jsx("div", { className: "text-2xl font-bold ".concat(card.color), children: card.value }), /*#__PURE__*/ _jsx("div", { className: "text-xs text-gray-500 mt-0.5", children: card.label }) ] }, card.label)) }), /*#__PURE__*/ _jsx("div", { className: "flex items-center gap-4 mb-2", children: seriesDef.map((s)=>/*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-1.5 text-xs text-gray-500", children: [ /*#__PURE__*/ _jsx("span", { className: "w-3 h-0.5 inline-block rounded", style: { background: s.color } }), s.label ] }, s.label)) }), /*#__PURE__*/ _jsx("div", { className: "overflow-x-auto", children: /*#__PURE__*/ _jsxs("svg", { viewBox: "0 0 ".concat(W, " ").concat(H + 12), className: "w-full", style: { minWidth: 320 }, children: [ yTicks.map((v, idx)=>{ const y = chartH - v / maxVal * chartH; return /*#__PURE__*/ _jsxs("g", { children: [ /*#__PURE__*/ _jsx("line", { x1: padL, y1: y, x2: W - 4, y2: y, stroke: "#f3f4f6", strokeWidth: 1 }), /*#__PURE__*/ _jsx("text", { x: padL - 5, y: y + 3.5, textAnchor: "end", fontSize: 9, fill: "#9ca3af", children: fmtY(v) }) ] }, "y-".concat(idx, "-").concat(v)); }), xTicks.map((param)=>{ let { i } = param; return /*#__PURE__*/ _jsx("line", { x1: padL + i * stepX, y1: 0, x2: padL + i * stepX, y2: chartH, stroke: "#f9fafb", strokeWidth: 1 }, "vg-".concat(i)); }), xTicks.map((param)=>{ let { i, label } = param; return /*#__PURE__*/ _jsx("text", { x: padL + i * stepX, y: H + 10, textAnchor: "middle", fontSize: 9, fill: "#9ca3af", children: label }, i); }), seriesDef.map((s, si)=>/*#__PURE__*/ _jsx("path", { d: areaPath(s.vals), fill: s.fill }, "fill-".concat(si))), seriesDef.map((s, si)=>/*#__PURE__*/ _jsx("path", { d: smoothPath(pts(s.vals)), fill: "none", stroke: s.color, strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round" }, "line-".concat(si))), seriesDef.map((s, si)=>{ const points = pts(s.vals); const last = points[points.length - 1]; return /*#__PURE__*/ _jsx("circle", { cx: last[0], cy: last[1], r: 4, fill: "white", stroke: s.color, strokeWidth: 2 }, "dot-".concat(si)); }), /*#__PURE__*/ _jsx("line", { x1: padL, y1: chartH, x2: W - 4, y2: chartH, stroke: "#e5e7eb", strokeWidth: 1 }) ] }) }) ] }); })() ] }) ] }), activeTab === 'reviews' && /*#__PURE__*/ _jsx("div", { className: "space-y-4", children: myReviews === null ? /*#__PURE__*/ _jsx("div", { className: "text-center py-10 text-white/70", children: t('common.loading') }) : myReviews.length === 0 ? /*#__PURE__*/ _jsxs("div", { className: "text-center py-20 text-white/60", children: [ /*#__PURE__*/ _jsx("p", { className: "text-4xl mb-3", children: "⭐" }), /*#__PURE__*/ _jsx("p", { children: t('profile.no_reviews') }) ] }) : myReviews.map((param)=>{ let { review, author } = param; var _author_name_, _author_name; var _author_name__toUpperCase, _author_name1; return /*#__PURE__*/ _jsx("div", { className: "bg-white rounded-xl border border-gray-200 p-4", children: /*#__PURE__*/ _jsxs("div", { className: "flex items-start gap-3", children: [ /*#__PURE__*/ _jsx("div", { className: "w-9 h-9 rounded-full bg-gray-100 flex-shrink-0 flex items-center justify-center text-gray-600 text-sm font-bold overflow-hidden", children: (author === null || author === void 0 ? void 0 : author.image) ? /*#__PURE__*/ _jsx("img", { src: author.image, alt: author.name, className: "w-full h-full object-cover" }) : (_author_name__toUpperCase = author === null || author === void 0 ? void 0 : (_author_name = author.name) === null || _author_name === void 0 ? void 0 : (_author_name_ = _author_name[0]) === null || _author_name_ === void 0 ? void 0 : _author_name_.toUpperCase()) !== null && _author_name__toUpperCase !== void 0 ? _author_name__toUpperCase : '?' }), /*#__PURE__*/ _jsxs("div", { className: "flex-1", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 mb-1", children: [ /*#__PURE__*/ _jsx("span", { className: "text-sm font-medium text-gray-800", children: (_author_name1 = author === null || author === void 0 ? void 0 : author.name) !== null && _author_name1 !== void 0 ? _author_name1 : '—' }), /*#__PURE__*/ _jsxs("span", { className: "text-yellow-400", children: [ '★'.repeat(review.rating), '☆'.repeat(5 - review.rating) ] }) ] }), review.comment && /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-600", children: review.comment }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-1", children: new Date(review.createdAt).toLocaleDateString() }) ] }) ] }) }, review.id); }) }), activeTab === 'finance' && /*#__PURE__*/ _jsxs("div", { className: "space-y-5", children: [ /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between mb-3", children: [ /*#__PURE__*/ _jsx("h2", { className: "font-semibold text-gray-800", children: t('profile.balance') }), /*#__PURE__*/ _jsxs("button", { onClick: ()=>{ setTopUpAmount(10); setTopUpError(''); setShowTopUpModal(true); }, className: "flex items-center gap-1.5 text-sm font-medium text-green-600 hover:text-green-700 hover:bg-green-50 px-3 py-1.5 rounded-lg transition-colors", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 4v16m8-8H4" }) }), t('profile.balance.topup') ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 p-4 bg-green-50 rounded-xl border border-green-100", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-6 h-6 text-green-600 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 8c-1.657 0-3 .895-3 2s1.343 2 3 2 3 .895 3 2-1.343 2-3 2m0-8c1.11 0 2.08.402 2.599 1M12 8V7m0 1v8m0 0v1m0-1c-1.11 0-2.08-.402-2.599-1M21 12a9 9 0 11-18 0 9 9 0 0118 0z" }) }), /*#__PURE__*/ _jsxs("span", { className: "text-xl font-bold text-green-700", children: [ parseFloat((_user_balance = user === null || user === void 0 ? void 0 : user.balance) !== null && _user_balance !== void 0 ? _user_balance : '0').toFixed(2), " EUR" ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "mt-4", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between mb-2", children: [ /*#__PURE__*/ _jsx("h3", { className: "text-sm font-semibold text-gray-800", children: t('profile.balance.history', 'Operation history') }), /*#__PURE__*/ _jsx("span", { className: "text-xs text-gray-400", children: t('profile.balance.history.last', 'Latest operations') }) ] }), balanceHistory.length === 0 ? /*#__PURE__*/ _jsx("div", { className: "rounded-xl border border-dashed border-gray-200 px-4 py-6 text-sm text-gray-400 text-center", children: t('profile.balance.history.empty', 'No operations yet') }) : /*#__PURE__*/ _jsx("div", { className: "space-y-2", children: balanceHistory.map((entry)=>{ const isCredit = entry.direction === 'credit'; const amount = Number(entry.amount).toFixed(2); const badgeClass = isCredit ? 'bg-emerald-50 text-emerald-700 border-emerald-100' : 'bg-rose-50 text-rose-700 border-rose-100'; const title = entry.kind === 'topup' ? t('profile.balance.history.kind.topup', 'Balance top-up') : entry.kind === 'plan_purchase' ? t('profile.balance.history.kind.plan_purchase', 'Plan charge') : entry.kind === 'admin_topup' ? t('profile.balance.history.kind.admin_topup', 'Admin top-up') : t('profile.balance.history.kind.admin_adjustment', 'Admin adjustment'); return /*#__PURE__*/ _jsxs("div", { className: "rounded-xl border border-gray-200 px-4 py-3", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-start justify-between gap-3", children: [ /*#__PURE__*/ _jsxs("div", { className: "min-w-0", children: [ /*#__PURE__*/ _jsx("div", { className: "text-sm font-medium text-gray-900", children: entry.description || title }), /*#__PURE__*/ _jsx("div", { className: "text-xs text-gray-500 mt-1", children: new Date(entry.createdAt).toLocaleString(dateLocale) }) ] }), /*#__PURE__*/ _jsxs("div", { className: "shrink-0 rounded-full border px-2.5 py-1 text-xs font-semibold ".concat(badgeClass), children: [ isCredit ? '+' : '-', amount, " ", entry.currency ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "mt-2 text-xs text-gray-500", children: [ t('profile.balance.history.balance_after', 'Balance after'), ": ", Number(entry.balanceAfter).toFixed(2), " ", entry.currency ] }) ] }, entry.id); }) }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ _jsx("h2", { className: "font-semibold text-gray-800 mb-4", children: t('profile.plan_history.title', 'Plan history') }), planHistory.length === 0 ? /*#__PURE__*/ _jsx("div", { className: "rounded-xl border border-dashed border-gray-200 px-4 py-6 text-sm text-gray-400 text-center", children: t('profile.plan_history.empty', 'Plan change history is empty') }) : /*#__PURE__*/ _jsx("div", { className: "space-y-2", children: planHistory.map((entry)=>{ const eventColors = { activated: 'bg-green-50 text-green-700 border-green-100', renewed: 'bg-emerald-50 text-emerald-700 border-emerald-100', downgraded: 'bg-rose-50 text-rose-700 border-rose-100', referral_reward: 'bg-amber-50 text-amber-700 border-amber-100', admin_change: 'bg-purple-50 text-purple-700 border-purple-100', expired: 'bg-gray-100 text-gray-600 border-gray-200' }; const eventLabels = { activated: t('profile.plan_history.event.activated', 'Activated'), renewed: t('profile.plan_history.event.renewed', 'Renewed'), downgraded: t('profile.plan_history.event.downgraded', 'Downgraded'), referral_reward: t('profile.plan_history.event.referral_reward', 'Referral reward'), admin_change: t('profile.plan_history.event.admin_change', 'Changed by admin'), expired: t('profile.plan_history.event.expired', 'Expired') }; var _eventColors_entry_event; const badgeClass = (_eventColors_entry_event = eventColors[entry.event]) !== null && _eventColors_entry_event !== void 0 ? _eventColors_entry_event : 'bg-gray-100 text-gray-600 border-gray-200'; var _eventLabels_entry_event; const label = (_eventLabels_entry_event = eventLabels[entry.event]) !== null && _eventLabels_entry_event !== void 0 ? _eventLabels_entry_event : entry.event; return /*#__PURE__*/ _jsx("div", { className: "rounded-xl border border-gray-200 px-4 py-3", children: /*#__PURE__*/ _jsxs("div", { className: "flex items-start justify-between gap-3", children: [ /*#__PURE__*/ _jsxs("div", { className: "min-w-0", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 flex-wrap", children: [ /*#__PURE__*/ _jsx("span", { className: "text-sm font-semibold text-gray-900", children: entry.planName }), entry.previousPlanName && entry.previousPlanName !== entry.planName && /*#__PURE__*/ _jsxs("span", { className: "text-xs text-gray-400", children: [ "← ", entry.previousPlanName ] }) ] }), /*#__PURE__*/ _jsx("div", { className: "text-xs text-gray-500 mt-1", children: new Date(entry.createdAt).toLocaleString(dateLocale) }), entry.expiresAt && /*#__PURE__*/ _jsxs("div", { className: "text-xs text-gray-500 mt-0.5", children: [ t('profile.plan_history.expires', 'Until'), ": ", new Date(entry.expiresAt).toLocaleDateString(dateLocale) ] }), entry.daysAdded && entry.event === 'referral_reward' && /*#__PURE__*/ _jsxs("div", { className: "text-xs text-amber-600 mt-0.5", children: [ "+", entry.daysAdded, " ", t('profile.plan_history.days', 'days') ] }), entry.note && /*#__PURE__*/ _jsx("div", { className: "text-xs text-gray-400 mt-0.5", children: entry.note }) ] }), /*#__PURE__*/ _jsx("span", { className: "shrink-0 rounded-full border px-2.5 py-1 text-xs font-semibold ".concat(badgeClass), children: label }) ] }) }, entry.id); }) }) ] }), showTopUpModal && /*#__PURE__*/ _jsx("div", { className: "fixed inset-0 z-50 flex items-end sm:items-center justify-center p-4 bg-black/40 backdrop-blur-sm", children: /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-2xl shadow-2xl w-full max-w-sm p-6", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between mb-5", children: [ /*#__PURE__*/ _jsx("h3", { className: "text-lg font-semibold text-gray-900", children: t('profile.balance.topup.title') }), /*#__PURE__*/ _jsx("button", { onClick: ()=>setShowTopUpModal(false), className: "text-gray-400 hover:text-gray-600", children: /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" }) }) }) ] }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-500 mb-3", children: t('profile.balance.topup.hint') }), /*#__PURE__*/ _jsx("div", { className: "grid grid-cols-4 gap-2 mb-4", children: [ 5, 10, 20, 50 ].map((v)=>/*#__PURE__*/ _jsxs("button", { onClick: ()=>setTopUpAmount(v), className: "py-2 rounded-xl text-sm font-semibold border transition-colors ".concat(Number(topUpAmount) === v ? 'bg-green-600 text-white border-green-600' : 'border-gray-200 text-gray-700 hover:border-green-400'), children: [ "€", v ] }, v)) }), /*#__PURE__*/ _jsxs("div", { className: "mb-5", children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('profile.balance.topup.amount') }), /*#__PURE__*/ _jsxs("div", { className: "relative", children: [ /*#__PURE__*/ _jsx("span", { className: "absolute left-3 top-1/2 -translate-y-1/2 text-gray-400 text-sm", children: "€" }), /*#__PURE__*/ _jsx("input", { type: "number", min: "1", max: "9999", step: "1", value: topUpAmount, onChange: (e)=>setTopUpAmount(e.target.value), className: "w-full pl-7 pr-4 py-2.5 border border-gray-300 rounded-xl text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }) ] }), topUpError && /*#__PURE__*/ _jsx("p", { className: "text-sm text-red-600 mb-3", children: topUpError }), /*#__PURE__*/ _jsx("button", { onClick: handleTopUp, disabled: topUpLoading || !Number(topUpAmount) || Number(topUpAmount) < 1, className: "w-full py-3 bg-green-600 hover:bg-green-700 disabled:bg-gray-300 disabled:cursor-not-allowed text-white font-semibold rounded-xl transition-colors flex items-center justify-center gap-2", children: topUpLoading ? /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs("svg", { className: "w-4 h-4 animate-spin", fill: "none", viewBox: "0 0 24 24", children: [ /*#__PURE__*/ _jsx("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }), /*#__PURE__*/ _jsx("path", { className: "opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8v8z" }) ] }), t('profile.balance.topup.loading') ] }) : t('profile.balance.topup.submit') }) ] }) }), /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ _jsx("h2", { className: "font-semibold text-gray-800 mb-3", children: t('profile.plan.title') }), (user === null || user === void 0 ? void 0 : user.plan) ? /*#__PURE__*/ _jsxs("div", { className: "flex items-start gap-3 p-4 bg-green-50 rounded-xl border border-green-100", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-6 h-6 text-gray-500 shrink-0 mt-0.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M3 10h18M7 15h1m4 0h1m-7 4h12a3 3 0 003-3V8a3 3 0 00-3-3H6a3 3 0 00-3 3v8a3 3 0 003 3z" }) }), /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ _jsx("p", { className: "font-semibold text-gray-900", children: user.plan.name }), user.plan.description && /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-500 mt-0.5", children: user.plan.description }), /*#__PURE__*/ _jsxs("div", { className: "flex flex-wrap gap-3 mt-2 text-xs text-gray-500", children: [ /*#__PURE__*/ _jsxs("span", { className: "font-medium text-green-700", children: [ user.plan.price, " ", user.plan.currency ] }), user.plan.maxCards != null ? /*#__PURE__*/ _jsxs("span", { children: [ t('profile.plan.cards_up_to'), " ", user.plan.maxCards ] }) : /*#__PURE__*/ _jsx("span", { children: t('profile.plan.cards_unlimited') }), user.plan.maxTasks != null && /*#__PURE__*/ _jsxs("span", { children: [ t('profile.plan.tasks_up_to'), " ", user.plan.maxTasks ] }), user.plan.maxOffers != null && /*#__PURE__*/ _jsxs("span", { children: [ t('profile.plan.offers_up_to'), " ", user.plan.maxOffers ] }), /*#__PURE__*/ _jsx("span", { className: user.planExpiresAt && new Date(user.planExpiresAt) < new Date(Date.now() + 7 * 24 * 60 * 60 * 1000) ? 'text-red-500 font-medium' : '', children: user.planExpiresAt ? "".concat(t('profile.plan.valid_until'), " ").concat(new Date(user.planExpiresAt).toLocaleDateString()) : t('profile.plan.no_expiry') }) ] }), ((_user_plan_features = user.plan.features) !== null && _user_plan_features !== void 0 ? _user_plan_features : []).length > 0 && /*#__PURE__*/ _jsx("ul", { className: "mt-2 space-y-0.5", children: user.plan.features.map((f, i)=>/*#__PURE__*/ _jsxs("li", { className: "text-xs text-gray-600 flex items-center gap-1.5", children: [ /*#__PURE__*/ _jsx("span", { className: "text-green-500", children: "✓" }), " ", f ] }, i)) }) ] }) ] }) : /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 p-4 bg-gray-50 rounded-xl border border-gray-100", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" }) }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "text-sm font-medium text-gray-700", children: t('profile.plan.basic') }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-0.5", children: t('profile.plan.contact_upgrade') }) ] }) ] }) ] }), /*#__PURE__*/ _jsx("div", { className: "text-center", children: /*#__PURE__*/ _jsxs("a", { href: "/pricing", className: "inline-flex items-center gap-1.5 text-sm font-medium text-white/70 hover:text-white transition", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M13 7l5 5m0 0l-5 5m5-5H6" }) }), t('pricing.title', 'Pricing') ] }) }) ] }), activeTab !== 'cards' && activeTab !== 'reviews' && activeTab !== 'finance' && activeTab !== 'site' && /*#__PURE__*/ _jsxs("form", { onSubmit: handleSubmit, className: "space-y-6", children: [ error && /*#__PURE__*/ _jsx("div", { className: "bg-red-50 text-red-700 p-3 rounded-lg text-sm", children: error }), saved && /*#__PURE__*/ _jsxs("div", { className: "bg-green-50 text-green-700 p-3 rounded-lg text-sm", children: [ "✓ ", t('profile.saved') ] }), activeTab === 'notifications' && /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6 space-y-6", children: [ /*#__PURE__*/ _jsx("h2", { className: "font-semibold text-gray-800", children: t('notifications.title') }), notifySaved && /*#__PURE__*/ _jsxs("div", { className: "bg-green-50 text-green-700 p-3 rounded-lg text-sm", children: [ "✓ ", t('notifications.saved') ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-start justify-between gap-4", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex-1", children: [ /*#__PURE__*/ _jsx("p", { className: "font-medium text-gray-800 text-sm", children: t('chat.notif_messages') }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-500 mt-0.5", children: t('notifications.messages.desc') }) ] }), /*#__PURE__*/ _jsx("button", { type: "button", disabled: notifySaving, onClick: async ()=>{ const next = !notifMessages; setNotifMessages(next); setNotifySaving(true); try { await api.request('/users/me', { method: 'PATCH', body: JSON.stringify({ notifMessages: next }) }); setNotifySaved(true); setTimeout(()=>setNotifySaved(false), 2500); } catch (e) { setNotifMessages(!next); } finally{ setNotifySaving(false); } }, className: "relative inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full transition-colors focus:outline-none focus:ring-2 focus:ring-green-500 focus:ring-offset-2 disabled:opacity-50 ".concat(notifMessages ? 'bg-green-600' : 'bg-gray-200'), role: "switch", "aria-checked": notifMessages, children: /*#__PURE__*/ _jsx("span", { className: "inline-block h-4 w-4 transform rounded-full bg-white shadow transition-transform ".concat(notifMessages ? 'translate-x-6' : 'translate-x-1') }) }) ] }), showSpecialistTabs && /*#__PURE__*/ _jsxs("div", { className: "flex items-start justify-between gap-4 ".concat(!(user === null || user === void 0 ? void 0 : (_user_plan = user.plan) === null || _user_plan === void 0 ? void 0 : _user_plan.notifyNewTasks) ? 'opacity-60' : ''), children: [ /*#__PURE__*/ _jsxs("div", { className: "flex-1", children: [ /*#__PURE__*/ _jsx("p", { className: "font-medium text-gray-800 text-sm", children: t('notifications.email.new_tasks') }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-500 mt-0.5", children: t('notifications.email.new_tasks.desc') }), !(user === null || user === void 0 ? void 0 : (_user_plan1 = user.plan) === null || _user_plan1 === void 0 ? void 0 : _user_plan1.notifyNewTasks) && /*#__PURE__*/ _jsxs("p", { className: "text-xs text-amber-600 mt-1", children: [ "\uD83D\uDD12 ", t('notifications.plan_required') ] }) ] }), /*#__PURE__*/ _jsx("button", { type: "button", disabled: notifySaving || !(user === null || user === void 0 ? void 0 : (_user_plan2 = user.plan) === null || _user_plan2 === void 0 ? void 0 : _user_plan2.notifyNewTasks), onClick: async ()=>{ const next = !notifyNewTasks; setNotifyNewTasks(next); setNotifySaving(true); try { await api.request('/users/me', { method: 'PATCH', body: JSON.stringify({ notifyNewTasks: next }) }); setNotifySaved(true); setTimeout(()=>setNotifySaved(false), 2500); } catch (e) { setNotifyNewTasks(!next); } finally{ setNotifySaving(false); } }, className: "relative inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full transition-colors focus:outline-none focus:ring-2 focus:ring-green-500 focus:ring-offset-2 disabled:opacity-50 ".concat(notifyNewTasks ? 'bg-green-600' : 'bg-gray-200'), role: "switch", "aria-checked": notifyNewTasks, children: /*#__PURE__*/ _jsx("span", { className: "inline-block h-4 w-4 transform rounded-full bg-white shadow transition-transform ".concat(notifyNewTasks ? 'translate-x-6' : 'translate-x-1') }) }) ] }) ] }), activeTab === 'referral' && /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6 space-y-5", children: [ /*#__PURE__*/ _jsx("h2", { className: "font-semibold text-gray-800", children: t('profile.referral.title') }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-500", children: t('profile.referral.desc') }), !referralLoaded ? /*#__PURE__*/ _jsx("div", { className: "text-sm text-gray-400", children: t('common.loading') }) : referralCode ? /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs font-medium text-gray-500 mb-1.5", children: t('profile.referral.link_label') }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2", children: [ /*#__PURE__*/ _jsx("input", { readOnly: true, value: "".concat("object" !== 'undefined' ? window.location.origin : '', "/register?ref=").concat(referralCode), className: "flex-1 text-sm border border-gray-200 rounded-lg px-3 py-2 bg-gray-50 text-gray-700 focus:outline-none" }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>{ navigator.clipboard.writeText("".concat(window.location.origin, "/register?ref=").concat(referralCode)); setReferralCopied(true); setTimeout(()=>setReferralCopied(false), 2000); }, className: "px-3 py-2 rounded-lg border border-gray-200 text-sm font-medium hover:bg-gray-50 transition whitespace-nowrap", children: referralCopied ? t('profile.referral.copied') : t('profile.referral.copy') }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 p-4 bg-green-50 rounded-xl", children: [ /*#__PURE__*/ _jsx("div", { className: "text-2xl font-bold text-green-700", children: referralCount }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-green-700", children: t('profile.referral.invited_count') }) ] }) ] }) : /*#__PURE__*/ _jsx("div", { className: "text-sm text-gray-400", children: t('profile.referral.no_code') }) ] }), activeTab === 'auto_response' && /*#__PURE__*/ _jsx(AutoResponseTab, { categories: categories, locationTree: locationTree, loaded: arLoaded, onLoad: ()=>{ if (arLoaded) return; api.getAutoResponseSettings().then((s)=>{ setAutoResponse(s); setArLoaded(true); }).catch(()=>setArLoaded(true)); }, settings: autoResponse, saving: arSaving, saved: arSaved, onSave: async (data)=>{ setArSaving(true); setArSaved(false); try { const updated = await api.updateAutoResponseSettings(data); setAutoResponse(updated); setArSaved(true); setTimeout(()=>setArSaved(false), 2500); } catch (e) {} finally{ setArSaving(false); } }, t: t, catLocale: catLocale }), activeTab === 'info' && /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ _jsx("h2", { className: "font-semibold text-gray-800 mb-4", children: t('profile.photo') }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-5", children: [ /*#__PURE__*/ _jsxs("div", { className: "relative", children: [ (user === null || user === void 0 ? void 0 : user.image) ? /*#__PURE__*/ _jsx("img", { src: user.image, alt: user.name, className: "w-20 h-20 rounded-full object-cover border-2 border-gray-200" }) : /*#__PURE__*/ _jsx("div", { className: "w-20 h-20 rounded-full bg-green-100 flex items-center justify-center text-green-700 text-2xl font-bold border-2 border-gray-200", children: initials }), avatarUploading && /*#__PURE__*/ _jsx("div", { className: "absolute inset-0 rounded-full bg-black/40 flex items-center justify-center", children: /*#__PURE__*/ _jsx("div", { className: "w-5 h-5 border-2 border-white border-t-transparent rounded-full animate-spin" }) }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>{ var _fileRef_current; return (_fileRef_current = fileRef.current) === null || _fileRef_current === void 0 ? void 0 : _fileRef_current.click(); }, disabled: avatarUploading, className: "bg-gray-100 hover:bg-gray-200 text-gray-700 px-4 py-2 rounded-lg text-sm font-medium disabled:opacity-50", children: t('profile.photo.change') }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-1", children: t('profile.photo.hint') }), /*#__PURE__*/ _jsx("input", { ref: fileRef, type: "file", accept: "image/jpeg,image/png,image/webp", className: "hidden", onChange: handleAvatarChange }), /*#__PURE__*/ _jsx("div", { className: "mt-3 rounded-lg border border-gray-200 bg-gray-50 px-3 py-2.5", children: isSpecialist ? (dashData === null || dashData === void 0 ? void 0 : (_dashData_features3 = dashData.features) === null || _dashData_features3 === void 0 ? void 0 : _dashData_features3.hasCanHelpNowStatus) ? /*#__PURE__*/ _jsxs("label", { className: "flex items-center justify-between cursor-pointer gap-3", children: [ /*#__PURE__*/ _jsx("span", { className: "text-xs font-medium text-gray-700", children: t('status.can_help_now', 'Available now') }), /*#__PURE__*/ _jsx("button", { type: "button", disabled: statusToggling === 'canhelp_now', onClick: async ()=>{ setStatusToggling('canhelp_now'); const nextActive = !myStatuses.includes('canhelp_now'); try { const res = await api.toggleStatus('canhelp_now', nextActive); setMyStatuses((prev)=>res.isActive ? [ ...prev.filter((s)=>s !== 'canhelp_now'), 'canhelp_now' ] : prev.filter((s)=>s !== 'canhelp_now')); } catch (e) {} finally{ setStatusToggling(null); } }, className: "relative inline-flex h-5 w-10 items-center rounded-full transition-colors ".concat(myStatuses.includes('canhelp_now') ? 'bg-green-500' : 'bg-gray-300', " disabled:opacity-50"), children: /*#__PURE__*/ _jsx("span", { className: "inline-block h-3.5 w-3.5 transform rounded-full bg-white shadow transition-transform ".concat(myStatuses.includes('canhelp_now') ? 'translate-x-5.5' : 'translate-x-1') }) }) ] }) : /*#__PURE__*/ _jsx("p", { className: "text-xs text-amber-700", children: t('status.plan_required', 'Status is unavailable on your current plan') }) : !isAdmin ? (dashData === null || dashData === void 0 ? void 0 : (_dashData_features4 = dashData.features) === null || _dashData_features4 === void 0 ? void 0 : _dashData_features4.hasNeedHelpStatus) ? /*#__PURE__*/ _jsxs("label", { className: "flex items-center justify-between cursor-pointer gap-3", children: [ /*#__PURE__*/ _jsx("span", { className: "text-xs font-medium text-gray-700", children: t('status.need_help', 'Need help') }), /*#__PURE__*/ _jsx("button", { type: "button", disabled: statusToggling === 'need_help', onClick: async ()=>{ setStatusToggling('need_help'); const nextActive = !myStatuses.includes('need_help'); try { const res = await api.toggleStatus('need_help', nextActive); setMyStatuses((prev)=>res.isActive ? [ ...prev.filter((s)=>s !== 'need_help'), 'need_help' ] : prev.filter((s)=>s !== 'need_help')); } catch (e) {} finally{ setStatusToggling(null); } }, className: "relative inline-flex h-5 w-10 items-center rounded-full transition-colors ".concat(myStatuses.includes('need_help') ? 'bg-green-500' : 'bg-gray-300', " disabled:opacity-50"), children: /*#__PURE__*/ _jsx("span", { className: "inline-block h-3.5 w-3.5 transform rounded-full bg-white shadow transition-transform ".concat(myStatuses.includes('need_help') ? 'translate-x-5.5' : 'translate-x-1') }) }) ] }) : /*#__PURE__*/ _jsx("p", { className: "text-xs text-amber-700", children: t('status.plan_required', 'Status is unavailable on your current plan') }) : /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-600", children: t('status.admin_not_applicable', 'User status is not applicable to admin accounts') }) }) ] }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ _jsx("h2", { className: "font-semibold text-gray-800 mb-4", children: t('profile.background.title', 'Profile header background') }), /*#__PURE__*/ _jsx("div", { className: "w-full h-40 rounded-2xl border border-gray-200 overflow-hidden relative", style: { backgroundImage: siteSettings.profileBackgroundImage ? "linear-gradient(135deg, rgba(22,163,74,0.45), rgba(21,128,61,0.65)), url(".concat(siteSettings.profileBackgroundImage, ")") : 'linear-gradient(135deg, #22c55e 0%, #16a34a 45%, #166534 100%)', backgroundSize: 'cover', backgroundPosition: 'center' }, children: backgroundUploading && /*#__PURE__*/ _jsx("div", { className: "absolute inset-0 bg-black/35 flex items-center justify-center", children: /*#__PURE__*/ _jsx("div", { className: "w-6 h-6 border-2 border-white border-t-transparent rounded-full animate-spin" }) }) }), /*#__PURE__*/ _jsxs("div", { className: "mt-4 flex flex-wrap gap-2", children: [ /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>{ var _backgroundFileRef_current; return (_backgroundFileRef_current = backgroundFileRef.current) === null || _backgroundFileRef_current === void 0 ? void 0 : _backgroundFileRef_current.click(); }, disabled: backgroundUploading, className: "bg-gray-100 hover:bg-gray-200 text-gray-700 px-4 py-2 rounded-lg text-sm font-medium disabled:opacity-50", children: backgroundUploading ? t('profile.photo.uploading', 'Uploading...') : t('profile.background.change', 'Change background') }), siteSettings.profileBackgroundImage && /*#__PURE__*/ _jsx("button", { type: "button", onClick: handleRemoveBackground, disabled: backgroundUploading, className: "bg-white hover:bg-gray-50 text-gray-700 px-4 py-2 rounded-lg text-sm font-medium border border-gray-200 disabled:opacity-50", children: t('profile.background.remove', 'Remove background') }), /*#__PURE__*/ _jsx("input", { ref: backgroundFileRef, type: "file", accept: "image/jpeg,image/png,image/webp", className: "hidden", onChange: handleBackgroundChange }) ] }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-2", children: t('profile.background.hint', 'Shown in the public profile header on web and mobile app.') }) ] }), /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6 space-y-4", children: [ /*#__PURE__*/ _jsx("h2", { className: "font-semibold text-gray-800", children: t('profile.basic_info') }), /*#__PURE__*/ _jsxs("div", { className: "grid grid-cols-2 gap-4", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('register.first_name') }), /*#__PURE__*/ _jsx("input", { value: formData.firstName, onChange: (e)=>setFormData({ ...formData, firstName: e.target.value }), required: true, className: "w-full border border-gray-300 rounded-lg px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-400 text-sm" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('register.last_name') }), /*#__PURE__*/ _jsx("input", { value: formData.lastName, onChange: (e)=>setFormData({ ...formData, lastName: e.target.value }), required: true, className: "w-full border border-gray-300 rounded-lg px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-400 text-sm" }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: "Email" }), /*#__PURE__*/ _jsx("input", { value: user === null || user === void 0 ? void 0 : user.email, disabled: true, className: "w-full border border-gray-200 rounded-lg px-3 py-2 text-sm text-gray-400 bg-gray-50 cursor-not-allowed" }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between mt-1.5", children: [ (user === null || user === void 0 ? void 0 : user.emailVerified) ? /*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-1 text-xs text-green-600", children: [ /*#__PURE__*/ _jsx("span", { className: "inline-block w-1.5 h-1.5 rounded-full bg-green-500" }), t('profile.email.verified') ] }) : /*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-1 text-xs text-amber-600", children: [ /*#__PURE__*/ _jsx("span", { className: "inline-block w-1.5 h-1.5 rounded-full bg-amber-500" }), t('profile.email.not_verified') ] }), !(user === null || user === void 0 ? void 0 : user.emailVerified) && /*#__PURE__*/ _jsx("button", { type: "button", disabled: resendState !== 'idle', onClick: handleResendVerification, className: "text-xs text-green-600 hover:underline disabled:opacity-60 disabled:no-underline", children: resendState === 'sending' ? t('login.unverified.sending') : resendState === 'sent' ? t('login.unverified.sent') : t('login.unverified.resend') }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('profile.phone') }), /*#__PURE__*/ _jsx("input", { type: "tel", value: formData.phone, onChange: (e)=>setFormData({ ...formData, phone: e.target.value }), placeholder: t('profile.phone.placeholder'), className: "w-full border border-gray-300 rounded-lg px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-400 text-sm" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('profile.bio') }), /*#__PURE__*/ _jsx("textarea", { value: formData.bio, onChange: (e)=>setFormData({ ...formData, bio: e.target.value }), rows: 3, maxLength: 1000, placeholder: t('profile.bio.placeholder'), className: "w-full border border-gray-300 rounded-lg px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-400 text-sm resize-none" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('profile.language') }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mb-2", children: t('profile.language.hint') }), /*#__PURE__*/ _jsxs("select", { value: formData.locale, onChange: (e)=>setFormData({ ...formData, locale: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400", children: [ /*#__PURE__*/ _jsx("option", { value: "el", children: "ΕλληΜικά" }), /*#__PURE__*/ _jsx("option", { value: "en", children: "English" }), /*#__PURE__*/ _jsx("option", { value: "ru", children: "РусскОй" }), /*#__PURE__*/ _jsx("option", { value: "uk", children: "УкраїМська" }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('profile.languages') }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mb-2", children: t('profile.languages.hint') }), /*#__PURE__*/ _jsx("div", { className: "flex flex-wrap gap-2", children: [ { code: 'el', flag: '🇬🇷', label: 'ΕλληΜικά' }, { code: 'en', flag: '🇬🇧', label: 'English' }, { code: 'ru', flag: '🇷🇺', label: 'РусскОй' }, { code: 'uk', flag: '🇺🇊', label: 'УкраїМська' }, { code: 'de', flag: '🇩🇪', label: 'Deutsch' }, { code: 'fr', flag: '🇫🇷', label: 'Français' }, { code: 'it', flag: '🇮🇹', label: 'Italiano' }, { code: 'es', flag: '🇪🇞', label: 'Español' }, { code: 'ar', flag: '🇞🇊', label: 'العرؚية' }, { code: 'zh', flag: '🇚🇳', label: 'äž­æ–‡' } ].map((param)=>{ let { code, flag, label } = param; const selected = selectedLanguages.includes(code); return /*#__PURE__*/ _jsxs("button", { type: "button", onClick: ()=>setSelectedLanguages(selected ? selectedLanguages.filter((l)=>l !== code) : [ ...selectedLanguages, code ]), className: "flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-sm border transition ".concat(selected ? 'bg-green-600 border-green-600 text-white' : 'bg-white border-gray-300 text-gray-700 hover:border-green-400'), children: [ /*#__PURE__*/ _jsx("span", { children: flag }), /*#__PURE__*/ _jsx("span", { children: label }) ] }, code); }) }) ] }) ] }), !isSpecialist && !isAdmin && /*#__PURE__*/ _jsx("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: /*#__PURE__*/ _jsxs("div", { className: "p-4 bg-purple-50 rounded-xl", children: [ /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-600 mb-3", children: t('profile.become_specialist.desc') }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: handleBecomeSpecialist, disabled: becomingSpecialist, className: "bg-purple-600 hover:bg-purple-700 text-white px-5 py-2 rounded-lg text-sm font-semibold disabled:opacity-50", children: becomingSpecialist ? t('common.loading') : t('profile.become_specialist') }) ] }) }), isSpecialist && ((dashData === null || dashData === void 0 ? void 0 : (_dashData_plan = dashData.plan) === null || _dashData_plan === void 0 ? void 0 : _dashData_plan.tier) === 'pro' || (dashData === null || dashData === void 0 ? void 0 : (_dashData_plan1 = dashData.plan) === null || _dashData_plan1 === void 0 ? void 0 : _dashData_plan1.tier) === 'ultimate') && /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ _jsx("h2", { className: "font-semibold text-gray-800 mb-4", children: t('profile.show_contact', 'Show contacts') }), /*#__PURE__*/ _jsxs("label", { className: "flex items-center justify-between cursor-pointer gap-3", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "text-sm font-medium text-gray-800", children: t('profile.show_contact_hint', 'Clients can see your phone number') }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-0.5", children: t('profile.show_contact_desc', 'Lets clients contact you directly') }) ] }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setShowContactInfo((v)=>!v), className: "relative inline-flex h-6 w-11 items-center rounded-full transition-colors ".concat(showContactInfo ? 'bg-green-500' : 'bg-gray-300'), children: /*#__PURE__*/ _jsx("span", { className: "inline-block h-4 w-4 transform rounded-full bg-white shadow transition-transform ".concat(showContactInfo ? 'translate-x-6' : 'translate-x-1') }) }) ] }) ] }) ] }), /*#__PURE__*/ _jsx("button", { type: "submit", disabled: saving, className: "w-full bg-green-600 text-white py-3 rounded-xl font-semibold hover:bg-green-700 disabled:opacity-50 disabled:cursor-not-allowed ".concat(activeTab === 'notifications' || activeTab === 'referral' || activeTab === 'auto_response' ? 'hidden' : ''), children: saving ? t('profile.saving') : t('common.save') }) ] }), showUpgradeModal && /*#__PURE__*/ _jsx("div", { className: "fixed inset-0 z-50 flex items-center justify-center bg-black/50 px-4", children: /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-2xl shadow-xl p-6 w-full max-w-md", children: [ /*#__PURE__*/ _jsx("div", { className: "text-center mb-5", children: /*#__PURE__*/ _jsx("span", { className: "text-5xl", children: "\uD83D\uDE80" }) }), /*#__PURE__*/ _jsx("h2", { className: "text-lg font-bold text-gray-900 text-center mb-2", children: t('profile.upgrade.cards_limit') }), /*#__PURE__*/ _jsxs("p", { className: "text-sm text-gray-600 text-center mb-4", children: [ (_user_plan_name = user === null || user === void 0 ? void 0 : (_user_plan3 = user.plan) === null || _user_plan3 === void 0 ? void 0 : _user_plan3.name) !== null && _user_plan_name !== void 0 ? _user_plan_name : t('profile.plan.basic'), " — ", t('profile.plan.cards_up_to'), " ", maxCards ] }), (user === null || user === void 0 ? void 0 : user.plan) && /*#__PURE__*/ _jsxs("div", { className: "bg-gray-50 rounded-xl p-4 mb-5 text-sm text-gray-600 text-center", children: [ /*#__PURE__*/ _jsx("span", { className: "font-medium text-gray-800", children: t('profile.upgrade.plan') }), ' ', user.plan.name, " — ", user.plan.price, " ", user.plan.currency ] }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 text-center mb-5", children: t('profile.upgrade.contact') }), /*#__PURE__*/ _jsx("button", { onClick: ()=>setShowUpgradeModal(false), className: "w-full bg-green-600 hover:bg-green-700 text-white py-2.5 rounded-xl text-sm font-semibold", children: t('profile.upgrade.ok') }) ] }) }) ] }) ] }) ] }); } `rÌÿÿsÌÿÿ  tÌÿÿžÊÿÿ*ÌÿÿíÌÿÿþüÌÿÿ ýÌÿÿþÌÿÿÿÌÿÿ<ÍÿÿÍÿÿ=Íÿÿbacf2f6352c18345ÍÿÿœÊÿÿ  Íÿÿ ”SpecialistCardEditorAutoResponseTabProfilePageInner=Íÿÿ‹ProfilePage •mÿyBÌÿÿ#Ìÿÿ ` dÿÿý€ `=@“ a=@“€ A”Ò `>€ AÓ `=€ AE `4€ AFs `-€ At• `!€ A–â `L#Íÿÿ Ap'' @î`.@î`M0 A“'ª' @î`.@î`h A^HýH AOHýH @ù@þÍÿÿ AĀ〠@>`.@>`M0 Aç€þ€ @>`.@>`hÍÿÿ A‚4‚ @E`&@E`E0 A8‚O‚ @E`&@E``Íÿÿ Aµ…ԅ @^`.@^`M0 A؅ï… @^`.@^`hÍÿÿ A‡%‡ @e`&@e`E0 A)‡@‡ @e`&@e``… true AÙ­ñ­ @q `YAq 0 A ®® Cq q  @ªàÌÿÿàÌÿÿ a=@“†Êÿÿ†Êÿÿ `>-Íÿÿ-Íÿÿ `=0Íÿÿ0Íÿÿ `41Íÿÿ1Íÿÿ `-2Íÿÿ2Íÿÿ `!ìÕÿÿìÕÿÿ `L IÍÿÿHÍÿÿ AÇÐ   3Íÿÿ*Íÿÿ*Íÿÿý b  ØÌÿÿ×Ìÿÿ A3;  ûxÊÿÿxÊÿÿþ c " * ÔÌÿÿÓÌÿÿ Aem  ÷tÊÿÿtÊÿÿþ c ( ÐÌÿÿÏÌÿÿ A˜   ópÊÿÿpÊÿÿþ c"* ÌÌÿÿËÌÿÿ AÑÙ  ïlÊÿÿlÊÿÿþ c(0 ÈÌÿÿÇÌÿÿ A.6  ëhÊÿÿhÊÿÿþ c*2 ÄÌÿÿÃÌÿÿ Añù  çdÊÿÿdÊÿÿþ c*2 ÀÌÿÿ¿Ìÿÿ AŽŒ  ã`Êÿÿ`Êÿÿþ c*2 ŒÌÿÿ»Ìÿÿ Aw  ß\Êÿÿ\Êÿÿþ c*2 žÌÿÿ·Ìÿÿ A3;  ÛXÊÿÿXÊÿÿþ c*2 ŽÌÿÿ³Ìÿÿ A»Ã  ×TÊÿÿTÊÿÿþ c(0 °Ìÿÿ¯Ìÿÿ A  ÓPÊÿÿPÊÿÿþ c2: ¬Ìÿÿ«Ìÿÿ AÎÖ  ÏLÊÿÿLÊÿÿþ c08 šÌÿÿ§Ìÿÿ A› £   ËHÊÿÿHÊÿÿþ c @ H €Ìÿÿ£Ìÿÿ Av ~   ÇDÊÿÿDÊÿÿþ c!,!4  ÌÿÿŸÌÿÿ AÃ Ë   Ã@Êÿÿ@Êÿÿþ c#&#. œÌÿÿ›Ìÿÿ Ag o   ¿<Êÿÿ<Êÿÿþ c$8$@ ˜Ìÿÿ—Ìÿÿ A¢ ª   »8Êÿÿ8Êÿÿþ c%*%2 ”Ìÿÿ“Ìÿÿ AØ à   ·4Êÿÿ4Êÿÿþ c&&&. ÌÿÿÌÿÿ A    ³0Êÿÿ0Êÿÿþ c'$', %Íÿÿ$Íÿÿ A5 ;   ¯,Êÿÿ,Êÿÿþ c((# ˆÌÿÿ‡Ìÿÿ A ‰   «(Êÿÿ(Êÿÿþ c*&*. „ÌÿÿƒÌÿÿ AÃ Ë   §$Êÿÿ$Êÿÿþ c+4+< €ÌÿÿÌÿÿ A   £ Êÿÿ Êÿÿþ c,.,6 |Ìÿÿ{Ìÿÿ A> F   ŸÊÿÿÊÿÿþ c-.-6 xÌÿÿwÌÿÿ Ap x   ›ÊÿÿÊÿÿþ c.".* tÌÿÿsÌÿÿ A   —ÊÿÿÊÿÿþ c4048 pÌÿÿoÌÿÿ ABJ  “ÊÿÿÊÿÿþ c5058 rÌÿÿqÌÿÿ AT]   Êÿÿ Êÿÿþ c66  IüÿÿIÙÿÿ Aèø  Aèë  Š·Ìÿÿ·Ìÿÿý c99 ”createPriceListGroupCÙÿÿ Aò   Aòõ  „±Ìÿÿ±Ìÿÿý c@@4 ”deletePriceListGroup=Ùÿÿ AÈà  AÈË  ~ÿÿÿ«Ìÿÿ«Ìÿÿý cQQ& ”updatePriceListGroup7Ùÿÿ A„œ  A„‡  xÿÿÿ¥Ìÿÿ¥Ìÿÿý cUU6 “createPriceListItem1Ùÿÿ AÏæ  AÏÒ  rÿÿÿŸÌÿÿŸÌÿÿý cgg2 “deletePriceListItem+Ùÿÿ AQh  AQT  lÿÿÿ™Ìÿÿ™Ìÿÿý @„`@„`% KÌÿÿJÌÿÿ A/8  hÿÿÿåÉÿÿåÉÿÿþ @Š@Š`  “getSkillSuggestions!Ùÿÿ Aqˆ  Aqt  bÿÿÿÌÿÿÌÿÿý @Œ@Œ` ”updateSpecialistCardÙÿÿ Aì  Aìï  \ÿÿÿ‰Ìÿÿ‰Ìÿÿý @£`"@£`: úÙÿÿ A8 P   A8 ;   Wÿÿÿ„Ìÿÿ„Ìÿÿý @»`@»`* “deletePortfolioItemÙÿÿ Ao*†*  Ao*r*  Qÿÿÿ~Ìÿÿ~Ìÿÿý @`@`) “updatePortfolioItem Ùÿÿ AÀ+×+  AÀ+Ã+  KÿÿÿxÌÿÿxÌÿÿý @`@`6  Íÿÿ Íÿÿ A 11  GÿÿÿÌÿÿÌÿÿþ @9`@9` ÍÿÿÍÿÿ A—1œ1  CÿÿÿÌÿÿÌÿÿþ @<`@<` ÍÿÿÍÿÿ Ao2t2  ?ÿÿÿÌÿÿÌÿÿþ @?`"@?`' #Ìÿÿ$Ìÿÿ Aq3u3  ;ÿÿÿÌÿÿÌÿÿþ @D`*@D`. Ìÿÿ Ìÿÿ A}44  7ÿÿÿ Ìÿÿ Ìÿÿþ @H`A@H`E ÌÿÿÌÿÿ A66  3ÿÿÿ Ìÿÿ Ìÿÿþ @M`*@M`. ÌÿÿÌÿÿ A7 7  /ÿÿÿÌÿÿÌÿÿþ @S`"@S`& ÌÿÿÌÿÿ Aw:{:  +ÿÿÿÌÿÿÌÿÿþ @Y`"@Y`& ëÌÿÿìÌÿÿ A<<  'ÿÿÿýËÿÿýËÿÿþ @b`$@b`) çÌÿÿèÌÿÿ Ag<l<  #ÿÿÿùËÿÿùËÿÿþ @d`9@d`> ÌÿÿÌÿÿ A,=0=  ÿÿÿõËÿÿõËÿÿþ @g`*@g`. ÌÿÿÌÿÿ AA>E>  ÿÿÿñËÿÿñËÿÿþ @k`*@k`. ÿËÿÿÌÿÿ A ??  ÿÿÿíËÿÿíËÿÿþ @m`V@m`Z ×ÌÿÿØÌÿÿ A@@  ÿÿÿéËÿÿéËÿÿþ @s`?@s`D ÷ËÿÿøËÿÿ AuAyA  ÿÿÿåËÿÿåËÿÿþ @v`*@v`. óËÿÿôËÿÿ ACC   ÿÿÿáËÿÿáËÿÿþ @z`L@z`P ïËÿÿðËÿÿ AªD®D  ÿÿÿÝËÿÿÝËÿÿþ @€`"@€`& ëËÿÿìËÿÿ AvEzE  ÿÿÿÙËÿÿÙËÿÿþ @‚`Y@‚`] ÃÌÿÿÄÌÿÿ A…GŠG  ÿþÿÿÕËÿÿÕËÿÿþ @‰`"@‰`' ¿ÌÿÿÀÌÿÿ A"H'H  ûþÿÿÑËÿÿÑËÿÿþ @Œ`@@Œ`E ßËÿÿàËÿÿ AÇHËH  ÷þÿÿÍËÿÿÍËÿÿþ @`2@`6 ·ÌÿÿžÌÿÿ A S¥S  óþÿÿÉËÿÿÉËÿÿþ @œ`=@œ`B ³ÌÿÿŽÌÿÿ A%T*T  ïþÿÿÅËÿÿÅËÿÿþ @¿`>@¿`C ÓËÿÿÔËÿÿ AV”V  ëþÿÿÁËÿÿÁËÿÿþ @Ç`>@Ç`B ÏËÿÿÐËÿÿ ATYXY  çþÿÿœËÿÿœËÿÿþ @Ï`E@Ï`I §ÌÿÿšÌÿÿ AçZìZ  ãþÿÿ¹Ëÿÿ¹Ëÿÿþ @Ó`Q@Ó`V ÇËÿÿÈËÿÿ Aß[ã[  ßþÿÿµËÿÿµËÿÿþ @Ö`F@Ö`J ÃËÿÿÄËÿÿ Ai]m]  Ûþÿÿ±Ëÿÿ±Ëÿÿþ @Ú`\@Ú`` ›ÌÿÿœÌÿÿ AC`H`  ×þÿÿ­Ëÿÿ­Ëÿÿþ @å`B@å`G »ËÿÿŒËÿÿ Aaa  Óþÿÿ©Ëÿÿ©Ëÿÿþ @è`L@è`P “Ìÿÿ”Ìÿÿ A°aµa  Ïþÿÿ¥Ëÿÿ¥Ëÿÿþ @ê`U@ê`Z ³ËÿÿŽËÿÿ Ac c  Ëþÿÿ¡Ëÿÿ¡Ëÿÿþ @î`B@î`F ‹ÌÿÿŒÌÿÿ AŒe‘e  ÇþÿÿËÿÿËÿÿþ @÷`2@÷`7 «Ëÿÿ¬Ëÿÿ AJfNf  Ãþÿÿ™Ëÿÿ™Ëÿÿþ @ú`:@ú`> §ËÿÿšËÿÿ Aýij  ¿þÿÿ•Ëÿÿ•Ëÿÿþ @`:@`> £Ëÿÿ€Ëÿÿ A2l6l  »þÿÿ‘Ëÿÿ‘Ëÿÿþ @`M@`Q {Ìÿÿ|Ìÿÿ Afnkn  ·þÿÿËÿÿËÿÿþ C¡Š ›ËÿÿœËÿÿ A†qŠq  ³þÿÿ‰Ëÿÿ‰Ëÿÿþ @`F@`J sÌÿÿtÌÿÿ Aaufu  ¯þÿÿ…Ëÿÿ…Ëÿÿþ @(`9@(`> oÌÿÿpÌÿÿ AÞuãu  «þÿÿËÿÿËÿÿþ @*`:@*`? ËÿÿËÿÿ AÔvØv  §þÿÿ}Ëÿÿ}Ëÿÿþ @-`B@-`F gÌÿÿhÌÿÿ Ayy  £þÿÿyËÿÿyËÿÿþ @3`B@3`G ‡ËÿÿˆËÿÿ A2z6z  ŸþÿÿuËÿÿuËÿÿþ @6`V@6`Z ™Ôÿÿ˜Ôÿÿ A7zCz 4›þÿÿƒÔÿÿƒÔÿÿþ @6`[@6`g °ýÿÿ¯ýÿÿ A0{A{  —þÿÿÔÿÿÔÿÿþ @9`K@9`\ {Ëÿÿ|Ëÿÿ A‚}†}  “þÿÿiËÿÿiËÿÿþ @A`Q@A`U SÌÿÿTÌÿÿ A­€²€  þÿÿeËÿÿeËÿÿþ @G`I@G`N sËÿÿtËÿÿ A»¿  ‹þÿÿaËÿÿaËÿÿþ @J`J@J`N oËÿÿpËÿÿ A „„  ‡þÿÿ]Ëÿÿ]Ëÿÿþ @P`J@P`N kËÿÿlËÿÿ AΆ҆  ƒþÿÿYËÿÿYËÿÿþ @\`E@\`I CÌÿÿDÌÿÿ AƊˊ  þÿÿUËÿÿUËÿÿþ @e`9@e`> ?Ìÿÿ@Ìÿÿ AC‹H‹  {þÿÿQËÿÿQËÿÿþ @g`:@g`? _Ëÿÿ`Ëÿÿ A9Œ=Œ  wþÿÿMËÿÿMËÿÿþ @j`B@j`F [Ëÿÿ\Ëÿÿ AjŽnŽ  sþÿÿIËÿÿIËÿÿþ @p`B@p`F WËÿÿXËÿÿ A  oþÿÿEËÿÿEËÿÿþ @v`R@v`V /Ìÿÿ0Ìÿÿ A!“&“  kþÿÿAËÿÿAËÿÿþ @|`I@|`N OËÿÿPËÿÿ A/”3”  gþÿÿ=Ëÿÿ=Ëÿÿþ @`J@`N KËÿÿLËÿÿ A{––  cþÿÿ9Ëÿÿ9Ëÿÿþ @…`J@…`N GËÿÿHËÿÿ A:™>™  _þÿÿ5Ëÿÿ5Ëÿÿþ @‘`E@‘`I CËÿÿDËÿÿ A˙ϙ  [þÿÿ1Ëÿÿ1Ëÿÿþ @“`K@“`O ÌÿÿÌÿÿ Aµšºš  Wþÿÿ-Ëÿÿ-Ëÿÿþ @–`3@–`8 jÌÿÿkÌÿÿ A»šÄš 4Sþÿÿ)Ëÿÿ)Ëÿÿþ @–`9@–`B 7Ëÿÿ8Ëÿÿ AH›L›  Oþÿÿ%Ëÿÿ%Ëÿÿþ @˜`P@˜`T ÌÿÿÌÿÿ Aºœ¿œ  Kþÿÿ!Ëÿÿ!Ëÿÿþ @œ`M@œ`R /Ëÿÿ0Ëÿÿ A·»  GþÿÿËÿÿËÿÿþ @Ÿ`B@Ÿ`F ÌÿÿÌÿÿ AÁžÆž  CþÿÿËÿÿËÿÿþ @¡`n@¡`sìXÌÿÿ AǞО 4@þÿÿËÿÿËÿÿþ @¡`t@¡`} $Ëÿÿ%Ëÿÿ AjŸnŸ  <þÿÿËÿÿËÿÿþ @£`N@£`R  Ëÿÿ!Ëÿÿ A££  8þÿÿËÿÿËÿÿþ @¬`N@¬`R ËÿÿËÿÿ A•¥™¥  4þÿÿ Ëÿÿ Ëÿÿþ @²`N@²`R ôËÿÿõËÿÿ A šš  0þÿÿËÿÿËÿÿþ @¹`K@¹`PÙEÌÿÿ Ašš 4-þÿÿËÿÿËÿÿþ @¹`Q@¹`Z ËÿÿËÿÿ A³š·š  )þÿÿÿÊÿÿÿÊÿÿþ @»`N@»`R  ËÿÿËÿÿ A+ª/ª  %þÿÿûÊÿÿûÊÿÿþ @¿`N@¿`R  Ëÿÿ Ëÿÿ A}­­  !þÿÿ÷Êÿÿ÷Êÿÿþ @È`N@È`R ËÿÿËÿÿ Aš°ž°  þÿÿóÊÿÿóÊÿÿþ @Ñ`B@Ñ`F ÝËÿÿÞËÿÿ Ao±t±  þÿÿïÊÿÿïÊÿÿþ @Ó`h@Ó`m ÙËÿÿÚËÿÿ Aœ²¡²  þÿÿëÊÿÿëÊÿÿþ @Ö`R@Ö`W ùÊÿÿúÊÿÿ AŸ³Â³  þÿÿçÊÿÿçÊÿÿþ @Ù`Z@Ù`^ õÊÿÿöÊÿÿ Amµqµ   þÿÿãÊÿÿãÊÿÿþ @Ý`n@Ý`r ÍËÿÿÎËÿÿ A±·¶·   þÿÿßÊÿÿßÊÿÿþ @ã`o@ã`t íÊÿÿîÊÿÿ Aoºsº  þÿÿÛÊÿÿÛÊÿÿþ @ê`R@ê`V ÅËÿÿÆËÿÿ Aåœêœ  þÿÿ×Êÿÿ×Êÿÿþ @ó`_@ó`d åÊÿÿæÊÿÿ AüŸ¿  ýýÿÿÓÊÿÿÓÊÿÿþ @ö`J@ö`N áÊÿÿâÊÿÿ AƒÂ  ùýÿÿÏÊÿÿÏÊÿÿþ @ÿ`J@ÿ`N ¹ËÿÿºËÿÿ AÆÆ  õýÿÿËÊÿÿËÊÿÿþ @`J@`O ÙÊÿÿÚÊÿÿ AÇÇ  ñýÿÿÇÊÿÿÇÊÿÿþ @ `R@ `V ÕÊÿÿÖÊÿÿ AâÊæÊ  íýÿÿÃÊÿÿÃÊÿÿþ @`R@`V ­Ëÿÿ®Ëÿÿ A&Ï+Ï  éýÿÿ¿Êÿÿ¿Êÿÿþ @`J@`O ÍÊÿÿÎÊÿÿ A,Ð0Ð  åýÿÿ»Êÿÿ»Êÿÿþ @"`R@"`V ÉÊÿÿÊÊÿÿ AÁÒÅÒ  áýÿÿ·Êÿÿ·Êÿÿþ @(`R@(`V ÅÊÿÿÆÊÿÿ AsØwØ  Ýýÿÿ³Êÿÿ³Êÿÿþ @9`G@9`K ËÿÿžËÿÿ A:Ù?Ù  Ùýÿÿ¯Êÿÿ¯Êÿÿþ @;`P@;`U ™ËÿÿšËÿÿ AÄÜÉÜ  Õýÿÿ«Êÿÿ«Êÿÿþ @G`6@G`; ¹ÊÿÿºÊÿÿ A“Ý—Ý  Ñýÿÿ§Êÿÿ§Êÿÿþ @J`>@J`B µÊÿÿ¶Êÿÿ AŒàÀà  Íýÿÿ£Êÿÿ£Êÿÿþ @S`>@S`B ËÿÿŽËÿÿ A’ã—ã  ÉýÿÿŸÊÿÿŸÊÿÿþ @^`E@^`J ‰ËÿÿŠËÿÿ APäUä  Åýÿÿ›Êÿÿ›Êÿÿþ @a`K@a`P ©ÊÿÿªÊÿÿ AÍäÑä  Áýÿÿ—Êÿÿ—Êÿÿþ @c`:@c`> Ëÿÿ‚Ëÿÿ Aè"è  œýÿÿ“Êÿÿ“Êÿÿþ @k`]@k`bfÿÿÿÒËÿÿ A#è,è 4ºýÿÿÊÿÿÊÿÿþ @k`c@k`l žÊÿÿŸÊÿÿ A¶èºè  ¶ýÿÿŒÊÿÿŒÊÿÿþ @m`F@m`J vËÿÿwËÿÿ Ajêoê  ²ýÿÿˆÊÿÿˆÊÿÿþ @r`C@r`H[ÿÿÿÇËÿÿ Apêyê 4¯ýÿÿ…Êÿÿ…Êÿÿþ @r`I@r`R “Êÿÿ”Êÿÿ A-ì1ì  «ýÿÿÊÿÿÊÿÿþ @y`:@y`> ÊÿÿÊÿÿ A~î‚î  §ýÿÿ}Êÿÿ}Êÿÿþ @‚`K@‚`O ‹ÊÿÿŒÊÿÿ A¢ïŠï  £ýÿÿyÊÿÿyÊÿÿþ @…`7@…`; cËÿÿdËÿÿ AÔðÙð  ŸýÿÿuÊÿÿuÊÿÿþ @‰`A@‰`F ƒÊÿÿ„Êÿÿ Aëñïñ  ›ýÿÿqÊÿÿqÊÿÿþ @Œ`B@Œ`F [Ëÿÿ\Ëÿÿ Aµóºó  —ýÿÿmÊÿÿmÊÿÿþ @‘`B@‘`G {Êÿÿ|Êÿÿ Aýôõ  “ýÿÿiÊÿÿiÊÿÿþ @”`J@”`N SËÿÿTËÿÿ A÷”÷  ýÿÿeÊÿÿeÊÿÿþ @š`J@š`O sÊÿÿtÊÿÿ Açýëý  ‹ýÿÿaÊÿÿaÊÿÿþ @«`P@«`T oÊÿÿpÊÿÿ A—þ›þ  ‡ýÿÿ]Êÿÿ]Êÿÿþ @­`P@­`T GËÿÿHËÿÿ A:?  ƒýÿÿYÊÿÿYÊÿÿþ @ž``@ž`e gÊÿÿhÊÿÿ A  ýÿÿUÊÿÿUÊÿÿþ @»`2@»`6 ?Ëÿÿ@Ëÿÿ A,1  {ýÿÿQÊÿÿQÊÿÿþ @Â`=@Â`B _Êÿÿ`Êÿÿ AAE  wýÿÿMÊÿÿMÊÿÿþ @Ï`)@Ï`- 7Ëÿÿ8Ëÿÿ AÚß  sýÿÿIÊÿÿIÊÿÿþ @Ñ`(@Ñ`- WÊÿÿXÊÿÿ A„ˆ  oýÿÿEÊÿÿEÊÿÿþ @Ô`&@Ô`* SÊÿÿTÊÿÿ A`d  kýÿÿAÊÿÿAÊÿÿþ @Ø`&@Ø`* +Ëÿÿ,Ëÿÿ A^ c   gýÿÿ=Êÿÿ=Êÿÿþ @Ý`&@Ý`+ 'Ëÿÿ(Ëÿÿ A÷ ü   cýÿÿ9Êÿÿ9Êÿÿþ @à`.@à`3 GÊÿÿHÊÿÿ Al p   _ýÿÿ5Êÿÿ5Êÿÿþ @â`6@â`: CÊÿÿDÊÿÿ A˜ œ   [ýÿÿ1Êÿÿ1Êÿÿþ @æ`6@æ`: ËÿÿËÿÿ AÆ Ë   Wýÿÿ-Êÿÿ-Êÿÿþ @î`.@î`3 ;Êÿÿ<Êÿÿ A;?  Sýÿÿ)Êÿÿ)Êÿÿþ @ð`6@ð`: 7Êÿÿ8Êÿÿ Afj  Oýÿÿ%Êÿÿ%Êÿÿþ @ô`6@ô`: ËÿÿËÿÿ A   Kýÿÿ!Êÿÿ!Êÿÿþ @ÿ`&@ÿ`+ /Êÿÿ0Êÿÿ A§«  GýÿÿÊÿÿÊÿÿþ @`.@`2 +Êÿÿ,Êÿÿ Afj  CýÿÿÊÿÿÊÿÿþ @`.@`2 "Êÿÿ!Êÿÿ A…Ž  Êÿÿ  rÊÿÿ»Çÿÿ»Çÿÿý @@` ÊÿÿÊÿÿ A˜   Êÿÿ û·Çÿÿ·Çÿÿþ @@` ÊÿÿÊÿÿ A–š  ÷ Êÿÿ Êÿÿþ @8`&@8`* öÊÿÿ÷Êÿÿ A¯Ž  óÊÿÿÊÿÿþ @H`@H` ÊÿÿÊÿÿ A    ïÊÿÿÊÿÿþ @K`@K` îÊÿÿïÊÿÿ A ”   ëÊÿÿÊÿÿþ @M`(@M`- êÊÿÿëÊÿÿ A9!>!  çüÉÿÿüÉÿÿþ @P`&@P`+  Êÿÿ Êÿÿ Až!¢!  ãøÉÿÿøÉÿÿþ @R`.@R`2 ÊÿÿÊÿÿ A "€"  ßôÉÿÿôÉÿÿþ @V`.@V`2 ÊÿÿÊÿÿ Aï#ó#  ÛðÉÿÿðÉÿÿþ @\`&@\`* þÉÿÿÿÉÿÿ AD%H%  ×ìÉÿÿìÉÿÿþ @``4@``8 ÖÊÿÿ×Êÿÿ A“&˜&  ÓèÉÿÿèÉÿÿþ @g`@g` öÉÿÿ÷Éÿÿ A7';'  ÏäÉÿÿäÉÿÿþ @j`"@j`& ÎÊÿÿÏÊÿÿ A((  ËàÉÿÿàÉÿÿþ @n`"@n`' ÊÊÿÿËÊÿÿ A±(¶(  ÇÜÉÿÿÜÉÿÿþ @q`*@q`/ êÉÿÿëÉÿÿ A)")  ÃØÉÿÿØÉÿÿþ @s`2@s`6 æÉÿÿçÉÿÿ A8*<*  ¿ÔÉÿÿÔÉÿÿþ @w`2@w`6 ŸÊÿÿ¿Êÿÿ A²,·,  »ÐÉÿÿÐÉÿÿþ @`*@`/ ÞÉÿÿßÉÿÿ A-#-  ·ÌÉÿÿÌÉÿÿþ @ƒ`2@ƒ`6 ÚÉÿÿÛÉÿÿ A9.=.  ³ÈÉÿÿÈÉÿÿþ @‡`2@‡`6 ²Êÿÿ³Êÿÿ AÜ0á0  ¯ÄÉÿÿÄÉÿÿþ @“`"@“`' ÒÉÿÿÓÉÿÿ A91=1  «ÀÉÿÿÀÉÿÿþ @•`*@•`. ÎÉÿÿÏÉÿÿ A@2D2  §ŒÉÿÿŒÉÿÿþ @™`*@™`. ŠÊÿÿ§Êÿÿ A>4C4  £žÉÿÿžÉÿÿþ @¢`"@¢`' ÆÉÿÿÇÉÿÿ A›4Ÿ4  ŸŽÉÿÿŽÉÿÿþ @€`*@€`. ÂÉÿÿÃÉÿÿ A€5š5  ›°Éÿÿ°Éÿÿþ @š`*@š`. šÊÿÿ›Êÿÿ Aà7å7  —¬Éÿÿ¬Éÿÿþ @Ž`@Ž` ºÉÿÿ»Éÿÿ Az8~8  “šÉÿÿšÉÿÿþ @·`"@·`& ¶Éÿÿ·Éÿÿ Af9j9  €Éÿÿ€Éÿÿþ @»`"@»`& ŽÊÿÿÊÿÿ AŒ;Á;  ‹ Éÿÿ Éÿÿþ @Å`3@Å`8 ®Éÿÿ¯Éÿÿ AV<Z<  ‡œÉÿÿœÉÿÿþ @È`"@È`& ªÉÿÿ«Éÿÿ A==A=  ƒ˜Éÿÿ˜Éÿÿþ @Ì`"@Ì`& ŠÉÿÿ§Éÿÿ A{AA  ÿÿÿ”Éÿÿ”Éÿÿþ @Ù`1@Ù`5 ¢Éÿÿ£Éÿÿ AcDgD  {ÿÿÿÉÿÿÉÿÿþ @æ`@æ`~üÿÿìÉÿÿ @ù@þ ÉÿÿžÉÿÿ AH”H   èÉÿÿŠÉÿÿŠÉÿÿý @ú`@ú` ÒËÿÿÑËÿÿ A•HH 4û-Çÿÿ-Çÿÿþ @ú`@ú`& ”Éÿÿ•Éÿÿ AÙHÝH  ÷‚Éÿÿ‚Éÿÿþ @ü` @ü`$ áÉÿÿàÉÿÿ AJJ   ÛÉÿÿÌÉÿÿÌÉÿÿý @`@` âÉÿÿáÉÿÿ A:JIJ  ûÈÉÿÿÈÉÿÿþ @`@`( ãÉÿÿâÉÿÿ AvJ€J  ÷ÈÉÿÿÈÉÿÿþ @`)@`3 äÉÿÿãÉÿÿ AžJ§J  óÆÉÿÿÆÉÿÿþ @`@`# tÉÿÿsÉÿÿ A3L;L  ïÇÿÿÇÿÿþ @`&@`. pÉÿÿoÉÿÿ AL—L  ëÇÿÿÇÿÿþ @`@`$ lÉÿÿkÉÿÿ AÁLÉL  ç Çÿÿ Çÿÿþ @`"@`* hÉÿÿgÉÿÿ AñLùL  ãÇÿÿÇÿÿþ @` @`( dÉÿÿcÉÿÿ A M(M  ßÇÿÿÇÿÿþ @`@`& `Éÿÿ_Éÿÿ AOMWM  ÛÇÿÿÇÿÿþ @`@`& \Éÿÿ[Éÿÿ AM‰M  ×üÆÿÿüÆÿÿþ @`$@`, XÉÿÿWÉÿÿ A0N8N  ÓøÆÿÿøÆÿÿþ @`6@`> TÉÿÿSÉÿÿ AtN|N  ÏôÆÿÿôÆÿÿþ @ `@ `& PÉÿÿOÉÿÿ AŠN®N  ËðÆÿÿðÆÿÿþ @!`$@!`, LÉÿÿKÉÿÿ AßNçN  ÇìÆÿÿìÆÿÿþ @"`,@"`4 HÉÿÿGÉÿÿ A&O.O  ÃèÆÿÿèÆÿÿþ @#`6@#`> DÉÿÿCÉÿÿ A\OdO  ¿äÆÿÿäÆÿÿþ @$`(@$`0 @Éÿÿ?Éÿÿ A˜O O  »àÆÿÿàÆÿÿþ @%`,@%`4 <Éÿÿ;Éÿÿ AÕOÝO  ·ÜÆÿÿÜÆÿÿþ @&`,@&`4 8Éÿÿ7Éÿÿ APP  ³ØÆÿÿØÆÿÿþ @'`2@'`: 4Éÿÿ3Éÿÿ AZPbP  ¯ÔÆÿÿÔÆÿÿþ @(`4@(`< 0Éÿÿ/Éÿÿ A©P±P  «ÐÆÿÿÐÆÿÿþ @*`(@*`0 ,Éÿÿ+Éÿÿ AãPëP  §ÌÆÿÿÌÆÿÿþ @+`,@+`4 (Éÿÿ'Éÿÿ ABQJQ  £ÈÆÿÿÈÆÿÿþ @-`8@-`@ $Éÿÿ#Éÿÿ A…QQ  ŸÄÆÿÿÄÆÿÿþ @.`2@.`:  ÉÿÿÉÿÿ AÐQØQ  ›ÀÆÿÿÀÆÿÿþ @/`:@/`B µÉÿÿŽÉÿÿ AõQûQ  —ŒÆÿÿŒÆÿÿþ @0`@0` ±Éÿÿ°Éÿÿ A!R'R  “žÆÿÿžÆÿÿþ @1`@1`$ ÉÿÿÉÿÿ AR‡R  ŽÆÿÿŽÆÿÿþ @3`0@3`8 ÉÿÿÉÿÿ AŸRÆR  ‹°Æÿÿ°Æÿÿþ @4`.@4`6  Éÿÿ Éÿÿ AúRS  ‡¬Æÿÿ¬Æÿÿþ @5`,@5`4 ÉÿÿÉÿÿ A5S=S  ƒšÆÿÿšÆÿÿþ @6`*@6`2 ÉÿÿÉÿÿ A‘S™S  ÿÿÿ€Æÿÿ€Æÿÿþ @8`*@8`2 ÉÿÿÿÈÿÿ AäSìS  {ÿÿÿ Æÿÿ Æÿÿþ @:`,@:`4 üÈÿÿûÈÿÿ A"T*T  wÿÿÿœÆÿÿœÆÿÿþ @;`.@;`6 øÈÿÿ÷Èÿÿ A_TgT  sÿÿÿ˜Æÿÿ˜Æÿÿþ @<`0@<`8 ôÈÿÿóÈÿÿ A TšT  oÿÿÿ”Æÿÿ”Æÿÿþ @=`0@=`8 ðÈÿÿïÈÿÿ AýTU  kÿÿÿÆÿÿÆÿÿþ @?`0@?`8 ìÈÿÿëÈÿÿ A8U@U  gÿÿÿŒÆÿÿŒÆÿÿþ @@`*@@`2 èÈÿÿçÈÿÿ ArUzU  cÿÿÿˆÆÿÿˆÆÿÿþ @A`,@A`4 äÈÿÿãÈÿÿ A«U³U  _ÿÿÿ„Æÿÿ„Æÿÿþ @B`(@B`0 àÈÿÿßÈÿÿ AéUñU  [ÿÿÿ€Æÿÿ€Æÿÿþ @C`0@C`8 ÜÈÿÿÛÈÿÿ A!V)V  Wÿÿÿ|Æÿÿ|Æÿÿþ @D`*@D`2 ØÈÿÿ×Èÿÿ AoVwV  SÿÿÿxÆÿÿxÆÿÿþ @F`$@F`, ÔÈÿÿÓÈÿÿ A§V¯V  OÿÿÿtÆÿÿtÆÿÿþ @G`(@G`0 ÐÈÿÿÏÈÿÿ AåVíV  KÿÿÿpÆÿÿpÆÿÿþ @H`0@H`8 ÌÈÿÿËÈÿÿ A)W1W  GÿÿÿlÆÿÿlÆÿÿþ @I`4@I`< ÈÈÿÿÇÈÿÿ A_WgW  CÿÿÿhÆÿÿhÆÿÿþ @J`(@J`0 ÄÈÿÿÃÈÿÿ A–WžW  ?ÿÿÿdÆÿÿdÆÿÿþ @K`&@K`. ÀÈÿÿ¿Èÿÿ AÏW×W  ;ÿÿÿ`Æÿÿ`Æÿÿþ @L`(@L`0 ŒÈÿÿ»Èÿÿ AXX  7ÿÿÿ\Æÿÿ\Æÿÿþ @M`&@M`. žÈÿÿ·Èÿÿ AFXNX  3ÿÿÿXÆÿÿXÆÿÿþ @N`2@N`: ŽÈÿÿ³Èÿÿ AƒX‹X  /ÿÿÿTÆÿÿTÆÿÿþ @O`,@O`4 °Èÿÿ¯Èÿÿ AÉXÑX  +ÿÿÿPÆÿÿPÆÿÿþ @P`8@P`@ ¬Èÿÿ«Èÿÿ AYY  'ÿÿÿLÆÿÿLÆÿÿþ @Q`&@Q`. šÈÿÿ§Èÿÿ ADYLY  #ÿÿÿHÆÿÿHÆÿÿþ @R`4@R`< €Èÿÿ£Èÿÿ AY‰Y  ÿÿÿDÆÿÿDÆÿÿþ @S`,@S`4  ÈÿÿŸÈÿÿ AµYœY  ÿÿÿ@Æÿÿ@Æÿÿþ @T`$@T`, œÈÿÿ›Èÿÿ AêYòY  ÿÿÿ<Æÿÿ<Æÿÿþ @U`$@U`, ˜Èÿÿ—Èÿÿ AZ%Z  ÿÿÿ8Æÿÿ8Æÿÿþ @V`"@V`* initiateTopUptÕÿÿ A[+[  A[[   ÿÿÿâÈÿÿâÈÿÿý @]`*@]`; ŠauthClient•sendVerificationEmailý AC_c_  AC_M_  ÿÿÿ×Èÿÿ×Èÿÿý @u`@u`= ÈÿÿŒÈÿÿ Ab`k`  ÿÿÿ'Æÿÿ'Æÿÿþ @@`  ‘getMyReferralInfocÕÿÿ Aº`Ï`  Aº`œ`  üþÿÿÑÈÿÿÑÈÿÿý @@` }Èÿÿ|Èÿÿ AÑaÙa  øþÿÿÆÿÿÆÿÿþ @‰`&@‰`. yÈÿÿxÈÿÿ Abb  ôþÿÿÆÿÿÆÿÿþ @Š`0@Š`8 uÈÿÿtÈÿÿ AFbNb  ðþÿÿÆÿÿÆÿÿþ @‹`$@‹`, wÈÿÿvÈÿÿ AZbcb  ìþÿÿÆÿÿÆÿÿþ @Œ@Œ`  ³ËÿÿNÕÿÿ Aèbøb  Aèbëb  çþÿÿŒÈÿÿŒÈÿÿý @@` nÈÿÿmÈÿÿ Axcc  ãþÿÿÆÿÿÆÿÿþ @“@“`  ŒgetSiteStatsDÕÿÿ Add  Ad d  Ýþÿÿ²Èÿÿ²Èÿÿý @–@–` dÈÿÿcÈÿÿ Aªd³d  ÙþÿÿþÅÿÿþÅÿÿþ @š@š`  `Èÿÿ_Èÿÿ A-e6e  ÕþÿÿúÅÿÿúÅÿÿþ @ @ `  ÄÅÿÿ7Õÿÿ A}eˆe  A}e€e  Ðþÿÿ¥Èÿÿ¥Èÿÿý @£` @£` $øÿÿ2Õÿÿ A£eŽe  A£eŠe  Ëþÿÿ Èÿÿ Èÿÿý @€` @€` çñÿÿ-Õÿÿ AÄeÔe  AÄeÇe  Æþÿÿ›Èÿÿ›Èÿÿý @¥` @¥` —Ëÿÿ(Õÿÿ Aäeöe  Aäeçe  Áþÿÿ–Èÿÿ–Èÿÿý @Š` @Š` getMyStatuses"Õÿÿ Af'f  Aff  »þÿÿÈÿÿÈÿÿý @§` @§` ‘getBalanceHistoryÕÿÿ AEfZf  AEfHf  µþÿÿŠÈÿÿŠÈÿÿý @š` @š`! ŽgetPlanHistoryÕÿÿ Ayf‹f  Ayf|f  ¯þÿÿ„Èÿÿ„Èÿÿý @©` @©` þ÷ÿÿÕÿÿ AÓnän  AÓnÖn  ªþÿÿÈÿÿÈÿÿý @È` @È` ^Ëÿÿ Õÿÿ Aôo p  Aôo÷o  ¥þÿÿzÈÿÿzÈÿÿý @Ð`4@Ð`L qËÿÿÕÿÿ Awq‹q  Awqzq   þÿÿuÈÿÿuÈÿÿý @Ø` @Ø`  ÅÿÿÕÿÿ AŠs±s  AŠs©s  ›þÿÿpÈÿÿpÈÿÿý @æ`"@æ`- ŠÅÿÿýÔÿÿ Arw}w  Arwuw  –þÿÿkÈÿÿkÈÿÿý @`"@`- …ÅÿÿøÔÿÿ AVyay  AVyYy  ‘þÿÿfÈÿÿfÈÿÿý @`"@`- €ÅÿÿóÔÿÿ A'~2~  A'~*~  ŒþÿÿaÈÿÿaÈÿÿý @,`@,` {ÅÿÿîÔÿÿ Ap‚{‚  Ap‚s‚  ‡þÿÿ\Èÿÿ\Èÿÿý @F`@F` vÅÿÿéÔÿÿ Aä‡ï‡  Aä‡ç‡  ‚þÿÿWÈÿÿWÈÿÿý @j`@j` qÅÿÿäÔÿÿ AíŠøŠ  AíŠðŠ  }þÿÿRÈÿÿRÈÿÿý @`@` ”createSpecialistCardÞÔÿÿ AOg  AOR  wþÿÿLÈÿÿLÈÿÿý @”`@”`7 ”deleteSpecialistCardØÔÿÿ AœŽ  AœŸ  qþÿÿFÈÿÿFÈÿÿý @§`@§`* ýÇÿÿþÇÿÿ Aّݑ  mþÿÿëÇÿÿëÇÿÿþ @Ž`@Ž`! ùÇÿÿúÇÿÿ AÚ¢Þ¢  iþÿÿçÇÿÿçÇÿÿþ @è`@è`  õÇÿÿöÇÿÿ Aµ£¹£  eþÿÿãÇÿÿãÇÿÿþ @î`$@î`( ñÇÿÿòÇÿÿ Aõ€ù€  aþÿÿßÇÿÿßÇÿÿþ @ô`@ô`# íÇÿÿîÇÿÿ AÐ¥Ô¥  ]þÿÿÛÇÿÿÛÇÿÿþ @ú`$@ú`( éÇÿÿêÇÿÿ Af§j§  Yþÿÿ×Çÿÿ×Çÿÿþ @`@`! åÇÿÿæÇÿÿ AAšEš  UþÿÿÓÇÿÿÓÇÿÿþ @`$@`( áÇÿÿâÇÿÿ A~©‚©  QþÿÿÏÇÿÿÏÇÿÿþ @ `%@ `) ÝÇÿÿÞÇÿÿ AYª]ª  MþÿÿËÇÿÿËÇÿÿþ @`$@`( ÙÇÿÿÚÇÿÿ AÚ«Þ«  IþÿÿÇÇÿÿÇÇÿÿþ @`@`# ÕÇÿÿÖÇÿÿ Aµ¬¹¬  EþÿÿÃÇÿÿÃÇÿÿþ @`$@`( ÑÇÿÿÒÇÿÿ AȮ̮  Aþÿÿ¿Çÿÿ¿Çÿÿþ @$` @$`$ ÍÇÿÿÎÇÿÿ A£¯§¯  =þÿÿ»Çÿÿ»Çÿÿþ @*`$@*`( ÉÇÿÿÊÇÿÿ Aü°±  9þÿÿ·Çÿÿ·Çÿÿþ @0`%@0`) ÅÇÿÿÆÇÿÿ A×±Û±  5þÿÿ³Çÿÿ³Çÿÿþ @6`$@6`( ÁÇÿÿÂÇÿÿ A9³=³  1þÿÿ¯Çÿÿ¯Çÿÿþ @<`@<`  œÇÿÿŸÇÿÿ AŽŽ  -þÿÿ«Çÿÿ«Çÿÿþ @B`$@B`( •Èÿÿ–Èÿÿ A­Ÿ²Ÿ  )þÿÿ§Çÿÿ§Çÿÿþ @`@` ‘Èÿÿ’Èÿÿ A¿!¿  %þÿÿ£Çÿÿ£Çÿÿþ @’`@’` ±Çÿÿ²Çÿÿ A€¿š¿  !þÿÿŸÇÿÿŸÇÿÿþ @•`"@•`& ­Çÿÿ®Çÿÿ A]Âa  þÿÿ›Çÿÿ›Çÿÿþ @`k@`o …Èÿÿ†Èÿÿ AhÃmà  þÿÿ—Çÿÿ—Çÿÿþ @£`"@£`' ¥ÇÿÿŠÇÿÿ AúÃþà  þÿÿ“Çÿÿ“Çÿÿþ @Š`*@Š`. }Èÿÿ~Èÿÿ A6Æ;Æ  þÿÿÇÿÿÇÿÿþ @ª`6@ª`; ÇÿÿžÇÿÿ AðÆôÆ   þÿÿ‹Çÿÿ‹Çÿÿþ @­`2@­`6 ™ÇÿÿšÇÿÿ AÕÇÙÇ   þÿÿ‡Çÿÿ‡Çÿÿþ @±`2@±`6 qÈÿÿrÈÿÿ AÉÉ  þÿÿƒÇÿÿƒÇÿÿþ @µ``@µ`e ‘Çÿÿ’Çÿÿ AfËjË  þÿÿÇÿÿÇÿÿþ @Ã`A@Ã`E iÈÿÿjÈÿÿ AÌ Ì  ýýÿÿ{Çÿÿ{Çÿÿþ @Å`(@Å`- eÈÿÿfÈÿÿ AÁÌÆÌ  ùýÿÿwÇÿÿwÇÿÿþ @È`&@È`+ …Çÿÿ†Çÿÿ A&Í*Í  õýÿÿsÇÿÿsÇÿÿþ @Ê`.@Ê`2 Çÿÿ‚Çÿÿ A3Î7Î  ñýÿÿoÇÿÿoÇÿÿþ @Î`.@Î`2 }Çÿÿ~Çÿÿ A³Ï·Ï  íýÿÿkÇÿÿkÇÿÿþ @Ô`&@Ô`* UÈÿÿVÈÿÿ AÒÒ  éýÿÿgÇÿÿgÇÿÿþ @à`@à` uÇÿÿvÇÿÿ A§Ò«Ò  åýÿÿcÇÿÿcÇÿÿþ @ã`5@ã`9 qÇÿÿrÇÿÿ A+Ó/Ó  áýÿÿ_Çÿÿ_Çÿÿþ @å`0@å`4 IÈÿÿJÈÿÿ AàÓåÓ  Ýýÿÿ[Çÿÿ[Çÿÿþ @ç`D@ç`I EÈÿÿFÈÿÿ A'Ö,Ö  ÙýÿÿWÇÿÿWÇÿÿþ @í`6@í`; eÇÿÿfÇÿÿ AY×]×  ÕýÿÿSÇÿÿSÇÿÿþ @ñ`[@ñ`_ =Èÿÿ>Èÿÿ AŠÙÙ  ÑýÿÿOÇÿÿOÇÿÿþ @û`"@û`' ]Çÿÿ^Çÿÿ A/Ú3Ú  ÍýÿÿKÇÿÿKÇÿÿþ @þ`=@þ`A 5Èÿÿ6Èÿÿ AÛ Û  ÉýÿÿGÇÿÿGÇÿÿþ @`H@`M 1Èÿÿ2Èÿÿ ApÝuÝ  ÅýÿÿCÇÿÿCÇÿÿþ @`:@`? QÇÿÿRÇÿÿ A²Þ¶Þ  Áýÿÿ?Çÿÿ?Çÿÿþ @ `_@ `c )Èÿÿ*Èÿÿ A áá  œýÿÿ;Çÿÿ;Çÿÿþ @`C@`H IÇÿÿJÇÿÿ A»á¿á  ¹ýÿÿ7Çÿÿ7Çÿÿþ @`;@`? !Èÿÿ"Èÿÿ AÜâáâ  µýÿÿ3Çÿÿ3Çÿÿþ @`O@`T AÇÿÿBÇÿÿ AÂãÆã  ±ýÿÿ/Çÿÿ/Çÿÿþ @`:@`> =Çÿÿ>Çÿÿ A(å,å  ­ýÿÿ+Çÿÿ+Çÿÿþ @!`:@!`> 9Çÿÿ:Çÿÿ A‘æ•æ  ©ýÿÿ'Çÿÿ'Çÿÿþ @%`:@%`> 5Çÿÿ6Çÿÿ Avçzç  ¥ýÿÿ#Çÿÿ#Çÿÿþ @'`c@'`g  ÈÿÿÈÿÿ A»èÀè  ¡ýÿÿÇÿÿÇÿÿþ @-`2@-`7  Èÿÿ Èÿÿ Aé•é  ýÿÿÇÿÿÇÿÿþ @0`:@0`? ÈÿÿÈÿÿ A%ì*ì  ™ýÿÿÇÿÿÇÿÿþ @:`:@:`? ÈÿÿÈÿÿ A®ð³ð  •ýÿÿÇÿÿÇÿÿþ @K`E@K`J !Çÿÿ"Çÿÿ A›ñŸñ  ‘ýÿÿÇÿÿÇÿÿþ @N`:@N`> ÇÿÿÇÿÿ AÈòÌò  ýÿÿ Çÿÿ Çÿÿþ @R`:@R`> õÇÿÿöÇÿÿ AEöJö  ‰ýÿÿÇÿÿÇÿÿþ @]`:@]`? ÇÿÿÇÿÿ A÷÷  …ýÿÿÇÿÿÇÿÿþ @``B@``F ÇÿÿÇÿÿ AÊùÎù  ýÿÿÿÆÿÿÿÆÿÿþ @g`B@g`F  ÇÿÿÇÿÿ Apýtý  }ýÿÿûÆÿÿûÆÿÿþ @t`B@t`F åÇÿÿæÇÿÿ A¯þŽþ  yýÿÿ÷Æÿÿ÷Æÿÿþ @x`m@x`r ÇÿÿÇÿÿ AŠÿªÿ  uýÿÿóÆÿÿóÆÿÿþ @{`:@{`> ÝÇÿÿÞÇÿÿ AÈÍ  qýÿÿïÆÿÿïÆÿÿþ @`:@`? ýÆÿÿþÆÿÿ Aä è   mýÿÿëÆÿÿëÆÿÿþ @ž`=@ž`A ÕÇÿÿÖÇÿÿ AÀÅ  iýÿÿçÆÿÿçÆÿÿþ @¯`B@¯`G ÑÇÿÿÒÇÿÿ Aej  eýÿÿãÆÿÿãÆÿÿþ @²`2@²`7 ÍÇÿÿÎÇÿÿ AQV  aýÿÿ߯ÿÿ߯ÿÿþ @µ`:@µ`? íÆÿÿîÆÿÿ AÞâ  ]ýÿÿÛÆÿÿÛÆÿÿþ @·`B@·`F éÆÿÿêÆÿÿ A&*  Yýÿÿׯÿÿׯÿÿþ @»`B@»`F ÁÇÿÿÂÇÿÿ A¿Ä  UýÿÿÓÆÿÿÓÆÿÿþ @Á`:@Á`? áÆÿÿâÆÿÿ ALP  QýÿÿÏÆÿÿÏÆÿÿþ @Ã`B@Ã`F ¹ÇÿÿºÇÿÿ A©®  MýÿÿËÆÿÿËÆÿÿþ @Ç`B@Ç`G ÙÆÿÿÚÆÿÿ A®²  IýÿÿÇÆÿÿÇÆÿÿþ @Ê`J@Ê`N ÕÆÿÿÖÆÿÿ A  EýÿÿÃÆÿÿÃÆÿÿþ @Î`J@Î`N ­Çÿÿ®Çÿÿ AÐÕ  Aýÿÿ¿Æÿÿ¿Æÿÿþ @Ù`:@Ù`? ÍÆÿÿÎÆÿÿ AœÁ  =ýÿÿ»Æÿÿ»Æÿÿþ @Ü`B@Ü`F ¥ÇÿÿŠÇÿÿ Ad!i!  9ýÿÿ·Æÿÿ·Æÿÿþ @ã`O@ã`T ¡Çÿÿ¢Çÿÿ An#s#  5ýÿÿ³Æÿÿ³Æÿÿþ @ê`V@ê`[†ûÿÿòÇÿÿ At#}# 42ýÿÿ°Æÿÿ°Æÿÿþ @ê`\@ê`e šÇÿÿ›Çÿÿ A$$  .ýÿÿ¬Æÿÿ¬Æÿÿþ @ì`J@ì`O ºÆÿÿ»Æÿÿ AÎ'Ò'  *ýÿÿšÆÿÿšÆÿÿþ @õ`R@õ`V ¶Æÿÿ·Æÿÿ A **  &ýÿÿ€Æÿÿ€Æÿÿþ @û``@û`d ŽÇÿÿÇÿÿ A‹--  "ýÿÿ Æÿÿ Æÿÿþ @ `J@ `O ®Æÿÿ¯Æÿÿ At0x0  ýÿÿœÆÿÿœÆÿÿþ @ `R@ `V ªÆÿÿ«Æÿÿ A°2Ž2  ýÿÿ˜Æÿÿ˜Æÿÿþ @ ``@ `d ŠÆÿÿ§Æÿÿ AS6W6  ýÿÿ”Æÿÿ”Æÿÿþ @ `G@ `K ~ÇÿÿÇÿÿ A©7®7  ýÿÿÆÿÿÆÿÿþ @# `2@# `7 zÇÿÿ{Çÿÿ A‹88  ýÿÿŒÆÿÿŒÆÿÿþ @& `:@& `? šÆÿÿ›Æÿÿ A}99   ýÿÿˆÆÿÿˆÆÿÿþ @) `B@) `F –Æÿÿ—Æÿÿ AÞ:â:  ýÿÿ„Æÿÿ„Æÿÿþ @- `X@- `\ ’Æÿÿ“Æÿÿ A<ƒ<  ýÿÿ€Æÿÿ€Æÿÿþ @3 `:@3 `> jÇÿÿkÇÿÿ A7I RÇÿÿSÇÿÿ A#X(X  æüÿÿdÆÿÿdÆÿÿþ @Š `:@Š `? rÆÿÿsÆÿÿ AYY  âüÿÿ`Æÿÿ`Æÿÿþ @ `B@ `F nÆÿÿoÆÿÿ AqZuZ  Þüÿÿ\Æÿÿ\Æÿÿþ @‘ `B@‘ `F FÇÿÿGÇÿÿ Aò_÷_  ÚüÿÿXÆÿÿXÆÿÿþ @¡ `Q@¡ `V fÆÿÿgÆÿÿ ADcHc  ÖüÿÿTÆÿÿTÆÿÿþ @š `R@š `V >Çÿÿ?Çÿÿ A(f-f  ÒüÿÿPÆÿÿPÆÿÿþ @Ž `2@Ž `7 ^Æÿÿ_Æÿÿ A gg  ÎüÿÿLÆÿÿLÆÿÿþ @· `:@· `> 6Çÿÿ7Çÿÿ AÅgÊg  ÊüÿÿHÆÿÿHÆÿÿþ @¹ `H@¹ `M VÆÿÿWÆÿÿ AZh^h  ÆüÿÿDÆÿÿDÆÿÿþ @» `F@» `J RÆÿÿSÆÿÿ AÅiÉi  Âüÿÿ@Æÿÿ@Æÿÿþ @¿ `F@¿ `J NÆÿÿOÆÿÿ AÍkÑk  Ÿüÿÿ<Æÿÿ<Æÿÿþ @Æ `N@Æ `R JÆÿÿKÆÿÿ A(m,m  ºüÿÿ8Æÿÿ8Æÿÿþ @É `h@É `l "Çÿÿ#Çÿÿ A4„9„  ¶üÿÿ4Æÿÿ4Æÿÿþ @ `E@ `JûÿÿsÇÿÿ A:„C„ 4³üÿÿ1Æÿÿ1Æÿÿþ @ `K@ `T ?Æÿÿ@Æÿÿ Ä́ф  ¯üÿÿ-Æÿÿ-Æÿÿþ @ `F@ `J ÇÿÿÇÿÿ AŒŒ  «üÿÿ)Æÿÿ)Æÿÿþ @( `X@( `] 7Æÿÿ8Æÿÿ AJN  §üÿÿ%Æÿÿ%Æÿÿþ @+ `V@+ `Z 3Æÿÿ4Æÿÿ A܎àŽ  £üÿÿ!Æÿÿ!Æÿÿþ @/ `V@/ `Z /Æÿÿ0Æÿÿ A%‘)‘  ŸüÿÿÆÿÿÆÿÿþ @6 `F@6 `J ÇÿÿÇÿÿ A’’  ›üÿÿÆÿÿÆÿÿþ @8 `g@8 `l 'Æÿÿ(Æÿÿ A9“=“  —üÿÿÆÿÿÆÿÿþ @; `V@; `Z #Æÿÿ$Æÿÿ Ay–}–  “üÿÿÆÿÿÆÿÿþ @E `F@E `J ûÆÿÿüÆÿÿ A5—:—  üÿÿ Æÿÿ Æÿÿþ @G `T@G `Y ÷ÆÿÿøÆÿÿ AZš_š  ‹üÿÿ Æÿÿ Æÿÿþ @P `]@P `b ÆÿÿÆÿÿ A›!›  ‡üÿÿÆÿÿÆÿÿþ @R `^@R `b ÆÿÿÆÿÿ Ažž  ƒüÿÿÆÿÿÆÿÿþ @Z `^@Z `b ÆÿÿÆÿÿ Aæ¢ê¢  üÿÿýÅÿÿýÅÿÿþ @g `]@g `a  Æÿÿ Æÿÿ AÜŠàŠ  {üÿÿùÅÿÿùÅÿÿþ @r `]@r `a ÆÿÿÆÿÿ Aªª  wüÿÿõÅÿÿõÅÿÿþ @{ `i@{ `m ÆÿÿÆÿÿ Aª«®«  süÿÿñÅÿÿñÅÿÿþ @ `i@ `m ÿÅÿÿÆÿÿ Aë¯ï¯  oüÿÿíÅÿÿíÅÿÿþ @Š `]@Š `a ûÅÿÿüÅÿÿ A ³³  küÿÿéÅÿÿéÅÿÿþ @“ `R@“ `V ÷ÅÿÿøÅÿÿ A·”·  güÿÿåÅÿÿåÅÿÿþ @¥ `E@¥ `I óÅÿÿôÅÿÿ A#ž'ž  cüÿÿáÅÿÿáÅÿÿþ @§ `M@§ `Q ËÆÿÿÌÆÿÿ A¹¹  _üÿÿÝÅÿÿÝÅÿÿþ @ª `L@ª `Q ëÅÿÿìÅÿÿ Aعܹ  [üÿÿÙÅÿÿÙÅÿÿþ @­ `6@­ `: çÅÿÿèÅÿÿ AȺ̺  WüÿÿÕÅÿÿÕÅÿÿþ @± `6@± `: ãÅÿÿäÅÿÿ AŌɌ  SüÿÿÑÅÿÿÑÅÿÿþ @¹ `9@¹ `= »ÆÿÿŒÆÿÿ Axœ}œ  OüÿÿÍÅÿÿÍÅÿÿþ @» `@@» `E ÛÅÿÿÜÅÿÿ ANŸRŸ  KüÿÿÉÅÿÿÉÅÿÿþ @Ÿ `>@Ÿ `B ×ÅÿÿØÅÿÿ A«¿¯¿  GüÿÿÅÅÿÿÅÅÿÿþ CÀ À ‘ ¯Æÿÿ°Æÿÿ AŽÂ¹Â  CüÿÿÁÅÿÿÁÅÿÿþ @Æ `>@Æ `C «Æÿÿ¬Æÿÿ A’×à  ?üÿÿœÅÿÿœÅÿÿþ @É `F@É `K ËÅÿÿÌÅÿÿ AžÄ¢Ä  ;üÿÿ¹Åÿÿ¹Åÿÿþ @Ì `N@Ì `R £Æÿÿ€Æÿÿ AŠÆÆ  7üÿÿµÅÿÿµÅÿÿþ @Ð `N@Ð `S ÃÅÿÿÄÅÿÿ ApÉtÉ  3üÿÿ±Åÿÿ±Åÿÿþ @Ù `X@Ù `\ ¿ÅÿÿÀÅÿÿ A³Ê·Ê  /üÿÿ­Åÿÿ­Åÿÿþ @Ý `F@Ý `J —Æÿÿ˜Æÿÿ ARÍWÍ  +üÿÿ©Åÿÿ©Åÿÿþ @è `E@è `J “Æÿÿ”Æÿÿ A÷ÍüÍ  'üÿÿ¥Åÿÿ¥Åÿÿþ @ë `2@ë `7 ÆÿÿÆÿÿ AÙÎÞÎ  #üÿÿ¡Åÿÿ¡Åÿÿþ @î `:@î `? ¯Åÿÿ°Åÿÿ AËÏÏÏ  üÿÿÅÿÿÅÿÿþ @ñ `B@ñ `F ‡ÆÿÿˆÆÿÿ A ÑÑ  üÿÿ™Åÿÿ™Åÿÿþ @õ `B@õ `G §ÅÿÿšÅÿÿ AôÓøÓ  üÿÿ•Åÿÿ•Åÿÿþ @ý `J@ý `N £Åÿÿ€Åÿÿ AüÕÖ  üÿÿ‘Åÿÿ‘Åÿÿþ @ `X@ `\ {Æÿÿ|Æÿÿ AÙÙ  üÿÿÅÿÿÅÿÿþ @ `:@ `? ›ÅÿÿœÅÿÿ AÚÚ   üÿÿ‰Åÿÿ‰Åÿÿþ @ `B@ `F —Åÿÿ˜Åÿÿ A ÜÜ  üÿÿ…Åÿÿ…Åÿÿþ @ `P@ `T oÆÿÿpÆÿÿ AeÞjÞ  üÿÿÅÿÿÅÿÿþ @ `B@ `G kÆÿÿlÆÿÿ AJáOá  ÿûÿÿ}Åÿÿ}Åÿÿþ @& `:@& `? gÆÿÿhÆÿÿ Aââ  ûûÿÿyÅÿÿyÅÿÿþ @) `B@) `G ‡ÅÿÿˆÅÿÿ A$ã(ã  ÷ûÿÿuÅÿÿuÅÿÿþ @, `J@, `N ƒÅÿÿ„Åÿÿ A©ä­ä  óûÿÿqÅÿÿqÅÿÿþ @0 `J@0 `N Åÿÿ€Åÿÿ A®æ²æ  ïûÿÿmÅÿÿmÅÿÿþ @6 ``@6 `d {Åÿÿ|Åÿÿ Aè#è  ëûÿÿiÅÿÿiÅÿÿþ @9 `G@9 `K SÆÿÿTÆÿÿ Aiìnì  çûÿÿeÅÿÿeÅÿÿþ @@ `Q@@ `V OÆÿÿPÆÿÿ Aí•í  ãûÿÿaÅÿÿaÅÿÿþ @C `R@C `W KÆÿÿLÆÿÿ AÊîÏî  ßûÿÿ]Åÿÿ]Åÿÿþ @F `Z@F `_ kÅÿÿlÅÿÿ Aýïð  ÛûÿÿYÅÿÿYÅÿÿþ @I `b@I `f gÅÿÿhÅÿÿ AÊñÎñ  ×ûÿÿUÅÿÿUÅÿÿþ @M `b@M `f ?Æÿÿ@Æÿÿ ACôHô  ÓûÿÿQÅÿÿQÅÿÿþ @S `Z@S `_ ;Æÿÿ<Æÿÿ Aføkø  ÏûÿÿMÅÿÿMÅÿÿþ @^ `R@^ `W 7Æÿÿ8Æÿÿ Ašý­ý  ËûÿÿIÅÿÿIÅÿÿþ @p `2@p `7 WÅÿÿXÅÿÿ AŠþŽþ  ÇûÿÿEÅÿÿEÅÿÿþ @s `:@s `> SÅÿÿTÅÿÿ Aåÿéÿ  ÃûÿÿAÅÿÿAÅÿÿþ @w `U@w `Y OÅÿÿPÅÿÿ AFJ  ¿ûÿÿ=Åÿÿ=Åÿÿþ @z `?@z `C KÅÿÿLÅÿÿ AU Y   »ûÿÿ9Åÿÿ9Åÿÿþ @‘ `I@‘ `M #Æÿÿ$Æÿÿ A% *   ·ûÿÿ5Åÿÿ5Åÿÿþ @“ `P@“ `U Æÿÿ Æÿÿ A; @   ³ûÿÿ1Åÿÿ1Åÿÿþ @– `N@– `S ÆÿÿÆÿÿ AJO  ¯ûÿÿ-Åÿÿ-Åÿÿþ @™ `V@™ `[ ;Åÿÿ<Åÿÿ A‹  «ûÿÿ)Åÿÿ)Åÿÿþ @œ `^@œ `b ÆÿÿÆÿÿ A†‹  §ûÿÿ%Åÿÿ%Åÿÿþ C  ¥  ª 3Åÿÿ4Åÿÿ AÔØ  £ûÿÿ!Åÿÿ!Åÿÿþ @© `V@© `Z  Æÿÿ Æÿÿ A—œ  ŸûÿÿÅÿÿÅÿÿþ @­ `i@­ `n ÆÿÿÆÿÿ Aøý  ›ûÿÿÅÿÿÅÿÿþ Cµ ޵ “ 'Åÿÿ(Åÿÿ AW[  —ûÿÿÅÿÿÅÿÿþ @Ÿ `d@Ÿ `h #Åÿÿ$Åÿÿ A`d  “ûÿÿÅÿÿÅÿÿþ @Ä `N@Ä `R Åÿÿ Åÿÿ A^"b"  ûÿÿ Åÿÿ Åÿÿþ @Ï `D@Ï `H ÷ÅÿÿøÅÿÿ AD#I#  ‹ûÿÿ Åÿÿ Åÿÿþ @Ñ `@@Ñ `E óÅÿÿôÅÿÿ A7$<$  ‡ûÿÿÅÿÿÅÿÿþ @Ô `>@Ô `C ÅÿÿÅÿÿ A5%9%  ƒûÿÿÅÿÿÅÿÿþ @× `F@× `J ÅÿÿÅÿÿ A™&&  ûÿÿýÄÿÿýÄÿÿþ @Û `F@Û `J  Åÿÿ Åÿÿ AÍ'Ñ'  {ûÿÿùÄÿÿùÄÿÿþ @Þ `T@Þ `X ÅÿÿÅÿÿ AÕ)Ù)  wûÿÿõÄÿÿõÄÿÿþ @ä `X@ä `\ ÅÿÿÅÿÿ A`,d,  sûÿÿñÄÿÿñÄÿÿþ @í `>@í `B ÿÄÿÿÅÿÿ A™--  oûÿÿíÄÿÿíÄÿÿþ @ñ `>@ñ `B ×ÅÿÿØÅÿÿ A€/…/  kûÿÿéÄÿÿéÄÿÿþ @ø `M@ø `R ÓÅÿÿÔÅÿÿ AŸ2Ã2  gûÿÿåÄÿÿåÄÿÿþ @ `>@ `C óÄÿÿôÄÿÿ Aš3ž3  cûÿÿáÄÿÿáÄÿÿþ @ `F@ `J ËÅÿÿÌÅÿÿ A 55  _ûÿÿÝÄÿÿÝÄÿÿþ @ `F@ `K ëÄÿÿìÄÿÿ A66  [ûÿÿÙÄÿÿÙÄÿÿþ @ `N@ `R çÄÿÿèÄÿÿ A‡7‹7  WûÿÿÕÄÿÿÕÄÿÿþ @ `N@ `R ãÄÿÿäÄÿÿ AÝ;á;  SûÿÿÑÄÿÿÑÄÿÿþ @ `L@ `P ßÄÿÿàÄÿÿ A==  OûÿÿÍÄÿÿÍÄÿÿþ @ `>@ `B ·ÅÿÿžÅÿÿ A1?6?  KûÿÿÉÄÿÿÉÄÿÿþ @$ `[@$ ``œùÿÿÆÿÿ A7?@? 4HûÿÿÆÄÿÿÆÄÿÿþ @$ `a@$ `j °Åÿÿ±Åÿÿ AÒ?×?  DûÿÿÂÄÿÿÂÄÿÿþ @& `J@& `O ÐÄÿÿÑÄÿÿ A†AŠA  @ûÿÿŸÄÿÿŸÄÿÿþ @+ `R@+ `V ÌÄÿÿÍÄÿÿ A@DDD  <ûÿÿºÄÿÿºÄÿÿþ @3 `R@3 `V €Åÿÿ¥Åÿÿ AHH  8ûÿÿ¶Äÿÿ¶Äÿÿþ @A `2@A `7 ÄÄÿÿÅÄÿÿ AõHùH  4ûÿÿ²Äÿÿ²Äÿÿþ @D `:@D `> œÅÿÿÅÿÿ AWJ\J  0ûÿÿ®Äÿÿ®Äÿÿþ @H `t@H `y ŒÄÿÿœÄÿÿ AlKpK  ,ûÿÿªÄÿÿªÄÿÿþ @K `B@K `F žÄÿÿ¹Äÿÿ AdMhM  (ûÿÿŠÄÿÿŠÄÿÿþ @Q `P@Q `T Åÿÿ‘Åÿÿ AiOnO  $ûÿÿ¢Äÿÿ¢Äÿÿþ @W `B@W `G °Äÿÿ±Äÿÿ A[P_P   ûÿÿžÄÿÿžÄÿÿþ @Z `J@Z `N ¬Äÿÿ­Äÿÿ AÍQÑQ  ûÿÿšÄÿÿšÄÿÿþ @^ `c@^ `g „Åÿÿ…Åÿÿ A.S3S  ûÿÿ–Äÿÿ–Äÿÿþ @b `J@b `O €ÅÿÿÅÿÿ AYT^T  ûÿÿ’Äÿÿ’Äÿÿþ @e `R@e `W |Åÿÿ}Åÿÿ A@À `B \Äÿÿ]Äÿÿ AÛußu  ÌúÿÿJÄÿÿJÄÿÿþ @Æ `L@Æ `P 4Åÿÿ5Åÿÿ Aíxòx  ÈúÿÿFÄÿÿFÄÿÿþ CÒ ‘Ò – TÄÿÿUÄÿÿ AÔyØy  ÄúÿÿBÄÿÿBÄÿÿþ @Ö `;@Ö `? ,Åÿÿ-Åÿÿ Aázæz  Àúÿÿ>Äÿÿ>Äÿÿþ @Ú `;@Ú `@ (Åÿÿ)Åÿÿ A¢|§|  Œúÿÿ:Äÿÿ:Äÿÿþ @á `S@á `X HÄÿÿIÄÿÿ AŽ}’}  žúÿÿ6Äÿÿ6Äÿÿþ @ä `:@ä `>  Åÿÿ!Åÿÿ AÁ~Æ~  Žúÿÿ2Äÿÿ2Äÿÿþ @è `I@è `N ÅÿÿÅÿÿ AŸ€€€  °úÿÿ.Äÿÿ.Äÿÿþ @ï `:@ï `? ÅÿÿÅÿÿ A‘–  ¬úÿÿ*Äÿÿ*Äÿÿþ @ò `B@ò `G 8Äÿÿ9Äÿÿ A{‚‚  šúÿÿ&Äÿÿ&Äÿÿþ @õ `J@õ `N 4Äÿÿ5Äÿÿ Aäƒèƒ  €úÿÿ"Äÿÿ"Äÿÿþ @ù `J@ù `N 0Äÿÿ1Äÿÿ A¹…œ…   úÿÿÄÿÿÄÿÿþ @ÿ `B@ÿ `F ÁÿÿÑÿÿ A7ˆBˆ  A7ˆ:ˆ  ›úÿÿpÄÿÿpÄÿÿý @ `F@ `Q 'Äÿÿ(Äÿÿ A“Ž—Ž  —úÿÿÄÿÿÄÿÿþ @ `P@ `T ÿÄÿÿÅÿÿ A›   “úÿÿÄÿÿÄÿÿþ @ `P@ `U ûÄÿÿüÄÿÿ A9’>’  úÿÿ Äÿÿ Äÿÿþ @! `B@! `G ÄÿÿÄÿÿ A#“'“  ‹úÿÿ Äÿÿ Äÿÿþ @$ `J@$ `N ÄÿÿÄÿÿ A–”š”  ‡úÿÿÄÿÿÄÿÿþ @( `J@( `N ïÄÿÿðÄÿÿ Až–£–  ƒúÿÿÄÿÿÄÿÿþ C, ß, ä ÄÿÿÄÿÿ AP™T™  úÿÿýÃÿÿýÃÿÿþ @5 `B@5 `F nÁÿÿáÐÿÿ Aeœpœ  Aeœhœ  zúÿÿOÄÿÿOÄÿÿý @= `F@= `Q ÄÿÿÄÿÿ AŢɢ  vúÿÿôÃÿÿôÃÿÿþ @N `P@N `T ÞÄÿÿßÄÿÿ A¥"¥  rúÿÿðÃÿÿðÃÿÿþ @V `N@V `S þÃÿÿÿÃÿÿ A Š Š  núÿÿìÃÿÿìÃÿÿþ @Y `:@Y `> úÃÿÿûÃÿÿ A0§4§  júÿÿèÃÿÿèÃÿÿþ @] `:@] `> öÃÿÿ÷Ãÿÿ Aašeš  fúÿÿäÃÿÿäÃÿÿþ @a `L@a `P ÎÄÿÿÏÄÿÿ A_©d©  búÿÿàÃÿÿàÃÿÿþ @d `N@d `S³øÿÿÅÿÿ Ae©n© 4_úÿÿÝÃÿÿÝÃÿÿþ @d `T@d `] ÇÄÿÿÈÄÿÿ Að©õ©  [úÿÿÙÃÿÿÙÃÿÿþ @f `B@f `G çÃÿÿèÃÿÿ Aª‘ª  WúÿÿÕÃÿÿÕÃÿÿþ @h `J@h `N ¿ÄÿÿÀÄÿÿ A¬ ¬  SúÿÿÑÃÿÿÑÃÿÿþ @l `J@l `O ßÃÿÿàÃÿÿ A­­  OúÿÿÍÃÿÿÍÃÿÿþ @o `R@o `V ÛÃÿÿÜÃÿÿ A¯“¯  KúÿÿÉÃÿÿÉÃÿÿþ @t `R@t `V ³ÄÿÿŽÄÿÿ A µµ  GúÿÿÅÃÿÿÅÃÿÿþ @‚ `B@‚ `G ÓÃÿÿÔÃÿÿ A#¶'¶  CúÿÿÁÃÿÿÁÃÿÿþ @… `J@… `N ÏÃÿÿÐÃÿÿ Aƒ·‡·  ?úÿÿœÃÿÿœÃÿÿþ @‰ `J@‰ `N ËÃÿÿÌÃÿÿ Aƒ¹‡¹  ;úÿÿ¹Ãÿÿ¹Ãÿÿþ @ `?@ `C ÇÃÿÿÈÃÿÿ A»»  7úÿÿµÃÿÿµÃÿÿþ @– `S@– `W —getAutoResponseSettings˜Ðÿÿ A‹ŒŠŒ  A‹ŒŽŒ  1úÿÿÄÿÿÄÿÿý @œ `,@œ `G šupdateAutoResponseSettings’Ðÿÿ Aœ¿º¿  Aœ¿Ÿ¿  +úÿÿÄÿÿÄÿÿý @š `F@š `d “Äÿÿ”Äÿÿ AeÂj  'úÿÿ¥Ãÿÿ¥Ãÿÿþ @³ `J@³ `OxøÿÿäÄÿÿ AkÂt 4$úÿÿ¢Ãÿÿ¢Ãÿÿþ @³ `P@³ `Y ŒÄÿÿÄÿÿ AæÂë   úÿÿžÃÿÿžÃÿÿþ @µ `:@µ `? ¬Ãÿÿ­Ãÿÿ AàÃäà  úÿÿšÃÿÿšÃÿÿþ @ž `B@ž `F „Äÿÿ…Äÿÿ A#Å(Å  úÿÿ–Ãÿÿ–Ãÿÿþ @Œ `B@Œ `G €ÄÿÿÄÿÿ AÆ#Æ  úÿÿ’Ãÿÿ’Ãÿÿþ @¿ `J@¿ `O  Ãÿÿ¡Ãÿÿ A]ÇaÇ  úÿÿŽÃÿÿŽÃÿÿþ C Â ‘ œÃÿÿÃÿÿ AÉ É   úÿÿŠÃÿÿŠÃÿÿþ @Æ `W@Æ `[ ˜Ãÿÿ™Ãÿÿ AñÊõÊ  úÿÿ†Ãÿÿ†Ãÿÿþ @Ê `e@Ê `i ”Ãÿÿ•Ãÿÿ AÌÌ  úÿÿ‚Ãÿÿ‚Ãÿÿþ @Ì ``@Ì `d lÄÿÿmÄÿÿ AÎÎ  úÿÿ~Ãÿÿ~Ãÿÿþ @Ò `J@Ò `O ŒÃÿÿÃÿÿ A¿ÎÃÎ  üùÿÿzÃÿÿzÃÿÿþ @Ô `R@Ô `V ˆÃÿÿ‰Ãÿÿ AÓÓ  øùÿÿvÃÿÿvÃÿÿþ @Þ `R@Þ `V „Ãÿÿ…Ãÿÿ AšÔžÔ  ôùÿÿrÃÿÿrÃÿÿþ @â `R@â `V €ÃÿÿÃÿÿ A%×)×  ðùÿÿnÃÿÿnÃÿÿþ @é `R@é `V XÄÿÿYÄÿÿ AöØûØ  ìùÿÿjÃÿÿjÃÿÿþ Cë /ë 4 xÃÿÿyÃÿÿ ANÚRÚ  èùÿÿfÃÿÿfÃÿÿþ @î `^@î `b tÃÿÿuÃÿÿ AÜÜ  äùÿÿbÃÿÿbÃÿÿþ @ò `^@ò `b ŒtoggleStatusEÐÿÿ AOß_ß  AOßRß  Þùÿÿ³Ãÿÿ³Ãÿÿý @ù `n@ù `~ jÃÿÿkÃÿÿ Ažä¢ä  ÚùÿÿXÃÿÿXÃÿÿþ @`l@`p fÃÿÿgÃÿÿ A çç  ÖùÿÿTÃÿÿTÃÿÿþ @`[@`_ >Äÿÿ?Äÿÿ AKéPé  ÒùÿÿPÃÿÿPÃÿÿþ C $ ) ^Ãÿÿ_Ãÿÿ A£ê§ê  ÎùÿÿLÃÿÿLÃÿÿþ @`^@`b ZÃÿÿ[Ãÿÿ Aiìmì  ÊùÿÿHÃÿÿHÃÿÿþ @`^@`b æ,Ðÿÿ A—ï§ï  A—ïšï  ÅùÿÿšÃÿÿšÃÿÿý @`n@`~ QÃÿÿRÃÿÿ AÜôàô  Áùÿÿ?Ãÿÿ?Ãÿÿþ @#`l@#`p MÃÿÿNÃÿÿ AH÷L÷  œùÿÿ;Ãÿÿ;Ãÿÿþ @(`[@(`_ IÃÿÿJÃÿÿ AŸøÂø  ¹ùÿÿ7Ãÿÿ7Ãÿÿþ @+`[@+`_ !Äÿÿ"Äÿÿ Aü ü  µùÿÿ3Ãÿÿ3Ãÿÿþ @6`:@6`? AÃÿÿBÃÿÿ Aþüý  ±ùÿÿ/Ãÿÿ/Ãÿÿþ @9`B@9`F =Ãÿÿ>Ãÿÿ Aiþmþ  ­ùÿÿ+Ãÿÿ+Ãÿÿþ @=`B@=`F 9Ãÿÿ:Ãÿÿ AÊÎ  ©ùÿÿ'Ãÿÿ'Ãÿÿþ @D`g@D`k 5Ãÿÿ6Ãÿÿ AŽž  ¥ùÿÿ#Ãÿÿ#Ãÿÿþ @F`T@F`X  ÄÿÿÄÿÿ APU  ¡ùÿÿÃÿÿÃÿÿþ @K`B@K`G -Ãÿÿ.Ãÿÿ AMQ  ùÿÿÃÿÿÃÿÿþ @N`J@N`N )Ãÿÿ*Ãÿÿ A    ™ùÿÿÃÿÿÃÿÿþ @X`q@X`u %Ãÿÿ&Ãÿÿ A    •ùÿÿÃÿÿÃÿÿþ @_`J@_`N !Ãÿÿ"Ãÿÿ AÐÔ  ‘ùÿÿÃÿÿÃÿÿþ @h`B@h`F ùÃÿÿúÃÿÿ A¬±  ùÿÿ Ãÿÿ Ãÿÿþ @n`:@n`? ÃÿÿÃÿÿ A°Ž  ‰ùÿÿÃÿÿÃÿÿþ @q`B@q`F ñÃÿÿòÃÿÿ Aóø  …ùÿÿÃÿÿÃÿÿþ @u`B@u`G íÃÿÿîÃÿÿ Aíò  ùÿÿÿÂÿÿÿÂÿÿþ @x`J@x`O  ÃÿÿÃÿÿ Ašž  }ùÿÿûÂÿÿûÂÿÿþ @z`R@z`V  Ãÿÿ Ãÿÿ A26  yùÿÿ÷Âÿÿ÷Âÿÿþ @~`R@~`V áÃÿÿâÃÿÿ APU  uùÿÿóÂÿÿóÂÿÿþ @‰`J@‰`O ÃÿÿÃÿÿ Aý  qùÿÿïÂÿÿïÂÿÿþ @‹`R@‹`V ýÂÿÿþÂÿÿ A”˜  mùÿÿëÂÿÿëÂÿÿþ @`R@`V ÕÃÿÿÖÃÿÿ A""  iùÿÿçÂÿÿçÂÿÿþ @œ`B@œ`G õÂÿÿöÂÿÿ A¶"º"  eùÿÿãÂÿÿãÂÿÿþ @ž`J@ž`N ñÂÿÿòÂÿÿ A$!$  aùÿÿßÂÿÿßÂÿÿþ @¢`J@¢`N ÉÃÿÿÊÃÿÿ A:&?&  ]ùÿÿÛÂÿÿÛÂÿÿþ @§`J@§`O ÅÃÿÿÆÃÿÿ A¡'Š'  Yùÿÿ×Âÿÿ×Âÿÿþ Cª•ªš åÂÿÿæÂÿÿ Aä(è(  UùÿÿÓÂÿÿÓÂÿÿþ @­`Z@­`^ œÃÿÿŸÃÿÿ AÜ*á*  QùÿÿÏÂÿÿÏÂÿÿþ @²`W@²`\ ÝÂÿÿÞÂÿÿ A,#,  MùÿÿËÂÿÿËÂÿÿþ @µ`Z@µ`^ ÙÂÿÿÚÂÿÿ A£.§.  IùÿÿÇÂÿÿÇÂÿÿþ C»—»› ±Ãÿÿ²Ãÿÿ Aå2ê2  EùÿÿÃÂÿÿÃÂÿÿþ @Æ`B@Æ`G ÑÂÿÿÒÂÿÿ A‚3†3  Aùÿÿ¿Âÿÿ¿Âÿÿþ @È`J@È`N ÍÂÿÿÎÂÿÿ Aô4ø4  =ùÿÿ»Âÿÿ»Âÿÿþ @Ì`J@Ì`N ¥ÃÿÿŠÃÿÿ A9!9  9ùÿÿ·Âÿÿ·Âÿÿþ @Ø`B@Ø`G ÅÂÿÿÆÂÿÿ A¹9œ9  5ùÿÿ³Âÿÿ³Âÿÿþ @Ú`J@Ú`N ÁÂÿÿÂÂÿÿ A);-;  1ùÿÿ¯Âÿÿ¯Âÿÿþ @Þ`J@Þ`N ™ÃÿÿšÃÿÿ A§?¬?  -ùÿÿ«Âÿÿ«Âÿÿþ @ë`B@ë`G ¹ÂÿÿºÂÿÿ AD@H@  )ùÿÿ§Âÿÿ§Âÿÿþ @í`J@í`N µÂÿÿ¶Âÿÿ A¹AœA  %ùÿÿ£Âÿÿ£Âÿÿþ @ñ`J@ñ`N ÃÿÿŽÃÿÿ AC"C  !ùÿÿŸÂÿÿŸÂÿÿþ @õ`J@õ`O ­Âÿÿ®Âÿÿ A;F?F  ùÿÿ›Âÿÿ›Âÿÿþ @ý`R@ý`V ©ÂÿÿªÂÿÿ A˜GœG  ùÿÿ—Âÿÿ—Âÿÿþ @`R@`V ¥ÂÿÿŠÂÿÿ AôHøH  ùÿÿ“Âÿÿ“Âÿÿþ @`R@`V ¡Âÿÿ¢Âÿÿ APJTJ  ùÿÿÂÿÿÂÿÿþ @ `R@ `V yÃÿÿzÃÿÿ A‘L–L   ùÿÿ‹Âÿÿ‹Âÿÿþ @`B@`G ™ÂÿÿšÂÿÿ A.M2M   ùÿÿ‡Âÿÿ‡Âÿÿþ @`J@`N •Âÿÿ–Âÿÿ A€NšN  ùÿÿƒÂÿÿƒÂÿÿþ @`J@`N ‘Âÿÿ’Âÿÿ A P P  ùÿÿÂÿÿÂÿÿþ @`J@`N iÃÿÿjÃÿÿ Aîaóa  ýøÿÿ{Âÿÿ{Âÿÿþ @S`Y@S`^ ‰ÂÿÿŠÂÿÿ AÖeÚe  ùøÿÿwÂÿÿwÂÿÿþ @[`Z@[`^ …Âÿÿ†Âÿÿ Aîfòf  õøÿÿsÂÿÿsÂÿÿþ @^`Z@^`^ Âÿÿ‚Âÿÿ Aðiôi  ñøÿÿoÂÿÿoÂÿÿþ @i`W@i`[ YÃÿÿZÃÿÿ A³jžj  íøÿÿkÂÿÿkÂÿÿþ @k`H@k`M yÂÿÿzÂÿÿ AŠkªk  éøÿÿgÂÿÿgÂÿÿþ @n`F@n`J uÂÿÿvÂÿÿ Amm  åøÿÿcÂÿÿcÂÿÿþ @r`F@r`J MÃÿÿNÃÿÿ A×qÜq  áøÿÿ_Âÿÿ_Âÿÿþ C|Š|« mÂÿÿnÂÿÿ AÑrÕr  Ýøÿÿ[Âÿÿ[Âÿÿþ @`B@`F EÃÿÿFÃÿÿ A,t1t  ÙøÿÿWÂÿÿWÂÿÿþ @ƒ`B@ƒ`G AÃÿÿBÃÿÿ AHuMu  ÕøÿÿSÂÿÿSÂÿÿþ @†`J@†`O aÂÿÿbÂÿÿ Aõuùu  ÑøÿÿOÂÿÿOÂÿÿþ @ˆ`R@ˆ`V ]Âÿÿ^Âÿÿ A©w­w  ÍøÿÿKÂÿÿKÂÿÿþ @Œ`R@Œ`V YÂÿÿZÂÿÿ AÑyÕy  ÉøÿÿGÂÿÿGÂÿÿþ @’`J@’`N UÂÿÿVÂÿÿ AÆ{Ê{  ÅøÿÿCÂÿÿCÂÿÿþ @–`X@–`\ QÂÿÿRÂÿÿ AŒ~~  Áøÿÿ?Âÿÿ?Âÿÿþ @ `2@ `6 MÂÿÿNÂÿÿ ABF  œøÿÿ;Âÿÿ;Âÿÿþ @š`>@š`B %Ãÿÿ&Ãÿÿ Aû‚  ¹øÿÿ7Âÿÿ7Âÿÿþ @ª`8@ª`= EÂÿÿFÂÿÿ AՂق  µøÿÿ3Âÿÿ3Âÿÿþ @­`6@­`: AÂÿÿBÂÿÿ Arƒvƒ  ±øÿÿ/Âÿÿ/Âÿÿþ @¯`D@¯`H =Âÿÿ>Âÿÿ A¢„Š„  ­øÿÿ+Âÿÿ+Âÿÿþ @Ž`6@Ž`: ÃÿÿÃÿÿ AӅ؅  ©øÿÿ'Âÿÿ'Âÿÿþ @ž`6@ž`; ÃÿÿÃÿÿ AU‰Z‰  ¥øÿÿ#Âÿÿ#Âÿÿþ @Â`q@Â`v 1Âÿÿ2Âÿÿ AUŠYŠ  ¡øÿÿÂÿÿÂÿÿþ @Å`>@Å`B -Âÿÿ.Âÿÿ AAE  øÿÿÂÿÿÂÿÿþ @Ñ`6@Ñ`: )Âÿÿ*Âÿÿ AcŽgŽ  ™øÿÿÂÿÿÂÿÿþ @Õ`6@Õ`:   óÈ/* __next_internal_client_entry_do_not_use__ default auto */ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime"; import { useEffect, useState, useCallback } from 'react'; import { useParams, useRouter } from 'next/navigation'; import { useLocale } from '@/context/locale'; import { useSession } from '@/lib/auth'; import { getPublicSiteProfile, getOrCreateDirectRoom, sendMessage, request, getCategories, getLocations, trackSiteMessage, getPriceList } from '@/lib/api'; import { PlanBadge } from '@/components/PlanBadge'; export default function PersonalSitePage() { var _profile_portfolio, _profile_firstName, _profile_lastName, _profile_name_, _profile_name, _profile_siteSettings, _profile_siteSettings1, _profile_siteSettings2, _profile_portfolio1, _profile_portfolio2, _SITE_LOCALES_find; const { slug } = useParams(); const { t, locale, setLocale } = useLocale(); const { data: session } = useSession(); const router = useRouter(); const [profile, setProfile] = useState(null); const [loading, setLoading] = useState(true); const [notFound, setNotFound] = useState(false); const [msgLoading, setMsgLoading] = useState(false); const [linkCopied, setLinkCopied] = useState(false); const [lightbox, setLightbox] = useState(null); const [contactSent, setContactSent] = useState(false); const [contactForm, setContactForm] = useState({ name: '', email: '', message: '' }); const [contactLoading, setContactLoading] = useState(false); const [langOpen, setLangOpen] = useState(false); const [msgModal, setMsgModal] = useState(false); const [authModal, setAuthModal] = useState(false); const [msgText, setMsgText] = useState(''); const [msgSent, setMsgSent] = useState(false); const [catMap, setCatMap] = useState({}); const [locMap, setLocMap] = useState({}); const [locParentMap, setLocParentMap] = useState({}); const [priceLists, setPriceLists] = useState({}); const [scrolled, setScrolled] = useState(false); const dateLocale = locale === 'ru' ? 'ru-RU' : locale === 'uk' ? 'uk-UA' : locale === 'en' ? 'en-US' : 'el-GR'; useEffect(()=>{ const onScroll = ()=>setScrolled(window.scrollY > 100); window.addEventListener('scroll', onScroll, { passive: true }); return ()=>window.removeEventListener('scroll', onScroll); }, []); const LANG_MAP = { el: { flag: '🇬🇷', label: 'ΕλληΜικά' }, en: { flag: '🇬🇧', label: 'English' }, ru: { flag: '🇷🇺', label: 'РусскОй' }, uk: { flag: '🇺🇊', label: 'УкраїМська' }, de: { flag: '🇩🇪', label: 'Deutsch' }, fr: { flag: '🇫🇷', label: 'Français' }, it: { flag: '🇮🇹', label: 'Italiano' }, es: { flag: '🇪🇞', label: 'Español' }, ar: { flag: '🇞🇊', label: 'العرؚية' }, zh: { flag: '🇚🇳', label: 'äž­æ–‡' } }; const SITE_LOCALES = [ { code: 'el', flag: '🇬🇷', label: 'ΕλληΜικά' }, { code: 'en', flag: '🇬🇧', label: 'English' }, { code: 'ru', flag: '🇷🇺', label: 'РусскОй' } ]; useEffect(()=>{ if (!slug) return; getPublicSiteProfile(slug).then(setProfile).catch(()=>setNotFound(true)).finally(()=>setLoading(false)); }, [ slug ]); useEffect(()=>{ var _profile_siteSettings; const shouldShowPriceList = (profile === null || profile === void 0 ? void 0 : (_profile_siteSettings = profile.siteSettings) === null || _profile_siteSettings === void 0 ? void 0 : _profile_siteSettings.showPriceList) !== false; const cards = Array.isArray(profile === null || profile === void 0 ? void 0 : profile.cards) ? profile.cards : []; if (!profile || !shouldShowPriceList || cards.length === 0) { setPriceLists({}); return; } let cancelled = false; Promise.all(cards.map(async (card)=>[ card.id, await getPriceList(card.id, locale) ])).then((entries)=>{ if (cancelled) return; setPriceLists(Object.fromEntries(entries.filter((param)=>{ let [, groups] = param; return groups.length > 0; }))); }).catch(()=>{ if (!cancelled) setPriceLists({}); }); return ()=>{ cancelled = true; }; }, [ profile, locale ]); useEffect(()=>{ const catLocale = locale; getCategories().then((cats)=>{ const m = {}; for (const c of cats){ var _c_names_catLocale; m[c.slug] = (_c_names_catLocale = c.names[catLocale]) !== null && _c_names_catLocale !== void 0 ? _c_names_catLocale : c.names.el; var _c_children; for (const sub of (_c_children = c.children) !== null && _c_children !== void 0 ? _c_children : []){ var _sub_names_catLocale; m[sub.slug] = (_sub_names_catLocale = sub.names[catLocale]) !== null && _sub_names_catLocale !== void 0 ? _sub_names_catLocale : sub.names.el; } } setCatMap(m); }).catch(()=>{}); getLocations().then((locs)=>{ const m = {}; const pm = {}; for (const loc of locs){ var _loc_names, _loc_names1; var _loc_names_catLocale, _ref; const parentName = (_ref = (_loc_names_catLocale = (_loc_names = loc.names) === null || _loc_names === void 0 ? void 0 : _loc_names[catLocale]) !== null && _loc_names_catLocale !== void 0 ? _loc_names_catLocale : (_loc_names1 = loc.names) === null || _loc_names1 === void 0 ? void 0 : _loc_names1.el) !== null && _ref !== void 0 ? _ref : loc.slug; m[loc.slug] = parentName; var _loc_children; for (const child of (_loc_children = loc.children) !== null && _loc_children !== void 0 ? _loc_children : []){ var _child_names, _child_names1; var _child_names_catLocale, _ref1; m[child.slug] = (_ref1 = (_child_names_catLocale = (_child_names = child.names) === null || _child_names === void 0 ? void 0 : _child_names[catLocale]) !== null && _child_names_catLocale !== void 0 ? _child_names_catLocale : (_child_names1 = child.names) === null || _child_names1 === void 0 ? void 0 : _child_names1.el) !== null && _ref1 !== void 0 ? _ref1 : child.slug; pm[child.slug] = parentName; } } setLocMap(m); setLocParentMap(pm); }).catch(()=>{}); }, [ locale ]); function handleMessage() { if (!session) { setAuthModal(true); return; } setMsgModal(true); } async function handleSendMessage(e) { e.preventDefault(); if (!msgText.trim()) return; setMsgLoading(true); try { const { room } = await getOrCreateDirectRoom(profile.id); await sendMessage(room.id, msgText.trim()); trackSiteMessage(slug); setMsgSent(true); setMsgText(''); } catch (e) {} finally{ setMsgLoading(false); } } const handleContactSubmit = useCallback(async (e)=>{ e.preventDefault(); if (!contactForm.name.trim() || !contactForm.message.trim()) return; setContactLoading(true); try { await request("/users/site/".concat(slug, "/contact"), { method: 'POST', body: JSON.stringify(contactForm) }); setContactSent(true); setContactForm({ name: '', email: '', message: '' }); } catch (e) {} finally{ setContactLoading(false); } }, [ contactForm, slug ]); // Lightbox keyboard nav useEffect(()=>{ if (lightbox === null) return; const handler = (e)=>{ if (e.key === 'Escape') setLightbox(null); if (e.key === 'ArrowRight') setLightbox((i)=>{ var _profile_portfolio; var _profile_portfolio_length; return i !== null ? Math.min(i + 1, ((_profile_portfolio_length = profile === null || profile === void 0 ? void 0 : (_profile_portfolio = profile.portfolio) === null || _profile_portfolio === void 0 ? void 0 : _profile_portfolio.length) !== null && _profile_portfolio_length !== void 0 ? _profile_portfolio_length : 1) - 1) : null; }); if (e.key === 'ArrowLeft') setLightbox((i)=>i !== null ? Math.max(i - 1, 0) : null); }; document.addEventListener('keydown', handler); return ()=>document.removeEventListener('keydown', handler); }, [ lightbox, profile === null || profile === void 0 ? void 0 : (_profile_portfolio = profile.portfolio) === null || _profile_portfolio === void 0 ? void 0 : _profile_portfolio.length ]); if (loading) return /*#__PURE__*/ _jsx("div", { className: "min-h-screen flex items-center justify-center", style: { background: 'var(--site-bg)' }, children: /*#__PURE__*/ _jsxs("div", { className: "relative w-12 h-12", children: [ /*#__PURE__*/ _jsx("div", { className: "absolute inset-0 rounded-full border-2 border-green-500/20" }), /*#__PURE__*/ _jsx("div", { className: "absolute inset-0 rounded-full border-2 border-transparent border-t-blue-500 animate-spin" }) ] }) }); if (notFound || !profile) return /*#__PURE__*/ _jsxs("div", { className: "min-h-screen flex flex-col items-center justify-center gap-6", style: { background: 'var(--site-bg)' }, children: [ /*#__PURE__*/ _jsx("div", { className: "w-20 h-20 rounded-full flex items-center justify-center", style: { background: 'var(--site-surface)' }, children: /*#__PURE__*/ _jsx("svg", { className: "w-10 h-10 text-gray-500", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15.182 16.318A4.486 4.486 0 0012.016 15a4.486 4.486 0 00-3.198 1.318M21 12a9 9 0 11-18 0 9 9 0 0118 0zM9.75 9.75c0 .414-.168.75-.375.75S9 10.164 9 9.75 9.168 9 9.375 9s.375.336.375.75zm-.375 0h.008v.015h-.008V9.75zm5.625 0c0 .414-.168.75-.375.75s-.375-.336-.375-.75.168-.75.375-.75.375.336.375.75zm-.375 0h.008v.015h-.008V9.75z" }) }) }), /*#__PURE__*/ _jsx("p", { className: "text-gray-400 text-lg", children: t('common.not_found', 'Page not found') }), /*#__PURE__*/ _jsx("a", { href: "/", className: "text-gray-400 hover:text-gray-300 text-sm transition", children: t('nav.home', 'Home') }) ] }); var _profile_firstName_, _profile_lastName_; const initials = "".concat((_profile_firstName_ = (_profile_firstName = profile.firstName) === null || _profile_firstName === void 0 ? void 0 : _profile_firstName[0]) !== null && _profile_firstName_ !== void 0 ? _profile_firstName_ : '').concat((_profile_lastName_ = (_profile_lastName = profile.lastName) === null || _profile_lastName === void 0 ? void 0 : _profile_lastName[0]) !== null && _profile_lastName_ !== void 0 ? _profile_lastName_ : '').toUpperCase() || ((_profile_name = profile.name) === null || _profile_name === void 0 ? void 0 : (_profile_name_ = _profile_name[0]) === null || _profile_name_ === void 0 ? void 0 : _profile_name_.toUpperCase()) || '?'; const displayName = [ profile.firstName, profile.lastName ].filter(Boolean).join(' ') || profile.name || ''; const memberYear = profile.memberSince ? new Date(profile.memberSince).getFullYear() : null; const hasStats = profile.completedTasks > 0 || profile.rating || profile.reviewCount && profile.reviewCount > 0; const isLight = ((_profile_siteSettings = profile.siteSettings) === null || _profile_siteSettings === void 0 ? void 0 : _profile_siteSettings.siteTheme) === 'light'; const showServices = ((_profile_siteSettings1 = profile.siteSettings) === null || _profile_siteSettings1 === void 0 ? void 0 : _profile_siteSettings1.showServices) !== false; const showPriceList = ((_profile_siteSettings2 = profile.siteSettings) === null || _profile_siteSettings2 === void 0 ? void 0 : _profile_siteSettings2.showPriceList) !== false; const showCardsSection = showServices || showPriceList; var _profile_portfolio_length, _profile_portfolio_lightbox_title, _SITE_LOCALES_find_flag; return /*#__PURE__*/ _jsxs("div", { className: "site-theme min-h-screen selection:bg-green-500/30 ".concat(isLight ? 'site-light' : ''), style: { background: 'var(--site-bg)', color: 'var(--site-text)' }, children: [ lightbox !== null && ((_profile_portfolio1 = profile.portfolio) === null || _profile_portfolio1 === void 0 ? void 0 : _profile_portfolio1[lightbox]) && /*#__PURE__*/ _jsxs("div", { className: "fixed inset-0 z-50 bg-black/90 backdrop-blur-xl flex items-center justify-center p-4", onClick: ()=>setLightbox(null), children: [ /*#__PURE__*/ _jsx("button", { onClick: ()=>setLightbox(null), className: "absolute top-6 right-6 w-10 h-10 rounded-full bg-white/10 hover:bg-white/20 flex items-center justify-center transition", children: /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" }) }) }), lightbox > 0 && /*#__PURE__*/ _jsx("button", { onClick: (e)=>{ e.stopPropagation(); setLightbox(lightbox - 1); }, className: "absolute left-4 top-1/2 -translate-y-1/2 w-10 h-10 rounded-full bg-white/10 hover:bg-white/20 flex items-center justify-center transition", children: /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 19l-7-7 7-7" }) }) }), lightbox < ((_profile_portfolio_length = (_profile_portfolio2 = profile.portfolio) === null || _profile_portfolio2 === void 0 ? void 0 : _profile_portfolio2.length) !== null && _profile_portfolio_length !== void 0 ? _profile_portfolio_length : 1) - 1 && /*#__PURE__*/ _jsx("button", { onClick: (e)=>{ e.stopPropagation(); setLightbox(lightbox + 1); }, className: "absolute right-4 top-1/2 -translate-y-1/2 w-10 h-10 rounded-full bg-white/10 hover:bg-white/20 flex items-center justify-center transition", children: /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 5l7 7-7 7" }) }) }), /*#__PURE__*/ _jsx("img", { src: profile.portfolio[lightbox].imageUrl, alt: (_profile_portfolio_lightbox_title = profile.portfolio[lightbox].title) !== null && _profile_portfolio_lightbox_title !== void 0 ? _profile_portfolio_lightbox_title : '', className: "max-w-full max-h-[85vh] rounded-2xl object-contain", onClick: (e)=>e.stopPropagation() }), profile.portfolio[lightbox].title && /*#__PURE__*/ _jsx("div", { className: "absolute bottom-6 left-1/2 -translate-x-1/2 bg-black/60 backdrop-blur-md px-5 py-2.5 rounded-full text-sm", children: profile.portfolio[lightbox].title }) ] }), authModal && /*#__PURE__*/ _jsx("div", { className: "fixed inset-0 z-50 bg-black/70 backdrop-blur-sm flex items-center justify-center p-4", onClick: ()=>setAuthModal(false), children: /*#__PURE__*/ _jsxs("div", { className: "relative w-full max-w-sm rounded-2xl shadow-2xl p-6", style: { background: 'var(--site-modal-bg)', border: '1px solid var(--site-border)' }, onClick: (e)=>e.stopPropagation(), children: [ /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setAuthModal(false), className: "absolute top-4 right-4 w-8 h-8 rounded-full flex items-center justify-center transition", style: { background: 'var(--site-surface)', color: 'var(--site-text-muted)' }, children: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" }) }) }), /*#__PURE__*/ _jsx("div", { className: "w-12 h-12 rounded-full bg-green-500/10 flex items-center justify-center mb-4", children: /*#__PURE__*/ _jsx("svg", { className: "w-6 h-6 text-gray-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }) }), /*#__PURE__*/ _jsx("h3", { className: "text-base font-semibold mb-2", style: { color: 'var(--site-text)' }, children: t('site.auth_required_title', 'Authorization required') }), /*#__PURE__*/ _jsx("p", { className: "text-sm mb-5", style: { color: 'var(--site-text-muted)' }, children: t('site.auth_required_desc', 'To write in chat, sign in to your CanHelp account.') }), /*#__PURE__*/ _jsxs("div", { className: "flex flex-col gap-2.5", children: [ /*#__PURE__*/ _jsxs("a", { href: "/login", className: "w-full flex items-center justify-center gap-2 bg-green-600 hover:bg-green-500 text-white font-medium text-sm px-4 py-2.5 rounded-xl transition", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M11 16l-4-4m0 0l4-4m-4 4h14m-5 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h7a3 3 0 013 3v1" }) }), t('site.auth_login_btn', 'Sign in') ] }), /*#__PURE__*/ _jsxs("button", { type: "button", onClick: ()=>{ setAuthModal(false); setTimeout(()=>{ var _document_getElementById; (_document_getElementById = document.getElementById('contact')) === null || _document_getElementById === void 0 ? void 0 : _document_getElementById.scrollIntoView({ behavior: 'smooth', block: 'start' }); }, 100); }, className: "w-full flex items-center justify-center gap-2 text-sm font-medium px-4 py-2.5 rounded-xl transition", style: { background: 'var(--site-surface)', color: 'var(--site-text-secondary)', border: '1px solid var(--site-border)' }, children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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" }) }), t('site.auth_contact_form_btn', 'Write via contact form') ] }) ] }) ] }) }), msgModal && /*#__PURE__*/ _jsx("div", { className: "fixed inset-0 z-50 bg-black/70 backdrop-blur-sm flex items-center justify-center p-4", onClick: ()=>{ if (!msgLoading) { setMsgModal(false); setMsgSent(false); } }, children: /*#__PURE__*/ _jsxs("div", { className: "relative w-full max-w-md rounded-2xl shadow-2xl", style: { background: 'var(--site-modal-bg)', border: '1px solid var(--site-border)' }, onClick: (e)=>e.stopPropagation(), children: [ /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>{ setMsgModal(false); setMsgSent(false); }, className: "absolute top-4 right-4 w-8 h-8 rounded-full flex items-center justify-center transition", style: { background: 'var(--site-surface)', color: 'var(--site-text-muted)' }, children: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" }) }) }), /*#__PURE__*/ _jsxs("div", { className: "p-6", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 mb-5", children: [ /*#__PURE__*/ _jsx("div", { className: "w-10 h-10 rounded-full bg-green-500/10 flex items-center justify-center", children: /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5 text-gray-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }) }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("h3", { className: "text-base font-semibold", style: { color: 'var(--site-text)' }, children: t('site.write_to_chat', 'Write in chat') }), /*#__PURE__*/ _jsx("p", { className: "text-xs", style: { color: 'var(--site-text-muted)' }, children: displayName }) ] }) ] }), msgSent ? /*#__PURE__*/ _jsxs("div", { className: "text-center py-6", children: [ /*#__PURE__*/ _jsx("div", { className: "w-12 h-12 rounded-full bg-emerald-500/20 flex items-center justify-center mx-auto mb-3", children: /*#__PURE__*/ _jsx("svg", { className: "w-6 h-6 text-emerald-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" }) }) }), /*#__PURE__*/ _jsx("p", { className: "text-emerald-400 font-medium mb-1", children: t('site.message_sent', 'Message sent!') }), /*#__PURE__*/ _jsx("p", { className: "text-sm mb-4", style: { color: 'var(--site-text-muted)' }, children: t('site.message_sent_desc', 'The specialist will receive it in chat') }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>{ setMsgModal(false); setMsgSent(false); }, className: "text-sm text-gray-400 hover:text-gray-300 transition", children: t('common.close', 'Close') }) ] }) : /*#__PURE__*/ _jsxs("form", { onSubmit: handleSendMessage, children: [ /*#__PURE__*/ _jsx("textarea", { autoFocus: true, rows: 4, value: msgText, onChange: (e)=>setMsgText(e.target.value), className: "w-full rounded-xl px-4 py-3 text-sm focus:outline-none focus:border-green-500/50 transition resize-none mb-4", style: { background: 'var(--site-input-bg)', border: '1px solid var(--site-input-border)', color: 'var(--site-input-text)' }, placeholder: t('site.message_placeholder', 'Write your message...') }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-end gap-3", children: [ /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setMsgModal(false), className: "text-sm transition px-4 py-2", style: { color: 'var(--site-text-muted)' }, children: t('common.cancel', 'Cancel') }), /*#__PURE__*/ _jsxs("button", { type: "submit", disabled: msgLoading || !msgText.trim(), className: "inline-flex items-center gap-2 bg-green-600 hover:bg-green-500 text-white font-medium text-sm px-5 py-2.5 rounded-xl transition disabled:opacity-50", children: [ msgLoading ? /*#__PURE__*/ _jsx("div", { className: "w-4 h-4 rounded-full border-2 border-white/30 border-t-white animate-spin" }) : /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 19l9 2-9-18-9 18 9-2zm0 0v-8" }) }), t('site.contact_send', 'Send') ] }) ] }) ] }) ] }) ] }) }), /*#__PURE__*/ _jsx("nav", { className: "sticky top-0 z-40 backdrop-blur-xl", style: { background: 'var(--site-nav-bg)', borderBottom: '1px solid var(--site-border)' }, children: /*#__PURE__*/ _jsxs("div", { className: "max-w-5xl mx-auto px-4 sm:px-6 h-14 flex items-center justify-between", children: [ /*#__PURE__*/ _jsx("a", { href: "/", className: "logo-text-mini tracking-tight".concat(scrolled ? ' scrolled' : ''), style: { color: 'var(--site-text-secondary)' }, children: "CanHelp" }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2", children: [ (profile === null || profile === void 0 ? void 0 : profile.rating) && /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-1 text-xs mr-1", style: { color: 'var(--site-text-secondary)' }, children: [ /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5 text-amber-400", fill: "currentColor", viewBox: "0 0 20 20", children: /*#__PURE__*/ _jsx("path", { d: "M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 00-1.175 0l-2.8 2.034c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 00.951-.69l1.07-3.292z" }) }), /*#__PURE__*/ _jsx("span", { className: "font-medium", children: Number(profile.rating).toFixed(1) }) ] }), /*#__PURE__*/ _jsxs("div", { className: "relative", children: [ /*#__PURE__*/ _jsxs("button", { type: "button", onClick: ()=>setLangOpen(!langOpen), className: "flex items-center gap-1.5 text-xs transition px-2 py-1 rounded-lg", style: { color: 'var(--site-text-muted)' }, children: [ /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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" }) }), (_SITE_LOCALES_find_flag = (_SITE_LOCALES_find = SITE_LOCALES.find((l)=>l.code === locale)) === null || _SITE_LOCALES_find === void 0 ? void 0 : _SITE_LOCALES_find.flag) !== null && _SITE_LOCALES_find_flag !== void 0 ? _SITE_LOCALES_find_flag : '🌐' ] }), langOpen && /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx("div", { className: "fixed inset-0 z-40", onClick: ()=>setLangOpen(false) }), /*#__PURE__*/ _jsx("div", { className: "absolute right-0 top-full mt-1 z-50 rounded-xl shadow-xl overflow-hidden min-w-[140px]", style: { background: 'var(--site-lang-dropdown)', border: '1px solid var(--site-border)' }, children: SITE_LOCALES.map((l)=>/*#__PURE__*/ _jsxs("button", { type: "button", onClick: ()=>{ setLocale(l.code); setLangOpen(false); }, className: "w-full flex items-center gap-2 px-3 py-2 text-xs transition ".concat(locale === l.code ? 'text-gray-400 bg-green-500/10' : ''), style: locale === l.code ? {} : { color: 'var(--site-text-secondary)' }, children: [ /*#__PURE__*/ _jsx("span", { children: l.flag }), /*#__PURE__*/ _jsx("span", { children: l.label }) ] }, l.code)) }) ] }) ] }), /*#__PURE__*/ _jsx("div", { className: "w-px h-4", style: { background: 'var(--site-divider)' } }), /*#__PURE__*/ _jsxs("button", { type: "button", onClick: async ()=>{ const url = window.location.href; if (navigator.share) { try { await navigator.share({ title: displayName, url }); } catch (e) {} } else { navigator.clipboard.writeText(url); setLinkCopied(true); setTimeout(()=>setLinkCopied(false), 2000); } }, className: "flex items-center gap-1.5 text-xs transition", style: { color: 'var(--site-text-muted)' }, children: [ /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8.684 13.342C8.886 12.938 9 12.482 9 12c0-.482-.114-.938-.316-1.342m0 2.684a3 3 0 110-2.684m0 2.684l6.632 3.316m-6.632-6l6.632-3.316m0 0a3 3 0 105.367-2.684 3 3 0 00-5.367 2.684zm0 9.316a3 3 0 105.368 2.684 3 3 0 00-5.368-2.684z" }) }), linkCopied ? t('profile.site.copied') : t('site.share', 'Share') ] }) ] }) ] }) }), /*#__PURE__*/ _jsxs("section", { className: "relative overflow-hidden", children: [ /*#__PURE__*/ _jsx("div", { className: "absolute top-0 left-1/4 w-[500px] h-[500px] bg-green-600/10 rounded-full blur-[120px] pointer-events-none" }), /*#__PURE__*/ _jsx("div", { className: "absolute top-20 right-1/4 w-[400px] h-[400px] bg-purple-600/8 rounded-full blur-[100px] pointer-events-none" }), /*#__PURE__*/ _jsx("div", { className: "relative max-w-5xl mx-auto px-4 sm:px-6 pt-16 pb-20 sm:pt-24 sm:pb-28", children: /*#__PURE__*/ _jsxs("div", { className: "flex flex-col items-center text-center", children: [ /*#__PURE__*/ _jsxs("div", { className: "relative group mb-6", children: [ /*#__PURE__*/ _jsx("div", { className: "absolute -inset-1 bg-gradient-to-br from-green-600 to-purple-500 rounded-full opacity-60 blur group-hover:opacity-80 transition-opacity" }), /*#__PURE__*/ _jsx("div", { className: "relative w-28 h-28 sm:w-32 sm:h-32 rounded-full overflow-hidden border-2 flex items-center justify-center text-4xl font-bold", style: { borderColor: 'var(--site-avatar-border)', background: 'var(--site-avatar-bg)', color: 'var(--site-text)' }, children: profile.image ? /*#__PURE__*/ _jsx("img", { src: profile.image, alt: displayName, className: "w-full h-full object-cover" }) : initials }), Array.isArray(profile.activeStatuses) && profile.activeStatuses.includes('canhelp_now') && /*#__PURE__*/ _jsx("div", { className: "absolute bottom-1 right-1 w-5 h-5 bg-emerald-500 rounded-full border-2 flex items-center justify-center", style: { borderColor: 'var(--site-status-border-color)' }, children: /*#__PURE__*/ _jsx("span", { className: "w-2 h-2 rounded-full bg-white animate-pulse" }) }) ] }), /*#__PURE__*/ _jsx("h1", { className: "text-3xl sm:text-5xl font-bold tracking-tight bg-clip-text text-transparent mb-3 pb-1", style: { backgroundImage: 'linear-gradient(to bottom, var(--site-name-from), var(--site-name-to))' }, children: displayName }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-center gap-2 flex-wrap mb-4", children: [ profile.planTier && profile.planTier !== 'free' && /*#__PURE__*/ _jsx(PlanBadge, { tier: profile.planTier, verified: profile.hasVerifiedBadge, size: "md" }), Array.isArray(profile.activeStatuses) && profile.activeStatuses.includes('canhelp_now') && /*#__PURE__*/ _jsxs("span", { className: "inline-flex items-center gap-1.5 text-xs font-medium text-emerald-400 bg-emerald-500/10 border border-emerald-500/20 px-3 py-1.5 rounded-full", children: [ /*#__PURE__*/ _jsx("span", { className: "w-1.5 h-1.5 rounded-full bg-emerald-400 animate-pulse" }), t('status.can_help_now', 'Available now') ] }), memberYear && /*#__PURE__*/ _jsxs("span", { className: "text-xs px-3 py-1.5 rounded-full", style: { color: 'var(--site-text-muted)', background: 'var(--site-surface)' }, children: [ t('site.member_since', 'Member since'), " ", memberYear ] }) ] }), profile.bio && /*#__PURE__*/ _jsx("p", { className: "max-w-xl text-base sm:text-lg leading-relaxed mb-8", style: { color: 'var(--site-text-secondary)' }, children: profile.bio }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 flex-wrap justify-center", children: [ /*#__PURE__*/ _jsxs("button", { onClick: handleMessage, disabled: msgLoading, className: "group inline-flex items-center gap-2.5 bg-green-600 hover:bg-green-500 text-white font-semibold px-7 py-3.5 rounded-full transition-all hover:shadow-lg hover:shadow-blue-500/25 disabled:opacity-50", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5 group-hover:scale-110 transition-transform", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }), t('site.write_to_chat', 'Write in chat') ] }), profile.phone && /*#__PURE__*/ _jsxs("a", { href: "tel:".concat(profile.phone), className: "group inline-flex items-center gap-2.5 border font-medium px-7 py-3.5 rounded-full transition-all", style: { background: 'var(--site-phone-bg)', borderColor: 'var(--site-phone-border)', color: 'var(--site-phone-text)' }, children: [ /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5 group-hover:scale-110 transition-transform", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M3 5a2 2 0 012-2h3.28a1 1 0 01.948.684l1.498 4.493a1 1 0 01-.502 1.21l-2.257 1.13a11.042 11.042 0 005.516 5.516l1.13-2.257a1 1 0 011.21-.502l4.493 1.498a1 1 0 01.684.949V19a2 2 0 01-2 2h-1C9.716 21 3 14.284 3 6V5z" }) }), profile.phone ] }) ] }) ] }) }) ] }), hasStats && /*#__PURE__*/ _jsx("section", { className: "border-y", style: { borderColor: 'var(--site-border)', background: 'var(--site-surface)' }, children: /*#__PURE__*/ _jsx("div", { className: "max-w-5xl mx-auto px-4 sm:px-6 py-8", children: /*#__PURE__*/ _jsxs("div", { className: "grid grid-cols-2 sm:grid-cols-4 gap-6", children: [ profile.rating && /*#__PURE__*/ _jsxs("div", { className: "text-center", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-center gap-1 mb-1", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5 text-amber-400", fill: "currentColor", viewBox: "0 0 20 20", children: /*#__PURE__*/ _jsx("path", { d: "M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 00-1.175 0l-2.8 2.034c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 00.951-.69l1.07-3.292z" }) }), /*#__PURE__*/ _jsx("span", { className: "text-2xl font-bold", children: Number(profile.rating).toFixed(1) }) ] }), /*#__PURE__*/ _jsx("p", { className: "text-xs uppercase tracking-wider", style: { color: 'var(--site-text-muted)' }, children: t('site.rating', 'Rating') }) ] }), profile.reviewCount > 0 && /*#__PURE__*/ _jsxs("div", { className: "text-center", children: [ /*#__PURE__*/ _jsx("p", { className: "text-2xl font-bold mb-1", children: profile.reviewCount }), /*#__PURE__*/ _jsx("p", { className: "text-xs uppercase tracking-wider", style: { color: 'var(--site-text-muted)' }, children: t('profile.reviews') }) ] }), profile.completedTasks > 0 && /*#__PURE__*/ _jsxs("div", { className: "text-center", children: [ /*#__PURE__*/ _jsx("p", { className: "text-2xl font-bold mb-1", children: profile.completedTasks }), /*#__PURE__*/ _jsx("p", { className: "text-xs uppercase tracking-wider", style: { color: 'var(--site-text-muted)' }, children: t('site.completed_tasks', 'Completed') }) ] }), Array.isArray(profile.languages) && profile.languages.length > 0 && /*#__PURE__*/ _jsxs("div", { className: "text-center", children: [ /*#__PURE__*/ _jsx("p", { className: "text-2xl font-bold mb-1", children: profile.languages.length }), /*#__PURE__*/ _jsx("p", { className: "text-xs uppercase tracking-wider", style: { color: 'var(--site-text-muted)' }, children: t('site.languages', 'Languages') }) ] }) ] }) }) }), Array.isArray(profile.languages) && profile.languages.length > 0 && /*#__PURE__*/ _jsxs("section", { className: "max-w-5xl mx-auto px-4 sm:px-6 pt-10", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 mb-3", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", style: { color: 'var(--site-text-muted)' }, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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" }) }), /*#__PURE__*/ _jsx("span", { className: "text-sm", style: { color: 'var(--site-text-muted)' }, children: t('site.speaks_languages', 'Speaks languages') }) ] }), /*#__PURE__*/ _jsx("div", { className: "flex items-center gap-2 flex-wrap", children: profile.languages.map((lang)=>{ const info = LANG_MAP[lang]; return /*#__PURE__*/ _jsx("span", { className: "text-xs px-3 py-1.5 rounded-full flex items-center gap-1.5", style: { color: 'var(--site-tag-text)', background: 'var(--site-tag-bg)', border: '1px solid var(--site-tag-border)' }, children: info ? /*#__PURE__*/ _jsxs(_Fragment, { children: [ info.flag, " ", info.label ] }) : lang }, lang); }) }) ] }), /*#__PURE__*/ _jsxs("div", { className: "max-w-5xl mx-auto px-4 sm:px-6 pb-20 space-y-16 mt-10", children: [ showServices && Array.isArray(profile.cards) && profile.cards.length > 0 && /*#__PURE__*/ _jsxs("section", { children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 mb-6", children: [ /*#__PURE__*/ _jsx("div", { className: "w-8 h-8 rounded-lg bg-green-500/10 flex items-center justify-center", children: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-gray-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M21 13.255A23.931 23.931 0 0112 15c-3.183 0-6.22-.62-9-1.745M16 6V4a2 2 0 00-2-2h-4a2 2 0 00-2 2v2m4 6h.01M5 20h14a2 2 0 002-2V8a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z" }) }) }), /*#__PURE__*/ _jsx("h2", { className: "text-xl font-bold", children: t('specialist.services', 'Services') }) ] }), /*#__PURE__*/ _jsx("div", { className: "grid gap-4 sm:grid-cols-2", children: profile.cards.map((card)=>{ // Group locations by parent const grouped = {}; if (Array.isArray(card.locations)) { for (const slug of card.locations){ const parent = locParentMap[slug]; if (parent) { if (!grouped[parent]) grouped[parent] = []; grouped[parent].push(locMap[slug] || slug); } else { const name = locMap[slug] || slug; if (!grouped[name]) grouped[name] = []; } } } return /*#__PURE__*/ _jsxs("div", { className: "group relative rounded-2xl p-6 transition-all", style: { background: 'var(--site-card-bg)', border: '1px solid var(--site-card-border)' }, children: [ /*#__PURE__*/ _jsx("h3", { className: "font-semibold mb-2", style: { color: 'var(--site-text)' }, children: card.title }), showServices && (()=>{ const desc = (locale === 'el' ? card.descriptionEl : locale === 'en' ? card.descriptionEn : locale === 'ru' ? card.descriptionRu : card.descriptionUk) || card.descriptionEl || card.descriptionEn || card.descriptionRu || card.descriptionUk || card.description; return desc ? /*#__PURE__*/ _jsx("p", { className: "text-sm leading-relaxed mb-3", style: { color: 'var(--site-text-muted)' }, children: desc }) : null; })(), showServices && Array.isArray(card.categories) && card.categories.length > 0 && /*#__PURE__*/ _jsx("div", { className: "flex flex-wrap gap-1.5 mb-3", children: card.categories.map((slug)=>/*#__PURE__*/ _jsx("span", { className: "text-[11px] px-2.5 py-1 rounded-full bg-purple-500/10 text-purple-400 border border-purple-500/10", children: catMap[slug] || slug }, slug)) }), showServices && Object.keys(grouped).length > 0 && /*#__PURE__*/ _jsx("div", { className: "mb-3 space-y-1", children: Object.entries(grouped).map((param)=>{ let [parent, children] = param; return /*#__PURE__*/ _jsxs("div", { className: "flex items-start gap-1.5 text-xs", style: { color: 'var(--site-text-muted)' }, children: [ /*#__PURE__*/ _jsxs("svg", { className: "w-3.5 h-3.5 shrink-0 mt-0.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ _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" }), /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 11a3 3 0 11-6 0 3 3 0 016 0z" }) ] }), /*#__PURE__*/ _jsxs("span", { children: [ /*#__PURE__*/ _jsx("span", { className: "font-medium", style: { color: 'var(--site-text-secondary)' }, children: parent }), children.length > 0 && /*#__PURE__*/ _jsxs("span", { style: { color: 'var(--site-text-hint)' }, children: [ " — ", children.join(', ') ] }) ] }) ] }, parent); }) }), showServices && Array.isArray(card.skills) && card.skills.length > 0 && /*#__PURE__*/ _jsx("div", { className: "flex flex-wrap gap-1.5", children: card.skills.map((s)=>/*#__PURE__*/ _jsx("span", { className: "text-[11px] px-2.5 py-1 rounded-full bg-green-500/10 text-gray-400 border border-green-500/10", children: s }, s)) }), showPriceList && Array.isArray(priceLists[card.id]) && priceLists[card.id].length > 0 && /*#__PURE__*/ _jsxs("div", { className: "".concat(showServices ? 'mt-4 pt-4 border-t' : ''), style: { borderColor: 'var(--site-card-border)' }, children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs font-semibold uppercase tracking-wider mb-3", style: { color: 'var(--site-text-muted)' }, children: t('site.pricelist', 'Price list') }), /*#__PURE__*/ _jsx("div", { className: "space-y-3", children: priceLists[card.id].map((group)=>/*#__PURE__*/ _jsxs("div", { className: "rounded-xl p-4", style: { background: 'var(--site-surface)', border: '1px solid var(--site-card-border)' }, children: [ /*#__PURE__*/ _jsx("p", { className: "font-semibold mb-3", style: { color: 'var(--site-text)' }, children: group.title }), /*#__PURE__*/ _jsx("div", { className: "space-y-3", children: group.items.map((item)=>/*#__PURE__*/ _jsxs("div", { className: "flex items-start justify-between gap-4", children: [ /*#__PURE__*/ _jsxs("div", { className: "min-w-0", children: [ /*#__PURE__*/ _jsx("p", { className: "text-sm font-medium", style: { color: 'var(--site-text-secondary)' }, children: item.name }), item.description && /*#__PURE__*/ _jsx("p", { className: "text-xs mt-0.5", style: { color: 'var(--site-text-muted)' }, children: item.description }) ] }), (item.price || item.unit) && /*#__PURE__*/ _jsxs("div", { className: "shrink-0 text-sm font-semibold", style: { color: 'var(--site-text)' }, children: [ item.price ? "€".concat(item.price) : '', item.unit ? " ".concat(item.unit) : '' ] }) ] }, item.id)) }) ] }, group.id)) }) ] }) ] }, card.id); }) }) ] }), Array.isArray(profile.portfolio) && profile.portfolio.length > 0 && /*#__PURE__*/ _jsxs("section", { children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 mb-6", children: [ /*#__PURE__*/ _jsx("div", { className: "w-8 h-8 rounded-lg bg-purple-500/10 flex items-center justify-center", children: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-purple-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z" }) }) }), /*#__PURE__*/ _jsx("h2", { className: "text-xl font-bold", children: t('portfolio.title', 'Portfolio') }), /*#__PURE__*/ _jsxs("span", { className: "text-xs ml-auto", style: { color: 'var(--site-text-hint)' }, children: [ profile.portfolio.length, " ", t('site.photos', 'photos') ] }) ] }), /*#__PURE__*/ _jsx("div", { className: "grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 gap-3", children: profile.portfolio.map((item, idx)=>{ var _item_title; return /*#__PURE__*/ _jsxs("button", { onClick: ()=>item.imageUrl && setLightbox(idx), className: "group relative aspect-square rounded-xl overflow-hidden transition-all", style: { background: 'var(--site-surface)', border: '1px solid var(--site-card-border)' }, children: [ item.imageUrl && /*#__PURE__*/ _jsx("img", { src: item.imageUrl, alt: (_item_title = item.title) !== null && _item_title !== void 0 ? _item_title : '', className: "w-full h-full object-cover group-hover:scale-105 transition-transform duration-500" }), /*#__PURE__*/ _jsx("div", { className: "absolute inset-0 bg-gradient-to-t from-black/60 via-transparent to-transparent opacity-0 group-hover:opacity-100 transition-opacity flex items-end p-3", children: item.title && /*#__PURE__*/ _jsx("p", { className: "text-xs font-medium text-white truncate", children: item.title }) }), /*#__PURE__*/ _jsx("div", { className: "absolute top-2 right-2 w-7 h-7 rounded-full bg-black/40 backdrop-blur-md flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity", children: /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5 text-white/80", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0zM10 7v3m0 0v3m0-3h3m-3 0H7" }) }) }) ] }, item.id); }) }) ] }), Array.isArray(profile.reviews) && profile.reviews.length > 0 && /*#__PURE__*/ _jsxs("section", { children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 mb-6", children: [ /*#__PURE__*/ _jsx("div", { className: "w-8 h-8 rounded-lg bg-amber-500/10 flex items-center justify-center", children: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-amber-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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" }) }) }), /*#__PURE__*/ _jsx("h2", { className: "text-xl font-bold", children: t('profile.reviews') }), /*#__PURE__*/ _jsx("span", { className: "text-xs ml-auto", style: { color: 'var(--site-text-hint)' }, children: profile.reviewCount }) ] }), /*#__PURE__*/ _jsx("div", { className: "space-y-3", children: profile.reviews.slice(0, 6).map((review)=>{ var _review_authorFirstName, _review_authorName; const authorName = [ review.authorFirstName, review.authorLastName ].filter(Boolean).join(' ') || review.authorName || null; var _review_authorFirstName_, _ref; return /*#__PURE__*/ _jsxs("div", { className: "rounded-2xl p-5", style: { background: 'var(--site-card-bg)', border: '1px solid var(--site-card-border)' }, children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-start gap-3 mb-3", children: [ /*#__PURE__*/ _jsx("div", { className: "w-9 h-9 rounded-full flex items-center justify-center text-xs font-bold overflow-hidden shrink-0", style: { background: 'var(--site-surface)', color: 'var(--site-text-muted)' }, children: review.authorImage ? /*#__PURE__*/ _jsx("img", { src: review.authorImage, alt: "", className: "w-full h-full object-cover" }) : ((_ref = (_review_authorFirstName_ = (_review_authorFirstName = review.authorFirstName) === null || _review_authorFirstName === void 0 ? void 0 : _review_authorFirstName[0]) !== null && _review_authorFirstName_ !== void 0 ? _review_authorFirstName_ : (_review_authorName = review.authorName) === null || _review_authorName === void 0 ? void 0 : _review_authorName[0]) !== null && _ref !== void 0 ? _ref : '?').toUpperCase() }), /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between gap-2", children: [ /*#__PURE__*/ _jsx("p", { className: "text-sm font-medium", style: { color: 'var(--site-text-secondary)' }, children: authorName !== null && authorName !== void 0 ? authorName : t('common.anonymous', 'Anonymous') }), /*#__PURE__*/ _jsx("span", { className: "shrink-0 text-[11px]", style: { color: 'var(--site-text-hint)' }, children: new Date(review.createdAt).toLocaleDateString(dateLocale) }) ] }), /*#__PURE__*/ _jsx("div", { className: "flex gap-0.5 mt-0.5", children: Array.from({ length: 5 }).map((_, i)=>/*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5 ".concat(i < Math.round(review.rating) ? 'text-amber-400' : ''), style: i < Math.round(review.rating) ? {} : { color: 'var(--site-border)' }, fill: "currentColor", viewBox: "0 0 20 20", children: /*#__PURE__*/ _jsx("path", { d: "M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 00-1.175 0l-2.8 2.034c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 00.951-.69l1.07-3.292z" }) }, i)) }) ] }) ] }), review.comment && /*#__PURE__*/ _jsx("p", { className: "text-sm leading-relaxed pl-12", style: { color: 'var(--site-text-muted)' }, children: review.comment }) ] }, review.id); }) }) ] }), /*#__PURE__*/ _jsxs("section", { id: "contact", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 mb-6", children: [ /*#__PURE__*/ _jsx("div", { className: "w-8 h-8 rounded-lg bg-emerald-500/10 flex items-center justify-center", children: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-emerald-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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" }) }) }), /*#__PURE__*/ _jsx("h2", { className: "text-xl font-bold", children: t('site.contact_form', 'Contact') }) ] }), contactSent ? /*#__PURE__*/ _jsxs("div", { className: "bg-emerald-500/10 border border-emerald-500/20 rounded-2xl p-8 text-center", children: [ /*#__PURE__*/ _jsx("div", { className: "w-12 h-12 rounded-full bg-emerald-500/20 flex items-center justify-center mx-auto mb-3", children: /*#__PURE__*/ _jsx("svg", { className: "w-6 h-6 text-emerald-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" }) }) }), /*#__PURE__*/ _jsx("p", { className: "text-emerald-400 font-medium", children: t('site.contact_sent', 'Message sent!') }), /*#__PURE__*/ _jsx("p", { className: "text-sm mt-1", style: { color: 'var(--site-text-muted)' }, children: t('site.contact_sent_desc', 'The specialist will contact you shortly') }) ] }) : /*#__PURE__*/ _jsxs("form", { onSubmit: handleContactSubmit, className: "rounded-2xl p-6 space-y-4", style: { background: 'var(--site-card-bg)', border: '1px solid var(--site-card-border)' }, children: [ /*#__PURE__*/ _jsxs("div", { className: "grid gap-4 sm:grid-cols-2", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("label", { className: "text-xs uppercase tracking-wider mb-1.5 block", style: { color: 'var(--site-text-muted)' }, children: [ t('site.contact_name', 'Name'), " *" ] }), /*#__PURE__*/ _jsx("input", { type: "text", required: true, value: contactForm.name, onChange: (e)=>setContactForm((f)=>({ ...f, name: e.target.value })), className: "w-full rounded-xl px-4 py-3 text-sm focus:outline-none focus:border-green-500/50 transition", style: { background: 'var(--site-input-bg)', border: '1px solid var(--site-input-border)', color: 'var(--site-input-text)' }, placeholder: t('site.contact_name_ph', 'Your name') }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "text-xs uppercase tracking-wider mb-1.5 block", style: { color: 'var(--site-text-muted)' }, children: "Email" }), /*#__PURE__*/ _jsx("input", { type: "email", value: contactForm.email, onChange: (e)=>setContactForm((f)=>({ ...f, email: e.target.value })), className: "w-full rounded-xl px-4 py-3 text-sm focus:outline-none focus:border-green-500/50 transition", style: { background: 'var(--site-input-bg)', border: '1px solid var(--site-input-border)', color: 'var(--site-input-text)' }, placeholder: t('site.contact_email_ph', 'your@email.com') }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("label", { className: "text-xs uppercase tracking-wider mb-1.5 block", style: { color: 'var(--site-text-muted)' }, children: [ t('site.contact_message', 'Message'), " *" ] }), /*#__PURE__*/ _jsx("textarea", { required: true, rows: 4, value: contactForm.message, onChange: (e)=>setContactForm((f)=>({ ...f, message: e.target.value })), className: "w-full rounded-xl px-4 py-3 text-sm focus:outline-none focus:border-green-500/50 transition resize-none", style: { background: 'var(--site-input-bg)', border: '1px solid var(--site-input-border)', color: 'var(--site-input-text)' }, placeholder: t('site.contact_message_ph', 'Describe your task...') }) ] }), /*#__PURE__*/ _jsxs("button", { type: "submit", disabled: contactLoading, className: "inline-flex items-center gap-2 bg-green-600 hover:bg-green-500 text-white font-medium px-6 py-3 rounded-xl transition disabled:opacity-50", children: [ contactLoading ? /*#__PURE__*/ _jsx("div", { className: "w-4 h-4 rounded-full border-2 border-white/30 border-t-white animate-spin" }) : /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 19l9 2-9-18-9 18 9-2zm0 0v-8" }) }), t('site.contact_send', 'Send') ] }) ] }) ] }), /*#__PURE__*/ _jsx("footer", { className: "border-t pt-8 pb-4", style: { borderColor: 'var(--site-border)' }, children: /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between text-xs", style: { color: 'var(--site-footer-text)' }, children: [ /*#__PURE__*/ _jsx("a", { href: "/", className: "transition", children: "CanHelp.gr" }), /*#__PURE__*/ _jsxs("p", { children: [ "\xa9 ", new Date().getFullYear() ] }) ] }) }) ] }), /*#__PURE__*/ _jsx("button", { onClick: ()=>window.scrollTo({ top: 0, behavior: 'smooth' }), className: "fixed bottom-6 right-6 z-50 w-10 h-10 rounded-full flex items-center justify-center backdrop-blur-sm transition-all duration-300 ".concat(scrolled ? 'opacity-100 translate-y-0' : 'opacity-0 translate-y-4 pointer-events-none'), style: { background: 'var(--site-scroll-btn-bg)', border: '1px solid var(--site-scroll-btn-border)', color: 'var(--site-scroll-btn-text)' }, "aria-label": "Scroll to top", children: /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 15l7-7 7 7" }) }) }) ] }); } `iÁÿÿjÁÿÿ  kÁÿÿ•¿ÿÿBÁÿÿäÁÿÿþóÁÿÿ ôÁÿÿõÁÿÿöÁÿÿ÷Áÿÿeddd138a5001dee9ûÁÿÿ“¿ÿÿ  üÁÿÿ 7ÂÿÿPersonalSitePage •mÿyB9Áÿÿ?Áÿÿ  dÿÿý€ `=@“ a=@“€ A”Í `9€ AÎ `7€ A3 `-€ A4\ `(€ A]ø @›€ Aù, `3 A<ƒÈ A-ƒÈ @è @$óÁÿÿóÁÿÿ a=@“™¿ÿÿ™¿ÿÿ `9@Âÿÿ@Âÿÿ `7EÂÿÿEÂÿÿ `-BÂÿÿBÂÿÿ `(EÂÿÿEÂÿÿ @›wÄÿÿwÄÿÿ `3áIÂÿÿ @è WëÿÿVëÿÿ AV_   EÂÿÿ6Âÿÿ6Âÿÿý b  VÂÿÿUÂÿÿ Aˆ‘  û8Âÿÿ8Âÿÿþ c % . MÂÿÿLÂÿÿ A³œ  ÷2Âÿÿ2Âÿÿþ c  ( >Âÿÿ=Âÿÿ AÔÝ  ó*Âÿÿ*Âÿÿþ c   ÞÁÿÿÝÁÿÿ A   ï~¿ÿÿ~¿ÿÿþ c"* ÚÁÿÿÙÁÿÿ A5=  ëz¿ÿÿz¿ÿÿþ c"* ÖÁÿÿÕÁÿÿ Aiq  çv¿ÿÿv¿ÿÿþ c$, ÒÁÿÿÑÁÿÿ A¢ª  ãr¿ÿÿr¿ÿÿþ c(0 ÎÁÿÿÍÁÿÿ AÛã  ßn¿ÿÿn¿ÿÿþ c(0 ÊÁÿÿÉÁÿÿ A  Ûj¿ÿÿj¿ÿÿþ c$, ÆÁÿÿÅÁÿÿ AJR  ×f¿ÿÿf¿ÿÿþ c*2 ÂÁÿÿÁÁÿÿ A…  Ób¿ÿÿb¿ÿÿþ c*2 ŸÁÿÿœÁÿÿ A   Ï^¿ÿÿ^¿ÿÿþ c08 ºÁÿÿ¹Áÿÿ A6>  ËZ¿ÿÿZ¿ÿÿþ c$, ¶ÁÿÿµÁÿÿ Aks  ÇV¿ÿÿV¿ÿÿþ c$, ²Áÿÿ±Áÿÿ A¢ª  ÃR¿ÿÿR¿ÿÿþ c&. ®Áÿÿ­Áÿÿ AÕÝ  ¿N¿ÿÿN¿ÿÿþ c"* ªÁÿÿ©Áÿÿ A   »J¿ÿÿJ¿ÿÿþ c"* ŠÁÿÿ¥Áÿÿ A6>  ·F¿ÿÿF¿ÿÿþ c ( ¢Áÿÿ¡Áÿÿ Adl  ³B¿ÿÿB¿ÿÿþ c! !( žÁÿÿÁÿÿ AžŠ  ¯>¿ÿÿ>¿ÿÿþ c","4 šÁÿÿ™Áÿÿ AÔÜ  «:¿ÿÿ:¿ÿÿþ c#(#0 –Áÿÿ•Áÿÿ A  §6¿ÿÿ6¿ÿÿþ c$$$, ˜Áÿÿ—Áÿÿ A˜  £2¿ÿÿ2¿ÿÿþ c&&  ”Áÿÿ“Áÿÿ A#  Ÿ.¿ÿÿ.¿ÿÿþ chh  ”getPublicSiteProfileþ AMa  šÙÁÿÿÙÁÿÿþ cjj ‹ÁÿÿŠÁÿÿ AØá  –%¿ÿÿ%¿ÿÿþ cnn  bñÿÿañÿÿ As  ’ÑÁÿÿÑÁÿÿþ cyy" ƒÁÿÿ‚Áÿÿ AFO  Ž¿ÿÿ¿ÿÿþ @Š@Š`  LñÿÿKñÿÿ A€  ŠÉÁÿÿÉÁÿÿþ @Œ@Œ` ëÿÿëÿÿ AZf  †ÅÁÿÿÅÁÿÿþ @™@™` ¥ìÿÿ€ìÿÿ Ap…  ‚ÁÁÿÿÁÁÿÿþ @»`#@»`8 ‹sendMessageþ A¥°  }ÿÿÿŒÁÿÿŒÁÿÿþ @Œ`@Œ` trackSiteMessageþ A×ç  xÿÿÿ·Áÿÿ·Áÿÿþ @œ` @œ` =Âÿÿ<Âÿÿ A›Š  tÿÿÿ¿ÿÿ¿ÿÿþ @Ä` @Ä`+ ÍŸÿÿÌŸÿÿ A^e  pÿÿÿ¯Áÿÿ¯Áÿÿþ @É`@É` aÁÿÿ`Áÿÿ A7!@!  lÿÿÿûŸÿÿûŸÿÿþ @Û@Û`  bÁÿÿcÁÿÿ A¥%©%  hÿÿÿPÁÿÿPÁÿÿþ @ì`&@ì`* :Âÿÿ;Âÿÿ A\&a&  dÿÿÿLÁÿÿLÁÿÿþ @ñ` @ñ`% ZÁÿÿ[Áÿÿ AÎ&Ò&  `ÿÿÿHÁÿÿHÁÿÿþ @ô`@ô`" VÁÿÿWÁÿÿ Aj'n'  \ÿÿÿDÁÿÿDÁÿÿþ @÷`@÷`" .Âÿÿ/Âÿÿ AY(^(  Xÿÿÿ@Áÿÿ@Áÿÿþ @ý`3@ý`8 NÁÿÿOÁÿÿ A.)2)  Tÿÿÿ<Áÿÿ<Áÿÿþ @`@` JÁÿÿKÁÿÿ A* *  Pÿÿÿ8Áÿÿ8Áÿÿþ @`(@`, FÁÿÿGÁÿÿ A.+2+  Lÿÿÿ4Áÿÿ4Áÿÿþ @`,@`0 BÁÿÿCÁÿÿ AX-\-  Hÿÿÿ0Áÿÿ0Áÿÿþ @`@` >Áÿÿ?Áÿÿ A..  Dÿÿÿ,Áÿÿ,Áÿÿþ @`@` ÂÿÿÂÿÿ AÂ5Ç5  @ÿÿÿ(Áÿÿ(Áÿÿþ @-`@-` ÂÿÿÂÿÿ Ap7u7  <ÿÿÿ$Áÿÿ$Áÿÿþ C4²4· 2Áÿÿ3Áÿÿ A`8d8  8ÿÿÿ Áÿÿ Áÿÿþ @8`"@8`& .Áÿÿ/Áÿÿ Aw9{9  4ÿÿÿÁÿÿÁÿÿþ @;`0@;`4 *Áÿÿ+Áÿÿ A§:«:  0ÿÿÿÁÿÿÁÿÿþ @A`4@A`8 &Áÿÿ'Áÿÿ Aå;é;  ,ÿÿÿÁÿÿÁÿÿþ @H`2@H`6 "Áÿÿ#Áÿÿ A=…=  (ÿÿÿÁÿÿÁÿÿþ @N`0@N`4 ÁÿÿÁÿÿ A±>µ>  $ÿÿÿ Áÿÿ Áÿÿþ @T`4@T`8 ÁÿÿÁÿÿ AØ@Ü@   ÿÿÿÁÿÿÁÿÿþ C[ [$ ÁÿÿÁÿÿ AuByB  ÿÿÿÁÿÿÁÿÿþ @a`0@a`4 ÁÿÿÁÿÿ A¥C©C  ÿÿÿÁÿÿÁÿÿþ @g`4@g`8 ÁÿÿÁÿÿ AËDÏD  ÿÿÿüÀÿÿüÀÿÿþ @n`"@n`&  Áÿÿ Áÿÿ AÖFÚF  ÿÿÿøÀÿÿøÀÿÿþ @t`G@t`K ÁÿÿÁÿÿ AHH   ÿÿÿôÀÿÿôÀÿÿþ @z`'@z`+ ÞÁÿÿßÁÿÿ AóHøH  ÿÿÿðÀÿÿðÀÿÿþ @}`(@}`- þÀÿÿÿÀÿÿ A„JˆJ  ÿÿÿìÀÿÿìÀÿÿþ @…`&@…`* úÀÿÿûÀÿÿ A|L€L  ÿÿÿèÀÿÿèÀÿÿþ @`4@`8 öÀÿÿ÷Àÿÿ AÄMÈM  üþÿÿäÀÿÿäÀÿÿþ @“`8@“`< òÀÿÿóÀÿÿ AOO  øþÿÿàÀÿÿàÀÿÿþ @š`&@š`* îÀÿÿïÀÿÿ AÇOËO  ôþÿÿÜÀÿÿÜÀÿÿþ @œ`4@œ`8 êÀÿÿëÀÿÿ AQ!Q  ðþÿÿØÀÿÿØÀÿÿþ @¢`8@¢`< æÀÿÿçÀÿÿ AðRôR  ìþÿÿÔÀÿÿÔÀÿÿþ @©`&@©`* âÀÿÿãÀÿÿ AbTfT  èþÿÿÐÀÿÿÐÀÿÿþ @°`&@°`* ºÁÿÿ»Áÿÿ AäUéU  äþÿÿÌÀÿÿÌÀÿÿþ @·`&@·`+ ¶Áÿÿ·Áÿÿ A‰VŽV  àþÿÿÈÀÿÿÈÀÿÿþ @º`.@º`3 ÖÀÿÿ×Àÿÿ AñWõW  ÜþÿÿÄÀÿÿÄÀÿÿþ @Ÿ`6@Ÿ`: ÒÀÿÿÓÀÿÿ AY…Y  ØþÿÿÀÀÿÿÀÀÿÿþ @Ä`D@Ä`H ªÁÿÿ«Áÿÿ AÒ[×[  ÔþÿÿŒÀÿÿŒÀÿÿþ @Í`.@Í`3 ÊÀÿÿËÀÿÿ Aa"a  ÐþÿÿžÀÿÿžÀÿÿþ @à`6@à`: ÆÀÿÿÇÀÿÿ A®b²b  ÌþÿÿŽÀÿÿŽÀÿÿþ @æ`D@æ`H ÂÀÿÿÃÀÿÿ A†eŠe  Èþÿÿ°Àÿÿ°Àÿÿþ @ô`&@ô`* šÁÿÿ›Áÿÿ Aõfúf  Äþÿÿ¬Àÿÿ¬Àÿÿþ @ü`(@ü`- ºÀÿÿ»Àÿÿ A‚h†h  ÀþÿÿšÀÿÿšÀÿÿþ @`&@`* ¶Àÿÿ·Àÿÿ Aíjñj  Œþÿÿ€Àÿÿ€Àÿÿþ @`4@`8 ²Àÿÿ³Àÿÿ A5l9l  žþÿÿ Àÿÿ Àÿÿþ @`8@`< ŠÁÿÿ‹Áÿÿ Am„m  ŽþÿÿœÀÿÿœÀÿÿþ @`&@`+ †Áÿÿ‡Áÿÿ Ann  °þÿÿ˜Àÿÿ˜Àÿÿþ @`.@`3 ŠÀÿÿ§Àÿÿ AÖnÚn  ¬þÿÿ”Àÿÿ”Àÿÿþ @"`6@"`: ¢Àÿÿ£Àÿÿ Aªo®o  šþÿÿÀÿÿÀÿÿþ @$`D@$`H žÀÿÿŸÀÿÿ A`qdq  €þÿÿŒÀÿÿŒÀÿÿþ @*`H@*`L vÁÿÿwÁÿÿ A£sšs   þÿÿˆÀÿÿˆÀÿÿþ @1`6@1`; –Àÿÿ—Àÿÿ A(t,t  œþÿÿ„Àÿÿ„Àÿÿþ @3`>@3`B ’Àÿÿ“Àÿÿ A.v2v  ˜þÿÿ€Àÿÿ€Àÿÿþ @:`>@:`B jÁÿÿkÁÿÿ Ašx­x  ”þÿÿ|Àÿÿ|Àÿÿþ @E`8@E`= ŠÀÿÿ‹Àÿÿ A`ydy  þÿÿxÀÿÿxÀÿÿþ @H`6@H`: †Àÿÿ‡Àÿÿ ACzGz  ŒþÿÿtÀÿÿtÀÿÿþ @J`D@J`H ‚ÀÿÿƒÀÿÿ Aü{|  ˆþÿÿpÀÿÿpÀÿÿþ @P`H@P`L ~ÀÿÿÀÿÿ A°}Ž}  „þÿÿlÀÿÿlÀÿÿþ @W`6@W`: zÀÿÿ{Àÿÿ AØ~Ü~  €þÿÿhÀÿÿhÀÿÿþ @[`6@[`: vÀÿÿwÀÿÿ Aœ€Á€  |þÿÿdÀÿÿdÀÿÿþ @b`6@b`: NÁÿÿOÁÿÿ A?ƒDƒ  xþÿÿ`Àÿÿ`Àÿÿþ @l`3@l`8 nÀÿÿoÀÿÿ Aöƒúƒ  tþÿÿ\Àÿÿ\Àÿÿþ @o`6@o`: FÁÿÿGÁÿÿ Aí‡ò‡  pþÿÿXÀÿÿXÀÿÿþ @|`6@|`; fÀÿÿgÀÿÿ AЈԈ  lþÿÿTÀÿÿTÀÿÿþ @`>@`B >Áÿÿ?Áÿÿ Ar‹w‹  hþÿÿPÀÿÿPÀÿÿþ @ˆ`>@ˆ`C ^Àÿÿ_Àÿÿ AŽ’  dþÿÿLÀÿÿLÀÿÿþ @`S@`W ZÀÿÿ[Àÿÿ AzŽ~Ž  `þÿÿHÀÿÿHÀÿÿþ @`K@`O VÀÿÿWÀÿÿ Ajn  \þÿÿDÀÿÿDÀÿÿþ @•`T@•`X RÀÿÿSÀÿÿ Aù“ý“  Xþÿÿ@Àÿÿ@Àÿÿþ @§`@§` *Áÿÿ+Áÿÿ A••  Tþÿÿ<Àÿÿ<Àÿÿþ @­`(@­`- JÀÿÿKÀÿÿ AЕԕ  Pþÿÿ8Àÿÿ8Àÿÿþ @°`&@°`* "Áÿÿ#Áÿÿ Ai—n—  Lþÿÿ4Àÿÿ4Àÿÿþ @ž`&@ž`+ ÁÿÿÁÿÿ AV˜[˜  Hþÿÿ0Àÿÿ0Àÿÿþ @»`t@»`y >Àÿÿ?Àÿÿ A™ƙ  Dþÿÿ,Àÿÿ,Àÿÿþ @Á`6@Á`: :Àÿÿ;Àÿÿ Aíšñš  @þÿÿ(Àÿÿ(Àÿÿþ @Å`D@Å`H 6Àÿÿ7Àÿÿ A  <þÿÿ$Àÿÿ$Àÿÿþ @É`6@É`: ÁÿÿÁÿÿ Akžpž  8þÿÿ Àÿÿ Àÿÿþ @Ï`.@Ï`3  Áÿÿ Áÿÿ AŸ Ÿ  4þÿÿÀÿÿÀÿÿþ @Ò`6@Ò`; *Àÿÿ+Àÿÿ A`¡d¡  0þÿÿÀÿÿÀÿÿþ @Ú`>@Ú`B &Àÿÿ'Àÿÿ A$£(£  ,þÿÿÀÿÿÀÿÿþ @à`L@à`P þÀÿÿÿÀÿÿ AžŠœŠ  (þÿÿÀÿÿÀÿÿþ @é`B@é`G MÁÿÿNÁÿÿ AŸŠÇŠ 4$þÿÿ Àÿÿ Àÿÿþ @é`H@é`Q ÀÿÿÀÿÿ AA§E§   þÿÿÀÿÿÀÿÿþ @ë`>@ë`B ÀÿÿÀÿÿ Ajšnš  þÿÿÀÿÿÀÿÿþ @ï`>@ï`B îÀÿÿïÀÿÿ A§ª¬ª  þÿÿÀÿÿÀÿÿþ @õ`b@õ`g ÀÿÿÀÿÿ A•®™®  þÿÿü¿ÿÿü¿ÿÿþ @`N@`R  Àÿÿ Àÿÿ A‹¯¯  þÿÿø¿ÿÿø¿ÿÿþ @`N@`R ÀÿÿÀÿÿ A¹±œ±   þÿÿô¿ÿÿô¿ÿÿþ @ `.@ `2 ÞÀÿÿßÀÿÿ Añ²ö²  þÿÿð¿ÿÿð¿ÿÿþ @`.@`3 þ¿ÿÿÿ¿ÿÿ A.ž2ž  þÿÿì¿ÿÿì¿ÿÿþ @)`6@)`: ú¿ÿÿû¿ÿÿ A¹ƹ  þÿÿè¿ÿÿè¿ÿÿþ @/`D@/`H ÒÀÿÿÓÀÿÿ Aœœ  üýÿÿä¿ÿÿä¿ÿÿþ @=`@=` ò¿ÿÿó¿ÿÿ Ažœ¢œ  øýÿÿà¿ÿÿà¿ÿÿþ @@`"@@`& î¿ÿÿï¿ÿÿ AuŸyŸ  ôýÿÿÜ¿ÿÿÜ¿ÿÿþ @C`"@C`& ê¿ÿÿë¿ÿÿ AN¿R¿  ðýÿÿØ¿ÿÿØ¿ÿÿþ @F`"@F`& ÂÀÿÿÃÀÿÿ Aø¿ý¿  ìýÿÿÔ¿ÿÿÔ¿ÿÿþ @H`0@H`5 ŸÀÿÿ¿Àÿÿ A®À³À  èýÿÿпÿÿпÿÿþ @K`.@K`3 Þ¿ÿÿß¿ÿÿ AiÁmÁ  äýÿÿÌ¿ÿÿÌ¿ÿÿþ @N`6@N`: Ú¿ÿÿÛ¿ÿÿ AšÂžÂ  àýÿÿÈ¿ÿÿÈ¿ÿÿþ @Q`6@Q`: Ö¿ÿÿ׿ÿÿ AÅÅ  ÜýÿÿÄ¿ÿÿÄ¿ÿÿþ @X`T@X`X Ò¿ÿÿÓ¿ÿÿ AóÆ÷Æ  ØýÿÿÀ¿ÿÿÀ¿ÿÿþ C^‘^• οÿÿÏ¿ÿÿ AªÈ®È  ÔýÿÿŒ¿ÿÿŒ¿ÿÿþ @c`D@c`H Ê¿ÿÿË¿ÿÿ AôÉøÉ  Ðýÿÿž¿ÿÿž¿ÿÿþ @i`.@i`2 ¢Àÿÿ£Àÿÿ AëËðË  ÌýÿÿŽ¿ÿÿŽ¿ÿÿþ @p`.@p`3 ¿ÿÿÿÿÿ AûÌÿÌ  Èýÿÿ°¿ÿÿ°¿ÿÿþ @s`i@s`m RÂÿÿQÂÿÿ AÍ Í 4Äýÿÿ6Âÿÿ6Âÿÿþ @s`n@s`w –Àÿÿ—Àÿÿ A•ΚÎ  Àýÿÿš¿ÿÿš¿ÿÿþ Cx‘x– ¶¿ÿÿ·¿ÿÿ AãÏçÏ  Œýÿÿ€¿ÿÿ€¿ÿÿþ @{`>@{`B ŽÀÿÿÀÿÿ A•ÑšÑ  žýÿÿ ¿ÿÿ ¿ÿÿþ @`D@`I ®¿ÿÿ¯¿ÿÿ AçÔëÔ  Žýÿÿœ¿ÿÿœ¿ÿÿþ @`=@`A †Àÿÿ‡Àÿÿ A„Ö‰Ö  °ýÿÿ˜¿ÿÿ˜¿ÿÿþ @–`.@–`3 ‚ÀÿÿƒÀÿÿ A\×a×  ¬ýÿÿ”¿ÿÿ”¿ÿÿþ @™`6@™`; ¢¿ÿÿ£¿ÿÿ AiÙmÙ  šýÿÿ¿ÿÿ¿ÿÿþ @ž`>@ž`B ž¿ÿÿŸ¿ÿÿ ATÛXÛ  €ýÿÿŒ¿ÿÿŒ¿ÿÿþ @€`L@€`P vÀÿÿwÀÿÿ ADÞIÞ   ýÿÿˆ¿ÿÿˆ¿ÿÿþ @­`G@­`L –¿ÿÿ—¿ÿÿ Aáá  œýÿÿ„¿ÿÿ„¿ÿÿþ @¶`>@¶`B ’¿ÿÿ“¿ÿÿ Aÿâã  ˜ýÿÿ€¿ÿÿ€¿ÿÿþ @Œ`L@Œ`P Ž¿ÿÿ¿ÿÿ A¥æ©æ  ”ýÿÿ|¿ÿÿ|¿ÿÿþ @Ì`&@Ì`* Š¿ÿÿ‹¿ÿÿ AŸç£ç  ýÿÿx¿ÿÿx¿ÿÿþ @Ò`(@Ò`, bÀÿÿcÀÿÿ Aè$è  Œýÿÿt¿ÿÿt¿ÿÿþ @Ô`,@Ô`1 ^Àÿÿ_Àÿÿ AÚèßè  ˆýÿÿp¿ÿÿp¿ÿÿþ @×`<@×`A ZÀÿÿ[Àÿÿ Aé†é  „ýÿÿl¿ÿÿl¿ÿÿþ @Ú`2@Ú`7 z¿ÿÿ{¿ÿÿ A`êdê  €ýÿÿh¿ÿÿh¿ÿÿþ @Ý`:@Ý`> v¿ÿÿw¿ÿÿ A—ë›ë  |ýÿÿd¿ÿÿd¿ÿÿþ @á`H@á`L r¿ÿÿs¿ÿÿ AÕíÙí  xýÿÿ`¿ÿÿ`¿ÿÿþ @å`:@å`> n¿ÿÿo¿ÿÿ ADïHï  týÿÿ\¿ÿÿ\¿ÿÿþ @ë`2@ë`6 FÀÿÿGÀÿÿ AJñOñ  pýÿÿX¿ÿÿX¿ÿÿþ @ô`E@ô`J f¿ÿÿg¿ÿÿ Aññõñ  lýÿÿT¿ÿÿT¿ÿÿþ @÷`2@÷`6 b¿ÿÿc¿ÿÿ Aëòïò  hýÿÿP¿ÿÿP¿ÿÿþ @û`2@û`6 :Àÿÿ;Àÿÿ Aîôóô  dýÿÿL¿ÿÿL¿ÿÿþ @`H@`M Z¿ÿÿ[¿ÿÿ A•õ™õ  `ýÿÿH¿ÿÿH¿ÿÿþ @`2@`6 V¿ÿÿW¿ÿÿ A’ö–ö  \ýÿÿD¿ÿÿD¿ÿÿþ @ `2@ `6 .Àÿÿ/Àÿÿ AÍøÒø  Xýÿÿ@¿ÿÿ@¿ÿÿþ @`n@`s N¿ÿÿO¿ÿÿ Atùxù  Týÿÿ<¿ÿÿ<¿ÿÿþ @`2@`6 J¿ÿÿK¿ÿÿ Asúwú  Pýÿÿ8¿ÿÿ8¿ÿÿþ @`2@`6 "Àÿÿ#Àÿÿ Aëüðü  Lýÿÿ4¿ÿÿ4¿ÿÿþ @(`^@(`c ÀÿÿÀÿÿ Aý„ý  Hýÿÿ0¿ÿÿ0¿ÿÿþ @+`"@+`' >¿ÿÿ?¿ÿÿ Aþ#þ  Dýÿÿ,¿ÿÿ,¿ÿÿþ @.`*@.`. :¿ÿÿ;¿ÿÿ A  @ýÿÿ(¿ÿÿ(¿ÿÿþ @7`8@7`< 6¿ÿÿ7¿ÿÿ A”˜  <ýÿÿ$¿ÿÿ$¿ÿÿþ @=`*@=`. 2¿ÿÿ3¿ÿÿ A59  8ýÿÿ ¿ÿÿ ¿ÿÿþ @F`"@F`& .¿ÿÿ/¿ÿÿ A7;  4ýÿÿ¿ÿÿ¿ÿÿþ @J`1@J`5 ÀÿÿÀÿÿ A  0ýÿÿ¿ÿÿ¿ÿÿþ @Q`?@Q`DÿÿÿWÀÿÿ A! 4-ýÿÿ¿ÿÿ¿ÿÿþ @Q`E@Q`N ÿ¿ÿÿÀÿÿ AÌÑ  )ýÿÿ¿ÿÿ¿ÿÿþ @]`@]` û¿ÿÿü¿ÿÿ A¹Ÿ  %ýÿÿ ¿ÿÿ ¿ÿÿþ @``n@``s ÷¿ÿÿø¿ÿÿ A    !ýÿÿ ¿ÿÿ ¿ÿÿþ @b`*@b`/ ¿ÿÿ¿ÿÿ AÒ Ö   ýÿÿ¿ÿÿ¿ÿÿþ @e`2@e`6 ¿ÿÿ¿ÿÿ Aš ž   ýÿÿ¿ÿÿ¿ÿÿþ @g`@@g`D ¿ÿÿ¿ÿÿ A8 <   ýÿÿýŸÿÿýŸÿÿþ @m`D@m`H  ¿ÿÿ ¿ÿÿ Anr  ýÿÿùŸÿÿùŸÿÿþ @t`2@t`6 ¿ÿÿ¿ÿÿ A­±   ýÿÿõŸÿÿõŸÿÿþ @z`*@z`. ß¿ÿÿà¿ÿÿ A/4   ýÿÿñŸÿÿñŸÿÿþ @‹`9@‹`> ÿŸÿÿ¿ÿÿ A  ýÿÿíŸÿÿíŸÿÿþ @’`:@’`> ûŸÿÿüŸÿÿ Acg  ýÿÿéŸÿÿéŸÿÿþ @›`L@›`P ÷ŸÿÿøŸÿÿ AÔØ  ýüÿÿåŸÿÿåŸÿÿþ C£Š£Ž óŸÿÿôŸÿÿ A €  ùüÿÿáŸÿÿáŸÿÿþ @¥`d@¥`h ïŸÿÿðŸÿÿ A‰  õüÿÿÝŸÿÿÝŸÿÿþ @ª`m@ª`q Ç¿ÿÿÈ¿ÿÿ Aâç  ñüÿÿÙŸÿÿÙŸÿÿþ @®`I@®`N ÿÿÿÄ¿ÿÿ AŸ!Ã!  íüÿÿÕŸÿÿÕŸÿÿþ @Ž`J@Ž`O ãŸÿÿäŸÿÿ A!$%$  éüÿÿÑŸÿÿÑŸÿÿþ @»`R@»`V ߟÿÿàŸÿÿ A+&/&  åüÿÿÍŸÿÿÍŸÿÿþ @À`R@À`V ·¿ÿÿž¿ÿÿ A|((  áüÿÿÉŸÿÿÉŸÿÿþ @Ç`J@Ç`O ןÿÿØŸÿÿ A*).)  ÝüÿÿÅŸÿÿÅŸÿÿþ @É`R@É`V ¯¿ÿÿ°¿ÿÿ A±+¶+  ÙüÿÿÁŸÿÿÁŸÿÿþ @Ð`i@Ð`n ÏŸÿÿПÿÿ A@0D0  ÕüÿÿœŸÿÿœŸÿÿþ C߂߆ ËŸÿÿÌŸÿÿ A11  Ñüÿÿ¹Ÿÿÿ¹Ÿÿÿþ @á`]@á`a £¿ÿÿ€¿ÿÿ Aõ2ú2  ÍüÿÿµŸÿÿµŸÿÿþ Cæ“æ˜ ßÿÿÄŸÿÿ A¹4œ4  Éüÿÿ±Ÿÿÿ±Ÿÿÿþ @ì`B@ì`F ¿ŸÿÿÀŸÿÿ Aõ6ù6  Åüÿÿ­Ÿÿÿ­Ÿÿÿþ @ó`B@ó`F —¿ÿÿ˜¿ÿÿ AÄ7É7  Áüÿÿ©Ÿÿÿ©Ÿÿÿþ @õ`q@õ`v ·ŸÿÿžŸÿÿ A1:5:  œüÿÿ¥Ÿÿÿ¥Ÿÿÿþ @ü`R@ü`V ³ŸÿÿŽŸÿÿ A <€<  ¹üÿÿ¡Ÿÿÿ¡Ÿÿÿþ @`R@`V ‹¿ÿÿŒ¿ÿÿ A†=‹=  µüÿÿŸÿÿŸÿÿþ @`x@`} ‡¿ÿÿˆ¿ÿÿ AØ>Ý>  ±üÿÿ™Ÿÿÿ™Ÿÿÿþ @`b@`g §ŸÿÿšŸÿÿ A#@'@  ­üÿÿ•Ÿÿÿ•Ÿÿÿþ @ `j@ `n £Ÿÿÿ€Ÿÿÿ AWC[C  ©üÿÿ‘Ÿÿÿ‘Ÿÿÿþ @`~A‚ {¿ÿÿ|¿ÿÿ A;G@G  ¥üÿÿŸÿÿŸÿÿþ @`A„ w¿ÿÿx¿ÿÿ AjNoN  ¡üÿÿ‰Ÿÿÿ‰Ÿÿÿþ @3`f@3`k s¿ÿÿt¿ÿÿ AËNÐN  üÿÿ…Ÿÿÿ…Ÿÿÿþ @5`*@5`/ “Ÿÿÿ”Ÿÿÿ AƒO‡O  ™üÿÿŸÿÿŸÿÿþ @8`2@8`6 ŸÿÿŸÿÿ ALPPP  •üÿÿ}Ÿÿÿ}Ÿÿÿþ @:`@@:`D ‹ŸÿÿŒŸÿÿ AìQðQ  ‘üÿÿyŸÿÿyŸÿÿþ @@`D@@`H ‡ŸÿÿˆŸÿÿ ATT  üÿÿuŸÿÿuŸÿÿþ @G`2@G`6 _¿ÿÿ`¿ÿÿ AUU  ‰üÿÿqŸÿÿqŸÿÿþ @K`2@K`7 Ÿÿÿ€Ÿÿÿ AŸWÂW  …üÿÿmŸÿÿmŸÿÿþ @X`*@X`. W¿ÿÿX¿ÿÿ AìXñX  üÿÿiŸÿÿiŸÿÿþ @\`9@\`> wŸÿÿxŸÿÿ AU[Y[  }üÿÿeŸÿÿeŸÿÿþ @d`K@d`O sŸÿÿtŸÿÿ A(],]  yüÿÿaŸÿÿaŸÿÿþ @i`:@i`> oŸÿÿpŸÿÿ Aa^e^  uüÿÿ]Ÿÿÿ]Ÿÿÿþ @k`V@k`Z kŸÿÿlŸÿÿ Aœ_Á_  qüÿÿYŸÿÿYŸÿÿþ @p`:@p`> gŸÿÿhŸÿÿ Að`ô`  müÿÿUŸÿÿUŸÿÿþ @r`H@r`L cŸÿÿdŸÿÿ AÂbÆb  iüÿÿQŸÿÿQŸÿÿþ @x`L@x`P ;¿ÿÿ<¿ÿÿ A¿eÄe  eüÿÿMŸÿÿMŸÿÿþ @…`b@…`g 7¿ÿÿ8¿ÿÿ A f%f  aüÿÿIŸÿÿIŸÿÿþ @‡`*@‡`/ WŸÿÿXŸÿÿ AØfÜf  ]üÿÿEŸÿÿEŸÿÿþ @Š`2@Š`6 SŸÿÿTŸÿÿ A g€g  YüÿÿAŸÿÿAŸÿÿþ @Œ`@@Œ`D OŸÿÿPŸÿÿ A?iCi  Uüÿÿ=Ÿÿÿ=Ÿÿÿþ @’`D@’`H KŸÿÿLŸÿÿ A0l4l  Qüÿÿ9Ÿÿÿ9Ÿÿÿþ @™`2@™`6 GŸÿÿHŸÿÿ A&m*m  Müÿÿ5Ÿÿÿ5Ÿÿÿþ @`2@`6 CŸÿÿDŸÿÿ Aûnÿn  Iüÿÿ1Ÿÿÿ1Ÿÿÿþ @Š`*@Š`. ¿ÿÿ¿ÿÿ A‚q‡q  Eüÿÿ-Ÿÿÿ-Ÿÿÿþ @¯`9@¯`> ¿ÿÿ¿ÿÿ AHsMs  Aüÿÿ)Ÿÿÿ)Ÿÿÿþ @¶`:@¶`? 7Ÿÿÿ8Ÿÿÿ A/t3t  =üÿÿ%Ÿÿÿ%Ÿÿÿþ @¹`B@¹`F 3Ÿÿÿ4Ÿÿÿ A€v„v  9üÿÿ!Ÿÿÿ!Ÿÿÿþ @¿`e@¿`i  ¿ÿÿ ¿ÿÿ Aëyðy  5üÿÿŸÿÿŸÿÿþ @Å`B@Å`G ¿ÿÿ¿ÿÿ AÝzâz  1üÿÿŸÿÿŸÿÿþ @È`J@È`O 'Ÿÿÿ(Ÿÿÿ A||  -üÿÿŸÿÿŸÿÿþ @Ë`R@Ë`V #Ÿÿÿ$Ÿÿÿ AÍ~Ñ~  )üÿÿŸÿÿŸÿÿþ @Ò`R@Ò`V Ÿÿÿ Ÿÿÿ Aíñ  %üÿÿ Ÿÿÿ Ÿÿÿþ @Û`J@Û`N ŸÿÿŸÿÿ A_ƒcƒ  !üÿÿ Ÿÿÿ Ÿÿÿþ @ß`]@ß`a ŸÿÿŸÿÿ AS†W†  üÿÿŸÿÿŸÿÿþ @æ``@æ`d ŸÿÿŸÿÿ AŠŠ  üÿÿŸÿÿŸÿÿþ @ï`L@ï`P ëŸÿÿìŸÿÿ A“Œ˜Œ  üÿÿýœÿÿýœÿÿþ @ü`"@ü`' çŸÿÿèŸÿÿ A   üÿÿùœÿÿùœÿÿþ @ÿ`*@ÿ`/ ŸÿÿŸÿÿ AӍ׍   üÿÿõœÿÿõœÿÿþ @`2@`6 ŸÿÿŸÿÿ AŽ¡Ž   üÿÿñœÿÿñœÿÿþ @`@@`D ÿœÿÿŸÿÿ A>B  üÿÿíœÿÿíœÿÿþ @ `D@ `H ûœÿÿüœÿÿ A,’0’  üÿÿéœÿÿéœÿÿþ @`2@`6 ÓŸÿÿÔŸÿÿ Av“{“  ýûÿÿåœÿÿåœÿÿþ @`8@`= óœÿÿôœÿÿ A\”`”  ùûÿÿáœÿÿáœÿÿþ @`2@`6 ïœÿÿðœÿÿ A7•;•  õûÿÿÝœÿÿÝœÿÿþ @`@@`D ëœÿÿìœÿÿ Aؖܖ  ñûÿÿÙœÿÿÙœÿÿþ @"`D@"`H çœÿÿèœÿÿ Ap˜t˜  íûÿÿÕœÿÿÕœÿÿþ @)`2@)`6 ãœÿÿäœÿÿ Aƒ™‡™  éûÿÿÑœÿÿÑœÿÿþ @-`2@-`6 »ŸÿÿŒŸÿÿ Ak›p›  åûÿÿÍœÿÿÍœÿÿþ @5`/@5`4 ·ŸÿÿžŸÿÿ ACH  áûÿÿÉœÿÿÉœÿÿþ @=`2@=`7 ³ŸÿÿŽŸÿÿ Ažž  ÝûÿÿÅœÿÿÅœÿÿþ @@`:@@`? ¯Ÿÿÿ°Ÿÿÿ Až¢ž  ÙûÿÿÁœÿÿÁœÿÿþ @B`B@B`G ÏœÿÿМÿÿ A¡“¡  Õûÿÿœœÿÿœœÿÿþ @L`B@L`F §ŸÿÿšŸÿÿ AG§L§  Ñûÿÿ¹œÿÿ¹œÿÿþ @^`:@^`? ÇœÿÿÈœÿÿ AÔ§ا  Íûÿÿµœÿÿµœÿÿþ @``B@``F ÜÿÿÄœÿÿ Aô©ø©  Éûÿÿ±œÿÿ±œÿÿþ @g`B@g`F ›ŸÿÿœŸÿÿ A¶¯»¯  Åûÿÿ­œÿÿ­œÿÿþ @z`2@z`7 —Ÿÿÿ˜Ÿÿÿ A3°8°  Áûÿÿ©œÿÿ©œÿÿþ @|`:@|`? ·œÿÿžœÿÿ A۲߲  œûÿÿ¥œÿÿ¥œÿÿþ @†`:@†`> ŸÿÿŸÿÿ A"ž'ž  ¹ûÿÿ¡œÿÿ¡œÿÿþ @˜`2@˜`7 ¯œÿÿ°œÿÿ Aí¹ñ¹  µûÿÿœÿÿœÿÿþ @`K@`O «œÿÿ¬œÿÿ AÁºź  ±ûÿÿ™œÿÿ™œÿÿþ @Ÿ`?@Ÿ`C §œÿÿšœÿÿ AiŒmŒ  ­ûÿÿ•œÿÿ•œÿÿþ @¥`H@¥`L £œÿÿ€œÿÿ AÿŸ¿  ©ûÿÿ‘œÿÿ‘œÿÿþ @²`"@²`& {Ÿÿÿ|Ÿÿÿ Aó¿ø¿  ¥ûÿÿœÿÿœÿÿþ @·`0@·`5 ›œÿÿœœÿÿ A1Á5Á  ¡ûÿÿ‰œÿÿ‰œÿÿþ @œ`.@œ`2 sŸÿÿtŸÿÿ A6Â;  ûÿÿ…œÿÿ…œÿÿþ @Â`.@Â`3 “œÿÿ”œÿÿ AºÃŸÃ  ™ûÿÿœÿÿœÿÿþ @Í`@Í` œÿÿœÿÿ AœÆ Æ  •ûÿÿ}œÿÿ}œÿÿþ @Ù`(@Ù`, ‹œÿÿŒœÿÿ AœÇ Ç  ‘ûÿÿyœÿÿyœÿÿþ @ß`,@ß`0 öºÿÿ úºÿÿ_Œÿÿûºÿÿüºÿÿ¶/opt/canhelp/apps/web/src/components/UpgradePrompt.tsx€€ ýºÿÿ=»ÿÿ>»ÿÿ¢./src/components/UpgradePrompt.tsxÿÿ @‰ `1–mÿyBý?»ÿÿC»ÿÿ!€=‚mÿyBp=‚mÿyB95bac6c00960eeffD»ÿÿ` E»ÿÿÇ/opt/canhelp/apps/web/opt/canhelp/apps/web/src/components/UpgradePromptÊ/opt/canhelp/apps/web/opt/canhelp/apps/web/src/components/UpgradePrompt.jsË/opt/canhelp/apps/web/opt/canhelp/apps/web/src/components/UpgradePrompt.mjsË/opt/canhelp/apps/web/opt/canhelp/apps/web/src/components/UpgradePrompt.tsxÊ/opt/canhelp/apps/web/opt/canhelp/apps/web/src/components/UpgradePrompt.tsË/opt/canhelp/apps/web/opt/canhelp/apps/web/src/components/UpgradePrompt.jsxÌ/opt/canhelp/apps/web/opt/canhelp/apps/web/src/components/UpgradePrompt.jsonÌ/opt/canhelp/apps/web/opt/canhelp/apps/web/src/components/UpgradePrompt.wasmK»ÿÿ²/opt/canhelp/apps/web/src/components/UpgradePromptµ/opt/canhelp/apps/web/src/components/UpgradePrompt.js¶/opt/canhelp/apps/web/src/components/UpgradePrompt.mjs† W»ÿÿlŒÿÿ  £import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import Link from 'next/link'; const tierLabels = { free: 'Free', pro: 'Pro', ultimate: 'Ultimate' }; const tierColors = { free: 'bg-gray-50 border-gray-200 text-gray-700', pro: 'bg-green-50 border-green-200 text-gray-800', ultimate: 'bg-amber-50 border-amber-200 text-amber-800' }; const tierBtnColors = { free: 'bg-gray-600 hover:bg-gray-700 text-white', pro: 'bg-green-600 hover:bg-green-700 text-white', ultimate: 'bg-amber-500 hover:bg-amber-600 text-white' }; export function UpgradePrompt(param) { let { feature, requiredTier, variant = 'inline', t, className = '' } = param; const tierLabel = tierLabels[requiredTier]; if (variant === 'banner') { return /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between gap-3 rounded-xl border px-4 py-3 ".concat(tierColors[requiredTier], " ").concat(className), children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 min-w-0", children: [ /*#__PURE__*/ _jsx(LockIcon, { className: "w-4 h-4 shrink-0 opacity-60" }), /*#__PURE__*/ _jsxs("span", { className: "text-sm font-medium truncate", children: [ feature, " — ", t('upgrade.available_in', 'Available in'), " ", /*#__PURE__*/ _jsx("b", { children: tierLabel }) ] }) ] }), /*#__PURE__*/ _jsx(Link, { href: "/pricing?highlight=".concat(requiredTier), className: "shrink-0 text-xs font-semibold px-3 py-1.5 rounded-lg transition ".concat(tierBtnColors[requiredTier]), children: t('upgrade.cta', 'Upgrade') }) ] }); } if (variant === 'block') { return /*#__PURE__*/ _jsxs("div", { className: "rounded-2xl border p-6 text-center ".concat(tierColors[requiredTier], " ").concat(className), children: [ /*#__PURE__*/ _jsx(LockIcon, { className: "w-8 h-8 mx-auto mb-3 opacity-40" }), /*#__PURE__*/ _jsx("p", { className: "font-semibold text-base mb-1", children: feature }), /*#__PURE__*/ _jsxs("p", { className: "text-sm opacity-70 mb-4", children: [ t('upgrade.available_in', 'Available in plan'), " ", /*#__PURE__*/ _jsx("b", { children: tierLabel }) ] }), /*#__PURE__*/ _jsx(Link, { href: "/pricing?highlight=".concat(requiredTier), className: "inline-block text-sm font-semibold px-5 py-2 rounded-xl transition ".concat(tierBtnColors[requiredTier]), children: t('upgrade.cta', 'Upgrade plan') }) ] }); } // inline variant return /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 text-sm ".concat(className), children: [ /*#__PURE__*/ _jsx(LockIcon, { className: "w-4 h-4 text-gray-400 shrink-0" }), /*#__PURE__*/ _jsxs("span", { className: "text-gray-500", children: [ t('upgrade.available_in', 'Available in'), " ", /*#__PURE__*/ _jsx("b", { className: "text-gray-700", children: tierLabel }), ".", ' ', /*#__PURE__*/ _jsx(Link, { href: "/pricing?highlight=".concat(requiredTier), className: "text-green-600 hover:underline", children: t('upgrade.cta', 'Upgrade') }) ] }) ] }); } function LockIcon(param) { let { className = '' } = param; return /*#__PURE__*/ _jsx("svg", { viewBox: "0 0 20 20", fill: "currentColor", className: className, children: /*#__PURE__*/ _jsx("path", { fillRule: "evenodd", d: "M10 1a4.5 4.5 0 00-4.5 4.5V9H5a2 2 0 00-2 2v6a2 2 0 002 2h10a2 2 0 002-2v-6a2 2 0 00-2-2h-.5V5.5A4.5 4.5 0 0010 1zm3 8V5.5a3 3 0 10-6 0V9h6z", clipRule: "evenodd" }) }); } `³Œÿÿ¶Œÿÿ ·Œÿÿáºÿÿ)»ÿÿ0œÿÿþ?œÿÿ @œÿÿAœÿÿBœÿÿCœÿÿ1d4afed4addb336cGœÿÿߺÿÿ  Hœÿÿ ˆLockIconŠtierLabelsŠtierColorsWÄÿÿüíÿÿ •mÿyBßã  dÿÿý€ `? `?€ a@] ` A<Œ A5Œ cm `GœÿÿGœÿÿ `?—œÿÿ—œÿÿ `ííÿÿííÿÿ cm /Ÿÿÿ0Ÿÿÿ A    éíÿÿ@œÿÿ@œÿÿý c" *Ÿÿÿ+Ÿÿÿ A÷ü  û<œÿÿ<œÿÿþ c# JœÿÿKœÿÿ AŽ’  ÷8œÿÿ8œÿÿþ c&* "Ÿÿÿ#Ÿÿÿ A&+  ó4œÿÿ4œÿÿþ c&+ BœÿÿCœÿÿ A“—  ï0œÿÿ0œÿÿþ c&.&2 >œÿÿ?œÿÿ A{  ë,œÿÿ,œÿÿþ c--" ˆœÿÿŸÿÿ A€„ 4çyœÿÿyœÿÿþ c-#-' ŸÿÿŸÿÿ Aÿ   ã$œÿÿ$œÿÿþ c66" 2œÿÿ3œÿÿ Aº Ÿ   ß œÿÿ œÿÿþ c99" .œÿÿ/œÿÿ A> B   Ûœÿÿœÿÿþ c<<" ŸÿÿŸÿÿ Aá æ   לÿÿœÿÿþ c@@# &œÿÿ'œÿÿ AÓ ×   Óœÿÿœÿÿþ cE&E* "œÿÿ#œÿÿ Ar v   Ïœÿÿœÿÿþ cJJ"ädŸÿÿ Aw {  4Ì^œÿÿ^œÿÿþ cJ#J' ÷œÿÿøœÿÿ Að õ   È œÿÿ œÿÿþ cSS œÿÿœÿÿ Avz  Äœÿÿœÿÿþ cVV ïœÿÿðœÿÿ Aíò  Àœÿÿœÿÿþ cYY œÿÿœÿÿ A¿Ã  ŒýŒÿÿýŒÿÿþ c^"^&  œÿÿ œÿÿ A—›  žùŒÿÿùŒÿÿþ cd"d&ÍMŸÿÿ Aœ  4µGœÿÿGœÿÿþ cd'd+ œÿÿœÿÿ A   šíÿÿñŒÿÿñŒÿÿý cpp ÿŒÿÿœÿÿ A¡  ûíŒÿÿíŒÿÿþ ct t$ —webpack/lib/ModuleGraph“RestoreProvidedDatatºÿÿˆprovidedcanMangleProvideterminalBinding‹exportsInfoÖŒÿÿ ü>œÿÿ ù;œÿÿ ö8œÿÿ ó5œÿÿ ð2œÿÿ í/œÿÿ ê,œÿÿ ç)œÿÿ ä&œÿÿ á#œÿÿ Þkíÿÿ ‡sources“runtimeRequirements„dataŠjavascript«webpack/lib/util/registerExternalSerializerœwebpack-sources/CachedSource («webpack/lib/util/registerExternalSerializerœwebpack-sources/ConcatSource€«webpack/lib/util/registerExternalSerializer™webpack-sources/RawSourcek/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ ScrollToTopButton: () => (/* binding */ ScrollToTopButton) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); «webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourceç/* __next_internal_client_entry_do_not_use__ ScrollToTopButton auto */ import { jsx as _jsx } from "react/jsx-runtime"; import { useEffect, useState } from 'react'; export function ScrollToTopButton() { const [visible, setVisible] = useState(false); useEffect(()=>{ const onScroll = ()=>{ setVisible(window.scrollY > 200); }; window.addEventListener('scroll', onScroll); return ()=>window.removeEventListener('scroll', onScroll); }, []); return /*#__PURE__*/ _jsx("button", { className: "scroll-to-top-btn".concat(visible ? ' visible' : ''), "aria-label": "Back to top", onClick: ()=>window.scrollTo({ top: 0, behavior: 'smooth' }), children: /*#__PURE__*/ _jsx("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /*#__PURE__*/ _jsx("path", { d: "M10 16V4M10 4L4 10M10 4L16 10", stroke: "white", strokeWidth: "2.8", strokeLinecap: "round", strokeLinejoin: "round" }) }) }); } bGvxL£¥«íô  ë€¯(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)°(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)¶(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)ÿÿeŒÿÿ†source„size„maps‰ºÿÿÓ/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ ScrollToTopButton: () => (/* binding */ ScrollToTopButton) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* __next_internal_client_entry_do_not_use__ ScrollToTopButton auto */ function ScrollToTopButton() { const [visible, setVisible] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ const onScroll = ()=>{ setVisible(window.scrollY > 200); }; window.addEventListener('scroll', onScroll); return ()=>window.removeEventListener('scroll', onScroll); }, []); return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { className: "scroll-to-top-btn".concat(visible ? ' visible' : ''), "aria-label": "Back to top", onClick: ()=>window.scrollTo({ top: 0, behavior: 'smooth' }), children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M10 16V4M10 4L4 10M10 4L16 10", stroke: "white", strokeWidth: "2.8", strokeLinecap: "round", strokeLinejoin: "round" }) }) }); } ”{"finalSource":true}ƒmap‹bufferedMap ConcatSourceRawSourcek/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ ScrollToTopButton: () => (/* binding */ ScrollToTopButton) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); ReplaceSourceRawSourceŒÿÿz71118undefined120163undefined165171undefined237244(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined258266(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined519522(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined793796(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined10031006(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined “__webpack_require__˜Œÿÿ•__webpack_require__.dŒÿÿçè ž¹«webpack/lib/util/registerExternalSerializerœwebpack-sources/ConcatSource€«webpack/lib/util/registerExternalSerializer™webpack-sources/RawSource¿__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ ChatPage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7541); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(9664); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(next_link__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(1592); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(9906); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(2982); /* harmony import */ var _lib_formatName__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(1258); /* harmony import */ var socket_io_client__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(2838); «webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSource4ª/* __next_internal_client_entry_do_not_use__ default auto */ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime"; import { useState, useEffect, useRef, useCallback, Suspense } from 'react'; import { useRouter, useSearchParams } from 'next/navigation'; import Link from 'next/link'; import { useSession } from '@/lib/auth'; import { useLocale } from '@/context/locale'; import { getChatRooms, getMessages, getDailyUsage } from '@/lib/api'; import { formatShortName } from '@/lib/formatName'; import { io } from 'socket.io-client'; const API_URL = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; function ChatPageInner() { var _session_user, _activeRoom_task, _activeRoom_otherUser, _activeRoom_otherUser1, _activeRoom_otherUser2; const router = useRouter(); const searchParams = useSearchParams(); const { data: session, isPending } = useSession(); const { t, locale } = useLocale(); const [rooms, setRooms] = useState([]); const [loadingRooms, setLoadingRooms] = useState(true); const [activeRoomId, setActiveRoomId] = useState(null); const [messages, setMessages] = useState([]); const [loadingMessages, setLoadingMessages] = useState(false); const [input, setInput] = useState(''); const [connected, setConnected] = useState(false); const [msgLimit, setMsgLimit] = useState(null); const [uploadingImage, setUploadingImage] = useState(false); const [lightboxUrl, setLightboxUrl] = useState(null); const socketRef = useRef(null); const messagesEndRef = useRef(null); const inputRef = useRef(null); const fileInputRef = useRef(null); useEffect(()=>{ if (!isPending && !session) router.push('/login'); }, [ session, isPending ]); // Load chat rooms useEffect(()=>{ if (!session) return; getChatRooms().then((data)=>{ setRooms(data); const roomParam = searchParams.get('room'); if (roomParam) setActiveRoomId(roomParam); }).catch((err)=>console.error('[chat] getChatRooms error:', err)).finally(()=>setLoadingRooms(false)); getDailyUsage().then((u)=>setMsgLimit({ left: u.messagesLeft, sent: u.messagesSent })).catch((err)=>console.error('[chat] getDailyUsage error:', err)); }, [ session ]); // Setup Socket.IO useEffect(()=>{ if (!session) return; const socket = io(API_URL, { withCredentials: true, transports: [ 'websocket', 'polling' ] }); socketRef.current = socket; socket.on('connect', ()=>setConnected(true)); socket.on('disconnect', ()=>setConnected(false)); socket.on('new_message', (msg)=>{ setMessages((prev)=>{ // avoid duplicate if we get it back from our own send if (prev.some((m)=>m.message.id === msg.id)) return prev; var _session_user_name, _session_user_image; // sender info: only known for current user; others show placeholder (? avatar) const sender = session.user && session.user.id === msg.senderId ? { id: session.user.id, name: (_session_user_name = session.user.name) !== null && _session_user_name !== void 0 ? _session_user_name : '', image: (_session_user_image = session.user.image) !== null && _session_user_image !== void 0 ? _session_user_image : undefined } : null; return [ ...prev, { message: msg, sender } ]; }); // Update lastMessage in rooms list and bubble room to top setRooms((prev)=>{ const updated = prev.map((r)=>{ var _msg_translations, _msg_imageUrl; return r.room.id === msg.roomId ? { ...r, lastMessage: { body: msg.body, createdAt: msg.createdAt, translations: (_msg_translations = msg.translations) !== null && _msg_translations !== void 0 ? _msg_translations : null, imageUrl: (_msg_imageUrl = msg.imageUrl) !== null && _msg_imageUrl !== void 0 ? _msg_imageUrl : null } } : r; }); return updated.sort((a, b)=>{ var _a_lastMessage, _b_lastMessage; const aTime = ((_a_lastMessage = a.lastMessage) === null || _a_lastMessage === void 0 ? void 0 : _a_lastMessage.createdAt) ? new Date(a.lastMessage.createdAt).getTime() : new Date(a.room.createdAt).getTime(); const bTime = ((_b_lastMessage = b.lastMessage) === null || _b_lastMessage === void 0 ? void 0 : _b_lastMessage.createdAt) ? new Date(b.lastMessage.createdAt).getTime() : new Date(b.room.createdAt).getTime(); return bTime - aTime; }); }); }); socket.on('message_translated', (param)=>{ let { id, roomId, translations } = param; setMessages((prev)=>prev.map((m)=>m.message.id === id ? { ...m, message: { ...m.message, translations } } : m)); // Also update lastMessage in sidebar if this is the last message of that room if (roomId) { setRooms((prev)=>prev.map((r)=>r.room.id === roomId && r.lastMessage ? { ...r, lastMessage: { ...r.lastMessage, translations } } : r)); } }); return ()=>{ socket.disconnect(); socketRef.current = null; }; }, [ session ]); // Join room and load messages when activeRoomId changes useEffect(()=>{ var _socketRef_current, _socketRef_current1; if (!activeRoomId) return; setLoadingMessages(true); setMessages([]); getMessages(activeRoomId).then(setMessages).catch((err)=>console.error('[chat] getMessages error:', err)).finally(()=>setLoadingMessages(false)); (_socketRef_current = socketRef.current) === null || _socketRef_current === void 0 ? void 0 : _socketRef_current.emit('join_room', activeRoomId); (_socketRef_current1 = socketRef.current) === null || _socketRef_current1 === void 0 ? void 0 : _socketRef_current1.emit('mark_read', activeRoomId); }, [ activeRoomId ]); // Focus input when active room changes useEffect(()=>{ if (!activeRoomId) return; const t = setTimeout(()=>{ var _inputRef_current; return (_inputRef_current = inputRef.current) === null || _inputRef_current === void 0 ? void 0 : _inputRef_current.focus(); }, 50); return ()=>clearTimeout(t); }, [ activeRoomId ]); // Auto-scroll on new messages (within container only) useEffect(()=>{ var _messagesEndRef_current; (_messagesEndRef_current = messagesEndRef.current) === null || _messagesEndRef_current === void 0 ? void 0 : _messagesEndRef_current.scrollIntoView({ behavior: 'smooth', block: 'nearest' }); }, [ messages ]); // Close lightbox on Escape useEffect(()=>{ const onKey = (e)=>{ if (e.key === 'Escape') setLightboxUrl(null); }; window.addEventListener('keydown', onKey); return ()=>window.removeEventListener('keydown', onKey); }, []); const sendMessage = useCallback(()=>{ const body = input.trim(); if (!body || !activeRoomId || !socketRef.current) return; if (msgLimit && msgLimit.left !== null && msgLimit.left <= 0) return; socketRef.current.emit('send_message', { roomId: activeRoomId, body, locale }); setInput(''); // decrement local counter setMsgLimit((prev)=>prev && prev.left !== null ? { ...prev, left: prev.left - 1, sent: prev.sent + 1 } : prev); }, [ input, activeRoomId, msgLimit ]); const uploadAndSendImage = useCallback(async (file)=>{ if (!activeRoomId || !socketRef.current) return; setUploadingImage(true); try { const formData = new FormData(); formData.append('file', file); const res = await fetch("".concat(API_URL, "/api/uploads"), { method: 'POST', credentials: 'include', body: formData }); if (!res.ok) throw new Error('Upload failed'); const { url } = await res.json(); socketRef.current.emit('send_message', { roomId: activeRoomId, body: '', imageUrl: url, locale }); } catch (_) { // silent } finally{ setUploadingImage(false); if (fileInputRef.current) fileInputRef.current.value = ''; } }, [ activeRoomId, locale ]); const handleKeyDown = (e)=>{ if (e.key === 'Enter' && !e.shiftKey) { e.preventDefault(); sendMessage(); } }; const LOCALE_TAG = { ru: 'ru-RU', en: 'en-US', el: 'el-GR' }; var _LOCALE_TAG_locale; const localeTag = (_LOCALE_TAG_locale = LOCALE_TAG[locale]) !== null && _LOCALE_TAG_locale !== void 0 ? _LOCALE_TAG_locale : 'el-GR'; function fmtMsgTime(iso) { const d = new Date(iso); const now = new Date(); const diffMin = Math.floor((now.getTime() - d.getTime()) / 60000); if (diffMin < 1) return t('chat.just_now'); if (diffMin < 60) return "".concat(diffMin).concat(t('chat.min_ago')); if (d.toDateString() === now.toDateString()) return d.toLocaleTimeString(localeTag, { hour: '2-digit', minute: '2-digit' }); return d.toLocaleDateString(localeTag, { day: '2-digit', month: '2-digit' }); } if (isPending || loadingRooms) { return /*#__PURE__*/ _jsx("div", { className: "text-center py-20 text-white", children: t('common.loading') }); } const activeRoom = rooms.find((r)=>r.room.id === activeRoomId); const currentUserId = session === null || session === void 0 ? void 0 : (_session_user = session.user) === null || _session_user === void 0 ? void 0 : _session_user.id; var _activeRoom_task_title; return /*#__PURE__*/ _jsxs("div", { className: "max-w-5xl mx-auto px-4 py-6 h-[calc(100vh-80px)] flex gap-4", children: [ /*#__PURE__*/ _jsxs("div", { className: "w-72 flex-shrink-0 bg-white rounded-xl border border-gray-200 overflow-hidden flex flex-col", children: [ /*#__PURE__*/ _jsxs("div", { className: "p-4 border-b border-gray-100", children: [ /*#__PURE__*/ _jsx("h1", { className: "font-bold text-gray-900 text-lg", children: t('nav.chat') }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-1.5 mt-1", children: [ /*#__PURE__*/ _jsx("span", { className: "w-2 h-2 rounded-full ".concat(connected ? 'bg-green-400' : 'bg-gray-300') }), /*#__PURE__*/ _jsx("span", { className: "text-xs text-gray-400", children: connected ? t('chat.connected') : t('chat.disconnected') }) ] }) ] }), /*#__PURE__*/ _jsx("div", { className: "flex-1 overflow-y-auto", children: rooms.length === 0 ? /*#__PURE__*/ _jsx("div", { className: "p-6 text-center text-gray-400 text-sm", children: t('chat.no_rooms') }) : rooms.map((param)=>{ let { room, task, otherUser, lastMessage } = param; var _lastMessage_translations; var _task_title; const roomLabel = (_task_title = task === null || task === void 0 ? void 0 : task.title) !== null && _task_title !== void 0 ? _task_title : formatShortName(otherUser === null || otherUser === void 0 ? void 0 : otherUser.firstName, otherUser === null || otherUser === void 0 ? void 0 : otherUser.lastName, otherUser === null || otherUser === void 0 ? void 0 : otherUser.name) || t('chat.direct_chat'); const roomSub = task ? formatShortName(otherUser === null || otherUser === void 0 ? void 0 : otherUser.firstName, otherUser === null || otherUser === void 0 ? void 0 : otherUser.lastName, otherUser === null || otherUser === void 0 ? void 0 : otherUser.name) || '' : t('chat.direct_chat'); var _lastMessage_translations_locale; return /*#__PURE__*/ _jsxs("button", { onClick: ()=>{ setActiveRoomId(room.id); setTimeout(()=>{ var _inputRef_current; return (_inputRef_current = inputRef.current) === null || _inputRef_current === void 0 ? void 0 : _inputRef_current.focus(); }, 50); }, className: "w-full text-left px-4 py-3 border-b border-gray-50 hover:bg-gray-50 transition ".concat(activeRoomId === room.id ? 'bg-green-50 border-l-2 border-l-green-500' : ''), children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-start justify-between gap-1", children: [ /*#__PURE__*/ _jsx("p", { className: "text-sm font-medium text-gray-800 line-clamp-1 flex-1", children: roomLabel }), lastMessage && /*#__PURE__*/ _jsx("span", { className: "text-[10px] text-gray-400 shrink-0 mt-0.5", children: fmtMsgTime(lastMessage.createdAt) }) ] }), lastMessage ? /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-0.5 line-clamp-1", children: lastMessage.imageUrl && !lastMessage.body ? '📷' : (_lastMessage_translations_locale = (_lastMessage_translations = lastMessage.translations) === null || _lastMessage_translations === void 0 ? void 0 : _lastMessage_translations[locale]) !== null && _lastMessage_translations_locale !== void 0 ? _lastMessage_translations_locale : lastMessage.body }) : task ? /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-0.5 line-clamp-1", children: roomSub }) : null ] }, room.id); }) }) ] }), /*#__PURE__*/ _jsx("div", { className: "flex-1 bg-white rounded-xl border border-gray-200 flex flex-col overflow-hidden", children: !activeRoomId ? /*#__PURE__*/ _jsx("div", { className: "flex-1 flex items-center justify-center text-gray-400 text-sm", children: t('chat.select') }) : /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx("div", { className: "px-5 py-4 border-b border-gray-100", children: /*#__PURE__*/ _jsx("p", { className: "font-semibold text-gray-800 text-sm", children: (_activeRoom_task_title = activeRoom === null || activeRoom === void 0 ? void 0 : (_activeRoom_task = activeRoom.task) === null || _activeRoom_task === void 0 ? void 0 : _activeRoom_task.title) !== null && _activeRoom_task_title !== void 0 ? _activeRoom_task_title : formatShortName(activeRoom === null || activeRoom === void 0 ? void 0 : (_activeRoom_otherUser = activeRoom.otherUser) === null || _activeRoom_otherUser === void 0 ? void 0 : _activeRoom_otherUser.firstName, activeRoom === null || activeRoom === void 0 ? void 0 : (_activeRoom_otherUser1 = activeRoom.otherUser) === null || _activeRoom_otherUser1 === void 0 ? void 0 : _activeRoom_otherUser1.lastName, activeRoom === null || activeRoom === void 0 ? void 0 : (_activeRoom_otherUser2 = activeRoom.otherUser) === null || _activeRoom_otherUser2 === void 0 ? void 0 : _activeRoom_otherUser2.name) || t('chat.direct_chat') }) }), (activeRoom === null || activeRoom === void 0 ? void 0 : activeRoom.task) && /*#__PURE__*/ _jsxs(Link, { href: "/tasks/".concat(activeRoom.task.id), className: "flex items-center gap-3 mx-5 mt-4 px-4 py-3 bg-green-50 border border-green-200 rounded-xl hover:bg-green-100 transition group", children: [ /*#__PURE__*/ _jsx("div", { className: "w-8 h-8 rounded-lg bg-green-600 flex items-center justify-center flex-shrink-0", children: /*#__PURE__*/ _jsxs("svg", { className: "w-4 h-4 text-white", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", children: [ /*#__PURE__*/ _jsx("path", { d: "M16 4h2a2 2 0 012 2v14a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2h2" }), /*#__PURE__*/ _jsx("rect", { x: "8", y: "2", width: "8", height: "4", rx: "1", ry: "1" }) ] }) }), /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-500 font-medium", children: t('chat.linked_task') }), /*#__PURE__*/ _jsx("p", { className: "text-sm font-semibold text-gray-800 truncate group-hover:underline", children: activeRoom.task.title }) ] }), /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-gray-400 flex-shrink-0", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", children: /*#__PURE__*/ _jsx("polyline", { points: "9 18 15 12 9 6" }) }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex-1 overflow-y-auto px-5 py-4 space-y-3", children: [ loadingMessages ? /*#__PURE__*/ _jsx("div", { className: "text-center text-gray-400 text-sm py-10", children: t('common.loading') }) : messages.length === 0 ? /*#__PURE__*/ _jsx("div", { className: "text-center text-gray-400 text-sm py-10", children: t('chat.no_messages') }) : messages.map((param)=>{ let { message, sender } = param; var _sender_name_, _sender_name, _message_translations; const isMe = message.senderId === currentUserId; var _sender_name__toUpperCase, _message_translations_locale; return /*#__PURE__*/ _jsxs("div", { className: "flex gap-2.5 ".concat(isMe ? 'flex-row-reverse' : ''), children: [ /*#__PURE__*/ _jsx("div", { className: "w-8 h-8 rounded-full bg-green-100 flex-shrink-0 flex items-center justify-center text-green-700 text-xs font-bold overflow-hidden", children: (sender === null || sender === void 0 ? void 0 : sender.image) ? /*#__PURE__*/ _jsx("img", { src: sender.image, alt: sender.name, className: "w-full h-full object-cover" }) : (_sender_name__toUpperCase = sender === null || sender === void 0 ? void 0 : (_sender_name = sender.name) === null || _sender_name === void 0 ? void 0 : (_sender_name_ = _sender_name[0]) === null || _sender_name_ === void 0 ? void 0 : _sender_name_.toUpperCase()) !== null && _sender_name__toUpperCase !== void 0 ? _sender_name__toUpperCase : '?' }), /*#__PURE__*/ _jsxs("div", { className: "max-w-[70%] ".concat(isMe ? 'items-end' : 'items-start', " flex flex-col gap-1"), children: [ !isMe && /*#__PURE__*/ _jsx("span", { className: "text-xs text-gray-400 px-1", children: formatShortName(sender === null || sender === void 0 ? void 0 : sender.firstName, sender === null || sender === void 0 ? void 0 : sender.lastName, sender === null || sender === void 0 ? void 0 : sender.name) }), message.imageUrl ? /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setLightboxUrl("".concat(API_URL).concat(message.imageUrl)), className: "block focus:outline-none", children: /*#__PURE__*/ _jsx("img", { src: "".concat(API_URL).concat(message.imageUrl), alt: "photo", className: "rounded-2xl max-w-[240px] max-h-[320px] object-cover cursor-pointer hover:opacity-90 transition" }) }) : /*#__PURE__*/ _jsx("div", { className: "px-4 py-2 rounded-2xl text-sm leading-relaxed ".concat(isMe ? 'bg-green-600 text-white rounded-tr-sm' : 'bg-gray-100 text-gray-800 rounded-tl-sm'), children: (_message_translations_locale = (_message_translations = message.translations) === null || _message_translations === void 0 ? void 0 : _message_translations[locale]) !== null && _message_translations_locale !== void 0 ? _message_translations_locale : message.body }), /*#__PURE__*/ _jsx("span", { className: "text-xs text-gray-300 px-1", children: new Date(message.createdAt).toLocaleTimeString(localeTag, { hour: '2-digit', minute: '2-digit' }) }) ] }) ] }, message.id); }), /*#__PURE__*/ _jsx("div", { ref: messagesEndRef }) ] }), lightboxUrl && /*#__PURE__*/ _jsx("div", { className: "fixed inset-0 z-50 flex items-center justify-center bg-black/80 backdrop-blur-sm", onClick: ()=>setLightboxUrl(null), children: /*#__PURE__*/ _jsxs("div", { className: "relative max-w-[90vw] max-h-[90vh]", onClick: (e)=>e.stopPropagation(), children: [ /*#__PURE__*/ _jsx("img", { src: lightboxUrl, alt: "photo", className: "max-w-[90vw] max-h-[90vh] rounded-2xl object-contain shadow-2xl" }), /*#__PURE__*/ _jsx("button", { onClick: ()=>setLightboxUrl(null), className: "absolute -top-3 -right-3 w-8 h-8 bg-white rounded-full flex items-center justify-center shadow-lg hover:bg-gray-100 transition", "aria-label": "Close", children: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-gray-700", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" }) }) }), /*#__PURE__*/ _jsx("a", { href: lightboxUrl, download: true, target: "_blank", rel: "noreferrer", className: "absolute -bottom-3 -right-3 w-8 h-8 bg-white rounded-full flex items-center justify-center shadow-lg hover:bg-gray-100 transition", "aria-label": "Download", onClick: (e)=>e.stopPropagation(), children: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-gray-700", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4 16v2a2 2 0 002 2h12a2 2 0 002-2v-2M7 10l5 5 5-5M12 15V3" }) }) }) ] }) }), /*#__PURE__*/ _jsxs("div", { className: "px-4 py-3 border-t border-gray-100", children: [ " ", /*#__PURE__*/ _jsx("input", { ref: fileInputRef, type: "file", accept: "image/jpeg,image/png,image/gif,image/webp", className: "hidden", onChange: (e)=>{ var _e_target_files; const file = (_e_target_files = e.target.files) === null || _e_target_files === void 0 ? void 0 : _e_target_files[0]; if (file) uploadAndSendImage(file); } }), " ", msgLimit && msgLimit.left !== null && msgLimit.left <= 0 && /*#__PURE__*/ _jsxs("div", { className: "mb-2 flex items-center gap-2 bg-red-50 border border-red-200 rounded-xl px-3 py-2", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-red-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 9v2m0 4h.01M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z" }) }), /*#__PURE__*/ _jsx("span", { className: "text-xs text-red-700 flex-1", children: t('chat.limit_reached', 'Daily message limit reached') }), /*#__PURE__*/ _jsx(Link, { href: "/pricing", className: "text-xs font-medium text-red-700 underline", children: t('dashboard.plan.upgrade', 'Upgrade plan') }) ] }), msgLimit && msgLimit.left !== null && msgLimit.left > 0 && msgLimit.left <= Math.ceil((msgLimit.left + msgLimit.sent) * 0.2) && /*#__PURE__*/ _jsxs("div", { className: "mb-2 flex items-center gap-2 bg-amber-50 border border-amber-200 rounded-xl px-3 py-2", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-amber-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 9v2m0 4h.01M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z" }) }), /*#__PURE__*/ _jsx("span", { className: "text-xs text-amber-700 flex-1", children: t('chat.limit_warning', '{n} messages left today').replace('{n}', String(msgLimit.left)) }), /*#__PURE__*/ _jsx(Link, { href: "/pricing", className: "text-xs font-medium text-amber-700 underline", children: t('dashboard.plan.upgrade', 'Upgrade plan') }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-2 items-end", children: [ /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>{ var _fileInputRef_current; return (_fileInputRef_current = fileInputRef.current) === null || _fileInputRef_current === void 0 ? void 0 : _fileInputRef_current.click(); }, disabled: uploadingImage || !connected || !!(msgLimit && msgLimit.left !== null && msgLimit.left <= 0), className: "h-10 w-10 text-gray-400 hover:text-gray-500 disabled:opacity-40 disabled:cursor-not-allowed flex-shrink-0 flex items-center justify-center rounded-xl hover:bg-gray-50 transition", title: "Send photo", children: uploadingImage ? /*#__PURE__*/ _jsxs("svg", { className: "w-5 h-5 animate-spin", fill: "none", viewBox: "0 0 24 24", children: [ /*#__PURE__*/ _jsx("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }), /*#__PURE__*/ _jsx("path", { className: "opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8v8H4z" }) ] }) : /*#__PURE__*/ _jsxs("svg", { className: "w-5 h-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: [ /*#__PURE__*/ _jsx("rect", { x: "3", y: "3", width: "18", height: "18", rx: "3", ry: "3" }), /*#__PURE__*/ _jsx("circle", { cx: "8.5", cy: "8.5", r: "1.5" }), /*#__PURE__*/ _jsx("polyline", { points: "21 15 16 10 5 21" }) ] }) }), /*#__PURE__*/ _jsx("textarea", { ref: inputRef, value: input, onChange: (e)=>setInput(e.target.value), onKeyDown: handleKeyDown, rows: 1, placeholder: t('chat.placeholder'), disabled: !!(msgLimit && msgLimit.left !== null && msgLimit.left <= 0), className: "flex-1 border border-gray-300 rounded-xl px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 resize-none max-h-32 disabled:bg-gray-50 disabled:text-gray-400", style: { minHeight: '40px' } }), /*#__PURE__*/ _jsx("button", { onClick: sendMessage, disabled: !input.trim() || !connected || !!(msgLimit && msgLimit.left !== null && msgLimit.left <= 0), className: "h-10 w-10 bg-green-600 text-white rounded-xl hover:bg-green-700 disabled:opacity-40 disabled:cursor-not-allowed flex-shrink-0 flex items-center justify-center", children: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 12h14M12 5l7 7-7 7" }) }) }) ] }) ] }) ] }) }) ] }); } export default function ChatPage() { return /*#__PURE__*/ _jsx(Suspense, { fallback: /*#__PURE__*/ _jsx("div", { className: "text-center py-20 text-white", children: "..." }), children: /*#__PURE__*/ _jsx(ChatPageInner, {}) }); } @…`=_’”Þà:<ce‘“×Ù  2Dbg}&DR€‰š°ÓÚ _IP}„œÄìó 'U\•œÐ×öû$BGin{ƒKVk_wk s ° ± …0:OWêòLTV`ò!ü!Í)Ð)x+|+, ,Î,Ò,n-q-K.O./_/ì/ï/n1q1þ12'454_5m5Ü6à6ó9÷9Í:Ð: < <ž=¡=Õ?Ø?bAeABBÖBÚBÜBäB/C_2CŸCÁCQE_EhHlHnHqHœIÀIˆJŒJ»LŸL¬M¯MçOëOP P³Q¶Q+S.S U#UV"VêVíVßW_âWXZ\Z@[C[—\š\ˆ_Œ_¬`¯`^ala»bŸbEdHd6f9fàhãhìkïkÄlÇlÀmÄmÁnÄnppžq_¡q>sAsÜtßtUwXwóxöx{ {í{ð{:>3€6€ÙÜ¢ƒ¥ƒÖ„Ù„Û„Þ„ ‡‡ˆ ˆ°‰³‰y‹_|‹ÑŒÔŒÖŒÙŒˆŽŒŽDG““}”€”·–º–a˜e˜BšEšWœZœ©¬ Ÿ Ÿ££¥¥ÂŠÅŠ©H"©R©U©W©^©ƒ©†©ªª€€€€€€€€€˜"https://api.canhelp.gr"0º(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)À(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useSearchParams)¿(0,_lib_auth__WEBPACK_IMPORTED_MODULE_4__/* .useSession */ .wV)Ã(0,_context_locale__WEBPACK_IMPORTED_MODULE_5__/* .useLocale */ .Y)¯(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)ÿÿÿÿÿÿÿÿÿ­(0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)ÿÿÿ°(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)ÿÀ(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getChatRooms */ .Zp)Á(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getDailyUsage */ .z4)ýŽ(0,socket_io_client__WEBPACK_IMPORTED_MODULE_7__.io)ü¿(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getMessages */ .VL)ûûû²(0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)ÿ¶(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)·(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)ÿÿþÿþþþþÉ(0,_lib_formatName__WEBPACK_IMPORTED_MODULE_8__/* .formatShortName */ .H)ÿþþýýýýýýþ·react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragmentüüþý²(next_link__WEBPACK_IMPORTED_MODULE_3___default())ûüûûüûûûûüûûüûûüûýûûûûûûüûûûûûûûüûüûûûûÿüûûûûÿüûüûûüûûûûûûû€û«react__WEBPACK_IMPORTED_MODULE_1__.SuspenseúúìŽÃ__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ ChatPage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7541); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(9664); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(next_link__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(1592); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(9906); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(2982); /* harmony import */ var _lib_formatName__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(1258); /* harmony import */ var socket_io_client__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(2838); /* __next_internal_client_entry_do_not_use__ default auto */ const API_URL = "https://api.canhelp.gr" || 0; function ChatPageInner() { var _session_user, _activeRoom_task, _activeRoom_otherUser, _activeRoom_otherUser1, _activeRoom_otherUser2; const router = (0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)(); const searchParams = (0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useSearchParams)(); const { data: session, isPending } = (0,_lib_auth__WEBPACK_IMPORTED_MODULE_4__/* .useSession */ .wV)(); const { t, locale } = (0,_context_locale__WEBPACK_IMPORTED_MODULE_5__/* .useLocale */ .Y)(); const [rooms, setRooms] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [loadingRooms, setLoadingRooms] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(true); const [activeRoomId, setActiveRoomId] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [messages, setMessages] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [loadingMessages, setLoadingMessages] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [input, setInput] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [connected, setConnected] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [msgLimit, setMsgLimit] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [uploadingImage, setUploadingImage] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [lightboxUrl, setLightboxUrl] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const socketRef = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null); const messagesEndRef = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null); const inputRef = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null); const fileInputRef = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!isPending && !session) router.push('/login'); }, [ session, isPending ]); // Load chat rooms (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!session) return; (0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getChatRooms */ .Zp)().then((data)=>{ setRooms(data); const roomParam = searchParams.get('room'); if (roomParam) setActiveRoomId(roomParam); }).catch((err)=>console.error('[chat] getChatRooms error:', err)).finally(()=>setLoadingRooms(false)); (0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getDailyUsage */ .z4)().then((u)=>setMsgLimit({ left: u.messagesLeft, sent: u.messagesSent })).catch((err)=>console.error('[chat] getDailyUsage error:', err)); }, [ session ]); // Setup Socket.IO (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!session) return; const socket = (0,socket_io_client__WEBPACK_IMPORTED_MODULE_7__.io)(API_URL, { withCredentials: true, transports: [ 'websocket', 'polling' ] }); socketRef.current = socket; socket.on('connect', ()=>setConnected(true)); socket.on('disconnect', ()=>setConnected(false)); socket.on('new_message', (msg)=>{ setMessages((prev)=>{ // avoid duplicate if we get it back from our own send if (prev.some((m)=>m.message.id === msg.id)) return prev; var _session_user_name, _session_user_image; // sender info: only known for current user; others show placeholder (? avatar) const sender = session.user && session.user.id === msg.senderId ? { id: session.user.id, name: (_session_user_name = session.user.name) !== null && _session_user_name !== void 0 ? _session_user_name : '', image: (_session_user_image = session.user.image) !== null && _session_user_image !== void 0 ? _session_user_image : undefined } : null; return [ ...prev, { message: msg, sender } ]; }); // Update lastMessage in rooms list and bubble room to top setRooms((prev)=>{ const updated = prev.map((r)=>{ var _msg_translations, _msg_imageUrl; return r.room.id === msg.roomId ? { ...r, lastMessage: { body: msg.body, createdAt: msg.createdAt, translations: (_msg_translations = msg.translations) !== null && _msg_translations !== void 0 ? _msg_translations : null, imageUrl: (_msg_imageUrl = msg.imageUrl) !== null && _msg_imageUrl !== void 0 ? _msg_imageUrl : null } } : r; }); return updated.sort((a, b)=>{ var _a_lastMessage, _b_lastMessage; const aTime = ((_a_lastMessage = a.lastMessage) === null || _a_lastMessage === void 0 ? void 0 : _a_lastMessage.createdAt) ? new Date(a.lastMessage.createdAt).getTime() : new Date(a.room.createdAt).getTime(); const bTime = ((_b_lastMessage = b.lastMessage) === null || _b_lastMessage === void 0 ? void 0 : _b_lastMessage.createdAt) ? new Date(b.lastMessage.createdAt).getTime() : new Date(b.room.createdAt).getTime(); return bTime - aTime; }); }); }); socket.on('message_translated', (param)=>{ let { id, roomId, translations } = param; setMessages((prev)=>prev.map((m)=>m.message.id === id ? { ...m, message: { ...m.message, translations } } : m)); // Also update lastMessage in sidebar if this is the last message of that room if (roomId) { setRooms((prev)=>prev.map((r)=>r.room.id === roomId && r.lastMessage ? { ...r, lastMessage: { ...r.lastMessage, translations } } : r)); } }); return ()=>{ socket.disconnect(); socketRef.current = null; }; }, [ session ]); // Join room and load messages when activeRoomId changes (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ var _socketRef_current, _socketRef_current1; if (!activeRoomId) return; setLoadingMessages(true); setMessages([]); (0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getMessages */ .VL)(activeRoomId).then(setMessages).catch((err)=>console.error('[chat] getMessages error:', err)).finally(()=>setLoadingMessages(false)); (_socketRef_current = socketRef.current) === null || _socketRef_current === void 0 ? void 0 : _socketRef_current.emit('join_room', activeRoomId); (_socketRef_current1 = socketRef.current) === null || _socketRef_current1 === void 0 ? void 0 : _socketRef_current1.emit('mark_read', activeRoomId); }, [ activeRoomId ]); // Focus input when active room changes (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!activeRoomId) return; const t = setTimeout(()=>{ var _inputRef_current; return (_inputRef_current = inputRef.current) === null || _inputRef_current === void 0 ? void 0 : _inputRef_current.focus(); }, 50); return ()=>clearTimeout(t); }, [ activeRoomId ]); // Auto-scroll on new messages (within container only) (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ var _messagesEndRef_current; (_messagesEndRef_current = messagesEndRef.current) === null || _messagesEndRef_current === void 0 ? void 0 : _messagesEndRef_current.scrollIntoView({ behavior: 'smooth', block: 'nearest' }); }, [ messages ]); // Close lightbox on Escape (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ const onKey = (e)=>{ if (e.key === 'Escape') setLightboxUrl(null); }; window.addEventListener('keydown', onKey); return ()=>window.removeEventListener('keydown', onKey); }, []); const sendMessage = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)(()=>{ const body = input.trim(); if (!body || !activeRoomId || !socketRef.current) return; if (msgLimit && msgLimit.left !== null && msgLimit.left <= 0) return; socketRef.current.emit('send_message', { roomId: activeRoomId, body, locale }); setInput(''); // decrement local counter setMsgLimit((prev)=>prev && prev.left !== null ? { ...prev, left: prev.left - 1, sent: prev.sent + 1 } : prev); }, [ input, activeRoomId, msgLimit ]); const uploadAndSendImage = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)(async (file)=>{ if (!activeRoomId || !socketRef.current) return; setUploadingImage(true); try { const formData = new FormData(); formData.append('file', file); const res = await fetch("".concat(API_URL, "/api/uploads"), { method: 'POST', credentials: 'include', body: formData }); if (!res.ok) throw new Error('Upload failed'); const { url } = await res.json(); socketRef.current.emit('send_message', { roomId: activeRoomId, body: '', imageUrl: url, locale }); } catch (_) { // silent } finally{ setUploadingImage(false); if (fileInputRef.current) fileInputRef.current.value = ''; } }, [ activeRoomId, locale ]); const handleKeyDown = (e)=>{ if (e.key === 'Enter' && !e.shiftKey) { e.preventDefault(); sendMessage(); } }; const LOCALE_TAG = { ru: 'ru-RU', en: 'en-US', el: 'el-GR' }; var _LOCALE_TAG_locale; const localeTag = (_LOCALE_TAG_locale = LOCALE_TAG[locale]) !== null && _LOCALE_TAG_locale !== void 0 ? _LOCALE_TAG_locale : 'el-GR'; function fmtMsgTime(iso) { const d = new Date(iso); const now = new Date(); const diffMin = Math.floor((now.getTime() - d.getTime()) / 60000); if (diffMin < 1) return t('chat.just_now'); if (diffMin < 60) return "".concat(diffMin).concat(t('chat.min_ago')); if (d.toDateString() === now.toDateString()) return d.toLocaleTimeString(localeTag, { hour: '2-digit', minute: '2-digit' }); return d.toLocaleDateString(localeTag, { day: '2-digit', month: '2-digit' }); } if (isPending || loadingRooms) { return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-center py-20 text-white", children: t('common.loading') }); } const activeRoom = rooms.find((r)=>r.room.id === activeRoomId); const currentUserId = session === null || session === void 0 ? void 0 : (_session_user = session.user) === null || _session_user === void 0 ? void 0 : _session_user.id; var _activeRoom_task_title; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "max-w-5xl mx-auto px-4 py-6 h-[calc(100vh-80px)] flex gap-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "w-72 flex-shrink-0 bg-white rounded-xl border border-gray-200 overflow-hidden flex flex-col", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "p-4 border-b border-gray-100", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h1", { className: "font-bold text-gray-900 text-lg", children: t('nav.chat') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-1.5 mt-1", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "w-2 h-2 rounded-full ".concat(connected ? 'bg-green-400' : 'bg-gray-300') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-xs text-gray-400", children: connected ? t('chat.connected') : t('chat.disconnected') }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex-1 overflow-y-auto", children: rooms.length === 0 ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "p-6 text-center text-gray-400 text-sm", children: t('chat.no_rooms') }) : rooms.map((param)=>{ let { room, task, otherUser, lastMessage } = param; var _lastMessage_translations; var _task_title; const roomLabel = (_task_title = task === null || task === void 0 ? void 0 : task.title) !== null && _task_title !== void 0 ? _task_title : (0,_lib_formatName__WEBPACK_IMPORTED_MODULE_8__/* .formatShortName */ .H)(otherUser === null || otherUser === void 0 ? void 0 : otherUser.firstName, otherUser === null || otherUser === void 0 ? void 0 : otherUser.lastName, otherUser === null || otherUser === void 0 ? void 0 : otherUser.name) || t('chat.direct_chat'); const roomSub = task ? (0,_lib_formatName__WEBPACK_IMPORTED_MODULE_8__/* .formatShortName */ .H)(otherUser === null || otherUser === void 0 ? void 0 : otherUser.firstName, otherUser === null || otherUser === void 0 ? void 0 : otherUser.lastName, otherUser === null || otherUser === void 0 ? void 0 : otherUser.name) || '' : t('chat.direct_chat'); var _lastMessage_translations_locale; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { onClick: ()=>{ setActiveRoomId(room.id); setTimeout(()=>{ var _inputRef_current; return (_inputRef_current = inputRef.current) === null || _inputRef_current === void 0 ? void 0 : _inputRef_current.focus(); }, 50); }, className: "w-full text-left px-4 py-3 border-b border-gray-50 hover:bg-gray-50 transition ".concat(activeRoomId === room.id ? 'bg-green-50 border-l-2 border-l-green-500' : ''), children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-start justify-between gap-1", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm font-medium text-gray-800 line-clamp-1 flex-1", children: roomLabel }), lastMessage && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-[10px] text-gray-400 shrink-0 mt-0.5", children: fmtMsgTime(lastMessage.createdAt) }) ] }), lastMessage ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400 mt-0.5 line-clamp-1", children: lastMessage.imageUrl && !lastMessage.body ? '📷' : (_lastMessage_translations_locale = (_lastMessage_translations = lastMessage.translations) === null || _lastMessage_translations === void 0 ? void 0 : _lastMessage_translations[locale]) !== null && _lastMessage_translations_locale !== void 0 ? _lastMessage_translations_locale : lastMessage.body }) : task ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400 mt-0.5 line-clamp-1", children: roomSub }) : null ] }, room.id); }) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex-1 bg-white rounded-xl border border-gray-200 flex flex-col overflow-hidden", children: !activeRoomId ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex-1 flex items-center justify-center text-gray-400 text-sm", children: t('chat.select') }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "px-5 py-4 border-b border-gray-100", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "font-semibold text-gray-800 text-sm", children: (_activeRoom_task_title = activeRoom === null || activeRoom === void 0 ? void 0 : (_activeRoom_task = activeRoom.task) === null || _activeRoom_task === void 0 ? void 0 : _activeRoom_task.title) !== null && _activeRoom_task_title !== void 0 ? _activeRoom_task_title : (0,_lib_formatName__WEBPACK_IMPORTED_MODULE_8__/* .formatShortName */ .H)(activeRoom === null || activeRoom === void 0 ? void 0 : (_activeRoom_otherUser = activeRoom.otherUser) === null || _activeRoom_otherUser === void 0 ? void 0 : _activeRoom_otherUser.firstName, activeRoom === null || activeRoom === void 0 ? void 0 : (_activeRoom_otherUser1 = activeRoom.otherUser) === null || _activeRoom_otherUser1 === void 0 ? void 0 : _activeRoom_otherUser1.lastName, activeRoom === null || activeRoom === void 0 ? void 0 : (_activeRoom_otherUser2 = activeRoom.otherUser) === null || _activeRoom_otherUser2 === void 0 ? void 0 : _activeRoom_otherUser2.name) || t('chat.direct_chat') }) }), (activeRoom === null || activeRoom === void 0 ? void 0 : activeRoom.task) && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)((next_link__WEBPACK_IMPORTED_MODULE_3___default()), { href: "/tasks/".concat(activeRoom.task.id), className: "flex items-center gap-3 mx-5 mt-4 px-4 py-3 bg-green-50 border border-green-200 rounded-xl hover:bg-green-100 transition group", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "w-8 h-8 rounded-lg bg-green-600 flex items-center justify-center flex-shrink-0", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-4 h-4 text-white", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M16 4h2a2 2 0 012 2v14a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2h2" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("rect", { x: "8", y: "2", width: "8", height: "4", rx: "1", ry: "1" }) ] }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-500 font-medium", children: t('chat.linked_task') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm font-semibold text-gray-800 truncate group-hover:underline", children: activeRoom.task.title }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 text-gray-400 flex-shrink-0", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("polyline", { points: "9 18 15 12 9 6" }) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex-1 overflow-y-auto px-5 py-4 space-y-3", children: [ loadingMessages ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-center text-gray-400 text-sm py-10", children: t('common.loading') }) : messages.length === 0 ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-center text-gray-400 text-sm py-10", children: t('chat.no_messages') }) : messages.map((param)=>{ let { message, sender } = param; var _sender_name_, _sender_name, _message_translations; const isMe = message.senderId === currentUserId; var _sender_name__toUpperCase, _message_translations_locale; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-2.5 ".concat(isMe ? 'flex-row-reverse' : ''), children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "w-8 h-8 rounded-full bg-green-100 flex-shrink-0 flex items-center justify-center text-green-700 text-xs font-bold overflow-hidden", children: (sender === null || sender === void 0 ? void 0 : sender.image) ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: sender.image, alt: sender.name, className: "w-full h-full object-cover" }) : (_sender_name__toUpperCase = sender === null || sender === void 0 ? void 0 : (_sender_name = sender.name) === null || _sender_name === void 0 ? void 0 : (_sender_name_ = _sender_name[0]) === null || _sender_name_ === void 0 ? void 0 : _sender_name_.toUpperCase()) !== null && _sender_name__toUpperCase !== void 0 ? _sender_name__toUpperCase : '?' }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "max-w-[70%] ".concat(isMe ? 'items-end' : 'items-start', " flex flex-col gap-1"), children: [ !isMe && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-xs text-gray-400 px-1", children: (0,_lib_formatName__WEBPACK_IMPORTED_MODULE_8__/* .formatShortName */ .H)(sender === null || sender === void 0 ? void 0 : sender.firstName, sender === null || sender === void 0 ? void 0 : sender.lastName, sender === null || sender === void 0 ? void 0 : sender.name) }), message.imageUrl ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>setLightboxUrl("".concat(API_URL).concat(message.imageUrl)), className: "block focus:outline-none", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: "".concat(API_URL).concat(message.imageUrl), alt: "photo", className: "rounded-2xl max-w-[240px] max-h-[320px] object-cover cursor-pointer hover:opacity-90 transition" }) }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "px-4 py-2 rounded-2xl text-sm leading-relaxed ".concat(isMe ? 'bg-green-600 text-white rounded-tr-sm' : 'bg-gray-100 text-gray-800 rounded-tl-sm'), children: (_message_translations_locale = (_message_translations = message.translations) === null || _message_translations === void 0 ? void 0 : _message_translations[locale]) !== null && _message_translations_locale !== void 0 ? _message_translations_locale : message.body }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-xs text-gray-300 px-1", children: new Date(message.createdAt).toLocaleTimeString(localeTag, { hour: '2-digit', minute: '2-digit' }) }) ] }) ] }, message.id); }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { ref: messagesEndRef }) ] }), lightboxUrl && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "fixed inset-0 z-50 flex items-center justify-center bg-black/80 backdrop-blur-sm", onClick: ()=>setLightboxUrl(null), children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "relative max-w-[90vw] max-h-[90vh]", onClick: (e)=>e.stopPropagation(), children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: lightboxUrl, alt: "photo", className: "max-w-[90vw] max-h-[90vh] rounded-2xl object-contain shadow-2xl" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>setLightboxUrl(null), className: "absolute -top-3 -right-3 w-8 h-8 bg-white rounded-full flex items-center justify-center shadow-lg hover:bg-gray-100 transition", "aria-label": "Close", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 text-gray-700", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" }) }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("a", { href: lightboxUrl, download: true, target: "_blank", rel: "noreferrer", className: "absolute -bottom-3 -right-3 w-8 h-8 bg-white rounded-full flex items-center justify-center shadow-lg hover:bg-gray-100 transition", "aria-label": "Download", onClick: (e)=>e.stopPropagation(), children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 text-gray-700", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4 16v2a2 2 0 002 2h12a2 2 0 002-2v-2M7 10l5 5 5-5M12 15V3" }) }) }) ] }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "px-4 py-3 border-t border-gray-100", children: [ " ", /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { ref: fileInputRef, type: "file", accept: "image/jpeg,image/png,image/gif,image/webp", className: "hidden", onChange: (e)=>{ var _e_target_files; const file = (_e_target_files = e.target.files) === null || _e_target_files === void 0 ? void 0 : _e_target_files[0]; if (file) uploadAndSendImage(file); } }), " ", msgLimit && msgLimit.left !== null && msgLimit.left <= 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "mb-2 flex items-center gap-2 bg-red-50 border border-red-200 rounded-xl px-3 py-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 text-red-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 9v2m0 4h.01M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z" }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-xs text-red-700 flex-1", children: t('chat.limit_reached', 'Daily message limit reached') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)((next_link__WEBPACK_IMPORTED_MODULE_3___default()), { href: "/pricing", className: "text-xs font-medium text-red-700 underline", children: t('dashboard.plan.upgrade', 'Upgrade plan') }) ] }), msgLimit && msgLimit.left !== null && msgLimit.left > 0 && msgLimit.left <= Math.ceil((msgLimit.left + msgLimit.sent) * 0.2) && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "mb-2 flex items-center gap-2 bg-amber-50 border border-amber-200 rounded-xl px-3 py-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 text-amber-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 9v2m0 4h.01M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z" }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-xs text-amber-700 flex-1", children: t('chat.limit_warning', '{n} messages left today').replace('{n}', String(msgLimit.left)) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)((next_link__WEBPACK_IMPORTED_MODULE_3___default()), { href: "/pricing", className: "text-xs font-medium text-amber-700 underline", children: t('dashboard.plan.upgrade', 'Upgrade plan') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-2 items-end", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>{ var _fileInputRef_current; return (_fileInputRef_current = fileInputRef.current) === null || _fileInputRef_current === void 0 ? void 0 : _fileInputRef_current.click(); }, disabled: uploadingImage || !connected || !!(msgLimit && msgLimit.left !== null && msgLimit.left <= 0), className: "h-10 w-10 text-gray-400 hover:text-gray-500 disabled:opacity-40 disabled:cursor-not-allowed flex-shrink-0 flex items-center justify-center rounded-xl hover:bg-gray-50 transition", title: "Send photo", children: uploadingImage ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-5 h-5 animate-spin", fill: "none", viewBox: "0 0 24 24", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { className: "opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8v8H4z" }) ] }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-5 h-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("rect", { x: "3", y: "3", width: "18", height: "18", rx: "3", ry: "3" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("circle", { cx: "8.5", cy: "8.5", r: "1.5" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("polyline", { points: "21 15 16 10 5 21" }) ] }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("textarea", { ref: inputRef, value: input, onChange: (e)=>setInput(e.target.value), onKeyDown: handleKeyDown, rows: 1, placeholder: t('chat.placeholder'), disabled: !!(msgLimit && msgLimit.left !== null && msgLimit.left <= 0), className: "flex-1 border border-gray-300 rounded-xl px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 resize-none max-h-32 disabled:bg-gray-50 disabled:text-gray-400", style: { minHeight: '40px' } }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: sendMessage, disabled: !input.trim() || !connected || !!(msgLimit && msgLimit.left !== null && msgLimit.left <= 0), className: "h-10 w-10 bg-green-600 text-white rounded-xl hover:bg-green-700 disabled:opacity-40 disabled:cursor-not-allowed flex-shrink-0 flex items-center justify-center", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 12h14M12 5l7 7-7 7" }) }) }) ] }) ] }) ] }) }) ] }); } function ChatPage() { return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(react__WEBPACK_IMPORTED_MODULE_1__.Suspense, { fallback: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-center py-20 text-white", children: "..." }), children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(ChatPageInner, {}) }); } íð ñ¿__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ ChatPage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7541); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(9664); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(next_link__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(1592); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(9906); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(2982); /* harmony import */ var _lib_formatName__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(1258); /* harmony import */ var socket_io_client__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(2838); òÀŒÿÿ÷"61146undefined148222undefined224284undefined286314undefined316355undefined357401undefined403471undefined473523undefined525562undefined580610"https://api.canhelp.gr"undefined6156370undefined798806(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)undefined836850(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useSearchParams)undefined896905(0,_lib_auth__WEBPACK_IMPORTED_MODULE_4__/* .useSession */ .wV)undefined936944(0,_context_locale__WEBPACK_IMPORTED_MODULE_5__/* .useLocale */ .Y)undefined979986(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined10371044(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined10971104(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined11491156(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined12131220(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined12601267(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined13121319(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined13651372(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined14291436(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined14881495(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined15261531(0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)undefined15671572(0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)undefined16021607(0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)undefined16411646(0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)undefined16591667(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined18131821(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined18671878(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getChatRooms */ .Zp)undefined21552167(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getDailyUsage */ .z4)undefined24112419(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined24802481(0,socket_io_client__WEBPACK_IMPORTED_MODULE_7__.io)undefined62776285(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined64486458(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getMessages */ .VL)undefined69916999(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined74027410(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined77567764(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined80228032(0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)undefined86908700(0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)undefined1070110704(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1112811132(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1127111275(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1147011474(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1163011633(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1185111855(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1203712040(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1226812271(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1265412657(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1279812801(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1335113365(0,_lib_formatName__WEBPACK_IMPORTED_MODULE_8__/* .formatShortName */ .H)undefined1366313677(0,_lib_formatName__WEBPACK_IMPORTED_MODULE_8__/* .formatShortName */ .H)undefined1404414048(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1483514839(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1505315056(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1537015373(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1577415777(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1634116344(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1673816741(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1691816921(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1711017114(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1711617124react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragmentundefined1719917202(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1734217345(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1774517759(0,_lib_formatName__WEBPACK_IMPORTED_MODULE_8__/* .formatShortName */ .H)undefined1853618540(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1854218545(next_link__WEBPACK_IMPORTED_MODULE_3___default())undefined1887718880(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1908019084(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1964319646(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1988419887(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2045520459(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2063720640(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2091520918(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2129121294(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2179221795(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2204622050(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2225022253(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2249522498(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2312823132(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2336023363(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2370323706(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2445624460(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2474824751(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2492624940(0,_lib_formatName__WEBPACK_IMPORTED_MODULE_8__/* .formatShortName */ .H)undefined2527525278(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2566925672(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2616626169(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2684826851(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2762827631(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2784427847(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2809628100(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2835328356(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2868628689(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2908629089(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2950229505(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2991629919(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3054930552(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3096330966(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3149531499(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3172531728(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3257032574(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3281932822(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3324133244(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3369833701(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3400634009(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3401134014(next_link__WEBPACK_IMPORTED_MODULE_3___default())undefined3457134575(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3482434827(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3524835251(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3570535708(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3604936052(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3605436057(next_link__WEBPACK_IMPORTED_MODULE_3___default())undefined3648836492(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3667636679(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3765737661(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3801338016(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3858338586(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3900939013(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3949039493(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4002340026(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4036140364(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4071340716(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4174941752(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4226442267(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4269042693(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4328443298undefined4334643349(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4335143358react__WEBPACK_IMPORTED_MODULE_1__.Suspenseundefined4339543398(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4353643539(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined ó•__webpack_require__.n•__webpack_require__.rŠŒÿÿò»ŒÿÿÚÛ W«webpack/lib/util/registerExternalSerializerœwebpack-sources/ConcatSource€«webpack/lib/util/registerExternalSerializer™webpack-sources/RawSource__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ NotificationsPage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7541); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(1592); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(9906); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(2982); «webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourceÂM/* __next_internal_client_entry_do_not_use__ default auto */ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { useEffect, useState } from 'react'; import { useRouter } from 'next/navigation'; import { useSession } from '@/lib/auth'; import { useLocale } from '@/context/locale'; import { getNotifications, markAllRead, markRead, dismissNotification } from '@/lib/api'; function NotifIcon(param) { let { type } = param; const cls = 'w-5 h-5'; switch(type){ case 'new_offer': return /*#__PURE__*/ _jsxs("svg", { className: cls, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", children: [ /*#__PURE__*/ _jsx("rect", { x: "2", y: "7", width: "20", height: "14", rx: "2" }), /*#__PURE__*/ _jsx("path", { d: "M16 21V5a2 2 0 00-2-2h-4a2 2 0 00-2 2v16" }) ] }); case 'offer_accepted': return /*#__PURE__*/ _jsxs("svg", { className: cls, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", children: [ /*#__PURE__*/ _jsx("circle", { cx: "12", cy: "12", r: "10" }), /*#__PURE__*/ _jsx("polyline", { points: "9 12 11 14 15 10" }) ] }); case 'offer_declined': return /*#__PURE__*/ _jsxs("svg", { className: cls, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", children: [ /*#__PURE__*/ _jsx("circle", { cx: "12", cy: "12", r: "10" }), /*#__PURE__*/ _jsx("line", { x1: "15", y1: "9", x2: "9", y2: "15" }), /*#__PURE__*/ _jsx("line", { x1: "9", y1: "9", x2: "15", y2: "15" }) ] }); case 'task_completed': return /*#__PURE__*/ _jsx("svg", { className: cls, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", children: /*#__PURE__*/ _jsx("polyline", { points: "20 6 9 17 4 12" }) }); case 'task_cancelled': return /*#__PURE__*/ _jsxs("svg", { className: cls, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", children: [ /*#__PURE__*/ _jsx("path", { d: "M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z" }), /*#__PURE__*/ _jsx("line", { x1: "12", y1: "9", x2: "12", y2: "13" }), /*#__PURE__*/ _jsx("line", { x1: "12", y1: "17", x2: "12.01", y2: "17" }) ] }); case 'new_message': return /*#__PURE__*/ _jsx("svg", { className: cls, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", children: /*#__PURE__*/ _jsx("path", { d: "M21 15a2 2 0 01-2 2H7l-4 4V5a2 2 0 012-2h14a2 2 0 012 2z" }) }); case 'new_review': return /*#__PURE__*/ _jsx("svg", { className: cls, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", children: /*#__PURE__*/ _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" }) }); case 'task_invite': return /*#__PURE__*/ _jsxs("svg", { className: cls, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", children: [ /*#__PURE__*/ _jsx("path", { d: "M16 4h2a2 2 0 012 2v14a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2h2" }), /*#__PURE__*/ _jsx("rect", { x: "8", y: "2", width: "8", height: "4", rx: "1", ry: "1" }) ] }); default: return /*#__PURE__*/ _jsxs("svg", { className: cls, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", children: [ /*#__PURE__*/ _jsx("path", { d: "M18 8A6 6 0 006 8c0 7-3 9-3 9h18s-3-2-3-9" }), /*#__PURE__*/ _jsx("path", { d: "M13.73 21a2 2 0 01-3.46 0" }) ] }); } } const typeColor = { new_offer: 'bg-green-100 text-green-600', offer_accepted: 'bg-green-100 text-green-600', offer_declined: 'bg-red-100 text-red-600', task_completed: 'bg-emerald-100 text-emerald-600', task_cancelled: 'bg-amber-100 text-amber-600', new_message: 'bg-purple-100 text-purple-600', new_review: 'bg-yellow-100 text-yellow-600', task_invite: 'bg-indigo-100 text-indigo-600', referral_reward: 'bg-cyan-100 text-cyan-700', specialist_card_submitted: 'bg-amber-100 text-amber-700', specialist_card_approved: 'bg-green-100 text-green-700', specialist_card_rejected: 'bg-rose-100 text-rose-700' }; /** Extract the quoted task title from a stored body string (any locale) */ function extractParam(body) { if (!body) return null; const m = body.match(/[«""](.+?)[»""]/); var _m_; return (_m_ = m === null || m === void 0 ? void 0 : m[1]) !== null && _m_ !== void 0 ? _m_ : null; } /** Extract rating number from a stored review body */ function extractRating(body) { if (!body) return null; const m = body.match(/(\d+)\s*[★\*]/); var _m_; return (_m_ = m === null || m === void 0 ? void 0 : m[1]) !== null && _m_ !== void 0 ? _m_ : null; } /** Extract first integer from text (for referral days, etc.) */ function extractNumber(body) { if (!body) return null; const m = body.match(/(\d+)/); var _m_; return (_m_ = m === null || m === void 0 ? void 0 : m[1]) !== null && _m_ !== void 0 ? _m_ : null; } export default function NotificationsPage() { const { data: session, isPending } = useSession(); const router = useRouter(); const { t, locale } = useLocale(); const [notifications, setNotifications] = useState([]); const [loading, setLoading] = useState(true); useEffect(()=>{ if (!isPending && !session) router.push('/login'); }, [ session, isPending ]); useEffect(()=>{ if (!session) return; getNotifications().then(setNotifications).catch(()=>{}).finally(()=>setLoading(false)); }, [ session ]); async function handleMarkAll() { await markAllRead(); setNotifications((prev)=>prev.map((n)=>({ ...n, isRead: true }))); } async function handleMark(id) { await markRead(id); setNotifications((prev)=>prev.map((n)=>n.id === id ? { ...n, isRead: true } : n)); } async function handleDismiss(e, id) { e.stopPropagation(); await dismissNotification(id).catch(()=>{}); setNotifications((prev)=>prev.filter((n)=>n.id !== id)); } if (isPending || loading) return /*#__PURE__*/ _jsx("div", { className: "text-center py-20 text-white", children: t('common.loading') }); function relativeTime(dateStr) { const diff = Date.now() - new Date(dateStr).getTime(); const sec = Math.floor(diff / 1000); const min = Math.floor(sec / 60); const hrs = Math.floor(min / 60); const days = Math.floor(hrs / 24); if (locale === 'ru') { if (sec < 60) return 'тПлькП чтП'; if (min < 60) return "".concat(min, " ЌОМ. МазаЎ"); if (hrs < 24) return "".concat(hrs, " ч. МазаЎ"); if (days === 1) return 'вчера'; if (days < 7) return "".concat(days, " ЎМ. МазаЎ"); } else if (locale === 'uk') { if (sec < 60) return 'щПйМП'; if (min < 60) return "".concat(min, " хв. тПЌу"); if (hrs < 24) return "".concat(hrs, " гПЎ. тПЌу"); if (days === 1) return 'вчПра'; if (days < 7) return "".concat(days, " ЎМ. тПЌу"); } else if (locale === 'en') { if (sec < 60) return 'just now'; if (min < 60) return "".concat(min, "m ago"); if (hrs < 24) return "".concat(hrs, "h ago"); if (days === 1) return 'yesterday'; if (days < 7) return "".concat(days, "d ago"); } else { if (sec < 60) return 'Όόλις τώρα'; if (min < 60) return "".concat(min, " λ. πριΜ"); if (hrs < 24) return "".concat(hrs, " ω. πριΜ"); if (days === 1) return 'χΞες'; if (days < 7) return "".concat(days, " ÎŒ. πριΜ"); } return new Date(dateStr).toLocaleDateString(dateLocale, { day: 'numeric', month: 'short', year: days > 365 ? 'numeric' : undefined }); } const unreadCount = notifications.filter((n)=>!n.isRead).length; const dateLocale = locale === 'ru' ? 'ru-RU' : locale === 'uk' ? 'uk-UA' : locale === 'en' ? 'en-US' : 'el-GR'; return /*#__PURE__*/ _jsxs("div", { className: "max-w-2xl mx-auto px-4 py-8", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex justify-between items-center mb-6", children: [ /*#__PURE__*/ _jsxs("h1", { className: "text-2xl font-bold text-white", children: [ t('notif.title'), " ", unreadCount > 0 && /*#__PURE__*/ _jsxs("span", { className: "text-white/70 font-normal text-xl", children: [ "(", unreadCount, ")" ] }) ] }), unreadCount > 0 && /*#__PURE__*/ _jsx("button", { onClick: handleMarkAll, className: "text-sm text-white/80 hover:text-white hover:underline transition", children: t('notif.mark_all') }) ] }), notifications.length === 0 ? /*#__PURE__*/ _jsx("div", { className: "text-center py-20 text-white/60", children: t('notif.empty') }) : /*#__PURE__*/ _jsx("div", { className: "space-y-2", children: notifications.map((n)=>{ const link = n.type === 'referral_reward' ? '/profile?tab=referral' : n.referenceId ? n.type === 'new_message' ? "/chat?room=".concat(n.referenceId) : "/tasks/".concat(n.referenceId) : null; const handleClick = async ()=>{ if (!n.isRead) await handleMark(n.id); if (link) router.push(link); }; var _typeColor_n_type; return /*#__PURE__*/ _jsxs("div", { onClick: handleClick, className: "flex items-start gap-3 p-4 rounded-xl border transition ".concat(link ? 'cursor-pointer' : 'cursor-default', " ").concat(n.isRead ? 'bg-white/90 border-white/20 hover:bg-white' : 'bg-white border-green-300 shadow-sm hover:bg-green-50'), children: [ /*#__PURE__*/ _jsx("div", { className: "p-2.5 rounded-xl flex-shrink-0 ".concat((_typeColor_n_type = typeColor[n.type]) !== null && _typeColor_n_type !== void 0 ? _typeColor_n_type : 'bg-gray-100 text-gray-500'), children: /*#__PURE__*/ _jsx(NotifIcon, { type: n.type }) }), /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ _jsx("p", { className: "font-medium ".concat(n.isRead ? 'text-gray-600' : 'text-gray-900'), children: t("notif.type.".concat(n.type), t('notif.type.generic', 'Notification')) }), n.body && /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-500 mt-0.5 truncate", children: (()=>{ if (n.type === 'new_message') return n.body; if (n.type === 'new_review') { const rating = extractRating(n.body); const tpl = t("notif.body.new_review", ''); return rating && tpl ? tpl.replace('{rating}', rating) : n.body; } if (n.type === 'referral_reward') { const days = extractNumber(n.body); const plan = extractParam(n.body); const tpl = t('notif.body.referral_reward', ''); if (tpl && days && plan) return tpl.replace('{days}', days).replace('{plan}', plan); return tpl || n.body; } const title = extractParam(n.body); const tpl = t("notif.body.".concat(n.type), ''); if (tpl && title) return tpl.replace('{title}', title); return tpl || n.body; })() }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-1", children: relativeTime(n.createdAt) }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex flex-col items-end gap-2 shrink-0", onClick: (e)=>e.stopPropagation(), children: [ /*#__PURE__*/ _jsx("button", { onClick: (e)=>handleDismiss(e, n.id), className: "p-1 rounded-md text-gray-300 hover:text-red-400 hover:bg-red-50 transition", title: t('common.delete', 'Delete'), children: /*#__PURE__*/ _jsxs("svg", { className: "w-4 h-4", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", children: [ /*#__PURE__*/ _jsx("line", { x1: "18", y1: "6", x2: "6", y2: "18" }), /*#__PURE__*/ _jsx("line", { x1: "6", y1: "6", x2: "18", y2: "18" }) ] }) }), /*#__PURE__*/ _jsx("div", { className: "flex items-center gap-1.5", children: !n.isRead && /*#__PURE__*/ _jsx("span", { className: "w-2 h-2 bg-green-500 rounded-full" }) }) ] }) ] }, n.id); }) }) ] }); } cB={}_šªÕ×þ,.†&*psdg26|+.êî4 7 ã æ ± Ž Ÿ Á ñ _ô ” ˜ Þᘛgjvy©¬ilœŸ‹ÕØ~ÂÆ œŸ!!X!_a!y!! !š!Û!â! """'"¢"ª"Ø"ç"„#Ž#N$U$J%\%ë%î%Ì-Ð-;.?.Í.Ñ.Ï/Ó/…1_ˆ1Ô2×2j3m3¹5œ5U7X7t8w8$9(9Î9Ñ91;4;òAõA.C2C3D6D E€EìGïGbIeILKOK÷K@úK€€€€€€·(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)¶(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)ÿþÿÿþÿÿÿÿÿþÿÿÿÿÿÿÿþÿÿþÿÿ€¿(0,_lib_auth__WEBPACK_IMPORTED_MODULE_3__/* .useSession */ .wV)º(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)Ã(0,_context_locale__WEBPACK_IMPORTED_MODULE_4__/* .useLocale */ .Y)¯(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)ÿ°(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)ÿÄ(0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getNotifications */ .Tr)¿(0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .markAllRead */ .NL)Œ(0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .markRead */ .Ip)Ç(0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .dismissNotification */ .yk)öõõõõöööõööõöööõöõöööößèZ__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ NotificationsPage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7541); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(1592); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(9906); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(2982); /* __next_internal_client_entry_do_not_use__ default auto */ function NotifIcon(param) { let { type } = param; const cls = 'w-5 h-5'; switch(type){ case 'new_offer': return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: cls, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("rect", { x: "2", y: "7", width: "20", height: "14", rx: "2" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M16 21V5a2 2 0 00-2-2h-4a2 2 0 00-2 2v16" }) ] }); case 'offer_accepted': return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: cls, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("circle", { cx: "12", cy: "12", r: "10" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("polyline", { points: "9 12 11 14 15 10" }) ] }); case 'offer_declined': return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: cls, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("circle", { cx: "12", cy: "12", r: "10" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: "15", y1: "9", x2: "9", y2: "15" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: "9", y1: "9", x2: "15", y2: "15" }) ] }); case 'task_completed': return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: cls, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("polyline", { points: "20 6 9 17 4 12" }) }); case 'task_cancelled': return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: cls, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: "12", y1: "9", x2: "12", y2: "13" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: "12", y1: "17", x2: "12.01", y2: "17" }) ] }); case 'new_message': return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: cls, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M21 15a2 2 0 01-2 2H7l-4 4V5a2 2 0 012-2h14a2 2 0 012 2z" }) }); case 'new_review': return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: cls, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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" }) }); case 'task_invite': return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: cls, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M16 4h2a2 2 0 012 2v14a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2h2" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("rect", { x: "8", y: "2", width: "8", height: "4", rx: "1", ry: "1" }) ] }); default: return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: cls, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M18 8A6 6 0 006 8c0 7-3 9-3 9h18s-3-2-3-9" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M13.73 21a2 2 0 01-3.46 0" }) ] }); } } const typeColor = { new_offer: 'bg-green-100 text-green-600', offer_accepted: 'bg-green-100 text-green-600', offer_declined: 'bg-red-100 text-red-600', task_completed: 'bg-emerald-100 text-emerald-600', task_cancelled: 'bg-amber-100 text-amber-600', new_message: 'bg-purple-100 text-purple-600', new_review: 'bg-yellow-100 text-yellow-600', task_invite: 'bg-indigo-100 text-indigo-600', referral_reward: 'bg-cyan-100 text-cyan-700', specialist_card_submitted: 'bg-amber-100 text-amber-700', specialist_card_approved: 'bg-green-100 text-green-700', specialist_card_rejected: 'bg-rose-100 text-rose-700' }; /** Extract the quoted task title from a stored body string (any locale) */ function extractParam(body) { if (!body) return null; const m = body.match(/[«""](.+?)[»""]/); var _m_; return (_m_ = m === null || m === void 0 ? void 0 : m[1]) !== null && _m_ !== void 0 ? _m_ : null; } /** Extract rating number from a stored review body */ function extractRating(body) { if (!body) return null; const m = body.match(/(\d+)\s*[★\*]/); var _m_; return (_m_ = m === null || m === void 0 ? void 0 : m[1]) !== null && _m_ !== void 0 ? _m_ : null; } /** Extract first integer from text (for referral days, etc.) */ function extractNumber(body) { if (!body) return null; const m = body.match(/(\d+)/); var _m_; return (_m_ = m === null || m === void 0 ? void 0 : m[1]) !== null && _m_ !== void 0 ? _m_ : null; } function NotificationsPage() { const { data: session, isPending } = (0,_lib_auth__WEBPACK_IMPORTED_MODULE_3__/* .useSession */ .wV)(); const router = (0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)(); const { t, locale } = (0,_context_locale__WEBPACK_IMPORTED_MODULE_4__/* .useLocale */ .Y)(); const [notifications, setNotifications] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [loading, setLoading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(true); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!isPending && !session) router.push('/login'); }, [ session, isPending ]); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!session) return; (0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getNotifications */ .Tr)().then(setNotifications).catch(()=>{}).finally(()=>setLoading(false)); }, [ session ]); async function handleMarkAll() { await (0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .markAllRead */ .NL)(); setNotifications((prev)=>prev.map((n)=>({ ...n, isRead: true }))); } async function handleMark(id) { await (0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .markRead */ .Ip)(id); setNotifications((prev)=>prev.map((n)=>n.id === id ? { ...n, isRead: true } : n)); } async function handleDismiss(e, id) { e.stopPropagation(); await (0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .dismissNotification */ .yk)(id).catch(()=>{}); setNotifications((prev)=>prev.filter((n)=>n.id !== id)); } if (isPending || loading) return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-center py-20 text-white", children: t('common.loading') }); function relativeTime(dateStr) { const diff = Date.now() - new Date(dateStr).getTime(); const sec = Math.floor(diff / 1000); const min = Math.floor(sec / 60); const hrs = Math.floor(min / 60); const days = Math.floor(hrs / 24); if (locale === 'ru') { if (sec < 60) return 'тПлькП чтП'; if (min < 60) return "".concat(min, " ЌОМ. МазаЎ"); if (hrs < 24) return "".concat(hrs, " ч. МазаЎ"); if (days === 1) return 'вчера'; if (days < 7) return "".concat(days, " ЎМ. МазаЎ"); } else if (locale === 'uk') { if (sec < 60) return 'щПйМП'; if (min < 60) return "".concat(min, " хв. тПЌу"); if (hrs < 24) return "".concat(hrs, " гПЎ. тПЌу"); if (days === 1) return 'вчПра'; if (days < 7) return "".concat(days, " ЎМ. тПЌу"); } else if (locale === 'en') { if (sec < 60) return 'just now'; if (min < 60) return "".concat(min, "m ago"); if (hrs < 24) return "".concat(hrs, "h ago"); if (days === 1) return 'yesterday'; if (days < 7) return "".concat(days, "d ago"); } else { if (sec < 60) return 'Όόλις τώρα'; if (min < 60) return "".concat(min, " λ. πριΜ"); if (hrs < 24) return "".concat(hrs, " ω. πριΜ"); if (days === 1) return 'χΞες'; if (days < 7) return "".concat(days, " ÎŒ. πριΜ"); } return new Date(dateStr).toLocaleDateString(dateLocale, { day: 'numeric', month: 'short', year: days > 365 ? 'numeric' : undefined }); } const unreadCount = notifications.filter((n)=>!n.isRead).length; const dateLocale = locale === 'ru' ? 'ru-RU' : locale === 'uk' ? 'uk-UA' : locale === 'en' ? 'en-US' : 'el-GR'; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "max-w-2xl mx-auto px-4 py-8", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex justify-between items-center mb-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("h1", { className: "text-2xl font-bold text-white", children: [ t('notif.title'), " ", unreadCount > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "text-white/70 font-normal text-xl", children: [ "(", unreadCount, ")" ] }) ] }), unreadCount > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: handleMarkAll, className: "text-sm text-white/80 hover:text-white hover:underline transition", children: t('notif.mark_all') }) ] }), notifications.length === 0 ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-center py-20 text-white/60", children: t('notif.empty') }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "space-y-2", children: notifications.map((n)=>{ const link = n.type === 'referral_reward' ? '/profile?tab=referral' : n.referenceId ? n.type === 'new_message' ? "/chat?room=".concat(n.referenceId) : "/tasks/".concat(n.referenceId) : null; const handleClick = async ()=>{ if (!n.isRead) await handleMark(n.id); if (link) router.push(link); }; var _typeColor_n_type; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { onClick: handleClick, className: "flex items-start gap-3 p-4 rounded-xl border transition ".concat(link ? 'cursor-pointer' : 'cursor-default', " ").concat(n.isRead ? 'bg-white/90 border-white/20 hover:bg-white' : 'bg-white border-green-300 shadow-sm hover:bg-green-50'), children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "p-2.5 rounded-xl flex-shrink-0 ".concat((_typeColor_n_type = typeColor[n.type]) !== null && _typeColor_n_type !== void 0 ? _typeColor_n_type : 'bg-gray-100 text-gray-500'), children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(NotifIcon, { type: n.type }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "font-medium ".concat(n.isRead ? 'text-gray-600' : 'text-gray-900'), children: t("notif.type.".concat(n.type), t('notif.type.generic', 'Notification')) }), n.body && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-gray-500 mt-0.5 truncate", children: (()=>{ if (n.type === 'new_message') return n.body; if (n.type === 'new_review') { const rating = extractRating(n.body); const tpl = t("notif.body.new_review", ''); return rating && tpl ? tpl.replace('{rating}', rating) : n.body; } if (n.type === 'referral_reward') { const days = extractNumber(n.body); const plan = extractParam(n.body); const tpl = t('notif.body.referral_reward', ''); if (tpl && days && plan) return tpl.replace('{days}', days).replace('{plan}', plan); return tpl || n.body; } const title = extractParam(n.body); const tpl = t("notif.body.".concat(n.type), ''); if (tpl && title) return tpl.replace('{title}', title); return tpl || n.body; })() }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400 mt-1", children: relativeTime(n.createdAt) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex flex-col items-end gap-2 shrink-0", onClick: (e)=>e.stopPropagation(), children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: (e)=>handleDismiss(e, n.id), className: "p-1 rounded-md text-gray-300 hover:text-red-400 hover:bg-red-50 transition", title: t('common.delete', 'Delete'), children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-4 h-4", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: "18", y1: "6", x2: "6", y2: "18" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: "6", y1: "6", x2: "18", y2: "18" }) ] }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex items-center gap-1.5", children: !n.isRead && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "w-2 h-2 bg-green-500 rounded-full" }) }) ] }) ] }, n.id); }) }) ] }); } àã ä__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ NotificationsPage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7541); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(1592); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(9906); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(2982); åjÂÿÿ)61123undefined125168undefined170213undefined215254undefined256300undefined302390undefined550554(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined880883(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined11241127(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined13301334(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined16601663(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined18351838(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined20262030(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined23562359(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined25312534(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined27372740(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined30063009(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined33133316(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined34763480(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined38063809(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined39923995(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined41994202(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined44704473(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined47774780(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined49694972(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined52765279(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined55155519(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined58455848(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined60146017(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined63386342(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined66686671(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined68126815(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined84498463undefined85368545(0,_lib_auth__WEBPACK_IMPORTED_MODULE_3__/* .useSession */ .wV)undefined85698577(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)undefined86088616(0,_context_locale__WEBPACK_IMPORTED_MODULE_4__/* .useLocale */ .Y)undefined86678674(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined87158722(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined87358743(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined88668874(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined89208935(0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getNotifications */ .Tr)undefined90929102(0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .markAllRead */ .NL)undefined92949301(0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .markRead */ .Ip)undefined95469564(0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .dismissNotification */ .yk)undefined97079710(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1172411728(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1183511839(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1198111985(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1223912243(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1267712680(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1301213015(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1316213165(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1375313757(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1416514168(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1445214455(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1462814632(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1479814801(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1515315156(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1688216885(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1719817202(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1745917462(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1782417828(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1841218415(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1878618789(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1927619279(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1944719450(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined æôŒÿÿçgÂÿÿÏÐ ˇ«webpack/lib/util/registerExternalSerializerœwebpack-sources/ConcatSource€«webpack/lib/util/registerExternalSerializer™webpack-sources/RawSourced__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ PricingPage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(9664); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(next_link__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(7541); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(1592); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(9906); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(2982); /* harmony import */ var _components_PlanBadge__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(2035); «webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourceœz/* __next_internal_client_entry_do_not_use__ default auto */ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime"; import { useState, useEffect } from 'react'; import Link from 'next/link'; import { useRouter } from 'next/navigation'; import { useSession } from '@/lib/auth'; import { useLocale } from '@/context/locale'; import { getPlans, getMyDashboard, previewPlanChange, purchasePlan } from '@/lib/api'; import { PlanBadge } from '@/components/PlanBadge'; const FEATURE_ROWS = [ { key: 'maxMessagesPerDay', labelKey: 'pricing.feat.messages', format: (v)=>v === null ? '∞' : String(v) }, { key: 'maxOrdersPerDay', labelKey: 'pricing.feat.orders', format: (v)=>v === null ? '∞' : String(v) }, { key: 'canContactAll', labelKey: 'pricing.feat.contact_all' }, { key: 'canViewPhone', labelKey: 'pricing.feat.view_phone' }, { key: 'canShowContactInfo', labelKey: 'pricing.feat.show_contact' }, { key: 'hasFavorites', labelKey: 'pricing.feat.favorites' }, { key: 'hasVerifiedBadge', labelKey: 'pricing.feat.verified_badge' }, { key: 'hasGoogleCalendar', labelKey: 'pricing.feat.google_calendar' }, { key: 'hasPersonalSite', labelKey: 'pricing.feat.personal_site' }, { key: 'hasAutoResponse', labelKey: 'pricing.feat.auto_response' }, { key: 'hasAutoMatch', labelKey: 'pricing.feat.auto_match' }, { key: 'highlightedReviews', labelKey: 'pricing.feat.highlighted_reviews' }, { key: 'maxCards', labelKey: 'pricing.feat.cards', format: (v)=>v === null ? '∞' : String(v) }, { key: 'notifyNewTasks', labelKey: 'pricing.feat.notify_tasks' }, { key: 'canUploadVideo', labelKey: 'pricing.feat.video' } ]; function CheckIcon() { return /*#__PURE__*/ _jsx("svg", { viewBox: "0 0 20 20", fill: "currentColor", className: "w-5 h-5 text-green-500 mx-auto", children: /*#__PURE__*/ _jsx("path", { fillRule: "evenodd", d: "M16.704 4.153a.75.75 0 01.143 1.052l-8 10.5a.75.75 0 01-1.127.075l-4.5-4.5a.75.75 0 011.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 011.05-.143z", clipRule: "evenodd" }) }); } function XIcon() { return /*#__PURE__*/ _jsx("svg", { viewBox: "0 0 20 20", fill: "currentColor", className: "w-4 h-4 text-gray-300 mx-auto", children: /*#__PURE__*/ _jsx("path", { d: "M6.28 5.22a.75.75 0 00-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 101.06 1.06L10 11.06l3.72 3.72a.75.75 0 101.06-1.06L11.06 10l3.72-3.72a.75.75 0 00-1.06-1.06L10 8.94 6.28 5.22z" }) }); } const tierOrder = [ 'free', 'pro', 'ultimate' ]; const tierHeaderColors = { free: 'bg-gray-50 border-gray-200', pro: 'bg-green-50 border-green-200', ultimate: 'bg-gradient-to-br from-amber-50 to-yellow-50 border-amber-300' }; const tierPriceColors = { free: 'text-gray-700', pro: 'text-green-700', ultimate: 'text-amber-600' }; const tierBtnColors = { free: 'bg-gray-100 text-gray-700 hover:bg-gray-200', pro: 'bg-green-600 text-white hover:bg-green-700', ultimate: 'bg-gradient-to-r from-amber-500 to-yellow-500 text-white hover:from-amber-600 hover:to-yellow-600' }; export default function PricingPage() { const { data: session } = useSession(); const { t } = useLocale(); const router = useRouter(); const [plans, setPlans] = useState([]); const [currentPlanId, setCurrentPlanId] = useState(null); const [loading, setLoading] = useState(true); const [confirmPlan, setConfirmPlan] = useState(null); const [preview, setPreview] = useState(null); const [previewLoading, setPreviewLoading] = useState(false); const [purchasing, setPurchasing] = useState(false); // Fetch plans with abort to prevent stale race conditions useEffect(()=>{ let aborted = false; setLoading(true); getPlans().then((data)=>{ if (!aborted) setPlans(data.sort((a, b)=>tierOrder.indexOf(a.tier) - tierOrder.indexOf(b.tier))); }).catch(()=>{}).finally(()=>{ if (!aborted) setLoading(false); }); return ()=>{ aborted = true; }; }, []); const fetchCurrentPlan = ()=>{ if (!session) return; getMyDashboard().then((d)=>{ var _d_plan; var _d_plan_id; return setCurrentPlanId((_d_plan_id = (_d_plan = d.plan) === null || _d_plan === void 0 ? void 0 : _d_plan.id) !== null && _d_plan_id !== void 0 ? _d_plan_id : null); }).catch(()=>{}); }; useEffect(fetchCurrentPlan, [ session ]); // Refresh active plan when admin widget changes it useEffect(()=>{ const handler = ()=>fetchCurrentPlan(); window.addEventListener('canhelp:plan-changed', handler); document.addEventListener('visibilitychange', handler); return ()=>{ window.removeEventListener('canhelp:plan-changed', handler); document.removeEventListener('visibilitychange', handler); }; }, [ session ]); async function handleSelectPlan(plan) { if (!session) { router.push('/sign-in'); return; } setConfirmPlan(plan); setPreview(null); setPreviewLoading(true); try { const p = await previewPlanChange(plan.id); setPreview(p); } catch (e) { setConfirmPlan(null); } finally{ setPreviewLoading(false); } } async function handleConfirm() { if (!confirmPlan || !preview) return; setPurchasing(true); try { const result = await purchasePlan(confirmPlan.id, preview.canPayFromBalance); if (result.url && result.params) { const form = document.createElement('form'); form.method = 'POST'; form.action = result.url; Object.entries(result.params).forEach((param)=>{ let [k, v] = param; const inp = document.createElement('input'); inp.type = 'hidden'; inp.name = k; inp.value = v; form.appendChild(inp); }); document.body.appendChild(form); form.submit(); return; } setCurrentPlanId(confirmPlan.id); setConfirmPlan(null); setPreview(null); } catch (e) { // ignore } finally{ setPurchasing(false); } } const visibleFeatures = FEATURE_ROWS; return /*#__PURE__*/ _jsxs("main", { className: "min-h-screen py-12 px-4", children: [ /*#__PURE__*/ _jsxs("div", { className: "max-w-5xl mx-auto", children: [ /*#__PURE__*/ _jsxs("div", { className: "text-center mb-10", children: [ /*#__PURE__*/ _jsx("h1", { className: "text-4xl font-bold text-white mb-3", children: t('pricing.title', 'Pricing') }), /*#__PURE__*/ _jsx("p", { className: "text-white/70 text-lg", children: t('pricing.subtitle') }) ] }), loading ? /*#__PURE__*/ _jsx("div", { className: "text-center text-white/60 py-20", children: t('common.loading', 'Loading...') }) : /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx("div", { className: "grid grid-cols-1 md:grid-cols-3 gap-6 mb-12", children: plans.map((plan)=>{ const isCurrentPlan = plan.id === currentPlanId; const isFree = plan.tier === 'free'; return /*#__PURE__*/ _jsxs("div", { className: "rounded-2xl border-2 p-6 bg-white flex flex-col transition ".concat(isCurrentPlan ? 'ring-2 ring-green-500 ring-offset-2' : '', " ").concat(plan.tier === 'ultimate' ? 'border-amber-300 shadow-lg shadow-amber-100' : 'border-gray-200'), children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 mb-4", children: [ /*#__PURE__*/ _jsx(PlanBadge, { tier: plan.tier, size: "md" }), isCurrentPlan && /*#__PURE__*/ _jsx("span", { className: "text-xs font-medium text-green-600 bg-green-50 border border-green-200 px-2 py-0.5 rounded-full", children: t('pricing.current_plan', 'Your plan') }), plan.tier === 'pro' && !isCurrentPlan && /*#__PURE__*/ _jsx("span", { className: "text-xs font-medium text-green-600 bg-green-50 border border-green-100 px-2 py-0.5 rounded-full", children: t('pricing.popular', 'Popular') }) ] }), /*#__PURE__*/ _jsx("h2", { className: "text-xl font-bold text-gray-900 mb-1", children: plan.name }), /*#__PURE__*/ _jsx("p", { className: "text-gray-500 text-sm mb-4 min-h-[40px]", children: plan.description }), /*#__PURE__*/ _jsxs("div", { className: "text-3xl font-extrabold mb-1 ".concat(tierPriceColors[plan.tier]), children: [ isFree ? t('pricing.free', 'Free') : /*#__PURE__*/ _jsxs(_Fragment, { children: [ plan.oldPrice && /*#__PURE__*/ _jsxs("span", { className: "text-lg font-normal text-gray-400 line-through mr-2", children: [ "€", plan.oldPrice ] }), "€", plan.price ] }), !isFree && /*#__PURE__*/ _jsxs("span", { className: "text-base font-normal text-gray-400", children: [ "/", t('pricing.per_month', 'month') ] }) ] }), plan.durationDays && !isFree && /*#__PURE__*/ _jsxs("p", { className: "text-xs text-gray-400 mb-5", children: [ t('pricing.duration', 'Duration'), ": ", plan.durationDays, " ", t('pricing.days', 'days') ] }), isFree && /*#__PURE__*/ _jsx("div", { className: "mb-5" }), /*#__PURE__*/ _jsx("div", { className: "mt-auto", children: isCurrentPlan ? /*#__PURE__*/ _jsx("div", { className: "w-full py-2.5 text-center text-sm font-semibold text-green-700 bg-green-50 border border-green-200 rounded-xl", children: t('pricing.your_plan', 'Current plan') }) : isFree ? /*#__PURE__*/ _jsx("div", { className: "w-full py-2.5 text-center text-sm font-medium text-gray-400 bg-gray-50 border border-gray-200 rounded-xl", children: t('pricing.free_default', 'Default') }) : /*#__PURE__*/ _jsxs("button", { onClick: ()=>handleSelectPlan(plan), className: "block w-full py-2.5 text-center text-sm font-semibold rounded-xl transition ".concat(tierBtnColors[plan.tier]), children: [ t('pricing.choose', 'Choose'), " ", plan.name ] }) }) ] }, plan.id); }) }), /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-2xl border border-gray-200 overflow-hidden", children: [ /*#__PURE__*/ _jsx("div", { className: "px-6 py-4 border-b border-gray-100", children: /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-gray-900", children: t('pricing.compare', 'Feature comparison') }) }), /*#__PURE__*/ _jsx("div", { className: "overflow-x-auto", children: /*#__PURE__*/ _jsxs("table", { className: "w-full text-sm", children: [ /*#__PURE__*/ _jsx("thead", { children: /*#__PURE__*/ _jsxs("tr", { className: "border-b border-gray-100", children: [ /*#__PURE__*/ _jsx("th", { className: "text-left px-6 py-3 text-gray-500 font-medium w-1/2", children: t('pricing.feature', 'Feature') }), plans.map((plan)=>/*#__PURE__*/ _jsx("th", { className: "text-center px-4 py-3 font-medium text-gray-700", children: /*#__PURE__*/ _jsxs("div", { className: "flex flex-col items-center gap-1", children: [ /*#__PURE__*/ _jsx(PlanBadge, { tier: plan.tier, size: "sm" }), /*#__PURE__*/ _jsx("span", { className: "text-xs text-gray-400", children: plan.tier === 'free' ? t('pricing.free', 'Free') : "€".concat(plan.price) }) ] }) }, plan.id)) ] }) }), /*#__PURE__*/ _jsx("tbody", { children: visibleFeatures.map((param)=>{ let { key, labelKey, format } = param; return /*#__PURE__*/ _jsxs("tr", { className: "border-b border-gray-50 hover:bg-gray-50/50 transition", children: [ /*#__PURE__*/ _jsx("td", { className: "px-6 py-3 text-gray-600", children: t(labelKey, labelKey) }), plans.map((plan)=>{ const val = plan[key]; let cell; if (format) { cell = /*#__PURE__*/ _jsx("span", { className: "text-gray-700 font-medium", children: format(val) }); } else if (typeof val === 'boolean') { cell = val ? /*#__PURE__*/ _jsx(CheckIcon, {}) : /*#__PURE__*/ _jsx(XIcon, {}); } else { cell = /*#__PURE__*/ _jsx("span", { className: "text-gray-700", children: val === null ? '∞' : String(val !== null && val !== void 0 ? val : '—') }); } return /*#__PURE__*/ _jsx("td", { className: "text-center px-4 py-3", children: cell }, plan.id); }) ] }, key); }) }) ] }) }) ] }), /*#__PURE__*/ _jsx("p", { className: "text-center text-white/50 text-sm mt-8", children: t('pricing.faq_note', 'Payment is deducted from your CanHelp balance. Top up is available in Payments.') }) ] }) ] }), confirmPlan && /*#__PURE__*/ _jsx("div", { className: "fixed inset-0 z-50 flex items-center justify-center bg-black/50 px-4", children: /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-2xl shadow-2xl w-full max-w-md p-6", children: [ /*#__PURE__*/ _jsx("h2", { className: "text-lg font-bold text-gray-900 mb-4", children: t('pricing.confirm.title', 'Confirm plan selection') }), previewLoading ? /*#__PURE__*/ _jsx("div", { className: "py-10 text-center text-gray-400", children: t('common.loading', 'Loading...') }) : preview ? /*#__PURE__*/ _jsxs("div", { className: "space-y-3 text-sm text-gray-700", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex justify-between", children: [ /*#__PURE__*/ _jsx("span", { className: "text-gray-500", children: t('pricing.confirm.plan', 'Plan') }), /*#__PURE__*/ _jsx("span", { className: "font-semibold", children: confirmPlan.name }) ] }), preview.type === 'upgrade' && Number(preview.prorated) > 0 && /*#__PURE__*/ _jsxs("div", { className: "flex justify-between", children: [ /*#__PURE__*/ _jsx("span", { className: "text-gray-500", children: t('pricing.confirm.prorated', 'Prorated credit') }), /*#__PURE__*/ _jsxs("span", { className: "text-green-600 font-medium", children: [ "−€", preview.prorated ] }) ] }), preview.type !== 'downgrade' && /*#__PURE__*/ _jsxs("div", { className: "flex justify-between", children: [ /*#__PURE__*/ _jsx("span", { className: "text-gray-500", children: t('pricing.confirm.effective_price', 'To pay') }), /*#__PURE__*/ _jsxs("span", { className: "font-bold text-gray-900", children: [ "€", preview.effectivePrice ] }) ] }), preview.type !== 'downgrade' && /*#__PURE__*/ _jsxs("div", { className: "flex justify-between", children: [ /*#__PURE__*/ _jsx("span", { className: "text-gray-500", children: t('pricing.confirm.your_balance', 'Your balance') }), /*#__PURE__*/ _jsxs("span", { className: preview.canPayFromBalance ? 'text-green-600' : 'text-red-500', children: [ "€", preview.currentBalance ] }) ] }), preview.type === 'downgrade' && /*#__PURE__*/ _jsxs("div", { className: "bg-orange-50 border border-orange-200 rounded-xl p-3 text-orange-800 text-xs", children: [ t('pricing.confirm.downgrade_info', 'The switch to the new plan will happen automatically after the current period ends.'), preview.scheduledDate && /*#__PURE__*/ _jsxs(_Fragment, { children: [ " ", new Date(preview.scheduledDate).toLocaleDateString('ru-RU') ] }) ] }), preview.type !== 'downgrade' && !preview.canPayFromBalance && /*#__PURE__*/ _jsxs("div", { className: "bg-red-50 border border-red-200 rounded-xl p-3 text-red-700 text-xs", children: [ t('pricing.confirm.insufficient', 'Insufficient balance.'), ' ', /*#__PURE__*/ _jsx(Link, { href: "/payment", className: "underline font-medium", onClick: ()=>setConfirmPlan(null), children: t('pricing.confirm.top_up', 'Top up') }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-3 pt-2", children: [ /*#__PURE__*/ _jsx("button", { onClick: ()=>{ setConfirmPlan(null); setPreview(null); }, className: "flex-1 py-2.5 rounded-xl border border-gray-200 text-sm font-medium text-gray-600 hover:bg-gray-50 transition", children: t('common.cancel', 'Cancel') }), (preview.type === 'downgrade' || preview.canPayFromBalance) && /*#__PURE__*/ _jsx("button", { onClick: handleConfirm, disabled: purchasing, className: "flex-1 py-2.5 rounded-xl text-sm font-semibold text-white transition ".concat(preview.type === 'downgrade' ? 'bg-orange-500 hover:bg-orange-600' : tierBtnColors[confirmPlan.tier].replace('block w-full', '').trim(), " disabled:opacity-50"), children: purchasing ? t('common.loading', 'Loading...') : preview.type === 'downgrade' ? t('pricing.confirm.schedule_downgrade', 'Schedule switch') : t('pricing.confirm.pay', 'Pay') }) ] }) ] }) : null ] }) }) ] }); } aj=_’”¿ÁÝß  35acžºì  ©¬Ù Ü w z  Р(0HPs_z¯¶áè"MT”ÆÍ"ipâï ~†+r}RVŸÂ;_?ÐÓÀÃÍÐŒ’šíðj!n!# #î#ñ#ó#û#%%Ø&Û&Â(Å(à)ã)+ +8,_<,>,F,ê,î,,000Ž2ž2[5^566Á6Ä608389“9 =$=÷=ú=ž>¡>ç?ê?{@@KANA§A_«A¢B¥B7D:D"E&EVFYF[FcFÎGÑGKKL"LCMFMPP RR1R4RìRïRìTïT%X(XŽY_·YMZQZøZûZ\\×\Û\†]Š]B^E^S_V_Ò`Ö`Ža‘a®b²b³d·doeref‘f”h˜hPiSiqjRujœl lMnQnSn[nHpLpÄqÇqÉqÌq­s±sdtgtww€€€€€€€€¶(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)ÿÿÿ€¿(0,_lib_auth__WEBPACK_IMPORTED_MODULE_4__/* .useSession */ .wV)Ã(0,_context_locale__WEBPACK_IMPORTED_MODULE_5__/* .useLocale */ .Y)º(0,next_navigation__WEBPACK_IMPORTED_MODULE_3__.useRouter)¯(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)ÿÿÿÿÿÿ°(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)Œ(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getPlans */ .T9)Á(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getMyDashboard */ .H)ýýÅ(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .previewPlanChange */ .Cs)À(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .purchasePlan */ .Je)·(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)ÿÿõõõÿ·react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.FragmentôþþôÅ_components_PlanBadge__WEBPACK_IMPORTED_MODULE_7__/* .PlanBadge */ .dóóóóýýþýýýóóóóýýóóóýóýóóýóÿóóýóóóóóóóóýóóýýóóýóýýóýýóýýýþýó²(next_link__WEBPACK_IMPORTED_MODULE_2___default())üòòԐ__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ PricingPage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(9664); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(next_link__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(7541); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(1592); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(9906); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(2982); /* harmony import */ var _components_PlanBadge__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(2035); /* __next_internal_client_entry_do_not_use__ default auto */ const FEATURE_ROWS = [ { key: 'maxMessagesPerDay', labelKey: 'pricing.feat.messages', format: (v)=>v === null ? '∞' : String(v) }, { key: 'maxOrdersPerDay', labelKey: 'pricing.feat.orders', format: (v)=>v === null ? '∞' : String(v) }, { key: 'canContactAll', labelKey: 'pricing.feat.contact_all' }, { key: 'canViewPhone', labelKey: 'pricing.feat.view_phone' }, { key: 'canShowContactInfo', labelKey: 'pricing.feat.show_contact' }, { key: 'hasFavorites', labelKey: 'pricing.feat.favorites' }, { key: 'hasVerifiedBadge', labelKey: 'pricing.feat.verified_badge' }, { key: 'hasGoogleCalendar', labelKey: 'pricing.feat.google_calendar' }, { key: 'hasPersonalSite', labelKey: 'pricing.feat.personal_site' }, { key: 'hasAutoResponse', labelKey: 'pricing.feat.auto_response' }, { key: 'hasAutoMatch', labelKey: 'pricing.feat.auto_match' }, { key: 'highlightedReviews', labelKey: 'pricing.feat.highlighted_reviews' }, { key: 'maxCards', labelKey: 'pricing.feat.cards', format: (v)=>v === null ? '∞' : String(v) }, { key: 'notifyNewTasks', labelKey: 'pricing.feat.notify_tasks' }, { key: 'canUploadVideo', labelKey: 'pricing.feat.video' } ]; function CheckIcon() { return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { viewBox: "0 0 20 20", fill: "currentColor", className: "w-5 h-5 text-green-500 mx-auto", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { fillRule: "evenodd", d: "M16.704 4.153a.75.75 0 01.143 1.052l-8 10.5a.75.75 0 01-1.127.075l-4.5-4.5a.75.75 0 011.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 011.05-.143z", clipRule: "evenodd" }) }); } function XIcon() { return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { viewBox: "0 0 20 20", fill: "currentColor", className: "w-4 h-4 text-gray-300 mx-auto", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M6.28 5.22a.75.75 0 00-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 101.06 1.06L10 11.06l3.72 3.72a.75.75 0 101.06-1.06L11.06 10l3.72-3.72a.75.75 0 00-1.06-1.06L10 8.94 6.28 5.22z" }) }); } const tierOrder = [ 'free', 'pro', 'ultimate' ]; const tierHeaderColors = { free: 'bg-gray-50 border-gray-200', pro: 'bg-green-50 border-green-200', ultimate: 'bg-gradient-to-br from-amber-50 to-yellow-50 border-amber-300' }; const tierPriceColors = { free: 'text-gray-700', pro: 'text-green-700', ultimate: 'text-amber-600' }; const tierBtnColors = { free: 'bg-gray-100 text-gray-700 hover:bg-gray-200', pro: 'bg-green-600 text-white hover:bg-green-700', ultimate: 'bg-gradient-to-r from-amber-500 to-yellow-500 text-white hover:from-amber-600 hover:to-yellow-600' }; function PricingPage() { const { data: session } = (0,_lib_auth__WEBPACK_IMPORTED_MODULE_4__/* .useSession */ .wV)(); const { t } = (0,_context_locale__WEBPACK_IMPORTED_MODULE_5__/* .useLocale */ .Y)(); const router = (0,next_navigation__WEBPACK_IMPORTED_MODULE_3__.useRouter)(); const [plans, setPlans] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [currentPlanId, setCurrentPlanId] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [loading, setLoading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(true); const [confirmPlan, setConfirmPlan] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [preview, setPreview] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [previewLoading, setPreviewLoading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [purchasing, setPurchasing] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); // Fetch plans with abort to prevent stale race conditions (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ let aborted = false; setLoading(true); (0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getPlans */ .T9)().then((data)=>{ if (!aborted) setPlans(data.sort((a, b)=>tierOrder.indexOf(a.tier) - tierOrder.indexOf(b.tier))); }).catch(()=>{}).finally(()=>{ if (!aborted) setLoading(false); }); return ()=>{ aborted = true; }; }, []); const fetchCurrentPlan = ()=>{ if (!session) return; (0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getMyDashboard */ .H)().then((d)=>{ var _d_plan; var _d_plan_id; return setCurrentPlanId((_d_plan_id = (_d_plan = d.plan) === null || _d_plan === void 0 ? void 0 : _d_plan.id) !== null && _d_plan_id !== void 0 ? _d_plan_id : null); }).catch(()=>{}); }; (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(fetchCurrentPlan, [ session ]); // Refresh active plan when admin widget changes it (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ const handler = ()=>fetchCurrentPlan(); window.addEventListener('canhelp:plan-changed', handler); document.addEventListener('visibilitychange', handler); return ()=>{ window.removeEventListener('canhelp:plan-changed', handler); document.removeEventListener('visibilitychange', handler); }; }, [ session ]); async function handleSelectPlan(plan) { if (!session) { router.push('/sign-in'); return; } setConfirmPlan(plan); setPreview(null); setPreviewLoading(true); try { const p = await (0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .previewPlanChange */ .Cs)(plan.id); setPreview(p); } catch (e) { setConfirmPlan(null); } finally{ setPreviewLoading(false); } } async function handleConfirm() { if (!confirmPlan || !preview) return; setPurchasing(true); try { const result = await (0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .purchasePlan */ .Je)(confirmPlan.id, preview.canPayFromBalance); if (result.url && result.params) { const form = document.createElement('form'); form.method = 'POST'; form.action = result.url; Object.entries(result.params).forEach((param)=>{ let [k, v] = param; const inp = document.createElement('input'); inp.type = 'hidden'; inp.name = k; inp.value = v; form.appendChild(inp); }); document.body.appendChild(form); form.submit(); return; } setCurrentPlanId(confirmPlan.id); setConfirmPlan(null); setPreview(null); } catch (e) { // ignore } finally{ setPurchasing(false); } } const visibleFeatures = FEATURE_ROWS; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("main", { className: "min-h-screen py-12 px-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "max-w-5xl mx-auto", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "text-center mb-10", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h1", { className: "text-4xl font-bold text-white mb-3", children: t('pricing.title', 'Pricing') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-white/70 text-lg", children: t('pricing.subtitle') }) ] }), loading ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-center text-white/60 py-20", children: t('common.loading', 'Loading...') }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "grid grid-cols-1 md:grid-cols-3 gap-6 mb-12", children: plans.map((plan)=>{ const isCurrentPlan = plan.id === currentPlanId; const isFree = plan.tier === 'free'; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "rounded-2xl border-2 p-6 bg-white flex flex-col transition ".concat(isCurrentPlan ? 'ring-2 ring-green-500 ring-offset-2' : '', " ").concat(plan.tier === 'ultimate' ? 'border-amber-300 shadow-lg shadow-amber-100' : 'border-gray-200'), children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-2 mb-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components_PlanBadge__WEBPACK_IMPORTED_MODULE_7__/* .PlanBadge */ .d, { tier: plan.tier, size: "md" }), isCurrentPlan && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-xs font-medium text-green-600 bg-green-50 border border-green-200 px-2 py-0.5 rounded-full", children: t('pricing.current_plan', 'Your plan') }), plan.tier === 'pro' && !isCurrentPlan && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-xs font-medium text-green-600 bg-green-50 border border-green-100 px-2 py-0.5 rounded-full", children: t('pricing.popular', 'Popular') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "text-xl font-bold text-gray-900 mb-1", children: plan.name }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-gray-500 text-sm mb-4 min-h-[40px]", children: plan.description }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "text-3xl font-extrabold mb-1 ".concat(tierPriceColors[plan.tier]), children: [ isFree ? t('pricing.free', 'Free') : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [ plan.oldPrice && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "text-lg font-normal text-gray-400 line-through mr-2", children: [ "€", plan.oldPrice ] }), "€", plan.price ] }), !isFree && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "text-base font-normal text-gray-400", children: [ "/", t('pricing.per_month', 'month') ] }) ] }), plan.durationDays && !isFree && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { className: "text-xs text-gray-400 mb-5", children: [ t('pricing.duration', 'Duration'), ": ", plan.durationDays, " ", t('pricing.days', 'days') ] }), isFree && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "mb-5" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "mt-auto", children: isCurrentPlan ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "w-full py-2.5 text-center text-sm font-semibold text-green-700 bg-green-50 border border-green-200 rounded-xl", children: t('pricing.your_plan', 'Current plan') }) : isFree ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "w-full py-2.5 text-center text-sm font-medium text-gray-400 bg-gray-50 border border-gray-200 rounded-xl", children: t('pricing.free_default', 'Default') }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { onClick: ()=>handleSelectPlan(plan), className: "block w-full py-2.5 text-center text-sm font-semibold rounded-xl transition ".concat(tierBtnColors[plan.tier]), children: [ t('pricing.choose', 'Choose'), " ", plan.name ] }) }) ] }, plan.id); }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-2xl border border-gray-200 overflow-hidden", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "px-6 py-4 border-b border-gray-100", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h3", { className: "font-semibold text-gray-900", children: t('pricing.compare', 'Feature comparison') }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "overflow-x-auto", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("table", { className: "w-full text-sm", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("thead", { children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("tr", { className: "border-b border-gray-100", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "text-left px-6 py-3 text-gray-500 font-medium w-1/2", children: t('pricing.feature', 'Feature') }), plans.map((plan)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "text-center px-4 py-3 font-medium text-gray-700", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex flex-col items-center gap-1", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components_PlanBadge__WEBPACK_IMPORTED_MODULE_7__/* .PlanBadge */ .d, { tier: plan.tier, size: "sm" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-xs text-gray-400", children: plan.tier === 'free' ? t('pricing.free', 'Free') : "€".concat(plan.price) }) ] }) }, plan.id)) ] }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("tbody", { children: visibleFeatures.map((param)=>{ let { key, labelKey, format } = param; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("tr", { className: "border-b border-gray-50 hover:bg-gray-50/50 transition", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-6 py-3 text-gray-600", children: t(labelKey, labelKey) }), plans.map((plan)=>{ const val = plan[key]; let cell; if (format) { cell = /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-gray-700 font-medium", children: format(val) }); } else if (typeof val === 'boolean') { cell = val ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(CheckIcon, {}) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(XIcon, {}); } else { cell = /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-gray-700", children: val === null ? '∞' : String(val !== null && val !== void 0 ? val : '—') }); } return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "text-center px-4 py-3", children: cell }, plan.id); }) ] }, key); }) }) ] }) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-center text-white/50 text-sm mt-8", children: t('pricing.faq_note', 'Payment is deducted from your CanHelp balance. Top up is available in Payments.') }) ] }) ] }), confirmPlan && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "fixed inset-0 z-50 flex items-center justify-center bg-black/50 px-4", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-2xl shadow-2xl w-full max-w-md p-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "text-lg font-bold text-gray-900 mb-4", children: t('pricing.confirm.title', 'Confirm plan selection') }), previewLoading ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "py-10 text-center text-gray-400", children: t('common.loading', 'Loading...') }) : preview ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-3 text-sm text-gray-700", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex justify-between", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-gray-500", children: t('pricing.confirm.plan', 'Plan') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "font-semibold", children: confirmPlan.name }) ] }), preview.type === 'upgrade' && Number(preview.prorated) > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex justify-between", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-gray-500", children: t('pricing.confirm.prorated', 'Prorated credit') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "text-green-600 font-medium", children: [ "−€", preview.prorated ] }) ] }), preview.type !== 'downgrade' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex justify-between", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-gray-500", children: t('pricing.confirm.effective_price', 'To pay') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "font-bold text-gray-900", children: [ "€", preview.effectivePrice ] }) ] }), preview.type !== 'downgrade' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex justify-between", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-gray-500", children: t('pricing.confirm.your_balance', 'Your balance') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: preview.canPayFromBalance ? 'text-green-600' : 'text-red-500', children: [ "€", preview.currentBalance ] }) ] }), preview.type === 'downgrade' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-orange-50 border border-orange-200 rounded-xl p-3 text-orange-800 text-xs", children: [ t('pricing.confirm.downgrade_info', 'The switch to the new plan will happen automatically after the current period ends.'), preview.scheduledDate && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [ " ", new Date(preview.scheduledDate).toLocaleDateString('ru-RU') ] }) ] }), preview.type !== 'downgrade' && !preview.canPayFromBalance && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-red-50 border border-red-200 rounded-xl p-3 text-red-700 text-xs", children: [ t('pricing.confirm.insufficient', 'Insufficient balance.'), ' ', /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)((next_link__WEBPACK_IMPORTED_MODULE_2___default()), { href: "/payment", className: "underline font-medium", onClick: ()=>setConfirmPlan(null), children: t('pricing.confirm.top_up', 'Top up') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-3 pt-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>{ setConfirmPlan(null); setPreview(null); }, className: "flex-1 py-2.5 rounded-xl border border-gray-200 text-sm font-medium text-gray-600 hover:bg-gray-50 transition", children: t('common.cancel', 'Cancel') }), (preview.type === 'downgrade' || preview.canPayFromBalance) && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: handleConfirm, disabled: purchasing, className: "flex-1 py-2.5 rounded-xl text-sm font-semibold text-white transition ".concat(preview.type === 'downgrade' ? 'bg-orange-500 hover:bg-orange-600' : tierBtnColors[confirmPlan.tier].replace('block w-full', '').trim(), " disabled:opacity-50"), children: purchasing ? t('common.loading', 'Loading...') : preview.type === 'downgrade' ? t('pricing.confirm.schedule_downgrade', 'Schedule switch') : t('pricing.confirm.pay', 'Pay') }) ] }) ] }) : null ] }) }) ] }); } ÕØ Ùd__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ PricingPage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(9664); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(next_link__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(7541); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(1592); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(9906); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(2982); /* harmony import */ var _components_PlanBadge__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(2035); Ú}Ãÿÿ%61146undefined148191undefined193221undefined223266undefined268307undefined309353undefined355440undefined442492undefined20582061(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined22172220(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined25212524(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined26792682(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined35223536undefined35923601(0,_lib_auth__WEBPACK_IMPORTED_MODULE_4__/* .useSession */ .wV)undefined36243632(0,_context_locale__WEBPACK_IMPORTED_MODULE_5__/* .useLocale */ .Y)undefined36563664(0,next_navigation__WEBPACK_IMPORTED_MODULE_3__.useRouter)undefined36993706(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined37593766(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined38093816(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined38673874(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined39173924(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined39813988(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined40384045(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined41224130(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined42014208(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getPlans */ .T9)undefined45784591(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getMyDashboard */ .H)undefined48764884(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined49904998(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined56595675(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .previewPlanChange */ .Cs)undefined60026013(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .purchasePlan */ .Je)undefined69946998(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined71027106(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined72277231(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined73767379(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined76167619(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined78857888(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined80768080(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined80828090react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragmentundefined81738176(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined85548558(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined89668970(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined91989201(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined92039211_components_PlanBadge__WEBPACK_IMPORTED_MODULE_7__/* .PlanBadge */ .dundefined94959498(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined99449947(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1043410437(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1072010723(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1101511019(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1132011324(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1132611334react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragmentundefined1149811502(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1233212336(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1298012984(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1365913662(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1384513848(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1401714020(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1438414387(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1473514739(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1564815652(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1586315866(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1603016033(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1635916362(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1650716511(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1671516718(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1680716811(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1705817061(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1746317466(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1769817702(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1800618009(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1801118019_components_PlanBadge__WEBPACK_IMPORTED_MODULE_7__/* .PlanBadge */ .dundefined1838218385(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1920519208(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1948619490(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1977919782(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2049420497(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2100521008(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2104121044(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2122821231(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2174021743(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2256522568(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2296422967(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2311723121(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2328823291(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2355423557(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2376723771(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2394223946(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2413024133(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2440324406(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2478624790(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2497424977(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2526225266(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2577925783(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2596725970(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2625326257(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2677226776(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2696026963(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2724927253(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2780427808(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2823728241(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2824328251react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragmentundefined2874428748(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2912429127(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2912929132(next_link__WEBPACK_IMPORTED_MODULE_2___default())undefined2961329617(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2979629799(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3046730470(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined ÛèétŒÿÿÜzÃÿÿÄÅ /­«webpack/lib/util/registerExternalSerializerœwebpack-sources/ConcatSource€«webpack/lib/util/registerExternalSerializer™webpack-sources/RawSource+__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ AdminPage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7541); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(9664); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(next_link__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(1592); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(9906); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(2982); /* harmony import */ var _lib_formatName__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(1258); /* harmony import */ var _lib_taskLocale__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(4017); /* harmony import */ var _components_CategoryIcon__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(5940); «webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourceÞ;/* __next_internal_client_entry_do_not_use__ default auto */ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime"; import { useState, useEffect, useRef } from 'react'; import { useRouter } from 'next/navigation'; import Link from 'next/link'; import { useSession } from '@/lib/auth'; import { useLocale } from '@/context/locale'; import * as api from '@/lib/api'; import { request } from '@/lib/api'; import { formatShortName } from '@/lib/formatName'; import { formatPrice } from '@/lib/taskLocale'; import { CategoryIcon } from '@/components/CategoryIcon'; const TEMPLATE_VARS = { 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' ] }; const TEMPLATE_HINT_VARS = Array.from(new Set(Object.values(TEMPLATE_VARS).flat())); const DEFAULT_CATEGORY_ICON_PRESETS = [ { 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 getCatLabel(row, locale) { if (!row) return ''; if (locale === 'en') return row.namesEn || row.namesEl || row.slug || ''; if (locale === 'ru') return row.namesRu || row.namesEl || row.slug || ''; if (locale === 'uk') return row.namesUk || row.namesEl || row.slug || ''; return row.namesEl || row.namesEn || row.slug || ''; } function getLocLabel(row, locale) { if (!row) return ''; if (locale === 'en') return row.nameEn || row.nameEl || row.slug || ''; if (locale === 'ru') return row.nameRu || row.nameEl || row.slug || ''; if (locale === 'uk') return row.nameUk || row.nameEl || row.slug || ''; return row.nameEl || row.nameEn || row.slug || ''; } function CategoryIconPicker(param) { let { value, onChange, onUpload, uploading, error, presets } = param; return /*#__PURE__*/ _jsxs("div", { className: "space-y-2", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 rounded-xl border border-gray-200 bg-white px-3 py-2", children: [ /*#__PURE__*/ _jsx("div", { className: "flex h-12 w-12 items-center justify-center rounded-lg bg-green-50", children: /*#__PURE__*/ _jsx(CategoryIcon, { icon: value, alt: "category icon", className: "h-9 w-9 object-contain text-3xl leading-none", fallback: "\uD83D\uDCE6" }) }), /*#__PURE__*/ _jsx("input", { value: value, onChange: (e)=>onChange(e.target.value), className: "flex-1 border-0 bg-transparent p-0 text-sm outline-none ring-0", placeholder: "/category-icons/package.svg" }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2", children: [ /*#__PURE__*/ _jsxs("label", { className: "inline-flex cursor-pointer items-center rounded-lg border px-3 py-1.5 text-xs font-medium transition ".concat(uploading ? 'border-gray-200 bg-gray-100 text-gray-400' : 'border-green-300 bg-green-50 text-green-700 hover:bg-green-100'), children: [ uploading ? 'Uploading...' : 'Upload SVG', /*#__PURE__*/ _jsx("input", { type: "file", accept: ".svg,image/svg+xml", className: "hidden", disabled: uploading, onChange: async (e)=>{ var _e_target_files; const file = (_e_target_files = e.target.files) === null || _e_target_files === void 0 ? void 0 : _e_target_files[0]; if (!file) return; await onUpload(file); e.target.value = ''; } }) ] }), /*#__PURE__*/ _jsx("span", { className: "text-xs text-gray-500", children: "or choose from presets" }) ] }), /*#__PURE__*/ _jsx("p", { className: "text-[11px] text-gray-500", children: "Preset source: /public/category-icons/presets.json" }), error ? /*#__PURE__*/ _jsx("p", { className: "text-xs text-red-600", children: error }) : null, /*#__PURE__*/ _jsx("div", { className: "grid grid-cols-2 gap-2 sm:grid-cols-3 lg:grid-cols-4", children: presets.map((preset)=>{ const active = value === preset.value; return /*#__PURE__*/ _jsxs("button", { type: "button", onClick: ()=>onChange(preset.value), className: "flex h-20 flex-col items-center justify-center gap-1 rounded-lg border px-2 transition ".concat(active ? 'border-green-500 bg-green-50 shadow-sm' : 'border-gray-200 bg-white hover:border-green-300 hover:bg-green-50'), "aria-label": preset.label, title: preset.label, children: [ /*#__PURE__*/ _jsx(CategoryIcon, { icon: preset.value, alt: preset.label, className: "h-8 w-8 object-contain text-3xl leading-none", fallback: "\uD83D\uDCE6" }), /*#__PURE__*/ _jsx("span", { className: "max-w-full truncate text-[11px] font-medium text-gray-600 leading-tight", children: preset.label }) ] }, preset.value); }) }) ] }); } function AdminCatPicker(param) { let { catRows, locale, selected, onAdd, addLabel } = param; const [open, setOpen] = useState(false); const [search, setSearch] = useState(''); const [expandedParent, setExpandedParent] = useState(null); const ref = useRef(null); useEffect(()=>{ function h(e) { if (ref.current && !ref.current.contains(e.target)) { setOpen(false); setSearch(''); } } document.addEventListener('mousedown', h); return ()=>document.removeEventListener('mousedown', h); }, []); const parents = catRows.filter((r)=>!r.parentId); const lowerSearch = search.toLowerCase(); const matchesSearch = (r)=>{ var _r_slug; return !search || getCatLabel(r, locale).toLowerCase().includes(lowerSearch) || ((_r_slug = r.slug) !== null && _r_slug !== void 0 ? _r_slug : '').toLowerCase().includes(lowerSearch); }; return /*#__PURE__*/ _jsxs("div", { className: "relative", ref: ref, children: [ /*#__PURE__*/ _jsxs("button", { type: "button", onClick: ()=>setOpen((v)=>!v), className: "w-full flex items-center gap-1.5 px-3 py-1.5 text-xs transition-colors ".concat(open ? '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: [ /*#__PURE__*/ _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: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4 6h16M4 10h16M4 14h16M4 18h16" }) }), /*#__PURE__*/ _jsx("span", { className: "flex-1 text-left truncate", children: addLabel }), /*#__PURE__*/ _jsx("svg", { className: "w-3 h-3 text-gray-400 shrink-0 transition-transform ".concat(open ? 'rotate-180' : ''), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19 9l-7 7-7-7" }) }) ] }), open && /*#__PURE__*/ _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: [ /*#__PURE__*/ _jsx("div", { className: "sticky top-0 bg-white px-3 py-2 border-b border-gray-100", children: /*#__PURE__*/ _jsx("input", { autoFocus: true, value: search, onChange: (e)=>setSearch(e.target.value), placeholder: "ППОск...", className: "w-full text-xs border border-gray-200 rounded-lg px-2.5 py-1.5 focus:outline-none focus:ring-2 focus:ring-blue-300" }) }), parents.map((parent)=>{ const children = catRows.filter((r)=>r.parentId === parent.id); const parentLabel = getCatLabel(parent, locale); const isExpanded = expandedParent === parent.id; const matchingChildren = children.filter((c)=>!selected.includes(c.slug) && matchesSearch(c)); const parentAvail = !selected.includes(parent.slug) && matchesSearch(parent); const hasChildren = children.length > 0; if (!parentAvail && matchingChildren.length === 0 && search) return null; return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _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: ()=>{ if (hasChildren && !search) { setExpandedParent(isExpanded ? null : parent.id); } else if (parentAvail) { onAdd(parent.slug); setOpen(false); setSearch(''); } }, children: [ parent.icon ? /*#__PURE__*/ _jsx(CategoryIcon, { icon: parent.icon, alt: parentLabel, className: "h-5 w-5 shrink-0 object-contain text-sm leading-none", fallback: "\uD83D\uDCE6" }) : null, /*#__PURE__*/ _jsx("span", { className: "flex-1 font-medium", children: parentLabel }), hasChildren && !search ? /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5 text-gray-400 shrink-0 transition-transform ".concat(isExpanded ? 'rotate-90' : ''), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 5l7 7-7 7" }) }) : null ] }), (isExpanded || !!search) && matchingChildren.map((child)=>/*#__PURE__*/ _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: ()=>{ onAdd(child.slug); setOpen(false); setSearch(''); }, children: [ /*#__PURE__*/ _jsx("span", { className: "w-1.5 h-1.5 rounded-full bg-gray-300 shrink-0" }), /*#__PURE__*/ _jsx("span", { className: "flex-1", children: getCatLabel(child, locale) }) ] }, child.id)) ] }, parent.id); }) ] }) ] }); } function AdminLocPicker(param) { let { locRows, locale, selected, onAdd, addLabel } = param; const [open, setOpen] = useState(false); const [search, setSearch] = useState(''); const [expandedCity, setExpandedCity] = useState(null); const ref = useRef(null); useEffect(()=>{ function h(e) { if (ref.current && !ref.current.contains(e.target)) { setOpen(false); setSearch(''); } } document.addEventListener('mousedown', h); return ()=>document.removeEventListener('mousedown', h); }, []); const cities = locRows.filter((r)=>!r.parentId); const lowerSearch = search.toLowerCase(); const matchesSearch = (r)=>{ var _r_slug; return !search || getLocLabel(r, locale).toLowerCase().includes(lowerSearch) || ((_r_slug = r.slug) !== null && _r_slug !== void 0 ? _r_slug : '').toLowerCase().includes(lowerSearch); }; return /*#__PURE__*/ _jsxs("div", { className: "relative", ref: ref, children: [ /*#__PURE__*/ _jsxs("button", { type: "button", onClick: ()=>setOpen((v)=>!v), className: "w-full flex items-center gap-1.5 px-3 py-1.5 text-xs transition-colors ".concat(open ? '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: [ /*#__PURE__*/ _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: [ /*#__PURE__*/ _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" }), /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 11a3 3 0 11-6 0 3 3 0 016 0z" }) ] }), /*#__PURE__*/ _jsx("span", { className: "flex-1 text-left truncate", children: addLabel }), /*#__PURE__*/ _jsx("svg", { className: "w-3 h-3 text-gray-400 shrink-0 transition-transform ".concat(open ? 'rotate-180' : ''), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19 9l-7 7-7-7" }) }) ] }), open && /*#__PURE__*/ _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: [ /*#__PURE__*/ _jsx("div", { className: "sticky top-0 bg-white px-3 py-2 border-b border-gray-100", children: /*#__PURE__*/ _jsx("input", { autoFocus: true, value: search, onChange: (e)=>setSearch(e.target.value), placeholder: "ППОск...", className: "w-full text-xs border border-gray-200 rounded-lg px-2.5 py-1.5 focus:outline-none focus:ring-2 focus:ring-blue-300" }) }), cities.map((city)=>{ const districts = locRows.filter((r)=>r.parentId === city.id); const cityLabel = getLocLabel(city, locale); const isExpanded = expandedCity === city.id; const hasDistricts = districts.length > 0; const matchingDistricts = districts.filter((d)=>!selected.includes(d.slug) && matchesSearch(d)); const cityAvail = !selected.includes(city.slug) && matchesSearch(city); if (!cityAvail && matchingDistricts.length === 0 && search) return null; return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _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: ()=>{ if (hasDistricts && !search) { setExpandedCity(isExpanded ? null : city.id); } else if (cityAvail) { onAdd(city.slug); setOpen(false); setSearch(''); } }, children: [ /*#__PURE__*/ _jsx("svg", { className: "w-3 h-3 text-gray-300 shrink-0", fill: "currentColor", viewBox: "0 0 24 24", children: /*#__PURE__*/ _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" }) }), /*#__PURE__*/ _jsx("span", { className: "flex-1 font-medium", children: cityLabel }), hasDistricts && !search ? /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5 text-gray-400 shrink-0 transition-transform ".concat(isExpanded ? 'rotate-90' : ''), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 5l7 7-7 7" }) }) : null ] }), (isExpanded || !!search) && matchingDistricts.map((d)=>/*#__PURE__*/ _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: ()=>{ onAdd(d.slug); setOpen(false); setSearch(''); }, children: [ /*#__PURE__*/ _jsx("span", { className: "w-1.5 h-1.5 rounded-full bg-gray-300 shrink-0" }), /*#__PURE__*/ _jsx("span", { className: "flex-1", children: getLocLabel(d, locale) }) ] }, d.id)) ] }, city.id); }) ] }) ] }); } export default function AdminPage() { var _session_user, _stats_tokensByMonth; const router = useRouter(); const { data: session, isPending } = useSession(); const { t, locale } = useLocale(); const [tab, setTab] = useState('stats'); const [sidebarCollapsed, setSidebarCollapsed] = useState(false); useEffect(()=>{ setSidebarCollapsed(window.innerWidth < 1024); }, []); // Stats const [stats, setStats] = useState(null); // Users const [users, setUsers] = useState([]); const [usersPage, setUsersPage] = useState(1); const [usersTotal, setUsersTotal] = useState(0); const [usersQ, setUsersQ] = useState(''); const [usersQInput, setUsersQInput] = useState(''); const [usersRole, setUsersRole] = useState(''); // Tasks const [tasks, setTasks] = useState([]); const [tasksPage, setTasksPage] = useState(1); const [tasksTotal, setTasksTotal] = useState(0); const [tasksQ, setTasksQ] = useState(''); const [tasksQInput, setTasksQInput] = useState(''); const [tasksStatus, setTasksStatus] = useState(''); // Reports const [reports, setReports] = useState([]); const [reportsPage, setReportsPage] = useState(1); const [reportsTotal, setReportsTotal] = useState(0); const [pendingReportsCount, setPendingReportsCount] = useState(0); // Specialist card moderation const [moderationCards, setModerationCards] = useState([]); const [moderationCardsPage, setModerationCardsPage] = useState(1); const [moderationCardsTotal, setModerationCardsTotal] = useState(0); const [moderationCardsLoading, setModerationCardsLoading] = useState(false); const [pendingCardsCount, setPendingCardsCount] = useState(0); // Support tickets const [supportTickets, setSupportTickets] = useState([]); const [supportPage, setSupportPage] = useState(1); const [supportTotal, setSupportTotal] = useState(0); const [supportStatus, setSupportStatus] = useState(''); const [supportType, setSupportType] = useState(''); const [supportQ, setSupportQ] = useState(''); const [supportQInput, setSupportQInput] = useState(''); const [supportReplyId, setSupportReplyId] = useState(null); const [supportReplyText, setSupportReplyText] = useState(''); const [supportReplySaving, setSupportReplySaving] = useState(false); // AI Logs const [logs, setLogs] = useState([]); const [logsPage, setLogsPage] = useState(1); const [logsTotal, setLogsTotal] = useState(0); // Activity Logs const [activityLog, setActivityLog] = useState([]); const [activityTotal, setActivityTotal] = useState(0); const [activityPage, setActivityPage] = useState(1); const [activityEvent, setActivityEvent] = useState(''); const [activityUserId, setActivityUserId] = useState(''); const [activityDateFrom, setActivityDateFrom] = useState(''); const [activityDateTo, setActivityDateTo] = useState(''); const [activityEventTypes, setActivityEventTypes] = useState([]); // Mail Logs const [mailLog, setMailLog] = useState([]); const [mailTotal, setMailTotal] = useState(0); const [mailPage, setMailPage] = useState(1); const [mailEvent, setMailEvent] = useState(''); const [mailDateFrom, setMailDateFrom] = useState(''); const [mailDateTo, setMailDateTo] = useState(''); const [mailEventTypes, setMailEventTypes] = useState([]); // Logs sub-tab const [logsSubTab, setLogsSubTab] = useState('ai'); // Notification Logs const [notifLogs, setNotifLogs] = useState([]); const [notifLogsPage, setNotifLogsPage] = useState(1); const [notifLogsTotal, setNotifLogsTotal] = useState(0); const [notifLogsType, setNotifLogsType] = useState(''); const [notifLogsTypes, setNotifLogsTypes] = useState([]); const [notifLogsDateFrom, setNotifLogsDateFrom] = useState(''); const [notifLogsDateTo, setNotifLogsDateTo] = useState(''); // Notification stats chart const [notifsByDay, setNotifsByDay] = useState([]); const [mailByDay, setMailByDay] = useState([]); // Balance archive const [balanceRows, setBalanceRows] = useState([]); const [balanceTotal, setBalanceTotal] = useState(0); const [balancePage, setBalancePage] = useState(1); const [balanceUserId, setBalanceUserId] = useState(''); const [balanceKind, setBalanceKind] = useState(''); const [topUpSaving, setTopUpSaving] = useState(false); const [withdrawSaving, setWithdrawSaving] = useState(false); // User edit modal const [editUser, setEditUser] = useState(null); const [editUserSaving, setEditUserSaving] = useState(false); const [verifyingEmail, setVerifyingEmail] = useState(false); const [editUserTab, setEditUserTab] = useState('profile'); const [balanceModal, setBalanceModal] = useState(null); const [skillInput, setSkillInput] = useState(''); const [editUserCards, setEditUserCards] = useState([]); const [editUserCardsLoading, setEditUserCardsLoading] = useState(false); const [cardSkillInputs, setCardSkillInputs] = useState({}); const [cardSaving, setCardSaving] = useState({}); const [cardCatSelects, setCardCatSelects] = useState({}); const [cardLocSelects, setCardLocSelects] = useState({}); // Plans const [planRows, setPlanRows] = useState([]); const [planForm, setPlanForm] = useState(null); const [planSaving, setPlanSaving] = useState(false); // Locations const [locRows, setLocRows] = useState([]); const [locForm, setLocForm] = useState(null); const [locSaving, setLocSaving] = useState(false); const [locExpanded, setLocExpanded] = useState(new Set()); // Categories const [catRows, setCatRows] = useState([]); const [catForm, setCatForm] = useState(null); const [catSaving, setCatSaving] = useState(false); const [catExpanded, setCatExpanded] = useState(new Set()); const [catIconUploading, setCatIconUploading] = useState(false); const [catIconError, setCatIconError] = useState(null); const [categoryIconPresets, setCategoryIconPresets] = useState(DEFAULT_CATEGORY_ICON_PRESETS); // Category Skills const [catSkillsExpanded, setCatSkillsExpanded] = useState(new Set()); const [catSkillsCache, setCatSkillsCache] = useState({}); const [catSkillsLoading, setCatSkillsLoading] = useState(new Set()); const [skillForm, setSkillForm] = useState(null); const [skillSaving, setSkillSaving] = useState(false); // Settings const [settingsTab, setSettingsTab] = useState('general'); const [generalForm, setGeneralForm] = useState({ siteName: 'CanHelp', siteUrl: '', contactEmail: '', supportPhone: '' }); const [generalSaving, setGeneralSaving] = useState(false); const [generalSaved, setGeneralSaved] = useState(false); const [smtpForm, setSmtpForm] = useState({ host: '', port: '587', username: '', password: '', fromName: 'CanHelp', fromEmail: '', encryption: 'tls' }); const [smtpSaving, setSmtpSaving] = useState(false); const [smtpSaved, setSmtpSaved] = useState(false); const [testEmailSending, setTestEmailSending] = useState(false); const [testEmailResult, setTestEmailResult] = useState(null); const [notifTemplates, setNotifTemplates] = useState({ email_verification: { subject: 'ППЎтверЎОте ваш email — {{siteName}}', body: '' }, registration_success: { subject: 'ДПбрП пПжалПвать в {{siteName}}!', body: '' }, password_reset: { subject: 'ВПсстаМПвлеМОе парПля — {{siteName}}', body: '' }, new_offer: { subject: 'НПвПе преЎлПжеМОе пП вашей заЎаче «{{taskTitle}}»', body: '' }, new_task: { subject: 'НПвая заЎача: {{taskTitle}}', body: '' }, offer_accepted: { subject: 'Ваше преЎлПжеМОе прОМятП: {{taskTitle}}', body: '

Ваше преЎлПжеМОе прОМятП! 🎉

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

ЗаказчОк прОМял ваше преЎлПжеМОе Ма выпПлМеМОе заЎачО:

{{taskTitle}}

СуЌЌа: {{price}}€

Открыть чат →' }, new_message: { subject: 'НПвПе сППбщеМОе Пт {{senderName}}', body: '

НПвПе сППбщеМОе

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

ВаЌ МапОсал(а) {{senderName}}:

"{{preview}}"

ОтветОть →' }, offer_declined: { subject: 'Ваше преЎлПжеМОе ПтклПМеМП: {{taskTitle}}', body: '

Ваше преЎлПжеМОе ПтклПМеМП

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

К сПжалеМОю, заказчОк ПтклПМОл ваше преЎлПжеМОе Ма:

{{taskTitle}}

НайтО ЎругОе заказы →' }, offer_other_accepted: { subject: 'ВыбраМ ЎругПй ОспПлМОтель: {{taskTitle}}', body: '

ВыбраМ ЎругПй ОспПлМОтель

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

ЗаказчОк выбрал ЎругПгП ОспПлМОтеля Ўля заЎаМОя:

{{taskTitle}}

НайтО ЎругОе заказы →' }, task_updated: { subject: 'ЗаЎаМОе ПбМПвлеМП: {{taskTitle}}', body: '

ЗаЎаМОе ПбМПвлеМП

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

ЗаказчОк ПбМПвОл ЎеталО заЎаМОя:

{{taskTitle}}

СЌПтреть заказ →' }, deadline_reminder: { subject: 'ЗаЎаМОе Остекает завтра: {{taskTitle}}', body: '

НапПЌОМаМОе П ЎеЎлайМе

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

Ваше заЎаМОе Остекает через 24 часа. ОбМПвОте ЎеЎлайМ, ОМаче заЎаМОе буЎет автПЌатОческО сМятП с публОкацОО.

{{taskTitle}}

РеЎактОрПвать заЎаМОе →' }, task_archived: { subject: 'ЗаЎаМОе сМятП с публОкацОО: {{taskTitle}}', body: '

ЗаЎаМОе перевеЎеМП в черМПвОк

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

Ваше заЎаМОе ОстеклП О былП автПЌатОческО перевеЎеМП в черМПвОк. ОбМПвОте ЎеЎлайМ, чтПбы ПпублОкПвать егП сМПва.

{{taskTitle}}

РеЎактОрПвать заЎаМОе →' }, referral_reward: { subject: 'Вы пПлучОлО реферальМую МаграЎу — {{siteName}}', body: '

Вы пПлучОлО реферальМую МаграЎу! 🎁

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

Друг зарегОстрОрПвался пП вашей реферальМПй ссылке. На ваш аккауМт ЎПбавлеМП {{days}} ЎМей ЎПступа к плаМу {{planName}}!

+{{days}} ЎМей — {{planName}}

ПерейтО к аккауМту →' }, referral_reward_el: { subject: 'Λάβατε αΜταΌοιβή παραποΌπής — {{siteName}}', body: '

Λάβατε αΜταΌοιβή παραποΌπής! 🎁

Γεια {{userName}},

ΈΜας φίλος εγγράφηκε χρησιΌοποιώΜτας τοΜ σύΜΎεσΌο παραποΌπής σας. ΣτοΜ λογαριασΌό σας προστέΞηκαΜ {{days}} ηΌέρες πρόσβασης στο πλάΜο {{planName}}!

+{{days}} ηΌέρες — {{planName}}

Δες τοΜ λογαριασΌό σου →' }, referral_reward_en: { subject: 'You received a referral reward — {{siteName}}', body: '

You received a referral reward! 🎁

Hi {{userName}},

A friend registered using your referral link. {{days}} days of {{planName}} access have been added to your account!

+{{days}} days — {{planName}}

View your account →' }, referral_reward_ru: { subject: 'Вы пПлучОлО реферальМую МаграЎу — {{siteName}}', body: '

Вы пПлучОлО реферальМую МаграЎу! 🎁

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

Друг зарегОстрОрПвался пП вашей реферальМПй ссылке. На ваш аккауМт ЎПбавлеМП {{days}} ЎМей ЎПступа к плаМу {{planName}}!

+{{days}} ЎМей — {{planName}}

ПерейтО к аккауМту →' } }); const [editingTemplate, setEditingTemplate] = useState(null); const [templateLocale, setTemplateLocale] = useState('el'); const [templateSaving, setTemplateSaving] = useState(false); const [templateTranslating, setTemplateTranslating] = useState(false); const [ePayForm, setEPayForm] = useState({ merchantId: '', apiUser: '', apiPassword: '', environment: 'test', confirmationUrl: '', cancelUrl: '', enabled: false }); const [ePaySaving, setEPaySaving] = useState(false); const [ePaySaved, setEPaySaved] = useState(false); const [referralForm, setReferralForm] = useState({ enabled: false, planId: '', days: '30' }); const [referralSaving, setReferralSaving] = useState(false); const [referralSaved, setReferralSaved] = useState(false); const [seoForm, setSeoForm] = useState({ maintenanceMode: false, indexingEnabled: true, headScripts: '', siteTitleEl: '', siteTitleEn: '', siteTitleRu: '', siteTitleUk: '', siteDescriptionEl: '', siteDescriptionEn: '', siteDescriptionRu: '', siteDescriptionUk: '' }); const [seoSaving, setSeoSaving] = useState(false); const [seoSaved, setSeoSaved] = useState(false); const [seoLangTab, setSeoLangTab] = useState('el'); const [socialForm, setSocialForm] = useState({ telegram: '', instagram: '', facebook: '', twitter: '', youtube: '', tiktok: '', whatsapp: '', viber: '' }); const [socialSaving, setSocialSaving] = useState(false); const [socialSaved, setSocialSaved] = useState(false); const [telegramForm, setTelegramForm] = useState({ botToken: '', adminChatId: '', channelIdEl: '', channelIdEn: '', channelIdRu: '', channelIdUk: '', notifyRegistrations: false, postNewTasks: false }); const [telegramSaving, setTelegramSaving] = useState(false); const [telegramSaved, setTelegramSaved] = useState(false); const [testingTelegramAdmin, setTestingTelegramAdmin] = useState(false); const [testingTelegramChannel, setTestingTelegramChannel] = useState(false); const [testResultTelegramAdmin, setTestResultTelegramAdmin] = useState(null); const [testResultTelegramChannel, setTestResultTelegramChannel] = useState(null); const [testingLocale, setTestingLocale] = useState(null); const [testResultChannels, setTestResultChannels] = useState({}); const [verifyingTelegramToken, setVerifyingTelegramToken] = useState(false); const [verifyResultTelegramToken, setVerifyResultTelegramToken] = useState(null); // Backup const [backupAutoEnabled, setBackupAutoEnabled] = useState(false); const [backupAutoSaving, setBackupAutoSaving] = useState(false); const [backupTables, setBackupTables] = useState([]); const [backupTablesLoading, setBackupTablesLoading] = useState(false); const [backupStoredFiles, setBackupStoredFiles] = useState([]); const [backupExporting, setBackupExporting] = useState(false); const [backupImporting, setBackupImporting] = useState(null); const [backupRestoring, setBackupRestoring] = useState(null); const [backupMsg, setBackupMsg] = useState(null); const [backupMsgError, setBackupMsgError] = useState(false); const setBackupSuccess = (msg)=>{ setBackupMsg(msg); setBackupMsgError(false); }; const setBackupError = (msg)=>{ setBackupMsg(msg); setBackupMsgError(true); }; // ─── Translations state ─────────────────────────────────────────────────── const [transStats, setTransStats] = useState(null); const [transStatsLoading, setTransStatsLoading] = useState(false); const [transLang, setTransLang] = useState('uk'); const [transFromLang, setTransFromLang] = useState('el'); const [transTableTranslating, setTransTableTranslating] = useState({}); const [transMsg, setTransMsg] = useState(null); const [transPreview, setTransPreview] = useState(null); // ─── Referrals state ───────────────────────────────────────────────────── const [referralsData, setReferralsData] = useState(null); const [referralsLoading, setReferralsLoading] = useState(false); const [referralsExpanded, setReferralsExpanded] = useState(new Set()); // ─── Push state ────────────────────────────────────────────────────────── const [pushMode, setPushMode] = useState('broadcast'); const [pushTargetUserId, setPushTargetUserId] = useState(''); const [pushTitle, setPushTitle] = useState(''); const [pushBody, setPushBody] = useState(''); const [pushType, setPushType] = useState('general'); const [pushReferenceId, setPushReferenceId] = useState(''); const [pushOnlyActive, setPushOnlyActive] = useState(true); const [pushSending, setPushSending] = useState(false); const [pushResult, setPushResult] = useState(null); const [pushError, setPushError] = useState(null); const [loading, setLoading] = useState(false); const isAdmin = !isPending && session && ((_session_user = session.user) === null || _session_user === void 0 ? void 0 : _session_user.role) === 'admin'; useEffect(()=>{ var _session_user; if (!isPending && !session) router.push('/login'); if (!isPending && session && ((_session_user = session.user) === null || _session_user === void 0 ? void 0 : _session_user.role) !== 'admin') router.push('/'); }, [ session, isPending ]); useEffect(()=>{ if (!isAdmin) return; api.getAdminStats().then(setStats).catch(()=>{}); api.getAdminNotifStats().then(setNotifsByDay).catch(()=>{}); api.getAdminMailStats().then(setMailByDay).catch(()=>{}); api.getAdminReports(1, 'pending').then((d)=>setPendingReportsCount(d.total)).catch(()=>{}); api.getAdminSpecialistCards(1, 'pending').then((d)=>setPendingCardsCount(d.total)).catch(()=>{}); }, [ isAdmin ]); useEffect(()=>{ if (!isAdmin || tab !== 'users') return; setLoading(true); api.getAdminUsers(usersPage, usersQ || undefined, usersRole || undefined).then((d)=>{ setUsers(d.data); setUsersTotal(d.total); }).catch(()=>{}).finally(()=>setLoading(false)); }, [ isAdmin, tab, usersPage, usersQ, usersRole ]); useEffect(()=>{ if (!isAdmin || tab !== 'tasks') return; setLoading(true); api.getAdminTasks(tasksPage, tasksQ || undefined, tasksStatus || undefined).then((d)=>{ setTasks(d.data); setTasksTotal(d.total); }).catch(()=>{}).finally(()=>setLoading(false)); }, [ isAdmin, tab, tasksPage, tasksQ, tasksStatus ]); useEffect(()=>{ if (!isAdmin || tab !== 'reports') return; setLoading(true); api.getAdminReports(reportsPage).then((d)=>{ setReports(d.data); setReportsTotal(d.total); }).catch(()=>{}).finally(()=>setLoading(false)); }, [ isAdmin, tab, reportsPage ]); useEffect(()=>{ if (!isAdmin || tab !== 'moderation') return; setModerationCardsLoading(true); api.getAdminSpecialistCards(moderationCardsPage, 'review').then((d)=>{ setModerationCards(d.data); setModerationCardsTotal(d.total); }).catch(()=>{}).finally(()=>setModerationCardsLoading(false)); }, [ isAdmin, tab, moderationCardsPage ]); useEffect(()=>{ if (!isAdmin || tab !== 'support') return; setLoading(true); const params = { page: String(supportPage), limit: '30' }; if (supportStatus) params.status = supportStatus; if (supportType) params.type = supportType; if (supportQ) params.q = supportQ; api.getAdminSupportTickets(params).then((d)=>{ setSupportTickets(d.data); setSupportTotal(d.total); }).catch(()=>{}).finally(()=>setLoading(false)); }, [ isAdmin, tab, supportPage, supportStatus, supportType, supportQ ]); useEffect(()=>{ if (!isAdmin || tab !== 'balances') return; setLoading(true); api.getAdminBalanceHistory({ page: balancePage, userId: balanceUserId || undefined, kind: balanceKind || undefined }).then((d)=>{ setBalanceRows(d.data); setBalanceTotal(d.total); }).catch(()=>{}).finally(()=>setLoading(false)); }, [ isAdmin, tab, balancePage, balanceUserId, balanceKind ]); useEffect(()=>{ if (!isAdmin || tab !== 'logs') return; if (logsSubTab === 'ai') { setLoading(true); api.getAdminAiLogs(logsPage).then((d)=>{ setLogs(d.data); setLogsTotal(d.total); }).catch(()=>{}).finally(()=>setLoading(false)); } else if (logsSubTab === 'activity') { api.getAdminActivityLogs({ page: activityPage, event: activityEvent || undefined, userId: activityUserId || undefined, dateFrom: activityDateFrom || undefined, dateTo: activityDateTo || undefined }).then((d)=>{ var _d_eventTypes; setActivityLog(d.data); setActivityTotal(d.total); if ((_d_eventTypes = d.eventTypes) === null || _d_eventTypes === void 0 ? void 0 : _d_eventTypes.length) setActivityEventTypes(d.eventTypes); }).catch(()=>{}); } else if (logsSubTab === 'mail') { api.getAdminMailLogs({ page: mailPage, event: mailEvent || undefined, dateFrom: mailDateFrom || undefined, dateTo: mailDateTo || undefined }).then((d)=>{ var _d_eventTypes; setMailLog(d.data); setMailTotal(d.total); if ((_d_eventTypes = d.eventTypes) === null || _d_eventTypes === void 0 ? void 0 : _d_eventTypes.length) setMailEventTypes(d.eventTypes); }).catch(()=>{}); } else if (logsSubTab === 'notifications') { api.getAdminNotifLogs({ page: notifLogsPage, type: notifLogsType || undefined, dateFrom: notifLogsDateFrom || undefined, dateTo: notifLogsDateTo || undefined }).then((d)=>{ var _d_notifTypes; setNotifLogs(d.data); setNotifLogsTotal(d.total); if ((_d_notifTypes = d.notifTypes) === null || _d_notifTypes === void 0 ? void 0 : _d_notifTypes.length) setNotifLogsTypes(d.notifTypes); }).catch(()=>{}); } }, [ isAdmin, tab, logsSubTab, logsPage, activityPage, activityEvent, activityUserId, activityDateFrom, activityDateTo, mailPage, mailEvent, mailDateFrom, mailDateTo, notifLogsPage, notifLogsType, notifLogsDateFrom, notifLogsDateTo ]); useEffect(()=>{ setActivityPage(1); }, [ activityEvent, activityUserId, activityDateFrom, activityDateTo ]); useEffect(()=>{ setMailPage(1); }, [ mailEvent, mailDateFrom, mailDateTo ]); useEffect(()=>{ setNotifLogsPage(1); }, [ notifLogsType, notifLogsDateFrom, notifLogsDateTo ]); useEffect(()=>{ if (!isAdmin || tab !== 'plans') return; api.getAdminPlans().then(setPlanRows).catch(()=>{}); }, [ isAdmin, tab ]); useEffect(()=>{ if (!isAdmin || tab !== 'translations') return; setTransStatsLoading(true); api.getTranslationsStats().then((d)=>setTransStats(d.tables)).catch(()=>{}).finally(()=>setTransStatsLoading(false)); }, [ isAdmin, tab ]); useEffect(()=>{ if (!isAdmin || tab !== 'backup') return; request('/admin/backup/settings').then((d)=>setBackupAutoEnabled(!!d.autoEnabled)).catch(()=>{}); setBackupTablesLoading(true); request('/admin/backup/tables').then((d)=>setBackupTables(d.tables || [])).catch(()=>{}).finally(()=>setBackupTablesLoading(false)); request('/admin/backup/list').then((d)=>setBackupStoredFiles(d.files || [])).catch(()=>{}); }, [ isAdmin, tab ]); useEffect(()=>{ if (!isAdmin || tab !== 'referrals') return; setReferralsLoading(true); api.getAdminReferrals().then((d)=>setReferralsData(d)).catch(()=>{}).finally(()=>setReferralsLoading(false)); }, [ isAdmin, tab ]); // Load plans when users tab opens (for plan selector in edit modal) useEffect(()=>{ if (!isAdmin || tab !== 'users') return; if (planRows.length === 0) api.getAdminPlans().then(setPlanRows).catch(()=>{}); }, [ isAdmin, tab ]); // Reset page when filters change useEffect(()=>{ setUsersPage(1); }, [ usersQ, usersRole ]); useEffect(()=>{ setTasksPage(1); }, [ tasksQ, tasksStatus ]); useEffect(()=>{ setBalancePage(1); }, [ balanceUserId, balanceKind ]); async function sendAdminPush() { if (!pushTitle.trim()) return; if (pushMode === 'user' && !pushTargetUserId.trim()) { setPushError('УкажОте ID пПльзПвателя'); return; } setPushSending(true); setPushError(null); setPushResult(null); try { const payload = { title: pushTitle.trim(), body: pushBody.trim() || undefined, type: pushType.trim() || undefined, referenceId: pushReferenceId.trim() || undefined }; if (pushMode === 'broadcast') { const res = await api.adminBroadcastPush({ ...payload, onlyActive: pushOnlyActive }); setPushResult(res); } else { const res = await api.adminSendPushToUser(pushTargetUserId.trim(), payload); setPushResult(res); } } catch (err) { setPushError((err === null || err === void 0 ? void 0 : err.message) || 'Не уЎалПсь ПтправОть push'); } finally{ setPushSending(false); } } async function toggleUser(id, isActive) { const fn = isActive ? api.deactivateUser : api.activateUser; const updated = await fn(id).catch(()=>null); if (updated) setUsers((prev)=>prev.map((u)=>u.id === id ? updated : u)); } async function changeRole(id, role) { const updated = await api.changeUserRole(id, role).catch(()=>null); if (updated) setUsers((prev)=>prev.map((u)=>u.id === id ? updated : u)); } function openEditUser(u) { setEditUserTab('profile'); setSkillInput(''); setBalanceModal(null); setEditUserCards([]); setCardSkillInputs({}); setCardSaving({}); setCardCatSelects({}); setCardLocSelects({}); setEditUser({ ...u, topUpAmount: '', topUpDescription: '', withdrawAmount: '', withdrawDescription: '' }); api.getAdminUser(u.id).then((fresh)=>setEditUser((prev)=>prev && prev.id === fresh.id ? { ...fresh, topUpAmount: '', topUpDescription: '', withdrawAmount: '', withdrawDescription: '' } : prev)).catch(()=>{}); } function describeFcmFailure(key, message) { if (!key) return message || 'FCM прОМял 0 сППбщеМОй'; if (key === 'THIRD_PARTY_AUTH_ERROR') { return 'ОшОбка APNs/Firebase iOS: прПверьте Apple APNs Auth Key (.p8) О связку Firebase прПекта Ўля iOS-прОлПжеМОя'; } if (key === 'UNREGISTERED') { return 'ТПкеМ устрПйства бПльше Ме валОЎеМ'; } if (key === 'INVALID_ARGUMENT') { return 'НекПрректМый тПкеМ ОлО payload'; } if (key === 'REQUEST_FAILED') { return message || 'FCM request failed before response'; } return message ? "".concat(key, ": ").concat(message) : key; } async function saveEditUser() { if (!editUser) return; setEditUserSaving(true); try { var _editUser_languages, _editUser_showContactInfo, _editUser_notifyNewTasks, _editUser_notifMessages, _editUser_skills, _editUser_siteSettings; const updated = await api.updateAdminUser(editUser.id, { firstName: editUser.firstName, lastName: editUser.lastName, phone: editUser.phone || null, bio: editUser.bio || null, role: editUser.role, planId: editUser.planId || null, isActive: editUser.isActive, locale: editUser.locale, languages: (_editUser_languages = editUser.languages) !== null && _editUser_languages !== void 0 ? _editUser_languages : [], personalSiteSlug: editUser.personalSiteSlug || null, showContactInfo: (_editUser_showContactInfo = editUser.showContactInfo) !== null && _editUser_showContactInfo !== void 0 ? _editUser_showContactInfo : false, notifyNewTasks: (_editUser_notifyNewTasks = editUser.notifyNewTasks) !== null && _editUser_notifyNewTasks !== void 0 ? _editUser_notifyNewTasks : false, notifMessages: (_editUser_notifMessages = editUser.notifMessages) !== null && _editUser_notifMessages !== void 0 ? _editUser_notifMessages : true, skills: (_editUser_skills = editUser.skills) !== null && _editUser_skills !== void 0 ? _editUser_skills : [], siteSettings: (_editUser_siteSettings = editUser.siteSettings) !== null && _editUser_siteSettings !== void 0 ? _editUser_siteSettings : {} }); await Promise.all(editUserCards.map((card)=>{ var _card_skills, _card_categories, _card_locations; return api.adminUpdateSpecialistCard(card.id, { title: card.title, description: card.description || null, skills: (_card_skills = card.skills) !== null && _card_skills !== void 0 ? _card_skills : [], categories: (_card_categories = card.categories) !== null && _card_categories !== void 0 ? _card_categories : [], locations: (_card_locations = card.locations) !== null && _card_locations !== void 0 ? _card_locations : [], publicationStatus: card.publicationStatus, isActive: card.isActive }).catch(()=>null); })); setUsers((prev)=>prev.map((u)=>u.id === editUser.id ? updated : u)); setEditUser(null); } catch (e) {} finally{ setEditUserSaving(false); } } async function verifyEmail() { if (!editUser) return; setVerifyingEmail(true); try { const updated = await api.verifyAdminUserEmail(editUser.id); setEditUser((u)=>u ? { ...u, emailVerified: updated.emailVerified } : u); setUsers((prev)=>prev.map((u)=>u.id === editUser.id ? { ...u, emailVerified: updated.emailVerified } : u)); } catch (e) {} finally{ setVerifyingEmail(false); } } async function handleAdminTopUp() { if (!editUser) return; const amount = Number(editUser.topUpAmount); if (!amount || amount <= 0) return; setTopUpSaving(true); try { const result = await api.adminTopUpUserBalance(editUser.id, { amount, description: editUser.topUpDescription || undefined }); setUsers((prev)=>prev.map((u)=>u.id === editUser.id ? result.user : u)); setEditUser((prev)=>prev ? { ...prev, ...result.user, topUpAmount: '', topUpDescription: '' } : prev); if (tab === 'balances') { api.getAdminBalanceHistory({ page: balancePage, userId: balanceUserId || undefined, kind: balanceKind || undefined }).then((d)=>{ setBalanceRows(d.data); setBalanceTotal(d.total); }).catch(()=>{}); } } catch (e) { // ignore } finally{ setTopUpSaving(false); } } async function handleAdminWithdraw() { if (!editUser) return; const amount = Number(editUser.withdrawAmount); if (!amount || amount <= 0) return; setWithdrawSaving(true); try { const result = await api.adminWithdrawUserBalance(editUser.id, { amount, description: editUser.withdrawDescription || undefined }); setUsers((prev)=>prev.map((u)=>u.id === editUser.id ? result.user : u)); setEditUser((prev)=>prev ? { ...prev, ...result.user, withdrawAmount: '', withdrawDescription: '' } : prev); if (tab === 'balances') { api.getAdminBalanceHistory({ page: balancePage, userId: balanceUserId || undefined, kind: balanceKind || undefined }).then((d)=>{ setBalanceRows(d.data); setBalanceTotal(d.total); }).catch(()=>{}); } } catch (e) { // ignore } finally{ setWithdrawSaving(false); } } async function saveCard(cardId) { const card = editUserCards.find((c)=>c.id === cardId); if (!card) return; setCardSaving((prev)=>({ ...prev, [cardId]: true })); try { var _card_skills, _card_categories, _card_locations; const updated = await api.adminUpdateSpecialistCard(cardId, { title: card.title, description: card.description || null, skills: (_card_skills = card.skills) !== null && _card_skills !== void 0 ? _card_skills : [], categories: (_card_categories = card.categories) !== null && _card_categories !== void 0 ? _card_categories : [], locations: (_card_locations = card.locations) !== null && _card_locations !== void 0 ? _card_locations : [], publicationStatus: card.publicationStatus, isActive: card.isActive }); setEditUserCards((prev)=>prev.map((c)=>c.id === cardId ? updated : c)); } catch (e) {} finally{ setCardSaving((prev)=>({ ...prev, [cardId]: false })); } } async function updateModerationCard(cardId, publicationStatus) { const updated = await api.adminUpdateSpecialistCard(cardId, { publicationStatus, isActive: publicationStatus === 'active' }).catch(()=>null); if (!updated) return; setModerationCards((prev)=>prev.map((card)=>card.id === cardId ? updated : card)); if ((editUser === null || editUser === void 0 ? void 0 : editUser.id) === updated.specialistId) { setEditUserCards((prev)=>prev.map((card)=>card.id === cardId ? updated : card)); } api.getAdminReports(1, 'pending').then((d)=>setPendingReportsCount(d.total)).catch(()=>{}); api.getAdminSpecialistCards(1, 'pending').then((d)=>setPendingCardsCount(d.total)).catch(()=>{}); } async function cancelTask(id) { const updated = await api.cancelTaskAdmin(id).catch(()=>null); if (updated) { const task = updated.task || updated; setTasks((prev)=>prev.map((row)=>{ const t = row.task || row; return t.id === id ? { ...row, task: task } : row; })); } } async function deleteTask(id, title) { if (!window.confirm("".concat(t('admin.tasks.delete.confirm'), '\n"').concat(title, '"'))) return; const ok = await api.deleteTaskAdmin(id).catch(()=>null); if (ok) setTasks((prev)=>prev.filter((row)=>{ var _row_task; return (((_row_task = row.task) === null || _row_task === void 0 ? void 0 : _row_task.id) || row.id) !== id; })); } async function handleReport(id, status) { const updated = await api.updateReportStatus(id, status).catch(()=>null); if (updated) setReports((prev)=>prev.map((r)=>r.id === id ? { ...r, ...updated } : r)); } // Locations useEffect(()=>{ if (!isAdmin || tab !== 'locations') return; api.getAdminLocations().then(setLocRows).catch(()=>{}); }, [ isAdmin, tab ]); function openAddLoc(parentId) { setLocForm({ parentId: parentId !== null && parentId !== void 0 ? parentId : null, slug: '', nameEl: '', nameEn: '', nameRu: '', nameUk: '', order: 0, isActive: true }); } function openEditLoc(loc) { var _loc_names, _loc_names1, _loc_names2, _loc_names3; var _loc_parentId, _loc_nameEl, _ref, _loc_nameEn, _ref1, _loc_nameRu, _ref2, _loc_nameUk, _ref3, _loc_order, _loc_isActive; setLocForm({ id: loc.id, parentId: (_loc_parentId = loc.parentId) !== null && _loc_parentId !== void 0 ? _loc_parentId : null, slug: loc.slug, nameEl: (_ref = (_loc_nameEl = loc.nameEl) !== null && _loc_nameEl !== void 0 ? _loc_nameEl : (_loc_names = loc.names) === null || _loc_names === void 0 ? void 0 : _loc_names.el) !== null && _ref !== void 0 ? _ref : '', nameEn: (_ref1 = (_loc_nameEn = loc.nameEn) !== null && _loc_nameEn !== void 0 ? _loc_nameEn : (_loc_names1 = loc.names) === null || _loc_names1 === void 0 ? void 0 : _loc_names1.en) !== null && _ref1 !== void 0 ? _ref1 : '', nameRu: (_ref2 = (_loc_nameRu = loc.nameRu) !== null && _loc_nameRu !== void 0 ? _loc_nameRu : (_loc_names2 = loc.names) === null || _loc_names2 === void 0 ? void 0 : _loc_names2.ru) !== null && _ref2 !== void 0 ? _ref2 : '', nameUk: (_ref3 = (_loc_nameUk = loc.nameUk) !== null && _loc_nameUk !== void 0 ? _loc_nameUk : (_loc_names3 = loc.names) === null || _loc_names3 === void 0 ? void 0 : _loc_names3.uk) !== null && _ref3 !== void 0 ? _ref3 : '', order: (_loc_order = loc.order) !== null && _loc_order !== void 0 ? _loc_order : 0, isActive: (_loc_isActive = loc.isActive) !== null && _loc_isActive !== void 0 ? _loc_isActive : true }); } async function saveLoc() { if (!locForm) return; setLocSaving(true); try { if (locForm.id) { const updated = await api.updateLocation(locForm.id, locForm); setLocRows((prev)=>prev.map((r)=>r.id === locForm.id ? updated : r)); } else { const created = await api.createLocation({ slug: locForm.slug, nameEl: locForm.nameEl, nameEn: locForm.nameEn, nameRu: locForm.nameRu, nameUk: locForm.nameUk, parentId: locForm.parentId, order: locForm.order }); setLocRows((prev)=>[ ...prev, created ]); } setLocForm(null); } catch (e) { // ignore } finally{ setLocSaving(false); } } async function deleteLoc(id, name) { if (!window.confirm("".concat(t('admin.loc.delete.confirm'), '\n"').concat(name, '"'))) return; const ok = await api.deleteLocation(id).catch(()=>null); if (ok) setLocRows((prev)=>prev.filter((r)=>r.id !== id)); } function toggleLocExpand(id) { setLocExpanded((prev)=>{ const next = new Set(prev); next.has(id) ? next.delete(id) : next.add(id); return next; }); } // Categories useEffect(()=>{ if (!isAdmin || tab !== 'categories') return; api.getAdminCategories().then(setCatRows).catch(()=>{}); }, [ isAdmin, tab ]); useEffect(()=>{ if (!isAdmin) return; fetch('/category-icons/presets.json').then((res)=>res.ok ? res.json() : Promise.reject(new Error('Failed to load presets'))).then((data)=>{ if (!Array.isArray(data)) return; const cleaned = data.filter((x)=>!!x && typeof x === 'object' && typeof x.value === 'string' && typeof x.label === 'string').filter((x)=>x.value.startsWith('/category-icons/')); if (cleaned.length > 0) setCategoryIconPresets(cleaned); }).catch(()=>{}); }, [ isAdmin ]); function openAddCat(parentId) { setCatIconError(null); setCatForm({ parentId: parentId !== null && parentId !== void 0 ? parentId : null, slug: '', icon: '/category-icons/package.svg', namesEl: '', namesEn: '', namesRu: '', namesUk: '', order: 0, isActive: true }); } function openEditCat(cat) { var _cat_names, _cat_names1, _cat_names2, _cat_names3; const selectedIcon = typeof cat.icon === 'string' ? cat.icon : ''; const knownPreset = new Set(categoryIconPresets.map((p)=>p.value)); const normalizedIcon = selectedIcon.startsWith('/category-icons/') && !knownPreset.has(selectedIcon) ? '/category-icons/package.svg' : selectedIcon || '/category-icons/package.svg'; setCatIconError(null); var _cat_parentId, _cat_namesEl, _ref, _cat_namesEn, _ref1, _cat_namesRu, _ref2, _cat_namesUk, _ref3, _cat_order, _cat_isActive; setCatForm({ id: cat.id, parentId: (_cat_parentId = cat.parentId) !== null && _cat_parentId !== void 0 ? _cat_parentId : null, slug: cat.slug, icon: normalizedIcon, namesEl: (_ref = (_cat_namesEl = cat.namesEl) !== null && _cat_namesEl !== void 0 ? _cat_namesEl : (_cat_names = cat.names) === null || _cat_names === void 0 ? void 0 : _cat_names.el) !== null && _ref !== void 0 ? _ref : '', namesEn: (_ref1 = (_cat_namesEn = cat.namesEn) !== null && _cat_namesEn !== void 0 ? _cat_namesEn : (_cat_names1 = cat.names) === null || _cat_names1 === void 0 ? void 0 : _cat_names1.en) !== null && _ref1 !== void 0 ? _ref1 : '', namesRu: (_ref2 = (_cat_namesRu = cat.namesRu) !== null && _cat_namesRu !== void 0 ? _cat_namesRu : (_cat_names2 = cat.names) === null || _cat_names2 === void 0 ? void 0 : _cat_names2.ru) !== null && _ref2 !== void 0 ? _ref2 : '', namesUk: (_ref3 = (_cat_namesUk = cat.namesUk) !== null && _cat_namesUk !== void 0 ? _cat_namesUk : (_cat_names3 = cat.names) === null || _cat_names3 === void 0 ? void 0 : _cat_names3.uk) !== null && _ref3 !== void 0 ? _ref3 : '', order: (_cat_order = cat.order) !== null && _cat_order !== void 0 ? _cat_order : 0, isActive: (_cat_isActive = cat.isActive) !== null && _cat_isActive !== void 0 ? _cat_isActive : true }); } async function uploadCategoryIcon(file) { if (file.type !== 'image/svg+xml') { setCatIconError('Only SVG files are allowed'); return; } setCatIconUploading(true); setCatIconError(null); try { const fd = new FormData(); fd.append('file', file); const base = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; const res = await fetch("".concat(base, "/api/uploads"), { method: 'POST', credentials: 'include', body: fd }); if (!res.ok) { const err = await res.json().catch(()=>({ error: 'Upload failed' })); throw new Error(err.error || 'Upload failed'); } const data = await res.json(); setCatForm((f)=>f ? { ...f, icon: data.url } : f); } catch (err) { setCatIconError((err === null || err === void 0 ? void 0 : err.message) || 'Upload failed'); } finally{ setCatIconUploading(false); } } async function saveCat() { if (!catForm) return; setCatSaving(true); try { if (catForm.id) { const updated = await api.updateCategory(catForm.id, catForm); setCatRows((prev)=>prev.map((r)=>r.id === catForm.id ? updated : r)); } else { const created = await api.createCategory({ slug: catForm.slug, icon: catForm.icon, namesEl: catForm.namesEl, namesEn: catForm.namesEn, namesRu: catForm.namesRu, namesUk: catForm.namesUk, parentId: catForm.parentId, order: catForm.order }); setCatRows((prev)=>[ ...prev, created ]); } setCatForm(null); } catch (e) { // ignore } finally{ setCatSaving(false); } } async function deleteCat(id, name) { if (!window.confirm("".concat(t('admin.cat.delete.confirm'), '\n"').concat(name, '"'))) return; const ok = await api.deleteCategory(id).catch(()=>null); if (ok) setCatRows((prev)=>prev.filter((r)=>r.id !== id)); } function toggleCatExpand(id) { setCatExpanded((prev)=>{ const next = new Set(prev); next.has(id) ? next.delete(id) : next.add(id); return next; }); } async function toggleCatSkills(cat) { const id = cat.id; const slug = cat.slug; setCatSkillsExpanded((prev)=>{ const next = new Set(prev); if (next.has(id)) { next.delete(id); return next; } next.add(id); return next; }); if (!catSkillsCache[slug]) { setCatSkillsLoading((prev)=>new Set(prev).add(id)); try { const skills = await api.getAdminSkills(slug); setCatSkillsCache((prev)=>({ ...prev, [slug]: skills })); } catch (e) {} finally{ setCatSkillsLoading((prev)=>{ const n = new Set(prev); n.delete(id); return n; }); } } } function openAddSkill(catSlug) { setSkillForm({ catSlug, nameEl: '', nameEn: '', nameRu: '', nameUk: '', order: 0 }); } function openEditSkill(skill, catSlug) { var _skill_nameEl, _skill_nameEn, _skill_nameRu, _skill_nameUk, _skill_order; setSkillForm({ id: skill.id, catSlug, nameEl: (_skill_nameEl = skill.nameEl) !== null && _skill_nameEl !== void 0 ? _skill_nameEl : '', nameEn: (_skill_nameEn = skill.nameEn) !== null && _skill_nameEn !== void 0 ? _skill_nameEn : '', nameRu: (_skill_nameRu = skill.nameRu) !== null && _skill_nameRu !== void 0 ? _skill_nameRu : '', nameUk: (_skill_nameUk = skill.nameUk) !== null && _skill_nameUk !== void 0 ? _skill_nameUk : '', order: (_skill_order = skill.order) !== null && _skill_order !== void 0 ? _skill_order : 0 }); } async function saveSkill() { if (!skillForm) return; setSkillSaving(true); try { if (skillForm.id) { const updated = await api.updateSkill(skillForm.id, { nameEl: skillForm.nameEl, nameEn: skillForm.nameEn, nameRu: skillForm.nameRu, nameUk: skillForm.nameUk, order: skillForm.order }); setCatSkillsCache((prev)=>{ var _prev_skillForm_catSlug; return { ...prev, [skillForm.catSlug]: ((_prev_skillForm_catSlug = prev[skillForm.catSlug]) !== null && _prev_skillForm_catSlug !== void 0 ? _prev_skillForm_catSlug : []).map((s)=>s.id === skillForm.id ? updated : s) }; }); } else { const created = await api.createSkill({ categorySlug: skillForm.catSlug, nameEl: skillForm.nameEl, nameEn: skillForm.nameEn, nameRu: skillForm.nameRu, nameUk: skillForm.nameUk, order: skillForm.order }); setCatSkillsCache((prev)=>{ var _prev_skillForm_catSlug; return { ...prev, [skillForm.catSlug]: [ ...(_prev_skillForm_catSlug = prev[skillForm.catSlug]) !== null && _prev_skillForm_catSlug !== void 0 ? _prev_skillForm_catSlug : [], created ] }; }); } setSkillForm(null); } catch (e) {} finally{ setSkillSaving(false); } } async function deleteSkill(skill, catSlug) { if (!skill._skipConfirm && !window.confirm('УЎалОть Мавык "'.concat(skill.nameEl, '"?'))) return; const ok = skill._skipConfirm ? true : await api.deleteSkill(skill.id).catch(()=>null); if (ok) { setCatSkillsCache((prev)=>{ var _prev_catSlug; return { ...prev, [catSlug]: ((_prev_catSlug = prev[catSlug]) !== null && _prev_catSlug !== void 0 ? _prev_catSlug : []).filter((s)=>s.id !== skill.id) }; }); } } function openAddPlan() { setPlanForm({ 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: false, isActive: true, order: 0, notifyNewTasks: false, canContactFreePlan: false, canContactProPlan: true, canContactAll: false, canShowContactInfo: false, canViewPhone: false, canUploadVideo: false, hasFavorites: false, hasGoogleCalendar: false, hasVerifiedBadge: false, highlightedReviews: false, hasPersonalSite: false, hasCanHelpNowStatus: false, hasNeedHelpStatus: false, hasAutoResponse: false, hasAutoMatch: false, hasPriceList: false, receiveInstantDispatchFree: false, receiveInstantDispatchPro: false }); } function openEditPlan(plan) { var _plan_description, _plan_role, _plan_tier, _plan_price, _plan_oldPrice, _plan_currency, _plan_searchBoost, _plan_offersMultiplier, _plan_features, _plan_isDefault, _plan_isActive, _plan_order, _plan_notifyNewTasks, _plan_canContactFreePlan, _plan_canContactProPlan, _plan_canContactAll, _plan_canShowContactInfo, _plan_canViewPhone, _plan_canUploadVideo, _plan_hasFavorites, _plan_hasGoogleCalendar, _plan_hasVerifiedBadge, _plan_highlightedReviews, _plan_hasPersonalSite, _plan_hasCanHelpNowStatus, _plan_hasNeedHelpStatus, _plan_hasAutoResponse, _plan_hasAutoMatch, _plan_hasPriceList, _plan_receiveInstantDispatchFree, _plan_receiveInstantDispatchPro; setPlanForm({ id: plan.id, name: plan.name, description: (_plan_description = plan.description) !== null && _plan_description !== void 0 ? _plan_description : '', role: (_plan_role = plan.role) !== null && _plan_role !== void 0 ? _plan_role : 'customer', tier: (_plan_tier = plan.tier) !== null && _plan_tier !== void 0 ? _plan_tier : 'free', price: (_plan_price = plan.price) !== null && _plan_price !== void 0 ? _plan_price : '0', oldPrice: (_plan_oldPrice = plan.oldPrice) !== null && _plan_oldPrice !== void 0 ? _plan_oldPrice : '', currency: (_plan_currency = plan.currency) !== null && _plan_currency !== void 0 ? _plan_currency : 'EUR', maxTasks: plan.maxTasks != null ? String(plan.maxTasks) : '', maxOffers: plan.maxOffers != null ? String(plan.maxOffers) : '', maxCards: plan.maxCards != null ? String(plan.maxCards) : '', maxMessagesPerDay: plan.maxMessagesPerDay != null ? String(plan.maxMessagesPerDay) : '', maxOrdersPerDay: plan.maxOrdersPerDay != null ? String(plan.maxOrdersPerDay) : '', maxSkills: plan.maxSkills != null ? String(plan.maxSkills) : '', durationDays: plan.durationDays != null ? String(plan.durationDays) : '', searchBoost: (_plan_searchBoost = plan.searchBoost) !== null && _plan_searchBoost !== void 0 ? _plan_searchBoost : 0, offersMultiplier: (_plan_offersMultiplier = plan.offersMultiplier) !== null && _plan_offersMultiplier !== void 0 ? _plan_offersMultiplier : '1.00', features: ((_plan_features = plan.features) !== null && _plan_features !== void 0 ? _plan_features : []).join('\n'), isDefault: (_plan_isDefault = plan.isDefault) !== null && _plan_isDefault !== void 0 ? _plan_isDefault : false, isActive: (_plan_isActive = plan.isActive) !== null && _plan_isActive !== void 0 ? _plan_isActive : true, order: (_plan_order = plan.order) !== null && _plan_order !== void 0 ? _plan_order : 0, notifyNewTasks: (_plan_notifyNewTasks = plan.notifyNewTasks) !== null && _plan_notifyNewTasks !== void 0 ? _plan_notifyNewTasks : false, canContactFreePlan: (_plan_canContactFreePlan = plan.canContactFreePlan) !== null && _plan_canContactFreePlan !== void 0 ? _plan_canContactFreePlan : false, canContactProPlan: (_plan_canContactProPlan = plan.canContactProPlan) !== null && _plan_canContactProPlan !== void 0 ? _plan_canContactProPlan : true, canContactAll: (_plan_canContactAll = plan.canContactAll) !== null && _plan_canContactAll !== void 0 ? _plan_canContactAll : false, canShowContactInfo: (_plan_canShowContactInfo = plan.canShowContactInfo) !== null && _plan_canShowContactInfo !== void 0 ? _plan_canShowContactInfo : false, canViewPhone: (_plan_canViewPhone = plan.canViewPhone) !== null && _plan_canViewPhone !== void 0 ? _plan_canViewPhone : false, canUploadVideo: (_plan_canUploadVideo = plan.canUploadVideo) !== null && _plan_canUploadVideo !== void 0 ? _plan_canUploadVideo : false, hasFavorites: (_plan_hasFavorites = plan.hasFavorites) !== null && _plan_hasFavorites !== void 0 ? _plan_hasFavorites : false, hasGoogleCalendar: (_plan_hasGoogleCalendar = plan.hasGoogleCalendar) !== null && _plan_hasGoogleCalendar !== void 0 ? _plan_hasGoogleCalendar : false, hasVerifiedBadge: (_plan_hasVerifiedBadge = plan.hasVerifiedBadge) !== null && _plan_hasVerifiedBadge !== void 0 ? _plan_hasVerifiedBadge : false, highlightedReviews: (_plan_highlightedReviews = plan.highlightedReviews) !== null && _plan_highlightedReviews !== void 0 ? _plan_highlightedReviews : false, hasPersonalSite: (_plan_hasPersonalSite = plan.hasPersonalSite) !== null && _plan_hasPersonalSite !== void 0 ? _plan_hasPersonalSite : false, hasCanHelpNowStatus: (_plan_hasCanHelpNowStatus = plan.hasCanHelpNowStatus) !== null && _plan_hasCanHelpNowStatus !== void 0 ? _plan_hasCanHelpNowStatus : false, hasNeedHelpStatus: (_plan_hasNeedHelpStatus = plan.hasNeedHelpStatus) !== null && _plan_hasNeedHelpStatus !== void 0 ? _plan_hasNeedHelpStatus : false, hasAutoResponse: (_plan_hasAutoResponse = plan.hasAutoResponse) !== null && _plan_hasAutoResponse !== void 0 ? _plan_hasAutoResponse : false, hasAutoMatch: (_plan_hasAutoMatch = plan.hasAutoMatch) !== null && _plan_hasAutoMatch !== void 0 ? _plan_hasAutoMatch : false, hasPriceList: (_plan_hasPriceList = plan.hasPriceList) !== null && _plan_hasPriceList !== void 0 ? _plan_hasPriceList : false, receiveInstantDispatchFree: (_plan_receiveInstantDispatchFree = plan.receiveInstantDispatchFree) !== null && _plan_receiveInstantDispatchFree !== void 0 ? _plan_receiveInstantDispatchFree : false, receiveInstantDispatchPro: (_plan_receiveInstantDispatchPro = plan.receiveInstantDispatchPro) !== null && _plan_receiveInstantDispatchPro !== void 0 ? _plan_receiveInstantDispatchPro : false }); } async function savePlan() { if (!planForm) return; setPlanSaving(true); try { const payload = { name: planForm.name, description: planForm.description || undefined, role: planForm.role, tier: planForm.tier, price: planForm.price, oldPrice: planForm.oldPrice || null, currency: planForm.currency, maxTasks: planForm.maxTasks ? Number(planForm.maxTasks) : null, maxOffers: planForm.maxOffers ? Number(planForm.maxOffers) : null, maxCards: planForm.maxCards ? Number(planForm.maxCards) : null, maxMessagesPerDay: planForm.maxMessagesPerDay ? Number(planForm.maxMessagesPerDay) : null, maxOrdersPerDay: planForm.maxOrdersPerDay ? Number(planForm.maxOrdersPerDay) : null, maxSkills: planForm.maxSkills ? Number(planForm.maxSkills) : null, durationDays: planForm.durationDays ? Number(planForm.durationDays) : null, notifyNewTasks: planForm.notifyNewTasks, searchBoost: planForm.searchBoost, offersMultiplier: planForm.offersMultiplier, canContactFreePlan: planForm.canContactFreePlan, canContactProPlan: planForm.canContactProPlan, canContactAll: planForm.canContactAll, canShowContactInfo: planForm.canShowContactInfo, canViewPhone: planForm.canViewPhone, canUploadVideo: planForm.canUploadVideo, hasFavorites: planForm.hasFavorites, hasGoogleCalendar: planForm.hasGoogleCalendar, hasVerifiedBadge: planForm.hasVerifiedBadge, highlightedReviews: planForm.highlightedReviews, hasPersonalSite: planForm.hasPersonalSite, hasCanHelpNowStatus: planForm.hasCanHelpNowStatus, hasNeedHelpStatus: planForm.hasNeedHelpStatus, hasAutoResponse: planForm.hasAutoResponse, hasAutoMatch: planForm.hasAutoMatch, hasPriceList: planForm.hasPriceList, receiveInstantDispatchFree: planForm.receiveInstantDispatchFree, receiveInstantDispatchPro: planForm.receiveInstantDispatchPro, features: planForm.features ? planForm.features.split('\n').map((s)=>s.trim()).filter(Boolean) : [], isDefault: planForm.isDefault, isActive: planForm.isActive, order: planForm.order }; if (planForm.id) { const updated = await api.updatePlan(planForm.id, payload); setPlanRows((prev)=>prev.map((r)=>r.id === planForm.id ? updated : r)); } else { const created = await api.createPlan(payload); setPlanRows((prev)=>[ ...prev, created ]); } // If set as default — refresh all to sync isDefault flags if (planForm.isDefault) { api.getAdminPlans().then(setPlanRows).catch(()=>{}); } setPlanForm(null); } catch (e) { // ignore } finally{ setPlanSaving(false); } } async function deletePlan(id, name) { if (!window.confirm('Delete plan "'.concat(name, '"?'))) return; const ok = await api.deletePlan(id).catch(()=>null); if (ok) setPlanRows((prev)=>prev.filter((r)=>r.id !== id)); } // Settings useEffect(()=>{ if (!isAdmin || tab !== 'settings') return; if (planRows.length === 0) api.getAdminPlans().then(setPlanRows).catch(()=>{}); api.getAdminSettings().then((kv)=>{ var _kv_generalsiteName, _kv_generalsiteUrl, _kv_generalcontactEmail, _kv_generalsupportPhone; setGeneralForm({ siteName: (_kv_generalsiteName = kv['general.siteName']) !== null && _kv_generalsiteName !== void 0 ? _kv_generalsiteName : 'CanHelp', siteUrl: (_kv_generalsiteUrl = kv['general.siteUrl']) !== null && _kv_generalsiteUrl !== void 0 ? _kv_generalsiteUrl : '', contactEmail: (_kv_generalcontactEmail = kv['general.contactEmail']) !== null && _kv_generalcontactEmail !== void 0 ? _kv_generalcontactEmail : '', supportPhone: (_kv_generalsupportPhone = kv['general.supportPhone']) !== null && _kv_generalsupportPhone !== void 0 ? _kv_generalsupportPhone : '' }); var _kv_smtphost, _kv_smtpport, _kv_smtpusername, _kv_smtppassword, _kv_smtpfromName, _kv_smtpfromEmail, _kv_smtpencryption; setSmtpForm({ host: (_kv_smtphost = kv['smtp.host']) !== null && _kv_smtphost !== void 0 ? _kv_smtphost : '', port: (_kv_smtpport = kv['smtp.port']) !== null && _kv_smtpport !== void 0 ? _kv_smtpport : '587', username: (_kv_smtpusername = kv['smtp.username']) !== null && _kv_smtpusername !== void 0 ? _kv_smtpusername : '', password: (_kv_smtppassword = kv['smtp.password']) !== null && _kv_smtppassword !== void 0 ? _kv_smtppassword : '', fromName: (_kv_smtpfromName = kv['smtp.fromName']) !== null && _kv_smtpfromName !== void 0 ? _kv_smtpfromName : 'CanHelp', fromEmail: (_kv_smtpfromEmail = kv['smtp.fromEmail']) !== null && _kv_smtpfromEmail !== void 0 ? _kv_smtpfromEmail : '', encryption: (_kv_smtpencryption = kv['smtp.encryption']) !== null && _kv_smtpencryption !== void 0 ? _kv_smtpencryption : 'tls' }); var _kv_paymentepaymerchantId, _kv_paymentepayapiUser, _kv_paymentepayapiPassword, _kv_paymentepayenvironment, _kv_paymentepayconfirmationUrl, _kv_paymentepaycancelUrl; setEPayForm({ merchantId: (_kv_paymentepaymerchantId = kv['payment.epay.merchantId']) !== null && _kv_paymentepaymerchantId !== void 0 ? _kv_paymentepaymerchantId : '', apiUser: (_kv_paymentepayapiUser = kv['payment.epay.apiUser']) !== null && _kv_paymentepayapiUser !== void 0 ? _kv_paymentepayapiUser : '', apiPassword: (_kv_paymentepayapiPassword = kv['payment.epay.apiPassword']) !== null && _kv_paymentepayapiPassword !== void 0 ? _kv_paymentepayapiPassword : '', environment: (_kv_paymentepayenvironment = kv['payment.epay.environment']) !== null && _kv_paymentepayenvironment !== void 0 ? _kv_paymentepayenvironment : 'test', confirmationUrl: (_kv_paymentepayconfirmationUrl = kv['payment.epay.confirmationUrl']) !== null && _kv_paymentepayconfirmationUrl !== void 0 ? _kv_paymentepayconfirmationUrl : '', cancelUrl: (_kv_paymentepaycancelUrl = kv['payment.epay.cancelUrl']) !== null && _kv_paymentepaycancelUrl !== void 0 ? _kv_paymentepaycancelUrl : '', enabled: kv['payment.epay.enabled'] === 'true' }); var _kv_referral_plan_id, _ref, _ref1, _kv_referral_days, _ref2, _ref3; setReferralForm({ enabled: kv['referral_enabled'] === 'true', planId: (_ref1 = (_ref = (_kv_referral_plan_id = kv['referral_plan_id']) !== null && _kv_referral_plan_id !== void 0 ? _kv_referral_plan_id : kv['referral_customer_plan_id']) !== null && _ref !== void 0 ? _ref : kv['referral_specialist_plan_id']) !== null && _ref1 !== void 0 ? _ref1 : '', days: (_ref3 = (_ref2 = (_kv_referral_days = kv['referral_days']) !== null && _kv_referral_days !== void 0 ? _kv_referral_days : kv['referral_customer_days']) !== null && _ref2 !== void 0 ? _ref2 : kv['referral_specialist_days']) !== null && _ref3 !== void 0 ? _ref3 : '30' }); var _kv_seoheadScripts, _kv_seositeTitleel, _ref4, _kv_seositeTitleen, _kv_seositeTitleru, _kv_seositeTitleuk, _kv_seositeDescriptionel, _ref5, _kv_seositeDescriptionen, _kv_seositeDescriptionru, _kv_seositeDescriptionuk; setSeoForm({ maintenanceMode: kv['seo.maintenanceMode'] === 'true', indexingEnabled: kv['seo.indexingEnabled'] !== 'false', headScripts: (_kv_seoheadScripts = kv['seo.headScripts']) !== null && _kv_seoheadScripts !== void 0 ? _kv_seoheadScripts : '', siteTitleEl: (_ref4 = (_kv_seositeTitleel = kv['seo.siteTitle.el']) !== null && _kv_seositeTitleel !== void 0 ? _kv_seositeTitleel : kv['seo.siteTitle']) !== null && _ref4 !== void 0 ? _ref4 : '', siteTitleEn: (_kv_seositeTitleen = kv['seo.siteTitle.en']) !== null && _kv_seositeTitleen !== void 0 ? _kv_seositeTitleen : '', siteTitleRu: (_kv_seositeTitleru = kv['seo.siteTitle.ru']) !== null && _kv_seositeTitleru !== void 0 ? _kv_seositeTitleru : '', siteTitleUk: (_kv_seositeTitleuk = kv['seo.siteTitle.uk']) !== null && _kv_seositeTitleuk !== void 0 ? _kv_seositeTitleuk : '', siteDescriptionEl: (_ref5 = (_kv_seositeDescriptionel = kv['seo.siteDescription.el']) !== null && _kv_seositeDescriptionel !== void 0 ? _kv_seositeDescriptionel : kv['seo.siteDescription']) !== null && _ref5 !== void 0 ? _ref5 : '', siteDescriptionEn: (_kv_seositeDescriptionen = kv['seo.siteDescription.en']) !== null && _kv_seositeDescriptionen !== void 0 ? _kv_seositeDescriptionen : '', siteDescriptionRu: (_kv_seositeDescriptionru = kv['seo.siteDescription.ru']) !== null && _kv_seositeDescriptionru !== void 0 ? _kv_seositeDescriptionru : '', siteDescriptionUk: (_kv_seositeDescriptionuk = kv['seo.siteDescription.uk']) !== null && _kv_seositeDescriptionuk !== void 0 ? _kv_seositeDescriptionuk : '' }); var _kv_socialtelegram, _kv_socialinstagram, _kv_socialfacebook, _kv_socialtwitter, _kv_socialyoutube, _kv_socialtiktok, _kv_socialwhatsapp, _kv_socialviber; setSocialForm({ telegram: (_kv_socialtelegram = kv['social.telegram']) !== null && _kv_socialtelegram !== void 0 ? _kv_socialtelegram : '', instagram: (_kv_socialinstagram = kv['social.instagram']) !== null && _kv_socialinstagram !== void 0 ? _kv_socialinstagram : '', facebook: (_kv_socialfacebook = kv['social.facebook']) !== null && _kv_socialfacebook !== void 0 ? _kv_socialfacebook : '', twitter: (_kv_socialtwitter = kv['social.twitter']) !== null && _kv_socialtwitter !== void 0 ? _kv_socialtwitter : '', youtube: (_kv_socialyoutube = kv['social.youtube']) !== null && _kv_socialyoutube !== void 0 ? _kv_socialyoutube : '', tiktok: (_kv_socialtiktok = kv['social.tiktok']) !== null && _kv_socialtiktok !== void 0 ? _kv_socialtiktok : '', whatsapp: (_kv_socialwhatsapp = kv['social.whatsapp']) !== null && _kv_socialwhatsapp !== void 0 ? _kv_socialwhatsapp : '', viber: (_kv_socialviber = kv['social.viber']) !== null && _kv_socialviber !== void 0 ? _kv_socialviber : '' }); var _kv_telegrambotToken, _kv_telegramadminChatId, _kv_telegramchannelIdel, _kv_telegramchannelIden, _kv_telegramchannelIdru, _kv_telegramchannelIduk; setTelegramForm({ botToken: (_kv_telegrambotToken = kv['telegram.botToken']) !== null && _kv_telegrambotToken !== void 0 ? _kv_telegrambotToken : '', adminChatId: (_kv_telegramadminChatId = kv['telegram.adminChatId']) !== null && _kv_telegramadminChatId !== void 0 ? _kv_telegramadminChatId : '', channelIdEl: (_kv_telegramchannelIdel = kv['telegram.channelId.el']) !== null && _kv_telegramchannelIdel !== void 0 ? _kv_telegramchannelIdel : '', channelIdEn: (_kv_telegramchannelIden = kv['telegram.channelId.en']) !== null && _kv_telegramchannelIden !== void 0 ? _kv_telegramchannelIden : '', channelIdRu: (_kv_telegramchannelIdru = kv['telegram.channelId.ru']) !== null && _kv_telegramchannelIdru !== void 0 ? _kv_telegramchannelIdru : '', channelIdUk: (_kv_telegramchannelIduk = kv['telegram.channelId.uk']) !== null && _kv_telegramchannelIduk !== void 0 ? _kv_telegramchannelIduk : '', notifyRegistrations: kv['telegram.notifyRegistrations'] === 'true', postNewTasks: kv['telegram.postNewTasks'] === 'true' }); }).catch(()=>{}); api.getAdminEmailTemplates().then((rows)=>{ const map = {}; for (const r of rows)map[r.key] = { subject: r.subject, body: r.body }; setNotifTemplates((prev)=>({ ...prev, ...map })); }).catch(()=>{}); }, [ isAdmin, tab ]); async function saveGeneralSettings() { setGeneralSaving(true); try { await api.updateAdminSettings({ 'general.siteName': generalForm.siteName, 'general.siteUrl': generalForm.siteUrl, 'general.contactEmail': generalForm.contactEmail, 'general.supportPhone': generalForm.supportPhone }); setGeneralSaved(true); setTimeout(()=>setGeneralSaved(false), 2500); } catch (e) {} finally{ setGeneralSaving(false); } } async function saveSmtpSettings() { setSmtpSaving(true); try { await api.updateAdminSettings({ 'smtp.host': smtpForm.host, 'smtp.port': smtpForm.port, 'smtp.username': smtpForm.username, 'smtp.password': smtpForm.password, 'smtp.fromName': smtpForm.fromName, 'smtp.fromEmail': smtpForm.fromEmail, 'smtp.encryption': smtpForm.encryption }); setSmtpSaved(true); setTimeout(()=>setSmtpSaved(false), 2500); } catch (e) {} finally{ setSmtpSaving(false); } } async function autoTranslateTemplate(key) { const localeKey = "".concat(key, "_").concat(templateLocale); var _notifTemplates_localeKey, _ref; const current = (_ref = (_notifTemplates_localeKey = notifTemplates[localeKey]) !== null && _notifTemplates_localeKey !== void 0 ? _notifTemplates_localeKey : notifTemplates[key]) !== null && _ref !== void 0 ? _ref : { subject: '', body: '' }; if (!current.subject && !current.body) return; setTemplateTranslating(true); try { // СПхраМяеЌ ОсхПЎМый язык в БД (еслО ещё Ме сПхраМёМ) await api.updateAdminEmailTemplate(localeKey, current); // ПеревПЎОЌ Ма ПстальМые языкО const results = await api.translateAdminEmailTemplate({ subject: current.subject, body: current.body, fromLocale: templateLocale }); // ОбМПвляеЌ state setNotifTemplates((prev)=>{ const next = { ...prev, [localeKey]: current }; for (const [loc, tpl] of Object.entries(results)){ next["".concat(key, "_").concat(loc)] = tpl; } return next; }); // СПхраМяеЌ кажЎый перевПЎ в БД await Promise.all(Object.entries(results).map((param)=>{ let [loc, tpl] = param; return api.updateAdminEmailTemplate("".concat(key, "_").concat(loc), tpl); })); } catch (e) {} finally{ setTemplateTranslating(false); } } async function saveTemplate(key) { const localeKey = "".concat(key, "_").concat(templateLocale); setTemplateSaving(true); try { var _notifTemplates_localeKey; await api.updateAdminEmailTemplate(localeKey, (_notifTemplates_localeKey = notifTemplates[localeKey]) !== null && _notifTemplates_localeKey !== void 0 ? _notifTemplates_localeKey : { subject: '', body: '' }); setEditingTemplate(null); } catch (e) {} finally{ setTemplateSaving(false); } } async function saveEPaySettings() { setEPaySaving(true); try { await api.updateAdminSettings({ 'payment.epay.merchantId': ePayForm.merchantId, 'payment.epay.apiUser': ePayForm.apiUser, 'payment.epay.apiPassword': ePayForm.apiPassword, 'payment.epay.environment': ePayForm.environment, 'payment.epay.confirmationUrl': ePayForm.confirmationUrl, 'payment.epay.cancelUrl': ePayForm.cancelUrl, 'payment.epay.enabled': String(ePayForm.enabled) }); setEPaySaved(true); setTimeout(()=>setEPaySaved(false), 2500); } catch (e) {} finally{ setEPaySaving(false); } } async function saveReferralSettings() { setReferralSaving(true); try { await api.updateAdminSettings({ 'referral_enabled': String(referralForm.enabled), 'referral_plan_id': referralForm.planId, 'referral_days': referralForm.days }); setReferralSaved(true); setTimeout(()=>setReferralSaved(false), 2500); } catch (e) {} finally{ setReferralSaving(false); } } async function saveSeoSettings() { setSeoSaving(true); try { await api.updateAdminSettings({ 'seo.maintenanceMode': String(seoForm.maintenanceMode), 'seo.indexingEnabled': String(seoForm.indexingEnabled), 'seo.headScripts': seoForm.headScripts, 'seo.siteTitle.el': seoForm.siteTitleEl, 'seo.siteTitle.en': seoForm.siteTitleEn, 'seo.siteTitle.ru': seoForm.siteTitleRu, 'seo.siteTitle.uk': seoForm.siteTitleUk, 'seo.siteDescription.el': seoForm.siteDescriptionEl, 'seo.siteDescription.en': seoForm.siteDescriptionEn, 'seo.siteDescription.ru': seoForm.siteDescriptionRu, 'seo.siteDescription.uk': seoForm.siteDescriptionUk }); setSeoSaved(true); setTimeout(()=>setSeoSaved(false), 2500); } catch (e) {} finally{ setSeoSaving(false); } } async function saveSocialSettings() { setSocialSaving(true); try { await api.updateAdminSettings({ 'social.telegram': socialForm.telegram, 'social.instagram': socialForm.instagram, 'social.facebook': socialForm.facebook, 'social.twitter': socialForm.twitter, 'social.youtube': socialForm.youtube, 'social.tiktok': socialForm.tiktok, 'social.whatsapp': socialForm.whatsapp, 'social.viber': socialForm.viber }); setSocialSaved(true); setTimeout(()=>setSocialSaved(false), 2500); } catch (e) {} finally{ setSocialSaving(false); } } async function saveTelegramSettings() { setTelegramSaving(true); try { await api.updateAdminSettings({ 'telegram.botToken': telegramForm.botToken, 'telegram.adminChatId': telegramForm.adminChatId, 'telegram.channelId.el': telegramForm.channelIdEl, 'telegram.channelId.en': telegramForm.channelIdEn, 'telegram.channelId.ru': telegramForm.channelIdRu, 'telegram.channelId.uk': telegramForm.channelIdUk, 'telegram.notifyRegistrations': String(telegramForm.notifyRegistrations), 'telegram.postNewTasks': String(telegramForm.postNewTasks) }); setTelegramSaved(true); setTimeout(()=>setTelegramSaved(false), 2500); } catch (e) {} finally{ setTelegramSaving(false); } } async function testTelegram(type) { const chatIdMap = { admin: telegramForm.adminChatId, el: telegramForm.channelIdEl, en: telegramForm.channelIdEn, ru: telegramForm.channelIdRu, uk: telegramForm.channelIdUk }; var _chatIdMap_type; const chatId = (_chatIdMap_type = chatIdMap[type]) !== null && _chatIdMap_type !== void 0 ? _chatIdMap_type : ''; if (type === 'admin') { setTestingTelegramAdmin(true); setTestResultTelegramAdmin(null); } else { setTestingLocale(type); setTestResultChannels((p)=>{ const n = { ...p }; delete n[type]; return n; }); } try { const res = await api.testTelegramConnection(telegramForm.botToken, chatId); var _res_error; const result = { ok: res.ok, msg: res.ok ? res.botName ? "@".concat(res.botName) : t('admin.settings.telegram.test_ok') : (_res_error = res.error) !== null && _res_error !== void 0 ? _res_error : t('admin.settings.telegram.test_fail') }; if (type === 'admin') setTestResultTelegramAdmin(result); else setTestResultChannels((p)=>({ ...p, [type]: result })); } catch (e) { const result = { ok: false, msg: t('admin.settings.telegram.test_fail') }; if (type === 'admin') setTestResultTelegramAdmin(result); else setTestResultChannels((p)=>({ ...p, [type]: result })); } finally{ if (type === 'admin') setTestingTelegramAdmin(false); else setTestingLocale(null); } } async function verifyTelegramToken() { setVerifyingTelegramToken(true); setVerifyResultTelegramToken(null); try { const res = await api.verifyTelegramToken(telegramForm.botToken); var _res_error; setVerifyResultTelegramToken({ ok: res.ok, msg: res.ok ? "@".concat(res.botName) : (_res_error = res.error) !== null && _res_error !== void 0 ? _res_error : t('admin.settings.telegram.test_fail') }); } catch (e) { setVerifyResultTelegramToken({ ok: false, msg: t('admin.settings.telegram.test_fail') }); } finally{ setVerifyingTelegramToken(false); } } if (isPending) return /*#__PURE__*/ _jsx("div", { className: "text-center py-20 text-gray-500", children: t('common.loading') }); const dateLocale = locale === 'ru' ? 'ru-RU' : locale === 'en' ? 'en-US' : 'el-GR'; const catName = (id)=>{ const cat = catRows.find((c)=>c.id === id); if (!cat) return id; if (locale === 'en') return cat.namesEn || cat.namesEl; if (locale === 'ru') return cat.namesRu || cat.namesEl; if (locale === 'uk') return cat.namesUk || cat.namesEl; return cat.namesEl || cat.namesEn || id; }; const locName = (id)=>{ const loc = locRows.find((l)=>l.id === id); if (!loc) return id; if (locale === 'en') return loc.nameEn || loc.nameEl; if (locale === 'ru') return loc.nameRu || loc.nameEl; if (locale === 'uk') return loc.nameUk || loc.nameEl; return loc.nameEl || loc.nameEn || id; }; const TABS = [ { key: 'stats', label: t('admin.tab.stats'), icon: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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: t('admin.tab.users'), icon: /*#__PURE__*/ _jsxs("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M17 21v-2a4 4 0 00-4-4H5a4 4 0 00-4 4v2" }), /*#__PURE__*/ _jsx("circle", { cx: "9", cy: "7", r: "4" }), /*#__PURE__*/ _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: t('admin.tab.tasks'), icon: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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: t('admin.tab.reports'), badge: pendingReportsCount || undefined, icon: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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: t('admin.tab.moderation'), badge: pendingCardsCount || undefined, icon: /*#__PURE__*/ _jsxs("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ _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" }), /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 20h12" }) ] }) }, { key: 'categories', label: t('admin.tab.categories'), icon: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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: t('admin.tab.locations'), icon: /*#__PURE__*/ _jsxs("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ _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" }), /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 11a3 3 0 11-6 0 3 3 0 016 0z" }) ] }) }, { key: 'balances', label: t('admin.tab.balances', 'Balance'), icon: /*#__PURE__*/ _jsxs("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ _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" }), /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M20 12h-6m0 0a2 2 0 100 4h6v-8h-6a2 2 0 100 4z" }) ] }) }, { key: 'plans', label: t('admin.tab.plans'), icon: /*#__PURE__*/ _jsxs("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ _jsx("rect", { x: "1", y: "4", width: "22", height: "16", rx: "2", ry: "2" }), /*#__PURE__*/ _jsx("line", { x1: "1", y1: "10", x2: "23", y2: "10" }) ] }) }, { key: 'logs', label: t('admin.tab.logs'), icon: /*#__PURE__*/ _jsxs("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ _jsx("polyline", { points: "4 17 10 11 4 5" }), /*#__PURE__*/ _jsx("line", { x1: "12", y1: "19", x2: "20", y2: "19" }) ] }) }, { key: 'settings', label: t('admin.tab.settings'), icon: /*#__PURE__*/ _jsxs("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ _jsx("circle", { cx: "12", cy: "12", r: "3" }), /*#__PURE__*/ _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: t('admin.tab.support', 'Support'), icon: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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: t('admin.tab.push', 'Push'), icon: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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: t('admin.tab.backup', 'Backup'), icon: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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: t('admin.tab.translations', 'Translations'), icon: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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: t('admin.tab.dbcheck', 'DB check'), icon: /*#__PURE__*/ _jsxs("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ _jsx("ellipse", { cx: "12", cy: "5", rx: "9", ry: "3" }), /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M21 12c0 1.66-4.03 3-9 3S3 13.66 3 12" }), /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M3 5v14c0 1.66 4.03 3 9 3s9-1.34 9-3V5" }), /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 12l2 2 4-4" }) ] }) }, { key: 'referrals', label: t('admin.tab.referrals', 'Referrals'), icon: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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" }) }) } ]; const statusColors = { 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' }; const reportStatusColors = { pending: 'bg-yellow-100 text-yellow-700', reviewed: 'bg-green-100 text-green-700', dismissed: 'bg-gray-100 text-gray-500' }; const reasonColors = { 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' }; const cardStatus = (card)=>{ var _card_publicationStatus; return (_card_publicationStatus = card.publicationStatus) !== null && _card_publicationStatus !== void 0 ? _card_publicationStatus : card.isActive ? 'active' : 'inactive'; }; const pendingModerationCards = moderationCards.filter((card)=>cardStatus(card) === 'pending'); const activeModerationCards = moderationCards.filter((card)=>cardStatus(card) === 'active'); var _stats_totalCostUsd, _planForm_oldPrice, _pushResult_tokensFound, _pushResult_usersWithoutTokens, _pushResult_usersConfigBlocked, _pushResult_usersAuthFailed, _pushResult_usersAllFailed, _pushResult_usersWithoutTokens1, _pushResult_usersConfigBlocked1, _pushResult_usersAuthFailed1, _pushResult_usersAllFailed1, _referralsData_totalReferrers, _referralsData_totalReferrals, _referralsData_activeRewards, _editUser_firstName, _editUser_lastName, _editUser_phone, _editUser_bio, _editUser_planId, _editUser_locale, _editUser_balance, _editUser_showContactInfo, _editUser_notifyNewTasks, _editUser_notifMessages, _editUser_personalSiteSlug, _editUser_siteSettings, _siteTheme, _editUser_skills, _editUser_balance1, _editUser_topUpAmount, _editUser_withdrawAmount, _editUser_topUpDescription, _editUser_withdrawDescription; return /*#__PURE__*/ _jsx("div", { className: "min-h-screen bg-gray-50", children: /*#__PURE__*/ _jsxs("div", { className: "max-w-7xl mx-auto px-4 py-8", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between mb-6", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-7 h-7 text-yellow-500", fill: "currentColor", viewBox: "0 0 24 24", children: /*#__PURE__*/ _jsx("path", { d: "M5 16L3 5l5.5 5L12 4l3.5 6L21 5l-2 11H5zm0 3a1 1 0 000 2h14a1 1 0 000-2H5z" }) }), /*#__PURE__*/ _jsx("h1", { className: "text-2xl font-bold text-gray-900", children: t('admin.title') }) ] }), /*#__PURE__*/ _jsxs(Link, { href: "/", className: "flex items-center gap-1.5 text-sm text-gray-500 hover:text-green-600 transition", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 19l-7-7 7-7" }) }), t('admin.back_home') ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-6", children: [ /*#__PURE__*/ _jsx("aside", { className: "shrink-0 transition-all duration-200 ".concat(sidebarCollapsed ? 'w-12' : 'w-52'), children: /*#__PURE__*/ _jsxs("nav", { className: "bg-white rounded-xl border border-gray-200 overflow-hidden", children: [ /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setSidebarCollapsed((v)=>!v), title: sidebarCollapsed ? 'РазверМуть ЌеМю' : 'СверМуть ЌеМю', 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: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 transition-transform duration-200 ".concat(sidebarCollapsed ? 'rotate-180' : ''), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 19l-7-7 7-7" }) }) }), TABS.map((param)=>{ let { key, label, icon, badge } = param; return /*#__PURE__*/ _jsxs("button", { onClick: ()=>setTab(key), title: sidebarCollapsed ? label : undefined, className: "w-full flex items-center py-3 text-sm font-medium text-left transition ".concat(tab === key ? 'bg-green-50 text-green-700 border-r-2 border-green-600' : 'text-gray-600 hover:bg-gray-50 hover:text-gray-900', " ").concat(sidebarCollapsed ? 'justify-center px-3' : 'gap-3 px-4'), children: [ /*#__PURE__*/ _jsx("span", { className: "w-4 h-4 flex-shrink-0 flex items-center justify-center", children: icon }), !sidebarCollapsed && /*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-2 min-w-0", children: [ /*#__PURE__*/ _jsx("span", { children: label }), badge ? /*#__PURE__*/ _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: badge }) : null ] }) ] }, key); }) ] }) }), /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-0", children: [ tab === 'stats' && /*#__PURE__*/ _jsxs("div", { className: "space-y-6", children: [ /*#__PURE__*/ _jsx("div", { className: "grid grid-cols-2 md:grid-cols-5 gap-4", children: [ { label: t('admin.stats.users'), value: stats === null || stats === void 0 ? void 0 : stats.userCount, icon: /*#__PURE__*/ _jsx("svg", { className: "w-8 h-8", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ _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: t('admin.stats.specialists'), value: stats === null || stats === void 0 ? void 0 : stats.specialistCount, icon: /*#__PURE__*/ _jsxs("svg", { className: "w-8 h-8", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: [ /*#__PURE__*/ _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" }), /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 12a3 3 0 11-6 0 3 3 0 016 0z" }) ] }), color: 'text-purple-600' }, { label: t('admin.stats.tasks'), value: stats === null || stats === void 0 ? void 0 : stats.taskCount, icon: /*#__PURE__*/ _jsx("svg", { className: "w-8 h-8", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ _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: t('admin.stats.offers'), value: stats === null || stats === void 0 ? void 0 : stats.offerCount, icon: /*#__PURE__*/ _jsx("svg", { className: "w-8 h-8", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ _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: t('admin.stats.reviews'), value: stats === null || stats === void 0 ? void 0 : stats.reviewCount, icon: /*#__PURE__*/ _jsx("svg", { className: "w-8 h-8", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ _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((param)=>{ let { label, value, icon, color } = param; return /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-5", children: [ /*#__PURE__*/ _jsx("div", { className: "mb-2 ".concat(color), children: icon }), /*#__PURE__*/ _jsx("div", { className: "text-3xl font-bold ".concat(color), children: value !== null && value !== void 0 ? value : '—' }), /*#__PURE__*/ _jsx("div", { className: "text-sm text-gray-500 mt-1", children: label }) ] }, label); }) }), (stats === null || stats === void 0 ? void 0 : stats.tasksByDay) && /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between mb-4", children: [ /*#__PURE__*/ _jsx("h2", { className: "font-semibold text-gray-800", children: t('admin.stats.activity_30d') }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-4 text-xs text-gray-500", children: [ /*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-1.5", children: [ /*#__PURE__*/ _jsx("span", { className: "w-3 h-0.5 bg-green-500 inline-block rounded" }), t('admin.stats.users_label') ] }), /*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-1.5", children: [ /*#__PURE__*/ _jsx("span", { className: "w-3 h-0.5 bg-purple-400 inline-block rounded" }), t('admin.stats.specialists_label') ] }), /*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-1.5", children: [ /*#__PURE__*/ _jsx("span", { className: "w-3 h-0.5 bg-green-500 inline-block rounded" }), t('admin.stats.tasks_label') ] }) ] }) ] }), /*#__PURE__*/ _jsx(AdminAreaChart, { series: [ { data: stats.usersByDay, color: '#3b82f6', fill: '#3b82f615', label: t('admin.stats.users_label') }, { data: stats.specialistsByDay, color: '#a855f7', fill: '#a855f710', label: t('admin.stats.specialists_label') }, { data: stats.tasksByDay, color: '#22c55e', fill: '#22c55e10', label: t('admin.stats.tasks_label') } ] }) ] }), (stats === null || stats === void 0 ? void 0 : stats.tasksByStatus) && /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ _jsx("h2", { className: "font-semibold text-gray-800 mb-5", children: t('admin.stats.tasks_by_status') }), /*#__PURE__*/ _jsx("div", { className: "space-y-3", children: (()=>{ const total = stats.tasksByStatus.reduce((s, r)=>s + Number(r.count), 0) || 1; const statusMeta = { open: { label: t('admin.task_status.open'), bg: 'bg-green-50', bar: 'bg-green-500' }, in_progress: { label: t('admin.task_status.in_progress'), bg: 'bg-green-50', bar: 'bg-green-500' }, completed: { label: t('admin.task_status.completed'), bg: 'bg-gray-50', bar: 'bg-gray-400' }, cancelled: { label: t('admin.task_status.cancelled'), bg: 'bg-red-50', bar: 'bg-red-400' }, draft: { label: t('admin.task_status.draft'), bg: 'bg-yellow-50', bar: 'bg-yellow-400' } }; const order = [ 'open', 'in_progress', 'completed', 'draft', 'cancelled' ]; const sorted = [ ...stats.tasksByStatus ].sort((a, b)=>order.indexOf(a.status) - order.indexOf(b.status)); return sorted.map((param)=>{ let { status, count: c } = param; var _statusMeta_status; const meta = (_statusMeta_status = statusMeta[status]) !== null && _statusMeta_status !== void 0 ? _statusMeta_status : { label: status, bg: 'bg-gray-50', bar: 'bg-gray-300' }; const pct = Math.round(Number(c) / total * 100); return /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 px-3 py-2 rounded-lg ".concat(meta.bg), children: [ /*#__PURE__*/ _jsx("span", { className: "text-sm text-gray-600 w-28 shrink-0", children: meta.label }), /*#__PURE__*/ _jsx("div", { className: "flex-1 bg-gray-200 rounded-full h-2 overflow-hidden", children: /*#__PURE__*/ _jsx("div", { className: "h-full rounded-full ".concat(meta.bar, " transition-all"), style: { width: "".concat(pct, "%") } }) }), /*#__PURE__*/ _jsx("span", { className: "text-sm font-semibold text-gray-700 w-8 text-right", children: c }), /*#__PURE__*/ _jsxs("span", { className: "text-xs text-gray-400 w-8", children: [ pct, "%" ] }) ] }, status); }); })() }) ] }), notifsByDay.length > 0 && /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between mb-4", children: [ /*#__PURE__*/ _jsx("h2", { className: "font-semibold text-gray-800", children: t('admin.stats.notif_chart_title') }), /*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-1.5 text-xs text-gray-500", children: [ /*#__PURE__*/ _jsx("span", { className: "w-3 h-0.5 bg-orange-500 inline-block rounded" }), t('admin.stats.notif_label') ] }) ] }), /*#__PURE__*/ _jsx(AdminAreaChart, { series: [ { data: notifsByDay, color: '#f97316', fill: '#f9731615', label: t('admin.stats.notif_label') } ] }) ] }), mailByDay.length > 0 && /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between mb-4", children: [ /*#__PURE__*/ _jsx("h2", { className: "font-semibold text-gray-800", children: t('admin.stats.mail_chart_title') }), /*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-1.5 text-xs text-gray-500", children: [ /*#__PURE__*/ _jsx("span", { className: "w-3 h-0.5 bg-sky-500 inline-block rounded" }), t('admin.stats.mail_label') ] }) ] }), /*#__PURE__*/ _jsx(AdminAreaChart, { series: [ { data: mailByDay, color: '#0ea5e9', fill: '#0ea5e915', label: t('admin.stats.mail_label') } ] }) ] }), stats && /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6 space-y-5", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between", children: [ /*#__PURE__*/ _jsx("h2", { className: "font-semibold text-gray-800", children: t('admin.stats.tokens_title') }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-4 text-xs text-gray-500", children: [ /*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-1.5", children: [ /*#__PURE__*/ _jsx("span", { className: "w-3 h-0.5 bg-violet-500 inline-block rounded" }), t('admin.stats.tokens_out') ] }), /*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-1.5", children: [ /*#__PURE__*/ _jsx("span", { className: "w-3 h-0.5 bg-sky-500 inline-block rounded" }), t('admin.stats.tokens_in') ] }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "grid grid-cols-3 gap-4", children: [ /*#__PURE__*/ _jsxs("div", { className: "rounded-lg bg-violet-50 border border-violet-100 px-4 py-3", children: [ /*#__PURE__*/ _jsx("div", { className: "text-xs text-violet-600 mb-1", children: t('admin.stats.tokens_out_label') }), /*#__PURE__*/ _jsx("div", { className: "text-2xl font-bold text-violet-700", children: Number(stats.totalOutputTokens).toLocaleString() }) ] }), /*#__PURE__*/ _jsxs("div", { className: "rounded-lg bg-sky-50 border border-sky-100 px-4 py-3", children: [ /*#__PURE__*/ _jsx("div", { className: "text-xs text-sky-600 mb-1", children: t('admin.stats.tokens_in_label') }), /*#__PURE__*/ _jsx("div", { className: "text-2xl font-bold text-sky-700", children: Number(stats.totalInputTokens).toLocaleString() }) ] }), /*#__PURE__*/ _jsxs("div", { className: "rounded-lg bg-emerald-50 border border-emerald-100 px-4 py-3", children: [ /*#__PURE__*/ _jsx("div", { className: "text-xs text-emerald-600 mb-1", children: t('admin.stats.cost_label') }), /*#__PURE__*/ _jsxs("div", { className: "text-2xl font-bold text-emerald-700", children: [ "$", Number((_stats_totalCostUsd = stats.totalCostUsd) !== null && _stats_totalCostUsd !== void 0 ? _stats_totalCostUsd : 0).toFixed(4) ] }) ] }) ] }), ((_stats_tokensByMonth = stats.tokensByMonth) === null || _stats_tokensByMonth === void 0 ? void 0 : _stats_tokensByMonth.length) > 0 && /*#__PURE__*/ _jsx(AdminMonthChart, { dateLocale: dateLocale, series: [ { data: stats.tokensByMonth.map((r)=>({ month: r.month, count: Number(r.output) })), color: '#8b5cf6', fill: '#8b5cf610', label: t('admin.stats.tokens_out_label') }, { data: stats.tokensByMonth.map((r)=>({ month: r.month, count: Number(r.input) })), color: '#0ea5e9', fill: '#0ea5e915', label: t('admin.stats.tokens_in_label') } ] }) ] }) ] }), tab === 'users' && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("div", { className: "flex gap-3 mb-4", children: [ /*#__PURE__*/ _jsxs("form", { className: "flex gap-2 flex-1", onSubmit: (e)=>{ e.preventDefault(); setUsersQ(usersQInput); }, children: [ /*#__PURE__*/ _jsx("input", { value: usersQInput, onChange: (e)=>setUsersQInput(e.target.value), placeholder: t('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" }), /*#__PURE__*/ _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: t('tasks.search.btn') }) ] }), /*#__PURE__*/ _jsxs("select", { value: usersRole, onChange: (e)=>setUsersRole(e.target.value), className: "border border-gray-300 rounded-lg px-3 py-2 text-sm", children: [ /*#__PURE__*/ _jsx("option", { value: "", children: t('admin.filter.all_roles') }), /*#__PURE__*/ _jsx("option", { value: "user", children: t('admin.user_edit.role.user') }), /*#__PURE__*/ _jsx("option", { value: "admin", children: t('profile.role.admin') }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 overflow-hidden", children: [ /*#__PURE__*/ _jsxs("table", { className: "w-full text-sm", children: [ /*#__PURE__*/ _jsx("thead", { className: "bg-gray-50 text-left", children: /*#__PURE__*/ _jsxs("tr", { children: [ /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.col.user') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.col.email') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.col.role') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.col.plan', 'Plan') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.col.registered') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.col.status') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3" }) ] }) }), /*#__PURE__*/ _jsx("tbody", { className: "divide-y divide-gray-100", children: loading ? /*#__PURE__*/ _jsx("tr", { children: /*#__PURE__*/ _jsx("td", { colSpan: 6, className: "px-4 py-8 text-center text-gray-400", children: t('common.loading') }) }) : users.length === 0 ? /*#__PURE__*/ _jsx("tr", { children: /*#__PURE__*/ _jsx("td", { colSpan: 6, className: "px-4 py-8 text-center text-gray-400", children: "—" }) }) : users.map((u)=>{ var _planRows_find; var _planRows_find_name; return /*#__PURE__*/ _jsxs("tr", { className: "hover:bg-gray-50", children: [ /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 font-medium text-gray-800", children: formatShortName(u.firstName, u.lastName, u.name) }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-gray-500", children: u.email }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3", children: /*#__PURE__*/ _jsx("span", { className: "px-2 py-0.5 rounded-full text-xs font-medium ".concat(u.role === 'admin' ? 'bg-red-100 text-red-700' : u.role === 'specialist' ? 'bg-green-100 text-green-700' : 'bg-gray-100 text-gray-600'), children: t("profile.role.".concat(u.role)) || u.role }) }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-gray-400 text-xs", children: u.planId ? (_planRows_find_name = (_planRows_find = planRows.find((p)=>p.id === u.planId)) === null || _planRows_find === void 0 ? void 0 : _planRows_find.name) !== null && _planRows_find_name !== void 0 ? _planRows_find_name : /*#__PURE__*/ _jsxs("span", { className: "font-mono", children: [ u.planId.slice(0, 8), "
" ] }) : /*#__PURE__*/ _jsx("span", { className: "text-gray-300", children: "—" }) }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-gray-400", children: new Date(u.createdAt).toLocaleDateString(dateLocale) }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3", children: /*#__PURE__*/ _jsx("span", { className: "px-2 py-0.5 rounded-full text-xs font-medium ".concat(u.isActive !== false ? 'bg-green-100 text-green-700' : 'bg-red-100 text-red-600'), children: u.isActive !== false ? t('admin.users.active') : t('admin.users.inactive') }) }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-right", children: /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-end gap-1.5", children: [ /*#__PURE__*/ _jsx("button", { onClick: ()=>openEditUser(u), 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: /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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" }) }) }), u.role !== 'admin' && /*#__PURE__*/ _jsx("button", { onClick: ()=>toggleUser(u.id, u.isActive !== false), className: "text-xs px-3 py-1 rounded-lg font-medium ".concat(u.isActive !== false ? 'bg-red-50 text-red-600 hover:bg-red-100' : 'bg-green-50 text-green-600 hover:bg-green-100'), children: u.isActive !== false ? t('admin.users.deactivate') : t('admin.users.activate') }) ] }) }) ] }, u.id); }) }) ] }), /*#__PURE__*/ _jsx(Pagination, { page: usersPage, total: usersTotal, limit: 20, onChange: setUsersPage, totalLabel: t('admin.pagination.total') }) ] }) ] }), tab === 'balances' && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("div", { className: "flex flex-wrap gap-3 mb-4", children: [ /*#__PURE__*/ _jsx("input", { value: balanceUserId, onChange: (e)=>setBalanceUserId(e.target.value), placeholder: t('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" }), /*#__PURE__*/ _jsxs("select", { value: balanceKind, onChange: (e)=>setBalanceKind(e.target.value), className: "border border-gray-300 rounded-lg px-3 py-2 text-sm", children: [ /*#__PURE__*/ _jsx("option", { value: "", children: t('admin.balance.filter.all', 'All operations') }), /*#__PURE__*/ _jsx("option", { value: "topup", children: t('admin.balance.kind.topup', 'Top-up') }), /*#__PURE__*/ _jsx("option", { value: "plan_purchase", children: t('admin.balance.kind.plan_purchase', 'Plan charge') }), /*#__PURE__*/ _jsx("option", { value: "admin_topup", children: t('admin.balance.kind.admin_topup', 'Admin top-up') }), /*#__PURE__*/ _jsx("option", { value: "admin_adjustment", children: t('admin.balance.kind.admin_adjustment', 'Adjustment') }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 overflow-hidden", children: [ /*#__PURE__*/ _jsxs("table", { className: "w-full text-sm", children: [ /*#__PURE__*/ _jsx("thead", { className: "bg-gray-50 text-left", children: /*#__PURE__*/ _jsxs("tr", { children: [ /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.col.user') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.balance.col.operation', 'Operation') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.balance.col.amount', 'Amount') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.balance.col.result', 'Balance') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.balance.col.description', 'Description') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.balance.col.date', 'Date') }) ] }) }), /*#__PURE__*/ _jsx("tbody", { className: "divide-y divide-gray-100", children: loading ? /*#__PURE__*/ _jsx("tr", { children: /*#__PURE__*/ _jsx("td", { colSpan: 6, className: "px-4 py-8 text-center text-gray-400", children: t('common.loading') }) }) : balanceRows.length === 0 ? /*#__PURE__*/ _jsx("tr", { children: /*#__PURE__*/ _jsx("td", { colSpan: 6, className: "px-4 py-8 text-center text-gray-400", children: t('admin.balance.empty', 'No records yet') }) }) : balanceRows.map((row)=>{ const isCredit = row.direction === 'credit'; const kindLabel = row.kind === 'topup' ? t('admin.balance.kind.topup', 'Top-up') : row.kind === 'plan_purchase' ? t('admin.balance.kind.plan_purchase', 'Plan charge') : row.kind === 'admin_topup' ? t('admin.balance.kind.admin_topup', 'Admin top-up') : t('admin.balance.kind.admin_adjustment', 'Adjustment'); return /*#__PURE__*/ _jsxs("tr", { className: "hover:bg-gray-50 align-top", children: [ /*#__PURE__*/ _jsxs("td", { className: "px-4 py-3", children: [ /*#__PURE__*/ _jsx("div", { className: "font-medium text-gray-800", children: row.userName || '—' }), /*#__PURE__*/ _jsx("div", { className: "text-xs text-gray-500 mt-0.5", children: row.userEmail || row.userId }) ] }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3", children: /*#__PURE__*/ _jsx("span", { className: "inline-flex rounded-full px-2 py-0.5 text-xs font-medium ".concat(isCredit ? 'bg-emerald-50 text-emerald-700' : 'bg-rose-50 text-rose-700'), children: kindLabel }) }), /*#__PURE__*/ _jsxs("td", { className: "px-4 py-3 font-semibold ".concat(isCredit ? 'text-emerald-700' : 'text-rose-700'), children: [ isCredit ? '+' : '-', Number(row.amount).toFixed(2), " ", row.currency ] }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-gray-600", children: /*#__PURE__*/ _jsxs("div", { children: [ Number(row.balanceBefore).toFixed(2), " → ", Number(row.balanceAfter).toFixed(2), " ", row.currency ] }) }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-gray-500 max-w-sm", children: row.description || '—' }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-gray-500 whitespace-nowrap", children: new Date(row.createdAt).toLocaleString(dateLocale) }) ] }, row.id); }) }) ] }), /*#__PURE__*/ _jsx(Pagination, { page: balancePage, total: balanceTotal, limit: 50, onChange: setBalancePage, totalLabel: t('admin.pagination.total') }) ] }) ] }), tab === 'tasks' && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("div", { className: "flex gap-3 mb-4", children: [ /*#__PURE__*/ _jsxs("form", { className: "flex gap-2 flex-1", onSubmit: (e)=>{ e.preventDefault(); setTasksQ(tasksQInput); }, children: [ /*#__PURE__*/ _jsx("input", { value: tasksQInput, onChange: (e)=>setTasksQInput(e.target.value), placeholder: t('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" }), /*#__PURE__*/ _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: t('tasks.search.btn') }) ] }), /*#__PURE__*/ _jsxs("select", { value: tasksStatus, onChange: (e)=>setTasksStatus(e.target.value), className: "border border-gray-300 rounded-lg px-3 py-2 text-sm", children: [ /*#__PURE__*/ _jsx("option", { value: "", children: t('admin.filter.all_statuses') }), [ 'open', 'in_progress', 'completed', 'cancelled', 'draft' ].map((s)=>/*#__PURE__*/ _jsx("option", { value: s, children: t("task.status.".concat(s), s) }, s)) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 overflow-hidden", children: [ /*#__PURE__*/ _jsxs("table", { className: "w-full text-sm", children: [ /*#__PURE__*/ _jsx("thead", { className: "bg-gray-50 text-left", children: /*#__PURE__*/ _jsxs("tr", { children: [ /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.col.title') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.col.customer') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.col.status') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.col.budget') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.col.created') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3" }) ] }) }), /*#__PURE__*/ _jsx("tbody", { className: "divide-y divide-gray-100", children: loading ? /*#__PURE__*/ _jsx("tr", { children: /*#__PURE__*/ _jsx("td", { colSpan: 6, className: "px-4 py-8 text-center text-gray-400", children: t('common.loading') }) }) : tasks.length === 0 ? /*#__PURE__*/ _jsx("tr", { children: /*#__PURE__*/ _jsx("td", { colSpan: 6, className: "px-4 py-8 text-center text-gray-400", children: "—" }) }) : tasks.map((row)=>{ const task = row.task || row; const customer = row.customer; var _customer_name, _statusColors_task_status; return /*#__PURE__*/ _jsxs("tr", { className: "hover:bg-gray-50", children: [ /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 font-medium text-gray-800 max-w-xs", children: /*#__PURE__*/ _jsx(Link, { href: "/tasks/".concat(task.id), className: "hover:text-green-600 truncate block", target: "_blank", children: locale === 'en' && task.titleEn || locale === 'ru' && task.titleRu || locale === 'uk' && task.titleUk || task.titleEl || task.title }) }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-gray-500 text-xs", children: (_customer_name = customer === null || customer === void 0 ? void 0 : customer.name) !== null && _customer_name !== void 0 ? _customer_name : '—' }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3", children: /*#__PURE__*/ _jsx("span", { className: "px-2 py-0.5 rounded-full text-xs font-medium ".concat((_statusColors_task_status = statusColors[task.status]) !== null && _statusColors_task_status !== void 0 ? _statusColors_task_status : 'bg-gray-100 text-gray-600'), children: t("task.status.".concat(task.status), task.status) }) }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-gray-500", children: task.budget ? "".concat(formatPrice(task.budget), "€") : '—' }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-gray-400", children: new Date(task.createdAt).toLocaleDateString(dateLocale) }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-right", children: /*#__PURE__*/ _jsxs("div", { className: "flex gap-1.5 justify-end", children: [ task.status !== 'cancelled' && task.status !== 'completed' && /*#__PURE__*/ _jsx("button", { onClick: ()=>cancelTask(task.id), className: "text-xs px-2.5 py-1 rounded-lg font-medium bg-yellow-50 text-yellow-700 hover:bg-yellow-100", children: t('admin.tasks.cancel') }), /*#__PURE__*/ _jsx("button", { onClick: ()=>deleteTask(task.id, locale === 'en' && task.titleEn || locale === 'ru' && task.titleRu || locale === 'uk' && task.titleUk || task.titleEl || task.title), className: "text-xs px-2.5 py-1 rounded-lg font-medium bg-red-50 text-red-600 hover:bg-red-100", children: t('admin.tasks.delete') }) ] }) }) ] }, task.id); }) }) ] }), /*#__PURE__*/ _jsx(Pagination, { page: tasksPage, total: tasksTotal, limit: 20, onChange: setTasksPage, totalLabel: t('admin.pagination.total') }) ] }) ] }), tab === 'categories' && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("div", { className: "flex justify-between items-center mb-4", children: [ /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-500", children: t('admin.cat.hint') }), /*#__PURE__*/ _jsxs("button", { onClick: ()=>openAddCat(null), className: "px-4 py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700", children: [ "+ ", t('admin.cat.add_root') ] }) ] }), catForm && /*#__PURE__*/ _jsxs("div", { className: "bg-green-50 border border-green-200 rounded-xl p-5 mb-4", children: [ /*#__PURE__*/ _jsxs("h3", { className: "font-semibold text-gray-800 mb-4", children: [ catForm.id ? t('admin.cat.edit') : t('admin.cat.new'), catForm.parentId && /*#__PURE__*/ _jsxs("span", { className: "text-xs text-gray-400 ml-2", children: [ "(", t('admin.cat.subcategory'), ")" ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "grid grid-cols-2 md:grid-cols-3 gap-3 mb-3", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.cat.slug') }), /*#__PURE__*/ _jsx("input", { value: catForm.slug, onChange: (e)=>setCatForm((f)=>f && { ...f, slug: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm", placeholder: "e.g. repairs" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.cat.icon') }), /*#__PURE__*/ _jsx(CategoryIconPicker, { value: catForm.icon, onChange: (icon)=>setCatForm((f)=>f && { ...f, icon }), onUpload: uploadCategoryIcon, uploading: catIconUploading, error: catIconError, presets: categoryIconPresets }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.cat.order') }), /*#__PURE__*/ _jsx("input", { type: "number", value: catForm.order, onChange: (e)=>setCatForm((f)=>f && { ...f, order: Number(e.target.value) }), className: "w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: [ t('admin.cat.name_el'), " \uD83C\uDDEC\uD83C\uDDF7" ] }), /*#__PURE__*/ _jsx("input", { value: catForm.namesEl, onChange: (e)=>setCatForm((f)=>f && { ...f, namesEl: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: [ t('admin.cat.name_en'), " \uD83C\uDDEC\uD83C\uDDE7" ] }), /*#__PURE__*/ _jsx("input", { value: catForm.namesEn, onChange: (e)=>setCatForm((f)=>f && { ...f, namesEn: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: [ t('admin.cat.name_ru'), " \uD83C\uDDF7\uD83C\uDDFA" ] }), /*#__PURE__*/ _jsx("input", { value: catForm.namesRu, onChange: (e)=>setCatForm((f)=>f && { ...f, namesRu: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: [ t('admin.cat.name_uk'), " \uD83C\uDDFA\uD83C\uDDE6" ] }), /*#__PURE__*/ _jsx("input", { value: catForm.namesUk, onChange: (e)=>setCatForm((f)=>f && { ...f, namesUk: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }) ] }), catForm.id && /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-2 text-sm text-gray-700 mb-3", children: [ /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: catForm.isActive, onChange: (e)=>setCatForm((f)=>f && { ...f, isActive: e.target.checked }) }), t('admin.cat.active') ] }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-2", children: [ /*#__PURE__*/ _jsx("button", { onClick: saveCat, disabled: catSaving, className: "px-4 py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700 disabled:opacity-50", children: catSaving ? t('common.saving') : t('common.save') }), /*#__PURE__*/ _jsx("button", { onClick: ()=>setCatForm(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: t('common.cancel') }) ] }) ] }), /*#__PURE__*/ _jsx("div", { className: "bg-white rounded-xl border border-gray-200 divide-y divide-gray-100", children: catRows.length === 0 ? /*#__PURE__*/ _jsx("div", { className: "px-4 py-8 text-center text-gray-400", children: t('admin.cat.empty') }) : /*#__PURE__*/ _jsx(CatTree, { rows: catRows, parentId: null, depth: 0, locale: locale, expanded: catExpanded, onToggle: toggleCatExpand, onEdit: openEditCat, onDelete: deleteCat, onAddChild: openAddCat, skillsExpanded: catSkillsExpanded, skillsCache: catSkillsCache, skillsLoading: catSkillsLoading, onToggleSkills: toggleCatSkills, skillForm: skillForm, skillSaving: skillSaving, onOpenAddSkill: openAddSkill, onOpenEditSkill: openEditSkill, onSaveSkill: saveSkill, onDeleteSkill: deleteSkill, onCancelSkillForm: ()=>setSkillForm(null), onSkillFormChange: setSkillForm, t: t }) }) ] }), tab === 'locations' && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("div", { className: "flex justify-between items-center mb-4", children: [ /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-500", children: t('admin.loc.hint') }), /*#__PURE__*/ _jsxs("button", { onClick: ()=>openAddLoc(null), className: "px-4 py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700", children: [ "+ ", t('admin.loc.add_city') ] }) ] }), locForm && /*#__PURE__*/ _jsxs("div", { className: "bg-green-50 border border-green-200 rounded-xl p-5 mb-4", children: [ /*#__PURE__*/ _jsxs("h3", { className: "font-semibold text-gray-800 mb-4", children: [ locForm.id ? t('admin.loc.edit') : t('admin.loc.new'), locForm.parentId && /*#__PURE__*/ _jsxs("span", { className: "text-xs text-gray-400 ml-2", children: [ "(", t('admin.loc.district'), ")" ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "grid grid-cols-2 md:grid-cols-4 gap-3 mb-3", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.cat.slug') }), /*#__PURE__*/ _jsx("input", { value: locForm.slug, onChange: (e)=>setLocForm((f)=>f && { ...f, slug: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm", placeholder: "e.g. athens-center" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: [ t('admin.cat.name_el'), " \uD83C\uDDEC\uD83C\uDDF7" ] }), /*#__PURE__*/ _jsx("input", { value: locForm.nameEl, onChange: (e)=>setLocForm((f)=>f && { ...f, nameEl: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: [ t('admin.cat.name_en'), " \uD83C\uDDEC\uD83C\uDDE7" ] }), /*#__PURE__*/ _jsx("input", { value: locForm.nameEn, onChange: (e)=>setLocForm((f)=>f && { ...f, nameEn: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: [ t('admin.cat.name_ru'), " \uD83C\uDDF7\uD83C\uDDFA" ] }), /*#__PURE__*/ _jsx("input", { value: locForm.nameRu, onChange: (e)=>setLocForm((f)=>f && { ...f, nameRu: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: [ t('admin.cat.name_uk'), " \uD83C\uDDFA\uD83C\uDDE6" ] }), /*#__PURE__*/ _jsx("input", { value: locForm.nameUk, onChange: (e)=>setLocForm((f)=>f && { ...f, nameUk: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-4 mb-3", children: [ /*#__PURE__*/ _jsxs("div", { className: "w-24", children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.cat.order') }), /*#__PURE__*/ _jsx("input", { type: "number", value: locForm.order, onChange: (e)=>setLocForm((f)=>f && { ...f, order: Number(e.target.value) }), className: "w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), locForm.id && /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-2 text-sm text-gray-700 mt-4", children: [ /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: locForm.isActive, onChange: (e)=>setLocForm((f)=>f && { ...f, isActive: e.target.checked }) }), t('admin.cat.active') ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-2", children: [ /*#__PURE__*/ _jsx("button", { onClick: saveLoc, disabled: locSaving, className: "px-4 py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700 disabled:opacity-50", children: locSaving ? t('common.saving') : t('common.save') }), /*#__PURE__*/ _jsx("button", { onClick: ()=>setLocForm(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: t('common.cancel') }) ] }) ] }), /*#__PURE__*/ _jsx("div", { className: "bg-white rounded-xl border border-gray-200 divide-y divide-gray-100", children: locRows.length === 0 ? /*#__PURE__*/ _jsx("div", { className: "px-4 py-8 text-center text-gray-400", children: t('admin.loc.empty') }) : /*#__PURE__*/ _jsx(LocTree, { rows: locRows, parentId: null, depth: 0, locale: locale, expanded: locExpanded, onToggle: toggleLocExpand, onEdit: openEditLoc, onDelete: deleteLoc, onAddChild: openAddLoc, t: t }) }) ] }), tab === 'reports' && /*#__PURE__*/ _jsxs("div", { className: "space-y-3", children: [ loading ? /*#__PURE__*/ _jsx("div", { className: "text-center py-10 text-gray-400", children: t('common.loading') }) : reports.length === 0 ? /*#__PURE__*/ _jsx("div", { className: "text-center py-10 text-gray-400", children: t('admin.reports.none') }) : reports.map((r)=>{ var _r_targetId; var _reportStatusColors_r_status, _reasonColors_r_reason; return /*#__PURE__*/ _jsx("div", { className: "bg-white rounded-xl border border-gray-200 p-5", children: /*#__PURE__*/ _jsxs("div", { className: "flex items-start justify-between gap-4", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 flex-wrap mb-2", children: [ /*#__PURE__*/ _jsx("span", { className: "px-2 py-0.5 rounded-full text-xs font-medium ".concat((_reportStatusColors_r_status = reportStatusColors[r.status]) !== null && _reportStatusColors_r_status !== void 0 ? _reportStatusColors_r_status : 'bg-gray-100 text-gray-500'), children: r.status }), /*#__PURE__*/ _jsx("span", { className: "px-2 py-0.5 rounded-full text-xs font-medium ".concat((_reasonColors_r_reason = reasonColors[r.reason]) !== null && _reasonColors_r_reason !== void 0 ? _reasonColors_r_reason : 'bg-gray-100 text-gray-600'), children: r.reason }), /*#__PURE__*/ _jsxs("span", { className: "text-xs text-gray-400", children: [ r.targetType === 'task' ? t('admin.reports.target.task') : t('admin.reports.target.user'), ":", ' ', r.targetTitle ? /*#__PURE__*/ _jsx(Link, { href: r.targetType === 'task' ? "/tasks/".concat(r.targetId) : "/users/".concat(r.targetId), className: "text-green-600 hover:underline font-medium", target: "_blank", children: r.targetTitle }) : /*#__PURE__*/ _jsxs("span", { className: "font-mono", children: [ "#", (_r_targetId = r.targetId) === null || _r_targetId === void 0 ? void 0 : _r_targetId.slice(0, 8) ] }) ] }) ] }), r.reporterName && /*#__PURE__*/ _jsxs("p", { className: "text-xs text-gray-400 mb-1", children: [ t('admin.col.reporter'), ": ", /*#__PURE__*/ _jsx("span", { className: "font-medium text-gray-600", children: r.reporterName }) ] }), r.description && /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-700", children: r.description }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-1.5", children: new Date(r.createdAt).toLocaleString(dateLocale) }) ] }), r.status === 'pending' && /*#__PURE__*/ _jsxs("div", { className: "flex gap-2 flex-shrink-0", children: [ /*#__PURE__*/ _jsx("button", { onClick: ()=>handleReport(r.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: t('admin.reports.reviewed') }), /*#__PURE__*/ _jsx("button", { onClick: ()=>handleReport(r.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: t('admin.reports.dismiss') }) ] }) ] }) }, r.id); }), /*#__PURE__*/ _jsx(Pagination, { page: reportsPage, total: reportsTotal, limit: 20, onChange: setReportsPage, totalLabel: t('admin.pagination.total') }) ] }), tab === 'moderation' && /*#__PURE__*/ _jsxs("div", { className: "space-y-6", children: [ /*#__PURE__*/ _jsxs("div", { className: "grid md:grid-cols-2 gap-4", children: [ /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-5", children: [ /*#__PURE__*/ _jsx("div", { className: "text-sm text-gray-500", children: t('admin.moderation.pending_count', 'Pending') }), /*#__PURE__*/ _jsx("div", { className: "text-3xl font-bold text-gray-900 mt-1", children: pendingModerationCards.length }), /*#__PURE__*/ _jsx("div", { className: "text-xs text-gray-400 mt-1", children: t('admin.moderation.pending_hint', 'New proposals waiting for approval') }) ] }), /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-5", children: [ /*#__PURE__*/ _jsx("div", { className: "text-sm text-gray-500", children: t('admin.moderation.active_count', 'Active') }), /*#__PURE__*/ _jsx("div", { className: "text-3xl font-bold text-gray-900 mt-1", children: activeModerationCards.length }), /*#__PURE__*/ _jsx("div", { className: "text-xs text-gray-400 mt-1", children: t('admin.moderation.active_hint', 'Visible cards that can be blocked') }) ] }) ] }), moderationCardsLoading ? /*#__PURE__*/ _jsx("div", { className: "text-center py-10 text-gray-400", children: t('common.loading') }) : moderationCards.length === 0 ? /*#__PURE__*/ _jsx("div", { className: "text-center py-10 text-gray-400", children: t('admin.moderation.none', 'No specialist cards found') }) : /*#__PURE__*/ _jsxs("div", { className: "space-y-6", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-gray-800 mb-3", children: t('admin.moderation.pending_title', 'Pending approval') }), /*#__PURE__*/ _jsx("div", { className: "space-y-3", children: pendingModerationCards.length === 0 ? /*#__PURE__*/ _jsx("div", { className: "text-sm text-gray-400 bg-white border border-dashed border-gray-200 rounded-xl p-4", children: t('admin.moderation.pending_empty', 'No pending proposals right now') }) : pendingModerationCards.map((card)=>{ var _card_specialistName, _ref; return /*#__PURE__*/ _jsx("div", { className: "bg-white rounded-xl border border-gray-200 p-4", children: /*#__PURE__*/ _jsxs("div", { className: "flex flex-wrap items-start justify-between gap-3", children: [ /*#__PURE__*/ _jsxs("div", { className: "min-w-0 flex-1", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 flex-wrap mb-1", children: [ /*#__PURE__*/ _jsx("span", { className: "px-2 py-0.5 rounded-full text-xs font-medium bg-yellow-100 text-yellow-700", children: t('admin.moderation.pending', 'Pending') }), /*#__PURE__*/ _jsx("span", { className: "text-sm font-semibold text-gray-800 truncate", children: card.title }) ] }), /*#__PURE__*/ _jsx("div", { className: "text-xs text-gray-500 mb-2", children: /*#__PURE__*/ _jsx(Link, { href: "/users/".concat(card.specialistId), className: "hover:text-green-600 hover:underline font-medium", children: (_ref = (_card_specialistName = card.specialistName) !== null && _card_specialistName !== void 0 ? _card_specialistName : card.specialistEmail) !== null && _ref !== void 0 ? _ref : card.specialistId }) }), card.description && /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-700 line-clamp-3", children: card.description }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-2 flex-shrink-0", children: [ /*#__PURE__*/ _jsx("button", { onClick: ()=>updateModerationCard(card.id, 'active'), className: "px-3 py-1.5 rounded-lg text-xs font-medium bg-green-600 text-white hover:bg-green-700", children: t('admin.moderation.approve', 'Approve') }), /*#__PURE__*/ _jsx("button", { onClick: ()=>updateModerationCard(card.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: t('admin.moderation.block', 'Block') }) ] }) ] }) }, card.id); }) }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-gray-800 mb-3", children: t('admin.moderation.active_title', 'Active cards') }), /*#__PURE__*/ _jsx("div", { className: "space-y-3", children: activeModerationCards.length === 0 ? /*#__PURE__*/ _jsx("div", { className: "text-sm text-gray-400 bg-white border border-dashed border-gray-200 rounded-xl p-4", children: t('admin.moderation.active_empty', 'No active cards found') }) : activeModerationCards.map((card)=>{ var _card_specialistName, _ref; return /*#__PURE__*/ _jsx("div", { className: "bg-white rounded-xl border border-gray-200 p-4", children: /*#__PURE__*/ _jsxs("div", { className: "flex flex-wrap items-start justify-between gap-3", children: [ /*#__PURE__*/ _jsxs("div", { className: "min-w-0 flex-1", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 flex-wrap mb-1", children: [ /*#__PURE__*/ _jsx("span", { className: "px-2 py-0.5 rounded-full text-xs font-medium bg-green-100 text-green-700", children: t('admin.moderation.active', 'Active') }), /*#__PURE__*/ _jsx("span", { className: "text-sm font-semibold text-gray-800 truncate", children: card.title }) ] }), /*#__PURE__*/ _jsx("div", { className: "text-xs text-gray-500 mb-2", children: /*#__PURE__*/ _jsx(Link, { href: "/users/".concat(card.specialistId), className: "hover:text-green-600 hover:underline font-medium", children: (_ref = (_card_specialistName = card.specialistName) !== null && _card_specialistName !== void 0 ? _card_specialistName : card.specialistEmail) !== null && _ref !== void 0 ? _ref : card.specialistId }) }), card.description && /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-700 line-clamp-3", children: card.description }) ] }), /*#__PURE__*/ _jsx("button", { onClick: ()=>updateModerationCard(card.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: t('admin.moderation.block', 'Block') }) ] }) }, card.id); }) }) ] }), /*#__PURE__*/ _jsx(Pagination, { page: moderationCardsPage, total: moderationCardsTotal, limit: 20, onChange: setModerationCardsPage, totalLabel: t('admin.pagination.total') }) ] }) ] }), tab === 'logs' && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("div", { className: "flex gap-1 bg-gray-100 rounded-xl p-1 mb-5 w-fit", children: [ { key: 'ai', label: t('admin.logs.subtab.ai') }, { key: 'activity', label: t('admin.logs.subtab.activity') }, { key: 'mail', label: t('admin.logs.subtab.mail') }, { key: 'notifications', label: t('admin.logs.subtab.notifications') } ].map((param)=>{ let { key, label } = param; return /*#__PURE__*/ _jsx("button", { onClick: ()=>setLogsSubTab(key), className: "px-4 py-1.5 rounded-lg text-sm font-medium transition-colors ".concat(logsSubTab === key ? 'bg-white text-gray-900 shadow-sm' : 'text-gray-500 hover:text-gray-700'), children: label }, key); }) }), logsSubTab === 'ai' && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("div", { className: "flex justify-between items-center mb-4", children: [ /*#__PURE__*/ _jsxs("p", { className: "text-sm text-gray-500", children: [ t('admin.pagination.total'), ": ", logsTotal ] }), /*#__PURE__*/ _jsxs("button", { onClick: ()=>{ setLogsPage(1); api.getAdminAiLogs(1).then((d)=>{ setLogs(d.data); setLogsTotal(d.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: [ /*#__PURE__*/ _jsxs("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ _jsx("polyline", { points: "23 4 23 10 17 10" }), /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M20.49 15a9 9 0 11-2.12-9.36L23 10" }) ] }), t('common.refresh') ] }) ] }), loading ? /*#__PURE__*/ _jsx("div", { className: "text-center py-10 text-gray-400", children: t('common.loading') }) : logs.length === 0 ? /*#__PURE__*/ _jsx("div", { className: "text-center py-10 text-gray-400", children: t('admin.logs.empty') }) : /*#__PURE__*/ _jsx("div", { className: "overflow-x-auto rounded-xl border border-gray-200", children: /*#__PURE__*/ _jsxs("table", { className: "w-full text-sm", children: [ /*#__PURE__*/ _jsx("thead", { className: "bg-gray-50 text-gray-500 text-xs uppercase", children: /*#__PURE__*/ _jsxs("tr", { children: [ /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 text-left", children: t('admin.logs.date') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 text-left", children: t('admin.logs.provider') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 text-left", children: t('admin.logs.model') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 text-left", children: t('admin.logs.action') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 text-left", children: t('admin.logs.langs') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 text-right", children: t('admin.logs.in') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 text-right", children: t('admin.logs.out') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 text-right", children: t('admin.logs.total') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 text-right", children: t('admin.logs.ms') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 text-center", children: t('admin.logs.status') }) ] }) }), /*#__PURE__*/ _jsx("tbody", { className: "divide-y divide-gray-100", children: logs.map((log)=>{ var _log_inputTokens, _log_outputTokens, _log_totalTokens, _log_durationMs, _log_error; return /*#__PURE__*/ _jsxs("tr", { className: "bg-white hover:bg-gray-50", children: [ /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-gray-500 whitespace-nowrap", children: new Date(log.createdAt).toLocaleString(dateLocale) }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3", children: /*#__PURE__*/ _jsx("span", { className: "px-2 py-0.5 rounded-full text-xs font-medium ".concat(log.provider === 'anthropic' ? 'bg-purple-100 text-purple-700' : 'bg-green-100 text-green-700'), children: log.provider }) }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-gray-600 font-mono text-xs", children: log.model }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-gray-600", children: log.action }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-gray-500", children: log.fromLocale && log.toLocale ? "".concat(log.fromLocale, " → ").concat(log.toLocale) : '—' }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-right text-gray-600", children: (_log_inputTokens = log.inputTokens) !== null && _log_inputTokens !== void 0 ? _log_inputTokens : '—' }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-right text-gray-600", children: (_log_outputTokens = log.outputTokens) !== null && _log_outputTokens !== void 0 ? _log_outputTokens : '—' }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-right font-medium", children: (_log_totalTokens = log.totalTokens) !== null && _log_totalTokens !== void 0 ? _log_totalTokens : '—' }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-right text-gray-500", children: (_log_durationMs = log.durationMs) !== null && _log_durationMs !== void 0 ? _log_durationMs : '—' }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-center", children: log.success ? /*#__PURE__*/ _jsx("span", { className: "text-green-600 flex justify-center", children: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("polyline", { points: "20 6 9 17 4 12" }) }) }) : /*#__PURE__*/ _jsx("span", { className: "text-red-500 flex justify-center", title: (_log_error = log.error) !== null && _log_error !== void 0 ? _log_error : '', children: /*#__PURE__*/ _jsxs("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: [ /*#__PURE__*/ _jsx("line", { x1: "18", y1: "6", x2: "6", y2: "18" }), /*#__PURE__*/ _jsx("line", { x1: "6", y1: "6", x2: "18", y2: "18" }) ] }) }) }) ] }, log.id); }) }) ] }) }), /*#__PURE__*/ _jsx(Pagination, { page: logsPage, total: logsTotal, limit: 50, onChange: setLogsPage, totalLabel: t('admin.pagination.total') }) ] }), logsSubTab === 'activity' && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-4 mb-4 flex flex-wrap gap-3 items-end", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-500 mb-1", children: t('admin.activity.event') }), /*#__PURE__*/ _jsxs("select", { value: activityEvent, onChange: (e)=>setActivityEvent(e.target.value), className: "border border-gray-300 rounded-lg px-3 py-1.5 text-sm min-w-[180px]", children: [ /*#__PURE__*/ _jsx("option", { value: "", children: t('admin.activity.all_events') }), activityEventTypes.map((ev)=>/*#__PURE__*/ _jsx("option", { value: ev, children: ev }, ev)) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-500 mb-1", children: t('admin.activity.from') }), /*#__PURE__*/ _jsx("input", { type: "date", value: activityDateFrom, onChange: (e)=>setActivityDateFrom(e.target.value), className: "border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-500 mb-1", children: t('admin.activity.to') }), /*#__PURE__*/ _jsx("input", { type: "date", value: activityDateTo, onChange: (e)=>setActivityDateTo(e.target.value), className: "border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), (activityEvent || activityDateFrom || activityDateTo || activityUserId) && /*#__PURE__*/ _jsxs("button", { onClick: ()=>{ setActivityEvent(''); setActivityDateFrom(''); setActivityDateTo(''); setActivityUserId(''); }, 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: [ /*#__PURE__*/ _jsxs("svg", { className: "w-3 h-3", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: [ /*#__PURE__*/ _jsx("line", { x1: "18", y1: "6", x2: "6", y2: "18" }), /*#__PURE__*/ _jsx("line", { x1: "6", y1: "6", x2: "18", y2: "18" }) ] }), t('admin.activity.reset') ] }), /*#__PURE__*/ _jsxs("p", { className: "text-xs text-gray-400 self-end ml-auto", children: [ t('admin.activity.total'), ": ", activityTotal ] }) ] }), activityLog.length === 0 ? /*#__PURE__*/ _jsx("div", { className: "text-center py-10 text-gray-400", children: t('admin.activity.empty') }) : /*#__PURE__*/ _jsx("div", { className: "space-y-2", children: activityLog.map((entry)=>/*#__PURE__*/ _jsx(ActivityLogRow, { entry: entry, dateLocale: dateLocale, onFilterUser: (id)=>{ setActivityUserId(id); setActivityEvent(''); }, t: t }, entry.id)) }), /*#__PURE__*/ _jsx(Pagination, { page: activityPage, total: activityTotal, limit: 50, onChange: setActivityPage, totalLabel: t('admin.pagination.total') }) ] }), logsSubTab === 'mail' && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-4 mb-4 flex flex-wrap gap-3 items-end", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-500 mb-1", children: t('admin.mail.event') }), /*#__PURE__*/ _jsxs("select", { value: mailEvent, onChange: (e)=>setMailEvent(e.target.value), className: "border border-gray-300 rounded-lg px-3 py-1.5 text-sm min-w-[200px]", children: [ /*#__PURE__*/ _jsx("option", { value: "", children: t('admin.mail.all_events') }), mailEventTypes.map((ev)=>/*#__PURE__*/ _jsx("option", { value: ev, children: t("admin.event.".concat(ev.replace(/\./g, '_')), ev) }, ev)) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-500 mb-1", children: t('admin.mail.from') }), /*#__PURE__*/ _jsx("input", { type: "date", value: mailDateFrom, onChange: (e)=>setMailDateFrom(e.target.value), className: "border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-500 mb-1", children: t('admin.mail.to') }), /*#__PURE__*/ _jsx("input", { type: "date", value: mailDateTo, onChange: (e)=>setMailDateTo(e.target.value), className: "border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), (mailEvent || mailDateFrom || mailDateTo) && /*#__PURE__*/ _jsxs("button", { onClick: ()=>{ setMailEvent(''); setMailDateFrom(''); setMailDateTo(''); }, 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: [ /*#__PURE__*/ _jsxs("svg", { className: "w-3 h-3", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: [ /*#__PURE__*/ _jsx("line", { x1: "18", y1: "6", x2: "6", y2: "18" }), /*#__PURE__*/ _jsx("line", { x1: "6", y1: "6", x2: "18", y2: "18" }) ] }), t('admin.mail.reset') ] }), /*#__PURE__*/ _jsxs("p", { className: "text-xs text-gray-400 self-end ml-auto", children: [ t('admin.mail.total'), ": ", mailTotal ] }) ] }), mailLog.length === 0 ? /*#__PURE__*/ _jsx("div", { className: "text-center py-10 text-gray-400", children: t('admin.mail.empty') }) : /*#__PURE__*/ _jsx("div", { className: "overflow-x-auto rounded-xl border border-gray-200", children: /*#__PURE__*/ _jsxs("table", { className: "w-full text-sm", children: [ /*#__PURE__*/ _jsx("thead", { className: "bg-gray-50 text-gray-500 text-xs uppercase", children: /*#__PURE__*/ _jsxs("tr", { children: [ /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 text-left", children: t('admin.logs.date') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 text-left", children: t('admin.mail.recipient') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 text-left", children: t('admin.mail.event') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 text-left", children: t('admin.mail.provider') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 text-left", children: t('admin.mail.details') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 text-center", children: t('admin.mail.status') }) ] }) }), /*#__PURE__*/ _jsx("tbody", { className: "divide-y divide-gray-100", children: mailLog.map((entry)=>{ const details = parseLogDetails(entry.details); const provider = typeof (details === null || details === void 0 ? void 0 : details.provider) === 'string' ? details.provider : '—'; const recipient = typeof (details === null || details === void 0 ? void 0 : details.to) === 'string' ? details.to : entry.userEmail || '—'; const subject = typeof (details === null || details === void 0 ? void 0 : details.subject) === 'string' ? details.subject : ''; const error = typeof (details === null || details === void 0 ? void 0 : details.error) === 'string' ? details.error : ''; const success = entry.event === 'email.sent' || entry.event === 'admin.email.test.sent'; return /*#__PURE__*/ _jsxs("tr", { className: "bg-white hover:bg-gray-50 align-top", children: [ /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-gray-500 whitespace-nowrap", children: new Date(entry.createdAt).toLocaleString(dateLocale) }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-gray-700", children: recipient }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3", children: /*#__PURE__*/ _jsx("span", { className: "px-2 py-0.5 rounded-full text-xs font-medium bg-sky-50 text-sky-700", children: t("admin.event.".concat(entry.event.replace(/\./g, '_')), entry.event) }) }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-gray-600", children: provider }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-gray-600 max-w-md", children: /*#__PURE__*/ _jsx("div", { className: "truncate", title: subject || error || undefined, children: subject || error || '—' }) }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-center", children: success ? /*#__PURE__*/ _jsx("span", { className: "text-green-600 inline-flex justify-center", title: t('admin.mail.success'), children: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("polyline", { points: "20 6 9 17 4 12" }) }) }) : /*#__PURE__*/ _jsx("span", { className: "text-red-500 inline-flex justify-center", title: error || t('admin.mail.failed'), children: /*#__PURE__*/ _jsxs("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: [ /*#__PURE__*/ _jsx("line", { x1: "18", y1: "6", x2: "6", y2: "18" }), /*#__PURE__*/ _jsx("line", { x1: "6", y1: "6", x2: "18", y2: "18" }) ] }) }) }) ] }, entry.id); }) }) ] }) }), /*#__PURE__*/ _jsx(Pagination, { page: mailPage, total: mailTotal, limit: 50, onChange: setMailPage, totalLabel: t('admin.pagination.total') }) ] }), logsSubTab === 'notifications' && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-4 mb-4 flex flex-wrap gap-3 items-end", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-500 mb-1", children: t('admin.notif_logs.type') }), /*#__PURE__*/ _jsxs("select", { value: notifLogsType, onChange: (e)=>setNotifLogsType(e.target.value), className: "border border-gray-300 rounded-lg px-3 py-1.5 text-sm min-w-[200px]", children: [ /*#__PURE__*/ _jsx("option", { value: "", children: t('admin.filter.all') }), notifLogsTypes.map((tp)=>/*#__PURE__*/ _jsx("option", { value: tp, children: tp }, tp)) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-500 mb-1", children: t('admin.activity.from') }), /*#__PURE__*/ _jsx("input", { type: "date", value: notifLogsDateFrom, onChange: (e)=>setNotifLogsDateFrom(e.target.value), className: "border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-500 mb-1", children: t('admin.activity.to') }), /*#__PURE__*/ _jsx("input", { type: "date", value: notifLogsDateTo, onChange: (e)=>setNotifLogsDateTo(e.target.value), className: "border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), (notifLogsType || notifLogsDateFrom || notifLogsDateTo) && /*#__PURE__*/ _jsxs("button", { onClick: ()=>{ setNotifLogsType(''); setNotifLogsDateFrom(''); setNotifLogsDateTo(''); }, 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: [ /*#__PURE__*/ _jsxs("svg", { className: "w-3 h-3", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: [ /*#__PURE__*/ _jsx("line", { x1: "18", y1: "6", x2: "6", y2: "18" }), /*#__PURE__*/ _jsx("line", { x1: "6", y1: "6", x2: "18", y2: "18" }) ] }), t('admin.activity.reset') ] }), /*#__PURE__*/ _jsxs("p", { className: "text-xs text-gray-400 self-end ml-auto", children: [ t('admin.pagination.total'), ": ", notifLogsTotal ] }) ] }), notifLogs.length === 0 ? /*#__PURE__*/ _jsx("div", { className: "text-center py-10 text-gray-400", children: t('admin.notif_logs.empty') }) : /*#__PURE__*/ _jsx("div", { className: "overflow-x-auto rounded-xl border border-gray-200", children: /*#__PURE__*/ _jsxs("table", { className: "w-full text-sm", children: [ /*#__PURE__*/ _jsx("thead", { className: "bg-gray-50 text-gray-500 text-xs uppercase", children: /*#__PURE__*/ _jsxs("tr", { children: [ /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 text-left", children: t('admin.logs.date') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 text-left", children: t('admin.col.user') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 text-left", children: t('admin.notif_logs.type') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 text-left", children: t('admin.notif_logs.title') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 text-center", children: t('admin.notif_logs.read') }) ] }) }), /*#__PURE__*/ _jsx("tbody", { className: "divide-y divide-gray-100", children: notifLogs.map((n)=>{ var _n_recipientName, _ref; return /*#__PURE__*/ _jsxs("tr", { className: "bg-white hover:bg-gray-50", children: [ /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-gray-500 whitespace-nowrap", children: new Date(n.createdAt).toLocaleString(dateLocale) }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-gray-700", children: (_ref = (_n_recipientName = n.recipientName) !== null && _n_recipientName !== void 0 ? _n_recipientName : n.recipientEmail) !== null && _ref !== void 0 ? _ref : n.recipientId }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3", children: /*#__PURE__*/ _jsx("span", { className: "px-2 py-0.5 rounded-full text-xs font-medium bg-green-50 text-green-700", children: n.type }) }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-gray-600 max-w-xs truncate", children: n.title }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-center", children: n.isRead ? /*#__PURE__*/ _jsx("span", { className: "text-green-600 flex justify-center", children: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("polyline", { points: "20 6 9 17 4 12" }) }) }) : /*#__PURE__*/ _jsx("span", { className: "text-gray-400 flex justify-center", children: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("circle", { cx: "12", cy: "12", r: "10" }) }) }) }) ] }, n.id); }) }) ] }) }), /*#__PURE__*/ _jsx(Pagination, { page: notifLogsPage, total: notifLogsTotal, limit: 50, onChange: setNotifLogsPage, totalLabel: t('admin.pagination.total') }) ] }) ] }), tab === 'plans' && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between mb-4", children: [ /*#__PURE__*/ _jsxs("h2", { className: "text-lg font-semibold text-gray-800 flex items-center gap-2", children: [ /*#__PURE__*/ _jsxs("svg", { className: "w-5 h-5 text-green-600", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: [ /*#__PURE__*/ _jsx("rect", { x: "1", y: "4", width: "22", height: "16", rx: "2", ry: "2" }), /*#__PURE__*/ _jsx("line", { x1: "1", y1: "10", x2: "23", y2: "10" }) ] }), t('admin.plans.title') ] }), /*#__PURE__*/ _jsx("button", { onClick: openAddPlan, className: "bg-green-600 text-white text-sm px-4 py-2 rounded-lg hover:bg-green-700 font-medium", children: t('admin.plans.add') }) ] }), planForm && /*#__PURE__*/ _jsxs("div", { className: "bg-white border border-gray-200 rounded-xl p-5 mb-4 space-y-3", children: [ /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-gray-800", children: planForm.id ? t('admin.plans.form.edit') : t('admin.plans.form.new') }), /*#__PURE__*/ _jsxs("div", { className: "grid grid-cols-2 gap-3", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.name') }), /*#__PURE__*/ _jsx("input", { value: planForm.name, onChange: (e)=>setPlanForm({ ...planForm, name: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.price') }), /*#__PURE__*/ _jsx("input", { type: "number", min: "0", step: "0.01", value: planForm.price, onChange: (e)=>setPlanForm({ ...planForm, price: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.old_price') }), /*#__PURE__*/ _jsx("input", { type: "number", min: "0", step: "0.01", value: (_planForm_oldPrice = planForm.oldPrice) !== null && _planForm_oldPrice !== void 0 ? _planForm_oldPrice : '', onChange: (e)=>setPlanForm({ ...planForm, oldPrice: e.target.value }), placeholder: "—", className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.tier') }), /*#__PURE__*/ _jsxs("select", { value: planForm.tier, onChange: (e)=>setPlanForm({ ...planForm, tier: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400", children: [ /*#__PURE__*/ _jsx("option", { value: "free", children: t('admin.plans.form.tier.free') }), /*#__PURE__*/ _jsx("option", { value: "pro", children: t('admin.plans.form.tier.pro') }), /*#__PURE__*/ _jsx("option", { value: "ultimate", children: t('admin.plans.form.tier.ultimate') }) ] }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.description') }), /*#__PURE__*/ _jsx("input", { value: planForm.description, onChange: (e)=>setPlanForm({ ...planForm, description: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ _jsx("p", { className: "text-xs font-semibold text-gray-500 uppercase tracking-wide pt-1", children: t('admin.plans.form.section.limits') }), /*#__PURE__*/ _jsxs("div", { className: "grid grid-cols-3 gap-3", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.max_tasks') }), /*#__PURE__*/ _jsx("input", { type: "number", min: "0", placeholder: "∞", value: planForm.maxTasks, onChange: (e)=>setPlanForm({ ...planForm, maxTasks: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.max_offers') }), /*#__PURE__*/ _jsx("input", { type: "number", min: "0", placeholder: "∞", value: planForm.maxOffers, onChange: (e)=>setPlanForm({ ...planForm, maxOffers: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.max_cards') }), /*#__PURE__*/ _jsx("input", { type: "number", min: "0", placeholder: "∞", value: planForm.maxCards, onChange: (e)=>setPlanForm({ ...planForm, maxCards: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.max_messages_day') }), /*#__PURE__*/ _jsx("input", { type: "number", min: "0", placeholder: "∞", value: planForm.maxMessagesPerDay, onChange: (e)=>setPlanForm({ ...planForm, maxMessagesPerDay: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.max_orders_day') }), /*#__PURE__*/ _jsx("input", { type: "number", min: "0", placeholder: "∞", value: planForm.maxOrdersPerDay, onChange: (e)=>setPlanForm({ ...planForm, maxOrdersPerDay: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.max_skills') }), /*#__PURE__*/ _jsx("input", { type: "number", min: "0", placeholder: "∞", value: planForm.maxSkills, onChange: (e)=>setPlanForm({ ...planForm, maxSkills: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.duration_days') }), /*#__PURE__*/ _jsx("input", { type: "number", min: "0", placeholder: "∞", value: planForm.durationDays, onChange: (e)=>setPlanForm({ ...planForm, durationDays: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }) ] }), /*#__PURE__*/ _jsx("p", { className: "text-xs font-semibold text-gray-500 uppercase tracking-wide pt-1", children: t('admin.plans.form.section.boost') }), /*#__PURE__*/ _jsxs("div", { className: "grid grid-cols-2 gap-3", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.search_boost') }), /*#__PURE__*/ _jsx("input", { type: "number", min: "0", value: planForm.searchBoost, onChange: (e)=>setPlanForm({ ...planForm, searchBoost: Number(e.target.value) }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.offers_multiplier') }), /*#__PURE__*/ _jsx("input", { type: "number", min: "0", step: "0.01", value: planForm.offersMultiplier, onChange: (e)=>setPlanForm({ ...planForm, offersMultiplier: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.features') }), /*#__PURE__*/ _jsx("textarea", { rows: 3, value: planForm.features, onChange: (e)=>setPlanForm({ ...planForm, features: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 resize-none" }) ] }), /*#__PURE__*/ _jsx("p", { className: "text-xs font-semibold text-gray-500 uppercase tracking-wide pt-1", children: t('admin.plans.form.section.contact') }), /*#__PURE__*/ _jsx("div", { className: "grid grid-cols-2 gap-2", children: [ [ 'canContactFreePlan', t('admin.plans.form.can_contact_free') ], [ 'canContactProPlan', t('admin.plans.form.can_contact_pro') ], [ 'canContactAll', t('admin.plans.form.can_contact_all') ], [ 'canShowContactInfo', t('admin.plans.form.can_show_contact') ], [ 'canViewPhone', t('admin.plans.form.can_view_phone') ] ].map((param)=>{ let [key, label] = param; return /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-2 cursor-pointer text-sm text-gray-700", children: [ /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: planForm[key], onChange: (e)=>setPlanForm({ ...planForm, [key]: e.target.checked }), className: "w-4 h-4 rounded text-green-600" }), label ] }, key); }) }), /*#__PURE__*/ _jsx("p", { className: "text-xs font-semibold text-gray-500 uppercase tracking-wide pt-1", children: t('admin.plans.form.section.features') }), /*#__PURE__*/ _jsx("div", { className: "grid grid-cols-2 gap-2", children: [ [ 'notifyNewTasks', t('admin.plans.form.notify') ], [ 'canUploadVideo', t('admin.plans.form.upload_video') ], [ 'hasFavorites', t('admin.plans.form.favorites') ], [ 'hasGoogleCalendar', t('admin.plans.form.google_calendar') ], [ 'hasVerifiedBadge', t('admin.plans.form.verified_badge') ], [ 'highlightedReviews', t('admin.plans.form.highlighted_reviews') ], [ 'hasPersonalSite', t('admin.plans.form.personal_site') ], [ 'hasCanHelpNowStatus', t('admin.plans.form.can_help_now') ], [ 'hasNeedHelpStatus', t('admin.plans.form.need_help') ], [ 'hasAutoResponse', t('admin.plans.form.auto_response') ], [ 'hasAutoMatch', t('admin.plans.form.auto_match') ], [ 'hasPriceList', t('admin.plans.form.price_list') ], [ 'receiveInstantDispatchFree', t('admin.plans.form.instant_dispatch_free') ], [ 'receiveInstantDispatchPro', t('admin.plans.form.instant_dispatch_pro') ] ].map((param)=>{ let [key, label] = param; return /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-2 cursor-pointer text-sm text-gray-700", children: [ /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: planForm[key], onChange: (e)=>setPlanForm({ ...planForm, [key]: e.target.checked }), className: "w-4 h-4 rounded text-green-600" }), label ] }, key); }) }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-6 pt-1", children: [ /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-2 cursor-pointer text-sm text-gray-700", children: [ /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: planForm.isDefault, onChange: (e)=>setPlanForm({ ...planForm, isDefault: e.target.checked }), className: "w-4 h-4 rounded text-green-600" }), t('admin.plans.form.default') ] }), /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-2 cursor-pointer text-sm text-gray-700", children: [ /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: planForm.isActive, onChange: (e)=>setPlanForm({ ...planForm, isActive: e.target.checked }), className: "w-4 h-4 rounded text-green-600" }), t('admin.plans.form.active') ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2", children: [ /*#__PURE__*/ _jsx("label", { className: "text-xs text-gray-600", children: t('admin.plans.form.order') }), /*#__PURE__*/ _jsx("input", { type: "number", value: planForm.order, onChange: (e)=>setPlanForm({ ...planForm, order: Number(e.target.value) }), className: "w-16 border border-gray-300 rounded-lg px-2 py-1 text-sm focus:outline-none" }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-2 pt-1", children: [ /*#__PURE__*/ _jsx("button", { onClick: savePlan, disabled: planSaving || !planForm.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: planSaving ? '...' : t('common.save') }), /*#__PURE__*/ _jsx("button", { onClick: ()=>setPlanForm(null), className: "px-4 py-2 rounded-lg text-sm font-medium text-gray-600 hover:bg-gray-100", children: t('common.cancel') }) ] }) ] }), /*#__PURE__*/ _jsx("div", { className: "bg-white rounded-xl border border-gray-200 overflow-hidden", children: planRows.length === 0 ? /*#__PURE__*/ _jsx("div", { className: "px-4 py-8 text-center text-gray-400 text-sm", children: t('admin.plans.empty') }) : /*#__PURE__*/ _jsx("div", { className: "divide-y divide-gray-100", children: planRows.sort((a, b)=>{ var _a_order, _b_order; return ((_a_order = a.order) !== null && _a_order !== void 0 ? _a_order : 0) - ((_b_order = b.order) !== null && _b_order !== void 0 ? _b_order : 0); }).map((plan)=>{ var _plan_features; return /*#__PURE__*/ _jsxs("div", { className: "flex items-start gap-4 px-4 py-4 ".concat(!plan.isActive ? 'opacity-50' : ''), children: [ /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 flex-wrap", children: [ /*#__PURE__*/ _jsx("span", { className: "font-semibold text-gray-900", children: plan.name }), plan.isDefault && /*#__PURE__*/ _jsx("span", { className: "bg-green-100 text-green-700 text-xs px-2 py-0.5 rounded-full font-medium", children: t('admin.plans.badge.default') }), !plan.isActive && /*#__PURE__*/ _jsx("span", { className: "bg-gray-100 text-gray-500 text-xs px-2 py-0.5 rounded-full", children: t('admin.plans.badge.inactive') }) ] }), plan.description && /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-500 mt-0.5", children: plan.description }), /*#__PURE__*/ _jsxs("div", { className: "flex flex-wrap gap-3 mt-1 text-xs text-gray-500", children: [ /*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-1.5 font-semibold text-gray-800", children: [ plan.oldPrice && /*#__PURE__*/ _jsxs("span", { className: "font-normal text-gray-400 line-through", children: [ plan.oldPrice, " ", plan.currency ] }), /*#__PURE__*/ _jsxs("span", { children: [ plan.price, " ", plan.currency ] }) ] }), plan.maxTasks != null && /*#__PURE__*/ _jsxs("span", { children: [ t('admin.plans.tasks'), ": ", plan.maxTasks ] }), plan.maxOffers != null && /*#__PURE__*/ _jsxs("span", { children: [ t('admin.plans.offers'), ": ", plan.maxOffers ] }), plan.maxCards != null && /*#__PURE__*/ _jsxs("span", { children: [ t('admin.plans.cards'), ": ", plan.maxCards ] }), plan.notifyNewTasks && /*#__PURE__*/ _jsxs("span", { className: "text-green-700 flex items-center gap-1", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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" }) }), t('admin.plans.notify_tasks') ] }) ] }), ((_plan_features = plan.features) !== null && _plan_features !== void 0 ? _plan_features : []).length > 0 && /*#__PURE__*/ _jsx("ul", { className: "mt-1.5 space-y-0.5", children: plan.features.map((f, i)=>/*#__PURE__*/ _jsxs("li", { className: "text-xs text-gray-600 flex items-center gap-1.5", children: [ /*#__PURE__*/ _jsx("span", { className: "text-green-500", children: /*#__PURE__*/ _jsx("svg", { className: "w-3 h-3", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("polyline", { points: "20 6 9 17 4 12" }) }) }), " ", f ] }, i)) }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-1 shrink-0", children: [ !plan.isDefault && /*#__PURE__*/ _jsx("button", { onClick: ()=>api.updatePlan(plan.id, { isDefault: true }).then(()=>api.getAdminPlans().then(setPlanRows)).catch(()=>{}), className: "text-xs px-2 py-1 rounded-lg bg-green-50 text-green-600 hover:bg-green-100 font-medium", title: t('admin.plans.make_default'), children: /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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" }) }) }), /*#__PURE__*/ _jsx("button", { onClick: ()=>openEditPlan(plan), className: "text-xs px-2 py-1 rounded-lg bg-gray-100 text-gray-600 hover:bg-gray-200 font-medium", children: t('common.edit') }), /*#__PURE__*/ _jsx("button", { onClick: ()=>deletePlan(plan.id, plan.name), className: "text-xs px-2 py-1 rounded-lg bg-red-50 text-red-600 hover:bg-red-100 font-medium", children: t('common.delete') }) ] }) ] }, plan.id); }) }) }) ] }), tab === 'settings' && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _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((st)=>{ const labels = { general: t('admin.settings.tab.general'), smtp: t('admin.settings.tab.smtp'), notifications: t('admin.settings.tab.notifications'), payment: t('admin.settings.tab.payment'), referral: t('admin.settings.tab.referral'), seo: t('admin.settings.tab.seo'), socials: t('admin.settings.tab.socials'), telegram: t('admin.settings.tab.telegram') }; return /*#__PURE__*/ _jsx("button", { onClick: ()=>setSettingsTab(st), className: "px-4 py-2 rounded-lg text-sm font-medium transition ".concat(settingsTab === st ? 'bg-green-600 text-white shadow-sm' : 'text-gray-600 hover:bg-gray-100'), children: labels[st] }, st); }) }), settingsTab === 'general' && /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6 max-w-lg", children: [ /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-gray-800 mb-5", children: t('admin.settings.general.title') }), /*#__PURE__*/ _jsxs("div", { className: "space-y-4", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.general.site_name') }), /*#__PURE__*/ _jsx("input", { value: generalForm.siteName, onChange: (e)=>setGeneralForm((f)=>({ ...f, siteName: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400", placeholder: "CanHelp" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.general.site_url') }), /*#__PURE__*/ _jsx("input", { value: generalForm.siteUrl, onChange: (e)=>setGeneralForm((f)=>({ ...f, siteUrl: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400", placeholder: "https://canhelp.com" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.general.contact_email') }), /*#__PURE__*/ _jsx("input", { type: "email", value: generalForm.contactEmail, onChange: (e)=>setGeneralForm((f)=>({ ...f, contactEmail: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400", placeholder: "contact@canhelp.com" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.general.support_phone') }), /*#__PURE__*/ _jsx("input", { value: generalForm.supportPhone, onChange: (e)=>setGeneralForm((f)=>({ ...f, supportPhone: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400", placeholder: "+30 21 000 0000" }) ] }), /*#__PURE__*/ _jsx("button", { onClick: saveGeneralSettings, disabled: generalSaving, 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: generalSaving ? t('admin.settings.saving') : generalSaved ? t('admin.settings.saved') : t('common.save') }) ] }) ] }), settingsTab === 'smtp' && /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6 max-w-lg", children: [ /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-gray-800 mb-1", children: t('admin.settings.smtp.title') }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-400 mb-5", children: t('admin.settings.smtp.hint') }), /*#__PURE__*/ _jsxs("div", { className: "space-y-4", children: [ /*#__PURE__*/ _jsxs("div", { className: "grid grid-cols-3 gap-3", children: [ /*#__PURE__*/ _jsxs("div", { className: "col-span-2", children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.smtp.host') }), /*#__PURE__*/ _jsx("input", { value: smtpForm.host, onChange: (e)=>setSmtpForm((f)=>({ ...f, host: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400", placeholder: "smtp.gmail.com" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.smtp.port') }), /*#__PURE__*/ _jsx("input", { value: smtpForm.port, onChange: (e)=>setSmtpForm((f)=>({ ...f, port: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400", placeholder: "587" }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.smtp.encryption') }), /*#__PURE__*/ _jsxs("select", { value: smtpForm.encryption, onChange: (e)=>setSmtpForm((f)=>({ ...f, encryption: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400", children: [ /*#__PURE__*/ _jsx("option", { value: "none", children: t('admin.settings.smtp.enc.none') }), /*#__PURE__*/ _jsx("option", { value: "tls", children: "STARTTLS (587)" }), /*#__PURE__*/ _jsx("option", { value: "ssl", children: "SSL/TLS (465)" }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.smtp.username') }), /*#__PURE__*/ _jsx("input", { value: smtpForm.username, onChange: (e)=>setSmtpForm((f)=>({ ...f, username: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400", placeholder: "user@gmail.com", autoComplete: "off" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.smtp.password') }), /*#__PURE__*/ _jsx("input", { type: "password", value: smtpForm.password, onChange: (e)=>setSmtpForm((f)=>({ ...f, password: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400", autoComplete: "new-password", placeholder: "••••••••••••" }) ] }), /*#__PURE__*/ _jsxs("div", { className: "grid grid-cols-2 gap-3", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.smtp.from_name') }), /*#__PURE__*/ _jsx("input", { value: smtpForm.fromName, onChange: (e)=>setSmtpForm((f)=>({ ...f, fromName: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400", placeholder: "CanHelp" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.smtp.from_email') }), /*#__PURE__*/ _jsx("input", { type: "email", value: smtpForm.fromEmail, onChange: (e)=>setSmtpForm((f)=>({ ...f, fromEmail: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400", placeholder: "noreply@canhelp.com" }) ] }) ] }), /*#__PURE__*/ _jsx("button", { onClick: saveSmtpSettings, disabled: smtpSaving, 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: smtpSaving ? t('admin.settings.saving') : smtpSaved ? t('admin.settings.saved') : t('common.save') }), /*#__PURE__*/ _jsx("button", { onClick: async ()=>{ setTestEmailSending(true); setTestEmailResult(null); try { const res = await api.sendTestEmail(); setTestEmailResult("✓ Sent to ".concat(res.to)); } catch (e) { setTestEmailResult("✗ Error: ".concat(e.message)); } finally{ setTestEmailSending(false); setTimeout(()=>setTestEmailResult(null), 5000); } }, disabled: testEmailSending, 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: testEmailSending ? t('admin.settings.smtp.sending') : /*#__PURE__*/ _jsxs("span", { className: "flex items-center justify-center gap-2", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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" }) }), t('admin.settings.smtp.test') ] }) }), testEmailResult && /*#__PURE__*/ _jsx("p", { className: "text-sm text-center font-medium ".concat(testEmailResult.startsWith('✓') ? 'text-green-600' : 'text-red-500'), children: testEmailResult }) ] }) ] }), settingsTab === 'payment' && /*#__PURE__*/ _jsxs("div", { className: "space-y-6 max-w-lg", children: [ /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between mb-5", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3", children: [ /*#__PURE__*/ _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" }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-gray-800", children: "ePay — Piraeus Bank" }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400", children: "ГреческОй платёжМый шлюз" }) ] }) ] }), /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-2 cursor-pointer", children: [ /*#__PURE__*/ _jsx("span", { className: "text-sm text-gray-500", children: t('admin.settings.active') }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setEPayForm((f)=>({ ...f, enabled: !f.enabled })), className: "relative w-10 h-6 rounded-full p-0 transition-colors cursor-pointer ".concat(ePayForm.enabled ? 'bg-green-600' : 'bg-gray-300'), children: /*#__PURE__*/ _jsx("span", { className: "absolute left-0 top-1 w-4 h-4 bg-white rounded-full shadow transition-transform ".concat(ePayForm.enabled ? 'translate-x-5' : 'translate-x-1') }) }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "space-y-4", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.env.label') }), /*#__PURE__*/ _jsxs("select", { value: ePayForm.environment, onChange: (e)=>setEPayForm((f)=>({ ...f, environment: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm", children: [ /*#__PURE__*/ _jsx("option", { value: "test", children: t('admin.settings.env.test') }), /*#__PURE__*/ _jsx("option", { value: "production", children: t('admin.settings.env.prod') }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.merchant_id') }), /*#__PURE__*/ _jsx("input", { value: ePayForm.merchantId, onChange: (e)=>setEPayForm((f)=>({ ...f, merchantId: e.target.value })), placeholder: t('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" }) ] }), /*#__PURE__*/ _jsxs("div", { className: "grid grid-cols-2 gap-3", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: "API User" }), /*#__PURE__*/ _jsx("input", { value: ePayForm.apiUser, onChange: (e)=>setEPayForm((f)=>({ ...f, apiUser: e.target.value })), autoComplete: "off", className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: "API Password" }), /*#__PURE__*/ _jsx("input", { type: "password", value: ePayForm.apiPassword, onChange: (e)=>setEPayForm((f)=>({ ...f, apiPassword: e.target.value })), autoComplete: "new-password", className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: "Confirmation URL (webhook)" }), /*#__PURE__*/ _jsx("input", { value: ePayForm.confirmationUrl, onChange: (e)=>setEPayForm((f)=>({ ...f, confirmationUrl: e.target.value })), placeholder: "https://yoursite.com/api/payments/epay/confirm", className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: "Cancel URL" }), /*#__PURE__*/ _jsx("input", { value: ePayForm.cancelUrl, onChange: (e)=>setEPayForm((f)=>({ ...f, cancelUrl: e.target.value })), placeholder: "https://yoursite.com/payment/cancelled", className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 mt-5", children: [ /*#__PURE__*/ _jsx("button", { onClick: saveEPaySettings, disabled: ePaySaving, className: "px-5 py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700 disabled:opacity-50", children: ePaySaving ? t('admin.settings.saving') : t('common.save') }), ePaySaved && /*#__PURE__*/ _jsx("span", { className: "text-sm text-green-600", children: t('admin.settings.saved') }) ] }) ] }), /*#__PURE__*/ _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: [ /*#__PURE__*/ _jsxs("svg", { className: "w-4 h-4 shrink-0 mt-0.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ _jsx("circle", { cx: "12", cy: "12", r: "10" }), /*#__PURE__*/ _jsx("line", { x1: "12", y1: "8", x2: "12", y2: "12" }), /*#__PURE__*/ _jsx("line", { x1: "12", y1: "16", x2: "12.01", y2: "16" }) ] }), /*#__PURE__*/ _jsx("span", { children: t('admin.settings.payment.hint') }) ] }) ] }), settingsTab === 'notifications' && /*#__PURE__*/ _jsxs("div", { className: "space-y-3 max-w-2xl", children: [ /*#__PURE__*/ _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: [ /*#__PURE__*/ _jsxs("svg", { className: "w-4 h-4 shrink-0 mt-0.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ _jsx("circle", { cx: "12", cy: "12", r: "10" }), /*#__PURE__*/ _jsx("line", { x1: "12", y1: "8", x2: "12", y2: "12" }), /*#__PURE__*/ _jsx("line", { x1: "12", y1: "16", x2: "12.01", y2: "16" }) ] }), /*#__PURE__*/ _jsxs("p", { children: [ t('admin.notif.vars_hint'), ' ', TEMPLATE_HINT_VARS.map((name)=>{ const v = "{{".concat(name, "}}"); return /*#__PURE__*/ _jsx("code", { className: "mx-0.5 bg-green-100 text-gray-800 px-1.5 py-0.5 rounded text-xs font-mono", children: v }, v); }) ] }) ] }), [ { key: 'email_verification', label: t('admin.notif.email_verification'), icon: /*#__PURE__*/ _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: /*#__PURE__*/ _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: t('admin.notif.registration_success'), icon: /*#__PURE__*/ _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: /*#__PURE__*/ _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: t('admin.notif.password_reset'), icon: /*#__PURE__*/ _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: /*#__PURE__*/ _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: t('admin.notif.new_offer'), icon: /*#__PURE__*/ _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: /*#__PURE__*/ _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: t('admin.notif.new_task'), icon: /*#__PURE__*/ _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: /*#__PURE__*/ _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: t('admin.notif.offer_accepted'), icon: /*#__PURE__*/ _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: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" }) }) }, { key: 'new_message', label: t('admin.notif.new_message'), icon: /*#__PURE__*/ _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: /*#__PURE__*/ _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: t('admin.notif.offer_declined'), icon: /*#__PURE__*/ _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: /*#__PURE__*/ _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: t('admin.notif.offer_other_accepted'), icon: /*#__PURE__*/ _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: /*#__PURE__*/ _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: t('admin.notif.task_updated'), icon: /*#__PURE__*/ _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: /*#__PURE__*/ _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: t('admin.notif.deadline_reminder'), icon: /*#__PURE__*/ _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: /*#__PURE__*/ _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: t('admin.notif.task_archived'), icon: /*#__PURE__*/ _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: /*#__PURE__*/ _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: t('admin.notif.referral_reward'), icon: /*#__PURE__*/ _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: /*#__PURE__*/ _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" }) }) }, // ── Plan / subscription emails ───────────────────────────── { key: 'plan_activated', label: t('admin.email_template.plan_activated'), icon: /*#__PURE__*/ _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: /*#__PURE__*/ _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: t('admin.email_template.plan_upgraded'), icon: /*#__PURE__*/ _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: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 10l7-7m0 0l7 7m-7-7v18" }) }) }, { key: 'plan_downgrade_scheduled', label: t('admin.email_template.plan_downgrade_scheduled'), icon: /*#__PURE__*/ _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: /*#__PURE__*/ _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: t('admin.email_template.plan_downgrade_applied'), icon: /*#__PURE__*/ _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: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19 14l-7 7m0 0l-7-7m7 7V3" }) }) }, { key: 'plan_renewal_reminder', label: t('admin.email_template.plan_renewal_reminder'), icon: /*#__PURE__*/ _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: /*#__PURE__*/ _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: t('admin.email_template.plan_insufficient_funds'), icon: /*#__PURE__*/ _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: /*#__PURE__*/ _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((param)=>{ let { key, label, icon } = param; const localeKey = "".concat(key, "_").concat(templateLocale); var _notifTemplates_localeKey, _ref; const tmpl = (_ref = (_notifTemplates_localeKey = notifTemplates[localeKey]) !== null && _notifTemplates_localeKey !== void 0 ? _notifTemplates_localeKey : notifTemplates[key]) !== null && _ref !== void 0 ? _ref : { subject: '', body: '' }; const isEditing = editingTemplate === key; var _TEMPLATE_VARS_key; const templateVars = (_TEMPLATE_VARS_key = TEMPLATE_VARS[key]) !== null && _TEMPLATE_VARS_key !== void 0 ? _TEMPLATE_VARS_key : []; return /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 overflow-hidden", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 px-5 py-4 cursor-pointer hover:bg-gray-50 select-none", onClick: ()=>setEditingTemplate(isEditing ? null : key), children: [ /*#__PURE__*/ _jsx("span", { className: "text-xl shrink-0", children: icon }), /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ _jsx("div", { className: "font-medium text-gray-800 text-sm", children: label }), tmpl.subject ? /*#__PURE__*/ _jsxs("div", { className: "text-xs text-gray-400 mt-0.5 truncate", children: [ t('admin.notif.tmpl.subject_label'), ": ", tmpl.subject ] }) : /*#__PURE__*/ _jsx("div", { className: "text-xs text-gray-300 mt-0.5 italic", children: t('admin.notif.tmpl.not_set') }) ] }), /*#__PURE__*/ _jsx("span", { className: "text-gray-400 transition-transform ".concat(isEditing ? 'rotate-90' : ''), children: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("polyline", { points: "9 18 15 12 9 6" }) }) }) ] }), isEditing && /*#__PURE__*/ _jsxs("div", { className: "px-5 pb-5 border-t border-gray-100 pt-4 space-y-3", children: [ /*#__PURE__*/ _jsx("div", { className: "flex gap-1 pb-2", children: [ 'el', 'en', 'uk', 'ru' ].map((loc)=>/*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setTemplateLocale(loc), className: "px-3 py-1 text-xs font-medium rounded-md transition-colors ".concat(templateLocale === loc ? 'bg-green-600 text-white' : 'bg-gray-100 text-gray-600 hover:bg-gray-200'), children: loc === 'el' ? 'ΕλληΜικά' : loc === 'en' ? 'English' : loc === 'uk' ? 'УкраїМська' : 'РусскОй' }, loc)) }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.notif.tmpl.subject_label') }), /*#__PURE__*/ _jsx("input", { value: tmpl.subject, onChange: (e)=>setNotifTemplates((prev)=>{ var _prev_localeKey; return { ...prev, [localeKey]: { ...(_prev_localeKey = prev[localeKey]) !== null && _prev_localeKey !== void 0 ? _prev_localeKey : { subject: '', body: '' }, subject: e.target.value } }; }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.notif.tmpl.body_label') }), /*#__PURE__*/ _jsx("textarea", { rows: 7, value: tmpl.body, onChange: (e)=>setNotifTemplates((prev)=>{ var _prev_localeKey; return { ...prev, [localeKey]: { ...(_prev_localeKey = prev[localeKey]) !== null && _prev_localeKey !== void 0 ? _prev_localeKey : { subject: '', body: '' }, body: e.target.value } }; }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 font-mono resize-y", placeholder: "

УважаеЌый {{userName}},

..." }) ] }), templateVars.length > 0 && /*#__PURE__*/ _jsxs("div", { className: "rounded-lg border border-amber-200 bg-amber-50 px-3 py-2", children: [ /*#__PURE__*/ _jsx("div", { className: "text-xs font-medium text-amber-800 mb-1", children: t('admin.notif.vars_hint') }), /*#__PURE__*/ _jsx("div", { className: "flex flex-wrap gap-1.5", children: templateVars.map((name)=>{ const variable = "{{".concat(name, "}}"); return /*#__PURE__*/ _jsx("code", { className: "bg-amber-100 text-amber-900 px-1.5 py-0.5 rounded text-xs font-mono", children: variable }, variable); }) }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-2 flex-wrap", children: [ /*#__PURE__*/ _jsx("button", { onClick: ()=>saveTemplate(key), disabled: templateSaving || templateTranslating, className: "px-4 py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700 disabled:opacity-50", children: templateSaving ? t('admin.notif.tmpl.saving') : t('admin.notif.tmpl.save') }), /*#__PURE__*/ _jsxs("button", { onClick: ()=>autoTranslateTemplate(key), disabled: templateSaving || templateTranslating, 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: [ /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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" }) }), templateTranslating ? t('admin.notif.tmpl.translating') : t('admin.notif.tmpl.translate') ] }), /*#__PURE__*/ _jsx("button", { onClick: ()=>setEditingTemplate(null), className: "px-4 py-2 bg-gray-100 text-gray-700 rounded-lg text-sm font-medium hover:bg-gray-200", children: t('admin.notif.tmpl.close') }) ] }) ] }) ] }, key); }) ] }), settingsTab === 'referral' && /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6 max-w-lg space-y-5", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-gray-800", children: t('admin.settings.referral.title') }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-400 mt-1", children: t('admin.settings.referral.hint') }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "text-sm font-medium text-gray-700", children: t('admin.settings.referral.enabled_label') }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400", children: t('admin.settings.referral.enabled_hint') }) ] }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setReferralForm((f)=>({ ...f, enabled: !f.enabled })), className: "relative w-10 h-6 rounded-full p-0 transition-colors cursor-pointer ".concat(referralForm.enabled ? 'bg-green-600' : 'bg-gray-300'), children: /*#__PURE__*/ _jsx("span", { className: "absolute left-0 top-1 w-4 h-4 bg-white rounded-full shadow transition-transform ".concat(referralForm.enabled ? 'translate-x-5' : 'translate-x-1') }) }) ] }), /*#__PURE__*/ _jsxs("div", { className: "border border-gray-100 rounded-lg p-4 space-y-4", children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs font-semibold text-gray-500 uppercase tracking-wide", children: t('admin.settings.referral.shared_section') }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.referral.plan_label') }), /*#__PURE__*/ _jsxs("select", { value: referralForm.planId, onChange: (e)=>setReferralForm((f)=>({ ...f, planId: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400", children: [ /*#__PURE__*/ _jsx("option", { value: "", children: t('admin.settings.referral.no_plan') }), planRows.map((p)=>/*#__PURE__*/ _jsx("option", { value: p.id, children: p.name }, p.id)) ] }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-1", children: t('admin.settings.referral.plan_hint') }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.referral.days_label') }), /*#__PURE__*/ _jsx("input", { type: "number", min: "1", max: "365", value: referralForm.days, onChange: (e)=>setReferralForm((f)=>({ ...f, days: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-1", children: t('admin.settings.referral.days_hint') }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3", children: [ /*#__PURE__*/ _jsx("button", { onClick: saveReferralSettings, disabled: referralSaving, className: "px-5 py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700 disabled:opacity-50", children: referralSaving ? t('admin.settings.saving') : t('common.save') }), referralSaved && /*#__PURE__*/ _jsx("span", { className: "text-sm text-green-600", children: t('admin.settings.saved') }) ] }) ] }), settingsTab === 'socials' && /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6 max-w-lg space-y-5", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-gray-800 mb-1", children: t('admin.settings.socials.title') }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400", children: t('admin.settings.socials.hint') }) ] }), [ { key: 'telegram', label: 'Telegram', placeholder: 'https://t.me/yourname', icon: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", viewBox: "0 0 24 24", fill: "currentColor", children: /*#__PURE__*/ _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: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", viewBox: "0 0 24 24", fill: "currentColor", children: /*#__PURE__*/ _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: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", viewBox: "0 0 24 24", fill: "currentColor", children: /*#__PURE__*/ _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: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", viewBox: "0 0 24 24", fill: "currentColor", children: /*#__PURE__*/ _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: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", viewBox: "0 0 24 24", fill: "currentColor", children: /*#__PURE__*/ _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: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", viewBox: "0 0 24 24", fill: "currentColor", children: /*#__PURE__*/ _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: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", viewBox: "0 0 24 24", fill: "currentColor", children: /*#__PURE__*/ _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: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", viewBox: "0 0 24 24", fill: "currentColor", children: /*#__PURE__*/ _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((param)=>{ let { key, label, placeholder, icon } = param; return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("label", { className: "block text-sm font-medium text-gray-700 mb-1 flex items-center gap-2", children: [ /*#__PURE__*/ _jsx("span", { className: "".concat(socialForm[key] ? 'text-green-600' : 'text-gray-300'), children: icon }), label, !socialForm[key] && /*#__PURE__*/ _jsx("span", { className: "text-xs font-normal text-gray-400 ml-auto", children: "Ме запПлМеМП" }) ] }), /*#__PURE__*/ _jsx("input", { type: "url", value: socialForm[key], onChange: (e)=>setSocialForm((f)=>({ ...f, [key]: e.target.value })), placeholder: placeholder, className: "w-full border rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 ".concat(socialForm[key] ? 'border-green-300 bg-green-50/30' : 'border-gray-300') }) ] }, key); }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 pt-2", children: [ /*#__PURE__*/ _jsx("button", { onClick: saveSocialSettings, disabled: socialSaving, className: "px-5 py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700 disabled:opacity-50", children: socialSaving ? t('admin.settings.saving') : t('common.save') }), socialSaved && /*#__PURE__*/ _jsx("span", { className: "text-sm text-green-600", children: t('admin.settings.saved') }) ] }) ] }), settingsTab === 'seo' && /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6 max-w-lg space-y-6", children: [ /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-gray-800", children: t('admin.settings.seo.title') }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "text-sm font-medium text-gray-700", children: t('admin.settings.seo.maintenance_label') }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-0.5", children: t('admin.settings.seo.maintenance_hint') }) ] }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setSeoForm((f)=>({ ...f, maintenanceMode: !f.maintenanceMode })), className: "relative w-10 h-6 rounded-full p-0 transition-colors cursor-pointer flex-shrink-0 ".concat(seoForm.maintenanceMode ? 'bg-red-500' : 'bg-gray-300'), children: /*#__PURE__*/ _jsx("span", { className: "absolute left-0 top-1 w-4 h-4 bg-white rounded-full shadow transition-transform ".concat(seoForm.maintenanceMode ? 'translate-x-5' : 'translate-x-1') }) }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "text-sm font-medium text-gray-700", children: t('admin.settings.seo.indexing_label') }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-0.5", children: t('admin.settings.seo.indexing_hint') }) ] }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setSeoForm((f)=>({ ...f, indexingEnabled: !f.indexingEnabled })), className: "relative w-10 h-6 rounded-full p-0 transition-colors cursor-pointer flex-shrink-0 ".concat(seoForm.indexingEnabled ? 'bg-green-600' : 'bg-gray-300'), children: /*#__PURE__*/ _jsx("span", { className: "absolute left-0 top-1 w-4 h-4 bg-white rounded-full shadow transition-transform ".concat(seoForm.indexingEnabled ? 'translate-x-5' : 'translate-x-1') }) }) ] }), /*#__PURE__*/ _jsx("div", { className: "space-y-4", children: /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("p", { className: "text-sm font-medium text-gray-700 mb-2", children: [ t('admin.settings.seo.site_title_label'), " / ", t('admin.settings.seo.site_description_label') ] }), /*#__PURE__*/ _jsx("div", { className: "flex gap-1 mb-3", children: [ { code: 'el', flag: '🇬🇷', label: 'EL' }, { code: 'en', flag: '🇬🇧', label: 'EN' }, { code: 'ru', flag: '🇷🇺', label: 'RU' }, { code: 'uk', flag: '🇺🇊', label: 'UK' } ].map((param)=>{ let { code, flag, label } = param; return /*#__PURE__*/ _jsxs("button", { type: "button", onClick: ()=>setSeoLangTab(code), className: "flex items-center gap-1 px-3 py-1.5 rounded-lg text-sm font-medium transition-colors ".concat(seoLangTab === code ? 'bg-green-600 text-white' : 'bg-gray-100 text-gray-600 hover:bg-gray-200'), children: [ flag, " ", label ] }, code); }) }), /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-500 mb-1", children: t('admin.settings.seo.site_title_label') }), /*#__PURE__*/ _jsx("input", { value: seoForm["siteTitle".concat(seoLangTab.charAt(0).toUpperCase() + seoLangTab.slice(1))], onChange: (e)=>setSeoForm((f)=>({ ...f, ["siteTitle".concat(seoLangTab.charAt(0).toUpperCase() + seoLangTab.slice(1))]: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 mb-3", placeholder: seoLangTab === 'el' ? 'CanHelp — ΚάΞε άΜΞρωπος έχει κάτι Μα προσφέρει' : seoLangTab === 'en' ? 'CanHelp — Everyone has something valuable to offer' : seoLangTab === 'ru' ? 'CanHelp — КажЎый челПвек ЌПжет чеЌ-тП пПЌПчь' : 'CanHelp — КПжеМ Ќає МавОчку, яка ЌПже ЎПпПЌПгтО іМшПЌу' }), /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-500 mb-1", children: t('admin.settings.seo.site_description_label') }), /*#__PURE__*/ _jsx("textarea", { rows: 3, value: seoForm["siteDescription".concat(seoLangTab.charAt(0).toUpperCase() + seoLangTab.slice(1))], onChange: (e)=>setSeoForm((f)=>({ ...f, ["siteDescription".concat(seoLangTab.charAt(0).toUpperCase() + seoLangTab.slice(1))]: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 resize-none", placeholder: seoLangTab === 'el' ? 'Η ελληΜική πλατφόρΌα για online αΜάΞεση εργασιώΜ...' : seoLangTab === 'en' ? 'The Greek platform for online task delegation...' : seoLangTab === 'ru' ? 'Греческая платфПрЌа Ўля ПМлайМ-пПОска спецОалОстПв...' : 'Грецька платфПрЌа Ўля пПшуку фахівців ПМлайМ...' }) ] }) }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.seo.head_scripts_label') }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mb-2", children: t('admin.settings.seo.head_scripts_hint') }), /*#__PURE__*/ _jsx("textarea", { rows: 6, value: seoForm.headScripts, onChange: (e)=>setSeoForm((f)=>({ ...f, headScripts: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm font-mono focus:outline-none focus:ring-2 focus:ring-blue-400 resize-y", placeholder: '\n', spellCheck: false }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3", children: [ /*#__PURE__*/ _jsx("button", { onClick: saveSeoSettings, disabled: seoSaving, className: "px-5 py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700 disabled:opacity-50", children: seoSaving ? t('admin.settings.saving') : t('common.save') }), seoSaved && /*#__PURE__*/ _jsx("span", { className: "text-sm text-green-600", children: t('admin.settings.saved') }) ] }) ] }), settingsTab === 'telegram' && /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6 max-w-lg space-y-6", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-gray-800 mb-1", children: t('admin.settings.telegram.title') }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400", children: t('admin.settings.telegram.help') }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.telegram.bot_token') }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-2", children: [ /*#__PURE__*/ _jsx("input", { type: "text", value: telegramForm.botToken, onChange: (e)=>{ setTelegramForm((f)=>({ ...f, botToken: e.target.value })); setVerifyResultTelegramToken(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" }), /*#__PURE__*/ _jsx("button", { onClick: verifyTelegramToken, disabled: verifyingTelegramToken || !telegramForm.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: verifyingTelegramToken ? '...' : t('admin.settings.telegram.verify') }) ] }), verifyResultTelegramToken && /*#__PURE__*/ _jsx("p", { className: "text-xs mt-1 font-medium ".concat(verifyResultTelegramToken.ok ? 'text-green-600' : 'text-red-500'), children: verifyResultTelegramToken.ok ? "✓ ".concat(verifyResultTelegramToken.msg) : "✗ ".concat(verifyResultTelegramToken.msg) }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.telegram.admin_chat_id') }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-2", children: [ /*#__PURE__*/ _jsx("input", { type: "text", value: telegramForm.adminChatId, onChange: (e)=>setTelegramForm((f)=>({ ...f, adminChatId: e.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" }), /*#__PURE__*/ _jsx("button", { onClick: ()=>testTelegram('admin'), disabled: testingTelegramAdmin || !telegramForm.botToken || !telegramForm.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: testingTelegramAdmin ? '...' : t('admin.settings.telegram.test') }) ] }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-1", children: t('admin.settings.telegram.admin_chat_hint') }), testResultTelegramAdmin && /*#__PURE__*/ _jsx("p", { className: "text-xs mt-1 font-medium ".concat(testResultTelegramAdmin.ok ? 'text-green-600' : 'text-red-500'), children: testResultTelegramAdmin.ok ? "✓ ".concat(testResultTelegramAdmin.msg) : "✗ ".concat(testResultTelegramAdmin.msg) }) ] }), /*#__PURE__*/ _jsxs("div", { className: "space-y-3", children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700", children: t('admin.settings.telegram.channels_title') }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 -mt-2", children: t('admin.settings.telegram.channel_hint') }), [ { locale: 'el', flag: '🇬🇷', label: 'ΕλληΜικά', field: 'channelIdEl' }, { locale: 'en', flag: '🇬🇧', label: 'English', field: 'channelIdEn' }, { locale: 'ru', flag: '🇷🇺', label: 'РусскОй', field: 'channelIdRu' }, { locale: 'uk', flag: '🇺🇊', label: 'УкраїМська', field: 'channelIdUk' } ].map((param)=>{ let { locale: loc, flag, label, field } = param; return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-1.5 mb-1", children: [ /*#__PURE__*/ _jsx("span", { className: "text-base leading-none", children: flag }), /*#__PURE__*/ _jsx("span", { className: "text-xs font-medium text-gray-600", children: label }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-2", children: [ /*#__PURE__*/ _jsx("input", { type: "text", value: telegramForm[field], onChange: (e)=>setTelegramForm((f)=>({ ...f, [field]: e.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" }), /*#__PURE__*/ _jsx("button", { onClick: ()=>testTelegram(loc), disabled: testingLocale === loc || !telegramForm.botToken || !telegramForm[field], className: "px-3 py-2 border border-gray-300 rounded-lg text-sm hover:bg-gray-50 disabled:opacity-40 flex-shrink-0", children: testingLocale === loc ? '...' : t('admin.settings.telegram.test') }) ] }), testResultChannels[loc] && /*#__PURE__*/ _jsx("p", { className: "text-xs mt-1 font-medium ".concat(testResultChannels[loc].ok ? 'text-green-600' : 'text-red-500'), children: testResultChannels[loc].ok ? "✓ ".concat(testResultChannels[loc].msg) : "✗ ".concat(testResultChannels[loc].msg) }) ] }, loc); }) ] }), /*#__PURE__*/ _jsxs("div", { className: "space-y-4", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "text-sm font-medium text-gray-700", children: t('admin.settings.telegram.notify_registrations') }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-0.5", children: t('admin.settings.telegram.notify_registrations_hint') }) ] }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setTelegramForm((f)=>({ ...f, notifyRegistrations: !f.notifyRegistrations })), className: "relative w-10 h-6 rounded-full transition-colors cursor-pointer flex-shrink-0 p-0 border-0 outline-none ".concat(telegramForm.notifyRegistrations ? 'bg-green-600' : 'bg-gray-300'), children: /*#__PURE__*/ _jsx("span", { className: "absolute top-1 left-0 w-4 h-4 bg-white rounded-full shadow transition-transform ".concat(telegramForm.notifyRegistrations ? 'translate-x-5' : 'translate-x-1') }) }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "text-sm font-medium text-gray-700", children: t('admin.settings.telegram.post_new_tasks') }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-0.5", children: t('admin.settings.telegram.post_new_tasks_hint') }) ] }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setTelegramForm((f)=>({ ...f, postNewTasks: !f.postNewTasks })), className: "relative w-10 h-6 rounded-full transition-colors cursor-pointer flex-shrink-0 p-0 border-0 outline-none ".concat(telegramForm.postNewTasks ? 'bg-green-600' : 'bg-gray-300'), children: /*#__PURE__*/ _jsx("span", { className: "absolute top-1 left-0 w-4 h-4 bg-white rounded-full shadow transition-transform ".concat(telegramForm.postNewTasks ? 'translate-x-5' : 'translate-x-1') }) }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 pt-2", children: [ /*#__PURE__*/ _jsx("button", { onClick: saveTelegramSettings, disabled: telegramSaving, className: "px-5 py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700 disabled:opacity-50", children: telegramSaving ? t('admin.settings.saving') : t('common.save') }), telegramSaved && /*#__PURE__*/ _jsx("span", { className: "text-sm text-green-600", children: t('admin.settings.saved') }) ] }) ] }) ] }), tab === 'support' && /*#__PURE__*/ _jsxs("div", { className: "space-y-4", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex flex-wrap gap-3 mb-2", children: [ /*#__PURE__*/ _jsxs("form", { className: "flex gap-2", onSubmit: (e)=>{ e.preventDefault(); setSupportQ(supportQInput); setSupportPage(1); }, children: [ /*#__PURE__*/ _jsx("input", { value: supportQInput, onChange: (e)=>setSupportQInput(e.target.value), placeholder: t('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" }), /*#__PURE__*/ _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: t('admin.search', 'Search') }), supportQ && /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>{ setSupportQInput(''); setSupportQ(''); setSupportPage(1); }, className: "text-sm text-gray-500 hover:text-gray-700 px-2", children: "✕" }) ] }), /*#__PURE__*/ _jsxs("select", { value: supportStatus, onChange: (e)=>{ setSupportStatus(e.target.value); setSupportPage(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: [ /*#__PURE__*/ _jsx("option", { value: "", children: t('admin.support.all_statuses', 'All statuses') }), /*#__PURE__*/ _jsx("option", { value: "open", children: t('admin.support.status.open', 'Open') }), /*#__PURE__*/ _jsx("option", { value: "in_progress", children: t('admin.support.status.in_progress', 'In progress') }), /*#__PURE__*/ _jsx("option", { value: "resolved", children: t('admin.support.status.resolved', 'Resolved') }), /*#__PURE__*/ _jsx("option", { value: "closed", children: t('admin.support.status.closed', 'Closed') }) ] }), /*#__PURE__*/ _jsxs("select", { value: supportType, onChange: (e)=>{ setSupportType(e.target.value); setSupportPage(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: [ /*#__PURE__*/ _jsx("option", { value: "", children: t('admin.support.all_types', 'All types') }), /*#__PURE__*/ _jsxs("option", { value: "bug", children: [ "\uD83D\uDC1B ", t('support.type.bug', 'Bug') ] }), /*#__PURE__*/ _jsxs("option", { value: "suggestion", children: [ "\uD83D\uDCA1 ", t('support.type.suggestion', 'Suggestion') ] }), /*#__PURE__*/ _jsxs("option", { value: "other", children: [ "\uD83D\uDCAC ", t('support.type.other', 'Other') ] }) ] }), /*#__PURE__*/ _jsxs("span", { className: "ml-auto text-sm text-gray-400 self-center", children: [ supportTotal, " ", t('admin.pagination.total', 'total') ] }) ] }), loading ? /*#__PURE__*/ _jsx("div", { className: "text-center py-10 text-gray-400", children: t('common.loading') }) : supportTickets.length === 0 ? /*#__PURE__*/ _jsx("div", { className: "text-center py-10 text-gray-400", children: t('admin.support.none', 'No tickets') }) : supportTickets.map((ticket)=>{ const typeColors = { bug: 'bg-red-100 text-red-700', suggestion: 'bg-green-100 text-green-700', other: 'bg-gray-100 text-gray-600' }; const statusColors2 = { 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' }; const typeIcons = { bug: '🐛', suggestion: '💡', other: '💬' }; const isReplying = supportReplyId === ticket.id; var _typeColors_ticket_type, _statusColors2_ticket_status; return /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-5", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-start justify-between gap-4 mb-3", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 flex-wrap mb-1", children: [ /*#__PURE__*/ _jsxs("span", { className: "px-2 py-0.5 rounded-full text-xs font-medium ".concat((_typeColors_ticket_type = typeColors[ticket.type]) !== null && _typeColors_ticket_type !== void 0 ? _typeColors_ticket_type : 'bg-gray-100 text-gray-600'), children: [ typeIcons[ticket.type], " ", ticket.type ] }), /*#__PURE__*/ _jsx("span", { className: "px-2 py-0.5 rounded-full text-xs font-medium ".concat((_statusColors2_ticket_status = statusColors2[ticket.status]) !== null && _statusColors2_ticket_status !== void 0 ? _statusColors2_ticket_status : 'bg-gray-100 text-gray-500'), children: ticket.status }), /*#__PURE__*/ _jsxs("span", { className: "text-xs text-gray-400", children: [ "#", ticket.id.slice(0, 8) ] }) ] }), /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-gray-900 text-sm", children: ticket.subject }), ticket.userName && /*#__PURE__*/ _jsxs("p", { className: "text-xs text-gray-400 mt-0.5", children: [ ticket.userName, " \xb7 ", ticket.userEmail ] }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-0.5", children: new Date(ticket.createdAt).toLocaleString(dateLocale) }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-2 flex-shrink-0", children: [ ticket.status !== 'closed' && /*#__PURE__*/ _jsx("button", { onClick: ()=>{ setSupportReplyId(isReplying ? null : ticket.id); setSupportReplyText(ticket.adminReply || ''); }, className: "text-xs px-3 py-1.5 rounded-lg font-medium bg-green-50 text-green-700 hover:bg-green-100", children: isReplying ? t('admin.support.cancel', 'Cancel') : t('admin.support.reply', 'Reply') }), ticket.status === 'open' && /*#__PURE__*/ _jsx("button", { onClick: ()=>api.setSupportTicketStatus(ticket.id, 'closed').then(()=>setSupportTickets((prev)=>prev.map((t)=>t.id === ticket.id ? { ...t, status: 'closed' } : t))), className: "text-xs px-3 py-1.5 rounded-lg font-medium bg-gray-100 text-gray-600 hover:bg-gray-200", children: t('admin.support.close', 'Close') }) ] }) ] }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-700 whitespace-pre-wrap bg-gray-50 rounded-lg p-3 mb-3", children: ticket.body }), ticket.adminReply && !isReplying && /*#__PURE__*/ _jsxs("div", { className: "bg-green-50 border border-green-100 rounded-lg p-3 mb-2", children: [ /*#__PURE__*/ _jsxs("p", { className: "text-xs font-medium text-green-600 mb-1", children: [ t('admin.support.your_reply', 'Your reply'), ":" ] }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-800 whitespace-pre-wrap", children: ticket.adminReply }) ] }), isReplying && /*#__PURE__*/ _jsxs("div", { className: "space-y-2 mt-2", children: [ /*#__PURE__*/ _jsx("textarea", { rows: 3, value: supportReplyText, onChange: (e)=>setSupportReplyText(e.target.value), placeholder: t('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" }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-2 items-center", children: [ /*#__PURE__*/ _jsxs("select", { id: "status-".concat(ticket.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: [ /*#__PURE__*/ _jsx("option", { value: "open", children: t('admin.support.status.open', 'Open') }), /*#__PURE__*/ _jsx("option", { value: "in_progress", children: t('admin.support.status.in_progress', 'In progress') }), /*#__PURE__*/ _jsx("option", { value: "resolved", children: t('admin.support.status.resolved', 'Resolved') }), /*#__PURE__*/ _jsx("option", { value: "closed", children: t('admin.support.status.closed', 'Closed') }) ] }), /*#__PURE__*/ _jsx("button", { disabled: supportReplySaving || !supportReplyText.trim(), onClick: async ()=>{ const statusEl = document.getElementById("status-".concat(ticket.id)); setSupportReplySaving(true); try { const updated = await api.replyToSupportTicket(ticket.id, { adminReply: supportReplyText, status: statusEl === null || statusEl === void 0 ? void 0 : statusEl.value }); setSupportTickets((prev)=>prev.map((t)=>t.id === ticket.id ? { ...t, ...updated } : t)); setSupportReplyId(null); } catch (e) {} finally{ setSupportReplySaving(false); } }, 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: supportReplySaving ? '...' : t('admin.support.send_reply', 'Send') }) ] }) ] }) ] }, ticket.id); }), /*#__PURE__*/ _jsx(Pagination, { page: supportPage, total: supportTotal, limit: 30, onChange: setSupportPage, totalLabel: t('admin.pagination.total') }) ] }), tab === 'push' && /*#__PURE__*/ _jsxs("div", { className: "space-y-4", children: [ /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-5 space-y-4", children: [ /*#__PURE__*/ _jsx("h2", { className: "text-lg font-semibold text-gray-800", children: "Push-рассылка" }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-2", children: [ /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setPushMode('broadcast'), className: "px-3 py-1.5 text-sm rounded-lg border ".concat(pushMode === 'broadcast' ? 'bg-green-600 text-white border-green-600' : 'bg-white text-gray-700 border-gray-300'), children: "ВсеЌ пПльзПвателяЌ" }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setPushMode('user'), className: "px-3 py-1.5 text-sm rounded-lg border ".concat(pushMode === 'user' ? 'bg-green-600 text-white border-green-600' : 'bg-white text-gray-700 border-gray-300'), children: "КПМкретМПЌу пПльзПвателю" }) ] }), pushMode === 'user' && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "text-sm text-gray-600 block mb-1", children: "User ID" }), /*#__PURE__*/ _jsx("input", { value: pushTargetUserId, onChange: (e)=>setPushTargetUserId(e.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" }) ] }), pushMode === 'broadcast' && /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-2 text-sm text-gray-700", children: [ /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: pushOnlyActive, onChange: (e)=>setPushOnlyActive(e.target.checked) }), "ТПлькП актОвМыЌ пПльзПвателяЌ" ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "text-sm text-gray-600 block mb-1", children: "ЗагПлПвПк" }), /*#__PURE__*/ _jsx("input", { value: pushTitle, onChange: (e)=>setPushTitle(e.target.value), placeholder: "НапрОЌер: НПвые заЎачО ряЎПЌ с ваЌО", className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "text-sm text-gray-600 block mb-1", children: "Текст" }), /*#__PURE__*/ _jsx("textarea", { rows: 3, value: pushBody, onChange: (e)=>setPushBody(e.target.value), placeholder: "КПрПткОй текст увеЎПЌлеМОя", className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 resize-none" }) ] }), /*#__PURE__*/ _jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-3", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "text-sm text-gray-600 block mb-1", children: "ТОп" }), /*#__PURE__*/ _jsx("input", { value: pushType, onChange: (e)=>setPushType(e.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" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "text-sm text-gray-600 block mb-1", children: "Reference ID (ПпцОПМальМП)" }), /*#__PURE__*/ _jsx("input", { value: pushReferenceId, onChange: (e)=>setPushReferenceId(e.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" }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3", children: [ /*#__PURE__*/ _jsx("button", { type: "button", onClick: sendAdminPush, disabled: pushSending || !pushTitle.trim() || pushMode === 'user' && !pushTargetUserId.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: pushSending ? 'Отправка...' : 'ОтправОть Push' }), pushError && /*#__PURE__*/ _jsx("span", { className: "text-sm text-red-600", children: pushError }) ] }) ] }), pushResult && /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-5", children: [ /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-gray-800 mb-3", children: "Результат" }), 'usersTotal' in pushResult ? /*#__PURE__*/ _jsxs("div", { className: "grid grid-cols-2 md:grid-cols-5 gap-3 text-sm", children: [ /*#__PURE__*/ _jsxs("div", { className: "rounded-lg bg-gray-50 border border-gray-200 px-3 py-2", children: [ /*#__PURE__*/ _jsx("div", { className: "text-gray-500", children: "ППльзПвателей" }), /*#__PURE__*/ _jsx("div", { className: "text-gray-900 font-semibold", children: pushResult.usersTotal }) ] }), /*#__PURE__*/ _jsxs("div", { className: "rounded-lg bg-gray-50 border border-gray-200 px-3 py-2", children: [ /*#__PURE__*/ _jsx("div", { className: "text-gray-500", children: "ППлучОлО" }), /*#__PURE__*/ _jsx("div", { className: "text-gray-900 font-semibold", children: pushResult.usersWithSent }) ] }), /*#__PURE__*/ _jsxs("div", { className: "rounded-lg bg-gray-50 border border-gray-200 px-3 py-2", children: [ /*#__PURE__*/ _jsx("div", { className: "text-gray-500", children: "ОтправлеМП push" }), /*#__PURE__*/ _jsx("div", { className: "text-gray-900 font-semibold", children: pushResult.pushesSent }) ] }), /*#__PURE__*/ _jsxs("div", { className: "rounded-lg bg-gray-50 border border-gray-200 px-3 py-2", children: [ /*#__PURE__*/ _jsx("div", { className: "text-gray-500", children: "НевалОЎМые тПкеМы" }), /*#__PURE__*/ _jsx("div", { className: "text-gray-900 font-semibold", children: pushResult.invalidTokens }) ] }), /*#__PURE__*/ _jsxs("div", { className: "rounded-lg bg-gray-50 border border-gray-200 px-3 py-2", children: [ /*#__PURE__*/ _jsx("div", { className: "text-gray-500", children: "ОшОбкО пП userId" }), /*#__PURE__*/ _jsx("div", { className: "text-gray-900 font-semibold", children: pushResult.failedUsers.length }) ] }) ] }) : /*#__PURE__*/ _jsxs("div", { className: "grid grid-cols-2 md:grid-cols-4 gap-3 text-sm", children: [ /*#__PURE__*/ _jsxs("div", { className: "rounded-lg bg-gray-50 border border-gray-200 px-3 py-2", children: [ /*#__PURE__*/ _jsx("div", { className: "text-gray-500", children: "User ID" }), /*#__PURE__*/ _jsx("div", { className: "text-gray-900 font-mono text-xs break-all", children: pushResult.targetUserId }) ] }), /*#__PURE__*/ _jsxs("div", { className: "rounded-lg bg-gray-50 border border-gray-200 px-3 py-2", children: [ /*#__PURE__*/ _jsx("div", { className: "text-gray-500", children: "ТПкеМПв МайЎеМП" }), /*#__PURE__*/ _jsx("div", { className: "text-gray-900 font-semibold", children: (_pushResult_tokensFound = pushResult.tokensFound) !== null && _pushResult_tokensFound !== void 0 ? _pushResult_tokensFound : 0 }) ] }), /*#__PURE__*/ _jsxs("div", { className: "rounded-lg bg-gray-50 border border-gray-200 px-3 py-2", children: [ /*#__PURE__*/ _jsx("div", { className: "text-gray-500", children: "ОтправлеМП push" }), /*#__PURE__*/ _jsx("div", { className: "text-gray-900 font-semibold", children: pushResult.sent }) ] }), /*#__PURE__*/ _jsxs("div", { className: "rounded-lg bg-gray-50 border border-gray-200 px-3 py-2", children: [ /*#__PURE__*/ _jsx("div", { className: "text-gray-500", children: "НевалОЎМые тПкеМы" }), /*#__PURE__*/ _jsx("div", { className: "text-gray-900 font-semibold", children: pushResult.invalidTokens }) ] }) ] }), 'usersTotal' in pushResult ? /*#__PURE__*/ _jsx(_Fragment, { children: ((_pushResult_usersWithoutTokens = pushResult.usersWithoutTokens) !== null && _pushResult_usersWithoutTokens !== void 0 ? _pushResult_usersWithoutTokens : 0) > 0 || ((_pushResult_usersConfigBlocked = pushResult.usersConfigBlocked) !== null && _pushResult_usersConfigBlocked !== void 0 ? _pushResult_usersConfigBlocked : 0) > 0 || ((_pushResult_usersAuthFailed = pushResult.usersAuthFailed) !== null && _pushResult_usersAuthFailed !== void 0 ? _pushResult_usersAuthFailed : 0) > 0 || ((_pushResult_usersAllFailed = pushResult.usersAllFailed) !== null && _pushResult_usersAllFailed !== void 0 ? _pushResult_usersAllFailed : 0) > 0 ? /*#__PURE__*/ _jsxs("div", { className: "mt-3 rounded-lg border border-amber-200 bg-amber-50 px-3 py-2 text-xs text-amber-900", children: [ /*#__PURE__*/ _jsxs("div", { children: [ "ДОагМПстОка: без тПкеМПв — ", (_pushResult_usersWithoutTokens1 = pushResult.usersWithoutTokens) !== null && _pushResult_usersWithoutTokens1 !== void 0 ? _pushResult_usersWithoutTokens1 : 0, ", FCM Ме МастрПеМ — ", (_pushResult_usersConfigBlocked1 = pushResult.usersConfigBlocked) !== null && _pushResult_usersConfigBlocked1 !== void 0 ? _pushResult_usersConfigBlocked1 : 0, ", ПшОбка auth FCM — ", (_pushResult_usersAuthFailed1 = pushResult.usersAuthFailed) !== null && _pushResult_usersAuthFailed1 !== void 0 ? _pushResult_usersAuthFailed1 : 0, ", FCM send failed — ", (_pushResult_usersAllFailed1 = pushResult.usersAllFailed) !== null && _pushResult_usersAllFailed1 !== void 0 ? _pushResult_usersAllFailed1 : 0 ] }), pushResult.failedReasonStats && Object.keys(pushResult.failedReasonStats).length > 0 ? /*#__PURE__*/ _jsxs("div", { className: "mt-1", children: [ "КПЎы ПшОбПк FCM: ", Object.entries(pushResult.failedReasonStats).map((param)=>{ let [key, count] = param; return "".concat(key, ": ").concat(count); }).join(', ') ] }) : null, pushResult.failedReasonSample ? /*#__PURE__*/ _jsxs("div", { className: "mt-1", children: [ "ПрОЌер ПшОбкО: ", describeFcmFailure(pushResult.failedReasonStats ? Object.keys(pushResult.failedReasonStats)[0] : null, pushResult.failedReasonSample) ] }) : null ] }) : null }) : /*#__PURE__*/ _jsx(_Fragment, { children: pushResult.reason ? /*#__PURE__*/ _jsxs("div", { className: "mt-3 rounded-lg border border-amber-200 bg-amber-50 px-3 py-2 text-xs text-amber-900", children: [ /*#__PURE__*/ _jsxs("div", { children: [ "ДОагМПстОка: ", pushResult.reason === 'no_tokens' ? 'у пПльзПвателя Мет push-тПкеМПв' : pushResult.reason === 'fcm_not_configured' ? 'FCM Ме МастрПеМ Ма API (переЌеММые FCM_*)' : pushResult.reason === 'fcm_auth_failed' ? 'ПшОбка автПрОзацОО FCM (service account)' : describeFcmFailure(pushResult.failureKey, pushResult.failureMessage) ] }), pushResult.failureKey ? /*#__PURE__*/ _jsxs("div", { className: "mt-1", children: [ "КПЎ FCM: ", pushResult.failureKey ] }) : null, pushResult.failureMessage ? /*#__PURE__*/ _jsxs("div", { className: "mt-1", children: [ "СППбщеМОе FCM: ", pushResult.failureMessage ] }) : null ] }) : null }) ] }) ] }), tab === 'backup' && /*#__PURE__*/ _jsxs("div", { className: "space-y-6", children: [ /*#__PURE__*/ _jsxs("h2", { className: "text-lg font-semibold text-gray-800 flex items-center gap-2", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5 text-green-600", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ _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" }) }), t('admin.backup.title', 'Backup') ] }), backupMsg && /*#__PURE__*/ _jsxs("div", { className: "".concat(backupMsgError ? '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: [ /*#__PURE__*/ _jsx("span", { children: backupMsg }), /*#__PURE__*/ _jsx("button", { onClick: ()=>setBackupMsg(null), className: "".concat(backupMsgError ? 'text-red-500 hover:text-red-700' : 'text-green-500 hover:text-green-700', " ml-4"), children: "\xd7" }) ] }), /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-5 flex items-center justify-between", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "font-medium text-gray-800 text-sm", children: t('admin.backup.autoBackup', 'Auto Backup') }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-500 mt-0.5", children: t('admin.backup.autoBackupDesc', 'Create a backup every day automatically') }) ] }), /*#__PURE__*/ _jsx("button", { disabled: backupAutoSaving, onClick: async ()=>{ setBackupAutoSaving(true); try { await request('/admin/backup/settings', { method: 'PUT', body: JSON.stringify({ autoEnabled: !backupAutoEnabled }) }); setBackupAutoEnabled((v)=>!v); } catch (e) {} setBackupAutoSaving(false); }, className: "relative w-11 h-6 rounded-full transition-colors ".concat(backupAutoEnabled ? 'bg-green-600' : 'bg-gray-300', " ").concat(backupAutoSaving ? 'opacity-50' : ''), children: /*#__PURE__*/ _jsx("span", { className: "absolute top-0.5 left-0.5 w-5 h-5 rounded-full bg-white shadow transition-transform ".concat(backupAutoEnabled ? 'translate-x-5' : 'translate-x-0') }) }) ] }), /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-5", children: [ /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-gray-800 text-sm mb-4", children: t('admin.backup.title', 'Database Backup') }), /*#__PURE__*/ _jsxs("div", { className: "flex flex-wrap gap-3", children: [ /*#__PURE__*/ _jsxs("button", { disabled: backupExporting, onClick: async ()=>{ setBackupExporting(true); try { const BASE = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; const res = await fetch("".concat(BASE, "/api/admin/backup/export"), { credentials: 'include' }); if (!res.ok) throw new Error('Export failed'); const blob = await res.blob(); const url = URL.createObjectURL(blob); const a = document.createElement('a'); a.href = url; a.download = "backup_".concat(new Date().toISOString().slice(0, 10), ".sql.gz"); a.click(); URL.revokeObjectURL(url); setBackupSuccess(t('admin.backup.exportSuccess', 'Export successful')); } catch (e) { setBackupError(e.message || 'Error'); } setBackupExporting(false); }, 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: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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" }) }), backupExporting ? t('admin.backup.exporting', 'Exporting...') : t('admin.backup.exportAll', 'Export Full DB') ] }), /*#__PURE__*/ _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 ".concat(backupImporting === 'full' ? 'opacity-50 pointer-events-none' : ''), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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" }) }), backupImporting === 'full' ? t('admin.backup.importing', 'Importing...') : t('admin.backup.importAll', 'Import Full DB'), /*#__PURE__*/ _jsx("input", { type: "file", accept: ".sql.gz,.gz", className: "hidden", onChange: async (e)=>{ var _e_target_files; const file = (_e_target_files = e.target.files) === null || _e_target_files === void 0 ? void 0 : _e_target_files[0]; if (!file) return; if (!window.confirm(t('admin.backup.restoreConfirm', 'Restore from this backup?'))) return; setBackupImporting('full'); try { const fd = new FormData(); fd.append('file', file); const BASE = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; const res = await fetch("".concat(BASE, "/api/admin/backup/import"), { method: 'POST', credentials: 'include', body: fd }); if (!res.ok) throw new Error('Import failed'); setBackupSuccess(t('admin.backup.importSuccess', 'Import successful')); } catch (err) { setBackupError(err.message || 'Error'); } setBackupImporting(null); e.target.value = ''; } }) ] }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-5", children: [ /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-gray-800 text-sm mb-4", children: t('admin.backup.storedBackups', 'Stored Backups') }), backupStoredFiles.length === 0 ? /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-400", children: t('admin.backup.noStoredBackups', 'No stored backups') }) : /*#__PURE__*/ _jsx("div", { className: "space-y-2", children: backupStoredFiles.map((f)=>/*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between py-2 px-3 bg-gray-50 rounded-lg border border-gray-100", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "text-sm font-medium text-gray-800", children: f.name === 'backup_today' ? t('admin.backup.today', 'Today') : t('admin.backup.yesterday', 'Yesterday') }), /*#__PURE__*/ _jsxs("p", { className: "text-xs text-gray-400", children: [ t('admin.backup.size', 'Size'), ": ", (f.size / 1024).toFixed(1), " KB \xb7 ", t('admin.backup.date', 'Date'), ": ", new Date(f.date).toLocaleString() ] }) ] }), /*#__PURE__*/ _jsx("button", { disabled: backupRestoring === f.name, onClick: async ()=>{ if (!window.confirm(t('admin.backup.restoreConfirm', 'Restore from this backup?'))) return; setBackupRestoring(f.name); try { await request('/admin/backup/restore', { method: 'POST', body: JSON.stringify({ name: f.name }) }); setBackupSuccess(t('admin.backup.restoreSuccess', 'Restore successful')); } catch (err) { setBackupError(err.message || 'Error'); } setBackupRestoring(null); }, className: "text-sm text-green-600 hover:text-gray-800 font-medium disabled:opacity-50", children: backupRestoring === f.name ? t('admin.backup.restoring', 'Restoring...') : t('admin.backup.restore', 'Restore') }) ] }, f.name)) }) ] }), /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-5", children: [ /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-gray-800 text-sm mb-4", children: t('admin.backup.tables', 'Tables') }), backupTablesLoading ? /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 text-sm text-gray-400", children: [ /*#__PURE__*/ _jsxs("svg", { className: "w-4 h-4 animate-spin", fill: "none", viewBox: "0 0 24 24", children: [ /*#__PURE__*/ _jsx("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }), /*#__PURE__*/ _jsx("path", { className: "opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8v8z" }) ] }), t('common.loading', 'Loading...') ] }) : backupTables.length === 0 ? /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-400", children: t('admin.noData', 'No data') }) : /*#__PURE__*/ _jsx("div", { className: "overflow-x-auto", children: /*#__PURE__*/ _jsx("table", { className: "w-full text-sm", children: /*#__PURE__*/ _jsx("tbody", { className: "divide-y divide-gray-100", children: backupTables.map((tbl)=>/*#__PURE__*/ _jsxs("tr", { className: "hover:bg-gray-50", children: [ /*#__PURE__*/ _jsx("td", { className: "py-2 pr-4 font-mono text-gray-700", children: tbl }), /*#__PURE__*/ _jsx("td", { className: "py-2 text-right", children: /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-end gap-2", children: [ /*#__PURE__*/ _jsx("button", { onClick: async ()=>{ try { const BASE = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; const res = await fetch("".concat(BASE, "/api/admin/backup/export/").concat(tbl), { credentials: 'include' }); if (!res.ok) throw new Error('Export failed'); const blob = await res.blob(); const url = URL.createObjectURL(blob); const a = document.createElement('a'); a.href = url; a.download = "".concat(tbl, "_").concat(new Date().toISOString().slice(0, 10), ".sql.gz"); a.click(); URL.revokeObjectURL(url); } catch (err) { setBackupError(err.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: t('admin.backup.exportTable', 'Export') }), /*#__PURE__*/ _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: [ backupImporting === tbl ? t('admin.backup.importing', 'Importing...') : t('admin.backup.importTable', 'Import'), /*#__PURE__*/ _jsx("input", { type: "file", accept: ".sql.gz,.gz", className: "hidden", onChange: async (e)=>{ var _e_target_files; const file = (_e_target_files = e.target.files) === null || _e_target_files === void 0 ? void 0 : _e_target_files[0]; if (!file) return; if (!window.confirm(t('admin.backup.restoreConfirm', 'Restore from this backup?'))) return; setBackupImporting(tbl); try { const fd = new FormData(); fd.append('file', file); const BASE = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; const res = await fetch("".concat(BASE, "/api/admin/backup/import/").concat(tbl), { method: 'POST', credentials: 'include', body: fd }); if (!res.ok) { const errData = await res.json().catch(()=>({ error: 'Import failed' })); throw new Error(errData.error || 'Import failed'); } setBackupSuccess(t('admin.backup.importSuccess', 'Import successful')); } catch (err) { setBackupError(err.message || 'Error'); } setBackupImporting(null); e.target.value = ''; } }) ] }) ] }) }) ] }, tbl)) }) }) }) ] }) ] }), tab === 'translations' && /*#__PURE__*/ _jsxs("div", { className: "space-y-6", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("h2", { className: "text-base font-semibold text-gray-900", children: "ПеревПЎы" }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-500 mt-0.5", children: "АвтПЌатОческОй перевПЎ прПпущеММых зМачеМОй пП таблОцаЌ" }) ] }), /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-4 flex flex-wrap gap-4 items-end", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: "ИстПчМОк" }), /*#__PURE__*/ _jsxs("select", { value: transFromLang, onChange: (e)=>setTransFromLang(e.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: [ /*#__PURE__*/ _jsx("option", { value: "el", children: "\uD83C\uDDEC\uD83C\uDDF7 Greek" }), /*#__PURE__*/ _jsx("option", { value: "en", children: "\uD83C\uDDEC\uD83C\uDDE7 English" }), /*#__PURE__*/ _jsx("option", { value: "ru", children: "\uD83C\uDDF7\uD83C\uDDFA Russian" }), /*#__PURE__*/ _jsx("option", { value: "uk", children: "\uD83C\uDDFA\uD83C\uDDE6 Ukrainian" }) ] }) ] }), /*#__PURE__*/ _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: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M13 7l5 5-5 5M6 12h12" }) }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: "ПеревестО Ма" }), /*#__PURE__*/ _jsxs("select", { value: transLang, onChange: (e)=>setTransLang(e.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: [ /*#__PURE__*/ _jsx("option", { value: "el", children: "\uD83C\uDDEC\uD83C\uDDF7 Greek" }), /*#__PURE__*/ _jsx("option", { value: "en", children: "\uD83C\uDDEC\uD83C\uDDE7 English" }), /*#__PURE__*/ _jsx("option", { value: "ru", children: "\uD83C\uDDF7\uD83C\uDDFA Russian" }), /*#__PURE__*/ _jsx("option", { value: "uk", children: "\uD83C\uDDFA\uD83C\uDDE6 Ukrainian" }) ] }) ] }), /*#__PURE__*/ _jsx("div", { className: "ml-auto self-end", children: /*#__PURE__*/ _jsxs("span", { className: "text-sm font-semibold text-gray-700 flex items-center gap-2", children: [ { el: '🇬🇷', en: '🇬🇧', ru: '🇷🇺', uk: '🇺🇊' }[transFromLang], " ", transFromLang.toUpperCase(), /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-gray-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M13 7l5 5-5 5M6 12h12" }) }), { el: '🇬🇷', en: '🇬🇧', ru: '🇷🇺', uk: '🇺🇊' }[transLang], " ", transLang.toUpperCase() ] }) }) ] }), transMsg && /*#__PURE__*/ _jsx("div", { className: "text-sm px-4 py-2 rounded-lg ".concat(transMsg.error ? 'bg-red-50 text-red-700' : 'bg-green-50 text-green-700'), children: transMsg.text }), transStatsLoading ? /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 text-sm text-gray-400 py-6", children: [ /*#__PURE__*/ _jsxs("svg", { className: "w-4 h-4 animate-spin", fill: "none", viewBox: "0 0 24 24", children: [ /*#__PURE__*/ _jsx("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }), /*#__PURE__*/ _jsx("path", { className: "opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8v8z" }) ] }), "Загрузка " ] }) : /*#__PURE__*/ _jsx("div", { className: "grid gap-4 sm:grid-cols-2 lg:grid-cols-3", children: (transStats !== null && transStats !== void 0 ? transStats : []).map((tbl)=>{ const isTasks = tbl.name === 'tasks'; // For tasks: total missing across all langs (tasks may miss multiple langs each) const totalMissingAllLangs = Object.values(tbl.missing).reduce((a, b)=>a + b, 0); var _tbl_missing_transLang; const missingCount = isTasks ? totalMissingAllLangs : (_tbl_missing_transLang = tbl.missing[transLang]) !== null && _tbl_missing_transLang !== void 0 ? _tbl_missing_transLang : 0; const isTranslating = !!transTableTranslating[tbl.name]; const anyTranslating = Object.values(transTableTranslating).some(Boolean); return /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-5 flex flex-col", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-start justify-between", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "font-semibold text-gray-900 text-sm", children: tbl.label }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-0.5", children: tbl.name }) ] }), /*#__PURE__*/ _jsx("span", { className: "text-xs font-semibold px-2 py-0.5 rounded-full ".concat(missingCount > 0 ? 'bg-red-100 text-red-700' : 'bg-green-100 text-green-700'), children: missingCount > 0 ? "".concat(missingCount, " missing") : 'Complete' }) ] }), /*#__PURE__*/ _jsxs("p", { className: "text-xs text-gray-500 mt-3", children: [ "ВсегП: ", tbl.total, isTasks && ' · с языка ПрОгОМала Ма все ПстальМые' ] }), /*#__PURE__*/ _jsx("div", { className: "mt-2 flex flex-wrap gap-1", children: [ 'el', 'en', 'ru', 'uk' ].map((lang)=>{ var _tbl_missing_lang; const cnt = (_tbl_missing_lang = tbl.missing[lang]) !== null && _tbl_missing_lang !== void 0 ? _tbl_missing_lang : 0; const isClickable = isTasks && cnt > 0; return /*#__PURE__*/ _jsxs("button", { type: "button", disabled: !isClickable, onClick: isClickable ? async ()=>{ setTransPreview({ lang, loading: true, rows: [] }); try { const d = await api.getTasksTranslationPreview(lang, 50); setTransPreview({ lang, loading: false, rows: d.rows }); } catch (e) { setTransPreview({ lang, loading: false, rows: [] }); } } : undefined, className: "text-xs px-2 py-0.5 rounded-full border transition ".concat(cnt > 0 ? 'border-red-200 bg-red-50 text-red-600' + (isClickable ? ' cursor-pointer hover:bg-red-100' : '') : 'border-green-200 bg-green-50 text-green-600 cursor-default'), children: [ lang, ": ", cnt > 0 ? "-".concat(cnt) : '✓' ] }, lang); }) }), /*#__PURE__*/ _jsx("div", { className: "mt-4 mt-auto pt-4", children: missingCount === 0 ? /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-1.5 text-xs text-emerald-600", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" }) }), "Все перевПЎы запПлМеМы" ] }) : /*#__PURE__*/ _jsx("button", { disabled: anyTranslating, onClick: async ()=>{ if (!isTasks && transFromLang === transLang) { setTransMsg({ text: 'ИсхПЎМый О целевПй язык сПвпаЎают', error: true }); return; } setTransTableTranslating((prev)=>({ ...prev, [tbl.name]: true })); setTransMsg(null); try { const res = isTasks ? await api.autoTranslateTasks(500) : tbl.name === 'email_templates' ? await api.autoTranslateEmailTemplates(transLang, transFromLang) : await api.autoTranslate(tbl.name, transLang, transFromLang, 500); setTransMsg({ text: "".concat(tbl.label, ": translated ").concat(res.translated, " of ").concat(res.total) + (res.failed > 0 ? " \xb7 errors: ".concat(res.failed) : ''), error: res.failed > 0 && res.translated === 0 }); api.getTranslationsStats().then((d)=>setTransStats(d.tables)).catch(()=>{}); } catch (err) { const msg = (err === null || err === void 0 ? void 0 : err.response) ? await err.response.text().catch(()=>err.message) : err.message || 'Error'; setTransMsg({ text: "Error: ".concat(msg), error: true }); } finally{ setTransTableTranslating((prev)=>{ const n = { ...prev }; delete n[tbl.name]; return n; }); } }, 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: isTranslating ? /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs("svg", { className: "w-3.5 h-3.5 animate-spin flex-shrink-0", fill: "none", viewBox: "0 0 24 24", children: [ /*#__PURE__*/ _jsx("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }), /*#__PURE__*/ _jsx("path", { className: "opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8v8z" }) ] }), "Translating..." ] }) : isTasks ? /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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 ", missingCount ] }) : /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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 ", missingCount, " \xb7 ", { el: '🇬🇷', en: '🇬🇧', ru: '🇷🇺', uk: '🇺🇊' }[transFromLang], " ", transFromLang.toUpperCase(), /*#__PURE__*/ _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: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M13 7l5 5-5 5M6 12h12" }) }), { el: '🇬🇷', en: '🇬🇧', ru: '🇷🇺', uk: '🇺🇊' }[transLang], " ", transLang.toUpperCase() ] }) }) }) ] }, tbl.name); }) }) ] }), tab === 'dbcheck' && /*#__PURE__*/ _jsx(DbCheckTab, {}), tab === 'referrals' && /*#__PURE__*/ _jsxs("div", { className: "space-y-6", children: [ /*#__PURE__*/ _jsx("div", { className: "grid grid-cols-3 gap-4", children: [ { label: 'РеферерПв', value: (_referralsData_totalReferrers = referralsData === null || referralsData === void 0 ? void 0 : referralsData.totalReferrers) !== null && _referralsData_totalReferrers !== void 0 ? _referralsData_totalReferrers : '—', color: 'text-green-600' }, { label: 'ПрОглашеМОй', value: (_referralsData_totalReferrals = referralsData === null || referralsData === void 0 ? void 0 : referralsData.totalReferrals) !== null && _referralsData_totalReferrals !== void 0 ? _referralsData_totalReferrals : '—', color: 'text-purple-600' }, { label: 'АктОвМых МаграЎ', value: (_referralsData_activeRewards = referralsData === null || referralsData === void 0 ? void 0 : referralsData.activeRewards) !== null && _referralsData_activeRewards !== void 0 ? _referralsData_activeRewards : '—', color: 'text-green-600' } ].map((param)=>{ let { label, value, color } = param; return /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-2xl border border-gray-200 p-5 text-center", children: [ /*#__PURE__*/ _jsx("div", { className: "text-3xl font-bold ".concat(color), children: value }), /*#__PURE__*/ _jsx("div", { className: "text-xs text-gray-500 mt-1", children: label }) ] }, label); }) }), /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-2xl border border-gray-200 overflow-hidden", children: [ /*#__PURE__*/ _jsxs("div", { className: "px-5 py-4 border-b border-gray-100 flex items-center justify-between", children: [ /*#__PURE__*/ _jsx("h2", { className: "font-semibold text-gray-800", children: "ДеревП рефералПв" }), /*#__PURE__*/ _jsxs("button", { onClick: ()=>{ setReferralsLoading(true); api.getAdminReferrals().then(setReferralsData).catch(()=>{}).finally(()=>setReferralsLoading(false)); }, className: "text-xs text-green-600 hover:underline flex items-center gap-1", children: [ referralsLoading && /*#__PURE__*/ _jsxs("svg", { className: "w-3 h-3 animate-spin", fill: "none", viewBox: "0 0 24 24", children: [ /*#__PURE__*/ _jsx("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }), /*#__PURE__*/ _jsx("path", { className: "opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8v8z" }) ] }), "ОбМПвОть" ] }) ] }), referralsLoading && !referralsData ? /*#__PURE__*/ _jsx("div", { className: "flex justify-center py-16", children: /*#__PURE__*/ _jsxs("svg", { className: "w-6 h-6 animate-spin text-purple-600", fill: "none", viewBox: "0 0 24 24", children: [ /*#__PURE__*/ _jsx("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }), /*#__PURE__*/ _jsx("path", { className: "opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8v8z" }) ] }) }) : !referralsData || referralsData.tree.length === 0 ? /*#__PURE__*/ _jsx("div", { className: "py-16 text-center text-sm text-gray-400", children: "Нет ЎаММых П рефералах" }) : /*#__PURE__*/ _jsx("div", { className: "divide-y divide-gray-100", children: referralsData.tree.map((node)=>{ var _node_referrer, _node_referrer1; var _node_referrer_id; const rid = (_node_referrer_id = (_node_referrer = node.referrer) === null || _node_referrer === void 0 ? void 0 : _node_referrer.id) !== null && _node_referrer_id !== void 0 ? _node_referrer_id : 'unknown'; const isExpanded = referralsExpanded.has(rid); var _node_referrer_firstName, _node_referrer_lastName; const referrerName = node.referrer ? "".concat((_node_referrer_firstName = node.referrer.firstName) !== null && _node_referrer_firstName !== void 0 ? _node_referrer_firstName : '', " ").concat((_node_referrer_lastName = node.referrer.lastName) !== null && _node_referrer_lastName !== void 0 ? _node_referrer_lastName : '').trim() || node.referrer.email : '(уЎалёМ)'; return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("button", { className: "w-full flex items-center gap-3 px-5 py-3.5 hover:bg-gray-50 text-left transition-colors", onClick: ()=>setReferralsExpanded((prev)=>{ const next = new Set(prev); next.has(rid) ? next.delete(rid) : next.add(rid); return next; }), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-gray-400 flex-shrink-0 transition-transform ".concat(isExpanded ? 'rotate-90' : ''), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 5l7 7-7 7" }) }), /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ _jsx("span", { className: "font-medium text-sm text-gray-900", children: referrerName }), node.referrer && /*#__PURE__*/ _jsx("span", { className: "ml-2 text-xs text-gray-400", children: node.referrer.email }) ] }), ((_node_referrer1 = node.referrer) === null || _node_referrer1 === void 0 ? void 0 : _node_referrer1.referralCode) && /*#__PURE__*/ _jsx("code", { className: "text-xs bg-gray-100 text-gray-600 px-2 py-0.5 rounded font-mono", children: node.referrer.referralCode }), /*#__PURE__*/ _jsxs("span", { className: "ml-3 text-xs font-semibold text-purple-700 bg-purple-50 px-2 py-0.5 rounded-full", children: [ node.referees.length, " реф." ] }) ] }), isExpanded && /*#__PURE__*/ _jsx("div", { className: "bg-gray-50 border-t border-gray-100", children: /*#__PURE__*/ _jsxs("table", { className: "w-full text-xs", children: [ /*#__PURE__*/ _jsx("thead", { children: /*#__PURE__*/ _jsxs("tr", { className: "border-b border-gray-200", children: [ /*#__PURE__*/ _jsx("th", { className: "text-left px-10 py-2 font-semibold text-gray-500", children: "ПрОглашёММый" }), /*#__PURE__*/ _jsx("th", { className: "text-left px-3 py-2 font-semibold text-gray-500", children: "Email" }), /*#__PURE__*/ _jsx("th", { className: "text-center px-3 py-2 font-semibold text-gray-500", children: "+ЎМей" }), /*#__PURE__*/ _jsx("th", { className: "text-center px-3 py-2 font-semibold text-gray-500", children: "Истекает" }), /*#__PURE__*/ _jsx("th", { className: "text-center px-3 py-2 font-semibold text-gray-500", children: "Дата" }) ] }) }), /*#__PURE__*/ _jsx("tbody", { children: node.referees.map((referee)=>{ var _referee_firstName, _referee_lastName; const refName = "".concat((_referee_firstName = referee.firstName) !== null && _referee_firstName !== void 0 ? _referee_firstName : '', " ").concat((_referee_lastName = referee.lastName) !== null && _referee_lastName !== void 0 ? _referee_lastName : '').trim() || referee.email; const expiresAt = new Date(referee.expiresAt); const createdAt = new Date(referee.createdAt); const isActive = expiresAt > new Date(); return /*#__PURE__*/ _jsxs("tr", { className: "border-b border-gray-100 last:border-0 hover:bg-white transition-colors", children: [ /*#__PURE__*/ _jsx("td", { className: "px-10 py-2.5 font-medium text-gray-800", children: refName }), /*#__PURE__*/ _jsx("td", { className: "px-3 py-2.5 text-gray-500", children: referee.email }), /*#__PURE__*/ _jsx("td", { className: "px-3 py-2.5 text-center", children: /*#__PURE__*/ _jsxs("span", { className: "font-semibold text-green-700", children: [ "+", referee.daysAdded ] }) }), /*#__PURE__*/ _jsx("td", { className: "px-3 py-2.5 text-center", children: /*#__PURE__*/ _jsx("span", { className: "px-1.5 py-0.5 rounded text-xs font-medium ".concat(isActive ? 'bg-green-100 text-green-700' : 'bg-gray-100 text-gray-500'), children: expiresAt.toLocaleDateString('ru-RU', { day: '2-digit', month: '2-digit', year: '2-digit' }) }) }), /*#__PURE__*/ _jsx("td", { className: "px-3 py-2.5 text-center text-gray-400", children: createdAt.toLocaleDateString('ru-RU', { day: '2-digit', month: '2-digit', year: '2-digit' }) }) ] }, referee.id); }) }) ] }) }) ] }, rid); }) }) ] }) ] }), transPreview && /*#__PURE__*/ _jsx("div", { className: "fixed inset-0 z-50 flex items-center justify-center bg-black/50 px-4", onClick: ()=>setTransPreview(null), children: /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-2xl shadow-xl w-full max-w-3xl max-h-[80vh] flex flex-col", onClick: (e)=>e.stopPropagation(), children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between px-6 py-4 border-b border-gray-100 flex-shrink-0", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("h3", { className: "font-semibold text-gray-900", children: [ "ЗаЎачО без перевПЎа: ", /*#__PURE__*/ _jsx("span", { className: "uppercase font-bold text-red-600", children: transPreview.lang }) ] }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-0.5", children: "ППказаМы первые 50 запОсей" }) ] }), /*#__PURE__*/ _jsx("button", { onClick: ()=>setTransPreview(null), className: "text-gray-400 hover:text-gray-600 p-1", children: /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" }) }) }) ] }), /*#__PURE__*/ _jsx("div", { className: "overflow-y-auto flex-1 px-6 py-4", children: transPreview.loading ? /*#__PURE__*/ _jsx("div", { className: "flex justify-center py-12", children: /*#__PURE__*/ _jsxs("svg", { className: "w-6 h-6 animate-spin text-purple-600", fill: "none", viewBox: "0 0 24 24", children: [ /*#__PURE__*/ _jsx("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }), /*#__PURE__*/ _jsx("path", { className: "opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8v8z" }) ] }) }) : transPreview.rows.length === 0 ? /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-500 text-center py-12", children: "Нет заЎач без перевПЎа" }) : /*#__PURE__*/ _jsxs("table", { className: "w-full text-xs border-collapse", children: [ /*#__PURE__*/ _jsx("thead", { children: /*#__PURE__*/ _jsxs("tr", { className: "border-b border-gray-200", children: [ /*#__PURE__*/ _jsx("th", { className: "text-left py-2 pr-3 font-semibold text-gray-600 w-[35%]", children: "ОрОгОМал (title)" }), /*#__PURE__*/ _jsx("th", { className: "text-center py-2 px-2 font-semibold text-gray-600", children: "orig" }), [ 'el', 'en', 'ru', 'uk' ].map((l)=>/*#__PURE__*/ _jsx("th", { className: "text-center py-2 px-2 font-semibold text-gray-600 w-[14%]", children: l }, l)) ] }) }), /*#__PURE__*/ _jsx("tbody", { children: transPreview.rows.map((row)=>/*#__PURE__*/ _jsxs("tr", { className: "border-b border-gray-100 hover:bg-gray-50", children: [ /*#__PURE__*/ _jsx("td", { className: "py-2 pr-3 text-gray-800 truncate max-w-[200px]", title: row.title, children: row.title }), /*#__PURE__*/ _jsx("td", { className: "py-2 px-2 text-center", children: /*#__PURE__*/ _jsx("span", { className: "uppercase font-semibold text-purple-700 bg-purple-50 px-1.5 py-0.5 rounded", children: row.originalLocale }) }), [ [ 'el', row.titleEl ], [ 'en', row.titleEn ], [ 'ru', row.titleRu ], [ 'uk', row.titleUk ] ].map((param)=>{ let [l, val] = param; return /*#__PURE__*/ _jsx("td", { className: "py-2 px-2 text-center", title: val !== null && val !== void 0 ? val : '', children: val ? /*#__PURE__*/ _jsx("span", { className: "text-emerald-600 font-semibold", children: "✓" }) : /*#__PURE__*/ _jsx("span", { className: "text-red-500 font-semibold", children: "✗" }) }, l); }) ] }, row.id)) }) ] }) }) ] }) }), editUser && /*#__PURE__*/ _jsx("div", { className: "fixed inset-0 z-50 flex items-center justify-center bg-black/50 px-4", children: /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-2xl shadow-xl w-full max-w-4xl max-h-[90vh] flex flex-col", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between px-6 py-4 border-b border-gray-100 flex-shrink-0", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("h2", { className: "text-base font-semibold text-gray-900", children: t('admin.user_edit.title') }), /*#__PURE__*/ _jsxs("p", { className: "text-xs text-gray-400 mt-0.5", children: [ editUser.email, " \xb7 ID: ", editUser.id ] }) ] }), /*#__PURE__*/ _jsx("button", { onClick: ()=>setEditUser(null), className: "text-gray-400 hover:text-gray-600 text-2xl leading-none", children: "\xd7" }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex flex-1 min-h-0", children: [ /*#__PURE__*/ _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: t('admin.user_edit.tab.profile') }, { id: 'account', label: t('admin.user_edit.tab.account') }, { id: 'balance', label: t('admin.user_edit.tab.balance') }, { id: 'settings', label: t('admin.user_edit.tab.settings') }, { id: 'site', label: t('admin.user_edit.tab.site') }, { id: 'specialist', label: t('admin.user_edit.tab.specialist') } ].map((item)=>/*#__PURE__*/ _jsx("button", { onClick: ()=>{ setEditUserTab(item.id); if (item.id === 'specialist' && editUser) { setEditUserCardsLoading(true); const loadCards = api.getAdminUserSpecialistCards(editUser.id).then(setEditUserCards).catch(()=>{}); const loadCats = catRows.length === 0 ? api.getAdminCategories().then(setCatRows).catch(()=>{}) : Promise.resolve(); const loadLocs = locRows.length === 0 ? api.getAdminLocations().then(setLocRows).catch(()=>{}) : Promise.resolve(); Promise.all([ loadCards, loadCats, loadLocs ]).finally(()=>setEditUserCardsLoading(false)); } }, className: "w-full text-left px-3 py-2.5 text-sm rounded-lg transition-colors ".concat(editUserTab === item.id ? 'bg-green-50 text-green-700 font-medium' : 'text-gray-600 hover:bg-gray-50'), children: item.label }, item.id)) }), /*#__PURE__*/ _jsxs("div", { className: "flex-1 overflow-y-auto p-6", children: [ editUserTab === 'profile' && /*#__PURE__*/ _jsxs("div", { className: "space-y-4", children: [ /*#__PURE__*/ _jsxs("div", { className: "p-3 bg-gray-50 rounded-lg text-xs text-gray-500 space-y-0.5", children: [ /*#__PURE__*/ _jsxs("p", { children: [ /*#__PURE__*/ _jsxs("span", { className: "font-medium", children: [ t('admin.user_edit.registered'), ":" ] }), " ", new Date(editUser.createdAt).toLocaleDateString(dateLocale) ] }), editUser.lastSeenAt && /*#__PURE__*/ _jsxs("p", { children: [ /*#__PURE__*/ _jsxs("span", { className: "font-medium", children: [ t('admin.user_edit.last_seen'), ":" ] }), " ", new Date(editUser.lastSeenAt).toLocaleDateString(dateLocale) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "grid grid-cols-2 gap-3", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.user_edit.first_name') }), /*#__PURE__*/ _jsx("input", { value: (_editUser_firstName = editUser.firstName) !== null && _editUser_firstName !== void 0 ? _editUser_firstName : '', onChange: (e)=>setEditUser((u)=>({ ...u, firstName: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.user_edit.last_name') }), /*#__PURE__*/ _jsx("input", { value: (_editUser_lastName = editUser.lastName) !== null && _editUser_lastName !== void 0 ? _editUser_lastName : '', onChange: (e)=>setEditUser((u)=>({ ...u, lastName: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.user_edit.phone') }), /*#__PURE__*/ _jsx("input", { value: (_editUser_phone = editUser.phone) !== null && _editUser_phone !== void 0 ? _editUser_phone : '', onChange: (e)=>setEditUser((u)=>({ ...u, phone: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.user_edit.bio') }), /*#__PURE__*/ _jsx("textarea", { value: (_editUser_bio = editUser.bio) !== null && _editUser_bio !== void 0 ? _editUser_bio : '', onChange: (e)=>setEditUser((u)=>({ ...u, bio: e.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" }) ] }) ] }), editUserTab === 'account' && /*#__PURE__*/ _jsxs("div", { className: "space-y-4", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.user_edit.email') }), /*#__PURE__*/ _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: editUser.email }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between rounded-lg border px-3 py-2 bg-gray-50", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2", children: [ editUser.emailVerified ? /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-green-500 shrink-0", viewBox: "0 0 20 20", fill: "currentColor", children: /*#__PURE__*/ _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" }) }) : /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-red-400 shrink-0", viewBox: "0 0 20 20", fill: "currentColor", children: /*#__PURE__*/ _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" }) }), /*#__PURE__*/ _jsx("span", { className: "text-sm font-medium ".concat(editUser.emailVerified ? 'text-green-700' : 'text-red-600'), children: editUser.emailVerified ? t('admin.user_edit.email_verified') : t('admin.user_edit.email_not_verified') }) ] }), !editUser.emailVerified && /*#__PURE__*/ _jsx("button", { onClick: verifyEmail, disabled: verifyingEmail, className: "text-xs px-3 py-1 rounded-md bg-green-600 text-white hover:bg-green-700 disabled:opacity-50 transition-colors", children: verifyingEmail ? '...' : t('admin.user_edit.verify_email_btn') }) ] }), /*#__PURE__*/ _jsxs("div", { className: "grid grid-cols-2 gap-3", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.user_edit.role') }), /*#__PURE__*/ _jsxs("select", { value: editUser.role, onChange: (e)=>setEditUser((u)=>({ ...u, role: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm", children: [ /*#__PURE__*/ _jsx("option", { value: "user", children: t('admin.user_edit.role.user') }), /*#__PURE__*/ _jsx("option", { value: "admin", children: t('admin.user_edit.role.admin') }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.user_edit.plan') }), /*#__PURE__*/ _jsxs("select", { value: (_editUser_planId = editUser.planId) !== null && _editUser_planId !== void 0 ? _editUser_planId : '', onChange: (e)=>setEditUser((u)=>({ ...u, planId: e.target.value || null })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm", children: [ /*#__PURE__*/ _jsx("option", { value: "", children: t('admin.user_edit.no_plan') }), planRows.map((p)=>/*#__PURE__*/ _jsx("option", { value: p.id, children: p.name }, p.id)) ] }) ] }) ] }), editUser.planExpiresAt && /*#__PURE__*/ _jsxs("p", { className: "text-xs text-gray-500", children: [ t('admin.user_edit.plan_expires'), ": ", new Date(editUser.planExpiresAt).toLocaleDateString(dateLocale) ] }), /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-2 cursor-pointer", children: [ /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: editUser.isActive !== false, onChange: (e)=>setEditUser((u)=>({ ...u, isActive: e.target.checked })), className: "w-4 h-4 rounded border-gray-300 text-green-600" }), /*#__PURE__*/ _jsx("span", { className: "text-sm text-gray-700", children: t('admin.user_edit.active') }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.user_edit.interface_lang') }), /*#__PURE__*/ _jsxs("select", { value: (_editUser_locale = editUser.locale) !== null && _editUser_locale !== void 0 ? _editUser_locale : 'el', onChange: (e)=>setEditUser((u)=>({ ...u, locale: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm", children: [ /*#__PURE__*/ _jsx("option", { value: "el", children: "ΕλληΜικά" }), /*#__PURE__*/ _jsx("option", { value: "en", children: "English" }), /*#__PURE__*/ _jsx("option", { value: "ru", children: "РусскОй" }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: t('admin.user_edit.comm_languages') }), /*#__PURE__*/ _jsx("div", { className: "flex gap-5", children: [ 'el', 'en', 'uk', 'ru' ].map((lang)=>{ var _editUser_languages; return /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-1.5 cursor-pointer", children: [ /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: ((_editUser_languages = editUser.languages) !== null && _editUser_languages !== void 0 ? _editUser_languages : []).includes(lang), onChange: (e)=>{ var _editUser_languages; const langs = (_editUser_languages = editUser.languages) !== null && _editUser_languages !== void 0 ? _editUser_languages : []; setEditUser((u)=>({ ...u, languages: e.target.checked ? [ ...langs.filter((l)=>l !== lang), lang ] : langs.filter((l)=>l !== lang) })); }, className: "w-4 h-4 rounded border-gray-300 text-green-600" }), /*#__PURE__*/ _jsx("span", { className: "text-sm text-gray-700", children: lang === 'el' ? 'ΕλληΜικά' : lang === 'en' ? 'English' : lang === 'uk' ? 'УкраїМська' : 'РусскОй' }) ] }, lang); }) }) ] }) ] }), editUserTab === 'balance' && /*#__PURE__*/ _jsxs("div", { className: "space-y-6", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between p-5 bg-gray-50 rounded-xl border border-gray-200", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("div", { className: "text-xs text-gray-500 mb-1", children: t('admin.user_edit.balance') }), /*#__PURE__*/ _jsxs("div", { className: "text-2xl font-bold text-gray-900", children: [ Number((_editUser_balance = editUser.balance) !== null && _editUser_balance !== void 0 ? _editUser_balance : 0).toFixed(2), " EUR" ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-2", children: [ /*#__PURE__*/ _jsxs("button", { onClick: ()=>setBalanceModal('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: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M12 4v16m8-8H4" }) }), t('admin.balance.topup.btn') ] }), /*#__PURE__*/ _jsxs("button", { onClick: ()=>setBalanceModal('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: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M20 12H4" }) }), t('admin.balance.withdraw.btn') ] }) ] }) ] }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-center text-gray-400", children: t('admin.balance.modal_hint') }) ] }), editUserTab === 'settings' && /*#__PURE__*/ _jsx("div", { className: "space-y-4", children: /*#__PURE__*/ _jsxs("div", { className: "space-y-3 pt-1 divide-y divide-gray-100", children: [ /*#__PURE__*/ _jsxs("label", { className: "flex items-center justify-between cursor-pointer py-2", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("div", { className: "text-sm font-medium text-gray-700", children: t('admin.user_edit.show_contact_info') }), /*#__PURE__*/ _jsx("div", { className: "text-xs text-gray-400", children: t('admin.user_edit.show_contact_info.hint') }) ] }), /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: (_editUser_showContactInfo = editUser.showContactInfo) !== null && _editUser_showContactInfo !== void 0 ? _editUser_showContactInfo : false, onChange: (e)=>setEditUser((u)=>({ ...u, showContactInfo: e.target.checked })), className: "w-4 h-4 rounded border-gray-300 text-green-600" }) ] }), /*#__PURE__*/ _jsxs("label", { className: "flex items-center justify-between cursor-pointer py-2", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("div", { className: "text-sm font-medium text-gray-700", children: t('admin.user_edit.notify_new_tasks') }), /*#__PURE__*/ _jsx("div", { className: "text-xs text-gray-400", children: t('admin.user_edit.notify_new_tasks.hint') }) ] }), /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: (_editUser_notifyNewTasks = editUser.notifyNewTasks) !== null && _editUser_notifyNewTasks !== void 0 ? _editUser_notifyNewTasks : false, onChange: (e)=>setEditUser((u)=>({ ...u, notifyNewTasks: e.target.checked })), className: "w-4 h-4 rounded border-gray-300 text-green-600" }) ] }), /*#__PURE__*/ _jsxs("label", { className: "flex items-center justify-between cursor-pointer py-2", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("div", { className: "text-sm font-medium text-gray-700", children: t('admin.user_edit.notif_messages') }), /*#__PURE__*/ _jsx("div", { className: "text-xs text-gray-400", children: t('admin.user_edit.notif_messages.hint') }) ] }), /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: (_editUser_notifMessages = editUser.notifMessages) !== null && _editUser_notifMessages !== void 0 ? _editUser_notifMessages : true, onChange: (e)=>setEditUser((u)=>({ ...u, notifMessages: e.target.checked })), className: "w-4 h-4 rounded border-gray-300 text-green-600" }) ] }) ] }) }), editUserTab === 'site' && /*#__PURE__*/ _jsxs("div", { className: "space-y-4", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.user_edit.personal_site_slug') }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2", children: [ /*#__PURE__*/ _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: [ /*#__PURE__*/ _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/" }), /*#__PURE__*/ _jsx("input", { value: (_editUser_personalSiteSlug = editUser.personalSiteSlug) !== null && _editUser_personalSiteSlug !== void 0 ? _editUser_personalSiteSlug : '', onChange: (e)=>setEditUser((u)=>({ ...u, personalSiteSlug: e.target.value || null })), placeholder: "my-username", className: "flex-1 px-3 py-2 text-sm focus:outline-none" }) ] }), editUser.personalSiteSlug && /*#__PURE__*/ _jsx("a", { href: "/site/".concat(editUser.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: /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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" }) }) }) ] }) ] }), editUser.personalSiteSlug && /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx("h4", { className: "text-sm font-semibold text-gray-800 pt-3 border-t border-gray-100", children: t('profile.site.visible_title') }), /*#__PURE__*/ _jsx("div", { className: "space-y-1", children: [ { key: 'showBio', label: t('profile.site.visible.bio') }, { key: 'showRating', label: t('profile.site.visible.rating') }, { key: 'showServices', label: t('profile.site.visible.services') }, { key: 'showPortfolio', label: t('profile.site.visible.portfolio') }, { key: 'showReviews', label: t('profile.site.visible.reviews') }, { key: 'showPhone', label: t('profile.site.visible.contacts') }, { key: 'showFullLastName', label: t('profile.site.visible.full_last_name') }, { key: 'showStatus', label: t('profile.site.visible.status') } ].map((item)=>{ var _editUser_siteSettings; return /*#__PURE__*/ _jsxs("label", { className: "flex items-center justify-between cursor-pointer py-1.5", children: [ /*#__PURE__*/ _jsx("span", { className: "text-sm text-gray-700", children: item.label }), /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: ((_editUser_siteSettings = editUser.siteSettings) !== null && _editUser_siteSettings !== void 0 ? _editUser_siteSettings : {})[item.key] !== false, onChange: (e)=>setEditUser((u)=>{ var _u_siteSettings; return { ...u, siteSettings: { ...(_u_siteSettings = u.siteSettings) !== null && _u_siteSettings !== void 0 ? _u_siteSettings : {}, [item.key]: e.target.checked } }; }), className: "w-4 h-4 rounded border-gray-300 text-green-600" }) ] }, item.key); }) }), /*#__PURE__*/ _jsxs("div", { className: "pt-2", children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1.5", children: t('profile.site.theme') }), /*#__PURE__*/ _jsxs("select", { value: (_siteTheme = ((_editUser_siteSettings = editUser.siteSettings) !== null && _editUser_siteSettings !== void 0 ? _editUser_siteSettings : {}).siteTheme) !== null && _siteTheme !== void 0 ? _siteTheme : 'dark', onChange: (e)=>setEditUser((u)=>{ var _u_siteSettings; return { ...u, siteSettings: { ...(_u_siteSettings = u.siteSettings) !== null && _u_siteSettings !== void 0 ? _u_siteSettings : {}, siteTheme: e.target.value } }; }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm", children: [ /*#__PURE__*/ _jsx("option", { value: "dark", children: t('profile.site.theme.dark') }), /*#__PURE__*/ _jsx("option", { value: "light", children: t('profile.site.theme.light') }) ] }) ] }) ] }) ] }), editUserTab === 'specialist' && /*#__PURE__*/ _jsxs("div", { className: "space-y-6", children: [ (()=>{ if ((editUser === null || editUser === void 0 ? void 0 : editUser.role) === 'specialist') return null; var _editUser_bio; const bio = String((_editUser_bio = editUser === null || editUser === void 0 ? void 0 : editUser.bio) !== null && _editUser_bio !== void 0 ? _editUser_bio : '').trim(); const publishedCards = (editUserCards !== null && editUserCards !== void 0 ? editUserCards : []).filter((c)=>{ var _c_publicationStatus; return ((_c_publicationStatus = c.publicationStatus) !== null && _c_publicationStatus !== void 0 ? _c_publicationStatus : c.isActive ? 'active' : 'inactive') === 'active'; }); const hasPublishedCard = publishedCards.length > 0; const hasCategories = publishedCards.some((c)=>{ var _c_categories; var _c_categories_length; return ((_c_categories_length = (_c_categories = c.categories) === null || _c_categories === void 0 ? void 0 : _c_categories.length) !== null && _c_categories_length !== void 0 ? _c_categories_length : 0) > 0; }); const hasLocations = publishedCards.some((c)=>{ var _c_locations; var _c_locations_length; return ((_c_locations_length = (_c_locations = c.locations) === null || _c_locations === void 0 ? void 0 : _c_locations.length) !== null && _c_locations_length !== void 0 ? _c_locations_length : 0) > 0; }); const missing = []; if (!bio) missing.push(t('admin.user_edit.visibility_requirements.bio', 'Fill in bio')); if (!hasPublishedCard) missing.push(t('admin.user_edit.visibility_requirements.published_card', 'Publish at least one card')); if (!hasCategories) missing.push(t('admin.user_edit.visibility_requirements.categories', 'Add a category in a published card')); if (!hasLocations) missing.push(t('admin.user_edit.visibility_requirements.locations', 'Add a location in a published card')); if (missing.length === 0) return null; return /*#__PURE__*/ _jsxs("div", { className: "rounded-xl border border-amber-300 bg-amber-50 p-3", children: [ /*#__PURE__*/ _jsx("p", { className: "text-sm font-semibold text-amber-900", children: t('admin.user_edit.visibility_requirements.title', 'Profile is not yet visible in Offers') }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-amber-800 mt-1", children: t('admin.user_edit.visibility_requirements.hint', 'Visibility requirements to complete:') }), /*#__PURE__*/ _jsx("ul", { className: "mt-2 text-xs text-amber-900 list-disc pl-5 space-y-0.5", children: missing.map((m)=>/*#__PURE__*/ _jsx("li", { children: m }, m)) }) ] }); })(), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: t('admin.user_edit.skills') }), /*#__PURE__*/ _jsx("div", { className: "flex flex-wrap gap-1.5 mb-2 min-h-[28px]", children: ((_editUser_skills = editUser.skills) !== null && _editUser_skills !== void 0 ? _editUser_skills : []).map((s)=>/*#__PURE__*/ _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, /*#__PURE__*/ _jsx("button", { onClick: ()=>setEditUser((u)=>{ var _u_skills; return { ...u, skills: ((_u_skills = u.skills) !== null && _u_skills !== void 0 ? _u_skills : []).filter((x)=>x !== s) }; }), className: "text-gray-400 hover:text-green-700 leading-none", children: "\xd7" }) ] }, s)) }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-2", children: [ /*#__PURE__*/ _jsx("input", { value: skillInput, onChange: (e)=>setSkillInput(e.target.value), onKeyDown: (e)=>{ if ((e.key === 'Enter' || e.key === ',') && skillInput.trim()) { e.preventDefault(); const val = skillInput.trim().replace(/,$/, ''); var _editUser_skills; if (val && !((_editUser_skills = editUser.skills) !== null && _editUser_skills !== void 0 ? _editUser_skills : []).includes(val)) { setEditUser((u)=>{ var _u_skills; return { ...u, skills: [ ...(_u_skills = u.skills) !== null && _u_skills !== void 0 ? _u_skills : [], val ] }; }); } setSkillInput(''); } }, placeholder: t('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" }), /*#__PURE__*/ _jsx("button", { onClick: ()=>{ const val = skillInput.trim(); var _editUser_skills; if (val && !((_editUser_skills = editUser.skills) !== null && _editUser_skills !== void 0 ? _editUser_skills : []).includes(val)) { setEditUser((u)=>{ var _u_skills; return { ...u, skills: [ ...(_u_skills = u.skills) !== null && _u_skills !== void 0 ? _u_skills : [], val ] }; }); } setSkillInput(''); }, className: "px-3 py-2 bg-green-600 text-white rounded-lg text-sm hover:bg-green-700", children: t('common.add') }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "border-t border-gray-100 pt-4", children: [ /*#__PURE__*/ _jsx("div", { className: "text-sm font-medium text-gray-700 mb-3", children: t('admin.user_edit.specialist_cards') }), editUserCardsLoading ? /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 py-2", children: t('common.loading') }) : editUserCards.length === 0 ? /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 py-4 text-center", children: t('admin.user_edit.no_cards') }) : /*#__PURE__*/ _jsx("div", { className: "space-y-4", children: editUserCards.map((card)=>{ var _card_title, _card_description, _card_skills, _cardSkillInputs_card_id, _card_categories, _card_categories1, _card_locations, _card_locations1; return /*#__PURE__*/ _jsxs("div", { className: "border border-gray-200 bg-gray-50 rounded-xl p-4 space-y-3", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3", children: [ /*#__PURE__*/ _jsx("input", { value: (_card_title = card.title) !== null && _card_title !== void 0 ? _card_title : '', onChange: (e)=>setEditUserCards((prev)=>prev.map((c)=>c.id === card.id ? { ...c, title: e.target.value } : c)), placeholder: t('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" }), /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-1.5 cursor-pointer flex-shrink-0", children: [ /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: card.isActive !== false, onChange: (e)=>setEditUserCards((prev)=>prev.map((c)=>c.id === card.id ? { ...c, isActive: e.target.checked } : c)), className: "w-4 h-4 rounded border-gray-300 text-green-600" }), /*#__PURE__*/ _jsx("span", { className: "text-xs text-gray-600", children: t('admin.user_edit.published') }) ] }) ] }), /*#__PURE__*/ _jsx("textarea", { value: (_card_description = card.description) !== null && _card_description !== void 0 ? _card_description : '', onChange: (e)=>setEditUserCards((prev)=>prev.map((c)=>c.id === card.id ? { ...c, description: e.target.value } : c)), rows: 3, placeholder: t('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" }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("div", { className: "text-xs font-medium text-gray-500 mb-1.5", children: t('admin.user_edit.skills') }), /*#__PURE__*/ _jsx("div", { className: "flex flex-wrap gap-1.5 mb-1.5 min-h-[24px]", children: ((_card_skills = card.skills) !== null && _card_skills !== void 0 ? _card_skills : []).map((s)=>/*#__PURE__*/ _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, /*#__PURE__*/ _jsx("button", { onClick: ()=>setEditUserCards((prev)=>prev.map((c)=>{ var _c_skills; return c.id === card.id ? { ...c, skills: ((_c_skills = c.skills) !== null && _c_skills !== void 0 ? _c_skills : []).filter((x)=>x !== s) } : c; })), className: "text-gray-400 hover:text-green-700 leading-none", children: "\xd7" }) ] }, s)) }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-2", children: [ /*#__PURE__*/ _jsx("input", { value: (_cardSkillInputs_card_id = cardSkillInputs[card.id]) !== null && _cardSkillInputs_card_id !== void 0 ? _cardSkillInputs_card_id : '', onChange: (e)=>setCardSkillInputs((prev)=>({ ...prev, [card.id]: e.target.value })), onKeyDown: (e)=>{ var _cardSkillInputs_card_id; if ((e.key === 'Enter' || e.key === ',') && ((_cardSkillInputs_card_id = cardSkillInputs[card.id]) !== null && _cardSkillInputs_card_id !== void 0 ? _cardSkillInputs_card_id : '').trim()) { e.preventDefault(); var _cardSkillInputs_card_id1; const val = ((_cardSkillInputs_card_id1 = cardSkillInputs[card.id]) !== null && _cardSkillInputs_card_id1 !== void 0 ? _cardSkillInputs_card_id1 : '').trim().replace(/,$/, ''); var _card_skills; if (val && !((_card_skills = card.skills) !== null && _card_skills !== void 0 ? _card_skills : []).includes(val)) { setEditUserCards((prev)=>prev.map((c)=>{ var _c_skills; return c.id === card.id ? { ...c, skills: [ ...(_c_skills = c.skills) !== null && _c_skills !== void 0 ? _c_skills : [], val ] } : c; })); } setCardSkillInputs((prev)=>({ ...prev, [card.id]: '' })); } }, placeholder: t('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" }), /*#__PURE__*/ _jsx("button", { onClick: ()=>{ var _cardSkillInputs_card_id; const val = ((_cardSkillInputs_card_id = cardSkillInputs[card.id]) !== null && _cardSkillInputs_card_id !== void 0 ? _cardSkillInputs_card_id : '').trim(); var _card_skills; if (val && !((_card_skills = card.skills) !== null && _card_skills !== void 0 ? _card_skills : []).includes(val)) { setEditUserCards((prev)=>prev.map((c)=>{ var _c_skills; return c.id === card.id ? { ...c, skills: [ ...(_c_skills = c.skills) !== null && _c_skills !== void 0 ? _c_skills : [], val ] } : c; })); } setCardSkillInputs((prev)=>({ ...prev, [card.id]: '' })); }, className: "px-2.5 py-1.5 bg-green-600 text-white rounded-lg text-xs hover:bg-green-700", children: "+" }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("div", { className: "text-xs font-medium text-gray-500 mb-1.5", children: t('admin.user_edit.categories') }), /*#__PURE__*/ _jsx("div", { className: "flex flex-wrap gap-1.5 mb-1.5 min-h-[24px]", children: ((_card_categories = card.categories) !== null && _card_categories !== void 0 ? _card_categories : []).map((slug)=>{ var _catRows_find; return /*#__PURE__*/ _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: [ getCatLabel((_catRows_find = catRows.find((c)=>c.slug === slug)) !== null && _catRows_find !== void 0 ? _catRows_find : { slug }, locale), /*#__PURE__*/ _jsx("button", { onClick: ()=>setEditUserCards((prev)=>prev.map((c)=>{ var _c_categories; return c.id === card.id ? { ...c, categories: ((_c_categories = c.categories) !== null && _c_categories !== void 0 ? _c_categories : []).filter((x)=>x !== slug) } : c; })), className: "text-purple-400 hover:text-purple-700 leading-none", children: "\xd7" }) ] }, slug); }) }), /*#__PURE__*/ _jsx(AdminCatPicker, { catRows: catRows, locale: locale, selected: (_card_categories1 = card.categories) !== null && _card_categories1 !== void 0 ? _card_categories1 : [], onAdd: (id)=>setEditUserCards((prev)=>prev.map((c)=>{ var _c_categories; return c.id === card.id ? { ...c, categories: [ ...(_c_categories = c.categories) !== null && _c_categories !== void 0 ? _c_categories : [], id ] } : c; })), addLabel: t('admin.user_edit.add_category') }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("div", { className: "text-xs font-medium text-gray-500 mb-1.5", children: t('admin.user_edit.locations') }), /*#__PURE__*/ _jsx("div", { className: "flex flex-wrap gap-1.5 mb-1.5 min-h-[24px]", children: ((_card_locations = card.locations) !== null && _card_locations !== void 0 ? _card_locations : []).map((slug)=>{ var _locRows_find; return /*#__PURE__*/ _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: [ getLocLabel((_locRows_find = locRows.find((l)=>l.slug === slug)) !== null && _locRows_find !== void 0 ? _locRows_find : { slug }, locale), /*#__PURE__*/ _jsx("button", { onClick: ()=>setEditUserCards((prev)=>prev.map((c)=>{ var _c_locations; return c.id === card.id ? { ...c, locations: ((_c_locations = c.locations) !== null && _c_locations !== void 0 ? _c_locations : []).filter((x)=>x !== slug) } : c; })), className: "text-green-400 hover:text-green-700 leading-none", children: "\xd7" }) ] }, slug); }) }), /*#__PURE__*/ _jsx(AdminLocPicker, { locRows: locRows, locale: locale, selected: (_card_locations1 = card.locations) !== null && _card_locations1 !== void 0 ? _card_locations1 : [], onAdd: (id)=>setEditUserCards((prev)=>prev.map((c)=>{ var _c_locations; return c.id === card.id ? { ...c, locations: [ ...(_c_locations = c.locations) !== null && _c_locations !== void 0 ? _c_locations : [], id ] } : c; })), addLabel: t('admin.user_edit.add_location') }) ] }), /*#__PURE__*/ _jsx("div", { className: "flex justify-end pt-1", children: /*#__PURE__*/ _jsx("button", { onClick: ()=>saveCard(card.id), disabled: cardSaving[card.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: cardSaving[card.id] ? '...' : t('common.save') }) }) ] }, card.id); }) }) ] }) ] }) ] }) ] }), editUserTab !== 'balance' ? /*#__PURE__*/ _jsxs("div", { className: "border-t border-gray-100 px-6 py-4 flex gap-3 flex-shrink-0", children: [ /*#__PURE__*/ _jsx("button", { onClick: saveEditUser, disabled: editUserSaving, className: "flex-1 bg-green-600 hover:bg-green-700 text-white py-2 rounded-lg text-sm font-semibold disabled:opacity-50", children: editUserSaving ? '...' : t('common.save') }), /*#__PURE__*/ _jsx("button", { onClick: ()=>setEditUser(null), className: "flex-1 bg-gray-100 hover:bg-gray-200 text-gray-700 py-2 rounded-lg text-sm font-medium", children: t('common.cancel') }) ] }) : /*#__PURE__*/ _jsx("div", { className: "border-t border-gray-100 px-6 py-4 flex-shrink-0", children: /*#__PURE__*/ _jsx("button", { onClick: ()=>setEditUser(null), className: "w-full bg-gray-100 hover:bg-gray-200 text-gray-700 py-2 rounded-lg text-sm font-medium", children: t('common.close') }) }) ] }) }), editUser && balanceModal && /*#__PURE__*/ _jsx("div", { className: "fixed inset-0 z-[60] flex items-center justify-center bg-black/40 px-4", children: /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-2xl shadow-2xl p-6 w-full max-w-sm border-t-4 ".concat(balanceModal === 'topup' ? 'border-emerald-500' : 'border-rose-500'), children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between mb-4", children: [ /*#__PURE__*/ _jsx("h3", { className: "text-base font-semibold ".concat(balanceModal === 'topup' ? 'text-emerald-900' : 'text-rose-900'), children: balanceModal === 'topup' ? t('admin.balance.topup.title') : t('admin.balance.withdraw.title') }), /*#__PURE__*/ _jsx("button", { onClick: ()=>setBalanceModal(null), className: "text-gray-400 hover:text-gray-600 text-2xl leading-none", children: "\xd7" }) ] }), /*#__PURE__*/ _jsxs("p", { className: "text-xs text-gray-500 mb-4", children: [ t('admin.user_edit.balance'), ": ", /*#__PURE__*/ _jsxs("span", { className: "font-semibold text-gray-700", children: [ Number((_editUser_balance1 = editUser.balance) !== null && _editUser_balance1 !== void 0 ? _editUser_balance1 : 0).toFixed(2), " EUR" ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "space-y-3", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium mb-1 ".concat(balanceModal === 'topup' ? 'text-emerald-800' : 'text-rose-800'), children: balanceModal === 'topup' ? t('admin.balance.topup.amount') : t('admin.balance.withdraw.amount') }), /*#__PURE__*/ _jsx("input", { type: "number", min: "0.01", step: "0.01", value: balanceModal === 'topup' ? (_editUser_topUpAmount = editUser.topUpAmount) !== null && _editUser_topUpAmount !== void 0 ? _editUser_topUpAmount : '' : (_editUser_withdrawAmount = editUser.withdrawAmount) !== null && _editUser_withdrawAmount !== void 0 ? _editUser_withdrawAmount : '', onChange: (e)=>setEditUser((u)=>balanceModal === 'topup' ? { ...u, topUpAmount: e.target.value } : { ...u, withdrawAmount: e.target.value }), className: "w-full border rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 ".concat(balanceModal === 'topup' ? 'border-emerald-300 focus:ring-emerald-400' : 'border-rose-300 focus:ring-rose-400') }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium mb-1 ".concat(balanceModal === 'topup' ? 'text-emerald-800' : 'text-rose-800'), children: balanceModal === 'topup' ? t('admin.balance.topup.description') : t('admin.balance.withdraw.description') }), /*#__PURE__*/ _jsx("input", { value: balanceModal === 'topup' ? (_editUser_topUpDescription = editUser.topUpDescription) !== null && _editUser_topUpDescription !== void 0 ? _editUser_topUpDescription : '' : (_editUser_withdrawDescription = editUser.withdrawDescription) !== null && _editUser_withdrawDescription !== void 0 ? _editUser_withdrawDescription : '', onChange: (e)=>setEditUser((u)=>balanceModal === 'topup' ? { ...u, topUpDescription: e.target.value } : { ...u, withdrawDescription: e.target.value }), placeholder: balanceModal === 'topup' ? t('admin.balance.topup.description.placeholder') : t('admin.balance.withdraw.description.placeholder'), className: "w-full border rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 ".concat(balanceModal === 'topup' ? 'border-emerald-300 focus:ring-emerald-400' : 'border-rose-300 focus:ring-rose-400') }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-2 mt-5", children: [ /*#__PURE__*/ _jsx("button", { onClick: async ()=>{ if (balanceModal === 'topup') { await handleAdminTopUp(); } else { await handleAdminWithdraw(); } setBalanceModal(null); }, disabled: balanceModal === 'topup' ? topUpSaving || !Number(editUser.topUpAmount) : withdrawSaving || !Number(editUser.withdrawAmount), className: "flex-1 text-white py-2 rounded-lg text-sm font-semibold disabled:opacity-50 ".concat(balanceModal === 'topup' ? 'bg-emerald-600 hover:bg-emerald-700' : 'bg-rose-600 hover:bg-rose-700'), children: (balanceModal === 'topup' ? topUpSaving : withdrawSaving) ? t('common.loading') : balanceModal === 'topup' ? t('admin.balance.topup.submit') : t('admin.balance.withdraw.submit') }), /*#__PURE__*/ _jsx("button", { onClick: ()=>setBalanceModal(null), className: "flex-1 bg-gray-100 hover:bg-gray-200 text-gray-700 py-2 rounded-lg text-sm font-medium", children: t('common.cancel') }) ] }) ] }) }) ] }) ] }) ] }) }); } // ─── DbCheckTab ───────────────────────────────────────────────────────────── function DbCheckTab() { // ── Skill duplicates ────────────────────────────────────────────────────── const [dedupLoading, setDedupLoading] = useState(false); const [dedupGroups, setDedupGroups] = useState(null); const [keepIds, setKeepIds] = useState({}); const [merging, setMerging] = useState(null); function gk(group) { var _group__nameEl, _group_, _group_1; var _group__nameEl_toLowerCase_trim; return (_group__nameEl_toLowerCase_trim = (_group_ = group[0]) === null || _group_ === void 0 ? void 0 : (_group__nameEl = _group_.nameEl) === null || _group__nameEl === void 0 ? void 0 : _group__nameEl.toLowerCase().trim()) !== null && _group__nameEl_toLowerCase_trim !== void 0 ? _group__nameEl_toLowerCase_trim : (_group_1 = group[0]) === null || _group_1 === void 0 ? void 0 : _group_1.id; } async function findDuplicates() { setDedupLoading(true); setDedupGroups(null); setKeepIds({}); try { const groups = await api.getSkillDedup() // all categories ; setDedupGroups(groups); const auto = {}; groups.forEach((group)=>{ const best = [ ...group ].sort((a, b)=>{ var _b_usageCount, _a_usageCount; return ((_b_usageCount = b.usageCount) !== null && _b_usageCount !== void 0 ? _b_usageCount : 0) - ((_a_usageCount = a.usageCount) !== null && _a_usageCount !== void 0 ? _a_usageCount : 0); })[0]; auto[gk(group)] = best.id; }); setKeepIds(auto); } catch (e) { setDedupGroups([]); } finally{ setDedupLoading(false); } } async function mergeGroup(key, group) { const keepId = keepIds[key]; if (!keepId) return; const deleteIds = group.filter((s)=>s.id !== keepId).map((s)=>s.id); if (!deleteIds.length) return; setMerging(key); try { await api.mergeSkillDuplicates(keepId, deleteIds); setDedupGroups((prev)=>prev ? prev.filter((g)=>gk(g) !== key) : prev); } catch (e) {} finally{ setMerging(null); } } async function mergeAll() { if (!(dedupGroups === null || dedupGroups === void 0 ? void 0 : dedupGroups.length)) return; setMerging('__all__'); for (const group of [ ...dedupGroups ]){ const key = gk(group); const keepId = keepIds[key]; if (!keepId) continue; const deleteIds = group.filter((s)=>s.id !== keepId).map((s)=>s.id); if (!deleteIds.length) continue; try { await api.mergeSkillDuplicates(keepId, deleteIds); setDedupGroups((prev)=>prev ? prev.filter((g)=>gk(g) !== key) : prev); } catch (e) {} } setMerging(null); } var _dedupGroups_reduce; const totalDuplicates = (_dedupGroups_reduce = dedupGroups === null || dedupGroups === void 0 ? void 0 : dedupGroups.reduce((acc, g)=>acc + g.length - 1, 0)) !== null && _dedupGroups_reduce !== void 0 ? _dedupGroups_reduce : 0; return /*#__PURE__*/ _jsxs("div", { className: "space-y-6", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("h2", { className: "text-base font-semibold text-gray-900", children: "ПрПверка базы ЎаММых" }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-500 mt-0.5", children: "ДОагМПстОка О ОсправлеМОе прПблеЌ в базе ЎаММых" }) ] }), /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 overflow-hidden", children: [ /*#__PURE__*/ _jsxs("div", { className: "px-5 py-4 border-b border-gray-100 flex items-center justify-between", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("h3", { className: "text-sm font-semibold text-gray-800", children: "ДублОкаты МавыкПв" }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-0.5", children: "ППОск МавыкПв с ПЎОМакПвыЌ ОЌеМеЌ в ПЎМПй категПрОО. ПрО ПбъеЎОМеМОО — ссылкО в картПчках спецОалОстПв ПбМПвляются автПЌатОческО." }) ] }), /*#__PURE__*/ _jsxs("button", { onClick: findDuplicates, disabled: dedupLoading, 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: [ /*#__PURE__*/ _jsxs("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ _jsx("circle", { cx: "11", cy: "11", r: "8" }), /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M21 21l-4.35-4.35" }) ] }), dedupLoading ? 'Ищу ' : 'НайтО ЎублОкаты' ] }) ] }), dedupGroups !== null && /*#__PURE__*/ _jsx("div", { className: "p-5", children: dedupGroups.length === 0 ? /*#__PURE__*/ _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: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" }) }), "ДублОкатПв Ме МайЎеМП — база в пПряЎке" ] }) : /*#__PURE__*/ _jsxs("div", { className: "space-y-3", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between", children: [ /*#__PURE__*/ _jsxs("p", { className: "text-sm text-green-700 font-semibold", children: [ "НайЎеМП ", dedupGroups.length, " групп \xb7 ", totalDuplicates, " лОшМОх запОсей" ] }), /*#__PURE__*/ _jsx("button", { onClick: mergeAll, disabled: merging === '__all__', 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: merging === '__all__' ? 'ОбъеЎОМяю ' : "ОбъеЎОМОть все (".concat(dedupGroups.length, ")") }) ] }), dedupGroups.map((group)=>{ var _group_, _group_1; const key = gk(group); return /*#__PURE__*/ _jsxs("div", { className: "bg-white border border-orange-200 rounded-xl overflow-hidden shadow-sm", children: [ /*#__PURE__*/ _jsxs("div", { className: "px-4 py-2.5 bg-orange-50 border-b border-orange-100 flex items-center justify-between gap-3", children: [ /*#__PURE__*/ _jsxs("div", { className: "min-w-0", children: [ /*#__PURE__*/ _jsxs("span", { className: "text-sm font-semibold text-orange-800", children: [ "\xab", (_group_ = group[0]) === null || _group_ === void 0 ? void 0 : _group_.nameEl, "\xbb" ] }), /*#__PURE__*/ _jsx("span", { className: "ml-2 text-xs text-green-600 font-mono", children: (_group_1 = group[0]) === null || _group_1 === void 0 ? void 0 : _group_1.categorySlug }), /*#__PURE__*/ _jsxs("span", { className: "ml-2 text-xs text-orange-400", children: [ group.length, " варОаМта" ] }) ] }), /*#__PURE__*/ _jsx("button", { onClick: ()=>mergeGroup(key, group), disabled: !!merging, 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: merging === key ? 'ОбъеЎОМяю ' : 'ОбъеЎОМОть' }) ] }), /*#__PURE__*/ _jsx("div", { className: "divide-y divide-gray-50", children: group.map((skill)=>/*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-3 px-4 py-2.5 cursor-pointer hover:bg-gray-50 transition", children: [ /*#__PURE__*/ _jsx("input", { type: "radio", name: "dedup-global-".concat(key), checked: keepIds[key] === skill.id, onChange: ()=>setKeepIds((prev)=>({ ...prev, [key]: skill.id })), className: "accent-amber-600 shrink-0" }), /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 flex-wrap", children: [ /*#__PURE__*/ _jsx("span", { className: "text-sm font-medium text-gray-800", children: skill.nameEl }), skill.nameEn && skill.nameEn !== skill.nameEl && /*#__PURE__*/ _jsxs("span", { className: "text-xs text-gray-400", children: [ "EN: ", skill.nameEn ] }), skill.nameRu && skill.nameRu !== skill.nameEl && /*#__PURE__*/ _jsxs("span", { className: "text-xs text-gray-400", children: [ "RU: ", skill.nameRu ] }), skill.nameUk && /*#__PURE__*/ _jsxs("span", { className: "text-xs text-gray-400", children: [ "UK: ", skill.nameUk ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 mt-0.5", children: [ /*#__PURE__*/ _jsx("span", { className: "text-[11px] font-semibold ".concat(skill.usageCount > 0 ? 'text-green-600' : 'text-gray-400'), children: skill.usageCount > 0 ? "".concat(skill.usageCount, " ОспПльзПваМОй") : 'Ме ОспПльзПвался' }), /*#__PURE__*/ _jsxs("span", { className: "text-[11px] text-gray-300", children: [ "order: ", skill.order ] }), keepIds[key] === skill.id && /*#__PURE__*/ _jsx("span", { className: "text-[11px] font-bold text-amber-600 uppercase", children: "← ПставОть" }) ] }) ] }) ] }, skill.id)) }) ] }, key); }) ] }) }) ] }) ] }); } function LocTree(param) { let { rows, parentId, depth, locale, expanded, onToggle, onEdit, onDelete, onAddChild, t } = param; const children = rows.filter((r)=>{ var _r_parentId; return ((_r_parentId = r.parentId) !== null && _r_parentId !== void 0 ? _r_parentId : null) === parentId; }); if (children.length === 0) return null; return /*#__PURE__*/ _jsx(_Fragment, { children: children.sort((a, b)=>{ var _a_order, _b_order; return ((_a_order = a.order) !== null && _a_order !== void 0 ? _a_order : 0) - ((_b_order = b.order) !== null && _b_order !== void 0 ? _b_order : 0); }).map((loc)=>{ const hasChildren = rows.some((r)=>r.parentId === loc.id); const isOpen = expanded.has(loc.id); const name = (locale === 'en' ? loc.nameEn : locale === 'ru' ? loc.nameRu : locale === 'uk' ? loc.nameUk : loc.nameEl) || loc.nameEl || loc.slug; return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 px-4 py-3 hover:bg-gray-50 ".concat(!loc.isActive ? 'opacity-50' : ''), style: { paddingLeft: "".concat(16 + depth * 24, "px") }, children: [ /*#__PURE__*/ _jsx("button", { onClick: ()=>hasChildren && onToggle(loc.id), className: "w-5 h-5 flex items-center justify-center text-gray-400 rounded ".concat(hasChildren ? 'hover:bg-gray-200 cursor-pointer' : 'cursor-default'), children: hasChildren ? isOpen ? /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("polyline", { points: "6 9 12 15 18 9" }) }) : /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("polyline", { points: "9 18 15 12 9 6" }) }) : /*#__PURE__*/ _jsx("span", { className: "w-3.5 h-3.5 block" }) }), depth === 0 ? /*#__PURE__*/ _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: /*#__PURE__*/ _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" }) }) : /*#__PURE__*/ _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: [ /*#__PURE__*/ _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" }), /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 11a3 3 0 11-6 0 3 3 0 016 0z" }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ _jsx("span", { className: "font-medium text-gray-800 text-sm", children: name }), /*#__PURE__*/ _jsx("span", { className: "ml-2 text-xs text-gray-400", children: loc.nameEn }), /*#__PURE__*/ _jsxs("span", { className: "ml-1.5 font-mono text-xs text-gray-300", children: [ "/", loc.slug ] }) ] }), /*#__PURE__*/ _jsx("span", { className: "px-2 py-0.5 rounded-full text-xs font-medium ".concat(loc.isActive ? 'bg-green-100 text-green-700' : 'bg-gray-100 text-gray-500'), children: loc.isActive ? t('admin.cat.active') : t('admin.cat.inactive') }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-1 flex-shrink-0", children: [ depth === 0 && /*#__PURE__*/ _jsx("button", { onClick: ()=>onAddChild(loc.id), className: "text-xs px-2 py-1 rounded-lg bg-green-50 text-green-600 hover:bg-green-100 font-medium", title: t('admin.loc.add_district'), children: "+" }), /*#__PURE__*/ _jsx("button", { onClick: ()=>onEdit(loc), className: "text-xs px-2 py-1 rounded-lg bg-gray-100 text-gray-600 hover:bg-gray-200 font-medium", children: t('common.edit') }), /*#__PURE__*/ _jsx("button", { onClick: ()=>onDelete(loc.id, name), className: "text-xs px-2 py-1 rounded-lg bg-red-50 text-red-600 hover:bg-red-100 font-medium", children: t('common.delete') }) ] }) ] }), hasChildren && isOpen && /*#__PURE__*/ _jsx(LocTree, { rows: rows, parentId: loc.id, depth: depth + 1, locale: locale, expanded: expanded, onToggle: onToggle, onEdit: onEdit, onDelete: onDelete, onAddChild: onAddChild, t: t }) ] }, loc.id); }) }); } function CatTree(param) { let { rows, parentId, depth, locale, expanded, onToggle, onEdit, onDelete, onAddChild, skillsExpanded, skillsCache, skillsLoading, onToggleSkills, skillForm, skillSaving, onOpenAddSkill, onOpenEditSkill, onSaveSkill, onDeleteSkill, onCancelSkillForm, onSkillFormChange, t } = param; const children = rows.filter((r)=>{ var _r_parentId; return ((_r_parentId = r.parentId) !== null && _r_parentId !== void 0 ? _r_parentId : null) === parentId; }); if (children.length === 0) return null; return /*#__PURE__*/ _jsx(_Fragment, { children: children.sort((a, b)=>{ var _a_order, _b_order; return ((_a_order = a.order) !== null && _a_order !== void 0 ? _a_order : 0) - ((_b_order = b.order) !== null && _b_order !== void 0 ? _b_order : 0); }).map((cat)=>{ var _cat_names; const hasChildren = rows.some((r)=>r.parentId === cat.id); const isOpen = expanded.has(cat.id); const skillsOpen = skillsExpanded.has(cat.id); const isLoadingSkills = skillsLoading.has(cat.id); var _skillsCache_cat_slug; const skills = (_skillsCache_cat_slug = skillsCache[cat.slug]) !== null && _skillsCache_cat_slug !== void 0 ? _skillsCache_cat_slug : []; const name = (locale === 'en' ? cat.namesEn : locale === 'ru' ? cat.namesRu : locale === 'uk' ? cat.namesUk : cat.namesEl) || cat.namesEl || cat.slug; return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 px-4 py-3 hover:bg-gray-50 ".concat(!cat.isActive ? 'opacity-50' : ''), style: { paddingLeft: "".concat(16 + depth * 24, "px") }, children: [ /*#__PURE__*/ _jsx("button", { onClick: ()=>hasChildren && onToggle(cat.id), className: "w-5 h-5 flex items-center justify-center text-gray-400 rounded ".concat(hasChildren ? 'hover:bg-gray-200 cursor-pointer' : 'cursor-default'), children: hasChildren ? isOpen ? /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("polyline", { points: "6 9 12 15 18 9" }) }) : /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("polyline", { points: "9 18 15 12 9 6" }) }) : /*#__PURE__*/ _jsx("span", { className: "w-3.5 h-3.5 block" }) }), /*#__PURE__*/ _jsx("span", { className: "w-10 h-10 flex items-center justify-center rounded-xl bg-green-50", children: /*#__PURE__*/ _jsx(CategoryIcon, { icon: cat.icon, alt: name, className: "h-7 w-7 object-contain text-2xl leading-none", fallback: "\uD83D\uDCE6" }) }), /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ _jsx("span", { className: "font-medium text-gray-800 text-sm", children: name }), /*#__PURE__*/ _jsx("span", { className: "ml-2 text-xs text-gray-400", children: cat.namesEn || ((_cat_names = cat.names) === null || _cat_names === void 0 ? void 0 : _cat_names.en) }), /*#__PURE__*/ _jsxs("span", { className: "ml-1.5 font-mono text-xs text-gray-300", children: [ "/", cat.slug ] }) ] }), /*#__PURE__*/ _jsx("span", { className: "px-2 py-0.5 rounded-full text-xs font-medium ".concat(cat.isActive ? 'bg-green-100 text-green-700' : 'bg-gray-100 text-gray-500'), children: cat.isActive ? t('admin.cat.active') : t('admin.cat.inactive') }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-1 flex-shrink-0", children: [ /*#__PURE__*/ _jsxs("button", { onClick: ()=>onToggleSkills(cat), className: "text-xs px-2 py-1 rounded-lg font-medium flex items-center gap-1 ".concat(skillsOpen ? 'bg-amber-100 text-amber-700' : 'bg-amber-50 text-amber-600 hover:bg-amber-100'), title: "НавыкО", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-3 h-3", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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" }) }), skillsCache[cat.slug] ? skillsCache[cat.slug].length : t('admin.cat.skills', 'Skills') ] }), /*#__PURE__*/ _jsx("button", { onClick: ()=>onAddChild(cat.id), className: "text-xs px-2 py-1 rounded-lg bg-green-50 text-green-600 hover:bg-green-100 font-medium", title: t('admin.cat.add_child'), children: "+" }), /*#__PURE__*/ _jsx("button", { onClick: ()=>onEdit(cat), className: "text-xs px-2 py-1 rounded-lg bg-gray-100 text-gray-600 hover:bg-gray-200 font-medium", children: t('common.edit') }), /*#__PURE__*/ _jsx("button", { onClick: ()=>onDelete(cat.id, name), className: "text-xs px-2 py-1 rounded-lg bg-red-50 text-red-600 hover:bg-red-100 font-medium", children: t('common.delete') }) ] }) ] }), skillsOpen && /*#__PURE__*/ _jsx(SkillsPanel, { cat: cat, locale: locale, depth: depth, t: t, skills: skills, isLoading: isLoadingSkills, skillForm: skillForm, skillSaving: skillSaving, onOpenAddSkill: onOpenAddSkill, onOpenEditSkill: onOpenEditSkill, onSaveSkill: onSaveSkill, onDeleteSkill: onDeleteSkill, onCancelSkillForm: onCancelSkillForm, onSkillFormChange: onSkillFormChange }), hasChildren && isOpen && /*#__PURE__*/ _jsx(CatTree, { rows: rows, parentId: cat.id, depth: depth + 1, locale: locale, expanded: expanded, onToggle: onToggle, onEdit: onEdit, onDelete: onDelete, onAddChild: onAddChild, skillsExpanded: skillsExpanded, skillsCache: skillsCache, skillsLoading: skillsLoading, onToggleSkills: onToggleSkills, skillForm: skillForm, skillSaving: skillSaving, onOpenAddSkill: onOpenAddSkill, onOpenEditSkill: onOpenEditSkill, onSaveSkill: onSaveSkill, onDeleteSkill: onDeleteSkill, onCancelSkillForm: onCancelSkillForm, onSkillFormChange: onSkillFormChange, t: t }) ] }, cat.id); }) }); } // ─── SkillsPanel ──────────────────────────────────────────────────────────── // Self-contained component for the skill list + edit form + dedup panel per category const SKILL_LANG_LABELS = { nameEl: '🇬🇷 EL', nameEn: '🇬🇧 EN', nameRu: '🇷🇺 RU', nameUk: '🇺🇊 UK' }; function SkillForm(param) { let { form, saving, onSave, onCancel, onChange } = param; var _form_nameEl; var _form_order; return /*#__PURE__*/ _jsxs("div", { className: "bg-white border border-amber-200 rounded-xl p-4 shadow-sm", children: [ /*#__PURE__*/ _jsx("div", { className: "grid grid-cols-2 gap-3 mb-3", children: [ 'nameEl', 'nameEn', 'nameRu', 'nameUk' ].map((field, i)=>{ var _form_field; return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-[11px] font-semibold text-gray-500 mb-1 uppercase tracking-wide", children: SKILL_LANG_LABELS[field] }), /*#__PURE__*/ _jsx("input", { value: (_form_field = form[field]) !== null && _form_field !== void 0 ? _form_field : '', onChange: (e)=>onChange({ ...form, [field]: e.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: i === 0, placeholder: field === 'nameUk' ? 'МеПбПвʌязкПвП' : '' }) ] }, field); }) }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 pt-1 border-t border-gray-100", children: [ /*#__PURE__*/ _jsx("label", { className: "text-xs text-gray-400 font-medium", children: "ППряЎПк" }), /*#__PURE__*/ _jsx("input", { type: "number", value: (_form_order = form.order) !== null && _form_order !== void 0 ? _form_order : 0, onChange: (e)=>onChange({ ...form, order: Number(e.target.value) }), className: "w-16 border border-gray-200 rounded-lg px-2 py-1 text-xs text-center" }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-2 ml-auto", children: [ /*#__PURE__*/ _jsx("button", { onClick: onCancel, className: "px-3 py-1.5 bg-gray-100 text-gray-600 rounded-lg text-xs font-medium hover:bg-gray-200 transition", children: "ОтЌеМа" }), /*#__PURE__*/ _jsx("button", { onClick: onSave, disabled: saving || !((_form_nameEl = form.nameEl) === null || _form_nameEl === void 0 ? void 0 : _form_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: saving ? 'СПхраМяю ' : 'СПхраМОть' }) ] }) ] }) ] }); } function SkillsPanel(param) { let { cat, locale, depth, t, skills, isLoading, skillForm, skillSaving, onOpenAddSkill, onOpenEditSkill, onSaveSkill, onDeleteSkill, onCancelSkillForm, onSkillFormChange } = param; const showAddForm = (skillForm === null || skillForm === void 0 ? void 0 : skillForm.catSlug) === cat.slug && !(skillForm === null || skillForm === void 0 ? void 0 : skillForm.id); return /*#__PURE__*/ _jsxs("div", { className: "border-t border-amber-100 bg-gradient-to-b from-amber-50/60 to-white", style: { paddingLeft: "".concat(16 + depth * 24 + 36, "px"), paddingRight: '16px', paddingTop: '14px', paddingBottom: '14px' }, children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 mb-3", children: [ /*#__PURE__*/ _jsx("span", { className: "text-xs font-bold text-amber-700 uppercase tracking-wider", children: "НавыкО" }), /*#__PURE__*/ _jsxs("span", { className: "text-xs text-amber-500 font-mono", children: [ "/", cat.slug ] }), /*#__PURE__*/ _jsxs("span", { className: "ml-1 text-xs text-amber-400", children: [ "(", skills.length, ")" ] }), /*#__PURE__*/ _jsx("div", { className: "ml-auto", children: /*#__PURE__*/ _jsxs("button", { onClick: ()=>{ onCancelSkillForm(); onOpenAddSkill(cat.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: [ /*#__PURE__*/ _jsxs("svg", { className: "w-3 h-3", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: [ /*#__PURE__*/ _jsx("line", { x1: "12", y1: "5", x2: "12", y2: "19" }), /*#__PURE__*/ _jsx("line", { x1: "5", y1: "12", x2: "19", y2: "12" }) ] }), "ДПбавОть" ] }) }) ] }), isLoading ? /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 py-3 text-xs text-gray-400", children: [ /*#__PURE__*/ _jsxs("svg", { className: "w-3.5 h-3.5 animate-spin", fill: "none", viewBox: "0 0 24 24", children: [ /*#__PURE__*/ _jsx("circle", { cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4", className: "opacity-25" }), /*#__PURE__*/ _jsx("path", { fill: "currentColor", d: "M4 12a8 8 0 018-8v8z", className: "opacity-75" }) ] }), "Загрузка " ] }) : /*#__PURE__*/ _jsxs("div", { className: "space-y-1", children: [ skills.length === 0 && !showAddForm && /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 italic py-2", children: "НавыкО Ме ЎПбавлеМы" }), skills.map((skill)=>{ const isEditingThis = (skillForm === null || skillForm === void 0 ? void 0 : skillForm.id) === skill.id; const skillName = locale === 'en' ? skill.nameEn : locale === 'ru' ? skill.nameRu : locale === 'uk' ? skill.nameUk || skill.nameEn : skill.nameEl; return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 rounded-lg px-3 py-2 group transition ".concat(isEditingThis ? 'bg-amber-50 border border-amber-200' : 'bg-white border border-gray-100 hover:border-amber-200 hover:bg-amber-50/30'), children: [ /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ _jsx("span", { className: "text-sm font-medium text-gray-800", children: skillName }), locale !== 'en' && skill.nameEn && /*#__PURE__*/ _jsx("span", { className: "ml-2 text-xs text-gray-400", children: skill.nameEn }), locale !== 'ru' && skill.nameRu && skill.nameRu !== skill.nameEl && /*#__PURE__*/ _jsx("span", { className: "ml-1.5 text-xs text-gray-300", children: skill.nameRu }) ] }), skill.order > 0 && /*#__PURE__*/ _jsxs("span", { className: "text-[10px] text-gray-300 font-mono", children: [ "#", skill.order ] }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-1 transition-opacity ".concat(isEditingThis ? 'opacity-100' : 'opacity-0 group-hover:opacity-100'), children: [ /*#__PURE__*/ _jsx("button", { onClick: ()=>isEditingThis ? onCancelSkillForm() : (onCancelSkillForm(), onOpenEditSkill(skill, cat.slug)), className: "text-xs px-2 py-0.5 rounded-md font-medium transition ".concat(isEditingThis ? 'bg-amber-100 text-amber-700' : 'bg-gray-100 text-gray-600 hover:bg-amber-100 hover:text-amber-700'), children: isEditingThis ? '✕' : t('common.edit') }), /*#__PURE__*/ _jsx("button", { onClick: ()=>onDeleteSkill(skill, cat.slug), className: "text-xs px-2 py-0.5 rounded-md bg-red-50 text-red-600 hover:bg-red-100 transition", children: t('common.delete') }) ] }) ] }), isEditingThis && /*#__PURE__*/ _jsx("div", { className: "mt-1 mb-1 ml-0", children: /*#__PURE__*/ _jsx(SkillForm, { form: skillForm, saving: skillSaving, onSave: onSaveSkill, onCancel: onCancelSkillForm, onChange: onSkillFormChange }) }) ] }, skill.id); }), showAddForm && /*#__PURE__*/ _jsx("div", { className: "mt-2", children: /*#__PURE__*/ _jsx(SkillForm, { form: skillForm, saving: skillSaving, onSave: onSaveSkill, onCancel: onCancelSkillForm, onChange: onSkillFormChange }) }) ] }) ] }); } function Pagination(param) { let { page, total, limit, onChange, totalLabel } = param; const pages = Math.ceil(total / limit); if (pages <= 1) return null; return /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between px-4 py-3 border-t border-gray-100 text-sm text-gray-500", children: [ /*#__PURE__*/ _jsxs("span", { children: [ totalLabel, ": ", total ] }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-1", children: [ /*#__PURE__*/ _jsx("button", { onClick: ()=>onChange(page - 1), disabled: page === 1, className: "px-3 py-1 rounded-lg border border-gray-200 disabled:opacity-40 hover:bg-gray-50", children: "←" }), /*#__PURE__*/ _jsxs("span", { className: "px-3 py-1", children: [ page, " / ", pages ] }), /*#__PURE__*/ _jsx("button", { onClick: ()=>onChange(page + 1), disabled: page >= pages, className: "px-3 py-1 rounded-lg border border-gray-200 disabled:opacity-40 hover:bg-gray-50", children: "→" }) ] }) ] }); } // ── Activity log helpers ────────────────────────────────────────────────── function parseLogDetails(details) { try { return details ? JSON.parse(details) : null; } catch (e) { return null; } } const EVENT_META = { 'user.login': { icon: /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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: /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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: /*#__PURE__*/ _jsxs("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ _jsx("circle", { cx: "12", cy: "12", r: "10" }), /*#__PURE__*/ _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: /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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: /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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: /*#__PURE__*/ _jsxs("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ _jsx("circle", { cx: "12", cy: "12", r: "10" }), /*#__PURE__*/ _jsx("line", { x1: "15", y1: "9", x2: "9", y2: "15" }), /*#__PURE__*/ _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: /*#__PURE__*/ _jsxs("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ _jsx("polyline", { points: "3 6 5 6 21 6" }), /*#__PURE__*/ _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: /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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: /*#__PURE__*/ _jsxs("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ _jsx("line", { x1: "18", y1: "6", x2: "6", y2: "18" }), /*#__PURE__*/ _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: /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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 ActivityLogRow(param) { let { entry, dateLocale, onFilterUser, t } = param; var _EVENT_META_entry_event; const meta = (_EVENT_META_entry_event = EVENT_META[entry.event]) !== null && _EVENT_META_entry_event !== void 0 ? _EVENT_META_entry_event : { icon: /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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: entry.event, color: 'bg-gray-50 text-gray-700 border-gray-200' }; const details = parseLogDetails(entry.details); return /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 px-4 py-3 flex items-start gap-3", children: [ /*#__PURE__*/ _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 ".concat(meta.color), children: [ meta.icon, " ", t(meta.labelKey, meta.labelKey) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 flex-wrap", children: [ entry.userName && /*#__PURE__*/ _jsx("button", { onClick: ()=>entry.userId && onFilterUser(entry.userId), className: "text-sm font-medium text-gray-800 hover:text-green-600", children: entry.userName }), entry.userEmail && /*#__PURE__*/ _jsx("span", { className: "text-xs text-gray-400", children: entry.userEmail }) ] }), details && Object.keys(details).length > 0 && /*#__PURE__*/ _jsx("div", { className: "mt-1 flex flex-wrap gap-2", children: Object.entries(details).map((param)=>{ let [k, v] = param; return /*#__PURE__*/ _jsxs("span", { className: "text-xs bg-gray-100 text-gray-600 px-2 py-0.5 rounded", children: [ k, ": ", /*#__PURE__*/ _jsx("span", { className: "font-medium", children: String(v) }) ] }, k); }) }), entry.ipAddress && /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-0.5", children: entry.ipAddress }) ] }), /*#__PURE__*/ _jsx("time", { className: "shrink-0 text-xs text-gray-400 whitespace-nowrap", children: new Date(entry.createdAt).toLocaleString(dateLocale) }) ] }); } const MONTH_NAMES = [ 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec' ]; function AdminMonthChart(param) { let { series, dateLocale = 'en-US' } = param; // Collect all unique months from all series, sorted const monthSet = new Set(); series.forEach((s)=>s.data.forEach((r)=>monthSet.add(r.month))); const months = Array.from(monthSet).sort(); if (months.length === 0) return null; // Build lookup maps const seriesVals = series.map((s)=>{ const map = {}; s.data.forEach((r)=>{ map[r.month] = Number(r.count); }); return months.map((m)=>{ var _map_m; return (_map_m = map[m]) !== null && _map_m !== void 0 ? _map_m : 0; }); }); const allVals = seriesVals.flat(); const maxVal = Math.max(...allVals, 1); const W = 700; const H = 160; const padL = maxVal >= 1000000 ? 50 : maxVal >= 10000 ? 44 : maxVal >= 1000 ? 40 : 36; const padB = 24; const chartH = H - padB; const totalBars = months.length * series.length; const groupW = (W - padL - 8) / months.length; const barW = Math.max(4, Math.min(20, groupW / series.length - 2)); const yTicks = [ 0, Math.round(maxVal / 3), Math.round(maxVal * 2 / 3), maxVal ]; function barX(mi, si) { const groupStart = padL + mi * groupW + (groupW - series.length * (barW + 1)) / 2; return groupStart + si * (barW + 1); } function barHeight(v) { return v / maxVal * chartH; } return /*#__PURE__*/ _jsx("div", { className: "overflow-x-auto", children: /*#__PURE__*/ _jsxs("svg", { viewBox: "0 0 ".concat(W, " ").concat(H + 14), className: "w-full", style: { minWidth: Math.max(360, months.length * 40) }, children: [ yTicks.map((v, i)=>{ const y = chartH - v / maxVal * chartH; return /*#__PURE__*/ _jsxs("g", { children: [ /*#__PURE__*/ _jsx("line", { x1: padL, y1: y, x2: W - 4, y2: y, stroke: "#f3f4f6", strokeWidth: 1 }), /*#__PURE__*/ _jsx("text", { x: padL - 5, y: y + 3.5, textAnchor: "end", fontSize: 9, fill: "#9ca3af", children: fmtYLabel(v) }) ] }, i); }), months.map((m, mi)=>series.map((s, si)=>{ const v = seriesVals[si][mi]; const bh = barHeight(v); const x = barX(mi, si); return /*#__PURE__*/ _jsx("rect", { x: x, y: chartH - bh, width: barW, height: bh, fill: s.color, opacity: 0.8, rx: 2 }, "bar-".concat(mi, "-").concat(si)); })), months.map((m, mi)=>{ const [yr, mo] = m.slice(0, 7).split('-').map(Number); const d = new Date(Date.UTC(yr, mo - 1, 2)); const label = new Intl.DateTimeFormat(dateLocale, { month: 'short' }).format(d) + (mi === 0 || mo === 1 ? " ".concat(yr) : ''); const cx = padL + mi * groupW + groupW / 2; return /*#__PURE__*/ _jsx("text", { x: cx, y: H + 12, textAnchor: "middle", fontSize: 9, fill: "#9ca3af", children: label }, "xl-".concat(mi)); }), /*#__PURE__*/ _jsx("line", { x1: padL, y1: chartH, x2: W - 4, y2: chartH, stroke: "#e5e7eb", strokeWidth: 1 }) ] }) }); } function getLast30Days() { const days = []; for(let i = 29; i >= 0; i--){ const d = new Date(Date.now() - i * 86400000); days.push(d.toISOString().slice(0, 10)); } return days; } function smoothPath(pts) { if (pts.length < 2) return ''; let d = "M ".concat(pts[0][0].toFixed(1), " ").concat(pts[0][1].toFixed(1)); for(let i = 1; i < pts.length; i++){ const cpx = ((pts[i - 1][0] + pts[i][0]) / 2).toFixed(1); d += " C ".concat(cpx, " ").concat(pts[i - 1][1].toFixed(1), " ").concat(cpx, " ").concat(pts[i][1].toFixed(1), " ").concat(pts[i][0].toFixed(1), " ").concat(pts[i][1].toFixed(1)); } return d; } function fmtYLabel(v) { if (v >= 1000000) return "".concat(+(v / 1000000).toFixed(1), "M"); if (v >= 1000) return "".concat(Math.round(v / 1000), "K"); return String(v); } function AdminAreaChart(param) { let { series, days: daysProp } = param; const days = daysProp !== null && daysProp !== void 0 ? daysProp : getLast30Days(); const seriesVals = series.map((s)=>{ const map = {}; s.data.forEach((r)=>{ map[r.day] = Number(r.count); }); return days.map((d)=>{ var _map_d; return (_map_d = map[d]) !== null && _map_d !== void 0 ? _map_d : 0; }); }); const allVals = seriesVals.flat(); const maxVal = Math.max(...allVals, 1); const W = 700; const H = 160; const padL = maxVal >= 10000 ? 44 : maxVal >= 1000 ? 40 : 36; const padB = 22; const chartW = W - padL - 4; const chartH = H - padB; const stepX = chartW / (days.length - 1); function pts(vals) { return vals.map((v, i)=>[ padL + i * stepX, chartH - v / maxVal * chartH ]); } function areaPath(vals) { const points = pts(vals); const line = smoothPath(points); if (!line) return ''; const lastX = points[points.length - 1][0].toFixed(1); return "".concat(line, " L ").concat(lastX, " ").concat(chartH.toFixed(1), " L ").concat(padL.toFixed(1), " ").concat(chartH.toFixed(1), " Z"); } // Y-axis: 4 labels (0, 1/3, 2/3, max) const yTicks = [ 0, Math.round(maxVal / 3), Math.round(maxVal * 2 / 3), maxVal ]; // X-axis: every 7 days + last const xTicks = days.map((d, i)=>({ i, label: d.slice(8) })).filter((_, i)=>i % 7 === 0 || i === days.length - 1); return /*#__PURE__*/ _jsx("div", { className: "overflow-x-auto", children: /*#__PURE__*/ _jsxs("svg", { viewBox: "0 0 ".concat(W, " ").concat(H + 12), className: "w-full", style: { minWidth: 360 }, children: [ yTicks.map((v, i)=>{ const y = chartH - v / maxVal * chartH; return /*#__PURE__*/ _jsxs("g", { children: [ /*#__PURE__*/ _jsx("line", { x1: padL, y1: y, x2: W - 4, y2: y, stroke: "#f3f4f6", strokeWidth: 1 }), /*#__PURE__*/ _jsx("text", { x: padL - 5, y: y + 3.5, textAnchor: "end", fontSize: 9, fill: "#9ca3af", children: fmtYLabel(v) }) ] }, i); }), xTicks.map((param)=>{ let { i } = param; const x = padL + i * stepX; return /*#__PURE__*/ _jsx("line", { x1: x, y1: 0, x2: x, y2: chartH, stroke: "#f9fafb", strokeWidth: 1 }, "vg-".concat(i)); }), xTicks.map((param)=>{ let { i, label } = param; return /*#__PURE__*/ _jsx("text", { x: padL + i * stepX, y: H + 10, textAnchor: "middle", fontSize: 9, fill: "#9ca3af", children: label }, i); }), series.map((s, si)=>/*#__PURE__*/ _jsx("path", { d: areaPath(seriesVals[si]), fill: s.fill }, "fill-".concat(si))), series.map((s, si)=>/*#__PURE__*/ _jsx("path", { d: smoothPath(pts(seriesVals[si])), fill: "none", stroke: s.color, strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round" }, "line-".concat(si))), series.map((s, si)=>{ const points = pts(seriesVals[si]); const last = points[points.length - 1]; return /*#__PURE__*/ _jsx("g", { children: /*#__PURE__*/ _jsx("circle", { cx: last[0], cy: last[1], r: 4, fill: "white", stroke: s.color, strokeWidth: 2 }) }, "dot-".concat(si)); }), /*#__PURE__*/ _jsx("line", { x1: padL, y1: chartH, x2: W - 4, y2: chartH, stroke: "#e5e7eb", strokeWidth: 1 }) ] }) }); } @û`=_’”ÇÉôö;=ik‹°²äæNµ ¹ !!Ê!Í!p"s"u"€"Á#_Ä#3%7%¶%º%k'n'š**s+v+8,;,È,Ë,¿-Ã-ã/æ/è/ó/=1@1 33<3C3z33š3Ÿ3¬3_Ž3g6k6Õ6Ù6‰8Œ8Œ9¿9Ê:Í:~;;æ<é<>>þ>?›?ž?DDuDyDÜGßGáGìG‹IŽI€J_§JLL‚N†NõPøPÙQÜQT"TLTST†TTŠT«TžTÀTrWvWàWäW”Y˜YæZéZ(\+\a]d]^_^}_€_›`Ÿ`•a˜a2b5b˜fœfýfgOjRj~kkîlñln nïoòoáqåqPtSt4u7uïvývUw_]w‹w”w³w»wÚwáw!x(x6x>xŽx»xïxöx#y*yXy_y…yŒyœyÄyñyøy*z1z^zez“zšzÀz_Çzøzÿz0{7{o{v{§{®{à{ç{'|.|ˆ||Ð|×|} }f}m}­}Ž}~~9~@~r~y~­~Ž~å~_ì~SZ‘˜ÕÜ€"€W€^€‰€€Œ€Ã€DK}„ž¿öý8‚?‚v‚}‚Œ‚_Âý‚ƒ1ƒ8ƒbƒiƒ•ƒœƒÏƒÖƒ„ „C„J„„”„܄ㄅ…U…\……—…Î…Õ…††R†Y†ª†_±†Þ†å†-‡4‡g‡n‡ž‡¥‡Ù‡à‡ˆˆIˆPˆŠˆ‘ˆÖˆÝˆ‰‰W‰^‰’‰™‰Ó‰Ú‰ ŠŠGŠNŠ‘Š_˜ŠÔŠÛŠ ‹‹H‹O‹†‹‹Å‹Ì‹÷‹þ‹/Œ6ŒsŒzŒ£ŒªŒÙŒàŒ]d”ÃÊþŽGŽ_NބދŽÎŽÕŽDK‰ËÒ @G‹’ÊÑp‘w‘­‘Ž‘â‘鑟’Å’õ’ü’:“A“}“_„“œ“Ä“ð·÷·0ž7žpžwž»žÂžðž÷žÙ¹à¹ººMºTºÏºÖº»»A»H»±ŒžŒæŒíŒœ&œWœ_^œ?ŸFŸzŸŸ·ŸŸŸÍ¿Ô¿ ÀÀYÀ`ÀªÀ±ÀýÀÁSÁZÁ‘Á˜ÁÙÁàÁ'Â.Â~…ÂÒÂÙÂÃÃTÃ_[ÜãÃãÃêÃ#Ä*ÄfÄmĚįÄÞÄåÄÅ%ÅzƁÆÀÆÇÆ÷ÆþÆ5Ç<ǃNJǵnjÇñÇøÇ€È‡ÈÄÈ_ËÈ ÉɕɜÉàÉçÉÊÊFÊMÊxÊÊ¿ÊÆÊýÊË7Ë>ËpËwËŠË­ËØËßˋ̓ÌÑÍÙÍÎÎAÎ_VΆΚÎÈÎÚÎ,ÏFϳϻÏÐ&ÐOÑWѲÑÂÑïÒ÷ÒTÓfÓGÔOÔŸÔØÔòÕúÕS×l׍ؕØóØ Ù—Ú_ŸÚ$Û5ÛÜ%ܧ޺Þôàá€ä¬äEåMåŸåÆåJæRæ“æ£æúæçnç…çèè`èfèðèöè}éƒé ê_ê{êêdëlëÈëØëUì]ìµìœìííð#ðåðûðnòòƒò’òjó{óÁõÐõùú û %Â_Úµ Î y ” x‘œž`|J\®ÈXj‡™åúÌÔ-¢%³%\&m&v)‡)Ï*_×*+2+ˆ++™8·8Œ8Ò8<¡<J=[=”@¥@ÑCâCïIýIæLôLJQXQtyy-z:zP{`{«|ž|-}_5}”}€}Ñ}ä}ŸŸžŸ¡Š¡Æ£Ü£yš”šùš©׫ò«`­{­8¯N¯?²U²/ŽEŽ'ž=ž »6»‡Á ÁeÆ_{ÆÒÈÕÈÞÌáÌÔÍ×ÍŽÏžÏÁÐÄаѳÑ\Ò_ÒÊÓÍÓÀÔÃԎַ֪׭ׇًٔڗÚÒÛÕÛ"Ý%ÝÞ_Þ?àCàLáOáfâiâÕãÙãâäåäîåñåZç^çgèjè|éé¿êÃêÌëÏëJìMì–íší£îŠîQïTïéò_ìòßóâó¡õ€õ—öšö+ø.ø!ù$ù™úœúû’û0ý4ý=þ@þ ÿÿúÿýÿèëHK>Aë î G _K  Æ `d 157:69–™dhæé¥©{~z}Z]‡_‹û þ M"Q"E#H#*$-$' '¶'º'g(j(T*W*.,1,°/Ž/É1Ì1<5?5Ú8Ý8Ž:·:h>k>B@_E@DDðEóE J$J&K)K_LbLÒMÕMPPQQþQRWS[SgTkT‰UŒUŠWªWÈXËXìZðZ\_\ý^_ïeóeÝfàfh!h^xbx—yšy{{||£~Š~)€-€ „„ù„ý„÷…ú…U‡Y‡uˆxˆĊ_NJêî؎܎֏ُ3‘7‘S’V’ž”¡”²—¶—ª˜®˜£™Š™üš› œœ.1KŸOŸm p X£\£F€_J€p¥s¥ïŠòŠôšøšªª“«–«”­˜­À®î:°>°ZŽ]Žâ»æ»WŒ[Œ&œ*œ(¿+¿›ÁžÁÕÃÙÊÅ_ÅÆÆÉÆ È ÈøÉüÉòÊöÊÚËÝ˝̡ÌIÍLÍÐÎÓÎXÐ[ÐßÑâÑnÓqÓûÔþÔ„Ö‡Ö:Ø=Ø ÙÙpÙ_sÙLÛOÛ±ÛŽÛmÞqބ߇ßeàsà8á;á·âºâŒãã-æ0æüçèCêFê ìì¹íŒíŽî‘îññøñ_üñIóLóõõÇ÷Ê÷-û0û| ‘•jmÌÐ…ˆÕ Ø " % „ ‡ ã æ üö_úÞá¡¥MPÔ×ux¬¯QT˜›ilÎѰ ³ !!4%8%U&Y&}'_€'+).)u+x+J,M,—.›.2"233ž6»6O8R8h;k; >>€>„>O?S?QATAÄCÇCþEF·G_ºG J£J L€LšMžM‚N…NEOIOñOôOyQ|QSSTTVV W£WVYYY'Z*ZŒZZh\k\Í\_Ð\ ``!a$abbb!bJeMe[g^g0h3hôj÷jákëkšl«lWnZn7o;o¹pŒp:s=suxxx{_{Œ{{r|u|š}ž}g€k€^b؂܂›…Ÿ…†¡†B‡E‡ňȈ•Œ™Œ:=œŽÀŽ““Ÿ“Á“B•_E•™™Ž™ž™0œ3œ¥Ÿ©ŸJ N Æ¢É¢;Š?ŠàŠäŠ\©_©ѬÕ¬v­z­ò¯õ¯Ö³Ú³âŽåŽ#ž'ž¹_¹a»d» ŸŸóŸöŸñ¿ô¿,Ç0ǡǥLJȊȯɳÉ|Ì€ÌsÍwÍíÎñέѱѯҳÒTÓWÓ×ÔÚÔ­Ø_±ØRÙVÙÎÛÑÛAßEßæßêßbâeâÕåÙåzæ~æöèùèiìmìííŠïï^óbóRôVôFõIõÊöÍö¥ú_©úÉûÌûÃÿÇÿ¥š¬¯“–‘”  Õ Ø Ù Ü ³¶vztxrv £ï_ò&*ÁÄÆÉAE_ c ."1"J$M$¬%¯%Ã'Ç'Ë(Î(ô*÷*F.I.e0i011ï1ó1õ2_ø2Z4]4Ÿ5Á5£7§7©8¬8 ::o;r;Œ=¿=È>Ë>Ù?Ý?¢@Š@7A:A¯B²B‹CŽCåEèEÐFÔFH_HNIRIžJ»JÝLàLoOrOnPqPsPvPóSöSNVRV’W•W2Z5Z__€_§_aaòaõaAdDd,e_0epftfªg®gii5k8kÇmÊmÆnÉnËnÎnKrNrŠt©tŸxÁxx{|{í{ð{uxæƒêƒk„o„i…_m…ˇχžˆɈ`‹d‹ύҍëŽîŽ‹’Ž’€“§“«”®”y•}•m–p–N—R—˜˜Š™™››Ÿœ¢œ)ž_,ž²ŸµŸ9¡<¡Á¢Ä¢K€N€Ò¥Õ¥ššâ©æ©««Ú¬ݬ·­º­%°(°ȱ˱Z³]³>µAµ6·9·2¹_5¹(»+»œœŸŸ¿¿­Á°ÁJÃMÃñÄõÄêÇíÇhÊkÊÍÏÐÏ0Ò4ÒµÒ¹ÒßÓãÓ„Ô‡Ô ÖÖ*Ø_-ØÆÙÉÙ,Ü0ÜÑÜÔÜYÞ\Þáá¿áÂáEãHãMæQæ”é˜éììî îZñ^ñKôNôVõYõööù_ùlûpûñûõûýýÀýÃýEÿIÿZ]îñ†Š+.¯²h l    ’ quUYÂ_ÅÈËüÿÑÕÅÈŠ ª Z!]!â"å"o$r$ø%û%„'‡'))W+Z+³0·0é1_ì1·3º3H5K5%6(6|88 ::;;f=i=Y>\>Ô?×?nBqB DDŒEE…HˆHKKjPmPÒR_ÖRWS[ST…T&U)U°VŽVÍXÐX\Z_ZÂ\Æ\g]j]ï^ò^²a¶aWbZbÝcàc×fÛfÉiÍi6l9lyBy‘z”z-}0}‚_‚ò‚ö‚L„O„@…C…ò‡õ‡÷‹û‹ŒQŽaސV’Y’U”X”w–z–gškšܚߚ]¡`¡Σ_Ò£Å€È€Š ŠèŠìŠ§§"©%©,­0­Ñ­Ô­e¯h¯y³}³Ž!Ž·µºµ(º,ºͺкfŒiŒ€ÀƒÀüÃ_ÄóÄöÄ2Æ5ÆiÇmÇJÈNÈPÉTÉbÊeÊÌÌjÐnÐÑ"ÑÌÒÏҍב×2Ø5ØÅÙÉÙÝݝޠÞà_àvâzâãã¬ä¯äééµéžéFëIëð ð ññÂñÅñtówóÐ÷Ô÷…øˆø8ú;únÿqÿÅ_ÕVZy | ± Ž JMŽž†ŠŒ¢ŠÁď“TWÆÊöùˆ‹Â"_Å"Ÿ%£%˜&œ&M'P'ú(þ(Z,],û-þ-Ž0ž0i1l133Ž7’7¬8°8q9t9+;.;Ú?Þ?Ÿ@¢@]B_`BHH¹HŒHeJhJöNúN«O®OGQJQ5V9VAWDWíYðY1\5\i]m]¬_¯_7a:accZe]e'g_+gúgþg7i;izk}kmmÜnßn(q,q?sBsw!w'y*y|‚|‰~Œ~ž¡šƒ«ƒ‡‡ ‰‰PŒ_SŒ[Ž^Ž‘ő̓ϓŒ–¿–ŘȘœœžžQ¡T¡[£^£§ §©©u¬x¬€®ƒ®‘±”±™³œ³ß¶_â¶ëžîžœœ¿¿4Â7Â>ÄAÄ\Ç_ÇgÉjÉŸÌÁÌÈÎËÎáÑäÑìÓïӬׯ׎ٷÙÅàÉàãáçá¥ã_šã åå.æ1æÕçÙç©ê¬êäìçìòíõíDðGðzò~ò§óªóöö¬ù°ùiúlú,ü/üGKÄ_Çåé14äçÃÆÏÓ÷úºœV!Y!‚%…%ì)ð)í*ñ*‚+…+à,ã,œ. .•/_™/:0=0Å1È1Ž3·3†6‰6–8š89 9#;';È;Ë;_=c=±@Ž@HBKBEDHD6F:FÛFÞFrHuH›L_žLíNñNÜOßOhRkR‰TTŠUŽUV"VW„WŸZ¢Z÷[ú[ò`õ`JbMb\h_hŽi·iOmRm§nªnÅq_Èqs sövùvNxQx||\}_}4„7„Œ……<@ٍݍ‘‘““«—¯—Ÿ˜¢˜#›&›@_DAžDžzŸ~Ÿs w ¡¡¢¢¥¢—€š€ƒ§†§–©š©ª“ª4«7«»¬Ÿ¬­®°®›±ž±®³±³TŽXŽñŽ_õŽ··º·«¿¯¿AÄDÄÉÅÌÅÒÊÕÊ`ÌcÌeÒiÒúÒýÒtÔwÔ×ÕÚÕ[Ú_ÚJÛMÛÂÝÅÝäßèßåàéàzá_}áÝâàâ”ä˜ä)å,åŸæ£æ™çœçœìŸìûïþïTòXòéòìòcôgô]õ`õ`ùcù¿üÂü@þCþ‘ • r _u è ë J N ÷ û ) , ¶ ¹ Ø Ü ö ù o r B E y } Z ^ k o ! #! Ò" Õ" % % W( _Z( £* §* Ž+ ž+ i, l, . . B0 E0 3 ‚3 %6 )6 7 7 ¥9 š9 ÿ; < °< Ž< ‰= = Ó? Ö? KB NB 6D 9D œG _ÁG jJ mJ ºK œK M M eN hN ŒO ¿O nQ rQ T T aU eU sW wW šY žY \ \ ²^ µ^ œ_ À_ 7f ;f 1g 5g @h _Dh Ji Ni „j ˆj @n Cn €p šp Ìs Ïs au eu )x ,x Cz Gz u{ x{ , / ’ « ؃ ۃ _… c… z† ~† Έ ш ¯Š _³Š ¡‹ €‹ £Ž §Ž ¶ º ’ ’ œ“ Ÿ“ L• O• ó– ö– ™ ™ Á› ؛ 6€ 9€ OŠ SŠ § § ø§ û§ +© /© ª ª ”¬ _—¬ ¯ “¯ $° '° q± t± [Ž _Ž bµ eµ À· Ä· Už Xž €¹ §¹ vŒ zŒ œ œ VŸ YŸ qÁ uÁ n r à à |Ä Ä •Ç _™Ç :È =È ºÉ œÉ +Í /Í Î Î Ñ Ñ Ó Ó Ô Ô SÕ WÕ XÖ \Ö ~× × ÜØ ߨ ¿Ú ÃÚ åÛ èÛ >Ý AÝ $ß (ß Jà _Mà ªá ­á ã ‘ã ³ä ¶ä æ æ ûç ÿç !é $é ‚ê …ê Ÿì £ì €í ší Êî Íî "ð %ð ò ò ;ó >ó ›ô žô èö ìö ø _ø nù qù Kû Oû qü tü Óý Öý 7 : < D   D H ¬ ° M Q _ b d l Ñ Õ    $ h _l ã ç ” ˜ Ž ‘ _ b å! é! `# c# )$ ,$ F& J& V' Z' ë' î' W) Z) ?+ B+ Œ, Â, Ç0 Ê0 š2 ¬2 –3 _™3 é4 í4 Õ5 Ù5 €7 ž7 £7 ¹7 ®? ±? ÎA ÑA #E 'E ÜF ßF üH ÿH ëK îK MQ kQ pQ †Q lX pX ZY ]Y ÕZ ØZ ñ[ _ô[ ²\ ¶\ ú] þ] ¯^ ²^ —` ›` €e §e h &h Fo Jo 4p 7p •q ™q šr žr :t =t Ôv ×v €y §y Šz ©z R{ U{ | _ | æ| ê| ý} ~ ‚ … ]€ a€ ¬ ¯ ù‚ ƒ ƒ 2ƒ ŒŒ ÀŒ N Q – 7– <– R– š£ ž£ K€ O€ Ѐ Ó€ Š РЧ _ª§ ³š ·š H© K© ¢ª Šª Ÿ¬ Á¬ !® $® †¯ ‰¯ ë° î° $³ '³ µ µ ±¶ µ¶ F· I· €ž šž žº »º Œ Œ €œ ƒœ åŸ _èŸ Á !Á ËÁ ÏÁ @Å CÅ XÇ [Ç ŽÌ ‘Ì ÿÍ Î ñÎ õÎ iÐ lÐ ÃÒ ÆÒ Õ Õ ÁÙ ÅÙ ÕÚ ÙÚ åÛ éÛ šÜ Ü &Þ )Þ +à _.à Šâ ªâ )å ,å é é ‹ì šì õ õ ×õ Ûõ ÷ ÷ Où Rù ü ü ® à ó  5 E œ Ô 8 < > F ñ _õ ó ö   J N P X   e h û ÿ   Ž ·   e% h% Ð' Ó' À. Ã. / / Ì/ Ï/ e7 _i7 x8 {8 À9 Ã9 Œ; À; ·< »< Ó= Ö= !? %? @ -@ ñA õA ¹C ŒC “F –F 5J 8J ëJ ïJ ‡L ŠL O O @Q CQ RR _UR ˜W œW =X AX š[ [ B^ E^ u` y` £a Ša dc gc f f ×g Ûg 'k *k l l +m .m £m §m òn õn Ñp Ôp šr _«r t „t ]v `v !y $y €} „}   è€ ë€ ¿‚ ‚ ʃ ΃ S‡ V‡ ^ˆ aˆ íŒ ðŒ >” A” G• K• – ”– ®— ²— K˜ _O˜ Ÿ™ Á™ »› Ÿ› Œ  µž žž ¥  š  £ £ Ø£ Û£ Ž€ ’€ *Š -Š €š §š Ъ Óª à« ä« Ø¬ Û¬ <­ @­ O® R® é¯ _ì¯ ù² ü² Dµ Gµ ŵ ɵ õ¶ ø¶ ëž îž Ì¹ Ϲ - 0 žÃ ¡Ã óÄ öÄ æÈ éÈ §É «É ¥Ê ©Ê ÃË ÇË `Ì cÌ ÐÍ ÔÍ ¿Ð _ÂÐ ÂÒ ÆÒ ¡Ó €Ó Ü Ü öÝ Þ ¹Þ ÎÞ vß Šß 2ä 6ä Må Qå Ræ Væ ¡ç ¥ç lè pè Ýì áì ší ¬í ‹ò ò µó ¹ó ‚ô _…ô aö dö 1û 5û þû ü Üý ßý 0 4 í ð § ª   Ð Ó ˆ ‹ è ì í ñ ª ­ d g Ë Ï ' _+ ƒ † c f ê í È Ë $ $ ' ' „* ˆ* ®+ ²+ {, ~, T. X. 2 2 Ù3 Ü3 ð6 ô6 œ7 À7 –9 š9 ©= _¬= ˆ? ‹? 9C =C 7F ;F sG vG :K =K fM jM #N &N æO êO ³S ¶S PU SU ìV ïV ªY ®Y gZ jZ *\ -\ š_ ž_ a _ a ‰i Œi n n o $o †p Šp Sq Vq s s ýv w 3x 7x jz mz Â| Å|   :ƒ =ƒ ’… •… õŠ øŠ   ؍ _܍   ^ b 3‘ 6‘ “ “ Ÿ• ¢• ’š –š é› í› Ÿœ Áœ Šž ©ž (¡ +¡ Š Š m§ q§ Bš Eš (ª +ª 𬠫¬ f² _j² k³ o³ (Ž +Ž ïµ óµ 2· 6· ïž òž » » ŠÀ ©À fà ià Æ Æ Ê ƒÊ …Ê Ê @Ë CË Í Í ðÛ ôÛ mÝ pÝ ?ß _Bß sè wè £é Šé |ë €ë Ûò Þò ¬ô ¯ô ãø çø  # q t o r c f † ‰ ã ç   £ [ ^ È Ì Æ _É % ) [ ^ $+ '+ 6 "6 O7 R7 #9 &9 ’: •: ú; ý; 7> ;> µ? ¹? (A +A ‰F F 5H 8H PM SM øP ûP ­V _±V šW W ¯Y ²Y >[ B[ œ] Ÿ] ‘e •e g g c| f| ‘Œ •Œ ~  — š -’ 1’ – – ‚ž …ž š š õš øš « _« Ÿ­ £­ q± t± ê¹ í¹ fà ià pÄ sÄ [Ë _Ë bÌ eÌ ¬Î ¯Î ¯Ð ²Ð tÑ wÑ ãÓ æÓ ŠÔ ªÔ åÕ éÕ ×Ö ÚÖ ¥Ø šØ ¬Ú _°Ú Ü Ü ÝÞ áÞ ²ß ¶ß Oà Rà Iâ Lâ 8é <é Õé Øé Ùë Üë 8ó <ó ô ô Áù Äù —ý žý Òý Ùý þ þ 4þ ;þ û_ Ïæ¶ º   ` c , / " & È Ì  ” ý ¬°cg  03“_–„*.ÃÇŒ  <#@#6$:$]%a%H&L&))Œ*À*Z-]-0!0Ý0_á022Š5Ž5”6˜6É7Ì7š9ž9d<h< ??/B3BaCdC‰EEEHHHÕMØMÚMâM&P*PsPwPÚQ_ÝQBSESšT«TVUYUŒV¿VjWmW7X:X˜Y›Y%[)[­\°\^^ˆ_Œ_2`5`*a-a!b%båcècVe_ZeffÜgßgWiZiVkYkŽo‘o“o›o7s;s„sˆsëtîtSvVv¹wŒwgxjxÍyÐy{z~z:{={ñ{_ô{ö{|r}v}~~e€i€)‚,‚šƒžƒN„R„.†1†ևهÁŠĊŒ„Œüÿðóö’ù’A™_E™Ιљ››x›{›Žœ‘œџ՟r u 0¡3¡5£9£Ë£Σ¥¥©©nªrªöªùªÊ«Ϋ߬㬮_®®…®G°K°Ô±×±³³8µ<µÖµÚµƶɶ@žCžš¹ž¹6º9º]ŒaŒÂŒÆŒ6Ÿ:Ÿ¿¿TÀWÀÁÁ_ÄÁPÃTÃ÷ÄûÄ!Æ$ÆžÈ¡È Ë Ë•Ë˜ËºÍœÍ#Î&Î]ÐaÐ ÑÑÇÑËÑ=Ò@ҌӐӫԮÔ4×7ר_ ضٹيڍÚÜ!ÜÝÝŸÝ¢Ý ß ßÞßáßXá[á,â/â§ã«ãŽä‘ä)å,åßåâåDçHç+è.è›è_žèDêGêëë#ì'ì í íÀíÃíïïðïóïŸò¢òsóvó0õ4õÏõÓõ3÷7÷­÷±÷døgøÉùÌù÷ú_úúïûóûýýsþvþGÿJÿ+*±°†‰ÚÞGK¢¥  – ™ îñ?B03„TˆÓ×.1ŒÊ!Í!f#i#Ê$Í$’%•%€'§'à'ã'`)c)€€€€€€€€€€€·(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)ÿ¶(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)ÿÌ_components_CategoryIcon__WEBPACK_IMPORTED_MODULE_7__/* .CategoryIcon */ .Ezþýýþþþþþýþÿþ¯(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)ÿÿ­(0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)°(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)úúûûûûûúûûúúûüûûûúûûýýýþÿúúúûûûûûúûûúúûûûûûúûû€º(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)¿(0,_lib_auth__WEBPACK_IMPORTED_MODULE_4__/* .useSession */ .wV)Ã(0,_context_locale__WEBPACK_IMPORTED_MODULE_5__/* .useLocale */ .Y)úúüúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúüüœ_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminStats */ .dEÂ_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminNotifStats */ .biÁ_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminMailStats */ .u4¿_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminReports */ .z5Ç_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminSpecialistCards */ .s_÷œ_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminUsers */ .cSöœ_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminTasks */ .YjõüõýõÆ_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminSupportTickets */ .KZôÆ_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminBalanceHistory */ .g0óŸ_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminAiLogs */ .j_Ä_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminActivityLogs */ .yOÀ_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminMailLogs */ .qtÁ_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminNotifLogs */ .Brïïïïœ_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminPlans */ .OXîÄ_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getTranslationsStats */ .YQí»(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .request */ .Em)ÿÿìÁ_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminReferrals */ .cJëüëëëÂ_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .adminBroadcastPush */ .V7Ã_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .adminSendPushToUser */ .g1Ÿ_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .deactivateUser */ .WiŒ_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .activateUser */ .HeŸ_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .changeUserRole */ .MmŒ_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminUser */ .jd¿_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updateAdminUser */ .wlÉ_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .adminUpdateSpecialistCard */ .oqÄ_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .verifyAdminUserEmail */ .uQÅ_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .adminTopUpUserBalance */ .P0íÈ_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .adminWithdrawUserBalance */ .hDìüüçè¿_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .cancelTaskAdmin */ .nf¿_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .deleteTaskAdmin */ .GBÂ_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updateReportStatus */ .eUÝÁ_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminLocations */ .k_Ÿ_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updateLocation */ .NtŸ_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .createLocation */ .yJŸ_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .deleteLocation */ .zRÙÂ_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminCategories */ .KDؘ"https://api.canhelp.gr"0Ÿ_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updateCategory */ .$7Ÿ_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .createCategory */ .zZŸ_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .deleteCategory */ .K7Ÿ_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminSkills */ .i_»_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updateSkill */ .fP»_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .createSkill */ .S9»_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .deleteSkill */ .hpº_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updatePlan */ .tdº_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .createPlan */ .qTߺ_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .deletePlan */ .bRÍÞÀ_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminSettings */ .rCÆ_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminEmailTemplates */ .LpÃ_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updateAdminSettings */ .CXÿÈ_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updateAdminEmailTemplate */ .jgË_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .translateAdminEmailTemplate */ .wcþþýýýýýÆ_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .testTelegramConnection */ .qXÃ_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .verifyTelegramToken */ .clÂÂÂÁÂÂÂÂÂÂÂÁÂÂÂÂÁÂÂÁÂÂÁÂÂÁÂÂÁÂÂÂÂÂÂÂÂÂÂÁÂÂÂÂÂÂÂÁÁÁÂÂÂÁ²(next_link__WEBPACK_IMPORTED_MODULE_3___default())ÁÁÀÁÀÁÁÁÀÁÀÁÁÀÀÁÁÁÀÁÁÁÁÁÁÁÁÀÁÁÁÀÀÁÀÀÁÀÁÀÁÁÀÁÁÀÁÁÁÁÀÀÀÁÀÁÁÀÀÁÀÁÁÀÀÁÀÀÁÀÁÀÀÁÁÀÁÁÀÁÀÁÀÀÀÁÁÀÁÁÁÀÀÁÀÁÁÁÁÁÁÁÁÁÁÁÁÀÁÉ(0,_lib_formatName__WEBPACK_IMPORTED_MODULE_8__/* .formatShortName */ .H)ÀÀÀÀ¿ÀÀÀÀÀ¿ÀÀÀÀÀ¿¿À¿ÀÀÀÀÀ¿¿À¿ÀÀÀÀÀÀÀÀÀÀÀ¿¿ÀÀÀÀ¿À¿ÀÀÀ¿¿¿ÀÀ¿ÀÀ¿¿À¿ÀÀÀÀÀÀÀÀÀÀÀ¿ÀÀþÀÀÀÀÆ(0,_lib_taskLocale__WEBPACK_IMPORTED_MODULE_9__/* .formatPrice */ .$g)¿¿Ÿ¿¿¿ŸŸ¿ŸŸŸŸŸŸ¿¿Ÿ¿¿Ÿ¿¿ŸŸ¿ŸŸ¿ŸŸ¿ŸŸ¿Ÿ¿Ÿ¿¿¿¿¿ŸŸ¿ŸŸŸŸŸŸ¿¿ŸŸ¿ŸŸ¿ŸŸ¿ŸŸ¿ŸŸ¿¿Ÿ¿Ÿ¿¿¿¿¿Ÿ¿¿¿ŸŸŸ¿¿Ÿ¿ýŸŸ¿¿¿Ÿ¿¿¿ŸŸŸ¿¿¿Ÿ¿¿¿¿¿ŸŸ¿¿¿¿ŸŸŸ¿¿¿¿ý¿Ÿ¿¿Ÿ¿¿¿¿ŸŸŸ¿¿¿¿ý¿¿¿Ÿ¿¿ŸŸŸŸÐŸ¿¿¿¿¿Ÿ¿Ÿ¿¿¿¿¿¿¿¿¿¿¿Ÿ¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿Ÿ¿¿¿ŸŸŸ¿Ÿ¿¿Ÿ¿¿Ÿ¿¿ŸŸ¿¿Ÿ¿¿¿¿ŸŸŸ¿Ÿ¿¿Ÿ¿¿Ÿ¿¿ŸŸ¿¿Ÿ¿¿Ÿ¿Ÿ¿¿¿¿¿¿¿Ÿ¿¿¿¿¿¿¿¿¿¿¿¿Ÿ¿¿¿ŸŸŸ¿Ÿ¿¿Ÿ¿¿Ÿ¿¿ŸŸ¿¿Ÿ¿¿Ÿ¿Ÿ¿¿¿¿¿¿Ÿ¿¿¿¿¿¿¿¿¿¿¿¿¿ŸŸŸŸ¿¿¿Ÿ¿ŸŸ¿¿Ÿ¿¿Ÿ¿¿Ÿ¿Ÿ¿¿¿Ÿ¿¿¿ŸŸ¿¿Ÿ¿¿Ÿ¿¿Ÿ¿¿Ÿ¿¿Ÿ¿¿Ÿ¿¿¿ŸŸ¿¿Ÿ¿¿Ÿ¿¿¿¿Ÿ¿¿¿Ÿ¿ŸŸ¿Ÿ¿Ÿ¿¿Ÿ¿¿¿¿¿ŸŸŸ¿¿¿¿ŸŸŸŸŸŸŸŸ¿¿¿Ÿ¿¿¿Ÿ¿óÔ¿¿¿¿Ÿ¿¿Ÿ¿ŸŸ¿¿Ÿ¿¿Ÿ¿¿Ÿ¿¿¿Ÿ¿¿ŸŸŸ¿¿Ÿ¿¿Ÿ¿Ÿ¿¿¿Ÿ¿¿Ÿ¿¿ŸŸ¿¿Ÿ¿¿¿¿œ_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .sendTestEmail */ .FIœŸŸŸœœœœŸœŸŸœŸŸŸœœŸœŸŸœŸŸœœŸŸœŸŸœŸŸœŸŸœŸŸœœŸŸŸŸœœœŸŸŸœŸŸŸŸŸŸŸŸŸŸŸŸŸŸŸŸŸŸŸŸŸŸŸŸŸŸŸŸŸŸŸŸŸŸŸŸŸŸŸœœŸœŸœŸŸŸŸœŸŸœŸŸœŸŸœŸŸŸœŸœŸŸŸœœŸŸœœŸŸŸŸœŸœŸœŸŸŸœŸŸŸœŸŸœœŸŸŸŸŸŸŸŸŸŸŸŸŸŸŸŸŸŸœœŸŸŸœŸŸœŸœœŸŸŸŸœœŸŸŸŸŸœœŸœŸŸŸŸœŸŸŸœŸŸœœŸŸœŸœŸŸŸœŸœŸŸŸŸœŸŸœœŸŸœŸŸŸœœœŸŸŸŸœœŸŸŸŸœŸŸœœœŸŸŸœŸŸŸŸŸœŸœœœœŸŸœœœœœŸœŸœŸœŸŸÆ_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .setSupportTicketStatus */ .u0œŒŒœŒœŒŒœœœœœÄ_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .replyToSupportTicket */ .nTŒ»»Œ»ŒŒ»ŒŒ»Œ»ŒŒ»ŒŒ»»ŒŒ»ŒŒ»ŒŒ»Œ»»ŒŒ»ŒŒ»ŒŒ»ŒŒ»ŒŒ»»ŒŒ»ŒŒ»ŒŒ»ŒŒŒ·react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragmentºººº»ÿºººººº»»º»»ºº»»»Ò»º»ººç0»»º»»»ç0º»»»ºº»º»Òº»ºº»»»»»»º»»º»ç0º»ç0ºº»»ºº»º»»»»»»º»º»»»»»º»»»ºº»»»ººº»»»º»ºÊ_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getTasksTranslationPreview */ .QYº¹ºººÁ_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .autoTranslateTasks */ .IË_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .autoTranslateEmailTemplates */ .fuœ_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .autoTranslate */ .cpͶû¶··¶û··¶û·····¶·¶··¶¶·¶Ï¶···¶····¶¶··¶···¶·¶·¶······¶···¶····¶¶¶¶·······¶···¶·¶····¶·······¶¶¶·¶·¶··Ë_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminUserSpecialistCards */ .vyáݵµµµµµµµµ¶¶µ¶¶µ¶¶µ¶¶µµ¶¶µµ¶¶¶¶¶¶µµ¶µ¶¶µ¶µ¶¶µµ¶¶µ¶µ¶¶¶µ¶¶µ¶¶µµµ¶µµµ¶¶µ¶¶¶¶µµµ¶¶¶µµ¶¶¶µµ¶¶¶µµ¶µµ¶¶¶¶¶µú¶¶µ¶¶µ¶µ¶¶µµ¶¶¶¶µ¶¶µ¶µ¶¶µ¶¶¶¶µµ¶µ¶¶¶µ¶¶µ¶µ¶¶µ¶¶µ¶¶µ¶¶µ¶¶¶¶µ¶¶¶¶¶µµ¶¶µµµµ¶¶µ¶¶µ¶¶žžžžœ_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getSkillDedup */ .GEÄ_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .mergeSkillDuplicates */ .Uqÿ³³ŽŽ³³³ŽŽ³³ŽŽŽ³ŽŽ³³³Ž³³³³Ž³ŽŽ³Ž³³Ž³³³³Ž³ŽŽø³³ŽŽŽŽŽŽŽŽ³ŽŽ³ŽŽ³Ž³ŽŽŽŽŽø³³ŽŽŽŽŽŽŽŽµ³ŽŽ³Ž³³ŽŽŽŽŽŽŽ³Ž³ŽŽ³ŽŽ³ŽŽ³³Ž³³Ž³³ŽŽ³³ŽŽ³Ž³³³ŽŽŽ³³ŽŽŽŽŽŽ³³³Ž³ŽŽŽŽŽ³ŽŽŽŽŽŽ³ŽŽŽ³ŽŽŽŽ³ŽŽŽŽŽŽ³³³³ŽŽŽ³ŽŽŽ°(/* unused pure expression or super */ null && (‚))²±±²²²²²²±±²²²²²²²²²É Ÿ__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ AdminPage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7541); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(9664); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(next_link__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(1592); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(9906); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(2982); /* harmony import */ var _lib_formatName__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(1258); /* harmony import */ var _lib_taskLocale__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(4017); /* harmony import */ var _components_CategoryIcon__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(5940); /* __next_internal_client_entry_do_not_use__ default auto */ const TEMPLATE_VARS = { 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' ] }; const TEMPLATE_HINT_VARS = Array.from(new Set(Object.values(TEMPLATE_VARS).flat())); const DEFAULT_CATEGORY_ICON_PRESETS = [ { 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 getCatLabel(row, locale) { if (!row) return ''; if (locale === 'en') return row.namesEn || row.namesEl || row.slug || ''; if (locale === 'ru') return row.namesRu || row.namesEl || row.slug || ''; if (locale === 'uk') return row.namesUk || row.namesEl || row.slug || ''; return row.namesEl || row.namesEn || row.slug || ''; } function getLocLabel(row, locale) { if (!row) return ''; if (locale === 'en') return row.nameEn || row.nameEl || row.slug || ''; if (locale === 'ru') return row.nameRu || row.nameEl || row.slug || ''; if (locale === 'uk') return row.nameUk || row.nameEl || row.slug || ''; return row.nameEl || row.nameEn || row.slug || ''; } function CategoryIconPicker(param) { let { value, onChange, onUpload, uploading, error, presets } = param; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-3 rounded-xl border border-gray-200 bg-white px-3 py-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex h-12 w-12 items-center justify-center rounded-lg bg-green-50", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components_CategoryIcon__WEBPACK_IMPORTED_MODULE_7__/* .CategoryIcon */ .Ez, { icon: value, alt: "category icon", className: "h-9 w-9 object-contain text-3xl leading-none", fallback: "\uD83D\uDCE6" }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: value, onChange: (e)=>onChange(e.target.value), className: "flex-1 border-0 bg-transparent p-0 text-sm outline-none ring-0", placeholder: "/category-icons/package.svg" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "inline-flex cursor-pointer items-center rounded-lg border px-3 py-1.5 text-xs font-medium transition ".concat(uploading ? 'border-gray-200 bg-gray-100 text-gray-400' : 'border-green-300 bg-green-50 text-green-700 hover:bg-green-100'), children: [ uploading ? 'Uploading...' : 'Upload SVG', /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "file", accept: ".svg,image/svg+xml", className: "hidden", disabled: uploading, onChange: async (e)=>{ var _e_target_files; const file = (_e_target_files = e.target.files) === null || _e_target_files === void 0 ? void 0 : _e_target_files[0]; if (!file) return; await onUpload(file); e.target.value = ''; } }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-xs text-gray-500", children: "or choose from presets" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-[11px] text-gray-500", children: "Preset source: /public/category-icons/presets.json" }), error ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-red-600", children: error }) : null, /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "grid grid-cols-2 gap-2 sm:grid-cols-3 lg:grid-cols-4", children: presets.map((preset)=>{ const active = value === preset.value; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { type: "button", onClick: ()=>onChange(preset.value), className: "flex h-20 flex-col items-center justify-center gap-1 rounded-lg border px-2 transition ".concat(active ? 'border-green-500 bg-green-50 shadow-sm' : 'border-gray-200 bg-white hover:border-green-300 hover:bg-green-50'), "aria-label": preset.label, title: preset.label, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components_CategoryIcon__WEBPACK_IMPORTED_MODULE_7__/* .CategoryIcon */ .Ez, { icon: preset.value, alt: preset.label, className: "h-8 w-8 object-contain text-3xl leading-none", fallback: "\uD83D\uDCE6" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "max-w-full truncate text-[11px] font-medium text-gray-600 leading-tight", children: preset.label }) ] }, preset.value); }) }) ] }); } function AdminCatPicker(param) { let { catRows, locale, selected, onAdd, addLabel } = param; const [open, setOpen] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [search, setSearch] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [expandedParent, setExpandedParent] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const ref = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ function h(e) { if (ref.current && !ref.current.contains(e.target)) { setOpen(false); setSearch(''); } } document.addEventListener('mousedown', h); return ()=>document.removeEventListener('mousedown', h); }, []); const parents = catRows.filter((r)=>!r.parentId); const lowerSearch = search.toLowerCase(); const matchesSearch = (r)=>{ var _r_slug; return !search || getCatLabel(r, locale).toLowerCase().includes(lowerSearch) || ((_r_slug = r.slug) !== null && _r_slug !== void 0 ? _r_slug : '').toLowerCase().includes(lowerSearch); }; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "relative", ref: ref, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { type: "button", onClick: ()=>setOpen((v)=>!v), className: "w-full flex items-center gap-1.5 px-3 py-1.5 text-xs transition-colors ".concat(open ? '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: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4 6h16M4 10h16M4 14h16M4 18h16" }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "flex-1 text-left truncate", children: addLabel }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3 h-3 text-gray-400 shrink-0 transition-transform ".concat(open ? 'rotate-180' : ''), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19 9l-7 7-7-7" }) }) ] }), open && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "sticky top-0 bg-white px-3 py-2 border-b border-gray-100", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { autoFocus: true, value: search, onChange: (e)=>setSearch(e.target.value), placeholder: "ППОск...", className: "w-full text-xs border border-gray-200 rounded-lg px-2.5 py-1.5 focus:outline-none focus:ring-2 focus:ring-blue-300" }) }), parents.map((parent)=>{ const children = catRows.filter((r)=>r.parentId === parent.id); const parentLabel = getCatLabel(parent, locale); const isExpanded = expandedParent === parent.id; const matchingChildren = children.filter((c)=>!selected.includes(c.slug) && matchesSearch(c)); const parentAvail = !selected.includes(parent.slug) && matchesSearch(parent); const hasChildren = children.length > 0; if (!parentAvail && matchingChildren.length === 0 && search) return null; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: ()=>{ if (hasChildren && !search) { setExpandedParent(isExpanded ? null : parent.id); } else if (parentAvail) { onAdd(parent.slug); setOpen(false); setSearch(''); } }, children: [ parent.icon ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components_CategoryIcon__WEBPACK_IMPORTED_MODULE_7__/* .CategoryIcon */ .Ez, { icon: parent.icon, alt: parentLabel, className: "h-5 w-5 shrink-0 object-contain text-sm leading-none", fallback: "\uD83D\uDCE6" }) : null, /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "flex-1 font-medium", children: parentLabel }), hasChildren && !search ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3.5 h-3.5 text-gray-400 shrink-0 transition-transform ".concat(isExpanded ? 'rotate-90' : ''), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 5l7 7-7 7" }) }) : null ] }), (isExpanded || !!search) && matchingChildren.map((child)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: ()=>{ onAdd(child.slug); setOpen(false); setSearch(''); }, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "w-1.5 h-1.5 rounded-full bg-gray-300 shrink-0" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "flex-1", children: getCatLabel(child, locale) }) ] }, child.id)) ] }, parent.id); }) ] }) ] }); } function AdminLocPicker(param) { let { locRows, locale, selected, onAdd, addLabel } = param; const [open, setOpen] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [search, setSearch] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [expandedCity, setExpandedCity] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const ref = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ function h(e) { if (ref.current && !ref.current.contains(e.target)) { setOpen(false); setSearch(''); } } document.addEventListener('mousedown', h); return ()=>document.removeEventListener('mousedown', h); }, []); const cities = locRows.filter((r)=>!r.parentId); const lowerSearch = search.toLowerCase(); const matchesSearch = (r)=>{ var _r_slug; return !search || getLocLabel(r, locale).toLowerCase().includes(lowerSearch) || ((_r_slug = r.slug) !== null && _r_slug !== void 0 ? _r_slug : '').toLowerCase().includes(lowerSearch); }; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "relative", ref: ref, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { type: "button", onClick: ()=>setOpen((v)=>!v), className: "w-full flex items-center gap-1.5 px-3 py-1.5 text-xs transition-colors ".concat(open ? '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: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 11a3 3 0 11-6 0 3 3 0 016 0z" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "flex-1 text-left truncate", children: addLabel }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3 h-3 text-gray-400 shrink-0 transition-transform ".concat(open ? 'rotate-180' : ''), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19 9l-7 7-7-7" }) }) ] }), open && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "sticky top-0 bg-white px-3 py-2 border-b border-gray-100", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { autoFocus: true, value: search, onChange: (e)=>setSearch(e.target.value), placeholder: "ППОск...", className: "w-full text-xs border border-gray-200 rounded-lg px-2.5 py-1.5 focus:outline-none focus:ring-2 focus:ring-blue-300" }) }), cities.map((city)=>{ const districts = locRows.filter((r)=>r.parentId === city.id); const cityLabel = getLocLabel(city, locale); const isExpanded = expandedCity === city.id; const hasDistricts = districts.length > 0; const matchingDistricts = districts.filter((d)=>!selected.includes(d.slug) && matchesSearch(d)); const cityAvail = !selected.includes(city.slug) && matchesSearch(city); if (!cityAvail && matchingDistricts.length === 0 && search) return null; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: ()=>{ if (hasDistricts && !search) { setExpandedCity(isExpanded ? null : city.id); } else if (cityAvail) { onAdd(city.slug); setOpen(false); setSearch(''); } }, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3 h-3 text-gray-300 shrink-0", fill: "currentColor", viewBox: "0 0 24 24", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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" }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "flex-1 font-medium", children: cityLabel }), hasDistricts && !search ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3.5 h-3.5 text-gray-400 shrink-0 transition-transform ".concat(isExpanded ? 'rotate-90' : ''), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 5l7 7-7 7" }) }) : null ] }), (isExpanded || !!search) && matchingDistricts.map((d)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: ()=>{ onAdd(d.slug); setOpen(false); setSearch(''); }, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "w-1.5 h-1.5 rounded-full bg-gray-300 shrink-0" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "flex-1", children: getLocLabel(d, locale) }) ] }, d.id)) ] }, city.id); }) ] }) ] }); } function AdminPage() { var _session_user, _stats_tokensByMonth; const router = (0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)(); const { data: session, isPending } = (0,_lib_auth__WEBPACK_IMPORTED_MODULE_4__/* .useSession */ .wV)(); const { t, locale } = (0,_context_locale__WEBPACK_IMPORTED_MODULE_5__/* .useLocale */ .Y)(); const [tab, setTab] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)('stats'); const [sidebarCollapsed, setSidebarCollapsed] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ setSidebarCollapsed(window.innerWidth < 1024); }, []); // Stats const [stats, setStats] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); // Users const [users, setUsers] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [usersPage, setUsersPage] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(1); const [usersTotal, setUsersTotal] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(0); const [usersQ, setUsersQ] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [usersQInput, setUsersQInput] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [usersRole, setUsersRole] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); // Tasks const [tasks, setTasks] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [tasksPage, setTasksPage] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(1); const [tasksTotal, setTasksTotal] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(0); const [tasksQ, setTasksQ] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [tasksQInput, setTasksQInput] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [tasksStatus, setTasksStatus] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); // Reports const [reports, setReports] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [reportsPage, setReportsPage] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(1); const [reportsTotal, setReportsTotal] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(0); const [pendingReportsCount, setPendingReportsCount] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(0); // Specialist card moderation const [moderationCards, setModerationCards] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [moderationCardsPage, setModerationCardsPage] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(1); const [moderationCardsTotal, setModerationCardsTotal] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(0); const [moderationCardsLoading, setModerationCardsLoading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [pendingCardsCount, setPendingCardsCount] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(0); // Support tickets const [supportTickets, setSupportTickets] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [supportPage, setSupportPage] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(1); const [supportTotal, setSupportTotal] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(0); const [supportStatus, setSupportStatus] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [supportType, setSupportType] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [supportQ, setSupportQ] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [supportQInput, setSupportQInput] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [supportReplyId, setSupportReplyId] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [supportReplyText, setSupportReplyText] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [supportReplySaving, setSupportReplySaving] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); // AI Logs const [logs, setLogs] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [logsPage, setLogsPage] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(1); const [logsTotal, setLogsTotal] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(0); // Activity Logs const [activityLog, setActivityLog] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [activityTotal, setActivityTotal] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(0); const [activityPage, setActivityPage] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(1); const [activityEvent, setActivityEvent] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [activityUserId, setActivityUserId] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [activityDateFrom, setActivityDateFrom] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [activityDateTo, setActivityDateTo] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [activityEventTypes, setActivityEventTypes] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); // Mail Logs const [mailLog, setMailLog] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [mailTotal, setMailTotal] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(0); const [mailPage, setMailPage] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(1); const [mailEvent, setMailEvent] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [mailDateFrom, setMailDateFrom] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [mailDateTo, setMailDateTo] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [mailEventTypes, setMailEventTypes] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); // Logs sub-tab const [logsSubTab, setLogsSubTab] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)('ai'); // Notification Logs const [notifLogs, setNotifLogs] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [notifLogsPage, setNotifLogsPage] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(1); const [notifLogsTotal, setNotifLogsTotal] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(0); const [notifLogsType, setNotifLogsType] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [notifLogsTypes, setNotifLogsTypes] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [notifLogsDateFrom, setNotifLogsDateFrom] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [notifLogsDateTo, setNotifLogsDateTo] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); // Notification stats chart const [notifsByDay, setNotifsByDay] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [mailByDay, setMailByDay] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); // Balance archive const [balanceRows, setBalanceRows] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [balanceTotal, setBalanceTotal] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(0); const [balancePage, setBalancePage] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(1); const [balanceUserId, setBalanceUserId] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [balanceKind, setBalanceKind] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [topUpSaving, setTopUpSaving] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [withdrawSaving, setWithdrawSaving] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); // User edit modal const [editUser, setEditUser] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [editUserSaving, setEditUserSaving] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [verifyingEmail, setVerifyingEmail] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [editUserTab, setEditUserTab] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)('profile'); const [balanceModal, setBalanceModal] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [skillInput, setSkillInput] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [editUserCards, setEditUserCards] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [editUserCardsLoading, setEditUserCardsLoading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [cardSkillInputs, setCardSkillInputs] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)({}); const [cardSaving, setCardSaving] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)({}); const [cardCatSelects, setCardCatSelects] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)({}); const [cardLocSelects, setCardLocSelects] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)({}); // Plans const [planRows, setPlanRows] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [planForm, setPlanForm] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [planSaving, setPlanSaving] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); // Locations const [locRows, setLocRows] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [locForm, setLocForm] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [locSaving, setLocSaving] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [locExpanded, setLocExpanded] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(new Set()); // Categories const [catRows, setCatRows] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [catForm, setCatForm] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [catSaving, setCatSaving] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [catExpanded, setCatExpanded] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(new Set()); const [catIconUploading, setCatIconUploading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [catIconError, setCatIconError] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [categoryIconPresets, setCategoryIconPresets] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(DEFAULT_CATEGORY_ICON_PRESETS); // Category Skills const [catSkillsExpanded, setCatSkillsExpanded] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(new Set()); const [catSkillsCache, setCatSkillsCache] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)({}); const [catSkillsLoading, setCatSkillsLoading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(new Set()); const [skillForm, setSkillForm] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [skillSaving, setSkillSaving] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); // Settings const [settingsTab, setSettingsTab] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)('general'); const [generalForm, setGeneralForm] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)({ siteName: 'CanHelp', siteUrl: '', contactEmail: '', supportPhone: '' }); const [generalSaving, setGeneralSaving] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [generalSaved, setGeneralSaved] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [smtpForm, setSmtpForm] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)({ host: '', port: '587', username: '', password: '', fromName: 'CanHelp', fromEmail: '', encryption: 'tls' }); const [smtpSaving, setSmtpSaving] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [smtpSaved, setSmtpSaved] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [testEmailSending, setTestEmailSending] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [testEmailResult, setTestEmailResult] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [notifTemplates, setNotifTemplates] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)({ email_verification: { subject: 'ППЎтверЎОте ваш email — {{siteName}}', body: '' }, registration_success: { subject: 'ДПбрП пПжалПвать в {{siteName}}!', body: '' }, password_reset: { subject: 'ВПсстаМПвлеМОе парПля — {{siteName}}', body: '' }, new_offer: { subject: 'НПвПе преЎлПжеМОе пП вашей заЎаче «{{taskTitle}}»', body: '' }, new_task: { subject: 'НПвая заЎача: {{taskTitle}}', body: '' }, offer_accepted: { subject: 'Ваше преЎлПжеМОе прОМятП: {{taskTitle}}', body: '

Ваше преЎлПжеМОе прОМятП! 🎉

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

ЗаказчОк прОМял ваше преЎлПжеМОе Ма выпПлМеМОе заЎачО:

{{taskTitle}}

СуЌЌа: {{price}}€

Открыть чат →' }, new_message: { subject: 'НПвПе сППбщеМОе Пт {{senderName}}', body: '

НПвПе сППбщеМОе

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

ВаЌ МапОсал(а) {{senderName}}:

"{{preview}}"

ОтветОть →' }, offer_declined: { subject: 'Ваше преЎлПжеМОе ПтклПМеМП: {{taskTitle}}', body: '

Ваше преЎлПжеМОе ПтклПМеМП

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

К сПжалеМОю, заказчОк ПтклПМОл ваше преЎлПжеМОе Ма:

{{taskTitle}}

НайтО ЎругОе заказы →' }, offer_other_accepted: { subject: 'ВыбраМ ЎругПй ОспПлМОтель: {{taskTitle}}', body: '

ВыбраМ ЎругПй ОспПлМОтель

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

ЗаказчОк выбрал ЎругПгП ОспПлМОтеля Ўля заЎаМОя:

{{taskTitle}}

НайтО ЎругОе заказы →' }, task_updated: { subject: 'ЗаЎаМОе ПбМПвлеМП: {{taskTitle}}', body: '

ЗаЎаМОе ПбМПвлеМП

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

ЗаказчОк ПбМПвОл ЎеталО заЎаМОя:

{{taskTitle}}

СЌПтреть заказ →' }, deadline_reminder: { subject: 'ЗаЎаМОе Остекает завтра: {{taskTitle}}', body: '

НапПЌОМаМОе П ЎеЎлайМе

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

Ваше заЎаМОе Остекает через 24 часа. ОбМПвОте ЎеЎлайМ, ОМаче заЎаМОе буЎет автПЌатОческО сМятП с публОкацОО.

{{taskTitle}}

РеЎактОрПвать заЎаМОе →' }, task_archived: { subject: 'ЗаЎаМОе сМятП с публОкацОО: {{taskTitle}}', body: '

ЗаЎаМОе перевеЎеМП в черМПвОк

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

Ваше заЎаМОе ОстеклП О былП автПЌатОческО перевеЎеМП в черМПвОк. ОбМПвОте ЎеЎлайМ, чтПбы ПпублОкПвать егП сМПва.

{{taskTitle}}

РеЎактОрПвать заЎаМОе →' }, referral_reward: { subject: 'Вы пПлучОлО реферальМую МаграЎу — {{siteName}}', body: '

Вы пПлучОлО реферальМую МаграЎу! 🎁

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

Друг зарегОстрОрПвался пП вашей реферальМПй ссылке. На ваш аккауМт ЎПбавлеМП {{days}} ЎМей ЎПступа к плаМу {{planName}}!

+{{days}} ЎМей — {{planName}}

ПерейтО к аккауМту →' }, referral_reward_el: { subject: 'Λάβατε αΜταΌοιβή παραποΌπής — {{siteName}}', body: '

Λάβατε αΜταΌοιβή παραποΌπής! 🎁

Γεια {{userName}},

ΈΜας φίλος εγγράφηκε χρησιΌοποιώΜτας τοΜ σύΜΎεσΌο παραποΌπής σας. ΣτοΜ λογαριασΌό σας προστέΞηκαΜ {{days}} ηΌέρες πρόσβασης στο πλάΜο {{planName}}!

+{{days}} ηΌέρες — {{planName}}

Δες τοΜ λογαριασΌό σου →' }, referral_reward_en: { subject: 'You received a referral reward — {{siteName}}', body: '

You received a referral reward! 🎁

Hi {{userName}},

A friend registered using your referral link. {{days}} days of {{planName}} access have been added to your account!

+{{days}} days — {{planName}}

View your account →' }, referral_reward_ru: { subject: 'Вы пПлучОлО реферальМую МаграЎу — {{siteName}}', body: '

Вы пПлучОлО реферальМую МаграЎу! 🎁

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

Друг зарегОстрОрПвался пП вашей реферальМПй ссылке. На ваш аккауМт ЎПбавлеМП {{days}} ЎМей ЎПступа к плаМу {{planName}}!

+{{days}} ЎМей — {{planName}}

ПерейтО к аккауМту →' } }); const [editingTemplate, setEditingTemplate] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [templateLocale, setTemplateLocale] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)('el'); const [templateSaving, setTemplateSaving] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [templateTranslating, setTemplateTranslating] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [ePayForm, setEPayForm] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)({ merchantId: '', apiUser: '', apiPassword: '', environment: 'test', confirmationUrl: '', cancelUrl: '', enabled: false }); const [ePaySaving, setEPaySaving] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [ePaySaved, setEPaySaved] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [referralForm, setReferralForm] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)({ enabled: false, planId: '', days: '30' }); const [referralSaving, setReferralSaving] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [referralSaved, setReferralSaved] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [seoForm, setSeoForm] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)({ maintenanceMode: false, indexingEnabled: true, headScripts: '', siteTitleEl: '', siteTitleEn: '', siteTitleRu: '', siteTitleUk: '', siteDescriptionEl: '', siteDescriptionEn: '', siteDescriptionRu: '', siteDescriptionUk: '' }); const [seoSaving, setSeoSaving] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [seoSaved, setSeoSaved] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [seoLangTab, setSeoLangTab] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)('el'); const [socialForm, setSocialForm] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)({ telegram: '', instagram: '', facebook: '', twitter: '', youtube: '', tiktok: '', whatsapp: '', viber: '' }); const [socialSaving, setSocialSaving] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [socialSaved, setSocialSaved] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [telegramForm, setTelegramForm] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)({ botToken: '', adminChatId: '', channelIdEl: '', channelIdEn: '', channelIdRu: '', channelIdUk: '', notifyRegistrations: false, postNewTasks: false }); const [telegramSaving, setTelegramSaving] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [telegramSaved, setTelegramSaved] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [testingTelegramAdmin, setTestingTelegramAdmin] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [testingTelegramChannel, setTestingTelegramChannel] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [testResultTelegramAdmin, setTestResultTelegramAdmin] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [testResultTelegramChannel, setTestResultTelegramChannel] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [testingLocale, setTestingLocale] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [testResultChannels, setTestResultChannels] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)({}); const [verifyingTelegramToken, setVerifyingTelegramToken] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [verifyResultTelegramToken, setVerifyResultTelegramToken] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); // Backup const [backupAutoEnabled, setBackupAutoEnabled] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [backupAutoSaving, setBackupAutoSaving] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [backupTables, setBackupTables] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [backupTablesLoading, setBackupTablesLoading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [backupStoredFiles, setBackupStoredFiles] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [backupExporting, setBackupExporting] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [backupImporting, setBackupImporting] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [backupRestoring, setBackupRestoring] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [backupMsg, setBackupMsg] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [backupMsgError, setBackupMsgError] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const setBackupSuccess = (msg)=>{ setBackupMsg(msg); setBackupMsgError(false); }; const setBackupError = (msg)=>{ setBackupMsg(msg); setBackupMsgError(true); }; // ─── Translations state ─────────────────────────────────────────────────── const [transStats, setTransStats] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [transStatsLoading, setTransStatsLoading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [transLang, setTransLang] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)('uk'); const [transFromLang, setTransFromLang] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)('el'); const [transTableTranslating, setTransTableTranslating] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)({}); const [transMsg, setTransMsg] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [transPreview, setTransPreview] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); // ─── Referrals state ───────────────────────────────────────────────────── const [referralsData, setReferralsData] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [referralsLoading, setReferralsLoading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [referralsExpanded, setReferralsExpanded] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(new Set()); // ─── Push state ────────────────────────────────────────────────────────── const [pushMode, setPushMode] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)('broadcast'); const [pushTargetUserId, setPushTargetUserId] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [pushTitle, setPushTitle] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [pushBody, setPushBody] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [pushType, setPushType] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)('general'); const [pushReferenceId, setPushReferenceId] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [pushOnlyActive, setPushOnlyActive] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(true); const [pushSending, setPushSending] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [pushResult, setPushResult] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [pushError, setPushError] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [loading, setLoading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const isAdmin = !isPending && session && ((_session_user = session.user) === null || _session_user === void 0 ? void 0 : _session_user.role) === 'admin'; (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ var _session_user; if (!isPending && !session) router.push('/login'); if (!isPending && session && ((_session_user = session.user) === null || _session_user === void 0 ? void 0 : _session_user.role) !== 'admin') router.push('/'); }, [ session, isPending ]); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!isAdmin) return; _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminStats */ .dE().then(setStats).catch(()=>{}); _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminNotifStats */ .bi().then(setNotifsByDay).catch(()=>{}); _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminMailStats */ .u4().then(setMailByDay).catch(()=>{}); _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminReports */ .z5(1, 'pending').then((d)=>setPendingReportsCount(d.total)).catch(()=>{}); _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminSpecialistCards */ .s_(1, 'pending').then((d)=>setPendingCardsCount(d.total)).catch(()=>{}); }, [ isAdmin ]); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!isAdmin || tab !== 'users') return; setLoading(true); _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminUsers */ .cS(usersPage, usersQ || undefined, usersRole || undefined).then((d)=>{ setUsers(d.data); setUsersTotal(d.total); }).catch(()=>{}).finally(()=>setLoading(false)); }, [ isAdmin, tab, usersPage, usersQ, usersRole ]); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!isAdmin || tab !== 'tasks') return; setLoading(true); _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminTasks */ .Yj(tasksPage, tasksQ || undefined, tasksStatus || undefined).then((d)=>{ setTasks(d.data); setTasksTotal(d.total); }).catch(()=>{}).finally(()=>setLoading(false)); }, [ isAdmin, tab, tasksPage, tasksQ, tasksStatus ]); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!isAdmin || tab !== 'reports') return; setLoading(true); _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminReports */ .z5(reportsPage).then((d)=>{ setReports(d.data); setReportsTotal(d.total); }).catch(()=>{}).finally(()=>setLoading(false)); }, [ isAdmin, tab, reportsPage ]); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!isAdmin || tab !== 'moderation') return; setModerationCardsLoading(true); _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminSpecialistCards */ .s_(moderationCardsPage, 'review').then((d)=>{ setModerationCards(d.data); setModerationCardsTotal(d.total); }).catch(()=>{}).finally(()=>setModerationCardsLoading(false)); }, [ isAdmin, tab, moderationCardsPage ]); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!isAdmin || tab !== 'support') return; setLoading(true); const params = { page: String(supportPage), limit: '30' }; if (supportStatus) params.status = supportStatus; if (supportType) params.type = supportType; if (supportQ) params.q = supportQ; _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminSupportTickets */ .KZ(params).then((d)=>{ setSupportTickets(d.data); setSupportTotal(d.total); }).catch(()=>{}).finally(()=>setLoading(false)); }, [ isAdmin, tab, supportPage, supportStatus, supportType, supportQ ]); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!isAdmin || tab !== 'balances') return; setLoading(true); _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminBalanceHistory */ .g0({ page: balancePage, userId: balanceUserId || undefined, kind: balanceKind || undefined }).then((d)=>{ setBalanceRows(d.data); setBalanceTotal(d.total); }).catch(()=>{}).finally(()=>setLoading(false)); }, [ isAdmin, tab, balancePage, balanceUserId, balanceKind ]); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!isAdmin || tab !== 'logs') return; if (logsSubTab === 'ai') { setLoading(true); _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminAiLogs */ .j_(logsPage).then((d)=>{ setLogs(d.data); setLogsTotal(d.total); }).catch(()=>{}).finally(()=>setLoading(false)); } else if (logsSubTab === 'activity') { _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminActivityLogs */ .yO({ page: activityPage, event: activityEvent || undefined, userId: activityUserId || undefined, dateFrom: activityDateFrom || undefined, dateTo: activityDateTo || undefined }).then((d)=>{ var _d_eventTypes; setActivityLog(d.data); setActivityTotal(d.total); if ((_d_eventTypes = d.eventTypes) === null || _d_eventTypes === void 0 ? void 0 : _d_eventTypes.length) setActivityEventTypes(d.eventTypes); }).catch(()=>{}); } else if (logsSubTab === 'mail') { _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminMailLogs */ .qt({ page: mailPage, event: mailEvent || undefined, dateFrom: mailDateFrom || undefined, dateTo: mailDateTo || undefined }).then((d)=>{ var _d_eventTypes; setMailLog(d.data); setMailTotal(d.total); if ((_d_eventTypes = d.eventTypes) === null || _d_eventTypes === void 0 ? void 0 : _d_eventTypes.length) setMailEventTypes(d.eventTypes); }).catch(()=>{}); } else if (logsSubTab === 'notifications') { _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminNotifLogs */ .Br({ page: notifLogsPage, type: notifLogsType || undefined, dateFrom: notifLogsDateFrom || undefined, dateTo: notifLogsDateTo || undefined }).then((d)=>{ var _d_notifTypes; setNotifLogs(d.data); setNotifLogsTotal(d.total); if ((_d_notifTypes = d.notifTypes) === null || _d_notifTypes === void 0 ? void 0 : _d_notifTypes.length) setNotifLogsTypes(d.notifTypes); }).catch(()=>{}); } }, [ isAdmin, tab, logsSubTab, logsPage, activityPage, activityEvent, activityUserId, activityDateFrom, activityDateTo, mailPage, mailEvent, mailDateFrom, mailDateTo, notifLogsPage, notifLogsType, notifLogsDateFrom, notifLogsDateTo ]); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ setActivityPage(1); }, [ activityEvent, activityUserId, activityDateFrom, activityDateTo ]); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ setMailPage(1); }, [ mailEvent, mailDateFrom, mailDateTo ]); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ setNotifLogsPage(1); }, [ notifLogsType, notifLogsDateFrom, notifLogsDateTo ]); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!isAdmin || tab !== 'plans') return; _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminPlans */ .OX().then(setPlanRows).catch(()=>{}); }, [ isAdmin, tab ]); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!isAdmin || tab !== 'translations') return; setTransStatsLoading(true); _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getTranslationsStats */ .YQ().then((d)=>setTransStats(d.tables)).catch(()=>{}).finally(()=>setTransStatsLoading(false)); }, [ isAdmin, tab ]); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!isAdmin || tab !== 'backup') return; (0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .request */ .Em)('/admin/backup/settings').then((d)=>setBackupAutoEnabled(!!d.autoEnabled)).catch(()=>{}); setBackupTablesLoading(true); (0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .request */ .Em)('/admin/backup/tables').then((d)=>setBackupTables(d.tables || [])).catch(()=>{}).finally(()=>setBackupTablesLoading(false)); (0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .request */ .Em)('/admin/backup/list').then((d)=>setBackupStoredFiles(d.files || [])).catch(()=>{}); }, [ isAdmin, tab ]); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!isAdmin || tab !== 'referrals') return; setReferralsLoading(true); _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminReferrals */ .cJ().then((d)=>setReferralsData(d)).catch(()=>{}).finally(()=>setReferralsLoading(false)); }, [ isAdmin, tab ]); // Load plans when users tab opens (for plan selector in edit modal) (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!isAdmin || tab !== 'users') return; if (planRows.length === 0) _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminPlans */ .OX().then(setPlanRows).catch(()=>{}); }, [ isAdmin, tab ]); // Reset page when filters change (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ setUsersPage(1); }, [ usersQ, usersRole ]); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ setTasksPage(1); }, [ tasksQ, tasksStatus ]); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ setBalancePage(1); }, [ balanceUserId, balanceKind ]); async function sendAdminPush() { if (!pushTitle.trim()) return; if (pushMode === 'user' && !pushTargetUserId.trim()) { setPushError('УкажОте ID пПльзПвателя'); return; } setPushSending(true); setPushError(null); setPushResult(null); try { const payload = { title: pushTitle.trim(), body: pushBody.trim() || undefined, type: pushType.trim() || undefined, referenceId: pushReferenceId.trim() || undefined }; if (pushMode === 'broadcast') { const res = await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .adminBroadcastPush */ .V7({ ...payload, onlyActive: pushOnlyActive }); setPushResult(res); } else { const res = await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .adminSendPushToUser */ .g1(pushTargetUserId.trim(), payload); setPushResult(res); } } catch (err) { setPushError((err === null || err === void 0 ? void 0 : err.message) || 'Не уЎалПсь ПтправОть push'); } finally{ setPushSending(false); } } async function toggleUser(id, isActive) { const fn = isActive ? _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .deactivateUser */ .Wi : _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .activateUser */ .He; const updated = await fn(id).catch(()=>null); if (updated) setUsers((prev)=>prev.map((u)=>u.id === id ? updated : u)); } async function changeRole(id, role) { const updated = await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .changeUserRole */ .Mm(id, role).catch(()=>null); if (updated) setUsers((prev)=>prev.map((u)=>u.id === id ? updated : u)); } function openEditUser(u) { setEditUserTab('profile'); setSkillInput(''); setBalanceModal(null); setEditUserCards([]); setCardSkillInputs({}); setCardSaving({}); setCardCatSelects({}); setCardLocSelects({}); setEditUser({ ...u, topUpAmount: '', topUpDescription: '', withdrawAmount: '', withdrawDescription: '' }); _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminUser */ .jd(u.id).then((fresh)=>setEditUser((prev)=>prev && prev.id === fresh.id ? { ...fresh, topUpAmount: '', topUpDescription: '', withdrawAmount: '', withdrawDescription: '' } : prev)).catch(()=>{}); } function describeFcmFailure(key, message) { if (!key) return message || 'FCM прОМял 0 сППбщеМОй'; if (key === 'THIRD_PARTY_AUTH_ERROR') { return 'ОшОбка APNs/Firebase iOS: прПверьте Apple APNs Auth Key (.p8) О связку Firebase прПекта Ўля iOS-прОлПжеМОя'; } if (key === 'UNREGISTERED') { return 'ТПкеМ устрПйства бПльше Ме валОЎеМ'; } if (key === 'INVALID_ARGUMENT') { return 'НекПрректМый тПкеМ ОлО payload'; } if (key === 'REQUEST_FAILED') { return message || 'FCM request failed before response'; } return message ? "".concat(key, ": ").concat(message) : key; } async function saveEditUser() { if (!editUser) return; setEditUserSaving(true); try { var _editUser_languages, _editUser_showContactInfo, _editUser_notifyNewTasks, _editUser_notifMessages, _editUser_skills, _editUser_siteSettings; const updated = await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updateAdminUser */ .wl(editUser.id, { firstName: editUser.firstName, lastName: editUser.lastName, phone: editUser.phone || null, bio: editUser.bio || null, role: editUser.role, planId: editUser.planId || null, isActive: editUser.isActive, locale: editUser.locale, languages: (_editUser_languages = editUser.languages) !== null && _editUser_languages !== void 0 ? _editUser_languages : [], personalSiteSlug: editUser.personalSiteSlug || null, showContactInfo: (_editUser_showContactInfo = editUser.showContactInfo) !== null && _editUser_showContactInfo !== void 0 ? _editUser_showContactInfo : false, notifyNewTasks: (_editUser_notifyNewTasks = editUser.notifyNewTasks) !== null && _editUser_notifyNewTasks !== void 0 ? _editUser_notifyNewTasks : false, notifMessages: (_editUser_notifMessages = editUser.notifMessages) !== null && _editUser_notifMessages !== void 0 ? _editUser_notifMessages : true, skills: (_editUser_skills = editUser.skills) !== null && _editUser_skills !== void 0 ? _editUser_skills : [], siteSettings: (_editUser_siteSettings = editUser.siteSettings) !== null && _editUser_siteSettings !== void 0 ? _editUser_siteSettings : {} }); await Promise.all(editUserCards.map((card)=>{ var _card_skills, _card_categories, _card_locations; return _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .adminUpdateSpecialistCard */ .oq(card.id, { title: card.title, description: card.description || null, skills: (_card_skills = card.skills) !== null && _card_skills !== void 0 ? _card_skills : [], categories: (_card_categories = card.categories) !== null && _card_categories !== void 0 ? _card_categories : [], locations: (_card_locations = card.locations) !== null && _card_locations !== void 0 ? _card_locations : [], publicationStatus: card.publicationStatus, isActive: card.isActive }).catch(()=>null); })); setUsers((prev)=>prev.map((u)=>u.id === editUser.id ? updated : u)); setEditUser(null); } catch (e) {} finally{ setEditUserSaving(false); } } async function verifyEmail() { if (!editUser) return; setVerifyingEmail(true); try { const updated = await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .verifyAdminUserEmail */ .uQ(editUser.id); setEditUser((u)=>u ? { ...u, emailVerified: updated.emailVerified } : u); setUsers((prev)=>prev.map((u)=>u.id === editUser.id ? { ...u, emailVerified: updated.emailVerified } : u)); } catch (e) {} finally{ setVerifyingEmail(false); } } async function handleAdminTopUp() { if (!editUser) return; const amount = Number(editUser.topUpAmount); if (!amount || amount <= 0) return; setTopUpSaving(true); try { const result = await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .adminTopUpUserBalance */ .P0(editUser.id, { amount, description: editUser.topUpDescription || undefined }); setUsers((prev)=>prev.map((u)=>u.id === editUser.id ? result.user : u)); setEditUser((prev)=>prev ? { ...prev, ...result.user, topUpAmount: '', topUpDescription: '' } : prev); if (tab === 'balances') { _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminBalanceHistory */ .g0({ page: balancePage, userId: balanceUserId || undefined, kind: balanceKind || undefined }).then((d)=>{ setBalanceRows(d.data); setBalanceTotal(d.total); }).catch(()=>{}); } } catch (e) { // ignore } finally{ setTopUpSaving(false); } } async function handleAdminWithdraw() { if (!editUser) return; const amount = Number(editUser.withdrawAmount); if (!amount || amount <= 0) return; setWithdrawSaving(true); try { const result = await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .adminWithdrawUserBalance */ .hD(editUser.id, { amount, description: editUser.withdrawDescription || undefined }); setUsers((prev)=>prev.map((u)=>u.id === editUser.id ? result.user : u)); setEditUser((prev)=>prev ? { ...prev, ...result.user, withdrawAmount: '', withdrawDescription: '' } : prev); if (tab === 'balances') { _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminBalanceHistory */ .g0({ page: balancePage, userId: balanceUserId || undefined, kind: balanceKind || undefined }).then((d)=>{ setBalanceRows(d.data); setBalanceTotal(d.total); }).catch(()=>{}); } } catch (e) { // ignore } finally{ setWithdrawSaving(false); } } async function saveCard(cardId) { const card = editUserCards.find((c)=>c.id === cardId); if (!card) return; setCardSaving((prev)=>({ ...prev, [cardId]: true })); try { var _card_skills, _card_categories, _card_locations; const updated = await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .adminUpdateSpecialistCard */ .oq(cardId, { title: card.title, description: card.description || null, skills: (_card_skills = card.skills) !== null && _card_skills !== void 0 ? _card_skills : [], categories: (_card_categories = card.categories) !== null && _card_categories !== void 0 ? _card_categories : [], locations: (_card_locations = card.locations) !== null && _card_locations !== void 0 ? _card_locations : [], publicationStatus: card.publicationStatus, isActive: card.isActive }); setEditUserCards((prev)=>prev.map((c)=>c.id === cardId ? updated : c)); } catch (e) {} finally{ setCardSaving((prev)=>({ ...prev, [cardId]: false })); } } async function updateModerationCard(cardId, publicationStatus) { const updated = await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .adminUpdateSpecialistCard */ .oq(cardId, { publicationStatus, isActive: publicationStatus === 'active' }).catch(()=>null); if (!updated) return; setModerationCards((prev)=>prev.map((card)=>card.id === cardId ? updated : card)); if ((editUser === null || editUser === void 0 ? void 0 : editUser.id) === updated.specialistId) { setEditUserCards((prev)=>prev.map((card)=>card.id === cardId ? updated : card)); } _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminReports */ .z5(1, 'pending').then((d)=>setPendingReportsCount(d.total)).catch(()=>{}); _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminSpecialistCards */ .s_(1, 'pending').then((d)=>setPendingCardsCount(d.total)).catch(()=>{}); } async function cancelTask(id) { const updated = await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .cancelTaskAdmin */ .nf(id).catch(()=>null); if (updated) { const task = updated.task || updated; setTasks((prev)=>prev.map((row)=>{ const t = row.task || row; return t.id === id ? { ...row, task: task } : row; })); } } async function deleteTask(id, title) { if (!window.confirm("".concat(t('admin.tasks.delete.confirm'), '\n"').concat(title, '"'))) return; const ok = await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .deleteTaskAdmin */ .GB(id).catch(()=>null); if (ok) setTasks((prev)=>prev.filter((row)=>{ var _row_task; return (((_row_task = row.task) === null || _row_task === void 0 ? void 0 : _row_task.id) || row.id) !== id; })); } async function handleReport(id, status) { const updated = await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updateReportStatus */ .eU(id, status).catch(()=>null); if (updated) setReports((prev)=>prev.map((r)=>r.id === id ? { ...r, ...updated } : r)); } // Locations (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!isAdmin || tab !== 'locations') return; _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminLocations */ .k_().then(setLocRows).catch(()=>{}); }, [ isAdmin, tab ]); function openAddLoc(parentId) { setLocForm({ parentId: parentId !== null && parentId !== void 0 ? parentId : null, slug: '', nameEl: '', nameEn: '', nameRu: '', nameUk: '', order: 0, isActive: true }); } function openEditLoc(loc) { var _loc_names, _loc_names1, _loc_names2, _loc_names3; var _loc_parentId, _loc_nameEl, _ref, _loc_nameEn, _ref1, _loc_nameRu, _ref2, _loc_nameUk, _ref3, _loc_order, _loc_isActive; setLocForm({ id: loc.id, parentId: (_loc_parentId = loc.parentId) !== null && _loc_parentId !== void 0 ? _loc_parentId : null, slug: loc.slug, nameEl: (_ref = (_loc_nameEl = loc.nameEl) !== null && _loc_nameEl !== void 0 ? _loc_nameEl : (_loc_names = loc.names) === null || _loc_names === void 0 ? void 0 : _loc_names.el) !== null && _ref !== void 0 ? _ref : '', nameEn: (_ref1 = (_loc_nameEn = loc.nameEn) !== null && _loc_nameEn !== void 0 ? _loc_nameEn : (_loc_names1 = loc.names) === null || _loc_names1 === void 0 ? void 0 : _loc_names1.en) !== null && _ref1 !== void 0 ? _ref1 : '', nameRu: (_ref2 = (_loc_nameRu = loc.nameRu) !== null && _loc_nameRu !== void 0 ? _loc_nameRu : (_loc_names2 = loc.names) === null || _loc_names2 === void 0 ? void 0 : _loc_names2.ru) !== null && _ref2 !== void 0 ? _ref2 : '', nameUk: (_ref3 = (_loc_nameUk = loc.nameUk) !== null && _loc_nameUk !== void 0 ? _loc_nameUk : (_loc_names3 = loc.names) === null || _loc_names3 === void 0 ? void 0 : _loc_names3.uk) !== null && _ref3 !== void 0 ? _ref3 : '', order: (_loc_order = loc.order) !== null && _loc_order !== void 0 ? _loc_order : 0, isActive: (_loc_isActive = loc.isActive) !== null && _loc_isActive !== void 0 ? _loc_isActive : true }); } async function saveLoc() { if (!locForm) return; setLocSaving(true); try { if (locForm.id) { const updated = await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updateLocation */ .Nt(locForm.id, locForm); setLocRows((prev)=>prev.map((r)=>r.id === locForm.id ? updated : r)); } else { const created = await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .createLocation */ .yJ({ slug: locForm.slug, nameEl: locForm.nameEl, nameEn: locForm.nameEn, nameRu: locForm.nameRu, nameUk: locForm.nameUk, parentId: locForm.parentId, order: locForm.order }); setLocRows((prev)=>[ ...prev, created ]); } setLocForm(null); } catch (e) { // ignore } finally{ setLocSaving(false); } } async function deleteLoc(id, name) { if (!window.confirm("".concat(t('admin.loc.delete.confirm'), '\n"').concat(name, '"'))) return; const ok = await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .deleteLocation */ .zR(id).catch(()=>null); if (ok) setLocRows((prev)=>prev.filter((r)=>r.id !== id)); } function toggleLocExpand(id) { setLocExpanded((prev)=>{ const next = new Set(prev); next.has(id) ? next.delete(id) : next.add(id); return next; }); } // Categories (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!isAdmin || tab !== 'categories') return; _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminCategories */ .KD().then(setCatRows).catch(()=>{}); }, [ isAdmin, tab ]); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!isAdmin) return; fetch('/category-icons/presets.json').then((res)=>res.ok ? res.json() : Promise.reject(new Error('Failed to load presets'))).then((data)=>{ if (!Array.isArray(data)) return; const cleaned = data.filter((x)=>!!x && typeof x === 'object' && typeof x.value === 'string' && typeof x.label === 'string').filter((x)=>x.value.startsWith('/category-icons/')); if (cleaned.length > 0) setCategoryIconPresets(cleaned); }).catch(()=>{}); }, [ isAdmin ]); function openAddCat(parentId) { setCatIconError(null); setCatForm({ parentId: parentId !== null && parentId !== void 0 ? parentId : null, slug: '', icon: '/category-icons/package.svg', namesEl: '', namesEn: '', namesRu: '', namesUk: '', order: 0, isActive: true }); } function openEditCat(cat) { var _cat_names, _cat_names1, _cat_names2, _cat_names3; const selectedIcon = typeof cat.icon === 'string' ? cat.icon : ''; const knownPreset = new Set(categoryIconPresets.map((p)=>p.value)); const normalizedIcon = selectedIcon.startsWith('/category-icons/') && !knownPreset.has(selectedIcon) ? '/category-icons/package.svg' : selectedIcon || '/category-icons/package.svg'; setCatIconError(null); var _cat_parentId, _cat_namesEl, _ref, _cat_namesEn, _ref1, _cat_namesRu, _ref2, _cat_namesUk, _ref3, _cat_order, _cat_isActive; setCatForm({ id: cat.id, parentId: (_cat_parentId = cat.parentId) !== null && _cat_parentId !== void 0 ? _cat_parentId : null, slug: cat.slug, icon: normalizedIcon, namesEl: (_ref = (_cat_namesEl = cat.namesEl) !== null && _cat_namesEl !== void 0 ? _cat_namesEl : (_cat_names = cat.names) === null || _cat_names === void 0 ? void 0 : _cat_names.el) !== null && _ref !== void 0 ? _ref : '', namesEn: (_ref1 = (_cat_namesEn = cat.namesEn) !== null && _cat_namesEn !== void 0 ? _cat_namesEn : (_cat_names1 = cat.names) === null || _cat_names1 === void 0 ? void 0 : _cat_names1.en) !== null && _ref1 !== void 0 ? _ref1 : '', namesRu: (_ref2 = (_cat_namesRu = cat.namesRu) !== null && _cat_namesRu !== void 0 ? _cat_namesRu : (_cat_names2 = cat.names) === null || _cat_names2 === void 0 ? void 0 : _cat_names2.ru) !== null && _ref2 !== void 0 ? _ref2 : '', namesUk: (_ref3 = (_cat_namesUk = cat.namesUk) !== null && _cat_namesUk !== void 0 ? _cat_namesUk : (_cat_names3 = cat.names) === null || _cat_names3 === void 0 ? void 0 : _cat_names3.uk) !== null && _ref3 !== void 0 ? _ref3 : '', order: (_cat_order = cat.order) !== null && _cat_order !== void 0 ? _cat_order : 0, isActive: (_cat_isActive = cat.isActive) !== null && _cat_isActive !== void 0 ? _cat_isActive : true }); } async function uploadCategoryIcon(file) { if (file.type !== 'image/svg+xml') { setCatIconError('Only SVG files are allowed'); return; } setCatIconUploading(true); setCatIconError(null); try { const fd = new FormData(); fd.append('file', file); const base = "https://api.canhelp.gr" || 0; const res = await fetch("".concat(base, "/api/uploads"), { method: 'POST', credentials: 'include', body: fd }); if (!res.ok) { const err = await res.json().catch(()=>({ error: 'Upload failed' })); throw new Error(err.error || 'Upload failed'); } const data = await res.json(); setCatForm((f)=>f ? { ...f, icon: data.url } : f); } catch (err) { setCatIconError((err === null || err === void 0 ? void 0 : err.message) || 'Upload failed'); } finally{ setCatIconUploading(false); } } async function saveCat() { if (!catForm) return; setCatSaving(true); try { if (catForm.id) { const updated = await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updateCategory */ .$7(catForm.id, catForm); setCatRows((prev)=>prev.map((r)=>r.id === catForm.id ? updated : r)); } else { const created = await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .createCategory */ .zZ({ slug: catForm.slug, icon: catForm.icon, namesEl: catForm.namesEl, namesEn: catForm.namesEn, namesRu: catForm.namesRu, namesUk: catForm.namesUk, parentId: catForm.parentId, order: catForm.order }); setCatRows((prev)=>[ ...prev, created ]); } setCatForm(null); } catch (e) { // ignore } finally{ setCatSaving(false); } } async function deleteCat(id, name) { if (!window.confirm("".concat(t('admin.cat.delete.confirm'), '\n"').concat(name, '"'))) return; const ok = await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .deleteCategory */ .K7(id).catch(()=>null); if (ok) setCatRows((prev)=>prev.filter((r)=>r.id !== id)); } function toggleCatExpand(id) { setCatExpanded((prev)=>{ const next = new Set(prev); next.has(id) ? next.delete(id) : next.add(id); return next; }); } async function toggleCatSkills(cat) { const id = cat.id; const slug = cat.slug; setCatSkillsExpanded((prev)=>{ const next = new Set(prev); if (next.has(id)) { next.delete(id); return next; } next.add(id); return next; }); if (!catSkillsCache[slug]) { setCatSkillsLoading((prev)=>new Set(prev).add(id)); try { const skills = await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminSkills */ .i_(slug); setCatSkillsCache((prev)=>({ ...prev, [slug]: skills })); } catch (e) {} finally{ setCatSkillsLoading((prev)=>{ const n = new Set(prev); n.delete(id); return n; }); } } } function openAddSkill(catSlug) { setSkillForm({ catSlug, nameEl: '', nameEn: '', nameRu: '', nameUk: '', order: 0 }); } function openEditSkill(skill, catSlug) { var _skill_nameEl, _skill_nameEn, _skill_nameRu, _skill_nameUk, _skill_order; setSkillForm({ id: skill.id, catSlug, nameEl: (_skill_nameEl = skill.nameEl) !== null && _skill_nameEl !== void 0 ? _skill_nameEl : '', nameEn: (_skill_nameEn = skill.nameEn) !== null && _skill_nameEn !== void 0 ? _skill_nameEn : '', nameRu: (_skill_nameRu = skill.nameRu) !== null && _skill_nameRu !== void 0 ? _skill_nameRu : '', nameUk: (_skill_nameUk = skill.nameUk) !== null && _skill_nameUk !== void 0 ? _skill_nameUk : '', order: (_skill_order = skill.order) !== null && _skill_order !== void 0 ? _skill_order : 0 }); } async function saveSkill() { if (!skillForm) return; setSkillSaving(true); try { if (skillForm.id) { const updated = await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updateSkill */ .fP(skillForm.id, { nameEl: skillForm.nameEl, nameEn: skillForm.nameEn, nameRu: skillForm.nameRu, nameUk: skillForm.nameUk, order: skillForm.order }); setCatSkillsCache((prev)=>{ var _prev_skillForm_catSlug; return { ...prev, [skillForm.catSlug]: ((_prev_skillForm_catSlug = prev[skillForm.catSlug]) !== null && _prev_skillForm_catSlug !== void 0 ? _prev_skillForm_catSlug : []).map((s)=>s.id === skillForm.id ? updated : s) }; }); } else { const created = await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .createSkill */ .S9({ categorySlug: skillForm.catSlug, nameEl: skillForm.nameEl, nameEn: skillForm.nameEn, nameRu: skillForm.nameRu, nameUk: skillForm.nameUk, order: skillForm.order }); setCatSkillsCache((prev)=>{ var _prev_skillForm_catSlug; return { ...prev, [skillForm.catSlug]: [ ...(_prev_skillForm_catSlug = prev[skillForm.catSlug]) !== null && _prev_skillForm_catSlug !== void 0 ? _prev_skillForm_catSlug : [], created ] }; }); } setSkillForm(null); } catch (e) {} finally{ setSkillSaving(false); } } async function deleteSkill(skill, catSlug) { if (!skill._skipConfirm && !window.confirm('УЎалОть Мавык "'.concat(skill.nameEl, '"?'))) return; const ok = skill._skipConfirm ? true : await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .deleteSkill */ .hp(skill.id).catch(()=>null); if (ok) { setCatSkillsCache((prev)=>{ var _prev_catSlug; return { ...prev, [catSlug]: ((_prev_catSlug = prev[catSlug]) !== null && _prev_catSlug !== void 0 ? _prev_catSlug : []).filter((s)=>s.id !== skill.id) }; }); } } function openAddPlan() { setPlanForm({ 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: false, isActive: true, order: 0, notifyNewTasks: false, canContactFreePlan: false, canContactProPlan: true, canContactAll: false, canShowContactInfo: false, canViewPhone: false, canUploadVideo: false, hasFavorites: false, hasGoogleCalendar: false, hasVerifiedBadge: false, highlightedReviews: false, hasPersonalSite: false, hasCanHelpNowStatus: false, hasNeedHelpStatus: false, hasAutoResponse: false, hasAutoMatch: false, hasPriceList: false, receiveInstantDispatchFree: false, receiveInstantDispatchPro: false }); } function openEditPlan(plan) { var _plan_description, _plan_role, _plan_tier, _plan_price, _plan_oldPrice, _plan_currency, _plan_searchBoost, _plan_offersMultiplier, _plan_features, _plan_isDefault, _plan_isActive, _plan_order, _plan_notifyNewTasks, _plan_canContactFreePlan, _plan_canContactProPlan, _plan_canContactAll, _plan_canShowContactInfo, _plan_canViewPhone, _plan_canUploadVideo, _plan_hasFavorites, _plan_hasGoogleCalendar, _plan_hasVerifiedBadge, _plan_highlightedReviews, _plan_hasPersonalSite, _plan_hasCanHelpNowStatus, _plan_hasNeedHelpStatus, _plan_hasAutoResponse, _plan_hasAutoMatch, _plan_hasPriceList, _plan_receiveInstantDispatchFree, _plan_receiveInstantDispatchPro; setPlanForm({ id: plan.id, name: plan.name, description: (_plan_description = plan.description) !== null && _plan_description !== void 0 ? _plan_description : '', role: (_plan_role = plan.role) !== null && _plan_role !== void 0 ? _plan_role : 'customer', tier: (_plan_tier = plan.tier) !== null && _plan_tier !== void 0 ? _plan_tier : 'free', price: (_plan_price = plan.price) !== null && _plan_price !== void 0 ? _plan_price : '0', oldPrice: (_plan_oldPrice = plan.oldPrice) !== null && _plan_oldPrice !== void 0 ? _plan_oldPrice : '', currency: (_plan_currency = plan.currency) !== null && _plan_currency !== void 0 ? _plan_currency : 'EUR', maxTasks: plan.maxTasks != null ? String(plan.maxTasks) : '', maxOffers: plan.maxOffers != null ? String(plan.maxOffers) : '', maxCards: plan.maxCards != null ? String(plan.maxCards) : '', maxMessagesPerDay: plan.maxMessagesPerDay != null ? String(plan.maxMessagesPerDay) : '', maxOrdersPerDay: plan.maxOrdersPerDay != null ? String(plan.maxOrdersPerDay) : '', maxSkills: plan.maxSkills != null ? String(plan.maxSkills) : '', durationDays: plan.durationDays != null ? String(plan.durationDays) : '', searchBoost: (_plan_searchBoost = plan.searchBoost) !== null && _plan_searchBoost !== void 0 ? _plan_searchBoost : 0, offersMultiplier: (_plan_offersMultiplier = plan.offersMultiplier) !== null && _plan_offersMultiplier !== void 0 ? _plan_offersMultiplier : '1.00', features: ((_plan_features = plan.features) !== null && _plan_features !== void 0 ? _plan_features : []).join('\n'), isDefault: (_plan_isDefault = plan.isDefault) !== null && _plan_isDefault !== void 0 ? _plan_isDefault : false, isActive: (_plan_isActive = plan.isActive) !== null && _plan_isActive !== void 0 ? _plan_isActive : true, order: (_plan_order = plan.order) !== null && _plan_order !== void 0 ? _plan_order : 0, notifyNewTasks: (_plan_notifyNewTasks = plan.notifyNewTasks) !== null && _plan_notifyNewTasks !== void 0 ? _plan_notifyNewTasks : false, canContactFreePlan: (_plan_canContactFreePlan = plan.canContactFreePlan) !== null && _plan_canContactFreePlan !== void 0 ? _plan_canContactFreePlan : false, canContactProPlan: (_plan_canContactProPlan = plan.canContactProPlan) !== null && _plan_canContactProPlan !== void 0 ? _plan_canContactProPlan : true, canContactAll: (_plan_canContactAll = plan.canContactAll) !== null && _plan_canContactAll !== void 0 ? _plan_canContactAll : false, canShowContactInfo: (_plan_canShowContactInfo = plan.canShowContactInfo) !== null && _plan_canShowContactInfo !== void 0 ? _plan_canShowContactInfo : false, canViewPhone: (_plan_canViewPhone = plan.canViewPhone) !== null && _plan_canViewPhone !== void 0 ? _plan_canViewPhone : false, canUploadVideo: (_plan_canUploadVideo = plan.canUploadVideo) !== null && _plan_canUploadVideo !== void 0 ? _plan_canUploadVideo : false, hasFavorites: (_plan_hasFavorites = plan.hasFavorites) !== null && _plan_hasFavorites !== void 0 ? _plan_hasFavorites : false, hasGoogleCalendar: (_plan_hasGoogleCalendar = plan.hasGoogleCalendar) !== null && _plan_hasGoogleCalendar !== void 0 ? _plan_hasGoogleCalendar : false, hasVerifiedBadge: (_plan_hasVerifiedBadge = plan.hasVerifiedBadge) !== null && _plan_hasVerifiedBadge !== void 0 ? _plan_hasVerifiedBadge : false, highlightedReviews: (_plan_highlightedReviews = plan.highlightedReviews) !== null && _plan_highlightedReviews !== void 0 ? _plan_highlightedReviews : false, hasPersonalSite: (_plan_hasPersonalSite = plan.hasPersonalSite) !== null && _plan_hasPersonalSite !== void 0 ? _plan_hasPersonalSite : false, hasCanHelpNowStatus: (_plan_hasCanHelpNowStatus = plan.hasCanHelpNowStatus) !== null && _plan_hasCanHelpNowStatus !== void 0 ? _plan_hasCanHelpNowStatus : false, hasNeedHelpStatus: (_plan_hasNeedHelpStatus = plan.hasNeedHelpStatus) !== null && _plan_hasNeedHelpStatus !== void 0 ? _plan_hasNeedHelpStatus : false, hasAutoResponse: (_plan_hasAutoResponse = plan.hasAutoResponse) !== null && _plan_hasAutoResponse !== void 0 ? _plan_hasAutoResponse : false, hasAutoMatch: (_plan_hasAutoMatch = plan.hasAutoMatch) !== null && _plan_hasAutoMatch !== void 0 ? _plan_hasAutoMatch : false, hasPriceList: (_plan_hasPriceList = plan.hasPriceList) !== null && _plan_hasPriceList !== void 0 ? _plan_hasPriceList : false, receiveInstantDispatchFree: (_plan_receiveInstantDispatchFree = plan.receiveInstantDispatchFree) !== null && _plan_receiveInstantDispatchFree !== void 0 ? _plan_receiveInstantDispatchFree : false, receiveInstantDispatchPro: (_plan_receiveInstantDispatchPro = plan.receiveInstantDispatchPro) !== null && _plan_receiveInstantDispatchPro !== void 0 ? _plan_receiveInstantDispatchPro : false }); } async function savePlan() { if (!planForm) return; setPlanSaving(true); try { const payload = { name: planForm.name, description: planForm.description || undefined, role: planForm.role, tier: planForm.tier, price: planForm.price, oldPrice: planForm.oldPrice || null, currency: planForm.currency, maxTasks: planForm.maxTasks ? Number(planForm.maxTasks) : null, maxOffers: planForm.maxOffers ? Number(planForm.maxOffers) : null, maxCards: planForm.maxCards ? Number(planForm.maxCards) : null, maxMessagesPerDay: planForm.maxMessagesPerDay ? Number(planForm.maxMessagesPerDay) : null, maxOrdersPerDay: planForm.maxOrdersPerDay ? Number(planForm.maxOrdersPerDay) : null, maxSkills: planForm.maxSkills ? Number(planForm.maxSkills) : null, durationDays: planForm.durationDays ? Number(planForm.durationDays) : null, notifyNewTasks: planForm.notifyNewTasks, searchBoost: planForm.searchBoost, offersMultiplier: planForm.offersMultiplier, canContactFreePlan: planForm.canContactFreePlan, canContactProPlan: planForm.canContactProPlan, canContactAll: planForm.canContactAll, canShowContactInfo: planForm.canShowContactInfo, canViewPhone: planForm.canViewPhone, canUploadVideo: planForm.canUploadVideo, hasFavorites: planForm.hasFavorites, hasGoogleCalendar: planForm.hasGoogleCalendar, hasVerifiedBadge: planForm.hasVerifiedBadge, highlightedReviews: planForm.highlightedReviews, hasPersonalSite: planForm.hasPersonalSite, hasCanHelpNowStatus: planForm.hasCanHelpNowStatus, hasNeedHelpStatus: planForm.hasNeedHelpStatus, hasAutoResponse: planForm.hasAutoResponse, hasAutoMatch: planForm.hasAutoMatch, hasPriceList: planForm.hasPriceList, receiveInstantDispatchFree: planForm.receiveInstantDispatchFree, receiveInstantDispatchPro: planForm.receiveInstantDispatchPro, features: planForm.features ? planForm.features.split('\n').map((s)=>s.trim()).filter(Boolean) : [], isDefault: planForm.isDefault, isActive: planForm.isActive, order: planForm.order }; if (planForm.id) { const updated = await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updatePlan */ .td(planForm.id, payload); setPlanRows((prev)=>prev.map((r)=>r.id === planForm.id ? updated : r)); } else { const created = await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .createPlan */ .qT(payload); setPlanRows((prev)=>[ ...prev, created ]); } // If set as default — refresh all to sync isDefault flags if (planForm.isDefault) { _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminPlans */ .OX().then(setPlanRows).catch(()=>{}); } setPlanForm(null); } catch (e) { // ignore } finally{ setPlanSaving(false); } } async function deletePlan(id, name) { if (!window.confirm('Delete plan "'.concat(name, '"?'))) return; const ok = await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .deletePlan */ .bR(id).catch(()=>null); if (ok) setPlanRows((prev)=>prev.filter((r)=>r.id !== id)); } // Settings (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!isAdmin || tab !== 'settings') return; if (planRows.length === 0) _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminPlans */ .OX().then(setPlanRows).catch(()=>{}); _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminSettings */ .rC().then((kv)=>{ var _kv_generalsiteName, _kv_generalsiteUrl, _kv_generalcontactEmail, _kv_generalsupportPhone; setGeneralForm({ siteName: (_kv_generalsiteName = kv['general.siteName']) !== null && _kv_generalsiteName !== void 0 ? _kv_generalsiteName : 'CanHelp', siteUrl: (_kv_generalsiteUrl = kv['general.siteUrl']) !== null && _kv_generalsiteUrl !== void 0 ? _kv_generalsiteUrl : '', contactEmail: (_kv_generalcontactEmail = kv['general.contactEmail']) !== null && _kv_generalcontactEmail !== void 0 ? _kv_generalcontactEmail : '', supportPhone: (_kv_generalsupportPhone = kv['general.supportPhone']) !== null && _kv_generalsupportPhone !== void 0 ? _kv_generalsupportPhone : '' }); var _kv_smtphost, _kv_smtpport, _kv_smtpusername, _kv_smtppassword, _kv_smtpfromName, _kv_smtpfromEmail, _kv_smtpencryption; setSmtpForm({ host: (_kv_smtphost = kv['smtp.host']) !== null && _kv_smtphost !== void 0 ? _kv_smtphost : '', port: (_kv_smtpport = kv['smtp.port']) !== null && _kv_smtpport !== void 0 ? _kv_smtpport : '587', username: (_kv_smtpusername = kv['smtp.username']) !== null && _kv_smtpusername !== void 0 ? _kv_smtpusername : '', password: (_kv_smtppassword = kv['smtp.password']) !== null && _kv_smtppassword !== void 0 ? _kv_smtppassword : '', fromName: (_kv_smtpfromName = kv['smtp.fromName']) !== null && _kv_smtpfromName !== void 0 ? _kv_smtpfromName : 'CanHelp', fromEmail: (_kv_smtpfromEmail = kv['smtp.fromEmail']) !== null && _kv_smtpfromEmail !== void 0 ? _kv_smtpfromEmail : '', encryption: (_kv_smtpencryption = kv['smtp.encryption']) !== null && _kv_smtpencryption !== void 0 ? _kv_smtpencryption : 'tls' }); var _kv_paymentepaymerchantId, _kv_paymentepayapiUser, _kv_paymentepayapiPassword, _kv_paymentepayenvironment, _kv_paymentepayconfirmationUrl, _kv_paymentepaycancelUrl; setEPayForm({ merchantId: (_kv_paymentepaymerchantId = kv['payment.epay.merchantId']) !== null && _kv_paymentepaymerchantId !== void 0 ? _kv_paymentepaymerchantId : '', apiUser: (_kv_paymentepayapiUser = kv['payment.epay.apiUser']) !== null && _kv_paymentepayapiUser !== void 0 ? _kv_paymentepayapiUser : '', apiPassword: (_kv_paymentepayapiPassword = kv['payment.epay.apiPassword']) !== null && _kv_paymentepayapiPassword !== void 0 ? _kv_paymentepayapiPassword : '', environment: (_kv_paymentepayenvironment = kv['payment.epay.environment']) !== null && _kv_paymentepayenvironment !== void 0 ? _kv_paymentepayenvironment : 'test', confirmationUrl: (_kv_paymentepayconfirmationUrl = kv['payment.epay.confirmationUrl']) !== null && _kv_paymentepayconfirmationUrl !== void 0 ? _kv_paymentepayconfirmationUrl : '', cancelUrl: (_kv_paymentepaycancelUrl = kv['payment.epay.cancelUrl']) !== null && _kv_paymentepaycancelUrl !== void 0 ? _kv_paymentepaycancelUrl : '', enabled: kv['payment.epay.enabled'] === 'true' }); var _kv_referral_plan_id, _ref, _ref1, _kv_referral_days, _ref2, _ref3; setReferralForm({ enabled: kv['referral_enabled'] === 'true', planId: (_ref1 = (_ref = (_kv_referral_plan_id = kv['referral_plan_id']) !== null && _kv_referral_plan_id !== void 0 ? _kv_referral_plan_id : kv['referral_customer_plan_id']) !== null && _ref !== void 0 ? _ref : kv['referral_specialist_plan_id']) !== null && _ref1 !== void 0 ? _ref1 : '', days: (_ref3 = (_ref2 = (_kv_referral_days = kv['referral_days']) !== null && _kv_referral_days !== void 0 ? _kv_referral_days : kv['referral_customer_days']) !== null && _ref2 !== void 0 ? _ref2 : kv['referral_specialist_days']) !== null && _ref3 !== void 0 ? _ref3 : '30' }); var _kv_seoheadScripts, _kv_seositeTitleel, _ref4, _kv_seositeTitleen, _kv_seositeTitleru, _kv_seositeTitleuk, _kv_seositeDescriptionel, _ref5, _kv_seositeDescriptionen, _kv_seositeDescriptionru, _kv_seositeDescriptionuk; setSeoForm({ maintenanceMode: kv['seo.maintenanceMode'] === 'true', indexingEnabled: kv['seo.indexingEnabled'] !== 'false', headScripts: (_kv_seoheadScripts = kv['seo.headScripts']) !== null && _kv_seoheadScripts !== void 0 ? _kv_seoheadScripts : '', siteTitleEl: (_ref4 = (_kv_seositeTitleel = kv['seo.siteTitle.el']) !== null && _kv_seositeTitleel !== void 0 ? _kv_seositeTitleel : kv['seo.siteTitle']) !== null && _ref4 !== void 0 ? _ref4 : '', siteTitleEn: (_kv_seositeTitleen = kv['seo.siteTitle.en']) !== null && _kv_seositeTitleen !== void 0 ? _kv_seositeTitleen : '', siteTitleRu: (_kv_seositeTitleru = kv['seo.siteTitle.ru']) !== null && _kv_seositeTitleru !== void 0 ? _kv_seositeTitleru : '', siteTitleUk: (_kv_seositeTitleuk = kv['seo.siteTitle.uk']) !== null && _kv_seositeTitleuk !== void 0 ? _kv_seositeTitleuk : '', siteDescriptionEl: (_ref5 = (_kv_seositeDescriptionel = kv['seo.siteDescription.el']) !== null && _kv_seositeDescriptionel !== void 0 ? _kv_seositeDescriptionel : kv['seo.siteDescription']) !== null && _ref5 !== void 0 ? _ref5 : '', siteDescriptionEn: (_kv_seositeDescriptionen = kv['seo.siteDescription.en']) !== null && _kv_seositeDescriptionen !== void 0 ? _kv_seositeDescriptionen : '', siteDescriptionRu: (_kv_seositeDescriptionru = kv['seo.siteDescription.ru']) !== null && _kv_seositeDescriptionru !== void 0 ? _kv_seositeDescriptionru : '', siteDescriptionUk: (_kv_seositeDescriptionuk = kv['seo.siteDescription.uk']) !== null && _kv_seositeDescriptionuk !== void 0 ? _kv_seositeDescriptionuk : '' }); var _kv_socialtelegram, _kv_socialinstagram, _kv_socialfacebook, _kv_socialtwitter, _kv_socialyoutube, _kv_socialtiktok, _kv_socialwhatsapp, _kv_socialviber; setSocialForm({ telegram: (_kv_socialtelegram = kv['social.telegram']) !== null && _kv_socialtelegram !== void 0 ? _kv_socialtelegram : '', instagram: (_kv_socialinstagram = kv['social.instagram']) !== null && _kv_socialinstagram !== void 0 ? _kv_socialinstagram : '', facebook: (_kv_socialfacebook = kv['social.facebook']) !== null && _kv_socialfacebook !== void 0 ? _kv_socialfacebook : '', twitter: (_kv_socialtwitter = kv['social.twitter']) !== null && _kv_socialtwitter !== void 0 ? _kv_socialtwitter : '', youtube: (_kv_socialyoutube = kv['social.youtube']) !== null && _kv_socialyoutube !== void 0 ? _kv_socialyoutube : '', tiktok: (_kv_socialtiktok = kv['social.tiktok']) !== null && _kv_socialtiktok !== void 0 ? _kv_socialtiktok : '', whatsapp: (_kv_socialwhatsapp = kv['social.whatsapp']) !== null && _kv_socialwhatsapp !== void 0 ? _kv_socialwhatsapp : '', viber: (_kv_socialviber = kv['social.viber']) !== null && _kv_socialviber !== void 0 ? _kv_socialviber : '' }); var _kv_telegrambotToken, _kv_telegramadminChatId, _kv_telegramchannelIdel, _kv_telegramchannelIden, _kv_telegramchannelIdru, _kv_telegramchannelIduk; setTelegramForm({ botToken: (_kv_telegrambotToken = kv['telegram.botToken']) !== null && _kv_telegrambotToken !== void 0 ? _kv_telegrambotToken : '', adminChatId: (_kv_telegramadminChatId = kv['telegram.adminChatId']) !== null && _kv_telegramadminChatId !== void 0 ? _kv_telegramadminChatId : '', channelIdEl: (_kv_telegramchannelIdel = kv['telegram.channelId.el']) !== null && _kv_telegramchannelIdel !== void 0 ? _kv_telegramchannelIdel : '', channelIdEn: (_kv_telegramchannelIden = kv['telegram.channelId.en']) !== null && _kv_telegramchannelIden !== void 0 ? _kv_telegramchannelIden : '', channelIdRu: (_kv_telegramchannelIdru = kv['telegram.channelId.ru']) !== null && _kv_telegramchannelIdru !== void 0 ? _kv_telegramchannelIdru : '', channelIdUk: (_kv_telegramchannelIduk = kv['telegram.channelId.uk']) !== null && _kv_telegramchannelIduk !== void 0 ? _kv_telegramchannelIduk : '', notifyRegistrations: kv['telegram.notifyRegistrations'] === 'true', postNewTasks: kv['telegram.postNewTasks'] === 'true' }); }).catch(()=>{}); _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminEmailTemplates */ .Lp().then((rows)=>{ const map = {}; for (const r of rows)map[r.key] = { subject: r.subject, body: r.body }; setNotifTemplates((prev)=>({ ...prev, ...map })); }).catch(()=>{}); }, [ isAdmin, tab ]); async function saveGeneralSettings() { setGeneralSaving(true); try { await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updateAdminSettings */ .CX({ 'general.siteName': generalForm.siteName, 'general.siteUrl': generalForm.siteUrl, 'general.contactEmail': generalForm.contactEmail, 'general.supportPhone': generalForm.supportPhone }); setGeneralSaved(true); setTimeout(()=>setGeneralSaved(false), 2500); } catch (e) {} finally{ setGeneralSaving(false); } } async function saveSmtpSettings() { setSmtpSaving(true); try { await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updateAdminSettings */ .CX({ 'smtp.host': smtpForm.host, 'smtp.port': smtpForm.port, 'smtp.username': smtpForm.username, 'smtp.password': smtpForm.password, 'smtp.fromName': smtpForm.fromName, 'smtp.fromEmail': smtpForm.fromEmail, 'smtp.encryption': smtpForm.encryption }); setSmtpSaved(true); setTimeout(()=>setSmtpSaved(false), 2500); } catch (e) {} finally{ setSmtpSaving(false); } } async function autoTranslateTemplate(key) { const localeKey = "".concat(key, "_").concat(templateLocale); var _notifTemplates_localeKey, _ref; const current = (_ref = (_notifTemplates_localeKey = notifTemplates[localeKey]) !== null && _notifTemplates_localeKey !== void 0 ? _notifTemplates_localeKey : notifTemplates[key]) !== null && _ref !== void 0 ? _ref : { subject: '', body: '' }; if (!current.subject && !current.body) return; setTemplateTranslating(true); try { // СПхраМяеЌ ОсхПЎМый язык в БД (еслО ещё Ме сПхраМёМ) await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updateAdminEmailTemplate */ .jg(localeKey, current); // ПеревПЎОЌ Ма ПстальМые языкО const results = await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .translateAdminEmailTemplate */ .wc({ subject: current.subject, body: current.body, fromLocale: templateLocale }); // ОбМПвляеЌ state setNotifTemplates((prev)=>{ const next = { ...prev, [localeKey]: current }; for (const [loc, tpl] of Object.entries(results)){ next["".concat(key, "_").concat(loc)] = tpl; } return next; }); // СПхраМяеЌ кажЎый перевПЎ в БД await Promise.all(Object.entries(results).map((param)=>{ let [loc, tpl] = param; return _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updateAdminEmailTemplate */ .jg("".concat(key, "_").concat(loc), tpl); })); } catch (e) {} finally{ setTemplateTranslating(false); } } async function saveTemplate(key) { const localeKey = "".concat(key, "_").concat(templateLocale); setTemplateSaving(true); try { var _notifTemplates_localeKey; await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updateAdminEmailTemplate */ .jg(localeKey, (_notifTemplates_localeKey = notifTemplates[localeKey]) !== null && _notifTemplates_localeKey !== void 0 ? _notifTemplates_localeKey : { subject: '', body: '' }); setEditingTemplate(null); } catch (e) {} finally{ setTemplateSaving(false); } } async function saveEPaySettings() { setEPaySaving(true); try { await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updateAdminSettings */ .CX({ 'payment.epay.merchantId': ePayForm.merchantId, 'payment.epay.apiUser': ePayForm.apiUser, 'payment.epay.apiPassword': ePayForm.apiPassword, 'payment.epay.environment': ePayForm.environment, 'payment.epay.confirmationUrl': ePayForm.confirmationUrl, 'payment.epay.cancelUrl': ePayForm.cancelUrl, 'payment.epay.enabled': String(ePayForm.enabled) }); setEPaySaved(true); setTimeout(()=>setEPaySaved(false), 2500); } catch (e) {} finally{ setEPaySaving(false); } } async function saveReferralSettings() { setReferralSaving(true); try { await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updateAdminSettings */ .CX({ 'referral_enabled': String(referralForm.enabled), 'referral_plan_id': referralForm.planId, 'referral_days': referralForm.days }); setReferralSaved(true); setTimeout(()=>setReferralSaved(false), 2500); } catch (e) {} finally{ setReferralSaving(false); } } async function saveSeoSettings() { setSeoSaving(true); try { await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updateAdminSettings */ .CX({ 'seo.maintenanceMode': String(seoForm.maintenanceMode), 'seo.indexingEnabled': String(seoForm.indexingEnabled), 'seo.headScripts': seoForm.headScripts, 'seo.siteTitle.el': seoForm.siteTitleEl, 'seo.siteTitle.en': seoForm.siteTitleEn, 'seo.siteTitle.ru': seoForm.siteTitleRu, 'seo.siteTitle.uk': seoForm.siteTitleUk, 'seo.siteDescription.el': seoForm.siteDescriptionEl, 'seo.siteDescription.en': seoForm.siteDescriptionEn, 'seo.siteDescription.ru': seoForm.siteDescriptionRu, 'seo.siteDescription.uk': seoForm.siteDescriptionUk }); setSeoSaved(true); setTimeout(()=>setSeoSaved(false), 2500); } catch (e) {} finally{ setSeoSaving(false); } } async function saveSocialSettings() { setSocialSaving(true); try { await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updateAdminSettings */ .CX({ 'social.telegram': socialForm.telegram, 'social.instagram': socialForm.instagram, 'social.facebook': socialForm.facebook, 'social.twitter': socialForm.twitter, 'social.youtube': socialForm.youtube, 'social.tiktok': socialForm.tiktok, 'social.whatsapp': socialForm.whatsapp, 'social.viber': socialForm.viber }); setSocialSaved(true); setTimeout(()=>setSocialSaved(false), 2500); } catch (e) {} finally{ setSocialSaving(false); } } async function saveTelegramSettings() { setTelegramSaving(true); try { await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updateAdminSettings */ .CX({ 'telegram.botToken': telegramForm.botToken, 'telegram.adminChatId': telegramForm.adminChatId, 'telegram.channelId.el': telegramForm.channelIdEl, 'telegram.channelId.en': telegramForm.channelIdEn, 'telegram.channelId.ru': telegramForm.channelIdRu, 'telegram.channelId.uk': telegramForm.channelIdUk, 'telegram.notifyRegistrations': String(telegramForm.notifyRegistrations), 'telegram.postNewTasks': String(telegramForm.postNewTasks) }); setTelegramSaved(true); setTimeout(()=>setTelegramSaved(false), 2500); } catch (e) {} finally{ setTelegramSaving(false); } } async function testTelegram(type) { const chatIdMap = { admin: telegramForm.adminChatId, el: telegramForm.channelIdEl, en: telegramForm.channelIdEn, ru: telegramForm.channelIdRu, uk: telegramForm.channelIdUk }; var _chatIdMap_type; const chatId = (_chatIdMap_type = chatIdMap[type]) !== null && _chatIdMap_type !== void 0 ? _chatIdMap_type : ''; if (type === 'admin') { setTestingTelegramAdmin(true); setTestResultTelegramAdmin(null); } else { setTestingLocale(type); setTestResultChannels((p)=>{ const n = { ...p }; delete n[type]; return n; }); } try { const res = await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .testTelegramConnection */ .qX(telegramForm.botToken, chatId); var _res_error; const result = { ok: res.ok, msg: res.ok ? res.botName ? "@".concat(res.botName) : t('admin.settings.telegram.test_ok') : (_res_error = res.error) !== null && _res_error !== void 0 ? _res_error : t('admin.settings.telegram.test_fail') }; if (type === 'admin') setTestResultTelegramAdmin(result); else setTestResultChannels((p)=>({ ...p, [type]: result })); } catch (e) { const result = { ok: false, msg: t('admin.settings.telegram.test_fail') }; if (type === 'admin') setTestResultTelegramAdmin(result); else setTestResultChannels((p)=>({ ...p, [type]: result })); } finally{ if (type === 'admin') setTestingTelegramAdmin(false); else setTestingLocale(null); } } async function verifyTelegramToken() { setVerifyingTelegramToken(true); setVerifyResultTelegramToken(null); try { const res = await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .verifyTelegramToken */ .cl(telegramForm.botToken); var _res_error; setVerifyResultTelegramToken({ ok: res.ok, msg: res.ok ? "@".concat(res.botName) : (_res_error = res.error) !== null && _res_error !== void 0 ? _res_error : t('admin.settings.telegram.test_fail') }); } catch (e) { setVerifyResultTelegramToken({ ok: false, msg: t('admin.settings.telegram.test_fail') }); } finally{ setVerifyingTelegramToken(false); } } if (isPending) return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-center py-20 text-gray-500", children: t('common.loading') }); const dateLocale = locale === 'ru' ? 'ru-RU' : locale === 'en' ? 'en-US' : 'el-GR'; const catName = (id)=>{ const cat = catRows.find((c)=>c.id === id); if (!cat) return id; if (locale === 'en') return cat.namesEn || cat.namesEl; if (locale === 'ru') return cat.namesRu || cat.namesEl; if (locale === 'uk') return cat.namesUk || cat.namesEl; return cat.namesEl || cat.namesEn || id; }; const locName = (id)=>{ const loc = locRows.find((l)=>l.id === id); if (!loc) return id; if (locale === 'en') return loc.nameEn || loc.nameEl; if (locale === 'ru') return loc.nameRu || loc.nameEl; if (locale === 'uk') return loc.nameUk || loc.nameEl; return loc.nameEl || loc.nameEn || id; }; const TABS = [ { key: 'stats', label: t('admin.tab.stats'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: t('admin.tab.users'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M17 21v-2a4 4 0 00-4-4H5a4 4 0 00-4 4v2" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("circle", { cx: "9", cy: "7", r: "4" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: t('admin.tab.tasks'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: t('admin.tab.reports'), badge: pendingReportsCount || undefined, icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: t('admin.tab.moderation'), badge: pendingCardsCount || undefined, icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 20h12" }) ] }) }, { key: 'categories', label: t('admin.tab.categories'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: t('admin.tab.locations'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 11a3 3 0 11-6 0 3 3 0 016 0z" }) ] }) }, { key: 'balances', label: t('admin.tab.balances', 'Balance'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M20 12h-6m0 0a2 2 0 100 4h6v-8h-6a2 2 0 100 4z" }) ] }) }, { key: 'plans', label: t('admin.tab.plans'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("rect", { x: "1", y: "4", width: "22", height: "16", rx: "2", ry: "2" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: "1", y1: "10", x2: "23", y2: "10" }) ] }) }, { key: 'logs', label: t('admin.tab.logs'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("polyline", { points: "4 17 10 11 4 5" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: "12", y1: "19", x2: "20", y2: "19" }) ] }) }, { key: 'settings', label: t('admin.tab.settings'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("circle", { cx: "12", cy: "12", r: "3" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: t('admin.tab.support', 'Support'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: t('admin.tab.push', 'Push'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: t('admin.tab.backup', 'Backup'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: t('admin.tab.translations', 'Translations'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: t('admin.tab.dbcheck', 'DB check'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("ellipse", { cx: "12", cy: "5", rx: "9", ry: "3" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M21 12c0 1.66-4.03 3-9 3S3 13.66 3 12" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M3 5v14c0 1.66 4.03 3 9 3s9-1.34 9-3V5" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 12l2 2 4-4" }) ] }) }, { key: 'referrals', label: t('admin.tab.referrals', 'Referrals'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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" }) }) } ]; const statusColors = { 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' }; const reportStatusColors = { pending: 'bg-yellow-100 text-yellow-700', reviewed: 'bg-green-100 text-green-700', dismissed: 'bg-gray-100 text-gray-500' }; const reasonColors = { 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' }; const cardStatus = (card)=>{ var _card_publicationStatus; return (_card_publicationStatus = card.publicationStatus) !== null && _card_publicationStatus !== void 0 ? _card_publicationStatus : card.isActive ? 'active' : 'inactive'; }; const pendingModerationCards = moderationCards.filter((card)=>cardStatus(card) === 'pending'); const activeModerationCards = moderationCards.filter((card)=>cardStatus(card) === 'active'); var _stats_totalCostUsd, _planForm_oldPrice, _pushResult_tokensFound, _pushResult_usersWithoutTokens, _pushResult_usersConfigBlocked, _pushResult_usersAuthFailed, _pushResult_usersAllFailed, _pushResult_usersWithoutTokens1, _pushResult_usersConfigBlocked1, _pushResult_usersAuthFailed1, _pushResult_usersAllFailed1, _referralsData_totalReferrers, _referralsData_totalReferrals, _referralsData_activeRewards, _editUser_firstName, _editUser_lastName, _editUser_phone, _editUser_bio, _editUser_planId, _editUser_locale, _editUser_balance, _editUser_showContactInfo, _editUser_notifyNewTasks, _editUser_notifMessages, _editUser_personalSiteSlug, _editUser_siteSettings, _siteTheme, _editUser_skills, _editUser_balance1, _editUser_topUpAmount, _editUser_withdrawAmount, _editUser_topUpDescription, _editUser_withdrawDescription; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "min-h-screen bg-gray-50", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "max-w-7xl mx-auto px-4 py-8", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-between mb-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-7 h-7 text-yellow-500", fill: "currentColor", viewBox: "0 0 24 24", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M5 16L3 5l5.5 5L12 4l3.5 6L21 5l-2 11H5zm0 3a1 1 0 000 2h14a1 1 0 000-2H5z" }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h1", { className: "text-2xl font-bold text-gray-900", children: t('admin.title') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)((next_link__WEBPACK_IMPORTED_MODULE_3___default()), { href: "/", className: "flex items-center gap-1.5 text-sm text-gray-500 hover:text-green-600 transition", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 19l-7-7 7-7" }) }), t('admin.back_home') ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("aside", { className: "shrink-0 transition-all duration-200 ".concat(sidebarCollapsed ? 'w-12' : 'w-52'), children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("nav", { className: "bg-white rounded-xl border border-gray-200 overflow-hidden", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>setSidebarCollapsed((v)=>!v), title: sidebarCollapsed ? 'РазверМуть ЌеМю' : 'СверМуть ЌеМю', 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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 transition-transform duration-200 ".concat(sidebarCollapsed ? 'rotate-180' : ''), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 19l-7-7 7-7" }) }) }), TABS.map((param)=>{ let { key, label, icon, badge } = param; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { onClick: ()=>setTab(key), title: sidebarCollapsed ? label : undefined, className: "w-full flex items-center py-3 text-sm font-medium text-left transition ".concat(tab === key ? 'bg-green-50 text-green-700 border-r-2 border-green-600' : 'text-gray-600 hover:bg-gray-50 hover:text-gray-900', " ").concat(sidebarCollapsed ? 'justify-center px-3' : 'gap-3 px-4'), children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "w-4 h-4 flex-shrink-0 flex items-center justify-center", children: icon }), !sidebarCollapsed && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "flex items-center gap-2 min-w-0", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { children: label }), badge ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: badge }) : null ] }) ] }, key); }) ] }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex-1 min-w-0", children: [ tab === 'stats' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "grid grid-cols-2 md:grid-cols-5 gap-4", children: [ { label: t('admin.stats.users'), value: stats === null || stats === void 0 ? void 0 : stats.userCount, icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-8 h-8", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: t('admin.stats.specialists'), value: stats === null || stats === void 0 ? void 0 : stats.specialistCount, icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-8 h-8", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 12a3 3 0 11-6 0 3 3 0 016 0z" }) ] }), color: 'text-purple-600' }, { label: t('admin.stats.tasks'), value: stats === null || stats === void 0 ? void 0 : stats.taskCount, icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-8 h-8", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: t('admin.stats.offers'), value: stats === null || stats === void 0 ? void 0 : stats.offerCount, icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-8 h-8", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: t('admin.stats.reviews'), value: stats === null || stats === void 0 ? void 0 : stats.reviewCount, icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-8 h-8", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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((param)=>{ let { label, value, icon, color } = param; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "mb-2 ".concat(color), children: icon }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-3xl font-bold ".concat(color), children: value !== null && value !== void 0 ? value : '—' }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-sm text-gray-500 mt-1", children: label }) ] }, label); }) }), (stats === null || stats === void 0 ? void 0 : stats.tasksByDay) && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-between mb-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "font-semibold text-gray-800", children: t('admin.stats.activity_30d') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-4 text-xs text-gray-500", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "flex items-center gap-1.5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "w-3 h-0.5 bg-green-500 inline-block rounded" }), t('admin.stats.users_label') ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "flex items-center gap-1.5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "w-3 h-0.5 bg-purple-400 inline-block rounded" }), t('admin.stats.specialists_label') ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "flex items-center gap-1.5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "w-3 h-0.5 bg-green-500 inline-block rounded" }), t('admin.stats.tasks_label') ] }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(AdminAreaChart, { series: [ { data: stats.usersByDay, color: '#3b82f6', fill: '#3b82f615', label: t('admin.stats.users_label') }, { data: stats.specialistsByDay, color: '#a855f7', fill: '#a855f710', label: t('admin.stats.specialists_label') }, { data: stats.tasksByDay, color: '#22c55e', fill: '#22c55e10', label: t('admin.stats.tasks_label') } ] }) ] }), (stats === null || stats === void 0 ? void 0 : stats.tasksByStatus) && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "font-semibold text-gray-800 mb-5", children: t('admin.stats.tasks_by_status') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "space-y-3", children: (()=>{ const total = stats.tasksByStatus.reduce((s, r)=>s + Number(r.count), 0) || 1; const statusMeta = { open: { label: t('admin.task_status.open'), bg: 'bg-green-50', bar: 'bg-green-500' }, in_progress: { label: t('admin.task_status.in_progress'), bg: 'bg-green-50', bar: 'bg-green-500' }, completed: { label: t('admin.task_status.completed'), bg: 'bg-gray-50', bar: 'bg-gray-400' }, cancelled: { label: t('admin.task_status.cancelled'), bg: 'bg-red-50', bar: 'bg-red-400' }, draft: { label: t('admin.task_status.draft'), bg: 'bg-yellow-50', bar: 'bg-yellow-400' } }; const order = [ 'open', 'in_progress', 'completed', 'draft', 'cancelled' ]; const sorted = [ ...stats.tasksByStatus ].sort((a, b)=>order.indexOf(a.status) - order.indexOf(b.status)); return sorted.map((param)=>{ let { status, count: c } = param; var _statusMeta_status; const meta = (_statusMeta_status = statusMeta[status]) !== null && _statusMeta_status !== void 0 ? _statusMeta_status : { label: status, bg: 'bg-gray-50', bar: 'bg-gray-300' }; const pct = Math.round(Number(c) / total * 100); return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-3 px-3 py-2 rounded-lg ".concat(meta.bg), children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-sm text-gray-600 w-28 shrink-0", children: meta.label }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex-1 bg-gray-200 rounded-full h-2 overflow-hidden", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "h-full rounded-full ".concat(meta.bar, " transition-all"), style: { width: "".concat(pct, "%") } }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-sm font-semibold text-gray-700 w-8 text-right", children: c }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "text-xs text-gray-400 w-8", children: [ pct, "%" ] }) ] }, status); }); })() }) ] }), notifsByDay.length > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-between mb-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "font-semibold text-gray-800", children: t('admin.stats.notif_chart_title') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "flex items-center gap-1.5 text-xs text-gray-500", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "w-3 h-0.5 bg-orange-500 inline-block rounded" }), t('admin.stats.notif_label') ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(AdminAreaChart, { series: [ { data: notifsByDay, color: '#f97316', fill: '#f9731615', label: t('admin.stats.notif_label') } ] }) ] }), mailByDay.length > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-between mb-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "font-semibold text-gray-800", children: t('admin.stats.mail_chart_title') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "flex items-center gap-1.5 text-xs text-gray-500", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "w-3 h-0.5 bg-sky-500 inline-block rounded" }), t('admin.stats.mail_label') ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(AdminAreaChart, { series: [ { data: mailByDay, color: '#0ea5e9', fill: '#0ea5e915', label: t('admin.stats.mail_label') } ] }) ] }), stats && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-6 space-y-5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-between", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "font-semibold text-gray-800", children: t('admin.stats.tokens_title') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-4 text-xs text-gray-500", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "flex items-center gap-1.5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "w-3 h-0.5 bg-violet-500 inline-block rounded" }), t('admin.stats.tokens_out') ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "flex items-center gap-1.5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "w-3 h-0.5 bg-sky-500 inline-block rounded" }), t('admin.stats.tokens_in') ] }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "grid grid-cols-3 gap-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "rounded-lg bg-violet-50 border border-violet-100 px-4 py-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-xs text-violet-600 mb-1", children: t('admin.stats.tokens_out_label') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-2xl font-bold text-violet-700", children: Number(stats.totalOutputTokens).toLocaleString() }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "rounded-lg bg-sky-50 border border-sky-100 px-4 py-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-xs text-sky-600 mb-1", children: t('admin.stats.tokens_in_label') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-2xl font-bold text-sky-700", children: Number(stats.totalInputTokens).toLocaleString() }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "rounded-lg bg-emerald-50 border border-emerald-100 px-4 py-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-xs text-emerald-600 mb-1", children: t('admin.stats.cost_label') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "text-2xl font-bold text-emerald-700", children: [ "$", Number((_stats_totalCostUsd = stats.totalCostUsd) !== null && _stats_totalCostUsd !== void 0 ? _stats_totalCostUsd : 0).toFixed(4) ] }) ] }) ] }), ((_stats_tokensByMonth = stats.tokensByMonth) === null || _stats_tokensByMonth === void 0 ? void 0 : _stats_tokensByMonth.length) > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(AdminMonthChart, { dateLocale: dateLocale, series: [ { data: stats.tokensByMonth.map((r)=>({ month: r.month, count: Number(r.output) })), color: '#8b5cf6', fill: '#8b5cf610', label: t('admin.stats.tokens_out_label') }, { data: stats.tokensByMonth.map((r)=>({ month: r.month, count: Number(r.input) })), color: '#0ea5e9', fill: '#0ea5e915', label: t('admin.stats.tokens_in_label') } ] }) ] }) ] }), tab === 'users' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-3 mb-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("form", { className: "flex gap-2 flex-1", onSubmit: (e)=>{ e.preventDefault(); setUsersQ(usersQInput); }, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: usersQInput, onChange: (e)=>setUsersQInput(e.target.value), placeholder: t('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" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: t('tasks.search.btn') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("select", { value: usersRole, onChange: (e)=>setUsersRole(e.target.value), className: "border border-gray-300 rounded-lg px-3 py-2 text-sm", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "", children: t('admin.filter.all_roles') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "user", children: t('admin.user_edit.role.user') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "admin", children: t('profile.role.admin') }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 overflow-hidden", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("table", { className: "w-full text-sm", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("thead", { className: "bg-gray-50 text-left", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("tr", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.col.user') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.col.email') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.col.role') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.col.plan', 'Plan') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.col.registered') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.col.status') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3" }) ] }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("tbody", { className: "divide-y divide-gray-100", children: loading ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("tr", { children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { colSpan: 6, className: "px-4 py-8 text-center text-gray-400", children: t('common.loading') }) }) : users.length === 0 ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("tr", { children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { colSpan: 6, className: "px-4 py-8 text-center text-gray-400", children: "—" }) }) : users.map((u)=>{ var _planRows_find; var _planRows_find_name; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("tr", { className: "hover:bg-gray-50", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3 font-medium text-gray-800", children: (0,_lib_formatName__WEBPACK_IMPORTED_MODULE_8__/* .formatShortName */ .H)(u.firstName, u.lastName, u.name) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3 text-gray-500", children: u.email }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "px-2 py-0.5 rounded-full text-xs font-medium ".concat(u.role === 'admin' ? 'bg-red-100 text-red-700' : u.role === 'specialist' ? 'bg-green-100 text-green-700' : 'bg-gray-100 text-gray-600'), children: t("profile.role.".concat(u.role)) || u.role }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3 text-gray-400 text-xs", children: u.planId ? (_planRows_find_name = (_planRows_find = planRows.find((p)=>p.id === u.planId)) === null || _planRows_find === void 0 ? void 0 : _planRows_find.name) !== null && _planRows_find_name !== void 0 ? _planRows_find_name : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "font-mono", children: [ u.planId.slice(0, 8), "
" ] }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-gray-300", children: "—" }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3 text-gray-400", children: new Date(u.createdAt).toLocaleDateString(dateLocale) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "px-2 py-0.5 rounded-full text-xs font-medium ".concat(u.isActive !== false ? 'bg-green-100 text-green-700' : 'bg-red-100 text-red-600'), children: u.isActive !== false ? t('admin.users.active') : t('admin.users.inactive') }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3 text-right", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-end gap-1.5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>openEditUser(u), 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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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" }) }) }), u.role !== 'admin' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>toggleUser(u.id, u.isActive !== false), className: "text-xs px-3 py-1 rounded-lg font-medium ".concat(u.isActive !== false ? 'bg-red-50 text-red-600 hover:bg-red-100' : 'bg-green-50 text-green-600 hover:bg-green-100'), children: u.isActive !== false ? t('admin.users.deactivate') : t('admin.users.activate') }) ] }) }) ] }, u.id); }) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Pagination, { page: usersPage, total: usersTotal, limit: 20, onChange: setUsersPage, totalLabel: t('admin.pagination.total') }) ] }) ] }), tab === 'balances' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex flex-wrap gap-3 mb-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: balanceUserId, onChange: (e)=>setBalanceUserId(e.target.value), placeholder: t('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" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("select", { value: balanceKind, onChange: (e)=>setBalanceKind(e.target.value), className: "border border-gray-300 rounded-lg px-3 py-2 text-sm", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "", children: t('admin.balance.filter.all', 'All operations') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "topup", children: t('admin.balance.kind.topup', 'Top-up') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "plan_purchase", children: t('admin.balance.kind.plan_purchase', 'Plan charge') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "admin_topup", children: t('admin.balance.kind.admin_topup', 'Admin top-up') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "admin_adjustment", children: t('admin.balance.kind.admin_adjustment', 'Adjustment') }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 overflow-hidden", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("table", { className: "w-full text-sm", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("thead", { className: "bg-gray-50 text-left", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("tr", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.col.user') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.balance.col.operation', 'Operation') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.balance.col.amount', 'Amount') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.balance.col.result', 'Balance') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.balance.col.description', 'Description') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.balance.col.date', 'Date') }) ] }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("tbody", { className: "divide-y divide-gray-100", children: loading ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("tr", { children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { colSpan: 6, className: "px-4 py-8 text-center text-gray-400", children: t('common.loading') }) }) : balanceRows.length === 0 ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("tr", { children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { colSpan: 6, className: "px-4 py-8 text-center text-gray-400", children: t('admin.balance.empty', 'No records yet') }) }) : balanceRows.map((row)=>{ const isCredit = row.direction === 'credit'; const kindLabel = row.kind === 'topup' ? t('admin.balance.kind.topup', 'Top-up') : row.kind === 'plan_purchase' ? t('admin.balance.kind.plan_purchase', 'Plan charge') : row.kind === 'admin_topup' ? t('admin.balance.kind.admin_topup', 'Admin top-up') : t('admin.balance.kind.admin_adjustment', 'Adjustment'); return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("tr", { className: "hover:bg-gray-50 align-top", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("td", { className: "px-4 py-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "font-medium text-gray-800", children: row.userName || '—' }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-xs text-gray-500 mt-0.5", children: row.userEmail || row.userId }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "inline-flex rounded-full px-2 py-0.5 text-xs font-medium ".concat(isCredit ? 'bg-emerald-50 text-emerald-700' : 'bg-rose-50 text-rose-700'), children: kindLabel }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("td", { className: "px-4 py-3 font-semibold ".concat(isCredit ? 'text-emerald-700' : 'text-rose-700'), children: [ isCredit ? '+' : '-', Number(row.amount).toFixed(2), " ", row.currency ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3 text-gray-600", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ Number(row.balanceBefore).toFixed(2), " → ", Number(row.balanceAfter).toFixed(2), " ", row.currency ] }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3 text-gray-500 max-w-sm", children: row.description || '—' }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3 text-gray-500 whitespace-nowrap", children: new Date(row.createdAt).toLocaleString(dateLocale) }) ] }, row.id); }) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Pagination, { page: balancePage, total: balanceTotal, limit: 50, onChange: setBalancePage, totalLabel: t('admin.pagination.total') }) ] }) ] }), tab === 'tasks' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-3 mb-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("form", { className: "flex gap-2 flex-1", onSubmit: (e)=>{ e.preventDefault(); setTasksQ(tasksQInput); }, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: tasksQInput, onChange: (e)=>setTasksQInput(e.target.value), placeholder: t('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" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: t('tasks.search.btn') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("select", { value: tasksStatus, onChange: (e)=>setTasksStatus(e.target.value), className: "border border-gray-300 rounded-lg px-3 py-2 text-sm", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "", children: t('admin.filter.all_statuses') }), [ 'open', 'in_progress', 'completed', 'cancelled', 'draft' ].map((s)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: s, children: t("task.status.".concat(s), s) }, s)) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 overflow-hidden", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("table", { className: "w-full text-sm", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("thead", { className: "bg-gray-50 text-left", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("tr", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.col.title') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.col.customer') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.col.status') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.col.budget') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.col.created') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3" }) ] }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("tbody", { className: "divide-y divide-gray-100", children: loading ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("tr", { children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { colSpan: 6, className: "px-4 py-8 text-center text-gray-400", children: t('common.loading') }) }) : tasks.length === 0 ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("tr", { children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { colSpan: 6, className: "px-4 py-8 text-center text-gray-400", children: "—" }) }) : tasks.map((row)=>{ const task = row.task || row; const customer = row.customer; var _customer_name, _statusColors_task_status; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("tr", { className: "hover:bg-gray-50", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3 font-medium text-gray-800 max-w-xs", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)((next_link__WEBPACK_IMPORTED_MODULE_3___default()), { href: "/tasks/".concat(task.id), className: "hover:text-green-600 truncate block", target: "_blank", children: locale === 'en' && task.titleEn || locale === 'ru' && task.titleRu || locale === 'uk' && task.titleUk || task.titleEl || task.title }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3 text-gray-500 text-xs", children: (_customer_name = customer === null || customer === void 0 ? void 0 : customer.name) !== null && _customer_name !== void 0 ? _customer_name : '—' }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "px-2 py-0.5 rounded-full text-xs font-medium ".concat((_statusColors_task_status = statusColors[task.status]) !== null && _statusColors_task_status !== void 0 ? _statusColors_task_status : 'bg-gray-100 text-gray-600'), children: t("task.status.".concat(task.status), task.status) }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3 text-gray-500", children: task.budget ? "".concat((0,_lib_taskLocale__WEBPACK_IMPORTED_MODULE_9__/* .formatPrice */ .$g)(task.budget), "€") : '—' }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3 text-gray-400", children: new Date(task.createdAt).toLocaleDateString(dateLocale) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3 text-right", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-1.5 justify-end", children: [ task.status !== 'cancelled' && task.status !== 'completed' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>cancelTask(task.id), className: "text-xs px-2.5 py-1 rounded-lg font-medium bg-yellow-50 text-yellow-700 hover:bg-yellow-100", children: t('admin.tasks.cancel') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>deleteTask(task.id, locale === 'en' && task.titleEn || locale === 'ru' && task.titleRu || locale === 'uk' && task.titleUk || task.titleEl || task.title), className: "text-xs px-2.5 py-1 rounded-lg font-medium bg-red-50 text-red-600 hover:bg-red-100", children: t('admin.tasks.delete') }) ] }) }) ] }, task.id); }) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Pagination, { page: tasksPage, total: tasksTotal, limit: 20, onChange: setTasksPage, totalLabel: t('admin.pagination.total') }) ] }) ] }), tab === 'categories' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex justify-between items-center mb-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-gray-500", children: t('admin.cat.hint') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { onClick: ()=>openAddCat(null), className: "px-4 py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700", children: [ "+ ", t('admin.cat.add_root') ] }) ] }), catForm && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-green-50 border border-green-200 rounded-xl p-5 mb-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("h3", { className: "font-semibold text-gray-800 mb-4", children: [ catForm.id ? t('admin.cat.edit') : t('admin.cat.new'), catForm.parentId && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "text-xs text-gray-400 ml-2", children: [ "(", t('admin.cat.subcategory'), ")" ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "grid grid-cols-2 md:grid-cols-3 gap-3 mb-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.cat.slug') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: catForm.slug, onChange: (e)=>setCatForm((f)=>f && { ...f, slug: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm", placeholder: "e.g. repairs" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.cat.icon') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(CategoryIconPicker, { value: catForm.icon, onChange: (icon)=>setCatForm((f)=>f && { ...f, icon }), onUpload: uploadCategoryIcon, uploading: catIconUploading, error: catIconError, presets: categoryIconPresets }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.cat.order') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "number", value: catForm.order, onChange: (e)=>setCatForm((f)=>f && { ...f, order: Number(e.target.value) }), className: "w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: [ t('admin.cat.name_el'), " \uD83C\uDDEC\uD83C\uDDF7" ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: catForm.namesEl, onChange: (e)=>setCatForm((f)=>f && { ...f, namesEl: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: [ t('admin.cat.name_en'), " \uD83C\uDDEC\uD83C\uDDE7" ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: catForm.namesEn, onChange: (e)=>setCatForm((f)=>f && { ...f, namesEn: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: [ t('admin.cat.name_ru'), " \uD83C\uDDF7\uD83C\uDDFA" ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: catForm.namesRu, onChange: (e)=>setCatForm((f)=>f && { ...f, namesRu: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: [ t('admin.cat.name_uk'), " \uD83C\uDDFA\uD83C\uDDE6" ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: catForm.namesUk, onChange: (e)=>setCatForm((f)=>f && { ...f, namesUk: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }) ] }), catForm.id && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "flex items-center gap-2 text-sm text-gray-700 mb-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "checkbox", checked: catForm.isActive, onChange: (e)=>setCatForm((f)=>f && { ...f, isActive: e.target.checked }) }), t('admin.cat.active') ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: saveCat, disabled: catSaving, className: "px-4 py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700 disabled:opacity-50", children: catSaving ? t('common.saving') : t('common.save') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>setCatForm(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: t('common.cancel') }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "bg-white rounded-xl border border-gray-200 divide-y divide-gray-100", children: catRows.length === 0 ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "px-4 py-8 text-center text-gray-400", children: t('admin.cat.empty') }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(CatTree, { rows: catRows, parentId: null, depth: 0, locale: locale, expanded: catExpanded, onToggle: toggleCatExpand, onEdit: openEditCat, onDelete: deleteCat, onAddChild: openAddCat, skillsExpanded: catSkillsExpanded, skillsCache: catSkillsCache, skillsLoading: catSkillsLoading, onToggleSkills: toggleCatSkills, skillForm: skillForm, skillSaving: skillSaving, onOpenAddSkill: openAddSkill, onOpenEditSkill: openEditSkill, onSaveSkill: saveSkill, onDeleteSkill: deleteSkill, onCancelSkillForm: ()=>setSkillForm(null), onSkillFormChange: setSkillForm, t: t }) }) ] }), tab === 'locations' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex justify-between items-center mb-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-gray-500", children: t('admin.loc.hint') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { onClick: ()=>openAddLoc(null), className: "px-4 py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700", children: [ "+ ", t('admin.loc.add_city') ] }) ] }), locForm && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-green-50 border border-green-200 rounded-xl p-5 mb-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("h3", { className: "font-semibold text-gray-800 mb-4", children: [ locForm.id ? t('admin.loc.edit') : t('admin.loc.new'), locForm.parentId && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "text-xs text-gray-400 ml-2", children: [ "(", t('admin.loc.district'), ")" ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "grid grid-cols-2 md:grid-cols-4 gap-3 mb-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.cat.slug') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: locForm.slug, onChange: (e)=>setLocForm((f)=>f && { ...f, slug: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm", placeholder: "e.g. athens-center" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: [ t('admin.cat.name_el'), " \uD83C\uDDEC\uD83C\uDDF7" ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: locForm.nameEl, onChange: (e)=>setLocForm((f)=>f && { ...f, nameEl: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: [ t('admin.cat.name_en'), " \uD83C\uDDEC\uD83C\uDDE7" ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: locForm.nameEn, onChange: (e)=>setLocForm((f)=>f && { ...f, nameEn: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: [ t('admin.cat.name_ru'), " \uD83C\uDDF7\uD83C\uDDFA" ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: locForm.nameRu, onChange: (e)=>setLocForm((f)=>f && { ...f, nameRu: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: [ t('admin.cat.name_uk'), " \uD83C\uDDFA\uD83C\uDDE6" ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: locForm.nameUk, onChange: (e)=>setLocForm((f)=>f && { ...f, nameUk: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-4 mb-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "w-24", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.cat.order') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "number", value: locForm.order, onChange: (e)=>setLocForm((f)=>f && { ...f, order: Number(e.target.value) }), className: "w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), locForm.id && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "flex items-center gap-2 text-sm text-gray-700 mt-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "checkbox", checked: locForm.isActive, onChange: (e)=>setLocForm((f)=>f && { ...f, isActive: e.target.checked }) }), t('admin.cat.active') ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: saveLoc, disabled: locSaving, className: "px-4 py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700 disabled:opacity-50", children: locSaving ? t('common.saving') : t('common.save') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>setLocForm(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: t('common.cancel') }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "bg-white rounded-xl border border-gray-200 divide-y divide-gray-100", children: locRows.length === 0 ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "px-4 py-8 text-center text-gray-400", children: t('admin.loc.empty') }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(LocTree, { rows: locRows, parentId: null, depth: 0, locale: locale, expanded: locExpanded, onToggle: toggleLocExpand, onEdit: openEditLoc, onDelete: deleteLoc, onAddChild: openAddLoc, t: t }) }) ] }), tab === 'reports' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-3", children: [ loading ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-center py-10 text-gray-400", children: t('common.loading') }) : reports.length === 0 ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-center py-10 text-gray-400", children: t('admin.reports.none') }) : reports.map((r)=>{ var _r_targetId; var _reportStatusColors_r_status, _reasonColors_r_reason; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "bg-white rounded-xl border border-gray-200 p-5", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-start justify-between gap-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-2 flex-wrap mb-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "px-2 py-0.5 rounded-full text-xs font-medium ".concat((_reportStatusColors_r_status = reportStatusColors[r.status]) !== null && _reportStatusColors_r_status !== void 0 ? _reportStatusColors_r_status : 'bg-gray-100 text-gray-500'), children: r.status }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "px-2 py-0.5 rounded-full text-xs font-medium ".concat((_reasonColors_r_reason = reasonColors[r.reason]) !== null && _reasonColors_r_reason !== void 0 ? _reasonColors_r_reason : 'bg-gray-100 text-gray-600'), children: r.reason }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "text-xs text-gray-400", children: [ r.targetType === 'task' ? t('admin.reports.target.task') : t('admin.reports.target.user'), ":", ' ', r.targetTitle ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)((next_link__WEBPACK_IMPORTED_MODULE_3___default()), { href: r.targetType === 'task' ? "/tasks/".concat(r.targetId) : "/users/".concat(r.targetId), className: "text-green-600 hover:underline font-medium", target: "_blank", children: r.targetTitle }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "font-mono", children: [ "#", (_r_targetId = r.targetId) === null || _r_targetId === void 0 ? void 0 : _r_targetId.slice(0, 8) ] }) ] }) ] }), r.reporterName && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { className: "text-xs text-gray-400 mb-1", children: [ t('admin.col.reporter'), ": ", /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "font-medium text-gray-600", children: r.reporterName }) ] }), r.description && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-gray-700", children: r.description }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400 mt-1.5", children: new Date(r.createdAt).toLocaleString(dateLocale) }) ] }), r.status === 'pending' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-2 flex-shrink-0", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>handleReport(r.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: t('admin.reports.reviewed') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>handleReport(r.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: t('admin.reports.dismiss') }) ] }) ] }) }, r.id); }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Pagination, { page: reportsPage, total: reportsTotal, limit: 20, onChange: setReportsPage, totalLabel: t('admin.pagination.total') }) ] }), tab === 'moderation' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "grid md:grid-cols-2 gap-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-sm text-gray-500", children: t('admin.moderation.pending_count', 'Pending') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-3xl font-bold text-gray-900 mt-1", children: pendingModerationCards.length }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-xs text-gray-400 mt-1", children: t('admin.moderation.pending_hint', 'New proposals waiting for approval') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-sm text-gray-500", children: t('admin.moderation.active_count', 'Active') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-3xl font-bold text-gray-900 mt-1", children: activeModerationCards.length }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-xs text-gray-400 mt-1", children: t('admin.moderation.active_hint', 'Visible cards that can be blocked') }) ] }) ] }), moderationCardsLoading ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-center py-10 text-gray-400", children: t('common.loading') }) : moderationCards.length === 0 ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-center py-10 text-gray-400", children: t('admin.moderation.none', 'No specialist cards found') }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h3", { className: "font-semibold text-gray-800 mb-3", children: t('admin.moderation.pending_title', 'Pending approval') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "space-y-3", children: pendingModerationCards.length === 0 ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-sm text-gray-400 bg-white border border-dashed border-gray-200 rounded-xl p-4", children: t('admin.moderation.pending_empty', 'No pending proposals right now') }) : pendingModerationCards.map((card)=>{ var _card_specialistName, _ref; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "bg-white rounded-xl border border-gray-200 p-4", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex flex-wrap items-start justify-between gap-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "min-w-0 flex-1", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-2 flex-wrap mb-1", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "px-2 py-0.5 rounded-full text-xs font-medium bg-yellow-100 text-yellow-700", children: t('admin.moderation.pending', 'Pending') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-sm font-semibold text-gray-800 truncate", children: card.title }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-xs text-gray-500 mb-2", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)((next_link__WEBPACK_IMPORTED_MODULE_3___default()), { href: "/users/".concat(card.specialistId), className: "hover:text-green-600 hover:underline font-medium", children: (_ref = (_card_specialistName = card.specialistName) !== null && _card_specialistName !== void 0 ? _card_specialistName : card.specialistEmail) !== null && _ref !== void 0 ? _ref : card.specialistId }) }), card.description && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-gray-700 line-clamp-3", children: card.description }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-2 flex-shrink-0", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>updateModerationCard(card.id, 'active'), className: "px-3 py-1.5 rounded-lg text-xs font-medium bg-green-600 text-white hover:bg-green-700", children: t('admin.moderation.approve', 'Approve') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>updateModerationCard(card.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: t('admin.moderation.block', 'Block') }) ] }) ] }) }, card.id); }) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h3", { className: "font-semibold text-gray-800 mb-3", children: t('admin.moderation.active_title', 'Active cards') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "space-y-3", children: activeModerationCards.length === 0 ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-sm text-gray-400 bg-white border border-dashed border-gray-200 rounded-xl p-4", children: t('admin.moderation.active_empty', 'No active cards found') }) : activeModerationCards.map((card)=>{ var _card_specialistName, _ref; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "bg-white rounded-xl border border-gray-200 p-4", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex flex-wrap items-start justify-between gap-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "min-w-0 flex-1", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-2 flex-wrap mb-1", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "px-2 py-0.5 rounded-full text-xs font-medium bg-green-100 text-green-700", children: t('admin.moderation.active', 'Active') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-sm font-semibold text-gray-800 truncate", children: card.title }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-xs text-gray-500 mb-2", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)((next_link__WEBPACK_IMPORTED_MODULE_3___default()), { href: "/users/".concat(card.specialistId), className: "hover:text-green-600 hover:underline font-medium", children: (_ref = (_card_specialistName = card.specialistName) !== null && _card_specialistName !== void 0 ? _card_specialistName : card.specialistEmail) !== null && _ref !== void 0 ? _ref : card.specialistId }) }), card.description && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-gray-700 line-clamp-3", children: card.description }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>updateModerationCard(card.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: t('admin.moderation.block', 'Block') }) ] }) }, card.id); }) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Pagination, { page: moderationCardsPage, total: moderationCardsTotal, limit: 20, onChange: setModerationCardsPage, totalLabel: t('admin.pagination.total') }) ] }) ] }), tab === 'logs' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex gap-1 bg-gray-100 rounded-xl p-1 mb-5 w-fit", children: [ { key: 'ai', label: t('admin.logs.subtab.ai') }, { key: 'activity', label: t('admin.logs.subtab.activity') }, { key: 'mail', label: t('admin.logs.subtab.mail') }, { key: 'notifications', label: t('admin.logs.subtab.notifications') } ].map((param)=>{ let { key, label } = param; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>setLogsSubTab(key), className: "px-4 py-1.5 rounded-lg text-sm font-medium transition-colors ".concat(logsSubTab === key ? 'bg-white text-gray-900 shadow-sm' : 'text-gray-500 hover:text-gray-700'), children: label }, key); }) }), logsSubTab === 'ai' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex justify-between items-center mb-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { className: "text-sm text-gray-500", children: [ t('admin.pagination.total'), ": ", logsTotal ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { onClick: ()=>{ setLogsPage(1); _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminAiLogs */ .j_(1).then((d)=>{ setLogs(d.data); setLogsTotal(d.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: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("polyline", { points: "23 4 23 10 17 10" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M20.49 15a9 9 0 11-2.12-9.36L23 10" }) ] }), t('common.refresh') ] }) ] }), loading ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-center py-10 text-gray-400", children: t('common.loading') }) : logs.length === 0 ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-center py-10 text-gray-400", children: t('admin.logs.empty') }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "overflow-x-auto rounded-xl border border-gray-200", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("table", { className: "w-full text-sm", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("thead", { className: "bg-gray-50 text-gray-500 text-xs uppercase", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("tr", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 text-left", children: t('admin.logs.date') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 text-left", children: t('admin.logs.provider') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 text-left", children: t('admin.logs.model') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 text-left", children: t('admin.logs.action') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 text-left", children: t('admin.logs.langs') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 text-right", children: t('admin.logs.in') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 text-right", children: t('admin.logs.out') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 text-right", children: t('admin.logs.total') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 text-right", children: t('admin.logs.ms') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 text-center", children: t('admin.logs.status') }) ] }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("tbody", { className: "divide-y divide-gray-100", children: logs.map((log)=>{ var _log_inputTokens, _log_outputTokens, _log_totalTokens, _log_durationMs, _log_error; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("tr", { className: "bg-white hover:bg-gray-50", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3 text-gray-500 whitespace-nowrap", children: new Date(log.createdAt).toLocaleString(dateLocale) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "px-2 py-0.5 rounded-full text-xs font-medium ".concat(log.provider === 'anthropic' ? 'bg-purple-100 text-purple-700' : 'bg-green-100 text-green-700'), children: log.provider }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3 text-gray-600 font-mono text-xs", children: log.model }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3 text-gray-600", children: log.action }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3 text-gray-500", children: log.fromLocale && log.toLocale ? "".concat(log.fromLocale, " → ").concat(log.toLocale) : '—' }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3 text-right text-gray-600", children: (_log_inputTokens = log.inputTokens) !== null && _log_inputTokens !== void 0 ? _log_inputTokens : '—' }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3 text-right text-gray-600", children: (_log_outputTokens = log.outputTokens) !== null && _log_outputTokens !== void 0 ? _log_outputTokens : '—' }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3 text-right font-medium", children: (_log_totalTokens = log.totalTokens) !== null && _log_totalTokens !== void 0 ? _log_totalTokens : '—' }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3 text-right text-gray-500", children: (_log_durationMs = log.durationMs) !== null && _log_durationMs !== void 0 ? _log_durationMs : '—' }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3 text-center", children: log.success ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-green-600 flex justify-center", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("polyline", { points: "20 6 9 17 4 12" }) }) }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-red-500 flex justify-center", title: (_log_error = log.error) !== null && _log_error !== void 0 ? _log_error : '', children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: "18", y1: "6", x2: "6", y2: "18" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: "6", y1: "6", x2: "18", y2: "18" }) ] }) }) }) ] }, log.id); }) }) ] }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Pagination, { page: logsPage, total: logsTotal, limit: 50, onChange: setLogsPage, totalLabel: t('admin.pagination.total') }) ] }), logsSubTab === 'activity' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-4 mb-4 flex flex-wrap gap-3 items-end", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs font-medium text-gray-500 mb-1", children: t('admin.activity.event') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("select", { value: activityEvent, onChange: (e)=>setActivityEvent(e.target.value), className: "border border-gray-300 rounded-lg px-3 py-1.5 text-sm min-w-[180px]", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "", children: t('admin.activity.all_events') }), activityEventTypes.map((ev)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: ev, children: ev }, ev)) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs font-medium text-gray-500 mb-1", children: t('admin.activity.from') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "date", value: activityDateFrom, onChange: (e)=>setActivityDateFrom(e.target.value), className: "border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs font-medium text-gray-500 mb-1", children: t('admin.activity.to') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "date", value: activityDateTo, onChange: (e)=>setActivityDateTo(e.target.value), className: "border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), (activityEvent || activityDateFrom || activityDateTo || activityUserId) && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { onClick: ()=>{ setActivityEvent(''); setActivityDateFrom(''); setActivityDateTo(''); setActivityUserId(''); }, 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: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-3 h-3", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: "18", y1: "6", x2: "6", y2: "18" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: "6", y1: "6", x2: "18", y2: "18" }) ] }), t('admin.activity.reset') ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { className: "text-xs text-gray-400 self-end ml-auto", children: [ t('admin.activity.total'), ": ", activityTotal ] }) ] }), activityLog.length === 0 ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-center py-10 text-gray-400", children: t('admin.activity.empty') }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "space-y-2", children: activityLog.map((entry)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(ActivityLogRow, { entry: entry, dateLocale: dateLocale, onFilterUser: (id)=>{ setActivityUserId(id); setActivityEvent(''); }, t: t }, entry.id)) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Pagination, { page: activityPage, total: activityTotal, limit: 50, onChange: setActivityPage, totalLabel: t('admin.pagination.total') }) ] }), logsSubTab === 'mail' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-4 mb-4 flex flex-wrap gap-3 items-end", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs font-medium text-gray-500 mb-1", children: t('admin.mail.event') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("select", { value: mailEvent, onChange: (e)=>setMailEvent(e.target.value), className: "border border-gray-300 rounded-lg px-3 py-1.5 text-sm min-w-[200px]", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "", children: t('admin.mail.all_events') }), mailEventTypes.map((ev)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: ev, children: t("admin.event.".concat(ev.replace(/\./g, '_')), ev) }, ev)) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs font-medium text-gray-500 mb-1", children: t('admin.mail.from') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "date", value: mailDateFrom, onChange: (e)=>setMailDateFrom(e.target.value), className: "border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs font-medium text-gray-500 mb-1", children: t('admin.mail.to') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "date", value: mailDateTo, onChange: (e)=>setMailDateTo(e.target.value), className: "border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), (mailEvent || mailDateFrom || mailDateTo) && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { onClick: ()=>{ setMailEvent(''); setMailDateFrom(''); setMailDateTo(''); }, 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: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-3 h-3", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: "18", y1: "6", x2: "6", y2: "18" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: "6", y1: "6", x2: "18", y2: "18" }) ] }), t('admin.mail.reset') ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { className: "text-xs text-gray-400 self-end ml-auto", children: [ t('admin.mail.total'), ": ", mailTotal ] }) ] }), mailLog.length === 0 ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-center py-10 text-gray-400", children: t('admin.mail.empty') }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "overflow-x-auto rounded-xl border border-gray-200", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("table", { className: "w-full text-sm", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("thead", { className: "bg-gray-50 text-gray-500 text-xs uppercase", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("tr", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 text-left", children: t('admin.logs.date') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 text-left", children: t('admin.mail.recipient') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 text-left", children: t('admin.mail.event') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 text-left", children: t('admin.mail.provider') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 text-left", children: t('admin.mail.details') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 text-center", children: t('admin.mail.status') }) ] }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("tbody", { className: "divide-y divide-gray-100", children: mailLog.map((entry)=>{ const details = parseLogDetails(entry.details); const provider = typeof (details === null || details === void 0 ? void 0 : details.provider) === 'string' ? details.provider : '—'; const recipient = typeof (details === null || details === void 0 ? void 0 : details.to) === 'string' ? details.to : entry.userEmail || '—'; const subject = typeof (details === null || details === void 0 ? void 0 : details.subject) === 'string' ? details.subject : ''; const error = typeof (details === null || details === void 0 ? void 0 : details.error) === 'string' ? details.error : ''; const success = entry.event === 'email.sent' || entry.event === 'admin.email.test.sent'; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("tr", { className: "bg-white hover:bg-gray-50 align-top", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3 text-gray-500 whitespace-nowrap", children: new Date(entry.createdAt).toLocaleString(dateLocale) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3 text-gray-700", children: recipient }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "px-2 py-0.5 rounded-full text-xs font-medium bg-sky-50 text-sky-700", children: t("admin.event.".concat(entry.event.replace(/\./g, '_')), entry.event) }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3 text-gray-600", children: provider }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3 text-gray-600 max-w-md", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "truncate", title: subject || error || undefined, children: subject || error || '—' }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3 text-center", children: success ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-green-600 inline-flex justify-center", title: t('admin.mail.success'), children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("polyline", { points: "20 6 9 17 4 12" }) }) }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-red-500 inline-flex justify-center", title: error || t('admin.mail.failed'), children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: "18", y1: "6", x2: "6", y2: "18" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: "6", y1: "6", x2: "18", y2: "18" }) ] }) }) }) ] }, entry.id); }) }) ] }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Pagination, { page: mailPage, total: mailTotal, limit: 50, onChange: setMailPage, totalLabel: t('admin.pagination.total') }) ] }), logsSubTab === 'notifications' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-4 mb-4 flex flex-wrap gap-3 items-end", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs font-medium text-gray-500 mb-1", children: t('admin.notif_logs.type') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("select", { value: notifLogsType, onChange: (e)=>setNotifLogsType(e.target.value), className: "border border-gray-300 rounded-lg px-3 py-1.5 text-sm min-w-[200px]", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "", children: t('admin.filter.all') }), notifLogsTypes.map((tp)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: tp, children: tp }, tp)) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs font-medium text-gray-500 mb-1", children: t('admin.activity.from') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "date", value: notifLogsDateFrom, onChange: (e)=>setNotifLogsDateFrom(e.target.value), className: "border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs font-medium text-gray-500 mb-1", children: t('admin.activity.to') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "date", value: notifLogsDateTo, onChange: (e)=>setNotifLogsDateTo(e.target.value), className: "border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), (notifLogsType || notifLogsDateFrom || notifLogsDateTo) && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { onClick: ()=>{ setNotifLogsType(''); setNotifLogsDateFrom(''); setNotifLogsDateTo(''); }, 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: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-3 h-3", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: "18", y1: "6", x2: "6", y2: "18" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: "6", y1: "6", x2: "18", y2: "18" }) ] }), t('admin.activity.reset') ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { className: "text-xs text-gray-400 self-end ml-auto", children: [ t('admin.pagination.total'), ": ", notifLogsTotal ] }) ] }), notifLogs.length === 0 ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-center py-10 text-gray-400", children: t('admin.notif_logs.empty') }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "overflow-x-auto rounded-xl border border-gray-200", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("table", { className: "w-full text-sm", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("thead", { className: "bg-gray-50 text-gray-500 text-xs uppercase", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("tr", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 text-left", children: t('admin.logs.date') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 text-left", children: t('admin.col.user') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 text-left", children: t('admin.notif_logs.type') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 text-left", children: t('admin.notif_logs.title') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 text-center", children: t('admin.notif_logs.read') }) ] }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("tbody", { className: "divide-y divide-gray-100", children: notifLogs.map((n)=>{ var _n_recipientName, _ref; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("tr", { className: "bg-white hover:bg-gray-50", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3 text-gray-500 whitespace-nowrap", children: new Date(n.createdAt).toLocaleString(dateLocale) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3 text-gray-700", children: (_ref = (_n_recipientName = n.recipientName) !== null && _n_recipientName !== void 0 ? _n_recipientName : n.recipientEmail) !== null && _ref !== void 0 ? _ref : n.recipientId }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "px-2 py-0.5 rounded-full text-xs font-medium bg-green-50 text-green-700", children: n.type }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3 text-gray-600 max-w-xs truncate", children: n.title }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3 text-center", children: n.isRead ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-green-600 flex justify-center", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("polyline", { points: "20 6 9 17 4 12" }) }) }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-gray-400 flex justify-center", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("circle", { cx: "12", cy: "12", r: "10" }) }) }) }) ] }, n.id); }) }) ] }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Pagination, { page: notifLogsPage, total: notifLogsTotal, limit: 50, onChange: setNotifLogsPage, totalLabel: t('admin.pagination.total') }) ] }) ] }), tab === 'plans' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-between mb-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("h2", { className: "text-lg font-semibold text-gray-800 flex items-center gap-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-5 h-5 text-green-600", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("rect", { x: "1", y: "4", width: "22", height: "16", rx: "2", ry: "2" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: "1", y1: "10", x2: "23", y2: "10" }) ] }), t('admin.plans.title') ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: openAddPlan, className: "bg-green-600 text-white text-sm px-4 py-2 rounded-lg hover:bg-green-700 font-medium", children: t('admin.plans.add') }) ] }), planForm && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white border border-gray-200 rounded-xl p-5 mb-4 space-y-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h3", { className: "font-semibold text-gray-800", children: planForm.id ? t('admin.plans.form.edit') : t('admin.plans.form.new') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "grid grid-cols-2 gap-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.name') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: planForm.name, onChange: (e)=>setPlanForm({ ...planForm, name: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.price') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "number", min: "0", step: "0.01", value: planForm.price, onChange: (e)=>setPlanForm({ ...planForm, price: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.old_price') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "number", min: "0", step: "0.01", value: (_planForm_oldPrice = planForm.oldPrice) !== null && _planForm_oldPrice !== void 0 ? _planForm_oldPrice : '', onChange: (e)=>setPlanForm({ ...planForm, oldPrice: e.target.value }), placeholder: "—", className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.tier') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("select", { value: planForm.tier, onChange: (e)=>setPlanForm({ ...planForm, tier: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "free", children: t('admin.plans.form.tier.free') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "pro", children: t('admin.plans.form.tier.pro') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "ultimate", children: t('admin.plans.form.tier.ultimate') }) ] }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.description') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: planForm.description, onChange: (e)=>setPlanForm({ ...planForm, description: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs font-semibold text-gray-500 uppercase tracking-wide pt-1", children: t('admin.plans.form.section.limits') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "grid grid-cols-3 gap-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.max_tasks') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "number", min: "0", placeholder: "∞", value: planForm.maxTasks, onChange: (e)=>setPlanForm({ ...planForm, maxTasks: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.max_offers') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "number", min: "0", placeholder: "∞", value: planForm.maxOffers, onChange: (e)=>setPlanForm({ ...planForm, maxOffers: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.max_cards') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "number", min: "0", placeholder: "∞", value: planForm.maxCards, onChange: (e)=>setPlanForm({ ...planForm, maxCards: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.max_messages_day') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "number", min: "0", placeholder: "∞", value: planForm.maxMessagesPerDay, onChange: (e)=>setPlanForm({ ...planForm, maxMessagesPerDay: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.max_orders_day') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "number", min: "0", placeholder: "∞", value: planForm.maxOrdersPerDay, onChange: (e)=>setPlanForm({ ...planForm, maxOrdersPerDay: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.max_skills') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "number", min: "0", placeholder: "∞", value: planForm.maxSkills, onChange: (e)=>setPlanForm({ ...planForm, maxSkills: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.duration_days') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "number", min: "0", placeholder: "∞", value: planForm.durationDays, onChange: (e)=>setPlanForm({ ...planForm, durationDays: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs font-semibold text-gray-500 uppercase tracking-wide pt-1", children: t('admin.plans.form.section.boost') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "grid grid-cols-2 gap-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.search_boost') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "number", min: "0", value: planForm.searchBoost, onChange: (e)=>setPlanForm({ ...planForm, searchBoost: Number(e.target.value) }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.offers_multiplier') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "number", min: "0", step: "0.01", value: planForm.offersMultiplier, onChange: (e)=>setPlanForm({ ...planForm, offersMultiplier: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.features') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("textarea", { rows: 3, value: planForm.features, onChange: (e)=>setPlanForm({ ...planForm, features: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 resize-none" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs font-semibold text-gray-500 uppercase tracking-wide pt-1", children: t('admin.plans.form.section.contact') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "grid grid-cols-2 gap-2", children: [ [ 'canContactFreePlan', t('admin.plans.form.can_contact_free') ], [ 'canContactProPlan', t('admin.plans.form.can_contact_pro') ], [ 'canContactAll', t('admin.plans.form.can_contact_all') ], [ 'canShowContactInfo', t('admin.plans.form.can_show_contact') ], [ 'canViewPhone', t('admin.plans.form.can_view_phone') ] ].map((param)=>{ let [key, label] = param; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "flex items-center gap-2 cursor-pointer text-sm text-gray-700", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "checkbox", checked: planForm[key], onChange: (e)=>setPlanForm({ ...planForm, [key]: e.target.checked }), className: "w-4 h-4 rounded text-green-600" }), label ] }, key); }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs font-semibold text-gray-500 uppercase tracking-wide pt-1", children: t('admin.plans.form.section.features') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "grid grid-cols-2 gap-2", children: [ [ 'notifyNewTasks', t('admin.plans.form.notify') ], [ 'canUploadVideo', t('admin.plans.form.upload_video') ], [ 'hasFavorites', t('admin.plans.form.favorites') ], [ 'hasGoogleCalendar', t('admin.plans.form.google_calendar') ], [ 'hasVerifiedBadge', t('admin.plans.form.verified_badge') ], [ 'highlightedReviews', t('admin.plans.form.highlighted_reviews') ], [ 'hasPersonalSite', t('admin.plans.form.personal_site') ], [ 'hasCanHelpNowStatus', t('admin.plans.form.can_help_now') ], [ 'hasNeedHelpStatus', t('admin.plans.form.need_help') ], [ 'hasAutoResponse', t('admin.plans.form.auto_response') ], [ 'hasAutoMatch', t('admin.plans.form.auto_match') ], [ 'hasPriceList', t('admin.plans.form.price_list') ], [ 'receiveInstantDispatchFree', t('admin.plans.form.instant_dispatch_free') ], [ 'receiveInstantDispatchPro', t('admin.plans.form.instant_dispatch_pro') ] ].map((param)=>{ let [key, label] = param; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "flex items-center gap-2 cursor-pointer text-sm text-gray-700", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "checkbox", checked: planForm[key], onChange: (e)=>setPlanForm({ ...planForm, [key]: e.target.checked }), className: "w-4 h-4 rounded text-green-600" }), label ] }, key); }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-6 pt-1", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "flex items-center gap-2 cursor-pointer text-sm text-gray-700", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "checkbox", checked: planForm.isDefault, onChange: (e)=>setPlanForm({ ...planForm, isDefault: e.target.checked }), className: "w-4 h-4 rounded text-green-600" }), t('admin.plans.form.default') ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "flex items-center gap-2 cursor-pointer text-sm text-gray-700", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "checkbox", checked: planForm.isActive, onChange: (e)=>setPlanForm({ ...planForm, isActive: e.target.checked }), className: "w-4 h-4 rounded text-green-600" }), t('admin.plans.form.active') ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "text-xs text-gray-600", children: t('admin.plans.form.order') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "number", value: planForm.order, onChange: (e)=>setPlanForm({ ...planForm, order: Number(e.target.value) }), className: "w-16 border border-gray-300 rounded-lg px-2 py-1 text-sm focus:outline-none" }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-2 pt-1", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: savePlan, disabled: planSaving || !planForm.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: planSaving ? '...' : t('common.save') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>setPlanForm(null), className: "px-4 py-2 rounded-lg text-sm font-medium text-gray-600 hover:bg-gray-100", children: t('common.cancel') }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "bg-white rounded-xl border border-gray-200 overflow-hidden", children: planRows.length === 0 ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "px-4 py-8 text-center text-gray-400 text-sm", children: t('admin.plans.empty') }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "divide-y divide-gray-100", children: planRows.sort((a, b)=>{ var _a_order, _b_order; return ((_a_order = a.order) !== null && _a_order !== void 0 ? _a_order : 0) - ((_b_order = b.order) !== null && _b_order !== void 0 ? _b_order : 0); }).map((plan)=>{ var _plan_features; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-start gap-4 px-4 py-4 ".concat(!plan.isActive ? 'opacity-50' : ''), children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-2 flex-wrap", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "font-semibold text-gray-900", children: plan.name }), plan.isDefault && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "bg-green-100 text-green-700 text-xs px-2 py-0.5 rounded-full font-medium", children: t('admin.plans.badge.default') }), !plan.isActive && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "bg-gray-100 text-gray-500 text-xs px-2 py-0.5 rounded-full", children: t('admin.plans.badge.inactive') }) ] }), plan.description && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-gray-500 mt-0.5", children: plan.description }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex flex-wrap gap-3 mt-1 text-xs text-gray-500", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "flex items-center gap-1.5 font-semibold text-gray-800", children: [ plan.oldPrice && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "font-normal text-gray-400 line-through", children: [ plan.oldPrice, " ", plan.currency ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { children: [ plan.price, " ", plan.currency ] }) ] }), plan.maxTasks != null && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { children: [ t('admin.plans.tasks'), ": ", plan.maxTasks ] }), plan.maxOffers != null && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { children: [ t('admin.plans.offers'), ": ", plan.maxOffers ] }), plan.maxCards != null && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { children: [ t('admin.plans.cards'), ": ", plan.maxCards ] }), plan.notifyNewTasks && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "text-green-700 flex items-center gap-1", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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" }) }), t('admin.plans.notify_tasks') ] }) ] }), ((_plan_features = plan.features) !== null && _plan_features !== void 0 ? _plan_features : []).length > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("ul", { className: "mt-1.5 space-y-0.5", children: plan.features.map((f, i)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("li", { className: "text-xs text-gray-600 flex items-center gap-1.5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-green-500", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3 h-3", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("polyline", { points: "20 6 9 17 4 12" }) }) }), " ", f ] }, i)) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-1 shrink-0", children: [ !plan.isDefault && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updatePlan */ .td(plan.id, { isDefault: true }).then(()=>_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminPlans */ .OX().then(setPlanRows)).catch(()=>{}), className: "text-xs px-2 py-1 rounded-lg bg-green-50 text-green-600 hover:bg-green-100 font-medium", title: t('admin.plans.make_default'), children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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" }) }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>openEditPlan(plan), className: "text-xs px-2 py-1 rounded-lg bg-gray-100 text-gray-600 hover:bg-gray-200 font-medium", children: t('common.edit') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>deletePlan(plan.id, plan.name), className: "text-xs px-2 py-1 rounded-lg bg-red-50 text-red-600 hover:bg-red-100 font-medium", children: t('common.delete') }) ] }) ] }, plan.id); }) }) }) ] }), tab === 'settings' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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((st)=>{ const labels = { general: t('admin.settings.tab.general'), smtp: t('admin.settings.tab.smtp'), notifications: t('admin.settings.tab.notifications'), payment: t('admin.settings.tab.payment'), referral: t('admin.settings.tab.referral'), seo: t('admin.settings.tab.seo'), socials: t('admin.settings.tab.socials'), telegram: t('admin.settings.tab.telegram') }; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>setSettingsTab(st), className: "px-4 py-2 rounded-lg text-sm font-medium transition ".concat(settingsTab === st ? 'bg-green-600 text-white shadow-sm' : 'text-gray-600 hover:bg-gray-100'), children: labels[st] }, st); }) }), settingsTab === 'general' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-6 max-w-lg", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h3", { className: "font-semibold text-gray-800 mb-5", children: t('admin.settings.general.title') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.general.site_name') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: generalForm.siteName, onChange: (e)=>setGeneralForm((f)=>({ ...f, siteName: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400", placeholder: "CanHelp" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.general.site_url') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: generalForm.siteUrl, onChange: (e)=>setGeneralForm((f)=>({ ...f, siteUrl: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400", placeholder: "https://canhelp.com" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.general.contact_email') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "email", value: generalForm.contactEmail, onChange: (e)=>setGeneralForm((f)=>({ ...f, contactEmail: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400", placeholder: "contact@canhelp.com" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.general.support_phone') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: generalForm.supportPhone, onChange: (e)=>setGeneralForm((f)=>({ ...f, supportPhone: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400", placeholder: "+30 21 000 0000" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: saveGeneralSettings, disabled: generalSaving, 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: generalSaving ? t('admin.settings.saving') : generalSaved ? t('admin.settings.saved') : t('common.save') }) ] }) ] }), settingsTab === 'smtp' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-6 max-w-lg", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h3", { className: "font-semibold text-gray-800 mb-1", children: t('admin.settings.smtp.title') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-gray-400 mb-5", children: t('admin.settings.smtp.hint') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "grid grid-cols-3 gap-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "col-span-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.smtp.host') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: smtpForm.host, onChange: (e)=>setSmtpForm((f)=>({ ...f, host: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400", placeholder: "smtp.gmail.com" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.smtp.port') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: smtpForm.port, onChange: (e)=>setSmtpForm((f)=>({ ...f, port: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400", placeholder: "587" }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.smtp.encryption') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("select", { value: smtpForm.encryption, onChange: (e)=>setSmtpForm((f)=>({ ...f, encryption: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "none", children: t('admin.settings.smtp.enc.none') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "tls", children: "STARTTLS (587)" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "ssl", children: "SSL/TLS (465)" }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.smtp.username') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: smtpForm.username, onChange: (e)=>setSmtpForm((f)=>({ ...f, username: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400", placeholder: "user@gmail.com", autoComplete: "off" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.smtp.password') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "password", value: smtpForm.password, onChange: (e)=>setSmtpForm((f)=>({ ...f, password: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400", autoComplete: "new-password", placeholder: "••••••••••••" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "grid grid-cols-2 gap-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.smtp.from_name') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: smtpForm.fromName, onChange: (e)=>setSmtpForm((f)=>({ ...f, fromName: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400", placeholder: "CanHelp" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.smtp.from_email') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "email", value: smtpForm.fromEmail, onChange: (e)=>setSmtpForm((f)=>({ ...f, fromEmail: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400", placeholder: "noreply@canhelp.com" }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: saveSmtpSettings, disabled: smtpSaving, 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: smtpSaving ? t('admin.settings.saving') : smtpSaved ? t('admin.settings.saved') : t('common.save') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: async ()=>{ setTestEmailSending(true); setTestEmailResult(null); try { const res = await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .sendTestEmail */ .FI(); setTestEmailResult("✓ Sent to ".concat(res.to)); } catch (e) { setTestEmailResult("✗ Error: ".concat(e.message)); } finally{ setTestEmailSending(false); setTimeout(()=>setTestEmailResult(null), 5000); } }, disabled: testEmailSending, 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: testEmailSending ? t('admin.settings.smtp.sending') : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "flex items-center justify-center gap-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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" }) }), t('admin.settings.smtp.test') ] }) }), testEmailResult && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-center font-medium ".concat(testEmailResult.startsWith('✓') ? 'text-green-600' : 'text-red-500'), children: testEmailResult }) ] }) ] }), settingsTab === 'payment' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-6 max-w-lg", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-between mb-5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h3", { className: "font-semibold text-gray-800", children: "ePay — Piraeus Bank" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400", children: "ГреческОй платёжМый шлюз" }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "flex items-center gap-2 cursor-pointer", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-sm text-gray-500", children: t('admin.settings.active') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>setEPayForm((f)=>({ ...f, enabled: !f.enabled })), className: "relative w-10 h-6 rounded-full p-0 transition-colors cursor-pointer ".concat(ePayForm.enabled ? 'bg-green-600' : 'bg-gray-300'), children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "absolute left-0 top-1 w-4 h-4 bg-white rounded-full shadow transition-transform ".concat(ePayForm.enabled ? 'translate-x-5' : 'translate-x-1') }) }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.env.label') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("select", { value: ePayForm.environment, onChange: (e)=>setEPayForm((f)=>({ ...f, environment: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "test", children: t('admin.settings.env.test') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "production", children: t('admin.settings.env.prod') }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.merchant_id') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: ePayForm.merchantId, onChange: (e)=>setEPayForm((f)=>({ ...f, merchantId: e.target.value })), placeholder: t('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" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "grid grid-cols-2 gap-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: "API User" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: ePayForm.apiUser, onChange: (e)=>setEPayForm((f)=>({ ...f, apiUser: e.target.value })), autoComplete: "off", className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: "API Password" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "password", value: ePayForm.apiPassword, onChange: (e)=>setEPayForm((f)=>({ ...f, apiPassword: e.target.value })), autoComplete: "new-password", className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: "Confirmation URL (webhook)" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: ePayForm.confirmationUrl, onChange: (e)=>setEPayForm((f)=>({ ...f, confirmationUrl: e.target.value })), placeholder: "https://yoursite.com/api/payments/epay/confirm", className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: "Cancel URL" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: ePayForm.cancelUrl, onChange: (e)=>setEPayForm((f)=>({ ...f, cancelUrl: e.target.value })), placeholder: "https://yoursite.com/payment/cancelled", className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-3 mt-5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: saveEPaySettings, disabled: ePaySaving, className: "px-5 py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700 disabled:opacity-50", children: ePaySaving ? t('admin.settings.saving') : t('common.save') }), ePaySaved && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-sm text-green-600", children: t('admin.settings.saved') }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-4 h-4 shrink-0 mt-0.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("circle", { cx: "12", cy: "12", r: "10" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: "12", y1: "8", x2: "12", y2: "12" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: "12", y1: "16", x2: "12.01", y2: "16" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { children: t('admin.settings.payment.hint') }) ] }) ] }), settingsTab === 'notifications' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-3 max-w-2xl", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-4 h-4 shrink-0 mt-0.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("circle", { cx: "12", cy: "12", r: "10" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: "12", y1: "8", x2: "12", y2: "12" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: "12", y1: "16", x2: "12.01", y2: "16" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { children: [ t('admin.notif.vars_hint'), ' ', TEMPLATE_HINT_VARS.map((name)=>{ const v = "{{".concat(name, "}}"); return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("code", { className: "mx-0.5 bg-green-100 text-gray-800 px-1.5 py-0.5 rounded text-xs font-mono", children: v }, v); }) ] }) ] }), [ { key: 'email_verification', label: t('admin.notif.email_verification'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: t('admin.notif.registration_success'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: t('admin.notif.password_reset'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: t('admin.notif.new_offer'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: t('admin.notif.new_task'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: t('admin.notif.offer_accepted'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" }) }) }, { key: 'new_message', label: t('admin.notif.new_message'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: t('admin.notif.offer_declined'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: t('admin.notif.offer_other_accepted'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: t('admin.notif.task_updated'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: t('admin.notif.deadline_reminder'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: t('admin.notif.task_archived'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: t('admin.notif.referral_reward'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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" }) }) }, // ── Plan / subscription emails ───────────────────────────── { key: 'plan_activated', label: t('admin.email_template.plan_activated'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: t('admin.email_template.plan_upgraded'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 10l7-7m0 0l7 7m-7-7v18" }) }) }, { key: 'plan_downgrade_scheduled', label: t('admin.email_template.plan_downgrade_scheduled'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: t('admin.email_template.plan_downgrade_applied'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19 14l-7 7m0 0l-7-7m7 7V3" }) }) }, { key: 'plan_renewal_reminder', label: t('admin.email_template.plan_renewal_reminder'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: t('admin.email_template.plan_insufficient_funds'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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((param)=>{ let { key, label, icon } = param; const localeKey = "".concat(key, "_").concat(templateLocale); var _notifTemplates_localeKey, _ref; const tmpl = (_ref = (_notifTemplates_localeKey = notifTemplates[localeKey]) !== null && _notifTemplates_localeKey !== void 0 ? _notifTemplates_localeKey : notifTemplates[key]) !== null && _ref !== void 0 ? _ref : { subject: '', body: '' }; const isEditing = editingTemplate === key; var _TEMPLATE_VARS_key; const templateVars = (_TEMPLATE_VARS_key = TEMPLATE_VARS[key]) !== null && _TEMPLATE_VARS_key !== void 0 ? _TEMPLATE_VARS_key : []; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 overflow-hidden", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-3 px-5 py-4 cursor-pointer hover:bg-gray-50 select-none", onClick: ()=>setEditingTemplate(isEditing ? null : key), children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-xl shrink-0", children: icon }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "font-medium text-gray-800 text-sm", children: label }), tmpl.subject ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "text-xs text-gray-400 mt-0.5 truncate", children: [ t('admin.notif.tmpl.subject_label'), ": ", tmpl.subject ] }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-xs text-gray-300 mt-0.5 italic", children: t('admin.notif.tmpl.not_set') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-gray-400 transition-transform ".concat(isEditing ? 'rotate-90' : ''), children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("polyline", { points: "9 18 15 12 9 6" }) }) }) ] }), isEditing && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "px-5 pb-5 border-t border-gray-100 pt-4 space-y-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex gap-1 pb-2", children: [ 'el', 'en', 'uk', 'ru' ].map((loc)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>setTemplateLocale(loc), className: "px-3 py-1 text-xs font-medium rounded-md transition-colors ".concat(templateLocale === loc ? 'bg-green-600 text-white' : 'bg-gray-100 text-gray-600 hover:bg-gray-200'), children: loc === 'el' ? 'ΕλληΜικά' : loc === 'en' ? 'English' : loc === 'uk' ? 'УкраїМська' : 'РусскОй' }, loc)) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.notif.tmpl.subject_label') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: tmpl.subject, onChange: (e)=>setNotifTemplates((prev)=>{ var _prev_localeKey; return { ...prev, [localeKey]: { ...(_prev_localeKey = prev[localeKey]) !== null && _prev_localeKey !== void 0 ? _prev_localeKey : { subject: '', body: '' }, subject: e.target.value } }; }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.notif.tmpl.body_label') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("textarea", { rows: 7, value: tmpl.body, onChange: (e)=>setNotifTemplates((prev)=>{ var _prev_localeKey; return { ...prev, [localeKey]: { ...(_prev_localeKey = prev[localeKey]) !== null && _prev_localeKey !== void 0 ? _prev_localeKey : { subject: '', body: '' }, body: e.target.value } }; }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 font-mono resize-y", placeholder: "

УважаеЌый {{userName}},

..." }) ] }), templateVars.length > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "rounded-lg border border-amber-200 bg-amber-50 px-3 py-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-xs font-medium text-amber-800 mb-1", children: t('admin.notif.vars_hint') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex flex-wrap gap-1.5", children: templateVars.map((name)=>{ const variable = "{{".concat(name, "}}"); return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("code", { className: "bg-amber-100 text-amber-900 px-1.5 py-0.5 rounded text-xs font-mono", children: variable }, variable); }) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-2 flex-wrap", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>saveTemplate(key), disabled: templateSaving || templateTranslating, className: "px-4 py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700 disabled:opacity-50", children: templateSaving ? t('admin.notif.tmpl.saving') : t('admin.notif.tmpl.save') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { onClick: ()=>autoTranslateTemplate(key), disabled: templateSaving || templateTranslating, 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: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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" }) }), templateTranslating ? t('admin.notif.tmpl.translating') : t('admin.notif.tmpl.translate') ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>setEditingTemplate(null), className: "px-4 py-2 bg-gray-100 text-gray-700 rounded-lg text-sm font-medium hover:bg-gray-200", children: t('admin.notif.tmpl.close') }) ] }) ] }) ] }, key); }) ] }), settingsTab === 'referral' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-6 max-w-lg space-y-5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h3", { className: "font-semibold text-gray-800", children: t('admin.settings.referral.title') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-gray-400 mt-1", children: t('admin.settings.referral.hint') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-between", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm font-medium text-gray-700", children: t('admin.settings.referral.enabled_label') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400", children: t('admin.settings.referral.enabled_hint') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>setReferralForm((f)=>({ ...f, enabled: !f.enabled })), className: "relative w-10 h-6 rounded-full p-0 transition-colors cursor-pointer ".concat(referralForm.enabled ? 'bg-green-600' : 'bg-gray-300'), children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "absolute left-0 top-1 w-4 h-4 bg-white rounded-full shadow transition-transform ".concat(referralForm.enabled ? 'translate-x-5' : 'translate-x-1') }) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "border border-gray-100 rounded-lg p-4 space-y-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs font-semibold text-gray-500 uppercase tracking-wide", children: t('admin.settings.referral.shared_section') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.referral.plan_label') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("select", { value: referralForm.planId, onChange: (e)=>setReferralForm((f)=>({ ...f, planId: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "", children: t('admin.settings.referral.no_plan') }), planRows.map((p)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: p.id, children: p.name }, p.id)) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400 mt-1", children: t('admin.settings.referral.plan_hint') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.referral.days_label') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "number", min: "1", max: "365", value: referralForm.days, onChange: (e)=>setReferralForm((f)=>({ ...f, days: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400 mt-1", children: t('admin.settings.referral.days_hint') }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: saveReferralSettings, disabled: referralSaving, className: "px-5 py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700 disabled:opacity-50", children: referralSaving ? t('admin.settings.saving') : t('common.save') }), referralSaved && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-sm text-green-600", children: t('admin.settings.saved') }) ] }) ] }), settingsTab === 'socials' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-6 max-w-lg space-y-5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h3", { className: "font-semibold text-gray-800 mb-1", children: t('admin.settings.socials.title') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400", children: t('admin.settings.socials.hint') }) ] }), [ { key: 'telegram', label: 'Telegram', placeholder: 'https://t.me/yourname', icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4", viewBox: "0 0 24 24", fill: "currentColor", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4", viewBox: "0 0 24 24", fill: "currentColor", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4", viewBox: "0 0 24 24", fill: "currentColor", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4", viewBox: "0 0 24 24", fill: "currentColor", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4", viewBox: "0 0 24 24", fill: "currentColor", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4", viewBox: "0 0 24 24", fill: "currentColor", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4", viewBox: "0 0 24 24", fill: "currentColor", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4", viewBox: "0 0 24 24", fill: "currentColor", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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((param)=>{ let { key, label, placeholder, icon } = param; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "block text-sm font-medium text-gray-700 mb-1 flex items-center gap-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "".concat(socialForm[key] ? 'text-green-600' : 'text-gray-300'), children: icon }), label, !socialForm[key] && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-xs font-normal text-gray-400 ml-auto", children: "Ме запПлМеМП" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "url", value: socialForm[key], onChange: (e)=>setSocialForm((f)=>({ ...f, [key]: e.target.value })), placeholder: placeholder, className: "w-full border rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 ".concat(socialForm[key] ? 'border-green-300 bg-green-50/30' : 'border-gray-300') }) ] }, key); }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-3 pt-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: saveSocialSettings, disabled: socialSaving, className: "px-5 py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700 disabled:opacity-50", children: socialSaving ? t('admin.settings.saving') : t('common.save') }), socialSaved && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-sm text-green-600", children: t('admin.settings.saved') }) ] }) ] }), settingsTab === 'seo' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-6 max-w-lg space-y-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h3", { className: "font-semibold text-gray-800", children: t('admin.settings.seo.title') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-between", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm font-medium text-gray-700", children: t('admin.settings.seo.maintenance_label') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400 mt-0.5", children: t('admin.settings.seo.maintenance_hint') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>setSeoForm((f)=>({ ...f, maintenanceMode: !f.maintenanceMode })), className: "relative w-10 h-6 rounded-full p-0 transition-colors cursor-pointer flex-shrink-0 ".concat(seoForm.maintenanceMode ? 'bg-red-500' : 'bg-gray-300'), children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "absolute left-0 top-1 w-4 h-4 bg-white rounded-full shadow transition-transform ".concat(seoForm.maintenanceMode ? 'translate-x-5' : 'translate-x-1') }) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-between", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm font-medium text-gray-700", children: t('admin.settings.seo.indexing_label') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400 mt-0.5", children: t('admin.settings.seo.indexing_hint') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>setSeoForm((f)=>({ ...f, indexingEnabled: !f.indexingEnabled })), className: "relative w-10 h-6 rounded-full p-0 transition-colors cursor-pointer flex-shrink-0 ".concat(seoForm.indexingEnabled ? 'bg-green-600' : 'bg-gray-300'), children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "absolute left-0 top-1 w-4 h-4 bg-white rounded-full shadow transition-transform ".concat(seoForm.indexingEnabled ? 'translate-x-5' : 'translate-x-1') }) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "space-y-4", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { className: "text-sm font-medium text-gray-700 mb-2", children: [ t('admin.settings.seo.site_title_label'), " / ", t('admin.settings.seo.site_description_label') ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex gap-1 mb-3", children: [ { code: 'el', flag: '🇬🇷', label: 'EL' }, { code: 'en', flag: '🇬🇧', label: 'EN' }, { code: 'ru', flag: '🇷🇺', label: 'RU' }, { code: 'uk', flag: '🇺🇊', label: 'UK' } ].map((param)=>{ let { code, flag, label } = param; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { type: "button", onClick: ()=>setSeoLangTab(code), className: "flex items-center gap-1 px-3 py-1.5 rounded-lg text-sm font-medium transition-colors ".concat(seoLangTab === code ? 'bg-green-600 text-white' : 'bg-gray-100 text-gray-600 hover:bg-gray-200'), children: [ flag, " ", label ] }, code); }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs font-medium text-gray-500 mb-1", children: t('admin.settings.seo.site_title_label') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: seoForm["siteTitle".concat(seoLangTab.charAt(0).toUpperCase() + seoLangTab.slice(1))], onChange: (e)=>setSeoForm((f)=>({ ...f, ["siteTitle".concat(seoLangTab.charAt(0).toUpperCase() + seoLangTab.slice(1))]: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 mb-3", placeholder: seoLangTab === 'el' ? 'CanHelp — ΚάΞε άΜΞρωπος έχει κάτι Μα προσφέρει' : seoLangTab === 'en' ? 'CanHelp — Everyone has something valuable to offer' : seoLangTab === 'ru' ? 'CanHelp — КажЎый челПвек ЌПжет чеЌ-тП пПЌПчь' : 'CanHelp — КПжеМ Ќає МавОчку, яка ЌПже ЎПпПЌПгтО іМшПЌу' }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs font-medium text-gray-500 mb-1", children: t('admin.settings.seo.site_description_label') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("textarea", { rows: 3, value: seoForm["siteDescription".concat(seoLangTab.charAt(0).toUpperCase() + seoLangTab.slice(1))], onChange: (e)=>setSeoForm((f)=>({ ...f, ["siteDescription".concat(seoLangTab.charAt(0).toUpperCase() + seoLangTab.slice(1))]: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 resize-none", placeholder: seoLangTab === 'el' ? 'Η ελληΜική πλατφόρΌα για online αΜάΞεση εργασιώΜ...' : seoLangTab === 'en' ? 'The Greek platform for online task delegation...' : seoLangTab === 'ru' ? 'Греческая платфПрЌа Ўля ПМлайМ-пПОска спецОалОстПв...' : 'Грецька платфПрЌа Ўля пПшуку фахівців ПМлайМ...' }) ] }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.seo.head_scripts_label') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400 mb-2", children: t('admin.settings.seo.head_scripts_hint') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("textarea", { rows: 6, value: seoForm.headScripts, onChange: (e)=>setSeoForm((f)=>({ ...f, headScripts: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm font-mono focus:outline-none focus:ring-2 focus:ring-blue-400 resize-y", placeholder: '\n', spellCheck: false }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: saveSeoSettings, disabled: seoSaving, className: "px-5 py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700 disabled:opacity-50", children: seoSaving ? t('admin.settings.saving') : t('common.save') }), seoSaved && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-sm text-green-600", children: t('admin.settings.saved') }) ] }) ] }), settingsTab === 'telegram' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-6 max-w-lg space-y-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h3", { className: "font-semibold text-gray-800 mb-1", children: t('admin.settings.telegram.title') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400", children: t('admin.settings.telegram.help') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.telegram.bot_token') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "text", value: telegramForm.botToken, onChange: (e)=>{ setTelegramForm((f)=>({ ...f, botToken: e.target.value })); setVerifyResultTelegramToken(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" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: verifyTelegramToken, disabled: verifyingTelegramToken || !telegramForm.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: verifyingTelegramToken ? '...' : t('admin.settings.telegram.verify') }) ] }), verifyResultTelegramToken && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs mt-1 font-medium ".concat(verifyResultTelegramToken.ok ? 'text-green-600' : 'text-red-500'), children: verifyResultTelegramToken.ok ? "✓ ".concat(verifyResultTelegramToken.msg) : "✗ ".concat(verifyResultTelegramToken.msg) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.telegram.admin_chat_id') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "text", value: telegramForm.adminChatId, onChange: (e)=>setTelegramForm((f)=>({ ...f, adminChatId: e.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" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>testTelegram('admin'), disabled: testingTelegramAdmin || !telegramForm.botToken || !telegramForm.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: testingTelegramAdmin ? '...' : t('admin.settings.telegram.test') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400 mt-1", children: t('admin.settings.telegram.admin_chat_hint') }), testResultTelegramAdmin && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs mt-1 font-medium ".concat(testResultTelegramAdmin.ok ? 'text-green-600' : 'text-red-500'), children: testResultTelegramAdmin.ok ? "✓ ".concat(testResultTelegramAdmin.msg) : "✗ ".concat(testResultTelegramAdmin.msg) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700", children: t('admin.settings.telegram.channels_title') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400 -mt-2", children: t('admin.settings.telegram.channel_hint') }), [ { locale: 'el', flag: '🇬🇷', label: 'ΕλληΜικά', field: 'channelIdEl' }, { locale: 'en', flag: '🇬🇧', label: 'English', field: 'channelIdEn' }, { locale: 'ru', flag: '🇷🇺', label: 'РусскОй', field: 'channelIdRu' }, { locale: 'uk', flag: '🇺🇊', label: 'УкраїМська', field: 'channelIdUk' } ].map((param)=>{ let { locale: loc, flag, label, field } = param; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-1.5 mb-1", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-base leading-none", children: flag }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-xs font-medium text-gray-600", children: label }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "text", value: telegramForm[field], onChange: (e)=>setTelegramForm((f)=>({ ...f, [field]: e.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" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>testTelegram(loc), disabled: testingLocale === loc || !telegramForm.botToken || !telegramForm[field], className: "px-3 py-2 border border-gray-300 rounded-lg text-sm hover:bg-gray-50 disabled:opacity-40 flex-shrink-0", children: testingLocale === loc ? '...' : t('admin.settings.telegram.test') }) ] }), testResultChannels[loc] && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs mt-1 font-medium ".concat(testResultChannels[loc].ok ? 'text-green-600' : 'text-red-500'), children: testResultChannels[loc].ok ? "✓ ".concat(testResultChannels[loc].msg) : "✗ ".concat(testResultChannels[loc].msg) }) ] }, loc); }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-between", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm font-medium text-gray-700", children: t('admin.settings.telegram.notify_registrations') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400 mt-0.5", children: t('admin.settings.telegram.notify_registrations_hint') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>setTelegramForm((f)=>({ ...f, notifyRegistrations: !f.notifyRegistrations })), className: "relative w-10 h-6 rounded-full transition-colors cursor-pointer flex-shrink-0 p-0 border-0 outline-none ".concat(telegramForm.notifyRegistrations ? 'bg-green-600' : 'bg-gray-300'), children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "absolute top-1 left-0 w-4 h-4 bg-white rounded-full shadow transition-transform ".concat(telegramForm.notifyRegistrations ? 'translate-x-5' : 'translate-x-1') }) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-between", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm font-medium text-gray-700", children: t('admin.settings.telegram.post_new_tasks') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400 mt-0.5", children: t('admin.settings.telegram.post_new_tasks_hint') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>setTelegramForm((f)=>({ ...f, postNewTasks: !f.postNewTasks })), className: "relative w-10 h-6 rounded-full transition-colors cursor-pointer flex-shrink-0 p-0 border-0 outline-none ".concat(telegramForm.postNewTasks ? 'bg-green-600' : 'bg-gray-300'), children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "absolute top-1 left-0 w-4 h-4 bg-white rounded-full shadow transition-transform ".concat(telegramForm.postNewTasks ? 'translate-x-5' : 'translate-x-1') }) }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-3 pt-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: saveTelegramSettings, disabled: telegramSaving, className: "px-5 py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700 disabled:opacity-50", children: telegramSaving ? t('admin.settings.saving') : t('common.save') }), telegramSaved && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-sm text-green-600", children: t('admin.settings.saved') }) ] }) ] }) ] }), tab === 'support' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex flex-wrap gap-3 mb-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("form", { className: "flex gap-2", onSubmit: (e)=>{ e.preventDefault(); setSupportQ(supportQInput); setSupportPage(1); }, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: supportQInput, onChange: (e)=>setSupportQInput(e.target.value), placeholder: t('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" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: t('admin.search', 'Search') }), supportQ && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>{ setSupportQInput(''); setSupportQ(''); setSupportPage(1); }, className: "text-sm text-gray-500 hover:text-gray-700 px-2", children: "✕" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("select", { value: supportStatus, onChange: (e)=>{ setSupportStatus(e.target.value); setSupportPage(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: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "", children: t('admin.support.all_statuses', 'All statuses') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "open", children: t('admin.support.status.open', 'Open') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "in_progress", children: t('admin.support.status.in_progress', 'In progress') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "resolved", children: t('admin.support.status.resolved', 'Resolved') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "closed", children: t('admin.support.status.closed', 'Closed') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("select", { value: supportType, onChange: (e)=>{ setSupportType(e.target.value); setSupportPage(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: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "", children: t('admin.support.all_types', 'All types') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("option", { value: "bug", children: [ "\uD83D\uDC1B ", t('support.type.bug', 'Bug') ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("option", { value: "suggestion", children: [ "\uD83D\uDCA1 ", t('support.type.suggestion', 'Suggestion') ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("option", { value: "other", children: [ "\uD83D\uDCAC ", t('support.type.other', 'Other') ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "ml-auto text-sm text-gray-400 self-center", children: [ supportTotal, " ", t('admin.pagination.total', 'total') ] }) ] }), loading ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-center py-10 text-gray-400", children: t('common.loading') }) : supportTickets.length === 0 ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-center py-10 text-gray-400", children: t('admin.support.none', 'No tickets') }) : supportTickets.map((ticket)=>{ const typeColors = { bug: 'bg-red-100 text-red-700', suggestion: 'bg-green-100 text-green-700', other: 'bg-gray-100 text-gray-600' }; const statusColors2 = { 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' }; const typeIcons = { bug: '🐛', suggestion: '💡', other: '💬' }; const isReplying = supportReplyId === ticket.id; var _typeColors_ticket_type, _statusColors2_ticket_status; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-start justify-between gap-4 mb-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-2 flex-wrap mb-1", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "px-2 py-0.5 rounded-full text-xs font-medium ".concat((_typeColors_ticket_type = typeColors[ticket.type]) !== null && _typeColors_ticket_type !== void 0 ? _typeColors_ticket_type : 'bg-gray-100 text-gray-600'), children: [ typeIcons[ticket.type], " ", ticket.type ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "px-2 py-0.5 rounded-full text-xs font-medium ".concat((_statusColors2_ticket_status = statusColors2[ticket.status]) !== null && _statusColors2_ticket_status !== void 0 ? _statusColors2_ticket_status : 'bg-gray-100 text-gray-500'), children: ticket.status }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "text-xs text-gray-400", children: [ "#", ticket.id.slice(0, 8) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h3", { className: "font-semibold text-gray-900 text-sm", children: ticket.subject }), ticket.userName && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { className: "text-xs text-gray-400 mt-0.5", children: [ ticket.userName, " \xb7 ", ticket.userEmail ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400 mt-0.5", children: new Date(ticket.createdAt).toLocaleString(dateLocale) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-2 flex-shrink-0", children: [ ticket.status !== 'closed' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>{ setSupportReplyId(isReplying ? null : ticket.id); setSupportReplyText(ticket.adminReply || ''); }, className: "text-xs px-3 py-1.5 rounded-lg font-medium bg-green-50 text-green-700 hover:bg-green-100", children: isReplying ? t('admin.support.cancel', 'Cancel') : t('admin.support.reply', 'Reply') }), ticket.status === 'open' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .setSupportTicketStatus */ .u0(ticket.id, 'closed').then(()=>setSupportTickets((prev)=>prev.map((t)=>t.id === ticket.id ? { ...t, status: 'closed' } : t))), className: "text-xs px-3 py-1.5 rounded-lg font-medium bg-gray-100 text-gray-600 hover:bg-gray-200", children: t('admin.support.close', 'Close') }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-gray-700 whitespace-pre-wrap bg-gray-50 rounded-lg p-3 mb-3", children: ticket.body }), ticket.adminReply && !isReplying && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-green-50 border border-green-100 rounded-lg p-3 mb-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { className: "text-xs font-medium text-green-600 mb-1", children: [ t('admin.support.your_reply', 'Your reply'), ":" ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-gray-800 whitespace-pre-wrap", children: ticket.adminReply }) ] }), isReplying && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-2 mt-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("textarea", { rows: 3, value: supportReplyText, onChange: (e)=>setSupportReplyText(e.target.value), placeholder: t('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" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-2 items-center", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("select", { id: "status-".concat(ticket.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: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "open", children: t('admin.support.status.open', 'Open') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "in_progress", children: t('admin.support.status.in_progress', 'In progress') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "resolved", children: t('admin.support.status.resolved', 'Resolved') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "closed", children: t('admin.support.status.closed', 'Closed') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { disabled: supportReplySaving || !supportReplyText.trim(), onClick: async ()=>{ const statusEl = document.getElementById("status-".concat(ticket.id)); setSupportReplySaving(true); try { const updated = await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .replyToSupportTicket */ .nT(ticket.id, { adminReply: supportReplyText, status: statusEl === null || statusEl === void 0 ? void 0 : statusEl.value }); setSupportTickets((prev)=>prev.map((t)=>t.id === ticket.id ? { ...t, ...updated } : t)); setSupportReplyId(null); } catch (e) {} finally{ setSupportReplySaving(false); } }, 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: supportReplySaving ? '...' : t('admin.support.send_reply', 'Send') }) ] }) ] }) ] }, ticket.id); }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Pagination, { page: supportPage, total: supportTotal, limit: 30, onChange: setSupportPage, totalLabel: t('admin.pagination.total') }) ] }), tab === 'push' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-5 space-y-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "text-lg font-semibold text-gray-800", children: "Push-рассылка" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>setPushMode('broadcast'), className: "px-3 py-1.5 text-sm rounded-lg border ".concat(pushMode === 'broadcast' ? 'bg-green-600 text-white border-green-600' : 'bg-white text-gray-700 border-gray-300'), children: "ВсеЌ пПльзПвателяЌ" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>setPushMode('user'), className: "px-3 py-1.5 text-sm rounded-lg border ".concat(pushMode === 'user' ? 'bg-green-600 text-white border-green-600' : 'bg-white text-gray-700 border-gray-300'), children: "КПМкретМПЌу пПльзПвателю" }) ] }), pushMode === 'user' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "text-sm text-gray-600 block mb-1", children: "User ID" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: pushTargetUserId, onChange: (e)=>setPushTargetUserId(e.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" }) ] }), pushMode === 'broadcast' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "flex items-center gap-2 text-sm text-gray-700", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "checkbox", checked: pushOnlyActive, onChange: (e)=>setPushOnlyActive(e.target.checked) }), "ТПлькП актОвМыЌ пПльзПвателяЌ" ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "text-sm text-gray-600 block mb-1", children: "ЗагПлПвПк" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: pushTitle, onChange: (e)=>setPushTitle(e.target.value), placeholder: "НапрОЌер: НПвые заЎачО ряЎПЌ с ваЌО", className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "text-sm text-gray-600 block mb-1", children: "Текст" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("textarea", { rows: 3, value: pushBody, onChange: (e)=>setPushBody(e.target.value), placeholder: "КПрПткОй текст увеЎПЌлеМОя", className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 resize-none" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "text-sm text-gray-600 block mb-1", children: "ТОп" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: pushType, onChange: (e)=>setPushType(e.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" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "text-sm text-gray-600 block mb-1", children: "Reference ID (ПпцОПМальМП)" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: pushReferenceId, onChange: (e)=>setPushReferenceId(e.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" }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: sendAdminPush, disabled: pushSending || !pushTitle.trim() || pushMode === 'user' && !pushTargetUserId.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: pushSending ? 'Отправка...' : 'ОтправОть Push' }), pushError && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-sm text-red-600", children: pushError }) ] }) ] }), pushResult && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h3", { className: "font-semibold text-gray-800 mb-3", children: "Результат" }), 'usersTotal' in pushResult ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "grid grid-cols-2 md:grid-cols-5 gap-3 text-sm", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "rounded-lg bg-gray-50 border border-gray-200 px-3 py-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-gray-500", children: "ППльзПвателей" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-gray-900 font-semibold", children: pushResult.usersTotal }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "rounded-lg bg-gray-50 border border-gray-200 px-3 py-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-gray-500", children: "ППлучОлО" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-gray-900 font-semibold", children: pushResult.usersWithSent }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "rounded-lg bg-gray-50 border border-gray-200 px-3 py-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-gray-500", children: "ОтправлеМП push" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-gray-900 font-semibold", children: pushResult.pushesSent }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "rounded-lg bg-gray-50 border border-gray-200 px-3 py-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-gray-500", children: "НевалОЎМые тПкеМы" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-gray-900 font-semibold", children: pushResult.invalidTokens }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "rounded-lg bg-gray-50 border border-gray-200 px-3 py-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-gray-500", children: "ОшОбкО пП userId" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-gray-900 font-semibold", children: pushResult.failedUsers.length }) ] }) ] }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "grid grid-cols-2 md:grid-cols-4 gap-3 text-sm", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "rounded-lg bg-gray-50 border border-gray-200 px-3 py-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-gray-500", children: "User ID" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-gray-900 font-mono text-xs break-all", children: pushResult.targetUserId }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "rounded-lg bg-gray-50 border border-gray-200 px-3 py-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-gray-500", children: "ТПкеМПв МайЎеМП" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-gray-900 font-semibold", children: (_pushResult_tokensFound = pushResult.tokensFound) !== null && _pushResult_tokensFound !== void 0 ? _pushResult_tokensFound : 0 }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "rounded-lg bg-gray-50 border border-gray-200 px-3 py-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-gray-500", children: "ОтправлеМП push" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-gray-900 font-semibold", children: pushResult.sent }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "rounded-lg bg-gray-50 border border-gray-200 px-3 py-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-gray-500", children: "НевалОЎМые тПкеМы" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-gray-900 font-semibold", children: pushResult.invalidTokens }) ] }) ] }), 'usersTotal' in pushResult ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: ((_pushResult_usersWithoutTokens = pushResult.usersWithoutTokens) !== null && _pushResult_usersWithoutTokens !== void 0 ? _pushResult_usersWithoutTokens : 0) > 0 || ((_pushResult_usersConfigBlocked = pushResult.usersConfigBlocked) !== null && _pushResult_usersConfigBlocked !== void 0 ? _pushResult_usersConfigBlocked : 0) > 0 || ((_pushResult_usersAuthFailed = pushResult.usersAuthFailed) !== null && _pushResult_usersAuthFailed !== void 0 ? _pushResult_usersAuthFailed : 0) > 0 || ((_pushResult_usersAllFailed = pushResult.usersAllFailed) !== null && _pushResult_usersAllFailed !== void 0 ? _pushResult_usersAllFailed : 0) > 0 ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "mt-3 rounded-lg border border-amber-200 bg-amber-50 px-3 py-2 text-xs text-amber-900", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ "ДОагМПстОка: без тПкеМПв — ", (_pushResult_usersWithoutTokens1 = pushResult.usersWithoutTokens) !== null && _pushResult_usersWithoutTokens1 !== void 0 ? _pushResult_usersWithoutTokens1 : 0, ", FCM Ме МастрПеМ — ", (_pushResult_usersConfigBlocked1 = pushResult.usersConfigBlocked) !== null && _pushResult_usersConfigBlocked1 !== void 0 ? _pushResult_usersConfigBlocked1 : 0, ", ПшОбка auth FCM — ", (_pushResult_usersAuthFailed1 = pushResult.usersAuthFailed) !== null && _pushResult_usersAuthFailed1 !== void 0 ? _pushResult_usersAuthFailed1 : 0, ", FCM send failed — ", (_pushResult_usersAllFailed1 = pushResult.usersAllFailed) !== null && _pushResult_usersAllFailed1 !== void 0 ? _pushResult_usersAllFailed1 : 0 ] }), pushResult.failedReasonStats && Object.keys(pushResult.failedReasonStats).length > 0 ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "mt-1", children: [ "КПЎы ПшОбПк FCM: ", Object.entries(pushResult.failedReasonStats).map((param)=>{ let [key, count] = param; return "".concat(key, ": ").concat(count); }).join(', ') ] }) : null, pushResult.failedReasonSample ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "mt-1", children: [ "ПрОЌер ПшОбкО: ", describeFcmFailure(pushResult.failedReasonStats ? Object.keys(pushResult.failedReasonStats)[0] : null, pushResult.failedReasonSample) ] }) : null ] }) : null }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: pushResult.reason ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "mt-3 rounded-lg border border-amber-200 bg-amber-50 px-3 py-2 text-xs text-amber-900", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ "ДОагМПстОка: ", pushResult.reason === 'no_tokens' ? 'у пПльзПвателя Мет push-тПкеМПв' : pushResult.reason === 'fcm_not_configured' ? 'FCM Ме МастрПеМ Ма API (переЌеММые FCM_*)' : pushResult.reason === 'fcm_auth_failed' ? 'ПшОбка автПрОзацОО FCM (service account)' : describeFcmFailure(pushResult.failureKey, pushResult.failureMessage) ] }), pushResult.failureKey ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "mt-1", children: [ "КПЎ FCM: ", pushResult.failureKey ] }) : null, pushResult.failureMessage ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "mt-1", children: [ "СППбщеМОе FCM: ", pushResult.failureMessage ] }) : null ] }) : null }) ] }) ] }), tab === 'backup' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("h2", { className: "text-lg font-semibold text-gray-800 flex items-center gap-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-5 h-5 text-green-600", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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" }) }), t('admin.backup.title', 'Backup') ] }), backupMsg && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "".concat(backupMsgError ? '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: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { children: backupMsg }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>setBackupMsg(null), className: "".concat(backupMsgError ? 'text-red-500 hover:text-red-700' : 'text-green-500 hover:text-green-700', " ml-4"), children: "\xd7" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-5 flex items-center justify-between", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "font-medium text-gray-800 text-sm", children: t('admin.backup.autoBackup', 'Auto Backup') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-500 mt-0.5", children: t('admin.backup.autoBackupDesc', 'Create a backup every day automatically') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { disabled: backupAutoSaving, onClick: async ()=>{ setBackupAutoSaving(true); try { await (0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .request */ .Em)('/admin/backup/settings', { method: 'PUT', body: JSON.stringify({ autoEnabled: !backupAutoEnabled }) }); setBackupAutoEnabled((v)=>!v); } catch (e) {} setBackupAutoSaving(false); }, className: "relative w-11 h-6 rounded-full transition-colors ".concat(backupAutoEnabled ? 'bg-green-600' : 'bg-gray-300', " ").concat(backupAutoSaving ? 'opacity-50' : ''), children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "absolute top-0.5 left-0.5 w-5 h-5 rounded-full bg-white shadow transition-transform ".concat(backupAutoEnabled ? 'translate-x-5' : 'translate-x-0') }) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h3", { className: "font-semibold text-gray-800 text-sm mb-4", children: t('admin.backup.title', 'Database Backup') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex flex-wrap gap-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { disabled: backupExporting, onClick: async ()=>{ setBackupExporting(true); try { const BASE = "https://api.canhelp.gr" || 0; const res = await fetch("".concat(BASE, "/api/admin/backup/export"), { credentials: 'include' }); if (!res.ok) throw new Error('Export failed'); const blob = await res.blob(); const url = URL.createObjectURL(blob); const a = document.createElement('a'); a.href = url; a.download = "backup_".concat(new Date().toISOString().slice(0, 10), ".sql.gz"); a.click(); URL.revokeObjectURL(url); setBackupSuccess(t('admin.backup.exportSuccess', 'Export successful')); } catch (e) { setBackupError(e.message || 'Error'); } setBackupExporting(false); }, 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: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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" }) }), backupExporting ? t('admin.backup.exporting', 'Exporting...') : t('admin.backup.exportAll', 'Export Full DB') ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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 ".concat(backupImporting === 'full' ? 'opacity-50 pointer-events-none' : ''), children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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" }) }), backupImporting === 'full' ? t('admin.backup.importing', 'Importing...') : t('admin.backup.importAll', 'Import Full DB'), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "file", accept: ".sql.gz,.gz", className: "hidden", onChange: async (e)=>{ var _e_target_files; const file = (_e_target_files = e.target.files) === null || _e_target_files === void 0 ? void 0 : _e_target_files[0]; if (!file) return; if (!window.confirm(t('admin.backup.restoreConfirm', 'Restore from this backup?'))) return; setBackupImporting('full'); try { const fd = new FormData(); fd.append('file', file); const BASE = "https://api.canhelp.gr" || 0; const res = await fetch("".concat(BASE, "/api/admin/backup/import"), { method: 'POST', credentials: 'include', body: fd }); if (!res.ok) throw new Error('Import failed'); setBackupSuccess(t('admin.backup.importSuccess', 'Import successful')); } catch (err) { setBackupError(err.message || 'Error'); } setBackupImporting(null); e.target.value = ''; } }) ] }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h3", { className: "font-semibold text-gray-800 text-sm mb-4", children: t('admin.backup.storedBackups', 'Stored Backups') }), backupStoredFiles.length === 0 ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-gray-400", children: t('admin.backup.noStoredBackups', 'No stored backups') }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "space-y-2", children: backupStoredFiles.map((f)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-between py-2 px-3 bg-gray-50 rounded-lg border border-gray-100", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm font-medium text-gray-800", children: f.name === 'backup_today' ? t('admin.backup.today', 'Today') : t('admin.backup.yesterday', 'Yesterday') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { className: "text-xs text-gray-400", children: [ t('admin.backup.size', 'Size'), ": ", (f.size / 1024).toFixed(1), " KB \xb7 ", t('admin.backup.date', 'Date'), ": ", new Date(f.date).toLocaleString() ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { disabled: backupRestoring === f.name, onClick: async ()=>{ if (!window.confirm(t('admin.backup.restoreConfirm', 'Restore from this backup?'))) return; setBackupRestoring(f.name); try { await (0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .request */ .Em)('/admin/backup/restore', { method: 'POST', body: JSON.stringify({ name: f.name }) }); setBackupSuccess(t('admin.backup.restoreSuccess', 'Restore successful')); } catch (err) { setBackupError(err.message || 'Error'); } setBackupRestoring(null); }, className: "text-sm text-green-600 hover:text-gray-800 font-medium disabled:opacity-50", children: backupRestoring === f.name ? t('admin.backup.restoring', 'Restoring...') : t('admin.backup.restore', 'Restore') }) ] }, f.name)) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h3", { className: "font-semibold text-gray-800 text-sm mb-4", children: t('admin.backup.tables', 'Tables') }), backupTablesLoading ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-2 text-sm text-gray-400", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-4 h-4 animate-spin", fill: "none", viewBox: "0 0 24 24", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { className: "opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8v8z" }) ] }), t('common.loading', 'Loading...') ] }) : backupTables.length === 0 ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-gray-400", children: t('admin.noData', 'No data') }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "overflow-x-auto", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("table", { className: "w-full text-sm", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("tbody", { className: "divide-y divide-gray-100", children: backupTables.map((tbl)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("tr", { className: "hover:bg-gray-50", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "py-2 pr-4 font-mono text-gray-700", children: tbl }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "py-2 text-right", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-end gap-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: async ()=>{ try { const BASE = "https://api.canhelp.gr" || 0; const res = await fetch("".concat(BASE, "/api/admin/backup/export/").concat(tbl), { credentials: 'include' }); if (!res.ok) throw new Error('Export failed'); const blob = await res.blob(); const url = URL.createObjectURL(blob); const a = document.createElement('a'); a.href = url; a.download = "".concat(tbl, "_").concat(new Date().toISOString().slice(0, 10), ".sql.gz"); a.click(); URL.revokeObjectURL(url); } catch (err) { setBackupError(err.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: t('admin.backup.exportTable', 'Export') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: [ backupImporting === tbl ? t('admin.backup.importing', 'Importing...') : t('admin.backup.importTable', 'Import'), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "file", accept: ".sql.gz,.gz", className: "hidden", onChange: async (e)=>{ var _e_target_files; const file = (_e_target_files = e.target.files) === null || _e_target_files === void 0 ? void 0 : _e_target_files[0]; if (!file) return; if (!window.confirm(t('admin.backup.restoreConfirm', 'Restore from this backup?'))) return; setBackupImporting(tbl); try { const fd = new FormData(); fd.append('file', file); const BASE = "https://api.canhelp.gr" || 0; const res = await fetch("".concat(BASE, "/api/admin/backup/import/").concat(tbl), { method: 'POST', credentials: 'include', body: fd }); if (!res.ok) { const errData = await res.json().catch(()=>({ error: 'Import failed' })); throw new Error(errData.error || 'Import failed'); } setBackupSuccess(t('admin.backup.importSuccess', 'Import successful')); } catch (err) { setBackupError(err.message || 'Error'); } setBackupImporting(null); e.target.value = ''; } }) ] }) ] }) }) ] }, tbl)) }) }) }) ] }) ] }), tab === 'translations' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "text-base font-semibold text-gray-900", children: "ПеревПЎы" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-gray-500 mt-0.5", children: "АвтПЌатОческОй перевПЎ прПпущеММых зМачеМОй пП таблОцаЌ" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-4 flex flex-wrap gap-4 items-end", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: "ИстПчМОк" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("select", { value: transFromLang, onChange: (e)=>setTransFromLang(e.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: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "el", children: "\uD83C\uDDEC\uD83C\uDDF7 Greek" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "en", children: "\uD83C\uDDEC\uD83C\uDDE7 English" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "ru", children: "\uD83C\uDDF7\uD83C\uDDFA Russian" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "uk", children: "\uD83C\uDDFA\uD83C\uDDE6 Ukrainian" }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M13 7l5 5-5 5M6 12h12" }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: "ПеревестО Ма" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("select", { value: transLang, onChange: (e)=>setTransLang(e.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: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "el", children: "\uD83C\uDDEC\uD83C\uDDF7 Greek" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "en", children: "\uD83C\uDDEC\uD83C\uDDE7 English" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "ru", children: "\uD83C\uDDF7\uD83C\uDDFA Russian" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "uk", children: "\uD83C\uDDFA\uD83C\uDDE6 Ukrainian" }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "ml-auto self-end", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "text-sm font-semibold text-gray-700 flex items-center gap-2", children: [ { el: '🇬🇷', en: '🇬🇧', ru: '🇷🇺', uk: '🇺🇊' }[transFromLang], " ", transFromLang.toUpperCase(), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 text-gray-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M13 7l5 5-5 5M6 12h12" }) }), { el: '🇬🇷', en: '🇬🇧', ru: '🇷🇺', uk: '🇺🇊' }[transLang], " ", transLang.toUpperCase() ] }) }) ] }), transMsg && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-sm px-4 py-2 rounded-lg ".concat(transMsg.error ? 'bg-red-50 text-red-700' : 'bg-green-50 text-green-700'), children: transMsg.text }), transStatsLoading ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-2 text-sm text-gray-400 py-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-4 h-4 animate-spin", fill: "none", viewBox: "0 0 24 24", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { className: "opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8v8z" }) ] }), "Загрузка " ] }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "grid gap-4 sm:grid-cols-2 lg:grid-cols-3", children: (transStats !== null && transStats !== void 0 ? transStats : []).map((tbl)=>{ const isTasks = tbl.name === 'tasks'; // For tasks: total missing across all langs (tasks may miss multiple langs each) const totalMissingAllLangs = Object.values(tbl.missing).reduce((a, b)=>a + b, 0); var _tbl_missing_transLang; const missingCount = isTasks ? totalMissingAllLangs : (_tbl_missing_transLang = tbl.missing[transLang]) !== null && _tbl_missing_transLang !== void 0 ? _tbl_missing_transLang : 0; const isTranslating = !!transTableTranslating[tbl.name]; const anyTranslating = Object.values(transTableTranslating).some(Boolean); return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-5 flex flex-col", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-start justify-between", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "font-semibold text-gray-900 text-sm", children: tbl.label }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400 mt-0.5", children: tbl.name }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-xs font-semibold px-2 py-0.5 rounded-full ".concat(missingCount > 0 ? 'bg-red-100 text-red-700' : 'bg-green-100 text-green-700'), children: missingCount > 0 ? "".concat(missingCount, " missing") : 'Complete' }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { className: "text-xs text-gray-500 mt-3", children: [ "ВсегП: ", tbl.total, isTasks && ' · с языка ПрОгОМала Ма все ПстальМые' ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "mt-2 flex flex-wrap gap-1", children: [ 'el', 'en', 'ru', 'uk' ].map((lang)=>{ var _tbl_missing_lang; const cnt = (_tbl_missing_lang = tbl.missing[lang]) !== null && _tbl_missing_lang !== void 0 ? _tbl_missing_lang : 0; const isClickable = isTasks && cnt > 0; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { type: "button", disabled: !isClickable, onClick: isClickable ? async ()=>{ setTransPreview({ lang, loading: true, rows: [] }); try { const d = await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getTasksTranslationPreview */ .QY(lang, 50); setTransPreview({ lang, loading: false, rows: d.rows }); } catch (e) { setTransPreview({ lang, loading: false, rows: [] }); } } : undefined, className: "text-xs px-2 py-0.5 rounded-full border transition ".concat(cnt > 0 ? 'border-red-200 bg-red-50 text-red-600' + (isClickable ? ' cursor-pointer hover:bg-red-100' : '') : 'border-green-200 bg-green-50 text-green-600 cursor-default'), children: [ lang, ": ", cnt > 0 ? "-".concat(cnt) : '✓' ] }, lang); }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "mt-4 mt-auto pt-4", children: missingCount === 0 ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-1.5 text-xs text-emerald-600", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3.5 h-3.5 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" }) }), "Все перевПЎы запПлМеМы" ] }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { disabled: anyTranslating, onClick: async ()=>{ if (!isTasks && transFromLang === transLang) { setTransMsg({ text: 'ИсхПЎМый О целевПй язык сПвпаЎают', error: true }); return; } setTransTableTranslating((prev)=>({ ...prev, [tbl.name]: true })); setTransMsg(null); try { const res = isTasks ? await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .autoTranslateTasks */ .I(500) : tbl.name === 'email_templates' ? await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .autoTranslateEmailTemplates */ .fu(transLang, transFromLang) : await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .autoTranslate */ .cp(tbl.name, transLang, transFromLang, 500); setTransMsg({ text: "".concat(tbl.label, ": translated ").concat(res.translated, " of ").concat(res.total) + (res.failed > 0 ? " \xb7 errors: ".concat(res.failed) : ''), error: res.failed > 0 && res.translated === 0 }); _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getTranslationsStats */ .YQ().then((d)=>setTransStats(d.tables)).catch(()=>{}); } catch (err) { const msg = (err === null || err === void 0 ? void 0 : err.response) ? await err.response.text().catch(()=>err.message) : err.message || 'Error'; setTransMsg({ text: "Error: ".concat(msg), error: true }); } finally{ setTransTableTranslating((prev)=>{ const n = { ...prev }; delete n[tbl.name]; return n; }); } }, 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: isTranslating ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-3.5 h-3.5 animate-spin flex-shrink-0", fill: "none", viewBox: "0 0 24 24", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { className: "opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8v8z" }) ] }), "Translating..." ] }) : isTasks ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3.5 h-3.5 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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 ", missingCount ] }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3.5 h-3.5 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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 ", missingCount, " \xb7 ", { el: '🇬🇷', en: '🇬🇧', ru: '🇷🇺', uk: '🇺🇊' }[transFromLang], " ", transFromLang.toUpperCase(), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M13 7l5 5-5 5M6 12h12" }) }), { el: '🇬🇷', en: '🇬🇧', ru: '🇷🇺', uk: '🇺🇊' }[transLang], " ", transLang.toUpperCase() ] }) }) }) ] }, tbl.name); }) }) ] }), tab === 'dbcheck' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(DbCheckTab, {}), tab === 'referrals' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "grid grid-cols-3 gap-4", children: [ { label: 'РеферерПв', value: (_referralsData_totalReferrers = referralsData === null || referralsData === void 0 ? void 0 : referralsData.totalReferrers) !== null && _referralsData_totalReferrers !== void 0 ? _referralsData_totalReferrers : '—', color: 'text-green-600' }, { label: 'ПрОглашеМОй', value: (_referralsData_totalReferrals = referralsData === null || referralsData === void 0 ? void 0 : referralsData.totalReferrals) !== null && _referralsData_totalReferrals !== void 0 ? _referralsData_totalReferrals : '—', color: 'text-purple-600' }, { label: 'АктОвМых МаграЎ', value: (_referralsData_activeRewards = referralsData === null || referralsData === void 0 ? void 0 : referralsData.activeRewards) !== null && _referralsData_activeRewards !== void 0 ? _referralsData_activeRewards : '—', color: 'text-green-600' } ].map((param)=>{ let { label, value, color } = param; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-2xl border border-gray-200 p-5 text-center", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-3xl font-bold ".concat(color), children: value }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-xs text-gray-500 mt-1", children: label }) ] }, label); }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-2xl border border-gray-200 overflow-hidden", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "px-5 py-4 border-b border-gray-100 flex items-center justify-between", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "font-semibold text-gray-800", children: "ДеревП рефералПв" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { onClick: ()=>{ setReferralsLoading(true); _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminReferrals */ .cJ().then(setReferralsData).catch(()=>{}).finally(()=>setReferralsLoading(false)); }, className: "text-xs text-green-600 hover:underline flex items-center gap-1", children: [ referralsLoading && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-3 h-3 animate-spin", fill: "none", viewBox: "0 0 24 24", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { className: "opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8v8z" }) ] }), "ОбМПвОть" ] }) ] }), referralsLoading && !referralsData ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex justify-center py-16", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-6 h-6 animate-spin text-purple-600", fill: "none", viewBox: "0 0 24 24", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { className: "opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8v8z" }) ] }) }) : !referralsData || referralsData.tree.length === 0 ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "py-16 text-center text-sm text-gray-400", children: "Нет ЎаММых П рефералах" }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "divide-y divide-gray-100", children: referralsData.tree.map((node)=>{ var _node_referrer, _node_referrer1; var _node_referrer_id; const rid = (_node_referrer_id = (_node_referrer = node.referrer) === null || _node_referrer === void 0 ? void 0 : _node_referrer.id) !== null && _node_referrer_id !== void 0 ? _node_referrer_id : 'unknown'; const isExpanded = referralsExpanded.has(rid); var _node_referrer_firstName, _node_referrer_lastName; const referrerName = node.referrer ? "".concat((_node_referrer_firstName = node.referrer.firstName) !== null && _node_referrer_firstName !== void 0 ? _node_referrer_firstName : '', " ").concat((_node_referrer_lastName = node.referrer.lastName) !== null && _node_referrer_lastName !== void 0 ? _node_referrer_lastName : '').trim() || node.referrer.email : '(уЎалёМ)'; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { className: "w-full flex items-center gap-3 px-5 py-3.5 hover:bg-gray-50 text-left transition-colors", onClick: ()=>setReferralsExpanded((prev)=>{ const next = new Set(prev); next.has(rid) ? next.delete(rid) : next.add(rid); return next; }), children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 text-gray-400 flex-shrink-0 transition-transform ".concat(isExpanded ? 'rotate-90' : ''), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 5l7 7-7 7" }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "font-medium text-sm text-gray-900", children: referrerName }), node.referrer && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "ml-2 text-xs text-gray-400", children: node.referrer.email }) ] }), ((_node_referrer1 = node.referrer) === null || _node_referrer1 === void 0 ? void 0 : _node_referrer1.referralCode) && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("code", { className: "text-xs bg-gray-100 text-gray-600 px-2 py-0.5 rounded font-mono", children: node.referrer.referralCode }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "ml-3 text-xs font-semibold text-purple-700 bg-purple-50 px-2 py-0.5 rounded-full", children: [ node.referees.length, " реф." ] }) ] }), isExpanded && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "bg-gray-50 border-t border-gray-100", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("table", { className: "w-full text-xs", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("thead", { children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("tr", { className: "border-b border-gray-200", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "text-left px-10 py-2 font-semibold text-gray-500", children: "ПрОглашёММый" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "text-left px-3 py-2 font-semibold text-gray-500", children: "Email" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "text-center px-3 py-2 font-semibold text-gray-500", children: "+ЎМей" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "text-center px-3 py-2 font-semibold text-gray-500", children: "Истекает" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "text-center px-3 py-2 font-semibold text-gray-500", children: "Дата" }) ] }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("tbody", { children: node.referees.map((referee)=>{ var _referee_firstName, _referee_lastName; const refName = "".concat((_referee_firstName = referee.firstName) !== null && _referee_firstName !== void 0 ? _referee_firstName : '', " ").concat((_referee_lastName = referee.lastName) !== null && _referee_lastName !== void 0 ? _referee_lastName : '').trim() || referee.email; const expiresAt = new Date(referee.expiresAt); const createdAt = new Date(referee.createdAt); const isActive = expiresAt > new Date(); return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("tr", { className: "border-b border-gray-100 last:border-0 hover:bg-white transition-colors", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-10 py-2.5 font-medium text-gray-800", children: refName }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-3 py-2.5 text-gray-500", children: referee.email }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-3 py-2.5 text-center", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "font-semibold text-green-700", children: [ "+", referee.daysAdded ] }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-3 py-2.5 text-center", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "px-1.5 py-0.5 rounded text-xs font-medium ".concat(isActive ? 'bg-green-100 text-green-700' : 'bg-gray-100 text-gray-500'), children: expiresAt.toLocaleDateString('ru-RU', { day: '2-digit', month: '2-digit', year: '2-digit' }) }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-3 py-2.5 text-center text-gray-400", children: createdAt.toLocaleDateString('ru-RU', { day: '2-digit', month: '2-digit', year: '2-digit' }) }) ] }, referee.id); }) }) ] }) }) ] }, rid); }) }) ] }) ] }), transPreview && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "fixed inset-0 z-50 flex items-center justify-center bg-black/50 px-4", onClick: ()=>setTransPreview(null), children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-2xl shadow-xl w-full max-w-3xl max-h-[80vh] flex flex-col", onClick: (e)=>e.stopPropagation(), children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-between px-6 py-4 border-b border-gray-100 flex-shrink-0", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("h3", { className: "font-semibold text-gray-900", children: [ "ЗаЎачО без перевПЎа: ", /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "uppercase font-bold text-red-600", children: transPreview.lang }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400 mt-0.5", children: "ППказаМы первые 50 запОсей" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>setTransPreview(null), className: "text-gray-400 hover:text-gray-600 p-1", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-5 h-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" }) }) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "overflow-y-auto flex-1 px-6 py-4", children: transPreview.loading ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex justify-center py-12", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-6 h-6 animate-spin text-purple-600", fill: "none", viewBox: "0 0 24 24", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { className: "opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8v8z" }) ] }) }) : transPreview.rows.length === 0 ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-gray-500 text-center py-12", children: "Нет заЎач без перевПЎа" }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("table", { className: "w-full text-xs border-collapse", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("thead", { children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("tr", { className: "border-b border-gray-200", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "text-left py-2 pr-3 font-semibold text-gray-600 w-[35%]", children: "ОрОгОМал (title)" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "text-center py-2 px-2 font-semibold text-gray-600", children: "orig" }), [ 'el', 'en', 'ru', 'uk' ].map((l)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "text-center py-2 px-2 font-semibold text-gray-600 w-[14%]", children: l }, l)) ] }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("tbody", { children: transPreview.rows.map((row)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("tr", { className: "border-b border-gray-100 hover:bg-gray-50", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "py-2 pr-3 text-gray-800 truncate max-w-[200px]", title: row.title, children: row.title }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "py-2 px-2 text-center", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "uppercase font-semibold text-purple-700 bg-purple-50 px-1.5 py-0.5 rounded", children: row.originalLocale }) }), [ [ 'el', row.titleEl ], [ 'en', row.titleEn ], [ 'ru', row.titleRu ], [ 'uk', row.titleUk ] ].map((param)=>{ let [l, val] = param; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "py-2 px-2 text-center", title: val !== null && val !== void 0 ? val : '', children: val ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-emerald-600 font-semibold", children: "✓" }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-red-500 font-semibold", children: "✗" }) }, l); }) ] }, row.id)) }) ] }) }) ] }) }), editUser && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "fixed inset-0 z-50 flex items-center justify-center bg-black/50 px-4", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-2xl shadow-xl w-full max-w-4xl max-h-[90vh] flex flex-col", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-between px-6 py-4 border-b border-gray-100 flex-shrink-0", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "text-base font-semibold text-gray-900", children: t('admin.user_edit.title') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { className: "text-xs text-gray-400 mt-0.5", children: [ editUser.email, " \xb7 ID: ", editUser.id ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>setEditUser(null), className: "text-gray-400 hover:text-gray-600 text-2xl leading-none", children: "\xd7" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex flex-1 min-h-0", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: t('admin.user_edit.tab.profile') }, { id: 'account', label: t('admin.user_edit.tab.account') }, { id: 'balance', label: t('admin.user_edit.tab.balance') }, { id: 'settings', label: t('admin.user_edit.tab.settings') }, { id: 'site', label: t('admin.user_edit.tab.site') }, { id: 'specialist', label: t('admin.user_edit.tab.specialist') } ].map((item)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>{ setEditUserTab(item.id); if (item.id === 'specialist' && editUser) { setEditUserCardsLoading(true); const loadCards = _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminUserSpecialistCards */ .vy(editUser.id).then(setEditUserCards).catch(()=>{}); const loadCats = catRows.length === 0 ? _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminCategories */ .KD().then(setCatRows).catch(()=>{}) : Promise.resolve(); const loadLocs = locRows.length === 0 ? _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminLocations */ .k_().then(setLocRows).catch(()=>{}) : Promise.resolve(); Promise.all([ loadCards, loadCats, loadLocs ]).finally(()=>setEditUserCardsLoading(false)); } }, className: "w-full text-left px-3 py-2.5 text-sm rounded-lg transition-colors ".concat(editUserTab === item.id ? 'bg-green-50 text-green-700 font-medium' : 'text-gray-600 hover:bg-gray-50'), children: item.label }, item.id)) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex-1 overflow-y-auto p-6", children: [ editUserTab === 'profile' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "p-3 bg-gray-50 rounded-lg text-xs text-gray-500 space-y-0.5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "font-medium", children: [ t('admin.user_edit.registered'), ":" ] }), " ", new Date(editUser.createdAt).toLocaleDateString(dateLocale) ] }), editUser.lastSeenAt && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "font-medium", children: [ t('admin.user_edit.last_seen'), ":" ] }), " ", new Date(editUser.lastSeenAt).toLocaleDateString(dateLocale) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "grid grid-cols-2 gap-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.user_edit.first_name') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: (_editUser_firstName = editUser.firstName) !== null && _editUser_firstName !== void 0 ? _editUser_firstName : '', onChange: (e)=>setEditUser((u)=>({ ...u, firstName: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.user_edit.last_name') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: (_editUser_lastName = editUser.lastName) !== null && _editUser_lastName !== void 0 ? _editUser_lastName : '', onChange: (e)=>setEditUser((u)=>({ ...u, lastName: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.user_edit.phone') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: (_editUser_phone = editUser.phone) !== null && _editUser_phone !== void 0 ? _editUser_phone : '', onChange: (e)=>setEditUser((u)=>({ ...u, phone: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.user_edit.bio') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("textarea", { value: (_editUser_bio = editUser.bio) !== null && _editUser_bio !== void 0 ? _editUser_bio : '', onChange: (e)=>setEditUser((u)=>({ ...u, bio: e.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" }) ] }) ] }), editUserTab === 'account' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.user_edit.email') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: editUser.email }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-between rounded-lg border px-3 py-2 bg-gray-50", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-2", children: [ editUser.emailVerified ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 text-green-500 shrink-0", viewBox: "0 0 20 20", fill: "currentColor", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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" }) }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 text-red-400 shrink-0", viewBox: "0 0 20 20", fill: "currentColor", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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" }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-sm font-medium ".concat(editUser.emailVerified ? 'text-green-700' : 'text-red-600'), children: editUser.emailVerified ? t('admin.user_edit.email_verified') : t('admin.user_edit.email_not_verified') }) ] }), !editUser.emailVerified && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: verifyEmail, disabled: verifyingEmail, className: "text-xs px-3 py-1 rounded-md bg-green-600 text-white hover:bg-green-700 disabled:opacity-50 transition-colors", children: verifyingEmail ? '...' : t('admin.user_edit.verify_email_btn') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "grid grid-cols-2 gap-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.user_edit.role') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("select", { value: editUser.role, onChange: (e)=>setEditUser((u)=>({ ...u, role: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "user", children: t('admin.user_edit.role.user') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "admin", children: t('admin.user_edit.role.admin') }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.user_edit.plan') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("select", { value: (_editUser_planId = editUser.planId) !== null && _editUser_planId !== void 0 ? _editUser_planId : '', onChange: (e)=>setEditUser((u)=>({ ...u, planId: e.target.value || null })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "", children: t('admin.user_edit.no_plan') }), planRows.map((p)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: p.id, children: p.name }, p.id)) ] }) ] }) ] }), editUser.planExpiresAt && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { className: "text-xs text-gray-500", children: [ t('admin.user_edit.plan_expires'), ": ", new Date(editUser.planExpiresAt).toLocaleDateString(dateLocale) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "flex items-center gap-2 cursor-pointer", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "checkbox", checked: editUser.isActive !== false, onChange: (e)=>setEditUser((u)=>({ ...u, isActive: e.target.checked })), className: "w-4 h-4 rounded border-gray-300 text-green-600" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-sm text-gray-700", children: t('admin.user_edit.active') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.user_edit.interface_lang') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("select", { value: (_editUser_locale = editUser.locale) !== null && _editUser_locale !== void 0 ? _editUser_locale : 'el', onChange: (e)=>setEditUser((u)=>({ ...u, locale: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "el", children: "ΕλληΜικά" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "en", children: "English" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "ru", children: "РусскОй" }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: t('admin.user_edit.comm_languages') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex gap-5", children: [ 'el', 'en', 'uk', 'ru' ].map((lang)=>{ var _editUser_languages; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "flex items-center gap-1.5 cursor-pointer", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "checkbox", checked: ((_editUser_languages = editUser.languages) !== null && _editUser_languages !== void 0 ? _editUser_languages : []).includes(lang), onChange: (e)=>{ var _editUser_languages; const langs = (_editUser_languages = editUser.languages) !== null && _editUser_languages !== void 0 ? _editUser_languages : []; setEditUser((u)=>({ ...u, languages: e.target.checked ? [ ...langs.filter((l)=>l !== lang), lang ] : langs.filter((l)=>l !== lang) })); }, className: "w-4 h-4 rounded border-gray-300 text-green-600" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-sm text-gray-700", children: lang === 'el' ? 'ΕλληΜικά' : lang === 'en' ? 'English' : lang === 'uk' ? 'УкраїМська' : 'РусскОй' }) ] }, lang); }) }) ] }) ] }), editUserTab === 'balance' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-between p-5 bg-gray-50 rounded-xl border border-gray-200", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-xs text-gray-500 mb-1", children: t('admin.user_edit.balance') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "text-2xl font-bold text-gray-900", children: [ Number((_editUser_balance = editUser.balance) !== null && _editUser_balance !== void 0 ? _editUser_balance : 0).toFixed(2), " EUR" ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { onClick: ()=>setBalanceModal('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: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M12 4v16m8-8H4" }) }), t('admin.balance.topup.btn') ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { onClick: ()=>setBalanceModal('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: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M20 12H4" }) }), t('admin.balance.withdraw.btn') ] }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-center text-gray-400", children: t('admin.balance.modal_hint') }) ] }), editUserTab === 'settings' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "space-y-4", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-3 pt-1 divide-y divide-gray-100", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "flex items-center justify-between cursor-pointer py-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-sm font-medium text-gray-700", children: t('admin.user_edit.show_contact_info') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-xs text-gray-400", children: t('admin.user_edit.show_contact_info.hint') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "checkbox", checked: (_editUser_showContactInfo = editUser.showContactInfo) !== null && _editUser_showContactInfo !== void 0 ? _editUser_showContactInfo : false, onChange: (e)=>setEditUser((u)=>({ ...u, showContactInfo: e.target.checked })), className: "w-4 h-4 rounded border-gray-300 text-green-600" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "flex items-center justify-between cursor-pointer py-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-sm font-medium text-gray-700", children: t('admin.user_edit.notify_new_tasks') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-xs text-gray-400", children: t('admin.user_edit.notify_new_tasks.hint') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "checkbox", checked: (_editUser_notifyNewTasks = editUser.notifyNewTasks) !== null && _editUser_notifyNewTasks !== void 0 ? _editUser_notifyNewTasks : false, onChange: (e)=>setEditUser((u)=>({ ...u, notifyNewTasks: e.target.checked })), className: "w-4 h-4 rounded border-gray-300 text-green-600" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "flex items-center justify-between cursor-pointer py-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-sm font-medium text-gray-700", children: t('admin.user_edit.notif_messages') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-xs text-gray-400", children: t('admin.user_edit.notif_messages.hint') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "checkbox", checked: (_editUser_notifMessages = editUser.notifMessages) !== null && _editUser_notifMessages !== void 0 ? _editUser_notifMessages : true, onChange: (e)=>setEditUser((u)=>({ ...u, notifMessages: e.target.checked })), className: "w-4 h-4 rounded border-gray-300 text-green-600" }) ] }) ] }) }), editUserTab === 'site' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.user_edit.personal_site_slug') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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/" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: (_editUser_personalSiteSlug = editUser.personalSiteSlug) !== null && _editUser_personalSiteSlug !== void 0 ? _editUser_personalSiteSlug : '', onChange: (e)=>setEditUser((u)=>({ ...u, personalSiteSlug: e.target.value || null })), placeholder: "my-username", className: "flex-1 px-3 py-2 text-sm focus:outline-none" }) ] }), editUser.personalSiteSlug && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("a", { href: "/site/".concat(editUser.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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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" }) }) }) ] }) ] }), editUser.personalSiteSlug && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h4", { className: "text-sm font-semibold text-gray-800 pt-3 border-t border-gray-100", children: t('profile.site.visible_title') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "space-y-1", children: [ { key: 'showBio', label: t('profile.site.visible.bio') }, { key: 'showRating', label: t('profile.site.visible.rating') }, { key: 'showServices', label: t('profile.site.visible.services') }, { key: 'showPortfolio', label: t('profile.site.visible.portfolio') }, { key: 'showReviews', label: t('profile.site.visible.reviews') }, { key: 'showPhone', label: t('profile.site.visible.contacts') }, { key: 'showFullLastName', label: t('profile.site.visible.full_last_name') }, { key: 'showStatus', label: t('profile.site.visible.status') } ].map((item)=>{ var _editUser_siteSettings; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "flex items-center justify-between cursor-pointer py-1.5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-sm text-gray-700", children: item.label }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "checkbox", checked: ((_editUser_siteSettings = editUser.siteSettings) !== null && _editUser_siteSettings !== void 0 ? _editUser_siteSettings : {})[item.key] !== false, onChange: (e)=>setEditUser((u)=>{ var _u_siteSettings; return { ...u, siteSettings: { ...(_u_siteSettings = u.siteSettings) !== null && _u_siteSettings !== void 0 ? _u_siteSettings : {}, [item.key]: e.target.checked } }; }), className: "w-4 h-4 rounded border-gray-300 text-green-600" }) ] }, item.key); }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "pt-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1.5", children: t('profile.site.theme') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("select", { value: (_siteTheme = ((_editUser_siteSettings = editUser.siteSettings) !== null && _editUser_siteSettings !== void 0 ? _editUser_siteSettings : {}).siteTheme) !== null && _siteTheme !== void 0 ? _siteTheme : 'dark', onChange: (e)=>setEditUser((u)=>{ var _u_siteSettings; return { ...u, siteSettings: { ...(_u_siteSettings = u.siteSettings) !== null && _u_siteSettings !== void 0 ? _u_siteSettings : {}, siteTheme: e.target.value } }; }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "dark", children: t('profile.site.theme.dark') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "light", children: t('profile.site.theme.light') }) ] }) ] }) ] }) ] }), editUserTab === 'specialist' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-6", children: [ (()=>{ if ((editUser === null || editUser === void 0 ? void 0 : editUser.role) === 'specialist') return null; var _editUser_bio; const bio = String((_editUser_bio = editUser === null || editUser === void 0 ? void 0 : editUser.bio) !== null && _editUser_bio !== void 0 ? _editUser_bio : '').trim(); const publishedCards = (editUserCards !== null && editUserCards !== void 0 ? editUserCards : []).filter((c)=>{ var _c_publicationStatus; return ((_c_publicationStatus = c.publicationStatus) !== null && _c_publicationStatus !== void 0 ? _c_publicationStatus : c.isActive ? 'active' : 'inactive') === 'active'; }); const hasPublishedCard = publishedCards.length > 0; const hasCategories = publishedCards.some((c)=>{ var _c_categories; var _c_categories_length; return ((_c_categories_length = (_c_categories = c.categories) === null || _c_categories === void 0 ? void 0 : _c_categories.length) !== null && _c_categories_length !== void 0 ? _c_categories_length : 0) > 0; }); const hasLocations = publishedCards.some((c)=>{ var _c_locations; var _c_locations_length; return ((_c_locations_length = (_c_locations = c.locations) === null || _c_locations === void 0 ? void 0 : _c_locations.length) !== null && _c_locations_length !== void 0 ? _c_locations_length : 0) > 0; }); const missing = []; if (!bio) missing.push(t('admin.user_edit.visibility_requirements.bio', 'Fill in bio')); if (!hasPublishedCard) missing.push(t('admin.user_edit.visibility_requirements.published_card', 'Publish at least one card')); if (!hasCategories) missing.push(t('admin.user_edit.visibility_requirements.categories', 'Add a category in a published card')); if (!hasLocations) missing.push(t('admin.user_edit.visibility_requirements.locations', 'Add a location in a published card')); if (missing.length === 0) return null; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "rounded-xl border border-amber-300 bg-amber-50 p-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm font-semibold text-amber-900", children: t('admin.user_edit.visibility_requirements.title', 'Profile is not yet visible in Offers') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-amber-800 mt-1", children: t('admin.user_edit.visibility_requirements.hint', 'Visibility requirements to complete:') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("ul", { className: "mt-2 text-xs text-amber-900 list-disc pl-5 space-y-0.5", children: missing.map((m)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("li", { children: m }, m)) }) ] }); })(), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: t('admin.user_edit.skills') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex flex-wrap gap-1.5 mb-2 min-h-[28px]", children: ((_editUser_skills = editUser.skills) !== null && _editUser_skills !== void 0 ? _editUser_skills : []).map((s)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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, /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>setEditUser((u)=>{ var _u_skills; return { ...u, skills: ((_u_skills = u.skills) !== null && _u_skills !== void 0 ? _u_skills : []).filter((x)=>x !== s) }; }), className: "text-gray-400 hover:text-green-700 leading-none", children: "\xd7" }) ] }, s)) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: skillInput, onChange: (e)=>setSkillInput(e.target.value), onKeyDown: (e)=>{ if ((e.key === 'Enter' || e.key === ',') && skillInput.trim()) { e.preventDefault(); const val = skillInput.trim().replace(/,$/, ''); var _editUser_skills; if (val && !((_editUser_skills = editUser.skills) !== null && _editUser_skills !== void 0 ? _editUser_skills : []).includes(val)) { setEditUser((u)=>{ var _u_skills; return { ...u, skills: [ ...(_u_skills = u.skills) !== null && _u_skills !== void 0 ? _u_skills : [], val ] }; }); } setSkillInput(''); } }, placeholder: t('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" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>{ const val = skillInput.trim(); var _editUser_skills; if (val && !((_editUser_skills = editUser.skills) !== null && _editUser_skills !== void 0 ? _editUser_skills : []).includes(val)) { setEditUser((u)=>{ var _u_skills; return { ...u, skills: [ ...(_u_skills = u.skills) !== null && _u_skills !== void 0 ? _u_skills : [], val ] }; }); } setSkillInput(''); }, className: "px-3 py-2 bg-green-600 text-white rounded-lg text-sm hover:bg-green-700", children: t('common.add') }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "border-t border-gray-100 pt-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-sm font-medium text-gray-700 mb-3", children: t('admin.user_edit.specialist_cards') }), editUserCardsLoading ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400 py-2", children: t('common.loading') }) : editUserCards.length === 0 ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400 py-4 text-center", children: t('admin.user_edit.no_cards') }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "space-y-4", children: editUserCards.map((card)=>{ var _card_title, _card_description, _card_skills, _cardSkillInputs_card_id, _card_categories, _card_categories1, _card_locations, _card_locations1; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "border border-gray-200 bg-gray-50 rounded-xl p-4 space-y-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: (_card_title = card.title) !== null && _card_title !== void 0 ? _card_title : '', onChange: (e)=>setEditUserCards((prev)=>prev.map((c)=>c.id === card.id ? { ...c, title: e.target.value } : c)), placeholder: t('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" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "flex items-center gap-1.5 cursor-pointer flex-shrink-0", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "checkbox", checked: card.isActive !== false, onChange: (e)=>setEditUserCards((prev)=>prev.map((c)=>c.id === card.id ? { ...c, isActive: e.target.checked } : c)), className: "w-4 h-4 rounded border-gray-300 text-green-600" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-xs text-gray-600", children: t('admin.user_edit.published') }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("textarea", { value: (_card_description = card.description) !== null && _card_description !== void 0 ? _card_description : '', onChange: (e)=>setEditUserCards((prev)=>prev.map((c)=>c.id === card.id ? { ...c, description: e.target.value } : c)), rows: 3, placeholder: t('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" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-xs font-medium text-gray-500 mb-1.5", children: t('admin.user_edit.skills') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex flex-wrap gap-1.5 mb-1.5 min-h-[24px]", children: ((_card_skills = card.skills) !== null && _card_skills !== void 0 ? _card_skills : []).map((s)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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, /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>setEditUserCards((prev)=>prev.map((c)=>{ var _c_skills; return c.id === card.id ? { ...c, skills: ((_c_skills = c.skills) !== null && _c_skills !== void 0 ? _c_skills : []).filter((x)=>x !== s) } : c; })), className: "text-gray-400 hover:text-green-700 leading-none", children: "\xd7" }) ] }, s)) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: (_cardSkillInputs_card_id = cardSkillInputs[card.id]) !== null && _cardSkillInputs_card_id !== void 0 ? _cardSkillInputs_card_id : '', onChange: (e)=>setCardSkillInputs((prev)=>({ ...prev, [card.id]: e.target.value })), onKeyDown: (e)=>{ var _cardSkillInputs_card_id; if ((e.key === 'Enter' || e.key === ',') && ((_cardSkillInputs_card_id = cardSkillInputs[card.id]) !== null && _cardSkillInputs_card_id !== void 0 ? _cardSkillInputs_card_id : '').trim()) { e.preventDefault(); var _cardSkillInputs_card_id1; const val = ((_cardSkillInputs_card_id1 = cardSkillInputs[card.id]) !== null && _cardSkillInputs_card_id1 !== void 0 ? _cardSkillInputs_card_id1 : '').trim().replace(/,$/, ''); var _card_skills; if (val && !((_card_skills = card.skills) !== null && _card_skills !== void 0 ? _card_skills : []).includes(val)) { setEditUserCards((prev)=>prev.map((c)=>{ var _c_skills; return c.id === card.id ? { ...c, skills: [ ...(_c_skills = c.skills) !== null && _c_skills !== void 0 ? _c_skills : [], val ] } : c; })); } setCardSkillInputs((prev)=>({ ...prev, [card.id]: '' })); } }, placeholder: t('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" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>{ var _cardSkillInputs_card_id; const val = ((_cardSkillInputs_card_id = cardSkillInputs[card.id]) !== null && _cardSkillInputs_card_id !== void 0 ? _cardSkillInputs_card_id : '').trim(); var _card_skills; if (val && !((_card_skills = card.skills) !== null && _card_skills !== void 0 ? _card_skills : []).includes(val)) { setEditUserCards((prev)=>prev.map((c)=>{ var _c_skills; return c.id === card.id ? { ...c, skills: [ ...(_c_skills = c.skills) !== null && _c_skills !== void 0 ? _c_skills : [], val ] } : c; })); } setCardSkillInputs((prev)=>({ ...prev, [card.id]: '' })); }, className: "px-2.5 py-1.5 bg-green-600 text-white rounded-lg text-xs hover:bg-green-700", children: "+" }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-xs font-medium text-gray-500 mb-1.5", children: t('admin.user_edit.categories') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex flex-wrap gap-1.5 mb-1.5 min-h-[24px]", children: ((_card_categories = card.categories) !== null && _card_categories !== void 0 ? _card_categories : []).map((slug)=>{ var _catRows_find; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: [ getCatLabel((_catRows_find = catRows.find((c)=>c.slug === slug)) !== null && _catRows_find !== void 0 ? _catRows_find : { slug }, locale), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>setEditUserCards((prev)=>prev.map((c)=>{ var _c_categories; return c.id === card.id ? { ...c, categories: ((_c_categories = c.categories) !== null && _c_categories !== void 0 ? _c_categories : []).filter((x)=>x !== slug) } : c; })), className: "text-purple-400 hover:text-purple-700 leading-none", children: "\xd7" }) ] }, slug); }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(AdminCatPicker, { catRows: catRows, locale: locale, selected: (_card_categories1 = card.categories) !== null && _card_categories1 !== void 0 ? _card_categories1 : [], onAdd: (id)=>setEditUserCards((prev)=>prev.map((c)=>{ var _c_categories; return c.id === card.id ? { ...c, categories: [ ...(_c_categories = c.categories) !== null && _c_categories !== void 0 ? _c_categories : [], id ] } : c; })), addLabel: t('admin.user_edit.add_category') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-xs font-medium text-gray-500 mb-1.5", children: t('admin.user_edit.locations') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex flex-wrap gap-1.5 mb-1.5 min-h-[24px]", children: ((_card_locations = card.locations) !== null && _card_locations !== void 0 ? _card_locations : []).map((slug)=>{ var _locRows_find; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: [ getLocLabel((_locRows_find = locRows.find((l)=>l.slug === slug)) !== null && _locRows_find !== void 0 ? _locRows_find : { slug }, locale), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>setEditUserCards((prev)=>prev.map((c)=>{ var _c_locations; return c.id === card.id ? { ...c, locations: ((_c_locations = c.locations) !== null && _c_locations !== void 0 ? _c_locations : []).filter((x)=>x !== slug) } : c; })), className: "text-green-400 hover:text-green-700 leading-none", children: "\xd7" }) ] }, slug); }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(AdminLocPicker, { locRows: locRows, locale: locale, selected: (_card_locations1 = card.locations) !== null && _card_locations1 !== void 0 ? _card_locations1 : [], onAdd: (id)=>setEditUserCards((prev)=>prev.map((c)=>{ var _c_locations; return c.id === card.id ? { ...c, locations: [ ...(_c_locations = c.locations) !== null && _c_locations !== void 0 ? _c_locations : [], id ] } : c; })), addLabel: t('admin.user_edit.add_location') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex justify-end pt-1", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>saveCard(card.id), disabled: cardSaving[card.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: cardSaving[card.id] ? '...' : t('common.save') }) }) ] }, card.id); }) }) ] }) ] }) ] }) ] }), editUserTab !== 'balance' ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "border-t border-gray-100 px-6 py-4 flex gap-3 flex-shrink-0", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: saveEditUser, disabled: editUserSaving, className: "flex-1 bg-green-600 hover:bg-green-700 text-white py-2 rounded-lg text-sm font-semibold disabled:opacity-50", children: editUserSaving ? '...' : t('common.save') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>setEditUser(null), className: "flex-1 bg-gray-100 hover:bg-gray-200 text-gray-700 py-2 rounded-lg text-sm font-medium", children: t('common.cancel') }) ] }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "border-t border-gray-100 px-6 py-4 flex-shrink-0", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>setEditUser(null), className: "w-full bg-gray-100 hover:bg-gray-200 text-gray-700 py-2 rounded-lg text-sm font-medium", children: t('common.close') }) }) ] }) }), editUser && balanceModal && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "fixed inset-0 z-[60] flex items-center justify-center bg-black/40 px-4", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-2xl shadow-2xl p-6 w-full max-w-sm border-t-4 ".concat(balanceModal === 'topup' ? 'border-emerald-500' : 'border-rose-500'), children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-between mb-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h3", { className: "text-base font-semibold ".concat(balanceModal === 'topup' ? 'text-emerald-900' : 'text-rose-900'), children: balanceModal === 'topup' ? t('admin.balance.topup.title') : t('admin.balance.withdraw.title') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>setBalanceModal(null), className: "text-gray-400 hover:text-gray-600 text-2xl leading-none", children: "\xd7" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { className: "text-xs text-gray-500 mb-4", children: [ t('admin.user_edit.balance'), ": ", /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "font-semibold text-gray-700", children: [ Number((_editUser_balance1 = editUser.balance) !== null && _editUser_balance1 !== void 0 ? _editUser_balance1 : 0).toFixed(2), " EUR" ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium mb-1 ".concat(balanceModal === 'topup' ? 'text-emerald-800' : 'text-rose-800'), children: balanceModal === 'topup' ? t('admin.balance.topup.amount') : t('admin.balance.withdraw.amount') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "number", min: "0.01", step: "0.01", value: balanceModal === 'topup' ? (_editUser_topUpAmount = editUser.topUpAmount) !== null && _editUser_topUpAmount !== void 0 ? _editUser_topUpAmount : '' : (_editUser_withdrawAmount = editUser.withdrawAmount) !== null && _editUser_withdrawAmount !== void 0 ? _editUser_withdrawAmount : '', onChange: (e)=>setEditUser((u)=>balanceModal === 'topup' ? { ...u, topUpAmount: e.target.value } : { ...u, withdrawAmount: e.target.value }), className: "w-full border rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 ".concat(balanceModal === 'topup' ? 'border-emerald-300 focus:ring-emerald-400' : 'border-rose-300 focus:ring-rose-400') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium mb-1 ".concat(balanceModal === 'topup' ? 'text-emerald-800' : 'text-rose-800'), children: balanceModal === 'topup' ? t('admin.balance.topup.description') : t('admin.balance.withdraw.description') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: balanceModal === 'topup' ? (_editUser_topUpDescription = editUser.topUpDescription) !== null && _editUser_topUpDescription !== void 0 ? _editUser_topUpDescription : '' : (_editUser_withdrawDescription = editUser.withdrawDescription) !== null && _editUser_withdrawDescription !== void 0 ? _editUser_withdrawDescription : '', onChange: (e)=>setEditUser((u)=>balanceModal === 'topup' ? { ...u, topUpDescription: e.target.value } : { ...u, withdrawDescription: e.target.value }), placeholder: balanceModal === 'topup' ? t('admin.balance.topup.description.placeholder') : t('admin.balance.withdraw.description.placeholder'), className: "w-full border rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 ".concat(balanceModal === 'topup' ? 'border-emerald-300 focus:ring-emerald-400' : 'border-rose-300 focus:ring-rose-400') }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-2 mt-5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: async ()=>{ if (balanceModal === 'topup') { await handleAdminTopUp(); } else { await handleAdminWithdraw(); } setBalanceModal(null); }, disabled: balanceModal === 'topup' ? topUpSaving || !Number(editUser.topUpAmount) : withdrawSaving || !Number(editUser.withdrawAmount), className: "flex-1 text-white py-2 rounded-lg text-sm font-semibold disabled:opacity-50 ".concat(balanceModal === 'topup' ? 'bg-emerald-600 hover:bg-emerald-700' : 'bg-rose-600 hover:bg-rose-700'), children: (balanceModal === 'topup' ? topUpSaving : withdrawSaving) ? t('common.loading') : balanceModal === 'topup' ? t('admin.balance.topup.submit') : t('admin.balance.withdraw.submit') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>setBalanceModal(null), className: "flex-1 bg-gray-100 hover:bg-gray-200 text-gray-700 py-2 rounded-lg text-sm font-medium", children: t('common.cancel') }) ] }) ] }) }) ] }) ] }) ] }) }); } // ─── DbCheckTab ───────────────────────────────────────────────────────────── function DbCheckTab() { // ── Skill duplicates ────────────────────────────────────────────────────── const [dedupLoading, setDedupLoading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [dedupGroups, setDedupGroups] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [keepIds, setKeepIds] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)({}); const [merging, setMerging] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); function gk(group) { var _group__nameEl, _group_, _group_1; var _group__nameEl_toLowerCase_trim; return (_group__nameEl_toLowerCase_trim = (_group_ = group[0]) === null || _group_ === void 0 ? void 0 : (_group__nameEl = _group_.nameEl) === null || _group__nameEl === void 0 ? void 0 : _group__nameEl.toLowerCase().trim()) !== null && _group__nameEl_toLowerCase_trim !== void 0 ? _group__nameEl_toLowerCase_trim : (_group_1 = group[0]) === null || _group_1 === void 0 ? void 0 : _group_1.id; } async function findDuplicates() { setDedupLoading(true); setDedupGroups(null); setKeepIds({}); try { const groups = await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getSkillDedup */ .GE() // all categories ; setDedupGroups(groups); const auto = {}; groups.forEach((group)=>{ const best = [ ...group ].sort((a, b)=>{ var _b_usageCount, _a_usageCount; return ((_b_usageCount = b.usageCount) !== null && _b_usageCount !== void 0 ? _b_usageCount : 0) - ((_a_usageCount = a.usageCount) !== null && _a_usageCount !== void 0 ? _a_usageCount : 0); })[0]; auto[gk(group)] = best.id; }); setKeepIds(auto); } catch (e) { setDedupGroups([]); } finally{ setDedupLoading(false); } } async function mergeGroup(key, group) { const keepId = keepIds[key]; if (!keepId) return; const deleteIds = group.filter((s)=>s.id !== keepId).map((s)=>s.id); if (!deleteIds.length) return; setMerging(key); try { await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .mergeSkillDuplicates */ .Uq(keepId, deleteIds); setDedupGroups((prev)=>prev ? prev.filter((g)=>gk(g) !== key) : prev); } catch (e) {} finally{ setMerging(null); } } async function mergeAll() { if (!(dedupGroups === null || dedupGroups === void 0 ? void 0 : dedupGroups.length)) return; setMerging('__all__'); for (const group of [ ...dedupGroups ]){ const key = gk(group); const keepId = keepIds[key]; if (!keepId) continue; const deleteIds = group.filter((s)=>s.id !== keepId).map((s)=>s.id); if (!deleteIds.length) continue; try { await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .mergeSkillDuplicates */ .Uq(keepId, deleteIds); setDedupGroups((prev)=>prev ? prev.filter((g)=>gk(g) !== key) : prev); } catch (e) {} } setMerging(null); } var _dedupGroups_reduce; const totalDuplicates = (_dedupGroups_reduce = dedupGroups === null || dedupGroups === void 0 ? void 0 : dedupGroups.reduce((acc, g)=>acc + g.length - 1, 0)) !== null && _dedupGroups_reduce !== void 0 ? _dedupGroups_reduce : 0; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "text-base font-semibold text-gray-900", children: "ПрПверка базы ЎаММых" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-gray-500 mt-0.5", children: "ДОагМПстОка О ОсправлеМОе прПблеЌ в базе ЎаММых" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 overflow-hidden", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "px-5 py-4 border-b border-gray-100 flex items-center justify-between", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h3", { className: "text-sm font-semibold text-gray-800", children: "ДублОкаты МавыкПв" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400 mt-0.5", children: "ППОск МавыкПв с ПЎОМакПвыЌ ОЌеМеЌ в ПЎМПй категПрОО. ПрО ПбъеЎОМеМОО — ссылкО в картПчках спецОалОстПв ПбМПвляются автПЌатОческО." }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { onClick: findDuplicates, disabled: dedupLoading, 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: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("circle", { cx: "11", cy: "11", r: "8" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M21 21l-4.35-4.35" }) ] }), dedupLoading ? 'Ищу ' : 'НайтО ЎублОкаты' ] }) ] }), dedupGroups !== null && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "p-5", children: dedupGroups.length === 0 ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" }) }), "ДублОкатПв Ме МайЎеМП — база в пПряЎке" ] }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-between", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { className: "text-sm text-green-700 font-semibold", children: [ "НайЎеМП ", dedupGroups.length, " групп \xb7 ", totalDuplicates, " лОшМОх запОсей" ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: mergeAll, disabled: merging === '__all__', 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: merging === '__all__' ? 'ОбъеЎОМяю ' : "ОбъеЎОМОть все (".concat(dedupGroups.length, ")") }) ] }), dedupGroups.map((group)=>{ var _group_, _group_1; const key = gk(group); return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white border border-orange-200 rounded-xl overflow-hidden shadow-sm", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "px-4 py-2.5 bg-orange-50 border-b border-orange-100 flex items-center justify-between gap-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "min-w-0", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "text-sm font-semibold text-orange-800", children: [ "\xab", (_group_ = group[0]) === null || _group_ === void 0 ? void 0 : _group_.nameEl, "\xbb" ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "ml-2 text-xs text-green-600 font-mono", children: (_group_1 = group[0]) === null || _group_1 === void 0 ? void 0 : _group_1.categorySlug }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "ml-2 text-xs text-orange-400", children: [ group.length, " варОаМта" ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>mergeGroup(key, group), disabled: !!merging, 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: merging === key ? 'ОбъеЎОМяю ' : 'ОбъеЎОМОть' }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "divide-y divide-gray-50", children: group.map((skill)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "flex items-center gap-3 px-4 py-2.5 cursor-pointer hover:bg-gray-50 transition", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "radio", name: "dedup-global-".concat(key), checked: keepIds[key] === skill.id, onChange: ()=>setKeepIds((prev)=>({ ...prev, [key]: skill.id })), className: "accent-amber-600 shrink-0" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-3 flex-wrap", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-sm font-medium text-gray-800", children: skill.nameEl }), skill.nameEn && skill.nameEn !== skill.nameEl && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "text-xs text-gray-400", children: [ "EN: ", skill.nameEn ] }), skill.nameRu && skill.nameRu !== skill.nameEl && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "text-xs text-gray-400", children: [ "RU: ", skill.nameRu ] }), skill.nameUk && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "text-xs text-gray-400", children: [ "UK: ", skill.nameUk ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-3 mt-0.5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-[11px] font-semibold ".concat(skill.usageCount > 0 ? 'text-green-600' : 'text-gray-400'), children: skill.usageCount > 0 ? "".concat(skill.usageCount, " ОспПльзПваМОй") : 'Ме ОспПльзПвался' }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "text-[11px] text-gray-300", children: [ "order: ", skill.order ] }), keepIds[key] === skill.id && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-[11px] font-bold text-amber-600 uppercase", children: "← ПставОть" }) ] }) ] }) ] }, skill.id)) }) ] }, key); }) ] }) }) ] }) ] }); } function LocTree(param) { let { rows, parentId, depth, locale, expanded, onToggle, onEdit, onDelete, onAddChild, t } = param; const children = rows.filter((r)=>{ var _r_parentId; return ((_r_parentId = r.parentId) !== null && _r_parentId !== void 0 ? _r_parentId : null) === parentId; }); if (children.length === 0) return null; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: children.sort((a, b)=>{ var _a_order, _b_order; return ((_a_order = a.order) !== null && _a_order !== void 0 ? _a_order : 0) - ((_b_order = b.order) !== null && _b_order !== void 0 ? _b_order : 0); }).map((loc)=>{ const hasChildren = rows.some((r)=>r.parentId === loc.id); const isOpen = expanded.has(loc.id); const name = (locale === 'en' ? loc.nameEn : locale === 'ru' ? loc.nameRu : locale === 'uk' ? loc.nameUk : loc.nameEl) || loc.nameEl || loc.slug; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-2 px-4 py-3 hover:bg-gray-50 ".concat(!loc.isActive ? 'opacity-50' : ''), style: { paddingLeft: "".concat(16 + depth * 24, "px") }, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>hasChildren && onToggle(loc.id), className: "w-5 h-5 flex items-center justify-center text-gray-400 rounded ".concat(hasChildren ? 'hover:bg-gray-200 cursor-pointer' : 'cursor-default'), children: hasChildren ? isOpen ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("polyline", { points: "6 9 12 15 18 9" }) }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("polyline", { points: "9 18 15 12 9 6" }) }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "w-3.5 h-3.5 block" }) }), depth === 0 ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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" }) }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 11a3 3 0 11-6 0 3 3 0 016 0z" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "font-medium text-gray-800 text-sm", children: name }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "ml-2 text-xs text-gray-400", children: loc.nameEn }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "ml-1.5 font-mono text-xs text-gray-300", children: [ "/", loc.slug ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "px-2 py-0.5 rounded-full text-xs font-medium ".concat(loc.isActive ? 'bg-green-100 text-green-700' : 'bg-gray-100 text-gray-500'), children: loc.isActive ? t('admin.cat.active') : t('admin.cat.inactive') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-1 flex-shrink-0", children: [ depth === 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>onAddChild(loc.id), className: "text-xs px-2 py-1 rounded-lg bg-green-50 text-green-600 hover:bg-green-100 font-medium", title: t('admin.loc.add_district'), children: "+" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>onEdit(loc), className: "text-xs px-2 py-1 rounded-lg bg-gray-100 text-gray-600 hover:bg-gray-200 font-medium", children: t('common.edit') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>onDelete(loc.id, name), className: "text-xs px-2 py-1 rounded-lg bg-red-50 text-red-600 hover:bg-red-100 font-medium", children: t('common.delete') }) ] }) ] }), hasChildren && isOpen && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(LocTree, { rows: rows, parentId: loc.id, depth: depth + 1, locale: locale, expanded: expanded, onToggle: onToggle, onEdit: onEdit, onDelete: onDelete, onAddChild: onAddChild, t: t }) ] }, loc.id); }) }); } function CatTree(param) { let { rows, parentId, depth, locale, expanded, onToggle, onEdit, onDelete, onAddChild, skillsExpanded, skillsCache, skillsLoading, onToggleSkills, skillForm, skillSaving, onOpenAddSkill, onOpenEditSkill, onSaveSkill, onDeleteSkill, onCancelSkillForm, onSkillFormChange, t } = param; const children = rows.filter((r)=>{ var _r_parentId; return ((_r_parentId = r.parentId) !== null && _r_parentId !== void 0 ? _r_parentId : null) === parentId; }); if (children.length === 0) return null; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: children.sort((a, b)=>{ var _a_order, _b_order; return ((_a_order = a.order) !== null && _a_order !== void 0 ? _a_order : 0) - ((_b_order = b.order) !== null && _b_order !== void 0 ? _b_order : 0); }).map((cat)=>{ var _cat_names; const hasChildren = rows.some((r)=>r.parentId === cat.id); const isOpen = expanded.has(cat.id); const skillsOpen = skillsExpanded.has(cat.id); const isLoadingSkills = skillsLoading.has(cat.id); var _skillsCache_cat_slug; const skills = (_skillsCache_cat_slug = skillsCache[cat.slug]) !== null && _skillsCache_cat_slug !== void 0 ? _skillsCache_cat_slug : []; const name = (locale === 'en' ? cat.namesEn : locale === 'ru' ? cat.namesRu : locale === 'uk' ? cat.namesUk : cat.namesEl) || cat.namesEl || cat.slug; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-2 px-4 py-3 hover:bg-gray-50 ".concat(!cat.isActive ? 'opacity-50' : ''), style: { paddingLeft: "".concat(16 + depth * 24, "px") }, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>hasChildren && onToggle(cat.id), className: "w-5 h-5 flex items-center justify-center text-gray-400 rounded ".concat(hasChildren ? 'hover:bg-gray-200 cursor-pointer' : 'cursor-default'), children: hasChildren ? isOpen ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("polyline", { points: "6 9 12 15 18 9" }) }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("polyline", { points: "9 18 15 12 9 6" }) }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "w-3.5 h-3.5 block" }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "w-10 h-10 flex items-center justify-center rounded-xl bg-green-50", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components_CategoryIcon__WEBPACK_IMPORTED_MODULE_7__/* .CategoryIcon */ .Ez, { icon: cat.icon, alt: name, className: "h-7 w-7 object-contain text-2xl leading-none", fallback: "\uD83D\uDCE6" }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "font-medium text-gray-800 text-sm", children: name }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "ml-2 text-xs text-gray-400", children: cat.namesEn || ((_cat_names = cat.names) === null || _cat_names === void 0 ? void 0 : _cat_names.en) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "ml-1.5 font-mono text-xs text-gray-300", children: [ "/", cat.slug ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "px-2 py-0.5 rounded-full text-xs font-medium ".concat(cat.isActive ? 'bg-green-100 text-green-700' : 'bg-gray-100 text-gray-500'), children: cat.isActive ? t('admin.cat.active') : t('admin.cat.inactive') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-1 flex-shrink-0", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { onClick: ()=>onToggleSkills(cat), className: "text-xs px-2 py-1 rounded-lg font-medium flex items-center gap-1 ".concat(skillsOpen ? 'bg-amber-100 text-amber-700' : 'bg-amber-50 text-amber-600 hover:bg-amber-100'), title: "НавыкО", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3 h-3", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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" }) }), skillsCache[cat.slug] ? skillsCache[cat.slug].length : t('admin.cat.skills', 'Skills') ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>onAddChild(cat.id), className: "text-xs px-2 py-1 rounded-lg bg-green-50 text-green-600 hover:bg-green-100 font-medium", title: t('admin.cat.add_child'), children: "+" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>onEdit(cat), className: "text-xs px-2 py-1 rounded-lg bg-gray-100 text-gray-600 hover:bg-gray-200 font-medium", children: t('common.edit') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>onDelete(cat.id, name), className: "text-xs px-2 py-1 rounded-lg bg-red-50 text-red-600 hover:bg-red-100 font-medium", children: t('common.delete') }) ] }) ] }), skillsOpen && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(SkillsPanel, { cat: cat, locale: locale, depth: depth, t: t, skills: skills, isLoading: isLoadingSkills, skillForm: skillForm, skillSaving: skillSaving, onOpenAddSkill: onOpenAddSkill, onOpenEditSkill: onOpenEditSkill, onSaveSkill: onSaveSkill, onDeleteSkill: onDeleteSkill, onCancelSkillForm: onCancelSkillForm, onSkillFormChange: onSkillFormChange }), hasChildren && isOpen && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(CatTree, { rows: rows, parentId: cat.id, depth: depth + 1, locale: locale, expanded: expanded, onToggle: onToggle, onEdit: onEdit, onDelete: onDelete, onAddChild: onAddChild, skillsExpanded: skillsExpanded, skillsCache: skillsCache, skillsLoading: skillsLoading, onToggleSkills: onToggleSkills, skillForm: skillForm, skillSaving: skillSaving, onOpenAddSkill: onOpenAddSkill, onOpenEditSkill: onOpenEditSkill, onSaveSkill: onSaveSkill, onDeleteSkill: onDeleteSkill, onCancelSkillForm: onCancelSkillForm, onSkillFormChange: onSkillFormChange, t: t }) ] }, cat.id); }) }); } // ─── SkillsPanel ──────────────────────────────────────────────────────────── // Self-contained component for the skill list + edit form + dedup panel per category const SKILL_LANG_LABELS = { nameEl: '🇬🇷 EL', nameEn: '🇬🇧 EN', nameRu: '🇷🇺 RU', nameUk: '🇺🇊 UK' }; function SkillForm(param) { let { form, saving, onSave, onCancel, onChange } = param; var _form_nameEl; var _form_order; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white border border-amber-200 rounded-xl p-4 shadow-sm", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "grid grid-cols-2 gap-3 mb-3", children: [ 'nameEl', 'nameEn', 'nameRu', 'nameUk' ].map((field, i)=>{ var _form_field; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-[11px] font-semibold text-gray-500 mb-1 uppercase tracking-wide", children: SKILL_LANG_LABELS[field] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: (_form_field = form[field]) !== null && _form_field !== void 0 ? _form_field : '', onChange: (e)=>onChange({ ...form, [field]: e.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: i === 0, placeholder: field === 'nameUk' ? 'МеПбПвʌязкПвП' : '' }) ] }, field); }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-3 pt-1 border-t border-gray-100", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "text-xs text-gray-400 font-medium", children: "ППряЎПк" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "number", value: (_form_order = form.order) !== null && _form_order !== void 0 ? _form_order : 0, onChange: (e)=>onChange({ ...form, order: Number(e.target.value) }), className: "w-16 border border-gray-200 rounded-lg px-2 py-1 text-xs text-center" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-2 ml-auto", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: onCancel, className: "px-3 py-1.5 bg-gray-100 text-gray-600 rounded-lg text-xs font-medium hover:bg-gray-200 transition", children: "ОтЌеМа" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: onSave, disabled: saving || !((_form_nameEl = form.nameEl) === null || _form_nameEl === void 0 ? void 0 : _form_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: saving ? 'СПхраМяю ' : 'СПхраМОть' }) ] }) ] }) ] }); } function SkillsPanel(param) { let { cat, locale, depth, t, skills, isLoading, skillForm, skillSaving, onOpenAddSkill, onOpenEditSkill, onSaveSkill, onDeleteSkill, onCancelSkillForm, onSkillFormChange } = param; const showAddForm = (skillForm === null || skillForm === void 0 ? void 0 : skillForm.catSlug) === cat.slug && !(skillForm === null || skillForm === void 0 ? void 0 : skillForm.id); return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "border-t border-amber-100 bg-gradient-to-b from-amber-50/60 to-white", style: { paddingLeft: "".concat(16 + depth * 24 + 36, "px"), paddingRight: '16px', paddingTop: '14px', paddingBottom: '14px' }, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-2 mb-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-xs font-bold text-amber-700 uppercase tracking-wider", children: "НавыкО" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "text-xs text-amber-500 font-mono", children: [ "/", cat.slug ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "ml-1 text-xs text-amber-400", children: [ "(", skills.length, ")" ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "ml-auto", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { onClick: ()=>{ onCancelSkillForm(); onOpenAddSkill(cat.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: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-3 h-3", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: "12", y1: "5", x2: "12", y2: "19" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: "5", y1: "12", x2: "19", y2: "12" }) ] }), "ДПбавОть" ] }) }) ] }), isLoading ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-2 py-3 text-xs text-gray-400", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-3.5 h-3.5 animate-spin", fill: "none", viewBox: "0 0 24 24", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("circle", { cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4", className: "opacity-25" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { fill: "currentColor", d: "M4 12a8 8 0 018-8v8z", className: "opacity-75" }) ] }), "Загрузка " ] }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-1", children: [ skills.length === 0 && !showAddForm && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400 italic py-2", children: "НавыкО Ме ЎПбавлеМы" }), skills.map((skill)=>{ const isEditingThis = (skillForm === null || skillForm === void 0 ? void 0 : skillForm.id) === skill.id; const skillName = locale === 'en' ? skill.nameEn : locale === 'ru' ? skill.nameRu : locale === 'uk' ? skill.nameUk || skill.nameEn : skill.nameEl; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-2 rounded-lg px-3 py-2 group transition ".concat(isEditingThis ? 'bg-amber-50 border border-amber-200' : 'bg-white border border-gray-100 hover:border-amber-200 hover:bg-amber-50/30'), children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-sm font-medium text-gray-800", children: skillName }), locale !== 'en' && skill.nameEn && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "ml-2 text-xs text-gray-400", children: skill.nameEn }), locale !== 'ru' && skill.nameRu && skill.nameRu !== skill.nameEl && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "ml-1.5 text-xs text-gray-300", children: skill.nameRu }) ] }), skill.order > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "text-[10px] text-gray-300 font-mono", children: [ "#", skill.order ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-1 transition-opacity ".concat(isEditingThis ? 'opacity-100' : 'opacity-0 group-hover:opacity-100'), children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>isEditingThis ? onCancelSkillForm() : (onCancelSkillForm(), onOpenEditSkill(skill, cat.slug)), className: "text-xs px-2 py-0.5 rounded-md font-medium transition ".concat(isEditingThis ? 'bg-amber-100 text-amber-700' : 'bg-gray-100 text-gray-600 hover:bg-amber-100 hover:text-amber-700'), children: isEditingThis ? '✕' : t('common.edit') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>onDeleteSkill(skill, cat.slug), className: "text-xs px-2 py-0.5 rounded-md bg-red-50 text-red-600 hover:bg-red-100 transition", children: t('common.delete') }) ] }) ] }), isEditingThis && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "mt-1 mb-1 ml-0", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(SkillForm, { form: skillForm, saving: skillSaving, onSave: onSaveSkill, onCancel: onCancelSkillForm, onChange: onSkillFormChange }) }) ] }, skill.id); }), showAddForm && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "mt-2", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(SkillForm, { form: skillForm, saving: skillSaving, onSave: onSaveSkill, onCancel: onCancelSkillForm, onChange: onSkillFormChange }) }) ] }) ] }); } function Pagination(param) { let { page, total, limit, onChange, totalLabel } = param; const pages = Math.ceil(total / limit); if (pages <= 1) return null; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-between px-4 py-3 border-t border-gray-100 text-sm text-gray-500", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { children: [ totalLabel, ": ", total ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-1", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>onChange(page - 1), disabled: page === 1, className: "px-3 py-1 rounded-lg border border-gray-200 disabled:opacity-40 hover:bg-gray-50", children: "←" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "px-3 py-1", children: [ page, " / ", pages ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>onChange(page + 1), disabled: page >= pages, className: "px-3 py-1 rounded-lg border border-gray-200 disabled:opacity-40 hover:bg-gray-50", children: "→" }) ] }) ] }); } // ── Activity log helpers ────────────────────────────────────────────────── function parseLogDetails(details) { try { return details ? JSON.parse(details) : null; } catch (e) { return null; } } const EVENT_META = { 'user.login': { icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("circle", { cx: "12", cy: "12", r: "10" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("circle", { cx: "12", cy: "12", r: "10" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: "15", y1: "9", x2: "9", y2: "15" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("polyline", { points: "3 6 5 6 21 6" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: "18", y1: "6", x2: "6", y2: "18" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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 ActivityLogRow(param) { let { entry, dateLocale, onFilterUser, t } = param; var _EVENT_META_entry_event; const meta = (_EVENT_META_entry_event = EVENT_META[entry.event]) !== null && _EVENT_META_entry_event !== void 0 ? _EVENT_META_entry_event : { icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: entry.event, color: 'bg-gray-50 text-gray-700 border-gray-200' }; const details = parseLogDetails(entry.details); return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 px-4 py-3 flex items-start gap-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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 ".concat(meta.color), children: [ meta.icon, " ", t(meta.labelKey, meta.labelKey) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-2 flex-wrap", children: [ entry.userName && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>entry.userId && onFilterUser(entry.userId), className: "text-sm font-medium text-gray-800 hover:text-green-600", children: entry.userName }), entry.userEmail && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-xs text-gray-400", children: entry.userEmail }) ] }), details && Object.keys(details).length > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "mt-1 flex flex-wrap gap-2", children: Object.entries(details).map((param)=>{ let [k, v] = param; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "text-xs bg-gray-100 text-gray-600 px-2 py-0.5 rounded", children: [ k, ": ", /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "font-medium", children: String(v) }) ] }, k); }) }), entry.ipAddress && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400 mt-0.5", children: entry.ipAddress }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("time", { className: "shrink-0 text-xs text-gray-400 whitespace-nowrap", children: new Date(entry.createdAt).toLocaleString(dateLocale) }) ] }); } const MONTH_NAMES = (/* unused pure expression or super */ null && ([ 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec' ])); function AdminMonthChart(param) { let { series, dateLocale = 'en-US' } = param; // Collect all unique months from all series, sorted const monthSet = new Set(); series.forEach((s)=>s.data.forEach((r)=>monthSet.add(r.month))); const months = Array.from(monthSet).sort(); if (months.length === 0) return null; // Build lookup maps const seriesVals = series.map((s)=>{ const map = {}; s.data.forEach((r)=>{ map[r.month] = Number(r.count); }); return months.map((m)=>{ var _map_m; return (_map_m = map[m]) !== null && _map_m !== void 0 ? _map_m : 0; }); }); const allVals = seriesVals.flat(); const maxVal = Math.max(...allVals, 1); const W = 700; const H = 160; const padL = maxVal >= 1000000 ? 50 : maxVal >= 10000 ? 44 : maxVal >= 1000 ? 40 : 36; const padB = 24; const chartH = H - padB; const totalBars = months.length * series.length; const groupW = (W - padL - 8) / months.length; const barW = Math.max(4, Math.min(20, groupW / series.length - 2)); const yTicks = [ 0, Math.round(maxVal / 3), Math.round(maxVal * 2 / 3), maxVal ]; function barX(mi, si) { const groupStart = padL + mi * groupW + (groupW - series.length * (barW + 1)) / 2; return groupStart + si * (barW + 1); } function barHeight(v) { return v / maxVal * chartH; } return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "overflow-x-auto", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { viewBox: "0 0 ".concat(W, " ").concat(H + 14), className: "w-full", style: { minWidth: Math.max(360, months.length * 40) }, children: [ yTicks.map((v, i)=>{ const y = chartH - v / maxVal * chartH; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("g", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: padL, y1: y, x2: W - 4, y2: y, stroke: "#f3f4f6", strokeWidth: 1 }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("text", { x: padL - 5, y: y + 3.5, textAnchor: "end", fontSize: 9, fill: "#9ca3af", children: fmtYLabel(v) }) ] }, i); }), months.map((m, mi)=>series.map((s, si)=>{ const v = seriesVals[si][mi]; const bh = barHeight(v); const x = barX(mi, si); return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("rect", { x: x, y: chartH - bh, width: barW, height: bh, fill: s.color, opacity: 0.8, rx: 2 }, "bar-".concat(mi, "-").concat(si)); })), months.map((m, mi)=>{ const [yr, mo] = m.slice(0, 7).split('-').map(Number); const d = new Date(Date.UTC(yr, mo - 1, 2)); const label = new Intl.DateTimeFormat(dateLocale, { month: 'short' }).format(d) + (mi === 0 || mo === 1 ? " ".concat(yr) : ''); const cx = padL + mi * groupW + groupW / 2; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("text", { x: cx, y: H + 12, textAnchor: "middle", fontSize: 9, fill: "#9ca3af", children: label }, "xl-".concat(mi)); }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: padL, y1: chartH, x2: W - 4, y2: chartH, stroke: "#e5e7eb", strokeWidth: 1 }) ] }) }); } function getLast30Days() { const days = []; for(let i = 29; i >= 0; i--){ const d = new Date(Date.now() - i * 86400000); days.push(d.toISOString().slice(0, 10)); } return days; } function smoothPath(pts) { if (pts.length < 2) return ''; let d = "M ".concat(pts[0][0].toFixed(1), " ").concat(pts[0][1].toFixed(1)); for(let i = 1; i < pts.length; i++){ const cpx = ((pts[i - 1][0] + pts[i][0]) / 2).toFixed(1); d += " C ".concat(cpx, " ").concat(pts[i - 1][1].toFixed(1), " ").concat(cpx, " ").concat(pts[i][1].toFixed(1), " ").concat(pts[i][0].toFixed(1), " ").concat(pts[i][1].toFixed(1)); } return d; } function fmtYLabel(v) { if (v >= 1000000) return "".concat(+(v / 1000000).toFixed(1), "M"); if (v >= 1000) return "".concat(Math.round(v / 1000), "K"); return String(v); } function AdminAreaChart(param) { let { series, days: daysProp } = param; const days = daysProp !== null && daysProp !== void 0 ? daysProp : getLast30Days(); const seriesVals = series.map((s)=>{ const map = {}; s.data.forEach((r)=>{ map[r.day] = Number(r.count); }); return days.map((d)=>{ var _map_d; return (_map_d = map[d]) !== null && _map_d !== void 0 ? _map_d : 0; }); }); const allVals = seriesVals.flat(); const maxVal = Math.max(...allVals, 1); const W = 700; const H = 160; const padL = maxVal >= 10000 ? 44 : maxVal >= 1000 ? 40 : 36; const padB = 22; const chartW = W - padL - 4; const chartH = H - padB; const stepX = chartW / (days.length - 1); function pts(vals) { return vals.map((v, i)=>[ padL + i * stepX, chartH - v / maxVal * chartH ]); } function areaPath(vals) { const points = pts(vals); const line = smoothPath(points); if (!line) return ''; const lastX = points[points.length - 1][0].toFixed(1); return "".concat(line, " L ").concat(lastX, " ").concat(chartH.toFixed(1), " L ").concat(padL.toFixed(1), " ").concat(chartH.toFixed(1), " Z"); } // Y-axis: 4 labels (0, 1/3, 2/3, max) const yTicks = [ 0, Math.round(maxVal / 3), Math.round(maxVal * 2 / 3), maxVal ]; // X-axis: every 7 days + last const xTicks = days.map((d, i)=>({ i, label: d.slice(8) })).filter((_, i)=>i % 7 === 0 || i === days.length - 1); return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "overflow-x-auto", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { viewBox: "0 0 ".concat(W, " ").concat(H + 12), className: "w-full", style: { minWidth: 360 }, children: [ yTicks.map((v, i)=>{ const y = chartH - v / maxVal * chartH; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("g", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: padL, y1: y, x2: W - 4, y2: y, stroke: "#f3f4f6", strokeWidth: 1 }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("text", { x: padL - 5, y: y + 3.5, textAnchor: "end", fontSize: 9, fill: "#9ca3af", children: fmtYLabel(v) }) ] }, i); }), xTicks.map((param)=>{ let { i } = param; const x = padL + i * stepX; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: x, y1: 0, x2: x, y2: chartH, stroke: "#f9fafb", strokeWidth: 1 }, "vg-".concat(i)); }), xTicks.map((param)=>{ let { i, label } = param; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("text", { x: padL + i * stepX, y: H + 10, textAnchor: "middle", fontSize: 9, fill: "#9ca3af", children: label }, i); }), series.map((s, si)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: areaPath(seriesVals[si]), fill: s.fill }, "fill-".concat(si))), series.map((s, si)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: smoothPath(pts(seriesVals[si])), fill: "none", stroke: s.color, strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round" }, "line-".concat(si))), series.map((s, si)=>{ const points = pts(seriesVals[si]); const last = points[points.length - 1]; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("g", { children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("circle", { cx: last[0], cy: last[1], r: 4, fill: "white", stroke: s.color, strokeWidth: 2 }) }, "dot-".concat(si)); }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: padL, y1: chartH, x2: W - 4, y2: chartH, stroke: "#e5e7eb", strokeWidth: 1 }) ] }) }); } ÊÍ Î+__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ AdminPage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7541); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(9664); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(next_link__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(1592); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(9906); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(2982); /* harmony import */ var _lib_formatName__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(1258); /* harmony import */ var _lib_taskLocale__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(4017); /* harmony import */ var _components_CategoryIcon__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(5940); Ï1Åÿÿ61146undefined148199undefined201244undefined246274undefined276315undefined317361undefined363395undefined397432undefined434484undefined486532undefined534590undefined83738377(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined84668470(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined86508653(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined88168819(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined88218832_components_CategoryIcon__WEBPACK_IMPORTED_MODULE_7__/* .CategoryIcon */ .Ezundefined91539156(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined95239527(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined96549658(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1009110094(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1090610909(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1112311126(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1132011323(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1146411467(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1171111715(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1225912262(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1226412275_components_CategoryIcon__WEBPACK_IMPORTED_MODULE_7__/* .CategoryIcon */ .Ezundefined1260512608(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1306713074(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined1311613123(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined1317813185(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined1321013215(0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)undefined1322813236(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined1392713931(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1403714041(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1447314476(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1478014783(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1505015053(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1523015233(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1559015593(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1587615880(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1612616129(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1628316286(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1742417428(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1752517529(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1839618399(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1840118412_components_CategoryIcon__WEBPACK_IMPORTED_MODULE_7__/* .CategoryIcon */ .Ezundefined1882718830(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1910819111(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1959719600(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2009820102(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2072520728(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2095320956(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2153121538(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined2158021587(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined2163821645(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined2167021675(0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)undefined2168821696(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined2238622390(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2249622500(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2293222936(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2327023273(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2359223595(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2390523908(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2408524088(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2444524448(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2473124735(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2498124984(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2513825141(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2626426268(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2636526369(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2721527218(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2751827521(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2788627889(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2816628169(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2865528658(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2915329157(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2977629779(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3000430007(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3044730461undefined3054930557(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)undefined3060330612(0,_lib_auth__WEBPACK_IMPORTED_MODULE_4__/* .useSession */ .wV)undefined3064330651(0,_context_locale__WEBPACK_IMPORTED_MODULE_5__/* .useLocale */ .Y)undefined3068230689(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3075330760(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3077430782(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined3090030907(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3095930966(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3101131018(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3106431071(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3110931116(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3116531172(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3121731224(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3127431281(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3132631333(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3137931386(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3142431431(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3148031487(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3153631543(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3159931606(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3165531662(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3171231719(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3178331790(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3188031887(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3195231959(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3202532032(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3210232109(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3217332180(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3225732264(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3231332320(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3237032377(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3242932436(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3248532492(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3253532542(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3259532602(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3265732664(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3272532732(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3279532802(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3285532862(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3290532912(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3295632963(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3303233039(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3309233099(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3314933156(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3320833215(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3327033277(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3333633343(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3339833405(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3346833475(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3353333540(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3358533592(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3363433641(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3368533692(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3374333750(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3379733804(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3385933866(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3393333940(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3401234019(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3407234079(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3413334140(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3419234199(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3425434261(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3432234329(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3438634393(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3447434481(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3452634533(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3460534612(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3466334670(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3471834725(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3477734784(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3483334840(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3488934896(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3495434961(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3503035037(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3509435101(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3515935166(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3521835225(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3528335290(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3533935346(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3539935406(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3547335480(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3554035547(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3559435601(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3565635663(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3571835725(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3578135788(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3583135838(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3588735894(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3595535962(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3600336010(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3605736064(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3611636123(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3618936196(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3623736244(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3629136298(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3635036357(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3642336430(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3648436491(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3655836565(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3667636683(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3674536752(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3681136818(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3687036877(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3692836935(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3700337010(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3706637073(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3723237239(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3729337300(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3734637353(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3756637573(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3762137628(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3769037697(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3775737764(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3782137828(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined4708847095(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined4715247159(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined4721647223(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined4729147298(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined4734447351(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined4757747584(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined4763247639(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined4769347700(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined4782347830(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined4788647893(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined4793747944(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined4830548312(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined4835848365(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined4841548422(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined4847148478(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined4870348710(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined4876248769(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined4882348830(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined4910149108(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined4916449171(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined4924149248(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined4932249329(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined4940549412(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined4949149498(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined4955349560(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined4962549632(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined4970349710(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined4979049797(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined4987449881(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined4994349950(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined5000450011(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined5007650083(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined5014750154(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined5021150218(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined5027850285(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined5034450351(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined5039850405(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined5046250469(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined5081050817(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined5088050887(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined5093550942(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined5099751004(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined5107551082(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined5112551132(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined5118551192(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined5132851335(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined5139651403(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined5146751474(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined5160551612(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined5168051687(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined5173251739(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined5178251789(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined5183251839(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined5190351910(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined5196551972(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined5202352030(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined5208052087(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined5213452141(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined5218452191(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined5236352371(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined5268952697(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined5274352759_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminStats */ .dEundefined5280152822_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminNotifStats */ .biundefined5287052890_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminMailStats */ .u4undefined5293652954_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminReports */ .z5undefined5303653062_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminSpecialistCards */ .s_undefined5317153179(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined5327053286_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminUsers */ .cSundefined5358353591(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined5368253698_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminTasks */ .Yjundefined5399954007(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined5410054118_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminReports */ .z5undefined5434354351(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined5446254488_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminSpecialistCards */ .s_undefined5477054778(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined5512355148_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminSupportTickets */ .KZundefined5543755445(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined5553955564_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminBalanceHistory */ .g0undefined5595955967(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined5610056117_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminAiLogs */ .j_undefined5633456357_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminActivityLogs */ .yOundefined5699957018_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminMailLogs */ .qtundefined5758857608_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminNotifLogs */ .Brundefined5853258540(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined5869358701(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined5881458822(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined5895458962(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined5902759043_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminPlans */ .OXundefined5913059138(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined5924659269_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getTranslationsStats */ .YQundefined5941459422(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined5948859494(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .request */ .Em)undefined5963259638(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .request */ .Em)undefined5977359779(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .request */ .Em)undefined5991559923(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined6002760047_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminReferrals */ .cJundefined6026060268(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined6036060376_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminPlans */ .OXundefined6050160509(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined6059760605(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined6069560703(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined6145461475_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .adminBroadcastPush */ .V7undefined6166961691_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .adminSendPushToUser */ .g1undefined6206262079_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .deactivateUser */ .Wiundefined6208362098_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .activateUser */ .Heundefined6231462331_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .changeUserRole */ .Mmundefined6291362928_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminUser */ .jdundefined6424964267_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updateAdminUser */ .wlundefined6580165829_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .adminUpdateSpecialistCard */ .oqundefined6682266845_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .verifyAdminUserEmail */ .uQundefined6752267546_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .adminTopUpUserBalance */ .P0undefined6802168046_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminBalanceHistory */ .g0undefined6872968756_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .adminWithdrawUserBalance */ .hDundefined6924069265_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminBalanceHistory */ .g0undefined7004470072_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .adminUpdateSpecialistCard */ .oqundefined7100871036_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .adminUpdateSpecialistCard */ .oqundefined7149871516_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminReports */ .z5undefined7159871624_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminSpecialistCards */ .s_undefined7176871786_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .cancelTaskAdmin */ .nfundefined7232772345_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .deleteTaskAdmin */ .GBundefined7267772698_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updateReportStatus */ .eUundefined7290872916(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined7298573005_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminLocations */ .k_undefined7517075187_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updateLocation */ .Ntundefined7535675373_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .createLocation */ .yJundefined7615076167_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .deleteLocation */ .zRundefined7649576503(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined7657376594_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminCategories */ .KDundefined7668076688(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined8002580055"https://api.canhelp.gr"undefined80060800820undefined8104081057_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updateCategory */ .$7undefined8122681243_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .createCategory */ .zZundefined8206882085_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .deleteCategory */ .K7undefined8289782914_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminSkills */ .i_undefined8446384477_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updateSkill */ .fPundefined8522285236_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .createSkill */ .S9undefined8634686360_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .deleteSkill */ .hpundefined9662896641_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updatePlan */ .tdundefined9681396826_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .createPlan */ .qTundefined9710497120_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminPlans */ .OXundefined9745197464_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .deletePlan */ .bRundefined9758197589(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined9768497700_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminPlans */ .OXundefined9774597764_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminSettings */ .rCundefined106399106424_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminEmailTemplates */ .Lpundefined106896106918_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updateAdminSettings */ .CXundefined107462107484_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updateAdminSettings */ .CXundefined108665108692_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updateAdminEmailTemplate */ .jgundefined108793108823_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .translateAdminEmailTemplate */ .wcundefined109527109554_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updateAdminEmailTemplate */ .jgundefined109920109947_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updateAdminEmailTemplate */ .jgundefined110392110414_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updateAdminSettings */ .CXundefined111167111189_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updateAdminSettings */ .CXundefined111663111685_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updateAdminSettings */ .CXundefined112679112701_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updateAdminSettings */ .CXundefined113440113462_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updateAdminSettings */ .CXundefined115079115104_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .testTelegramConnection */ .qXundefined116325116347_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .verifyTelegramToken */ .clundefined116946116949(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined117982117985(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined118228118231(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined118708118712(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined118977118980(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined119216119219(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined119388119391(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined119754119757(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined120000120003(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined120500120503(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined120746120749(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined121223121227(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined121492121495(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined121810121813(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined122146122149(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined122392122395(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined122943122947(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined123212123215(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined123494123497(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined123861123865(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined124130124133(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined124398124401(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined124762124766(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined125031125034(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined125308125311(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined125631125635(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined125900125903(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined126026126029(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined126358126362(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined126627126630(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined126801126804(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined127721127724(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined127967127970(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined128417128420(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined128663128666(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined129067129070(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined129313129316(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined129689129692(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined129935129938(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined130352130356(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined130621130624(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined130829130832(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined131066131069(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined131304131307(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined131656131659(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined131902131905(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined134379134382(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined134471134475(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined134594134598(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined134752134756(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined134919134922(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined135183135186(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined135439135442(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined135729135733(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined135735135738(next_link__WEBPACK_IMPORTED_MODULE_3___default())undefined135990135993(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined136342136345(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined136804136808(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined136934136937(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined137125137129(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined137339137342(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined137850137853(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined138330138333(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined138887138891(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined139515139518(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined139853139857(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined140101140104(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined140330140333(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined141061141065(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined141238141242(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined141415141418(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined141908141911(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined142382142385(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined143280143284(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined143817143820(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined144700144703(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined145626145629(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined146100146103(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined147048147051(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined147522147525(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined148502148505(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined148976148979(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined150048150052(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined150310150313(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined150623150626(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined150994150997(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined151570151574(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined151808151812(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined152062152065(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined152407152411(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined152679152683(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined152969152972(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined153510153514(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined153800153803(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined154348154352(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined154638154641(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined155389155392(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined157167157171(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined157405157408(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined157726157729(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined161886161890(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined162199162202(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined162583162586(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined162831162834(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined163491163494(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined163881163885(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined164875164879(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined165113165117(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined165367165370(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined165717165721(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined166005166008(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined166596166599(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined167402167406(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined167640167644(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined167894167897(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined168243168247(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined168531168534(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined169118169121(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined169906169910(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined170154170158(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined170403170406(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined170748170752(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined171020171024(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined171310171313(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined171851171855(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined172141172144(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined172888172892(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined173126173130(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined173424173427(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined173807173810(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined174324174328(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined174616174619(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined174995174998(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined175508175512(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined175808175811(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined176186176190(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined177242177245(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined179170179174(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined179287179291(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined179494179498(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined180008180011(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined180635180638(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined181205181209(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined181642181645(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined181958181961(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined182281182284(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined182776182780(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined183026183030(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined183258183261(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined183453183457(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined183625183628(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined184016184019(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined184408184411(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined184799184802(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined185198185201(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined185595185598(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined185988185991(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined186426186429(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined186635186638(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined186736186739(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined187212187215(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined187313187316(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined188013188017(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined188292188295(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined188517188531(0,_lib_formatName__WEBPACK_IMPORTED_MODULE_8__/* .formatShortName */ .H)undefined188728188731(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined189111189114(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined189324189327(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined189997190000(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined190460190464(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined191043191046(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined191501191504(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined191929191932(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined192142192145(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined192792192795(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined193016193020(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined193353193356(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined193811193814(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined194503194506(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined195373195376(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined196732196735(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined197404197408(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined197521197525(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined197738197741(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined198348198352(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined198789198792(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined199125199128(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined199458199461(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined199812199815(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined200163200166(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined200700200704(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined200950200954(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined201182201185(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined201377201381(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined201549201552(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined201940201943(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined202357202360(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined202768202771(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined203180203183(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined203601203604(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined204184204187(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined204393204396(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined204494204497(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined204976204979(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined205077205080(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined206132206136(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined206421206425(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined206717206720(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined207147207150(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined207733207736(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined207946207949(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined208535208539(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined209439209442(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined209666209670(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined210616210619(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined211023211026(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined211816211819(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined212491212495(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined212608212612(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined212815212819(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined213329213332(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined213956213959(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined214526214530(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined214967214970(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined215712215715(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined216224216228(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined216474216478(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined216706216709(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined216901216905(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined217073217076(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined217465217468(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined217860217863(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined218253218256(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined218646218649(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined219040219043(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined219478219481(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined219687219690(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined219788219791(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined220264220267(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined220365220368(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined221194221198(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined221473221476(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined221721221724(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined221726221729(next_link__WEBPACK_IMPORTED_MODULE_3___default())undefined222538222541(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined223067223070(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined223280223283(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined223988223991(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined224225224235(0,_lib_taskLocale__WEBPACK_IMPORTED_MODULE_9__/* .formatPrice */ .$g)undefined224424224427(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined224855224858(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined225079225083(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined225465225468(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined226106226109(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined227445227448(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined228119228123(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined228236228240(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined228466228469(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined228762228766(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined229479229483(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined229726229730(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined230104230108(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined230811230815(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined231069231073(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined231234231237(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined231621231624(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined232597232601(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined232762232765(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined233149233152(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined234265234269(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined234430234433(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined234818234821(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined235791235795(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined235956235960(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined236592236595(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined237477237481(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined237642237646(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined238278238281(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined239163239167(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined239328239332(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined239964239967(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined240849240853(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined241014241018(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined241650241653(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined242646242650(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined242914242917(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined243747243751(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined243973243976(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined244577244580(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined245260245263(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined245491245494(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined245745245748(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined247596247600(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined247713247717(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined247943247946(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined248239248243(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined248956248960(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined249203249207(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined249581249585(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined250285250289(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined250543250547(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined250708250711(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined251095251098(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined252077252081(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined252242252246(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined252878252881(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined253761253765(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined253926253930(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined254562254565(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined255445255449(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined255610255614(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined256246256249(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined257129257133(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined257294257298(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined257930257933(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined258910258914(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined259154259158(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined259398259401(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined259786259789(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined260773260777(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined261065261068(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined262083262087(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined262309262312(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined262913262916(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined263596263599(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined263827263830(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined264081264084(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined264986264990(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined265173265176(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined265433265436(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined265907265910(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined266102266106(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined266356266360(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined266610266614(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined266912266915(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined267503267506(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined268070268074(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined268737268740(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined268742268745(next_link__WEBPACK_IMPORTED_MODULE_3___default())undefined269377269381(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined270431270435(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined270894270897(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined271434271437(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined271788271791(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined272323272327(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined272587272590(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined273140273143(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined273990273993(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined274533274537(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined274710274714(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined274927274931(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined275189275192(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined275546275549(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined275902275905(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined276387276391(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined276649276652(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined277004277007(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined277359277362(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined277948277951(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined278216278219(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined278489278493(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined278690278694(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined278839278842(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined279215279218(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined279435279438(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined280037280040(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined280272280276(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined280596280600(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined280910280914(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined281272281275(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined281821281824(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined282479282482(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined282734282737(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined282739282742(next_link__WEBPACK_IMPORTED_MODULE_3___default())undefined283635283638(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined284238284242(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined284562284565(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined285234285237(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined286479286483(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined286628286631(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined286999287002(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined287218287221(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined287809287812(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined288044288048(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined288368288372(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined288682288686(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined289044289047(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined289589289592(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined290247290250(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined290502290505(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined290507290510(next_link__WEBPACK_IMPORTED_MODULE_3___default())undefined291403291406(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined292006292009(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined293054293057(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined293752293756(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined293869293872(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined295285295288(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined295910295914(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined296043296047(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined296297296301(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined296907296911(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined297144297161_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminAiLogs */ .j_undefined297824297828(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined298447298450(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined298731298734(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined299659299662(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined299940299943(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined300203300206(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined300409300413(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined300653300656(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined300878300882(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined301058301061(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined301450301453(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined301846301849(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined302239302242(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined302633302636(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined303026303029(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined303417303420(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined303809303812(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined304203304206(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined304594304597(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined305178305181(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined305634305638(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined305934305937(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined306394306397(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined306615306618(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined307237307240(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined307656307659(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined308058308061(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined308542308545(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined309046309049(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined309554309557(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined310056310059(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined310556310559(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined310803310806(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined311059311062(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined311725311728(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined312138312141(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined312561312565(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined313322313325(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined313960313963(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined315341315344(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined315952315956(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined316085316089(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined316383316387(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined316548316551(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined316941316945(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined317482317485(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined317894317897(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined318508318512(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined318673318676(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined319065319068(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined319770319774(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined319935319938(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined320325320328(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined321101321105(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined321940321944(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined322561322564(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined323079323082(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined323930323934(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined324683324686(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined324950324953(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined325141325144(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined325889325892(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined326508326512(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined326641326645(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined326939326943(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined327104327107(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined327493327497(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined328026328029(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined328430328433(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined329094329098(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined329259329262(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined329647329650(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined330344330348(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined330509330512(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined330895330898(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined331633331637(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined332373332377(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined332994332997(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined333512333515(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined334359334363(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined335100335103(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined335363335366(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined335569335573(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined335813335816(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined336038336042(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined336218336221(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined336610336613(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined337007337010(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined337400337403(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined337796337799(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined338191338194(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined338775338778(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined340147340151(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined340457340460(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined340919340922(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined341320341323(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined341541341544(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined342140342143(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined342540342543(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined342784342787(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined343398343401(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined343641343644(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined344020344023(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined344686344689(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined345099345102(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined345484345488(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined346245346248(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined346883346886(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined348266348269(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined348882348886(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined349015349019(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined349313349317(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined349478349481(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined349872349876(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined350413350416(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined350812350815(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined351426351430(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined351591351594(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined351983351986(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined352690352694(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined352855352858(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined353245353248(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined354007354011(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined354761354765(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined355382355385(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined355900355903(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined356751356755(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined357505357508(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined357774357777(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined357980357984(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined358224358227(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined358449358453(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined358629358632(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined359021359024(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined359412359415(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined359810359813(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined360209360212(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined360797360800(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined361196361200(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined361496361499(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined361954361957(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined362520362523(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined362741362744(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined363280363283(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined363697363700(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined363941363944(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined364197364200(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined364863364866(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined365276365279(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined365531365534(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined366195366198(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined367365367368(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined368046368050(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined368163368167(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined368393368397(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined368667368671(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined369247369250(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined369876369879(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined370637370640(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined371168371172(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined371421371424(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined371773371777(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined372011372015(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined372176372179(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined372570372573(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined373486373490(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined373651373654(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined374046374049(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined375208375212(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined375373375376(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined375772375775(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined377117377121(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined377282377285(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined377676377680(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined378502378505(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined378890378893(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined379276379279(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined380011380015(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined380160380163(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined380529380532(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined381379381382(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined381735381739(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined381973381977(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined382138382141(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined382537382540(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined383709383713(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined383874383877(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined384274384277(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined385448385452(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined385613385616(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined386012386015(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined387184387188(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined387349387352(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined387755387758(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined388945388949(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined389110389113(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined389514389517(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined390700390704(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined390865390868(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined391265391268(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined392439392443(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined392604392607(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined393007393010(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined394284394287(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined394639394643(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined394877394881(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined395042395045(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined395444395447(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined396544396548(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined396709396712(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined397116397119(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined398397398401(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined398546398549(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined398912398915(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined399840399843(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined400197400200(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined402065402069(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined402367402370(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined403469403472(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined403827403830(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined408332408336(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined408634408637(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined409736409740(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined409980409984(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined410282410285(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined411313411317(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined411615411618(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined412643412647(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined412906412909(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined413278413281(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined414350414354(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined414581414584(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined415193415196(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined415846415849(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined416069416072(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined416333416336(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined417004417008(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined417308417312(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined417574417578(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined417883417886(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined418308418311(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined418799418802(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined419416419419(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined419796419800(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined420119420123(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined420490420494(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined421333421337(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined422210422214(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined422892422896(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined423575423579(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined424254424258(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined424593424596(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined425261425264(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined426498426501(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined426738426742(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined427084427087(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined427328427331(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined428018428021(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined429047429051(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined429337429340(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined429439429452_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updatePlan */ .tdundefined429649429665_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminPlans */ .OXundefined430082430085(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined430678430681(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined431189431192(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined431735431738(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined432743432747(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined432860432863(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined434525434528(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined435150435154(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined435397435400(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined435719435723(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined435944435948(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined436109436112(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined436514436517(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined437548437552(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined437713437716(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined438117438120(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined439161439165(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined439326439329(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined439735439738(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined440872440876(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined441037441040(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined441446441449(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined442496442499(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined443388443392(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined443635443638(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined443954443957(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined444265444269(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined444490444494(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined444752444756(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined445026445029(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined445455445458(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined446570446574(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined446751446754(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined447180447183(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined448397448401(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined448562448565(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined448965448969(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined449815449818(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined450205450208(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined450577450580(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined451190451194(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined451355451358(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined451756451759(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined452880452884(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined453045453048(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined453446453449(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined454663454667(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined454925454929(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined455106455109(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined455540455543(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined456656456660(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined456837456840(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined457272457275(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined458606458609(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined459282459285(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined459717459733_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .sendTestEmail */ .FIundefined460886460890(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined461177461180(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined461745461748(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined462666462669(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined463284463288(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined463494463498(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined463756463760(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined464034464038(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined464321464324(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined464783464787(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined464980464983(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined465413465416(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined466118466122(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined466422466425(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined466824466827(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined467650467653(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined468383468387(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined468632468636(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined468813468816(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined469242469246(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined470106470109(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined470523470526(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined471220471224(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined471401471404(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined471832471835(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined472974472978(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined473260473264(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined473457473460(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined473899473902(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined475098475102(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined475295475298(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined475741475744(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined477188477192(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined477369477372(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined477797477800(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined478966478970(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined479147479150(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined479559479562(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined480821480825(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined481089481092(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined481773481776(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined482353482357(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined482665482669(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined483244483247(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined483639483642(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined484110484113(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined484698484701(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined485159485163(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined485370485374(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined485687485691(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined486266486269(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined486661486664(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined487132487135(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined487720487724(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined488255488258(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined489246489249(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined489767489770(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined490623490626(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined491145491148(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined491934491937(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined492456492459(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined493312493315(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined493835493838(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined494672494675(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined495195495198(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined496066496069(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined496588496591(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined497340497343(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined497861497864(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined498705498708(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined499225499228(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined500049500052(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined500571500574(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined501512501515(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined502033502036(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined502901502904(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined503424503427(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined504209504212(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined504729504732(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined505567505570(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined506091506094(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined507151507154(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined507672507675(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined508468508471(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined508990508993(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined509788509791(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined510311510314(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined511166511169(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined511688511691(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined512481512484(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined513004513007(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined513964513967(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined514484514487(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined516293516297(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined516579516583(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined517029517032(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined517388517392(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined517678517681(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined518101518105(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined518825518828(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined519396519399(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined519666519669(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined520260520263(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined520826520830(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined521127521130(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined521753521756(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined522668522672(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined522857522860(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined523308523311(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined525383525387(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined525572525575(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined526020526023(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined528357528361(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined528689528692(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined529124529127(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined529603529606(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined530383530387(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined530679530682(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined531470531474(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined532154532157(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined532822532825(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined533890533893(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined535020535024(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined535277535281(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined535426535429(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined535776535779(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined536220536224(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined536469536473(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined536634536637(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined537029537032(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined537524537527(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined538246538249(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined538774538778(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined539037539040(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined539427539431(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined539592539595(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined539999540003(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined540849540852(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined541256541259(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined541765541768(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined542262542266(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined542427542430(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined542834542837(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined543899543902(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined544493544497(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined544732544735(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined545384545387(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined545929545933(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined546186546190(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined546335546338(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined546689546692(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined547487547490(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined547831547834(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined549106549109(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined549450549453(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined551004551007(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined551348551351(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined552271552274(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined552615552618(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined553413553416(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined553757553760(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined554742554745(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined555086555089(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined556036556039(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined556380556383(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined558132558135(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined558476558479(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined560444560448(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined560601560605(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined560923560926(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined561422561425(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined561937561940(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined563115563119(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined563359563362(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined564003564006(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined564544564548(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined564801564804(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined565114565118(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined565363565367(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined565528565531(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined565922565925(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined566423566426(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined567171567174(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined567702567706(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined567951567955(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined568116568119(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined568507568510(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined569005569008(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined569755569758(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined570286570289(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined570452570456(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined570609570613(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined571319571322(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined573355573359(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined574529574532(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined574921574924(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined576210576213(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined576608576611(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined578149578153(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined578298578301(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined578676578679(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined579031579034(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined580187580191(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined580426580429(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined581058581061(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined581604581608(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined581861581865(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined582010582013(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined582365582368(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined582804582808(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined582953582956(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined583327583331(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined583577583580(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined584860584863(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined585723585726(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined586324586328(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined586473586476(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined586851586855(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined587101587104(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined588128588131(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined588991588994(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined589376589379(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined589969589973(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined590194590197(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined590568590571(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined592970592974(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined593143593147(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined593449593452(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined593846593849(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined594392594396(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined594678594681(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined595823595826(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined596802596805(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined597625597629(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined597850597854(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined598123598127(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined598304598307(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined598738598741(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined599301599304(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined600151600154(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined600739600743(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined601012601016(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined601193601196(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined601621601624(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined602178602181(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined603007603010(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined603685603689(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined603929603932(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined604581604584(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined605183605187(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined605360605364(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined605577605581(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined606163606166(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined606795606798(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined607286607289(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined608189608193(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined608874608877(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined609210609213(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined609541609544(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined609893609896(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined610236610239(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined610670610674(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined611351611354(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined611681611685(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined612211612215(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined612762612766(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined613395613399(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined614066614069(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined614333614336(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined615991615995(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined616241616245(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined616512616516(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined616778616782(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined617092617096(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined618048618051(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined618660618664(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined619468619471(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined619873619877(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined620585620588(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined621123621127(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined621429621432(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined622380622383(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined622482622507_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .setSupportTicketStatus */ .u0undefined623576623579(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined623967623971(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined624250624254(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined624846624849(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined625327625331(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined625569625572(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined626339626343(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined626614626618(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined627201627204(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined627612627615(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined628044628047(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined628467628470(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined629021629024(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined629697629720_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .replyToSupportTicket */ .nTundefined631862631865(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined632399632403(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined632576632580(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined632824632827(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined633131633135(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined633357633360(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined634004634007(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined634767634771(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined634916634919(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined635249635252(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined635995635999(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined636258636261(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined636864636868(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined637013637016(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined637348637351(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined638070638074(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefinedÀ638219638222(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined638550638553(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined639345639349(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined639598639602(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined639763639766(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined640124640127(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined640917640921(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined641082641085(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined641466641469(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined642347642351(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined642586642589(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined643356643359(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined643868643872(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined644106644109(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined644435644439(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined644696644700(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined644990644993(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined645340645343(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined645823645827(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined646117646120(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined646462646465(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined646948646952(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined647242647245(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined647594647597(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined648077648081(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined648371648374(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined648725648728(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined649211649215(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined649505649508(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined649858649861(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined650399650403(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined650660650664(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined650954650957(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined651298651301(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined651797651801(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined652091652094(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined652443652446(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined653032653036(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined653326653329(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined653678653681(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined654155654159(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined654449654452(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined654803654806(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined655415655418(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined655420655428react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragmentundefined656140656144(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined656452656456(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined658092658096(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined659021659025(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined659807659810(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined659812659820react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragmentundefined659921659925(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined660233660237(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined661024661028(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined661608661612(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined662499662503(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined662676662680(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined662926662929(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined663391663394(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined664037664041(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined664416664419(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined664617664620(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined665158665162(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined665430665434(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined665579665582(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined665943665946(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined666431666434(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined666812666818(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .request */ .Em)undefined667847667850(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined668328668332(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined668566668569(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined668905668909(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined669141669145(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined669568669598"https://api.canhelp.gr"undefined6696036696250undefined671662671665(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined672206672209(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined673059673063(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined673500673503(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined674044674047(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined674795674798(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined676173676203"https://api.canhelp.gr"undefined6762086762300undefined677996678000(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined678234678237(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined678613678616(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined678897678900(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined679090679094(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined679418679422(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined679599679602(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined680087680091(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined681380681383(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined682016682022(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .request */ .Em)undefined683846683850(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined684084684087(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined684437684441(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined684698684702(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined685114685117(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined685780685783(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined686500686503(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined686758686761(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined686930686933(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined687111687114(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined687334687338(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined687613687616(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined688002688005(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined688221688225(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined688556688559(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined688889688919"https://api.canhelp.gr"undefined6889246889460undefined691388691392(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined692046692049(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined693785693815"https://api.canhelp.gr"undefined6938206938420undefined697242697246(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined697419697423(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined697552697555(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined697856697859(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined698278698282(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined698547698551(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined698696698699(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined699042699046(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined699582699585(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined699937699940(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined700294700297(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined700651700654(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined701220701223(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined701701701704(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined702129702133(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined702278702281(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined702628702632(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined703160703163(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined703515703518(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined703872703875(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined704229704232(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined704798704801(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined704971704975(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined705856705859(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined706392706395(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined707726707729(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined708095708099(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined708337708341(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined708713708716(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined709315709318(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined709913709916(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined711105711109(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined711381711385(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined711653711657(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined711834711837(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined712230712233(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined712747712750(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined713382713386(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined714025714028(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined715024715028(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined715915715944_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getTasksTranslationPreview */ .QYundefined718084718087(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined718295718299(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined718597718600(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined719183719186(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined719880719883(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined721326721347_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .autoTranslateTasks */ .Iundefined721395721425_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .autoTranslateEmailTemplates */ .fuundefined721461721477_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .autoTranslate */ .cpundefined722109722132_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getTranslationsStats */ .YQundefined724024724028(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined724030724038react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragmentundefined724209724213(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined724723724726(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined725517725520(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined726346726350(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined726352726360react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragmentundefined726531726534(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined727141727144(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined728059728063(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined728065728073react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragmentundefined728244728247(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined728854728857(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined730469730472(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined731088731091(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined732864732867(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined732955732959(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined733132733135(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined735077735081(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined735352735355(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined735680735683(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined736188736192(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined736439736443(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined736723736726(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined737057737061(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined737305737325_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminReferrals */ .cJundefined737777737781(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined738233738236(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined738963738966(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined739893739896(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined740075740079(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined740487740490(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined741121741124(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined741696741699(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined741970741973(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined743320743324(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined743485743489(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined744346744349(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined745026745029(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined745589745593(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined745891745894(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined746340746343(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined747035747038(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined747479747483(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined748327748330(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined748551748555(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined748843748846(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined748963748967(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined749298749301(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined749777749780(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined750248750251(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined750721750724(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined751197751200(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined751905751908(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined753024753028(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined753418753421(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined753896753899(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined754367754370(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined754634754638(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined755539755542(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined755806755809(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined756973756976(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined758846758849(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined759111759115(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined759440759444(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined759726759730(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined759883759887(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined760254760257(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined760763760766(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined761228761231(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined761525761528(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined762021762024(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined762636762639(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined762840762843(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined763022763026(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined763434763437(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined764068764071(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined764624764627(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined764896764900(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined765144765147(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined765244765248(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined765519765522(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined765929765932(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined766713766716(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined767300767303(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined767429767433(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined767733767736(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined768235768238(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined768460768463(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined770605770608(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined770974770977(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined771315771318(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined772326772329(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined772519772523(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined772773772777(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined773059773063(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined773216773219(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined773584773588(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined774335774338(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined774850774854(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined775073775076(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined777224777227(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined777718777748_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminUserSpecialistCards */ .vyundefined777913777934_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminCategories */ .KDundefined778102778122_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminLocations */ .k_undefined779314779318(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined779597779601(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined779858779862(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined780193780197(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined780396780400(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined781533781537(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined781736781740(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined782987782991(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined783285783289(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined783490783493(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined783969783972(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined785201785205(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined785406785409(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined785884785887(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined787248787252(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined787437787440(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined787879787882(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined789011789015(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined789200789203(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined789640789643(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined791016791020(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined791277791281(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined791466791469(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined791908791911(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined792523792527(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined792871792875(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined793219793222(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined793699793702(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined794346794349(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined794824794827(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined795655795658(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined796427796430(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined797316797320(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined797614797618(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined797819797822(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined798292798296(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined799238799241(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined799705799708(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined800496800500(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined800701800704(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined801174801178(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined802217802220(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined802696802699(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined803641803645(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined804407804411(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined804723804726(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined805690805693(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined806246806250(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined806435806438(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined806886806890(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined807859807862(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined808272808275(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined808684808687(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined809386809390(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined809575809578(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined810026810029(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined810906810910(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined811272811275(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined813449813452(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined814619814623(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined814880814884(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined815238815242(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined815443815446(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined815899815903(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined816893816897(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined817203817207(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined817770817773(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined818370818373(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined819462819466(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined820026820029(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined820626820629(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined822005822008(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined822554822557(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined822744822748(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined823047823051(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined823390823394(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined823603823606(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined824092824095(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined824735824738(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined826002826006(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined826345826349(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined826558826561(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined827046827049(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined827688827691(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined828950828954(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined829293829297(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined829506829509(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined829992829995(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined830632830635(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined832102832106(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined832363832367(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined832552832555(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined833007833011(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined833330833334(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined833775833778(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined834309834312(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined835750835753(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined836454836457(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined837146837149(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined838271838275(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined838277838285react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragmentundefined838464838467(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined838929838932(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined842736842740(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined843117843120(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined843583843586(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined845939845943(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined846243846246(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined846716846720(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined848603848606(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined849068849071(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined850147850151(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined854047854051(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined854385854388(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined854895854898(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined855395855398(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined855686855689(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined856291856295(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined856480856483(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined856923856926(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined857288857292(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined857798857801(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined859429859433(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined859739859742(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined863012863015(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined865822865826(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined866127866130(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined866595866598(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined866962866965(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined867322867325(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined867895867899(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined868277868281(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined868648868651(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined870025870029(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined870453870456(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined871760871763(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined872696872699(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined874157874161(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined874394874397(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined874927874930(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined875326875330(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined875932875935(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined877969877973(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined878351878354(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined883811883814(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined887953887957(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined888190888193(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined888727888730(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined889389889393(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined890369890372(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined892546892549(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined894984894988(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined895221895224(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined895757895760(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined896415896419(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined897393897396(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined899562899565(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined901990901993(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined902256902259(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined904027904031(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined904290904293(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined904876904879(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined905391905394(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined905588905591(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined906211906214(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined906406906410(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined906725906729(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined906967906970(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined907429907432(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined907948907952(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined908316908320(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined909021909025(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined909234909238(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined909391909394(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined909897909900(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined911672911676(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined911829911832(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined912345912348(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined914232914236(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined914451914454(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined915905915908(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined916887916894(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined916946916953(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined916996917003(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined917044917051(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined917755917771_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getSkillDedup */ .GEundefined918787918810_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .mergeSkillDuplicates */ .Uqundefined919503919526_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .mergeSkillDuplicates */ .Uqundefined919990919994(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined920083920087(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined920160920163(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined920364920367(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined920610920614(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined920776920780(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined920976920980(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined921085921088(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined921348921351(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined921772921776(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined922211922215(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined922634922637(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined922928922931(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined923539923542(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined923670923674(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined923923923926(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined924289924292(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined924714924718(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined924867924871(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined925068925072(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined925699925702(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined926524926528(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined926774926778(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined927069927073(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined927304927308(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined928014928017(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined928444928448(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined929114929117(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined929822929825(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined930013930017(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined930321930324(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined931210931214(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined931476931480(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined931785931788(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined932250932254(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined932964932968(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined933645933649(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined934447934451(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined934753934756(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined935305935309(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined936005936008(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined937429937432(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined937434937442react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragmentundefined938022938026(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined938099938103(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined938458938461(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined938818938821(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined939176939179(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined939350939353(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined939708939711(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined939882939885(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined940087940090(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined940440940443(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined940837940841(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined941229941232(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined941591941594(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined941960941964(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined942130942133(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined942378942381(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined942625942629(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined943077943080(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined943446943450(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined943641943644(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined944092944095(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined944471944474(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined944982944985(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined946062946065(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined946067946075react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragmentundefined946999947003(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined947076947080(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined947435947438(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined947795947798(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined948153948156(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined948327948330(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined948685948688(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined948859948862(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined949050949053(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined949233949236(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined949238949249_components_CategoryIcon__WEBPACK_IMPORTED_MODULE_7__/* .CategoryIcon */ .Ezundefined949618949622(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined949788949791(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined950036950039(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined950373950377(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined950825950828(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined951194951198(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined951374951378(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined951854951857(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined952278952281(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined953025953028(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined953473953476(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined953852953855(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined954352954355(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined955126955129(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined956737956741(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined956878956881(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined957211957215(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined957304957307(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined957582957585(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined958417958421(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined958578958581(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined958768958771(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined959285959289(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined959435959438(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined959772959775(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined960790960794(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined961134961138(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined961270961273(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined961482961486(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined961759961763(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined962069962072(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined962177962181(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined962631962635(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined963028963031(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined963355963358(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined963896963900(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined964054964058(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined964294964297(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined964672964675(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined965018965022(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined965174965177(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined965725965729(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined965826965830(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined966198966202(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined966404966407(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined966740966743(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined967105967108(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined967504967508(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined967927967931(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined968225968228(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined968862968865(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined969482969485(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined969621969624(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined970170970173(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined970275970278(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined970845970849(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined971019971023(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined971207971211(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined971325971328(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined971660971664(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined971947971950(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined972596972599(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined972808972811(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined973238973241(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined973450973453(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined973853973857(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined974084974087(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined974239974242(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined974602974605(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined974814974817(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined975192975195(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined975404975407(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined975783975787(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined976014976017(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined976169976172(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined976351976354(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined976708976712(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined976939976942(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined977051977054(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined977476977479(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined977688977691(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined977955977959(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined978186978189(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined978368978371(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined978716978719(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined978928978931(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined979615979618(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined979827979830(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined980272980276(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined980431980435(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined980787980791(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined980909980913(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined981092981095(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined981449981452(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined981751981754(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined981999982003(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined982290982293(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined982643982646(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined982855982858(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined983083983082(/* unused pure expression or super */ null && (undefined983217983216))undefined984710984713(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined984794984798(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined985159985163(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined985250985253(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined985600985603(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined986262986265(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined987118987121(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined987455987458(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined990256990259(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined990340990344(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined990675990679(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined990766990769(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined991116991119(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined991690991693(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined992102992105(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined992458992461(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined992658992661(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined993188993191(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined993248993251(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined993632993635(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined ÏÜÝhŒÿÿÐ-Åÿÿž¹ ê?«webpack/lib/util/registerExternalSerializerœwebpack-sources/ConcatSource€«webpack/lib/util/registerExternalSerializer™webpack-sources/RawSourceÃ__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ MakeOfferPage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7541); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(9664); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(next_link__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(1592); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(9906); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(2982); /* harmony import */ var _lib_formatName__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(1258); /* harmony import */ var _lib_taskLocale__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(4017); «webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourceÊ3/* __next_internal_client_entry_do_not_use__ default auto */ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { useState, useEffect } from 'react'; import { useRouter, useParams } from 'next/navigation'; import Link from 'next/link'; import { useSession } from '@/lib/auth'; import { useLocale } from '@/context/locale'; import { getTask, createOffer, getLocations } from '@/lib/api'; import { shortName } from '@/lib/formatName'; import { formatPrice, taskTitle, taskDescription } from '@/lib/taskLocale'; export default function MakeOfferPage() { const { id } = useParams(); const router = useRouter(); const { data: session, isPending } = useSession(); const { t, locale } = useLocale(); const [task, setTask] = useState(null); const [loading, setLoading] = useState(true); const [rawLocs, setRawLocs] = useState([]); const [submitting, setSubmitting] = useState(false); const [error, setError] = useState(''); const locMap = rawLocs.reduce((acc, city)=>{ var _city_names, _city_names1; var _city_names_locale, _ref; acc[city.slug] = (_ref = (_city_names_locale = (_city_names = city.names) === null || _city_names === void 0 ? void 0 : _city_names[locale]) !== null && _city_names_locale !== void 0 ? _city_names_locale : (_city_names1 = city.names) === null || _city_names1 === void 0 ? void 0 : _city_names1.el) !== null && _ref !== void 0 ? _ref : city.slug; var _city_children; for (const d of (_city_children = city.children) !== null && _city_children !== void 0 ? _city_children : []){ var _d_names, _d_names1; var _d_names_locale, _ref1; acc[d.slug] = (_ref1 = (_d_names_locale = (_d_names = d.names) === null || _d_names === void 0 ? void 0 : _d_names[locale]) !== null && _d_names_locale !== void 0 ? _d_names_locale : (_d_names1 = d.names) === null || _d_names1 === void 0 ? void 0 : _d_names1.el) !== null && _ref1 !== void 0 ? _ref1 : d.slug; } return acc; }, {}); useEffect(()=>{ if (!isPending && !session) router.push('/login'); }, [ session, isPending ]); useEffect(()=>{ if (!id) return; getTask(id).then((data)=>setTask(data)).catch(()=>router.push("/tasks/".concat(id))).finally(()=>setLoading(false)); getLocations().then((locs)=>setRawLocs(locs)).catch(()=>{}); }, [ id ]); async function handleSubmit(e) { e.preventDefault(); setError(''); setSubmitting(true); const form = new FormData(e.currentTarget); try { await createOffer({ taskId: id, price: Number(form.get('price')), message: form.get('message') || undefined }); router.push("/tasks/".concat(id)); } catch (err) { setError(err.message || t('common.error')); } finally{ setSubmitting(false); } } if (isPending || loading) { return /*#__PURE__*/ _jsx("div", { className: "text-center py-20 text-white", children: t('common.loading') }); } var _task_task; const taskData = (_task_task = task === null || task === void 0 ? void 0 : task.task) !== null && _task_task !== void 0 ? _task_task : task; const customer = task === null || task === void 0 ? void 0 : task.customer; const customerName = (customer === null || customer === void 0 ? void 0 : customer.name) ? shortName(customer.name) : null; var _taskData_title, _locMap_taskData_location; return /*#__PURE__*/ _jsxs("div", { className: "max-w-xl mx-auto px-4 py-10", children: [ /*#__PURE__*/ _jsxs(Link, { href: "/tasks/".concat(id), className: "inline-flex items-center gap-1.5 text-sm text-white/70 hover:text-white mb-8 transition", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 19l-7-7 7-7" }) }), (_taskData_title = taskData === null || taskData === void 0 ? void 0 : taskData.title) !== null && _taskData_title !== void 0 ? _taskData_title : t('common.back_home', 'Back') ] }), /*#__PURE__*/ _jsx("h1", { className: "text-2xl font-bold text-white mb-1", children: t('task.offer.btn') }), customerName && /*#__PURE__*/ _jsxs("p", { className: "text-sm text-white/60 mb-6", children: [ t('common.from'), " ", customerName ] }), taskData && /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-4 mb-6 shadow-sm", children: [ /*#__PURE__*/ _jsx("p", { className: "font-semibold text-gray-900 text-sm line-clamp-2", children: taskTitle(taskData, locale) }), taskDescription(taskData, locale) && /*#__PURE__*/ _jsx("p", { className: "text-gray-500 text-xs mt-1 line-clamp-2", children: taskDescription(taskData, locale) }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-4 mt-2", children: [ taskData.budget && /*#__PURE__*/ _jsxs("span", { className: "text-xs text-gray-500", children: [ "\uD83D\uDCB0 ", t('task.budget'), ": ", /*#__PURE__*/ _jsxs("strong", { className: "text-gray-900", children: [ formatPrice(taskData.budget), "€" ] }) ] }), taskData.budgetNegotiable && !taskData.budget && /*#__PURE__*/ _jsxs("span", { className: "text-xs text-gray-500", children: [ "\uD83D\uDCAC ", t('task.budget_negotiable') ] }), taskData.location && /*#__PURE__*/ _jsxs("span", { className: "text-xs text-gray-500", children: [ "\uD83D\uDCCD ", (_locMap_taskData_location = locMap[taskData.location]) !== null && _locMap_taskData_location !== void 0 ? _locMap_taskData_location : taskData.location ] }) ] }) ] }), /*#__PURE__*/ _jsxs("form", { onSubmit: handleSubmit, className: "bg-white rounded-2xl border border-gray-100 p-6 shadow-sm space-y-5", children: [ error && /*#__PURE__*/ _jsx("div", { className: "bg-red-50 text-red-700 p-3 rounded-lg text-sm", children: error }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("label", { className: "block text-sm font-medium text-gray-700 mb-1.5", children: [ t('offer.price'), " (€) ", /*#__PURE__*/ _jsx("span", { className: "text-red-500", children: "*" }) ] }), /*#__PURE__*/ _jsxs("div", { className: "relative", children: [ /*#__PURE__*/ _jsx("span", { className: "absolute left-3 top-1/2 -translate-y-1/2 text-gray-400 font-medium select-none", children: "€" }), /*#__PURE__*/ _jsx("input", { name: "price", type: "number", required: true, min: 1, step: 1, placeholder: t('offer.price.placeholder'), className: "w-full border border-gray-200 rounded-xl pl-8 pr-3 py-3 focus:outline-none focus:ring-2 focus:ring-blue-400 text-xl font-bold text-gray-900" }) ] }), (taskData === null || taskData === void 0 ? void 0 : taskData.budget) && /*#__PURE__*/ _jsxs("p", { className: "text-xs text-gray-400 mt-1.5", children: [ t('offer.customer_budget'), ": ", /*#__PURE__*/ _jsxs("strong", { children: [ formatPrice(taskData.budget), "€" ] }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("label", { className: "block text-sm font-medium text-gray-700 mb-1.5", children: [ t('offer.message'), /*#__PURE__*/ _jsxs("span", { className: "text-gray-400 font-normal ml-1", children: [ "(", t('offer.optional'), ")" ] }) ] }), /*#__PURE__*/ _jsx("textarea", { name: "message", rows: 5, maxLength: 2000, placeholder: t('offer.message.placeholder'), className: "w-full border border-gray-200 rounded-xl px-3 py-2.5 focus:outline-none focus:ring-2 focus:ring-blue-400 resize-none text-sm text-gray-700" }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-3 pt-1", children: [ /*#__PURE__*/ _jsx("button", { type: "submit", disabled: submitting, className: "flex-1 bg-green-600 text-white py-3 rounded-xl font-semibold hover:bg-green-700 disabled:opacity-50 disabled:cursor-not-allowed transition", children: submitting ? t('offer.submitting') : t('task.offer.btn') }), /*#__PURE__*/ _jsx(Link, { href: "/tasks/".concat(id), className: "px-5 py-3 rounded-xl border border-gray-200 text-gray-600 hover:bg-gray-50 font-medium text-sm flex items-center transition", children: t('common.cancel') }) ] }) ] }) ] }); } c@={}_šªàâþ')UW•—ÃÅNVnv€­ÌÔõü'.Y`_–ŸÅü‡°¶- 8 N X õ ø Ê Ò 8<§«­°•˜­°‰Œ?CI_Mòõw¿Íòõn|ÊÎ}ÄÈz„¶º,0LP-0ñõN R }!\€!˜"œ"<#?#`$c$h'l'ˆ(Œ(ú().*2*‹**+“+‡-Š-/¡/0030 2222€€€€€€€€€€º(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useParams)º(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)¿(0,_lib_auth__WEBPACK_IMPORTED_MODULE_4__/* .useSession */ .wV)Ã(0,_context_locale__WEBPACK_IMPORTED_MODULE_5__/* .useLocale */ .Y)¯(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)ÿÿÿÿ°(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)ÿ»(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getTask */ .gg)À(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getLocations */ .Vs)¿(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .createOffer */ .ts)¶(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)Ã(0,_lib_formatName__WEBPACK_IMPORTED_MODULE_7__/* .shortName */ .E)·(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)ÿ²(next_link__WEBPACK_IMPORTED_MODULE_3___default())üüüþþüÄ(0,_lib_taskLocale__WEBPACK_IMPORTED_MODULE_8__/* .taskTitle */ .Oj)Ê(0,_lib_taskLocale__WEBPACK_IMPORTED_MODULE_8__/* .taskDescription */ .GZ)úÿüüüÆ(0,_lib_taskLocale__WEBPACK_IMPORTED_MODULE_8__/* .formatPrice */ .$g)ûûûùûûùûùùûûÿûûûùûùùüœ.A__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ MakeOfferPage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7541); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(9664); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(next_link__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(1592); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(9906); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(2982); /* harmony import */ var _lib_formatName__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(1258); /* harmony import */ var _lib_taskLocale__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(4017); /* __next_internal_client_entry_do_not_use__ default auto */ function MakeOfferPage() { const { id } = (0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useParams)(); const router = (0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)(); const { data: session, isPending } = (0,_lib_auth__WEBPACK_IMPORTED_MODULE_4__/* .useSession */ .wV)(); const { t, locale } = (0,_context_locale__WEBPACK_IMPORTED_MODULE_5__/* .useLocale */ .Y)(); const [task, setTask] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [loading, setLoading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(true); const [rawLocs, setRawLocs] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [submitting, setSubmitting] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [error, setError] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const locMap = rawLocs.reduce((acc, city)=>{ var _city_names, _city_names1; var _city_names_locale, _ref; acc[city.slug] = (_ref = (_city_names_locale = (_city_names = city.names) === null || _city_names === void 0 ? void 0 : _city_names[locale]) !== null && _city_names_locale !== void 0 ? _city_names_locale : (_city_names1 = city.names) === null || _city_names1 === void 0 ? void 0 : _city_names1.el) !== null && _ref !== void 0 ? _ref : city.slug; var _city_children; for (const d of (_city_children = city.children) !== null && _city_children !== void 0 ? _city_children : []){ var _d_names, _d_names1; var _d_names_locale, _ref1; acc[d.slug] = (_ref1 = (_d_names_locale = (_d_names = d.names) === null || _d_names === void 0 ? void 0 : _d_names[locale]) !== null && _d_names_locale !== void 0 ? _d_names_locale : (_d_names1 = d.names) === null || _d_names1 === void 0 ? void 0 : _d_names1.el) !== null && _ref1 !== void 0 ? _ref1 : d.slug; } return acc; }, {}); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!isPending && !session) router.push('/login'); }, [ session, isPending ]); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!id) return; (0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getTask */ .gg)(id).then((data)=>setTask(data)).catch(()=>router.push("/tasks/".concat(id))).finally(()=>setLoading(false)); (0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getLocations */ .Vs)().then((locs)=>setRawLocs(locs)).catch(()=>{}); }, [ id ]); async function handleSubmit(e) { e.preventDefault(); setError(''); setSubmitting(true); const form = new FormData(e.currentTarget); try { await (0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .createOffer */ .ts)({ taskId: id, price: Number(form.get('price')), message: form.get('message') || undefined }); router.push("/tasks/".concat(id)); } catch (err) { setError(err.message || t('common.error')); } finally{ setSubmitting(false); } } if (isPending || loading) { return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-center py-20 text-white", children: t('common.loading') }); } var _task_task; const taskData = (_task_task = task === null || task === void 0 ? void 0 : task.task) !== null && _task_task !== void 0 ? _task_task : task; const customer = task === null || task === void 0 ? void 0 : task.customer; const customerName = (customer === null || customer === void 0 ? void 0 : customer.name) ? (0,_lib_formatName__WEBPACK_IMPORTED_MODULE_7__/* .shortName */ .E)(customer.name) : null; var _taskData_title, _locMap_taskData_location; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "max-w-xl mx-auto px-4 py-10", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)((next_link__WEBPACK_IMPORTED_MODULE_3___default()), { href: "/tasks/".concat(id), className: "inline-flex items-center gap-1.5 text-sm text-white/70 hover:text-white mb-8 transition", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 19l-7-7 7-7" }) }), (_taskData_title = taskData === null || taskData === void 0 ? void 0 : taskData.title) !== null && _taskData_title !== void 0 ? _taskData_title : t('common.back_home', 'Back') ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h1", { className: "text-2xl font-bold text-white mb-1", children: t('task.offer.btn') }), customerName && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { className: "text-sm text-white/60 mb-6", children: [ t('common.from'), " ", customerName ] }), taskData && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-4 mb-6 shadow-sm", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "font-semibold text-gray-900 text-sm line-clamp-2", children: (0,_lib_taskLocale__WEBPACK_IMPORTED_MODULE_8__/* .taskTitle */ .Oj)(taskData, locale) }), (0,_lib_taskLocale__WEBPACK_IMPORTED_MODULE_8__/* .taskDescription */ .GZ)(taskData, locale) && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-gray-500 text-xs mt-1 line-clamp-2", children: (0,_lib_taskLocale__WEBPACK_IMPORTED_MODULE_8__/* .taskDescription */ .GZ)(taskData, locale) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-4 mt-2", children: [ taskData.budget && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "text-xs text-gray-500", children: [ "\uD83D\uDCB0 ", t('task.budget'), ": ", /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("strong", { className: "text-gray-900", children: [ (0,_lib_taskLocale__WEBPACK_IMPORTED_MODULE_8__/* .formatPrice */ .$g)(taskData.budget), "€" ] }) ] }), taskData.budgetNegotiable && !taskData.budget && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "text-xs text-gray-500", children: [ "\uD83D\uDCAC ", t('task.budget_negotiable') ] }), taskData.location && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "text-xs text-gray-500", children: [ "\uD83D\uDCCD ", (_locMap_taskData_location = locMap[taskData.location]) !== null && _locMap_taskData_location !== void 0 ? _locMap_taskData_location : taskData.location ] }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("form", { onSubmit: handleSubmit, className: "bg-white rounded-2xl border border-gray-100 p-6 shadow-sm space-y-5", children: [ error && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "bg-red-50 text-red-700 p-3 rounded-lg text-sm", children: error }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "block text-sm font-medium text-gray-700 mb-1.5", children: [ t('offer.price'), " (€) ", /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-red-500", children: "*" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "relative", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "absolute left-3 top-1/2 -translate-y-1/2 text-gray-400 font-medium select-none", children: "€" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { name: "price", type: "number", required: true, min: 1, step: 1, placeholder: t('offer.price.placeholder'), className: "w-full border border-gray-200 rounded-xl pl-8 pr-3 py-3 focus:outline-none focus:ring-2 focus:ring-blue-400 text-xl font-bold text-gray-900" }) ] }), (taskData === null || taskData === void 0 ? void 0 : taskData.budget) && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { className: "text-xs text-gray-400 mt-1.5", children: [ t('offer.customer_budget'), ": ", /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("strong", { children: [ (0,_lib_taskLocale__WEBPACK_IMPORTED_MODULE_8__/* .formatPrice */ .$g)(taskData.budget), "€" ] }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "block text-sm font-medium text-gray-700 mb-1.5", children: [ t('offer.message'), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "text-gray-400 font-normal ml-1", children: [ "(", t('offer.optional'), ")" ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("textarea", { name: "message", rows: 5, maxLength: 2000, placeholder: t('offer.message.placeholder'), className: "w-full border border-gray-200 rounded-xl px-3 py-2.5 focus:outline-none focus:ring-2 focus:ring-blue-400 resize-none text-sm text-gray-700" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-3 pt-1", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "submit", disabled: submitting, className: "flex-1 bg-green-600 text-white py-3 rounded-xl font-semibold hover:bg-green-700 disabled:opacity-50 disabled:cursor-not-allowed transition", children: submitting ? t('offer.submitting') : t('task.offer.btn') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)((next_link__WEBPACK_IMPORTED_MODULE_3___default()), { href: "/tasks/".concat(id), className: "px-5 py-3 rounded-xl border border-gray-200 text-gray-600 hover:bg-gray-50 font-medium text-sm flex items-center transition", children: t('common.cancel') }) ] }) ] }) ] }); } ŸÁ ÂÃ__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ MakeOfferPage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7541); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(9664); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(next_link__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(1592); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(9906); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(2982); /* harmony import */ var _lib_formatName__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(1258); /* harmony import */ var _lib_taskLocale__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(4017); ïåÿÿ61123undefined125168undefined170224undefined226254undefined256295undefined297341undefined343405undefined407451undefined453527undefined529543undefined590598(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useParams)undefined622630(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)undefined676685(0,_lib_auth__WEBPACK_IMPORTED_MODULE_4__/* .useSession */ .wV)undefined716724(0,_context_locale__WEBPACK_IMPORTED_MODULE_5__/* .useLocale */ .Y)undefined757764(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined807814(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined857864(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined911918(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined958965(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined20442052(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined21752183(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined22242230(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getTask */ .gg)undefined23492360(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getLocations */ .Vs)undefined26382648(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .createOffer */ .ts)undefined30613064(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined35303538(0,_lib_formatName__WEBPACK_IMPORTED_MODULE_7__/* .shortName */ .E)undefined36403644(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined37513755(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined37573760(next_link__WEBPACK_IMPORTED_MODULE_3___default())undefined39893992(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined42694272(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined47454748(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined49274931(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined51935197(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined53625365(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined54955503(0,_lib_taskLocale__WEBPACK_IMPORTED_MODULE_8__/* .taskTitle */ .Oj)undefined55675581(0,_lib_taskLocale__WEBPACK_IMPORTED_MODULE_8__/* .taskDescription */ .GZ)undefined56185621(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined57425756(0,_lib_taskLocale__WEBPACK_IMPORTED_MODULE_8__/* .taskDescription */ .GZ)undefined58345838(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined60136017(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined63406344(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined65226532(0,_lib_taskLocale__WEBPACK_IMPORTED_MODULE_8__/* .formatPrice */ .$g)undefined68386842(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined72127216(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined77567760(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined79817984(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined81778181(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined82708274(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined85738576(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined88568860(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined90209023(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined93129315(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1008810092(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1037610380(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1049010500(0,_lib_taskLocale__WEBPACK_IMPORTED_MODULE_8__/* .formatPrice */ .$g)undefined1079810802(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1089110895(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1115111155(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1165511658(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1218912193(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1233612339(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1281312816(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1281812821(next_link__WEBPACK_IMPORTED_MODULE_3___default())undefined ÄÑÒ]ŒÿÿŬåÿÿ­® „–«webpack/lib/util/registerExternalSerializerœwebpack-sources/ConcatSource€«webpack/lib/util/registerExternalSerializer™webpack-sources/RawSource/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ TaskDetailClient) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(9664); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(next_link__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(7541); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(1592); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(9906); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(2982); /* harmony import */ var _lib_taskLocale__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(4017); /* harmony import */ var _lib_formatName__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(1258); /* harmony import */ var _components_PlanBadge__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(2035); «webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourceZ|/* __next_internal_client_entry_do_not_use__ default auto */ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime"; import { useState, useEffect } from 'react'; import Link from 'next/link'; import { useRouter } from 'next/navigation'; import { useSession } from '@/lib/auth'; import { useLocale } from '@/context/locale'; import { getOffers, acceptOffer, declineOffer, completeTask, createReview, getMyOffers, getTaskReviews, getTaskInvite, dismissNotification, getOrCreateDirectRoom, updateTask, getTaskStats, runAutoMatch, getMyDashboard } from '@/lib/api'; import { taskTitle, taskDescription, formatPrice } from '@/lib/taskLocale'; import { shortName } from '@/lib/formatName'; import { PlanBadge } from '@/components/PlanBadge'; const statusColors = { open: 'bg-green-100 text-green-700', in_progress: 'bg-green-100 text-green-700', completed: 'bg-gray-100 text-gray-700', cancelled: 'bg-red-100 text-red-700', draft: 'bg-yellow-100 text-yellow-700' }; export default function TaskDetailClient(param) { let { taskId, initialTask, initialCustomer, catMap = {}, locMap = {} } = param; var _session_user, _acceptedOffer_specialist; const { data: session } = useSession(); const { t, locale } = useLocale(); const router = useRouter(); const [task, setTask] = useState(initialTask); const [customer] = useState(initialCustomer); const [offers, setOffers] = useState([]); const [offersLoaded, setOffersLoaded] = useState(false); const [myOffer, setMyOffer] = useState(null); const [myOfferLoaded, setMyOfferLoaded] = useState(false); const [myReview, setMyReview] = useState(null); const [myReviewLoaded, setMyReviewLoaded] = useState(false); const [reviewTargetId, setReviewTargetId] = useState(null); const [reviewRating, setReviewRating] = useState(5); const [reviewComment, setReviewComment] = useState(''); const [reviewSubmitting, setReviewSubmitting] = useState(false); const [reviewDone, setReviewDone] = useState(false); const [invite, setInvite] = useState(null); const [inviteLoaded, setInviteLoaded] = useState(false); const [inviteDeclining, setInviteDeclining] = useState(false); const [msgLoading, setMsgLoading] = useState(false); const [lightboxIndex, setLightboxIndex] = useState(null); // FOMO stats + auto-match const [taskStats, setTaskStats] = useState(null); const [autoMatchResults, setAutoMatchResults] = useState(null); const [autoMatchLoading, setAutoMatchLoading] = useState(false); const [hasAutoMatch, setHasAutoMatch] = useState(false); // Edit task state const [editing, setEditing] = useState(false); const [editSaving, setEditSaving] = useState(false); const [editForm, setEditForm] = useState(null); // Keyboard navigation for lightbox useEffect(()=>{ const handler = (e)=>{ if (e.key === 'Escape') setLightboxIndex(null); if (e.key === 'ArrowLeft') setLightboxIndex((prev)=>prev !== null && prev > 0 ? prev - 1 : prev); if (e.key === 'ArrowRight') setLightboxIndex((prev)=>{ if (prev === null) return prev; const imgs = task.images; return imgs && prev < imgs.length - 1 ? prev + 1 : prev; }); }; window.addEventListener('keydown', handler); return ()=>window.removeEventListener('keydown', handler); }, [ task.images ]); const dateLocale = locale === 'ru' ? 'ru-RU' : locale === 'uk' ? 'uk-UA' : locale === 'en' ? 'en-US' : 'el-GR'; const currentUserId = session === null || session === void 0 ? void 0 : (_session_user = session.user) === null || _session_user === void 0 ? void 0 : _session_user.id; const isOwner = currentUserId === task.customerId; const loginRedirectHref = "/login?redirect=".concat(encodeURIComponent("/tasks/".concat(taskId))); // Load offers if owner useEffect(()=>{ if (!isOwner || offersLoaded) return; getOffers(taskId).then((data)=>{ setOffers(data); setOffersLoaded(true); }).catch(()=>setOffersLoaded(true)); }, [ isOwner, taskId, offersLoaded ]); // Load task stats + dashboard features for owner useEffect(()=>{ if (!isOwner) return; getTaskStats(taskId).then(setTaskStats).catch(()=>{}); getMyDashboard().then((d)=>{ var _d_features; return setHasAutoMatch(!!((_d_features = d.features) === null || _d_features === void 0 ? void 0 : _d_features.hasAutoMatch)); }).catch(()=>{}); }, [ isOwner, taskId ]); // Load specialist's own offer useEffect(()=>{ if (!currentUserId || isOwner || myOfferLoaded) return; getMyOffers().then((rows)=>{ const found = rows.find((r)=>{ var _r_task; return ((_r_task = r.task) === null || _r_task === void 0 ? void 0 : _r_task.id) === taskId; }); var _found_offer; setMyOffer((_found_offer = found === null || found === void 0 ? void 0 : found.offer) !== null && _found_offer !== void 0 ? _found_offer : null); setMyOfferLoaded(true); }).catch(()=>setMyOfferLoaded(true)); }, [ currentUserId, isOwner, taskId, myOfferLoaded ]); // Load task invite for specialist useEffect(()=>{ if (!currentUserId || isOwner || inviteLoaded) return; getTaskInvite(taskId).then((rows)=>{ var _rows_; setInvite((_rows_ = rows[0]) !== null && _rows_ !== void 0 ? _rows_ : null); setInviteLoaded(true); }).catch(()=>setInviteLoaded(true)); }, [ currentUserId, isOwner, taskId, inviteLoaded ]); // Load review for specialist when task completed useEffect(()=>{ if (!currentUserId || isOwner || myReviewLoaded || task.status !== 'completed') return; getTaskReviews(taskId).then((rows)=>{ const found = rows.find((r)=>r.targetId === currentUserId); setMyReview(found !== null && found !== void 0 ? found : null); setMyReviewLoaded(true); }).catch(()=>setMyReviewLoaded(true)); }, [ currentUserId, isOwner, taskId, task.status, myReviewLoaded ]); async function handleAccept(offerId) { const updated = await acceptOffer(offerId).catch(()=>null); if (updated) { setOffers((prev)=>prev.map((r)=>r.offer.id === offerId ? { ...r, offer: updated } : r)); setTask((t)=>({ ...t, status: 'in_progress' })); } } async function handleDecline(offerId) { const updated = await declineOffer(offerId).catch(()=>null); if (updated) { setOffers((prev)=>prev.map((r)=>r.offer.id === offerId ? { ...r, offer: updated } : r)); } } async function handleComplete() { if (!window.confirm(t('task.complete.confirm'))) return; const updated = await completeTask(taskId).catch(()=>null); if (updated) setTask((t)=>({ ...t, status: 'completed' })); } async function handleReview(e) { e.preventDefault(); if (!reviewTargetId) return; setReviewSubmitting(true); const ok = await createReview({ taskId, targetId: reviewTargetId, rating: reviewRating, comment: reviewComment || undefined }).catch(()=>null); setReviewSubmitting(false); if (ok) { setReviewDone(true); setReviewTargetId(null); } } async function handleMessage(otherUserId) { setMsgLoading(true); try { const { room } = await getOrCreateDirectRoom(otherUserId); router.push("/chat?room=".concat(room.id)); } catch (e) {} setMsgLoading(false); } function handleEditOpen() { var _task_budgetNegotiable, _task_category, _task_location, _task_district, _task_street, _task_houseNumber, _task_timeSlot, _task_confidentialNote; setEditForm({ title: task.title, description: task.description, budget: task.budget ? Number(task.budget) : '', budgetNegotiable: (_task_budgetNegotiable = task.budgetNegotiable) !== null && _task_budgetNegotiable !== void 0 ? _task_budgetNegotiable : false, category: (_task_category = task.category) !== null && _task_category !== void 0 ? _task_category : '', location: (_task_location = task.location) !== null && _task_location !== void 0 ? _task_location : '', district: (_task_district = task.district) !== null && _task_district !== void 0 ? _task_district : '', street: (_task_street = task.street) !== null && _task_street !== void 0 ? _task_street : '', houseNumber: (_task_houseNumber = task.houseNumber) !== null && _task_houseNumber !== void 0 ? _task_houseNumber : '', timeSlot: (_task_timeSlot = task.timeSlot) !== null && _task_timeSlot !== void 0 ? _task_timeSlot : '', confidentialNote: (_task_confidentialNote = task.confidentialNote) !== null && _task_confidentialNote !== void 0 ? _task_confidentialNote : '', deadline: task.deadline ? new Date(task.deadline).toISOString().slice(0, 10) : '', expiresAt: task.expiresAt ? new Date(task.expiresAt).toISOString().slice(0, 10) : '', status: task.status === 'draft' ? 'draft' : 'open' }); setEditing(true); } async function handleEditSave(e) { e.preventDefault(); if (!editForm) return; setEditSaving(true); try { const payload = { title: editForm.title, description: editForm.description, budgetNegotiable: editForm.budgetNegotiable, status: editForm.status }; if (editForm.budget !== '' && editForm.budget > 0) payload.budget = Number(editForm.budget); if (editForm.category) payload.category = editForm.category; if (editForm.location) payload.location = editForm.location; if (editForm.district) payload.district = editForm.district; if (editForm.street) payload.street = editForm.street; if (editForm.houseNumber) payload.houseNumber = editForm.houseNumber; if (editForm.timeSlot) payload.timeSlot = editForm.timeSlot; if (editForm.confidentialNote !== undefined) payload.confidentialNote = editForm.confidentialNote; if (editForm.deadline) payload.deadline = new Date(editForm.deadline).toISOString(); if (editForm.expiresAt) payload.expiresAt = new Date(editForm.expiresAt).toISOString(); const updated = await updateTask(taskId, payload); setTask((prev)=>({ ...prev, ...updated })); setEditing(false); } catch (err) { alert((err === null || err === void 0 ? void 0 : err.message) || t('common.error')); } finally{ setEditSaving(false); } } const acceptedOffer = offers.find((r)=>r.offer.status === 'accepted'); var _catMap_task_category, _locMap_task_location; return /*#__PURE__*/ _jsxs("div", { className: "max-w-4xl mx-auto px-4 py-8", children: [ /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6 mb-6", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex justify-between items-start gap-4 mb-4", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [ /*#__PURE__*/ _jsx("span", { className: "text-xs font-medium px-2 py-1 rounded-full ".concat(statusColors[task.status]), children: t("task.status.".concat(task.status), task.status) }), task.category && /*#__PURE__*/ _jsx("span", { className: "text-xs font-medium text-green-600 bg-green-50 px-2 py-1 rounded-full", children: (_catMap_task_category = catMap[task.category]) !== null && _catMap_task_category !== void 0 ? _catMap_task_category : task.category }), isOwner && /*#__PURE__*/ _jsx("span", { className: "text-xs text-gray-400 bg-gray-100 px-2 py-1 rounded-full", children: t('task.yours') }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 shrink-0", children: [ isOwner && (task.status === 'draft' || task.status === 'open') && /*#__PURE__*/ _jsxs("button", { onClick: handleEditOpen, className: "flex items-center gap-1.5 text-xs font-medium text-green-600 bg-green-50 hover:bg-green-100 px-3 py-1.5 rounded-lg transition", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M16.862 4.487l1.687-1.688a1.875 1.875 0 112.652 2.652L10.582 16.07a4.5 4.5 0 01-1.897 1.13L6 18l.8-2.685a4.5 4.5 0 011.13-1.897l8.932-8.931zm0 0L19.5 7.125" }) }), t('task.edit') ] }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-400", children: new Date(task.createdAt).toLocaleDateString(dateLocale) }) ] }) ] }), /*#__PURE__*/ _jsx("h1", { className: "text-2xl font-bold text-gray-900 mb-4", children: taskTitle(task, locale) }), /*#__PURE__*/ _jsx("p", { className: "text-gray-700 whitespace-pre-wrap mb-6", children: taskDescription(task, locale) }), /*#__PURE__*/ _jsxs("div", { className: "grid grid-cols-2 md:grid-cols-4 gap-4 p-4 bg-gray-50 rounded-lg", children: [ task.budget && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-500", children: t('task.budget') }), /*#__PURE__*/ _jsxs("p", { className: "font-bold text-green-600 text-lg", children: [ task.budget, "€" ] }), task.budgetNegotiable && /*#__PURE__*/ _jsx("p", { className: "text-xs text-green-600 mt-0.5", children: t('task.budget_negotiable') }) ] }), !task.budget && task.budgetNegotiable && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-500", children: t('task.budget') }), /*#__PURE__*/ _jsx("p", { className: "font-medium text-green-600", children: t('task.budget_negotiable') }) ] }), task.location && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-500", children: t('task.location') }), /*#__PURE__*/ _jsxs("p", { className: "font-medium", children: [ "\uD83D\uDCCD ", (_locMap_task_location = locMap[task.location]) !== null && _locMap_task_location !== void 0 ? _locMap_task_location : task.location ] }) ] }), task.deadline && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-500", children: t('task.deadline') }), /*#__PURE__*/ _jsx("p", { className: "font-medium", children: new Date(task.deadline).toLocaleDateString(dateLocale) }), task.timeSlot && task.timeSlot !== '' && /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-500 mt-0.5", children: t("create.field.time_slot.".concat(task.timeSlot), task.timeSlot) }) ] }), !task.deadline && task.timeSlot && task.timeSlot !== '' && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-500", children: t('task.time_slot') }), /*#__PURE__*/ _jsx("p", { className: "font-medium", children: t("create.field.time_slot.".concat(task.timeSlot), task.timeSlot) }) ] }), task.expiresAt && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-500", children: t('task.expires_at') }), /*#__PURE__*/ _jsx("p", { className: "font-medium", children: new Date(task.expiresAt).toLocaleDateString(dateLocale) }) ] }), customer && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-500", children: t('task.customer') }), /*#__PURE__*/ _jsxs(Link, { href: "/users/".concat(customer.id), className: "flex items-center gap-2 mt-1 group", children: [ /*#__PURE__*/ _jsx("div", { className: "w-8 h-8 rounded-full overflow-hidden bg-green-100 shrink-0 flex items-center justify-center", children: customer.image ? /*#__PURE__*/ _jsx("img", { src: customer.image, alt: shortName(customer.name), className: "w-full h-full object-cover" }) : /*#__PURE__*/ _jsx("span", { className: "text-green-600 font-semibold text-xs", children: shortName(customer.name).charAt(0).toUpperCase() }) }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "font-medium text-gray-900 group-hover:text-green-600 leading-none", children: shortName(customer.name) }), customer.rating && /*#__PURE__*/ _jsxs("p", { className: "text-xs text-yellow-500 leading-none mt-0.5", children: [ "★ ", Number(customer.rating).toFixed(1) ] }) ] }) ] }) ] }) ] }), task.images && task.images.length > 0 && /*#__PURE__*/ _jsx("div", { className: "mt-4", children: /*#__PURE__*/ _jsx("div", { className: "flex flex-wrap gap-2", children: task.images.map((url, i)=>/*#__PURE__*/ _jsx("button", { onClick: ()=>setLightboxIndex(i), className: "block w-24 h-24 rounded-lg overflow-hidden border border-gray-200 hover:opacity-90 hover:border-green-300 transition", children: /*#__PURE__*/ _jsx("img", { src: url, alt: "", className: "w-full h-full object-cover" }) }, i)) }) }), lightboxIndex !== null && task.images && /*#__PURE__*/ _jsx("div", { className: "fixed inset-0 z-50 flex items-center justify-center bg-black/85", onClick: ()=>setLightboxIndex(null), children: /*#__PURE__*/ _jsxs("div", { className: "relative max-w-4xl w-full mx-4", onClick: (e)=>e.stopPropagation(), children: [ /*#__PURE__*/ _jsx("img", { src: task.images[lightboxIndex], alt: "", className: "w-full max-h-[80vh] object-contain rounded-lg" }), /*#__PURE__*/ _jsx("button", { onClick: ()=>setLightboxIndex(null), className: "absolute -top-10 right-0 text-white/80 hover:text-white p-2", children: /*#__PURE__*/ _jsx("svg", { className: "w-6 h-6", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" }) }) }), lightboxIndex > 0 && /*#__PURE__*/ _jsx("button", { onClick: ()=>setLightboxIndex(lightboxIndex - 1), className: "absolute left-0 top-1/2 -translate-y-1/2 -translate-x-12 text-white/80 hover:text-white p-2", children: /*#__PURE__*/ _jsx("svg", { className: "w-8 h-8", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 19l-7-7 7-7" }) }) }), lightboxIndex < task.images.length - 1 && /*#__PURE__*/ _jsx("button", { onClick: ()=>setLightboxIndex(lightboxIndex + 1), className: "absolute right-0 top-1/2 -translate-y-1/2 translate-x-12 text-white/80 hover:text-white p-2", children: /*#__PURE__*/ _jsx("svg", { className: "w-8 h-8", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 5l7 7-7 7" }) }) }), task.images.length > 1 && /*#__PURE__*/ _jsxs("p", { className: "text-white/60 text-sm text-center mt-3", children: [ lightboxIndex + 1, " / ", task.images.length ] }) ] }) }), (isOwner || (myOffer === null || myOffer === void 0 ? void 0 : myOffer.status) === 'accepted') && (task.district || task.street || task.confidentialNote) && /*#__PURE__*/ _jsxs("div", { className: "mt-4 p-3 bg-yellow-50 border border-yellow-200 rounded-lg space-y-2", children: [ /*#__PURE__*/ _jsxs("p", { className: "text-xs font-medium text-yellow-700 flex items-center gap-1", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z" }) }), t('task.confidential') ] }), (task.district || task.street) && /*#__PURE__*/ _jsxs("p", { className: "text-sm text-yellow-800", children: [ "\uD83D\uDCCD ", [ task.district, task.street, task.houseNumber ].filter(Boolean).join(', ') ] }), task.confidentialNote && /*#__PURE__*/ _jsx("p", { className: "text-sm text-yellow-800", children: task.confidentialNote }) ] }), /*#__PURE__*/ _jsxs("div", { className: "mt-6 flex flex-wrap gap-3", children: [ !session && !isOwner && task.status === 'open' && /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx(Link, { href: loginRedirectHref, className: "bg-green-600 text-white px-6 py-3 rounded-xl font-semibold hover:bg-green-700", children: t('task.make_offer', 'Send offer') }), /*#__PURE__*/ _jsxs(Link, { href: loginRedirectHref, className: "flex items-center gap-2 bg-green-50 text-green-600 border border-green-200 px-4 py-2.5 rounded-xl font-medium hover:bg-green-100", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }), t('chat.write_customer', 'Write to customer') ] }) ] }), isOwner && task.status === 'in_progress' && /*#__PURE__*/ _jsx("button", { onClick: handleComplete, className: "bg-green-600 text-white px-6 py-3 rounded-xl font-semibold hover:bg-green-700", children: t('task.complete') }), isOwner && (acceptedOffer === null || acceptedOffer === void 0 ? void 0 : (_acceptedOffer_specialist = acceptedOffer.specialist) === null || _acceptedOffer_specialist === void 0 ? void 0 : _acceptedOffer_specialist.id) && /*#__PURE__*/ _jsxs("button", { onClick: ()=>handleMessage(acceptedOffer.specialist.id), disabled: msgLoading, className: "flex items-center gap-2 bg-green-50 text-green-600 border border-green-200 px-4 py-2.5 rounded-xl font-medium hover:bg-green-100 disabled:opacity-50", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }), t('chat.write_specialist') ] }), isOwner && task.status === 'completed' && acceptedOffer && !reviewDone && /*#__PURE__*/ _jsx("button", { onClick: ()=>{ var _acceptedOffer_specialist; var _acceptedOffer_specialist_id; return setReviewTargetId((_acceptedOffer_specialist_id = (_acceptedOffer_specialist = acceptedOffer.specialist) === null || _acceptedOffer_specialist === void 0 ? void 0 : _acceptedOffer_specialist.id) !== null && _acceptedOffer_specialist_id !== void 0 ? _acceptedOffer_specialist_id : null); }, className: "bg-yellow-500 text-white px-6 py-3 rounded-xl font-semibold hover:bg-yellow-600", children: t('review.leave') }), reviewDone && /*#__PURE__*/ _jsx("span", { className: "text-green-600 font-medium py-3", children: t('review.done') }) ] }), reviewTargetId && /*#__PURE__*/ _jsxs("form", { onSubmit: handleReview, className: "mt-6 border-t border-gray-100 pt-6 space-y-4", children: [ /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-gray-800", children: t('review.leave') }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "text-sm font-medium text-gray-700 mb-2", children: t('review.rating') }), /*#__PURE__*/ _jsx("div", { className: "flex gap-1", children: [ 1, 2, 3, 4, 5 ].map((star)=>/*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setReviewRating(star), className: "text-2xl transition ".concat(star <= reviewRating ? 'text-yellow-400' : 'text-gray-300'), children: "★" }, star)) }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('review.comment') }), /*#__PURE__*/ _jsx("textarea", { value: reviewComment, onChange: (e)=>setReviewComment(e.target.value), rows: 3, maxLength: 2000, placeholder: t('review.comment.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" }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-3", children: [ /*#__PURE__*/ _jsx("button", { type: "submit", disabled: reviewSubmitting, className: "bg-green-600 text-white px-5 py-2 rounded-xl font-semibold hover:bg-green-700 disabled:opacity-50", children: reviewSubmitting ? t('review.submitting') : t('review.submit') }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setReviewTargetId(null), className: "px-5 py-2 rounded-xl border border-gray-200 text-gray-600 hover:bg-gray-50", children: t('common.cancel') }) ] }) ] }) ] }), isOwner && /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between mb-4 flex-wrap gap-2", children: [ /*#__PURE__*/ _jsxs("h2", { className: "text-lg font-bold text-gray-900", children: [ t('task.offers'), " (", offers.length, ")" ] }), taskStats && /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 text-xs text-gray-500", children: [ taskStats.totalViews > 0 && /*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-1", children: [ /*#__PURE__*/ _jsxs("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: [ /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 12a3 3 0 11-6 0 3 3 0 016 0z" }), /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z" }) ] }), taskStats.totalViews ] }), taskStats.offerCount > 0 && /*#__PURE__*/ _jsxs("span", { className: "font-medium text-green-600", children: [ "⚡ ", taskStats.offerCount, " ", t('task.offers').toLowerCase() ] }) ] }), hasAutoMatch && task.status === 'open' && /*#__PURE__*/ _jsxs("button", { onClick: async ()=>{ setAutoMatchLoading(true); try { const res = await runAutoMatch(taskId); var _res_matches; setAutoMatchResults((_res_matches = res.matches) !== null && _res_matches !== void 0 ? _res_matches : []); } catch (e) {} finally{ setAutoMatchLoading(false); } }, disabled: autoMatchLoading, className: "flex items-center gap-1.5 text-xs font-medium bg-purple-50 text-purple-700 border border-purple-200 px-3 py-1.5 rounded-lg hover:bg-purple-100 transition disabled:opacity-50", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M13 10V3L4 14h7v7l9-11h-7z" }) }), autoMatchLoading ? t('common.loading') : t('task.auto_match', 'Auto match') ] }) ] }), autoMatchResults && autoMatchResults.length > 0 && /*#__PURE__*/ _jsxs("div", { className: "mb-4 p-3 bg-purple-50 rounded-xl border border-purple-100", children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs font-medium text-purple-700 mb-2", children: t('task.auto_match_results', 'Top specialists') }), /*#__PURE__*/ _jsx("div", { className: "space-y-2", children: autoMatchResults.slice(0, 5).map((s)=>{ var _s_name_, _s_name; var _s_firstName; return /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between gap-2", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2", children: [ /*#__PURE__*/ _jsx("div", { className: "w-7 h-7 rounded-full bg-purple-100 flex items-center justify-center text-purple-700 text-xs font-bold overflow-hidden", children: s.image ? /*#__PURE__*/ _jsx("img", { src: s.image, alt: "", className: "w-full h-full object-cover" }) : (_s_name = s.name) === null || _s_name === void 0 ? void 0 : (_s_name_ = _s_name[0]) === null || _s_name_ === void 0 ? void 0 : _s_name_.toUpperCase() }), /*#__PURE__*/ _jsx("span", { className: "text-sm text-gray-800", children: (_s_firstName = s.firstName) !== null && _s_firstName !== void 0 ? _s_firstName : s.name }), s.rating && /*#__PURE__*/ _jsxs("span", { className: "text-xs text-yellow-500", children: [ "★", Number(s.rating).toFixed(1) ] }) ] }), /*#__PURE__*/ _jsx("button", { onClick: ()=>handleMessage(s.id), className: "text-xs text-green-600 hover:underline", children: t('chat.write_btn') }) ] }, s.id); }) }) ] }), !offersLoaded ? /*#__PURE__*/ _jsx("p", { className: "text-gray-400 text-sm", children: t('common.loading') }) : offers.length === 0 ? /*#__PURE__*/ _jsx("p", { className: "text-gray-500 text-sm", children: t('task.offers.none') }) : /*#__PURE__*/ _jsx("div", { className: "space-y-4", children: offers.map((row)=>{ var _specialist_name_, _specialist_name; const offer = row.offer; const specialist = row.specialist; var _specialist_name__toUpperCase; return /*#__PURE__*/ _jsxs("div", { className: "border border-gray-100 rounded-xl p-4", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex justify-between items-start gap-4", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-start gap-3", children: [ /*#__PURE__*/ _jsx("div", { className: "w-10 h-10 rounded-full bg-green-100 flex-shrink-0 flex items-center justify-center text-green-700 font-bold overflow-hidden", children: (specialist === null || specialist === void 0 ? void 0 : specialist.image) ? /*#__PURE__*/ _jsx("img", { src: specialist.image, alt: specialist.name, className: "w-full h-full object-cover" }) : (_specialist_name__toUpperCase = specialist === null || specialist === void 0 ? void 0 : (_specialist_name = specialist.name) === null || _specialist_name === void 0 ? void 0 : (_specialist_name_ = _specialist_name[0]) === null || _specialist_name_ === void 0 ? void 0 : _specialist_name_.toUpperCase()) !== null && _specialist_name__toUpperCase !== void 0 ? _specialist_name__toUpperCase : '?' }), /*#__PURE__*/ _jsxs("div", { children: [ specialist && /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-1.5", children: [ /*#__PURE__*/ _jsx(Link, { href: "/users/".concat(specialist.id), className: "font-medium text-gray-900 hover:text-green-600", children: shortName(specialist.name) }), specialist.planTier && specialist.planTier !== 'free' && /*#__PURE__*/ _jsx(PlanBadge, { tier: specialist.planTier }), specialist.hasVerifiedBadge && /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5 text-gray-500", viewBox: "0 0 24 24", fill: "currentColor", children: /*#__PURE__*/ _jsx("path", { d: "M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z" }) }) ] }), offer.message && /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-600 mt-1", children: offer.message }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "text-right shrink-0", children: [ /*#__PURE__*/ _jsxs("p", { className: "text-lg font-bold text-green-600", children: [ formatPrice(offer.price), "€" ] }), /*#__PURE__*/ _jsx("span", { className: "text-xs px-2 py-0.5 rounded-full ".concat(offer.status === 'accepted' ? 'bg-green-100 text-green-700' : offer.status === 'declined' ? 'bg-red-100 text-red-700' : 'bg-gray-100 text-gray-700'), children: t("offer.status.".concat(offer.status), offer.status) }) ] }) ] }), offer.status === 'pending' && task.status === 'open' && /*#__PURE__*/ _jsxs("div", { className: "flex gap-2 mt-3 pt-3 border-t border-gray-50", children: [ /*#__PURE__*/ _jsx("button", { onClick: ()=>handleAccept(offer.id), className: "flex-1 bg-green-600 text-white py-2 rounded-lg text-sm font-semibold hover:bg-green-700", children: t('offer.accept') }), /*#__PURE__*/ _jsx("button", { onClick: ()=>handleDecline(offer.id), className: "flex-1 bg-gray-100 text-gray-700 py-2 rounded-lg text-sm font-semibold hover:bg-gray-200", children: t('offer.decline') }) ] }) ] }, offer.id); }) }) ] }), !isOwner && session && invite && inviteLoaded && task.status === 'open' && !myOffer && /*#__PURE__*/ _jsx("div", { className: "rounded-xl border border-green-200 bg-green-50 p-5", children: /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between gap-4 flex-wrap gap-y-3", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3", children: [ /*#__PURE__*/ _jsx("div", { className: "w-10 h-10 rounded-full bg-green-100 flex items-center justify-center shrink-0", children: /*#__PURE__*/ _jsx("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", strokeWidth: 1.5, stroke: "currentColor", className: "w-5 h-5 text-green-600", children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M21.75 6.75v10.5a2.25 2.25 0 0 1-2.25 2.25h-15a2.25 2.25 0 0 1-2.25-2.25V6.75m19.5 0A2.25 2.25 0 0 0 19.5 4.5h-15a2.25 2.25 0 0 0-2.25 2.25m19.5 0v.243a2.25 2.25 0 0 1-1.07 1.916l-7.5 4.615a2.25 2.25 0 0 1-2.36 0L3.32 8.91a2.25 2.25 0 0 1-1.07-1.916V6.75" }) }) }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "font-semibold text-gray-900 text-sm", children: t('task.invite.banner_title') }), /*#__PURE__*/ _jsx("p", { className: "text-gray-500 text-sm mt-0.5", children: t('task.invite.banner_hint') }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-2 shrink-0", children: [ /*#__PURE__*/ _jsx(Link, { href: "/tasks/".concat(taskId, "/offer"), className: "bg-green-600 text-white px-4 py-2 rounded-lg text-sm font-semibold hover:bg-green-700 transition", children: t('task.invite.accept') }), /*#__PURE__*/ _jsx("button", { onClick: async ()=>{ if (!invite) return; setInviteDeclining(true); await dismissNotification(invite.id).catch(()=>{}); setInvite(null); setInviteDeclining(false); }, disabled: inviteDeclining, className: "border border-gray-300 bg-white text-gray-600 px-4 py-2 rounded-lg text-sm font-medium hover:bg-gray-50 disabled:opacity-50 transition", children: t('task.invite.decline') }) ] }) ] }) }), !isOwner && session && myOfferLoaded && /*#__PURE__*/ _jsxs("div", { className: "space-y-4", children: [ task.status === 'completed' && (myOffer === null || myOffer === void 0 ? void 0 : myOffer.status) === 'accepted' && /*#__PURE__*/ _jsxs("div", { className: "bg-green-50 border border-green-200 rounded-xl p-5 flex items-center gap-4", children: [ /*#__PURE__*/ _jsx("span", { className: "text-3xl", children: "\uD83C\uDF89" }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "font-bold text-green-800 text-lg", children: "ЗаЎаМОе завершеМП!" }), /*#__PURE__*/ _jsx("p", { className: "text-green-700 text-sm", children: "ЗаказчОк ПтЌетОл заЎаМОе как выпПлМеММПе." }) ] }), /*#__PURE__*/ _jsxs("button", { onClick: ()=>handleMessage(task.customerId), disabled: msgLoading, className: "ml-auto flex items-center gap-2 bg-white text-green-600 border border-green-200 px-4 py-2 rounded-xl text-sm font-medium hover:bg-green-50 disabled:opacity-50", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }), t('chat.write_customer') ] }) ] }), (myOffer || task.status === 'open' && !invite || task.status !== 'open') && /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ _jsx("h2", { className: "text-lg font-bold text-gray-900 mb-4", children: "МПё преЎлПжеМОе" }), myOffer ? /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-start justify-between gap-4", children: [ /*#__PURE__*/ _jsxs("div", { className: "space-y-1", children: [ myOffer.message && /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-600", children: myOffer.message }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400", children: new Date(myOffer.createdAt).toLocaleString(dateLocale) }) ] }), /*#__PURE__*/ _jsxs("div", { className: "text-right shrink-0", children: [ /*#__PURE__*/ _jsxs("p", { className: "text-xl font-bold text-green-600", children: [ formatPrice(myOffer.price), "€" ] }), /*#__PURE__*/ _jsx("span", { className: "text-xs px-2 py-0.5 rounded-full font-medium ".concat(myOffer.status === 'accepted' ? 'bg-green-100 text-green-700' : myOffer.status === 'declined' ? 'bg-red-100 text-red-700' : 'bg-yellow-100 text-yellow-700'), children: myOffer.status === 'accepted' ? '✓ ПрОМятП' : myOffer.status === 'declined' ? '✗ ОтклПМеМП' : '⏳ На рассЌПтреМОО' }) ] }) ] }), myOffer.status === 'accepted' && task.status === 'in_progress' && /*#__PURE__*/ _jsx("div", { className: "mt-3 pt-3 border-t border-gray-100", children: /*#__PURE__*/ _jsxs("button", { onClick: ()=>handleMessage(task.customerId), disabled: msgLoading, className: "flex items-center gap-2 bg-green-50 text-green-600 border border-green-200 px-4 py-2 rounded-xl text-sm font-medium hover:bg-green-100 disabled:opacity-50", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }), t('chat.write_customer') ] }) }) ] }) : task.status === 'open' && !invite ? /*#__PURE__*/ _jsxs("div", { className: "space-y-3", children: [ taskStats && taskStats.offerCount > 0 && /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 p-2.5 bg-amber-50 rounded-lg border border-amber-100", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-amber-500 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M13 10V3L4 14h7v7l9-11h-7z" }) }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-amber-700", children: t('fomo.already_offered', '\u0423\u0436\u0435 {n} \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0441\u0442\u043e\u0432 \u043e\u0442\u043a\u043b\u0438\u043a\u043d\u0443\u043b\u0438\u0441\u044c').replace('{n}', String(taskStats.offerCount)) }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between", children: [ /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-500", children: t('task.no_offer_yet', '\u0412\u044b \u0435\u0449\u0451 \u043d\u0435 \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u043b\u0438 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u0435') }), /*#__PURE__*/ _jsx(Link, { href: "/tasks/".concat(taskId, "/offer"), className: "bg-green-600 text-white px-4 py-2 rounded-lg text-sm font-semibold hover:bg-green-700", children: t('task.make_offer', '\u041e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u0435') }) ] }) ] }) : null ] }), task.status === 'completed' && (myOffer === null || myOffer === void 0 ? void 0 : myOffer.status) === 'accepted' && /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ _jsx("h2", { className: "text-lg font-bold text-gray-900 mb-4", children: "ОцеМка заказчОка" }), !myReviewLoaded ? /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-400", children: "Загрузка..." }) : myReview ? /*#__PURE__*/ _jsxs("div", { className: "space-y-3", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-1", children: [ [ 1, 2, 3, 4, 5 ].map((star)=>/*#__PURE__*/ _jsx("span", { className: "text-2xl ".concat(star <= myReview.rating ? 'text-yellow-400' : 'text-gray-200'), children: "★" }, star)), /*#__PURE__*/ _jsxs("span", { className: "ml-2 text-lg font-bold text-gray-800", children: [ myReview.rating, "/5" ] }) ] }), myReview.comment && /*#__PURE__*/ _jsx("p", { className: "text-gray-700 text-sm leading-relaxed", children: myReview.comment }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400", children: new Date(myReview.createdAt).toLocaleDateString(dateLocale) }) ] }) : /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-500", children: "ЗаказчОк ещё Ме ПставОл ПцеМку." }) ] }) ] }), editing && editForm && /*#__PURE__*/ _jsx("div", { className: "fixed inset-0 z-50 flex items-start justify-center bg-black/50 overflow-y-auto py-8 px-4", children: /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-2xl w-full max-w-2xl shadow-xl", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between px-6 py-4 border-b border-gray-100", children: [ /*#__PURE__*/ _jsx("h2", { className: "text-lg font-bold text-gray-900", children: t('task.edit') }), /*#__PURE__*/ _jsx("button", { onClick: ()=>setEditing(false), className: "text-gray-400 hover:text-gray-600 p-1", children: /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" }) }) }) ] }), /*#__PURE__*/ _jsxs("form", { onSubmit: handleEditSave, className: "p-6 space-y-4", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: [ t('create.field.title'), " *" ] }), /*#__PURE__*/ _jsx("input", { type: "text", required: true, minLength: 5, maxLength: 200, value: editForm.title, onChange: (e)=>setEditForm((p)=>({ ...p, title: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: [ t('create.field.description'), " *" ] }), /*#__PURE__*/ _jsx("textarea", { required: true, minLength: 20, value: editForm.description, onChange: (e)=>setEditForm((p)=>({ ...p, description: e.target.value })), rows: 4, 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" }) ] }), /*#__PURE__*/ _jsxs("div", { className: "grid grid-cols-2 gap-4", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('create.field.budget') }), /*#__PURE__*/ _jsx("input", { type: "number", min: 1, value: editForm.budget, onChange: (e)=>setEditForm((p)=>({ ...p, budget: e.target.value })), placeholder: "€", className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ _jsx("div", { className: "flex items-end pb-2", children: /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-2 cursor-pointer", children: [ /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: editForm.budgetNegotiable, onChange: (e)=>setEditForm((p)=>({ ...p, budgetNegotiable: e.target.checked })), className: "w-4 h-4 rounded text-green-600" }), /*#__PURE__*/ _jsx("span", { className: "text-sm text-gray-700", children: t('create.field.budget_negotiable') }) ] }) }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('create.field.deadline') }), /*#__PURE__*/ _jsx("input", { type: "date", value: editForm.deadline, onChange: (e)=>setEditForm((p)=>({ ...p, deadline: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('create.field.expires_at') }), /*#__PURE__*/ _jsx("input", { type: "date", value: editForm.expiresAt, onChange: (e)=>setEditForm((p)=>({ ...p, expiresAt: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ _jsxs("div", { className: "grid grid-cols-3 gap-3", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('create.field.address.district') }), /*#__PURE__*/ _jsx("input", { type: "text", value: editForm.district, onChange: (e)=>setEditForm((p)=>({ ...p, district: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('create.field.address.street') }), /*#__PURE__*/ _jsx("input", { type: "text", value: editForm.street, onChange: (e)=>setEditForm((p)=>({ ...p, street: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('create.field.address.house') }), /*#__PURE__*/ _jsx("input", { type: "text", value: editForm.houseNumber, onChange: (e)=>setEditForm((p)=>({ ...p, houseNumber: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('create.field.confidential') }), /*#__PURE__*/ _jsx("textarea", { value: editForm.confidentialNote, onChange: (e)=>setEditForm((p)=>({ ...p, confidentialNote: e.target.value })), rows: 2, 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" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('task.status_label', 'Status') }), /*#__PURE__*/ _jsxs("select", { value: editForm.status, onChange: (e)=>setEditForm((p)=>({ ...p, status: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400", children: [ /*#__PURE__*/ _jsx("option", { value: "open", children: t('task.status.open') }), /*#__PURE__*/ _jsx("option", { value: "draft", children: t('task.status.draft') }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-3 pt-2", children: [ /*#__PURE__*/ _jsx("button", { type: "submit", disabled: editSaving, className: "flex-1 bg-green-600 text-white py-2.5 rounded-xl font-semibold hover:bg-green-700 disabled:opacity-50 transition", children: editSaving ? t('common.saving', '...') : t('common.save') }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setEditing(false), className: "px-6 py-2.5 rounded-xl border border-gray-200 text-gray-600 hover:bg-gray-50 transition", children: t('common.cancel') }) ] }) ] }) ] }) }) ] }); } @8`=_’”¿ÁÝß  35acOQ›ÉËýóÉÒñù:Aho£_ªÝäNUƒŠÃÊ @G{‚œÄöý'.cjŠ­ßæ % s _z · Ÿ û  8 ? ‚ ‰ »  ð ÷ , 4 ‚ŠÈÐ×ß LYƒ‹ÛåU]¬_ž*2¢¯nx#.ŸªÝèž²£+¬+§-«-..µ.¹.d/h/!0$0„1‡1+3.3~4_‚4|5€5ñ6ô68 8<;?;º<œ<5===‡=Š=>>Z>^>,?0?™?œ?Ž@’@,B/B–CšCDDøD_ûDGFKFŽF·F«G¯GêIîIWJZJNKQKˆL‹L)N-N–N™NŽO‘OõPùPbQeQ[R^R²S¶ST"TU_UUU8V;V9WYZZ‘Z”Zg[o[ \\R_U_»_Ÿ_V`Y`a“ac cþc_dëdîdff g#g˜h›h/j2j`kckØlÛln‚n°o³o(q+qŒrÀrPuTuvvìvïvjxmxŽz_žzù|ü|þ}~Í~Ñ~Ó~Û~>ACF¿€Ã€Å€È€3‚6‚݃àƒ‡‡-‰1‰ïŠòŠiŒlŒ`’_c’}““^”a”;•?•š•«•°–³–a˜d˜£š§š››#œ&œÐžÔžvŸyŸf¡i¡££§£=€A€÷€û€³Š_·Š˜§œ§dšhšIªLªÑ«Ô«°®Ž®± ±²²(µ+µ€¶§¶¹¹Ð¹Ó¹×ºÚºŒŒôŒøŒ×œÚœûŸ_þŸJÁMÁÖÂÚÂ.Å1ÅqÇtÇ,È/ÈÓÈÖÈpÊtÊ1Ë5Ë ÌÌíÌðÌZÎ]γѷÑ^ÒbÒsÓvÓxÓ{ÓÆÔ_ÎÔŽÕ·Õ¹ÕÁÕáÖäÖ{Ø~ØxÚ{ڑܕÜpÝtÝdÞnÞrßußQâUâ1ã4ããäæä¿çÂçFèJè÷èûèžé_¡éhêkê>ìAìªî®îï"ï?ðBðÉñÍñlòoòqòtòòóõóéôûôÐ÷Ô÷¹øœø‡ùŠùPúTúœúÀúÁû_Äû ýýËþÎþEH!ÏÒ¿ÃÅÍ04 òõ&)Ú Þ ¹ œ ­ · œ À ö_ù¡•˜WZ‹Y]Y\²µó÷Èˍ!!’!•!ä$è$–%™%&’&Q'_U'ö'ú'û)þ)S+W+y-|-~..Œ/¿/û0þ0š1¬1O2S2#3&344ú4ý4r6u6%8)8ù8ý8n9_r9,;/;Ê>Î>??C?AA|D€D:E>E¿EÂEG GÑJÔJqKuKeLhLJOMOVQZQËQÎQõRøRçU_ëU\V_VˆW‹W|Z€Z:[>[¿[Â[]][`_`à`ã`0b3bvezeûeþeJgMgÛjßjPkSk~llŠoNŽoÿop/q3q¹sŒsÓtÖtv…v8w;wDyGy€€€€€€€€€€€¿(0,_lib_auth__WEBPACK_IMPORTED_MODULE_4__/* .useSession */ .wV)Ã(0,_context_locale__WEBPACK_IMPORTED_MODULE_5__/* .useLocale */ .Y)º(0,next_navigation__WEBPACK_IMPORTED_MODULE_3__.useRouter)¯(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ°(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)ÿœ(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getOffers */ .Sw)þÀ(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getTaskStats */ .vh)Á(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getMyDashboard */ .H)ü¿(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getMyOffers */ .aT)ûÁ(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getTaskInvite */ .F9)úÂ(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getTaskReviews */ .H6)¿(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .acceptOffer */ .$H)À(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .declineOffer */ .Lb)À(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .completeTask */ .Rt)À(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .createReview */ .bx)É(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getOrCreateDirectRoom */ .QN)Ÿ(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updateTask */ .lC)·(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)ÿÿÿ¶(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)ÿÿþþÿÿÿÿÄ(0,_lib_taskLocale__WEBPACK_IMPORTED_MODULE_8__/* .taskTitle */ .Oj)þÊ(0,_lib_taskLocale__WEBPACK_IMPORTED_MODULE_8__/* .taskDescription */ .GZ)üüýüýüýýüýüüýýýüýýüýýüýü²(next_link__WEBPACK_IMPORTED_MODULE_2___default())üüÃ(0,_lib_formatName__WEBPACK_IMPORTED_MODULE_9__/* .shortName */ .E)ûÿúûÿúûûûûûúûûûûûûûûûûúúúûûúûúú·react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.FragmentúýùýúúúùúúúúùúùúúúùúúùúúùùùùùùúúùùÀ(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .runAutoMatch */ .OV)ùùøùùøøùùùøùùùùøøøùùøøùüýùÅ_components_PlanBadge__WEBPACK_IMPORTED_MODULE_7__/* .PlanBadge */ .døøø÷÷Æ(0,_lib_taskLocale__WEBPACK_IMPORTED_MODULE_8__/* .formatPrice */ .$g)÷ö÷÷÷öö÷÷÷ö÷÷ö÷ú÷Ç(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .dismissNotification */ .yk)õõöõööõööõöõûõõööõõþööõööõõöööõööùõööõõöõööööõõööööõõõöõõöõõöööõööõööõööõõööõööõööõööõöõööõöö²^ž/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ TaskDetailClient) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(9664); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(next_link__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(7541); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(1592); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(9906); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(2982); /* harmony import */ var _lib_taskLocale__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(4017); /* harmony import */ var _lib_formatName__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(1258); /* harmony import */ var _components_PlanBadge__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(2035); /* __next_internal_client_entry_do_not_use__ default auto */ const statusColors = { open: 'bg-green-100 text-green-700', in_progress: 'bg-green-100 text-green-700', completed: 'bg-gray-100 text-gray-700', cancelled: 'bg-red-100 text-red-700', draft: 'bg-yellow-100 text-yellow-700' }; function TaskDetailClient(param) { let { taskId, initialTask, initialCustomer, catMap = {}, locMap = {} } = param; var _session_user, _acceptedOffer_specialist; const { data: session } = (0,_lib_auth__WEBPACK_IMPORTED_MODULE_4__/* .useSession */ .wV)(); const { t, locale } = (0,_context_locale__WEBPACK_IMPORTED_MODULE_5__/* .useLocale */ .Y)(); const router = (0,next_navigation__WEBPACK_IMPORTED_MODULE_3__.useRouter)(); const [task, setTask] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(initialTask); const [customer] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(initialCustomer); const [offers, setOffers] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [offersLoaded, setOffersLoaded] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [myOffer, setMyOffer] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [myOfferLoaded, setMyOfferLoaded] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [myReview, setMyReview] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [myReviewLoaded, setMyReviewLoaded] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [reviewTargetId, setReviewTargetId] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [reviewRating, setReviewRating] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(5); const [reviewComment, setReviewComment] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [reviewSubmitting, setReviewSubmitting] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [reviewDone, setReviewDone] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [invite, setInvite] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [inviteLoaded, setInviteLoaded] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [inviteDeclining, setInviteDeclining] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [msgLoading, setMsgLoading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [lightboxIndex, setLightboxIndex] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); // FOMO stats + auto-match const [taskStats, setTaskStats] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [autoMatchResults, setAutoMatchResults] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [autoMatchLoading, setAutoMatchLoading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [hasAutoMatch, setHasAutoMatch] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); // Edit task state const [editing, setEditing] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [editSaving, setEditSaving] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [editForm, setEditForm] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); // Keyboard navigation for lightbox (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ const handler = (e)=>{ if (e.key === 'Escape') setLightboxIndex(null); if (e.key === 'ArrowLeft') setLightboxIndex((prev)=>prev !== null && prev > 0 ? prev - 1 : prev); if (e.key === 'ArrowRight') setLightboxIndex((prev)=>{ if (prev === null) return prev; const imgs = task.images; return imgs && prev < imgs.length - 1 ? prev + 1 : prev; }); }; window.addEventListener('keydown', handler); return ()=>window.removeEventListener('keydown', handler); }, [ task.images ]); const dateLocale = locale === 'ru' ? 'ru-RU' : locale === 'uk' ? 'uk-UA' : locale === 'en' ? 'en-US' : 'el-GR'; const currentUserId = session === null || session === void 0 ? void 0 : (_session_user = session.user) === null || _session_user === void 0 ? void 0 : _session_user.id; const isOwner = currentUserId === task.customerId; const loginRedirectHref = "/login?redirect=".concat(encodeURIComponent("/tasks/".concat(taskId))); // Load offers if owner (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!isOwner || offersLoaded) return; (0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getOffers */ .Sw)(taskId).then((data)=>{ setOffers(data); setOffersLoaded(true); }).catch(()=>setOffersLoaded(true)); }, [ isOwner, taskId, offersLoaded ]); // Load task stats + dashboard features for owner (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!isOwner) return; (0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getTaskStats */ .vh)(taskId).then(setTaskStats).catch(()=>{}); (0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getMyDashboard */ .H)().then((d)=>{ var _d_features; return setHasAutoMatch(!!((_d_features = d.features) === null || _d_features === void 0 ? void 0 : _d_features.hasAutoMatch)); }).catch(()=>{}); }, [ isOwner, taskId ]); // Load specialist's own offer (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!currentUserId || isOwner || myOfferLoaded) return; (0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getMyOffers */ .aT)().then((rows)=>{ const found = rows.find((r)=>{ var _r_task; return ((_r_task = r.task) === null || _r_task === void 0 ? void 0 : _r_task.id) === taskId; }); var _found_offer; setMyOffer((_found_offer = found === null || found === void 0 ? void 0 : found.offer) !== null && _found_offer !== void 0 ? _found_offer : null); setMyOfferLoaded(true); }).catch(()=>setMyOfferLoaded(true)); }, [ currentUserId, isOwner, taskId, myOfferLoaded ]); // Load task invite for specialist (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!currentUserId || isOwner || inviteLoaded) return; (0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getTaskInvite */ .F9)(taskId).then((rows)=>{ var _rows_; setInvite((_rows_ = rows[0]) !== null && _rows_ !== void 0 ? _rows_ : null); setInviteLoaded(true); }).catch(()=>setInviteLoaded(true)); }, [ currentUserId, isOwner, taskId, inviteLoaded ]); // Load review for specialist when task completed (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!currentUserId || isOwner || myReviewLoaded || task.status !== 'completed') return; (0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getTaskReviews */ .H6)(taskId).then((rows)=>{ const found = rows.find((r)=>r.targetId === currentUserId); setMyReview(found !== null && found !== void 0 ? found : null); setMyReviewLoaded(true); }).catch(()=>setMyReviewLoaded(true)); }, [ currentUserId, isOwner, taskId, task.status, myReviewLoaded ]); async function handleAccept(offerId) { const updated = await (0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .acceptOffer */ .$H)(offerId).catch(()=>null); if (updated) { setOffers((prev)=>prev.map((r)=>r.offer.id === offerId ? { ...r, offer: updated } : r)); setTask((t)=>({ ...t, status: 'in_progress' })); } } async function handleDecline(offerId) { const updated = await (0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .declineOffer */ .Lb)(offerId).catch(()=>null); if (updated) { setOffers((prev)=>prev.map((r)=>r.offer.id === offerId ? { ...r, offer: updated } : r)); } } async function handleComplete() { if (!window.confirm(t('task.complete.confirm'))) return; const updated = await (0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .completeTask */ .Rt)(taskId).catch(()=>null); if (updated) setTask((t)=>({ ...t, status: 'completed' })); } async function handleReview(e) { e.preventDefault(); if (!reviewTargetId) return; setReviewSubmitting(true); const ok = await (0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .createReview */ .bx)({ taskId, targetId: reviewTargetId, rating: reviewRating, comment: reviewComment || undefined }).catch(()=>null); setReviewSubmitting(false); if (ok) { setReviewDone(true); setReviewTargetId(null); } } async function handleMessage(otherUserId) { setMsgLoading(true); try { const { room } = await (0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getOrCreateDirectRoom */ .QN)(otherUserId); router.push("/chat?room=".concat(room.id)); } catch (e) {} setMsgLoading(false); } function handleEditOpen() { var _task_budgetNegotiable, _task_category, _task_location, _task_district, _task_street, _task_houseNumber, _task_timeSlot, _task_confidentialNote; setEditForm({ title: task.title, description: task.description, budget: task.budget ? Number(task.budget) : '', budgetNegotiable: (_task_budgetNegotiable = task.budgetNegotiable) !== null && _task_budgetNegotiable !== void 0 ? _task_budgetNegotiable : false, category: (_task_category = task.category) !== null && _task_category !== void 0 ? _task_category : '', location: (_task_location = task.location) !== null && _task_location !== void 0 ? _task_location : '', district: (_task_district = task.district) !== null && _task_district !== void 0 ? _task_district : '', street: (_task_street = task.street) !== null && _task_street !== void 0 ? _task_street : '', houseNumber: (_task_houseNumber = task.houseNumber) !== null && _task_houseNumber !== void 0 ? _task_houseNumber : '', timeSlot: (_task_timeSlot = task.timeSlot) !== null && _task_timeSlot !== void 0 ? _task_timeSlot : '', confidentialNote: (_task_confidentialNote = task.confidentialNote) !== null && _task_confidentialNote !== void 0 ? _task_confidentialNote : '', deadline: task.deadline ? new Date(task.deadline).toISOString().slice(0, 10) : '', expiresAt: task.expiresAt ? new Date(task.expiresAt).toISOString().slice(0, 10) : '', status: task.status === 'draft' ? 'draft' : 'open' }); setEditing(true); } async function handleEditSave(e) { e.preventDefault(); if (!editForm) return; setEditSaving(true); try { const payload = { title: editForm.title, description: editForm.description, budgetNegotiable: editForm.budgetNegotiable, status: editForm.status }; if (editForm.budget !== '' && editForm.budget > 0) payload.budget = Number(editForm.budget); if (editForm.category) payload.category = editForm.category; if (editForm.location) payload.location = editForm.location; if (editForm.district) payload.district = editForm.district; if (editForm.street) payload.street = editForm.street; if (editForm.houseNumber) payload.houseNumber = editForm.houseNumber; if (editForm.timeSlot) payload.timeSlot = editForm.timeSlot; if (editForm.confidentialNote !== undefined) payload.confidentialNote = editForm.confidentialNote; if (editForm.deadline) payload.deadline = new Date(editForm.deadline).toISOString(); if (editForm.expiresAt) payload.expiresAt = new Date(editForm.expiresAt).toISOString(); const updated = await (0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updateTask */ .lC)(taskId, payload); setTask((prev)=>({ ...prev, ...updated })); setEditing(false); } catch (err) { alert((err === null || err === void 0 ? void 0 : err.message) || t('common.error')); } finally{ setEditSaving(false); } } const acceptedOffer = offers.find((r)=>r.offer.status === 'accepted'); var _catMap_task_category, _locMap_task_location; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "max-w-4xl mx-auto px-4 py-8", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-6 mb-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex justify-between items-start gap-4 mb-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex flex-wrap items-center gap-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-xs font-medium px-2 py-1 rounded-full ".concat(statusColors[task.status]), children: t("task.status.".concat(task.status), task.status) }), task.category && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-xs font-medium text-green-600 bg-green-50 px-2 py-1 rounded-full", children: (_catMap_task_category = catMap[task.category]) !== null && _catMap_task_category !== void 0 ? _catMap_task_category : task.category }), isOwner && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-xs text-gray-400 bg-gray-100 px-2 py-1 rounded-full", children: t('task.yours') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-2 shrink-0", children: [ isOwner && (task.status === 'draft' || task.status === 'open') && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { onClick: handleEditOpen, className: "flex items-center gap-1.5 text-xs font-medium text-green-600 bg-green-50 hover:bg-green-100 px-3 py-1.5 rounded-lg transition", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M16.862 4.487l1.687-1.688a1.875 1.875 0 112.652 2.652L10.582 16.07a4.5 4.5 0 01-1.897 1.13L6 18l.8-2.685a4.5 4.5 0 011.13-1.897l8.932-8.931zm0 0L19.5 7.125" }) }), t('task.edit') ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-gray-400", children: new Date(task.createdAt).toLocaleDateString(dateLocale) }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h1", { className: "text-2xl font-bold text-gray-900 mb-4", children: (0,_lib_taskLocale__WEBPACK_IMPORTED_MODULE_8__/* .taskTitle */ .Oj)(task, locale) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-gray-700 whitespace-pre-wrap mb-6", children: (0,_lib_taskLocale__WEBPACK_IMPORTED_MODULE_8__/* .taskDescription */ .GZ)(task, locale) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "grid grid-cols-2 md:grid-cols-4 gap-4 p-4 bg-gray-50 rounded-lg", children: [ task.budget && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-500", children: t('task.budget') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { className: "font-bold text-green-600 text-lg", children: [ task.budget, "€" ] }), task.budgetNegotiable && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-green-600 mt-0.5", children: t('task.budget_negotiable') }) ] }), !task.budget && task.budgetNegotiable && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-500", children: t('task.budget') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "font-medium text-green-600", children: t('task.budget_negotiable') }) ] }), task.location && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-500", children: t('task.location') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { className: "font-medium", children: [ "\uD83D\uDCCD ", (_locMap_task_location = locMap[task.location]) !== null && _locMap_task_location !== void 0 ? _locMap_task_location : task.location ] }) ] }), task.deadline && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-500", children: t('task.deadline') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "font-medium", children: new Date(task.deadline).toLocaleDateString(dateLocale) }), task.timeSlot && task.timeSlot !== '' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-500 mt-0.5", children: t("create.field.time_slot.".concat(task.timeSlot), task.timeSlot) }) ] }), !task.deadline && task.timeSlot && task.timeSlot !== '' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-500", children: t('task.time_slot') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "font-medium", children: t("create.field.time_slot.".concat(task.timeSlot), task.timeSlot) }) ] }), task.expiresAt && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-500", children: t('task.expires_at') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "font-medium", children: new Date(task.expiresAt).toLocaleDateString(dateLocale) }) ] }), customer && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-500", children: t('task.customer') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)((next_link__WEBPACK_IMPORTED_MODULE_2___default()), { href: "/users/".concat(customer.id), className: "flex items-center gap-2 mt-1 group", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "w-8 h-8 rounded-full overflow-hidden bg-green-100 shrink-0 flex items-center justify-center", children: customer.image ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: customer.image, alt: (0,_lib_formatName__WEBPACK_IMPORTED_MODULE_9__/* .shortName */ .E)(customer.name), className: "w-full h-full object-cover" }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-green-600 font-semibold text-xs", children: (0,_lib_formatName__WEBPACK_IMPORTED_MODULE_9__/* .shortName */ .E)(customer.name).charAt(0).toUpperCase() }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "font-medium text-gray-900 group-hover:text-green-600 leading-none", children: (0,_lib_formatName__WEBPACK_IMPORTED_MODULE_9__/* .shortName */ .E)(customer.name) }), customer.rating && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { className: "text-xs text-yellow-500 leading-none mt-0.5", children: [ "★ ", Number(customer.rating).toFixed(1) ] }) ] }) ] }) ] }) ] }), task.images && task.images.length > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "mt-4", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex flex-wrap gap-2", children: task.images.map((url, i)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>setLightboxIndex(i), className: "block w-24 h-24 rounded-lg overflow-hidden border border-gray-200 hover:opacity-90 hover:border-green-300 transition", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: url, alt: "", className: "w-full h-full object-cover" }) }, i)) }) }), lightboxIndex !== null && task.images && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "fixed inset-0 z-50 flex items-center justify-center bg-black/85", onClick: ()=>setLightboxIndex(null), children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "relative max-w-4xl w-full mx-4", onClick: (e)=>e.stopPropagation(), children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: task.images[lightboxIndex], alt: "", className: "w-full max-h-[80vh] object-contain rounded-lg" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>setLightboxIndex(null), className: "absolute -top-10 right-0 text-white/80 hover:text-white p-2", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-6 h-6", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" }) }) }), lightboxIndex > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>setLightboxIndex(lightboxIndex - 1), className: "absolute left-0 top-1/2 -translate-y-1/2 -translate-x-12 text-white/80 hover:text-white p-2", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-8 h-8", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 19l-7-7 7-7" }) }) }), lightboxIndex < task.images.length - 1 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>setLightboxIndex(lightboxIndex + 1), className: "absolute right-0 top-1/2 -translate-y-1/2 translate-x-12 text-white/80 hover:text-white p-2", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-8 h-8", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 5l7 7-7 7" }) }) }), task.images.length > 1 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { className: "text-white/60 text-sm text-center mt-3", children: [ lightboxIndex + 1, " / ", task.images.length ] }) ] }) }), (isOwner || (myOffer === null || myOffer === void 0 ? void 0 : myOffer.status) === 'accepted') && (task.district || task.street || task.confidentialNote) && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "mt-4 p-3 bg-yellow-50 border border-yellow-200 rounded-lg space-y-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { className: "text-xs font-medium text-yellow-700 flex items-center gap-1", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z" }) }), t('task.confidential') ] }), (task.district || task.street) && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { className: "text-sm text-yellow-800", children: [ "\uD83D\uDCCD ", [ task.district, task.street, task.houseNumber ].filter(Boolean).join(', ') ] }), task.confidentialNote && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-yellow-800", children: task.confidentialNote }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "mt-6 flex flex-wrap gap-3", children: [ !session && !isOwner && task.status === 'open' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)((next_link__WEBPACK_IMPORTED_MODULE_2___default()), { href: loginRedirectHref, className: "bg-green-600 text-white px-6 py-3 rounded-xl font-semibold hover:bg-green-700", children: t('task.make_offer', 'Send offer') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)((next_link__WEBPACK_IMPORTED_MODULE_2___default()), { href: loginRedirectHref, className: "flex items-center gap-2 bg-green-50 text-green-600 border border-green-200 px-4 py-2.5 rounded-xl font-medium hover:bg-green-100", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }), t('chat.write_customer', 'Write to customer') ] }) ] }), isOwner && task.status === 'in_progress' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: handleComplete, className: "bg-green-600 text-white px-6 py-3 rounded-xl font-semibold hover:bg-green-700", children: t('task.complete') }), isOwner && (acceptedOffer === null || acceptedOffer === void 0 ? void 0 : (_acceptedOffer_specialist = acceptedOffer.specialist) === null || _acceptedOffer_specialist === void 0 ? void 0 : _acceptedOffer_specialist.id) && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { onClick: ()=>handleMessage(acceptedOffer.specialist.id), disabled: msgLoading, className: "flex items-center gap-2 bg-green-50 text-green-600 border border-green-200 px-4 py-2.5 rounded-xl font-medium hover:bg-green-100 disabled:opacity-50", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }), t('chat.write_specialist') ] }), isOwner && task.status === 'completed' && acceptedOffer && !reviewDone && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>{ var _acceptedOffer_specialist; var _acceptedOffer_specialist_id; return setReviewTargetId((_acceptedOffer_specialist_id = (_acceptedOffer_specialist = acceptedOffer.specialist) === null || _acceptedOffer_specialist === void 0 ? void 0 : _acceptedOffer_specialist.id) !== null && _acceptedOffer_specialist_id !== void 0 ? _acceptedOffer_specialist_id : null); }, className: "bg-yellow-500 text-white px-6 py-3 rounded-xl font-semibold hover:bg-yellow-600", children: t('review.leave') }), reviewDone && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-green-600 font-medium py-3", children: t('review.done') }) ] }), reviewTargetId && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("form", { onSubmit: handleReview, className: "mt-6 border-t border-gray-100 pt-6 space-y-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h3", { className: "font-semibold text-gray-800", children: t('review.leave') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm font-medium text-gray-700 mb-2", children: t('review.rating') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex gap-1", children: [ 1, 2, 3, 4, 5 ].map((star)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>setReviewRating(star), className: "text-2xl transition ".concat(star <= reviewRating ? 'text-yellow-400' : 'text-gray-300'), children: "★" }, star)) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('review.comment') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("textarea", { value: reviewComment, onChange: (e)=>setReviewComment(e.target.value), rows: 3, maxLength: 2000, placeholder: t('review.comment.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" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "submit", disabled: reviewSubmitting, className: "bg-green-600 text-white px-5 py-2 rounded-xl font-semibold hover:bg-green-700 disabled:opacity-50", children: reviewSubmitting ? t('review.submitting') : t('review.submit') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>setReviewTargetId(null), className: "px-5 py-2 rounded-xl border border-gray-200 text-gray-600 hover:bg-gray-50", children: t('common.cancel') }) ] }) ] }) ] }), isOwner && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-between mb-4 flex-wrap gap-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("h2", { className: "text-lg font-bold text-gray-900", children: [ t('task.offers'), " (", offers.length, ")" ] }), taskStats && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-3 text-xs text-gray-500", children: [ taskStats.totalViews > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "flex items-center gap-1", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 12a3 3 0 11-6 0 3 3 0 016 0z" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z" }) ] }), taskStats.totalViews ] }), taskStats.offerCount > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "font-medium text-green-600", children: [ "⚡ ", taskStats.offerCount, " ", t('task.offers').toLowerCase() ] }) ] }), hasAutoMatch && task.status === 'open' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { onClick: async ()=>{ setAutoMatchLoading(true); try { const res = await (0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .runAutoMatch */ .OV)(taskId); var _res_matches; setAutoMatchResults((_res_matches = res.matches) !== null && _res_matches !== void 0 ? _res_matches : []); } catch (e) {} finally{ setAutoMatchLoading(false); } }, disabled: autoMatchLoading, className: "flex items-center gap-1.5 text-xs font-medium bg-purple-50 text-purple-700 border border-purple-200 px-3 py-1.5 rounded-lg hover:bg-purple-100 transition disabled:opacity-50", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M13 10V3L4 14h7v7l9-11h-7z" }) }), autoMatchLoading ? t('common.loading') : t('task.auto_match', 'Auto match') ] }) ] }), autoMatchResults && autoMatchResults.length > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "mb-4 p-3 bg-purple-50 rounded-xl border border-purple-100", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs font-medium text-purple-700 mb-2", children: t('task.auto_match_results', 'Top specialists') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "space-y-2", children: autoMatchResults.slice(0, 5).map((s)=>{ var _s_name_, _s_name; var _s_firstName; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-between gap-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "w-7 h-7 rounded-full bg-purple-100 flex items-center justify-center text-purple-700 text-xs font-bold overflow-hidden", children: s.image ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: s.image, alt: "", className: "w-full h-full object-cover" }) : (_s_name = s.name) === null || _s_name === void 0 ? void 0 : (_s_name_ = _s_name[0]) === null || _s_name_ === void 0 ? void 0 : _s_name_.toUpperCase() }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-sm text-gray-800", children: (_s_firstName = s.firstName) !== null && _s_firstName !== void 0 ? _s_firstName : s.name }), s.rating && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "text-xs text-yellow-500", children: [ "★", Number(s.rating).toFixed(1) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>handleMessage(s.id), className: "text-xs text-green-600 hover:underline", children: t('chat.write_btn') }) ] }, s.id); }) }) ] }), !offersLoaded ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-gray-400 text-sm", children: t('common.loading') }) : offers.length === 0 ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-gray-500 text-sm", children: t('task.offers.none') }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "space-y-4", children: offers.map((row)=>{ var _specialist_name_, _specialist_name; const offer = row.offer; const specialist = row.specialist; var _specialist_name__toUpperCase; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "border border-gray-100 rounded-xl p-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex justify-between items-start gap-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-start gap-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "w-10 h-10 rounded-full bg-green-100 flex-shrink-0 flex items-center justify-center text-green-700 font-bold overflow-hidden", children: (specialist === null || specialist === void 0 ? void 0 : specialist.image) ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: specialist.image, alt: specialist.name, className: "w-full h-full object-cover" }) : (_specialist_name__toUpperCase = specialist === null || specialist === void 0 ? void 0 : (_specialist_name = specialist.name) === null || _specialist_name === void 0 ? void 0 : (_specialist_name_ = _specialist_name[0]) === null || _specialist_name_ === void 0 ? void 0 : _specialist_name_.toUpperCase()) !== null && _specialist_name__toUpperCase !== void 0 ? _specialist_name__toUpperCase : '?' }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ specialist && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-1.5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)((next_link__WEBPACK_IMPORTED_MODULE_2___default()), { href: "/users/".concat(specialist.id), className: "font-medium text-gray-900 hover:text-green-600", children: (0,_lib_formatName__WEBPACK_IMPORTED_MODULE_9__/* .shortName */ .E)(specialist.name) }), specialist.planTier && specialist.planTier !== 'free' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components_PlanBadge__WEBPACK_IMPORTED_MODULE_7__/* .PlanBadge */ .d, { tier: specialist.planTier }), specialist.hasVerifiedBadge && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3.5 h-3.5 text-gray-500", viewBox: "0 0 24 24", fill: "currentColor", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z" }) }) ] }), offer.message && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-gray-600 mt-1", children: offer.message }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "text-right shrink-0", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { className: "text-lg font-bold text-green-600", children: [ (0,_lib_taskLocale__WEBPACK_IMPORTED_MODULE_8__/* .formatPrice */ .$g)(offer.price), "€" ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-xs px-2 py-0.5 rounded-full ".concat(offer.status === 'accepted' ? 'bg-green-100 text-green-700' : offer.status === 'declined' ? 'bg-red-100 text-red-700' : 'bg-gray-100 text-gray-700'), children: t("offer.status.".concat(offer.status), offer.status) }) ] }) ] }), offer.status === 'pending' && task.status === 'open' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-2 mt-3 pt-3 border-t border-gray-50", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>handleAccept(offer.id), className: "flex-1 bg-green-600 text-white py-2 rounded-lg text-sm font-semibold hover:bg-green-700", children: t('offer.accept') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>handleDecline(offer.id), className: "flex-1 bg-gray-100 text-gray-700 py-2 rounded-lg text-sm font-semibold hover:bg-gray-200", children: t('offer.decline') }) ] }) ] }, offer.id); }) }) ] }), !isOwner && session && invite && inviteLoaded && task.status === 'open' && !myOffer && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "rounded-xl border border-green-200 bg-green-50 p-5", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-between gap-4 flex-wrap gap-y-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "w-10 h-10 rounded-full bg-green-100 flex items-center justify-center shrink-0", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", strokeWidth: 1.5, stroke: "currentColor", className: "w-5 h-5 text-green-600", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M21.75 6.75v10.5a2.25 2.25 0 0 1-2.25 2.25h-15a2.25 2.25 0 0 1-2.25-2.25V6.75m19.5 0A2.25 2.25 0 0 0 19.5 4.5h-15a2.25 2.25 0 0 0-2.25 2.25m19.5 0v.243a2.25 2.25 0 0 1-1.07 1.916l-7.5 4.615a2.25 2.25 0 0 1-2.36 0L3.32 8.91a2.25 2.25 0 0 1-1.07-1.916V6.75" }) }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "font-semibold text-gray-900 text-sm", children: t('task.invite.banner_title') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-gray-500 text-sm mt-0.5", children: t('task.invite.banner_hint') }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-2 shrink-0", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)((next_link__WEBPACK_IMPORTED_MODULE_2___default()), { href: "/tasks/".concat(taskId, "/offer"), className: "bg-green-600 text-white px-4 py-2 rounded-lg text-sm font-semibold hover:bg-green-700 transition", children: t('task.invite.accept') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: async ()=>{ if (!invite) return; setInviteDeclining(true); await (0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .dismissNotification */ .yk)(invite.id).catch(()=>{}); setInvite(null); setInviteDeclining(false); }, disabled: inviteDeclining, className: "border border-gray-300 bg-white text-gray-600 px-4 py-2 rounded-lg text-sm font-medium hover:bg-gray-50 disabled:opacity-50 transition", children: t('task.invite.decline') }) ] }) ] }) }), !isOwner && session && myOfferLoaded && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-4", children: [ task.status === 'completed' && (myOffer === null || myOffer === void 0 ? void 0 : myOffer.status) === 'accepted' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-green-50 border border-green-200 rounded-xl p-5 flex items-center gap-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-3xl", children: "\uD83C\uDF89" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "font-bold text-green-800 text-lg", children: "ЗаЎаМОе завершеМП!" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-green-700 text-sm", children: "ЗаказчОк ПтЌетОл заЎаМОе как выпПлМеММПе." }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { onClick: ()=>handleMessage(task.customerId), disabled: msgLoading, className: "ml-auto flex items-center gap-2 bg-white text-green-600 border border-green-200 px-4 py-2 rounded-xl text-sm font-medium hover:bg-green-50 disabled:opacity-50", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }), t('chat.write_customer') ] }) ] }), (myOffer || task.status === 'open' && !invite || task.status !== 'open') && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "text-lg font-bold text-gray-900 mb-4", children: "МПё преЎлПжеМОе" }), myOffer ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-start justify-between gap-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-1", children: [ myOffer.message && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-gray-600", children: myOffer.message }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400", children: new Date(myOffer.createdAt).toLocaleString(dateLocale) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "text-right shrink-0", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { className: "text-xl font-bold text-green-600", children: [ (0,_lib_taskLocale__WEBPACK_IMPORTED_MODULE_8__/* .formatPrice */ .$g)(myOffer.price), "€" ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-xs px-2 py-0.5 rounded-full font-medium ".concat(myOffer.status === 'accepted' ? 'bg-green-100 text-green-700' : myOffer.status === 'declined' ? 'bg-red-100 text-red-700' : 'bg-yellow-100 text-yellow-700'), children: myOffer.status === 'accepted' ? '✓ ПрОМятП' : myOffer.status === 'declined' ? '✗ ОтклПМеМП' : '⏳ На рассЌПтреМОО' }) ] }) ] }), myOffer.status === 'accepted' && task.status === 'in_progress' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "mt-3 pt-3 border-t border-gray-100", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { onClick: ()=>handleMessage(task.customerId), disabled: msgLoading, className: "flex items-center gap-2 bg-green-50 text-green-600 border border-green-200 px-4 py-2 rounded-xl text-sm font-medium hover:bg-green-100 disabled:opacity-50", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }), t('chat.write_customer') ] }) }) ] }) : task.status === 'open' && !invite ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-3", children: [ taskStats && taskStats.offerCount > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-2 p-2.5 bg-amber-50 rounded-lg border border-amber-100", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 text-amber-500 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M13 10V3L4 14h7v7l9-11h-7z" }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-amber-700", children: t('fomo.already_offered', '\u0423\u0436\u0435 {n} \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0441\u0442\u043e\u0432 \u043e\u0442\u043a\u043b\u0438\u043a\u043d\u0443\u043b\u0438\u0441\u044c').replace('{n}', String(taskStats.offerCount)) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-between", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-gray-500", children: t('task.no_offer_yet', '\u0412\u044b \u0435\u0449\u0451 \u043d\u0435 \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u043b\u0438 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u0435') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)((next_link__WEBPACK_IMPORTED_MODULE_2___default()), { href: "/tasks/".concat(taskId, "/offer"), className: "bg-green-600 text-white px-4 py-2 rounded-lg text-sm font-semibold hover:bg-green-700", children: t('task.make_offer', '\u041e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u0435') }) ] }) ] }) : null ] }), task.status === 'completed' && (myOffer === null || myOffer === void 0 ? void 0 : myOffer.status) === 'accepted' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "text-lg font-bold text-gray-900 mb-4", children: "ОцеМка заказчОка" }), !myReviewLoaded ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-gray-400", children: "Загрузка..." }) : myReview ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-1", children: [ [ 1, 2, 3, 4, 5 ].map((star)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-2xl ".concat(star <= myReview.rating ? 'text-yellow-400' : 'text-gray-200'), children: "★" }, star)), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "ml-2 text-lg font-bold text-gray-800", children: [ myReview.rating, "/5" ] }) ] }), myReview.comment && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-gray-700 text-sm leading-relaxed", children: myReview.comment }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400", children: new Date(myReview.createdAt).toLocaleDateString(dateLocale) }) ] }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-gray-500", children: "ЗаказчОк ещё Ме ПставОл ПцеМку." }) ] }) ] }), editing && editForm && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "fixed inset-0 z-50 flex items-start justify-center bg-black/50 overflow-y-auto py-8 px-4", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-2xl w-full max-w-2xl shadow-xl", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-between px-6 py-4 border-b border-gray-100", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "text-lg font-bold text-gray-900", children: t('task.edit') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>setEditing(false), className: "text-gray-400 hover:text-gray-600 p-1", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-5 h-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" }) }) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("form", { onSubmit: handleEditSave, className: "p-6 space-y-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: [ t('create.field.title'), " *" ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "text", required: true, minLength: 5, maxLength: 200, value: editForm.title, onChange: (e)=>setEditForm((p)=>({ ...p, title: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: [ t('create.field.description'), " *" ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("textarea", { required: true, minLength: 20, value: editForm.description, onChange: (e)=>setEditForm((p)=>({ ...p, description: e.target.value })), rows: 4, 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" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "grid grid-cols-2 gap-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('create.field.budget') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "number", min: 1, value: editForm.budget, onChange: (e)=>setEditForm((p)=>({ ...p, budget: e.target.value })), placeholder: "€", className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex items-end pb-2", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "flex items-center gap-2 cursor-pointer", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "checkbox", checked: editForm.budgetNegotiable, onChange: (e)=>setEditForm((p)=>({ ...p, budgetNegotiable: e.target.checked })), className: "w-4 h-4 rounded text-green-600" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-sm text-gray-700", children: t('create.field.budget_negotiable') }) ] }) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('create.field.deadline') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "date", value: editForm.deadline, onChange: (e)=>setEditForm((p)=>({ ...p, deadline: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('create.field.expires_at') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "date", value: editForm.expiresAt, onChange: (e)=>setEditForm((p)=>({ ...p, expiresAt: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "grid grid-cols-3 gap-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('create.field.address.district') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "text", value: editForm.district, onChange: (e)=>setEditForm((p)=>({ ...p, district: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('create.field.address.street') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "text", value: editForm.street, onChange: (e)=>setEditForm((p)=>({ ...p, street: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('create.field.address.house') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "text", value: editForm.houseNumber, onChange: (e)=>setEditForm((p)=>({ ...p, houseNumber: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('create.field.confidential') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("textarea", { value: editForm.confidentialNote, onChange: (e)=>setEditForm((p)=>({ ...p, confidentialNote: e.target.value })), rows: 2, 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" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('task.status_label', 'Status') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("select", { value: editForm.status, onChange: (e)=>setEditForm((p)=>({ ...p, status: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "open", children: t('task.status.open') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "draft", children: t('task.status.draft') }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-3 pt-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "submit", disabled: editSaving, className: "flex-1 bg-green-600 text-white py-2.5 rounded-xl font-semibold hover:bg-green-700 disabled:opacity-50 transition", children: editSaving ? t('common.saving', '...') : t('common.save') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>setEditing(false), className: "px-6 py-2.5 rounded-xl border border-gray-200 text-gray-600 hover:bg-gray-50 transition", children: t('common.cancel') }) ] }) ] }) ] }) }) ] }); } ³¶ ·/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ TaskDetailClient) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(9664); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(next_link__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(7541); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(1592); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(9906); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(2982); /* harmony import */ var _lib_taskLocale__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(4017); /* harmony import */ var _lib_formatName__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(1258); /* harmony import */ var _components_PlanBadge__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(2035); ž³æÿÿÎV61146undefined148191undefined193221undefined223266undefined268307undefined309353undefined355591undefined593667undefined669713undefined715765undefined10111025undefined12251234(0,_lib_auth__WEBPACK_IMPORTED_MODULE_4__/* .useSession */ .wV)undefined12651273(0,_context_locale__WEBPACK_IMPORTED_MODULE_5__/* .useLocale */ .Y)undefined12971305(0,next_navigation__WEBPACK_IMPORTED_MODULE_3__.useRouter)undefined13381345(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined13841391(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined14431450(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined15011508(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined15521559(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined16141621(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined16671674(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined17311738(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined17961803(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined18561863(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined19151922(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined19811988(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined20382045(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined20872094(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined21472154(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined22142221(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined22712278(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined23342341(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined24192426(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined24872494(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined25552562(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined26162623(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined26902697(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined27472754(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined28002807(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined28602868(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined39703978(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined40404048(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getOffers */ .Sw)undefined43114319(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined43654376(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getTaskStats */ .vh)undefined44284441(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getMyDashboard */ .H)undefined47394747(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined48274837(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getMyOffers */ .aT)undefined54615469(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined55485560(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getTaskInvite */ .F9)undefined59305938(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined60506063(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getTaskReviews */ .H6)undefined65106520(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .acceptOffer */ .$H)undefined69476958(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .declineOffer */ .Lb)undefined73277338(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .completeTask */ .Rt)undefined76457656(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .createReview */ .bx)undefined80948114(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getOrCreateDirectRoom */ .QN)undefined1117111180(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updateTask */ .lC)undefined1168711691(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1179811802(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1195711961(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1213212136(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1232112324(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1267612679(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1309913102(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1343813442(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1369213696(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1406514068(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1449314496(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1516415167(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1554615549(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1566915677(0,_lib_taskLocale__WEBPACK_IMPORTED_MODULE_8__/* .taskTitle */ .Oj)undefined1575115754(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1587415888(0,_lib_taskLocale__WEBPACK_IMPORTED_MODULE_8__/* .taskDescription */ .GZ)undefined1596215966(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1617216176(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1628116284(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1652616530(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1694016943(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1730217306(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1741117414(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1765617659(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1799117995(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1810018103(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1834718351(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1892218926(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1903119034(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1927819281(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1959219595(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2000920013(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2011820121(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2036620369(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2072520729(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2083420837(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2108321086(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2142621430(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2153521538(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2178221786(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2178821791(next_link__WEBPACK_IMPORTED_MODULE_2___default())undefined2207222075(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2232922332(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2247322481(0,_lib_formatName__WEBPACK_IMPORTED_MODULE_9__/* .shortName */ .E)undefined2265822661(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2283822846(0,_lib_formatName__WEBPACK_IMPORTED_MODULE_9__/* .shortName */ .E)undefined2304423048(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2318523188(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2339923407(0,_lib_formatName__WEBPACK_IMPORTED_MODULE_9__/* .shortName */ .E)undefined2356523569(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2440224405(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2450724510(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2466224665(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2497624979(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2537325376(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2559825602(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2583525838(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2614026143(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2640026403(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2677626779(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2718327186(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2748827491(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2786427867(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2828728290(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2859228595(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2896828971(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2937229376(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3003230036(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3023130235(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3044430447(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3082630829(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3141231416(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3199331996(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3225432258(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3246132465(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3246732475react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragmentundefined3257432577(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3257932582(next_link__WEBPACK_IMPORTED_MODULE_2___default())undefined3295932963(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3296532968(next_link__WEBPACK_IMPORTED_MODULE_2___default())undefined3333133334(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3375733760(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3456234565(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3511735121(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3556735570(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3594535948(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3663236635(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3747237475(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3775737761(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3798237985(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3820338207(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3831238315(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3857638579(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3900939012(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3958739591(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3969639699(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3997139974(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4065640660(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined4082240825(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4131841321(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4189141895(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined4204542049(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined4223142235(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined4267542679(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined4290442908(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined4310843112(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined4359343596(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4398543988(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4472044724(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined4534045344(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined4557445585(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .runAutoMatch */ .OV)undefined4637646379(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4675646759(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4737947383(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined4756847571(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4783147834(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4815348157(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined4837248376(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined4859948602(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4889148894(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4948249485(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4987849882(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined5047850481(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined5105751060(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined5124451247(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined5141151414(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined5182451828(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined5201752021(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined5223552239(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined5246152464(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined5282652829(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined5368353687(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined5385453858(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined5413154134(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined5413654139(next_link__WEBPACK_IMPORTED_MODULE_2___default())undefined5447054478(0,_lib_formatName__WEBPACK_IMPORTED_MODULE_9__/* .shortName */ .E)undefined5470854711(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined5471354721_components_PlanBadge__WEBPACK_IMPORTED_MODULE_7__/* .PlanBadge */ .dundefined5500955012(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined5541955422(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined5592855931(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined5646556469(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined5668856692(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined5693256942(0,_lib_taskLocale__WEBPACK_IMPORTED_MODULE_8__/* .formatPrice */ .$g)undefined5720257205(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined5793757941(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined5816158164(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined5859558598(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined5932759330(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined5946259466(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined5963959643(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined5980659809(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined6000860011(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined6047860481(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined6109861102(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined6121561218(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined6150361506(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined6189761901(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined6206062063(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined6206562068(next_link__WEBPACK_IMPORTED_MODULE_2___default())undefined6245062453(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined6269762715(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .dismissNotification */ .yk)undefined6344063444(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined6367363677(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined6387963882(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined6408064084(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined6418964192(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined6444964452(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined6477964783(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined6522765230(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined6560565608(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined6633366337(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined6651166514(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined6675166755(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined6675766765react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragmentundefined6686466868(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined6708267086(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined6731467317(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined6762267625(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined6805868062(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined6828168285(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined6852568535(0,_lib_taskLocale__WEBPACK_IMPORTED_MODULE_8__/* .formatPrice */ .$g)undefined6879768800(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined6962269625(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined6978969793(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined7029370296(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined7074370746(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined7156371567(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined7176971773(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined7202572028(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined7247372476(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined7288272885(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined7345973463(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined7367273675(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined7412574128(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined7413074133(next_link__WEBPACK_IMPORTED_MODULE_2___default())undefined7498074984(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined7515875161(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined7540775410(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined7560175605(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined7576675770(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined7628376286(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined7662776631(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined7717777180(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined7743877441(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined7775677759(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined7807578078(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined7824878252(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined7841578419(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined7862778630(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined7886578868(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined7909879101(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined7947479477(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined7990979913(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined8012180125(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined8023880242(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined8068480687(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined8161081614(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined8172781731(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined8217982182(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined8306883072(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined8325883262(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined8339183394(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined8371983722(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined8468984692(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined8484984853(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined8509385096(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined8583485837(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined8635886362(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined8647586478(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined8677386776(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined8752787531(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined8764487647(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined8794487947(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined8870088704(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined8889088894(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined8902389026(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined8936189364(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined9020390207(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined9033690339(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined9067290675(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined9151091514(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined9164391646(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined9197891981(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined9289192895(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined9300893011(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined9331093313(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined9409094094(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined9420794210(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined9451194515(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined9516195164(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined9544395446(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined9587395877(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined9605696059(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined9658096583(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined ¹ÆRŒÿÿº°æÿÿ¢£ /¿«webpack/lib/util/registerExternalSerializerœwebpack-sources/ConcatSource€«webpack/lib/util/registerExternalSerializer™webpack-sources/RawSourcet__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ ProfilePage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7541); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(1592); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(9906); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(2982); /* harmony import */ var _components_CategoryIcon__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(5940); «webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSource’/* __next_internal_client_entry_do_not_use__ default auto */ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime"; import { useState, useEffect, useRef, Suspense } from 'react'; import { useRouter, useSearchParams } from 'next/navigation'; import { useSession, authClient } from '@/lib/auth'; import { useLocale } from '@/context/locale'; import * as api from '@/lib/api'; import { CategoryIcon, isCategoryIconUrl } from '@/components/CategoryIcon'; function SpecialistCardEditor(param) { let { card, isOpen, onToggle, onUpdate, onDelete, categories, locationTree, catLocale, locale, hasPriceList, visibilityIssues = [], moderationNotice = null } = param; const { t } = useLocale(); const hasVisibilityIssues = visibilityIssues.length > 0; const [cardTab, setCardTab] = useState('main'); const [saving, setSaving] = useState(false); const [savedOk, setSavedOk] = useState(false); const [localTitle, setLocalTitle] = useState(card.title); var _card_descriptionEl; const [localDescEl, setLocalDescEl] = useState((_card_descriptionEl = card.descriptionEl) !== null && _card_descriptionEl !== void 0 ? _card_descriptionEl : ''); var _card_descriptionEn; const [localDescEn, setLocalDescEn] = useState((_card_descriptionEn = card.descriptionEn) !== null && _card_descriptionEn !== void 0 ? _card_descriptionEn : ''); var _card_descriptionRu; const [localDescRu, setLocalDescRu] = useState((_card_descriptionRu = card.descriptionRu) !== null && _card_descriptionRu !== void 0 ? _card_descriptionRu : ''); var _card_descriptionUk; const [localDescUk, setLocalDescUk] = useState((_card_descriptionUk = card.descriptionUk) !== null && _card_descriptionUk !== void 0 ? _card_descriptionUk : ''); var _card_skills; const [localSkills, setLocalSkills] = useState((_card_skills = card.skills) !== null && _card_skills !== void 0 ? _card_skills : []); const [skillInput, setSkillInput] = useState(''); var _card_categories; const [localCategories, setLocalCategories] = useState((_card_categories = card.categories) !== null && _card_categories !== void 0 ? _card_categories : []); var _card_locations; const [localLocations, setLocalLocations] = useState((_card_locations = card.locations) !== null && _card_locations !== void 0 ? _card_locations : []); var _card_publicationStatus; const [localPublicationStatus, setLocalPublicationStatus] = useState((_card_publicationStatus = card.publicationStatus) !== null && _card_publicationStatus !== void 0 ? _card_publicationStatus : card.isActive ? 'active' : 'inactive'); const [apiSkillSugs, setApiSkillSugs] = useState([]); var _card_portfolio; const [portfolio, setPortfolio] = useState((_card_portfolio = card.portfolio) !== null && _card_portfolio !== void 0 ? _card_portfolio : []); const [portfolioUploading, setPortfolioUploading] = useState(false); const [editingItem, setEditingItem] = useState(null); const [editTitle, setEditTitle] = useState(''); const [editDesc, setEditDesc] = useState(''); const portfolioFileRef = useRef(null); // Price list state const [priceList, setPriceList] = useState([]); const [priceListLoading, setPriceListLoading] = useState(false); const [newGroupTitle, setNewGroupTitle] = useState(''); const [addingGroupId, setAddingGroupId] = useState(null); const [newItem, setNewItem] = useState({ name: '', description: '', price: '', unit: '' }); const [editingGroupId, setEditingGroupId] = useState(null); const [editGroupTitle, setEditGroupTitle] = useState(''); useEffect(()=>{ if (cardTab !== 'pricelist' || priceList.length > 0 || priceListLoading) return; setPriceListLoading(true); api.getPriceList(card.id, locale).then(setPriceList).catch(()=>{}).finally(()=>setPriceListLoading(false)); }, [ cardTab, locale ]); async function handleAddGroup() { if (!newGroupTitle.trim()) return; const group = await api.createPriceListGroup(card.id, { title: newGroupTitle.trim(), locale: [ 'el', 'en', 'ru', 'uk' ].includes(locale) ? locale : 'el', autoTranslate: true }); setPriceList((prev)=>[ ...prev, group ]); setNewGroupTitle(''); } async function handleDeleteGroup(groupId) { await api.deletePriceListGroup(groupId); setPriceList((prev)=>prev.filter((g)=>g.id !== groupId)); } async function handleSaveGroupTitle(groupId) { const updated = await api.updatePriceListGroup(groupId, { title: editGroupTitle.trim(), locale: [ 'el', 'en', 'ru', 'uk' ].includes(locale) ? locale : 'el', autoTranslate: true }); setPriceList((prev)=>prev.map((g)=>g.id === groupId ? { ...g, title: updated.title } : g)); setEditingGroupId(null); } async function handleAddItem(groupId) { if (!newItem.name.trim()) return; const item = await api.createPriceListItem(groupId, { name: newItem.name.trim(), description: newItem.description.trim() || null, price: newItem.price.trim() || null, unit: newItem.unit.trim() || null, locale: [ 'el', 'en', 'ru', 'uk' ].includes(locale) ? locale : 'el', autoTranslate: true }); setPriceList((prev)=>prev.map((g)=>g.id === groupId ? { ...g, items: [ ...g.items, item ] } : g)); setNewItem({ name: '', description: '', price: '', unit: '' }); setAddingGroupId(null); } async function handleDeleteItem(itemId, groupId) { await api.deletePriceListItem(itemId); setPriceList((prev)=>prev.map((g)=>g.id === groupId ? { ...g, items: g.items.filter((i)=>i.id !== itemId) } : g)); } useEffect(()=>{ if (cardTab !== 'skills') return; api.getSkillSuggestions(localCategories.length > 0 ? localCategories : undefined).then(setApiSkillSugs).catch(()=>setApiSkillSugs([])); }, [ localCategories, cardTab ]); const lbl = (ru, en, el)=>locale === 'ru' ? ru : locale === 'en' ? en : el; async function saveAll() { setSaving(true); try { const activeLocale = [ 'el', 'en', 'ru', 'uk' ].includes(locale) ? locale : 'el'; const cap = activeLocale.charAt(0).toUpperCase() + activeLocale.slice(1); const descField = "description".concat(cap); const descValue = { el: localDescEl, en: localDescEn, ru: localDescRu, uk: localDescUk }[activeLocale] || null; const updated = await api.updateSpecialistCard(card.id, { title: localTitle, [descField]: descValue, descriptionLocale: activeLocale, autoTranslate: !!descValue, skills: localSkills, categories: localCategories, locations: localLocations, publicationStatus: localPublicationStatus, isActive: localPublicationStatus === 'active' }); onUpdate({ ...updated, portfolio }); setSavedOk(true); setTimeout(()=>setSavedOk(false), 2000); } catch (e) {} finally{ setSaving(false); } } async function updatePublicationStatus(next) { setLocalPublicationStatus(next); try { await api.updateSpecialistCard(card.id, { publicationStatus: next, isActive: next === 'active' }); } catch (e) {} } function addSkill(s) { const trimmed = s.trim(); if (trimmed && !localSkills.includes(trimmed)) setLocalSkills([ ...localSkills, trimmed ]); setSkillInput(''); } function toggleCategory(slug) { let childSlugs = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : []; if (localCategories.includes(slug)) { setLocalCategories(localCategories.filter((c)=>c !== slug && !childSlugs.includes(c))); } else { setLocalCategories([ ...new Set([ ...localCategories, slug, ...childSlugs ]) ]); } } function toggleLocation(slug) { let childSlugs = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : []; if (localLocations.includes(slug)) { setLocalLocations(localLocations.filter((c)=>c !== slug && !childSlugs.includes(c))); } else { setLocalLocations([ ...new Set([ ...localLocations, slug, ...childSlugs ]) ]); } } async function handlePortfolioUpload(e) { var _e_target_files; const file = (_e_target_files = e.target.files) === null || _e_target_files === void 0 ? void 0 : _e_target_files[0]; if (!file) return; setPortfolioUploading(true); try { const form = new FormData(); form.append('file', file); form.append('cardId', card.id); const res = await fetch("".concat(process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000', "/api/portfolio"), { method: 'POST', credentials: 'include', body: form }); if (!res.ok) throw new Error('Upload failed'); const item = await res.json(); const next = [ ...portfolio, item ]; setPortfolio(next); onUpdate({ ...card, portfolio: next }); } catch (e) {} finally{ setPortfolioUploading(false); if (portfolioFileRef.current) portfolioFileRef.current.value = ''; } } async function handlePortfolioDelete(id) { try { await api.deletePortfolioItem(id); const next = portfolio.filter((p)=>p.id !== id); setPortfolio(next); onUpdate({ ...card, portfolio: next }); } catch (e) {} } async function handlePortfolioSave(id) { try { const item = await api.updatePortfolioItem(id, { title: editTitle, description: editDesc }); setPortfolio((prev)=>prev.map((p)=>p.id === id ? item : p)); setEditingItem(null); } catch (e) {} } const cardTabs = [ { id: 'main', label: t('profile.card.tab.main') }, { id: 'categories', label: t('profile.card.tab.categories') }, { id: 'skills', label: t('profile.card.tab.skills') }, { id: 'geography', label: t('profile.card.tab.geography') }, { id: 'pricelist', label: t('profile.card.tab.pricelist'), hidden: !hasPriceList }, { id: 'portfolio', label: t('profile.card.tab.portfolio') } ]; const pendingReviewNotice = localPublicationStatus === 'pending' ? { title: t('profile.card.review_pending', 'Pending approval'), body: t('profile.card.review_pending_hint', 'Your card is being reviewed by the admin team.'), tone: 'amber' } : null; const effectiveModerationNotice = moderationNotice !== null && moderationNotice !== void 0 ? moderationNotice : pendingReviewNotice; return /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 overflow-hidden", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 px-4 py-3 border-b border-gray-100 ".concat(hasVisibilityIssues ? 'bg-amber-50' : ''), children: [ /*#__PURE__*/ _jsxs("button", { type: "button", onClick: onToggle, className: "flex-1 flex items-center gap-3 text-left", children: [ /*#__PURE__*/ _jsx("span", { className: "text-sm font-semibold text-gray-800 flex-1", children: localTitle || card.title }), hasVisibilityIssues && /*#__PURE__*/ _jsx("span", { className: "inline-flex items-center justify-center w-5 h-5 rounded-full bg-amber-500 text-white text-xs font-bold", title: t('profile.card.visibility_issue', 'Card is not shown in offers'), children: "!" }), /*#__PURE__*/ _jsx("span", { className: "text-gray-400 text-xs", children: isOpen ? '▲' : 'â–Œ' }) ] }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>updatePublicationStatus(localPublicationStatus === 'active' ? 'inactive' : localPublicationStatus === 'pending' ? 'inactive' : 'pending'), className: "px-3 py-1.5 rounded-lg text-xs font-medium whitespace-nowrap ".concat(localPublicationStatus === 'active' ? 'bg-red-50 text-red-700 hover:bg-red-100' : localPublicationStatus === 'pending' ? 'bg-amber-50 text-amber-700 hover:bg-amber-100' : 'bg-green-50 text-green-700 hover:bg-green-100'), children: localPublicationStatus === 'active' ? t('profile.card.unpublish', 'Unpublish') : localPublicationStatus === 'pending' ? t('profile.card.withdraw_review', 'Withdraw request') : t('profile.card.submit_review', 'Submit for review') }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: onDelete, className: "text-red-400 hover:text-red-600 text-sm px-1 flex-shrink-0", title: t('profile.card.delete'), children: "\uD83D\uDDD1" }) ] }), isOpen && /*#__PURE__*/ _jsxs("div", { children: [ hasVisibilityIssues && /*#__PURE__*/ _jsxs("div", { className: "mx-4 mt-4 mb-2 rounded-lg border border-amber-300 bg-amber-50 p-3", children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs font-semibold text-amber-900", children: t('profile.card.visibility_issue', 'Card is not shown in offers') }), /*#__PURE__*/ _jsx("ul", { className: "mt-1.5 list-disc pl-4 text-xs text-amber-900 space-y-0.5", children: visibilityIssues.map((issue)=>/*#__PURE__*/ _jsx("li", { children: issue }, issue)) }) ] }), effectiveModerationNotice && /*#__PURE__*/ _jsxs("div", { className: "mx-4 mt-4 mb-2 rounded-lg border p-3 ".concat(effectiveModerationNotice.tone === 'green' ? 'border-green-300 bg-green-50' : effectiveModerationNotice.tone === 'red' ? 'border-red-300 bg-red-50' : 'border-amber-300 bg-amber-50'), children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs font-semibold ".concat(effectiveModerationNotice.tone === 'green' ? 'text-green-900' : effectiveModerationNotice.tone === 'red' ? 'text-red-900' : 'text-amber-900'), children: effectiveModerationNotice.title }), effectiveModerationNotice.body && /*#__PURE__*/ _jsx("p", { className: "mt-1 text-xs ".concat(effectiveModerationNotice.tone === 'green' ? 'text-green-800' : effectiveModerationNotice.tone === 'red' ? 'text-red-800' : 'text-amber-800'), children: effectiveModerationNotice.body }) ] }), /*#__PURE__*/ _jsx("div", { className: "flex overflow-x-auto border-b border-gray-100 bg-gray-50 gap-0", children: cardTabs.filter((t)=>!t.hidden).map((t)=>/*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setCardTab(t.id), className: "px-4 py-2.5 text-xs font-medium whitespace-nowrap border-b-2 transition -mb-px ".concat(cardTab === t.id ? 'border-green-500 text-green-600 bg-white' : 'border-transparent text-gray-500 hover:text-gray-700'), children: t.label }, t.id)) }), /*#__PURE__*/ _jsxs("div", { className: "p-4", children: [ cardTab === 'main' && /*#__PURE__*/ _jsxs("div", { className: "space-y-3", children: [ /*#__PURE__*/ _jsx("input", { value: localTitle, onChange: (e)=>setLocalTitle(e.target.value), maxLength: 200, placeholder: t('profile.cards.new_title'), 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" }), (()=>{ const activeLocale = [ 'el', 'en', 'ru', 'uk' ].includes(locale) ? locale : 'el'; const descMap = { el: [ localDescEl, setLocalDescEl ], en: [ localDescEn, setLocalDescEn ], ru: [ localDescRu, setLocalDescRu ], uk: [ localDescUk, setLocalDescUk ] }; const [val, setVal] = descMap[activeLocale]; const flags = { el: '🇬🇷', en: '🇬🇧', ru: '🇷🇺', uk: '🇺🇊' }; const otherLocales = [ 'el', 'en', 'ru', 'uk' ].filter((l)=>l !== activeLocale); const otherHasContent = otherLocales.some((l)=>descMap[l][0]); return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-1.5 text-xs font-medium text-gray-500 mb-1", children: [ flags[activeLocale], " ", t('profile.card.description', 'Description') ] }), /*#__PURE__*/ _jsx("textarea", { value: val, onChange: (e)=>setVal(e.target.value), rows: 4, maxLength: 2000, placeholder: t('profile.bio.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" }), val && /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-1", children: t('profile.card.desc_auto_translate', 'Will be automatically translated into other languages on save') }), otherHasContent && /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-1.5 mt-1.5", children: [ /*#__PURE__*/ _jsx("span", { className: "text-xs text-gray-400", children: t('profile.card.desc_translated', 'Translations available:') }), otherLocales.map((l)=>/*#__PURE__*/ _jsx("span", { className: "text-xs px-1.5 py-0.5 rounded-full ".concat(descMap[l][0] ? 'bg-green-50 text-green-600' : 'bg-gray-100 text-gray-400'), children: flags[l] }, l)) ] }) ] }); })() ] }), cardTab === 'skills' && /*#__PURE__*/ _jsxs("div", { className: "space-y-3", children: [ localSkills.length > 0 && /*#__PURE__*/ _jsx("div", { className: "flex flex-wrap gap-2", children: localSkills.map((s)=>/*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-1.5 bg-green-50 text-green-700 text-sm px-3 py-1 rounded-full", children: [ s, /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setLocalSkills(localSkills.filter((x)=>x !== s)), className: "text-gray-400 hover:text-green-700 leading-none", children: "\xd7" }) ] }, s)) }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-2", children: [ /*#__PURE__*/ _jsx("input", { value: skillInput, onChange: (e)=>setSkillInput(e.target.value), onKeyDown: (e)=>{ if (e.key === 'Enter') { e.preventDefault(); addSkill(skillInput); } }, placeholder: t('profile.card.skill.add'), 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" }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>addSkill(skillInput), className: "px-3 py-2 bg-gray-100 hover:bg-gray-200 rounded-lg text-sm font-medium", children: "+" }) ] }), apiSkillSugs.length > 0 && /*#__PURE__*/ _jsx("div", { className: "flex flex-wrap gap-1.5", children: apiSkillSugs.map((s)=>{ var _s_names_catLocale; return (_s_names_catLocale = s.names[catLocale]) !== null && _s_names_catLocale !== void 0 ? _s_names_catLocale : s.names.el; }).filter((name, i, arr)=>arr.indexOf(name) === i && !localSkills.includes(name)).slice(0, 16).map((name)=>/*#__PURE__*/ _jsxs("button", { type: "button", onClick: ()=>addSkill(name), className: "text-xs px-2.5 py-1 border border-gray-200 rounded-full text-gray-500 hover:border-green-400 hover:text-green-600 transition", children: [ "+ ", name ] }, name)) }) ] }), cardTab === 'categories' && /*#__PURE__*/ _jsx("div", { className: "space-y-3", children: categories.map((cat)=>{ var _cat_names, _cat_names1; var _cat_names_catLocale, _ref; const catName = (_ref = (_cat_names_catLocale = (_cat_names = cat.names) === null || _cat_names === void 0 ? void 0 : _cat_names[catLocale]) !== null && _cat_names_catLocale !== void 0 ? _cat_names_catLocale : (_cat_names1 = cat.names) === null || _cat_names1 === void 0 ? void 0 : _cat_names1.el) !== null && _ref !== void 0 ? _ref : cat.slug; var _cat_children; const children = (_cat_children = cat.children) !== null && _cat_children !== void 0 ? _cat_children : []; const childSlugs = children.map((c)=>c.slug); return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-2.5 cursor-pointer", children: [ /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: localCategories.includes(cat.slug), onChange: ()=>toggleCategory(cat.slug, childSlugs), className: "w-4 h-4 rounded border-gray-300 text-green-600 focus:ring-blue-400" }), /*#__PURE__*/ _jsxs("span", { className: "text-sm font-medium text-gray-800 inline-flex items-center gap-1", children: [ cat.icon && /*#__PURE__*/ _jsx(CategoryIcon, { icon: cat.icon, alt: catName, className: isCategoryIconUrl(cat.icon) ? 'h-4 w-4 object-contain' : 'text-sm leading-none', fallback: "\uD83D\uDCE6" }), catName ] }) ] }), children.length > 0 && /*#__PURE__*/ _jsx("div", { className: "ml-6 mt-2 space-y-2", children: children.map((sub)=>{ var _sub_names, _sub_names1; var _sub_names_catLocale, _ref; const subName = (_ref = (_sub_names_catLocale = (_sub_names = sub.names) === null || _sub_names === void 0 ? void 0 : _sub_names[catLocale]) !== null && _sub_names_catLocale !== void 0 ? _sub_names_catLocale : (_sub_names1 = sub.names) === null || _sub_names1 === void 0 ? void 0 : _sub_names1.el) !== null && _ref !== void 0 ? _ref : sub.slug; return /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-2.5 cursor-pointer", children: [ /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: localCategories.includes(sub.slug), onChange: ()=>toggleCategory(sub.slug), className: "w-4 h-4 rounded border-gray-300 text-green-600 focus:ring-blue-400" }), /*#__PURE__*/ _jsx("span", { className: "text-sm text-gray-600", children: subName }) ] }, sub.id); }) }) ] }, cat.id); }) }), cardTab === 'geography' && /*#__PURE__*/ _jsx("div", { className: "space-y-3", children: locationTree.map((city)=>{ var _city_names, _city_names1; var _city_names_catLocale, _ref; const cityName = (_ref = (_city_names_catLocale = (_city_names = city.names) === null || _city_names === void 0 ? void 0 : _city_names[catLocale]) !== null && _city_names_catLocale !== void 0 ? _city_names_catLocale : (_city_names1 = city.names) === null || _city_names1 === void 0 ? void 0 : _city_names1.el) !== null && _ref !== void 0 ? _ref : city.slug; var _city_children; const districts = (_city_children = city.children) !== null && _city_children !== void 0 ? _city_children : []; const districtSlugs = districts.map((d)=>d.slug); return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-2.5 cursor-pointer", children: [ /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: localLocations.includes(city.slug), onChange: ()=>toggleLocation(city.slug, districtSlugs), className: "w-4 h-4 rounded border-gray-300 text-green-600 focus:ring-blue-400" }), /*#__PURE__*/ _jsx("span", { className: "text-sm font-medium text-gray-800", children: cityName }) ] }), districts.length > 0 && /*#__PURE__*/ _jsx("div", { className: "ml-6 mt-2 space-y-2", children: districts.map((d)=>{ var _d_names, _d_names1; var _d_names_catLocale, _ref; const dName = (_ref = (_d_names_catLocale = (_d_names = d.names) === null || _d_names === void 0 ? void 0 : _d_names[catLocale]) !== null && _d_names_catLocale !== void 0 ? _d_names_catLocale : (_d_names1 = d.names) === null || _d_names1 === void 0 ? void 0 : _d_names1.el) !== null && _ref !== void 0 ? _ref : d.slug; return /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-2.5 cursor-pointer", children: [ /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: localLocations.includes(d.slug), onChange: ()=>toggleLocation(d.slug), className: "w-4 h-4 rounded border-gray-300 text-green-600 focus:ring-blue-400" }), /*#__PURE__*/ _jsx("span", { className: "text-sm text-gray-600", children: dName }) ] }, d.id); }) }) ] }, city.id); }) }), cardTab === 'pricelist' && /*#__PURE__*/ _jsx("div", { className: "space-y-4", children: priceListLoading ? /*#__PURE__*/ _jsx("div", { className: "text-center py-6 text-gray-400 text-sm", children: t('common.loading', 'Loading...') }) : /*#__PURE__*/ _jsxs(_Fragment, { children: [ priceList.length === 0 && /*#__PURE__*/ _jsx("div", { className: "text-center py-6 text-gray-400 text-sm border-2 border-dashed border-gray-200 rounded-xl", children: t('profile.card.pricelist.empty') }), priceList.map((group)=>/*#__PURE__*/ _jsxs("div", { className: "border border-gray-200 rounded-xl overflow-hidden", children: [ /*#__PURE__*/ _jsx("div", { className: "flex items-center gap-2 bg-gray-50 px-4 py-2.5 border-b border-gray-200", children: editingGroupId === group.id ? /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx("input", { value: editGroupTitle, onChange: (e)=>setEditGroupTitle(e.target.value), className: "flex-1 border border-gray-300 rounded-lg px-3 py-1.5 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400", onKeyDown: (e)=>{ if (e.key === 'Enter') handleSaveGroupTitle(group.id); }, autoFocus: true }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>handleSaveGroupTitle(group.id), className: "px-3 py-1.5 bg-green-600 text-white rounded-lg text-xs font-medium hover:bg-green-700", children: t('profile.card.pricelist.save_group') }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setEditingGroupId(null), className: "px-2 py-1.5 text-gray-500 hover:text-gray-700 text-xs", children: "✕" }) ] }) : /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx("span", { className: "flex-1 font-semibold text-sm text-gray-800", children: group.title }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>{ setEditingGroupId(group.id); setEditGroupTitle(group.title); }, className: "text-gray-400 hover:text-green-600 text-xs px-2 py-1 rounded hover:bg-green-50", children: "✏" }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>handleDeleteGroup(group.id), className: "text-gray-400 hover:text-red-500 text-xs px-2 py-1 rounded hover:bg-red-50", children: t('profile.card.pricelist.delete_group') }) ] }) }), /*#__PURE__*/ _jsx("div", { className: "divide-y divide-gray-100", children: group.items.map((item)=>/*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 px-4 py-2.5 text-sm group", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ _jsx("p", { className: "font-medium text-gray-800 truncate", children: item.name }), item.description && /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-500 truncate", children: item.description }) ] }), (item.price || item.unit) && /*#__PURE__*/ _jsxs("span", { className: "text-green-700 font-semibold text-sm whitespace-nowrap", children: [ item.price ? "€".concat(item.price) : '', item.unit ? " ".concat(item.unit) : '' ] }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>handleDeleteItem(item.id, group.id), className: "opacity-0 group-hover:opacity-100 text-red-400 hover:text-red-600 text-xs px-1 transition", children: t('profile.card.pricelist.delete_item') }) ] }, item.id)) }), addingGroupId === group.id ? /*#__PURE__*/ _jsxs("div", { className: "p-3 bg-green-50 border-t border-green-100 space-y-2", children: [ /*#__PURE__*/ _jsx("input", { placeholder: t('profile.card.pricelist.item_name'), value: newItem.name, onChange: (e)=>setNewItem((p)=>({ ...p, name: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }), /*#__PURE__*/ _jsx("input", { placeholder: t('profile.card.pricelist.item_desc'), value: newItem.description, onChange: (e)=>setNewItem((p)=>({ ...p, description: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-2", children: [ /*#__PURE__*/ _jsx("input", { placeholder: t('profile.card.pricelist.item_price'), value: newItem.price, onChange: (e)=>setNewItem((p)=>({ ...p, price: e.target.value })), className: "w-28 border border-gray-300 rounded-lg px-3 py-1.5 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }), /*#__PURE__*/ _jsx("input", { placeholder: t('profile.card.pricelist.item_unit'), value: newItem.unit, onChange: (e)=>setNewItem((p)=>({ ...p, unit: e.target.value })), className: "flex-1 border border-gray-300 rounded-lg px-3 py-1.5 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-2", children: [ /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>handleAddItem(group.id), className: "px-4 py-1.5 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700", children: t('profile.card.pricelist.save_item') }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>{ setAddingGroupId(null); setNewItem({ name: '', description: '', price: '', unit: '' }); }, className: "px-3 py-1.5 text-gray-500 hover:text-gray-700 text-sm", children: "✕" }) ] }) ] }) : /*#__PURE__*/ _jsx("div", { className: "px-4 py-2 border-t border-gray-100", children: /*#__PURE__*/ _jsxs("button", { type: "button", onClick: ()=>setAddingGroupId(group.id), className: "text-green-600 hover:text-gray-800 text-sm font-medium", children: [ "+ ", t('profile.card.pricelist.add_item') ] }) }) ] }, group.id)), /*#__PURE__*/ _jsxs("div", { className: "flex gap-2 pt-1", children: [ /*#__PURE__*/ _jsx("input", { placeholder: t('profile.card.pricelist.group_title'), value: newGroupTitle, onChange: (e)=>setNewGroupTitle(e.target.value), onKeyDown: (e)=>{ if (e.key === 'Enter') handleAddGroup(); }, 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" }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: handleAddGroup, className: "px-4 py-2 bg-green-600 hover:bg-green-700 text-white rounded-lg text-sm font-medium", children: t('profile.card.pricelist.add_group') }) ] }) ] }) }), cardTab === 'portfolio' && /*#__PURE__*/ _jsxs("div", { className: "space-y-3", children: [ portfolio.length < 20 && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>{ var _portfolioFileRef_current; return (_portfolioFileRef_current = portfolioFileRef.current) === null || _portfolioFileRef_current === void 0 ? void 0 : _portfolioFileRef_current.click(); }, disabled: portfolioUploading, className: "flex items-center gap-2 px-4 py-2 bg-green-600 hover:bg-green-700 text-white rounded-lg text-sm font-medium disabled:opacity-50", children: portfolioUploading ? /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx("span", { className: "w-4 h-4 border-2 border-white border-t-transparent rounded-full animate-spin" }), t('profile.card.photo.uploading') ] }) : /*#__PURE__*/ _jsxs(_Fragment, { children: [ "\uD83D\uDCF7 ", t('profile.card.photo.add') ] }) }), /*#__PURE__*/ _jsx("input", { ref: portfolioFileRef, type: "file", accept: "image/jpeg,image/png,image/webp", className: "hidden", onChange: handlePortfolioUpload }) ] }), portfolio.length === 0 ? /*#__PURE__*/ _jsx("div", { className: "text-center py-8 text-gray-400 text-sm border-2 border-dashed border-gray-200 rounded-xl", children: t('profile.card.photo.empty') }) : /*#__PURE__*/ _jsx("div", { className: "grid grid-cols-2 sm:grid-cols-3 gap-3", children: portfolio.map((item)=>{ var _item_title; return /*#__PURE__*/ _jsxs("div", { className: "group relative rounded-xl overflow-hidden border border-gray-200 bg-gray-50", children: [ /*#__PURE__*/ _jsx("img", { src: item.imageUrl, alt: (_item_title = item.title) !== null && _item_title !== void 0 ? _item_title : '', className: "w-full aspect-square object-cover" }), /*#__PURE__*/ _jsxs("div", { className: "absolute inset-0 bg-black/0 group-hover:bg-black/50 transition-all flex flex-col justify-between p-2", children: [ /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>handlePortfolioDelete(item.id), className: "self-end opacity-0 group-hover:opacity-100 transition w-7 h-7 rounded-full bg-red-500 text-white text-sm flex items-center justify-center hover:bg-red-600", children: "\xd7" }), /*#__PURE__*/ _jsxs("button", { type: "button", onClick: ()=>{ setEditingItem(item); var _item_title; setEditTitle((_item_title = item.title) !== null && _item_title !== void 0 ? _item_title : ''); var _item_description; setEditDesc((_item_description = item.description) !== null && _item_description !== void 0 ? _item_description : ''); }, className: "opacity-0 group-hover:opacity-100 transition text-xs text-white bg-black/50 hover:bg-black/70 rounded-lg px-2 py-1", children: [ "✏ ", t('profile.card.item.edit') ] }) ] }), item.title && /*#__PURE__*/ _jsx("div", { className: "px-2 py-1.5", children: /*#__PURE__*/ _jsx("p", { className: "text-xs font-medium text-gray-700 truncate", children: item.title }) }) ] }, item.id); }) }) ] }), cardTab !== 'portfolio' && cardTab !== 'pricelist' && /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 mt-4 pt-4 border-t border-gray-100", children: [ /*#__PURE__*/ _jsx("button", { type: "button", disabled: saving, onClick: saveAll, className: "px-5 py-2 bg-green-600 hover:bg-green-700 text-white rounded-lg text-sm font-semibold disabled:opacity-50", children: saving ? '...' : t('profile.card.save') }), savedOk && /*#__PURE__*/ _jsxs("span", { className: "text-sm text-green-600", children: [ "✓ ", t('profile.card.saved') ] }) ] }) ] }) ] }), editingItem && /*#__PURE__*/ _jsx("div", { className: "fixed inset-0 z-50 flex items-center justify-center bg-black/50 px-4", children: /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-2xl shadow-xl p-6 w-full max-w-md", children: [ /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-gray-800 mb-4", children: t('profile.card.item.edit') }), /*#__PURE__*/ _jsx("img", { src: editingItem.imageUrl, alt: "", className: "w-full h-40 object-cover rounded-xl mb-4" }), /*#__PURE__*/ _jsxs("div", { className: "space-y-3", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('profile.card.item.title') }), /*#__PURE__*/ _jsx("input", { value: editTitle, onChange: (e)=>setEditTitle(e.target.value), maxLength: 200, 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" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('profile.card.item.desc') }), /*#__PURE__*/ _jsx("textarea", { value: editDesc, onChange: (e)=>setEditDesc(e.target.value), rows: 3, maxLength: 1000, 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" }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-3 mt-5", children: [ /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>handlePortfolioSave(editingItem.id), className: "flex-1 bg-green-600 hover:bg-green-700 text-white py-2 rounded-lg text-sm font-medium", children: t('profile.card.item.save') }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setEditingItem(null), className: "flex-1 bg-gray-100 hover:bg-gray-200 text-gray-700 py-2 rounded-lg text-sm font-medium", children: t('profile.card.item.cancel') }) ] }) ] }) }) ] }); } // ─── AutoResponseTab ─────────────────────────────────────────────────────── function AutoResponseTab(param) { let { categories, locationTree, loaded, onLoad, settings, saving, saved, onSave, t, catLocale } = param; const { useEffect: _ue, useState: _us } = { useEffect, useState }; const [enabled, setEnabled] = _us(false); const [minBudget, setMinBudget] = _us(''); const [maxBudget, setMaxBudget] = _us(''); const [defaultPrice, setDefaultPrice] = _us(''); const [defaultMessage, setDefaultMessage] = _us(''); const [maxPerDay, setMaxPerDay] = _us(''); const [selCategories, setSelCategories] = _us([]); const [selLocations, setSelLocations] = _us([]); _ue(()=>{ onLoad(); }, []); _ue(()=>{ if (!settings) return; setEnabled(settings.enabled); setMinBudget(settings.minBudget != null ? String(settings.minBudget) : ''); setMaxBudget(settings.maxBudget != null ? String(settings.maxBudget) : ''); setDefaultPrice(settings.defaultPrice != null ? String(settings.defaultPrice) : ''); var _settings_defaultMessage; setDefaultMessage((_settings_defaultMessage = settings.defaultMessage) !== null && _settings_defaultMessage !== void 0 ? _settings_defaultMessage : ''); setMaxPerDay(settings.maxAutoOffersPerDay != null ? String(settings.maxAutoOffersPerDay) : ''); var _settings_categories; setSelCategories((_settings_categories = settings.categories) !== null && _settings_categories !== void 0 ? _settings_categories : []); var _settings_locations; setSelLocations((_settings_locations = settings.locations) !== null && _settings_locations !== void 0 ? _settings_locations : []); }, [ settings ]); if (!loaded) return /*#__PURE__*/ _jsx("div", { className: "text-center py-10 text-white/60", children: t('common.loading') }); const flatLocations = []; function flatten(nodes) { for (const n of nodes){ var _n_children; flatLocations.push({ id: n.id, name: n.name }); if ((_n_children = n.children) === null || _n_children === void 0 ? void 0 : _n_children.length) flatten(n.children); } } flatten(locationTree); return /*#__PURE__*/ _jsxs("div", { className: "space-y-4", children: [ /*#__PURE__*/ _jsx("div", { className: "bg-white rounded-xl border border-gray-200 p-5", children: /*#__PURE__*/ _jsxs("label", { className: "flex items-center justify-between cursor-pointer", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "font-medium text-gray-800", children: t('auto_response.title', 'Auto response') }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-0.5", children: t('auto_response.desc', 'Automatically respond to matching tasks') }) ] }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setEnabled((v)=>!v), className: "relative inline-flex h-6 w-11 items-center rounded-full transition-colors ".concat(enabled ? 'bg-green-500' : 'bg-gray-300'), children: /*#__PURE__*/ _jsx("span", { className: "inline-block h-4 w-4 transform rounded-full bg-white shadow transition-transform ".concat(enabled ? 'translate-x-6' : 'translate-x-1') }) }) ] }) }), /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-5 space-y-4", children: [ /*#__PURE__*/ _jsx("h3", { className: "font-medium text-gray-800 text-sm", children: t('auto_response.budget_range', 'Task budget') }), /*#__PURE__*/ _jsxs("div", { className: "grid grid-cols-2 gap-3", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs text-gray-500 mb-1", children: t('auto_response.min_budget', 'Min €') }), /*#__PURE__*/ _jsx("input", { type: "number", min: "0", value: minBudget, onChange: (e)=>setMinBudget(e.target.value), placeholder: "0", 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" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs text-gray-500 mb-1", children: t('auto_response.max_budget', 'Max €') }), /*#__PURE__*/ _jsx("input", { type: "number", min: "0", value: maxBudget, onChange: (e)=>setMaxBudget(e.target.value), placeholder: "∞", className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs text-gray-500 mb-1", children: t('auto_response.default_price', 'Default price €') }), /*#__PURE__*/ _jsx("input", { type: "number", min: "0", value: defaultPrice, onChange: (e)=>setDefaultPrice(e.target.value), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs text-gray-500 mb-1", children: t('auto_response.max_per_day', 'Max auto-offers/day') }), /*#__PURE__*/ _jsx("input", { type: "number", min: "1", max: "50", value: maxPerDay, onChange: (e)=>setMaxPerDay(e.target.value), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-5", children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs text-gray-500 mb-1", children: t('auto_response.default_message', 'Auto-response text') }), /*#__PURE__*/ _jsx("textarea", { value: defaultMessage, onChange: (e)=>setDefaultMessage(e.target.value), rows: 4, maxLength: 2000, placeholder: t('auto_response.message_placeholder', 'Hello! I can help with this task...'), 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" }) ] }), categories.length > 0 && /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-5", children: [ /*#__PURE__*/ _jsx("h3", { className: "font-medium text-gray-800 text-sm mb-3", children: t('auto_response.categories', 'Task categories') }), /*#__PURE__*/ _jsx("div", { className: "flex flex-wrap gap-2 max-h-40 overflow-y-auto", children: categories.flatMap((cat)=>{ var _cat_children; return [ cat, ...(_cat_children = cat.children) !== null && _cat_children !== void 0 ? _cat_children : [] ]; }).map((cat)=>{ var _cat_names, _cat_names1; var _cat_names_catLocale, _ref; const name = (_ref = (_cat_names_catLocale = (_cat_names = cat.names) === null || _cat_names === void 0 ? void 0 : _cat_names[catLocale]) !== null && _cat_names_catLocale !== void 0 ? _cat_names_catLocale : (_cat_names1 = cat.names) === null || _cat_names1 === void 0 ? void 0 : _cat_names1.el) !== null && _ref !== void 0 ? _ref : cat.slug; const sel = selCategories.includes(cat.slug); return /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setSelCategories(sel ? selCategories.filter((c)=>c !== cat.slug) : [ ...selCategories, cat.slug ]), className: "px-3 py-1.5 rounded-lg text-xs border transition ".concat(sel ? 'bg-green-600 border-green-600 text-white' : 'bg-white border-gray-300 text-gray-700 hover:border-green-400'), children: name }, cat.slug); }) }) ] }), /*#__PURE__*/ _jsx("button", { type: "button", disabled: saving, onClick: ()=>onSave({ enabled, minBudget: minBudget ? Number(minBudget) : null, maxBudget: maxBudget ? Number(maxBudget) : null, defaultPrice: defaultPrice ? Number(defaultPrice) : null, defaultMessage: defaultMessage || null, maxAutoOffersPerDay: maxPerDay ? Number(maxPerDay) : null, categories: selCategories.length > 0 ? selCategories : null, locations: selLocations.length > 0 ? selLocations : null }), className: "w-full bg-green-600 text-white py-3 rounded-xl font-semibold hover:bg-green-700 disabled:opacity-50", children: saving ? t('common.loading') : saved ? t('auto_response.saved', 'Saved ✓') : t('common.save') }) ] }); } export default function ProfilePage() { return /*#__PURE__*/ _jsx(Suspense, { fallback: null, children: /*#__PURE__*/ _jsx(ProfilePageInner, {}) }); } function ProfilePageInner() { var _user_firstName, _user_lastName, _dashData_features, _dashData_features1, _dashData_features2, _user_plan, _user_plan1, _user_plan2, _dashData_features3, _dashData_features4, _dashData_plan, _dashData_plan1, _user_plan3; const router = useRouter(); const searchParams = useSearchParams(); const { data: session, isPending } = useSession(); const { t, locale } = useLocale(); const validTabs = [ 'info', 'finance', 'cards', 'notifications', 'reviews', 'referral', 'auto_response', 'site' ]; var _searchParams_get; const initialTab = (_searchParams_get = searchParams.get('tab')) !== null && _searchParams_get !== void 0 ? _searchParams_get : 'info'; const [activeTab, setActiveTab] = useState(validTabs.includes(initialTab) ? initialTab : 'info'); const [user, setUser] = useState(null); const [loading, setLoading] = useState(true); const [saving, setSaving] = useState(false); const [saved, setSaved] = useState(false); const [error, setError] = useState(''); const [formData, setFormData] = useState({ firstName: '', lastName: '', phone: '', bio: '', locale: 'el' }); const [selectedLanguages, setSelectedLanguages] = useState([]); // Specialist cards const [cards, setCards] = useState([]); const [maxCards, setMaxCards] = useState(1); const [cardsLoading, setCardsLoading] = useState(false); const [cardNotifications, setCardNotifications] = useState([]); const [openCardId, setOpenCardId] = useState(null); const [creatingCard, setCreatingCard] = useState(false); const [newCardTitle, setNewCardTitle] = useState(''); const [showNewCardForm, setShowNewCardForm] = useState(false); const [showUpgradeModal, setShowUpgradeModal] = useState(false); // Reference data const [categories, setCategories] = useState([]); const [locationTree, setLocationTree] = useState([]); // Become specialist const [becomingSpecialist, setBecomingSpecialist] = useState(false); const [avatarUploading, setAvatarUploading] = useState(false); const [backgroundUploading, setBackgroundUploading] = useState(false); const fileRef = useRef(null); const backgroundFileRef = useRef(null); // Notification preferences const [notifyNewTasks, setNotifyNewTasks] = useState(false); const [notifMessages, setNotifMessages] = useState(true); const [notifySaving, setNotifySaving] = useState(false); const [notifySaved, setNotifySaved] = useState(false); // Email verification resend const [resendState, setResendState] = useState('idle'); // Referral info const [referralCode, setReferralCode] = useState(null); const [referralCount, setReferralCount] = useState(0); const [referralCopied, setReferralCopied] = useState(false); const [referralLoaded, setReferralLoaded] = useState(false); // Balance top-up modal const [showTopUpModal, setShowTopUpModal] = useState(false); const [topUpAmount, setTopUpAmount] = useState(10); const [topUpLoading, setTopUpLoading] = useState(false); const [topUpError, setTopUpError] = useState(''); const [balanceHistory, setBalanceHistory] = useState([]); const [planHistory, setPlanHistory] = useState([]); // Plan data + statuses const [dashData, setDashData] = useState(null); const [myStatuses, setMyStatuses] = useState([]); const [statusToggling, setStatusToggling] = useState(null); const [personalSiteSlug, setPersonalSiteSlug] = useState(''); const [slugSaving, setSlugSaving] = useState(false); const [slugSaved, setSlugSaved] = useState(false); const [slugCopied, setSlugCopied] = useState(false); const [slugError, setSlugError] = useState(''); const [showContactInfo, setShowContactInfo] = useState(false); const [siteSettings, setSiteSettings] = useState({}); const [siteSettingsSaving, setSiteSettingsSaving] = useState(false); const [siteStats, setSiteStats] = useState(null); const [siteStatsLoading, setSiteStatsLoading] = useState(false); const [autoResponse, setAutoResponse] = useState(null); const [arLoaded, setArLoaded] = useState(false); const [arSaving, setArSaving] = useState(false); const [arSaved, setArSaved] = useState(false); async function handleTopUp() { const amount = Number(topUpAmount); if (!amount || amount < 1) return; setTopUpLoading(true); setTopUpError(''); try { const { url, params } = await api.initiateTopUp(amount); // Build and auto-submit form to ePay const form = document.createElement('form'); form.method = 'POST'; form.action = url; Object.entries(params).forEach((param)=>{ let [k, v] = param; const input = document.createElement('input'); input.type = 'hidden'; input.name = k; input.value = v; form.appendChild(input); }); document.body.appendChild(form); form.submit(); } catch (e) { setTopUpError((e === null || e === void 0 ? void 0 : e.message) || t('profile.balance.topup.error')); setTopUpLoading(false); } } async function handleResendVerification() { if (!(user === null || user === void 0 ? void 0 : user.email) || resendState !== 'idle') return; setResendState('sending'); const callbackURL = "".concat(window.location.origin, "/profile"); const result = await authClient.sendVerificationEmail({ email: user.email, callbackURL }); if (result === null || result === void 0 ? void 0 : result.error) { setResendState('idle'); } else { setResendState('sent'); } } useEffect(()=>{ if (activeTab !== 'referral' || referralLoaded) return; api.getMyReferralInfo().then((r)=>{ setReferralCode(r.referralCode); setReferralCount(r.referralCount); }).catch(()=>{}).finally(()=>setReferralLoaded(true)); }, [ activeTab ]); // Reviews const [myReviews, setMyReviews] = useState(null); const [reviewsLoading, setReviewsLoading] = useState(false); const [myRating, setMyRating] = useState(null); useEffect(()=>{ if (activeTab !== 'reviews' || myReviews !== null || reviewsLoading) return; setReviewsLoading(true); api.getMyReviews().then(setMyReviews).catch(()=>setMyReviews([])).finally(()=>setReviewsLoading(false)); }, [ activeTab ]); useEffect(()=>{ if (activeTab !== 'site' || siteStats !== null || siteStatsLoading) return; setSiteStatsLoading(true); api.getSiteStats().then((res)=>setSiteStats(res.days)).catch(()=>setSiteStats([])).finally(()=>setSiteStatsLoading(false)); }, [ activeTab ]); useEffect(()=>{ if (!isPending && !session) router.push('/login'); }, [ session, isPending ]); useEffect(()=>{ if (!session) return; Promise.all([ api.request('/users/me'), api.getCategories(), api.getLocations(), api.getMyDashboard().catch(()=>null), api.getMyStatuses().catch(()=>[]), api.getBalanceHistory(8).catch(()=>[]), api.getPlanHistory(20).catch(()=>[]) ]).then((param)=>{ let [u, cats, locs, dash, statusRes, history, phist] = param; setUser(u); var _u_firstName, _u_lastName, _u_phone, _u_bio, _u_locale; setFormData({ firstName: (_u_firstName = u.firstName) !== null && _u_firstName !== void 0 ? _u_firstName : '', lastName: (_u_lastName = u.lastName) !== null && _u_lastName !== void 0 ? _u_lastName : '', phone: (_u_phone = u.phone) !== null && _u_phone !== void 0 ? _u_phone : '', bio: (_u_bio = u.bio) !== null && _u_bio !== void 0 ? _u_bio : '', locale: (_u_locale = u.locale) !== null && _u_locale !== void 0 ? _u_locale : 'el' }); var _u_languages; setSelectedLanguages((_u_languages = u.languages) !== null && _u_languages !== void 0 ? _u_languages : []); var _u_notifyNewTasks; setNotifyNewTasks((_u_notifyNewTasks = u.notifyNewTasks) !== null && _u_notifyNewTasks !== void 0 ? _u_notifyNewTasks : false); var _u_notifMessages; setNotifMessages((_u_notifMessages = u.notifMessages) !== null && _u_notifMessages !== void 0 ? _u_notifMessages : true); setCategories(cats); setLocationTree(locs); setDashData(dash); setMyStatuses((statusRes !== null && statusRes !== void 0 ? statusRes : []).filter((s)=>s.isActive).map((s)=>s.statusType)); setBalanceHistory(history); setPlanHistory(phist); var _u_personalSiteSlug; setPersonalSiteSlug((_u_personalSiteSlug = u.personalSiteSlug) !== null && _u_personalSiteSlug !== void 0 ? _u_personalSiteSlug : ''); var _u_showContactInfo; setShowContactInfo((_u_showContactInfo = u.showContactInfo) !== null && _u_showContactInfo !== void 0 ? _u_showContactInfo : false); var _u_siteSettings; setSiteSettings((_u_siteSettings = u.siteSettings) !== null && _u_siteSettings !== void 0 ? _u_siteSettings : {}); loadCards(); api.getUserRating(u.id).then((r)=>setMyRating(r.avg)).catch(()=>{}); }).catch(()=>{}).finally(()=>setLoading(false)); }, [ session ]); async function loadCards() { setCardsLoading(true); try { const { cards: c, maxCards: m } = await api.getMySpecialistCards(); setCards(c); setMaxCards(m); setOpenCardId((prev)=>{ var _c_; var _c__id; return prev && c.some((card)=>card.id === prev) ? prev : (_c__id = (_c_ = c[0]) === null || _c_ === void 0 ? void 0 : _c_.id) !== null && _c__id !== void 0 ? _c__id : null; }); api.getNotifications().then((rows)=>setCardNotifications(rows.filter((row)=>[ 'specialist_card_submitted', 'specialist_card_approved', 'specialist_card_rejected' ].includes(row.type)))).catch(()=>setCardNotifications([])); } catch (e) {} finally{ setCardsLoading(false); } } async function handleSubmit(e) { e.preventDefault(); setError(''); setSaving(true); try { const updated = await api.request('/users/me', { method: 'PATCH', body: JSON.stringify({ firstName: formData.firstName, lastName: formData.lastName, phone: formData.phone || undefined, bio: formData.bio || undefined, bioLocale: formData.locale, autoTranslateBio: true, locale: formData.locale, languages: selectedLanguages, showContactInfo }) }); setUser(updated); setSaved(true); setTimeout(()=>setSaved(false), 2500); } catch (err) { setError(err.message || t('common.error')); } finally{ setSaving(false); } } async function handleBecomeSpecialist() { setBecomingSpecialist(true); setError(''); try { const updated = await api.request('/users/me/become-specialist', { method: 'POST' }); setUser(updated); setActiveTab('cards'); loadCards(); } catch (err) { setError(err.message || t('common.error')); } finally{ setBecomingSpecialist(false); } } async function handleSaveSiteSlug() { setSlugSaving(true); setSlugError(''); try { const updated = await api.request('/users/me', { method: 'PATCH', body: JSON.stringify({ personalSiteSlug: personalSiteSlug || null }) }); setUser(updated); var _updated_personalSiteSlug; setPersonalSiteSlug((_updated_personalSiteSlug = updated.personalSiteSlug) !== null && _updated_personalSiteSlug !== void 0 ? _updated_personalSiteSlug : ''); setSlugSaved(true); setTimeout(()=>setSlugSaved(false), 2500); } catch (err) { var _err_code; const code = (_err_code = err === null || err === void 0 ? void 0 : err.code) !== null && _err_code !== void 0 ? _err_code : ''; if (code === 'SLUG_TAKEN' || err.message === 'This URL is already taken') { setSlugError(t('profile.site.slug_taken', 'This address is already taken')); } else { setSlugError(err.message || t('common.error')); } } finally{ setSlugSaving(false); } } async function handleSaveSiteSettings(newSettings) { setSiteSettings(newSettings); setSiteSettingsSaving(true); try { await api.request('/users/me', { method: 'PATCH', body: JSON.stringify({ siteSettings: newSettings }) }); } catch (e) {} finally{ setSiteSettingsSaving(false); } } async function handleAvatarChange(e) { var _e_target_files; const file = (_e_target_files = e.target.files) === null || _e_target_files === void 0 ? void 0 : _e_target_files[0]; if (!file) return; setAvatarUploading(true); try { const form = new FormData(); form.append('file', file); const res = await fetch("".concat(process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000', "/api/uploads"), { method: 'POST', credentials: 'include', body: form }); if (!res.ok) throw new Error('Upload failed'); const { url } = await res.json(); const fullUrl = "".concat(process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000').concat(url); await api.request('/users/me', { method: 'PATCH', body: JSON.stringify({ image: fullUrl }) }); setUser((prev)=>({ ...prev, image: fullUrl })); } catch (e) { setError(t('profile.upload.error')); } finally{ setAvatarUploading(false); } } async function handleBackgroundChange(e) { var _e_target_files; const file = (_e_target_files = e.target.files) === null || _e_target_files === void 0 ? void 0 : _e_target_files[0]; if (!file) return; setBackgroundUploading(true); try { const form = new FormData(); form.append('file', file); const res = await fetch("".concat(process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000', "/api/uploads"), { method: 'POST', credentials: 'include', body: form }); if (!res.ok) throw new Error('Upload failed'); const { url } = await res.json(); const fullUrl = "".concat(process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000').concat(url); const nextSettings = { ...siteSettings, profileBackgroundImage: fullUrl }; await api.request('/users/me', { method: 'PATCH', body: JSON.stringify({ siteSettings: nextSettings }) }); setSiteSettings(nextSettings); setSaved(true); setTimeout(()=>setSaved(false), 2500); } catch (e) { setError(t('profile.upload.error')); } finally{ setBackgroundUploading(false); if (backgroundFileRef.current) backgroundFileRef.current.value = ''; } } async function handleRemoveBackground() { setBackgroundUploading(true); try { const nextSettings = { ...siteSettings, profileBackgroundImage: null }; await api.request('/users/me', { method: 'PATCH', body: JSON.stringify({ siteSettings: nextSettings }) }); setSiteSettings(nextSettings); setSaved(true); setTimeout(()=>setSaved(false), 2500); } catch (e) { setError(t('profile.upload.error')); } finally{ setBackgroundUploading(false); } } async function handleCreateCard() { if (!newCardTitle.trim()) return; setCreatingCard(true); try { const card = await api.createSpecialistCard({ title: newCardTitle.trim() }); setCards((prev)=>[ ...prev, card ]); setOpenCardId(card.id); setNewCardTitle(''); setShowNewCardForm(false); } catch (err) { setError(err.message || t('common.error')); } finally{ setCreatingCard(false); } } async function handleDeleteCard(id) { if (!confirm(t('profile.cards.delete_confirm'))) return; try { await api.deleteSpecialistCard(id); setCards((prev)=>{ var _next_; const next = prev.filter((c)=>c.id !== id); var _next__id; if (openCardId === id) setOpenCardId((_next__id = (_next_ = next[0]) === null || _next_ === void 0 ? void 0 : _next_.id) !== null && _next__id !== void 0 ? _next__id : null); return next; }); } catch (err) { setError(err.message || t('common.error')); } } if (isPending || loading) { return /*#__PURE__*/ _jsx("div", { className: "text-center py-20 text-white", children: t('common.loading') }); } const catLocale = locale === 'en' ? 'en' : locale === 'ru' ? 'ru' : locale === 'uk' ? 'uk' : 'el'; const dateLocale = locale === 'en' ? 'en-US' : locale === 'ru' ? 'ru-RU' : 'el-GR'; const isSpecialist = (user === null || user === void 0 ? void 0 : user.role) === 'specialist'; const isAdmin = (user === null || user === void 0 ? void 0 : user.role) === 'admin'; const showSpecialistTabs = isSpecialist || isAdmin; var _user_firstName_, _user_lastName_; const initials = user ? "".concat((_user_firstName_ = (_user_firstName = user.firstName) === null || _user_firstName === void 0 ? void 0 : _user_firstName[0]) !== null && _user_firstName_ !== void 0 ? _user_firstName_ : '').concat((_user_lastName_ = (_user_lastName = user.lastName) === null || _user_lastName === void 0 ? void 0 : _user_lastName[0]) !== null && _user_lastName_ !== void 0 ? _user_lastName_ : '').toUpperCase() : '?'; const hasAutoResponse = !!(dashData === null || dashData === void 0 ? void 0 : (_dashData_features = dashData.features) === null || _dashData_features === void 0 ? void 0 : _dashData_features.hasAutoResponse); var _formData_bio, _ref; const profileBio = String((_ref = (_formData_bio = formData.bio) !== null && _formData_bio !== void 0 ? _formData_bio : user === null || user === void 0 ? void 0 : user.bio) !== null && _ref !== void 0 ? _ref : '').trim(); const publishedCards = cards.filter((c)=>{ var _c_publicationStatus; return ((_c_publicationStatus = c.publicationStatus) !== null && _c_publicationStatus !== void 0 ? _c_publicationStatus : c.isActive ? 'active' : 'inactive') === 'active'; }); const hasPublishedCard = publishedCards.length > 0; const hasCardCategories = publishedCards.some((c)=>{ var _c_categories; var _c_categories_length; return ((_c_categories_length = (_c_categories = c.categories) === null || _c_categories === void 0 ? void 0 : _c_categories.length) !== null && _c_categories_length !== void 0 ? _c_categories_length : 0) > 0; }); const hasCardLocations = publishedCards.some((c)=>{ var _c_locations; var _c_locations_length; return ((_c_locations_length = (_c_locations = c.locations) === null || _c_locations === void 0 ? void 0 : _c_locations.length) !== null && _c_locations_length !== void 0 ? _c_locations_length : 0) > 0; }); const moderationNoticeByCardId = cardNotifications.reduce((acc, row)=>{ if (!row.referenceId || acc[row.referenceId]) return acc; const tone = row.type === 'specialist_card_approved' ? 'green' : row.type === 'specialist_card_rejected' ? 'red' : 'amber'; const localizedTitle = row.type === 'specialist_card_approved' ? t('profile.card.review_approved', 'Card approved') : row.type === 'specialist_card_rejected' ? t('profile.card.review_rejected', 'Card rejected') : t('profile.card.review_pending', 'Pending approval'); const localizedBody = row.type === 'specialist_card_approved' ? t('profile.card.review_approved_hint', 'Your card is now visible in offers.') : row.type === 'specialist_card_rejected' ? t('profile.card.review_rejected_hint', 'Your card was not approved. Please update it and submit again.') : t('profile.card.review_pending_hint', 'Your card is being reviewed by the admin team.'); acc[row.referenceId] = { title: localizedTitle, body: localizedBody, tone }; return acc; }, {}); const listingMissing = []; if (!profileBio) listingMissing.push(t('profile.listing_requirements.bio', 'Add a short bio in the main profile section')); if (!hasPublishedCard) listingMissing.push(t('profile.listing_requirements.published_card', 'Publish at least one card')); if (!hasCardCategories) listingMissing.push(t('profile.listing_requirements.categories', 'Add at least one category to the published card')); if (!hasCardLocations) listingMissing.push(t('profile.listing_requirements.locations', 'Add at least one location to the published card')); const tabNeedsAttention = { info: !profileBio, cards: listingMissing.length > 0 }; const tabIcons = { info: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15.75 6a3.75 3.75 0 11-7.5 0 3.75 3.75 0 017.5 0zM4.501 20.118a7.5 7.5 0 0114.998 0A17.933 17.933 0 0112 21.75c-2.676 0-5.216-.584-7.499-1.632z" }) }), finance: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 6v12m-3-2.818l.879.659c1.171.879 3.07.879 4.242 0 1.172-.879 1.172-2.303 0-3.182C13.536 12.219 12.768 12 12 12c-.725 0-1.45-.22-2.003-.659-1.106-.879-1.106-2.303 0-3.182s2.9-.879 4.006 0l.415.33M21 12a9 9 0 11-18 0 9 9 0 0118 0z" }) }), cards: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M20.25 14.15v4.073a2.25 2.25 0 01-2.25 2.25h-12a2.25 2.25 0 01-2.25-2.25V6a2.25 2.25 0 012.25-2.25h4.073M15.75 3h5.25v5.25M15.75 3l-9 9" }) }), notifications: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M14.857 17.082a23.848 23.848 0 005.454-1.31A8.967 8.967 0 0118 9.75v-.7V9A6 6 0 006 9v.75a8.967 8.967 0 01-2.312 6.022c1.733.64 3.56 1.085 5.455 1.31m5.714 0a24.255 24.255 0 01-5.714 0m5.714 0a3 3 0 11-5.714 0" }) }), reviews: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M11.48 3.499a.562.562 0 011.04 0l2.125 5.111a.563.563 0 00.475.345l5.518.442c.499.04.701.663.321.988l-4.204 3.602a.563.563 0 00-.182.557l1.285 5.385a.562.562 0 01-.84.61l-4.725-2.885a.562.562 0 00-.586 0L6.982 20.54a.562.562 0 01-.84-.61l1.285-5.386a.562.562 0 00-.182-.557l-4.204-3.602a.562.562 0 01.321-.988l5.518-.442a.563.563 0 00.475-.345L11.48 3.5z" }) }), referral: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M13.19 8.688a4.5 4.5 0 011.242 7.244l-4.5 4.5a4.5 4.5 0 01-6.364-6.364l1.757-1.757m13.35-.622l1.757-1.757a4.5 4.5 0 00-6.364-6.364l-4.5 4.5a4.5 4.5 0 001.242 7.244" }) }), auto_response: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9.813 15.904L9 18.75l-.813-2.846a4.5 4.5 0 00-3.09-3.09L2.25 12l2.846-.813a4.5 4.5 0 003.09-3.09L9 5.25l.813 2.846a4.5 4.5 0 003.09 3.09L15.75 12l-2.846.813a4.5 4.5 0 00-3.09 3.09z" }) }), site: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 21a9.004 9.004 0 008.716-6.747M12 21a9.004 9.004 0 01-8.716-6.747M12 21c2.485 0 4.5-4.03 4.5-9S14.485 3 12 3m0 18c-2.485 0-4.5-4.03-4.5-9S9.515 3 12 3m0 0a8.997 8.997 0 017.843 4.582M12 3a8.997 8.997 0 00-7.843 4.582m15.686 0A11.953 11.953 0 0112 10.5c-2.998 0-5.74-1.1-7.843-2.918m15.686 0A8.959 8.959 0 0121 12c0 .778-.099 1.533-.284 2.253m0 0A17.919 17.919 0 0112 16.5c-3.162 0-6.133-.815-8.716-2.247m0 0A9.015 9.015 0 013 12c0-1.605.42-3.113 1.157-4.418" }) }) }; const tabs = showSpecialistTabs ? [ { id: 'info', label: t('profile.tab.info') }, { id: 'cards', label: t('profile.tab.cards') }, { id: 'notifications', label: t('profile.tab.notifications') }, { id: 'reviews', label: t('profile.tab.reviews') }, { id: 'finance', label: t('profile.tab.finance') }, { id: 'referral', label: t('profile.tab.referral') }, ...hasAutoResponse ? [ { id: 'auto_response', label: t('profile.tab.auto_response', 'Auto response') } ] : [], ...(dashData === null || dashData === void 0 ? void 0 : (_dashData_features1 = dashData.features) === null || _dashData_features1 === void 0 ? void 0 : _dashData_features1.hasPersonalSite) ? [ { id: 'site', label: t('profile.tab.site') } ] : [] ] : [ { id: 'info', label: t('profile.tab.info') }, { id: 'cards', label: t('profile.tab.cards') }, { id: 'notifications', label: t('profile.tab.notifications') }, { id: 'reviews', label: t('profile.tab.reviews') }, { id: 'finance', label: t('profile.tab.finance') }, { id: 'referral', label: t('profile.tab.referral') }, ...(dashData === null || dashData === void 0 ? void 0 : (_dashData_features2 = dashData.features) === null || _dashData_features2 === void 0 ? void 0 : _dashData_features2.hasPersonalSite) ? [ { id: 'site', label: t('profile.tab.site') } ] : [] ]; var _user_lastName1, _user_name, _user_balance, _user_plan_features, _user_plan_name; return /*#__PURE__*/ _jsxs("div", { className: "max-w-4xl mx-auto px-4 py-8", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-4 mb-6", children: [ /*#__PURE__*/ _jsx("div", { className: "w-14 h-14 rounded-full flex-shrink-0 overflow-hidden border-2 border-white/40 flex items-center justify-center text-green-700 text-xl font-bold bg-green-100 cursor-pointer", onClick: ()=>{ var _fileRef_current; setActiveTab('info'); (_fileRef_current = fileRef.current) === null || _fileRef_current === void 0 ? void 0 : _fileRef_current.click(); }, title: t('profile.photo.change'), children: (user === null || user === void 0 ? void 0 : user.image) ? /*#__PURE__*/ _jsx("img", { src: user.image, alt: user.name, className: "w-full h-full object-cover" }) : initials }), /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ _jsx("h1", { className: "text-xl font-bold text-white leading-tight", children: (user === null || user === void 0 ? void 0 : user.firstName) ? "".concat(user.firstName, " ").concat((_user_lastName1 = user.lastName) !== null && _user_lastName1 !== void 0 ? _user_lastName1 : '').trim() : (_user_name = user === null || user === void 0 ? void 0 : user.name) !== null && _user_name !== void 0 ? _user_name : t('nav.profile') }), myRating && /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-1 mt-0.5", children: [ /*#__PURE__*/ _jsx("span", { className: "text-yellow-300", children: "★" }), /*#__PURE__*/ _jsx("span", { className: "font-semibold text-white text-sm", children: Number(myRating).toFixed(1) }), myReviews !== null && myReviews.length > 0 && /*#__PURE__*/ _jsxs("span", { className: "text-white/60 text-xs", children: [ "(", myReviews.length, ")" ] }) ] }) ] }) ] }), !cardsLoading && cards.length === 0 && /*#__PURE__*/ _jsx("div", { className: "mb-6 rounded-2xl border border-amber-300 bg-amber-50/95 p-4 sm:p-5 shadow-sm", children: /*#__PURE__*/ _jsxs("div", { className: "flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "text-sm font-semibold text-amber-950", children: t('profile.cards.empty', 'No offers yet') }), /*#__PURE__*/ _jsx("p", { className: "text-xs leading-relaxed text-amber-800 mt-1 max-w-2xl", children: t('profile.cards.empty_hint', 'СПзЎайте первую картПчку, чтПбы пПказать услугО клОеМтаЌ.') }) ] }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>{ setActiveTab('cards'); setShowNewCardForm(true); }, className: "inline-flex items-center justify-center rounded-xl bg-amber-600 px-4 py-2 text-sm font-semibold text-white transition hover:bg-amber-700", children: t('profile.cards.create_first') }) ] }) }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-6 items-start", children: [ tabs.length > 1 && /*#__PURE__*/ _jsx("aside", { className: "w-52 shrink-0 hidden sm:block", children: /*#__PURE__*/ _jsx("nav", { className: "rounded-2xl overflow-hidden bg-white/10 backdrop-blur-sm", children: tabs.map((tab)=>/*#__PURE__*/ _jsxs("button", { type: "button", onClick: ()=>setActiveTab(tab.id), className: "w-full text-left px-4 py-3 text-sm font-medium transition border-b border-white/10 last:border-0 flex items-center gap-3 ".concat(activeTab === tab.id ? 'bg-white text-green-700' : 'text-white/80 hover:bg-white/10 hover:text-white'), children: [ tabIcons[tab.id], /*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-1.5", children: [ tab.label, tabNeedsAttention[tab.id] && /*#__PURE__*/ _jsx("span", { className: "inline-flex items-center justify-center w-4 h-4 rounded-full bg-amber-500 text-white text-[10px] font-bold", children: "!" }) ] }) ] }, tab.id)) }) }), /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-0", children: [ tabs.length > 1 && /*#__PURE__*/ _jsx("div", { className: "flex sm:hidden bg-white/15 backdrop-blur rounded-xl p-1 mb-4 gap-1 overflow-x-auto", children: tabs.map((tab)=>/*#__PURE__*/ _jsxs("button", { type: "button", onClick: ()=>setActiveTab(tab.id), className: "flex-1 min-w-fit px-3 py-2 text-xs font-medium rounded-lg transition whitespace-nowrap flex flex-col items-center gap-0.5 ".concat(activeTab === tab.id ? 'bg-white text-green-700 shadow-sm' : 'text-white/80 hover:text-white hover:bg-white/10'), children: [ tabIcons[tab.id], /*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-1.5", children: [ tab.label, tabNeedsAttention[tab.id] && /*#__PURE__*/ _jsx("span", { className: "inline-flex items-center justify-center w-4 h-4 rounded-full bg-amber-500 text-white text-[10px] font-bold", children: "!" }) ] }) ] }, tab.id)) }), activeTab === 'cards' && /*#__PURE__*/ _jsxs("div", { className: "space-y-4", children: [ error && /*#__PURE__*/ _jsx("div", { className: "bg-red-50 text-red-700 p-3 rounded-lg text-sm", children: error }), listingMissing.length > 0 && /*#__PURE__*/ _jsxs("div", { className: "bg-amber-50 border border-amber-300 rounded-xl p-4", children: [ /*#__PURE__*/ _jsx("p", { className: "text-sm font-semibold text-amber-900", children: t('profile.listing_requirements.title', 'Your profile is not shown yet in offers') }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-amber-800 mt-1", children: t('profile.listing_requirements.hint', 'To make the card visible, complete these conditions:') }), /*#__PURE__*/ _jsx("ul", { className: "mt-2 list-disc pl-5 text-xs text-amber-900 space-y-0.5", children: listingMissing.map((item)=>/*#__PURE__*/ _jsx("li", { children: item }, item)) }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between", children: [ /*#__PURE__*/ _jsxs("p", { className: "text-sm text-white/70", children: [ t('profile.cards.count'), ": ", cards.length, " / ", maxCards === null ? '∞' : maxCards ] }), /*#__PURE__*/ _jsxs("button", { type: "button", onClick: ()=>{ if (maxCards !== null && cards.length >= maxCards) { setShowUpgradeModal(true); } else { setShowNewCardForm(true); } }, className: "flex items-center gap-1.5 text-sm font-medium text-white hover:text-white/80", children: [ "+ ", t('profile.cards.add') ] }) ] }), showNewCardForm && /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-green-200 p-4 space-y-3", children: [ /*#__PURE__*/ _jsx("p", { className: "text-sm font-medium text-gray-800", children: t('profile.cards.new_title') }), /*#__PURE__*/ _jsx("input", { value: newCardTitle, onChange: (e)=>setNewCardTitle(e.target.value), onKeyDown: (e)=>{ if (e.key === 'Enter') handleCreateCard(); }, maxLength: 200, placeholder: t('profile.cards.placeholder'), autoFocus: true, 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" }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-2", children: [ /*#__PURE__*/ _jsx("button", { type: "button", onClick: handleCreateCard, disabled: creatingCard || !newCardTitle.trim(), className: "px-4 py-2 bg-green-600 hover:bg-green-700 text-white rounded-lg text-sm font-medium disabled:opacity-50", children: creatingCard ? '...' : t('profile.cards.create') }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>{ setShowNewCardForm(false); setNewCardTitle(''); }, className: "px-4 py-2 bg-gray-100 hover:bg-gray-200 text-gray-700 rounded-lg text-sm font-medium", children: t('profile.cards.cancel') }) ] }) ] }), cardsLoading && /*#__PURE__*/ _jsx("div", { className: "text-center py-10 text-white/70", children: t('common.loading') }), !cardsLoading && cards.length === 0 && !showNewCardForm && /*#__PURE__*/ _jsxs("div", { className: "text-center py-14 border-2 border-dashed border-white/30 rounded-xl", children: [ /*#__PURE__*/ _jsx("p", { className: "text-white/70 text-sm mb-3", children: t('profile.cards.empty') }), /*#__PURE__*/ _jsxs("button", { type: "button", onClick: ()=>setShowNewCardForm(true), className: "text-sm text-white font-medium hover:underline", children: [ "+ ", t('profile.cards.create_first') ] }) ] }), cards.map((card)=>{ var _dashData_features; const cardIssues = []; if (!profileBio) { cardIssues.push(t('profile.listing_requirements.bio', 'Add a short bio in the main profile section')); } var _card_publicationStatus; const publicationStatus = (_card_publicationStatus = card.publicationStatus) !== null && _card_publicationStatus !== void 0 ? _card_publicationStatus : card.isActive ? 'active' : 'inactive'; if (publicationStatus === 'pending') { cardIssues.push(t('profile.listing_requirements.review_pending', 'Card is under review')); } else if (publicationStatus !== 'active') { cardIssues.push(t('profile.listing_requirements.card_inactive', 'Make the card active')); } if (!card.categories || card.categories.length === 0) { cardIssues.push(t('profile.listing_requirements.categories', 'Add at least one category to the active card')); } if (!card.locations || card.locations.length === 0) { cardIssues.push(t('profile.listing_requirements.locations', 'Add at least one location to the active card')); } var _moderationNoticeByCardId_card_id; return /*#__PURE__*/ _jsx(SpecialistCardEditor, { card: card, isOpen: openCardId === card.id, onToggle: ()=>setOpenCardId(card.id), onUpdate: (updated)=>setCards((prev)=>prev.map((c)=>c.id === updated.id ? updated : c)), onDelete: ()=>handleDeleteCard(card.id), categories: categories, locationTree: locationTree, catLocale: catLocale, locale: locale, hasPriceList: !!(dashData === null || dashData === void 0 ? void 0 : (_dashData_features = dashData.features) === null || _dashData_features === void 0 ? void 0 : _dashData_features.hasPriceList), visibilityIssues: cardIssues, moderationNotice: (_moderationNoticeByCardId_card_id = moderationNoticeByCardId[card.id]) !== null && _moderationNoticeByCardId_card_id !== void 0 ? _moderationNoticeByCardId_card_id : null }, card.id); }) ] }), activeTab === 'site' && /*#__PURE__*/ _jsxs("div", { className: "space-y-5", children: [ /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6 space-y-4", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("h2", { className: "font-semibold text-gray-800 mb-1", children: t('profile.site.title') }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400", children: t('profile.site_slug_hint') }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-500 mb-1.5", children: t('profile.site.url_label') }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 flex-wrap", children: [ /*#__PURE__*/ _jsx("span", { className: "text-sm text-gray-400 shrink-0", children: "canhelp.gr/site/" }), /*#__PURE__*/ _jsx("input", { value: personalSiteSlug, onChange: (e)=>setPersonalSiteSlug(e.target.value.toLowerCase().replace(/[^a-z0-9_-]/g, '')), placeholder: "my-slug", maxLength: 50, className: "flex-1 min-w-32 border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 flex-wrap", children: [ /*#__PURE__*/ _jsx("button", { type: "button", onClick: handleSaveSiteSlug, disabled: slugSaving, className: "px-5 py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700 disabled:opacity-50", children: slugSaving ? t('profile.saving') : t('common.save') }), slugSaved && /*#__PURE__*/ _jsxs("span", { className: "text-sm text-green-600", children: [ "✓ ", t('profile.saved') ] }), personalSiteSlug && /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs("button", { type: "button", onClick: ()=>{ navigator.clipboard.writeText("".concat(window.location.origin, "/site/").concat(personalSiteSlug)); setSlugCopied(true); setTimeout(()=>setSlugCopied(false), 2000); }, className: "px-3 py-2 border border-gray-300 rounded-lg text-sm text-gray-600 hover:bg-gray-50 flex items-center gap-1.5", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z" }) }), slugCopied ? t('profile.site.copied') : t('profile.site.copy') ] }), /*#__PURE__*/ _jsxs("a", { href: "/site/".concat(personalSiteSlug), target: "_blank", rel: "noopener noreferrer", className: "px-3 py-2 border border-green-200 bg-green-50 rounded-lg text-sm text-green-600 hover:bg-green-100 flex items-center gap-1.5", children: [ t('profile.site_open'), /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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" }) }) ] }) ] }) ] }), slugError && /*#__PURE__*/ _jsx("p", { className: "text-xs text-red-500", children: slugError }) ] }), /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between mb-4", children: [ /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-gray-800", children: t('profile.site.visible_title') }), siteSettingsSaving && /*#__PURE__*/ _jsx("span", { className: "text-xs text-gray-400", children: t('profile.saving', 'Saving...') }) ] }), /*#__PURE__*/ _jsx("div", { className: "space-y-3", children: [ { key: 'showBio', label: t('profile.site.visible.bio', 'Biography') }, { key: 'showRating', label: t('profile.site.visible.rating', 'Rating and reviews') }, { key: 'showReviews', label: t('profile.site.visible.reviews', 'Reviews section') }, { key: 'showServices', label: t('profile.site.visible.services', 'Service cards') }, { key: 'showPriceList', label: t('profile.site.visible.price_list', 'Price list') }, { key: 'showPortfolio', label: t('profile.site.visible.portfolio', 'Portfolio') }, { key: 'showPhone', label: t('profile.site.visible.contacts', 'Contact phone') }, { key: 'showFullLastName', label: t('profile.site.visible.full_last_name', 'Show full last name') }, { key: 'showStatus', label: t('profile.site.visible.status', 'Status "Available now"') } ].map((param)=>{ let { key, label } = param; const checked = siteSettings[key] !== false // undefined = true by default ; return /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-3 cursor-pointer group", children: [ /*#__PURE__*/ _jsx("div", { className: "w-5 h-5 rounded border-2 flex items-center justify-center transition shrink-0 ".concat(checked ? 'bg-green-600 border-green-600' : 'bg-white border-gray-300 group-hover:border-green-400'), onClick: ()=>{ const next = { ...siteSettings, [key]: !checked }; handleSaveSiteSettings(next); }, children: checked && /*#__PURE__*/ _jsx("svg", { className: "w-3 h-3 text-white", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 3, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4.5 12.75l6 6 9-13.5" }) }) }), /*#__PURE__*/ _jsx("span", { className: "text-sm text-gray-700 select-none", onClick: ()=>{ const next = { ...siteSettings, [key]: !checked }; handleSaveSiteSettings(next); }, children: label }) ] }, key); }) }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-4", children: t('profile.site.edit_bio_hint', 'Name and photo are always visible') }), /*#__PURE__*/ _jsxs("div", { className: "mt-6 pt-4 border-t border-gray-100", children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: t('profile.site.theme', 'Theme') }), /*#__PURE__*/ _jsx("div", { className: "flex gap-3", children: [ { value: 'dark', label: t('profile.site.theme.dark', 'Dark'), icon: '🌙' }, { value: 'light', label: t('profile.site.theme.light', 'Light'), icon: '☀' } ].map((opt)=>{ var _siteSettings_siteTheme; const selected = ((_siteSettings_siteTheme = siteSettings.siteTheme) !== null && _siteSettings_siteTheme !== void 0 ? _siteSettings_siteTheme : 'dark') === opt.value; return /*#__PURE__*/ _jsxs("button", { onClick: ()=>handleSaveSiteSettings({ ...siteSettings, siteTheme: opt.value }), className: "flex-1 flex items-center justify-center gap-2 px-4 py-2.5 rounded-xl border-2 text-sm font-medium transition ".concat(selected ? 'border-green-500 bg-green-50 text-green-700' : 'border-gray-200 bg-white text-gray-500 hover:border-gray-300'), children: [ /*#__PURE__*/ _jsx("span", { children: opt.icon }), opt.label ] }, opt.value); }) }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ _jsx("div", { className: "flex items-center justify-between mb-4", children: /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-gray-800", children: t('profile.site.stats.title', 'Site analytics') }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-0.5", children: t('profile.site.stats.days', 'last 30 days') }) ] }) }), !personalSiteSlug ? /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-400 py-4 text-center", children: t('profile.site.stats.no_slug', 'Set your site URL to view statistics') }) : siteStatsLoading || siteStats === null ? /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-400 py-4 text-center", children: t('profile.site.stats.loading', 'Loading analytics...') }) : (()=>{ const totalViews = siteStats.reduce((s, d)=>s + d.views, 0); const totalUnique = siteStats.reduce((s, d)=>s + d.unique, 0); const totalMessages = siteStats.reduce((s, d)=>s + d.messages, 0); // Area chart helpers const days = siteStats.map((d)=>d.date); const seriesDef = [ { vals: siteStats.map((d)=>d.views), color: '#3b82f6', fill: '#3b82f615', label: t('profile.site.stats.views', 'Views') }, { vals: siteStats.map((d)=>d.unique), color: '#8b5cf6', fill: '#8b5cf610', label: t('profile.site.stats.unique', 'Unique') }, { vals: siteStats.map((d)=>d.messages), color: '#10b981', fill: '#10b98110', label: t('profile.site.stats.messages', 'Messages') } ]; const maxVal = Math.max(...seriesDef.flatMap((s)=>s.vals), 1); const W = 580; const H = 160; const padL = 36; const padB = 22; const chartW = W - padL - 4; const chartH = H - padB; const stepX = chartW / (days.length - 1); function pts(vals) { return vals.map((v, i)=>[ padL + i * stepX, chartH - v / maxVal * chartH ]); } function smoothPath(points) { if (points.length < 2) return ''; let d = "M ".concat(points[0][0].toFixed(1), " ").concat(points[0][1].toFixed(1)); for(let i = 1; i < points.length; i++){ const cpx = ((points[i - 1][0] + points[i][0]) / 2).toFixed(1); d += " C ".concat(cpx, " ").concat(points[i - 1][1].toFixed(1), " ").concat(cpx, " ").concat(points[i][1].toFixed(1), " ").concat(points[i][0].toFixed(1), " ").concat(points[i][1].toFixed(1)); } return d; } function areaPath(vals) { const points = pts(vals); const line = smoothPath(points); if (!line) return ''; const lastX = points[points.length - 1][0].toFixed(1); return "".concat(line, " L ").concat(lastX, " ").concat(chartH.toFixed(1), " L ").concat(padL.toFixed(1), " ").concat(chartH.toFixed(1), " Z"); } function fmtY(v) { return v >= 1000 ? "".concat(Math.round(v / 1000), "K") : String(v); } const yTicks = [ 0, Math.round(maxVal / 3), Math.round(maxVal * 2 / 3), maxVal ]; const xTicks = days.map((d, i)=>({ i, label: d.slice(8) })).filter((_, i)=>i % 7 === 0 || i === days.length - 1); return /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx("div", { className: "grid grid-cols-3 gap-3 mb-5", children: [ { label: t('profile.site.stats.total_views', 'Views'), value: totalViews, color: 'text-green-600', bg: 'bg-green-50' }, { label: t('profile.site.stats.total_unique', 'Unique visitors'), value: totalUnique, color: 'text-violet-600', bg: 'bg-violet-50' }, { label: t('profile.site.stats.total_messages', 'Messages'), value: totalMessages, color: 'text-emerald-600', bg: 'bg-emerald-50' } ].map((card)=>/*#__PURE__*/ _jsxs("div", { className: "".concat(card.bg, " rounded-xl p-3 text-center"), children: [ /*#__PURE__*/ _jsx("div", { className: "text-2xl font-bold ".concat(card.color), children: card.value }), /*#__PURE__*/ _jsx("div", { className: "text-xs text-gray-500 mt-0.5", children: card.label }) ] }, card.label)) }), /*#__PURE__*/ _jsx("div", { className: "flex items-center gap-4 mb-2", children: seriesDef.map((s)=>/*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-1.5 text-xs text-gray-500", children: [ /*#__PURE__*/ _jsx("span", { className: "w-3 h-0.5 inline-block rounded", style: { background: s.color } }), s.label ] }, s.label)) }), /*#__PURE__*/ _jsx("div", { className: "overflow-x-auto", children: /*#__PURE__*/ _jsxs("svg", { viewBox: "0 0 ".concat(W, " ").concat(H + 12), className: "w-full", style: { minWidth: 320 }, children: [ yTicks.map((v, idx)=>{ const y = chartH - v / maxVal * chartH; return /*#__PURE__*/ _jsxs("g", { children: [ /*#__PURE__*/ _jsx("line", { x1: padL, y1: y, x2: W - 4, y2: y, stroke: "#f3f4f6", strokeWidth: 1 }), /*#__PURE__*/ _jsx("text", { x: padL - 5, y: y + 3.5, textAnchor: "end", fontSize: 9, fill: "#9ca3af", children: fmtY(v) }) ] }, "y-".concat(idx, "-").concat(v)); }), xTicks.map((param)=>{ let { i } = param; return /*#__PURE__*/ _jsx("line", { x1: padL + i * stepX, y1: 0, x2: padL + i * stepX, y2: chartH, stroke: "#f9fafb", strokeWidth: 1 }, "vg-".concat(i)); }), xTicks.map((param)=>{ let { i, label } = param; return /*#__PURE__*/ _jsx("text", { x: padL + i * stepX, y: H + 10, textAnchor: "middle", fontSize: 9, fill: "#9ca3af", children: label }, i); }), seriesDef.map((s, si)=>/*#__PURE__*/ _jsx("path", { d: areaPath(s.vals), fill: s.fill }, "fill-".concat(si))), seriesDef.map((s, si)=>/*#__PURE__*/ _jsx("path", { d: smoothPath(pts(s.vals)), fill: "none", stroke: s.color, strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round" }, "line-".concat(si))), seriesDef.map((s, si)=>{ const points = pts(s.vals); const last = points[points.length - 1]; return /*#__PURE__*/ _jsx("circle", { cx: last[0], cy: last[1], r: 4, fill: "white", stroke: s.color, strokeWidth: 2 }, "dot-".concat(si)); }), /*#__PURE__*/ _jsx("line", { x1: padL, y1: chartH, x2: W - 4, y2: chartH, stroke: "#e5e7eb", strokeWidth: 1 }) ] }) }) ] }); })() ] }) ] }), activeTab === 'reviews' && /*#__PURE__*/ _jsx("div", { className: "space-y-4", children: myReviews === null ? /*#__PURE__*/ _jsx("div", { className: "text-center py-10 text-white/70", children: t('common.loading') }) : myReviews.length === 0 ? /*#__PURE__*/ _jsxs("div", { className: "text-center py-20 text-white/60", children: [ /*#__PURE__*/ _jsx("p", { className: "text-4xl mb-3", children: "⭐" }), /*#__PURE__*/ _jsx("p", { children: t('profile.no_reviews') }) ] }) : myReviews.map((param)=>{ let { review, author } = param; var _author_name_, _author_name; var _author_name__toUpperCase, _author_name1; return /*#__PURE__*/ _jsx("div", { className: "bg-white rounded-xl border border-gray-200 p-4", children: /*#__PURE__*/ _jsxs("div", { className: "flex items-start gap-3", children: [ /*#__PURE__*/ _jsx("div", { className: "w-9 h-9 rounded-full bg-gray-100 flex-shrink-0 flex items-center justify-center text-gray-600 text-sm font-bold overflow-hidden", children: (author === null || author === void 0 ? void 0 : author.image) ? /*#__PURE__*/ _jsx("img", { src: author.image, alt: author.name, className: "w-full h-full object-cover" }) : (_author_name__toUpperCase = author === null || author === void 0 ? void 0 : (_author_name = author.name) === null || _author_name === void 0 ? void 0 : (_author_name_ = _author_name[0]) === null || _author_name_ === void 0 ? void 0 : _author_name_.toUpperCase()) !== null && _author_name__toUpperCase !== void 0 ? _author_name__toUpperCase : '?' }), /*#__PURE__*/ _jsxs("div", { className: "flex-1", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 mb-1", children: [ /*#__PURE__*/ _jsx("span", { className: "text-sm font-medium text-gray-800", children: (_author_name1 = author === null || author === void 0 ? void 0 : author.name) !== null && _author_name1 !== void 0 ? _author_name1 : '—' }), /*#__PURE__*/ _jsxs("span", { className: "text-yellow-400", children: [ '★'.repeat(review.rating), '☆'.repeat(5 - review.rating) ] }) ] }), review.comment && /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-600", children: review.comment }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-1", children: new Date(review.createdAt).toLocaleDateString() }) ] }) ] }) }, review.id); }) }), activeTab === 'finance' && /*#__PURE__*/ _jsxs("div", { className: "space-y-5", children: [ /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between mb-3", children: [ /*#__PURE__*/ _jsx("h2", { className: "font-semibold text-gray-800", children: t('profile.balance') }), /*#__PURE__*/ _jsxs("button", { onClick: ()=>{ setTopUpAmount(10); setTopUpError(''); setShowTopUpModal(true); }, className: "flex items-center gap-1.5 text-sm font-medium text-green-600 hover:text-green-700 hover:bg-green-50 px-3 py-1.5 rounded-lg transition-colors", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 4v16m8-8H4" }) }), t('profile.balance.topup') ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 p-4 bg-green-50 rounded-xl border border-green-100", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-6 h-6 text-green-600 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 8c-1.657 0-3 .895-3 2s1.343 2 3 2 3 .895 3 2-1.343 2-3 2m0-8c1.11 0 2.08.402 2.599 1M12 8V7m0 1v8m0 0v1m0-1c-1.11 0-2.08-.402-2.599-1M21 12a9 9 0 11-18 0 9 9 0 0118 0z" }) }), /*#__PURE__*/ _jsxs("span", { className: "text-xl font-bold text-green-700", children: [ parseFloat((_user_balance = user === null || user === void 0 ? void 0 : user.balance) !== null && _user_balance !== void 0 ? _user_balance : '0').toFixed(2), " EUR" ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "mt-4", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between mb-2", children: [ /*#__PURE__*/ _jsx("h3", { className: "text-sm font-semibold text-gray-800", children: t('profile.balance.history', 'Operation history') }), /*#__PURE__*/ _jsx("span", { className: "text-xs text-gray-400", children: t('profile.balance.history.last', 'Latest operations') }) ] }), balanceHistory.length === 0 ? /*#__PURE__*/ _jsx("div", { className: "rounded-xl border border-dashed border-gray-200 px-4 py-6 text-sm text-gray-400 text-center", children: t('profile.balance.history.empty', 'No operations yet') }) : /*#__PURE__*/ _jsx("div", { className: "space-y-2", children: balanceHistory.map((entry)=>{ const isCredit = entry.direction === 'credit'; const amount = Number(entry.amount).toFixed(2); const badgeClass = isCredit ? 'bg-emerald-50 text-emerald-700 border-emerald-100' : 'bg-rose-50 text-rose-700 border-rose-100'; const title = entry.kind === 'topup' ? t('profile.balance.history.kind.topup', 'Balance top-up') : entry.kind === 'plan_purchase' ? t('profile.balance.history.kind.plan_purchase', 'Plan charge') : entry.kind === 'admin_topup' ? t('profile.balance.history.kind.admin_topup', 'Admin top-up') : t('profile.balance.history.kind.admin_adjustment', 'Admin adjustment'); return /*#__PURE__*/ _jsxs("div", { className: "rounded-xl border border-gray-200 px-4 py-3", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-start justify-between gap-3", children: [ /*#__PURE__*/ _jsxs("div", { className: "min-w-0", children: [ /*#__PURE__*/ _jsx("div", { className: "text-sm font-medium text-gray-900", children: entry.description || title }), /*#__PURE__*/ _jsx("div", { className: "text-xs text-gray-500 mt-1", children: new Date(entry.createdAt).toLocaleString(dateLocale) }) ] }), /*#__PURE__*/ _jsxs("div", { className: "shrink-0 rounded-full border px-2.5 py-1 text-xs font-semibold ".concat(badgeClass), children: [ isCredit ? '+' : '-', amount, " ", entry.currency ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "mt-2 text-xs text-gray-500", children: [ t('profile.balance.history.balance_after', 'Balance after'), ": ", Number(entry.balanceAfter).toFixed(2), " ", entry.currency ] }) ] }, entry.id); }) }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ _jsx("h2", { className: "font-semibold text-gray-800 mb-4", children: t('profile.plan_history.title', 'Plan history') }), planHistory.length === 0 ? /*#__PURE__*/ _jsx("div", { className: "rounded-xl border border-dashed border-gray-200 px-4 py-6 text-sm text-gray-400 text-center", children: t('profile.plan_history.empty', 'Plan change history is empty') }) : /*#__PURE__*/ _jsx("div", { className: "space-y-2", children: planHistory.map((entry)=>{ const eventColors = { activated: 'bg-green-50 text-green-700 border-green-100', renewed: 'bg-emerald-50 text-emerald-700 border-emerald-100', downgraded: 'bg-rose-50 text-rose-700 border-rose-100', referral_reward: 'bg-amber-50 text-amber-700 border-amber-100', admin_change: 'bg-purple-50 text-purple-700 border-purple-100', expired: 'bg-gray-100 text-gray-600 border-gray-200' }; const eventLabels = { activated: t('profile.plan_history.event.activated', 'Activated'), renewed: t('profile.plan_history.event.renewed', 'Renewed'), downgraded: t('profile.plan_history.event.downgraded', 'Downgraded'), referral_reward: t('profile.plan_history.event.referral_reward', 'Referral reward'), admin_change: t('profile.plan_history.event.admin_change', 'Changed by admin'), expired: t('profile.plan_history.event.expired', 'Expired') }; var _eventColors_entry_event; const badgeClass = (_eventColors_entry_event = eventColors[entry.event]) !== null && _eventColors_entry_event !== void 0 ? _eventColors_entry_event : 'bg-gray-100 text-gray-600 border-gray-200'; var _eventLabels_entry_event; const label = (_eventLabels_entry_event = eventLabels[entry.event]) !== null && _eventLabels_entry_event !== void 0 ? _eventLabels_entry_event : entry.event; return /*#__PURE__*/ _jsx("div", { className: "rounded-xl border border-gray-200 px-4 py-3", children: /*#__PURE__*/ _jsxs("div", { className: "flex items-start justify-between gap-3", children: [ /*#__PURE__*/ _jsxs("div", { className: "min-w-0", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 flex-wrap", children: [ /*#__PURE__*/ _jsx("span", { className: "text-sm font-semibold text-gray-900", children: entry.planName }), entry.previousPlanName && entry.previousPlanName !== entry.planName && /*#__PURE__*/ _jsxs("span", { className: "text-xs text-gray-400", children: [ "← ", entry.previousPlanName ] }) ] }), /*#__PURE__*/ _jsx("div", { className: "text-xs text-gray-500 mt-1", children: new Date(entry.createdAt).toLocaleString(dateLocale) }), entry.expiresAt && /*#__PURE__*/ _jsxs("div", { className: "text-xs text-gray-500 mt-0.5", children: [ t('profile.plan_history.expires', 'Until'), ": ", new Date(entry.expiresAt).toLocaleDateString(dateLocale) ] }), entry.daysAdded && entry.event === 'referral_reward' && /*#__PURE__*/ _jsxs("div", { className: "text-xs text-amber-600 mt-0.5", children: [ "+", entry.daysAdded, " ", t('profile.plan_history.days', 'days') ] }), entry.note && /*#__PURE__*/ _jsx("div", { className: "text-xs text-gray-400 mt-0.5", children: entry.note }) ] }), /*#__PURE__*/ _jsx("span", { className: "shrink-0 rounded-full border px-2.5 py-1 text-xs font-semibold ".concat(badgeClass), children: label }) ] }) }, entry.id); }) }) ] }), showTopUpModal && /*#__PURE__*/ _jsx("div", { className: "fixed inset-0 z-50 flex items-end sm:items-center justify-center p-4 bg-black/40 backdrop-blur-sm", children: /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-2xl shadow-2xl w-full max-w-sm p-6", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between mb-5", children: [ /*#__PURE__*/ _jsx("h3", { className: "text-lg font-semibold text-gray-900", children: t('profile.balance.topup.title') }), /*#__PURE__*/ _jsx("button", { onClick: ()=>setShowTopUpModal(false), className: "text-gray-400 hover:text-gray-600", children: /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" }) }) }) ] }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-500 mb-3", children: t('profile.balance.topup.hint') }), /*#__PURE__*/ _jsx("div", { className: "grid grid-cols-4 gap-2 mb-4", children: [ 5, 10, 20, 50 ].map((v)=>/*#__PURE__*/ _jsxs("button", { onClick: ()=>setTopUpAmount(v), className: "py-2 rounded-xl text-sm font-semibold border transition-colors ".concat(Number(topUpAmount) === v ? 'bg-green-600 text-white border-green-600' : 'border-gray-200 text-gray-700 hover:border-green-400'), children: [ "€", v ] }, v)) }), /*#__PURE__*/ _jsxs("div", { className: "mb-5", children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('profile.balance.topup.amount') }), /*#__PURE__*/ _jsxs("div", { className: "relative", children: [ /*#__PURE__*/ _jsx("span", { className: "absolute left-3 top-1/2 -translate-y-1/2 text-gray-400 text-sm", children: "€" }), /*#__PURE__*/ _jsx("input", { type: "number", min: "1", max: "9999", step: "1", value: topUpAmount, onChange: (e)=>setTopUpAmount(e.target.value), className: "w-full pl-7 pr-4 py-2.5 border border-gray-300 rounded-xl text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }) ] }), topUpError && /*#__PURE__*/ _jsx("p", { className: "text-sm text-red-600 mb-3", children: topUpError }), /*#__PURE__*/ _jsx("button", { onClick: handleTopUp, disabled: topUpLoading || !Number(topUpAmount) || Number(topUpAmount) < 1, className: "w-full py-3 bg-green-600 hover:bg-green-700 disabled:bg-gray-300 disabled:cursor-not-allowed text-white font-semibold rounded-xl transition-colors flex items-center justify-center gap-2", children: topUpLoading ? /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs("svg", { className: "w-4 h-4 animate-spin", fill: "none", viewBox: "0 0 24 24", children: [ /*#__PURE__*/ _jsx("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }), /*#__PURE__*/ _jsx("path", { className: "opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8v8z" }) ] }), t('profile.balance.topup.loading') ] }) : t('profile.balance.topup.submit') }) ] }) }), /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ _jsx("h2", { className: "font-semibold text-gray-800 mb-3", children: t('profile.plan.title') }), (user === null || user === void 0 ? void 0 : user.plan) ? /*#__PURE__*/ _jsxs("div", { className: "flex items-start gap-3 p-4 bg-green-50 rounded-xl border border-green-100", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-6 h-6 text-gray-500 shrink-0 mt-0.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M3 10h18M7 15h1m4 0h1m-7 4h12a3 3 0 003-3V8a3 3 0 00-3-3H6a3 3 0 00-3 3v8a3 3 0 003 3z" }) }), /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ _jsx("p", { className: "font-semibold text-gray-900", children: user.plan.name }), user.plan.description && /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-500 mt-0.5", children: user.plan.description }), /*#__PURE__*/ _jsxs("div", { className: "flex flex-wrap gap-3 mt-2 text-xs text-gray-500", children: [ /*#__PURE__*/ _jsxs("span", { className: "font-medium text-green-700", children: [ user.plan.price, " ", user.plan.currency ] }), user.plan.maxCards != null ? /*#__PURE__*/ _jsxs("span", { children: [ t('profile.plan.cards_up_to'), " ", user.plan.maxCards ] }) : /*#__PURE__*/ _jsx("span", { children: t('profile.plan.cards_unlimited') }), user.plan.maxTasks != null && /*#__PURE__*/ _jsxs("span", { children: [ t('profile.plan.tasks_up_to'), " ", user.plan.maxTasks ] }), user.plan.maxOffers != null && /*#__PURE__*/ _jsxs("span", { children: [ t('profile.plan.offers_up_to'), " ", user.plan.maxOffers ] }), /*#__PURE__*/ _jsx("span", { className: user.planExpiresAt && new Date(user.planExpiresAt) < new Date(Date.now() + 7 * 24 * 60 * 60 * 1000) ? 'text-red-500 font-medium' : '', children: user.planExpiresAt ? "".concat(t('profile.plan.valid_until'), " ").concat(new Date(user.planExpiresAt).toLocaleDateString()) : t('profile.plan.no_expiry') }) ] }), ((_user_plan_features = user.plan.features) !== null && _user_plan_features !== void 0 ? _user_plan_features : []).length > 0 && /*#__PURE__*/ _jsx("ul", { className: "mt-2 space-y-0.5", children: user.plan.features.map((f, i)=>/*#__PURE__*/ _jsxs("li", { className: "text-xs text-gray-600 flex items-center gap-1.5", children: [ /*#__PURE__*/ _jsx("span", { className: "text-green-500", children: "✓" }), " ", f ] }, i)) }) ] }) ] }) : /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 p-4 bg-gray-50 rounded-xl border border-gray-100", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" }) }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "text-sm font-medium text-gray-700", children: t('profile.plan.basic') }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-0.5", children: t('profile.plan.contact_upgrade') }) ] }) ] }) ] }), /*#__PURE__*/ _jsx("div", { className: "text-center", children: /*#__PURE__*/ _jsxs("a", { href: "/pricing", className: "inline-flex items-center gap-1.5 text-sm font-medium text-white/70 hover:text-white transition", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M13 7l5 5m0 0l-5 5m5-5H6" }) }), t('pricing.title', 'Pricing') ] }) }) ] }), activeTab !== 'cards' && activeTab !== 'reviews' && activeTab !== 'finance' && activeTab !== 'site' && /*#__PURE__*/ _jsxs("form", { onSubmit: handleSubmit, className: "space-y-6", children: [ error && /*#__PURE__*/ _jsx("div", { className: "bg-red-50 text-red-700 p-3 rounded-lg text-sm", children: error }), saved && /*#__PURE__*/ _jsxs("div", { className: "bg-green-50 text-green-700 p-3 rounded-lg text-sm", children: [ "✓ ", t('profile.saved') ] }), activeTab === 'notifications' && /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6 space-y-6", children: [ /*#__PURE__*/ _jsx("h2", { className: "font-semibold text-gray-800", children: t('notifications.title') }), notifySaved && /*#__PURE__*/ _jsxs("div", { className: "bg-green-50 text-green-700 p-3 rounded-lg text-sm", children: [ "✓ ", t('notifications.saved') ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-start justify-between gap-4", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex-1", children: [ /*#__PURE__*/ _jsx("p", { className: "font-medium text-gray-800 text-sm", children: t('chat.notif_messages') }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-500 mt-0.5", children: t('notifications.messages.desc') }) ] }), /*#__PURE__*/ _jsx("button", { type: "button", disabled: notifySaving, onClick: async ()=>{ const next = !notifMessages; setNotifMessages(next); setNotifySaving(true); try { await api.request('/users/me', { method: 'PATCH', body: JSON.stringify({ notifMessages: next }) }); setNotifySaved(true); setTimeout(()=>setNotifySaved(false), 2500); } catch (e) { setNotifMessages(!next); } finally{ setNotifySaving(false); } }, className: "relative inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full transition-colors focus:outline-none focus:ring-2 focus:ring-green-500 focus:ring-offset-2 disabled:opacity-50 ".concat(notifMessages ? 'bg-green-600' : 'bg-gray-200'), role: "switch", "aria-checked": notifMessages, children: /*#__PURE__*/ _jsx("span", { className: "inline-block h-4 w-4 transform rounded-full bg-white shadow transition-transform ".concat(notifMessages ? 'translate-x-6' : 'translate-x-1') }) }) ] }), showSpecialistTabs && /*#__PURE__*/ _jsxs("div", { className: "flex items-start justify-between gap-4 ".concat(!(user === null || user === void 0 ? void 0 : (_user_plan = user.plan) === null || _user_plan === void 0 ? void 0 : _user_plan.notifyNewTasks) ? 'opacity-60' : ''), children: [ /*#__PURE__*/ _jsxs("div", { className: "flex-1", children: [ /*#__PURE__*/ _jsx("p", { className: "font-medium text-gray-800 text-sm", children: t('notifications.email.new_tasks') }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-500 mt-0.5", children: t('notifications.email.new_tasks.desc') }), !(user === null || user === void 0 ? void 0 : (_user_plan1 = user.plan) === null || _user_plan1 === void 0 ? void 0 : _user_plan1.notifyNewTasks) && /*#__PURE__*/ _jsxs("p", { className: "text-xs text-amber-600 mt-1", children: [ "\uD83D\uDD12 ", t('notifications.plan_required') ] }) ] }), /*#__PURE__*/ _jsx("button", { type: "button", disabled: notifySaving || !(user === null || user === void 0 ? void 0 : (_user_plan2 = user.plan) === null || _user_plan2 === void 0 ? void 0 : _user_plan2.notifyNewTasks), onClick: async ()=>{ const next = !notifyNewTasks; setNotifyNewTasks(next); setNotifySaving(true); try { await api.request('/users/me', { method: 'PATCH', body: JSON.stringify({ notifyNewTasks: next }) }); setNotifySaved(true); setTimeout(()=>setNotifySaved(false), 2500); } catch (e) { setNotifyNewTasks(!next); } finally{ setNotifySaving(false); } }, className: "relative inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full transition-colors focus:outline-none focus:ring-2 focus:ring-green-500 focus:ring-offset-2 disabled:opacity-50 ".concat(notifyNewTasks ? 'bg-green-600' : 'bg-gray-200'), role: "switch", "aria-checked": notifyNewTasks, children: /*#__PURE__*/ _jsx("span", { className: "inline-block h-4 w-4 transform rounded-full bg-white shadow transition-transform ".concat(notifyNewTasks ? 'translate-x-6' : 'translate-x-1') }) }) ] }) ] }), activeTab === 'referral' && /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6 space-y-5", children: [ /*#__PURE__*/ _jsx("h2", { className: "font-semibold text-gray-800", children: t('profile.referral.title') }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-500", children: t('profile.referral.desc') }), !referralLoaded ? /*#__PURE__*/ _jsx("div", { className: "text-sm text-gray-400", children: t('common.loading') }) : referralCode ? /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs font-medium text-gray-500 mb-1.5", children: t('profile.referral.link_label') }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2", children: [ /*#__PURE__*/ _jsx("input", { readOnly: true, value: "".concat("object" !== 'undefined' ? window.location.origin : '', "/register?ref=").concat(referralCode), className: "flex-1 text-sm border border-gray-200 rounded-lg px-3 py-2 bg-gray-50 text-gray-700 focus:outline-none" }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>{ navigator.clipboard.writeText("".concat(window.location.origin, "/register?ref=").concat(referralCode)); setReferralCopied(true); setTimeout(()=>setReferralCopied(false), 2000); }, className: "px-3 py-2 rounded-lg border border-gray-200 text-sm font-medium hover:bg-gray-50 transition whitespace-nowrap", children: referralCopied ? t('profile.referral.copied') : t('profile.referral.copy') }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 p-4 bg-green-50 rounded-xl", children: [ /*#__PURE__*/ _jsx("div", { className: "text-2xl font-bold text-green-700", children: referralCount }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-green-700", children: t('profile.referral.invited_count') }) ] }) ] }) : /*#__PURE__*/ _jsx("div", { className: "text-sm text-gray-400", children: t('profile.referral.no_code') }) ] }), activeTab === 'auto_response' && /*#__PURE__*/ _jsx(AutoResponseTab, { categories: categories, locationTree: locationTree, loaded: arLoaded, onLoad: ()=>{ if (arLoaded) return; api.getAutoResponseSettings().then((s)=>{ setAutoResponse(s); setArLoaded(true); }).catch(()=>setArLoaded(true)); }, settings: autoResponse, saving: arSaving, saved: arSaved, onSave: async (data)=>{ setArSaving(true); setArSaved(false); try { const updated = await api.updateAutoResponseSettings(data); setAutoResponse(updated); setArSaved(true); setTimeout(()=>setArSaved(false), 2500); } catch (e) {} finally{ setArSaving(false); } }, t: t, catLocale: catLocale }), activeTab === 'info' && /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ _jsx("h2", { className: "font-semibold text-gray-800 mb-4", children: t('profile.photo') }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-5", children: [ /*#__PURE__*/ _jsxs("div", { className: "relative", children: [ (user === null || user === void 0 ? void 0 : user.image) ? /*#__PURE__*/ _jsx("img", { src: user.image, alt: user.name, className: "w-20 h-20 rounded-full object-cover border-2 border-gray-200" }) : /*#__PURE__*/ _jsx("div", { className: "w-20 h-20 rounded-full bg-green-100 flex items-center justify-center text-green-700 text-2xl font-bold border-2 border-gray-200", children: initials }), avatarUploading && /*#__PURE__*/ _jsx("div", { className: "absolute inset-0 rounded-full bg-black/40 flex items-center justify-center", children: /*#__PURE__*/ _jsx("div", { className: "w-5 h-5 border-2 border-white border-t-transparent rounded-full animate-spin" }) }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>{ var _fileRef_current; return (_fileRef_current = fileRef.current) === null || _fileRef_current === void 0 ? void 0 : _fileRef_current.click(); }, disabled: avatarUploading, className: "bg-gray-100 hover:bg-gray-200 text-gray-700 px-4 py-2 rounded-lg text-sm font-medium disabled:opacity-50", children: t('profile.photo.change') }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-1", children: t('profile.photo.hint') }), /*#__PURE__*/ _jsx("input", { ref: fileRef, type: "file", accept: "image/jpeg,image/png,image/webp", className: "hidden", onChange: handleAvatarChange }), /*#__PURE__*/ _jsx("div", { className: "mt-3 rounded-lg border border-gray-200 bg-gray-50 px-3 py-2.5", children: isSpecialist ? (dashData === null || dashData === void 0 ? void 0 : (_dashData_features3 = dashData.features) === null || _dashData_features3 === void 0 ? void 0 : _dashData_features3.hasCanHelpNowStatus) ? /*#__PURE__*/ _jsxs("label", { className: "flex items-center justify-between cursor-pointer gap-3", children: [ /*#__PURE__*/ _jsx("span", { className: "text-xs font-medium text-gray-700", children: t('status.can_help_now', 'Available now') }), /*#__PURE__*/ _jsx("button", { type: "button", disabled: statusToggling === 'canhelp_now', onClick: async ()=>{ setStatusToggling('canhelp_now'); const nextActive = !myStatuses.includes('canhelp_now'); try { const res = await api.toggleStatus('canhelp_now', nextActive); setMyStatuses((prev)=>res.isActive ? [ ...prev.filter((s)=>s !== 'canhelp_now'), 'canhelp_now' ] : prev.filter((s)=>s !== 'canhelp_now')); } catch (e) {} finally{ setStatusToggling(null); } }, className: "relative inline-flex h-5 w-10 items-center rounded-full transition-colors ".concat(myStatuses.includes('canhelp_now') ? 'bg-green-500' : 'bg-gray-300', " disabled:opacity-50"), children: /*#__PURE__*/ _jsx("span", { className: "inline-block h-3.5 w-3.5 transform rounded-full bg-white shadow transition-transform ".concat(myStatuses.includes('canhelp_now') ? 'translate-x-5.5' : 'translate-x-1') }) }) ] }) : /*#__PURE__*/ _jsx("p", { className: "text-xs text-amber-700", children: t('status.plan_required', 'Status is unavailable on your current plan') }) : !isAdmin ? (dashData === null || dashData === void 0 ? void 0 : (_dashData_features4 = dashData.features) === null || _dashData_features4 === void 0 ? void 0 : _dashData_features4.hasNeedHelpStatus) ? /*#__PURE__*/ _jsxs("label", { className: "flex items-center justify-between cursor-pointer gap-3", children: [ /*#__PURE__*/ _jsx("span", { className: "text-xs font-medium text-gray-700", children: t('status.need_help', 'Need help') }), /*#__PURE__*/ _jsx("button", { type: "button", disabled: statusToggling === 'need_help', onClick: async ()=>{ setStatusToggling('need_help'); const nextActive = !myStatuses.includes('need_help'); try { const res = await api.toggleStatus('need_help', nextActive); setMyStatuses((prev)=>res.isActive ? [ ...prev.filter((s)=>s !== 'need_help'), 'need_help' ] : prev.filter((s)=>s !== 'need_help')); } catch (e) {} finally{ setStatusToggling(null); } }, className: "relative inline-flex h-5 w-10 items-center rounded-full transition-colors ".concat(myStatuses.includes('need_help') ? 'bg-green-500' : 'bg-gray-300', " disabled:opacity-50"), children: /*#__PURE__*/ _jsx("span", { className: "inline-block h-3.5 w-3.5 transform rounded-full bg-white shadow transition-transform ".concat(myStatuses.includes('need_help') ? 'translate-x-5.5' : 'translate-x-1') }) }) ] }) : /*#__PURE__*/ _jsx("p", { className: "text-xs text-amber-700", children: t('status.plan_required', 'Status is unavailable on your current plan') }) : /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-600", children: t('status.admin_not_applicable', 'User status is not applicable to admin accounts') }) }) ] }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ _jsx("h2", { className: "font-semibold text-gray-800 mb-4", children: t('profile.background.title', 'Profile header background') }), /*#__PURE__*/ _jsx("div", { className: "w-full h-40 rounded-2xl border border-gray-200 overflow-hidden relative", style: { backgroundImage: siteSettings.profileBackgroundImage ? "linear-gradient(135deg, rgba(22,163,74,0.45), rgba(21,128,61,0.65)), url(".concat(siteSettings.profileBackgroundImage, ")") : 'linear-gradient(135deg, #22c55e 0%, #16a34a 45%, #166534 100%)', backgroundSize: 'cover', backgroundPosition: 'center' }, children: backgroundUploading && /*#__PURE__*/ _jsx("div", { className: "absolute inset-0 bg-black/35 flex items-center justify-center", children: /*#__PURE__*/ _jsx("div", { className: "w-6 h-6 border-2 border-white border-t-transparent rounded-full animate-spin" }) }) }), /*#__PURE__*/ _jsxs("div", { className: "mt-4 flex flex-wrap gap-2", children: [ /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>{ var _backgroundFileRef_current; return (_backgroundFileRef_current = backgroundFileRef.current) === null || _backgroundFileRef_current === void 0 ? void 0 : _backgroundFileRef_current.click(); }, disabled: backgroundUploading, className: "bg-gray-100 hover:bg-gray-200 text-gray-700 px-4 py-2 rounded-lg text-sm font-medium disabled:opacity-50", children: backgroundUploading ? t('profile.photo.uploading', 'Uploading...') : t('profile.background.change', 'Change background') }), siteSettings.profileBackgroundImage && /*#__PURE__*/ _jsx("button", { type: "button", onClick: handleRemoveBackground, disabled: backgroundUploading, className: "bg-white hover:bg-gray-50 text-gray-700 px-4 py-2 rounded-lg text-sm font-medium border border-gray-200 disabled:opacity-50", children: t('profile.background.remove', 'Remove background') }), /*#__PURE__*/ _jsx("input", { ref: backgroundFileRef, type: "file", accept: "image/jpeg,image/png,image/webp", className: "hidden", onChange: handleBackgroundChange }) ] }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-2", children: t('profile.background.hint', 'Shown in the public profile header on web and mobile app.') }) ] }), /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6 space-y-4", children: [ /*#__PURE__*/ _jsx("h2", { className: "font-semibold text-gray-800", children: t('profile.basic_info') }), /*#__PURE__*/ _jsxs("div", { className: "grid grid-cols-2 gap-4", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('register.first_name') }), /*#__PURE__*/ _jsx("input", { value: formData.firstName, onChange: (e)=>setFormData({ ...formData, firstName: e.target.value }), required: true, className: "w-full border border-gray-300 rounded-lg px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-400 text-sm" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('register.last_name') }), /*#__PURE__*/ _jsx("input", { value: formData.lastName, onChange: (e)=>setFormData({ ...formData, lastName: e.target.value }), required: true, className: "w-full border border-gray-300 rounded-lg px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-400 text-sm" }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: "Email" }), /*#__PURE__*/ _jsx("input", { value: user === null || user === void 0 ? void 0 : user.email, disabled: true, className: "w-full border border-gray-200 rounded-lg px-3 py-2 text-sm text-gray-400 bg-gray-50 cursor-not-allowed" }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between mt-1.5", children: [ (user === null || user === void 0 ? void 0 : user.emailVerified) ? /*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-1 text-xs text-green-600", children: [ /*#__PURE__*/ _jsx("span", { className: "inline-block w-1.5 h-1.5 rounded-full bg-green-500" }), t('profile.email.verified') ] }) : /*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-1 text-xs text-amber-600", children: [ /*#__PURE__*/ _jsx("span", { className: "inline-block w-1.5 h-1.5 rounded-full bg-amber-500" }), t('profile.email.not_verified') ] }), !(user === null || user === void 0 ? void 0 : user.emailVerified) && /*#__PURE__*/ _jsx("button", { type: "button", disabled: resendState !== 'idle', onClick: handleResendVerification, className: "text-xs text-green-600 hover:underline disabled:opacity-60 disabled:no-underline", children: resendState === 'sending' ? t('login.unverified.sending') : resendState === 'sent' ? t('login.unverified.sent') : t('login.unverified.resend') }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('profile.phone') }), /*#__PURE__*/ _jsx("input", { type: "tel", value: formData.phone, onChange: (e)=>setFormData({ ...formData, phone: e.target.value }), placeholder: t('profile.phone.placeholder'), className: "w-full border border-gray-300 rounded-lg px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-400 text-sm" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('profile.bio') }), /*#__PURE__*/ _jsx("textarea", { value: formData.bio, onChange: (e)=>setFormData({ ...formData, bio: e.target.value }), rows: 3, maxLength: 1000, placeholder: t('profile.bio.placeholder'), className: "w-full border border-gray-300 rounded-lg px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-400 text-sm resize-none" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('profile.language') }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mb-2", children: t('profile.language.hint') }), /*#__PURE__*/ _jsxs("select", { value: formData.locale, onChange: (e)=>setFormData({ ...formData, locale: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400", children: [ /*#__PURE__*/ _jsx("option", { value: "el", children: "ΕλληΜικά" }), /*#__PURE__*/ _jsx("option", { value: "en", children: "English" }), /*#__PURE__*/ _jsx("option", { value: "ru", children: "РусскОй" }), /*#__PURE__*/ _jsx("option", { value: "uk", children: "УкраїМська" }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('profile.languages') }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mb-2", children: t('profile.languages.hint') }), /*#__PURE__*/ _jsx("div", { className: "flex flex-wrap gap-2", children: [ { code: 'el', flag: '🇬🇷', label: 'ΕλληΜικά' }, { code: 'en', flag: '🇬🇧', label: 'English' }, { code: 'ru', flag: '🇷🇺', label: 'РусскОй' }, { code: 'uk', flag: '🇺🇊', label: 'УкраїМська' }, { code: 'de', flag: '🇩🇪', label: 'Deutsch' }, { code: 'fr', flag: '🇫🇷', label: 'Français' }, { code: 'it', flag: '🇮🇹', label: 'Italiano' }, { code: 'es', flag: '🇪🇞', label: 'Español' }, { code: 'ar', flag: '🇞🇊', label: 'العرؚية' }, { code: 'zh', flag: '🇚🇳', label: 'äž­æ–‡' } ].map((param)=>{ let { code, flag, label } = param; const selected = selectedLanguages.includes(code); return /*#__PURE__*/ _jsxs("button", { type: "button", onClick: ()=>setSelectedLanguages(selected ? selectedLanguages.filter((l)=>l !== code) : [ ...selectedLanguages, code ]), className: "flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-sm border transition ".concat(selected ? 'bg-green-600 border-green-600 text-white' : 'bg-white border-gray-300 text-gray-700 hover:border-green-400'), children: [ /*#__PURE__*/ _jsx("span", { children: flag }), /*#__PURE__*/ _jsx("span", { children: label }) ] }, code); }) }) ] }) ] }), !isSpecialist && !isAdmin && /*#__PURE__*/ _jsx("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: /*#__PURE__*/ _jsxs("div", { className: "p-4 bg-purple-50 rounded-xl", children: [ /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-600 mb-3", children: t('profile.become_specialist.desc') }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: handleBecomeSpecialist, disabled: becomingSpecialist, className: "bg-purple-600 hover:bg-purple-700 text-white px-5 py-2 rounded-lg text-sm font-semibold disabled:opacity-50", children: becomingSpecialist ? t('common.loading') : t('profile.become_specialist') }) ] }) }), isSpecialist && ((dashData === null || dashData === void 0 ? void 0 : (_dashData_plan = dashData.plan) === null || _dashData_plan === void 0 ? void 0 : _dashData_plan.tier) === 'pro' || (dashData === null || dashData === void 0 ? void 0 : (_dashData_plan1 = dashData.plan) === null || _dashData_plan1 === void 0 ? void 0 : _dashData_plan1.tier) === 'ultimate') && /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ _jsx("h2", { className: "font-semibold text-gray-800 mb-4", children: t('profile.show_contact', 'Show contacts') }), /*#__PURE__*/ _jsxs("label", { className: "flex items-center justify-between cursor-pointer gap-3", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "text-sm font-medium text-gray-800", children: t('profile.show_contact_hint', 'Clients can see your phone number') }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-0.5", children: t('profile.show_contact_desc', 'Lets clients contact you directly') }) ] }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setShowContactInfo((v)=>!v), className: "relative inline-flex h-6 w-11 items-center rounded-full transition-colors ".concat(showContactInfo ? 'bg-green-500' : 'bg-gray-300'), children: /*#__PURE__*/ _jsx("span", { className: "inline-block h-4 w-4 transform rounded-full bg-white shadow transition-transform ".concat(showContactInfo ? 'translate-x-6' : 'translate-x-1') }) }) ] }) ] }) ] }), /*#__PURE__*/ _jsx("button", { type: "submit", disabled: saving, className: "w-full bg-green-600 text-white py-3 rounded-xl font-semibold hover:bg-green-700 disabled:opacity-50 disabled:cursor-not-allowed ".concat(activeTab === 'notifications' || activeTab === 'referral' || activeTab === 'auto_response' ? 'hidden' : ''), children: saving ? t('profile.saving') : t('common.save') }) ] }), showUpgradeModal && /*#__PURE__*/ _jsx("div", { className: "fixed inset-0 z-50 flex items-center justify-center bg-black/50 px-4", children: /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-2xl shadow-xl p-6 w-full max-w-md", children: [ /*#__PURE__*/ _jsx("div", { className: "text-center mb-5", children: /*#__PURE__*/ _jsx("span", { className: "text-5xl", children: "\uD83D\uDE80" }) }), /*#__PURE__*/ _jsx("h2", { className: "text-lg font-bold text-gray-900 text-center mb-2", children: t('profile.upgrade.cards_limit') }), /*#__PURE__*/ _jsxs("p", { className: "text-sm text-gray-600 text-center mb-4", children: [ (_user_plan_name = user === null || user === void 0 ? void 0 : (_user_plan3 = user.plan) === null || _user_plan3 === void 0 ? void 0 : _user_plan3.name) !== null && _user_plan_name !== void 0 ? _user_plan_name : t('profile.plan.basic'), " — ", t('profile.plan.cards_up_to'), " ", maxCards ] }), (user === null || user === void 0 ? void 0 : user.plan) && /*#__PURE__*/ _jsxs("div", { className: "bg-gray-50 rounded-xl p-4 mb-5 text-sm text-gray-600 text-center", children: [ /*#__PURE__*/ _jsx("span", { className: "font-medium text-gray-800", children: t('profile.upgrade.plan') }), ' ', user.plan.name, " — ", user.plan.price, " ", user.plan.currency ] }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 text-center mb-5", children: t('profile.upgrade.contact') }), /*#__PURE__*/ _jsx("button", { onClick: ()=>setShowUpgradeModal(false), className: "w-full bg-green-600 hover:bg-green-700 text-white py-2.5 rounded-xl text-sm font-semibold", children: t('profile.upgrade.ok') }) ] }) }) ] }) ] }) ] }); } @¶`=_’”ÑÓDFrt”–áÇÏ3:el˜ŸÑØ.5ñøŽ»w~3_:»ÂÎÕ› ¢ v } Ã Ê g n ¢ © Ø ß  5 :  ˆ Ã Ê  > E p _w  BIT\è÷ò Èß„›ÏåQg/7q‡ì8 O p'Ž'“'©'o*_…*À+Ö+ 1 1—1›1o2s2q3t3}4€4667 7w:z:<<g<k<,=/=A>D> ??@@uA_xACCªD­DvEyE…G‰G"H&HÇHÊH S€S%T)TV“VTYWYçZëZß[â[i]l]C`G`aa°a_Žac cŒeeJfMfýij2l5lfnjn†q‰qaueuÞuâuÔv×vyy2z5z7zBz0{@{‚}…}­€_±€»Ÿ „„ΆцƊʊC‹G‹9Œ<ŒjŽmސ!“%“/”2”{–~–:™=™Ë™Î™µš¹š»šÃšH›_K›ºœŸœ·ºÁžÅžÇžÏžjŸmŸ££•¥˜¥ šššš³š¶š+ª.ª}­€­š°°o±s±œ² ²Ÿ³_Á³mµpµ±·µ·oºrºåœéœüŸÿŸ‚ÂÆÆÇÇâÊåÊ&Ï*Ï,Ð/ÐÁÒÄÒsØvØ:Ù>ÙÄÜÈܓÝ_–ÝŒà¿à’ã–ãPäTäÍäÐäè!è#è+è¶è¹èjênêpêxê-ì0ì~îî¢ï¥ïÔðØðëñîñµó¹óýô_õ÷“÷çýêý—þšþ:>,0ADÚÞ„‡`c^ b ÷ û l o ˜ › Æ Ê ;_>fi §ªfiŽ Ÿ–™¯³   “ 9!=!ž!¡! "£"ï#ò#D%G%“&_—&7':'((±(µ()!)8*;*²,¶,-"-9.<.Ü0à091<1@2C2>4B4›4ž4€5§5à7ä7z8_}8f9i9Œ;À;V<Y<==@={A~AcDfDOH]HH“H•HœHÙHÜHJJ:JHJvJJžJŠJ3L:LL_–LÁLÈLñLøL M'MOMVMMˆM0N7NtN{NŠN­NßNæN&O-O\OcO˜OŸOÕOÜOPPZPaP©P_°PãPêPBQIQ…QŒQÐQ×QõQúQ!R&RR†RŸRÅRúRS5S&¡'¥'ä(ç(Ü*à*,",£.Š.å2é2‚3…3ô4÷49 9¹9Œ9);,;§?_«?D@G@¹AŒAC!C;F>F˜G›GôH÷HPJSJ‘L•L.M1M€N§N P PîaòaÖeÙeîfñfðiói³j_·jŠk©kmm×qÛqÑrÔr,t0tHuLuõuøu©w¬wÑyÔyÆ{É{Œ~~BEûÿՂ؂rƒuƒ¢„J¥„ӅׅU‰Y‰UŠXŠADcŽfŽ€€€€€€€Ã(0,_context_locale__WEBPACK_IMPORTED_MODULE_4__/* .useLocale */ .Y)¯(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ­(0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)þþþþþþþ°(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)Œ_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getPriceList */ .CkÄ_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .createPriceListGroup */ .vDÄ_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .deletePriceListGroup */ .IcÄ_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .updatePriceListGroup */ .oDÃ_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .createPriceListItem */ .Z2Ã_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .deletePriceListItem */ .U9ùÃ_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getSkillSuggestions */ .rlÄ_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .updateSpecialistCard */ .zcÿ˜"https://api.canhelp.gr"0Ã_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .deletePortfolioItem */ .zBÃ_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .updatePortfolioItem */ .hl·(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)ÿÿ¶(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)ÿÿÿÿþþÿÿÿþÿÿÿÿþþÿþþÿÿþÿÿþÿþÿþÿÿÿþÿþþÿþÿÌ_components_CategoryIcon__WEBPACK_IMPORTED_MODULE_6__/* .CategoryIcon */ .EzÔ(0,_components_CategoryIcon__WEBPACK_IMPORTED_MODULE_6__/* .isCategoryIconUrl */ .V)ýüýýýüüýýýüýýýýü·react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragmentüûüûÿüüüûÿüüüüûûüüûüûüüûüüûüüüûûüüûûüûÿüûÿüüüûüûüûüüûüûüûüüûûüüûüüûüü®: react__WEBPACK_IMPORTED_MODULE_1__.useEffect­: react__WEBPACK_IMPORTED_MODULE_1__.useStateúùúùùúúúúùúùùúúùúúùúúùúúùúúùúúúú€ú«react__WEBPACK_IMPORTED_MODULE_1__.Suspenseùº(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)À(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useSearchParams)¿(0,_lib_auth__WEBPACK_IMPORTED_MODULE_3__/* .useSession */ .wV)æççççççççççççççççççççççèèççççççççççççççççççççççççççççççççœ_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .initiateTopUp */ .oh»_lib_auth__WEBPACK_IMPORTED_MODULE_3__/* .authClient */ .yKçÁ_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getMyReferralInfo */ .stäääæŒ_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getMyReviews */ .q7åŒ_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getSiteStats */ .RNää·_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Emœ_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getCategories */ .bWŒ_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getLocations */ .Vsœ_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getMyDashboard */ .Hœ_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getMyStatuses */ .z6Á_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getBalanceHistory */ .fmŸ_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getPlanHistory */ .ewœ_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getUserRating */ .BmÄ_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getMySpecialistCards */ .BbÀ_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getNotifications */ .Trööööã0ã0öã0ã0ööÄ_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .createSpecialistCard */ .eRÄ_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .deleteSpecialistCard */ .f5åååååååååååååååååääååäåäååäåääåååäååääåäåääåäåäååååääääååäåååäåäåäääååäåäååäåääèäååäåååääåååäåååååäååäåäåäååååäèåäåååäååääååååååååååäåååäååääåäååäääåäååäååäääååååäääååäääååååäääåäåääåååääååååååääåäååååäèäååäåäååäååäääåääååäåäååäåååäååäåääåäääåååôåääååäåôåäåååäèäåäå… true0äãääääÇ_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getAutoResponseSettings */ .GpÊ_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .updateAutoResponseSettings */ .RQáåáâááââââáââââáââŒ_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .toggleStatus */ .bcááàááÿáááàááááàááááàáààááàááàááààáàááàááàááàááàááááàáááàáááàááàáààááááááàáááààááá§Æ__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ ProfilePage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7541); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(1592); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(9906); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(2982); /* harmony import */ var _components_CategoryIcon__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(5940); /* __next_internal_client_entry_do_not_use__ default auto */ function SpecialistCardEditor(param) { let { card, isOpen, onToggle, onUpdate, onDelete, categories, locationTree, catLocale, locale, hasPriceList, visibilityIssues = [], moderationNotice = null } = param; const { t } = (0,_context_locale__WEBPACK_IMPORTED_MODULE_4__/* .useLocale */ .Y)(); const hasVisibilityIssues = visibilityIssues.length > 0; const [cardTab, setCardTab] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)('main'); const [saving, setSaving] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [savedOk, setSavedOk] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [localTitle, setLocalTitle] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(card.title); var _card_descriptionEl; const [localDescEl, setLocalDescEl] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)((_card_descriptionEl = card.descriptionEl) !== null && _card_descriptionEl !== void 0 ? _card_descriptionEl : ''); var _card_descriptionEn; const [localDescEn, setLocalDescEn] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)((_card_descriptionEn = card.descriptionEn) !== null && _card_descriptionEn !== void 0 ? _card_descriptionEn : ''); var _card_descriptionRu; const [localDescRu, setLocalDescRu] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)((_card_descriptionRu = card.descriptionRu) !== null && _card_descriptionRu !== void 0 ? _card_descriptionRu : ''); var _card_descriptionUk; const [localDescUk, setLocalDescUk] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)((_card_descriptionUk = card.descriptionUk) !== null && _card_descriptionUk !== void 0 ? _card_descriptionUk : ''); var _card_skills; const [localSkills, setLocalSkills] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)((_card_skills = card.skills) !== null && _card_skills !== void 0 ? _card_skills : []); const [skillInput, setSkillInput] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); var _card_categories; const [localCategories, setLocalCategories] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)((_card_categories = card.categories) !== null && _card_categories !== void 0 ? _card_categories : []); var _card_locations; const [localLocations, setLocalLocations] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)((_card_locations = card.locations) !== null && _card_locations !== void 0 ? _card_locations : []); var _card_publicationStatus; const [localPublicationStatus, setLocalPublicationStatus] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)((_card_publicationStatus = card.publicationStatus) !== null && _card_publicationStatus !== void 0 ? _card_publicationStatus : card.isActive ? 'active' : 'inactive'); const [apiSkillSugs, setApiSkillSugs] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); var _card_portfolio; const [portfolio, setPortfolio] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)((_card_portfolio = card.portfolio) !== null && _card_portfolio !== void 0 ? _card_portfolio : []); const [portfolioUploading, setPortfolioUploading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [editingItem, setEditingItem] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [editTitle, setEditTitle] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [editDesc, setEditDesc] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const portfolioFileRef = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null); // Price list state const [priceList, setPriceList] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [priceListLoading, setPriceListLoading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [newGroupTitle, setNewGroupTitle] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [addingGroupId, setAddingGroupId] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [newItem, setNewItem] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)({ name: '', description: '', price: '', unit: '' }); const [editingGroupId, setEditingGroupId] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [editGroupTitle, setEditGroupTitle] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (cardTab !== 'pricelist' || priceList.length > 0 || priceListLoading) return; setPriceListLoading(true); _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getPriceList */ .Ck(card.id, locale).then(setPriceList).catch(()=>{}).finally(()=>setPriceListLoading(false)); }, [ cardTab, locale ]); async function handleAddGroup() { if (!newGroupTitle.trim()) return; const group = await _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .createPriceListGroup */ .vD(card.id, { title: newGroupTitle.trim(), locale: [ 'el', 'en', 'ru', 'uk' ].includes(locale) ? locale : 'el', autoTranslate: true }); setPriceList((prev)=>[ ...prev, group ]); setNewGroupTitle(''); } async function handleDeleteGroup(groupId) { await _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .deletePriceListGroup */ .Ic(groupId); setPriceList((prev)=>prev.filter((g)=>g.id !== groupId)); } async function handleSaveGroupTitle(groupId) { const updated = await _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .updatePriceListGroup */ .oD(groupId, { title: editGroupTitle.trim(), locale: [ 'el', 'en', 'ru', 'uk' ].includes(locale) ? locale : 'el', autoTranslate: true }); setPriceList((prev)=>prev.map((g)=>g.id === groupId ? { ...g, title: updated.title } : g)); setEditingGroupId(null); } async function handleAddItem(groupId) { if (!newItem.name.trim()) return; const item = await _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .createPriceListItem */ .Z2(groupId, { name: newItem.name.trim(), description: newItem.description.trim() || null, price: newItem.price.trim() || null, unit: newItem.unit.trim() || null, locale: [ 'el', 'en', 'ru', 'uk' ].includes(locale) ? locale : 'el', autoTranslate: true }); setPriceList((prev)=>prev.map((g)=>g.id === groupId ? { ...g, items: [ ...g.items, item ] } : g)); setNewItem({ name: '', description: '', price: '', unit: '' }); setAddingGroupId(null); } async function handleDeleteItem(itemId, groupId) { await _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .deletePriceListItem */ .U9(itemId); setPriceList((prev)=>prev.map((g)=>g.id === groupId ? { ...g, items: g.items.filter((i)=>i.id !== itemId) } : g)); } (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (cardTab !== 'skills') return; _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getSkillSuggestions */ .rl(localCategories.length > 0 ? localCategories : undefined).then(setApiSkillSugs).catch(()=>setApiSkillSugs([])); }, [ localCategories, cardTab ]); const lbl = (ru, en, el)=>locale === 'ru' ? ru : locale === 'en' ? en : el; async function saveAll() { setSaving(true); try { const activeLocale = [ 'el', 'en', 'ru', 'uk' ].includes(locale) ? locale : 'el'; const cap = activeLocale.charAt(0).toUpperCase() + activeLocale.slice(1); const descField = "description".concat(cap); const descValue = { el: localDescEl, en: localDescEn, ru: localDescRu, uk: localDescUk }[activeLocale] || null; const updated = await _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .updateSpecialistCard */ .zc(card.id, { title: localTitle, [descField]: descValue, descriptionLocale: activeLocale, autoTranslate: !!descValue, skills: localSkills, categories: localCategories, locations: localLocations, publicationStatus: localPublicationStatus, isActive: localPublicationStatus === 'active' }); onUpdate({ ...updated, portfolio }); setSavedOk(true); setTimeout(()=>setSavedOk(false), 2000); } catch (e) {} finally{ setSaving(false); } } async function updatePublicationStatus(next) { setLocalPublicationStatus(next); try { await _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .updateSpecialistCard */ .zc(card.id, { publicationStatus: next, isActive: next === 'active' }); } catch (e) {} } function addSkill(s) { const trimmed = s.trim(); if (trimmed && !localSkills.includes(trimmed)) setLocalSkills([ ...localSkills, trimmed ]); setSkillInput(''); } function toggleCategory(slug) { let childSlugs = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : []; if (localCategories.includes(slug)) { setLocalCategories(localCategories.filter((c)=>c !== slug && !childSlugs.includes(c))); } else { setLocalCategories([ ...new Set([ ...localCategories, slug, ...childSlugs ]) ]); } } function toggleLocation(slug) { let childSlugs = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : []; if (localLocations.includes(slug)) { setLocalLocations(localLocations.filter((c)=>c !== slug && !childSlugs.includes(c))); } else { setLocalLocations([ ...new Set([ ...localLocations, slug, ...childSlugs ]) ]); } } async function handlePortfolioUpload(e) { var _e_target_files; const file = (_e_target_files = e.target.files) === null || _e_target_files === void 0 ? void 0 : _e_target_files[0]; if (!file) return; setPortfolioUploading(true); try { const form = new FormData(); form.append('file', file); form.append('cardId', card.id); const res = await fetch("".concat("https://api.canhelp.gr" || 0, "/api/portfolio"), { method: 'POST', credentials: 'include', body: form }); if (!res.ok) throw new Error('Upload failed'); const item = await res.json(); const next = [ ...portfolio, item ]; setPortfolio(next); onUpdate({ ...card, portfolio: next }); } catch (e) {} finally{ setPortfolioUploading(false); if (portfolioFileRef.current) portfolioFileRef.current.value = ''; } } async function handlePortfolioDelete(id) { try { await _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .deletePortfolioItem */ .zB(id); const next = portfolio.filter((p)=>p.id !== id); setPortfolio(next); onUpdate({ ...card, portfolio: next }); } catch (e) {} } async function handlePortfolioSave(id) { try { const item = await _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .updatePortfolioItem */ .hl(id, { title: editTitle, description: editDesc }); setPortfolio((prev)=>prev.map((p)=>p.id === id ? item : p)); setEditingItem(null); } catch (e) {} } const cardTabs = [ { id: 'main', label: t('profile.card.tab.main') }, { id: 'categories', label: t('profile.card.tab.categories') }, { id: 'skills', label: t('profile.card.tab.skills') }, { id: 'geography', label: t('profile.card.tab.geography') }, { id: 'pricelist', label: t('profile.card.tab.pricelist'), hidden: !hasPriceList }, { id: 'portfolio', label: t('profile.card.tab.portfolio') } ]; const pendingReviewNotice = localPublicationStatus === 'pending' ? { title: t('profile.card.review_pending', 'Pending approval'), body: t('profile.card.review_pending_hint', 'Your card is being reviewed by the admin team.'), tone: 'amber' } : null; const effectiveModerationNotice = moderationNotice !== null && moderationNotice !== void 0 ? moderationNotice : pendingReviewNotice; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 overflow-hidden", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-3 px-4 py-3 border-b border-gray-100 ".concat(hasVisibilityIssues ? 'bg-amber-50' : ''), children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { type: "button", onClick: onToggle, className: "flex-1 flex items-center gap-3 text-left", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-sm font-semibold text-gray-800 flex-1", children: localTitle || card.title }), hasVisibilityIssues && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "inline-flex items-center justify-center w-5 h-5 rounded-full bg-amber-500 text-white text-xs font-bold", title: t('profile.card.visibility_issue', 'Card is not shown in offers'), children: "!" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-gray-400 text-xs", children: isOpen ? '▲' : 'â–Œ' }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>updatePublicationStatus(localPublicationStatus === 'active' ? 'inactive' : localPublicationStatus === 'pending' ? 'inactive' : 'pending'), className: "px-3 py-1.5 rounded-lg text-xs font-medium whitespace-nowrap ".concat(localPublicationStatus === 'active' ? 'bg-red-50 text-red-700 hover:bg-red-100' : localPublicationStatus === 'pending' ? 'bg-amber-50 text-amber-700 hover:bg-amber-100' : 'bg-green-50 text-green-700 hover:bg-green-100'), children: localPublicationStatus === 'active' ? t('profile.card.unpublish', 'Unpublish') : localPublicationStatus === 'pending' ? t('profile.card.withdraw_review', 'Withdraw request') : t('profile.card.submit_review', 'Submit for review') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: onDelete, className: "text-red-400 hover:text-red-600 text-sm px-1 flex-shrink-0", title: t('profile.card.delete'), children: "\uD83D\uDDD1" }) ] }), isOpen && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ hasVisibilityIssues && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "mx-4 mt-4 mb-2 rounded-lg border border-amber-300 bg-amber-50 p-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs font-semibold text-amber-900", children: t('profile.card.visibility_issue', 'Card is not shown in offers') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("ul", { className: "mt-1.5 list-disc pl-4 text-xs text-amber-900 space-y-0.5", children: visibilityIssues.map((issue)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("li", { children: issue }, issue)) }) ] }), effectiveModerationNotice && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "mx-4 mt-4 mb-2 rounded-lg border p-3 ".concat(effectiveModerationNotice.tone === 'green' ? 'border-green-300 bg-green-50' : effectiveModerationNotice.tone === 'red' ? 'border-red-300 bg-red-50' : 'border-amber-300 bg-amber-50'), children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs font-semibold ".concat(effectiveModerationNotice.tone === 'green' ? 'text-green-900' : effectiveModerationNotice.tone === 'red' ? 'text-red-900' : 'text-amber-900'), children: effectiveModerationNotice.title }), effectiveModerationNotice.body && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "mt-1 text-xs ".concat(effectiveModerationNotice.tone === 'green' ? 'text-green-800' : effectiveModerationNotice.tone === 'red' ? 'text-red-800' : 'text-amber-800'), children: effectiveModerationNotice.body }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex overflow-x-auto border-b border-gray-100 bg-gray-50 gap-0", children: cardTabs.filter((t)=>!t.hidden).map((t)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>setCardTab(t.id), className: "px-4 py-2.5 text-xs font-medium whitespace-nowrap border-b-2 transition -mb-px ".concat(cardTab === t.id ? 'border-green-500 text-green-600 bg-white' : 'border-transparent text-gray-500 hover:text-gray-700'), children: t.label }, t.id)) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "p-4", children: [ cardTab === 'main' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: localTitle, onChange: (e)=>setLocalTitle(e.target.value), maxLength: 200, placeholder: t('profile.cards.new_title'), 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" }), (()=>{ const activeLocale = [ 'el', 'en', 'ru', 'uk' ].includes(locale) ? locale : 'el'; const descMap = { el: [ localDescEl, setLocalDescEl ], en: [ localDescEn, setLocalDescEn ], ru: [ localDescRu, setLocalDescRu ], uk: [ localDescUk, setLocalDescUk ] }; const [val, setVal] = descMap[activeLocale]; const flags = { el: '🇬🇷', en: '🇬🇧', ru: '🇷🇺', uk: '🇺🇊' }; const otherLocales = [ 'el', 'en', 'ru', 'uk' ].filter((l)=>l !== activeLocale); const otherHasContent = otherLocales.some((l)=>descMap[l][0]); return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "flex items-center gap-1.5 text-xs font-medium text-gray-500 mb-1", children: [ flags[activeLocale], " ", t('profile.card.description', 'Description') ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("textarea", { value: val, onChange: (e)=>setVal(e.target.value), rows: 4, maxLength: 2000, placeholder: t('profile.bio.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" }), val && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400 mt-1", children: t('profile.card.desc_auto_translate', 'Will be automatically translated into other languages on save') }), otherHasContent && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-1.5 mt-1.5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-xs text-gray-400", children: t('profile.card.desc_translated', 'Translations available:') }), otherLocales.map((l)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-xs px-1.5 py-0.5 rounded-full ".concat(descMap[l][0] ? 'bg-green-50 text-green-600' : 'bg-gray-100 text-gray-400'), children: flags[l] }, l)) ] }) ] }); })() ] }), cardTab === 'skills' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-3", children: [ localSkills.length > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex flex-wrap gap-2", children: localSkills.map((s)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "flex items-center gap-1.5 bg-green-50 text-green-700 text-sm px-3 py-1 rounded-full", children: [ s, /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>setLocalSkills(localSkills.filter((x)=>x !== s)), className: "text-gray-400 hover:text-green-700 leading-none", children: "\xd7" }) ] }, s)) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: skillInput, onChange: (e)=>setSkillInput(e.target.value), onKeyDown: (e)=>{ if (e.key === 'Enter') { e.preventDefault(); addSkill(skillInput); } }, placeholder: t('profile.card.skill.add'), 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" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>addSkill(skillInput), className: "px-3 py-2 bg-gray-100 hover:bg-gray-200 rounded-lg text-sm font-medium", children: "+" }) ] }), apiSkillSugs.length > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex flex-wrap gap-1.5", children: apiSkillSugs.map((s)=>{ var _s_names_catLocale; return (_s_names_catLocale = s.names[catLocale]) !== null && _s_names_catLocale !== void 0 ? _s_names_catLocale : s.names.el; }).filter((name, i, arr)=>arr.indexOf(name) === i && !localSkills.includes(name)).slice(0, 16).map((name)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { type: "button", onClick: ()=>addSkill(name), className: "text-xs px-2.5 py-1 border border-gray-200 rounded-full text-gray-500 hover:border-green-400 hover:text-green-600 transition", children: [ "+ ", name ] }, name)) }) ] }), cardTab === 'categories' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "space-y-3", children: categories.map((cat)=>{ var _cat_names, _cat_names1; var _cat_names_catLocale, _ref; const catName = (_ref = (_cat_names_catLocale = (_cat_names = cat.names) === null || _cat_names === void 0 ? void 0 : _cat_names[catLocale]) !== null && _cat_names_catLocale !== void 0 ? _cat_names_catLocale : (_cat_names1 = cat.names) === null || _cat_names1 === void 0 ? void 0 : _cat_names1.el) !== null && _ref !== void 0 ? _ref : cat.slug; var _cat_children; const children = (_cat_children = cat.children) !== null && _cat_children !== void 0 ? _cat_children : []; const childSlugs = children.map((c)=>c.slug); return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "flex items-center gap-2.5 cursor-pointer", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "checkbox", checked: localCategories.includes(cat.slug), onChange: ()=>toggleCategory(cat.slug, childSlugs), className: "w-4 h-4 rounded border-gray-300 text-green-600 focus:ring-blue-400" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "text-sm font-medium text-gray-800 inline-flex items-center gap-1", children: [ cat.icon && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components_CategoryIcon__WEBPACK_IMPORTED_MODULE_6__/* .CategoryIcon */ .Ez, { icon: cat.icon, alt: catName, className: (0,_components_CategoryIcon__WEBPACK_IMPORTED_MODULE_6__/* .isCategoryIconUrl */ .V)(cat.icon) ? 'h-4 w-4 object-contain' : 'text-sm leading-none', fallback: "\uD83D\uDCE6" }), catName ] }) ] }), children.length > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "ml-6 mt-2 space-y-2", children: children.map((sub)=>{ var _sub_names, _sub_names1; var _sub_names_catLocale, _ref; const subName = (_ref = (_sub_names_catLocale = (_sub_names = sub.names) === null || _sub_names === void 0 ? void 0 : _sub_names[catLocale]) !== null && _sub_names_catLocale !== void 0 ? _sub_names_catLocale : (_sub_names1 = sub.names) === null || _sub_names1 === void 0 ? void 0 : _sub_names1.el) !== null && _ref !== void 0 ? _ref : sub.slug; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "flex items-center gap-2.5 cursor-pointer", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "checkbox", checked: localCategories.includes(sub.slug), onChange: ()=>toggleCategory(sub.slug), className: "w-4 h-4 rounded border-gray-300 text-green-600 focus:ring-blue-400" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-sm text-gray-600", children: subName }) ] }, sub.id); }) }) ] }, cat.id); }) }), cardTab === 'geography' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "space-y-3", children: locationTree.map((city)=>{ var _city_names, _city_names1; var _city_names_catLocale, _ref; const cityName = (_ref = (_city_names_catLocale = (_city_names = city.names) === null || _city_names === void 0 ? void 0 : _city_names[catLocale]) !== null && _city_names_catLocale !== void 0 ? _city_names_catLocale : (_city_names1 = city.names) === null || _city_names1 === void 0 ? void 0 : _city_names1.el) !== null && _ref !== void 0 ? _ref : city.slug; var _city_children; const districts = (_city_children = city.children) !== null && _city_children !== void 0 ? _city_children : []; const districtSlugs = districts.map((d)=>d.slug); return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "flex items-center gap-2.5 cursor-pointer", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "checkbox", checked: localLocations.includes(city.slug), onChange: ()=>toggleLocation(city.slug, districtSlugs), className: "w-4 h-4 rounded border-gray-300 text-green-600 focus:ring-blue-400" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-sm font-medium text-gray-800", children: cityName }) ] }), districts.length > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "ml-6 mt-2 space-y-2", children: districts.map((d)=>{ var _d_names, _d_names1; var _d_names_catLocale, _ref; const dName = (_ref = (_d_names_catLocale = (_d_names = d.names) === null || _d_names === void 0 ? void 0 : _d_names[catLocale]) !== null && _d_names_catLocale !== void 0 ? _d_names_catLocale : (_d_names1 = d.names) === null || _d_names1 === void 0 ? void 0 : _d_names1.el) !== null && _ref !== void 0 ? _ref : d.slug; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "flex items-center gap-2.5 cursor-pointer", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "checkbox", checked: localLocations.includes(d.slug), onChange: ()=>toggleLocation(d.slug), className: "w-4 h-4 rounded border-gray-300 text-green-600 focus:ring-blue-400" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-sm text-gray-600", children: dName }) ] }, d.id); }) }) ] }, city.id); }) }), cardTab === 'pricelist' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "space-y-4", children: priceListLoading ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-center py-6 text-gray-400 text-sm", children: t('common.loading', 'Loading...') }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [ priceList.length === 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-center py-6 text-gray-400 text-sm border-2 border-dashed border-gray-200 rounded-xl", children: t('profile.card.pricelist.empty') }), priceList.map((group)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "border border-gray-200 rounded-xl overflow-hidden", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex items-center gap-2 bg-gray-50 px-4 py-2.5 border-b border-gray-200", children: editingGroupId === group.id ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: editGroupTitle, onChange: (e)=>setEditGroupTitle(e.target.value), className: "flex-1 border border-gray-300 rounded-lg px-3 py-1.5 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400", onKeyDown: (e)=>{ if (e.key === 'Enter') handleSaveGroupTitle(group.id); }, autoFocus: true }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>handleSaveGroupTitle(group.id), className: "px-3 py-1.5 bg-green-600 text-white rounded-lg text-xs font-medium hover:bg-green-700", children: t('profile.card.pricelist.save_group') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>setEditingGroupId(null), className: "px-2 py-1.5 text-gray-500 hover:text-gray-700 text-xs", children: "✕" }) ] }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "flex-1 font-semibold text-sm text-gray-800", children: group.title }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>{ setEditingGroupId(group.id); setEditGroupTitle(group.title); }, className: "text-gray-400 hover:text-green-600 text-xs px-2 py-1 rounded hover:bg-green-50", children: "✏" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>handleDeleteGroup(group.id), className: "text-gray-400 hover:text-red-500 text-xs px-2 py-1 rounded hover:bg-red-50", children: t('profile.card.pricelist.delete_group') }) ] }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "divide-y divide-gray-100", children: group.items.map((item)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-3 px-4 py-2.5 text-sm group", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "font-medium text-gray-800 truncate", children: item.name }), item.description && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-500 truncate", children: item.description }) ] }), (item.price || item.unit) && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "text-green-700 font-semibold text-sm whitespace-nowrap", children: [ item.price ? "€".concat(item.price) : '', item.unit ? " ".concat(item.unit) : '' ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>handleDeleteItem(item.id, group.id), className: "opacity-0 group-hover:opacity-100 text-red-400 hover:text-red-600 text-xs px-1 transition", children: t('profile.card.pricelist.delete_item') }) ] }, item.id)) }), addingGroupId === group.id ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "p-3 bg-green-50 border-t border-green-100 space-y-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { placeholder: t('profile.card.pricelist.item_name'), value: newItem.name, onChange: (e)=>setNewItem((p)=>({ ...p, name: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { placeholder: t('profile.card.pricelist.item_desc'), value: newItem.description, onChange: (e)=>setNewItem((p)=>({ ...p, description: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { placeholder: t('profile.card.pricelist.item_price'), value: newItem.price, onChange: (e)=>setNewItem((p)=>({ ...p, price: e.target.value })), className: "w-28 border border-gray-300 rounded-lg px-3 py-1.5 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { placeholder: t('profile.card.pricelist.item_unit'), value: newItem.unit, onChange: (e)=>setNewItem((p)=>({ ...p, unit: e.target.value })), className: "flex-1 border border-gray-300 rounded-lg px-3 py-1.5 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>handleAddItem(group.id), className: "px-4 py-1.5 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700", children: t('profile.card.pricelist.save_item') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>{ setAddingGroupId(null); setNewItem({ name: '', description: '', price: '', unit: '' }); }, className: "px-3 py-1.5 text-gray-500 hover:text-gray-700 text-sm", children: "✕" }) ] }) ] }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "px-4 py-2 border-t border-gray-100", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { type: "button", onClick: ()=>setAddingGroupId(group.id), className: "text-green-600 hover:text-gray-800 text-sm font-medium", children: [ "+ ", t('profile.card.pricelist.add_item') ] }) }) ] }, group.id)), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-2 pt-1", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { placeholder: t('profile.card.pricelist.group_title'), value: newGroupTitle, onChange: (e)=>setNewGroupTitle(e.target.value), onKeyDown: (e)=>{ if (e.key === 'Enter') handleAddGroup(); }, 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" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: handleAddGroup, className: "px-4 py-2 bg-green-600 hover:bg-green-700 text-white rounded-lg text-sm font-medium", children: t('profile.card.pricelist.add_group') }) ] }) ] }) }), cardTab === 'portfolio' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-3", children: [ portfolio.length < 20 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>{ var _portfolioFileRef_current; return (_portfolioFileRef_current = portfolioFileRef.current) === null || _portfolioFileRef_current === void 0 ? void 0 : _portfolioFileRef_current.click(); }, disabled: portfolioUploading, className: "flex items-center gap-2 px-4 py-2 bg-green-600 hover:bg-green-700 text-white rounded-lg text-sm font-medium disabled:opacity-50", children: portfolioUploading ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "w-4 h-4 border-2 border-white border-t-transparent rounded-full animate-spin" }), t('profile.card.photo.uploading') ] }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [ "\uD83D\uDCF7 ", t('profile.card.photo.add') ] }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { ref: portfolioFileRef, type: "file", accept: "image/jpeg,image/png,image/webp", className: "hidden", onChange: handlePortfolioUpload }) ] }), portfolio.length === 0 ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-center py-8 text-gray-400 text-sm border-2 border-dashed border-gray-200 rounded-xl", children: t('profile.card.photo.empty') }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "grid grid-cols-2 sm:grid-cols-3 gap-3", children: portfolio.map((item)=>{ var _item_title; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "group relative rounded-xl overflow-hidden border border-gray-200 bg-gray-50", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: item.imageUrl, alt: (_item_title = item.title) !== null && _item_title !== void 0 ? _item_title : '', className: "w-full aspect-square object-cover" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "absolute inset-0 bg-black/0 group-hover:bg-black/50 transition-all flex flex-col justify-between p-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>handlePortfolioDelete(item.id), className: "self-end opacity-0 group-hover:opacity-100 transition w-7 h-7 rounded-full bg-red-500 text-white text-sm flex items-center justify-center hover:bg-red-600", children: "\xd7" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { type: "button", onClick: ()=>{ setEditingItem(item); var _item_title; setEditTitle((_item_title = item.title) !== null && _item_title !== void 0 ? _item_title : ''); var _item_description; setEditDesc((_item_description = item.description) !== null && _item_description !== void 0 ? _item_description : ''); }, className: "opacity-0 group-hover:opacity-100 transition text-xs text-white bg-black/50 hover:bg-black/70 rounded-lg px-2 py-1", children: [ "✏ ", t('profile.card.item.edit') ] }) ] }), item.title && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "px-2 py-1.5", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs font-medium text-gray-700 truncate", children: item.title }) }) ] }, item.id); }) }) ] }), cardTab !== 'portfolio' && cardTab !== 'pricelist' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-3 mt-4 pt-4 border-t border-gray-100", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", disabled: saving, onClick: saveAll, className: "px-5 py-2 bg-green-600 hover:bg-green-700 text-white rounded-lg text-sm font-semibold disabled:opacity-50", children: saving ? '...' : t('profile.card.save') }), savedOk && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "text-sm text-green-600", children: [ "✓ ", t('profile.card.saved') ] }) ] }) ] }) ] }), editingItem && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "fixed inset-0 z-50 flex items-center justify-center bg-black/50 px-4", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-2xl shadow-xl p-6 w-full max-w-md", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h3", { className: "font-semibold text-gray-800 mb-4", children: t('profile.card.item.edit') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: editingItem.imageUrl, alt: "", className: "w-full h-40 object-cover rounded-xl mb-4" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('profile.card.item.title') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: editTitle, onChange: (e)=>setEditTitle(e.target.value), maxLength: 200, 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" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('profile.card.item.desc') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("textarea", { value: editDesc, onChange: (e)=>setEditDesc(e.target.value), rows: 3, maxLength: 1000, 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" }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-3 mt-5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>handlePortfolioSave(editingItem.id), className: "flex-1 bg-green-600 hover:bg-green-700 text-white py-2 rounded-lg text-sm font-medium", children: t('profile.card.item.save') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>setEditingItem(null), className: "flex-1 bg-gray-100 hover:bg-gray-200 text-gray-700 py-2 rounded-lg text-sm font-medium", children: t('profile.card.item.cancel') }) ] }) ] }) }) ] }); } // ─── AutoResponseTab ─────────────────────────────────────────────────────── function AutoResponseTab(param) { let { categories, locationTree, loaded, onLoad, settings, saving, saved, onSave, t, catLocale } = param; const { useEffect: _ue, useState: _us } = { useEffect: react__WEBPACK_IMPORTED_MODULE_1__.useEffect, useState: react__WEBPACK_IMPORTED_MODULE_1__.useState }; const [enabled, setEnabled] = _us(false); const [minBudget, setMinBudget] = _us(''); const [maxBudget, setMaxBudget] = _us(''); const [defaultPrice, setDefaultPrice] = _us(''); const [defaultMessage, setDefaultMessage] = _us(''); const [maxPerDay, setMaxPerDay] = _us(''); const [selCategories, setSelCategories] = _us([]); const [selLocations, setSelLocations] = _us([]); _ue(()=>{ onLoad(); }, []); _ue(()=>{ if (!settings) return; setEnabled(settings.enabled); setMinBudget(settings.minBudget != null ? String(settings.minBudget) : ''); setMaxBudget(settings.maxBudget != null ? String(settings.maxBudget) : ''); setDefaultPrice(settings.defaultPrice != null ? String(settings.defaultPrice) : ''); var _settings_defaultMessage; setDefaultMessage((_settings_defaultMessage = settings.defaultMessage) !== null && _settings_defaultMessage !== void 0 ? _settings_defaultMessage : ''); setMaxPerDay(settings.maxAutoOffersPerDay != null ? String(settings.maxAutoOffersPerDay) : ''); var _settings_categories; setSelCategories((_settings_categories = settings.categories) !== null && _settings_categories !== void 0 ? _settings_categories : []); var _settings_locations; setSelLocations((_settings_locations = settings.locations) !== null && _settings_locations !== void 0 ? _settings_locations : []); }, [ settings ]); if (!loaded) return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-center py-10 text-white/60", children: t('common.loading') }); const flatLocations = []; function flatten(nodes) { for (const n of nodes){ var _n_children; flatLocations.push({ id: n.id, name: n.name }); if ((_n_children = n.children) === null || _n_children === void 0 ? void 0 : _n_children.length) flatten(n.children); } } flatten(locationTree); return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "bg-white rounded-xl border border-gray-200 p-5", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "flex items-center justify-between cursor-pointer", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "font-medium text-gray-800", children: t('auto_response.title', 'Auto response') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400 mt-0.5", children: t('auto_response.desc', 'Automatically respond to matching tasks') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>setEnabled((v)=>!v), className: "relative inline-flex h-6 w-11 items-center rounded-full transition-colors ".concat(enabled ? 'bg-green-500' : 'bg-gray-300'), children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "inline-block h-4 w-4 transform rounded-full bg-white shadow transition-transform ".concat(enabled ? 'translate-x-6' : 'translate-x-1') }) }) ] }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-5 space-y-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h3", { className: "font-medium text-gray-800 text-sm", children: t('auto_response.budget_range', 'Task budget') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "grid grid-cols-2 gap-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs text-gray-500 mb-1", children: t('auto_response.min_budget', 'Min €') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "number", min: "0", value: minBudget, onChange: (e)=>setMinBudget(e.target.value), placeholder: "0", 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" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs text-gray-500 mb-1", children: t('auto_response.max_budget', 'Max €') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "number", min: "0", value: maxBudget, onChange: (e)=>setMaxBudget(e.target.value), placeholder: "∞", className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs text-gray-500 mb-1", children: t('auto_response.default_price', 'Default price €') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "number", min: "0", value: defaultPrice, onChange: (e)=>setDefaultPrice(e.target.value), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs text-gray-500 mb-1", children: t('auto_response.max_per_day', 'Max auto-offers/day') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "number", min: "1", max: "50", value: maxPerDay, onChange: (e)=>setMaxPerDay(e.target.value), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs text-gray-500 mb-1", children: t('auto_response.default_message', 'Auto-response text') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("textarea", { value: defaultMessage, onChange: (e)=>setDefaultMessage(e.target.value), rows: 4, maxLength: 2000, placeholder: t('auto_response.message_placeholder', 'Hello! I can help with this task...'), 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" }) ] }), categories.length > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h3", { className: "font-medium text-gray-800 text-sm mb-3", children: t('auto_response.categories', 'Task categories') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex flex-wrap gap-2 max-h-40 overflow-y-auto", children: categories.flatMap((cat)=>{ var _cat_children; return [ cat, ...(_cat_children = cat.children) !== null && _cat_children !== void 0 ? _cat_children : [] ]; }).map((cat)=>{ var _cat_names, _cat_names1; var _cat_names_catLocale, _ref; const name = (_ref = (_cat_names_catLocale = (_cat_names = cat.names) === null || _cat_names === void 0 ? void 0 : _cat_names[catLocale]) !== null && _cat_names_catLocale !== void 0 ? _cat_names_catLocale : (_cat_names1 = cat.names) === null || _cat_names1 === void 0 ? void 0 : _cat_names1.el) !== null && _ref !== void 0 ? _ref : cat.slug; const sel = selCategories.includes(cat.slug); return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>setSelCategories(sel ? selCategories.filter((c)=>c !== cat.slug) : [ ...selCategories, cat.slug ]), className: "px-3 py-1.5 rounded-lg text-xs border transition ".concat(sel ? 'bg-green-600 border-green-600 text-white' : 'bg-white border-gray-300 text-gray-700 hover:border-green-400'), children: name }, cat.slug); }) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", disabled: saving, onClick: ()=>onSave({ enabled, minBudget: minBudget ? Number(minBudget) : null, maxBudget: maxBudget ? Number(maxBudget) : null, defaultPrice: defaultPrice ? Number(defaultPrice) : null, defaultMessage: defaultMessage || null, maxAutoOffersPerDay: maxPerDay ? Number(maxPerDay) : null, categories: selCategories.length > 0 ? selCategories : null, locations: selLocations.length > 0 ? selLocations : null }), className: "w-full bg-green-600 text-white py-3 rounded-xl font-semibold hover:bg-green-700 disabled:opacity-50", children: saving ? t('common.loading') : saved ? t('auto_response.saved', 'Saved ✓') : t('common.save') }) ] }); } function ProfilePage() { return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(react__WEBPACK_IMPORTED_MODULE_1__.Suspense, { fallback: null, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(ProfilePageInner, {}) }); } function ProfilePageInner() { var _user_firstName, _user_lastName, _dashData_features, _dashData_features1, _dashData_features2, _user_plan, _user_plan1, _user_plan2, _dashData_features3, _dashData_features4, _dashData_plan, _dashData_plan1, _user_plan3; const router = (0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)(); const searchParams = (0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useSearchParams)(); const { data: session, isPending } = (0,_lib_auth__WEBPACK_IMPORTED_MODULE_3__/* .useSession */ .wV)(); const { t, locale } = (0,_context_locale__WEBPACK_IMPORTED_MODULE_4__/* .useLocale */ .Y)(); const validTabs = [ 'info', 'finance', 'cards', 'notifications', 'reviews', 'referral', 'auto_response', 'site' ]; var _searchParams_get; const initialTab = (_searchParams_get = searchParams.get('tab')) !== null && _searchParams_get !== void 0 ? _searchParams_get : 'info'; const [activeTab, setActiveTab] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(validTabs.includes(initialTab) ? initialTab : 'info'); const [user, setUser] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [loading, setLoading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(true); const [saving, setSaving] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [saved, setSaved] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [error, setError] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [formData, setFormData] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)({ firstName: '', lastName: '', phone: '', bio: '', locale: 'el' }); const [selectedLanguages, setSelectedLanguages] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); // Specialist cards const [cards, setCards] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [maxCards, setMaxCards] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(1); const [cardsLoading, setCardsLoading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [cardNotifications, setCardNotifications] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [openCardId, setOpenCardId] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [creatingCard, setCreatingCard] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [newCardTitle, setNewCardTitle] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [showNewCardForm, setShowNewCardForm] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [showUpgradeModal, setShowUpgradeModal] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); // Reference data const [categories, setCategories] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [locationTree, setLocationTree] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); // Become specialist const [becomingSpecialist, setBecomingSpecialist] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [avatarUploading, setAvatarUploading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [backgroundUploading, setBackgroundUploading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const fileRef = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null); const backgroundFileRef = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null); // Notification preferences const [notifyNewTasks, setNotifyNewTasks] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [notifMessages, setNotifMessages] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(true); const [notifySaving, setNotifySaving] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [notifySaved, setNotifySaved] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); // Email verification resend const [resendState, setResendState] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)('idle'); // Referral info const [referralCode, setReferralCode] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [referralCount, setReferralCount] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(0); const [referralCopied, setReferralCopied] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [referralLoaded, setReferralLoaded] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); // Balance top-up modal const [showTopUpModal, setShowTopUpModal] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [topUpAmount, setTopUpAmount] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(10); const [topUpLoading, setTopUpLoading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [topUpError, setTopUpError] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [balanceHistory, setBalanceHistory] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [planHistory, setPlanHistory] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); // Plan data + statuses const [dashData, setDashData] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [myStatuses, setMyStatuses] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [statusToggling, setStatusToggling] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [personalSiteSlug, setPersonalSiteSlug] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [slugSaving, setSlugSaving] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [slugSaved, setSlugSaved] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [slugCopied, setSlugCopied] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [slugError, setSlugError] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [showContactInfo, setShowContactInfo] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [siteSettings, setSiteSettings] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)({}); const [siteSettingsSaving, setSiteSettingsSaving] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [siteStats, setSiteStats] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [siteStatsLoading, setSiteStatsLoading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [autoResponse, setAutoResponse] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [arLoaded, setArLoaded] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [arSaving, setArSaving] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [arSaved, setArSaved] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); async function handleTopUp() { const amount = Number(topUpAmount); if (!amount || amount < 1) return; setTopUpLoading(true); setTopUpError(''); try { const { url, params } = await _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .initiateTopUp */ .oh(amount); // Build and auto-submit form to ePay const form = document.createElement('form'); form.method = 'POST'; form.action = url; Object.entries(params).forEach((param)=>{ let [k, v] = param; const input = document.createElement('input'); input.type = 'hidden'; input.name = k; input.value = v; form.appendChild(input); }); document.body.appendChild(form); form.submit(); } catch (e) { setTopUpError((e === null || e === void 0 ? void 0 : e.message) || t('profile.balance.topup.error')); setTopUpLoading(false); } } async function handleResendVerification() { if (!(user === null || user === void 0 ? void 0 : user.email) || resendState !== 'idle') return; setResendState('sending'); const callbackURL = "".concat(window.location.origin, "/profile"); const result = await _lib_auth__WEBPACK_IMPORTED_MODULE_3__/* .authClient */ .yK.sendVerificationEmail({ email: user.email, callbackURL }); if (result === null || result === void 0 ? void 0 : result.error) { setResendState('idle'); } else { setResendState('sent'); } } (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (activeTab !== 'referral' || referralLoaded) return; _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getMyReferralInfo */ .st().then((r)=>{ setReferralCode(r.referralCode); setReferralCount(r.referralCount); }).catch(()=>{}).finally(()=>setReferralLoaded(true)); }, [ activeTab ]); // Reviews const [myReviews, setMyReviews] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [reviewsLoading, setReviewsLoading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [myRating, setMyRating] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (activeTab !== 'reviews' || myReviews !== null || reviewsLoading) return; setReviewsLoading(true); _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getMyReviews */ .q7().then(setMyReviews).catch(()=>setMyReviews([])).finally(()=>setReviewsLoading(false)); }, [ activeTab ]); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (activeTab !== 'site' || siteStats !== null || siteStatsLoading) return; setSiteStatsLoading(true); _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getSiteStats */ .RN().then((res)=>setSiteStats(res.days)).catch(()=>setSiteStats([])).finally(()=>setSiteStatsLoading(false)); }, [ activeTab ]); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!isPending && !session) router.push('/login'); }, [ session, isPending ]); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!session) return; Promise.all([ _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Em('/users/me'), _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getCategories */ .bW(), _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getLocations */ .Vs(), _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getMyDashboard */ .H().catch(()=>null), _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getMyStatuses */ .z6().catch(()=>[]), _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getBalanceHistory */ .fm(8).catch(()=>[]), _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getPlanHistory */ .ew(20).catch(()=>[]) ]).then((param)=>{ let [u, cats, locs, dash, statusRes, history, phist] = param; setUser(u); var _u_firstName, _u_lastName, _u_phone, _u_bio, _u_locale; setFormData({ firstName: (_u_firstName = u.firstName) !== null && _u_firstName !== void 0 ? _u_firstName : '', lastName: (_u_lastName = u.lastName) !== null && _u_lastName !== void 0 ? _u_lastName : '', phone: (_u_phone = u.phone) !== null && _u_phone !== void 0 ? _u_phone : '', bio: (_u_bio = u.bio) !== null && _u_bio !== void 0 ? _u_bio : '', locale: (_u_locale = u.locale) !== null && _u_locale !== void 0 ? _u_locale : 'el' }); var _u_languages; setSelectedLanguages((_u_languages = u.languages) !== null && _u_languages !== void 0 ? _u_languages : []); var _u_notifyNewTasks; setNotifyNewTasks((_u_notifyNewTasks = u.notifyNewTasks) !== null && _u_notifyNewTasks !== void 0 ? _u_notifyNewTasks : false); var _u_notifMessages; setNotifMessages((_u_notifMessages = u.notifMessages) !== null && _u_notifMessages !== void 0 ? _u_notifMessages : true); setCategories(cats); setLocationTree(locs); setDashData(dash); setMyStatuses((statusRes !== null && statusRes !== void 0 ? statusRes : []).filter((s)=>s.isActive).map((s)=>s.statusType)); setBalanceHistory(history); setPlanHistory(phist); var _u_personalSiteSlug; setPersonalSiteSlug((_u_personalSiteSlug = u.personalSiteSlug) !== null && _u_personalSiteSlug !== void 0 ? _u_personalSiteSlug : ''); var _u_showContactInfo; setShowContactInfo((_u_showContactInfo = u.showContactInfo) !== null && _u_showContactInfo !== void 0 ? _u_showContactInfo : false); var _u_siteSettings; setSiteSettings((_u_siteSettings = u.siteSettings) !== null && _u_siteSettings !== void 0 ? _u_siteSettings : {}); loadCards(); _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getUserRating */ .Bm(u.id).then((r)=>setMyRating(r.avg)).catch(()=>{}); }).catch(()=>{}).finally(()=>setLoading(false)); }, [ session ]); async function loadCards() { setCardsLoading(true); try { const { cards: c, maxCards: m } = await _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getMySpecialistCards */ .Bb(); setCards(c); setMaxCards(m); setOpenCardId((prev)=>{ var _c_; var _c__id; return prev && c.some((card)=>card.id === prev) ? prev : (_c__id = (_c_ = c[0]) === null || _c_ === void 0 ? void 0 : _c_.id) !== null && _c__id !== void 0 ? _c__id : null; }); _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getNotifications */ .Tr().then((rows)=>setCardNotifications(rows.filter((row)=>[ 'specialist_card_submitted', 'specialist_card_approved', 'specialist_card_rejected' ].includes(row.type)))).catch(()=>setCardNotifications([])); } catch (e) {} finally{ setCardsLoading(false); } } async function handleSubmit(e) { e.preventDefault(); setError(''); setSaving(true); try { const updated = await _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Em('/users/me', { method: 'PATCH', body: JSON.stringify({ firstName: formData.firstName, lastName: formData.lastName, phone: formData.phone || undefined, bio: formData.bio || undefined, bioLocale: formData.locale, autoTranslateBio: true, locale: formData.locale, languages: selectedLanguages, showContactInfo }) }); setUser(updated); setSaved(true); setTimeout(()=>setSaved(false), 2500); } catch (err) { setError(err.message || t('common.error')); } finally{ setSaving(false); } } async function handleBecomeSpecialist() { setBecomingSpecialist(true); setError(''); try { const updated = await _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Em('/users/me/become-specialist', { method: 'POST' }); setUser(updated); setActiveTab('cards'); loadCards(); } catch (err) { setError(err.message || t('common.error')); } finally{ setBecomingSpecialist(false); } } async function handleSaveSiteSlug() { setSlugSaving(true); setSlugError(''); try { const updated = await _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Em('/users/me', { method: 'PATCH', body: JSON.stringify({ personalSiteSlug: personalSiteSlug || null }) }); setUser(updated); var _updated_personalSiteSlug; setPersonalSiteSlug((_updated_personalSiteSlug = updated.personalSiteSlug) !== null && _updated_personalSiteSlug !== void 0 ? _updated_personalSiteSlug : ''); setSlugSaved(true); setTimeout(()=>setSlugSaved(false), 2500); } catch (err) { var _err_code; const code = (_err_code = err === null || err === void 0 ? void 0 : err.code) !== null && _err_code !== void 0 ? _err_code : ''; if (code === 'SLUG_TAKEN' || err.message === 'This URL is already taken') { setSlugError(t('profile.site.slug_taken', 'This address is already taken')); } else { setSlugError(err.message || t('common.error')); } } finally{ setSlugSaving(false); } } async function handleSaveSiteSettings(newSettings) { setSiteSettings(newSettings); setSiteSettingsSaving(true); try { await _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Em('/users/me', { method: 'PATCH', body: JSON.stringify({ siteSettings: newSettings }) }); } catch (e) {} finally{ setSiteSettingsSaving(false); } } async function handleAvatarChange(e) { var _e_target_files; const file = (_e_target_files = e.target.files) === null || _e_target_files === void 0 ? void 0 : _e_target_files[0]; if (!file) return; setAvatarUploading(true); try { const form = new FormData(); form.append('file', file); const res = await fetch("".concat("https://api.canhelp.gr" || 0, "/api/uploads"), { method: 'POST', credentials: 'include', body: form }); if (!res.ok) throw new Error('Upload failed'); const { url } = await res.json(); const fullUrl = "".concat("https://api.canhelp.gr" || 0).concat(url); await _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Em('/users/me', { method: 'PATCH', body: JSON.stringify({ image: fullUrl }) }); setUser((prev)=>({ ...prev, image: fullUrl })); } catch (e) { setError(t('profile.upload.error')); } finally{ setAvatarUploading(false); } } async function handleBackgroundChange(e) { var _e_target_files; const file = (_e_target_files = e.target.files) === null || _e_target_files === void 0 ? void 0 : _e_target_files[0]; if (!file) return; setBackgroundUploading(true); try { const form = new FormData(); form.append('file', file); const res = await fetch("".concat("https://api.canhelp.gr" || 0, "/api/uploads"), { method: 'POST', credentials: 'include', body: form }); if (!res.ok) throw new Error('Upload failed'); const { url } = await res.json(); const fullUrl = "".concat("https://api.canhelp.gr" || 0).concat(url); const nextSettings = { ...siteSettings, profileBackgroundImage: fullUrl }; await _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Em('/users/me', { method: 'PATCH', body: JSON.stringify({ siteSettings: nextSettings }) }); setSiteSettings(nextSettings); setSaved(true); setTimeout(()=>setSaved(false), 2500); } catch (e) { setError(t('profile.upload.error')); } finally{ setBackgroundUploading(false); if (backgroundFileRef.current) backgroundFileRef.current.value = ''; } } async function handleRemoveBackground() { setBackgroundUploading(true); try { const nextSettings = { ...siteSettings, profileBackgroundImage: null }; await _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Em('/users/me', { method: 'PATCH', body: JSON.stringify({ siteSettings: nextSettings }) }); setSiteSettings(nextSettings); setSaved(true); setTimeout(()=>setSaved(false), 2500); } catch (e) { setError(t('profile.upload.error')); } finally{ setBackgroundUploading(false); } } async function handleCreateCard() { if (!newCardTitle.trim()) return; setCreatingCard(true); try { const card = await _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .createSpecialistCard */ .eR({ title: newCardTitle.trim() }); setCards((prev)=>[ ...prev, card ]); setOpenCardId(card.id); setNewCardTitle(''); setShowNewCardForm(false); } catch (err) { setError(err.message || t('common.error')); } finally{ setCreatingCard(false); } } async function handleDeleteCard(id) { if (!confirm(t('profile.cards.delete_confirm'))) return; try { await _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .deleteSpecialistCard */ .f5(id); setCards((prev)=>{ var _next_; const next = prev.filter((c)=>c.id !== id); var _next__id; if (openCardId === id) setOpenCardId((_next__id = (_next_ = next[0]) === null || _next_ === void 0 ? void 0 : _next_.id) !== null && _next__id !== void 0 ? _next__id : null); return next; }); } catch (err) { setError(err.message || t('common.error')); } } if (isPending || loading) { return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-center py-20 text-white", children: t('common.loading') }); } const catLocale = locale === 'en' ? 'en' : locale === 'ru' ? 'ru' : locale === 'uk' ? 'uk' : 'el'; const dateLocale = locale === 'en' ? 'en-US' : locale === 'ru' ? 'ru-RU' : 'el-GR'; const isSpecialist = (user === null || user === void 0 ? void 0 : user.role) === 'specialist'; const isAdmin = (user === null || user === void 0 ? void 0 : user.role) === 'admin'; const showSpecialistTabs = isSpecialist || isAdmin; var _user_firstName_, _user_lastName_; const initials = user ? "".concat((_user_firstName_ = (_user_firstName = user.firstName) === null || _user_firstName === void 0 ? void 0 : _user_firstName[0]) !== null && _user_firstName_ !== void 0 ? _user_firstName_ : '').concat((_user_lastName_ = (_user_lastName = user.lastName) === null || _user_lastName === void 0 ? void 0 : _user_lastName[0]) !== null && _user_lastName_ !== void 0 ? _user_lastName_ : '').toUpperCase() : '?'; const hasAutoResponse = !!(dashData === null || dashData === void 0 ? void 0 : (_dashData_features = dashData.features) === null || _dashData_features === void 0 ? void 0 : _dashData_features.hasAutoResponse); var _formData_bio, _ref; const profileBio = String((_ref = (_formData_bio = formData.bio) !== null && _formData_bio !== void 0 ? _formData_bio : user === null || user === void 0 ? void 0 : user.bio) !== null && _ref !== void 0 ? _ref : '').trim(); const publishedCards = cards.filter((c)=>{ var _c_publicationStatus; return ((_c_publicationStatus = c.publicationStatus) !== null && _c_publicationStatus !== void 0 ? _c_publicationStatus : c.isActive ? 'active' : 'inactive') === 'active'; }); const hasPublishedCard = publishedCards.length > 0; const hasCardCategories = publishedCards.some((c)=>{ var _c_categories; var _c_categories_length; return ((_c_categories_length = (_c_categories = c.categories) === null || _c_categories === void 0 ? void 0 : _c_categories.length) !== null && _c_categories_length !== void 0 ? _c_categories_length : 0) > 0; }); const hasCardLocations = publishedCards.some((c)=>{ var _c_locations; var _c_locations_length; return ((_c_locations_length = (_c_locations = c.locations) === null || _c_locations === void 0 ? void 0 : _c_locations.length) !== null && _c_locations_length !== void 0 ? _c_locations_length : 0) > 0; }); const moderationNoticeByCardId = cardNotifications.reduce((acc, row)=>{ if (!row.referenceId || acc[row.referenceId]) return acc; const tone = row.type === 'specialist_card_approved' ? 'green' : row.type === 'specialist_card_rejected' ? 'red' : 'amber'; const localizedTitle = row.type === 'specialist_card_approved' ? t('profile.card.review_approved', 'Card approved') : row.type === 'specialist_card_rejected' ? t('profile.card.review_rejected', 'Card rejected') : t('profile.card.review_pending', 'Pending approval'); const localizedBody = row.type === 'specialist_card_approved' ? t('profile.card.review_approved_hint', 'Your card is now visible in offers.') : row.type === 'specialist_card_rejected' ? t('profile.card.review_rejected_hint', 'Your card was not approved. Please update it and submit again.') : t('profile.card.review_pending_hint', 'Your card is being reviewed by the admin team.'); acc[row.referenceId] = { title: localizedTitle, body: localizedBody, tone }; return acc; }, {}); const listingMissing = []; if (!profileBio) listingMissing.push(t('profile.listing_requirements.bio', 'Add a short bio in the main profile section')); if (!hasPublishedCard) listingMissing.push(t('profile.listing_requirements.published_card', 'Publish at least one card')); if (!hasCardCategories) listingMissing.push(t('profile.listing_requirements.categories', 'Add at least one category to the published card')); if (!hasCardLocations) listingMissing.push(t('profile.listing_requirements.locations', 'Add at least one location to the published card')); const tabNeedsAttention = { info: !profileBio, cards: listingMissing.length > 0 }; const tabIcons = { info: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15.75 6a3.75 3.75 0 11-7.5 0 3.75 3.75 0 017.5 0zM4.501 20.118a7.5 7.5 0 0114.998 0A17.933 17.933 0 0112 21.75c-2.676 0-5.216-.584-7.499-1.632z" }) }), finance: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 6v12m-3-2.818l.879.659c1.171.879 3.07.879 4.242 0 1.172-.879 1.172-2.303 0-3.182C13.536 12.219 12.768 12 12 12c-.725 0-1.45-.22-2.003-.659-1.106-.879-1.106-2.303 0-3.182s2.9-.879 4.006 0l.415.33M21 12a9 9 0 11-18 0 9 9 0 0118 0z" }) }), cards: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M20.25 14.15v4.073a2.25 2.25 0 01-2.25 2.25h-12a2.25 2.25 0 01-2.25-2.25V6a2.25 2.25 0 012.25-2.25h4.073M15.75 3h5.25v5.25M15.75 3l-9 9" }) }), notifications: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M14.857 17.082a23.848 23.848 0 005.454-1.31A8.967 8.967 0 0118 9.75v-.7V9A6 6 0 006 9v.75a8.967 8.967 0 01-2.312 6.022c1.733.64 3.56 1.085 5.455 1.31m5.714 0a24.255 24.255 0 01-5.714 0m5.714 0a3 3 0 11-5.714 0" }) }), reviews: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M11.48 3.499a.562.562 0 011.04 0l2.125 5.111a.563.563 0 00.475.345l5.518.442c.499.04.701.663.321.988l-4.204 3.602a.563.563 0 00-.182.557l1.285 5.385a.562.562 0 01-.84.61l-4.725-2.885a.562.562 0 00-.586 0L6.982 20.54a.562.562 0 01-.84-.61l1.285-5.386a.562.562 0 00-.182-.557l-4.204-3.602a.562.562 0 01.321-.988l5.518-.442a.563.563 0 00.475-.345L11.48 3.5z" }) }), referral: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M13.19 8.688a4.5 4.5 0 011.242 7.244l-4.5 4.5a4.5 4.5 0 01-6.364-6.364l1.757-1.757m13.35-.622l1.757-1.757a4.5 4.5 0 00-6.364-6.364l-4.5 4.5a4.5 4.5 0 001.242 7.244" }) }), auto_response: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9.813 15.904L9 18.75l-.813-2.846a4.5 4.5 0 00-3.09-3.09L2.25 12l2.846-.813a4.5 4.5 0 003.09-3.09L9 5.25l.813 2.846a4.5 4.5 0 003.09 3.09L15.75 12l-2.846.813a4.5 4.5 0 00-3.09 3.09z" }) }), site: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 21a9.004 9.004 0 008.716-6.747M12 21a9.004 9.004 0 01-8.716-6.747M12 21c2.485 0 4.5-4.03 4.5-9S14.485 3 12 3m0 18c-2.485 0-4.5-4.03-4.5-9S9.515 3 12 3m0 0a8.997 8.997 0 017.843 4.582M12 3a8.997 8.997 0 00-7.843 4.582m15.686 0A11.953 11.953 0 0112 10.5c-2.998 0-5.74-1.1-7.843-2.918m15.686 0A8.959 8.959 0 0121 12c0 .778-.099 1.533-.284 2.253m0 0A17.919 17.919 0 0112 16.5c-3.162 0-6.133-.815-8.716-2.247m0 0A9.015 9.015 0 013 12c0-1.605.42-3.113 1.157-4.418" }) }) }; const tabs = showSpecialistTabs ? [ { id: 'info', label: t('profile.tab.info') }, { id: 'cards', label: t('profile.tab.cards') }, { id: 'notifications', label: t('profile.tab.notifications') }, { id: 'reviews', label: t('profile.tab.reviews') }, { id: 'finance', label: t('profile.tab.finance') }, { id: 'referral', label: t('profile.tab.referral') }, ...hasAutoResponse ? [ { id: 'auto_response', label: t('profile.tab.auto_response', 'Auto response') } ] : [], ...(dashData === null || dashData === void 0 ? void 0 : (_dashData_features1 = dashData.features) === null || _dashData_features1 === void 0 ? void 0 : _dashData_features1.hasPersonalSite) ? [ { id: 'site', label: t('profile.tab.site') } ] : [] ] : [ { id: 'info', label: t('profile.tab.info') }, { id: 'cards', label: t('profile.tab.cards') }, { id: 'notifications', label: t('profile.tab.notifications') }, { id: 'reviews', label: t('profile.tab.reviews') }, { id: 'finance', label: t('profile.tab.finance') }, { id: 'referral', label: t('profile.tab.referral') }, ...(dashData === null || dashData === void 0 ? void 0 : (_dashData_features2 = dashData.features) === null || _dashData_features2 === void 0 ? void 0 : _dashData_features2.hasPersonalSite) ? [ { id: 'site', label: t('profile.tab.site') } ] : [] ]; var _user_lastName1, _user_name, _user_balance, _user_plan_features, _user_plan_name; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "max-w-4xl mx-auto px-4 py-8", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-4 mb-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "w-14 h-14 rounded-full flex-shrink-0 overflow-hidden border-2 border-white/40 flex items-center justify-center text-green-700 text-xl font-bold bg-green-100 cursor-pointer", onClick: ()=>{ var _fileRef_current; setActiveTab('info'); (_fileRef_current = fileRef.current) === null || _fileRef_current === void 0 ? void 0 : _fileRef_current.click(); }, title: t('profile.photo.change'), children: (user === null || user === void 0 ? void 0 : user.image) ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: user.image, alt: user.name, className: "w-full h-full object-cover" }) : initials }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h1", { className: "text-xl font-bold text-white leading-tight", children: (user === null || user === void 0 ? void 0 : user.firstName) ? "".concat(user.firstName, " ").concat((_user_lastName1 = user.lastName) !== null && _user_lastName1 !== void 0 ? _user_lastName1 : '').trim() : (_user_name = user === null || user === void 0 ? void 0 : user.name) !== null && _user_name !== void 0 ? _user_name : t('nav.profile') }), myRating && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-1 mt-0.5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-yellow-300", children: "★" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "font-semibold text-white text-sm", children: Number(myRating).toFixed(1) }), myReviews !== null && myReviews.length > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "text-white/60 text-xs", children: [ "(", myReviews.length, ")" ] }) ] }) ] }) ] }), !cardsLoading && cards.length === 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "mb-6 rounded-2xl border border-amber-300 bg-amber-50/95 p-4 sm:p-5 shadow-sm", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm font-semibold text-amber-950", children: t('profile.cards.empty', 'No offers yet') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs leading-relaxed text-amber-800 mt-1 max-w-2xl", children: t('profile.cards.empty_hint', 'СПзЎайте первую картПчку, чтПбы пПказать услугО клОеМтаЌ.') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>{ setActiveTab('cards'); setShowNewCardForm(true); }, className: "inline-flex items-center justify-center rounded-xl bg-amber-600 px-4 py-2 text-sm font-semibold text-white transition hover:bg-amber-700", children: t('profile.cards.create_first') }) ] }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-6 items-start", children: [ tabs.length > 1 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("aside", { className: "w-52 shrink-0 hidden sm:block", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("nav", { className: "rounded-2xl overflow-hidden bg-white/10 backdrop-blur-sm", children: tabs.map((tab)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { type: "button", onClick: ()=>setActiveTab(tab.id), className: "w-full text-left px-4 py-3 text-sm font-medium transition border-b border-white/10 last:border-0 flex items-center gap-3 ".concat(activeTab === tab.id ? 'bg-white text-green-700' : 'text-white/80 hover:bg-white/10 hover:text-white'), children: [ tabIcons[tab.id], /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "flex items-center gap-1.5", children: [ tab.label, tabNeedsAttention[tab.id] && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "inline-flex items-center justify-center w-4 h-4 rounded-full bg-amber-500 text-white text-[10px] font-bold", children: "!" }) ] }) ] }, tab.id)) }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex-1 min-w-0", children: [ tabs.length > 1 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex sm:hidden bg-white/15 backdrop-blur rounded-xl p-1 mb-4 gap-1 overflow-x-auto", children: tabs.map((tab)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { type: "button", onClick: ()=>setActiveTab(tab.id), className: "flex-1 min-w-fit px-3 py-2 text-xs font-medium rounded-lg transition whitespace-nowrap flex flex-col items-center gap-0.5 ".concat(activeTab === tab.id ? 'bg-white text-green-700 shadow-sm' : 'text-white/80 hover:text-white hover:bg-white/10'), children: [ tabIcons[tab.id], /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "flex items-center gap-1.5", children: [ tab.label, tabNeedsAttention[tab.id] && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "inline-flex items-center justify-center w-4 h-4 rounded-full bg-amber-500 text-white text-[10px] font-bold", children: "!" }) ] }) ] }, tab.id)) }), activeTab === 'cards' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-4", children: [ error && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "bg-red-50 text-red-700 p-3 rounded-lg text-sm", children: error }), listingMissing.length > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-amber-50 border border-amber-300 rounded-xl p-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm font-semibold text-amber-900", children: t('profile.listing_requirements.title', 'Your profile is not shown yet in offers') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-amber-800 mt-1", children: t('profile.listing_requirements.hint', 'To make the card visible, complete these conditions:') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("ul", { className: "mt-2 list-disc pl-5 text-xs text-amber-900 space-y-0.5", children: listingMissing.map((item)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("li", { children: item }, item)) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-between", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { className: "text-sm text-white/70", children: [ t('profile.cards.count'), ": ", cards.length, " / ", maxCards === null ? '∞' : maxCards ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { type: "button", onClick: ()=>{ if (maxCards !== null && cards.length >= maxCards) { setShowUpgradeModal(true); } else { setShowNewCardForm(true); } }, className: "flex items-center gap-1.5 text-sm font-medium text-white hover:text-white/80", children: [ "+ ", t('profile.cards.add') ] }) ] }), showNewCardForm && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-green-200 p-4 space-y-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm font-medium text-gray-800", children: t('profile.cards.new_title') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: newCardTitle, onChange: (e)=>setNewCardTitle(e.target.value), onKeyDown: (e)=>{ if (e.key === 'Enter') handleCreateCard(); }, maxLength: 200, placeholder: t('profile.cards.placeholder'), autoFocus: true, 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" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: handleCreateCard, disabled: creatingCard || !newCardTitle.trim(), className: "px-4 py-2 bg-green-600 hover:bg-green-700 text-white rounded-lg text-sm font-medium disabled:opacity-50", children: creatingCard ? '...' : t('profile.cards.create') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>{ setShowNewCardForm(false); setNewCardTitle(''); }, className: "px-4 py-2 bg-gray-100 hover:bg-gray-200 text-gray-700 rounded-lg text-sm font-medium", children: t('profile.cards.cancel') }) ] }) ] }), cardsLoading && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-center py-10 text-white/70", children: t('common.loading') }), !cardsLoading && cards.length === 0 && !showNewCardForm && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "text-center py-14 border-2 border-dashed border-white/30 rounded-xl", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-white/70 text-sm mb-3", children: t('profile.cards.empty') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { type: "button", onClick: ()=>setShowNewCardForm(true), className: "text-sm text-white font-medium hover:underline", children: [ "+ ", t('profile.cards.create_first') ] }) ] }), cards.map((card)=>{ var _dashData_features; const cardIssues = []; if (!profileBio) { cardIssues.push(t('profile.listing_requirements.bio', 'Add a short bio in the main profile section')); } var _card_publicationStatus; const publicationStatus = (_card_publicationStatus = card.publicationStatus) !== null && _card_publicationStatus !== void 0 ? _card_publicationStatus : card.isActive ? 'active' : 'inactive'; if (publicationStatus === 'pending') { cardIssues.push(t('profile.listing_requirements.review_pending', 'Card is under review')); } else if (publicationStatus !== 'active') { cardIssues.push(t('profile.listing_requirements.card_inactive', 'Make the card active')); } if (!card.categories || card.categories.length === 0) { cardIssues.push(t('profile.listing_requirements.categories', 'Add at least one category to the active card')); } if (!card.locations || card.locations.length === 0) { cardIssues.push(t('profile.listing_requirements.locations', 'Add at least one location to the active card')); } var _moderationNoticeByCardId_card_id; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(SpecialistCardEditor, { card: card, isOpen: openCardId === card.id, onToggle: ()=>setOpenCardId(card.id), onUpdate: (updated)=>setCards((prev)=>prev.map((c)=>c.id === updated.id ? updated : c)), onDelete: ()=>handleDeleteCard(card.id), categories: categories, locationTree: locationTree, catLocale: catLocale, locale: locale, hasPriceList: !!(dashData === null || dashData === void 0 ? void 0 : (_dashData_features = dashData.features) === null || _dashData_features === void 0 ? void 0 : _dashData_features.hasPriceList), visibilityIssues: cardIssues, moderationNotice: (_moderationNoticeByCardId_card_id = moderationNoticeByCardId[card.id]) !== null && _moderationNoticeByCardId_card_id !== void 0 ? _moderationNoticeByCardId_card_id : null }, card.id); }) ] }), activeTab === 'site' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-6 space-y-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "font-semibold text-gray-800 mb-1", children: t('profile.site.title') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400", children: t('profile.site_slug_hint') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs font-medium text-gray-500 mb-1.5", children: t('profile.site.url_label') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-2 flex-wrap", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-sm text-gray-400 shrink-0", children: "canhelp.gr/site/" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: personalSiteSlug, onChange: (e)=>setPersonalSiteSlug(e.target.value.toLowerCase().replace(/[^a-z0-9_-]/g, '')), placeholder: "my-slug", maxLength: 50, className: "flex-1 min-w-32 border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-3 flex-wrap", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: handleSaveSiteSlug, disabled: slugSaving, className: "px-5 py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700 disabled:opacity-50", children: slugSaving ? t('profile.saving') : t('common.save') }), slugSaved && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "text-sm text-green-600", children: [ "✓ ", t('profile.saved') ] }), personalSiteSlug && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { type: "button", onClick: ()=>{ navigator.clipboard.writeText("".concat(window.location.origin, "/site/").concat(personalSiteSlug)); setSlugCopied(true); setTimeout(()=>setSlugCopied(false), 2000); }, className: "px-3 py-2 border border-gray-300 rounded-lg text-sm text-gray-600 hover:bg-gray-50 flex items-center gap-1.5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z" }) }), slugCopied ? t('profile.site.copied') : t('profile.site.copy') ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("a", { href: "/site/".concat(personalSiteSlug), target: "_blank", rel: "noopener noreferrer", className: "px-3 py-2 border border-green-200 bg-green-50 rounded-lg text-sm text-green-600 hover:bg-green-100 flex items-center gap-1.5", children: [ t('profile.site_open'), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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" }) }) ] }) ] }) ] }), slugError && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-red-500", children: slugError }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-between mb-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h3", { className: "font-semibold text-gray-800", children: t('profile.site.visible_title') }), siteSettingsSaving && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-xs text-gray-400", children: t('profile.saving', 'Saving...') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "space-y-3", children: [ { key: 'showBio', label: t('profile.site.visible.bio', 'Biography') }, { key: 'showRating', label: t('profile.site.visible.rating', 'Rating and reviews') }, { key: 'showReviews', label: t('profile.site.visible.reviews', 'Reviews section') }, { key: 'showServices', label: t('profile.site.visible.services', 'Service cards') }, { key: 'showPriceList', label: t('profile.site.visible.price_list', 'Price list') }, { key: 'showPortfolio', label: t('profile.site.visible.portfolio', 'Portfolio') }, { key: 'showPhone', label: t('profile.site.visible.contacts', 'Contact phone') }, { key: 'showFullLastName', label: t('profile.site.visible.full_last_name', 'Show full last name') }, { key: 'showStatus', label: t('profile.site.visible.status', 'Status "Available now"') } ].map((param)=>{ let { key, label } = param; const checked = siteSettings[key] !== false // undefined = true by default ; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "flex items-center gap-3 cursor-pointer group", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "w-5 h-5 rounded border-2 flex items-center justify-center transition shrink-0 ".concat(checked ? 'bg-green-600 border-green-600' : 'bg-white border-gray-300 group-hover:border-green-400'), onClick: ()=>{ const next = { ...siteSettings, [key]: !checked }; handleSaveSiteSettings(next); }, children: checked && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3 h-3 text-white", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 3, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4.5 12.75l6 6 9-13.5" }) }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-sm text-gray-700 select-none", onClick: ()=>{ const next = { ...siteSettings, [key]: !checked }; handleSaveSiteSettings(next); }, children: label }) ] }, key); }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400 mt-4", children: t('profile.site.edit_bio_hint', 'Name and photo are always visible') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "mt-6 pt-4 border-t border-gray-100", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: t('profile.site.theme', 'Theme') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex gap-3", children: [ { value: 'dark', label: t('profile.site.theme.dark', 'Dark'), icon: '🌙' }, { value: 'light', label: t('profile.site.theme.light', 'Light'), icon: '☀' } ].map((opt)=>{ var _siteSettings_siteTheme; const selected = ((_siteSettings_siteTheme = siteSettings.siteTheme) !== null && _siteSettings_siteTheme !== void 0 ? _siteSettings_siteTheme : 'dark') === opt.value; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { onClick: ()=>handleSaveSiteSettings({ ...siteSettings, siteTheme: opt.value }), className: "flex-1 flex items-center justify-center gap-2 px-4 py-2.5 rounded-xl border-2 text-sm font-medium transition ".concat(selected ? 'border-green-500 bg-green-50 text-green-700' : 'border-gray-200 bg-white text-gray-500 hover:border-gray-300'), children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { children: opt.icon }), opt.label ] }, opt.value); }) }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex items-center justify-between mb-4", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h3", { className: "font-semibold text-gray-800", children: t('profile.site.stats.title', 'Site analytics') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400 mt-0.5", children: t('profile.site.stats.days', 'last 30 days') }) ] }) }), !personalSiteSlug ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-gray-400 py-4 text-center", children: t('profile.site.stats.no_slug', 'Set your site URL to view statistics') }) : siteStatsLoading || siteStats === null ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-gray-400 py-4 text-center", children: t('profile.site.stats.loading', 'Loading analytics...') }) : (()=>{ const totalViews = siteStats.reduce((s, d)=>s + d.views, 0); const totalUnique = siteStats.reduce((s, d)=>s + d.unique, 0); const totalMessages = siteStats.reduce((s, d)=>s + d.messages, 0); // Area chart helpers const days = siteStats.map((d)=>d.date); const seriesDef = [ { vals: siteStats.map((d)=>d.views), color: '#3b82f6', fill: '#3b82f615', label: t('profile.site.stats.views', 'Views') }, { vals: siteStats.map((d)=>d.unique), color: '#8b5cf6', fill: '#8b5cf610', label: t('profile.site.stats.unique', 'Unique') }, { vals: siteStats.map((d)=>d.messages), color: '#10b981', fill: '#10b98110', label: t('profile.site.stats.messages', 'Messages') } ]; const maxVal = Math.max(...seriesDef.flatMap((s)=>s.vals), 1); const W = 580; const H = 160; const padL = 36; const padB = 22; const chartW = W - padL - 4; const chartH = H - padB; const stepX = chartW / (days.length - 1); function pts(vals) { return vals.map((v, i)=>[ padL + i * stepX, chartH - v / maxVal * chartH ]); } function smoothPath(points) { if (points.length < 2) return ''; let d = "M ".concat(points[0][0].toFixed(1), " ").concat(points[0][1].toFixed(1)); for(let i = 1; i < points.length; i++){ const cpx = ((points[i - 1][0] + points[i][0]) / 2).toFixed(1); d += " C ".concat(cpx, " ").concat(points[i - 1][1].toFixed(1), " ").concat(cpx, " ").concat(points[i][1].toFixed(1), " ").concat(points[i][0].toFixed(1), " ").concat(points[i][1].toFixed(1)); } return d; } function areaPath(vals) { const points = pts(vals); const line = smoothPath(points); if (!line) return ''; const lastX = points[points.length - 1][0].toFixed(1); return "".concat(line, " L ").concat(lastX, " ").concat(chartH.toFixed(1), " L ").concat(padL.toFixed(1), " ").concat(chartH.toFixed(1), " Z"); } function fmtY(v) { return v >= 1000 ? "".concat(Math.round(v / 1000), "K") : String(v); } const yTicks = [ 0, Math.round(maxVal / 3), Math.round(maxVal * 2 / 3), maxVal ]; const xTicks = days.map((d, i)=>({ i, label: d.slice(8) })).filter((_, i)=>i % 7 === 0 || i === days.length - 1); return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "grid grid-cols-3 gap-3 mb-5", children: [ { label: t('profile.site.stats.total_views', 'Views'), value: totalViews, color: 'text-green-600', bg: 'bg-green-50' }, { label: t('profile.site.stats.total_unique', 'Unique visitors'), value: totalUnique, color: 'text-violet-600', bg: 'bg-violet-50' }, { label: t('profile.site.stats.total_messages', 'Messages'), value: totalMessages, color: 'text-emerald-600', bg: 'bg-emerald-50' } ].map((card)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "".concat(card.bg, " rounded-xl p-3 text-center"), children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-2xl font-bold ".concat(card.color), children: card.value }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-xs text-gray-500 mt-0.5", children: card.label }) ] }, card.label)) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex items-center gap-4 mb-2", children: seriesDef.map((s)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "flex items-center gap-1.5 text-xs text-gray-500", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "w-3 h-0.5 inline-block rounded", style: { background: s.color } }), s.label ] }, s.label)) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "overflow-x-auto", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { viewBox: "0 0 ".concat(W, " ").concat(H + 12), className: "w-full", style: { minWidth: 320 }, children: [ yTicks.map((v, idx)=>{ const y = chartH - v / maxVal * chartH; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("g", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: padL, y1: y, x2: W - 4, y2: y, stroke: "#f3f4f6", strokeWidth: 1 }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("text", { x: padL - 5, y: y + 3.5, textAnchor: "end", fontSize: 9, fill: "#9ca3af", children: fmtY(v) }) ] }, "y-".concat(idx, "-").concat(v)); }), xTicks.map((param)=>{ let { i } = param; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: padL + i * stepX, y1: 0, x2: padL + i * stepX, y2: chartH, stroke: "#f9fafb", strokeWidth: 1 }, "vg-".concat(i)); }), xTicks.map((param)=>{ let { i, label } = param; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("text", { x: padL + i * stepX, y: H + 10, textAnchor: "middle", fontSize: 9, fill: "#9ca3af", children: label }, i); }), seriesDef.map((s, si)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: areaPath(s.vals), fill: s.fill }, "fill-".concat(si))), seriesDef.map((s, si)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: smoothPath(pts(s.vals)), fill: "none", stroke: s.color, strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round" }, "line-".concat(si))), seriesDef.map((s, si)=>{ const points = pts(s.vals); const last = points[points.length - 1]; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("circle", { cx: last[0], cy: last[1], r: 4, fill: "white", stroke: s.color, strokeWidth: 2 }, "dot-".concat(si)); }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: padL, y1: chartH, x2: W - 4, y2: chartH, stroke: "#e5e7eb", strokeWidth: 1 }) ] }) }) ] }); })() ] }) ] }), activeTab === 'reviews' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "space-y-4", children: myReviews === null ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-center py-10 text-white/70", children: t('common.loading') }) : myReviews.length === 0 ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "text-center py-20 text-white/60", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-4xl mb-3", children: "⭐" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { children: t('profile.no_reviews') }) ] }) : myReviews.map((param)=>{ let { review, author } = param; var _author_name_, _author_name; var _author_name__toUpperCase, _author_name1; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "bg-white rounded-xl border border-gray-200 p-4", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-start gap-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "w-9 h-9 rounded-full bg-gray-100 flex-shrink-0 flex items-center justify-center text-gray-600 text-sm font-bold overflow-hidden", children: (author === null || author === void 0 ? void 0 : author.image) ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: author.image, alt: author.name, className: "w-full h-full object-cover" }) : (_author_name__toUpperCase = author === null || author === void 0 ? void 0 : (_author_name = author.name) === null || _author_name === void 0 ? void 0 : (_author_name_ = _author_name[0]) === null || _author_name_ === void 0 ? void 0 : _author_name_.toUpperCase()) !== null && _author_name__toUpperCase !== void 0 ? _author_name__toUpperCase : '?' }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex-1", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-2 mb-1", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-sm font-medium text-gray-800", children: (_author_name1 = author === null || author === void 0 ? void 0 : author.name) !== null && _author_name1 !== void 0 ? _author_name1 : '—' }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "text-yellow-400", children: [ '★'.repeat(review.rating), '☆'.repeat(5 - review.rating) ] }) ] }), review.comment && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-gray-600", children: review.comment }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400 mt-1", children: new Date(review.createdAt).toLocaleDateString() }) ] }) ] }) }, review.id); }) }), activeTab === 'finance' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-between mb-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "font-semibold text-gray-800", children: t('profile.balance') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { onClick: ()=>{ setTopUpAmount(10); setTopUpError(''); setShowTopUpModal(true); }, className: "flex items-center gap-1.5 text-sm font-medium text-green-600 hover:text-green-700 hover:bg-green-50 px-3 py-1.5 rounded-lg transition-colors", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 4v16m8-8H4" }) }), t('profile.balance.topup') ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-3 p-4 bg-green-50 rounded-xl border border-green-100", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-6 h-6 text-green-600 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 8c-1.657 0-3 .895-3 2s1.343 2 3 2 3 .895 3 2-1.343 2-3 2m0-8c1.11 0 2.08.402 2.599 1M12 8V7m0 1v8m0 0v1m0-1c-1.11 0-2.08-.402-2.599-1M21 12a9 9 0 11-18 0 9 9 0 0118 0z" }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "text-xl font-bold text-green-700", children: [ parseFloat((_user_balance = user === null || user === void 0 ? void 0 : user.balance) !== null && _user_balance !== void 0 ? _user_balance : '0').toFixed(2), " EUR" ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "mt-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-between mb-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h3", { className: "text-sm font-semibold text-gray-800", children: t('profile.balance.history', 'Operation history') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-xs text-gray-400", children: t('profile.balance.history.last', 'Latest operations') }) ] }), balanceHistory.length === 0 ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "rounded-xl border border-dashed border-gray-200 px-4 py-6 text-sm text-gray-400 text-center", children: t('profile.balance.history.empty', 'No operations yet') }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "space-y-2", children: balanceHistory.map((entry)=>{ const isCredit = entry.direction === 'credit'; const amount = Number(entry.amount).toFixed(2); const badgeClass = isCredit ? 'bg-emerald-50 text-emerald-700 border-emerald-100' : 'bg-rose-50 text-rose-700 border-rose-100'; const title = entry.kind === 'topup' ? t('profile.balance.history.kind.topup', 'Balance top-up') : entry.kind === 'plan_purchase' ? t('profile.balance.history.kind.plan_purchase', 'Plan charge') : entry.kind === 'admin_topup' ? t('profile.balance.history.kind.admin_topup', 'Admin top-up') : t('profile.balance.history.kind.admin_adjustment', 'Admin adjustment'); return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "rounded-xl border border-gray-200 px-4 py-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-start justify-between gap-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "min-w-0", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-sm font-medium text-gray-900", children: entry.description || title }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-xs text-gray-500 mt-1", children: new Date(entry.createdAt).toLocaleString(dateLocale) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "shrink-0 rounded-full border px-2.5 py-1 text-xs font-semibold ".concat(badgeClass), children: [ isCredit ? '+' : '-', amount, " ", entry.currency ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "mt-2 text-xs text-gray-500", children: [ t('profile.balance.history.balance_after', 'Balance after'), ": ", Number(entry.balanceAfter).toFixed(2), " ", entry.currency ] }) ] }, entry.id); }) }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "font-semibold text-gray-800 mb-4", children: t('profile.plan_history.title', 'Plan history') }), planHistory.length === 0 ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "rounded-xl border border-dashed border-gray-200 px-4 py-6 text-sm text-gray-400 text-center", children: t('profile.plan_history.empty', 'Plan change history is empty') }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "space-y-2", children: planHistory.map((entry)=>{ const eventColors = { activated: 'bg-green-50 text-green-700 border-green-100', renewed: 'bg-emerald-50 text-emerald-700 border-emerald-100', downgraded: 'bg-rose-50 text-rose-700 border-rose-100', referral_reward: 'bg-amber-50 text-amber-700 border-amber-100', admin_change: 'bg-purple-50 text-purple-700 border-purple-100', expired: 'bg-gray-100 text-gray-600 border-gray-200' }; const eventLabels = { activated: t('profile.plan_history.event.activated', 'Activated'), renewed: t('profile.plan_history.event.renewed', 'Renewed'), downgraded: t('profile.plan_history.event.downgraded', 'Downgraded'), referral_reward: t('profile.plan_history.event.referral_reward', 'Referral reward'), admin_change: t('profile.plan_history.event.admin_change', 'Changed by admin'), expired: t('profile.plan_history.event.expired', 'Expired') }; var _eventColors_entry_event; const badgeClass = (_eventColors_entry_event = eventColors[entry.event]) !== null && _eventColors_entry_event !== void 0 ? _eventColors_entry_event : 'bg-gray-100 text-gray-600 border-gray-200'; var _eventLabels_entry_event; const label = (_eventLabels_entry_event = eventLabels[entry.event]) !== null && _eventLabels_entry_event !== void 0 ? _eventLabels_entry_event : entry.event; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "rounded-xl border border-gray-200 px-4 py-3", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-start justify-between gap-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "min-w-0", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-2 flex-wrap", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-sm font-semibold text-gray-900", children: entry.planName }), entry.previousPlanName && entry.previousPlanName !== entry.planName && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "text-xs text-gray-400", children: [ "← ", entry.previousPlanName ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-xs text-gray-500 mt-1", children: new Date(entry.createdAt).toLocaleString(dateLocale) }), entry.expiresAt && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "text-xs text-gray-500 mt-0.5", children: [ t('profile.plan_history.expires', 'Until'), ": ", new Date(entry.expiresAt).toLocaleDateString(dateLocale) ] }), entry.daysAdded && entry.event === 'referral_reward' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "text-xs text-amber-600 mt-0.5", children: [ "+", entry.daysAdded, " ", t('profile.plan_history.days', 'days') ] }), entry.note && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-xs text-gray-400 mt-0.5", children: entry.note }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "shrink-0 rounded-full border px-2.5 py-1 text-xs font-semibold ".concat(badgeClass), children: label }) ] }) }, entry.id); }) }) ] }), showTopUpModal && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "fixed inset-0 z-50 flex items-end sm:items-center justify-center p-4 bg-black/40 backdrop-blur-sm", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-2xl shadow-2xl w-full max-w-sm p-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-between mb-5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h3", { className: "text-lg font-semibold text-gray-900", children: t('profile.balance.topup.title') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>setShowTopUpModal(false), className: "text-gray-400 hover:text-gray-600", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-5 h-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" }) }) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-gray-500 mb-3", children: t('profile.balance.topup.hint') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "grid grid-cols-4 gap-2 mb-4", children: [ 5, 10, 20, 50 ].map((v)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { onClick: ()=>setTopUpAmount(v), className: "py-2 rounded-xl text-sm font-semibold border transition-colors ".concat(Number(topUpAmount) === v ? 'bg-green-600 text-white border-green-600' : 'border-gray-200 text-gray-700 hover:border-green-400'), children: [ "€", v ] }, v)) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "mb-5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('profile.balance.topup.amount') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "relative", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "absolute left-3 top-1/2 -translate-y-1/2 text-gray-400 text-sm", children: "€" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "number", min: "1", max: "9999", step: "1", value: topUpAmount, onChange: (e)=>setTopUpAmount(e.target.value), className: "w-full pl-7 pr-4 py-2.5 border border-gray-300 rounded-xl text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }) ] }), topUpError && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-red-600 mb-3", children: topUpError }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: handleTopUp, disabled: topUpLoading || !Number(topUpAmount) || Number(topUpAmount) < 1, className: "w-full py-3 bg-green-600 hover:bg-green-700 disabled:bg-gray-300 disabled:cursor-not-allowed text-white font-semibold rounded-xl transition-colors flex items-center justify-center gap-2", children: topUpLoading ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-4 h-4 animate-spin", fill: "none", viewBox: "0 0 24 24", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { className: "opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8v8z" }) ] }), t('profile.balance.topup.loading') ] }) : t('profile.balance.topup.submit') }) ] }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "font-semibold text-gray-800 mb-3", children: t('profile.plan.title') }), (user === null || user === void 0 ? void 0 : user.plan) ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-start gap-3 p-4 bg-green-50 rounded-xl border border-green-100", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-6 h-6 text-gray-500 shrink-0 mt-0.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M3 10h18M7 15h1m4 0h1m-7 4h12a3 3 0 003-3V8a3 3 0 00-3-3H6a3 3 0 00-3 3v8a3 3 0 003 3z" }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "font-semibold text-gray-900", children: user.plan.name }), user.plan.description && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-gray-500 mt-0.5", children: user.plan.description }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex flex-wrap gap-3 mt-2 text-xs text-gray-500", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "font-medium text-green-700", children: [ user.plan.price, " ", user.plan.currency ] }), user.plan.maxCards != null ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { children: [ t('profile.plan.cards_up_to'), " ", user.plan.maxCards ] }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { children: t('profile.plan.cards_unlimited') }), user.plan.maxTasks != null && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { children: [ t('profile.plan.tasks_up_to'), " ", user.plan.maxTasks ] }), user.plan.maxOffers != null && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { children: [ t('profile.plan.offers_up_to'), " ", user.plan.maxOffers ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: user.planExpiresAt && new Date(user.planExpiresAt) < new Date(Date.now() + 7 * 24 * 60 * 60 * 1000) ? 'text-red-500 font-medium' : '', children: user.planExpiresAt ? "".concat(t('profile.plan.valid_until'), " ").concat(new Date(user.planExpiresAt).toLocaleDateString()) : t('profile.plan.no_expiry') }) ] }), ((_user_plan_features = user.plan.features) !== null && _user_plan_features !== void 0 ? _user_plan_features : []).length > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("ul", { className: "mt-2 space-y-0.5", children: user.plan.features.map((f, i)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("li", { className: "text-xs text-gray-600 flex items-center gap-1.5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-green-500", children: "✓" }), " ", f ] }, i)) }) ] }) ] }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-3 p-4 bg-gray-50 rounded-xl border border-gray-100", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-5 h-5 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm font-medium text-gray-700", children: t('profile.plan.basic') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400 mt-0.5", children: t('profile.plan.contact_upgrade') }) ] }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-center", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("a", { href: "/pricing", className: "inline-flex items-center gap-1.5 text-sm font-medium text-white/70 hover:text-white transition", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M13 7l5 5m0 0l-5 5m5-5H6" }) }), t('pricing.title', 'Pricing') ] }) }) ] }), activeTab !== 'cards' && activeTab !== 'reviews' && activeTab !== 'finance' && activeTab !== 'site' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("form", { onSubmit: handleSubmit, className: "space-y-6", children: [ error && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "bg-red-50 text-red-700 p-3 rounded-lg text-sm", children: error }), saved && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-green-50 text-green-700 p-3 rounded-lg text-sm", children: [ "✓ ", t('profile.saved') ] }), activeTab === 'notifications' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-6 space-y-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "font-semibold text-gray-800", children: t('notifications.title') }), notifySaved && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-green-50 text-green-700 p-3 rounded-lg text-sm", children: [ "✓ ", t('notifications.saved') ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-start justify-between gap-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex-1", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "font-medium text-gray-800 text-sm", children: t('chat.notif_messages') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-500 mt-0.5", children: t('notifications.messages.desc') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", disabled: notifySaving, onClick: async ()=>{ const next = !notifMessages; setNotifMessages(next); setNotifySaving(true); try { await _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Em('/users/me', { method: 'PATCH', body: JSON.stringify({ notifMessages: next }) }); setNotifySaved(true); setTimeout(()=>setNotifySaved(false), 2500); } catch (e) { setNotifMessages(!next); } finally{ setNotifySaving(false); } }, className: "relative inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full transition-colors focus:outline-none focus:ring-2 focus:ring-green-500 focus:ring-offset-2 disabled:opacity-50 ".concat(notifMessages ? 'bg-green-600' : 'bg-gray-200'), role: "switch", "aria-checked": notifMessages, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "inline-block h-4 w-4 transform rounded-full bg-white shadow transition-transform ".concat(notifMessages ? 'translate-x-6' : 'translate-x-1') }) }) ] }), showSpecialistTabs && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-start justify-between gap-4 ".concat(!(user === null || user === void 0 ? void 0 : (_user_plan = user.plan) === null || _user_plan === void 0 ? void 0 : _user_plan.notifyNewTasks) ? 'opacity-60' : ''), children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex-1", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "font-medium text-gray-800 text-sm", children: t('notifications.email.new_tasks') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-500 mt-0.5", children: t('notifications.email.new_tasks.desc') }), !(user === null || user === void 0 ? void 0 : (_user_plan1 = user.plan) === null || _user_plan1 === void 0 ? void 0 : _user_plan1.notifyNewTasks) && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { className: "text-xs text-amber-600 mt-1", children: [ "\uD83D\uDD12 ", t('notifications.plan_required') ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", disabled: notifySaving || !(user === null || user === void 0 ? void 0 : (_user_plan2 = user.plan) === null || _user_plan2 === void 0 ? void 0 : _user_plan2.notifyNewTasks), onClick: async ()=>{ const next = !notifyNewTasks; setNotifyNewTasks(next); setNotifySaving(true); try { await _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Em('/users/me', { method: 'PATCH', body: JSON.stringify({ notifyNewTasks: next }) }); setNotifySaved(true); setTimeout(()=>setNotifySaved(false), 2500); } catch (e) { setNotifyNewTasks(!next); } finally{ setNotifySaving(false); } }, className: "relative inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full transition-colors focus:outline-none focus:ring-2 focus:ring-green-500 focus:ring-offset-2 disabled:opacity-50 ".concat(notifyNewTasks ? 'bg-green-600' : 'bg-gray-200'), role: "switch", "aria-checked": notifyNewTasks, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "inline-block h-4 w-4 transform rounded-full bg-white shadow transition-transform ".concat(notifyNewTasks ? 'translate-x-6' : 'translate-x-1') }) }) ] }) ] }), activeTab === 'referral' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-6 space-y-5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "font-semibold text-gray-800", children: t('profile.referral.title') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-gray-500", children: t('profile.referral.desc') }), !referralLoaded ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-sm text-gray-400", children: t('common.loading') }) : referralCode ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs font-medium text-gray-500 mb-1.5", children: t('profile.referral.link_label') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { readOnly: true, value: "".concat( true ? window.location.origin : 0, "/register?ref=").concat(referralCode), className: "flex-1 text-sm border border-gray-200 rounded-lg px-3 py-2 bg-gray-50 text-gray-700 focus:outline-none" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>{ navigator.clipboard.writeText("".concat(window.location.origin, "/register?ref=").concat(referralCode)); setReferralCopied(true); setTimeout(()=>setReferralCopied(false), 2000); }, className: "px-3 py-2 rounded-lg border border-gray-200 text-sm font-medium hover:bg-gray-50 transition whitespace-nowrap", children: referralCopied ? t('profile.referral.copied') : t('profile.referral.copy') }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-3 p-4 bg-green-50 rounded-xl", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-2xl font-bold text-green-700", children: referralCount }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-green-700", children: t('profile.referral.invited_count') }) ] }) ] }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-sm text-gray-400", children: t('profile.referral.no_code') }) ] }), activeTab === 'auto_response' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(AutoResponseTab, { categories: categories, locationTree: locationTree, loaded: arLoaded, onLoad: ()=>{ if (arLoaded) return; _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getAutoResponseSettings */ .Gp().then((s)=>{ setAutoResponse(s); setArLoaded(true); }).catch(()=>setArLoaded(true)); }, settings: autoResponse, saving: arSaving, saved: arSaved, onSave: async (data)=>{ setArSaving(true); setArSaved(false); try { const updated = await _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .updateAutoResponseSettings */ .RQ(data); setAutoResponse(updated); setArSaved(true); setTimeout(()=>setArSaved(false), 2500); } catch (e) {} finally{ setArSaving(false); } }, t: t, catLocale: catLocale }), activeTab === 'info' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "font-semibold text-gray-800 mb-4", children: t('profile.photo') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "relative", children: [ (user === null || user === void 0 ? void 0 : user.image) ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: user.image, alt: user.name, className: "w-20 h-20 rounded-full object-cover border-2 border-gray-200" }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "w-20 h-20 rounded-full bg-green-100 flex items-center justify-center text-green-700 text-2xl font-bold border-2 border-gray-200", children: initials }), avatarUploading && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "absolute inset-0 rounded-full bg-black/40 flex items-center justify-center", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "w-5 h-5 border-2 border-white border-t-transparent rounded-full animate-spin" }) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>{ var _fileRef_current; return (_fileRef_current = fileRef.current) === null || _fileRef_current === void 0 ? void 0 : _fileRef_current.click(); }, disabled: avatarUploading, className: "bg-gray-100 hover:bg-gray-200 text-gray-700 px-4 py-2 rounded-lg text-sm font-medium disabled:opacity-50", children: t('profile.photo.change') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400 mt-1", children: t('profile.photo.hint') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { ref: fileRef, type: "file", accept: "image/jpeg,image/png,image/webp", className: "hidden", onChange: handleAvatarChange }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "mt-3 rounded-lg border border-gray-200 bg-gray-50 px-3 py-2.5", children: isSpecialist ? (dashData === null || dashData === void 0 ? void 0 : (_dashData_features3 = dashData.features) === null || _dashData_features3 === void 0 ? void 0 : _dashData_features3.hasCanHelpNowStatus) ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "flex items-center justify-between cursor-pointer gap-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-xs font-medium text-gray-700", children: t('status.can_help_now', 'Available now') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", disabled: statusToggling === 'canhelp_now', onClick: async ()=>{ setStatusToggling('canhelp_now'); const nextActive = !myStatuses.includes('canhelp_now'); try { const res = await _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .toggleStatus */ .bc('canhelp_now', nextActive); setMyStatuses((prev)=>res.isActive ? [ ...prev.filter((s)=>s !== 'canhelp_now'), 'canhelp_now' ] : prev.filter((s)=>s !== 'canhelp_now')); } catch (e) {} finally{ setStatusToggling(null); } }, className: "relative inline-flex h-5 w-10 items-center rounded-full transition-colors ".concat(myStatuses.includes('canhelp_now') ? 'bg-green-500' : 'bg-gray-300', " disabled:opacity-50"), children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "inline-block h-3.5 w-3.5 transform rounded-full bg-white shadow transition-transform ".concat(myStatuses.includes('canhelp_now') ? 'translate-x-5.5' : 'translate-x-1') }) }) ] }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-amber-700", children: t('status.plan_required', 'Status is unavailable on your current plan') }) : !isAdmin ? (dashData === null || dashData === void 0 ? void 0 : (_dashData_features4 = dashData.features) === null || _dashData_features4 === void 0 ? void 0 : _dashData_features4.hasNeedHelpStatus) ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "flex items-center justify-between cursor-pointer gap-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-xs font-medium text-gray-700", children: t('status.need_help', 'Need help') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", disabled: statusToggling === 'need_help', onClick: async ()=>{ setStatusToggling('need_help'); const nextActive = !myStatuses.includes('need_help'); try { const res = await _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .toggleStatus */ .bc('need_help', nextActive); setMyStatuses((prev)=>res.isActive ? [ ...prev.filter((s)=>s !== 'need_help'), 'need_help' ] : prev.filter((s)=>s !== 'need_help')); } catch (e) {} finally{ setStatusToggling(null); } }, className: "relative inline-flex h-5 w-10 items-center rounded-full transition-colors ".concat(myStatuses.includes('need_help') ? 'bg-green-500' : 'bg-gray-300', " disabled:opacity-50"), children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "inline-block h-3.5 w-3.5 transform rounded-full bg-white shadow transition-transform ".concat(myStatuses.includes('need_help') ? 'translate-x-5.5' : 'translate-x-1') }) }) ] }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-amber-700", children: t('status.plan_required', 'Status is unavailable on your current plan') }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-600", children: t('status.admin_not_applicable', 'User status is not applicable to admin accounts') }) }) ] }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "font-semibold text-gray-800 mb-4", children: t('profile.background.title', 'Profile header background') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "w-full h-40 rounded-2xl border border-gray-200 overflow-hidden relative", style: { backgroundImage: siteSettings.profileBackgroundImage ? "linear-gradient(135deg, rgba(22,163,74,0.45), rgba(21,128,61,0.65)), url(".concat(siteSettings.profileBackgroundImage, ")") : 'linear-gradient(135deg, #22c55e 0%, #16a34a 45%, #166534 100%)', backgroundSize: 'cover', backgroundPosition: 'center' }, children: backgroundUploading && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "absolute inset-0 bg-black/35 flex items-center justify-center", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "w-6 h-6 border-2 border-white border-t-transparent rounded-full animate-spin" }) }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "mt-4 flex flex-wrap gap-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>{ var _backgroundFileRef_current; return (_backgroundFileRef_current = backgroundFileRef.current) === null || _backgroundFileRef_current === void 0 ? void 0 : _backgroundFileRef_current.click(); }, disabled: backgroundUploading, className: "bg-gray-100 hover:bg-gray-200 text-gray-700 px-4 py-2 rounded-lg text-sm font-medium disabled:opacity-50", children: backgroundUploading ? t('profile.photo.uploading', 'Uploading...') : t('profile.background.change', 'Change background') }), siteSettings.profileBackgroundImage && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: handleRemoveBackground, disabled: backgroundUploading, className: "bg-white hover:bg-gray-50 text-gray-700 px-4 py-2 rounded-lg text-sm font-medium border border-gray-200 disabled:opacity-50", children: t('profile.background.remove', 'Remove background') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { ref: backgroundFileRef, type: "file", accept: "image/jpeg,image/png,image/webp", className: "hidden", onChange: handleBackgroundChange }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400 mt-2", children: t('profile.background.hint', 'Shown in the public profile header on web and mobile app.') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-6 space-y-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "font-semibold text-gray-800", children: t('profile.basic_info') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "grid grid-cols-2 gap-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('register.first_name') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: formData.firstName, onChange: (e)=>setFormData({ ...formData, firstName: e.target.value }), required: true, className: "w-full border border-gray-300 rounded-lg px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-400 text-sm" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('register.last_name') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: formData.lastName, onChange: (e)=>setFormData({ ...formData, lastName: e.target.value }), required: true, className: "w-full border border-gray-300 rounded-lg px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-400 text-sm" }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: "Email" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: user === null || user === void 0 ? void 0 : user.email, disabled: true, className: "w-full border border-gray-200 rounded-lg px-3 py-2 text-sm text-gray-400 bg-gray-50 cursor-not-allowed" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-between mt-1.5", children: [ (user === null || user === void 0 ? void 0 : user.emailVerified) ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "flex items-center gap-1 text-xs text-green-600", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "inline-block w-1.5 h-1.5 rounded-full bg-green-500" }), t('profile.email.verified') ] }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "flex items-center gap-1 text-xs text-amber-600", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "inline-block w-1.5 h-1.5 rounded-full bg-amber-500" }), t('profile.email.not_verified') ] }), !(user === null || user === void 0 ? void 0 : user.emailVerified) && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", disabled: resendState !== 'idle', onClick: handleResendVerification, className: "text-xs text-green-600 hover:underline disabled:opacity-60 disabled:no-underline", children: resendState === 'sending' ? t('login.unverified.sending') : resendState === 'sent' ? t('login.unverified.sent') : t('login.unverified.resend') }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('profile.phone') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "tel", value: formData.phone, onChange: (e)=>setFormData({ ...formData, phone: e.target.value }), placeholder: t('profile.phone.placeholder'), className: "w-full border border-gray-300 rounded-lg px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-400 text-sm" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('profile.bio') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("textarea", { value: formData.bio, onChange: (e)=>setFormData({ ...formData, bio: e.target.value }), rows: 3, maxLength: 1000, placeholder: t('profile.bio.placeholder'), className: "w-full border border-gray-300 rounded-lg px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-400 text-sm resize-none" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('profile.language') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400 mb-2", children: t('profile.language.hint') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("select", { value: formData.locale, onChange: (e)=>setFormData({ ...formData, locale: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "el", children: "ΕλληΜικά" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "en", children: "English" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "ru", children: "РусскОй" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "uk", children: "УкраїМська" }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('profile.languages') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400 mb-2", children: t('profile.languages.hint') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex flex-wrap gap-2", children: [ { code: 'el', flag: '🇬🇷', label: 'ΕλληΜικά' }, { code: 'en', flag: '🇬🇧', label: 'English' }, { code: 'ru', flag: '🇷🇺', label: 'РусскОй' }, { code: 'uk', flag: '🇺🇊', label: 'УкраїМська' }, { code: 'de', flag: '🇩🇪', label: 'Deutsch' }, { code: 'fr', flag: '🇫🇷', label: 'Français' }, { code: 'it', flag: '🇮🇹', label: 'Italiano' }, { code: 'es', flag: '🇪🇞', label: 'Español' }, { code: 'ar', flag: '🇞🇊', label: 'العرؚية' }, { code: 'zh', flag: '🇚🇳', label: 'äž­æ–‡' } ].map((param)=>{ let { code, flag, label } = param; const selected = selectedLanguages.includes(code); return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { type: "button", onClick: ()=>setSelectedLanguages(selected ? selectedLanguages.filter((l)=>l !== code) : [ ...selectedLanguages, code ]), className: "flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-sm border transition ".concat(selected ? 'bg-green-600 border-green-600 text-white' : 'bg-white border-gray-300 text-gray-700 hover:border-green-400'), children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { children: flag }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { children: label }) ] }, code); }) }) ] }) ] }), !isSpecialist && !isAdmin && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "p-4 bg-purple-50 rounded-xl", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-gray-600 mb-3", children: t('profile.become_specialist.desc') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: handleBecomeSpecialist, disabled: becomingSpecialist, className: "bg-purple-600 hover:bg-purple-700 text-white px-5 py-2 rounded-lg text-sm font-semibold disabled:opacity-50", children: becomingSpecialist ? t('common.loading') : t('profile.become_specialist') }) ] }) }), isSpecialist && ((dashData === null || dashData === void 0 ? void 0 : (_dashData_plan = dashData.plan) === null || _dashData_plan === void 0 ? void 0 : _dashData_plan.tier) === 'pro' || (dashData === null || dashData === void 0 ? void 0 : (_dashData_plan1 = dashData.plan) === null || _dashData_plan1 === void 0 ? void 0 : _dashData_plan1.tier) === 'ultimate') && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "font-semibold text-gray-800 mb-4", children: t('profile.show_contact', 'Show contacts') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "flex items-center justify-between cursor-pointer gap-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm font-medium text-gray-800", children: t('profile.show_contact_hint', 'Clients can see your phone number') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400 mt-0.5", children: t('profile.show_contact_desc', 'Lets clients contact you directly') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>setShowContactInfo((v)=>!v), className: "relative inline-flex h-6 w-11 items-center rounded-full transition-colors ".concat(showContactInfo ? 'bg-green-500' : 'bg-gray-300'), children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "inline-block h-4 w-4 transform rounded-full bg-white shadow transition-transform ".concat(showContactInfo ? 'translate-x-6' : 'translate-x-1') }) }) ] }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "submit", disabled: saving, className: "w-full bg-green-600 text-white py-3 rounded-xl font-semibold hover:bg-green-700 disabled:opacity-50 disabled:cursor-not-allowed ".concat(activeTab === 'notifications' || activeTab === 'referral' || activeTab === 'auto_response' ? 'hidden' : ''), children: saving ? t('profile.saving') : t('common.save') }) ] }), showUpgradeModal && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "fixed inset-0 z-50 flex items-center justify-center bg-black/50 px-4", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-2xl shadow-xl p-6 w-full max-w-md", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-center mb-5", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-5xl", children: "\uD83D\uDE80" }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "text-lg font-bold text-gray-900 text-center mb-2", children: t('profile.upgrade.cards_limit') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { className: "text-sm text-gray-600 text-center mb-4", children: [ (_user_plan_name = user === null || user === void 0 ? void 0 : (_user_plan3 = user.plan) === null || _user_plan3 === void 0 ? void 0 : _user_plan3.name) !== null && _user_plan_name !== void 0 ? _user_plan_name : t('profile.plan.basic'), " — ", t('profile.plan.cards_up_to'), " ", maxCards ] }), (user === null || user === void 0 ? void 0 : user.plan) && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-gray-50 rounded-xl p-4 mb-5 text-sm text-gray-600 text-center", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "font-medium text-gray-800", children: t('profile.upgrade.plan') }), ' ', user.plan.name, " — ", user.plan.price, " ", user.plan.currency ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400 text-center mb-5", children: t('profile.upgrade.contact') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>setShowUpgradeModal(false), className: "w-full bg-green-600 hover:bg-green-700 text-white py-2.5 rounded-xl text-sm font-semibold", children: t('profile.upgrade.ok') }) ] }) }) ] }) ] }) ] }); } š« ¬t__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ ProfilePage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7541); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(1592); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(9906); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(2982); /* harmony import */ var _components_CategoryIcon__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(5940); ­?ïÿÿ’Ä61146undefined148209undefined211271undefined273324undefined326370undefined372404undefined406481undefined711719(0,_context_locale__WEBPACK_IMPORTED_MODULE_4__/* .useLocale */ .Y)undefined819826(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined869876(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined920927(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined977984(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined10701077(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined12651272(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined14601467(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined16551662(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined18431850(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined19791986(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined20692076(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined22542261(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined24592466(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined26782685(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined27552762(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined29192926(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined29782985(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined30323039(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined30823089(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined31253130(0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)undefined32013208(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined32673274(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined33303337(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined33903397(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined34403447(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined35863593(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined36503657(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined36683676(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined38163831_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getPriceList */ .Ckundefined40824105_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .createPriceListGroup */ .vDundefined45524575_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .deletePriceListGroup */ .Icundefined47404763_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .updatePriceListGroup */ .oDundefined53275349_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .createPriceListItem */ .Z2undefined62256247_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .deletePriceListItem */ .U9undefined64476455(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined65136535_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getSkillSuggestions */ .rlundefined74047427_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .updateSpecialistCard */ .zcundefined82488271_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .updateSpecialistCard */ .zcundefined1009610126"https://api.canhelp.gr"undefined10131101530undefined1086310885_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .deletePortfolioItem */ .zBundefined1120011222_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .updatePortfolioItem */ .hlundefined1255312557(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1269512699(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1291112915(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1316913172(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1343713440(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1382713830(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1408614089(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1496714970(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1536315367(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1546315467(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1566015663(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1593715940(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1613916142(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1639916403(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1675716760(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1716917172(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1757817581(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1778217785(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1830918313(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1846618470(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1863118634(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2140821412(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2154121545(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2216022163(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2286822871(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2327123275(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2351923522(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2391323916(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2464324647(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2483424837(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2500825012(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2535125354(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2599626000(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2618626189(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2713327136(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2769827701(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2826228266(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2906229065(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3004930053(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3017430178(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3042030423(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3097730981(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3128231285(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3128731298_components_CategoryIcon__WEBPACK_IMPORTED_MODULE_6__/* .CategoryIcon */ .Ezundefined3153631552(0,_components_CategoryIcon__WEBPACK_IMPORTED_MODULE_6__/* .isCategoryIconUrl */ .V)undefined3213032133(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3294132945(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3321133214(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3380433807(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3451034513(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3552635530(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3565135655(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3589735900(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3645836461(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3688736890(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3766537669(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3793537938(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3852338526(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3922639229(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3937139374(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3960539609(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3961139619react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragmentundefined3975239755(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4012240126(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined4037540378(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4064140645(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined4064740655react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragmentundefined4081040813(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4174441747(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4238942392(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4301843022(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined4302443032react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragmentundefined4318743190(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4356343566(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4441344416(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4521045213(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4542345427(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined4572445728(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined4601446017(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4644546448(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4702547029(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined4772747730(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4861348617(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined4889248895(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4979149794(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined5070450708(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined5096650969(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined5193851941(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined5303053034(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined5329253295(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined5395353956(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined5541155414(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined5561055614(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined5651656520(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined5672356726(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined5753257535(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined5825858262(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined5844858452(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined5857358576(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined5942159425(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined5942759435react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragmentundefined5957459577(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined6001060014(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined6001660024react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragmentundefined6046160464(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined6105461057(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined6134661349(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined6165261656(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined6193161934(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined6238962393(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined6271762720(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined6337563379(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined6499965002(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined6517565178(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined6585065854(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined6606466067(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined6660466608(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined6713767140(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined6729067294(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined6746067463(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined6768067683(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined6793467938(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined6808768091(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined6820468207(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined6850468507(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined6906269066(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined6917969182(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined6947869481(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined7015270156(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined7031170314(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined7075870761(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined7156671565: react__WEBPACK_IMPORTED_MODULE_1__.useEffectundefined7158471583: react__WEBPACK_IMPORTED_MODULE_1__.useStateundefined7311073113(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined7364773651(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined7374073743(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined7387173875(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined7404174045(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined7414274145(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined7440074403(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined7473574738(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined7507675079(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined7541175415(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined7557575578(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined7579975803(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined7595375957(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined7606276065(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined7634476347(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined7697876982(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined7708777090(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined7736977372(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined7804478048(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined7813778140(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined7840078403(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined7891078914(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined7900379006(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined7926879271(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined7984079844(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined7999479997(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined8023080233(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined8082880832(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined8098280985(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined8121381216(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined8229982302(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined8304383046(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined8404784061undefined8411284115(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined8411784124react__WEBPACK_IMPORTED_MODULE_1__.Suspenseundefined8418584188(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined8450084508(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)undefined8453884552(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useSearchParams)undefined8459884607(0,_lib_auth__WEBPACK_IMPORTED_MODULE_3__/* .useSession */ .wV)undefined8463884646(0,_context_locale__WEBPACK_IMPORTED_MODULE_4__/* .useLocale */ .Y)undefined8504385050(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8513585142(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8518585192(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8523385240(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8528085287(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8532785334(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8537785384(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8555285559(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8562085627(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8567085677(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8572785734(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8579885805(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8585285859(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8591285919(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8597385980(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8603786044(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8610686113(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8618586192(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8624386250(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8633886345(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8640586412(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8648086487(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8651786522(0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)undefined8656186566(0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)undefined8665586662(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8671886725(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8677886785(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8683786844(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8692986936(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8701287019(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8707487081(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8713587142(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8720087207(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8729387300(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8735287359(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8741087417(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8746787474(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8752987536(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8758587592(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8766387670(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8771987726(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8778187788(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8784987856(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8790387910(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8795887965(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8801588022(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8807088077(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8813488141(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8819588202(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8826588272(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8832088327(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8838888395(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8844988456(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8850188508(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8855488561(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8860588612(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8885888874_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .initiateTopUp */ .ohundefined8992389932_lib_auth__WEBPACK_IMPORTED_MODULE_3__/* .authClient */ .yKundefined9021090218(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined9029890318_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getMyReferralInfo */ .stundefined9057790584(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined9064190648(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined9069490701(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined9071490722(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined9085690871_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getMyReviews */ .q7undefined9100091008(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined9114391158_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getSiteStats */ .RNundefined9130691314(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined9143791445(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined9151791527_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Emundefined9155591571_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getCategories */ .bWundefined9158891603_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getLocations */ .Vsundefined9162091637_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getMyDashboard */ .Hundefined9167091686_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getMyStatuses */ .z6undefined9171791737_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getBalanceHistory */ .fmundefined9176991786_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getPlanHistory */ .ewundefined9390793923_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getUserRating */ .Bmundefined9419694219_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getMySpecialistCards */ .Bbundefined9458394602_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getNotifications */ .Trundefined9514295152_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Emundefined9611496124_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Emundefined9659896608_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Emundefined9783197841_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Emundefined9850098530"https://api.canhelp.gr"undefined98535985570undefined9883798867"https://api.canhelp.gr"undefined98872988940undefined9892898938_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Emundefined9976599795"https://api.canhelp.gr"undefined99800998220undefined100102100132"https://api.canhelp.gr"undefined1001371001590undefined100324100334_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Emundefined101101101111_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Emundefined101711101734_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .createSpecialistCard */ .eRundefined102300102323_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .deleteSpecialistCard */ .f5undefined102873102876(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined107226107229(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined107445107448(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined107765107768(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined107984107987(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined108390108393(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined108609108612(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined108926108929(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined109145109148(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined109530109533(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined109749109752(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined110280110283(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined110499110502(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined110844110847(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined111063111066(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined111417111420(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined111636111639(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined114349114353(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined114460114464(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined114596114599(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined115293115296(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined115560115564(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined115706115709(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined116278116282(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined116464116467(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined116693116696(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined117009117013(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined117606117609(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined117767117771(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined117953117957(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined118054118057(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined118323118326(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined118707118710(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined119314119318(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined119463119466(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined119595119598(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined119776119780(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined120359120363(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined120665120668(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined121226121230(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined121391121394(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined121606121610(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined122224122228(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined122546122549(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined123149123153(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined123323123326(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined123612123616(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined123842123845(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined124200124203(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined124561124564(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined124790124793(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined125115125119(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined125328125332(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined125989125993(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined127150127154(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined127387127390(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined127688127691(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined128581128585(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined128795128798(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined129482129485(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined130416130419(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined130735130739(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined130982130985(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined131272131276(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined133860133863(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined135360135364(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined135525135529(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined135761135765(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined135902135905(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined136230136233(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined136639136643(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined136780136783(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined137129137133(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined137390137393(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined137745137748(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined138704138708(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined138941138944(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined139620139624(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined140142140146(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined140148140156react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragmentundefined140303140307(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined141262141265(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined141834141837(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined142731142735(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined143476143479(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined144048144051(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined144979144982(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined145321145325(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined145547145551(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined145789145792(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined146142146145(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined146559146562(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined149815149819(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined150089150092(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined151042151045(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined151597151600(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined152180152183(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined153301153304(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined153635153639(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined153873153876(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined154225154228(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined155634155638(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined156484156487(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined157224157228(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined157450157453(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined157637157641(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined157786157789(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined158149158152(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined158669158672(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined159016159019(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined164916164920(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined164922164930react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragmentundefined165069165072(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined166931166935(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined167242167245(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined167644167647(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined168229168232(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined168449168453(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined168761168764(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined169593169596(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined169781169785(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined170586170590(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined170781170784(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined171547171550(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined172774172777(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined173788173791(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined174615174618(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined175018175021(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined176107176110(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined176908176911(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined178064178067(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined178211178214(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined178449178453(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined178648178651(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined178888178891(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined179397179400(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined179576179580(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined179790179793(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined180139180142(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined180916180920(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined181138181142(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined181406181409(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined181898181902(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined182640182643(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined182963182966(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined183634183638(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined183799183803(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined184025184029(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined184267184270(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined184587184591(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined185332185335(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined185852185855(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined186627186631(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined186905186908(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined187403187406(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined188005188009(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined188746188750(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined188954188958(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined189220189223(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined189609189612(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined190126190129(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined190495190498(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined191593191597(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined191888191892(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined192202192206(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined192509192512(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined192970192973(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined193603193607(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined194662194666(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined196008196012(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined196234196237(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined196581196584(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined196934196937(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined199509199512(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined199717199721(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined199995199999(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined200266200270(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined200587200590(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined201094201098(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined201940201943(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined202391202395(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined203256203260(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined204119204122(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined204640204643(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined205406205409(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined205636205640(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined205879205883(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined206133206136(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined206489206492(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined206797206800(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined207317207320(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined207968207971(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined208281208284(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined208768208772(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined209598209602(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined209818209821(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined210187210191(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined210435210438(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined210823210826(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined211933211936(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined212224212227(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined212785212789(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined212791212799react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragmentundefined212946212950(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined213382213385(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined214080214083(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined215059215063(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined215285215288(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined215639215643(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined215916215919(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined216420216423(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined216937216941(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined217179217182(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined217549217552(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined217902217906(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined218201218205(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined218940218944(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined219484219487(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined219799219803(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined220441220445(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined221054221057(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined221928221931(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined222155222159(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined222477222480(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined223372223376(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined223648223651(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined224145224148(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined224692224696(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined224849224852(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined225209225212(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined225841225844(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined225985225989(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined226331226334(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined226779226782(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined227565227569(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined227796227799(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined228065228069(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined228514228518(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined228750228753(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined229057229061(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined229535229539(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined229777229781(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined230011230014(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined230372230375(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined230841230844(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined231479231489_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Emundefined233107233110(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined233627233631(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined234041234045(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined234275234278(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined234646234649(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined235166235170(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined235856235859(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined236645236655_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Emundefined238277238280(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined238877238881(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined239113239116(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined239408239411(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined239713239716(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined239967239971(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined239973239981react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragmentundefined240112240116(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined240269240272(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined240645240649(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined240920240923(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined241113241136 trueundefined2411652411660undefined241551241554(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined242957242961(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined243235243238(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined243587243590(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined244099244102(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined244497244500(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined244875244901_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getAutoResponseSettings */ .Gpundefined245660245689_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .updateAutoResponseSettings */ .RQundefined246373246377(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined246379246387react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragmentundefined246502246506(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined246752246755(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined247075247079(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined247326247330(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined247645247648(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined248069248072(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined248561248564(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined248832248835(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined249362249366(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined249535249538(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined250649250652(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined251034251037(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined251685251688(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined252150252154(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined252494252497(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined252955252958(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined253775253790_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .toggleStatus */ .bcundefined255134255137(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined255756255759(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined256331256335(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined256675256678(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined257129257132(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined257943257958_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .toggleStatus */ .bcundefined259292259295(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined259912259915(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined260286260289(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined261124261128(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined261374261377(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined261737261740(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined262602262605(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined262836262839(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined263248263252(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined263501263504(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined264723264726(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined265478265481(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined266192266195(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined266668266672(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined266928266931(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined267251267255(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined267501267505(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined267674267677(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined268082268085(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined269136269140(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined269309269312(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined269716269719(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined270873270877(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined271030271033(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined271389271392(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined271930271934(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined272289272293(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined272612272615(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined273116273120(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined273439273442(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined274083274086(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined275173275177(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined275330275333(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined275700275703(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined276764276768(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined276921276924(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined277289277292(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined278439278443(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined278596278599(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined278969278972(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined279325279329(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined280123280126(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined280472280475(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined280820280823(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined281168281171(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined281745281749(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined281902281905(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined282276282279(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined282633282636(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined287214287218(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined288214288217(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined288494288497(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined289264289267(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined289459289463(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined289702289705(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined290051290054(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined291287291291(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined291537291540(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined291884291888(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined292168292172(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined292341292344(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined292777292780(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined293329293332(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined293830293833(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined294540294543(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined295234295237(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined295419295423(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined295637295640(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined295794295797(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined296098296101(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined296403296407(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined297301297305(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined297557297560(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined298305298308(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined298595298598(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined ®ŒGŒÿÿ¯<ïÿÿ—˜ eÞ«webpack/lib/util/registerExternalSerializerœwebpack-sources/ConcatSource€«webpack/lib/util/registerExternalSerializer™webpack-sources/RawSourcev__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ PersonalSitePage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7541); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(9906); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(1592); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(2982); /* harmony import */ var _components_PlanBadge__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(2035); «webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourceóÈ/* __next_internal_client_entry_do_not_use__ default auto */ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime"; import { useEffect, useState, useCallback } from 'react'; import { useParams, useRouter } from 'next/navigation'; import { useLocale } from '@/context/locale'; import { useSession } from '@/lib/auth'; import { getPublicSiteProfile, getOrCreateDirectRoom, sendMessage, request, getCategories, getLocations, trackSiteMessage, getPriceList } from '@/lib/api'; import { PlanBadge } from '@/components/PlanBadge'; export default function PersonalSitePage() { var _profile_portfolio, _profile_firstName, _profile_lastName, _profile_name_, _profile_name, _profile_siteSettings, _profile_siteSettings1, _profile_siteSettings2, _profile_portfolio1, _profile_portfolio2, _SITE_LOCALES_find; const { slug } = useParams(); const { t, locale, setLocale } = useLocale(); const { data: session } = useSession(); const router = useRouter(); const [profile, setProfile] = useState(null); const [loading, setLoading] = useState(true); const [notFound, setNotFound] = useState(false); const [msgLoading, setMsgLoading] = useState(false); const [linkCopied, setLinkCopied] = useState(false); const [lightbox, setLightbox] = useState(null); const [contactSent, setContactSent] = useState(false); const [contactForm, setContactForm] = useState({ name: '', email: '', message: '' }); const [contactLoading, setContactLoading] = useState(false); const [langOpen, setLangOpen] = useState(false); const [msgModal, setMsgModal] = useState(false); const [authModal, setAuthModal] = useState(false); const [msgText, setMsgText] = useState(''); const [msgSent, setMsgSent] = useState(false); const [catMap, setCatMap] = useState({}); const [locMap, setLocMap] = useState({}); const [locParentMap, setLocParentMap] = useState({}); const [priceLists, setPriceLists] = useState({}); const [scrolled, setScrolled] = useState(false); const dateLocale = locale === 'ru' ? 'ru-RU' : locale === 'uk' ? 'uk-UA' : locale === 'en' ? 'en-US' : 'el-GR'; useEffect(()=>{ const onScroll = ()=>setScrolled(window.scrollY > 100); window.addEventListener('scroll', onScroll, { passive: true }); return ()=>window.removeEventListener('scroll', onScroll); }, []); const LANG_MAP = { el: { flag: '🇬🇷', label: 'ΕλληΜικά' }, en: { flag: '🇬🇧', label: 'English' }, ru: { flag: '🇷🇺', label: 'РусскОй' }, uk: { flag: '🇺🇊', label: 'УкраїМська' }, de: { flag: '🇩🇪', label: 'Deutsch' }, fr: { flag: '🇫🇷', label: 'Français' }, it: { flag: '🇮🇹', label: 'Italiano' }, es: { flag: '🇪🇞', label: 'Español' }, ar: { flag: '🇞🇊', label: 'العرؚية' }, zh: { flag: '🇚🇳', label: 'äž­æ–‡' } }; const SITE_LOCALES = [ { code: 'el', flag: '🇬🇷', label: 'ΕλληΜικά' }, { code: 'en', flag: '🇬🇧', label: 'English' }, { code: 'ru', flag: '🇷🇺', label: 'РусскОй' } ]; useEffect(()=>{ if (!slug) return; getPublicSiteProfile(slug).then(setProfile).catch(()=>setNotFound(true)).finally(()=>setLoading(false)); }, [ slug ]); useEffect(()=>{ var _profile_siteSettings; const shouldShowPriceList = (profile === null || profile === void 0 ? void 0 : (_profile_siteSettings = profile.siteSettings) === null || _profile_siteSettings === void 0 ? void 0 : _profile_siteSettings.showPriceList) !== false; const cards = Array.isArray(profile === null || profile === void 0 ? void 0 : profile.cards) ? profile.cards : []; if (!profile || !shouldShowPriceList || cards.length === 0) { setPriceLists({}); return; } let cancelled = false; Promise.all(cards.map(async (card)=>[ card.id, await getPriceList(card.id, locale) ])).then((entries)=>{ if (cancelled) return; setPriceLists(Object.fromEntries(entries.filter((param)=>{ let [, groups] = param; return groups.length > 0; }))); }).catch(()=>{ if (!cancelled) setPriceLists({}); }); return ()=>{ cancelled = true; }; }, [ profile, locale ]); useEffect(()=>{ const catLocale = locale; getCategories().then((cats)=>{ const m = {}; for (const c of cats){ var _c_names_catLocale; m[c.slug] = (_c_names_catLocale = c.names[catLocale]) !== null && _c_names_catLocale !== void 0 ? _c_names_catLocale : c.names.el; var _c_children; for (const sub of (_c_children = c.children) !== null && _c_children !== void 0 ? _c_children : []){ var _sub_names_catLocale; m[sub.slug] = (_sub_names_catLocale = sub.names[catLocale]) !== null && _sub_names_catLocale !== void 0 ? _sub_names_catLocale : sub.names.el; } } setCatMap(m); }).catch(()=>{}); getLocations().then((locs)=>{ const m = {}; const pm = {}; for (const loc of locs){ var _loc_names, _loc_names1; var _loc_names_catLocale, _ref; const parentName = (_ref = (_loc_names_catLocale = (_loc_names = loc.names) === null || _loc_names === void 0 ? void 0 : _loc_names[catLocale]) !== null && _loc_names_catLocale !== void 0 ? _loc_names_catLocale : (_loc_names1 = loc.names) === null || _loc_names1 === void 0 ? void 0 : _loc_names1.el) !== null && _ref !== void 0 ? _ref : loc.slug; m[loc.slug] = parentName; var _loc_children; for (const child of (_loc_children = loc.children) !== null && _loc_children !== void 0 ? _loc_children : []){ var _child_names, _child_names1; var _child_names_catLocale, _ref1; m[child.slug] = (_ref1 = (_child_names_catLocale = (_child_names = child.names) === null || _child_names === void 0 ? void 0 : _child_names[catLocale]) !== null && _child_names_catLocale !== void 0 ? _child_names_catLocale : (_child_names1 = child.names) === null || _child_names1 === void 0 ? void 0 : _child_names1.el) !== null && _ref1 !== void 0 ? _ref1 : child.slug; pm[child.slug] = parentName; } } setLocMap(m); setLocParentMap(pm); }).catch(()=>{}); }, [ locale ]); function handleMessage() { if (!session) { setAuthModal(true); return; } setMsgModal(true); } async function handleSendMessage(e) { e.preventDefault(); if (!msgText.trim()) return; setMsgLoading(true); try { const { room } = await getOrCreateDirectRoom(profile.id); await sendMessage(room.id, msgText.trim()); trackSiteMessage(slug); setMsgSent(true); setMsgText(''); } catch (e) {} finally{ setMsgLoading(false); } } const handleContactSubmit = useCallback(async (e)=>{ e.preventDefault(); if (!contactForm.name.trim() || !contactForm.message.trim()) return; setContactLoading(true); try { await request("/users/site/".concat(slug, "/contact"), { method: 'POST', body: JSON.stringify(contactForm) }); setContactSent(true); setContactForm({ name: '', email: '', message: '' }); } catch (e) {} finally{ setContactLoading(false); } }, [ contactForm, slug ]); // Lightbox keyboard nav useEffect(()=>{ if (lightbox === null) return; const handler = (e)=>{ if (e.key === 'Escape') setLightbox(null); if (e.key === 'ArrowRight') setLightbox((i)=>{ var _profile_portfolio; var _profile_portfolio_length; return i !== null ? Math.min(i + 1, ((_profile_portfolio_length = profile === null || profile === void 0 ? void 0 : (_profile_portfolio = profile.portfolio) === null || _profile_portfolio === void 0 ? void 0 : _profile_portfolio.length) !== null && _profile_portfolio_length !== void 0 ? _profile_portfolio_length : 1) - 1) : null; }); if (e.key === 'ArrowLeft') setLightbox((i)=>i !== null ? Math.max(i - 1, 0) : null); }; document.addEventListener('keydown', handler); return ()=>document.removeEventListener('keydown', handler); }, [ lightbox, profile === null || profile === void 0 ? void 0 : (_profile_portfolio = profile.portfolio) === null || _profile_portfolio === void 0 ? void 0 : _profile_portfolio.length ]); if (loading) return /*#__PURE__*/ _jsx("div", { className: "min-h-screen flex items-center justify-center", style: { background: 'var(--site-bg)' }, children: /*#__PURE__*/ _jsxs("div", { className: "relative w-12 h-12", children: [ /*#__PURE__*/ _jsx("div", { className: "absolute inset-0 rounded-full border-2 border-green-500/20" }), /*#__PURE__*/ _jsx("div", { className: "absolute inset-0 rounded-full border-2 border-transparent border-t-blue-500 animate-spin" }) ] }) }); if (notFound || !profile) return /*#__PURE__*/ _jsxs("div", { className: "min-h-screen flex flex-col items-center justify-center gap-6", style: { background: 'var(--site-bg)' }, children: [ /*#__PURE__*/ _jsx("div", { className: "w-20 h-20 rounded-full flex items-center justify-center", style: { background: 'var(--site-surface)' }, children: /*#__PURE__*/ _jsx("svg", { className: "w-10 h-10 text-gray-500", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15.182 16.318A4.486 4.486 0 0012.016 15a4.486 4.486 0 00-3.198 1.318M21 12a9 9 0 11-18 0 9 9 0 0118 0zM9.75 9.75c0 .414-.168.75-.375.75S9 10.164 9 9.75 9.168 9 9.375 9s.375.336.375.75zm-.375 0h.008v.015h-.008V9.75zm5.625 0c0 .414-.168.75-.375.75s-.375-.336-.375-.75.168-.75.375-.75.375.336.375.75zm-.375 0h.008v.015h-.008V9.75z" }) }) }), /*#__PURE__*/ _jsx("p", { className: "text-gray-400 text-lg", children: t('common.not_found', 'Page not found') }), /*#__PURE__*/ _jsx("a", { href: "/", className: "text-gray-400 hover:text-gray-300 text-sm transition", children: t('nav.home', 'Home') }) ] }); var _profile_firstName_, _profile_lastName_; const initials = "".concat((_profile_firstName_ = (_profile_firstName = profile.firstName) === null || _profile_firstName === void 0 ? void 0 : _profile_firstName[0]) !== null && _profile_firstName_ !== void 0 ? _profile_firstName_ : '').concat((_profile_lastName_ = (_profile_lastName = profile.lastName) === null || _profile_lastName === void 0 ? void 0 : _profile_lastName[0]) !== null && _profile_lastName_ !== void 0 ? _profile_lastName_ : '').toUpperCase() || ((_profile_name = profile.name) === null || _profile_name === void 0 ? void 0 : (_profile_name_ = _profile_name[0]) === null || _profile_name_ === void 0 ? void 0 : _profile_name_.toUpperCase()) || '?'; const displayName = [ profile.firstName, profile.lastName ].filter(Boolean).join(' ') || profile.name || ''; const memberYear = profile.memberSince ? new Date(profile.memberSince).getFullYear() : null; const hasStats = profile.completedTasks > 0 || profile.rating || profile.reviewCount && profile.reviewCount > 0; const isLight = ((_profile_siteSettings = profile.siteSettings) === null || _profile_siteSettings === void 0 ? void 0 : _profile_siteSettings.siteTheme) === 'light'; const showServices = ((_profile_siteSettings1 = profile.siteSettings) === null || _profile_siteSettings1 === void 0 ? void 0 : _profile_siteSettings1.showServices) !== false; const showPriceList = ((_profile_siteSettings2 = profile.siteSettings) === null || _profile_siteSettings2 === void 0 ? void 0 : _profile_siteSettings2.showPriceList) !== false; const showCardsSection = showServices || showPriceList; var _profile_portfolio_length, _profile_portfolio_lightbox_title, _SITE_LOCALES_find_flag; return /*#__PURE__*/ _jsxs("div", { className: "site-theme min-h-screen selection:bg-green-500/30 ".concat(isLight ? 'site-light' : ''), style: { background: 'var(--site-bg)', color: 'var(--site-text)' }, children: [ lightbox !== null && ((_profile_portfolio1 = profile.portfolio) === null || _profile_portfolio1 === void 0 ? void 0 : _profile_portfolio1[lightbox]) && /*#__PURE__*/ _jsxs("div", { className: "fixed inset-0 z-50 bg-black/90 backdrop-blur-xl flex items-center justify-center p-4", onClick: ()=>setLightbox(null), children: [ /*#__PURE__*/ _jsx("button", { onClick: ()=>setLightbox(null), className: "absolute top-6 right-6 w-10 h-10 rounded-full bg-white/10 hover:bg-white/20 flex items-center justify-center transition", children: /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" }) }) }), lightbox > 0 && /*#__PURE__*/ _jsx("button", { onClick: (e)=>{ e.stopPropagation(); setLightbox(lightbox - 1); }, className: "absolute left-4 top-1/2 -translate-y-1/2 w-10 h-10 rounded-full bg-white/10 hover:bg-white/20 flex items-center justify-center transition", children: /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 19l-7-7 7-7" }) }) }), lightbox < ((_profile_portfolio_length = (_profile_portfolio2 = profile.portfolio) === null || _profile_portfolio2 === void 0 ? void 0 : _profile_portfolio2.length) !== null && _profile_portfolio_length !== void 0 ? _profile_portfolio_length : 1) - 1 && /*#__PURE__*/ _jsx("button", { onClick: (e)=>{ e.stopPropagation(); setLightbox(lightbox + 1); }, className: "absolute right-4 top-1/2 -translate-y-1/2 w-10 h-10 rounded-full bg-white/10 hover:bg-white/20 flex items-center justify-center transition", children: /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 5l7 7-7 7" }) }) }), /*#__PURE__*/ _jsx("img", { src: profile.portfolio[lightbox].imageUrl, alt: (_profile_portfolio_lightbox_title = profile.portfolio[lightbox].title) !== null && _profile_portfolio_lightbox_title !== void 0 ? _profile_portfolio_lightbox_title : '', className: "max-w-full max-h-[85vh] rounded-2xl object-contain", onClick: (e)=>e.stopPropagation() }), profile.portfolio[lightbox].title && /*#__PURE__*/ _jsx("div", { className: "absolute bottom-6 left-1/2 -translate-x-1/2 bg-black/60 backdrop-blur-md px-5 py-2.5 rounded-full text-sm", children: profile.portfolio[lightbox].title }) ] }), authModal && /*#__PURE__*/ _jsx("div", { className: "fixed inset-0 z-50 bg-black/70 backdrop-blur-sm flex items-center justify-center p-4", onClick: ()=>setAuthModal(false), children: /*#__PURE__*/ _jsxs("div", { className: "relative w-full max-w-sm rounded-2xl shadow-2xl p-6", style: { background: 'var(--site-modal-bg)', border: '1px solid var(--site-border)' }, onClick: (e)=>e.stopPropagation(), children: [ /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setAuthModal(false), className: "absolute top-4 right-4 w-8 h-8 rounded-full flex items-center justify-center transition", style: { background: 'var(--site-surface)', color: 'var(--site-text-muted)' }, children: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" }) }) }), /*#__PURE__*/ _jsx("div", { className: "w-12 h-12 rounded-full bg-green-500/10 flex items-center justify-center mb-4", children: /*#__PURE__*/ _jsx("svg", { className: "w-6 h-6 text-gray-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }) }), /*#__PURE__*/ _jsx("h3", { className: "text-base font-semibold mb-2", style: { color: 'var(--site-text)' }, children: t('site.auth_required_title', 'Authorization required') }), /*#__PURE__*/ _jsx("p", { className: "text-sm mb-5", style: { color: 'var(--site-text-muted)' }, children: t('site.auth_required_desc', 'To write in chat, sign in to your CanHelp account.') }), /*#__PURE__*/ _jsxs("div", { className: "flex flex-col gap-2.5", children: [ /*#__PURE__*/ _jsxs("a", { href: "/login", className: "w-full flex items-center justify-center gap-2 bg-green-600 hover:bg-green-500 text-white font-medium text-sm px-4 py-2.5 rounded-xl transition", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M11 16l-4-4m0 0l4-4m-4 4h14m-5 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h7a3 3 0 013 3v1" }) }), t('site.auth_login_btn', 'Sign in') ] }), /*#__PURE__*/ _jsxs("button", { type: "button", onClick: ()=>{ setAuthModal(false); setTimeout(()=>{ var _document_getElementById; (_document_getElementById = document.getElementById('contact')) === null || _document_getElementById === void 0 ? void 0 : _document_getElementById.scrollIntoView({ behavior: 'smooth', block: 'start' }); }, 100); }, className: "w-full flex items-center justify-center gap-2 text-sm font-medium px-4 py-2.5 rounded-xl transition", style: { background: 'var(--site-surface)', color: 'var(--site-text-secondary)', border: '1px solid var(--site-border)' }, children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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" }) }), t('site.auth_contact_form_btn', 'Write via contact form') ] }) ] }) ] }) }), msgModal && /*#__PURE__*/ _jsx("div", { className: "fixed inset-0 z-50 bg-black/70 backdrop-blur-sm flex items-center justify-center p-4", onClick: ()=>{ if (!msgLoading) { setMsgModal(false); setMsgSent(false); } }, children: /*#__PURE__*/ _jsxs("div", { className: "relative w-full max-w-md rounded-2xl shadow-2xl", style: { background: 'var(--site-modal-bg)', border: '1px solid var(--site-border)' }, onClick: (e)=>e.stopPropagation(), children: [ /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>{ setMsgModal(false); setMsgSent(false); }, className: "absolute top-4 right-4 w-8 h-8 rounded-full flex items-center justify-center transition", style: { background: 'var(--site-surface)', color: 'var(--site-text-muted)' }, children: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" }) }) }), /*#__PURE__*/ _jsxs("div", { className: "p-6", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 mb-5", children: [ /*#__PURE__*/ _jsx("div", { className: "w-10 h-10 rounded-full bg-green-500/10 flex items-center justify-center", children: /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5 text-gray-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }) }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("h3", { className: "text-base font-semibold", style: { color: 'var(--site-text)' }, children: t('site.write_to_chat', 'Write in chat') }), /*#__PURE__*/ _jsx("p", { className: "text-xs", style: { color: 'var(--site-text-muted)' }, children: displayName }) ] }) ] }), msgSent ? /*#__PURE__*/ _jsxs("div", { className: "text-center py-6", children: [ /*#__PURE__*/ _jsx("div", { className: "w-12 h-12 rounded-full bg-emerald-500/20 flex items-center justify-center mx-auto mb-3", children: /*#__PURE__*/ _jsx("svg", { className: "w-6 h-6 text-emerald-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" }) }) }), /*#__PURE__*/ _jsx("p", { className: "text-emerald-400 font-medium mb-1", children: t('site.message_sent', 'Message sent!') }), /*#__PURE__*/ _jsx("p", { className: "text-sm mb-4", style: { color: 'var(--site-text-muted)' }, children: t('site.message_sent_desc', 'The specialist will receive it in chat') }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>{ setMsgModal(false); setMsgSent(false); }, className: "text-sm text-gray-400 hover:text-gray-300 transition", children: t('common.close', 'Close') }) ] }) : /*#__PURE__*/ _jsxs("form", { onSubmit: handleSendMessage, children: [ /*#__PURE__*/ _jsx("textarea", { autoFocus: true, rows: 4, value: msgText, onChange: (e)=>setMsgText(e.target.value), className: "w-full rounded-xl px-4 py-3 text-sm focus:outline-none focus:border-green-500/50 transition resize-none mb-4", style: { background: 'var(--site-input-bg)', border: '1px solid var(--site-input-border)', color: 'var(--site-input-text)' }, placeholder: t('site.message_placeholder', 'Write your message...') }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-end gap-3", children: [ /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setMsgModal(false), className: "text-sm transition px-4 py-2", style: { color: 'var(--site-text-muted)' }, children: t('common.cancel', 'Cancel') }), /*#__PURE__*/ _jsxs("button", { type: "submit", disabled: msgLoading || !msgText.trim(), className: "inline-flex items-center gap-2 bg-green-600 hover:bg-green-500 text-white font-medium text-sm px-5 py-2.5 rounded-xl transition disabled:opacity-50", children: [ msgLoading ? /*#__PURE__*/ _jsx("div", { className: "w-4 h-4 rounded-full border-2 border-white/30 border-t-white animate-spin" }) : /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 19l9 2-9-18-9 18 9-2zm0 0v-8" }) }), t('site.contact_send', 'Send') ] }) ] }) ] }) ] }) ] }) }), /*#__PURE__*/ _jsx("nav", { className: "sticky top-0 z-40 backdrop-blur-xl", style: { background: 'var(--site-nav-bg)', borderBottom: '1px solid var(--site-border)' }, children: /*#__PURE__*/ _jsxs("div", { className: "max-w-5xl mx-auto px-4 sm:px-6 h-14 flex items-center justify-between", children: [ /*#__PURE__*/ _jsx("a", { href: "/", className: "logo-text-mini tracking-tight".concat(scrolled ? ' scrolled' : ''), style: { color: 'var(--site-text-secondary)' }, children: "CanHelp" }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2", children: [ (profile === null || profile === void 0 ? void 0 : profile.rating) && /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-1 text-xs mr-1", style: { color: 'var(--site-text-secondary)' }, children: [ /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5 text-amber-400", fill: "currentColor", viewBox: "0 0 20 20", children: /*#__PURE__*/ _jsx("path", { d: "M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 00-1.175 0l-2.8 2.034c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 00.951-.69l1.07-3.292z" }) }), /*#__PURE__*/ _jsx("span", { className: "font-medium", children: Number(profile.rating).toFixed(1) }) ] }), /*#__PURE__*/ _jsxs("div", { className: "relative", children: [ /*#__PURE__*/ _jsxs("button", { type: "button", onClick: ()=>setLangOpen(!langOpen), className: "flex items-center gap-1.5 text-xs transition px-2 py-1 rounded-lg", style: { color: 'var(--site-text-muted)' }, children: [ /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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" }) }), (_SITE_LOCALES_find_flag = (_SITE_LOCALES_find = SITE_LOCALES.find((l)=>l.code === locale)) === null || _SITE_LOCALES_find === void 0 ? void 0 : _SITE_LOCALES_find.flag) !== null && _SITE_LOCALES_find_flag !== void 0 ? _SITE_LOCALES_find_flag : '🌐' ] }), langOpen && /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx("div", { className: "fixed inset-0 z-40", onClick: ()=>setLangOpen(false) }), /*#__PURE__*/ _jsx("div", { className: "absolute right-0 top-full mt-1 z-50 rounded-xl shadow-xl overflow-hidden min-w-[140px]", style: { background: 'var(--site-lang-dropdown)', border: '1px solid var(--site-border)' }, children: SITE_LOCALES.map((l)=>/*#__PURE__*/ _jsxs("button", { type: "button", onClick: ()=>{ setLocale(l.code); setLangOpen(false); }, className: "w-full flex items-center gap-2 px-3 py-2 text-xs transition ".concat(locale === l.code ? 'text-gray-400 bg-green-500/10' : ''), style: locale === l.code ? {} : { color: 'var(--site-text-secondary)' }, children: [ /*#__PURE__*/ _jsx("span", { children: l.flag }), /*#__PURE__*/ _jsx("span", { children: l.label }) ] }, l.code)) }) ] }) ] }), /*#__PURE__*/ _jsx("div", { className: "w-px h-4", style: { background: 'var(--site-divider)' } }), /*#__PURE__*/ _jsxs("button", { type: "button", onClick: async ()=>{ const url = window.location.href; if (navigator.share) { try { await navigator.share({ title: displayName, url }); } catch (e) {} } else { navigator.clipboard.writeText(url); setLinkCopied(true); setTimeout(()=>setLinkCopied(false), 2000); } }, className: "flex items-center gap-1.5 text-xs transition", style: { color: 'var(--site-text-muted)' }, children: [ /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8.684 13.342C8.886 12.938 9 12.482 9 12c0-.482-.114-.938-.316-1.342m0 2.684a3 3 0 110-2.684m0 2.684l6.632 3.316m-6.632-6l6.632-3.316m0 0a3 3 0 105.367-2.684 3 3 0 00-5.367 2.684zm0 9.316a3 3 0 105.368 2.684 3 3 0 00-5.368-2.684z" }) }), linkCopied ? t('profile.site.copied') : t('site.share', 'Share') ] }) ] }) ] }) }), /*#__PURE__*/ _jsxs("section", { className: "relative overflow-hidden", children: [ /*#__PURE__*/ _jsx("div", { className: "absolute top-0 left-1/4 w-[500px] h-[500px] bg-green-600/10 rounded-full blur-[120px] pointer-events-none" }), /*#__PURE__*/ _jsx("div", { className: "absolute top-20 right-1/4 w-[400px] h-[400px] bg-purple-600/8 rounded-full blur-[100px] pointer-events-none" }), /*#__PURE__*/ _jsx("div", { className: "relative max-w-5xl mx-auto px-4 sm:px-6 pt-16 pb-20 sm:pt-24 sm:pb-28", children: /*#__PURE__*/ _jsxs("div", { className: "flex flex-col items-center text-center", children: [ /*#__PURE__*/ _jsxs("div", { className: "relative group mb-6", children: [ /*#__PURE__*/ _jsx("div", { className: "absolute -inset-1 bg-gradient-to-br from-green-600 to-purple-500 rounded-full opacity-60 blur group-hover:opacity-80 transition-opacity" }), /*#__PURE__*/ _jsx("div", { className: "relative w-28 h-28 sm:w-32 sm:h-32 rounded-full overflow-hidden border-2 flex items-center justify-center text-4xl font-bold", style: { borderColor: 'var(--site-avatar-border)', background: 'var(--site-avatar-bg)', color: 'var(--site-text)' }, children: profile.image ? /*#__PURE__*/ _jsx("img", { src: profile.image, alt: displayName, className: "w-full h-full object-cover" }) : initials }), Array.isArray(profile.activeStatuses) && profile.activeStatuses.includes('canhelp_now') && /*#__PURE__*/ _jsx("div", { className: "absolute bottom-1 right-1 w-5 h-5 bg-emerald-500 rounded-full border-2 flex items-center justify-center", style: { borderColor: 'var(--site-status-border-color)' }, children: /*#__PURE__*/ _jsx("span", { className: "w-2 h-2 rounded-full bg-white animate-pulse" }) }) ] }), /*#__PURE__*/ _jsx("h1", { className: "text-3xl sm:text-5xl font-bold tracking-tight bg-clip-text text-transparent mb-3 pb-1", style: { backgroundImage: 'linear-gradient(to bottom, var(--site-name-from), var(--site-name-to))' }, children: displayName }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-center gap-2 flex-wrap mb-4", children: [ profile.planTier && profile.planTier !== 'free' && /*#__PURE__*/ _jsx(PlanBadge, { tier: profile.planTier, verified: profile.hasVerifiedBadge, size: "md" }), Array.isArray(profile.activeStatuses) && profile.activeStatuses.includes('canhelp_now') && /*#__PURE__*/ _jsxs("span", { className: "inline-flex items-center gap-1.5 text-xs font-medium text-emerald-400 bg-emerald-500/10 border border-emerald-500/20 px-3 py-1.5 rounded-full", children: [ /*#__PURE__*/ _jsx("span", { className: "w-1.5 h-1.5 rounded-full bg-emerald-400 animate-pulse" }), t('status.can_help_now', 'Available now') ] }), memberYear && /*#__PURE__*/ _jsxs("span", { className: "text-xs px-3 py-1.5 rounded-full", style: { color: 'var(--site-text-muted)', background: 'var(--site-surface)' }, children: [ t('site.member_since', 'Member since'), " ", memberYear ] }) ] }), profile.bio && /*#__PURE__*/ _jsx("p", { className: "max-w-xl text-base sm:text-lg leading-relaxed mb-8", style: { color: 'var(--site-text-secondary)' }, children: profile.bio }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 flex-wrap justify-center", children: [ /*#__PURE__*/ _jsxs("button", { onClick: handleMessage, disabled: msgLoading, className: "group inline-flex items-center gap-2.5 bg-green-600 hover:bg-green-500 text-white font-semibold px-7 py-3.5 rounded-full transition-all hover:shadow-lg hover:shadow-blue-500/25 disabled:opacity-50", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5 group-hover:scale-110 transition-transform", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }), t('site.write_to_chat', 'Write in chat') ] }), profile.phone && /*#__PURE__*/ _jsxs("a", { href: "tel:".concat(profile.phone), className: "group inline-flex items-center gap-2.5 border font-medium px-7 py-3.5 rounded-full transition-all", style: { background: 'var(--site-phone-bg)', borderColor: 'var(--site-phone-border)', color: 'var(--site-phone-text)' }, children: [ /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5 group-hover:scale-110 transition-transform", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M3 5a2 2 0 012-2h3.28a1 1 0 01.948.684l1.498 4.493a1 1 0 01-.502 1.21l-2.257 1.13a11.042 11.042 0 005.516 5.516l1.13-2.257a1 1 0 011.21-.502l4.493 1.498a1 1 0 01.684.949V19a2 2 0 01-2 2h-1C9.716 21 3 14.284 3 6V5z" }) }), profile.phone ] }) ] }) ] }) }) ] }), hasStats && /*#__PURE__*/ _jsx("section", { className: "border-y", style: { borderColor: 'var(--site-border)', background: 'var(--site-surface)' }, children: /*#__PURE__*/ _jsx("div", { className: "max-w-5xl mx-auto px-4 sm:px-6 py-8", children: /*#__PURE__*/ _jsxs("div", { className: "grid grid-cols-2 sm:grid-cols-4 gap-6", children: [ profile.rating && /*#__PURE__*/ _jsxs("div", { className: "text-center", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-center gap-1 mb-1", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5 text-amber-400", fill: "currentColor", viewBox: "0 0 20 20", children: /*#__PURE__*/ _jsx("path", { d: "M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 00-1.175 0l-2.8 2.034c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 00.951-.69l1.07-3.292z" }) }), /*#__PURE__*/ _jsx("span", { className: "text-2xl font-bold", children: Number(profile.rating).toFixed(1) }) ] }), /*#__PURE__*/ _jsx("p", { className: "text-xs uppercase tracking-wider", style: { color: 'var(--site-text-muted)' }, children: t('site.rating', 'Rating') }) ] }), profile.reviewCount > 0 && /*#__PURE__*/ _jsxs("div", { className: "text-center", children: [ /*#__PURE__*/ _jsx("p", { className: "text-2xl font-bold mb-1", children: profile.reviewCount }), /*#__PURE__*/ _jsx("p", { className: "text-xs uppercase tracking-wider", style: { color: 'var(--site-text-muted)' }, children: t('profile.reviews') }) ] }), profile.completedTasks > 0 && /*#__PURE__*/ _jsxs("div", { className: "text-center", children: [ /*#__PURE__*/ _jsx("p", { className: "text-2xl font-bold mb-1", children: profile.completedTasks }), /*#__PURE__*/ _jsx("p", { className: "text-xs uppercase tracking-wider", style: { color: 'var(--site-text-muted)' }, children: t('site.completed_tasks', 'Completed') }) ] }), Array.isArray(profile.languages) && profile.languages.length > 0 && /*#__PURE__*/ _jsxs("div", { className: "text-center", children: [ /*#__PURE__*/ _jsx("p", { className: "text-2xl font-bold mb-1", children: profile.languages.length }), /*#__PURE__*/ _jsx("p", { className: "text-xs uppercase tracking-wider", style: { color: 'var(--site-text-muted)' }, children: t('site.languages', 'Languages') }) ] }) ] }) }) }), Array.isArray(profile.languages) && profile.languages.length > 0 && /*#__PURE__*/ _jsxs("section", { className: "max-w-5xl mx-auto px-4 sm:px-6 pt-10", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 mb-3", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", style: { color: 'var(--site-text-muted)' }, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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" }) }), /*#__PURE__*/ _jsx("span", { className: "text-sm", style: { color: 'var(--site-text-muted)' }, children: t('site.speaks_languages', 'Speaks languages') }) ] }), /*#__PURE__*/ _jsx("div", { className: "flex items-center gap-2 flex-wrap", children: profile.languages.map((lang)=>{ const info = LANG_MAP[lang]; return /*#__PURE__*/ _jsx("span", { className: "text-xs px-3 py-1.5 rounded-full flex items-center gap-1.5", style: { color: 'var(--site-tag-text)', background: 'var(--site-tag-bg)', border: '1px solid var(--site-tag-border)' }, children: info ? /*#__PURE__*/ _jsxs(_Fragment, { children: [ info.flag, " ", info.label ] }) : lang }, lang); }) }) ] }), /*#__PURE__*/ _jsxs("div", { className: "max-w-5xl mx-auto px-4 sm:px-6 pb-20 space-y-16 mt-10", children: [ showServices && Array.isArray(profile.cards) && profile.cards.length > 0 && /*#__PURE__*/ _jsxs("section", { children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 mb-6", children: [ /*#__PURE__*/ _jsx("div", { className: "w-8 h-8 rounded-lg bg-green-500/10 flex items-center justify-center", children: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-gray-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M21 13.255A23.931 23.931 0 0112 15c-3.183 0-6.22-.62-9-1.745M16 6V4a2 2 0 00-2-2h-4a2 2 0 00-2 2v2m4 6h.01M5 20h14a2 2 0 002-2V8a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z" }) }) }), /*#__PURE__*/ _jsx("h2", { className: "text-xl font-bold", children: t('specialist.services', 'Services') }) ] }), /*#__PURE__*/ _jsx("div", { className: "grid gap-4 sm:grid-cols-2", children: profile.cards.map((card)=>{ // Group locations by parent const grouped = {}; if (Array.isArray(card.locations)) { for (const slug of card.locations){ const parent = locParentMap[slug]; if (parent) { if (!grouped[parent]) grouped[parent] = []; grouped[parent].push(locMap[slug] || slug); } else { const name = locMap[slug] || slug; if (!grouped[name]) grouped[name] = []; } } } return /*#__PURE__*/ _jsxs("div", { className: "group relative rounded-2xl p-6 transition-all", style: { background: 'var(--site-card-bg)', border: '1px solid var(--site-card-border)' }, children: [ /*#__PURE__*/ _jsx("h3", { className: "font-semibold mb-2", style: { color: 'var(--site-text)' }, children: card.title }), showServices && (()=>{ const desc = (locale === 'el' ? card.descriptionEl : locale === 'en' ? card.descriptionEn : locale === 'ru' ? card.descriptionRu : card.descriptionUk) || card.descriptionEl || card.descriptionEn || card.descriptionRu || card.descriptionUk || card.description; return desc ? /*#__PURE__*/ _jsx("p", { className: "text-sm leading-relaxed mb-3", style: { color: 'var(--site-text-muted)' }, children: desc }) : null; })(), showServices && Array.isArray(card.categories) && card.categories.length > 0 && /*#__PURE__*/ _jsx("div", { className: "flex flex-wrap gap-1.5 mb-3", children: card.categories.map((slug)=>/*#__PURE__*/ _jsx("span", { className: "text-[11px] px-2.5 py-1 rounded-full bg-purple-500/10 text-purple-400 border border-purple-500/10", children: catMap[slug] || slug }, slug)) }), showServices && Object.keys(grouped).length > 0 && /*#__PURE__*/ _jsx("div", { className: "mb-3 space-y-1", children: Object.entries(grouped).map((param)=>{ let [parent, children] = param; return /*#__PURE__*/ _jsxs("div", { className: "flex items-start gap-1.5 text-xs", style: { color: 'var(--site-text-muted)' }, children: [ /*#__PURE__*/ _jsxs("svg", { className: "w-3.5 h-3.5 shrink-0 mt-0.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ _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" }), /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 11a3 3 0 11-6 0 3 3 0 016 0z" }) ] }), /*#__PURE__*/ _jsxs("span", { children: [ /*#__PURE__*/ _jsx("span", { className: "font-medium", style: { color: 'var(--site-text-secondary)' }, children: parent }), children.length > 0 && /*#__PURE__*/ _jsxs("span", { style: { color: 'var(--site-text-hint)' }, children: [ " — ", children.join(', ') ] }) ] }) ] }, parent); }) }), showServices && Array.isArray(card.skills) && card.skills.length > 0 && /*#__PURE__*/ _jsx("div", { className: "flex flex-wrap gap-1.5", children: card.skills.map((s)=>/*#__PURE__*/ _jsx("span", { className: "text-[11px] px-2.5 py-1 rounded-full bg-green-500/10 text-gray-400 border border-green-500/10", children: s }, s)) }), showPriceList && Array.isArray(priceLists[card.id]) && priceLists[card.id].length > 0 && /*#__PURE__*/ _jsxs("div", { className: "".concat(showServices ? 'mt-4 pt-4 border-t' : ''), style: { borderColor: 'var(--site-card-border)' }, children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs font-semibold uppercase tracking-wider mb-3", style: { color: 'var(--site-text-muted)' }, children: t('site.pricelist', 'Price list') }), /*#__PURE__*/ _jsx("div", { className: "space-y-3", children: priceLists[card.id].map((group)=>/*#__PURE__*/ _jsxs("div", { className: "rounded-xl p-4", style: { background: 'var(--site-surface)', border: '1px solid var(--site-card-border)' }, children: [ /*#__PURE__*/ _jsx("p", { className: "font-semibold mb-3", style: { color: 'var(--site-text)' }, children: group.title }), /*#__PURE__*/ _jsx("div", { className: "space-y-3", children: group.items.map((item)=>/*#__PURE__*/ _jsxs("div", { className: "flex items-start justify-between gap-4", children: [ /*#__PURE__*/ _jsxs("div", { className: "min-w-0", children: [ /*#__PURE__*/ _jsx("p", { className: "text-sm font-medium", style: { color: 'var(--site-text-secondary)' }, children: item.name }), item.description && /*#__PURE__*/ _jsx("p", { className: "text-xs mt-0.5", style: { color: 'var(--site-text-muted)' }, children: item.description }) ] }), (item.price || item.unit) && /*#__PURE__*/ _jsxs("div", { className: "shrink-0 text-sm font-semibold", style: { color: 'var(--site-text)' }, children: [ item.price ? "€".concat(item.price) : '', item.unit ? " ".concat(item.unit) : '' ] }) ] }, item.id)) }) ] }, group.id)) }) ] }) ] }, card.id); }) }) ] }), Array.isArray(profile.portfolio) && profile.portfolio.length > 0 && /*#__PURE__*/ _jsxs("section", { children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 mb-6", children: [ /*#__PURE__*/ _jsx("div", { className: "w-8 h-8 rounded-lg bg-purple-500/10 flex items-center justify-center", children: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-purple-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z" }) }) }), /*#__PURE__*/ _jsx("h2", { className: "text-xl font-bold", children: t('portfolio.title', 'Portfolio') }), /*#__PURE__*/ _jsxs("span", { className: "text-xs ml-auto", style: { color: 'var(--site-text-hint)' }, children: [ profile.portfolio.length, " ", t('site.photos', 'photos') ] }) ] }), /*#__PURE__*/ _jsx("div", { className: "grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 gap-3", children: profile.portfolio.map((item, idx)=>{ var _item_title; return /*#__PURE__*/ _jsxs("button", { onClick: ()=>item.imageUrl && setLightbox(idx), className: "group relative aspect-square rounded-xl overflow-hidden transition-all", style: { background: 'var(--site-surface)', border: '1px solid var(--site-card-border)' }, children: [ item.imageUrl && /*#__PURE__*/ _jsx("img", { src: item.imageUrl, alt: (_item_title = item.title) !== null && _item_title !== void 0 ? _item_title : '', className: "w-full h-full object-cover group-hover:scale-105 transition-transform duration-500" }), /*#__PURE__*/ _jsx("div", { className: "absolute inset-0 bg-gradient-to-t from-black/60 via-transparent to-transparent opacity-0 group-hover:opacity-100 transition-opacity flex items-end p-3", children: item.title && /*#__PURE__*/ _jsx("p", { className: "text-xs font-medium text-white truncate", children: item.title }) }), /*#__PURE__*/ _jsx("div", { className: "absolute top-2 right-2 w-7 h-7 rounded-full bg-black/40 backdrop-blur-md flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity", children: /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5 text-white/80", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0zM10 7v3m0 0v3m0-3h3m-3 0H7" }) }) }) ] }, item.id); }) }) ] }), Array.isArray(profile.reviews) && profile.reviews.length > 0 && /*#__PURE__*/ _jsxs("section", { children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 mb-6", children: [ /*#__PURE__*/ _jsx("div", { className: "w-8 h-8 rounded-lg bg-amber-500/10 flex items-center justify-center", children: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-amber-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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" }) }) }), /*#__PURE__*/ _jsx("h2", { className: "text-xl font-bold", children: t('profile.reviews') }), /*#__PURE__*/ _jsx("span", { className: "text-xs ml-auto", style: { color: 'var(--site-text-hint)' }, children: profile.reviewCount }) ] }), /*#__PURE__*/ _jsx("div", { className: "space-y-3", children: profile.reviews.slice(0, 6).map((review)=>{ var _review_authorFirstName, _review_authorName; const authorName = [ review.authorFirstName, review.authorLastName ].filter(Boolean).join(' ') || review.authorName || null; var _review_authorFirstName_, _ref; return /*#__PURE__*/ _jsxs("div", { className: "rounded-2xl p-5", style: { background: 'var(--site-card-bg)', border: '1px solid var(--site-card-border)' }, children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-start gap-3 mb-3", children: [ /*#__PURE__*/ _jsx("div", { className: "w-9 h-9 rounded-full flex items-center justify-center text-xs font-bold overflow-hidden shrink-0", style: { background: 'var(--site-surface)', color: 'var(--site-text-muted)' }, children: review.authorImage ? /*#__PURE__*/ _jsx("img", { src: review.authorImage, alt: "", className: "w-full h-full object-cover" }) : ((_ref = (_review_authorFirstName_ = (_review_authorFirstName = review.authorFirstName) === null || _review_authorFirstName === void 0 ? void 0 : _review_authorFirstName[0]) !== null && _review_authorFirstName_ !== void 0 ? _review_authorFirstName_ : (_review_authorName = review.authorName) === null || _review_authorName === void 0 ? void 0 : _review_authorName[0]) !== null && _ref !== void 0 ? _ref : '?').toUpperCase() }), /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between gap-2", children: [ /*#__PURE__*/ _jsx("p", { className: "text-sm font-medium", style: { color: 'var(--site-text-secondary)' }, children: authorName !== null && authorName !== void 0 ? authorName : t('common.anonymous', 'Anonymous') }), /*#__PURE__*/ _jsx("span", { className: "shrink-0 text-[11px]", style: { color: 'var(--site-text-hint)' }, children: new Date(review.createdAt).toLocaleDateString(dateLocale) }) ] }), /*#__PURE__*/ _jsx("div", { className: "flex gap-0.5 mt-0.5", children: Array.from({ length: 5 }).map((_, i)=>/*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5 ".concat(i < Math.round(review.rating) ? 'text-amber-400' : ''), style: i < Math.round(review.rating) ? {} : { color: 'var(--site-border)' }, fill: "currentColor", viewBox: "0 0 20 20", children: /*#__PURE__*/ _jsx("path", { d: "M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 00-1.175 0l-2.8 2.034c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 00.951-.69l1.07-3.292z" }) }, i)) }) ] }) ] }), review.comment && /*#__PURE__*/ _jsx("p", { className: "text-sm leading-relaxed pl-12", style: { color: 'var(--site-text-muted)' }, children: review.comment }) ] }, review.id); }) }) ] }), /*#__PURE__*/ _jsxs("section", { id: "contact", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 mb-6", children: [ /*#__PURE__*/ _jsx("div", { className: "w-8 h-8 rounded-lg bg-emerald-500/10 flex items-center justify-center", children: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-emerald-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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" }) }) }), /*#__PURE__*/ _jsx("h2", { className: "text-xl font-bold", children: t('site.contact_form', 'Contact') }) ] }), contactSent ? /*#__PURE__*/ _jsxs("div", { className: "bg-emerald-500/10 border border-emerald-500/20 rounded-2xl p-8 text-center", children: [ /*#__PURE__*/ _jsx("div", { className: "w-12 h-12 rounded-full bg-emerald-500/20 flex items-center justify-center mx-auto mb-3", children: /*#__PURE__*/ _jsx("svg", { className: "w-6 h-6 text-emerald-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" }) }) }), /*#__PURE__*/ _jsx("p", { className: "text-emerald-400 font-medium", children: t('site.contact_sent', 'Message sent!') }), /*#__PURE__*/ _jsx("p", { className: "text-sm mt-1", style: { color: 'var(--site-text-muted)' }, children: t('site.contact_sent_desc', 'The specialist will contact you shortly') }) ] }) : /*#__PURE__*/ _jsxs("form", { onSubmit: handleContactSubmit, className: "rounded-2xl p-6 space-y-4", style: { background: 'var(--site-card-bg)', border: '1px solid var(--site-card-border)' }, children: [ /*#__PURE__*/ _jsxs("div", { className: "grid gap-4 sm:grid-cols-2", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("label", { className: "text-xs uppercase tracking-wider mb-1.5 block", style: { color: 'var(--site-text-muted)' }, children: [ t('site.contact_name', 'Name'), " *" ] }), /*#__PURE__*/ _jsx("input", { type: "text", required: true, value: contactForm.name, onChange: (e)=>setContactForm((f)=>({ ...f, name: e.target.value })), className: "w-full rounded-xl px-4 py-3 text-sm focus:outline-none focus:border-green-500/50 transition", style: { background: 'var(--site-input-bg)', border: '1px solid var(--site-input-border)', color: 'var(--site-input-text)' }, placeholder: t('site.contact_name_ph', 'Your name') }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "text-xs uppercase tracking-wider mb-1.5 block", style: { color: 'var(--site-text-muted)' }, children: "Email" }), /*#__PURE__*/ _jsx("input", { type: "email", value: contactForm.email, onChange: (e)=>setContactForm((f)=>({ ...f, email: e.target.value })), className: "w-full rounded-xl px-4 py-3 text-sm focus:outline-none focus:border-green-500/50 transition", style: { background: 'var(--site-input-bg)', border: '1px solid var(--site-input-border)', color: 'var(--site-input-text)' }, placeholder: t('site.contact_email_ph', 'your@email.com') }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("label", { className: "text-xs uppercase tracking-wider mb-1.5 block", style: { color: 'var(--site-text-muted)' }, children: [ t('site.contact_message', 'Message'), " *" ] }), /*#__PURE__*/ _jsx("textarea", { required: true, rows: 4, value: contactForm.message, onChange: (e)=>setContactForm((f)=>({ ...f, message: e.target.value })), className: "w-full rounded-xl px-4 py-3 text-sm focus:outline-none focus:border-green-500/50 transition resize-none", style: { background: 'var(--site-input-bg)', border: '1px solid var(--site-input-border)', color: 'var(--site-input-text)' }, placeholder: t('site.contact_message_ph', 'Describe your task...') }) ] }), /*#__PURE__*/ _jsxs("button", { type: "submit", disabled: contactLoading, className: "inline-flex items-center gap-2 bg-green-600 hover:bg-green-500 text-white font-medium px-6 py-3 rounded-xl transition disabled:opacity-50", children: [ contactLoading ? /*#__PURE__*/ _jsx("div", { className: "w-4 h-4 rounded-full border-2 border-white/30 border-t-white animate-spin" }) : /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 19l9 2-9-18-9 18 9-2zm0 0v-8" }) }), t('site.contact_send', 'Send') ] }) ] }) ] }), /*#__PURE__*/ _jsx("footer", { className: "border-t pt-8 pb-4", style: { borderColor: 'var(--site-border)' }, children: /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between text-xs", style: { color: 'var(--site-footer-text)' }, children: [ /*#__PURE__*/ _jsx("a", { href: "/", className: "transition", children: "CanHelp.gr" }), /*#__PURE__*/ _jsxs("p", { children: [ "\xa9 ", new Date().getFullYear() ] }) ] }) }) ] }), /*#__PURE__*/ _jsx("button", { onClick: ()=>window.scrollTo({ top: 0, behavior: 'smooth' }), className: "fixed bottom-6 right-6 z-50 w-10 h-10 rounded-full flex items-center justify-center backdrop-blur-sm transition-all duration-300 ".concat(scrolled ? 'opacity-100 translate-y-0' : 'opacity-0 translate-y-4 pointer-events-none'), style: { background: 'var(--site-scroll-btn-bg)', border: '1px solid var(--site-scroll-btn-border)', color: 'var(--site-scroll-btn-text)' }, "aria-label": "Scroll to top", children: /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 15l7-7 7 7" }) }) }) ] }); } @$`=_’”ÌÎ24[]÷ù+-;V^ˆ³ŒÔÜ 5<ip¢©Û_âJQ…Œ6=kr¢©ÕÜ 6=dkž¥ÔÛ —_"M`Øàs~FN€ŒZep„¥¯×曥^d7!?!¥%š%\&`&Î&Ñ&j'_m'Y(](.)1)**.+1+X-[-..Â5Æ5p7t7`8c8w9z9§:ª:å;è;=„=±>Ž>Ø@Û@uB_xB¥CšCËDÎDÖFÙFHHóH÷H„J‡J|LLÄMÇMOOÇOÊOQ QðRóRbTeTäUèU‰VVñW_ôWY„YÒ[Ö[a!a®b±b†e‰eõfùf‚h…híjðj5l8lmƒmnnÖnÙnªo­o`qcq£s§s(t_+t.v1všx¬x`ycyCzFzü{ÿ{°}³}Ø~Û~œ€À€?ƒCƒöƒùƒí‡ñ‡ÐˆÓˆr‹v‹Ž‘zŽ}Žj_mù“ü“••Еӕi—m—V˜Z˜Â™Å™íšðškžožŸŸ`¡c¡$£'£žŠŒŠŸŠÆŠA§D§jš_mš§ª«ª•®˜®‹¯Ž¯¹±Œ±ñ²õ².ž1žÂ¹Å¹œœžœ¡œuŸxŸN¿Q¿ø¿ü¿®À²ÀiÁlÁšÂÂÅ_ÅóÆöƪȭÈôÉ÷ÉëËïËûÌþÌÍ͕ΙÎãÏæÏ•Ñ™ÑçÔêԄֈÖ\×`×iÙlÙTÛWÛDÞHÞá_áÿâã¥æšæŸç¢çè#èÚèÞèé…é`êcê—ëšëÕíØíDïGïJñNñññôñëòîòîôòô•õ˜õ’ö_•öÍøÑøtùwùsúvúëüïüýƒýþ"þ”—587: Ìйœ  Ò _Õ š  8 ; nq­°/3cfÔ× £‰ŒâæŸ!Â!!$$$+&.&|(€(*)_-)±+µ+@0C011õ2ù2¹4Œ4õ6ø6Ä7È71:4: <£<†=Š=Ø>Ü>#@&@WCZC;G?GjNnNËN_ÏNƒO†OLPOPìQïQTTUUŸWÁWìXðXU[X[(]+]a^d^œ_À_ð`ó`ÂbÅb¿eÃe f$fØf_Ûf g£g?iBi0l3l&m)mûnþn‚q†qHsLs/t2t€vƒvëyïyÝzáz||Í~Ð~íð_ƒbƒS†_V†ŠŠ“Œ—ŒӍ֍Ž Ž>A,’/’v“z“\”_”7•:•ؖۖp˜s˜ƒ™†™k›o›CGž_žž¡ž¡’¡G§K§Ô§×§ô©÷©¶¯º¯3°7°Û²Þ²"ž&ží¹ð¹ÁºĺiŒlŒÿŸ¿ó¿÷¿1Á4Á6ÂF:ºÜÜƟƜǟǀ€€€€€€€º(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useParams)Ã(0,_context_locale__WEBPACK_IMPORTED_MODULE_3__/* .useLocale */ .Y)¿(0,_lib_auth__WEBPACK_IMPORTED_MODULE_4__/* .useSession */ .wV)º(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)¯(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ°(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)ÿÈ(0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getPublicSiteProfile */ .S$)þÀ(0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getPriceList */ .Ck)ýÁ(0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getCategories */ .bW)À(0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getLocations */ .Vs)É(0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getOrCreateDirectRoom */ .QN)¿(0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .sendMessage */ ._z)Ä(0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .trackSiteMessage */ .UE)²(0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)»(0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Em)ö¶(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)·(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)þþÿþþþþþÿÿþþþþþþþþþþþþÿþþþþþþþþÿÿþþÿþþþÿþþþÿÿþþþÿþþÿþþþþþþÿþÿþÿþþþþÿþÿÿþþþÿÿþþÿ·react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.FragmentýýþýýýþýýþýýýþþýýýýýýþýÅ_components_PlanBadge__WEBPACK_IMPORTED_MODULE_6__/* .PlanBadge */ .dýüýüýýüüýüüüüýýýüüüüýüüýüüýüüýýüüüüüýþýýýüüüüüýüüüüüýýüüýüýüüýüüýüüýýüüýýýüüüüýüýüüüüüüýýüüüüüüýýüüýýüüüüüüýýüüüüýüüüüüýýýýüýüüýýüýüüüüýüýüüüœñ__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ PersonalSitePage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7541); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(9906); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(1592); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(2982); /* harmony import */ var _components_PlanBadge__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(2035); /* __next_internal_client_entry_do_not_use__ default auto */ function PersonalSitePage() { var _profile_portfolio, _profile_firstName, _profile_lastName, _profile_name_, _profile_name, _profile_siteSettings, _profile_siteSettings1, _profile_siteSettings2, _profile_portfolio1, _profile_portfolio2, _SITE_LOCALES_find; const { slug } = (0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useParams)(); const { t, locale, setLocale } = (0,_context_locale__WEBPACK_IMPORTED_MODULE_3__/* .useLocale */ .Y)(); const { data: session } = (0,_lib_auth__WEBPACK_IMPORTED_MODULE_4__/* .useSession */ .wV)(); const router = (0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)(); const [profile, setProfile] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [loading, setLoading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(true); const [notFound, setNotFound] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [msgLoading, setMsgLoading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [linkCopied, setLinkCopied] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [lightbox, setLightbox] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [contactSent, setContactSent] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [contactForm, setContactForm] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)({ name: '', email: '', message: '' }); const [contactLoading, setContactLoading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [langOpen, setLangOpen] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [msgModal, setMsgModal] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [authModal, setAuthModal] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [msgText, setMsgText] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [msgSent, setMsgSent] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [catMap, setCatMap] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)({}); const [locMap, setLocMap] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)({}); const [locParentMap, setLocParentMap] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)({}); const [priceLists, setPriceLists] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)({}); const [scrolled, setScrolled] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const dateLocale = locale === 'ru' ? 'ru-RU' : locale === 'uk' ? 'uk-UA' : locale === 'en' ? 'en-US' : 'el-GR'; (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ const onScroll = ()=>setScrolled(window.scrollY > 100); window.addEventListener('scroll', onScroll, { passive: true }); return ()=>window.removeEventListener('scroll', onScroll); }, []); const LANG_MAP = { el: { flag: '🇬🇷', label: 'ΕλληΜικά' }, en: { flag: '🇬🇧', label: 'English' }, ru: { flag: '🇷🇺', label: 'РусскОй' }, uk: { flag: '🇺🇊', label: 'УкраїМська' }, de: { flag: '🇩🇪', label: 'Deutsch' }, fr: { flag: '🇫🇷', label: 'Français' }, it: { flag: '🇮🇹', label: 'Italiano' }, es: { flag: '🇪🇞', label: 'Español' }, ar: { flag: '🇞🇊', label: 'العرؚية' }, zh: { flag: '🇚🇳', label: 'äž­æ–‡' } }; const SITE_LOCALES = [ { code: 'el', flag: '🇬🇷', label: 'ΕλληΜικά' }, { code: 'en', flag: '🇬🇧', label: 'English' }, { code: 'ru', flag: '🇷🇺', label: 'РусскОй' } ]; (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!slug) return; (0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getPublicSiteProfile */ .S$)(slug).then(setProfile).catch(()=>setNotFound(true)).finally(()=>setLoading(false)); }, [ slug ]); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ var _profile_siteSettings; const shouldShowPriceList = (profile === null || profile === void 0 ? void 0 : (_profile_siteSettings = profile.siteSettings) === null || _profile_siteSettings === void 0 ? void 0 : _profile_siteSettings.showPriceList) !== false; const cards = Array.isArray(profile === null || profile === void 0 ? void 0 : profile.cards) ? profile.cards : []; if (!profile || !shouldShowPriceList || cards.length === 0) { setPriceLists({}); return; } let cancelled = false; Promise.all(cards.map(async (card)=>[ card.id, await (0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getPriceList */ .Ck)(card.id, locale) ])).then((entries)=>{ if (cancelled) return; setPriceLists(Object.fromEntries(entries.filter((param)=>{ let [, groups] = param; return groups.length > 0; }))); }).catch(()=>{ if (!cancelled) setPriceLists({}); }); return ()=>{ cancelled = true; }; }, [ profile, locale ]); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ const catLocale = locale; (0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getCategories */ .bW)().then((cats)=>{ const m = {}; for (const c of cats){ var _c_names_catLocale; m[c.slug] = (_c_names_catLocale = c.names[catLocale]) !== null && _c_names_catLocale !== void 0 ? _c_names_catLocale : c.names.el; var _c_children; for (const sub of (_c_children = c.children) !== null && _c_children !== void 0 ? _c_children : []){ var _sub_names_catLocale; m[sub.slug] = (_sub_names_catLocale = sub.names[catLocale]) !== null && _sub_names_catLocale !== void 0 ? _sub_names_catLocale : sub.names.el; } } setCatMap(m); }).catch(()=>{}); (0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getLocations */ .Vs)().then((locs)=>{ const m = {}; const pm = {}; for (const loc of locs){ var _loc_names, _loc_names1; var _loc_names_catLocale, _ref; const parentName = (_ref = (_loc_names_catLocale = (_loc_names = loc.names) === null || _loc_names === void 0 ? void 0 : _loc_names[catLocale]) !== null && _loc_names_catLocale !== void 0 ? _loc_names_catLocale : (_loc_names1 = loc.names) === null || _loc_names1 === void 0 ? void 0 : _loc_names1.el) !== null && _ref !== void 0 ? _ref : loc.slug; m[loc.slug] = parentName; var _loc_children; for (const child of (_loc_children = loc.children) !== null && _loc_children !== void 0 ? _loc_children : []){ var _child_names, _child_names1; var _child_names_catLocale, _ref1; m[child.slug] = (_ref1 = (_child_names_catLocale = (_child_names = child.names) === null || _child_names === void 0 ? void 0 : _child_names[catLocale]) !== null && _child_names_catLocale !== void 0 ? _child_names_catLocale : (_child_names1 = child.names) === null || _child_names1 === void 0 ? void 0 : _child_names1.el) !== null && _ref1 !== void 0 ? _ref1 : child.slug; pm[child.slug] = parentName; } } setLocMap(m); setLocParentMap(pm); }).catch(()=>{}); }, [ locale ]); function handleMessage() { if (!session) { setAuthModal(true); return; } setMsgModal(true); } async function handleSendMessage(e) { e.preventDefault(); if (!msgText.trim()) return; setMsgLoading(true); try { const { room } = await (0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getOrCreateDirectRoom */ .QN)(profile.id); await (0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .sendMessage */ ._z)(room.id, msgText.trim()); (0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .trackSiteMessage */ .UE)(slug); setMsgSent(true); setMsgText(''); } catch (e) {} finally{ setMsgLoading(false); } } const handleContactSubmit = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)(async (e)=>{ e.preventDefault(); if (!contactForm.name.trim() || !contactForm.message.trim()) return; setContactLoading(true); try { await (0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Em)("/users/site/".concat(slug, "/contact"), { method: 'POST', body: JSON.stringify(contactForm) }); setContactSent(true); setContactForm({ name: '', email: '', message: '' }); } catch (e) {} finally{ setContactLoading(false); } }, [ contactForm, slug ]); // Lightbox keyboard nav (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (lightbox === null) return; const handler = (e)=>{ if (e.key === 'Escape') setLightbox(null); if (e.key === 'ArrowRight') setLightbox((i)=>{ var _profile_portfolio; var _profile_portfolio_length; return i !== null ? Math.min(i + 1, ((_profile_portfolio_length = profile === null || profile === void 0 ? void 0 : (_profile_portfolio = profile.portfolio) === null || _profile_portfolio === void 0 ? void 0 : _profile_portfolio.length) !== null && _profile_portfolio_length !== void 0 ? _profile_portfolio_length : 1) - 1) : null; }); if (e.key === 'ArrowLeft') setLightbox((i)=>i !== null ? Math.max(i - 1, 0) : null); }; document.addEventListener('keydown', handler); return ()=>document.removeEventListener('keydown', handler); }, [ lightbox, profile === null || profile === void 0 ? void 0 : (_profile_portfolio = profile.portfolio) === null || _profile_portfolio === void 0 ? void 0 : _profile_portfolio.length ]); if (loading) return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "min-h-screen flex items-center justify-center", style: { background: 'var(--site-bg)' }, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "relative w-12 h-12", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "absolute inset-0 rounded-full border-2 border-green-500/20" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "absolute inset-0 rounded-full border-2 border-transparent border-t-blue-500 animate-spin" }) ] }) }); if (notFound || !profile) return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "min-h-screen flex flex-col items-center justify-center gap-6", style: { background: 'var(--site-bg)' }, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "w-20 h-20 rounded-full flex items-center justify-center", style: { background: 'var(--site-surface)' }, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-10 h-10 text-gray-500", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15.182 16.318A4.486 4.486 0 0012.016 15a4.486 4.486 0 00-3.198 1.318M21 12a9 9 0 11-18 0 9 9 0 0118 0zM9.75 9.75c0 .414-.168.75-.375.75S9 10.164 9 9.75 9.168 9 9.375 9s.375.336.375.75zm-.375 0h.008v.015h-.008V9.75zm5.625 0c0 .414-.168.75-.375.75s-.375-.336-.375-.75.168-.75.375-.75.375.336.375.75zm-.375 0h.008v.015h-.008V9.75z" }) }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-gray-400 text-lg", children: t('common.not_found', 'Page not found') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("a", { href: "/", className: "text-gray-400 hover:text-gray-300 text-sm transition", children: t('nav.home', 'Home') }) ] }); var _profile_firstName_, _profile_lastName_; const initials = "".concat((_profile_firstName_ = (_profile_firstName = profile.firstName) === null || _profile_firstName === void 0 ? void 0 : _profile_firstName[0]) !== null && _profile_firstName_ !== void 0 ? _profile_firstName_ : '').concat((_profile_lastName_ = (_profile_lastName = profile.lastName) === null || _profile_lastName === void 0 ? void 0 : _profile_lastName[0]) !== null && _profile_lastName_ !== void 0 ? _profile_lastName_ : '').toUpperCase() || ((_profile_name = profile.name) === null || _profile_name === void 0 ? void 0 : (_profile_name_ = _profile_name[0]) === null || _profile_name_ === void 0 ? void 0 : _profile_name_.toUpperCase()) || '?'; const displayName = [ profile.firstName, profile.lastName ].filter(Boolean).join(' ') || profile.name || ''; const memberYear = profile.memberSince ? new Date(profile.memberSince).getFullYear() : null; const hasStats = profile.completedTasks > 0 || profile.rating || profile.reviewCount && profile.reviewCount > 0; const isLight = ((_profile_siteSettings = profile.siteSettings) === null || _profile_siteSettings === void 0 ? void 0 : _profile_siteSettings.siteTheme) === 'light'; const showServices = ((_profile_siteSettings1 = profile.siteSettings) === null || _profile_siteSettings1 === void 0 ? void 0 : _profile_siteSettings1.showServices) !== false; const showPriceList = ((_profile_siteSettings2 = profile.siteSettings) === null || _profile_siteSettings2 === void 0 ? void 0 : _profile_siteSettings2.showPriceList) !== false; const showCardsSection = showServices || showPriceList; var _profile_portfolio_length, _profile_portfolio_lightbox_title, _SITE_LOCALES_find_flag; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "site-theme min-h-screen selection:bg-green-500/30 ".concat(isLight ? 'site-light' : ''), style: { background: 'var(--site-bg)', color: 'var(--site-text)' }, children: [ lightbox !== null && ((_profile_portfolio1 = profile.portfolio) === null || _profile_portfolio1 === void 0 ? void 0 : _profile_portfolio1[lightbox]) && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "fixed inset-0 z-50 bg-black/90 backdrop-blur-xl flex items-center justify-center p-4", onClick: ()=>setLightbox(null), children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>setLightbox(null), className: "absolute top-6 right-6 w-10 h-10 rounded-full bg-white/10 hover:bg-white/20 flex items-center justify-center transition", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-5 h-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" }) }) }), lightbox > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: (e)=>{ e.stopPropagation(); setLightbox(lightbox - 1); }, className: "absolute left-4 top-1/2 -translate-y-1/2 w-10 h-10 rounded-full bg-white/10 hover:bg-white/20 flex items-center justify-center transition", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-5 h-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 19l-7-7 7-7" }) }) }), lightbox < ((_profile_portfolio_length = (_profile_portfolio2 = profile.portfolio) === null || _profile_portfolio2 === void 0 ? void 0 : _profile_portfolio2.length) !== null && _profile_portfolio_length !== void 0 ? _profile_portfolio_length : 1) - 1 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: (e)=>{ e.stopPropagation(); setLightbox(lightbox + 1); }, className: "absolute right-4 top-1/2 -translate-y-1/2 w-10 h-10 rounded-full bg-white/10 hover:bg-white/20 flex items-center justify-center transition", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-5 h-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 5l7 7-7 7" }) }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: profile.portfolio[lightbox].imageUrl, alt: (_profile_portfolio_lightbox_title = profile.portfolio[lightbox].title) !== null && _profile_portfolio_lightbox_title !== void 0 ? _profile_portfolio_lightbox_title : '', className: "max-w-full max-h-[85vh] rounded-2xl object-contain", onClick: (e)=>e.stopPropagation() }), profile.portfolio[lightbox].title && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "absolute bottom-6 left-1/2 -translate-x-1/2 bg-black/60 backdrop-blur-md px-5 py-2.5 rounded-full text-sm", children: profile.portfolio[lightbox].title }) ] }), authModal && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "fixed inset-0 z-50 bg-black/70 backdrop-blur-sm flex items-center justify-center p-4", onClick: ()=>setAuthModal(false), children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "relative w-full max-w-sm rounded-2xl shadow-2xl p-6", style: { background: 'var(--site-modal-bg)', border: '1px solid var(--site-border)' }, onClick: (e)=>e.stopPropagation(), children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>setAuthModal(false), className: "absolute top-4 right-4 w-8 h-8 rounded-full flex items-center justify-center transition", style: { background: 'var(--site-surface)', color: 'var(--site-text-muted)' }, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" }) }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "w-12 h-12 rounded-full bg-green-500/10 flex items-center justify-center mb-4", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-6 h-6 text-gray-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h3", { className: "text-base font-semibold mb-2", style: { color: 'var(--site-text)' }, children: t('site.auth_required_title', 'Authorization required') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm mb-5", style: { color: 'var(--site-text-muted)' }, children: t('site.auth_required_desc', 'To write in chat, sign in to your CanHelp account.') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex flex-col gap-2.5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("a", { href: "/login", className: "w-full flex items-center justify-center gap-2 bg-green-600 hover:bg-green-500 text-white font-medium text-sm px-4 py-2.5 rounded-xl transition", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M11 16l-4-4m0 0l4-4m-4 4h14m-5 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h7a3 3 0 013 3v1" }) }), t('site.auth_login_btn', 'Sign in') ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { type: "button", onClick: ()=>{ setAuthModal(false); setTimeout(()=>{ var _document_getElementById; (_document_getElementById = document.getElementById('contact')) === null || _document_getElementById === void 0 ? void 0 : _document_getElementById.scrollIntoView({ behavior: 'smooth', block: 'start' }); }, 100); }, className: "w-full flex items-center justify-center gap-2 text-sm font-medium px-4 py-2.5 rounded-xl transition", style: { background: 'var(--site-surface)', color: 'var(--site-text-secondary)', border: '1px solid var(--site-border)' }, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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" }) }), t('site.auth_contact_form_btn', 'Write via contact form') ] }) ] }) ] }) }), msgModal && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "fixed inset-0 z-50 bg-black/70 backdrop-blur-sm flex items-center justify-center p-4", onClick: ()=>{ if (!msgLoading) { setMsgModal(false); setMsgSent(false); } }, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "relative w-full max-w-md rounded-2xl shadow-2xl", style: { background: 'var(--site-modal-bg)', border: '1px solid var(--site-border)' }, onClick: (e)=>e.stopPropagation(), children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>{ setMsgModal(false); setMsgSent(false); }, className: "absolute top-4 right-4 w-8 h-8 rounded-full flex items-center justify-center transition", style: { background: 'var(--site-surface)', color: 'var(--site-text-muted)' }, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" }) }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "p-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-3 mb-5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "w-10 h-10 rounded-full bg-green-500/10 flex items-center justify-center", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-5 h-5 text-gray-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h3", { className: "text-base font-semibold", style: { color: 'var(--site-text)' }, children: t('site.write_to_chat', 'Write in chat') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs", style: { color: 'var(--site-text-muted)' }, children: displayName }) ] }) ] }), msgSent ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "text-center py-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "w-12 h-12 rounded-full bg-emerald-500/20 flex items-center justify-center mx-auto mb-3", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-6 h-6 text-emerald-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" }) }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-emerald-400 font-medium mb-1", children: t('site.message_sent', 'Message sent!') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm mb-4", style: { color: 'var(--site-text-muted)' }, children: t('site.message_sent_desc', 'The specialist will receive it in chat') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>{ setMsgModal(false); setMsgSent(false); }, className: "text-sm text-gray-400 hover:text-gray-300 transition", children: t('common.close', 'Close') }) ] }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("form", { onSubmit: handleSendMessage, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("textarea", { autoFocus: true, rows: 4, value: msgText, onChange: (e)=>setMsgText(e.target.value), className: "w-full rounded-xl px-4 py-3 text-sm focus:outline-none focus:border-green-500/50 transition resize-none mb-4", style: { background: 'var(--site-input-bg)', border: '1px solid var(--site-input-border)', color: 'var(--site-input-text)' }, placeholder: t('site.message_placeholder', 'Write your message...') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-end gap-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>setMsgModal(false), className: "text-sm transition px-4 py-2", style: { color: 'var(--site-text-muted)' }, children: t('common.cancel', 'Cancel') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { type: "submit", disabled: msgLoading || !msgText.trim(), className: "inline-flex items-center gap-2 bg-green-600 hover:bg-green-500 text-white font-medium text-sm px-5 py-2.5 rounded-xl transition disabled:opacity-50", children: [ msgLoading ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "w-4 h-4 rounded-full border-2 border-white/30 border-t-white animate-spin" }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 19l9 2-9-18-9 18 9-2zm0 0v-8" }) }), t('site.contact_send', 'Send') ] }) ] }) ] }) ] }) ] }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("nav", { className: "sticky top-0 z-40 backdrop-blur-xl", style: { background: 'var(--site-nav-bg)', borderBottom: '1px solid var(--site-border)' }, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "max-w-5xl mx-auto px-4 sm:px-6 h-14 flex items-center justify-between", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("a", { href: "/", className: "logo-text-mini tracking-tight".concat(scrolled ? ' scrolled' : ''), style: { color: 'var(--site-text-secondary)' }, children: "CanHelp" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-2", children: [ (profile === null || profile === void 0 ? void 0 : profile.rating) && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-1 text-xs mr-1", style: { color: 'var(--site-text-secondary)' }, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3.5 h-3.5 text-amber-400", fill: "currentColor", viewBox: "0 0 20 20", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 00-1.175 0l-2.8 2.034c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 00.951-.69l1.07-3.292z" }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "font-medium", children: Number(profile.rating).toFixed(1) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "relative", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { type: "button", onClick: ()=>setLangOpen(!langOpen), className: "flex items-center gap-1.5 text-xs transition px-2 py-1 rounded-lg", style: { color: 'var(--site-text-muted)' }, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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" }) }), (_SITE_LOCALES_find_flag = (_SITE_LOCALES_find = SITE_LOCALES.find((l)=>l.code === locale)) === null || _SITE_LOCALES_find === void 0 ? void 0 : _SITE_LOCALES_find.flag) !== null && _SITE_LOCALES_find_flag !== void 0 ? _SITE_LOCALES_find_flag : '🌐' ] }), langOpen && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "fixed inset-0 z-40", onClick: ()=>setLangOpen(false) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "absolute right-0 top-full mt-1 z-50 rounded-xl shadow-xl overflow-hidden min-w-[140px]", style: { background: 'var(--site-lang-dropdown)', border: '1px solid var(--site-border)' }, children: SITE_LOCALES.map((l)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { type: "button", onClick: ()=>{ setLocale(l.code); setLangOpen(false); }, className: "w-full flex items-center gap-2 px-3 py-2 text-xs transition ".concat(locale === l.code ? 'text-gray-400 bg-green-500/10' : ''), style: locale === l.code ? {} : { color: 'var(--site-text-secondary)' }, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { children: l.flag }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { children: l.label }) ] }, l.code)) }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "w-px h-4", style: { background: 'var(--site-divider)' } }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { type: "button", onClick: async ()=>{ const url = window.location.href; if (navigator.share) { try { await navigator.share({ title: displayName, url }); } catch (e) {} } else { navigator.clipboard.writeText(url); setLinkCopied(true); setTimeout(()=>setLinkCopied(false), 2000); } }, className: "flex items-center gap-1.5 text-xs transition", style: { color: 'var(--site-text-muted)' }, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8.684 13.342C8.886 12.938 9 12.482 9 12c0-.482-.114-.938-.316-1.342m0 2.684a3 3 0 110-2.684m0 2.684l6.632 3.316m-6.632-6l6.632-3.316m0 0a3 3 0 105.367-2.684 3 3 0 00-5.367 2.684zm0 9.316a3 3 0 105.368 2.684 3 3 0 00-5.368-2.684z" }) }), linkCopied ? t('profile.site.copied') : t('site.share', 'Share') ] }) ] }) ] }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("section", { className: "relative overflow-hidden", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "absolute top-0 left-1/4 w-[500px] h-[500px] bg-green-600/10 rounded-full blur-[120px] pointer-events-none" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "absolute top-20 right-1/4 w-[400px] h-[400px] bg-purple-600/8 rounded-full blur-[100px] pointer-events-none" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "relative max-w-5xl mx-auto px-4 sm:px-6 pt-16 pb-20 sm:pt-24 sm:pb-28", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex flex-col items-center text-center", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "relative group mb-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "absolute -inset-1 bg-gradient-to-br from-green-600 to-purple-500 rounded-full opacity-60 blur group-hover:opacity-80 transition-opacity" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "relative w-28 h-28 sm:w-32 sm:h-32 rounded-full overflow-hidden border-2 flex items-center justify-center text-4xl font-bold", style: { borderColor: 'var(--site-avatar-border)', background: 'var(--site-avatar-bg)', color: 'var(--site-text)' }, children: profile.image ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: profile.image, alt: displayName, className: "w-full h-full object-cover" }) : initials }), Array.isArray(profile.activeStatuses) && profile.activeStatuses.includes('canhelp_now') && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "absolute bottom-1 right-1 w-5 h-5 bg-emerald-500 rounded-full border-2 flex items-center justify-center", style: { borderColor: 'var(--site-status-border-color)' }, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "w-2 h-2 rounded-full bg-white animate-pulse" }) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h1", { className: "text-3xl sm:text-5xl font-bold tracking-tight bg-clip-text text-transparent mb-3 pb-1", style: { backgroundImage: 'linear-gradient(to bottom, var(--site-name-from), var(--site-name-to))' }, children: displayName }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-center gap-2 flex-wrap mb-4", children: [ profile.planTier && profile.planTier !== 'free' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components_PlanBadge__WEBPACK_IMPORTED_MODULE_6__/* .PlanBadge */ .d, { tier: profile.planTier, verified: profile.hasVerifiedBadge, size: "md" }), Array.isArray(profile.activeStatuses) && profile.activeStatuses.includes('canhelp_now') && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "inline-flex items-center gap-1.5 text-xs font-medium text-emerald-400 bg-emerald-500/10 border border-emerald-500/20 px-3 py-1.5 rounded-full", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "w-1.5 h-1.5 rounded-full bg-emerald-400 animate-pulse" }), t('status.can_help_now', 'Available now') ] }), memberYear && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "text-xs px-3 py-1.5 rounded-full", style: { color: 'var(--site-text-muted)', background: 'var(--site-surface)' }, children: [ t('site.member_since', 'Member since'), " ", memberYear ] }) ] }), profile.bio && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "max-w-xl text-base sm:text-lg leading-relaxed mb-8", style: { color: 'var(--site-text-secondary)' }, children: profile.bio }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-3 flex-wrap justify-center", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { onClick: handleMessage, disabled: msgLoading, className: "group inline-flex items-center gap-2.5 bg-green-600 hover:bg-green-500 text-white font-semibold px-7 py-3.5 rounded-full transition-all hover:shadow-lg hover:shadow-blue-500/25 disabled:opacity-50", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-5 h-5 group-hover:scale-110 transition-transform", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }), t('site.write_to_chat', 'Write in chat') ] }), profile.phone && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("a", { href: "tel:".concat(profile.phone), className: "group inline-flex items-center gap-2.5 border font-medium px-7 py-3.5 rounded-full transition-all", style: { background: 'var(--site-phone-bg)', borderColor: 'var(--site-phone-border)', color: 'var(--site-phone-text)' }, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-5 h-5 group-hover:scale-110 transition-transform", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M3 5a2 2 0 012-2h3.28a1 1 0 01.948.684l1.498 4.493a1 1 0 01-.502 1.21l-2.257 1.13a11.042 11.042 0 005.516 5.516l1.13-2.257a1 1 0 011.21-.502l4.493 1.498a1 1 0 01.684.949V19a2 2 0 01-2 2h-1C9.716 21 3 14.284 3 6V5z" }) }), profile.phone ] }) ] }) ] }) }) ] }), hasStats && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("section", { className: "border-y", style: { borderColor: 'var(--site-border)', background: 'var(--site-surface)' }, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "max-w-5xl mx-auto px-4 sm:px-6 py-8", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "grid grid-cols-2 sm:grid-cols-4 gap-6", children: [ profile.rating && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "text-center", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-center gap-1 mb-1", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-5 h-5 text-amber-400", fill: "currentColor", viewBox: "0 0 20 20", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 00-1.175 0l-2.8 2.034c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 00.951-.69l1.07-3.292z" }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-2xl font-bold", children: Number(profile.rating).toFixed(1) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs uppercase tracking-wider", style: { color: 'var(--site-text-muted)' }, children: t('site.rating', 'Rating') }) ] }), profile.reviewCount > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "text-center", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-2xl font-bold mb-1", children: profile.reviewCount }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs uppercase tracking-wider", style: { color: 'var(--site-text-muted)' }, children: t('profile.reviews') }) ] }), profile.completedTasks > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "text-center", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-2xl font-bold mb-1", children: profile.completedTasks }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs uppercase tracking-wider", style: { color: 'var(--site-text-muted)' }, children: t('site.completed_tasks', 'Completed') }) ] }), Array.isArray(profile.languages) && profile.languages.length > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "text-center", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-2xl font-bold mb-1", children: profile.languages.length }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs uppercase tracking-wider", style: { color: 'var(--site-text-muted)' }, children: t('site.languages', 'Languages') }) ] }) ] }) }) }), Array.isArray(profile.languages) && profile.languages.length > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("section", { className: "max-w-5xl mx-auto px-4 sm:px-6 pt-10", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-3 mb-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 shrink-0", style: { color: 'var(--site-text-muted)' }, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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" }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-sm", style: { color: 'var(--site-text-muted)' }, children: t('site.speaks_languages', 'Speaks languages') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex items-center gap-2 flex-wrap", children: profile.languages.map((lang)=>{ const info = LANG_MAP[lang]; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-xs px-3 py-1.5 rounded-full flex items-center gap-1.5", style: { color: 'var(--site-tag-text)', background: 'var(--site-tag-bg)', border: '1px solid var(--site-tag-border)' }, children: info ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [ info.flag, " ", info.label ] }) : lang }, lang); }) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "max-w-5xl mx-auto px-4 sm:px-6 pb-20 space-y-16 mt-10", children: [ showServices && Array.isArray(profile.cards) && profile.cards.length > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("section", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-3 mb-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "w-8 h-8 rounded-lg bg-green-500/10 flex items-center justify-center", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 text-gray-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M21 13.255A23.931 23.931 0 0112 15c-3.183 0-6.22-.62-9-1.745M16 6V4a2 2 0 00-2-2h-4a2 2 0 00-2 2v2m4 6h.01M5 20h14a2 2 0 002-2V8a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z" }) }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "text-xl font-bold", children: t('specialist.services', 'Services') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "grid gap-4 sm:grid-cols-2", children: profile.cards.map((card)=>{ // Group locations by parent const grouped = {}; if (Array.isArray(card.locations)) { for (const slug of card.locations){ const parent = locParentMap[slug]; if (parent) { if (!grouped[parent]) grouped[parent] = []; grouped[parent].push(locMap[slug] || slug); } else { const name = locMap[slug] || slug; if (!grouped[name]) grouped[name] = []; } } } return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "group relative rounded-2xl p-6 transition-all", style: { background: 'var(--site-card-bg)', border: '1px solid var(--site-card-border)' }, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h3", { className: "font-semibold mb-2", style: { color: 'var(--site-text)' }, children: card.title }), showServices && (()=>{ const desc = (locale === 'el' ? card.descriptionEl : locale === 'en' ? card.descriptionEn : locale === 'ru' ? card.descriptionRu : card.descriptionUk) || card.descriptionEl || card.descriptionEn || card.descriptionRu || card.descriptionUk || card.description; return desc ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm leading-relaxed mb-3", style: { color: 'var(--site-text-muted)' }, children: desc }) : null; })(), showServices && Array.isArray(card.categories) && card.categories.length > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex flex-wrap gap-1.5 mb-3", children: card.categories.map((slug)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-[11px] px-2.5 py-1 rounded-full bg-purple-500/10 text-purple-400 border border-purple-500/10", children: catMap[slug] || slug }, slug)) }), showServices && Object.keys(grouped).length > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "mb-3 space-y-1", children: Object.entries(grouped).map((param)=>{ let [parent, children] = param; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-start gap-1.5 text-xs", style: { color: 'var(--site-text-muted)' }, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-3.5 h-3.5 shrink-0 mt-0.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 11a3 3 0 11-6 0 3 3 0 016 0z" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "font-medium", style: { color: 'var(--site-text-secondary)' }, children: parent }), children.length > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { style: { color: 'var(--site-text-hint)' }, children: [ " — ", children.join(', ') ] }) ] }) ] }, parent); }) }), showServices && Array.isArray(card.skills) && card.skills.length > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex flex-wrap gap-1.5", children: card.skills.map((s)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-[11px] px-2.5 py-1 rounded-full bg-green-500/10 text-gray-400 border border-green-500/10", children: s }, s)) }), showPriceList && Array.isArray(priceLists[card.id]) && priceLists[card.id].length > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "".concat(showServices ? 'mt-4 pt-4 border-t' : ''), style: { borderColor: 'var(--site-card-border)' }, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs font-semibold uppercase tracking-wider mb-3", style: { color: 'var(--site-text-muted)' }, children: t('site.pricelist', 'Price list') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "space-y-3", children: priceLists[card.id].map((group)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "rounded-xl p-4", style: { background: 'var(--site-surface)', border: '1px solid var(--site-card-border)' }, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "font-semibold mb-3", style: { color: 'var(--site-text)' }, children: group.title }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "space-y-3", children: group.items.map((item)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-start justify-between gap-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "min-w-0", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm font-medium", style: { color: 'var(--site-text-secondary)' }, children: item.name }), item.description && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs mt-0.5", style: { color: 'var(--site-text-muted)' }, children: item.description }) ] }), (item.price || item.unit) && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "shrink-0 text-sm font-semibold", style: { color: 'var(--site-text)' }, children: [ item.price ? "€".concat(item.price) : '', item.unit ? " ".concat(item.unit) : '' ] }) ] }, item.id)) }) ] }, group.id)) }) ] }) ] }, card.id); }) }) ] }), Array.isArray(profile.portfolio) && profile.portfolio.length > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("section", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-3 mb-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "w-8 h-8 rounded-lg bg-purple-500/10 flex items-center justify-center", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 text-purple-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z" }) }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "text-xl font-bold", children: t('portfolio.title', 'Portfolio') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "text-xs ml-auto", style: { color: 'var(--site-text-hint)' }, children: [ profile.portfolio.length, " ", t('site.photos', 'photos') ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 gap-3", children: profile.portfolio.map((item, idx)=>{ var _item_title; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { onClick: ()=>item.imageUrl && setLightbox(idx), className: "group relative aspect-square rounded-xl overflow-hidden transition-all", style: { background: 'var(--site-surface)', border: '1px solid var(--site-card-border)' }, children: [ item.imageUrl && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: item.imageUrl, alt: (_item_title = item.title) !== null && _item_title !== void 0 ? _item_title : '', className: "w-full h-full object-cover group-hover:scale-105 transition-transform duration-500" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "absolute inset-0 bg-gradient-to-t from-black/60 via-transparent to-transparent opacity-0 group-hover:opacity-100 transition-opacity flex items-end p-3", children: item.title && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs font-medium text-white truncate", children: item.title }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "absolute top-2 right-2 w-7 h-7 rounded-full bg-black/40 backdrop-blur-md flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3.5 h-3.5 text-white/80", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0zM10 7v3m0 0v3m0-3h3m-3 0H7" }) }) }) ] }, item.id); }) }) ] }), Array.isArray(profile.reviews) && profile.reviews.length > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("section", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-3 mb-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "w-8 h-8 rounded-lg bg-amber-500/10 flex items-center justify-center", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 text-amber-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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" }) }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "text-xl font-bold", children: t('profile.reviews') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-xs ml-auto", style: { color: 'var(--site-text-hint)' }, children: profile.reviewCount }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "space-y-3", children: profile.reviews.slice(0, 6).map((review)=>{ var _review_authorFirstName, _review_authorName; const authorName = [ review.authorFirstName, review.authorLastName ].filter(Boolean).join(' ') || review.authorName || null; var _review_authorFirstName_, _ref; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "rounded-2xl p-5", style: { background: 'var(--site-card-bg)', border: '1px solid var(--site-card-border)' }, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-start gap-3 mb-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "w-9 h-9 rounded-full flex items-center justify-center text-xs font-bold overflow-hidden shrink-0", style: { background: 'var(--site-surface)', color: 'var(--site-text-muted)' }, children: review.authorImage ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: review.authorImage, alt: "", className: "w-full h-full object-cover" }) : ((_ref = (_review_authorFirstName_ = (_review_authorFirstName = review.authorFirstName) === null || _review_authorFirstName === void 0 ? void 0 : _review_authorFirstName[0]) !== null && _review_authorFirstName_ !== void 0 ? _review_authorFirstName_ : (_review_authorName = review.authorName) === null || _review_authorName === void 0 ? void 0 : _review_authorName[0]) !== null && _ref !== void 0 ? _ref : '?').toUpperCase() }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-between gap-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm font-medium", style: { color: 'var(--site-text-secondary)' }, children: authorName !== null && authorName !== void 0 ? authorName : t('common.anonymous', 'Anonymous') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "shrink-0 text-[11px]", style: { color: 'var(--site-text-hint)' }, children: new Date(review.createdAt).toLocaleDateString(dateLocale) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex gap-0.5 mt-0.5", children: Array.from({ length: 5 }).map((_, i)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3.5 h-3.5 ".concat(i < Math.round(review.rating) ? 'text-amber-400' : ''), style: i < Math.round(review.rating) ? {} : { color: 'var(--site-border)' }, fill: "currentColor", viewBox: "0 0 20 20", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 00-1.175 0l-2.8 2.034c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 00.951-.69l1.07-3.292z" }) }, i)) }) ] }) ] }), review.comment && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm leading-relaxed pl-12", style: { color: 'var(--site-text-muted)' }, children: review.comment }) ] }, review.id); }) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("section", { id: "contact", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-3 mb-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "w-8 h-8 rounded-lg bg-emerald-500/10 flex items-center justify-center", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 text-emerald-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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" }) }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "text-xl font-bold", children: t('site.contact_form', 'Contact') }) ] }), contactSent ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-emerald-500/10 border border-emerald-500/20 rounded-2xl p-8 text-center", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "w-12 h-12 rounded-full bg-emerald-500/20 flex items-center justify-center mx-auto mb-3", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-6 h-6 text-emerald-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" }) }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-emerald-400 font-medium", children: t('site.contact_sent', 'Message sent!') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm mt-1", style: { color: 'var(--site-text-muted)' }, children: t('site.contact_sent_desc', 'The specialist will contact you shortly') }) ] }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("form", { onSubmit: handleContactSubmit, className: "rounded-2xl p-6 space-y-4", style: { background: 'var(--site-card-bg)', border: '1px solid var(--site-card-border)' }, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "grid gap-4 sm:grid-cols-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "text-xs uppercase tracking-wider mb-1.5 block", style: { color: 'var(--site-text-muted)' }, children: [ t('site.contact_name', 'Name'), " *" ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "text", required: true, value: contactForm.name, onChange: (e)=>setContactForm((f)=>({ ...f, name: e.target.value })), className: "w-full rounded-xl px-4 py-3 text-sm focus:outline-none focus:border-green-500/50 transition", style: { background: 'var(--site-input-bg)', border: '1px solid var(--site-input-border)', color: 'var(--site-input-text)' }, placeholder: t('site.contact_name_ph', 'Your name') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "text-xs uppercase tracking-wider mb-1.5 block", style: { color: 'var(--site-text-muted)' }, children: "Email" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "email", value: contactForm.email, onChange: (e)=>setContactForm((f)=>({ ...f, email: e.target.value })), className: "w-full rounded-xl px-4 py-3 text-sm focus:outline-none focus:border-green-500/50 transition", style: { background: 'var(--site-input-bg)', border: '1px solid var(--site-input-border)', color: 'var(--site-input-text)' }, placeholder: t('site.contact_email_ph', 'your@email.com') }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "text-xs uppercase tracking-wider mb-1.5 block", style: { color: 'var(--site-text-muted)' }, children: [ t('site.contact_message', 'Message'), " *" ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("textarea", { required: true, rows: 4, value: contactForm.message, onChange: (e)=>setContactForm((f)=>({ ...f, message: e.target.value })), className: "w-full rounded-xl px-4 py-3 text-sm focus:outline-none focus:border-green-500/50 transition resize-none", style: { background: 'var(--site-input-bg)', border: '1px solid var(--site-input-border)', color: 'var(--site-input-text)' }, placeholder: t('site.contact_message_ph', 'Describe your task...') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { type: "submit", disabled: contactLoading, className: "inline-flex items-center gap-2 bg-green-600 hover:bg-green-500 text-white font-medium px-6 py-3 rounded-xl transition disabled:opacity-50", children: [ contactLoading ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "w-4 h-4 rounded-full border-2 border-white/30 border-t-white animate-spin" }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 19l9 2-9-18-9 18 9-2zm0 0v-8" }) }), t('site.contact_send', 'Send') ] }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("footer", { className: "border-t pt-8 pb-4", style: { borderColor: 'var(--site-border)' }, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-between text-xs", style: { color: 'var(--site-footer-text)' }, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("a", { href: "/", className: "transition", children: "CanHelp.gr" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { children: [ "\xa9 ", new Date().getFullYear() ] }) ] }) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>window.scrollTo({ top: 0, behavior: 'smooth' }), className: "fixed bottom-6 right-6 z-50 w-10 h-10 rounded-full flex items-center justify-center backdrop-blur-sm transition-all duration-300 ".concat(scrolled ? 'opacity-100 translate-y-0' : 'opacity-0 translate-y-4 pointer-events-none'), style: { background: 'var(--site-scroll-btn-bg)', border: '1px solid var(--site-scroll-btn-border)', color: 'var(--site-scroll-btn-text)' }, "aria-label": "Scroll to top", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-5 h-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 15l7-7 7 7" }) }) }) ] }); }   ¡v__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ PersonalSitePage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7541); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(9906); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(1592); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(2982); /* harmony import */ var _components_PlanBadge__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(2035); ¢=úÿÿ—Q61146undefined148204undefined206260undefined262306undefined308347undefined349503undefined505555undefined557571undefined854862(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useParams)undefined904912(0,_context_locale__WEBPACK_IMPORTED_MODULE_3__/* .useLocale */ .Y)undefined947956(0,_lib_auth__WEBPACK_IMPORTED_MODULE_4__/* .useSession */ .wV)undefined980988(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)undefined10271034(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined10771084(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined11291136(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined11861193(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined12431250(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined12961303(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined13541361(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined14131420(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined15371544(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined15901597(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined16431650(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined16981705(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined17491756(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined17971804(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined18461853(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined18921899(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined19501957(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined20042011(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined20542061(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined21912199(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined36103618(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined36613680(0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getPublicSiteProfile */ .S$)undefined38003808(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined44674478(0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getPriceList */ .Ck)undefined49344942(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined49925004(0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getCategories */ .bW)undefined57225733(0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getLocations */ .Vs)undefined75367556(0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getOrCreateDirectRoom */ .QN)undefined75897599(0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .sendMessage */ ._z)undefined76397654(0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .trackSiteMessage */ .UE)undefined78357845(0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)undefined80308036(0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Em)undefined85038511(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined96379640(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined98209824(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined99349937(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1009010093(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1032910333(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1054210545(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1078010783(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1105411057(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1160811611(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1178011783(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1376213766(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1419214196(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1443214435(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1471114714(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1501515018(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1533315336(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1574515748(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1604916052(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1660016603(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1701317016(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1731717320(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1761117614(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1813418137(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1845618459(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1867518679(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1907619079(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1958019583(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1990819911(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2023820241(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2042320426(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2076520768(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2123221235(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2160221605(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2198821992(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2215322157(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2251322516(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2291322916(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2350623510(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2486224865(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2526225265(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2599025993(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2635726361(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2675426757(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2737327376(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2770127704(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2803128035(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2817828182(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2837428377(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2858628589(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2902429027(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2960329607(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2973629739(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3025430257(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3088830892(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3107231075(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3129931302(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3174031743(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3217632179(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3247232475(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3295732960(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3359933603(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3378233785(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3479734801(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3502435027(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3569835702(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3623836241(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3647436477(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3697036973(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3788137884(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3816338167(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3835238355(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3876138765(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3899839002(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3936239365(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3966139664(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4021940222(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4055540559(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined4073140735(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined4131241315(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4176441767(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4268042684(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined4268642694react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragmentundefined4281742820(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4311443117(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4368743691(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined4469344696(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4493944942(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4549745500(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4580945813(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined4715047153(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4755447557(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4840648410(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined4854248545(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4875748760(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4897448977(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4914449148(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined4932649330(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined4951349516(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4981849821(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined5044850451(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined5093150934(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined5137051373(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined5170051703(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined5220352207(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined5247552478(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined5248052488_components_PlanBadge__WEBPACK_IMPORTED_MODULE_6__/* .PlanBadge */ .dundefined5288552889(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined5321953222(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined5365353657(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined5450354506(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined5491654920(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined5513255136(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined5565755660(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined5614856151(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined5690056904(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined5762057623(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined5811158114(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined5904559048(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined5929559298(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined5942359427(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined5961059614(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined5977759781(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined6000060003(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined6031160314(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined6088560888(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined6125261255(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined6177061774(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined6193761940(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined6218762190(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined6270262706(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined6286962872(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined6312263125(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined6369363697(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined6386063863(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined6411564118(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined6474764751(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined6489564899(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined6505565058(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined6553665539(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined6594065943(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined6635766360(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined6661566618(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined6709067094(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined6709667104react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragmentundefined6753267536(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined6776967773(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined6786667870(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined6805068053(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined6825068253(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined6866468667(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined6923069233(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined6954969552(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined7070370707(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined7118771190(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined7203572038(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined7266072663(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined7286472867(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined7335373356(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined7369873702(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined7417474178(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined7478574788(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined7530775310(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined7590075904(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined7607476077(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined7672176725(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined7788877891(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined7808078083(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined7858178585(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined7903379036(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined7960579608(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined7981279816(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined8043380436(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined8105681059(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined8128681290(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined8162481628(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined8195581958(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined8277582778(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined8377183775(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined8561085614(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined8570785711(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined8589185894(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined8609286095(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined8650886511(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined8705587058(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined8731487318(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined8799888001(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined8830088304(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined8891788920(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined8938489387(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined8969789700(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined9004590048(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined9035290355(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined9081890821(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined9158391587(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined9168091684(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined9186491867(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined9206492067(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined9247992482(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined9323293235(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined9347893481(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined9394793950(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined9459494598(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined9504895052(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined9527995282(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined9587295875(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined9674796751(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined9698996993(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined9728097283(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined9799798000(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined9879798800(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined9916799170(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined9992399926(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined100864100867(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined101523101527(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined101659101663(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined101843101846(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined102045102048(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined102462102465(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined102956102959(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined103286103290(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined103516103519(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined103735103738(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined104152104155(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined104560104563(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined104835104838(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined105323105327(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined105795105799(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined106000106004(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined106141106145(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined106895106898(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined108359108363(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined108500108503(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined109044109047(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined110518110522(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined110643110647(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined111323111326(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined112674112678(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined113133113136(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined113345113348(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined113769113772(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined114431114434(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined114675114679(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined114993114996(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined115254115258(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined115642115645(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined116380116383(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined116636116639(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined £±<Œÿÿ€:úÿÿ‰‹ŠŒ žr«webpack/lib/util/registerExternalSerializerœwebpack-sources/ConcatSource€«webpack/lib/util/registerExternalSerializer™webpack-sources/RawSource‘// ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); // EXPORTS __webpack_require__.d(__webpack_exports__, { "default": () => (/* binding */ DashboardPage) }); // EXTERNAL MODULE: ../../node_modules/next/dist/compiled/react/jsx-runtime.js var jsx_runtime = __webpack_require__(4568); // EXTERNAL MODULE: ../../node_modules/next/dist/compiled/react/index.js var react = __webpack_require__(7620); // EXTERNAL MODULE: ../../node_modules/next/dist/api/navigation.js var navigation = __webpack_require__(7541); // EXTERNAL MODULE: ../../node_modules/next/dist/client/app-dir/link.js var app_dir_link = __webpack_require__(9664); var link_default = /*#__PURE__*/__webpack_require__.n(app_dir_link); // EXTERNAL MODULE: ./src/lib/auth.ts var auth = __webpack_require__(1592); // EXTERNAL MODULE: ./src/context/locale.tsx var context_locale = __webpack_require__(9906); // EXTERNAL MODULE: ./src/lib/api.ts var api = __webpack_require__(2982); // EXTERNAL MODULE: ./src/lib/taskLocale.ts var taskLocale = __webpack_require__(4017); // EXTERNAL MODULE: ./src/components/PlanBadge.tsx var PlanBadge = __webpack_require__(2035); ;// ./src/components/UsageMeter.tsx «webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSource«webpack/lib/util/registerExternalSerializerœwebpack-sources/CachedSource ? «webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSource«webpack/lib/util/registerExternalSerializer™webpack-sources/RawSource~ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; export function UsageMeter(param) { let { current, limit, label, className = '' } = param; if (limit === null) { return /*#__PURE__*/ _jsxs("div", { className: "".concat(className), children: [ /*#__PURE__*/ _jsxs("div", { className: "flex justify-between items-center mb-1", children: [ /*#__PURE__*/ _jsx("span", { className: "text-xs text-gray-500", children: label }), /*#__PURE__*/ _jsx("span", { className: "text-xs font-semibold text-green-600", children: "∞" }) ] }), /*#__PURE__*/ _jsx("div", { className: "h-1.5 rounded-full bg-green-100", children: /*#__PURE__*/ _jsx("div", { className: "h-full w-full rounded-full bg-green-400" }) }) ] }); } const pct = limit > 0 ? Math.min(100, Math.round(current / limit * 100)) : 100; const remaining = Math.max(0, limit - current); const barColor = pct >= 100 ? 'bg-red-500' : pct >= 80 ? 'bg-amber-400' : 'bg-green-500'; const textColor = pct >= 100 ? 'text-red-600' : pct >= 80 ? 'text-amber-600' : 'text-gray-600'; return /*#__PURE__*/ _jsxs("div", { className: className, children: [ /*#__PURE__*/ _jsxs("div", { className: "flex justify-between items-center mb-1", children: [ /*#__PURE__*/ _jsx("span", { className: "text-xs text-gray-500", children: label }), /*#__PURE__*/ _jsxs("span", { className: "text-xs font-semibold ".concat(textColor), children: [ remaining, " / ", limit ] }) ] }), /*#__PURE__*/ _jsx("div", { className: "h-1.5 rounded-full bg-gray-100", children: /*#__PURE__*/ _jsx("div", { className: "h-full rounded-full transition-all ".concat(barColor), style: { width: "".concat(pct, "%") } }) }) ] }); } d>@FWÖÚHLæé£ŠŽ‘  mqÿ¬° { ~ €€Í__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._ÿË__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._ÿÿÿþþÿþÿÿ€†buffer†source„size„maps„hash‘ function UsageMeter(param) { let { current, limit, label, className = '' } = param; if (limit === null) { return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "".concat(className), children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "flex justify-between items-center mb-1", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { className: "text-xs text-gray-500", children: label }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { className: "text-xs font-semibold text-green-600", children: "∞" }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "h-1.5 rounded-full bg-green-100", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "h-full w-full rounded-full bg-green-400" }) }) ] }); } const pct = limit > 0 ? Math.min(100, Math.round(current / limit * 100)) : 100; const remaining = Math.max(0, limit - current); const barColor = pct >= 100 ? 'bg-red-500' : pct >= 80 ? 'bg-amber-400' : 'bg-green-500'; const textColor = pct >= 100 ? 'text-red-600' : pct >= 80 ? 'text-amber-600' : 'text-gray-600'; return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: className, children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "flex justify-between items-center mb-1", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { className: "text-xs text-gray-500", children: label }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("span", { className: "text-xs font-semibold ".concat(textColor), children: [ remaining, " / ", limit ] }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "h-1.5 rounded-full bg-gray-100", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "h-full rounded-full transition-all ".concat(barColor), style: { width: "".concat(pct, "%") } }) }) ] }); } €•{"finalSource":false}ƒmap‹bufferedMap ReplaceSourceRawSource~ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; export function UsageMeter(param) { let { current, limit, label, className = '' } = param; if (limit === null) { return /*#__PURE__*/ _jsxs("div", { className: "".concat(className), children: [ /*#__PURE__*/ _jsxs("div", { className: "flex justify-between items-center mb-1", children: [ /*#__PURE__*/ _jsx("span", { className: "text-xs text-gray-500", children: label }), /*#__PURE__*/ _jsx("span", { className: "text-xs font-semibold text-green-600", children: "∞" }) ] }), /*#__PURE__*/ _jsx("div", { className: "h-1.5 rounded-full bg-green-100", children: /*#__PURE__*/ _jsx("div", { className: "h-full w-full rounded-full bg-green-400" }) }) ] }); } const pct = limit > 0 ? Math.min(100, Math.round(current / limit * 100)) : 100; const remaining = Math.max(0, limit - current); const barColor = pct >= 100 ? 'bg-red-500' : pct >= 80 ? 'bg-amber-400' : 'bg-green-500'; const textColor = pct >= 100 ? 'text-red-600' : pct >= 80 ? 'text-amber-600' : 'text-gray-600'; return /*#__PURE__*/ _jsxs("div", { className: className, children: [ /*#__PURE__*/ _jsxs("div", { className: "flex justify-between items-center mb-1", children: [ /*#__PURE__*/ _jsx("span", { className: "text-xs text-gray-500", children: label }), /*#__PURE__*/ _jsxs("span", { className: "text-xs font-semibold ".concat(textColor), children: [ remaining, " / ", limit ] }) ] }), /*#__PURE__*/ _jsx("div", { className: "h-1.5 rounded-full bg-gray-100", children: /*#__PURE__*/ _jsx("div", { className: "h-full rounded-full transition-all ".concat(barColor), style: { width: "".concat(pct, "%") } }) }) ] }); } i062undefined6470undefined214218__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined328332__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined486489__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined675678__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined910913__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined10341037__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined15541558__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined16451649__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined17911794__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined19641968__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined23122315__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined24272430__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined` WÜJ–0z4~f°)sxÄgõ? é 5  × G ‘ ”(0,jsx_runtime.jsxs)ÿ“(0,jsx_runtime.jsx)ÿÿÿþþÿþÿÿ" ;// ./src/app/dashboard/page.tsx  ñ«webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSource«webpack/lib/util/registerExternalSerializer™webpack-sources/RawSourceÉÞ/* __next_internal_client_entry_do_not_use__ default auto */ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime"; import { useEffect, useState } from 'react'; import { useRouter, useSearchParams } from 'next/navigation'; import Link from 'next/link'; import { useSession } from '@/lib/auth'; import { useLocale } from '@/context/locale'; import { getMyTasks, getMyOffers, getMyReviews, getNotifications, getMyDashboard, getSpecialistFomoDashboard, getCustomerFomoDashboard, getMySpecialistCards, applyMyReferral } from '@/lib/api'; import { formatPrice, taskTitle } from '@/lib/taskLocale'; import { PlanBadge } from '@/components/PlanBadge'; import { UsageMeter } from '@/components/UsageMeter'; /** Extract the quoted task title from a stored notification body (any locale) */ function extractNotifParam(body) { if (!body) return null; const m = body.match(/[«""](.+?)[»""]/); var _m_; return (_m_ = m === null || m === void 0 ? void 0 : m[1]) !== null && _m_ !== void 0 ? _m_ : null; } function PlanBlock(param) { let { dashboard, t } = param; const plan = dashboard.plan; const expiry = dashboard.planExpiration; const usage = dashboard.usage; const stats = dashboard.stats; const expiryPct = expiry ? Math.max(0, Math.min(100, Math.round(expiry.daysLeft / 30 * 100))) : 100; const expiryColor = expiry ? expiry.daysLeft <= 3 ? 'bg-red-500' : expiry.daysLeft <= 7 ? 'bg-amber-400' : 'bg-green-400' : 'bg-green-400'; return /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-2xl border border-gray-200 p-5 mb-6", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between mb-4", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2", children: [ /*#__PURE__*/ _jsx("h2", { className: "font-semibold text-gray-800 text-sm", children: t('dashboard.plan.title', 'My Plan') }), plan ? /*#__PURE__*/ _jsx(PlanBadge, { tier: plan.tier, size: "sm" }) : /*#__PURE__*/ _jsx("span", { className: "text-xs text-gray-400", children: t('dashboard.plan.no_plan', 'Free') }) ] }), /*#__PURE__*/ _jsx(Link, { href: "/pricing", className: "text-xs font-medium text-green-600 hover:underline", children: (plan === null || plan === void 0 ? void 0 : plan.tier) === 'ultimate' ? null : t('dashboard.plan.upgrade', 'Upgrade') }) ] }), expiry && /*#__PURE__*/ _jsxs("div", { className: "mb-4", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex justify-between text-xs text-gray-500 mb-1", children: [ /*#__PURE__*/ _jsx("span", { children: t('dashboard.plan.expires', 'Expires in {n} days').replace('{n}', String(expiry.daysLeft)) }), /*#__PURE__*/ _jsxs("span", { children: [ expiry.daysLeft, " ", t('pricing.days', 'days') ] }) ] }), /*#__PURE__*/ _jsx("div", { className: "h-1.5 rounded-full bg-gray-100", children: /*#__PURE__*/ _jsx("div", { className: "h-full rounded-full transition-all ".concat(expiryColor), style: { width: "".concat(expiryPct, "%") } }) }) ] }), (usage.messagesSent !== undefined || usage.ordersMade !== undefined) && /*#__PURE__*/ _jsxs("div", { className: "space-y-2 mb-4", children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs font-medium text-gray-500 uppercase tracking-wide", children: t('dashboard.plan.limits', 'Daily limits') }), /*#__PURE__*/ _jsx(UsageMeter, { current: usage.messagesSent, limit: usage.messagesLeft !== null ? usage.messagesSent + usage.messagesLeft : null, label: t('dashboard.plan.messages', 'Messages') }), /*#__PURE__*/ _jsx(UsageMeter, { current: usage.ordersMade, limit: usage.ordersLeft !== null ? usage.ordersMade + usage.ordersLeft : null, label: t('dashboard.plan.orders', 'Orders') }) ] }), Object.keys(stats).length > 0 && /*#__PURE__*/ _jsx("div", { className: "grid grid-cols-2 gap-2", children: Object.entries(stats).map((param)=>{ let [key, val] = param; return /*#__PURE__*/ _jsxs("div", { className: "bg-gray-50 rounded-xl px-3 py-2 text-center", children: [ /*#__PURE__*/ _jsx("p", { className: "text-lg font-bold text-gray-800", children: val }), /*#__PURE__*/ _jsx("p", { className: "text-[10px] text-gray-400 uppercase tracking-wide", children: t("dashboard.stats.".concat(key), key) }) ] }, key); }) }) ] }); } export default function DashboardPage() { var _session_user, _fomoData_topCategories; const { data: session, isPending } = useSession(); const router = useRouter(); const searchParams = useSearchParams(); const { t, locale } = useLocale(); const [tasks, setTasks] = useState([]); const [offers, setOffers] = useState([]); const [myReviews, setMyReviews] = useState([]); const [invitations, setInvitations] = useState([]); const [loading, setLoading] = useState(true); const [dashboard, setDashboard] = useState(null); const [fomoData, setFomoData] = useState(null); const [hasHelperCard, setHasHelperCard] = useState(null); useEffect(()=>{ if (!isPending && !session) router.push('/login'); }, [ session, isPending ]); // Apply pending referral code after Google OAuth redirect (?ref=CODE) useEffect(()=>{ if (!session) return; const refCode = searchParams.get('ref'); if (!refCode) return; applyMyReferral(refCode).catch(()=>{}); // Remove the ref param from the URL without reloading const params = new URLSearchParams(searchParams.toString()); params.delete('ref'); const newUrl = params.toString() ? "?".concat(params.toString()) : window.location.pathname; router.replace(newUrl); }, [ session ]); // Detect whether the user has completed their helper profile (has a card). // Used to show the getting-started onboarding card to users who haven't yet. useEffect(()=>{ if (!session) return; getMySpecialistCards().then((param)=>{ let { cards } = param; return setHasHelperCard(cards.length > 0); }).catch(()=>setHasHelperCard(null)); }, [ session ]); useEffect(()=>{ if (!session) return; Promise.all([ getMyTasks(), getMyOffers(), getMyReviews(), getNotifications(), getMyDashboard() ]).then((param)=>{ let [t, o, r, notifs, dash] = param; setTasks(t); setOffers(o); setMyReviews(r); setInvitations(notifs.filter((n)=>n.type === 'task_invite')); setDashboard(dash); }).catch(()=>{}).finally(()=>setLoading(false)); }, [ session ]); useEffect(()=>{ var _session_user; if (!session) return; const role = (_session_user = session.user) === null || _session_user === void 0 ? void 0 : _session_user.role; if (role === 'specialist') { getSpecialistFomoDashboard().then(setFomoData).catch(()=>{}); } else { getCustomerFomoDashboard().then(setFomoData).catch(()=>{}); } }, [ session ]); if (isPending || loading) return /*#__PURE__*/ _jsx("div", { className: "text-center py-20 text-white", children: t('common.loading') }); const dateLocale = locale === 'ru' ? 'ru-RU' : locale === 'uk' ? 'uk-UA' : locale === 'en' ? 'en-US' : 'el-GR'; const activeTasks = tasks.filter((task)=>task.status !== 'completed' && task.status !== 'cancelled'); const completedTasks = tasks.filter((task)=>task.status === 'completed' || task.status === 'cancelled'); const activeOffers = offers.filter((row)=>{ const offer = row.offer || row; const task = row.task; return offer.status !== 'other_accepted' && (task === null || task === void 0 ? void 0 : task.status) !== 'completed' && (task === null || task === void 0 ? void 0 : task.status) !== 'cancelled'; }); const completedOffers = offers.filter((row)=>{ const offer = row.offer || row; const task = row.task; return offer.status === 'other_accepted' || (task === null || task === void 0 ? void 0 : task.status) === 'completed' || (task === null || task === void 0 ? void 0 : task.status) === 'cancelled'; }); function TaskCard(param) { let { task } = param; var _task_offerCount; const offerCount = (_task_offerCount = task.offerCount) !== null && _task_offerCount !== void 0 ? _task_offerCount : 0; var _task_declinedCount; const declinedCount = (_task_declinedCount = task.declinedCount) !== null && _task_declinedCount !== void 0 ? _task_declinedCount : 0; const activeOfferCount = offerCount - declinedCount; return /*#__PURE__*/ _jsx(Link, { href: "/tasks/".concat(task.id), className: "block bg-white rounded-xl border border-gray-200 p-4 hover:shadow-sm hover:border-green-300 transition", children: /*#__PURE__*/ _jsxs("div", { className: "flex justify-between items-start", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ _jsx("p", { className: "font-medium text-gray-900 truncate", children: taskTitle(task, locale) }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-1", children: new Date(task.createdAt).toLocaleDateString(dateLocale) }), offerCount > 0 && /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 mt-1.5", children: [ /*#__PURE__*/ _jsxs("span", { className: "text-xs text-green-600 font-medium", children: [ "\uD83D\uDCBC ", offerCount, " ", t('dashboard.offers_count', 'offers') ] }), declinedCount > 0 && /*#__PURE__*/ _jsxs("span", { className: "text-xs text-red-400", children: [ "✕ ", declinedCount, " ", t('dashboard.declined_count', 'declined') ] }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "ml-3 text-right shrink-0", children: [ /*#__PURE__*/ _jsx("span", { className: "text-xs px-2 py-0.5 rounded-full ".concat(task.status === 'open' ? 'bg-green-100 text-green-700' : task.status === 'in_progress' ? 'bg-green-100 text-green-700' : task.status === 'completed' ? 'bg-gray-100 text-gray-600' : 'bg-red-100 text-red-600'), children: t("task.status.".concat(task.status), task.status) }), task.budget && /*#__PURE__*/ _jsxs("p", { className: "text-sm font-bold text-green-600 mt-1", children: [ formatPrice(task.budget), "€" ] }) ] }) ] }) }); } function OfferCard(param) { let { row } = param; var _myReviews_find; const offer = row.offer || row; const task = row.task; var _myReviews_find_review; const reviewReceived = (task === null || task === void 0 ? void 0 : task.status) === 'completed' && offer.status === 'accepted' ? (_myReviews_find_review = (_myReviews_find = myReviews.find((r)=>{ var _r_review; return ((_r_review = r.review) === null || _r_review === void 0 ? void 0 : _r_review.taskId) === (task === null || task === void 0 ? void 0 : task.id); })) === null || _myReviews_find === void 0 ? void 0 : _myReviews_find.review) !== null && _myReviews_find_review !== void 0 ? _myReviews_find_review : null : null; return /*#__PURE__*/ _jsxs(Link, { href: task ? "/tasks/".concat(task.id) : '#', className: "block bg-white rounded-xl border border-gray-200 p-4 hover:shadow-sm hover:border-green-300 transition", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex justify-between items-start", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ _jsx("p", { className: "font-medium text-gray-900 truncate", children: (task === null || task === void 0 ? void 0 : task.title) || t('chat.task_fallback') }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-1", children: new Date(offer.createdAt).toLocaleDateString(dateLocale) }) ] }), /*#__PURE__*/ _jsxs("div", { className: "ml-3 text-right shrink-0", children: [ /*#__PURE__*/ _jsxs("p", { className: "font-bold text-green-600", children: [ formatPrice(offer.price), "€" ] }), /*#__PURE__*/ _jsx("span", { className: "text-xs px-2 py-0.5 rounded-full mt-1 inline-block ".concat(offer.status === 'accepted' ? 'bg-green-100 text-green-700' : offer.status === 'declined' ? 'bg-red-100 text-red-700' : offer.status === 'other_accepted' ? 'bg-green-100 text-green-600' : 'bg-gray-100 text-gray-700'), children: t("offer.status.".concat(offer.status), offer.status) }) ] }) ] }), reviewReceived && /*#__PURE__*/ _jsxs("div", { className: "mt-3 pt-3 border-t border-gray-100 flex items-center gap-2", children: [ /*#__PURE__*/ _jsx("div", { className: "flex gap-0.5", children: [ 1, 2, 3, 4, 5 ].map((star)=>/*#__PURE__*/ _jsx("span", { className: "text-sm ".concat(star <= reviewReceived.rating ? 'text-yellow-400' : 'text-gray-200'), children: "★" }, star)) }), /*#__PURE__*/ _jsxs("span", { className: "text-sm font-semibold text-gray-700", children: [ reviewReceived.rating, "/5" ] }), reviewReceived.comment && /*#__PURE__*/ _jsx("span", { className: "text-xs text-gray-500 truncate", children: reviewReceived.comment }) ] }), (task === null || task === void 0 ? void 0 : task.status) === 'completed' && offer.status === 'accepted' && !reviewReceived && /*#__PURE__*/ _jsx("p", { className: "mt-2 text-xs text-gray-400", children: t('dashboard.review_pending') }) ] }); } const isSpecialist = (session === null || session === void 0 ? void 0 : (_session_user = session.user) === null || _session_user === void 0 ? void 0 : _session_user.role) === 'specialist'; var _fomoData_missedCount; return /*#__PURE__*/ _jsxs("div", { className: "max-w-5xl mx-auto px-4 py-8", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex justify-between items-center mb-8", children: [ /*#__PURE__*/ _jsx("h1", { className: "text-2xl font-bold text-white", children: t('dashboard.title') }), /*#__PURE__*/ _jsx(Link, { href: "/tasks/new", className: "bg-green-600 text-white px-4 py-2 rounded-lg text-sm font-medium hover:bg-green-700", children: t('dashboard.new_task') }) ] }), hasHelperCard === false && /*#__PURE__*/ _jsxs("div", { className: "mb-6 bg-white rounded-2xl border border-gray-200 overflow-hidden", children: [ /*#__PURE__*/ _jsxs("div", { className: "px-5 pt-5 pb-3", children: [ /*#__PURE__*/ _jsx("h2", { className: "text-lg font-bold text-gray-900", children: t('dashboard.onboarding.title') }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-500 mt-1", children: t('dashboard.onboarding.subtitle') }) ] }), /*#__PURE__*/ _jsxs("div", { className: "grid sm:grid-cols-2 gap-3 p-5 pt-2", children: [ /*#__PURE__*/ _jsxs(Link, { href: "/specialist-setup", className: "group flex flex-col rounded-xl border-2 border-green-500 bg-green-50 p-4 hover:bg-green-100 transition", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 mb-1", children: [ /*#__PURE__*/ _jsx("span", { className: "text-xl", children: "\uD83D\uDEE0" }), /*#__PURE__*/ _jsx("span", { className: "font-semibold text-gray-800", children: t('dashboard.onboarding.helper.title') }) ] }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-green-700/80 mb-3 flex-1", children: t('dashboard.onboarding.helper.desc') }), /*#__PURE__*/ _jsxs("span", { className: "inline-flex items-center gap-1 text-sm font-semibold text-green-700", children: [ t('dashboard.onboarding.helper.cta'), " →" ] }) ] }), /*#__PURE__*/ _jsxs(Link, { href: "/tasks/new", className: "group flex flex-col rounded-xl border border-gray-200 bg-gray-50 p-4 hover:bg-gray-100 transition", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 mb-1", children: [ /*#__PURE__*/ _jsx("span", { className: "text-xl", children: "\uD83D\uDCDD" }), /*#__PURE__*/ _jsx("span", { className: "font-semibold text-gray-800", children: t('dashboard.onboarding.requester.title') }) ] }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-500 mb-3 flex-1", children: t('dashboard.onboarding.requester.desc') }), /*#__PURE__*/ _jsxs("span", { className: "inline-flex items-center gap-1 text-sm font-semibold text-gray-700", children: [ t('dashboard.onboarding.requester.cta'), " →" ] }) ] }) ] }) ] }), dashboard && /*#__PURE__*/ _jsx(PlanBlock, { dashboard: dashboard, t: t }), fomoData && (isSpecialist ? (fomoData.missedCount > 0 || fomoData.missedEarnings > 0) && /*#__PURE__*/ _jsxs("div", { className: "mb-6 bg-amber-50 border border-amber-200 rounded-xl px-5 py-4 flex items-start gap-3", children: [ /*#__PURE__*/ _jsx("div", { className: "shrink-0 mt-0.5", children: /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5 text-amber-500", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 9v2m0 4h.01M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z" }) }) }), /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ _jsxs("p", { className: "text-base font-semibold text-amber-800", children: [ t('fomo.specialist_missed', 'You missed {n} tasks').replace('{n}', String((_fomoData_missedCount = fomoData.missedCount) !== null && _fomoData_missedCount !== void 0 ? _fomoData_missedCount : 0)), fomoData.missedEarnings > 0 && /*#__PURE__*/ _jsxs("span", { className: "ml-1 text-amber-600", children: [ "for €", fomoData.missedEarnings ] }) ] }), ((_fomoData_topCategories = fomoData.topCategories) === null || _fomoData_topCategories === void 0 ? void 0 : _fomoData_topCategories.length) > 0 && /*#__PURE__*/ _jsxs("p", { className: "text-sm text-amber-600 mt-0.5", children: [ t('fomo.top_categories', 'Categories'), ": ", fomoData.topCategories.slice(0, 3).join(', ') ] }) ] }), /*#__PURE__*/ _jsx(Link, { href: "/pricing", className: "shrink-0 text-xs font-medium text-amber-700 bg-amber-100 px-3 py-1.5 rounded-lg hover:bg-amber-200 transition", children: t('dashboard.plan.upgrade') }) ] }) : fomoData.totalTasks > 0 && /*#__PURE__*/ _jsx("div", { className: "mb-6 bg-green-50 border border-green-200 rounded-xl px-5 py-4", children: /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between gap-4 flex-wrap", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3", children: [ /*#__PURE__*/ _jsx("div", { className: "shrink-0 bg-green-100 rounded-xl p-2", children: /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5 text-green-600", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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" }) }) }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("p", { className: "text-base font-semibold text-gray-800", children: [ fomoData.totalOffers, " ", t('fomo.offers_received', 'offers received') ] }), fomoData.avgOffersPerTask > 0 && /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-500", children: t('fomo.avg_offers', 'Average {n}/task').replace('{n}', Number(fomoData.avgOffersPerTask).toFixed(1)) }) ] }) ] }), fomoData.completionRate !== undefined && /*#__PURE__*/ _jsxs("div", { className: "text-right", children: [ /*#__PURE__*/ _jsxs("p", { className: "text-2xl font-bold text-green-700", children: [ Math.round(fomoData.completionRate * 100), "%" ] }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-400", children: t('fomo.completion_rate', 'completed') }) ] }) ] }) })), isSpecialist && /*#__PURE__*/ _jsxs(Link, { href: "/tasks", className: "flex items-center justify-between gap-4 bg-green-600 text-white rounded-xl px-5 py-4 mb-8 hover:bg-green-700 transition", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-4", children: [ /*#__PURE__*/ _jsx("div", { className: "shrink-0 bg-white/20 rounded-xl p-2.5", children: /*#__PURE__*/ _jsxs("svg", { className: "w-6 h-6 text-white", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ _jsx("circle", { cx: "11", cy: "11", r: "7" }), /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M21 21l-4.35-4.35" }) ] }) }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "font-semibold text-base", children: t('find_tasks.title') }), /*#__PURE__*/ _jsx("p", { className: "text-green-100 text-sm mt-0.5", children: t('find_tasks.banner_hint') }) ] }) ] }), /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5 shrink-0 text-white/70", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 5l7 7-7 7" }) }) ] }), /*#__PURE__*/ _jsxs("div", { className: "grid md:grid-cols-2 gap-8", children: [ /*#__PURE__*/ _jsxs("div", { className: "space-y-8", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("h2", { className: "text-lg font-semibold text-white mb-4", children: [ t('dashboard.my_tasks'), " ", /*#__PURE__*/ _jsxs("span", { className: "text-white/60 font-normal text-base", children: [ "(", activeTasks.length, ")" ] }) ] }), activeTasks.length === 0 ? /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6 text-center text-gray-500", children: [ /*#__PURE__*/ _jsx("p", { children: t('dashboard.tasks.empty') }), /*#__PURE__*/ _jsx(Link, { href: "/tasks/new", className: "text-green-600 hover:underline text-sm mt-2 inline-block", children: t('dashboard.tasks.empty.cta') }) ] }) : /*#__PURE__*/ _jsx("div", { className: "space-y-3", children: activeTasks.map((task)=>/*#__PURE__*/ _jsx(TaskCard, { task: task }, task.id)) }) ] }), completedTasks.length > 0 && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("h2", { className: "text-lg font-semibold text-white/70 mb-4", children: [ t('dashboard.completed_tasks'), " ", /*#__PURE__*/ _jsxs("span", { className: "font-normal text-base text-white/50", children: [ "(", completedTasks.length, ")" ] }) ] }), /*#__PURE__*/ _jsx("div", { className: "space-y-3 opacity-75", children: completedTasks.map((task)=>/*#__PURE__*/ _jsx(TaskCard, { task: task }, task.id)) }) ] }) ] }), /*#__PURE__*/ _jsx("div", { className: "space-y-8", children: isSpecialist ? /*#__PURE__*/ _jsxs(_Fragment, { children: [ invitations.length > 0 && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("h2", { className: "text-lg font-semibold text-white mb-4", children: [ t('dashboard.invitations'), " ", /*#__PURE__*/ _jsxs("span", { className: "text-white/60 font-normal text-base", children: [ "(", invitations.length, ")" ] }) ] }), /*#__PURE__*/ _jsx("div", { className: "space-y-3", children: invitations.map((inv)=>/*#__PURE__*/ _jsxs(Link, { href: inv.referenceId ? "/tasks/".concat(inv.referenceId) : '/tasks', className: "flex items-start gap-3 p-4 rounded-xl border transition cursor-pointer ".concat(inv.isRead ? 'bg-white/90 border-white/20 hover:bg-white' : 'bg-white border-amber-300 shadow-sm hover:bg-amber-50'), children: [ /*#__PURE__*/ _jsx("span", { className: "text-2xl", children: "\uD83D\uDCCB" }), /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ _jsx("p", { className: "font-medium truncate ".concat(inv.isRead ? 'text-gray-600' : 'text-gray-900'), children: t('notif.type.task_invite', inv.title) }), inv.body && /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-500 mt-0.5 truncate", children: (()=>{ const title = extractNotifParam(inv.body); const tpl = t('notif.body.task_invite', ''); return title && tpl ? tpl.replace('{title}', title) : inv.body; })() }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-1", children: new Date(inv.createdAt).toLocaleDateString(dateLocale) }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex flex-col items-end gap-1.5 shrink-0", children: [ !inv.isRead && /*#__PURE__*/ _jsx("span", { className: "w-2 h-2 bg-amber-400 rounded-full mt-2" }), /*#__PURE__*/ _jsx("span", { className: "text-xs text-gray-400", children: "→" }) ] }) ] }, inv.id)) }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("h2", { className: "text-lg font-semibold text-white mb-4", children: [ t('dashboard.my_offers'), " ", /*#__PURE__*/ _jsxs("span", { className: "text-white/60 font-normal text-base", children: [ "(", activeOffers.length, ")" ] }) ] }), activeOffers.length === 0 ? /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6 text-center text-gray-500", children: [ /*#__PURE__*/ _jsx("p", { children: t('dashboard.offers.empty') }), /*#__PURE__*/ _jsx(Link, { href: "/tasks", className: "text-green-600 hover:underline text-sm mt-2 inline-block", children: t('dashboard.offers.empty.cta') }) ] }) : /*#__PURE__*/ _jsx("div", { className: "space-y-3", children: activeOffers.map((row)=>/*#__PURE__*/ _jsx(OfferCard, { row: row }, (row.offer || row).id)) }) ] }), completedOffers.length > 0 && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("h2", { className: "text-lg font-semibold text-white/70 mb-4", children: [ t('dashboard.completed_offers'), " ", /*#__PURE__*/ _jsxs("span", { className: "font-normal text-base text-white/50", children: [ "(", completedOffers.length, ")" ] }) ] }), /*#__PURE__*/ _jsx("div", { className: "space-y-3 opacity-75", children: completedOffers.map((row)=>/*#__PURE__*/ _jsx(OfferCard, { row: row }, (row.offer || row).id)) }) ] }) ] }) : /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs(Link, { href: "/specialists", className: "flex items-center justify-between gap-4 bg-green-600 text-white rounded-xl px-5 py-4 hover:bg-green-700 transition", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-4", children: [ /*#__PURE__*/ _jsx("div", { className: "shrink-0 bg-white/20 rounded-xl p-2.5", children: /*#__PURE__*/ _jsx("svg", { className: "w-6 h-6 text-white", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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" }) }) }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "font-semibold text-base", children: t('dashboard.customer.specialists_title') }), /*#__PURE__*/ _jsx("p", { className: "text-green-100 text-sm mt-0.5", children: t('dashboard.customer.specialists_hint') }) ] }) ] }), /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5 shrink-0 text-white/70", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 5l7 7-7 7" }) }) ] }), /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-5", children: [ /*#__PURE__*/ _jsx("h2", { className: "text-base font-semibold text-gray-800 mb-4", children: t('dashboard.customer.how_title') }), /*#__PURE__*/ _jsx("div", { className: "space-y-3", children: [ { num: '1', text: t('dashboard.customer.step1'), icon: 'M12 4v16m8-8H4' }, { num: '2', text: t('dashboard.customer.step2'), icon: 'M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z' }, { num: '3', text: t('dashboard.customer.step3'), icon: 'M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z' } ].map((param)=>{ let { num, text, icon } = param; return /*#__PURE__*/ _jsxs("div", { className: "flex items-start gap-3", children: [ /*#__PURE__*/ _jsx("span", { className: "shrink-0 w-7 h-7 rounded-full bg-green-100 text-green-600 text-sm font-bold flex items-center justify-center", children: num }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-600 pt-1", children: text }) ] }, num); }) }), /*#__PURE__*/ _jsxs(Link, { href: "/tasks/new", className: "mt-4 inline-block text-sm font-medium text-green-600 hover:underline", children: [ tasks.length > 0 ? t('dashboard.tasks.add_new') : t('dashboard.tasks.empty.cta'), " →" ] }) ] }) ] }) }) ] }) ] }); } @Ü`=_’”¿ÁýÿDFrt46oq£¥Ùó÷{ š«§ª¬ŽD _G X [ ] ` Þ â N R   ß ã LOÏÒy}óöæéëô "+‚…Y_] ÚÝ#1НÇÏíû"ELsz§®ßæELy€·ŸË_Ó™¡,4<j}> F Ž — š ² Ã Î ß î ÿ !t"|"f##Á#Ø#[$^$“*–*˜*_›*r+v+þ+,,“,--y-|-Œ..F/J/t1x1Ý3á3y4|4e6i67 7;;; ;<<®<_²<L=O=>„>Ä?È?l@p@A&AÚAÝAIDMDûDþDNFQF‚G†GÞHáHUJXJL LuLyLM MÉM_ÌMÎMÑM$O(OÐOÔObPePQQTQfRjR SSSSHTLTUU!V$VžW¡WžXŒX¶ZºZŒZ¿Zæ[_ê[¶\¹\Ÿ]Á]>_A_W`[`Šb©bvczc6d9dªd­déeìeegig÷gûg¿iÃillúmýmÿmnfo_ioøoüo¡p¥pHqKqéqìqpsss¢uŠuvvExHx:z>zÔzØz\|_|Å}É}Ë}Î}Ç~Ë~beü_€’•€‚§‚=„A„ª„­„Š…©…‡‡?ˆBˆS‰W‰Ø‰Ü‰eŠiŠÒŠÖŠ Œ$Œ‡Ž‹Žƒ†NQS_Vÿ‘’¥’š’Ú“Þ“G”K”Ÿ•£•î—ñ—¢˜¥˜ã™æ™`šdšfšnšãšçšX›\›œœÁœ1Ÿ4ŸÞŸâŸäŸ_çŸò¡õ¡+£/£)€,€ç¥ê¥ ©© ««3¬6¬L­O­æ¯ê¯[°_°Ÿ±Â±OŽSŽWµZµ/¶2¶4¶7¶õ·_ø·£žŠžþ¹ºsºwºà»ä»XŸ[Ÿ¿¿kÀoÀqÀyÀÔÀØÀÚÀÝÀ'Â+ÂþÂÃÀÃÃãŊÅJÈNÈßÈVâÈ?ÊBÊVÌYÌýÍαϵχЊгѶÑY×]×GØJØÙÙÜÙÐÛÔÛÖÛÙۀ€€€€€€€€€Í__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._ÿÿË__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._ÿÒ__WEBPACK_MODULE_REFERENCE__8_5b22506c616e4261646765225d_directImport_asiSafe1__._þþÎ__WEBPACK_MODULE_REFERENCE__3_5b2264656661756c74225d_directImport_asiSafe1__._üüýüýýüýýÔ__WEBPACK_MODULE_REFERENCE__9_5b2255736167654d65746572225d_directImport_asiSafe1__._üÿüûüü€Ù__WEBPACK_MODULE_REFERENCE__4_5b2275736553657373696f6e225d_call_directImport_asiSafe1__._×__WEBPACK_MODULE_REFERENCE__2_5b22757365526f75746572225d_call_directImport_asiSafe1__._ã__WEBPACK_MODULE_REFERENCE__2_5b22757365536561726368506172616d73225d_call_directImport_asiSafe1__._×__WEBPACK_MODULE_REFERENCE__5_5b227573654c6f63616c65225d_call_directImport_asiSafe1__._Õ__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._ÿÿÿÿÿÿÿ×__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._ÿã__WEBPACK_MODULE_REFERENCE__6_5b226170706c794d79526566657272616c225d_call_directImport_asiSafe1__._þí__WEBPACK_MODULE_REFERENCE__6_5b226765744d795370656369616c6973744361726473225d_call_directImport_asiSafe1__._ýÙ__WEBPACK_MODULE_REFERENCE__6_5b226765744d795461736b73225d_call_directImport_asiSafe1__._Û__WEBPACK_MODULE_REFERENCE__6_5b226765744d794f6666657273225d_call_directImport_asiSafe1__._Ý__WEBPACK_MODULE_REFERENCE__6_5b226765744d7952657669657773225d_call_directImport_asiSafe1__._å__WEBPACK_MODULE_REFERENCE__6_5b226765744e6f74696669636174696f6e73225d_call_directImport_asiSafe1__._á__WEBPACK_MODULE_REFERENCE__6_5b226765744d7944617368626f617264225d_call_directImport_asiSafe1__._øù__WEBPACK_MODULE_REFERENCE__6_5b226765745370656369616c697374466f6d6f44617368626f617264225d_call_directImport_asiSafe1__._õ__WEBPACK_MODULE_REFERENCE__6_5b22676574437573746f6d6572466f6d6f44617368626f617264225d_call_directImport_asiSafe1__._ííïììí×__WEBPACK_MODULE_REFERENCE__7_5b227461736b5469746c65225d_call_directImport_asiSafe1__._ìëëëëìëÛ__WEBPACK_MODULE_REFERENCE__7_5b22666f726d61745072696365225d_call_directImport_asiSafe1__._êíêêëëêêÿëêëëêëëêêëëíêêëëêêíêëëëêêíêëëëêëêëëëêêêêëíëêêëëëêêëêêëêíêëêëëêëëëëêêêêêêëëíëëêêêëëëêÐ__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._éééêéìêéêêêéêêééééêêìêêéééêêéÿéìéêêêéêêêêéêêéêêéìí«/* __next_internal_client_entry_do_not_use__ default auto */ /** Extract the quoted task title from a stored notification body (any locale) */ function extractNotifParam(body) { if (!body) return null; const m = body.match(/[«""](.+?)[»""]/); var _m_; return (_m_ = m === null || m === void 0 ? void 0 : m[1]) !== null && _m_ !== void 0 ? _m_ : null; } function PlanBlock(param) { let { dashboard, t } = param; const plan = dashboard.plan; const expiry = dashboard.planExpiration; const usage = dashboard.usage; const stats = dashboard.stats; const expiryPct = expiry ? Math.max(0, Math.min(100, Math.round(expiry.daysLeft / 30 * 100))) : 100; const expiryColor = expiry ? expiry.daysLeft <= 3 ? 'bg-red-500' : expiry.daysLeft <= 7 ? 'bg-amber-400' : 'bg-green-400' : 'bg-green-400'; return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "bg-white rounded-2xl border border-gray-200 p-5 mb-6", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "flex items-center justify-between mb-4", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "flex items-center gap-2", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("h2", { className: "font-semibold text-gray-800 text-sm", children: t('dashboard.plan.title', 'My Plan') }), plan ? /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__8_5b22506c616e4261646765225d_directImport_asiSafe1__._, { tier: plan.tier, size: "sm" }) : /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { className: "text-xs text-gray-400", children: t('dashboard.plan.no_plan', 'Free') }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__3_5b2264656661756c74225d_directImport_asiSafe1__._, { href: "/pricing", className: "text-xs font-medium text-green-600 hover:underline", children: (plan === null || plan === void 0 ? void 0 : plan.tier) === 'ultimate' ? null : t('dashboard.plan.upgrade', 'Upgrade') }) ] }), expiry && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "mb-4", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "flex justify-between text-xs text-gray-500 mb-1", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { children: t('dashboard.plan.expires', 'Expires in {n} days').replace('{n}', String(expiry.daysLeft)) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("span", { children: [ expiry.daysLeft, " ", t('pricing.days', 'days') ] }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "h-1.5 rounded-full bg-gray-100", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "h-full rounded-full transition-all ".concat(expiryColor), style: { width: "".concat(expiryPct, "%") } }) }) ] }), (usage.messagesSent !== undefined || usage.ordersMade !== undefined) && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "space-y-2 mb-4", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { className: "text-xs font-medium text-gray-500 uppercase tracking-wide", children: t('dashboard.plan.limits', 'Daily limits') }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__9_5b2255736167654d65746572225d_directImport_asiSafe1__._, { current: usage.messagesSent, limit: usage.messagesLeft !== null ? usage.messagesSent + usage.messagesLeft : null, label: t('dashboard.plan.messages', 'Messages') }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__9_5b2255736167654d65746572225d_directImport_asiSafe1__._, { current: usage.ordersMade, limit: usage.ordersLeft !== null ? usage.ordersMade + usage.ordersLeft : null, label: t('dashboard.plan.orders', 'Orders') }) ] }), Object.keys(stats).length > 0 && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "grid grid-cols-2 gap-2", children: Object.entries(stats).map((param)=>{ let [key, val] = param; return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "bg-gray-50 rounded-xl px-3 py-2 text-center", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { className: "text-lg font-bold text-gray-800", children: val }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { className: "text-[10px] text-gray-400 uppercase tracking-wide", children: t("dashboard.stats.".concat(key), key) }) ] }, key); }) }) ] }); } function DashboardPage() { var _session_user, _fomoData_topCategories; const { data: session, isPending } = __WEBPACK_MODULE_REFERENCE__4_5b2275736553657373696f6e225d_call_directImport_asiSafe1__._(); const router = __WEBPACK_MODULE_REFERENCE__2_5b22757365526f75746572225d_call_directImport_asiSafe1__._(); const searchParams = __WEBPACK_MODULE_REFERENCE__2_5b22757365536561726368506172616d73225d_call_directImport_asiSafe1__._(); const { t, locale } = __WEBPACK_MODULE_REFERENCE__5_5b227573654c6f63616c65225d_call_directImport_asiSafe1__._(); const [tasks, setTasks] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._([]); const [offers, setOffers] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._([]); const [myReviews, setMyReviews] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._([]); const [invitations, setInvitations] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._([]); const [loading, setLoading] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._(true); const [dashboard, setDashboard] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._(null); const [fomoData, setFomoData] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._(null); const [hasHelperCard, setHasHelperCard] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._(null); __WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._(()=>{ if (!isPending && !session) router.push('/login'); }, [ session, isPending ]); // Apply pending referral code after Google OAuth redirect (?ref=CODE) __WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._(()=>{ if (!session) return; const refCode = searchParams.get('ref'); if (!refCode) return; __WEBPACK_MODULE_REFERENCE__6_5b226170706c794d79526566657272616c225d_call_directImport_asiSafe1__._(refCode).catch(()=>{}); // Remove the ref param from the URL without reloading const params = new URLSearchParams(searchParams.toString()); params.delete('ref'); const newUrl = params.toString() ? "?".concat(params.toString()) : window.location.pathname; router.replace(newUrl); }, [ session ]); // Detect whether the user has completed their helper profile (has a card). // Used to show the getting-started onboarding card to users who haven't yet. __WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._(()=>{ if (!session) return; __WEBPACK_MODULE_REFERENCE__6_5b226765744d795370656369616c6973744361726473225d_call_directImport_asiSafe1__._().then((param)=>{ let { cards } = param; return setHasHelperCard(cards.length > 0); }).catch(()=>setHasHelperCard(null)); }, [ session ]); __WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._(()=>{ if (!session) return; Promise.all([ __WEBPACK_MODULE_REFERENCE__6_5b226765744d795461736b73225d_call_directImport_asiSafe1__._(), __WEBPACK_MODULE_REFERENCE__6_5b226765744d794f6666657273225d_call_directImport_asiSafe1__._(), __WEBPACK_MODULE_REFERENCE__6_5b226765744d7952657669657773225d_call_directImport_asiSafe1__._(), __WEBPACK_MODULE_REFERENCE__6_5b226765744e6f74696669636174696f6e73225d_call_directImport_asiSafe1__._(), __WEBPACK_MODULE_REFERENCE__6_5b226765744d7944617368626f617264225d_call_directImport_asiSafe1__._() ]).then((param)=>{ let [t, o, r, notifs, dash] = param; setTasks(t); setOffers(o); setMyReviews(r); setInvitations(notifs.filter((n)=>n.type === 'task_invite')); setDashboard(dash); }).catch(()=>{}).finally(()=>setLoading(false)); }, [ session ]); __WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._(()=>{ var _session_user; if (!session) return; const role = (_session_user = session.user) === null || _session_user === void 0 ? void 0 : _session_user.role; if (role === 'specialist') { __WEBPACK_MODULE_REFERENCE__6_5b226765745370656369616c697374466f6d6f44617368626f617264225d_call_directImport_asiSafe1__._().then(setFomoData).catch(()=>{}); } else { __WEBPACK_MODULE_REFERENCE__6_5b22676574437573746f6d6572466f6d6f44617368626f617264225d_call_directImport_asiSafe1__._().then(setFomoData).catch(()=>{}); } }, [ session ]); if (isPending || loading) return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "text-center py-20 text-white", children: t('common.loading') }); const dateLocale = locale === 'ru' ? 'ru-RU' : locale === 'uk' ? 'uk-UA' : locale === 'en' ? 'en-US' : 'el-GR'; const activeTasks = tasks.filter((task)=>task.status !== 'completed' && task.status !== 'cancelled'); const completedTasks = tasks.filter((task)=>task.status === 'completed' || task.status === 'cancelled'); const activeOffers = offers.filter((row)=>{ const offer = row.offer || row; const task = row.task; return offer.status !== 'other_accepted' && (task === null || task === void 0 ? void 0 : task.status) !== 'completed' && (task === null || task === void 0 ? void 0 : task.status) !== 'cancelled'; }); const completedOffers = offers.filter((row)=>{ const offer = row.offer || row; const task = row.task; return offer.status === 'other_accepted' || (task === null || task === void 0 ? void 0 : task.status) === 'completed' || (task === null || task === void 0 ? void 0 : task.status) === 'cancelled'; }); function TaskCard(param) { let { task } = param; var _task_offerCount; const offerCount = (_task_offerCount = task.offerCount) !== null && _task_offerCount !== void 0 ? _task_offerCount : 0; var _task_declinedCount; const declinedCount = (_task_declinedCount = task.declinedCount) !== null && _task_declinedCount !== void 0 ? _task_declinedCount : 0; const activeOfferCount = offerCount - declinedCount; return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__3_5b2264656661756c74225d_directImport_asiSafe1__._, { href: "/tasks/".concat(task.id), className: "block bg-white rounded-xl border border-gray-200 p-4 hover:shadow-sm hover:border-green-300 transition", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "flex justify-between items-start", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { className: "font-medium text-gray-900 truncate", children: __WEBPACK_MODULE_REFERENCE__7_5b227461736b5469746c65225d_call_directImport_asiSafe1__._(task, locale) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { className: "text-xs text-gray-400 mt-1", children: new Date(task.createdAt).toLocaleDateString(dateLocale) }), offerCount > 0 && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "flex items-center gap-2 mt-1.5", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("span", { className: "text-xs text-green-600 font-medium", children: [ "\uD83D\uDCBC ", offerCount, " ", t('dashboard.offers_count', 'offers') ] }), declinedCount > 0 && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("span", { className: "text-xs text-red-400", children: [ "✕ ", declinedCount, " ", t('dashboard.declined_count', 'declined') ] }) ] }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "ml-3 text-right shrink-0", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { className: "text-xs px-2 py-0.5 rounded-full ".concat(task.status === 'open' ? 'bg-green-100 text-green-700' : task.status === 'in_progress' ? 'bg-green-100 text-green-700' : task.status === 'completed' ? 'bg-gray-100 text-gray-600' : 'bg-red-100 text-red-600'), children: t("task.status.".concat(task.status), task.status) }), task.budget && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("p", { className: "text-sm font-bold text-green-600 mt-1", children: [ __WEBPACK_MODULE_REFERENCE__7_5b22666f726d61745072696365225d_call_directImport_asiSafe1__._(task.budget), "€" ] }) ] }) ] }) }); } function OfferCard(param) { let { row } = param; var _myReviews_find; const offer = row.offer || row; const task = row.task; var _myReviews_find_review; const reviewReceived = (task === null || task === void 0 ? void 0 : task.status) === 'completed' && offer.status === 'accepted' ? (_myReviews_find_review = (_myReviews_find = myReviews.find((r)=>{ var _r_review; return ((_r_review = r.review) === null || _r_review === void 0 ? void 0 : _r_review.taskId) === (task === null || task === void 0 ? void 0 : task.id); })) === null || _myReviews_find === void 0 ? void 0 : _myReviews_find.review) !== null && _myReviews_find_review !== void 0 ? _myReviews_find_review : null : null; return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__3_5b2264656661756c74225d_directImport_asiSafe1__._, { href: task ? "/tasks/".concat(task.id) : '#', className: "block bg-white rounded-xl border border-gray-200 p-4 hover:shadow-sm hover:border-green-300 transition", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "flex justify-between items-start", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { className: "font-medium text-gray-900 truncate", children: (task === null || task === void 0 ? void 0 : task.title) || t('chat.task_fallback') }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { className: "text-xs text-gray-400 mt-1", children: new Date(offer.createdAt).toLocaleDateString(dateLocale) }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "ml-3 text-right shrink-0", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("p", { className: "font-bold text-green-600", children: [ __WEBPACK_MODULE_REFERENCE__7_5b22666f726d61745072696365225d_call_directImport_asiSafe1__._(offer.price), "€" ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { className: "text-xs px-2 py-0.5 rounded-full mt-1 inline-block ".concat(offer.status === 'accepted' ? 'bg-green-100 text-green-700' : offer.status === 'declined' ? 'bg-red-100 text-red-700' : offer.status === 'other_accepted' ? 'bg-green-100 text-green-600' : 'bg-gray-100 text-gray-700'), children: t("offer.status.".concat(offer.status), offer.status) }) ] }) ] }), reviewReceived && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "mt-3 pt-3 border-t border-gray-100 flex items-center gap-2", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "flex gap-0.5", children: [ 1, 2, 3, 4, 5 ].map((star)=>/*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { className: "text-sm ".concat(star <= reviewReceived.rating ? 'text-yellow-400' : 'text-gray-200'), children: "★" }, star)) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("span", { className: "text-sm font-semibold text-gray-700", children: [ reviewReceived.rating, "/5" ] }), reviewReceived.comment && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { className: "text-xs text-gray-500 truncate", children: reviewReceived.comment }) ] }), (task === null || task === void 0 ? void 0 : task.status) === 'completed' && offer.status === 'accepted' && !reviewReceived && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { className: "mt-2 text-xs text-gray-400", children: t('dashboard.review_pending') }) ] }); } const isSpecialist = (session === null || session === void 0 ? void 0 : (_session_user = session.user) === null || _session_user === void 0 ? void 0 : _session_user.role) === 'specialist'; var _fomoData_missedCount; return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "max-w-5xl mx-auto px-4 py-8", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "flex justify-between items-center mb-8", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("h1", { className: "text-2xl font-bold text-white", children: t('dashboard.title') }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__3_5b2264656661756c74225d_directImport_asiSafe1__._, { href: "/tasks/new", className: "bg-green-600 text-white px-4 py-2 rounded-lg text-sm font-medium hover:bg-green-700", children: t('dashboard.new_task') }) ] }), hasHelperCard === false && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "mb-6 bg-white rounded-2xl border border-gray-200 overflow-hidden", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "px-5 pt-5 pb-3", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("h2", { className: "text-lg font-bold text-gray-900", children: t('dashboard.onboarding.title') }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { className: "text-sm text-gray-500 mt-1", children: t('dashboard.onboarding.subtitle') }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "grid sm:grid-cols-2 gap-3 p-5 pt-2", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__3_5b2264656661756c74225d_directImport_asiSafe1__._, { href: "/specialist-setup", className: "group flex flex-col rounded-xl border-2 border-green-500 bg-green-50 p-4 hover:bg-green-100 transition", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "flex items-center gap-2 mb-1", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { className: "text-xl", children: "\uD83D\uDEE0" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { className: "font-semibold text-gray-800", children: t('dashboard.onboarding.helper.title') }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { className: "text-sm text-green-700/80 mb-3 flex-1", children: t('dashboard.onboarding.helper.desc') }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("span", { className: "inline-flex items-center gap-1 text-sm font-semibold text-green-700", children: [ t('dashboard.onboarding.helper.cta'), " →" ] }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__3_5b2264656661756c74225d_directImport_asiSafe1__._, { href: "/tasks/new", className: "group flex flex-col rounded-xl border border-gray-200 bg-gray-50 p-4 hover:bg-gray-100 transition", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "flex items-center gap-2 mb-1", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { className: "text-xl", children: "\uD83D\uDCDD" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { className: "font-semibold text-gray-800", children: t('dashboard.onboarding.requester.title') }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { className: "text-sm text-gray-500 mb-3 flex-1", children: t('dashboard.onboarding.requester.desc') }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("span", { className: "inline-flex items-center gap-1 text-sm font-semibold text-gray-700", children: [ t('dashboard.onboarding.requester.cta'), " →" ] }) ] }) ] }) ] }), dashboard && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(PlanBlock, { dashboard: dashboard, t: t }), fomoData && (isSpecialist ? (fomoData.missedCount > 0 || fomoData.missedEarnings > 0) && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "mb-6 bg-amber-50 border border-amber-200 rounded-xl px-5 py-4 flex items-start gap-3", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "shrink-0 mt-0.5", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("svg", { className: "w-5 h-5 text-amber-500", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 9v2m0 4h.01M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z" }) }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("p", { className: "text-base font-semibold text-amber-800", children: [ t('fomo.specialist_missed', 'You missed {n} tasks').replace('{n}', String((_fomoData_missedCount = fomoData.missedCount) !== null && _fomoData_missedCount !== void 0 ? _fomoData_missedCount : 0)), fomoData.missedEarnings > 0 && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("span", { className: "ml-1 text-amber-600", children: [ "for €", fomoData.missedEarnings ] }) ] }), ((_fomoData_topCategories = fomoData.topCategories) === null || _fomoData_topCategories === void 0 ? void 0 : _fomoData_topCategories.length) > 0 && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("p", { className: "text-sm text-amber-600 mt-0.5", children: [ t('fomo.top_categories', 'Categories'), ": ", fomoData.topCategories.slice(0, 3).join(', ') ] }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__3_5b2264656661756c74225d_directImport_asiSafe1__._, { href: "/pricing", className: "shrink-0 text-xs font-medium text-amber-700 bg-amber-100 px-3 py-1.5 rounded-lg hover:bg-amber-200 transition", children: t('dashboard.plan.upgrade') }) ] }) : fomoData.totalTasks > 0 && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "mb-6 bg-green-50 border border-green-200 rounded-xl px-5 py-4", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "flex items-center justify-between gap-4 flex-wrap", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "flex items-center gap-3", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "shrink-0 bg-green-100 rounded-xl p-2", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("svg", { className: "w-5 h-5 text-green-600", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("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" }) }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("p", { className: "text-base font-semibold text-gray-800", children: [ fomoData.totalOffers, " ", t('fomo.offers_received', 'offers received') ] }), fomoData.avgOffersPerTask > 0 && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { className: "text-sm text-gray-500", children: t('fomo.avg_offers', 'Average {n}/task').replace('{n}', Number(fomoData.avgOffersPerTask).toFixed(1)) }) ] }) ] }), fomoData.completionRate !== undefined && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "text-right", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("p", { className: "text-2xl font-bold text-green-700", children: [ Math.round(fomoData.completionRate * 100), "%" ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { className: "text-sm text-gray-400", children: t('fomo.completion_rate', 'completed') }) ] }) ] }) })), isSpecialist && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__3_5b2264656661756c74225d_directImport_asiSafe1__._, { href: "/tasks", className: "flex items-center justify-between gap-4 bg-green-600 text-white rounded-xl px-5 py-4 mb-8 hover:bg-green-700 transition", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "flex items-center gap-4", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "shrink-0 bg-white/20 rounded-xl p-2.5", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("svg", { className: "w-6 h-6 text-white", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("circle", { cx: "11", cy: "11", r: "7" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M21 21l-4.35-4.35" }) ] }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { className: "font-semibold text-base", children: t('find_tasks.title') }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { className: "text-green-100 text-sm mt-0.5", children: t('find_tasks.banner_hint') }) ] }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("svg", { className: "w-5 h-5 shrink-0 text-white/70", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 5l7 7-7 7" }) }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "grid md:grid-cols-2 gap-8", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "space-y-8", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("h2", { className: "text-lg font-semibold text-white mb-4", children: [ t('dashboard.my_tasks'), " ", /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("span", { className: "text-white/60 font-normal text-base", children: [ "(", activeTasks.length, ")" ] }) ] }), activeTasks.length === 0 ? /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "bg-white rounded-xl border border-gray-200 p-6 text-center text-gray-500", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { children: t('dashboard.tasks.empty') }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__3_5b2264656661756c74225d_directImport_asiSafe1__._, { href: "/tasks/new", className: "text-green-600 hover:underline text-sm mt-2 inline-block", children: t('dashboard.tasks.empty.cta') }) ] }) : /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "space-y-3", children: activeTasks.map((task)=>/*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(TaskCard, { task: task }, task.id)) }) ] }), completedTasks.length > 0 && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("h2", { className: "text-lg font-semibold text-white/70 mb-4", children: [ t('dashboard.completed_tasks'), " ", /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("span", { className: "font-normal text-base text-white/50", children: [ "(", completedTasks.length, ")" ] }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "space-y-3 opacity-75", children: completedTasks.map((task)=>/*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(TaskCard, { task: task }, task.id)) }) ] }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "space-y-8", children: isSpecialist ? /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._, { children: [ invitations.length > 0 && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("h2", { className: "text-lg font-semibold text-white mb-4", children: [ t('dashboard.invitations'), " ", /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("span", { className: "text-white/60 font-normal text-base", children: [ "(", invitations.length, ")" ] }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "space-y-3", children: invitations.map((inv)=>/*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__3_5b2264656661756c74225d_directImport_asiSafe1__._, { href: inv.referenceId ? "/tasks/".concat(inv.referenceId) : '/tasks', className: "flex items-start gap-3 p-4 rounded-xl border transition cursor-pointer ".concat(inv.isRead ? 'bg-white/90 border-white/20 hover:bg-white' : 'bg-white border-amber-300 shadow-sm hover:bg-amber-50'), children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { className: "text-2xl", children: "\uD83D\uDCCB" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { className: "font-medium truncate ".concat(inv.isRead ? 'text-gray-600' : 'text-gray-900'), children: t('notif.type.task_invite', inv.title) }), inv.body && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { className: "text-sm text-gray-500 mt-0.5 truncate", children: (()=>{ const title = extractNotifParam(inv.body); const tpl = t('notif.body.task_invite', ''); return title && tpl ? tpl.replace('{title}', title) : inv.body; })() }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { className: "text-xs text-gray-400 mt-1", children: new Date(inv.createdAt).toLocaleDateString(dateLocale) }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "flex flex-col items-end gap-1.5 shrink-0", children: [ !inv.isRead && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { className: "w-2 h-2 bg-amber-400 rounded-full mt-2" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { className: "text-xs text-gray-400", children: "→" }) ] }) ] }, inv.id)) }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("h2", { className: "text-lg font-semibold text-white mb-4", children: [ t('dashboard.my_offers'), " ", /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("span", { className: "text-white/60 font-normal text-base", children: [ "(", activeOffers.length, ")" ] }) ] }), activeOffers.length === 0 ? /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "bg-white rounded-xl border border-gray-200 p-6 text-center text-gray-500", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { children: t('dashboard.offers.empty') }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__3_5b2264656661756c74225d_directImport_asiSafe1__._, { href: "/tasks", className: "text-green-600 hover:underline text-sm mt-2 inline-block", children: t('dashboard.offers.empty.cta') }) ] }) : /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "space-y-3", children: activeOffers.map((row)=>/*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(OfferCard, { row: row }, (row.offer || row).id)) }) ] }), completedOffers.length > 0 && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("h2", { className: "text-lg font-semibold text-white/70 mb-4", children: [ t('dashboard.completed_offers'), " ", /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("span", { className: "font-normal text-base text-white/50", children: [ "(", completedOffers.length, ")" ] }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "space-y-3 opacity-75", children: completedOffers.map((row)=>/*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(OfferCard, { row: row }, (row.offer || row).id)) }) ] }) ] }) : /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._, { children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__3_5b2264656661756c74225d_directImport_asiSafe1__._, { href: "/specialists", className: "flex items-center justify-between gap-4 bg-green-600 text-white rounded-xl px-5 py-4 hover:bg-green-700 transition", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "flex items-center gap-4", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "shrink-0 bg-white/20 rounded-xl p-2.5", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("svg", { className: "w-6 h-6 text-white", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("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" }) }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { className: "font-semibold text-base", children: t('dashboard.customer.specialists_title') }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { className: "text-green-100 text-sm mt-0.5", children: t('dashboard.customer.specialists_hint') }) ] }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("svg", { className: "w-5 h-5 shrink-0 text-white/70", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 5l7 7-7 7" }) }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "bg-white rounded-xl border border-gray-200 p-5", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("h2", { className: "text-base font-semibold text-gray-800 mb-4", children: t('dashboard.customer.how_title') }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "space-y-3", children: [ { num: '1', text: t('dashboard.customer.step1'), icon: 'M12 4v16m8-8H4' }, { num: '2', text: t('dashboard.customer.step2'), icon: 'M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z' }, { num: '3', text: t('dashboard.customer.step3'), icon: 'M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z' } ].map((param)=>{ let { num, text, icon } = param; return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "flex items-start gap-3", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { className: "shrink-0 w-7 h-7 rounded-full bg-green-100 text-green-600 text-sm font-bold flex items-center justify-center", children: num }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { className: "text-sm text-gray-600 pt-1", children: text }) ] }, num); }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__3_5b2264656661756c74225d_directImport_asiSafe1__._, { href: "/tasks/new", className: "mt-4 inline-block text-sm font-medium text-green-600 hover:underline", children: [ tasks.length > 0 ? t('dashboard.tasks.add_new') : t('dashboard.tasks.empty.cta'), " →" ] }) ] }) ] }) }) ] }) ] }); } îñ òÉÞ/* __next_internal_client_entry_do_not_use__ default auto */ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime"; import { useEffect, useState } from 'react'; import { useRouter, useSearchParams } from 'next/navigation'; import Link from 'next/link'; import { useSession } from '@/lib/auth'; import { useLocale } from '@/context/locale'; import { getMyTasks, getMyOffers, getMyReviews, getNotifications, getMyDashboard, getSpecialistFomoDashboard, getCustomerFomoDashboard, getMySpecialistCards, applyMyReferral } from '@/lib/api'; import { formatPrice, taskTitle } from '@/lib/taskLocale'; import { PlanBadge } from '@/components/PlanBadge'; import { UsageMeter } from '@/components/UsageMeter'; /** Extract the quoted task title from a stored notification body (any locale) */ function extractNotifParam(body) { if (!body) return null; const m = body.match(/[«""](.+?)[»""]/); var _m_; return (_m_ = m === null || m === void 0 ? void 0 : m[1]) !== null && _m_ !== void 0 ? _m_ : null; } function PlanBlock(param) { let { dashboard, t } = param; const plan = dashboard.plan; const expiry = dashboard.planExpiration; const usage = dashboard.usage; const stats = dashboard.stats; const expiryPct = expiry ? Math.max(0, Math.min(100, Math.round(expiry.daysLeft / 30 * 100))) : 100; const expiryColor = expiry ? expiry.daysLeft <= 3 ? 'bg-red-500' : expiry.daysLeft <= 7 ? 'bg-amber-400' : 'bg-green-400' : 'bg-green-400'; return /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-2xl border border-gray-200 p-5 mb-6", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between mb-4", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2", children: [ /*#__PURE__*/ _jsx("h2", { className: "font-semibold text-gray-800 text-sm", children: t('dashboard.plan.title', 'My Plan') }), plan ? /*#__PURE__*/ _jsx(PlanBadge, { tier: plan.tier, size: "sm" }) : /*#__PURE__*/ _jsx("span", { className: "text-xs text-gray-400", children: t('dashboard.plan.no_plan', 'Free') }) ] }), /*#__PURE__*/ _jsx(Link, { href: "/pricing", className: "text-xs font-medium text-green-600 hover:underline", children: (plan === null || plan === void 0 ? void 0 : plan.tier) === 'ultimate' ? null : t('dashboard.plan.upgrade', 'Upgrade') }) ] }), expiry && /*#__PURE__*/ _jsxs("div", { className: "mb-4", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex justify-between text-xs text-gray-500 mb-1", children: [ /*#__PURE__*/ _jsx("span", { children: t('dashboard.plan.expires', 'Expires in {n} days').replace('{n}', String(expiry.daysLeft)) }), /*#__PURE__*/ _jsxs("span", { children: [ expiry.daysLeft, " ", t('pricing.days', 'days') ] }) ] }), /*#__PURE__*/ _jsx("div", { className: "h-1.5 rounded-full bg-gray-100", children: /*#__PURE__*/ _jsx("div", { className: "h-full rounded-full transition-all ".concat(expiryColor), style: { width: "".concat(expiryPct, "%") } }) }) ] }), (usage.messagesSent !== undefined || usage.ordersMade !== undefined) && /*#__PURE__*/ _jsxs("div", { className: "space-y-2 mb-4", children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs font-medium text-gray-500 uppercase tracking-wide", children: t('dashboard.plan.limits', 'Daily limits') }), /*#__PURE__*/ _jsx(UsageMeter, { current: usage.messagesSent, limit: usage.messagesLeft !== null ? usage.messagesSent + usage.messagesLeft : null, label: t('dashboard.plan.messages', 'Messages') }), /*#__PURE__*/ _jsx(UsageMeter, { current: usage.ordersMade, limit: usage.ordersLeft !== null ? usage.ordersMade + usage.ordersLeft : null, label: t('dashboard.plan.orders', 'Orders') }) ] }), Object.keys(stats).length > 0 && /*#__PURE__*/ _jsx("div", { className: "grid grid-cols-2 gap-2", children: Object.entries(stats).map((param)=>{ let [key, val] = param; return /*#__PURE__*/ _jsxs("div", { className: "bg-gray-50 rounded-xl px-3 py-2 text-center", children: [ /*#__PURE__*/ _jsx("p", { className: "text-lg font-bold text-gray-800", children: val }), /*#__PURE__*/ _jsx("p", { className: "text-[10px] text-gray-400 uppercase tracking-wide", children: t("dashboard.stats.".concat(key), key) }) ] }, key); }) }) ] }); } export default function DashboardPage() { var _session_user, _fomoData_topCategories; const { data: session, isPending } = useSession(); const router = useRouter(); const searchParams = useSearchParams(); const { t, locale } = useLocale(); const [tasks, setTasks] = useState([]); const [offers, setOffers] = useState([]); const [myReviews, setMyReviews] = useState([]); const [invitations, setInvitations] = useState([]); const [loading, setLoading] = useState(true); const [dashboard, setDashboard] = useState(null); const [fomoData, setFomoData] = useState(null); const [hasHelperCard, setHasHelperCard] = useState(null); useEffect(()=>{ if (!isPending && !session) router.push('/login'); }, [ session, isPending ]); // Apply pending referral code after Google OAuth redirect (?ref=CODE) useEffect(()=>{ if (!session) return; const refCode = searchParams.get('ref'); if (!refCode) return; applyMyReferral(refCode).catch(()=>{}); // Remove the ref param from the URL without reloading const params = new URLSearchParams(searchParams.toString()); params.delete('ref'); const newUrl = params.toString() ? "?".concat(params.toString()) : window.location.pathname; router.replace(newUrl); }, [ session ]); // Detect whether the user has completed their helper profile (has a card). // Used to show the getting-started onboarding card to users who haven't yet. useEffect(()=>{ if (!session) return; getMySpecialistCards().then((param)=>{ let { cards } = param; return setHasHelperCard(cards.length > 0); }).catch(()=>setHasHelperCard(null)); }, [ session ]); useEffect(()=>{ if (!session) return; Promise.all([ getMyTasks(), getMyOffers(), getMyReviews(), getNotifications(), getMyDashboard() ]).then((param)=>{ let [t, o, r, notifs, dash] = param; setTasks(t); setOffers(o); setMyReviews(r); setInvitations(notifs.filter((n)=>n.type === 'task_invite')); setDashboard(dash); }).catch(()=>{}).finally(()=>setLoading(false)); }, [ session ]); useEffect(()=>{ var _session_user; if (!session) return; const role = (_session_user = session.user) === null || _session_user === void 0 ? void 0 : _session_user.role; if (role === 'specialist') { getSpecialistFomoDashboard().then(setFomoData).catch(()=>{}); } else { getCustomerFomoDashboard().then(setFomoData).catch(()=>{}); } }, [ session ]); if (isPending || loading) return /*#__PURE__*/ _jsx("div", { className: "text-center py-20 text-white", children: t('common.loading') }); const dateLocale = locale === 'ru' ? 'ru-RU' : locale === 'uk' ? 'uk-UA' : locale === 'en' ? 'en-US' : 'el-GR'; const activeTasks = tasks.filter((task)=>task.status !== 'completed' && task.status !== 'cancelled'); const completedTasks = tasks.filter((task)=>task.status === 'completed' || task.status === 'cancelled'); const activeOffers = offers.filter((row)=>{ const offer = row.offer || row; const task = row.task; return offer.status !== 'other_accepted' && (task === null || task === void 0 ? void 0 : task.status) !== 'completed' && (task === null || task === void 0 ? void 0 : task.status) !== 'cancelled'; }); const completedOffers = offers.filter((row)=>{ const offer = row.offer || row; const task = row.task; return offer.status === 'other_accepted' || (task === null || task === void 0 ? void 0 : task.status) === 'completed' || (task === null || task === void 0 ? void 0 : task.status) === 'cancelled'; }); function TaskCard(param) { let { task } = param; var _task_offerCount; const offerCount = (_task_offerCount = task.offerCount) !== null && _task_offerCount !== void 0 ? _task_offerCount : 0; var _task_declinedCount; const declinedCount = (_task_declinedCount = task.declinedCount) !== null && _task_declinedCount !== void 0 ? _task_declinedCount : 0; const activeOfferCount = offerCount - declinedCount; return /*#__PURE__*/ _jsx(Link, { href: "/tasks/".concat(task.id), className: "block bg-white rounded-xl border border-gray-200 p-4 hover:shadow-sm hover:border-green-300 transition", children: /*#__PURE__*/ _jsxs("div", { className: "flex justify-between items-start", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ _jsx("p", { className: "font-medium text-gray-900 truncate", children: taskTitle(task, locale) }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-1", children: new Date(task.createdAt).toLocaleDateString(dateLocale) }), offerCount > 0 && /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 mt-1.5", children: [ /*#__PURE__*/ _jsxs("span", { className: "text-xs text-green-600 font-medium", children: [ "\uD83D\uDCBC ", offerCount, " ", t('dashboard.offers_count', 'offers') ] }), declinedCount > 0 && /*#__PURE__*/ _jsxs("span", { className: "text-xs text-red-400", children: [ "✕ ", declinedCount, " ", t('dashboard.declined_count', 'declined') ] }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "ml-3 text-right shrink-0", children: [ /*#__PURE__*/ _jsx("span", { className: "text-xs px-2 py-0.5 rounded-full ".concat(task.status === 'open' ? 'bg-green-100 text-green-700' : task.status === 'in_progress' ? 'bg-green-100 text-green-700' : task.status === 'completed' ? 'bg-gray-100 text-gray-600' : 'bg-red-100 text-red-600'), children: t("task.status.".concat(task.status), task.status) }), task.budget && /*#__PURE__*/ _jsxs("p", { className: "text-sm font-bold text-green-600 mt-1", children: [ formatPrice(task.budget), "€" ] }) ] }) ] }) }); } function OfferCard(param) { let { row } = param; var _myReviews_find; const offer = row.offer || row; const task = row.task; var _myReviews_find_review; const reviewReceived = (task === null || task === void 0 ? void 0 : task.status) === 'completed' && offer.status === 'accepted' ? (_myReviews_find_review = (_myReviews_find = myReviews.find((r)=>{ var _r_review; return ((_r_review = r.review) === null || _r_review === void 0 ? void 0 : _r_review.taskId) === (task === null || task === void 0 ? void 0 : task.id); })) === null || _myReviews_find === void 0 ? void 0 : _myReviews_find.review) !== null && _myReviews_find_review !== void 0 ? _myReviews_find_review : null : null; return /*#__PURE__*/ _jsxs(Link, { href: task ? "/tasks/".concat(task.id) : '#', className: "block bg-white rounded-xl border border-gray-200 p-4 hover:shadow-sm hover:border-green-300 transition", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex justify-between items-start", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ _jsx("p", { className: "font-medium text-gray-900 truncate", children: (task === null || task === void 0 ? void 0 : task.title) || t('chat.task_fallback') }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-1", children: new Date(offer.createdAt).toLocaleDateString(dateLocale) }) ] }), /*#__PURE__*/ _jsxs("div", { className: "ml-3 text-right shrink-0", children: [ /*#__PURE__*/ _jsxs("p", { className: "font-bold text-green-600", children: [ formatPrice(offer.price), "€" ] }), /*#__PURE__*/ _jsx("span", { className: "text-xs px-2 py-0.5 rounded-full mt-1 inline-block ".concat(offer.status === 'accepted' ? 'bg-green-100 text-green-700' : offer.status === 'declined' ? 'bg-red-100 text-red-700' : offer.status === 'other_accepted' ? 'bg-green-100 text-green-600' : 'bg-gray-100 text-gray-700'), children: t("offer.status.".concat(offer.status), offer.status) }) ] }) ] }), reviewReceived && /*#__PURE__*/ _jsxs("div", { className: "mt-3 pt-3 border-t border-gray-100 flex items-center gap-2", children: [ /*#__PURE__*/ _jsx("div", { className: "flex gap-0.5", children: [ 1, 2, 3, 4, 5 ].map((star)=>/*#__PURE__*/ _jsx("span", { className: "text-sm ".concat(star <= reviewReceived.rating ? 'text-yellow-400' : 'text-gray-200'), children: "★" }, star)) }), /*#__PURE__*/ _jsxs("span", { className: "text-sm font-semibold text-gray-700", children: [ reviewReceived.rating, "/5" ] }), reviewReceived.comment && /*#__PURE__*/ _jsx("span", { className: "text-xs text-gray-500 truncate", children: reviewReceived.comment }) ] }), (task === null || task === void 0 ? void 0 : task.status) === 'completed' && offer.status === 'accepted' && !reviewReceived && /*#__PURE__*/ _jsx("p", { className: "mt-2 text-xs text-gray-400", children: t('dashboard.review_pending') }) ] }); } const isSpecialist = (session === null || session === void 0 ? void 0 : (_session_user = session.user) === null || _session_user === void 0 ? void 0 : _session_user.role) === 'specialist'; var _fomoData_missedCount; return /*#__PURE__*/ _jsxs("div", { className: "max-w-5xl mx-auto px-4 py-8", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex justify-between items-center mb-8", children: [ /*#__PURE__*/ _jsx("h1", { className: "text-2xl font-bold text-white", children: t('dashboard.title') }), /*#__PURE__*/ _jsx(Link, { href: "/tasks/new", className: "bg-green-600 text-white px-4 py-2 rounded-lg text-sm font-medium hover:bg-green-700", children: t('dashboard.new_task') }) ] }), hasHelperCard === false && /*#__PURE__*/ _jsxs("div", { className: "mb-6 bg-white rounded-2xl border border-gray-200 overflow-hidden", children: [ /*#__PURE__*/ _jsxs("div", { className: "px-5 pt-5 pb-3", children: [ /*#__PURE__*/ _jsx("h2", { className: "text-lg font-bold text-gray-900", children: t('dashboard.onboarding.title') }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-500 mt-1", children: t('dashboard.onboarding.subtitle') }) ] }), /*#__PURE__*/ _jsxs("div", { className: "grid sm:grid-cols-2 gap-3 p-5 pt-2", children: [ /*#__PURE__*/ _jsxs(Link, { href: "/specialist-setup", className: "group flex flex-col rounded-xl border-2 border-green-500 bg-green-50 p-4 hover:bg-green-100 transition", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 mb-1", children: [ /*#__PURE__*/ _jsx("span", { className: "text-xl", children: "\uD83D\uDEE0" }), /*#__PURE__*/ _jsx("span", { className: "font-semibold text-gray-800", children: t('dashboard.onboarding.helper.title') }) ] }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-green-700/80 mb-3 flex-1", children: t('dashboard.onboarding.helper.desc') }), /*#__PURE__*/ _jsxs("span", { className: "inline-flex items-center gap-1 text-sm font-semibold text-green-700", children: [ t('dashboard.onboarding.helper.cta'), " →" ] }) ] }), /*#__PURE__*/ _jsxs(Link, { href: "/tasks/new", className: "group flex flex-col rounded-xl border border-gray-200 bg-gray-50 p-4 hover:bg-gray-100 transition", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 mb-1", children: [ /*#__PURE__*/ _jsx("span", { className: "text-xl", children: "\uD83D\uDCDD" }), /*#__PURE__*/ _jsx("span", { className: "font-semibold text-gray-800", children: t('dashboard.onboarding.requester.title') }) ] }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-500 mb-3 flex-1", children: t('dashboard.onboarding.requester.desc') }), /*#__PURE__*/ _jsxs("span", { className: "inline-flex items-center gap-1 text-sm font-semibold text-gray-700", children: [ t('dashboard.onboarding.requester.cta'), " →" ] }) ] }) ] }) ] }), dashboard && /*#__PURE__*/ _jsx(PlanBlock, { dashboard: dashboard, t: t }), fomoData && (isSpecialist ? (fomoData.missedCount > 0 || fomoData.missedEarnings > 0) && /*#__PURE__*/ _jsxs("div", { className: "mb-6 bg-amber-50 border border-amber-200 rounded-xl px-5 py-4 flex items-start gap-3", children: [ /*#__PURE__*/ _jsx("div", { className: "shrink-0 mt-0.5", children: /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5 text-amber-500", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 9v2m0 4h.01M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z" }) }) }), /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ _jsxs("p", { className: "text-base font-semibold text-amber-800", children: [ t('fomo.specialist_missed', 'You missed {n} tasks').replace('{n}', String((_fomoData_missedCount = fomoData.missedCount) !== null && _fomoData_missedCount !== void 0 ? _fomoData_missedCount : 0)), fomoData.missedEarnings > 0 && /*#__PURE__*/ _jsxs("span", { className: "ml-1 text-amber-600", children: [ "for €", fomoData.missedEarnings ] }) ] }), ((_fomoData_topCategories = fomoData.topCategories) === null || _fomoData_topCategories === void 0 ? void 0 : _fomoData_topCategories.length) > 0 && /*#__PURE__*/ _jsxs("p", { className: "text-sm text-amber-600 mt-0.5", children: [ t('fomo.top_categories', 'Categories'), ": ", fomoData.topCategories.slice(0, 3).join(', ') ] }) ] }), /*#__PURE__*/ _jsx(Link, { href: "/pricing", className: "shrink-0 text-xs font-medium text-amber-700 bg-amber-100 px-3 py-1.5 rounded-lg hover:bg-amber-200 transition", children: t('dashboard.plan.upgrade') }) ] }) : fomoData.totalTasks > 0 && /*#__PURE__*/ _jsx("div", { className: "mb-6 bg-green-50 border border-green-200 rounded-xl px-5 py-4", children: /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between gap-4 flex-wrap", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3", children: [ /*#__PURE__*/ _jsx("div", { className: "shrink-0 bg-green-100 rounded-xl p-2", children: /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5 text-green-600", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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" }) }) }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("p", { className: "text-base font-semibold text-gray-800", children: [ fomoData.totalOffers, " ", t('fomo.offers_received', 'offers received') ] }), fomoData.avgOffersPerTask > 0 && /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-500", children: t('fomo.avg_offers', 'Average {n}/task').replace('{n}', Number(fomoData.avgOffersPerTask).toFixed(1)) }) ] }) ] }), fomoData.completionRate !== undefined && /*#__PURE__*/ _jsxs("div", { className: "text-right", children: [ /*#__PURE__*/ _jsxs("p", { className: "text-2xl font-bold text-green-700", children: [ Math.round(fomoData.completionRate * 100), "%" ] }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-400", children: t('fomo.completion_rate', 'completed') }) ] }) ] }) })), isSpecialist && /*#__PURE__*/ _jsxs(Link, { href: "/tasks", className: "flex items-center justify-between gap-4 bg-green-600 text-white rounded-xl px-5 py-4 mb-8 hover:bg-green-700 transition", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-4", children: [ /*#__PURE__*/ _jsx("div", { className: "shrink-0 bg-white/20 rounded-xl p-2.5", children: /*#__PURE__*/ _jsxs("svg", { className: "w-6 h-6 text-white", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ _jsx("circle", { cx: "11", cy: "11", r: "7" }), /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M21 21l-4.35-4.35" }) ] }) }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "font-semibold text-base", children: t('find_tasks.title') }), /*#__PURE__*/ _jsx("p", { className: "text-green-100 text-sm mt-0.5", children: t('find_tasks.banner_hint') }) ] }) ] }), /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5 shrink-0 text-white/70", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 5l7 7-7 7" }) }) ] }), /*#__PURE__*/ _jsxs("div", { className: "grid md:grid-cols-2 gap-8", children: [ /*#__PURE__*/ _jsxs("div", { className: "space-y-8", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("h2", { className: "text-lg font-semibold text-white mb-4", children: [ t('dashboard.my_tasks'), " ", /*#__PURE__*/ _jsxs("span", { className: "text-white/60 font-normal text-base", children: [ "(", activeTasks.length, ")" ] }) ] }), activeTasks.length === 0 ? /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6 text-center text-gray-500", children: [ /*#__PURE__*/ _jsx("p", { children: t('dashboard.tasks.empty') }), /*#__PURE__*/ _jsx(Link, { href: "/tasks/new", className: "text-green-600 hover:underline text-sm mt-2 inline-block", children: t('dashboard.tasks.empty.cta') }) ] }) : /*#__PURE__*/ _jsx("div", { className: "space-y-3", children: activeTasks.map((task)=>/*#__PURE__*/ _jsx(TaskCard, { task: task }, task.id)) }) ] }), completedTasks.length > 0 && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("h2", { className: "text-lg font-semibold text-white/70 mb-4", children: [ t('dashboard.completed_tasks'), " ", /*#__PURE__*/ _jsxs("span", { className: "font-normal text-base text-white/50", children: [ "(", completedTasks.length, ")" ] }) ] }), /*#__PURE__*/ _jsx("div", { className: "space-y-3 opacity-75", children: completedTasks.map((task)=>/*#__PURE__*/ _jsx(TaskCard, { task: task }, task.id)) }) ] }) ] }), /*#__PURE__*/ _jsx("div", { className: "space-y-8", children: isSpecialist ? /*#__PURE__*/ _jsxs(_Fragment, { children: [ invitations.length > 0 && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("h2", { className: "text-lg font-semibold text-white mb-4", children: [ t('dashboard.invitations'), " ", /*#__PURE__*/ _jsxs("span", { className: "text-white/60 font-normal text-base", children: [ "(", invitations.length, ")" ] }) ] }), /*#__PURE__*/ _jsx("div", { className: "space-y-3", children: invitations.map((inv)=>/*#__PURE__*/ _jsxs(Link, { href: inv.referenceId ? "/tasks/".concat(inv.referenceId) : '/tasks', className: "flex items-start gap-3 p-4 rounded-xl border transition cursor-pointer ".concat(inv.isRead ? 'bg-white/90 border-white/20 hover:bg-white' : 'bg-white border-amber-300 shadow-sm hover:bg-amber-50'), children: [ /*#__PURE__*/ _jsx("span", { className: "text-2xl", children: "\uD83D\uDCCB" }), /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ _jsx("p", { className: "font-medium truncate ".concat(inv.isRead ? 'text-gray-600' : 'text-gray-900'), children: t('notif.type.task_invite', inv.title) }), inv.body && /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-500 mt-0.5 truncate", children: (()=>{ const title = extractNotifParam(inv.body); const tpl = t('notif.body.task_invite', ''); return title && tpl ? tpl.replace('{title}', title) : inv.body; })() }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-1", children: new Date(inv.createdAt).toLocaleDateString(dateLocale) }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex flex-col items-end gap-1.5 shrink-0", children: [ !inv.isRead && /*#__PURE__*/ _jsx("span", { className: "w-2 h-2 bg-amber-400 rounded-full mt-2" }), /*#__PURE__*/ _jsx("span", { className: "text-xs text-gray-400", children: "→" }) ] }) ] }, inv.id)) }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("h2", { className: "text-lg font-semibold text-white mb-4", children: [ t('dashboard.my_offers'), " ", /*#__PURE__*/ _jsxs("span", { className: "text-white/60 font-normal text-base", children: [ "(", activeOffers.length, ")" ] }) ] }), activeOffers.length === 0 ? /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6 text-center text-gray-500", children: [ /*#__PURE__*/ _jsx("p", { children: t('dashboard.offers.empty') }), /*#__PURE__*/ _jsx(Link, { href: "/tasks", className: "text-green-600 hover:underline text-sm mt-2 inline-block", children: t('dashboard.offers.empty.cta') }) ] }) : /*#__PURE__*/ _jsx("div", { className: "space-y-3", children: activeOffers.map((row)=>/*#__PURE__*/ _jsx(OfferCard, { row: row }, (row.offer || row).id)) }) ] }), completedOffers.length > 0 && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("h2", { className: "text-lg font-semibold text-white/70 mb-4", children: [ t('dashboard.completed_offers'), " ", /*#__PURE__*/ _jsxs("span", { className: "font-normal text-base text-white/50", children: [ "(", completedOffers.length, ")" ] }) ] }), /*#__PURE__*/ _jsx("div", { className: "space-y-3 opacity-75", children: completedOffers.map((row)=>/*#__PURE__*/ _jsx(OfferCard, { row: row }, (row.offer || row).id)) }) ] }) ] }) : /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs(Link, { href: "/specialists", className: "flex items-center justify-between gap-4 bg-green-600 text-white rounded-xl px-5 py-4 hover:bg-green-700 transition", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-4", children: [ /*#__PURE__*/ _jsx("div", { className: "shrink-0 bg-white/20 rounded-xl p-2.5", children: /*#__PURE__*/ _jsx("svg", { className: "w-6 h-6 text-white", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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" }) }) }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "font-semibold text-base", children: t('dashboard.customer.specialists_title') }), /*#__PURE__*/ _jsx("p", { className: "text-green-100 text-sm mt-0.5", children: t('dashboard.customer.specialists_hint') }) ] }) ] }), /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5 shrink-0 text-white/70", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 5l7 7-7 7" }) }) ] }), /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-5", children: [ /*#__PURE__*/ _jsx("h2", { className: "text-base font-semibold text-gray-800 mb-4", children: t('dashboard.customer.how_title') }), /*#__PURE__*/ _jsx("div", { className: "space-y-3", children: [ { num: '1', text: t('dashboard.customer.step1'), icon: 'M12 4v16m8-8H4' }, { num: '2', text: t('dashboard.customer.step2'), icon: 'M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z' }, { num: '3', text: t('dashboard.customer.step3'), icon: 'M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z' } ].map((param)=>{ let { num, text, icon } = param; return /*#__PURE__*/ _jsxs("div", { className: "flex items-start gap-3", children: [ /*#__PURE__*/ _jsx("span", { className: "shrink-0 w-7 h-7 rounded-full bg-green-100 text-green-600 text-sm font-bold flex items-center justify-center", children: num }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-600 pt-1", children: text }) ] }, num); }) }), /*#__PURE__*/ _jsxs(Link, { href: "/tasks/new", className: "mt-4 inline-block text-sm font-medium text-green-600 hover:underline", children: [ tasks.length > 0 ? t('dashboard.tasks.add_new') : t('dashboard.tasks.empty.cta'), " →" ] }) ] }) ] }) }) ] }) ] }); } ÊO61146undefined148191undefined193253undefined255283undefined285324undefined326370undefined372564undefined566623undefined625675undefined677729undefined15231527__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined16591663__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined18051809__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined19601963__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined22152218__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined22202228__WEBPACK_MODULE_REFERENCE__8_5b22506c616e4261646765225d_directImport_asiSafe1__._undefined23722375__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined26482651__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined26532656__WEBPACK_MODULE_REFERENCE__3_5b2264656661756c74225d_directImport_asiSafe1__._undefined30383042__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined31503154__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined33293332__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined35513555__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined39163919__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined40474050__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined44734477__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined45954598__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined48384841__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined48434852__WEBPACK_MODULE_REFERENCE__9_5b2255736167654d65746572225d_directImport_asiSafe1__._undefined51495152__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined51545163__WEBPACK_MODULE_REFERENCE__9_5b2255736167654d65746572225d_directImport_asiSafe1__._undefined55065509__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined57215725__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined58965899__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined61066109__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined64356449undefined65666575__WEBPACK_MODULE_REFERENCE__4_5b2275736553657373696f6e225d_call_directImport_asiSafe1__._undefined65996607__WEBPACK_MODULE_REFERENCE__2_5b22757365526f75746572225d_call_directImport_asiSafe1__._undefined66376651__WEBPACK_MODULE_REFERENCE__2_5b22757365536561726368506172616d73225d_call_directImport_asiSafe1__._undefined66826690__WEBPACK_MODULE_REFERENCE__5_5b227573654c6f63616c65225d_call_directImport_asiSafe1__._undefined67256732__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined67716778__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined68236830__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined68796886__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined69276934__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined69816988__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined70337040__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined70957102__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined71157123__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined73217329__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined74547468__WEBPACK_MODULE_REFERENCE__6_5b226170706c794d79526566657272616c225d_call_directImport_asiSafe1__._undefined79887996__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined80428061__WEBPACK_MODULE_REFERENCE__6_5b226765744d795370656369616c6973744361726473225d_call_directImport_asiSafe1__._undefined82548262__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined83348343__WEBPACK_MODULE_REFERENCE__6_5b226765744d795461736b73225d_call_directImport_asiSafe1__._undefined83608370__WEBPACK_MODULE_REFERENCE__6_5b226765744d794f6666657273225d_call_directImport_asiSafe1__._undefined83878398__WEBPACK_MODULE_REFERENCE__6_5b226765744d7952657669657773225d_call_directImport_asiSafe1__._undefined84158430__WEBPACK_MODULE_REFERENCE__6_5b226765744e6f74696669636174696f6e73225d_call_directImport_asiSafe1__._undefined84478460__WEBPACK_MODULE_REFERENCE__6_5b226765744d7944617368626f617264225d_call_directImport_asiSafe1__._undefined88208828__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined90629087__WEBPACK_MODULE_REFERENCE__6_5b226765745370656369616c697374466f6d6f44617368626f617264225d_call_directImport_asiSafe1__._undefined91539176__WEBPACK_MODULE_REFERENCE__6_5b22676574437573746f6d6572466f6d6f44617368626f617264225d_call_directImport_asiSafe1__._undefined93079310__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1089910902__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1090410907__WEBPACK_MODULE_REFERENCE__3_5b2264656661756c74225d_directImport_asiSafe1__._undefined1112211126__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1126211266__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1140811411__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1154311551__WEBPACK_MODULE_REFERENCE__7_5b227461736b5469746c65225d_call_directImport_asiSafe1__._undefined1164111644__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1191611920__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1210212106__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1266012664__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1327713281__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1343313436__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1392513929__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1410214112__WEBPACK_MODULE_REFERENCE__7_5b22666f726d61745072696365225d_call_directImport_asiSafe1__._undefined1512715131__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1513315136__WEBPACK_MODULE_REFERENCE__3_5b2264656661756c74225d_directImport_asiSafe1__._undefined1538215386__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1553415538__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1569215695__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1600116004__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1632416328__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1649216496__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1666816678__WEBPACK_MODULE_REFERENCE__7_5b22666f726d61745072696365225d_call_directImport_asiSafe1__._undefined1685816861__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1748117485__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1765917662__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1799818001__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1830618310__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1865418657__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1902919032__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1946219466__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1957319577__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1971919722__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1991319916__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1991819921__WEBPACK_MODULE_REFERENCE__3_5b2264656661756c74225d_directImport_asiSafe1__._undefined2026020264__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2043220436__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2057820581__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2081720820__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2109421098__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2126021264__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2126621269__WEBPACK_MODULE_REFERENCE__3_5b2264656661756c74225d_directImport_asiSafe1__._undefined2157621580__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2178421787__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2204922052__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2243022433__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2271222716__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2322223226__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2322823231__WEBPACK_MODULE_REFERENCE__3_5b2264656661756c74225d_directImport_asiSafe1__._undefined2352623530__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2373423737__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2399824001__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2438224385__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2466324667__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2525425257__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2546225466__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2565425657__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2577025773__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2608926092__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2646926473__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2661526619__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2707127075__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2767227676__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2815428157__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2815928162__WEBPACK_MODULE_REFERENCE__3_5b2264656661756c74225d_directImport_asiSafe1__._undefined2851828521__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2866428668__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2883328837__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2900029003__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2916129164__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2955229555__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3011430118__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3023130235__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3078930792__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3129031294__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3144431448__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3183631839__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3219732201__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3220332206__WEBPACK_MODULE_REFERENCE__3_5b2264656661756c74225d_directImport_asiSafe1__._undefined3245532459__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3261032613__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3276432768__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3317033173__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3344433447__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3385333857__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3396233965__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3421434217__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3457634579__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3487934882__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3515535159__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3528835292__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3542935433__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3553835542__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3587235876__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3648736491__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3673936742__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3694236945__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3694736950__WEBPACK_MODULE_REFERENCE__3_5b2264656661756c74225d_directImport_asiSafe1__._undefined3737537378__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3754137544__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3785037854__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3795937963__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3830338307__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3889438897__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3907439077__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3939539398__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3952039524__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3952639534__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined3965139655__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3976839772__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4012540129__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4075340756__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4092640930__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4093240935__WEBPACK_MODULE_REFERENCE__3_5b2264656661756c74225d_directImport_asiSafe1__._undefined4145841461__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4177141775__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4202542028__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4247142474__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4327543278__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4378843792__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4408344086__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4436444367__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4503045034__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4514745151__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4550245506__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4615946163__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4642346426__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4663946642__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4664446647__WEBPACK_MODULE_REFERENCE__3_5b2264656661756c74225d_directImport_asiSafe1__._undefined4709347096__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4726747270__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4761447618__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4773147735__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4809648100__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4872848731__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4891648919__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4925949263__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4926549273__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined4936449368__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4937049373__WEBPACK_MODULE_REFERENCE__3_5b2264656661756c74225d_directImport_asiSafe1__._undefined4970349707__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4991849921__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5011250115__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5059550598__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5127451278__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5142351426__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5177551778__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5231052313__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5273352736__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5316953173__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5338353386__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5368353686__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5512955133__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5536755370__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5576955772__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5627256276__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5627856281__WEBPACK_MODULE_REFERENCE__3_5b2264656661756c74225d_directImport_asiSafe1__._undefined_Ñ_«/{ Uì62|~Ï_©º   S Ñ  ‰ Õ „ Î ©õ^š(r_eÛ%_aŽÝ')|Óñ=è2K]uËéKjÀã7 ^ ² ß _3!d!ž!á!5"d"ž"å"9#p#Ä#Ñ#'$í$C%À%"&*(€(®()Û)1*y*Ñ*â*<+M+©+º+,/,_,÷-M.7/¯/ñ/e0è021g7±7³78×8#9«9÷9…:Ï:S;©;<M<]=©=_>«>Õ@!A†CÒCjD_ŽDFéF–GðGçK3L5L‚LxMÄMXN€N>OˆOºPQDRR4S€S,T†T:U„UðW (/* binding */ DashboardPage) }); // EXTERNAL MODULE: ../../node_modules/next/dist/compiled/react/jsx-runtime.js var jsx_runtime = __webpack_require__(4568); // EXTERNAL MODULE: ../../node_modules/next/dist/compiled/react/index.js var react = __webpack_require__(7620); // EXTERNAL MODULE: ../../node_modules/next/dist/api/navigation.js var navigation = __webpack_require__(7541); // EXTERNAL MODULE: ../../node_modules/next/dist/client/app-dir/link.js var app_dir_link = __webpack_require__(9664); var link_default = /*#__PURE__*/__webpack_require__.n(app_dir_link); // EXTERNAL MODULE: ./src/lib/auth.ts var auth = __webpack_require__(1592); // EXTERNAL MODULE: ./src/context/locale.tsx var context_locale = __webpack_require__(9906); // EXTERNAL MODULE: ./src/lib/api.ts var api = __webpack_require__(2982); // EXTERNAL MODULE: ./src/lib/taskLocale.ts var taskLocale = __webpack_require__(4017); // EXTERNAL MODULE: ./src/components/PlanBadge.tsx var PlanBadge = __webpack_require__(2035); ;// ./src/components/UsageMeter.tsx function UsageMeter(param) { let { current, limit, label, className = '' } = param; if (limit === null) { return /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "".concat(className), children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex justify-between items-center mb-1", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "text-xs text-gray-500", children: label }), /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "text-xs font-semibold text-green-600", children: "∞" }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "h-1.5 rounded-full bg-green-100", children: /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "h-full w-full rounded-full bg-green-400" }) }) ] }); } const pct = limit > 0 ? Math.min(100, Math.round(current / limit * 100)) : 100; const remaining = Math.max(0, limit - current); const barColor = pct >= 100 ? 'bg-red-500' : pct >= 80 ? 'bg-amber-400' : 'bg-green-500'; const textColor = pct >= 100 ? 'text-red-600' : pct >= 80 ? 'text-amber-600' : 'text-gray-600'; return /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: className, children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex justify-between items-center mb-1", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "text-xs text-gray-500", children: label }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("span", { className: "text-xs font-semibold ".concat(textColor), children: [ remaining, " / ", limit ] }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "h-1.5 rounded-full bg-gray-100", children: /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "h-full rounded-full transition-all ".concat(barColor), style: { width: "".concat(pct, "%") } }) }) ] }); } ;// ./src/app/dashboard/page.tsx /* __next_internal_client_entry_do_not_use__ default auto */ /** Extract the quoted task title from a stored notification body (any locale) */ function extractNotifParam(body) { if (!body) return null; const m = body.match(/[«""](.+?)[»""]/); var _m_; return (_m_ = m === null || m === void 0 ? void 0 : m[1]) !== null && _m_ !== void 0 ? _m_ : null; } function PlanBlock(param) { let { dashboard, t } = param; const plan = dashboard.plan; const expiry = dashboard.planExpiration; const usage = dashboard.usage; const stats = dashboard.stats; const expiryPct = expiry ? Math.max(0, Math.min(100, Math.round(expiry.daysLeft / 30 * 100))) : 100; const expiryColor = expiry ? expiry.daysLeft <= 3 ? 'bg-red-500' : expiry.daysLeft <= 7 ? 'bg-amber-400' : 'bg-green-400' : 'bg-green-400'; return /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "bg-white rounded-2xl border border-gray-200 p-5 mb-6", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex items-center justify-between mb-4", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex items-center gap-2", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("h2", { className: "font-semibold text-gray-800 text-sm", children: t('dashboard.plan.title', 'My Plan') }), plan ? /*#__PURE__*/ (0,jsx_runtime.jsx)(PlanBadge/* PlanBadge */.d, { tier: plan.tier, size: "sm" }) : /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "text-xs text-gray-400", children: t('dashboard.plan.no_plan', 'Free') }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)((link_default()), { href: "/pricing", className: "text-xs font-medium text-green-600 hover:underline", children: (plan === null || plan === void 0 ? void 0 : plan.tier) === 'ultimate' ? null : t('dashboard.plan.upgrade', 'Upgrade') }) ] }), expiry && /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "mb-4", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex justify-between text-xs text-gray-500 mb-1", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { children: t('dashboard.plan.expires', 'Expires in {n} days').replace('{n}', String(expiry.daysLeft)) }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("span", { children: [ expiry.daysLeft, " ", t('pricing.days', 'days') ] }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "h-1.5 rounded-full bg-gray-100", children: /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "h-full rounded-full transition-all ".concat(expiryColor), style: { width: "".concat(expiryPct, "%") } }) }) ] }), (usage.messagesSent !== undefined || usage.ordersMade !== undefined) && /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "space-y-2 mb-4", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "text-xs font-medium text-gray-500 uppercase tracking-wide", children: t('dashboard.plan.limits', 'Daily limits') }), /*#__PURE__*/ (0,jsx_runtime.jsx)(UsageMeter, { current: usage.messagesSent, limit: usage.messagesLeft !== null ? usage.messagesSent + usage.messagesLeft : null, label: t('dashboard.plan.messages', 'Messages') }), /*#__PURE__*/ (0,jsx_runtime.jsx)(UsageMeter, { current: usage.ordersMade, limit: usage.ordersLeft !== null ? usage.ordersMade + usage.ordersLeft : null, label: t('dashboard.plan.orders', 'Orders') }) ] }), Object.keys(stats).length > 0 && /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "grid grid-cols-2 gap-2", children: Object.entries(stats).map((param)=>{ let [key, val] = param; return /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "bg-gray-50 rounded-xl px-3 py-2 text-center", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "text-lg font-bold text-gray-800", children: val }), /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "text-[10px] text-gray-400 uppercase tracking-wide", children: t("dashboard.stats.".concat(key), key) }) ] }, key); }) }) ] }); } function DashboardPage() { var _session_user, _fomoData_topCategories; const { data: session, isPending } = (0,auth/* useSession */.wV)(); const router = (0,navigation.useRouter)(); const searchParams = (0,navigation.useSearchParams)(); const { t, locale } = (0,context_locale/* useLocale */.Y)(); const [tasks, setTasks] = (0,react.useState)([]); const [offers, setOffers] = (0,react.useState)([]); const [myReviews, setMyReviews] = (0,react.useState)([]); const [invitations, setInvitations] = (0,react.useState)([]); const [loading, setLoading] = (0,react.useState)(true); const [dashboard, setDashboard] = (0,react.useState)(null); const [fomoData, setFomoData] = (0,react.useState)(null); const [hasHelperCard, setHasHelperCard] = (0,react.useState)(null); (0,react.useEffect)(()=>{ if (!isPending && !session) router.push('/login'); }, [ session, isPending ]); // Apply pending referral code after Google OAuth redirect (?ref=CODE) (0,react.useEffect)(()=>{ if (!session) return; const refCode = searchParams.get('ref'); if (!refCode) return; (0,api/* applyMyReferral */.C0)(refCode).catch(()=>{}); // Remove the ref param from the URL without reloading const params = new URLSearchParams(searchParams.toString()); params.delete('ref'); const newUrl = params.toString() ? "?".concat(params.toString()) : window.location.pathname; router.replace(newUrl); }, [ session ]); // Detect whether the user has completed their helper profile (has a card). // Used to show the getting-started onboarding card to users who haven't yet. (0,react.useEffect)(()=>{ if (!session) return; (0,api/* getMySpecialistCards */.Bb)().then((param)=>{ let { cards } = param; return setHasHelperCard(cards.length > 0); }).catch(()=>setHasHelperCard(null)); }, [ session ]); (0,react.useEffect)(()=>{ if (!session) return; Promise.all([ (0,api/* getMyTasks */.Fu)(), (0,api/* getMyOffers */.aT)(), (0,api/* getMyReviews */.q7)(), (0,api/* getNotifications */.Tr)(), (0,api/* getMyDashboard */.H)() ]).then((param)=>{ let [t, o, r, notifs, dash] = param; setTasks(t); setOffers(o); setMyReviews(r); setInvitations(notifs.filter((n)=>n.type === 'task_invite')); setDashboard(dash); }).catch(()=>{}).finally(()=>setLoading(false)); }, [ session ]); (0,react.useEffect)(()=>{ var _session_user; if (!session) return; const role = (_session_user = session.user) === null || _session_user === void 0 ? void 0 : _session_user.role; if (role === 'specialist') { (0,api/* getSpecialistFomoDashboard */.zk)().then(setFomoData).catch(()=>{}); } else { (0,api/* getCustomerFomoDashboard */.ML)().then(setFomoData).catch(()=>{}); } }, [ session ]); if (isPending || loading) return /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "text-center py-20 text-white", children: t('common.loading') }); const dateLocale = locale === 'ru' ? 'ru-RU' : locale === 'uk' ? 'uk-UA' : locale === 'en' ? 'en-US' : 'el-GR'; const activeTasks = tasks.filter((task)=>task.status !== 'completed' && task.status !== 'cancelled'); const completedTasks = tasks.filter((task)=>task.status === 'completed' || task.status === 'cancelled'); const activeOffers = offers.filter((row)=>{ const offer = row.offer || row; const task = row.task; return offer.status !== 'other_accepted' && (task === null || task === void 0 ? void 0 : task.status) !== 'completed' && (task === null || task === void 0 ? void 0 : task.status) !== 'cancelled'; }); const completedOffers = offers.filter((row)=>{ const offer = row.offer || row; const task = row.task; return offer.status === 'other_accepted' || (task === null || task === void 0 ? void 0 : task.status) === 'completed' || (task === null || task === void 0 ? void 0 : task.status) === 'cancelled'; }); function TaskCard(param) { let { task } = param; var _task_offerCount; const offerCount = (_task_offerCount = task.offerCount) !== null && _task_offerCount !== void 0 ? _task_offerCount : 0; var _task_declinedCount; const declinedCount = (_task_declinedCount = task.declinedCount) !== null && _task_declinedCount !== void 0 ? _task_declinedCount : 0; const activeOfferCount = offerCount - declinedCount; return /*#__PURE__*/ (0,jsx_runtime.jsx)((link_default()), { href: "/tasks/".concat(task.id), className: "block bg-white rounded-xl border border-gray-200 p-4 hover:shadow-sm hover:border-green-300 transition", children: /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex justify-between items-start", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "font-medium text-gray-900 truncate", children: (0,taskLocale/* taskTitle */.Oj)(task, locale) }), /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "text-xs text-gray-400 mt-1", children: new Date(task.createdAt).toLocaleDateString(dateLocale) }), offerCount > 0 && /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex items-center gap-2 mt-1.5", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("span", { className: "text-xs text-green-600 font-medium", children: [ "\uD83D\uDCBC ", offerCount, " ", t('dashboard.offers_count', 'offers') ] }), declinedCount > 0 && /*#__PURE__*/ (0,jsx_runtime.jsxs)("span", { className: "text-xs text-red-400", children: [ "✕ ", declinedCount, " ", t('dashboard.declined_count', 'declined') ] }) ] }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "ml-3 text-right shrink-0", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "text-xs px-2 py-0.5 rounded-full ".concat(task.status === 'open' ? 'bg-green-100 text-green-700' : task.status === 'in_progress' ? 'bg-green-100 text-green-700' : task.status === 'completed' ? 'bg-gray-100 text-gray-600' : 'bg-red-100 text-red-600'), children: t("task.status.".concat(task.status), task.status) }), task.budget && /*#__PURE__*/ (0,jsx_runtime.jsxs)("p", { className: "text-sm font-bold text-green-600 mt-1", children: [ (0,taskLocale/* formatPrice */.$g)(task.budget), "€" ] }) ] }) ] }) }); } function OfferCard(param) { let { row } = param; var _myReviews_find; const offer = row.offer || row; const task = row.task; var _myReviews_find_review; const reviewReceived = (task === null || task === void 0 ? void 0 : task.status) === 'completed' && offer.status === 'accepted' ? (_myReviews_find_review = (_myReviews_find = myReviews.find((r)=>{ var _r_review; return ((_r_review = r.review) === null || _r_review === void 0 ? void 0 : _r_review.taskId) === (task === null || task === void 0 ? void 0 : task.id); })) === null || _myReviews_find === void 0 ? void 0 : _myReviews_find.review) !== null && _myReviews_find_review !== void 0 ? _myReviews_find_review : null : null; return /*#__PURE__*/ (0,jsx_runtime.jsxs)((link_default()), { href: task ? "/tasks/".concat(task.id) : '#', className: "block bg-white rounded-xl border border-gray-200 p-4 hover:shadow-sm hover:border-green-300 transition", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex justify-between items-start", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "font-medium text-gray-900 truncate", children: (task === null || task === void 0 ? void 0 : task.title) || t('chat.task_fallback') }), /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "text-xs text-gray-400 mt-1", children: new Date(offer.createdAt).toLocaleDateString(dateLocale) }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "ml-3 text-right shrink-0", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("p", { className: "font-bold text-green-600", children: [ (0,taskLocale/* formatPrice */.$g)(offer.price), "€" ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "text-xs px-2 py-0.5 rounded-full mt-1 inline-block ".concat(offer.status === 'accepted' ? 'bg-green-100 text-green-700' : offer.status === 'declined' ? 'bg-red-100 text-red-700' : offer.status === 'other_accepted' ? 'bg-green-100 text-green-600' : 'bg-gray-100 text-gray-700'), children: t("offer.status.".concat(offer.status), offer.status) }) ] }) ] }), reviewReceived && /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "mt-3 pt-3 border-t border-gray-100 flex items-center gap-2", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "flex gap-0.5", children: [ 1, 2, 3, 4, 5 ].map((star)=>/*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "text-sm ".concat(star <= reviewReceived.rating ? 'text-yellow-400' : 'text-gray-200'), children: "★" }, star)) }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("span", { className: "text-sm font-semibold text-gray-700", children: [ reviewReceived.rating, "/5" ] }), reviewReceived.comment && /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "text-xs text-gray-500 truncate", children: reviewReceived.comment }) ] }), (task === null || task === void 0 ? void 0 : task.status) === 'completed' && offer.status === 'accepted' && !reviewReceived && /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "mt-2 text-xs text-gray-400", children: t('dashboard.review_pending') }) ] }); } const isSpecialist = (session === null || session === void 0 ? void 0 : (_session_user = session.user) === null || _session_user === void 0 ? void 0 : _session_user.role) === 'specialist'; var _fomoData_missedCount; return /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "max-w-5xl mx-auto px-4 py-8", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex justify-between items-center mb-8", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("h1", { className: "text-2xl font-bold text-white", children: t('dashboard.title') }), /*#__PURE__*/ (0,jsx_runtime.jsx)((link_default()), { href: "/tasks/new", className: "bg-green-600 text-white px-4 py-2 rounded-lg text-sm font-medium hover:bg-green-700", children: t('dashboard.new_task') }) ] }), hasHelperCard === false && /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "mb-6 bg-white rounded-2xl border border-gray-200 overflow-hidden", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "px-5 pt-5 pb-3", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("h2", { className: "text-lg font-bold text-gray-900", children: t('dashboard.onboarding.title') }), /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "text-sm text-gray-500 mt-1", children: t('dashboard.onboarding.subtitle') }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "grid sm:grid-cols-2 gap-3 p-5 pt-2", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)((link_default()), { href: "/specialist-setup", className: "group flex flex-col rounded-xl border-2 border-green-500 bg-green-50 p-4 hover:bg-green-100 transition", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex items-center gap-2 mb-1", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "text-xl", children: "\uD83D\uDEE0" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "font-semibold text-gray-800", children: t('dashboard.onboarding.helper.title') }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "text-sm text-green-700/80 mb-3 flex-1", children: t('dashboard.onboarding.helper.desc') }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("span", { className: "inline-flex items-center gap-1 text-sm font-semibold text-green-700", children: [ t('dashboard.onboarding.helper.cta'), " →" ] }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)((link_default()), { href: "/tasks/new", className: "group flex flex-col rounded-xl border border-gray-200 bg-gray-50 p-4 hover:bg-gray-100 transition", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex items-center gap-2 mb-1", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "text-xl", children: "\uD83D\uDCDD" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "font-semibold text-gray-800", children: t('dashboard.onboarding.requester.title') }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "text-sm text-gray-500 mb-3 flex-1", children: t('dashboard.onboarding.requester.desc') }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("span", { className: "inline-flex items-center gap-1 text-sm font-semibold text-gray-700", children: [ t('dashboard.onboarding.requester.cta'), " →" ] }) ] }) ] }) ] }), dashboard && /*#__PURE__*/ (0,jsx_runtime.jsx)(PlanBlock, { dashboard: dashboard, t: t }), fomoData && (isSpecialist ? (fomoData.missedCount > 0 || fomoData.missedEarnings > 0) && /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "mb-6 bg-amber-50 border border-amber-200 rounded-xl px-5 py-4 flex items-start gap-3", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "shrink-0 mt-0.5", children: /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { className: "w-5 h-5 text-amber-500", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 9v2m0 4h.01M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z" }) }) }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("p", { className: "text-base font-semibold text-amber-800", children: [ t('fomo.specialist_missed', 'You missed {n} tasks').replace('{n}', String((_fomoData_missedCount = fomoData.missedCount) !== null && _fomoData_missedCount !== void 0 ? _fomoData_missedCount : 0)), fomoData.missedEarnings > 0 && /*#__PURE__*/ (0,jsx_runtime.jsxs)("span", { className: "ml-1 text-amber-600", children: [ "for €", fomoData.missedEarnings ] }) ] }), ((_fomoData_topCategories = fomoData.topCategories) === null || _fomoData_topCategories === void 0 ? void 0 : _fomoData_topCategories.length) > 0 && /*#__PURE__*/ (0,jsx_runtime.jsxs)("p", { className: "text-sm text-amber-600 mt-0.5", children: [ t('fomo.top_categories', 'Categories'), ": ", fomoData.topCategories.slice(0, 3).join(', ') ] }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)((link_default()), { href: "/pricing", className: "shrink-0 text-xs font-medium text-amber-700 bg-amber-100 px-3 py-1.5 rounded-lg hover:bg-amber-200 transition", children: t('dashboard.plan.upgrade') }) ] }) : fomoData.totalTasks > 0 && /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "mb-6 bg-green-50 border border-green-200 rounded-xl px-5 py-4", children: /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex items-center justify-between gap-4 flex-wrap", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex items-center gap-3", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "shrink-0 bg-green-100 rounded-xl p-2", children: /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { className: "w-5 h-5 text-green-600", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,jsx_runtime.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" }) }) }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("p", { className: "text-base font-semibold text-gray-800", children: [ fomoData.totalOffers, " ", t('fomo.offers_received', 'offers received') ] }), fomoData.avgOffersPerTask > 0 && /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "text-sm text-gray-500", children: t('fomo.avg_offers', 'Average {n}/task').replace('{n}', Number(fomoData.avgOffersPerTask).toFixed(1)) }) ] }) ] }), fomoData.completionRate !== undefined && /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "text-right", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("p", { className: "text-2xl font-bold text-green-700", children: [ Math.round(fomoData.completionRate * 100), "%" ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "text-sm text-gray-400", children: t('fomo.completion_rate', 'completed') }) ] }) ] }) })), isSpecialist && /*#__PURE__*/ (0,jsx_runtime.jsxs)((link_default()), { href: "/tasks", className: "flex items-center justify-between gap-4 bg-green-600 text-white rounded-xl px-5 py-4 mb-8 hover:bg-green-700 transition", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex items-center gap-4", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "shrink-0 bg-white/20 rounded-xl p-2.5", children: /*#__PURE__*/ (0,jsx_runtime.jsxs)("svg", { className: "w-6 h-6 text-white", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("circle", { cx: "11", cy: "11", r: "7" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M21 21l-4.35-4.35" }) ] }) }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "font-semibold text-base", children: t('find_tasks.title') }), /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "text-green-100 text-sm mt-0.5", children: t('find_tasks.banner_hint') }) ] }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { className: "w-5 h-5 shrink-0 text-white/70", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 5l7 7-7 7" }) }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "grid md:grid-cols-2 gap-8", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "space-y-8", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("h2", { className: "text-lg font-semibold text-white mb-4", children: [ t('dashboard.my_tasks'), " ", /*#__PURE__*/ (0,jsx_runtime.jsxs)("span", { className: "text-white/60 font-normal text-base", children: [ "(", activeTasks.length, ")" ] }) ] }), activeTasks.length === 0 ? /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-6 text-center text-gray-500", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { children: t('dashboard.tasks.empty') }), /*#__PURE__*/ (0,jsx_runtime.jsx)((link_default()), { href: "/tasks/new", className: "text-green-600 hover:underline text-sm mt-2 inline-block", children: t('dashboard.tasks.empty.cta') }) ] }) : /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "space-y-3", children: activeTasks.map((task)=>/*#__PURE__*/ (0,jsx_runtime.jsx)(TaskCard, { task: task }, task.id)) }) ] }), completedTasks.length > 0 && /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("h2", { className: "text-lg font-semibold text-white/70 mb-4", children: [ t('dashboard.completed_tasks'), " ", /*#__PURE__*/ (0,jsx_runtime.jsxs)("span", { className: "font-normal text-base text-white/50", children: [ "(", completedTasks.length, ")" ] }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "space-y-3 opacity-75", children: completedTasks.map((task)=>/*#__PURE__*/ (0,jsx_runtime.jsx)(TaskCard, { task: task }, task.id)) }) ] }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "space-y-8", children: isSpecialist ? /*#__PURE__*/ (0,jsx_runtime.jsxs)(jsx_runtime.Fragment, { children: [ invitations.length > 0 && /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("h2", { className: "text-lg font-semibold text-white mb-4", children: [ t('dashboard.invitations'), " ", /*#__PURE__*/ (0,jsx_runtime.jsxs)("span", { className: "text-white/60 font-normal text-base", children: [ "(", invitations.length, ")" ] }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "space-y-3", children: invitations.map((inv)=>/*#__PURE__*/ (0,jsx_runtime.jsxs)((link_default()), { href: inv.referenceId ? "/tasks/".concat(inv.referenceId) : '/tasks', className: "flex items-start gap-3 p-4 rounded-xl border transition cursor-pointer ".concat(inv.isRead ? 'bg-white/90 border-white/20 hover:bg-white' : 'bg-white border-amber-300 shadow-sm hover:bg-amber-50'), children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "text-2xl", children: "\uD83D\uDCCB" }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "font-medium truncate ".concat(inv.isRead ? 'text-gray-600' : 'text-gray-900'), children: t('notif.type.task_invite', inv.title) }), inv.body && /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "text-sm text-gray-500 mt-0.5 truncate", children: (()=>{ const title = extractNotifParam(inv.body); const tpl = t('notif.body.task_invite', ''); return title && tpl ? tpl.replace('{title}', title) : inv.body; })() }), /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "text-xs text-gray-400 mt-1", children: new Date(inv.createdAt).toLocaleDateString(dateLocale) }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex flex-col items-end gap-1.5 shrink-0", children: [ !inv.isRead && /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "w-2 h-2 bg-amber-400 rounded-full mt-2" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "text-xs text-gray-400", children: "→" }) ] }) ] }, inv.id)) }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("h2", { className: "text-lg font-semibold text-white mb-4", children: [ t('dashboard.my_offers'), " ", /*#__PURE__*/ (0,jsx_runtime.jsxs)("span", { className: "text-white/60 font-normal text-base", children: [ "(", activeOffers.length, ")" ] }) ] }), activeOffers.length === 0 ? /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-6 text-center text-gray-500", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { children: t('dashboard.offers.empty') }), /*#__PURE__*/ (0,jsx_runtime.jsx)((link_default()), { href: "/tasks", className: "text-green-600 hover:underline text-sm mt-2 inline-block", children: t('dashboard.offers.empty.cta') }) ] }) : /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "space-y-3", children: activeOffers.map((row)=>/*#__PURE__*/ (0,jsx_runtime.jsx)(OfferCard, { row: row }, (row.offer || row).id)) }) ] }), completedOffers.length > 0 && /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("h2", { className: "text-lg font-semibold text-white/70 mb-4", children: [ t('dashboard.completed_offers'), " ", /*#__PURE__*/ (0,jsx_runtime.jsxs)("span", { className: "font-normal text-base text-white/50", children: [ "(", completedOffers.length, ")" ] }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "space-y-3 opacity-75", children: completedOffers.map((row)=>/*#__PURE__*/ (0,jsx_runtime.jsx)(OfferCard, { row: row }, (row.offer || row).id)) }) ] }) ] }) : /*#__PURE__*/ (0,jsx_runtime.jsxs)(jsx_runtime.Fragment, { children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)((link_default()), { href: "/specialists", className: "flex items-center justify-between gap-4 bg-green-600 text-white rounded-xl px-5 py-4 hover:bg-green-700 transition", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex items-center gap-4", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "shrink-0 bg-white/20 rounded-xl p-2.5", children: /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { className: "w-6 h-6 text-white", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,jsx_runtime.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" }) }) }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "font-semibold text-base", children: t('dashboard.customer.specialists_title') }), /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "text-green-100 text-sm mt-0.5", children: t('dashboard.customer.specialists_hint') }) ] }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { className: "w-5 h-5 shrink-0 text-white/70", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 5l7 7-7 7" }) }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-5", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("h2", { className: "text-base font-semibold text-gray-800 mb-4", children: t('dashboard.customer.how_title') }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "space-y-3", children: [ { num: '1', text: t('dashboard.customer.step1'), icon: 'M12 4v16m8-8H4' }, { num: '2', text: t('dashboard.customer.step2'), icon: 'M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z' }, { num: '3', text: t('dashboard.customer.step3'), icon: 'M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z' } ].map((param)=>{ let { num, text, icon } = param; return /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex items-start gap-3", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "shrink-0 w-7 h-7 rounded-full bg-green-100 text-green-600 text-sm font-bold flex items-center justify-center", children: num }), /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "text-sm text-gray-600 pt-1", children: text }) ] }, num); }) }), /*#__PURE__*/ (0,jsx_runtime.jsxs)((link_default()), { href: "/tasks/new", className: "mt-4 inline-block text-sm font-medium text-green-600 hover:underline", children: [ tasks.length > 0 ? t('dashboard.tasks.add_new') : t('dashboard.tasks.empty.cta'), " →" ] }) ] }) ] }) }) ] }) ] }); } ‘” ` •‘// ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); // EXPORTS __webpack_require__.d(__webpack_exports__, { "default": () => (/* binding */ DashboardPage) }); // EXTERNAL MODULE: ../../node_modules/next/dist/compiled/react/jsx-runtime.js var jsx_runtime = __webpack_require__(4568); // EXTERNAL MODULE: ../../node_modules/next/dist/compiled/react/index.js var react = __webpack_require__(7620); // EXTERNAL MODULE: ../../node_modules/next/dist/api/navigation.js var navigation = __webpack_require__(7541); // EXTERNAL MODULE: ../../node_modules/next/dist/client/app-dir/link.js var app_dir_link = __webpack_require__(9664); var link_default = /*#__PURE__*/__webpack_require__.n(app_dir_link); // EXTERNAL MODULE: ./src/lib/auth.ts var auth = __webpack_require__(1592); // EXTERNAL MODULE: ./src/context/locale.tsx var context_locale = __webpack_require__(9906); // EXTERNAL MODULE: ./src/lib/api.ts var api = __webpack_require__(2982); // EXTERNAL MODULE: ./src/lib/taskLocale.ts var taskLocale = __webpack_require__(4017); // EXTERNAL MODULE: ./src/components/PlanBadge.tsx var PlanBadge = __webpack_require__(2035); ;// ./src/components/UsageMeter.tsx  ReplaceSource•~ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; export function UsageMeter(param) { let { current, limit, label, className = '' } = param; if (limit === null) { return /*#__PURE__*/ _jsxs("div", { className: "".concat(className), children: [ /*#__PURE__*/ _jsxs("div", { className: "flex justify-between items-center mb-1", children: [ /*#__PURE__*/ _jsx("span", { className: "text-xs text-gray-500", children: label }), /*#__PURE__*/ _jsx("span", { className: "text-xs font-semibold text-green-600", children: "∞" }) ] }), /*#__PURE__*/ _jsx("div", { className: "h-1.5 rounded-full bg-green-100", children: /*#__PURE__*/ _jsx("div", { className: "h-full w-full rounded-full bg-green-400" }) }) ] }); } const pct = limit > 0 ? Math.min(100, Math.round(current / limit * 100)) : 100; const remaining = Math.max(0, limit - current); const barColor = pct >= 100 ? 'bg-red-500' : pct >= 80 ? 'bg-amber-400' : 'bg-green-500'; const textColor = pct >= 100 ? 'text-red-600' : pct >= 80 ? 'text-amber-600' : 'text-gray-600'; return /*#__PURE__*/ _jsxs("div", { className: className, children: [ /*#__PURE__*/ _jsxs("div", { className: "flex justify-between items-center mb-1", children: [ /*#__PURE__*/ _jsx("span", { className: "text-xs text-gray-500", children: label }), /*#__PURE__*/ _jsxs("span", { className: "text-xs font-semibold ".concat(textColor), children: [ remaining, " / ", limit ] }) ] }), /*#__PURE__*/ _jsx("div", { className: "h-1.5 rounded-full bg-gray-100", children: /*#__PURE__*/ _jsx("div", { className: "h-full rounded-full transition-all ".concat(barColor), style: { width: "".concat(pct, "%") } }) }) ] }); } i062undefined6470undefined214218__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined328332__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined486489__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined675678__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined910913__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined10341037__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined15541558__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined16451649__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined17911794__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined19641968__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined23122315__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined24272430__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined¶144220(0,jsx_runtime.jsxs)undefined330406(0,jsx_runtime.jsxs)undefined560634(0,jsx_runtime.jsx)undefined820894(0,jsx_runtime.jsx)undefined11261200(0,jsx_runtime.jsx)undefined13211395(0,jsx_runtime.jsx)undefined19121988(0,jsx_runtime.jsxs)undefined20752151(0,jsx_runtime.jsxs)undefined22932367(0,jsx_runtime.jsx)undefined25372613(0,jsx_runtime.jsxs)undefined29573031(0,jsx_runtime.jsx)undefined31433217(0,jsx_runtime.jsx)undefinedRawSource" ;// ./src/app/dashboard/page.tsx û‘˜ŸÿÿÊO61146undefined148191undefined193253undefined255283undefined285324undefined326370undefined372564undefined566623undefined625675undefined677729undefined15231527__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined16591663__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined18051809__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined19601963__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined22152218__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined22202228__WEBPACK_MODULE_REFERENCE__8_5b22506c616e4261646765225d_directImport_asiSafe1__._undefined23722375__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined26482651__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined26532656__WEBPACK_MODULE_REFERENCE__3_5b2264656661756c74225d_directImport_asiSafe1__._undefined30383042__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined31503154__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined33293332__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined35513555__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined39163919__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined40474050__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined44734477__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined45954598__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined48384841__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined48434852__WEBPACK_MODULE_REFERENCE__9_5b2255736167654d65746572225d_directImport_asiSafe1__._undefined51495152__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined51545163__WEBPACK_MODULE_REFERENCE__9_5b2255736167654d65746572225d_directImport_asiSafe1__._undefined55065509__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined57215725__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined58965899__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined61066109__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined64356449undefined65666575__WEBPACK_MODULE_REFERENCE__4_5b2275736553657373696f6e225d_call_directImport_asiSafe1__._undefined65996607__WEBPACK_MODULE_REFERENCE__2_5b22757365526f75746572225d_call_directImport_asiSafe1__._undefined66376651__WEBPACK_MODULE_REFERENCE__2_5b22757365536561726368506172616d73225d_call_directImport_asiSafe1__._undefined66826690__WEBPACK_MODULE_REFERENCE__5_5b227573654c6f63616c65225d_call_directImport_asiSafe1__._undefined67256732__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined67716778__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined68236830__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined68796886__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined69276934__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined69816988__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined70337040__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined70957102__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined71157123__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined73217329__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined74547468__WEBPACK_MODULE_REFERENCE__6_5b226170706c794d79526566657272616c225d_call_directImport_asiSafe1__._undefined79887996__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined80428061__WEBPACK_MODULE_REFERENCE__6_5b226765744d795370656369616c6973744361726473225d_call_directImport_asiSafe1__._undefined82548262__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined83348343__WEBPACK_MODULE_REFERENCE__6_5b226765744d795461736b73225d_call_directImport_asiSafe1__._undefined83608370__WEBPACK_MODULE_REFERENCE__6_5b226765744d794f6666657273225d_call_directImport_asiSafe1__._undefined83878398__WEBPACK_MODULE_REFERENCE__6_5b226765744d7952657669657773225d_call_directImport_asiSafe1__._undefined84158430__WEBPACK_MODULE_REFERENCE__6_5b226765744e6f74696669636174696f6e73225d_call_directImport_asiSafe1__._undefined84478460__WEBPACK_MODULE_REFERENCE__6_5b226765744d7944617368626f617264225d_call_directImport_asiSafe1__._undefined88208828__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined90629087__WEBPACK_MODULE_REFERENCE__6_5b226765745370656369616c697374466f6d6f44617368626f617264225d_call_directImport_asiSafe1__._undefined91539176__WEBPACK_MODULE_REFERENCE__6_5b22676574437573746f6d6572466f6d6f44617368626f617264225d_call_directImport_asiSafe1__._undefined93079310__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1089910902__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1090410907__WEBPACK_MODULE_REFERENCE__3_5b2264656661756c74225d_directImport_asiSafe1__._undefined1112211126__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1126211266__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1140811411__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1154311551__WEBPACK_MODULE_REFERENCE__7_5b227461736b5469746c65225d_call_directImport_asiSafe1__._undefined1164111644__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1191611920__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1210212106__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1266012664__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1327713281__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1343313436__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1392513929__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1410214112__WEBPACK_MODULE_REFERENCE__7_5b22666f726d61745072696365225d_call_directImport_asiSafe1__._undefined1512715131__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1513315136__WEBPACK_MODULE_REFERENCE__3_5b2264656661756c74225d_directImport_asiSafe1__._undefined1538215386__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1553415538__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1569215695__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1600116004__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1632416328__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1649216496__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1666816678__WEBPACK_MODULE_REFERENCE__7_5b22666f726d61745072696365225d_call_directImport_asiSafe1__._undefined1685816861__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1748117485__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1765917662__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1799818001__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1830618310__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1865418657__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1902919032__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1946219466__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1957319577__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1971919722__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1991319916__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1991819921__WEBPACK_MODULE_REFERENCE__3_5b2264656661756c74225d_directImport_asiSafe1__._undefined2026020264__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2043220436__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2057820581__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2081720820__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2109421098__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2126021264__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2126621269__WEBPACK_MODULE_REFERENCE__3_5b2264656661756c74225d_directImport_asiSafe1__._undefined2157621580__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2178421787__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2204922052__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2243022433__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2271222716__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2322223226__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2322823231__WEBPACK_MODULE_REFERENCE__3_5b2264656661756c74225d_directImport_asiSafe1__._undefined2352623530__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2373423737__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2399824001__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2438224385__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2466324667__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2525425257__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2546225466__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2565425657__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2577025773__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2608926092__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2646926473__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2661526619__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2707127075__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2767227676__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2815428157__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2815928162__WEBPACK_MODULE_REFERENCE__3_5b2264656661756c74225d_directImport_asiSafe1__._undefined2851828521__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2866428668__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2883328837__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2900029003__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2916129164__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2955229555__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3011430118__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3023130235__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3078930792__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3129031294__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3144431448__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3183631839__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3219732201__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3220332206__WEBPACK_MODULE_REFERENCE__3_5b2264656661756c74225d_directImport_asiSafe1__._undefined3245532459__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3261032613__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3276432768__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3317033173__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3344433447__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3385333857__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3396233965__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3421434217__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3457634579__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3487934882__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3515535159__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3528835292__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3542935433__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3553835542__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3587235876__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3648736491__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3673936742__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3694236945__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3694736950__WEBPACK_MODULE_REFERENCE__3_5b2264656661756c74225d_directImport_asiSafe1__._undefined3737537378__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3754137544__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3785037854__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3795937963__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3830338307__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3889438897__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3907439077__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3939539398__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3952039524__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3952639534__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined3965139655__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3976839772__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4012540129__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4075340756__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4092640930__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4093240935__WEBPACK_MODULE_REFERENCE__3_5b2264656661756c74225d_directImport_asiSafe1__._undefined4145841461__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4177141775__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4202542028__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4247142474__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4327543278__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4378843792__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4408344086__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4436444367__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4503045034__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4514745151__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4550245506__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4615946163__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4642346426__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4663946642__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4664446647__WEBPACK_MODULE_REFERENCE__3_5b2264656661756c74225d_directImport_asiSafe1__._undefined4709347096__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4726747270__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4761447618__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4773147735__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4809648100__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4872848731__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4891648919__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4925949263__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4926549273__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined4936449368__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4937049373__WEBPACK_MODULE_REFERENCE__3_5b2264656661756c74225d_directImport_asiSafe1__._undefined4970349707__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4991849921__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5011250115__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5059550598__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5127451278__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5142351426__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5177551778__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5231052313__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5273352736__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5316953173__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5338353386__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5368353686__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5512955133__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5536755370__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5576955772__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5627256276__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5627856281__WEBPACK_MODULE_REFERENCE__3_5b2264656661756c74225d_directImport_asiSafe1__._undefined•863939(0,jsx_runtime.jsxs)undefined10711147(0,jsx_runtime.jsxs)undefined12891365(0,jsx_runtime.jsxs)undefined15161590(0,jsx_runtime.jsx)undefined18421916(0,jsx_runtime.jsx)undefined19181999PlanBadge/* PlanBadge */.dundefined21432217(0,jsx_runtime.jsx)undefined24902564(0,jsx_runtime.jsx)undefined25662643(link_default())undefined30253101(0,jsx_runtime.jsxs)undefined32093285(0,jsx_runtime.jsxs)undefined34603534(0,jsx_runtime.jsx)undefined37533829(0,jsx_runtime.jsxs)undefined41904264(0,jsx_runtime.jsx)undefined43924466(0,jsx_runtime.jsx)undefined48894965(0,jsx_runtime.jsxs)undefined50835157(0,jsx_runtime.jsx)undefined53975471(0,jsx_runtime.jsx)undefined54735556UsageMeterundefined58535927(0,jsx_runtime.jsx)undefined59296012UsageMeterundefined63556429(0,jsx_runtime.jsx)undefined66416717(0,jsx_runtime.jsxs)undefined68886962(0,jsx_runtime.jsx)undefined71697243(0,jsx_runtime.jsx)undefined76857773(0,auth/* useSession */.wV)undefined77977883(0,navigation.useRouter)undefined79138011(0,navigation.useSearchParams)undefined80428128(0,context_locale/* useLocale */.Y)undefined81638247(0,react.useState)undefined82868370(0,react.useState)undefined84158499(0,react.useState)undefined85488632(0,react.useState)undefined86738757(0,react.useState)undefined88048888(0,react.useState)undefined89339017(0,react.useState)undefined90729156(0,react.useState)undefined91699255(0,react.useEffect)undefined94539539(0,react.useEffect)undefined96649762(0,api/* applyMyReferral */.C0)undefined1028210368(0,react.useEffect)undefined1041410522(0,api/* getMySpecialistCards */.Bb)undefined1071510801(0,react.useEffect)undefined1087310961(0,api/* getMyTasks */.Fu)undefined1097811068(0,api/* getMyOffers */.aT)undefined1108511177(0,api/* getMyReviews */.q7)undefined1119411294(0,api/* getNotifications */.Tr)undefined1131111407(0,api/* getMyDashboard */.H)undefined1176711853(0,react.useEffect)undefined1208712207(0,api/* getSpecialistFomoDashboard */.zk)undefined1227312389(0,api/* getCustomerFomoDashboard */.ML)undefined1252012594(0,jsx_runtime.jsx)undefined1418314257(0,jsx_runtime.jsx)undefined1425914336(link_default())undefined1455114627(0,jsx_runtime.jsxs)undefined1476314839(0,jsx_runtime.jsxs)undefined1498115055(0,jsx_runtime.jsx)undefined1518715273(0,taskLocale/* taskTitle */.Oj)undefined1536315437(0,jsx_runtime.jsx)undefined1570915785(0,jsx_runtime.jsxs)undefined1596716043(0,jsx_runtime.jsxs)undefined1659716673(0,jsx_runtime.jsxs)undefined1728617362(0,jsx_runtime.jsxs)undefined1751417588(0,jsx_runtime.jsx)undefined1807718153(0,jsx_runtime.jsxs)undefined1832618416(0,taskLocale/* formatPrice */.$g)undefined1943119507(0,jsx_runtime.jsxs)undefined1950919586(link_default())undefined1983219908(0,jsx_runtime.jsxs)undefined2005620132(0,jsx_runtime.jsxs)undefined2028620360(0,jsx_runtime.jsx)undefined2066620740(0,jsx_runtime.jsx)undefined2106021136(0,jsx_runtime.jsxs)undefined2130021376(0,jsx_runtime.jsxs)undefined2154821638(0,taskLocale/* formatPrice */.$g)undefined2181821892(0,jsx_runtime.jsx)undefined2251222588(0,jsx_runtime.jsxs)undefined2276222836(0,jsx_runtime.jsx)undefined2317223246(0,jsx_runtime.jsx)undefined2355123627(0,jsx_runtime.jsxs)undefined2397124045(0,jsx_runtime.jsx)undefined2441724491(0,jsx_runtime.jsx)undefined2492124997(0,jsx_runtime.jsxs)undefined2510425180(0,jsx_runtime.jsxs)undefined2532225396(0,jsx_runtime.jsx)undefined2558725661(0,jsx_runtime.jsx)undefined2566325740(link_default())undefined2607926155(0,jsx_runtime.jsxs)undefined2632326399(0,jsx_runtime.jsxs)undefined2654126615(0,jsx_runtime.jsx)undefined2685126925(0,jsx_runtime.jsx)undefined2719927275(0,jsx_runtime.jsxs)undefined2743727513(0,jsx_runtime.jsxs)undefined2751527592(link_default())undefined2789927975(0,jsx_runtime.jsxs)undefined2817928253(0,jsx_runtime.jsx)undefined2851528589(0,jsx_runtime.jsx)undefined2896729041(0,jsx_runtime.jsx)undefined2932029396(0,jsx_runtime.jsxs)undefined2990229978(0,jsx_runtime.jsxs)undefined2998030057(link_default())undefined3035230428(0,jsx_runtime.jsxs)undefined3063230706(0,jsx_runtime.jsx)undefined3096731041(0,jsx_runtime.jsx)undefined3142231496(0,jsx_runtime.jsx)undefined3177431850(0,jsx_runtime.jsxs)undefined3243732511(0,jsx_runtime.jsx)undefined3271632792(0,jsx_runtime.jsxs)undefined3298033054(0,jsx_runtime.jsx)undefined3316733241(0,jsx_runtime.jsx)undefined3355733631(0,jsx_runtime.jsx)undefined3400834084(0,jsx_runtime.jsxs)undefined3422634302(0,jsx_runtime.jsxs)undefined3475434830(0,jsx_runtime.jsxs)undefined3542735503(0,jsx_runtime.jsxs)undefined3598136055(0,jsx_runtime.jsx)undefined3605736134(link_default())undefined3649036564(0,jsx_runtime.jsx)undefined3670736783(0,jsx_runtime.jsxs)undefined3694837024(0,jsx_runtime.jsxs)undefined3718737261(0,jsx_runtime.jsx)undefined3741937493(0,jsx_runtime.jsx)undefined3788137955(0,jsx_runtime.jsx)undefined3851438590(0,jsx_runtime.jsxs)undefined3870338779(0,jsx_runtime.jsxs)undefined3933339407(0,jsx_runtime.jsx)undefined3990539981(0,jsx_runtime.jsxs)undefined4013140207(0,jsx_runtime.jsxs)undefined4059540669(0,jsx_runtime.jsx)undefined4102741103(0,jsx_runtime.jsxs)undefined4110541182(link_default())undefined4143141507(0,jsx_runtime.jsxs)undefined4165841732(0,jsx_runtime.jsx)undefined4188341959(0,jsx_runtime.jsxs)undefined4236142435(0,jsx_runtime.jsx)undefined4270642780(0,jsx_runtime.jsx)undefined4318643262(0,jsx_runtime.jsxs)undefined4336743441(0,jsx_runtime.jsx)undefined4369043764(0,jsx_runtime.jsx)undefined4412344197(0,jsx_runtime.jsx)undefined4449744571(0,jsx_runtime.jsx)undefined4484444920(0,jsx_runtime.jsxs)undefined4504945125(0,jsx_runtime.jsxs)undefined4526245338(0,jsx_runtime.jsxs)undefined4544345519(0,jsx_runtime.jsxs)undefined4584945925(0,jsx_runtime.jsxs)undefined4653646612(0,jsx_runtime.jsxs)undefined4686046934(0,jsx_runtime.jsx)undefined4713447208(0,jsx_runtime.jsx)undefined4721047287(link_default())undefined4771247786(0,jsx_runtime.jsx)undefined4794948023(0,jsx_runtime.jsx)undefined4832948405(0,jsx_runtime.jsxs)undefined4851048586(0,jsx_runtime.jsxs)undefined4892649002(0,jsx_runtime.jsxs)undefined4958949663(0,jsx_runtime.jsx)undefined4984049914(0,jsx_runtime.jsx)undefined5023250306(0,jsx_runtime.jsx)undefined5042850504(0,jsx_runtime.jsxs)undefined5050650585jsx_runtime.Fragmentundefined5070250778(0,jsx_runtime.jsxs)undefined5089150967(0,jsx_runtime.jsxs)undefined5132051396(0,jsx_runtime.jsxs)undefined5202052094(0,jsx_runtime.jsx)undefined5226452340(0,jsx_runtime.jsxs)undefined5234252419(link_default())undefined5294253016(0,jsx_runtime.jsx)undefined5332653402(0,jsx_runtime.jsxs)undefined5365253726(0,jsx_runtime.jsx)undefined5416954243(0,jsx_runtime.jsx)undefined5504455118(0,jsx_runtime.jsx)undefined5562855704(0,jsx_runtime.jsxs)undefined5599556069(0,jsx_runtime.jsx)undefined5634756421(0,jsx_runtime.jsx)undefined5708457160(0,jsx_runtime.jsxs)undefined5727357349(0,jsx_runtime.jsxs)undefined5770057776(0,jsx_runtime.jsxs)undefined5842958505(0,jsx_runtime.jsxs)undefined5876558839(0,jsx_runtime.jsx)undefined5905259126(0,jsx_runtime.jsx)undefined5912859205(link_default())undefined5965159725(0,jsx_runtime.jsx)undefined5989659970(0,jsx_runtime.jsx)undefined6031460390(0,jsx_runtime.jsxs)undefined6050360579(0,jsx_runtime.jsxs)undefined6094061016(0,jsx_runtime.jsxs)undefined6164461718(0,jsx_runtime.jsx)undefined6190361977(0,jsx_runtime.jsx)undefined6231762393(0,jsx_runtime.jsxs)undefined6239562474jsx_runtime.Fragmentundefined6256562641(0,jsx_runtime.jsxs)undefined6264362720(link_default())undefined6305063126(0,jsx_runtime.jsxs)undefined6333763411(0,jsx_runtime.jsx)undefined6360263676(0,jsx_runtime.jsx)undefined6415664230(0,jsx_runtime.jsx)undefined6490664982(0,jsx_runtime.jsxs)undefined6512765201(0,jsx_runtime.jsx)undefined6555065624(0,jsx_runtime.jsx)undefined6615666230(0,jsx_runtime.jsx)undefined6665066724(0,jsx_runtime.jsx)undefined6715767233(0,jsx_runtime.jsxs)undefined6744367517(0,jsx_runtime.jsx)undefined6781467888(0,jsx_runtime.jsx)undefined6933169407(0,jsx_runtime.jsxs)undefined6964169715(0,jsx_runtime.jsx)undefined7011470188(0,jsx_runtime.jsx)undefined7068870764(0,jsx_runtime.jsxs)undefined7076670843(link_default())undefinedŒÿÿ `‹jsx_runtime›jsx_runtime_namespaceObject“jsx_runtime_defaultݹÿÿ•react_namespaceObjectreact_defaultŠnavigationŒapp_dir_link”link_namespaceObjectŒlink_default„authŽcontext_localeÉÿÿŠtaskLocaleПÿÿ¿ÿÿšUsageMeter_namespaceObjectŸÿÿŽŸÿÿŸÿÿ”page_namespaceObject Œÿÿ‚ŽÞkÿÿÿ ªI«webpack/lib/util/registerExternalSerializerœwebpack-sources/ConcatSource€«webpack/lib/util/registerExternalSerializer™webpack-sources/RawSourceà// ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); // EXPORTS __webpack_require__.d(__webpack_exports__, { "default": () => (/* binding */ UserProfilePage) }); // EXTERNAL MODULE: ../../node_modules/next/dist/compiled/react/jsx-runtime.js var jsx_runtime = __webpack_require__(4568); // EXTERNAL MODULE: ../../node_modules/next/dist/compiled/react/index.js var react = __webpack_require__(7620); // EXTERNAL MODULE: ../../node_modules/next/dist/api/navigation.js var navigation = __webpack_require__(7541); // EXTERNAL MODULE: ./src/context/locale.tsx var context_locale = __webpack_require__(9906); // EXTERNAL MODULE: ./src/lib/auth.ts var auth = __webpack_require__(1592); // EXTERNAL MODULE: ./src/lib/api.ts var api = __webpack_require__(2982); // EXTERNAL MODULE: ../../node_modules/next/dist/client/app-dir/link.js var app_dir_link = __webpack_require__(9664); var link_default = /*#__PURE__*/__webpack_require__.n(app_dir_link); ;// ./src/components/UpgradePrompt.tsx «webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSource«webpack/lib/util/registerExternalSerializerœwebpack-sources/CachedSource *«webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSource«webpack/lib/util/registerExternalSerializer™webpack-sources/RawSource£import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import Link from 'next/link'; const tierLabels = { free: 'Free', pro: 'Pro', ultimate: 'Ultimate' }; const tierColors = { free: 'bg-gray-50 border-gray-200 text-gray-700', pro: 'bg-green-50 border-green-200 text-gray-800', ultimate: 'bg-amber-50 border-amber-200 text-amber-800' }; const tierBtnColors = { free: 'bg-gray-600 hover:bg-gray-700 text-white', pro: 'bg-green-600 hover:bg-green-700 text-white', ultimate: 'bg-amber-500 hover:bg-amber-600 text-white' }; export function UpgradePrompt(param) { let { feature, requiredTier, variant = 'inline', t, className = '' } = param; const tierLabel = tierLabels[requiredTier]; if (variant === 'banner') { return /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between gap-3 rounded-xl border px-4 py-3 ".concat(tierColors[requiredTier], " ").concat(className), children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 min-w-0", children: [ /*#__PURE__*/ _jsx(LockIcon, { className: "w-4 h-4 shrink-0 opacity-60" }), /*#__PURE__*/ _jsxs("span", { className: "text-sm font-medium truncate", children: [ feature, " — ", t('upgrade.available_in', 'Available in'), " ", /*#__PURE__*/ _jsx("b", { children: tierLabel }) ] }) ] }), /*#__PURE__*/ _jsx(Link, { href: "/pricing?highlight=".concat(requiredTier), className: "shrink-0 text-xs font-semibold px-3 py-1.5 rounded-lg transition ".concat(tierBtnColors[requiredTier]), children: t('upgrade.cta', 'Upgrade') }) ] }); } if (variant === 'block') { return /*#__PURE__*/ _jsxs("div", { className: "rounded-2xl border p-6 text-center ".concat(tierColors[requiredTier], " ").concat(className), children: [ /*#__PURE__*/ _jsx(LockIcon, { className: "w-8 h-8 mx-auto mb-3 opacity-40" }), /*#__PURE__*/ _jsx("p", { className: "font-semibold text-base mb-1", children: feature }), /*#__PURE__*/ _jsxs("p", { className: "text-sm opacity-70 mb-4", children: [ t('upgrade.available_in', 'Available in plan'), " ", /*#__PURE__*/ _jsx("b", { children: tierLabel }) ] }), /*#__PURE__*/ _jsx(Link, { href: "/pricing?highlight=".concat(requiredTier), className: "inline-block text-sm font-semibold px-5 py-2 rounded-xl transition ".concat(tierBtnColors[requiredTier]), children: t('upgrade.cta', 'Upgrade plan') }) ] }); } // inline variant return /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 text-sm ".concat(className), children: [ /*#__PURE__*/ _jsx(LockIcon, { className: "w-4 h-4 text-gray-400 shrink-0" }), /*#__PURE__*/ _jsxs("span", { className: "text-gray-500", children: [ t('upgrade.available_in', 'Available in'), " ", /*#__PURE__*/ _jsx("b", { className: "text-gray-700", children: tierLabel }), ".", ' ', /*#__PURE__*/ _jsx(Link, { href: "/pricing?highlight=".concat(requiredTier), className: "text-green-600 hover:underline", children: t('upgrade.cta', 'Upgrade') }) ] }) ] }); } function LockIcon(param) { let { className = '' } = param; return /*#__PURE__*/ _jsx("svg", { viewBox: "0 0 20 20", fill: "currentColor", className: className, children: /*#__PURE__*/ _jsx("path", { fillRule: "evenodd", d: "M10 1a4.5 4.5 0 00-4.5 4.5V9H5a2 2 0 00-2 2v6a2 2 0 002 2h10a2 2 0 002-2v-6a2 2 0 00-2-2h-.5V5.5A4.5 4.5 0 0010 1zm3 8V5.5a3 3 0 10-6 0V9h6z", clipRule: "evenodd" }) }); } d>@\_5;÷ûŽ‘&*“–{~€ƒÿ º œ > A á å Ó Ö r u w z ð ô Mvyíñ¿Â—šœŸ €€€Í__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._ÿË__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._þÿÿÎ__WEBPACK_MODULE_REFERENCE__6_5b2264656661756c74225d_directImport_asiSafe1__._ýþþýþþÿýþýþþÿþþ€†buffer†source„size„maps„hashj const tierLabels = { free: 'Free', pro: 'Pro', ultimate: 'Ultimate' }; const tierColors = { free: 'bg-gray-50 border-gray-200 text-gray-700', pro: 'bg-green-50 border-green-200 text-gray-800', ultimate: 'bg-amber-50 border-amber-200 text-amber-800' }; const tierBtnColors = { free: 'bg-gray-600 hover:bg-gray-700 text-white', pro: 'bg-green-600 hover:bg-green-700 text-white', ultimate: 'bg-amber-500 hover:bg-amber-600 text-white' }; function UpgradePrompt(param) { let { feature, requiredTier, variant = 'inline', t, className = '' } = param; const tierLabel = tierLabels[requiredTier]; if (variant === 'banner') { return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "flex items-center justify-between gap-3 rounded-xl border px-4 py-3 ".concat(tierColors[requiredTier], " ").concat(className), children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "flex items-center gap-2 min-w-0", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(LockIcon, { className: "w-4 h-4 shrink-0 opacity-60" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("span", { className: "text-sm font-medium truncate", children: [ feature, " — ", t('upgrade.available_in', 'Available in'), " ", /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("b", { children: tierLabel }) ] }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__6_5b2264656661756c74225d_directImport_asiSafe1__._, { href: "/pricing?highlight=".concat(requiredTier), className: "shrink-0 text-xs font-semibold px-3 py-1.5 rounded-lg transition ".concat(tierBtnColors[requiredTier]), children: t('upgrade.cta', 'Upgrade') }) ] }); } if (variant === 'block') { return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "rounded-2xl border p-6 text-center ".concat(tierColors[requiredTier], " ").concat(className), children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(LockIcon, { className: "w-8 h-8 mx-auto mb-3 opacity-40" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { className: "font-semibold text-base mb-1", children: feature }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("p", { className: "text-sm opacity-70 mb-4", children: [ t('upgrade.available_in', 'Available in plan'), " ", /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("b", { children: tierLabel }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__6_5b2264656661756c74225d_directImport_asiSafe1__._, { href: "/pricing?highlight=".concat(requiredTier), className: "inline-block text-sm font-semibold px-5 py-2 rounded-xl transition ".concat(tierBtnColors[requiredTier]), children: t('upgrade.cta', 'Upgrade plan') }) ] }); } // inline variant return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "flex items-center gap-2 text-sm ".concat(className), children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(LockIcon, { className: "w-4 h-4 text-gray-400 shrink-0" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("span", { className: "text-gray-500", children: [ t('upgrade.available_in', 'Available in'), " ", /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("b", { className: "text-gray-700", children: tierLabel }), ".", ' ', /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__6_5b2264656661756c74225d_directImport_asiSafe1__._, { href: "/pricing?highlight=".concat(requiredTier), className: "text-green-600 hover:underline", children: t('upgrade.cta', 'Upgrade') }) ] }) ] }); } function LockIcon(param) { let { className = '' } = param; return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("svg", { viewBox: "0 0 20 20", fill: "currentColor", className: className, children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("path", { fillRule: "evenodd", d: "M10 1a4.5 4.5 0 00-4.5 4.5V9H5a2 2 0 00-2 2v6a2 2 0 002 2h10a2 2 0 002-2v-6a2 2 0 00-2-2h-.5V5.5A4.5 4.5 0 0010 1zm3 8V5.5a3 3 0 10-6 0V9h6z", clipRule: "evenodd" }) }); } €•{"finalSource":false}ƒmap‹bufferedMap ReplaceSourceRawSource£import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import Link from 'next/link'; const tierLabels = { free: 'Free', pro: 'Pro', ultimate: 'Ultimate' }; const tierColors = { free: 'bg-gray-50 border-gray-200 text-gray-700', pro: 'bg-green-50 border-green-200 text-gray-800', ultimate: 'bg-amber-50 border-amber-200 text-amber-800' }; const tierBtnColors = { free: 'bg-gray-600 hover:bg-gray-700 text-white', pro: 'bg-green-600 hover:bg-green-700 text-white', ultimate: 'bg-amber-500 hover:bg-amber-600 text-white' }; export function UpgradePrompt(param) { let { feature, requiredTier, variant = 'inline', t, className = '' } = param; const tierLabel = tierLabels[requiredTier]; if (variant === 'banner') { return /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between gap-3 rounded-xl border px-4 py-3 ".concat(tierColors[requiredTier], " ").concat(className), children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 min-w-0", children: [ /*#__PURE__*/ _jsx(LockIcon, { className: "w-4 h-4 shrink-0 opacity-60" }), /*#__PURE__*/ _jsxs("span", { className: "text-sm font-medium truncate", children: [ feature, " — ", t('upgrade.available_in', 'Available in'), " ", /*#__PURE__*/ _jsx("b", { children: tierLabel }) ] }) ] }), /*#__PURE__*/ _jsx(Link, { href: "/pricing?highlight=".concat(requiredTier), className: "shrink-0 text-xs font-semibold px-3 py-1.5 rounded-lg transition ".concat(tierBtnColors[requiredTier]), children: t('upgrade.cta', 'Upgrade') }) ] }); } if (variant === 'block') { return /*#__PURE__*/ _jsxs("div", { className: "rounded-2xl border p-6 text-center ".concat(tierColors[requiredTier], " ").concat(className), children: [ /*#__PURE__*/ _jsx(LockIcon, { className: "w-8 h-8 mx-auto mb-3 opacity-40" }), /*#__PURE__*/ _jsx("p", { className: "font-semibold text-base mb-1", children: feature }), /*#__PURE__*/ _jsxs("p", { className: "text-sm opacity-70 mb-4", children: [ t('upgrade.available_in', 'Available in plan'), " ", /*#__PURE__*/ _jsx("b", { children: tierLabel }) ] }), /*#__PURE__*/ _jsx(Link, { href: "/pricing?highlight=".concat(requiredTier), className: "inline-block text-sm font-semibold px-5 py-2 rounded-xl transition ".concat(tierBtnColors[requiredTier]), children: t('upgrade.cta', 'Upgrade plan') }) ] }); } // inline variant return /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 text-sm ".concat(className), children: [ /*#__PURE__*/ _jsx(LockIcon, { className: "w-4 h-4 text-gray-400 shrink-0" }), /*#__PURE__*/ _jsxs("span", { className: "text-gray-500", children: [ t('upgrade.available_in', 'Available in'), " ", /*#__PURE__*/ _jsx("b", { className: "text-gray-700", children: tierLabel }), ".", ' ', /*#__PURE__*/ _jsx(Link, { href: "/pricing?highlight=".concat(requiredTier), className: "text-green-600 hover:underline", children: t('upgrade.cta', 'Upgrade') }) ] }) ] }); } function LockIcon(param) { let { className = '' } = param; return /*#__PURE__*/ _jsx("svg", { viewBox: "0 0 20 20", fill: "currentColor", className: className, children: /*#__PURE__*/ _jsx("path", { fillRule: "evenodd", d: "M10 1a4.5 4.5 0 00-4.5 4.5V9H5a2 2 0 00-2 2v6a2 2 0 002 2h10a2 2 0 002-2v-6a2 2 0 00-2-2h-.5V5.5A4.5 4.5 0 0010 1zm3 8V5.5a3 3 0 10-6 0V9h6z", clipRule: "evenodd" }) }); } %062undefined6492undefined565571undefined795799__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined10151019__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined11661169__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined13181322__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined16831686__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined19151918__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined19201923__WEBPACK_MODULE_REFERENCE__6_5b2264656661756c74225d_directImport_asiSafe1__._undefined23032307__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined24902493__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined26222625__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined27852789__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined30273030__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined31863189__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined31913194__WEBPACK_MODULE_REFERENCE__6_5b2264656661756c74225d_directImport_asiSafe1__._undefined35683572__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined37023705__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined38213825__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined40314034__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined42474250__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined42524255__WEBPACK_MODULE_REFERENCE__6_5b2264656661756c74225d_directImport_asiSafe1__._undefined46294632__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined47654768__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined`_žÜ(»šæO™~ÈÊ “ ß – à a « K — …Ïkµ·zÆH’KR j?‰‹ØN˜g”(0,jsx_runtime.jsxs)ÿ“(0,jsx_runtime.jsx)þÿÿ(link_default())ýþþýþþÿýþýþþÿþþ // EXTERNAL MODULE: ./src/lib/formatName.ts var formatName = __webpack_require__(1258); // EXTERNAL MODULE: ./src/lib/formatLastSeen.ts var formatLastSeen = __webpack_require__(5338); // EXTERNAL MODULE: ./src/components/PlanBadge.tsx var PlanBadge = __webpack_require__(2035); // EXTERNAL MODULE: ./src/components/CategoryIcon.tsx var CategoryIcon = __webpack_require__(5940); ;// ./src/app/users/[id]/page.tsx  z,«webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSource«webpack/lib/util/registerExternalSerializer™webpack-sources/RawSourceÑ/* __next_internal_client_entry_do_not_use__ default auto */ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { useState, useEffect } from 'react'; import { useParams, useRouter } from 'next/navigation'; import { useLocale } from '@/context/locale'; import { useSession } from '@/lib/auth'; import { getUserProfile, getUserReviews, getUserRating, getSpecialistAvailability, getSpecialistCards, getCategories, getLocations, getSpecialistFavorites, addSpecialistFavorite, removeSpecialistFavorite, getOrCreateDirectRoom, getCanMessage, getPriceList } from '@/lib/api'; import { UpgradePrompt } from '@/components/UpgradePrompt'; import { formatShortName, shortName } from '@/lib/formatName'; import { formatLastSeen } from '@/lib/formatLastSeen'; import { PlanBadge } from '@/components/PlanBadge'; import { CategoryIcon, isCategoryIconUrl } from '@/components/CategoryIcon'; const MONTHS_BY_LOCALE = { ru: [ 'ЯМварь', 'Ѐевраль', 'Март', 'Апрель', 'Май', 'ИюМь', 'Июль', 'Август', 'СеМтябрь', 'Октябрь', 'НПябрь', 'Декабрь' ], en: [ 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December' ], el: [ 'ΙαΜουάριος', 'Ίεβρουάριος', 'Μάρτιος', 'Απρίλιος', 'Μάιος', 'ΙούΜιος', 'Ιούλιος', 'Αύγουστος', 'ΣεπτέΌβριος', 'Οκτώβριος', 'ΝοέΌβριος', 'ΔεκέΌβριος' ], uk: [ 'СічеМь', 'ЛютОй', 'БерезеМь', 'КвітеМь', 'ТравеМь', 'ЧервеМь', 'ЛОпеМь', 'СерпеМь', 'ВересеМь', 'ЖПвтеМь', 'ЛОстПпаЎ', 'ГруЎеМь' ] }; const WEEK_DAYS_BY_LOCALE = { ru: [ 'ПМ', 'Вт', 'Ср', 'Чт', 'Пт', 'Сб', 'Вс' ], en: [ 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa', 'Su' ], el: [ 'Δε', '΀ρ', '΀ε', 'Πε', 'Πα', 'Σά', 'Κυ' ], uk: [ 'ПМ', 'Вт', 'Ср', 'Чт', 'Пт', 'Сб', 'НЎ' ] }; export default function UserProfilePage() { var _user_firstName, _user_lastName, _user_name_, _user_name, _user_siteSettings, _session_user; const { id } = useParams(); const { t, locale } = useLocale(); const { data: session } = useSession(); const router = useRouter(); const [user, setUser] = useState(null); const [reviews, setReviews] = useState([]); const [rating, setRating] = useState(null); const [loading, setLoading] = useState(true); const [specialistCards, setSpecialistCards] = useState([]); const [priceLists, setPriceLists] = useState({}); const [catMap, setCatMap] = useState(new Map()); const [locMap, setLocMap] = useState(new Map()); const [isFavorite, setIsFavorite] = useState(false); const [favLoading, setFavLoading] = useState(false); const [msgLoading, setMsgLoading] = useState(false); const [canMsg, setCanMsg] = useState(null); // Availability const now = new Date(); const [availYear, setAvailYear] = useState(now.getFullYear()); const [availMonth, setAvailMonth] = useState(now.getMonth()); const [availMap, setAvailMap] = useState({}); const today = new Date().toISOString().slice(0, 10); const dateLocale = locale === 'ru' ? 'ru-RU' : locale === 'uk' ? 'uk-UA' : locale === 'en' ? 'en-US' : 'el-GR'; useEffect(()=>{ if (!id) return; Promise.all([ getUserProfile(id, locale), getUserReviews(id), getUserRating(id), getCategories().catch(()=>[]), getLocations().catch(()=>[]) ]).then((param)=>{ let [u, r, rt, cats, locs] = param; setUser(u); setReviews(r); setRating(rt.avg); setCatMap(new Map(flattenTree(cats).map((c)=>[ c.slug, c ]))); setLocMap(new Map(flattenTree(locs).map((l)=>[ l.slug, l ]))); if (u.role === 'specialist' || u.role === 'admin') { getSpecialistCards(id, locale).then((cards)=>{ setSpecialistCards(cards); cards.forEach((c)=>{ getPriceList(c.id, locale).then((pl)=>{ if (pl.length > 0) setPriceLists((prev)=>({ ...prev, [c.id]: pl })); }).catch(()=>{}); }); }).catch(()=>{}); } }).catch(()=>{}).finally(()=>setLoading(false)); }, [ id, locale ]); // Load favorite status when session available useEffect(()=>{ var _session_user; if (!session || !id) return; getSpecialistFavorites().then((rows)=>setIsFavorite(rows.some((r)=>{ var _r_specialist; return ((_r_specialist = r.specialist) === null || _r_specialist === void 0 ? void 0 : _r_specialist.id) === id; }))).catch(()=>{}); // Check if current user can message this person const myId = (_session_user = session.user) === null || _session_user === void 0 ? void 0 : _session_user.id; if (myId && myId !== id) { getCanMessage(id).then(setCanMsg).catch(()=>{}); } }, [ session, id ]); async function toggleFavorite() { if (!session) { router.push('/register'); return; } setFavLoading(true); try { if (isFavorite) { await removeSpecialistFavorite(id); setIsFavorite(false); } else { await addSpecialistFavorite(id); setIsFavorite(true); } } catch (e) {} setFavLoading(false); } async function handleMessage() { if (!session) { router.push('/login'); return; } setMsgLoading(true); try { const { room } = await getOrCreateDirectRoom(id); router.push("/chat?room=".concat(room.id)); } catch (e) {} setMsgLoading(false); } useEffect(()=>{ if (!id) return; const monthKey = "".concat(availYear, "-").concat(String(availMonth + 1).padStart(2, '0')); getSpecialistAvailability(id, monthKey).then((rows)=>{ setAvailMap((prev)=>{ const next = { ...prev }; rows.forEach((r)=>{ next[r.date] = r.status; }); return next; }); }).catch(()=>{}); }, [ id, availYear, availMonth ]); if (loading) return /*#__PURE__*/ _jsx("div", { className: "text-center py-20 text-white", children: t('common.loading') }); if (!user) return /*#__PURE__*/ _jsx("div", { className: "text-center py-20 text-white/70", children: t('common.error') }); var _user_firstName_, _user_lastName_; const initials = "".concat((_user_firstName_ = (_user_firstName = user.firstName) === null || _user_firstName === void 0 ? void 0 : _user_firstName[0]) !== null && _user_firstName_ !== void 0 ? _user_firstName_ : '').concat((_user_lastName_ = (_user_lastName = user.lastName) === null || _user_lastName === void 0 ? void 0 : _user_lastName[0]) !== null && _user_lastName_ !== void 0 ? _user_lastName_ : '').toUpperCase() || ((_user_name = user.name) === null || _user_name === void 0 ? void 0 : (_user_name_ = _user_name[0]) === null || _user_name_ === void 0 ? void 0 : _user_name_.toUpperCase()) || '?'; const displayName = formatShortName(user.firstName, user.lastName, user.name); const profileBackgroundImage = typeof ((_user_siteSettings = user.siteSettings) === null || _user_siteSettings === void 0 ? void 0 : _user_siteSettings.profileBackgroundImage) === 'string' && user.siteSettings.profileBackgroundImage.trim().length > 0 ? user.siteSettings.profileBackgroundImage : null; return /*#__PURE__*/ _jsxs("div", { className: "max-w-3xl mx-auto px-4 py-10", children: [ /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6 mb-6", children: [ /*#__PURE__*/ _jsxs("div", { className: "relative -mx-6 -mt-6 mb-5 h-44 overflow-hidden rounded-t-xl", style: { backgroundImage: profileBackgroundImage ? "linear-gradient(135deg, rgba(21, 128, 61, 0.45), rgba(22, 163, 74, 0.65)), url(".concat(profileBackgroundImage, ")") : 'linear-gradient(135deg, #22c55e 0%, #16a34a 45%, #166534 100%)', backgroundSize: 'cover', backgroundPosition: 'center' }, children: [ /*#__PURE__*/ _jsx("div", { className: "absolute inset-0 bg-gradient-to-b from-black/10 to-black/30" }), /*#__PURE__*/ _jsxs("div", { className: "relative h-full w-full p-5 flex items-end justify-between", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 min-w-0", children: [ /*#__PURE__*/ _jsx("div", { className: "w-14 h-14 rounded-full bg-white/20 border border-white/40 overflow-hidden flex items-center justify-center text-white text-xl font-bold backdrop-blur-sm", children: user.image ? /*#__PURE__*/ _jsx("img", { src: user.image, alt: displayName, className: "w-full h-full object-cover" }) : initials }), /*#__PURE__*/ _jsxs("div", { className: "min-w-0", children: [ /*#__PURE__*/ _jsx("p", { className: "text-white text-lg font-bold truncate", children: displayName }), /*#__PURE__*/ _jsxs("p", { className: "text-white/85 text-xs", children: [ t('profile.member_since'), " ", new Date(user.createdAt).toLocaleDateString(dateLocale) ] }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "shrink-0", children: [ user.planTier && user.planTier !== 'free' && /*#__PURE__*/ _jsx(PlanBadge, { tier: user.planTier, verified: user.hasVerifiedBadge, size: "sm" }), user.hasVerifiedBadge && user.planTier === 'free' && /*#__PURE__*/ _jsx(PlanBadge, { tier: "free", verified: true, size: "sm" }) ] }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-start gap-5", children: [ /*#__PURE__*/ _jsx("div", { className: "w-20 h-20 rounded-full bg-green-100 flex-shrink-0 flex items-center justify-center text-green-700 text-2xl font-bold overflow-hidden border-2 border-gray-100", children: user.image ? /*#__PURE__*/ _jsx("img", { src: user.image, alt: displayName, className: "w-full h-full object-cover" }) : initials }), /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 flex-wrap mb-1", children: [ /*#__PURE__*/ _jsx("h1", { className: "text-xl font-bold text-gray-900", children: displayName }), user.planTier && user.planTier !== 'free' && /*#__PURE__*/ _jsx(PlanBadge, { tier: user.planTier, verified: user.hasVerifiedBadge, size: "sm" }), user.hasVerifiedBadge && user.planTier === 'free' && /*#__PURE__*/ _jsx(PlanBadge, { tier: "free", verified: true, size: "sm" }), Array.isArray(user.activeStatuses) && user.activeStatuses.includes('can_help_now') && /*#__PURE__*/ _jsxs("span", { className: "inline-flex items-center gap-1 text-xs font-medium text-green-700 bg-green-50 border border-green-200 px-2 py-0.5 rounded-full", children: [ /*#__PURE__*/ _jsx("span", { className: "w-1.5 h-1.5 rounded-full bg-green-500 animate-pulse" }), t('status.can_help_now', 'Available now') ] }), Array.isArray(user.activeStatuses) && user.activeStatuses.includes('need_help') && /*#__PURE__*/ _jsxs("span", { className: "inline-flex items-center gap-1 text-xs font-medium text-green-700 bg-green-50 border border-green-200 px-2 py-0.5 rounded-full", children: [ /*#__PURE__*/ _jsx("span", { className: "w-1.5 h-1.5 rounded-full bg-green-500" }), t('status.need_help', 'Need help') ] }), (session ? ((_session_user = session.user) === null || _session_user === void 0 ? void 0 : _session_user.id) !== id : true) && /*#__PURE__*/ _jsxs("div", { className: "ml-auto flex items-center gap-2", children: [ !session ? // Guest — show button that leads to registration /*#__PURE__*/ _jsxs("a", { href: "/register", className: "flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-sm font-medium bg-green-50 text-green-600 border border-green-200 hover:bg-green-100 transition", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }), /*#__PURE__*/ _jsx("span", { children: t('chat.write_btn', 'Write') }) ] }) : (canMsg === null || canMsg === void 0 ? void 0 : canMsg.allowed) === false ? /*#__PURE__*/ _jsx(UpgradePrompt, { feature: t('chat.write_btn', 'Write'), requiredTier: "pro", variant: "inline", t: t }) : /*#__PURE__*/ _jsxs("button", { onClick: handleMessage, disabled: msgLoading, className: "flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-sm font-medium bg-green-50 text-green-600 border border-green-200 hover:bg-green-100 transition disabled:opacity-50", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }), /*#__PURE__*/ _jsx("span", { children: t('chat.write_btn') }) ] }), /*#__PURE__*/ _jsxs("button", { onClick: toggleFavorite, disabled: favLoading, title: isFavorite ? t('specialist.unfavorite') : t('specialist.favorite'), className: "flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-sm font-medium transition disabled:opacity-50 ".concat(isFavorite ? 'bg-pink-50 text-pink-600 border border-pink-200 hover:bg-pink-100' : 'bg-gray-50 text-gray-600 border border-gray-200 hover:bg-gray-100'), children: [ /*#__PURE__*/ _jsx("span", { children: isFavorite ? '❀' : '🀍' }), /*#__PURE__*/ _jsx("span", { children: isFavorite ? t('specialist.unfavorite') : t('specialist.favorite') }) ] }) ] }) ] }), rating && /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-1.5 mb-2", children: [ /*#__PURE__*/ _jsx("span", { className: "text-yellow-400 text-lg", children: "★" }), /*#__PURE__*/ _jsx("span", { className: "font-semibold text-gray-800", children: Number(rating).toFixed(1) }), /*#__PURE__*/ _jsxs("span", { className: "text-sm text-gray-400", children: [ "(", reviews.length, " ", t('profile.reviews').toLowerCase(), ")" ] }) ] }), /*#__PURE__*/ _jsxs("p", { className: "text-sm text-gray-400", children: [ t('profile.member_since'), " ", new Date(user.createdAt).toLocaleDateString(dateLocale), user.lastSeenAt && /*#__PURE__*/ _jsxs("span", { className: "ml-2", children: [ "\xb7 ", formatLastSeen(user.lastSeenAt, t) ] }) ] }) ] }) ] }), user.bio && /*#__PURE__*/ _jsx("p", { className: "mt-4 text-gray-700 text-sm leading-relaxed border-t border-gray-100 pt-4", children: user.bio }), user.phone && /*#__PURE__*/ _jsxs("div", { className: "mt-4 border-t border-gray-100 pt-4 flex items-center gap-2", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M3 5a2 2 0 012-2h3.28a1 1 0 01.948.684l1.498 4.493a1 1 0 01-.502 1.21l-2.257 1.13a11.042 11.042 0 005.516 5.516l1.13-2.257a1 1 0 011.21-.502l4.493 1.498a1 1 0 01.684.949V19a2 2 0 01-2 2h-1C9.716 21 3 14.284 3 6V5z" }) }), /*#__PURE__*/ _jsx("a", { href: "tel:".concat(user.phone), className: "text-sm font-medium text-gray-700 hover:text-green-600", children: user.phone }) ] }), user.personalSiteSlug && /*#__PURE__*/ _jsxs("div", { className: "mt-3 flex items-center gap-2", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _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" }) }), /*#__PURE__*/ _jsxs("a", { href: "/site/".concat(user.personalSiteSlug), target: "_blank", rel: "noopener noreferrer", className: "text-sm text-green-600 hover:underline", children: [ "canhelp.gr/site/", user.personalSiteSlug ] }) ] }), user.languages && user.languages.length > 0 && /*#__PURE__*/ _jsxs("div", { className: "mt-4 border-t border-gray-100 pt-4", children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs font-medium text-gray-500 mb-2 uppercase tracking-wide", children: t('profile.languages') }), /*#__PURE__*/ _jsx("div", { className: "flex flex-wrap gap-2", children: user.languages.map((code)=>{ const langMap = { el: { flag: '🇬🇷', label: 'ΕλληΜικά' }, en: { flag: '🇬🇧', label: 'English' }, ru: { flag: '🇷🇺', label: 'РусскОй' }, uk: { flag: '🇺🇊', label: 'УкраїМська' }, de: { flag: '🇩🇪', label: 'Deutsch' }, fr: { flag: '🇫🇷', label: 'Français' }, it: { flag: '🇮🇹', label: 'Italiano' }, es: { flag: '🇪🇞', label: 'Español' }, ar: { flag: '🇞🇊', label: 'العرؚية' }, zh: { flag: '🇚🇳', label: 'äž­æ–‡' } }; const lang = langMap[code]; if (!lang) return null; return /*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-1.5 bg-indigo-50 text-indigo-700 text-sm px-3 py-1 rounded-full border border-indigo-100", children: [ /*#__PURE__*/ _jsx("span", { children: lang.flag }), /*#__PURE__*/ _jsx("span", { children: lang.label }) ] }, code); }) }) ] }), user.skills && user.skills.length > 0 && specialistCards.length === 0 && /*#__PURE__*/ _jsxs("div", { className: "mt-4 border-t border-gray-100 pt-4", children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs font-medium text-gray-500 mb-2 uppercase tracking-wide", children: t('profile.skills.label') }), /*#__PURE__*/ _jsx("div", { className: "flex flex-wrap gap-2", children: user.skills.map((skill)=>/*#__PURE__*/ _jsx("span", { className: "bg-green-50 text-green-700 text-sm px-3 py-1 rounded-full", children: skill }, skill)) }) ] }), user.role === 'specialist' && user.specialistCategories && user.specialistCategories.length > 0 && specialistCards.length === 0 && /*#__PURE__*/ _jsxs("div", { className: "mt-4 border-t border-gray-100 pt-4", children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs font-medium text-gray-500 mb-2 uppercase tracking-wide", children: t('user.categories') }), /*#__PURE__*/ _jsx("div", { className: "flex flex-wrap gap-2", children: user.specialistCategories.map((slug)=>/*#__PURE__*/ _jsx("span", { className: "bg-purple-50 text-purple-700 text-sm px-3 py-1 rounded-full", children: slug }, slug)) }) ] }), user.role === 'specialist' && user.specialistLocations && user.specialistLocations.length > 0 && specialistCards.length === 0 && /*#__PURE__*/ _jsxs("div", { className: "mt-4 border-t border-gray-100 pt-4", children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs font-medium text-gray-500 mb-2 uppercase tracking-wide", children: t('user.work_area') }), /*#__PURE__*/ _jsx("div", { className: "flex flex-wrap gap-2", children: user.specialistLocations.map((slug)=>/*#__PURE__*/ _jsxs("span", { className: "bg-emerald-50 text-emerald-700 text-sm px-3 py-1 rounded-full", children: [ "\uD83D\uDCCD ", slug ] }, slug)) }) ] }) ] }), user.role === 'specialist' && /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6 mb-6", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between mb-4", children: [ /*#__PURE__*/ _jsxs("h2", { className: "font-bold text-gray-900 text-lg", children: [ "\uD83D\uDCC5 ", t('nav.schedule') ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 text-xs text-gray-500", children: [ /*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-1.5", children: [ /*#__PURE__*/ _jsx("span", { className: "w-3 h-3 rounded bg-emerald-200 border border-emerald-400 inline-block" }), t('schedule.available') ] }), /*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-1.5", children: [ /*#__PURE__*/ _jsx("span", { className: "w-3 h-3 rounded bg-red-200 border border-red-400 inline-block" }), t('schedule.busy') ] }) ] }) ] }), /*#__PURE__*/ _jsx(ReadOnlyCalendar, { year: availYear, month: availMonth, availMap: availMap, today: today, onPrev: ()=>{ if (availMonth === 0) { setAvailYear((y)=>y - 1); setAvailMonth(11); } else setAvailMonth((m)=>m - 1); }, onNext: ()=>{ if (availMonth === 11) { setAvailYear((y)=>y + 1); setAvailMonth(0); } else setAvailMonth((m)=>m + 1); } }) ] }), (user.role === 'specialist' || user.role === 'admin') && specialistCards.length > 0 && /*#__PURE__*/ _jsxs("div", { className: "space-y-4 mb-6", children: [ /*#__PURE__*/ _jsx("h2", { className: "font-bold text-white text-lg", children: t('nav.specialists') }), specialistCards.map((card)=>{ var _priceLists_card_id; return /*#__PURE__*/ _jsx(PublicCardView, { card: card, locale: locale, catMap: catMap, locMap: locMap, t: t, priceList: (_priceLists_card_id = priceLists[card.id]) !== null && _priceLists_card_id !== void 0 ? _priceLists_card_id : [] }, card.id); }) ] }), /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ _jsxs("h2", { className: "font-bold text-gray-900 text-lg mb-4", children: [ t('profile.reviews'), reviews.length > 0 && /*#__PURE__*/ _jsxs("span", { className: "text-gray-400 font-normal text-base ml-2", children: [ "(", reviews.length, ")" ] }) ] }), reviews.length === 0 ? /*#__PURE__*/ _jsx("p", { className: "text-gray-500 text-sm", children: t('profile.no_reviews') }) : /*#__PURE__*/ _jsx("div", { className: "space-y-4", children: reviews.map((param)=>{ let { review, author } = param; var _author_name_, _author_name; var _author_name__toUpperCase, _shortName; return /*#__PURE__*/ _jsx("div", { className: "border-b border-gray-50 pb-4 last:border-0 last:pb-0", children: /*#__PURE__*/ _jsxs("div", { className: "flex items-start gap-3", children: [ /*#__PURE__*/ _jsx("div", { className: "w-8 h-8 rounded-full bg-gray-100 flex-shrink-0 flex items-center justify-center text-gray-600 text-sm font-bold overflow-hidden", children: (author === null || author === void 0 ? void 0 : author.image) ? /*#__PURE__*/ _jsx("img", { src: author.image, alt: author.name, className: "w-full h-full object-cover" }) : (_author_name__toUpperCase = author === null || author === void 0 ? void 0 : (_author_name = author.name) === null || _author_name === void 0 ? void 0 : (_author_name_ = _author_name[0]) === null || _author_name_ === void 0 ? void 0 : _author_name_.toUpperCase()) !== null && _author_name__toUpperCase !== void 0 ? _author_name__toUpperCase : '?' }), /*#__PURE__*/ _jsxs("div", { className: "flex-1", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 mb-1", children: [ /*#__PURE__*/ _jsx("span", { className: "text-sm font-medium text-gray-800", children: (_shortName = shortName(author === null || author === void 0 ? void 0 : author.name)) !== null && _shortName !== void 0 ? _shortName : '—' }), /*#__PURE__*/ _jsxs("span", { className: "text-yellow-400", children: [ '★'.repeat(review.rating), '☆'.repeat(5 - review.rating) ] }) ] }), review.comment && /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-600", children: review.comment }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-1", children: new Date(review.createdAt).toLocaleDateString(dateLocale) }) ] }) ] }) }, review.id); }) }) ] }) ] }); } function ReadOnlyCalendar(param) { let { year, month, availMap, today, onPrev, onNext } = param; const { locale, t } = useLocale(); var _WEEK_DAYS_BY_LOCALE_locale; const weekDays = (_WEEK_DAYS_BY_LOCALE_locale = WEEK_DAYS_BY_LOCALE[locale]) !== null && _WEEK_DAYS_BY_LOCALE_locale !== void 0 ? _WEEK_DAYS_BY_LOCALE_locale : WEEK_DAYS_BY_LOCALE.ru; var _MONTHS_BY_LOCALE_locale; const months = (_MONTHS_BY_LOCALE_locale = MONTHS_BY_LOCALE[locale]) !== null && _MONTHS_BY_LOCALE_locale !== void 0 ? _MONTHS_BY_LOCALE_locale : MONTHS_BY_LOCALE.ru; const firstDay = new Date(year, month, 1); const startDow = (firstDay.getDay() + 6) % 7; const daysInMonth = new Date(year, month + 1, 0).getDate(); const prevMonthDays = new Date(year, month, 0).getDate(); const cells = []; for(let i = startDow - 1; i >= 0; i--){ cells.push({ day: prevMonthDays - i, cur: false, dateKey: '' }); } for(let d = 1; d <= daysInMonth; d++){ const dateKey = "".concat(year, "-").concat(String(month + 1).padStart(2, '0'), "-").concat(String(d).padStart(2, '0')); cells.push({ day: d, cur: true, dateKey }); } const remainder = cells.length % 7; if (remainder !== 0) { for(let d = 1; d <= 7 - remainder; d++){ cells.push({ day: d, cur: false, dateKey: '' }); } } const monthPrefix = "".concat(year, "-").concat(String(month + 1).padStart(2, '0')); const availCount = Object.entries(availMap).filter((param)=>{ let [k, v] = param; return k.startsWith(monthPrefix) && k >= today && v === 'available'; }).length; return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between mb-3", children: [ /*#__PURE__*/ _jsx("button", { onClick: onPrev, className: "w-7 h-7 rounded-lg hover:bg-gray-100 flex items-center justify-center text-gray-500", children: "‹" }), /*#__PURE__*/ _jsxs("div", { className: "text-center", children: [ /*#__PURE__*/ _jsxs("span", { className: "font-medium text-gray-800 text-sm", children: [ months[month], " ", year ] }), availCount > 0 && /*#__PURE__*/ _jsxs("span", { className: "ml-2 text-xs text-emerald-600", children: [ availCount, " ", t('schedule.free_days') ] }) ] }), /*#__PURE__*/ _jsx("button", { onClick: onNext, className: "w-7 h-7 rounded-lg hover:bg-gray-100 flex items-center justify-center text-gray-500", children: "›" }) ] }), /*#__PURE__*/ _jsx("div", { className: "grid grid-cols-7 mb-1", children: weekDays.map((d)=>/*#__PURE__*/ _jsx("div", { className: "text-center text-xs text-gray-400 py-1", children: d }, d)) }), /*#__PURE__*/ _jsx("div", { className: "grid grid-cols-7 gap-0.5", children: cells.map((cell, idx)=>{ if (!cell.cur) { return /*#__PURE__*/ _jsx("div", { className: "h-9 flex items-center justify-center text-xs text-gray-200", children: cell.day }, "e-".concat(idx)); } const status = availMap[cell.dateKey]; const isPast = cell.dateKey < today; const isToday = cell.dateKey === today; let cls = 'h-9 flex items-center justify-center rounded-lg text-sm font-medium '; if (isPast) { cls += 'text-gray-200 '; } else if (status === 'available') { cls += 'bg-emerald-100 border border-emerald-300 text-emerald-700 '; } else if (status === 'busy') { cls += 'bg-red-100 border border-red-300 text-red-600 '; } else { cls += 'text-gray-500 '; } if (isToday) cls += 'ring-2 ring-blue-400 ring-offset-1 '; return /*#__PURE__*/ _jsx("div", { className: cls, children: cell.day }, cell.dateKey); }) }) ] }); } // ─── Public card view ───────────────────────────────────────────────────────── function flattenTree(nodes) { return nodes.flatMap((n)=>{ var _n_children; return [ n, ...flattenTree((_n_children = n.children) !== null && _n_children !== void 0 ? _n_children : []) ]; }); } function PublicCardView(param) { let { card, locale, catMap, locMap, t, priceList } = param; const [lightbox, setLightbox] = useState(null); const [expandedAreas, setExpandedAreas] = useState([]); const locById = new Map(); for (const node of locMap.values()){ if (node === null || node === void 0 ? void 0 : node.id) locById.set(node.id, node); } const getLocName = (loc, fallback)=>{ var _loc_names, _loc_names1; return (loc === null || loc === void 0 ? void 0 : (_loc_names = loc.names) === null || _loc_names === void 0 ? void 0 : _loc_names[locale]) || (loc === null || loc === void 0 ? void 0 : (_loc_names1 = loc.names) === null || _loc_names1 === void 0 ? void 0 : _loc_names1.el) || fallback; }; const locationGroups = (()=>{ const grouped = new Map(); var _card_locations; for (const slug of (_card_locations = card.locations) !== null && _card_locations !== void 0 ? _card_locations : []){ const loc = locMap.get(slug); if (!loc) { if (!grouped.has(slug)) { grouped.set(slug, { root: { slug, names: { el: slug } }, rootSlug: slug, districts: [], districtSlugs: new Set() }); } continue; } let root = loc; const seenIds = new Set(); while((root === null || root === void 0 ? void 0 : root.parentId) && locById.has(root.parentId) && !seenIds.has(root.parentId)){ seenIds.add(root.parentId); root = locById.get(root.parentId); } var _root_slug; const rootSlug = (_root_slug = root === null || root === void 0 ? void 0 : root.slug) !== null && _root_slug !== void 0 ? _root_slug : slug; if (!grouped.has(rootSlug)) { grouped.set(rootSlug, { root, rootSlug, districts: [], districtSlugs: new Set() }); } const group = grouped.get(rootSlug); if (loc.slug !== rootSlug && !group.districtSlugs.has(loc.slug)) { group.districtSlugs.add(loc.slug); group.districts.push(loc); } } return Array.from(grouped.values()); })(); var _lightbox_title; return /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 overflow-hidden", children: [ /*#__PURE__*/ _jsxs("div", { className: "px-5 py-4 border-b border-gray-100", children: [ /*#__PURE__*/ _jsx("h3", { className: "font-bold text-gray-900", children: card.title }), card.description && /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-600 mt-1", children: card.description }) ] }), /*#__PURE__*/ _jsxs("div", { className: "p-5 space-y-4", children: [ card.skills && card.skills.length > 0 && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs font-semibold text-gray-500 uppercase tracking-wide mb-2", children: t('card.skills') }), /*#__PURE__*/ _jsx("div", { className: "flex flex-wrap gap-2", children: card.skills.map((s)=>/*#__PURE__*/ _jsx("span", { className: "bg-green-50 text-green-700 text-sm px-3 py-1 rounded-full", children: s }, s)) }) ] }), card.categories && card.categories.length > 0 && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs font-semibold text-gray-500 uppercase tracking-wide mb-2", children: t('card.categories') }), /*#__PURE__*/ _jsx("div", { className: "flex flex-wrap gap-2", children: card.categories.map((s)=>{ var _cat_names, _cat_names1; const cat = catMap.get(s); const name = cat ? ((_cat_names = cat.names) === null || _cat_names === void 0 ? void 0 : _cat_names[locale]) || ((_cat_names1 = cat.names) === null || _cat_names1 === void 0 ? void 0 : _cat_names1.el) || s : s; return /*#__PURE__*/ _jsxs("span", { className: "bg-purple-50 text-purple-700 text-sm px-3 py-1 rounded-full", children: [ (cat === null || cat === void 0 ? void 0 : cat.icon) ? /*#__PURE__*/ _jsx("span", { className: "mr-1 inline-flex align-middle", children: /*#__PURE__*/ _jsx(CategoryIcon, { icon: cat.icon, alt: name, className: isCategoryIconUrl(cat.icon) ? 'h-4 w-4 object-contain' : 'text-sm leading-none', fallback: "\uD83D\uDCE6" }) }) : null, name ] }, s); }) }) ] }), card.locations && card.locations.length > 0 && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs font-semibold text-gray-500 uppercase tracking-wide mb-2", children: t('user.work_area') }), /*#__PURE__*/ _jsxs("div", { className: "space-y-2", children: [ /*#__PURE__*/ _jsx("div", { className: "flex flex-wrap gap-2", children: locationGroups.map((group)=>{ const expanded = expandedAreas.includes(group.rootSlug); const canExpand = group.districts.length > 0; return /*#__PURE__*/ _jsxs("button", { type: "button", onClick: ()=>{ if (!canExpand) return; setExpandedAreas((prev)=>prev.includes(group.rootSlug) ? prev.filter((slug)=>slug !== group.rootSlug) : [ ...prev, group.rootSlug ]); }, className: "inline-flex items-center gap-1.5 text-sm px-3 py-1.5 rounded-full border transition ".concat(expanded ? 'bg-emerald-100 text-emerald-800 border-emerald-300' : 'bg-emerald-50 text-emerald-700 border-emerald-200 hover:bg-emerald-100', " ").concat(canExpand ? 'cursor-pointer' : 'cursor-default'), children: [ /*#__PURE__*/ _jsx("span", { children: "\uD83D\uDCCD" }), /*#__PURE__*/ _jsx("span", { children: getLocName(group.root, group.rootSlug) }), canExpand && /*#__PURE__*/ _jsx("span", { className: "text-[11px] font-semibold px-1.5 py-0.5 rounded-full bg-white/80 text-emerald-700 border border-emerald-200", children: expanded ? '−' : "+".concat(group.districts.length) }) ] }, group.rootSlug); }) }), locationGroups.filter((group)=>expandedAreas.includes(group.rootSlug) && group.districts.length > 0).map((group)=>/*#__PURE__*/ _jsxs("div", { className: "rounded-xl border border-emerald-100 bg-emerald-50/40 p-3", children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs text-emerald-700 font-medium mb-2", children: getLocName(group.root, group.rootSlug) }), /*#__PURE__*/ _jsx("div", { className: "flex flex-wrap gap-1.5", children: group.districts.map((district)=>/*#__PURE__*/ _jsx("span", { className: "text-xs px-2.5 py-1 rounded-full bg-white border border-emerald-200 text-emerald-700", children: getLocName(district, district.slug) }, district.slug)) }) ] }, "".concat(group.rootSlug, "-children"))) ] }) ] }), priceList.length > 0 && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs font-semibold text-gray-500 uppercase tracking-wide mb-3", children: t('profile.card.tab.pricelist') }), /*#__PURE__*/ _jsx("div", { className: "space-y-3", children: priceList.map((group)=>/*#__PURE__*/ _jsxs("div", { className: "border border-gray-200 rounded-xl overflow-hidden", children: [ /*#__PURE__*/ _jsx("div", { className: "bg-gray-50 px-4 py-2 border-b border-gray-200", children: /*#__PURE__*/ _jsx("span", { className: "font-semibold text-sm text-gray-800", children: group.title }) }), /*#__PURE__*/ _jsx("div", { className: "divide-y divide-gray-100", children: group.items.map((item)=>/*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 px-4 py-2.5 text-sm", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ _jsx("p", { className: "font-medium text-gray-800", children: item.name }), item.description && /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-500", children: item.description }) ] }), (item.price || item.unit) && /*#__PURE__*/ _jsxs("span", { className: "text-green-700 font-semibold whitespace-nowrap", children: [ item.price ? "€".concat(item.price) : '', item.unit ? " ".concat(item.unit) : '' ] }) ] }, item.id)) }) ] }, group.id)) }) ] }), card.portfolio && card.portfolio.length > 0 && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs font-semibold text-gray-500 uppercase tracking-wide mb-2", children: t('card.portfolio') }), /*#__PURE__*/ _jsx("div", { className: "grid grid-cols-2 sm:grid-cols-3 gap-3", children: card.portfolio.map((item)=>{ var _item_title; return /*#__PURE__*/ _jsxs("button", { type: "button", onClick: ()=>setLightbox(item), className: "group relative rounded-xl overflow-hidden border border-gray-200 bg-gray-50 text-left", children: [ /*#__PURE__*/ _jsx("img", { src: item.imageUrl, alt: (_item_title = item.title) !== null && _item_title !== void 0 ? _item_title : '', className: "w-full aspect-square object-cover group-hover:scale-105 transition-transform duration-200" }), item.title && /*#__PURE__*/ _jsx("div", { className: "px-2 py-1.5", children: /*#__PURE__*/ _jsx("p", { className: "text-xs font-medium text-gray-700 truncate", children: item.title }) }) ] }, item.id); }) }) ] }) ] }), lightbox && /*#__PURE__*/ _jsx("div", { className: "fixed inset-0 z-50 flex items-center justify-center bg-black/80 px-4", onClick: ()=>setLightbox(null), children: /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-2xl overflow-hidden max-w-lg w-full shadow-2xl", onClick: (e)=>e.stopPropagation(), children: [ /*#__PURE__*/ _jsx("img", { src: lightbox.imageUrl, alt: (_lightbox_title = lightbox.title) !== null && _lightbox_title !== void 0 ? _lightbox_title : '', className: "w-full max-h-[60vh] object-contain bg-gray-900" }), (lightbox.title || lightbox.description) && /*#__PURE__*/ _jsxs("div", { className: "p-4", children: [ lightbox.title && /*#__PURE__*/ _jsx("p", { className: "font-semibold text-gray-800 mb-1", children: lightbox.title }), lightbox.description && /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-600", children: lightbox.description }) ] }), /*#__PURE__*/ _jsx("div", { className: "flex justify-end px-4 pb-4", children: /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setLightbox(null), className: "text-sm text-gray-500 hover:text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-100", children: t('card.close') }) }) ] }) }) ] }); } @ãb={}_šªàâ79KM‡‰ÆÈýÿ13~M [ ñ ù  C L d l  ” ¿ _Æ í ô  & a h — ž Å Ì ú  7 > p w © ° Ú á @ G … Œ Ã Ê ‚ŠÍÚõ_!4@_jpf{MY–­Znìô™=@ÐÓå_ók!o!Û!ß!z"~"ã$æ$€%š%y&}&L'O'†(‰(#*'*ö*ù*6,:,E/I/.01030;0°1³1µ1_œ13”3*4-4I5L5†6Š60747 8 8R9U9W9_9Ô:×:Ù:á:_<c<ª=­=·?»?AA&C*C‚D_†DDFGFNHQHÊJÍJMLPLRL^LÞMâM PPRR’T•TòUöUþXYúYýY5\9\] ]^^;__?_b bœcÁcœdÊd3f6f!g%gßgâg@iCi4k7k§l«lGmJmšn«npp“r—r9s€B€ü€ÿ€IŠLŠ"©&©è©ì©Üªßª««³«ª¬®¬H¯K¯k°n°2³:³Ä¹È¹ºº“º–º§»«»6Œ_:ŒÅœÉœw¿z¿€À§À Á#ÁäÁçÁ®Â±ÂôÆ÷ÆÉˆÉ¿ÉÆÉQÓUÓßÓãÓmÔpÔ3Õ6ÕÖ ÖšÖ¬Ö×_רأ؊Ø%Ú)ڂڅچۉÛÍÝÑÝôÞ÷ާߪ߬߷ß~àŽàÑâÕâ.ã1ã1ä5äÖäÙäæƒæÚê_ÝêŽë·ë³ì¶ìŠïŽïƒð†ðÒñÕñ¥òšòjõnõÇõÊõÖöÙök÷o÷PøSøùùnúqú3û7ûBüFüLý_OýÒþÕþÝឌ/3»Ÿ£ Š C F } € FJ47¿Ãdgjm„B‡ €€€€€€€€€€€€×__WEBPACK_MODULE_REFERENCE__2_5b22757365506172616d73225d_call_directImport_asiSafe1__._×__WEBPACK_MODULE_REFERENCE__3_5b227573654c6f63616c65225d_call_directImport_asiSafe1__._Ù__WEBPACK_MODULE_REFERENCE__4_5b2275736553657373696f6e225d_call_directImport_asiSafe1__._×__WEBPACK_MODULE_REFERENCE__2_5b22757365526f75746572225d_call_directImport_asiSafe1__._Õ__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._ÿÿÿÿÿÿÿÿÿÿÿÿÿÿ×__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._á__WEBPACK_MODULE_REFERENCE__5_5b226765745573657250726f66696c65225d_call_directImport_asiSafe1__._á__WEBPACK_MODULE_REFERENCE__5_5b226765745573657252657669657773225d_call_directImport_asiSafe1__._ß__WEBPACK_MODULE_REFERENCE__5_5b2267657455736572526174696e67225d_call_directImport_asiSafe1__._ß__WEBPACK_MODULE_REFERENCE__5_5b2267657443617465676f72696573225d_call_directImport_asiSafe1__._Ý__WEBPACK_MODULE_REFERENCE__5_5b226765744c6f636174696f6e73225d_call_directImport_asiSafe1__._é__WEBPACK_MODULE_REFERENCE__5_5b226765745370656369616c6973744361726473225d_call_directImport_asiSafe1__._Ý__WEBPACK_MODULE_REFERENCE__5_5b2267657450726963654c697374225d_call_directImport_asiSafe1__._øñ__WEBPACK_MODULE_REFERENCE__5_5b226765745370656369616c6973744661766f7269746573225d_call_directImport_asiSafe1__._ß__WEBPACK_MODULE_REFERENCE__5_5b2267657443616e4d657373616765225d_call_directImport_asiSafe1__._õ__WEBPACK_MODULE_REFERENCE__5_5b2272656d6f76655370656369616c6973744661766f72697465225d_call_directImport_asiSafe1__._ï__WEBPACK_MODULE_REFERENCE__5_5b226164645370656369616c6973744661766f72697465225d_call_directImport_asiSafe1__._ï__WEBPACK_MODULE_REFERENCE__5_5b226765744f72437265617465446972656374526f6f6d225d_call_directImport_asiSafe1__._ó÷__WEBPACK_MODULE_REFERENCE__5_5b226765745370656369616c697374417661696c6162696c697479225d_call_directImport_asiSafe1__._Ë__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._ÿã__WEBPACK_MODULE_REFERENCE__8_5b22666f726d617453686f72744e616d65225d_call_directImport_asiSafe1__._Í__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._ÿÿýÿÿýýÿýÿÿýÓ__WEBPACK_MODULE_REFERENCE__10_5b22506c616e4261646765225d_directImport_asiSafe1__._üÿþüüþþüüÿüÿþüþüþþüüüüÚ__WEBPACK_MODULE_REFERENCE__7_5b225570677261646550726f6d7074225d_directImport_asiSafe1__._ýûûûýûûýûûýýýá__WEBPACK_MODULE_REFERENCE__9_5b22666f726d61744c6173745365656e225d_call_directImport_asiSafe1__._úüúúúüúúüüúúüúúüúúúüúúúüúúüüüüüüúüúúüúúüüüúúúüúúüüú×__WEBPACK_MODULE_REFERENCE__8_5b2273686f72744e616d65225d_call_directImport_asiSafe1__._ûùùçûûùûûûùùùùùùêêûûùùûûùùùûùùûùùÙ__WEBPACK_MODULE_REFERENCE__11_5b2243617465676f727949636f6e225d_directImport_asiSafe1__._è__WEBPACK_MODULE_REFERENCE__11_5b22697343617465676f727949636f6e55726c225d_call_directImport_asiSafe1__._ù÷ù÷ù÷÷÷ù÷÷÷ù÷÷ù÷÷÷ùù÷÷ùù÷÷ù÷÷÷÷ù÷ù÷÷÷÷ìR/* __next_internal_client_entry_do_not_use__ default auto */ const MONTHS_BY_LOCALE = { ru: [ 'ЯМварь', 'Ѐевраль', 'Март', 'Апрель', 'Май', 'ИюМь', 'Июль', 'Август', 'СеМтябрь', 'Октябрь', 'НПябрь', 'Декабрь' ], en: [ 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December' ], el: [ 'ΙαΜουάριος', 'Ίεβρουάριος', 'Μάρτιος', 'Απρίλιος', 'Μάιος', 'ΙούΜιος', 'Ιούλιος', 'Αύγουστος', 'ΣεπτέΌβριος', 'Οκτώβριος', 'ΝοέΌβριος', 'ΔεκέΌβριος' ], uk: [ 'СічеМь', 'ЛютОй', 'БерезеМь', 'КвітеМь', 'ТравеМь', 'ЧервеМь', 'ЛОпеМь', 'СерпеМь', 'ВересеМь', 'ЖПвтеМь', 'ЛОстПпаЎ', 'ГруЎеМь' ] }; const WEEK_DAYS_BY_LOCALE = { ru: [ 'ПМ', 'Вт', 'Ср', 'Чт', 'Пт', 'Сб', 'Вс' ], en: [ 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa', 'Su' ], el: [ 'Δε', '΀ρ', '΀ε', 'Πε', 'Πα', 'Σά', 'Κυ' ], uk: [ 'ПМ', 'Вт', 'Ср', 'Чт', 'Пт', 'Сб', 'НЎ' ] }; function UserProfilePage() { var _user_firstName, _user_lastName, _user_name_, _user_name, _user_siteSettings, _session_user; const { id } = __WEBPACK_MODULE_REFERENCE__2_5b22757365506172616d73225d_call_directImport_asiSafe1__._(); const { t, locale } = __WEBPACK_MODULE_REFERENCE__3_5b227573654c6f63616c65225d_call_directImport_asiSafe1__._(); const { data: session } = __WEBPACK_MODULE_REFERENCE__4_5b2275736553657373696f6e225d_call_directImport_asiSafe1__._(); const router = __WEBPACK_MODULE_REFERENCE__2_5b22757365526f75746572225d_call_directImport_asiSafe1__._(); const [user, setUser] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._(null); const [reviews, setReviews] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._([]); const [rating, setRating] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._(null); const [loading, setLoading] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._(true); const [specialistCards, setSpecialistCards] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._([]); const [priceLists, setPriceLists] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._({}); const [catMap, setCatMap] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._(new Map()); const [locMap, setLocMap] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._(new Map()); const [isFavorite, setIsFavorite] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._(false); const [favLoading, setFavLoading] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._(false); const [msgLoading, setMsgLoading] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._(false); const [canMsg, setCanMsg] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._(null); // Availability const now = new Date(); const [availYear, setAvailYear] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._(now.getFullYear()); const [availMonth, setAvailMonth] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._(now.getMonth()); const [availMap, setAvailMap] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._({}); const today = new Date().toISOString().slice(0, 10); const dateLocale = locale === 'ru' ? 'ru-RU' : locale === 'uk' ? 'uk-UA' : locale === 'en' ? 'en-US' : 'el-GR'; __WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._(()=>{ if (!id) return; Promise.all([ __WEBPACK_MODULE_REFERENCE__5_5b226765745573657250726f66696c65225d_call_directImport_asiSafe1__._(id, locale), __WEBPACK_MODULE_REFERENCE__5_5b226765745573657252657669657773225d_call_directImport_asiSafe1__._(id), __WEBPACK_MODULE_REFERENCE__5_5b2267657455736572526174696e67225d_call_directImport_asiSafe1__._(id), __WEBPACK_MODULE_REFERENCE__5_5b2267657443617465676f72696573225d_call_directImport_asiSafe1__._().catch(()=>[]), __WEBPACK_MODULE_REFERENCE__5_5b226765744c6f636174696f6e73225d_call_directImport_asiSafe1__._().catch(()=>[]) ]).then((param)=>{ let [u, r, rt, cats, locs] = param; setUser(u); setReviews(r); setRating(rt.avg); setCatMap(new Map(flattenTree(cats).map((c)=>[ c.slug, c ]))); setLocMap(new Map(flattenTree(locs).map((l)=>[ l.slug, l ]))); if (u.role === 'specialist' || u.role === 'admin') { __WEBPACK_MODULE_REFERENCE__5_5b226765745370656369616c6973744361726473225d_call_directImport_asiSafe1__._(id, locale).then((cards)=>{ setSpecialistCards(cards); cards.forEach((c)=>{ __WEBPACK_MODULE_REFERENCE__5_5b2267657450726963654c697374225d_call_directImport_asiSafe1__._(c.id, locale).then((pl)=>{ if (pl.length > 0) setPriceLists((prev)=>({ ...prev, [c.id]: pl })); }).catch(()=>{}); }); }).catch(()=>{}); } }).catch(()=>{}).finally(()=>setLoading(false)); }, [ id, locale ]); // Load favorite status when session available __WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._(()=>{ var _session_user; if (!session || !id) return; __WEBPACK_MODULE_REFERENCE__5_5b226765745370656369616c6973744661766f7269746573225d_call_directImport_asiSafe1__._().then((rows)=>setIsFavorite(rows.some((r)=>{ var _r_specialist; return ((_r_specialist = r.specialist) === null || _r_specialist === void 0 ? void 0 : _r_specialist.id) === id; }))).catch(()=>{}); // Check if current user can message this person const myId = (_session_user = session.user) === null || _session_user === void 0 ? void 0 : _session_user.id; if (myId && myId !== id) { __WEBPACK_MODULE_REFERENCE__5_5b2267657443616e4d657373616765225d_call_directImport_asiSafe1__._(id).then(setCanMsg).catch(()=>{}); } }, [ session, id ]); async function toggleFavorite() { if (!session) { router.push('/register'); return; } setFavLoading(true); try { if (isFavorite) { await __WEBPACK_MODULE_REFERENCE__5_5b2272656d6f76655370656369616c6973744661766f72697465225d_call_directImport_asiSafe1__._(id); setIsFavorite(false); } else { await __WEBPACK_MODULE_REFERENCE__5_5b226164645370656369616c6973744661766f72697465225d_call_directImport_asiSafe1__._(id); setIsFavorite(true); } } catch (e) {} setFavLoading(false); } async function handleMessage() { if (!session) { router.push('/login'); return; } setMsgLoading(true); try { const { room } = await __WEBPACK_MODULE_REFERENCE__5_5b226765744f72437265617465446972656374526f6f6d225d_call_directImport_asiSafe1__._(id); router.push("/chat?room=".concat(room.id)); } catch (e) {} setMsgLoading(false); } __WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._(()=>{ if (!id) return; const monthKey = "".concat(availYear, "-").concat(String(availMonth + 1).padStart(2, '0')); __WEBPACK_MODULE_REFERENCE__5_5b226765745370656369616c697374417661696c6162696c697479225d_call_directImport_asiSafe1__._(id, monthKey).then((rows)=>{ setAvailMap((prev)=>{ const next = { ...prev }; rows.forEach((r)=>{ next[r.date] = r.status; }); return next; }); }).catch(()=>{}); }, [ id, availYear, availMonth ]); if (loading) return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "text-center py-20 text-white", children: t('common.loading') }); if (!user) return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "text-center py-20 text-white/70", children: t('common.error') }); var _user_firstName_, _user_lastName_; const initials = "".concat((_user_firstName_ = (_user_firstName = user.firstName) === null || _user_firstName === void 0 ? void 0 : _user_firstName[0]) !== null && _user_firstName_ !== void 0 ? _user_firstName_ : '').concat((_user_lastName_ = (_user_lastName = user.lastName) === null || _user_lastName === void 0 ? void 0 : _user_lastName[0]) !== null && _user_lastName_ !== void 0 ? _user_lastName_ : '').toUpperCase() || ((_user_name = user.name) === null || _user_name === void 0 ? void 0 : (_user_name_ = _user_name[0]) === null || _user_name_ === void 0 ? void 0 : _user_name_.toUpperCase()) || '?'; const displayName = __WEBPACK_MODULE_REFERENCE__8_5b22666f726d617453686f72744e616d65225d_call_directImport_asiSafe1__._(user.firstName, user.lastName, user.name); const profileBackgroundImage = typeof ((_user_siteSettings = user.siteSettings) === null || _user_siteSettings === void 0 ? void 0 : _user_siteSettings.profileBackgroundImage) === 'string' && user.siteSettings.profileBackgroundImage.trim().length > 0 ? user.siteSettings.profileBackgroundImage : null; return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "max-w-3xl mx-auto px-4 py-10", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "bg-white rounded-xl border border-gray-200 p-6 mb-6", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "relative -mx-6 -mt-6 mb-5 h-44 overflow-hidden rounded-t-xl", style: { backgroundImage: profileBackgroundImage ? "linear-gradient(135deg, rgba(21, 128, 61, 0.45), rgba(22, 163, 74, 0.65)), url(".concat(profileBackgroundImage, ")") : 'linear-gradient(135deg, #22c55e 0%, #16a34a 45%, #166534 100%)', backgroundSize: 'cover', backgroundPosition: 'center' }, children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "absolute inset-0 bg-gradient-to-b from-black/10 to-black/30" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "relative h-full w-full p-5 flex items-end justify-between", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "flex items-center gap-3 min-w-0", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "w-14 h-14 rounded-full bg-white/20 border border-white/40 overflow-hidden flex items-center justify-center text-white text-xl font-bold backdrop-blur-sm", children: user.image ? /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("img", { src: user.image, alt: displayName, className: "w-full h-full object-cover" }) : initials }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "min-w-0", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { className: "text-white text-lg font-bold truncate", children: displayName }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("p", { className: "text-white/85 text-xs", children: [ t('profile.member_since'), " ", new Date(user.createdAt).toLocaleDateString(dateLocale) ] }) ] }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "shrink-0", children: [ user.planTier && user.planTier !== 'free' && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__10_5b22506c616e4261646765225d_directImport_asiSafe1__._, { tier: user.planTier, verified: user.hasVerifiedBadge, size: "sm" }), user.hasVerifiedBadge && user.planTier === 'free' && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__10_5b22506c616e4261646765225d_directImport_asiSafe1__._, { tier: "free", verified: true, size: "sm" }) ] }) ] }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "flex items-start gap-5", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "w-20 h-20 rounded-full bg-green-100 flex-shrink-0 flex items-center justify-center text-green-700 text-2xl font-bold overflow-hidden border-2 border-gray-100", children: user.image ? /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("img", { src: user.image, alt: displayName, className: "w-full h-full object-cover" }) : initials }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "flex items-center gap-2 flex-wrap mb-1", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("h1", { className: "text-xl font-bold text-gray-900", children: displayName }), user.planTier && user.planTier !== 'free' && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__10_5b22506c616e4261646765225d_directImport_asiSafe1__._, { tier: user.planTier, verified: user.hasVerifiedBadge, size: "sm" }), user.hasVerifiedBadge && user.planTier === 'free' && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__10_5b22506c616e4261646765225d_directImport_asiSafe1__._, { tier: "free", verified: true, size: "sm" }), Array.isArray(user.activeStatuses) && user.activeStatuses.includes('can_help_now') && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("span", { className: "inline-flex items-center gap-1 text-xs font-medium text-green-700 bg-green-50 border border-green-200 px-2 py-0.5 rounded-full", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { className: "w-1.5 h-1.5 rounded-full bg-green-500 animate-pulse" }), t('status.can_help_now', 'Available now') ] }), Array.isArray(user.activeStatuses) && user.activeStatuses.includes('need_help') && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("span", { className: "inline-flex items-center gap-1 text-xs font-medium text-green-700 bg-green-50 border border-green-200 px-2 py-0.5 rounded-full", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { className: "w-1.5 h-1.5 rounded-full bg-green-500" }), t('status.need_help', 'Need help') ] }), (session ? ((_session_user = session.user) === null || _session_user === void 0 ? void 0 : _session_user.id) !== id : true) && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "ml-auto flex items-center gap-2", children: [ !session ? // Guest — show button that leads to registration /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("a", { href: "/register", className: "flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-sm font-medium bg-green-50 text-green-600 border border-green-200 hover:bg-green-100 transition", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { children: t('chat.write_btn', 'Write') }) ] }) : (canMsg === null || canMsg === void 0 ? void 0 : canMsg.allowed) === false ? /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__7_5b225570677261646550726f6d7074225d_directImport_asiSafe1__._, { feature: t('chat.write_btn', 'Write'), requiredTier: "pro", variant: "inline", t: t }) : /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("button", { onClick: handleMessage, disabled: msgLoading, className: "flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-sm font-medium bg-green-50 text-green-600 border border-green-200 hover:bg-green-100 transition disabled:opacity-50", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { children: t('chat.write_btn') }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("button", { onClick: toggleFavorite, disabled: favLoading, title: isFavorite ? t('specialist.unfavorite') : t('specialist.favorite'), className: "flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-sm font-medium transition disabled:opacity-50 ".concat(isFavorite ? 'bg-pink-50 text-pink-600 border border-pink-200 hover:bg-pink-100' : 'bg-gray-50 text-gray-600 border border-gray-200 hover:bg-gray-100'), children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { children: isFavorite ? '❀' : '🀍' }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { children: isFavorite ? t('specialist.unfavorite') : t('specialist.favorite') }) ] }) ] }) ] }), rating && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "flex items-center gap-1.5 mb-2", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { className: "text-yellow-400 text-lg", children: "★" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { className: "font-semibold text-gray-800", children: Number(rating).toFixed(1) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("span", { className: "text-sm text-gray-400", children: [ "(", reviews.length, " ", t('profile.reviews').toLowerCase(), ")" ] }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("p", { className: "text-sm text-gray-400", children: [ t('profile.member_since'), " ", new Date(user.createdAt).toLocaleDateString(dateLocale), user.lastSeenAt && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("span", { className: "ml-2", children: [ "\xb7 ", __WEBPACK_MODULE_REFERENCE__9_5b22666f726d61744c6173745365656e225d_call_directImport_asiSafe1__._(user.lastSeenAt, t) ] }) ] }) ] }) ] }), user.bio && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { className: "mt-4 text-gray-700 text-sm leading-relaxed border-t border-gray-100 pt-4", children: user.bio }), user.phone && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "mt-4 border-t border-gray-100 pt-4 flex items-center gap-2", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M3 5a2 2 0 012-2h3.28a1 1 0 01.948.684l1.498 4.493a1 1 0 01-.502 1.21l-2.257 1.13a11.042 11.042 0 005.516 5.516l1.13-2.257a1 1 0 011.21-.502l4.493 1.498a1 1 0 01.684.949V19a2 2 0 01-2 2h-1C9.716 21 3 14.284 3 6V5z" }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("a", { href: "tel:".concat(user.phone), className: "text-sm font-medium text-gray-700 hover:text-green-600", children: user.phone }) ] }), user.personalSiteSlug && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "mt-3 flex items-center gap-2", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("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" }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("a", { href: "/site/".concat(user.personalSiteSlug), target: "_blank", rel: "noopener noreferrer", className: "text-sm text-green-600 hover:underline", children: [ "canhelp.gr/site/", user.personalSiteSlug ] }) ] }), user.languages && user.languages.length > 0 && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "mt-4 border-t border-gray-100 pt-4", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { className: "text-xs font-medium text-gray-500 mb-2 uppercase tracking-wide", children: t('profile.languages') }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "flex flex-wrap gap-2", children: user.languages.map((code)=>{ const langMap = { el: { flag: '🇬🇷', label: 'ΕλληΜικά' }, en: { flag: '🇬🇧', label: 'English' }, ru: { flag: '🇷🇺', label: 'РусскОй' }, uk: { flag: '🇺🇊', label: 'УкраїМська' }, de: { flag: '🇩🇪', label: 'Deutsch' }, fr: { flag: '🇫🇷', label: 'Français' }, it: { flag: '🇮🇹', label: 'Italiano' }, es: { flag: '🇪🇞', label: 'Español' }, ar: { flag: '🇞🇊', label: 'العرؚية' }, zh: { flag: '🇚🇳', label: 'äž­æ–‡' } }; const lang = langMap[code]; if (!lang) return null; return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("span", { className: "flex items-center gap-1.5 bg-indigo-50 text-indigo-700 text-sm px-3 py-1 rounded-full border border-indigo-100", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { children: lang.flag }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { children: lang.label }) ] }, code); }) }) ] }), user.skills && user.skills.length > 0 && specialistCards.length === 0 && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "mt-4 border-t border-gray-100 pt-4", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { className: "text-xs font-medium text-gray-500 mb-2 uppercase tracking-wide", children: t('profile.skills.label') }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "flex flex-wrap gap-2", children: user.skills.map((skill)=>/*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { className: "bg-green-50 text-green-700 text-sm px-3 py-1 rounded-full", children: skill }, skill)) }) ] }), user.role === 'specialist' && user.specialistCategories && user.specialistCategories.length > 0 && specialistCards.length === 0 && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "mt-4 border-t border-gray-100 pt-4", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { className: "text-xs font-medium text-gray-500 mb-2 uppercase tracking-wide", children: t('user.categories') }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "flex flex-wrap gap-2", children: user.specialistCategories.map((slug)=>/*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { className: "bg-purple-50 text-purple-700 text-sm px-3 py-1 rounded-full", children: slug }, slug)) }) ] }), user.role === 'specialist' && user.specialistLocations && user.specialistLocations.length > 0 && specialistCards.length === 0 && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "mt-4 border-t border-gray-100 pt-4", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { className: "text-xs font-medium text-gray-500 mb-2 uppercase tracking-wide", children: t('user.work_area') }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "flex flex-wrap gap-2", children: user.specialistLocations.map((slug)=>/*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("span", { className: "bg-emerald-50 text-emerald-700 text-sm px-3 py-1 rounded-full", children: [ "\uD83D\uDCCD ", slug ] }, slug)) }) ] }) ] }), user.role === 'specialist' && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "bg-white rounded-xl border border-gray-200 p-6 mb-6", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "flex items-center justify-between mb-4", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("h2", { className: "font-bold text-gray-900 text-lg", children: [ "\uD83D\uDCC5 ", t('nav.schedule') ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "flex items-center gap-3 text-xs text-gray-500", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("span", { className: "flex items-center gap-1.5", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { className: "w-3 h-3 rounded bg-emerald-200 border border-emerald-400 inline-block" }), t('schedule.available') ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("span", { className: "flex items-center gap-1.5", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { className: "w-3 h-3 rounded bg-red-200 border border-red-400 inline-block" }), t('schedule.busy') ] }) ] }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(ReadOnlyCalendar, { year: availYear, month: availMonth, availMap: availMap, today: today, onPrev: ()=>{ if (availMonth === 0) { setAvailYear((y)=>y - 1); setAvailMonth(11); } else setAvailMonth((m)=>m - 1); }, onNext: ()=>{ if (availMonth === 11) { setAvailYear((y)=>y + 1); setAvailMonth(0); } else setAvailMonth((m)=>m + 1); } }) ] }), (user.role === 'specialist' || user.role === 'admin') && specialistCards.length > 0 && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "space-y-4 mb-6", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("h2", { className: "font-bold text-white text-lg", children: t('nav.specialists') }), specialistCards.map((card)=>{ var _priceLists_card_id; return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(PublicCardView, { card: card, locale: locale, catMap: catMap, locMap: locMap, t: t, priceList: (_priceLists_card_id = priceLists[card.id]) !== null && _priceLists_card_id !== void 0 ? _priceLists_card_id : [] }, card.id); }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("h2", { className: "font-bold text-gray-900 text-lg mb-4", children: [ t('profile.reviews'), reviews.length > 0 && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("span", { className: "text-gray-400 font-normal text-base ml-2", children: [ "(", reviews.length, ")" ] }) ] }), reviews.length === 0 ? /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { className: "text-gray-500 text-sm", children: t('profile.no_reviews') }) : /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "space-y-4", children: reviews.map((param)=>{ let { review, author } = param; var _author_name_, _author_name; var _author_name__toUpperCase, _shortName; return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "border-b border-gray-50 pb-4 last:border-0 last:pb-0", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "flex items-start gap-3", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "w-8 h-8 rounded-full bg-gray-100 flex-shrink-0 flex items-center justify-center text-gray-600 text-sm font-bold overflow-hidden", children: (author === null || author === void 0 ? void 0 : author.image) ? /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("img", { src: author.image, alt: author.name, className: "w-full h-full object-cover" }) : (_author_name__toUpperCase = author === null || author === void 0 ? void 0 : (_author_name = author.name) === null || _author_name === void 0 ? void 0 : (_author_name_ = _author_name[0]) === null || _author_name_ === void 0 ? void 0 : _author_name_.toUpperCase()) !== null && _author_name__toUpperCase !== void 0 ? _author_name__toUpperCase : '?' }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "flex-1", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "flex items-center gap-2 mb-1", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { className: "text-sm font-medium text-gray-800", children: (_shortName = __WEBPACK_MODULE_REFERENCE__8_5b2273686f72744e616d65225d_call_directImport_asiSafe1__._(author === null || author === void 0 ? void 0 : author.name)) !== null && _shortName !== void 0 ? _shortName : '—' }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("span", { className: "text-yellow-400", children: [ '★'.repeat(review.rating), '☆'.repeat(5 - review.rating) ] }) ] }), review.comment && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { className: "text-sm text-gray-600", children: review.comment }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { className: "text-xs text-gray-400 mt-1", children: new Date(review.createdAt).toLocaleDateString(dateLocale) }) ] }) ] }) }, review.id); }) }) ] }) ] }); } function ReadOnlyCalendar(param) { let { year, month, availMap, today, onPrev, onNext } = param; const { locale, t } = __WEBPACK_MODULE_REFERENCE__3_5b227573654c6f63616c65225d_call_directImport_asiSafe1__._(); var _WEEK_DAYS_BY_LOCALE_locale; const weekDays = (_WEEK_DAYS_BY_LOCALE_locale = WEEK_DAYS_BY_LOCALE[locale]) !== null && _WEEK_DAYS_BY_LOCALE_locale !== void 0 ? _WEEK_DAYS_BY_LOCALE_locale : WEEK_DAYS_BY_LOCALE.ru; var _MONTHS_BY_LOCALE_locale; const months = (_MONTHS_BY_LOCALE_locale = MONTHS_BY_LOCALE[locale]) !== null && _MONTHS_BY_LOCALE_locale !== void 0 ? _MONTHS_BY_LOCALE_locale : MONTHS_BY_LOCALE.ru; const firstDay = new Date(year, month, 1); const startDow = (firstDay.getDay() + 6) % 7; const daysInMonth = new Date(year, month + 1, 0).getDate(); const prevMonthDays = new Date(year, month, 0).getDate(); const cells = []; for(let i = startDow - 1; i >= 0; i--){ cells.push({ day: prevMonthDays - i, cur: false, dateKey: '' }); } for(let d = 1; d <= daysInMonth; d++){ const dateKey = "".concat(year, "-").concat(String(month + 1).padStart(2, '0'), "-").concat(String(d).padStart(2, '0')); cells.push({ day: d, cur: true, dateKey }); } const remainder = cells.length % 7; if (remainder !== 0) { for(let d = 1; d <= 7 - remainder; d++){ cells.push({ day: d, cur: false, dateKey: '' }); } } const monthPrefix = "".concat(year, "-").concat(String(month + 1).padStart(2, '0')); const availCount = Object.entries(availMap).filter((param)=>{ let [k, v] = param; return k.startsWith(monthPrefix) && k >= today && v === 'available'; }).length; return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "flex items-center justify-between mb-3", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("button", { onClick: onPrev, className: "w-7 h-7 rounded-lg hover:bg-gray-100 flex items-center justify-center text-gray-500", children: "‹" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "text-center", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("span", { className: "font-medium text-gray-800 text-sm", children: [ months[month], " ", year ] }), availCount > 0 && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("span", { className: "ml-2 text-xs text-emerald-600", children: [ availCount, " ", t('schedule.free_days') ] }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("button", { onClick: onNext, className: "w-7 h-7 rounded-lg hover:bg-gray-100 flex items-center justify-center text-gray-500", children: "›" }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "grid grid-cols-7 mb-1", children: weekDays.map((d)=>/*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "text-center text-xs text-gray-400 py-1", children: d }, d)) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "grid grid-cols-7 gap-0.5", children: cells.map((cell, idx)=>{ if (!cell.cur) { return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "h-9 flex items-center justify-center text-xs text-gray-200", children: cell.day }, "e-".concat(idx)); } const status = availMap[cell.dateKey]; const isPast = cell.dateKey < today; const isToday = cell.dateKey === today; let cls = 'h-9 flex items-center justify-center rounded-lg text-sm font-medium '; if (isPast) { cls += 'text-gray-200 '; } else if (status === 'available') { cls += 'bg-emerald-100 border border-emerald-300 text-emerald-700 '; } else if (status === 'busy') { cls += 'bg-red-100 border border-red-300 text-red-600 '; } else { cls += 'text-gray-500 '; } if (isToday) cls += 'ring-2 ring-blue-400 ring-offset-1 '; return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: cls, children: cell.day }, cell.dateKey); }) }) ] }); } // ─── Public card view ───────────────────────────────────────────────────────── function flattenTree(nodes) { return nodes.flatMap((n)=>{ var _n_children; return [ n, ...flattenTree((_n_children = n.children) !== null && _n_children !== void 0 ? _n_children : []) ]; }); } function PublicCardView(param) { let { card, locale, catMap, locMap, t, priceList } = param; const [lightbox, setLightbox] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._(null); const [expandedAreas, setExpandedAreas] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._([]); const locById = new Map(); for (const node of locMap.values()){ if (node === null || node === void 0 ? void 0 : node.id) locById.set(node.id, node); } const getLocName = (loc, fallback)=>{ var _loc_names, _loc_names1; return (loc === null || loc === void 0 ? void 0 : (_loc_names = loc.names) === null || _loc_names === void 0 ? void 0 : _loc_names[locale]) || (loc === null || loc === void 0 ? void 0 : (_loc_names1 = loc.names) === null || _loc_names1 === void 0 ? void 0 : _loc_names1.el) || fallback; }; const locationGroups = (()=>{ const grouped = new Map(); var _card_locations; for (const slug of (_card_locations = card.locations) !== null && _card_locations !== void 0 ? _card_locations : []){ const loc = locMap.get(slug); if (!loc) { if (!grouped.has(slug)) { grouped.set(slug, { root: { slug, names: { el: slug } }, rootSlug: slug, districts: [], districtSlugs: new Set() }); } continue; } let root = loc; const seenIds = new Set(); while((root === null || root === void 0 ? void 0 : root.parentId) && locById.has(root.parentId) && !seenIds.has(root.parentId)){ seenIds.add(root.parentId); root = locById.get(root.parentId); } var _root_slug; const rootSlug = (_root_slug = root === null || root === void 0 ? void 0 : root.slug) !== null && _root_slug !== void 0 ? _root_slug : slug; if (!grouped.has(rootSlug)) { grouped.set(rootSlug, { root, rootSlug, districts: [], districtSlugs: new Set() }); } const group = grouped.get(rootSlug); if (loc.slug !== rootSlug && !group.districtSlugs.has(loc.slug)) { group.districtSlugs.add(loc.slug); group.districts.push(loc); } } return Array.from(grouped.values()); })(); var _lightbox_title; return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "bg-white rounded-xl border border-gray-200 overflow-hidden", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "px-5 py-4 border-b border-gray-100", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("h3", { className: "font-bold text-gray-900", children: card.title }), card.description && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { className: "text-sm text-gray-600 mt-1", children: card.description }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "p-5 space-y-4", children: [ card.skills && card.skills.length > 0 && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { className: "text-xs font-semibold text-gray-500 uppercase tracking-wide mb-2", children: t('card.skills') }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "flex flex-wrap gap-2", children: card.skills.map((s)=>/*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { className: "bg-green-50 text-green-700 text-sm px-3 py-1 rounded-full", children: s }, s)) }) ] }), card.categories && card.categories.length > 0 && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { className: "text-xs font-semibold text-gray-500 uppercase tracking-wide mb-2", children: t('card.categories') }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "flex flex-wrap gap-2", children: card.categories.map((s)=>{ var _cat_names, _cat_names1; const cat = catMap.get(s); const name = cat ? ((_cat_names = cat.names) === null || _cat_names === void 0 ? void 0 : _cat_names[locale]) || ((_cat_names1 = cat.names) === null || _cat_names1 === void 0 ? void 0 : _cat_names1.el) || s : s; return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("span", { className: "bg-purple-50 text-purple-700 text-sm px-3 py-1 rounded-full", children: [ (cat === null || cat === void 0 ? void 0 : cat.icon) ? /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { className: "mr-1 inline-flex align-middle", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__11_5b2243617465676f727949636f6e225d_directImport_asiSafe1__._, { icon: cat.icon, alt: name, className: __WEBPACK_MODULE_REFERENCE__11_5b22697343617465676f727949636f6e55726c225d_call_directImport_asiSafe1__._(cat.icon) ? 'h-4 w-4 object-contain' : 'text-sm leading-none', fallback: "\uD83D\uDCE6" }) }) : null, name ] }, s); }) }) ] }), card.locations && card.locations.length > 0 && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { className: "text-xs font-semibold text-gray-500 uppercase tracking-wide mb-2", children: t('user.work_area') }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "space-y-2", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "flex flex-wrap gap-2", children: locationGroups.map((group)=>{ const expanded = expandedAreas.includes(group.rootSlug); const canExpand = group.districts.length > 0; return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("button", { type: "button", onClick: ()=>{ if (!canExpand) return; setExpandedAreas((prev)=>prev.includes(group.rootSlug) ? prev.filter((slug)=>slug !== group.rootSlug) : [ ...prev, group.rootSlug ]); }, className: "inline-flex items-center gap-1.5 text-sm px-3 py-1.5 rounded-full border transition ".concat(expanded ? 'bg-emerald-100 text-emerald-800 border-emerald-300' : 'bg-emerald-50 text-emerald-700 border-emerald-200 hover:bg-emerald-100', " ").concat(canExpand ? 'cursor-pointer' : 'cursor-default'), children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { children: "\uD83D\uDCCD" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { children: getLocName(group.root, group.rootSlug) }), canExpand && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { className: "text-[11px] font-semibold px-1.5 py-0.5 rounded-full bg-white/80 text-emerald-700 border border-emerald-200", children: expanded ? '−' : "+".concat(group.districts.length) }) ] }, group.rootSlug); }) }), locationGroups.filter((group)=>expandedAreas.includes(group.rootSlug) && group.districts.length > 0).map((group)=>/*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "rounded-xl border border-emerald-100 bg-emerald-50/40 p-3", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { className: "text-xs text-emerald-700 font-medium mb-2", children: getLocName(group.root, group.rootSlug) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "flex flex-wrap gap-1.5", children: group.districts.map((district)=>/*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { className: "text-xs px-2.5 py-1 rounded-full bg-white border border-emerald-200 text-emerald-700", children: getLocName(district, district.slug) }, district.slug)) }) ] }, "".concat(group.rootSlug, "-children"))) ] }) ] }), priceList.length > 0 && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { className: "text-xs font-semibold text-gray-500 uppercase tracking-wide mb-3", children: t('profile.card.tab.pricelist') }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "space-y-3", children: priceList.map((group)=>/*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "border border-gray-200 rounded-xl overflow-hidden", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "bg-gray-50 px-4 py-2 border-b border-gray-200", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { className: "font-semibold text-sm text-gray-800", children: group.title }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "divide-y divide-gray-100", children: group.items.map((item)=>/*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "flex items-center gap-3 px-4 py-2.5 text-sm", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { className: "font-medium text-gray-800", children: item.name }), item.description && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { className: "text-xs text-gray-500", children: item.description }) ] }), (item.price || item.unit) && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("span", { className: "text-green-700 font-semibold whitespace-nowrap", children: [ item.price ? "€".concat(item.price) : '', item.unit ? " ".concat(item.unit) : '' ] }) ] }, item.id)) }) ] }, group.id)) }) ] }), card.portfolio && card.portfolio.length > 0 && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { className: "text-xs font-semibold text-gray-500 uppercase tracking-wide mb-2", children: t('card.portfolio') }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "grid grid-cols-2 sm:grid-cols-3 gap-3", children: card.portfolio.map((item)=>{ var _item_title; return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("button", { type: "button", onClick: ()=>setLightbox(item), className: "group relative rounded-xl overflow-hidden border border-gray-200 bg-gray-50 text-left", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("img", { src: item.imageUrl, alt: (_item_title = item.title) !== null && _item_title !== void 0 ? _item_title : '', className: "w-full aspect-square object-cover group-hover:scale-105 transition-transform duration-200" }), item.title && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "px-2 py-1.5", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { className: "text-xs font-medium text-gray-700 truncate", children: item.title }) }) ] }, item.id); }) }) ] }) ] }), lightbox && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "fixed inset-0 z-50 flex items-center justify-center bg-black/80 px-4", onClick: ()=>setLightbox(null), children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "bg-white rounded-2xl overflow-hidden max-w-lg w-full shadow-2xl", onClick: (e)=>e.stopPropagation(), children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("img", { src: lightbox.imageUrl, alt: (_lightbox_title = lightbox.title) !== null && _lightbox_title !== void 0 ? _lightbox_title : '', className: "w-full max-h-[60vh] object-contain bg-gray-900" }), (lightbox.title || lightbox.description) && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "p-4", children: [ lightbox.title && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { className: "font-semibold text-gray-800 mb-1", children: lightbox.title }), lightbox.description && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { className: "text-sm text-gray-600", children: lightbox.description }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "flex justify-end px-4 pb-4", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("button", { type: "button", onClick: ()=>setLightbox(null), className: "text-sm text-gray-500 hover:text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-100", children: t('card.close') }) }) ] }) }) ] }); } íð ñÑ/* __next_internal_client_entry_do_not_use__ default auto */ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { useState, useEffect } from 'react'; import { useParams, useRouter } from 'next/navigation'; import { useLocale } from '@/context/locale'; import { useSession } from '@/lib/auth'; import { getUserProfile, getUserReviews, getUserRating, getSpecialistAvailability, getSpecialistCards, getCategories, getLocations, getSpecialistFavorites, addSpecialistFavorite, removeSpecialistFavorite, getOrCreateDirectRoom, getCanMessage, getPriceList } from '@/lib/api'; import { UpgradePrompt } from '@/components/UpgradePrompt'; import { formatShortName, shortName } from '@/lib/formatName'; import { formatLastSeen } from '@/lib/formatLastSeen'; import { PlanBadge } from '@/components/PlanBadge'; import { CategoryIcon, isCategoryIconUrl } from '@/components/CategoryIcon'; const MONTHS_BY_LOCALE = { ru: [ 'ЯМварь', 'Ѐевраль', 'Март', 'Апрель', 'Май', 'ИюМь', 'Июль', 'Август', 'СеМтябрь', 'Октябрь', 'НПябрь', 'Декабрь' ], en: [ 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December' ], el: [ 'ΙαΜουάριος', 'Ίεβρουάριος', 'Μάρτιος', 'Απρίλιος', 'Μάιος', 'ΙούΜιος', 'Ιούλιος', 'Αύγουστος', 'ΣεπτέΌβριος', 'Οκτώβριος', 'ΝοέΌβριος', 'ΔεκέΌβριος' ], uk: [ 'СічеМь', 'ЛютОй', 'БерезеМь', 'КвітеМь', 'ТравеМь', 'ЧервеМь', 'ЛОпеМь', 'СерпеМь', 'ВересеМь', 'ЖПвтеМь', 'ЛОстПпаЎ', 'ГруЎеМь' ] }; const WEEK_DAYS_BY_LOCALE = { ru: [ 'ПМ', 'Вт', 'Ср', 'Чт', 'Пт', 'Сб', 'Вс' ], en: [ 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa', 'Su' ], el: [ 'Δε', '΀ρ', '΀ε', 'Πε', 'Πα', 'Σά', 'Κυ' ], uk: [ 'ПМ', 'Вт', 'Ср', 'Чт', 'Пт', 'Сб', 'НЎ' ] }; export default function UserProfilePage() { var _user_firstName, _user_lastName, _user_name_, _user_name, _user_siteSettings, _session_user; const { id } = useParams(); const { t, locale } = useLocale(); const { data: session } = useSession(); const router = useRouter(); const [user, setUser] = useState(null); const [reviews, setReviews] = useState([]); const [rating, setRating] = useState(null); const [loading, setLoading] = useState(true); const [specialistCards, setSpecialistCards] = useState([]); const [priceLists, setPriceLists] = useState({}); const [catMap, setCatMap] = useState(new Map()); const [locMap, setLocMap] = useState(new Map()); const [isFavorite, setIsFavorite] = useState(false); const [favLoading, setFavLoading] = useState(false); const [msgLoading, setMsgLoading] = useState(false); const [canMsg, setCanMsg] = useState(null); // Availability const now = new Date(); const [availYear, setAvailYear] = useState(now.getFullYear()); const [availMonth, setAvailMonth] = useState(now.getMonth()); const [availMap, setAvailMap] = useState({}); const today = new Date().toISOString().slice(0, 10); const dateLocale = locale === 'ru' ? 'ru-RU' : locale === 'uk' ? 'uk-UA' : locale === 'en' ? 'en-US' : 'el-GR'; useEffect(()=>{ if (!id) return; Promise.all([ getUserProfile(id, locale), getUserReviews(id), getUserRating(id), getCategories().catch(()=>[]), getLocations().catch(()=>[]) ]).then((param)=>{ let [u, r, rt, cats, locs] = param; setUser(u); setReviews(r); setRating(rt.avg); setCatMap(new Map(flattenTree(cats).map((c)=>[ c.slug, c ]))); setLocMap(new Map(flattenTree(locs).map((l)=>[ l.slug, l ]))); if (u.role === 'specialist' || u.role === 'admin') { getSpecialistCards(id, locale).then((cards)=>{ setSpecialistCards(cards); cards.forEach((c)=>{ getPriceList(c.id, locale).then((pl)=>{ if (pl.length > 0) setPriceLists((prev)=>({ ...prev, [c.id]: pl })); }).catch(()=>{}); }); }).catch(()=>{}); } }).catch(()=>{}).finally(()=>setLoading(false)); }, [ id, locale ]); // Load favorite status when session available useEffect(()=>{ var _session_user; if (!session || !id) return; getSpecialistFavorites().then((rows)=>setIsFavorite(rows.some((r)=>{ var _r_specialist; return ((_r_specialist = r.specialist) === null || _r_specialist === void 0 ? void 0 : _r_specialist.id) === id; }))).catch(()=>{}); // Check if current user can message this person const myId = (_session_user = session.user) === null || _session_user === void 0 ? void 0 : _session_user.id; if (myId && myId !== id) { getCanMessage(id).then(setCanMsg).catch(()=>{}); } }, [ session, id ]); async function toggleFavorite() { if (!session) { router.push('/register'); return; } setFavLoading(true); try { if (isFavorite) { await removeSpecialistFavorite(id); setIsFavorite(false); } else { await addSpecialistFavorite(id); setIsFavorite(true); } } catch (e) {} setFavLoading(false); } async function handleMessage() { if (!session) { router.push('/login'); return; } setMsgLoading(true); try { const { room } = await getOrCreateDirectRoom(id); router.push("/chat?room=".concat(room.id)); } catch (e) {} setMsgLoading(false); } useEffect(()=>{ if (!id) return; const monthKey = "".concat(availYear, "-").concat(String(availMonth + 1).padStart(2, '0')); getSpecialistAvailability(id, monthKey).then((rows)=>{ setAvailMap((prev)=>{ const next = { ...prev }; rows.forEach((r)=>{ next[r.date] = r.status; }); return next; }); }).catch(()=>{}); }, [ id, availYear, availMonth ]); if (loading) return /*#__PURE__*/ _jsx("div", { className: "text-center py-20 text-white", children: t('common.loading') }); if (!user) return /*#__PURE__*/ _jsx("div", { className: "text-center py-20 text-white/70", children: t('common.error') }); var _user_firstName_, _user_lastName_; const initials = "".concat((_user_firstName_ = (_user_firstName = user.firstName) === null || _user_firstName === void 0 ? void 0 : _user_firstName[0]) !== null && _user_firstName_ !== void 0 ? _user_firstName_ : '').concat((_user_lastName_ = (_user_lastName = user.lastName) === null || _user_lastName === void 0 ? void 0 : _user_lastName[0]) !== null && _user_lastName_ !== void 0 ? _user_lastName_ : '').toUpperCase() || ((_user_name = user.name) === null || _user_name === void 0 ? void 0 : (_user_name_ = _user_name[0]) === null || _user_name_ === void 0 ? void 0 : _user_name_.toUpperCase()) || '?'; const displayName = formatShortName(user.firstName, user.lastName, user.name); const profileBackgroundImage = typeof ((_user_siteSettings = user.siteSettings) === null || _user_siteSettings === void 0 ? void 0 : _user_siteSettings.profileBackgroundImage) === 'string' && user.siteSettings.profileBackgroundImage.trim().length > 0 ? user.siteSettings.profileBackgroundImage : null; return /*#__PURE__*/ _jsxs("div", { className: "max-w-3xl mx-auto px-4 py-10", children: [ /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6 mb-6", children: [ /*#__PURE__*/ _jsxs("div", { className: "relative -mx-6 -mt-6 mb-5 h-44 overflow-hidden rounded-t-xl", style: { backgroundImage: profileBackgroundImage ? "linear-gradient(135deg, rgba(21, 128, 61, 0.45), rgba(22, 163, 74, 0.65)), url(".concat(profileBackgroundImage, ")") : 'linear-gradient(135deg, #22c55e 0%, #16a34a 45%, #166534 100%)', backgroundSize: 'cover', backgroundPosition: 'center' }, children: [ /*#__PURE__*/ _jsx("div", { className: "absolute inset-0 bg-gradient-to-b from-black/10 to-black/30" }), /*#__PURE__*/ _jsxs("div", { className: "relative h-full w-full p-5 flex items-end justify-between", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 min-w-0", children: [ /*#__PURE__*/ _jsx("div", { className: "w-14 h-14 rounded-full bg-white/20 border border-white/40 overflow-hidden flex items-center justify-center text-white text-xl font-bold backdrop-blur-sm", children: user.image ? /*#__PURE__*/ _jsx("img", { src: user.image, alt: displayName, className: "w-full h-full object-cover" }) : initials }), /*#__PURE__*/ _jsxs("div", { className: "min-w-0", children: [ /*#__PURE__*/ _jsx("p", { className: "text-white text-lg font-bold truncate", children: displayName }), /*#__PURE__*/ _jsxs("p", { className: "text-white/85 text-xs", children: [ t('profile.member_since'), " ", new Date(user.createdAt).toLocaleDateString(dateLocale) ] }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "shrink-0", children: [ user.planTier && user.planTier !== 'free' && /*#__PURE__*/ _jsx(PlanBadge, { tier: user.planTier, verified: user.hasVerifiedBadge, size: "sm" }), user.hasVerifiedBadge && user.planTier === 'free' && /*#__PURE__*/ _jsx(PlanBadge, { tier: "free", verified: true, size: "sm" }) ] }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-start gap-5", children: [ /*#__PURE__*/ _jsx("div", { className: "w-20 h-20 rounded-full bg-green-100 flex-shrink-0 flex items-center justify-center text-green-700 text-2xl font-bold overflow-hidden border-2 border-gray-100", children: user.image ? /*#__PURE__*/ _jsx("img", { src: user.image, alt: displayName, className: "w-full h-full object-cover" }) : initials }), /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 flex-wrap mb-1", children: [ /*#__PURE__*/ _jsx("h1", { className: "text-xl font-bold text-gray-900", children: displayName }), user.planTier && user.planTier !== 'free' && /*#__PURE__*/ _jsx(PlanBadge, { tier: user.planTier, verified: user.hasVerifiedBadge, size: "sm" }), user.hasVerifiedBadge && user.planTier === 'free' && /*#__PURE__*/ _jsx(PlanBadge, { tier: "free", verified: true, size: "sm" }), Array.isArray(user.activeStatuses) && user.activeStatuses.includes('can_help_now') && /*#__PURE__*/ _jsxs("span", { className: "inline-flex items-center gap-1 text-xs font-medium text-green-700 bg-green-50 border border-green-200 px-2 py-0.5 rounded-full", children: [ /*#__PURE__*/ _jsx("span", { className: "w-1.5 h-1.5 rounded-full bg-green-500 animate-pulse" }), t('status.can_help_now', 'Available now') ] }), Array.isArray(user.activeStatuses) && user.activeStatuses.includes('need_help') && /*#__PURE__*/ _jsxs("span", { className: "inline-flex items-center gap-1 text-xs font-medium text-green-700 bg-green-50 border border-green-200 px-2 py-0.5 rounded-full", children: [ /*#__PURE__*/ _jsx("span", { className: "w-1.5 h-1.5 rounded-full bg-green-500" }), t('status.need_help', 'Need help') ] }), (session ? ((_session_user = session.user) === null || _session_user === void 0 ? void 0 : _session_user.id) !== id : true) && /*#__PURE__*/ _jsxs("div", { className: "ml-auto flex items-center gap-2", children: [ !session ? // Guest — show button that leads to registration /*#__PURE__*/ _jsxs("a", { href: "/register", className: "flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-sm font-medium bg-green-50 text-green-600 border border-green-200 hover:bg-green-100 transition", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }), /*#__PURE__*/ _jsx("span", { children: t('chat.write_btn', 'Write') }) ] }) : (canMsg === null || canMsg === void 0 ? void 0 : canMsg.allowed) === false ? /*#__PURE__*/ _jsx(UpgradePrompt, { feature: t('chat.write_btn', 'Write'), requiredTier: "pro", variant: "inline", t: t }) : /*#__PURE__*/ _jsxs("button", { onClick: handleMessage, disabled: msgLoading, className: "flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-sm font-medium bg-green-50 text-green-600 border border-green-200 hover:bg-green-100 transition disabled:opacity-50", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }), /*#__PURE__*/ _jsx("span", { children: t('chat.write_btn') }) ] }), /*#__PURE__*/ _jsxs("button", { onClick: toggleFavorite, disabled: favLoading, title: isFavorite ? t('specialist.unfavorite') : t('specialist.favorite'), className: "flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-sm font-medium transition disabled:opacity-50 ".concat(isFavorite ? 'bg-pink-50 text-pink-600 border border-pink-200 hover:bg-pink-100' : 'bg-gray-50 text-gray-600 border border-gray-200 hover:bg-gray-100'), children: [ /*#__PURE__*/ _jsx("span", { children: isFavorite ? '❀' : '🀍' }), /*#__PURE__*/ _jsx("span", { children: isFavorite ? t('specialist.unfavorite') : t('specialist.favorite') }) ] }) ] }) ] }), rating && /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-1.5 mb-2", children: [ /*#__PURE__*/ _jsx("span", { className: "text-yellow-400 text-lg", children: "★" }), /*#__PURE__*/ _jsx("span", { className: "font-semibold text-gray-800", children: Number(rating).toFixed(1) }), /*#__PURE__*/ _jsxs("span", { className: "text-sm text-gray-400", children: [ "(", reviews.length, " ", t('profile.reviews').toLowerCase(), ")" ] }) ] }), /*#__PURE__*/ _jsxs("p", { className: "text-sm text-gray-400", children: [ t('profile.member_since'), " ", new Date(user.createdAt).toLocaleDateString(dateLocale), user.lastSeenAt && /*#__PURE__*/ _jsxs("span", { className: "ml-2", children: [ "\xb7 ", formatLastSeen(user.lastSeenAt, t) ] }) ] }) ] }) ] }), user.bio && /*#__PURE__*/ _jsx("p", { className: "mt-4 text-gray-700 text-sm leading-relaxed border-t border-gray-100 pt-4", children: user.bio }), user.phone && /*#__PURE__*/ _jsxs("div", { className: "mt-4 border-t border-gray-100 pt-4 flex items-center gap-2", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M3 5a2 2 0 012-2h3.28a1 1 0 01.948.684l1.498 4.493a1 1 0 01-.502 1.21l-2.257 1.13a11.042 11.042 0 005.516 5.516l1.13-2.257a1 1 0 011.21-.502l4.493 1.498a1 1 0 01.684.949V19a2 2 0 01-2 2h-1C9.716 21 3 14.284 3 6V5z" }) }), /*#__PURE__*/ _jsx("a", { href: "tel:".concat(user.phone), className: "text-sm font-medium text-gray-700 hover:text-green-600", children: user.phone }) ] }), user.personalSiteSlug && /*#__PURE__*/ _jsxs("div", { className: "mt-3 flex items-center gap-2", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _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" }) }), /*#__PURE__*/ _jsxs("a", { href: "/site/".concat(user.personalSiteSlug), target: "_blank", rel: "noopener noreferrer", className: "text-sm text-green-600 hover:underline", children: [ "canhelp.gr/site/", user.personalSiteSlug ] }) ] }), user.languages && user.languages.length > 0 && /*#__PURE__*/ _jsxs("div", { className: "mt-4 border-t border-gray-100 pt-4", children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs font-medium text-gray-500 mb-2 uppercase tracking-wide", children: t('profile.languages') }), /*#__PURE__*/ _jsx("div", { className: "flex flex-wrap gap-2", children: user.languages.map((code)=>{ const langMap = { el: { flag: '🇬🇷', label: 'ΕλληΜικά' }, en: { flag: '🇬🇧', label: 'English' }, ru: { flag: '🇷🇺', label: 'РусскОй' }, uk: { flag: '🇺🇊', label: 'УкраїМська' }, de: { flag: '🇩🇪', label: 'Deutsch' }, fr: { flag: '🇫🇷', label: 'Français' }, it: { flag: '🇮🇹', label: 'Italiano' }, es: { flag: '🇪🇞', label: 'Español' }, ar: { flag: '🇞🇊', label: 'العرؚية' }, zh: { flag: '🇚🇳', label: 'äž­æ–‡' } }; const lang = langMap[code]; if (!lang) return null; return /*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-1.5 bg-indigo-50 text-indigo-700 text-sm px-3 py-1 rounded-full border border-indigo-100", children: [ /*#__PURE__*/ _jsx("span", { children: lang.flag }), /*#__PURE__*/ _jsx("span", { children: lang.label }) ] }, code); }) }) ] }), user.skills && user.skills.length > 0 && specialistCards.length === 0 && /*#__PURE__*/ _jsxs("div", { className: "mt-4 border-t border-gray-100 pt-4", children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs font-medium text-gray-500 mb-2 uppercase tracking-wide", children: t('profile.skills.label') }), /*#__PURE__*/ _jsx("div", { className: "flex flex-wrap gap-2", children: user.skills.map((skill)=>/*#__PURE__*/ _jsx("span", { className: "bg-green-50 text-green-700 text-sm px-3 py-1 rounded-full", children: skill }, skill)) }) ] }), user.role === 'specialist' && user.specialistCategories && user.specialistCategories.length > 0 && specialistCards.length === 0 && /*#__PURE__*/ _jsxs("div", { className: "mt-4 border-t border-gray-100 pt-4", children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs font-medium text-gray-500 mb-2 uppercase tracking-wide", children: t('user.categories') }), /*#__PURE__*/ _jsx("div", { className: "flex flex-wrap gap-2", children: user.specialistCategories.map((slug)=>/*#__PURE__*/ _jsx("span", { className: "bg-purple-50 text-purple-700 text-sm px-3 py-1 rounded-full", children: slug }, slug)) }) ] }), user.role === 'specialist' && user.specialistLocations && user.specialistLocations.length > 0 && specialistCards.length === 0 && /*#__PURE__*/ _jsxs("div", { className: "mt-4 border-t border-gray-100 pt-4", children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs font-medium text-gray-500 mb-2 uppercase tracking-wide", children: t('user.work_area') }), /*#__PURE__*/ _jsx("div", { className: "flex flex-wrap gap-2", children: user.specialistLocations.map((slug)=>/*#__PURE__*/ _jsxs("span", { className: "bg-emerald-50 text-emerald-700 text-sm px-3 py-1 rounded-full", children: [ "\uD83D\uDCCD ", slug ] }, slug)) }) ] }) ] }), user.role === 'specialist' && /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6 mb-6", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between mb-4", children: [ /*#__PURE__*/ _jsxs("h2", { className: "font-bold text-gray-900 text-lg", children: [ "\uD83D\uDCC5 ", t('nav.schedule') ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 text-xs text-gray-500", children: [ /*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-1.5", children: [ /*#__PURE__*/ _jsx("span", { className: "w-3 h-3 rounded bg-emerald-200 border border-emerald-400 inline-block" }), t('schedule.available') ] }), /*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-1.5", children: [ /*#__PURE__*/ _jsx("span", { className: "w-3 h-3 rounded bg-red-200 border border-red-400 inline-block" }), t('schedule.busy') ] }) ] }) ] }), /*#__PURE__*/ _jsx(ReadOnlyCalendar, { year: availYear, month: availMonth, availMap: availMap, today: today, onPrev: ()=>{ if (availMonth === 0) { setAvailYear((y)=>y - 1); setAvailMonth(11); } else setAvailMonth((m)=>m - 1); }, onNext: ()=>{ if (availMonth === 11) { setAvailYear((y)=>y + 1); setAvailMonth(0); } else setAvailMonth((m)=>m + 1); } }) ] }), (user.role === 'specialist' || user.role === 'admin') && specialistCards.length > 0 && /*#__PURE__*/ _jsxs("div", { className: "space-y-4 mb-6", children: [ /*#__PURE__*/ _jsx("h2", { className: "font-bold text-white text-lg", children: t('nav.specialists') }), specialistCards.map((card)=>{ var _priceLists_card_id; return /*#__PURE__*/ _jsx(PublicCardView, { card: card, locale: locale, catMap: catMap, locMap: locMap, t: t, priceList: (_priceLists_card_id = priceLists[card.id]) !== null && _priceLists_card_id !== void 0 ? _priceLists_card_id : [] }, card.id); }) ] }), /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ _jsxs("h2", { className: "font-bold text-gray-900 text-lg mb-4", children: [ t('profile.reviews'), reviews.length > 0 && /*#__PURE__*/ _jsxs("span", { className: "text-gray-400 font-normal text-base ml-2", children: [ "(", reviews.length, ")" ] }) ] }), reviews.length === 0 ? /*#__PURE__*/ _jsx("p", { className: "text-gray-500 text-sm", children: t('profile.no_reviews') }) : /*#__PURE__*/ _jsx("div", { className: "space-y-4", children: reviews.map((param)=>{ let { review, author } = param; var _author_name_, _author_name; var _author_name__toUpperCase, _shortName; return /*#__PURE__*/ _jsx("div", { className: "border-b border-gray-50 pb-4 last:border-0 last:pb-0", children: /*#__PURE__*/ _jsxs("div", { className: "flex items-start gap-3", children: [ /*#__PURE__*/ _jsx("div", { className: "w-8 h-8 rounded-full bg-gray-100 flex-shrink-0 flex items-center justify-center text-gray-600 text-sm font-bold overflow-hidden", children: (author === null || author === void 0 ? void 0 : author.image) ? /*#__PURE__*/ _jsx("img", { src: author.image, alt: author.name, className: "w-full h-full object-cover" }) : (_author_name__toUpperCase = author === null || author === void 0 ? void 0 : (_author_name = author.name) === null || _author_name === void 0 ? void 0 : (_author_name_ = _author_name[0]) === null || _author_name_ === void 0 ? void 0 : _author_name_.toUpperCase()) !== null && _author_name__toUpperCase !== void 0 ? _author_name__toUpperCase : '?' }), /*#__PURE__*/ _jsxs("div", { className: "flex-1", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 mb-1", children: [ /*#__PURE__*/ _jsx("span", { className: "text-sm font-medium text-gray-800", children: (_shortName = shortName(author === null || author === void 0 ? void 0 : author.name)) !== null && _shortName !== void 0 ? _shortName : '—' }), /*#__PURE__*/ _jsxs("span", { className: "text-yellow-400", children: [ '★'.repeat(review.rating), '☆'.repeat(5 - review.rating) ] }) ] }), review.comment && /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-600", children: review.comment }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-1", children: new Date(review.createdAt).toLocaleDateString(dateLocale) }) ] }) ] }) }, review.id); }) }) ] }) ] }); } function ReadOnlyCalendar(param) { let { year, month, availMap, today, onPrev, onNext } = param; const { locale, t } = useLocale(); var _WEEK_DAYS_BY_LOCALE_locale; const weekDays = (_WEEK_DAYS_BY_LOCALE_locale = WEEK_DAYS_BY_LOCALE[locale]) !== null && _WEEK_DAYS_BY_LOCALE_locale !== void 0 ? _WEEK_DAYS_BY_LOCALE_locale : WEEK_DAYS_BY_LOCALE.ru; var _MONTHS_BY_LOCALE_locale; const months = (_MONTHS_BY_LOCALE_locale = MONTHS_BY_LOCALE[locale]) !== null && _MONTHS_BY_LOCALE_locale !== void 0 ? _MONTHS_BY_LOCALE_locale : MONTHS_BY_LOCALE.ru; const firstDay = new Date(year, month, 1); const startDow = (firstDay.getDay() + 6) % 7; const daysInMonth = new Date(year, month + 1, 0).getDate(); const prevMonthDays = new Date(year, month, 0).getDate(); const cells = []; for(let i = startDow - 1; i >= 0; i--){ cells.push({ day: prevMonthDays - i, cur: false, dateKey: '' }); } for(let d = 1; d <= daysInMonth; d++){ const dateKey = "".concat(year, "-").concat(String(month + 1).padStart(2, '0'), "-").concat(String(d).padStart(2, '0')); cells.push({ day: d, cur: true, dateKey }); } const remainder = cells.length % 7; if (remainder !== 0) { for(let d = 1; d <= 7 - remainder; d++){ cells.push({ day: d, cur: false, dateKey: '' }); } } const monthPrefix = "".concat(year, "-").concat(String(month + 1).padStart(2, '0')); const availCount = Object.entries(availMap).filter((param)=>{ let [k, v] = param; return k.startsWith(monthPrefix) && k >= today && v === 'available'; }).length; return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between mb-3", children: [ /*#__PURE__*/ _jsx("button", { onClick: onPrev, className: "w-7 h-7 rounded-lg hover:bg-gray-100 flex items-center justify-center text-gray-500", children: "‹" }), /*#__PURE__*/ _jsxs("div", { className: "text-center", children: [ /*#__PURE__*/ _jsxs("span", { className: "font-medium text-gray-800 text-sm", children: [ months[month], " ", year ] }), availCount > 0 && /*#__PURE__*/ _jsxs("span", { className: "ml-2 text-xs text-emerald-600", children: [ availCount, " ", t('schedule.free_days') ] }) ] }), /*#__PURE__*/ _jsx("button", { onClick: onNext, className: "w-7 h-7 rounded-lg hover:bg-gray-100 flex items-center justify-center text-gray-500", children: "›" }) ] }), /*#__PURE__*/ _jsx("div", { className: "grid grid-cols-7 mb-1", children: weekDays.map((d)=>/*#__PURE__*/ _jsx("div", { className: "text-center text-xs text-gray-400 py-1", children: d }, d)) }), /*#__PURE__*/ _jsx("div", { className: "grid grid-cols-7 gap-0.5", children: cells.map((cell, idx)=>{ if (!cell.cur) { return /*#__PURE__*/ _jsx("div", { className: "h-9 flex items-center justify-center text-xs text-gray-200", children: cell.day }, "e-".concat(idx)); } const status = availMap[cell.dateKey]; const isPast = cell.dateKey < today; const isToday = cell.dateKey === today; let cls = 'h-9 flex items-center justify-center rounded-lg text-sm font-medium '; if (isPast) { cls += 'text-gray-200 '; } else if (status === 'available') { cls += 'bg-emerald-100 border border-emerald-300 text-emerald-700 '; } else if (status === 'busy') { cls += 'bg-red-100 border border-red-300 text-red-600 '; } else { cls += 'text-gray-500 '; } if (isToday) cls += 'ring-2 ring-blue-400 ring-offset-1 '; return /*#__PURE__*/ _jsx("div", { className: cls, children: cell.day }, cell.dateKey); }) }) ] }); } // ─── Public card view ───────────────────────────────────────────────────────── function flattenTree(nodes) { return nodes.flatMap((n)=>{ var _n_children; return [ n, ...flattenTree((_n_children = n.children) !== null && _n_children !== void 0 ? _n_children : []) ]; }); } function PublicCardView(param) { let { card, locale, catMap, locMap, t, priceList } = param; const [lightbox, setLightbox] = useState(null); const [expandedAreas, setExpandedAreas] = useState([]); const locById = new Map(); for (const node of locMap.values()){ if (node === null || node === void 0 ? void 0 : node.id) locById.set(node.id, node); } const getLocName = (loc, fallback)=>{ var _loc_names, _loc_names1; return (loc === null || loc === void 0 ? void 0 : (_loc_names = loc.names) === null || _loc_names === void 0 ? void 0 : _loc_names[locale]) || (loc === null || loc === void 0 ? void 0 : (_loc_names1 = loc.names) === null || _loc_names1 === void 0 ? void 0 : _loc_names1.el) || fallback; }; const locationGroups = (()=>{ const grouped = new Map(); var _card_locations; for (const slug of (_card_locations = card.locations) !== null && _card_locations !== void 0 ? _card_locations : []){ const loc = locMap.get(slug); if (!loc) { if (!grouped.has(slug)) { grouped.set(slug, { root: { slug, names: { el: slug } }, rootSlug: slug, districts: [], districtSlugs: new Set() }); } continue; } let root = loc; const seenIds = new Set(); while((root === null || root === void 0 ? void 0 : root.parentId) && locById.has(root.parentId) && !seenIds.has(root.parentId)){ seenIds.add(root.parentId); root = locById.get(root.parentId); } var _root_slug; const rootSlug = (_root_slug = root === null || root === void 0 ? void 0 : root.slug) !== null && _root_slug !== void 0 ? _root_slug : slug; if (!grouped.has(rootSlug)) { grouped.set(rootSlug, { root, rootSlug, districts: [], districtSlugs: new Set() }); } const group = grouped.get(rootSlug); if (loc.slug !== rootSlug && !group.districtSlugs.has(loc.slug)) { group.districtSlugs.add(loc.slug); group.districts.push(loc); } } return Array.from(grouped.values()); })(); var _lightbox_title; return /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 overflow-hidden", children: [ /*#__PURE__*/ _jsxs("div", { className: "px-5 py-4 border-b border-gray-100", children: [ /*#__PURE__*/ _jsx("h3", { className: "font-bold text-gray-900", children: card.title }), card.description && /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-600 mt-1", children: card.description }) ] }), /*#__PURE__*/ _jsxs("div", { className: "p-5 space-y-4", children: [ card.skills && card.skills.length > 0 && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs font-semibold text-gray-500 uppercase tracking-wide mb-2", children: t('card.skills') }), /*#__PURE__*/ _jsx("div", { className: "flex flex-wrap gap-2", children: card.skills.map((s)=>/*#__PURE__*/ _jsx("span", { className: "bg-green-50 text-green-700 text-sm px-3 py-1 rounded-full", children: s }, s)) }) ] }), card.categories && card.categories.length > 0 && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs font-semibold text-gray-500 uppercase tracking-wide mb-2", children: t('card.categories') }), /*#__PURE__*/ _jsx("div", { className: "flex flex-wrap gap-2", children: card.categories.map((s)=>{ var _cat_names, _cat_names1; const cat = catMap.get(s); const name = cat ? ((_cat_names = cat.names) === null || _cat_names === void 0 ? void 0 : _cat_names[locale]) || ((_cat_names1 = cat.names) === null || _cat_names1 === void 0 ? void 0 : _cat_names1.el) || s : s; return /*#__PURE__*/ _jsxs("span", { className: "bg-purple-50 text-purple-700 text-sm px-3 py-1 rounded-full", children: [ (cat === null || cat === void 0 ? void 0 : cat.icon) ? /*#__PURE__*/ _jsx("span", { className: "mr-1 inline-flex align-middle", children: /*#__PURE__*/ _jsx(CategoryIcon, { icon: cat.icon, alt: name, className: isCategoryIconUrl(cat.icon) ? 'h-4 w-4 object-contain' : 'text-sm leading-none', fallback: "\uD83D\uDCE6" }) }) : null, name ] }, s); }) }) ] }), card.locations && card.locations.length > 0 && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs font-semibold text-gray-500 uppercase tracking-wide mb-2", children: t('user.work_area') }), /*#__PURE__*/ _jsxs("div", { className: "space-y-2", children: [ /*#__PURE__*/ _jsx("div", { className: "flex flex-wrap gap-2", children: locationGroups.map((group)=>{ const expanded = expandedAreas.includes(group.rootSlug); const canExpand = group.districts.length > 0; return /*#__PURE__*/ _jsxs("button", { type: "button", onClick: ()=>{ if (!canExpand) return; setExpandedAreas((prev)=>prev.includes(group.rootSlug) ? prev.filter((slug)=>slug !== group.rootSlug) : [ ...prev, group.rootSlug ]); }, className: "inline-flex items-center gap-1.5 text-sm px-3 py-1.5 rounded-full border transition ".concat(expanded ? 'bg-emerald-100 text-emerald-800 border-emerald-300' : 'bg-emerald-50 text-emerald-700 border-emerald-200 hover:bg-emerald-100', " ").concat(canExpand ? 'cursor-pointer' : 'cursor-default'), children: [ /*#__PURE__*/ _jsx("span", { children: "\uD83D\uDCCD" }), /*#__PURE__*/ _jsx("span", { children: getLocName(group.root, group.rootSlug) }), canExpand && /*#__PURE__*/ _jsx("span", { className: "text-[11px] font-semibold px-1.5 py-0.5 rounded-full bg-white/80 text-emerald-700 border border-emerald-200", children: expanded ? '−' : "+".concat(group.districts.length) }) ] }, group.rootSlug); }) }), locationGroups.filter((group)=>expandedAreas.includes(group.rootSlug) && group.districts.length > 0).map((group)=>/*#__PURE__*/ _jsxs("div", { className: "rounded-xl border border-emerald-100 bg-emerald-50/40 p-3", children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs text-emerald-700 font-medium mb-2", children: getLocName(group.root, group.rootSlug) }), /*#__PURE__*/ _jsx("div", { className: "flex flex-wrap gap-1.5", children: group.districts.map((district)=>/*#__PURE__*/ _jsx("span", { className: "text-xs px-2.5 py-1 rounded-full bg-white border border-emerald-200 text-emerald-700", children: getLocName(district, district.slug) }, district.slug)) }) ] }, "".concat(group.rootSlug, "-children"))) ] }) ] }), priceList.length > 0 && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs font-semibold text-gray-500 uppercase tracking-wide mb-3", children: t('profile.card.tab.pricelist') }), /*#__PURE__*/ _jsx("div", { className: "space-y-3", children: priceList.map((group)=>/*#__PURE__*/ _jsxs("div", { className: "border border-gray-200 rounded-xl overflow-hidden", children: [ /*#__PURE__*/ _jsx("div", { className: "bg-gray-50 px-4 py-2 border-b border-gray-200", children: /*#__PURE__*/ _jsx("span", { className: "font-semibold text-sm text-gray-800", children: group.title }) }), /*#__PURE__*/ _jsx("div", { className: "divide-y divide-gray-100", children: group.items.map((item)=>/*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 px-4 py-2.5 text-sm", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ _jsx("p", { className: "font-medium text-gray-800", children: item.name }), item.description && /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-500", children: item.description }) ] }), (item.price || item.unit) && /*#__PURE__*/ _jsxs("span", { className: "text-green-700 font-semibold whitespace-nowrap", children: [ item.price ? "€".concat(item.price) : '', item.unit ? " ".concat(item.unit) : '' ] }) ] }, item.id)) }) ] }, group.id)) }) ] }), card.portfolio && card.portfolio.length > 0 && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs font-semibold text-gray-500 uppercase tracking-wide mb-2", children: t('card.portfolio') }), /*#__PURE__*/ _jsx("div", { className: "grid grid-cols-2 sm:grid-cols-3 gap-3", children: card.portfolio.map((item)=>{ var _item_title; return /*#__PURE__*/ _jsxs("button", { type: "button", onClick: ()=>setLightbox(item), className: "group relative rounded-xl overflow-hidden border border-gray-200 bg-gray-50 text-left", children: [ /*#__PURE__*/ _jsx("img", { src: item.imageUrl, alt: (_item_title = item.title) !== null && _item_title !== void 0 ? _item_title : '', className: "w-full aspect-square object-cover group-hover:scale-105 transition-transform duration-200" }), item.title && /*#__PURE__*/ _jsx("div", { className: "px-2 py-1.5", children: /*#__PURE__*/ _jsx("p", { className: "text-xs font-medium text-gray-700 truncate", children: item.title }) }) ] }, item.id); }) }) ] }) ] }), lightbox && /*#__PURE__*/ _jsx("div", { className: "fixed inset-0 z-50 flex items-center justify-center bg-black/80 px-4", onClick: ()=>setLightbox(null), children: /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-2xl overflow-hidden max-w-lg w-full shadow-2xl", onClick: (e)=>e.stopPropagation(), children: [ /*#__PURE__*/ _jsx("img", { src: lightbox.imageUrl, alt: (_lightbox_title = lightbox.title) !== null && _lightbox_title !== void 0 ? _lightbox_title : '', className: "w-full max-h-[60vh] object-contain bg-gray-900" }), (lightbox.title || lightbox.description) && /*#__PURE__*/ _jsxs("div", { className: "p-4", children: [ lightbox.title && /*#__PURE__*/ _jsx("p", { className: "font-semibold text-gray-800 mb-1", children: lightbox.title }), lightbox.description && /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-600", children: lightbox.description }) ] }), /*#__PURE__*/ _jsx("div", { className: "flex justify-end px-4 pb-4", children: /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setLightbox(null), className: "text-sm text-gray-500 hover:text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-100", children: t('card.close') }) }) ] }) }) ] }); } åR61123undefined125168undefined170224undefined226270undefined272311undefined313587undefined589647undefined649710undefined712765undefined767817undefined819894undefined23812395undefined25452553__WEBPACK_MODULE_REFERENCE__2_5b22757365506172616d73225d_call_directImport_asiSafe1__._undefined25842592__WEBPACK_MODULE_REFERENCE__3_5b227573654c6f63616c65225d_call_directImport_asiSafe1__._undefined26272636__WEBPACK_MODULE_REFERENCE__4_5b2275736553657373696f6e225d_call_directImport_asiSafe1__._undefined26602668__WEBPACK_MODULE_REFERENCE__2_5b22757365526f75746572225d_call_directImport_asiSafe1__._undefined27012708__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined27512758__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined27972804__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined28472854__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined29132920__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined29672974__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined30133020__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined30663073__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined31273134__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined31843191__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined32413248__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined32903297__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined33923399__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined34613468__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined35233530__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined37143722__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined37893802__WEBPACK_MODULE_REFERENCE__5_5b226765745573657250726f66696c65225d_call_directImport_asiSafe1__._undefined38293842__WEBPACK_MODULE_REFERENCE__5_5b226765745573657252657669657773225d_call_directImport_asiSafe1__._undefined38613873__WEBPACK_MODULE_REFERENCE__5_5b2267657455736572526174696e67225d_call_directImport_asiSafe1__._undefined38923904__WEBPACK_MODULE_REFERENCE__5_5b2267657443617465676f72696573225d_call_directImport_asiSafe1__._undefined39353946__WEBPACK_MODULE_REFERENCE__5_5b226765744c6f636174696f6e73225d_call_directImport_asiSafe1__._undefined44644481__WEBPACK_MODULE_REFERENCE__5_5b226765745370656369616c6973744361726473225d_call_directImport_asiSafe1__._undefined46234634__WEBPACK_MODULE_REFERENCE__5_5b2267657450726963654c697374225d_call_directImport_asiSafe1__._undefined51345142__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined52225243__WEBPACK_MODULE_REFERENCE__5_5b226765745370656369616c6973744661766f7269746573225d_call_directImport_asiSafe1__._undefined57095721__WEBPACK_MODULE_REFERENCE__5_5b2267657443616e4d657373616765225d_call_directImport_asiSafe1__._undefined60386061__WEBPACK_MODULE_REFERENCE__5_5b2272656d6f76655370656369616c6973744661766f72697465225d_call_directImport_asiSafe1__._undefined61496169__WEBPACK_MODULE_REFERENCE__5_5b226164645370656369616c6973744661766f72697465225d_call_directImport_asiSafe1__._undefined64906510__WEBPACK_MODULE_REFERENCE__5_5b226765744f72437265617465446972656374526f6f6d225d_call_directImport_asiSafe1__._undefined66366644__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined67856809__WEBPACK_MODULE_REFERENCE__5_5b226765745370656369616c697374417661696c6162696c697479225d_call_directImport_asiSafe1__._undefined72297232__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined73767379__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined81658179__WEBPACK_MODULE_REFERENCE__8_5b22666f726d617453686f72744e616d65225d_call_directImport_asiSafe1__._undefined85558559__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined86678671__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined88268830__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined94439446__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined96369640__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined98499853__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1006010063__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1037410377__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1078710791__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1099811001__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1131811322__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1210112105__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1233412337__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1233912347__WEBPACK_MODULE_REFERENCE__10_5b22506c616e4261646765225d_directImport_asiSafe1__._undefined1272012723__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1272512733__WEBPACK_MODULE_REFERENCE__10_5b22506c616e4261646765225d_directImport_asiSafe1__._undefined1320013204__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1335413357__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1364113644__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1395813962__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1412814132__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1434614349__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1467414677__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1467914687__WEBPACK_MODULE_REFERENCE__10_5b22506c616e4261646765225d_directImport_asiSafe1__._undefined1506015063__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1506515073__WEBPACK_MODULE_REFERENCE__10_5b22506c616e4261646765225d_directImport_asiSafe1__._undefined1545515459__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1578615789__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1631116315__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1664216645__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1719017194__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1753817542__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1798817991__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1851018513__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1914619149__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1953319536__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1953819550__WEBPACK_MODULE_REFERENCE__7_5b225570677261646550726f6d7074225d_directImport_asiSafe1__._undefined1993419938__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2049220495__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2101421017__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2165021653__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2200222006__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2278222785__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2303423037__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2360523609__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2381523818__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2408424087__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2437924383__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2509425098__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2553325537__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2578925802__WEBPACK_MODULE_REFERENCE__9_5b22666f726d61744c6173745365656e225d_call_directImport_asiSafe1__._undefined2616326166__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2640126405__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2659126594__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2694426947__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2744427447__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2781527819__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2797527978__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2832828331__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2869128695__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2933129335__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2949729500__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2975729760__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3226332267__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3255432557__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3274332746__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3318533189__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3335133354__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3361433617__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3377633779__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3425234256__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3441834421__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3467634679__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3485134854__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3532535329__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3549135494__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3574835751__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3592235926__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3647436478__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3663336637__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3680336807__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3715437158__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3735537359__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3756137564__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3795537959__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3816138164__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3864038643__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3957639580__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3969839701__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4000140004__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4050340507__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4065740661__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4089640900__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4134841351__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4151741520__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4187741880__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4204642050__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4223642239__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4256942572__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4329843302__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4349643500__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4374043743__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4394743955__WEBPACK_MODULE_REFERENCE__8_5b2273686f72744e616d65225d_call_directImport_asiSafe1__._undefined4420244206__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4487244875__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4516345166__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4587445882__WEBPACK_MODULE_REFERENCE__3_5b227573654c6f63616c65225d_call_directImport_asiSafe1__._undefined4755647560__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4761747621__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4776347766__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4803948043__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4818248186__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4858148585__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4901549018__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4931649319__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4944049443__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4963649639__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4983849841__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5093250935__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5158551592__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined5164751654__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined5409754101__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5423954243__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5438154384__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5457954582__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5479054794__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5495254956__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5504555048__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5530155304__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5545955462__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5584555849__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5593855941__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5619856201__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5678156785__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5707657079__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5725557258__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5726057271__WEBPACK_MODULE_REFERENCE__11_5b2243617465676f727949636f6e225d_directImport_asiSafe1__._undefined5747057486__WEBPACK_MODULE_REFERENCE__11_5b22697343617465676f727949636f6e55726c225d_call_directImport_asiSafe1__._undefined5806558069__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5815858161__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5841758421__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5858258585__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5900759011__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined6012260125__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6034060343__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6059560598__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6132261326__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined6157161574__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6190661909__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6211762120__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6282662830__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined6291962922__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6319063193__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6333963343__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined6356863571__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6376263765__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6411064113__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6430764311__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined6457864582__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined6484464847__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6523465237__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6575765761__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined6674466748__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined6683766840__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6709667099__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6737567379__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined6777167774__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6825968262__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6841968422__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6898968992__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6919069194__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined6942869431__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6982369827__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined6998869991__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7025070253__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7053270535__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7066770670__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined_תu˜ð^ÓþR y Í ø L ‡ Û ^ … Ù  [ ‘ å  k  ñ _oÎ"`Žë?÷Mð k~ÜïMlÈÎ6Ä jº*üZ— c_Ñ € þ T!á!W"û#E$Õ$%1(“( *W*Ã*+ª+ö+[.¥.c/¯/€0Ì0›1å13f35L56_e6¢7î7ù:E;*<t<v<È<=>‡>‰>Û>®@ú@AÚAöB@CzDÆDlEžEŽFØFHgHiH»H0JzJ|J_ÎJLL˜LßM)N3PPÆQR1T}TÕU!VßW)X0ZzZó\=]œ^_ _b_â`.aXc¢c©eóelh¶hj__jgm±mªnôn,qxqFrršsäsuTuxgxzfzb{Â{+}u}`~¬~f°XIƒ“ƒ…O…ë…_5†“‡Ý‡E‰‘‰ ŒYŒûŒEFސŽW˜£˜Â™ šÆš›ÇœµÿŸMŸìŸ6 ¢[¢ý¢G£F€€<¥_†¥]§©§Kš•š“©Ý©ˆªÔªø¬D­ß­+®Ñ®¯x°Ä°‰±Õ±Ÿ²é²pŽŒŽ†µÐµ¬·ö·›»ç»]Œ§ŒÓœ_ŸÀ\ÀòÀ>Á)ÂuÂ5ÄÄ%ÅoÅÔÆÇÄÇÈÊÈÉ^ÊšÊ~ÍÊÍŒÎØÎÈÏÐÞÐ4Ñ+ÒwÒÕ[Õ{Ö_Å։ÙßÙiàµàîà:áÈáâ#ãoãúãFäÑåæËçè?é‰éêLê ëWëìhì«ðõðóÓó ô^ôéý_5þ¿þ ÿ•ÿßÿ¢ìŒŠòK•’ÜwÁ@Œå/0 z Ÿ  - w 'qsË’_ù<ˆá++wbT«õÌ\0!|!q"»"$Q$!%k%-(y(Ò()(*r*+_P+1,{,:-„-Ý.'/é/50@1Œ1’2Ü2_4©4±6ý6Ô: ;y;Ã;Ã< =!>m>õ??@$BnB CUCŒENÖEœFèFÒGH€IðI‘JÛJÞK(L?M‰M NWN˜(0,navigation.useParams)£(0,context_locale/* useLocale */.Y)›(0,auth/* useSession */.wV)˜(0,navigation.useRouter)’(0,react.useState)ÿÿÿÿÿÿÿÿÿÿÿÿÿÿ“(0,react.useEffect)ž(0,api/* getUserProfile */.VM)ž(0,api/* getUserReviews */.v9)(0,api/* getUserRating */.Bm)(0,api/* getCategories */.bW)œ(0,api/* getLocations */.Vs)¢(0,api/* getSpecialistCards */.Bq)œ(0,api/* getPriceList */.Ck)øŠ(0,api/* getSpecialistFavorites */.pD)(0,api/* getCanMessage */.On)š(0,api/* removeSpecialistFavorite */.sD)€(0,api/* addSpecialistFavorite */.V)¥(0,api/* getOrCreateDirectRoom */.QN)ó©(0,api/* getSpecialistAvailability */.Xz)àà¥(0,formatName/* formatShortName */.H)ÞÞÞßÞÞßßÞßÞÞßšPlanBadge/* PlanBadge */.dÞÿÝÞÞÝÝÞÞÿÞÿÝÞÝÞÝÝÞÞÞލUpgradePromptÜÝÝÝÜÝÝÜÝÝÜÜÜš(0,formatLastSeen/* formatLastSeen */.V)ÜÛÜÜÜÛÜÜÛÛÜÜÛÜÜÛÜÜÜÛÜÜÜÛÜÜÛÛÛÛÛÛÜÛÜÜÛÜÜÛÛÛÜÜÜÛÜÜÛÛÜŸ(0,formatName/* shortName */.E)ÚÛÛéÚÚÛÚÚÚÛÛÛÛÛÛììÚÚÛÛÚÚÛÛÛÚÛÛÚÛÛ¡CategoryIcon/* CategoryIcon */.Ez©(0,CategoryIcon/* isCategoryIconUrl */.V)ØÙØÙØÙÙÙØÙÙÙØÙÙØÙÙÙØØÙÙØØÙÙØÙÙÙÙØÙØÙÙÙÙoÿÿÿ;// ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); // EXPORTS __webpack_require__.d(__webpack_exports__, { "default": () => (/* binding */ UserProfilePage) }); // EXTERNAL MODULE: ../../node_modules/next/dist/compiled/react/jsx-runtime.js var jsx_runtime = __webpack_require__(4568); // EXTERNAL MODULE: ../../node_modules/next/dist/compiled/react/index.js var react = __webpack_require__(7620); // EXTERNAL MODULE: ../../node_modules/next/dist/api/navigation.js var navigation = __webpack_require__(7541); // EXTERNAL MODULE: ./src/context/locale.tsx var context_locale = __webpack_require__(9906); // EXTERNAL MODULE: ./src/lib/auth.ts var auth = __webpack_require__(1592); // EXTERNAL MODULE: ./src/lib/api.ts var api = __webpack_require__(2982); // EXTERNAL MODULE: ../../node_modules/next/dist/client/app-dir/link.js var app_dir_link = __webpack_require__(9664); var link_default = /*#__PURE__*/__webpack_require__.n(app_dir_link); ;// ./src/components/UpgradePrompt.tsx const tierLabels = { free: 'Free', pro: 'Pro', ultimate: 'Ultimate' }; const tierColors = { free: 'bg-gray-50 border-gray-200 text-gray-700', pro: 'bg-green-50 border-green-200 text-gray-800', ultimate: 'bg-amber-50 border-amber-200 text-amber-800' }; const tierBtnColors = { free: 'bg-gray-600 hover:bg-gray-700 text-white', pro: 'bg-green-600 hover:bg-green-700 text-white', ultimate: 'bg-amber-500 hover:bg-amber-600 text-white' }; function UpgradePrompt(param) { let { feature, requiredTier, variant = 'inline', t, className = '' } = param; const tierLabel = tierLabels[requiredTier]; if (variant === 'banner') { return /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex items-center justify-between gap-3 rounded-xl border px-4 py-3 ".concat(tierColors[requiredTier], " ").concat(className), children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex items-center gap-2 min-w-0", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)(LockIcon, { className: "w-4 h-4 shrink-0 opacity-60" }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("span", { className: "text-sm font-medium truncate", children: [ feature, " — ", t('upgrade.available_in', 'Available in'), " ", /*#__PURE__*/ (0,jsx_runtime.jsx)("b", { children: tierLabel }) ] }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)((link_default()), { href: "/pricing?highlight=".concat(requiredTier), className: "shrink-0 text-xs font-semibold px-3 py-1.5 rounded-lg transition ".concat(tierBtnColors[requiredTier]), children: t('upgrade.cta', 'Upgrade') }) ] }); } if (variant === 'block') { return /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "rounded-2xl border p-6 text-center ".concat(tierColors[requiredTier], " ").concat(className), children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)(LockIcon, { className: "w-8 h-8 mx-auto mb-3 opacity-40" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "font-semibold text-base mb-1", children: feature }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("p", { className: "text-sm opacity-70 mb-4", children: [ t('upgrade.available_in', 'Available in plan'), " ", /*#__PURE__*/ (0,jsx_runtime.jsx)("b", { children: tierLabel }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)((link_default()), { href: "/pricing?highlight=".concat(requiredTier), className: "inline-block text-sm font-semibold px-5 py-2 rounded-xl transition ".concat(tierBtnColors[requiredTier]), children: t('upgrade.cta', 'Upgrade plan') }) ] }); } // inline variant return /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex items-center gap-2 text-sm ".concat(className), children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)(LockIcon, { className: "w-4 h-4 text-gray-400 shrink-0" }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("span", { className: "text-gray-500", children: [ t('upgrade.available_in', 'Available in'), " ", /*#__PURE__*/ (0,jsx_runtime.jsx)("b", { className: "text-gray-700", children: tierLabel }), ".", ' ', /*#__PURE__*/ (0,jsx_runtime.jsx)((link_default()), { href: "/pricing?highlight=".concat(requiredTier), className: "text-green-600 hover:underline", children: t('upgrade.cta', 'Upgrade') }) ] }) ] }); } function LockIcon(param) { let { className = '' } = param; return /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { viewBox: "0 0 20 20", fill: "currentColor", className: className, children: /*#__PURE__*/ (0,jsx_runtime.jsx)("path", { fillRule: "evenodd", d: "M10 1a4.5 4.5 0 00-4.5 4.5V9H5a2 2 0 00-2 2v6a2 2 0 002 2h10a2 2 0 002-2v-6a2 2 0 00-2-2h-.5V5.5A4.5 4.5 0 0010 1zm3 8V5.5a3 3 0 10-6 0V9h6z", clipRule: "evenodd" }) }); } // EXTERNAL MODULE: ./src/lib/formatName.ts var formatName = __webpack_require__(1258); // EXTERNAL MODULE: ./src/lib/formatLastSeen.ts var formatLastSeen = __webpack_require__(5338); // EXTERNAL MODULE: ./src/components/PlanBadge.tsx var PlanBadge = __webpack_require__(2035); // EXTERNAL MODULE: ./src/components/CategoryIcon.tsx var CategoryIcon = __webpack_require__(5940); ;// ./src/app/users/[id]/page.tsx /* __next_internal_client_entry_do_not_use__ default auto */ const MONTHS_BY_LOCALE = { ru: [ 'ЯМварь', 'Ѐевраль', 'Март', 'Апрель', 'Май', 'ИюМь', 'Июль', 'Август', 'СеМтябрь', 'Октябрь', 'НПябрь', 'Декабрь' ], en: [ 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December' ], el: [ 'ΙαΜουάριος', 'Ίεβρουάριος', 'Μάρτιος', 'Απρίλιος', 'Μάιος', 'ΙούΜιος', 'Ιούλιος', 'Αύγουστος', 'ΣεπτέΌβριος', 'Οκτώβριος', 'ΝοέΌβριος', 'ΔεκέΌβριος' ], uk: [ 'СічеМь', 'ЛютОй', 'БерезеМь', 'КвітеМь', 'ТравеМь', 'ЧервеМь', 'ЛОпеМь', 'СерпеМь', 'ВересеМь', 'ЖПвтеМь', 'ЛОстПпаЎ', 'ГруЎеМь' ] }; const WEEK_DAYS_BY_LOCALE = { ru: [ 'ПМ', 'Вт', 'Ср', 'Чт', 'Пт', 'Сб', 'Вс' ], en: [ 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa', 'Su' ], el: [ 'Δε', '΀ρ', '΀ε', 'Πε', 'Πα', 'Σά', 'Κυ' ], uk: [ 'ПМ', 'Вт', 'Ср', 'Чт', 'Пт', 'Сб', 'НЎ' ] }; function UserProfilePage() { var _user_firstName, _user_lastName, _user_name_, _user_name, _user_siteSettings, _session_user; const { id } = (0,navigation.useParams)(); const { t, locale } = (0,context_locale/* useLocale */.Y)(); const { data: session } = (0,auth/* useSession */.wV)(); const router = (0,navigation.useRouter)(); const [user, setUser] = (0,react.useState)(null); const [reviews, setReviews] = (0,react.useState)([]); const [rating, setRating] = (0,react.useState)(null); const [loading, setLoading] = (0,react.useState)(true); const [specialistCards, setSpecialistCards] = (0,react.useState)([]); const [priceLists, setPriceLists] = (0,react.useState)({}); const [catMap, setCatMap] = (0,react.useState)(new Map()); const [locMap, setLocMap] = (0,react.useState)(new Map()); const [isFavorite, setIsFavorite] = (0,react.useState)(false); const [favLoading, setFavLoading] = (0,react.useState)(false); const [msgLoading, setMsgLoading] = (0,react.useState)(false); const [canMsg, setCanMsg] = (0,react.useState)(null); // Availability const now = new Date(); const [availYear, setAvailYear] = (0,react.useState)(now.getFullYear()); const [availMonth, setAvailMonth] = (0,react.useState)(now.getMonth()); const [availMap, setAvailMap] = (0,react.useState)({}); const today = new Date().toISOString().slice(0, 10); const dateLocale = locale === 'ru' ? 'ru-RU' : locale === 'uk' ? 'uk-UA' : locale === 'en' ? 'en-US' : 'el-GR'; (0,react.useEffect)(()=>{ if (!id) return; Promise.all([ (0,api/* getUserProfile */.VM)(id, locale), (0,api/* getUserReviews */.v9)(id), (0,api/* getUserRating */.Bm)(id), (0,api/* getCategories */.bW)().catch(()=>[]), (0,api/* getLocations */.Vs)().catch(()=>[]) ]).then((param)=>{ let [u, r, rt, cats, locs] = param; setUser(u); setReviews(r); setRating(rt.avg); setCatMap(new Map(flattenTree(cats).map((c)=>[ c.slug, c ]))); setLocMap(new Map(flattenTree(locs).map((l)=>[ l.slug, l ]))); if (u.role === 'specialist' || u.role === 'admin') { (0,api/* getSpecialistCards */.Bq)(id, locale).then((cards)=>{ setSpecialistCards(cards); cards.forEach((c)=>{ (0,api/* getPriceList */.Ck)(c.id, locale).then((pl)=>{ if (pl.length > 0) setPriceLists((prev)=>({ ...prev, [c.id]: pl })); }).catch(()=>{}); }); }).catch(()=>{}); } }).catch(()=>{}).finally(()=>setLoading(false)); }, [ id, locale ]); // Load favorite status when session available (0,react.useEffect)(()=>{ var _session_user; if (!session || !id) return; (0,api/* getSpecialistFavorites */.pD)().then((rows)=>setIsFavorite(rows.some((r)=>{ var _r_specialist; return ((_r_specialist = r.specialist) === null || _r_specialist === void 0 ? void 0 : _r_specialist.id) === id; }))).catch(()=>{}); // Check if current user can message this person const myId = (_session_user = session.user) === null || _session_user === void 0 ? void 0 : _session_user.id; if (myId && myId !== id) { (0,api/* getCanMessage */.On)(id).then(setCanMsg).catch(()=>{}); } }, [ session, id ]); async function toggleFavorite() { if (!session) { router.push('/register'); return; } setFavLoading(true); try { if (isFavorite) { await (0,api/* removeSpecialistFavorite */.sD)(id); setIsFavorite(false); } else { await (0,api/* addSpecialistFavorite */.V)(id); setIsFavorite(true); } } catch (e) {} setFavLoading(false); } async function handleMessage() { if (!session) { router.push('/login'); return; } setMsgLoading(true); try { const { room } = await (0,api/* getOrCreateDirectRoom */.QN)(id); router.push("/chat?room=".concat(room.id)); } catch (e) {} setMsgLoading(false); } (0,react.useEffect)(()=>{ if (!id) return; const monthKey = "".concat(availYear, "-").concat(String(availMonth + 1).padStart(2, '0')); (0,api/* getSpecialistAvailability */.Xz)(id, monthKey).then((rows)=>{ setAvailMap((prev)=>{ const next = { ...prev }; rows.forEach((r)=>{ next[r.date] = r.status; }); return next; }); }).catch(()=>{}); }, [ id, availYear, availMonth ]); if (loading) return /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "text-center py-20 text-white", children: t('common.loading') }); if (!user) return /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "text-center py-20 text-white/70", children: t('common.error') }); var _user_firstName_, _user_lastName_; const initials = "".concat((_user_firstName_ = (_user_firstName = user.firstName) === null || _user_firstName === void 0 ? void 0 : _user_firstName[0]) !== null && _user_firstName_ !== void 0 ? _user_firstName_ : '').concat((_user_lastName_ = (_user_lastName = user.lastName) === null || _user_lastName === void 0 ? void 0 : _user_lastName[0]) !== null && _user_lastName_ !== void 0 ? _user_lastName_ : '').toUpperCase() || ((_user_name = user.name) === null || _user_name === void 0 ? void 0 : (_user_name_ = _user_name[0]) === null || _user_name_ === void 0 ? void 0 : _user_name_.toUpperCase()) || '?'; const displayName = (0,formatName/* formatShortName */.H)(user.firstName, user.lastName, user.name); const profileBackgroundImage = typeof ((_user_siteSettings = user.siteSettings) === null || _user_siteSettings === void 0 ? void 0 : _user_siteSettings.profileBackgroundImage) === 'string' && user.siteSettings.profileBackgroundImage.trim().length > 0 ? user.siteSettings.profileBackgroundImage : null; return /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "max-w-3xl mx-auto px-4 py-10", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-6 mb-6", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "relative -mx-6 -mt-6 mb-5 h-44 overflow-hidden rounded-t-xl", style: { backgroundImage: profileBackgroundImage ? "linear-gradient(135deg, rgba(21, 128, 61, 0.45), rgba(22, 163, 74, 0.65)), url(".concat(profileBackgroundImage, ")") : 'linear-gradient(135deg, #22c55e 0%, #16a34a 45%, #166534 100%)', backgroundSize: 'cover', backgroundPosition: 'center' }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "absolute inset-0 bg-gradient-to-b from-black/10 to-black/30" }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "relative h-full w-full p-5 flex items-end justify-between", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex items-center gap-3 min-w-0", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "w-14 h-14 rounded-full bg-white/20 border border-white/40 overflow-hidden flex items-center justify-center text-white text-xl font-bold backdrop-blur-sm", children: user.image ? /*#__PURE__*/ (0,jsx_runtime.jsx)("img", { src: user.image, alt: displayName, className: "w-full h-full object-cover" }) : initials }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "min-w-0", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "text-white text-lg font-bold truncate", children: displayName }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("p", { className: "text-white/85 text-xs", children: [ t('profile.member_since'), " ", new Date(user.createdAt).toLocaleDateString(dateLocale) ] }) ] }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "shrink-0", children: [ user.planTier && user.planTier !== 'free' && /*#__PURE__*/ (0,jsx_runtime.jsx)(PlanBadge/* PlanBadge */.d, { tier: user.planTier, verified: user.hasVerifiedBadge, size: "sm" }), user.hasVerifiedBadge && user.planTier === 'free' && /*#__PURE__*/ (0,jsx_runtime.jsx)(PlanBadge/* PlanBadge */.d, { tier: "free", verified: true, size: "sm" }) ] }) ] }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex items-start gap-5", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "w-20 h-20 rounded-full bg-green-100 flex-shrink-0 flex items-center justify-center text-green-700 text-2xl font-bold overflow-hidden border-2 border-gray-100", children: user.image ? /*#__PURE__*/ (0,jsx_runtime.jsx)("img", { src: user.image, alt: displayName, className: "w-full h-full object-cover" }) : initials }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex items-center gap-2 flex-wrap mb-1", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("h1", { className: "text-xl font-bold text-gray-900", children: displayName }), user.planTier && user.planTier !== 'free' && /*#__PURE__*/ (0,jsx_runtime.jsx)(PlanBadge/* PlanBadge */.d, { tier: user.planTier, verified: user.hasVerifiedBadge, size: "sm" }), user.hasVerifiedBadge && user.planTier === 'free' && /*#__PURE__*/ (0,jsx_runtime.jsx)(PlanBadge/* PlanBadge */.d, { tier: "free", verified: true, size: "sm" }), Array.isArray(user.activeStatuses) && user.activeStatuses.includes('can_help_now') && /*#__PURE__*/ (0,jsx_runtime.jsxs)("span", { className: "inline-flex items-center gap-1 text-xs font-medium text-green-700 bg-green-50 border border-green-200 px-2 py-0.5 rounded-full", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "w-1.5 h-1.5 rounded-full bg-green-500 animate-pulse" }), t('status.can_help_now', 'Available now') ] }), Array.isArray(user.activeStatuses) && user.activeStatuses.includes('need_help') && /*#__PURE__*/ (0,jsx_runtime.jsxs)("span", { className: "inline-flex items-center gap-1 text-xs font-medium text-green-700 bg-green-50 border border-green-200 px-2 py-0.5 rounded-full", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "w-1.5 h-1.5 rounded-full bg-green-500" }), t('status.need_help', 'Need help') ] }), (session ? ((_session_user = session.user) === null || _session_user === void 0 ? void 0 : _session_user.id) !== id : true) && /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "ml-auto flex items-center gap-2", children: [ !session ? // Guest — show button that leads to registration /*#__PURE__*/ (0,jsx_runtime.jsxs)("a", { href: "/register", className: "flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-sm font-medium bg-green-50 text-green-600 border border-green-200 hover:bg-green-100 transition", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { children: t('chat.write_btn', 'Write') }) ] }) : (canMsg === null || canMsg === void 0 ? void 0 : canMsg.allowed) === false ? /*#__PURE__*/ (0,jsx_runtime.jsx)(UpgradePrompt, { feature: t('chat.write_btn', 'Write'), requiredTier: "pro", variant: "inline", t: t }) : /*#__PURE__*/ (0,jsx_runtime.jsxs)("button", { onClick: handleMessage, disabled: msgLoading, className: "flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-sm font-medium bg-green-50 text-green-600 border border-green-200 hover:bg-green-100 transition disabled:opacity-50", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { children: t('chat.write_btn') }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("button", { onClick: toggleFavorite, disabled: favLoading, title: isFavorite ? t('specialist.unfavorite') : t('specialist.favorite'), className: "flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-sm font-medium transition disabled:opacity-50 ".concat(isFavorite ? 'bg-pink-50 text-pink-600 border border-pink-200 hover:bg-pink-100' : 'bg-gray-50 text-gray-600 border border-gray-200 hover:bg-gray-100'), children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { children: isFavorite ? '❀' : '🀍' }), /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { children: isFavorite ? t('specialist.unfavorite') : t('specialist.favorite') }) ] }) ] }) ] }), rating && /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex items-center gap-1.5 mb-2", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "text-yellow-400 text-lg", children: "★" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "font-semibold text-gray-800", children: Number(rating).toFixed(1) }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("span", { className: "text-sm text-gray-400", children: [ "(", reviews.length, " ", t('profile.reviews').toLowerCase(), ")" ] }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("p", { className: "text-sm text-gray-400", children: [ t('profile.member_since'), " ", new Date(user.createdAt).toLocaleDateString(dateLocale), user.lastSeenAt && /*#__PURE__*/ (0,jsx_runtime.jsxs)("span", { className: "ml-2", children: [ "\xb7 ", (0,formatLastSeen/* formatLastSeen */.V)(user.lastSeenAt, t) ] }) ] }) ] }) ] }), user.bio && /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "mt-4 text-gray-700 text-sm leading-relaxed border-t border-gray-100 pt-4", children: user.bio }), user.phone && /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "mt-4 border-t border-gray-100 pt-4 flex items-center gap-2", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M3 5a2 2 0 012-2h3.28a1 1 0 01.948.684l1.498 4.493a1 1 0 01-.502 1.21l-2.257 1.13a11.042 11.042 0 005.516 5.516l1.13-2.257a1 1 0 011.21-.502l4.493 1.498a1 1 0 01.684.949V19a2 2 0 01-2 2h-1C9.716 21 3 14.284 3 6V5z" }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)("a", { href: "tel:".concat(user.phone), className: "text-sm font-medium text-gray-700 hover:text-green-600", children: user.phone }) ] }), user.personalSiteSlug && /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "mt-3 flex items-center gap-2", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,jsx_runtime.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" }) }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("a", { href: "/site/".concat(user.personalSiteSlug), target: "_blank", rel: "noopener noreferrer", className: "text-sm text-green-600 hover:underline", children: [ "canhelp.gr/site/", user.personalSiteSlug ] }) ] }), user.languages && user.languages.length > 0 && /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "mt-4 border-t border-gray-100 pt-4", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "text-xs font-medium text-gray-500 mb-2 uppercase tracking-wide", children: t('profile.languages') }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "flex flex-wrap gap-2", children: user.languages.map((code)=>{ const langMap = { el: { flag: '🇬🇷', label: 'ΕλληΜικά' }, en: { flag: '🇬🇧', label: 'English' }, ru: { flag: '🇷🇺', label: 'РусскОй' }, uk: { flag: '🇺🇊', label: 'УкраїМська' }, de: { flag: '🇩🇪', label: 'Deutsch' }, fr: { flag: '🇫🇷', label: 'Français' }, it: { flag: '🇮🇹', label: 'Italiano' }, es: { flag: '🇪🇞', label: 'Español' }, ar: { flag: '🇞🇊', label: 'العرؚية' }, zh: { flag: '🇚🇳', label: 'äž­æ–‡' } }; const lang = langMap[code]; if (!lang) return null; return /*#__PURE__*/ (0,jsx_runtime.jsxs)("span", { className: "flex items-center gap-1.5 bg-indigo-50 text-indigo-700 text-sm px-3 py-1 rounded-full border border-indigo-100", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { children: lang.flag }), /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { children: lang.label }) ] }, code); }) }) ] }), user.skills && user.skills.length > 0 && specialistCards.length === 0 && /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "mt-4 border-t border-gray-100 pt-4", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "text-xs font-medium text-gray-500 mb-2 uppercase tracking-wide", children: t('profile.skills.label') }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "flex flex-wrap gap-2", children: user.skills.map((skill)=>/*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "bg-green-50 text-green-700 text-sm px-3 py-1 rounded-full", children: skill }, skill)) }) ] }), user.role === 'specialist' && user.specialistCategories && user.specialistCategories.length > 0 && specialistCards.length === 0 && /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "mt-4 border-t border-gray-100 pt-4", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "text-xs font-medium text-gray-500 mb-2 uppercase tracking-wide", children: t('user.categories') }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "flex flex-wrap gap-2", children: user.specialistCategories.map((slug)=>/*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "bg-purple-50 text-purple-700 text-sm px-3 py-1 rounded-full", children: slug }, slug)) }) ] }), user.role === 'specialist' && user.specialistLocations && user.specialistLocations.length > 0 && specialistCards.length === 0 && /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "mt-4 border-t border-gray-100 pt-4", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "text-xs font-medium text-gray-500 mb-2 uppercase tracking-wide", children: t('user.work_area') }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "flex flex-wrap gap-2", children: user.specialistLocations.map((slug)=>/*#__PURE__*/ (0,jsx_runtime.jsxs)("span", { className: "bg-emerald-50 text-emerald-700 text-sm px-3 py-1 rounded-full", children: [ "\uD83D\uDCCD ", slug ] }, slug)) }) ] }) ] }), user.role === 'specialist' && /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-6 mb-6", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex items-center justify-between mb-4", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("h2", { className: "font-bold text-gray-900 text-lg", children: [ "\uD83D\uDCC5 ", t('nav.schedule') ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex items-center gap-3 text-xs text-gray-500", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("span", { className: "flex items-center gap-1.5", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "w-3 h-3 rounded bg-emerald-200 border border-emerald-400 inline-block" }), t('schedule.available') ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("span", { className: "flex items-center gap-1.5", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "w-3 h-3 rounded bg-red-200 border border-red-400 inline-block" }), t('schedule.busy') ] }) ] }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)(ReadOnlyCalendar, { year: availYear, month: availMonth, availMap: availMap, today: today, onPrev: ()=>{ if (availMonth === 0) { setAvailYear((y)=>y - 1); setAvailMonth(11); } else setAvailMonth((m)=>m - 1); }, onNext: ()=>{ if (availMonth === 11) { setAvailYear((y)=>y + 1); setAvailMonth(0); } else setAvailMonth((m)=>m + 1); } }) ] }), (user.role === 'specialist' || user.role === 'admin') && specialistCards.length > 0 && /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "space-y-4 mb-6", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("h2", { className: "font-bold text-white text-lg", children: t('nav.specialists') }), specialistCards.map((card)=>{ var _priceLists_card_id; return /*#__PURE__*/ (0,jsx_runtime.jsx)(PublicCardView, { card: card, locale: locale, catMap: catMap, locMap: locMap, t: t, priceList: (_priceLists_card_id = priceLists[card.id]) !== null && _priceLists_card_id !== void 0 ? _priceLists_card_id : [] }, card.id); }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("h2", { className: "font-bold text-gray-900 text-lg mb-4", children: [ t('profile.reviews'), reviews.length > 0 && /*#__PURE__*/ (0,jsx_runtime.jsxs)("span", { className: "text-gray-400 font-normal text-base ml-2", children: [ "(", reviews.length, ")" ] }) ] }), reviews.length === 0 ? /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "text-gray-500 text-sm", children: t('profile.no_reviews') }) : /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "space-y-4", children: reviews.map((param)=>{ let { review, author } = param; var _author_name_, _author_name; var _author_name__toUpperCase, _shortName; return /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "border-b border-gray-50 pb-4 last:border-0 last:pb-0", children: /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex items-start gap-3", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "w-8 h-8 rounded-full bg-gray-100 flex-shrink-0 flex items-center justify-center text-gray-600 text-sm font-bold overflow-hidden", children: (author === null || author === void 0 ? void 0 : author.image) ? /*#__PURE__*/ (0,jsx_runtime.jsx)("img", { src: author.image, alt: author.name, className: "w-full h-full object-cover" }) : (_author_name__toUpperCase = author === null || author === void 0 ? void 0 : (_author_name = author.name) === null || _author_name === void 0 ? void 0 : (_author_name_ = _author_name[0]) === null || _author_name_ === void 0 ? void 0 : _author_name_.toUpperCase()) !== null && _author_name__toUpperCase !== void 0 ? _author_name__toUpperCase : '?' }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex-1", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex items-center gap-2 mb-1", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "text-sm font-medium text-gray-800", children: (_shortName = (0,formatName/* shortName */.E)(author === null || author === void 0 ? void 0 : author.name)) !== null && _shortName !== void 0 ? _shortName : '—' }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("span", { className: "text-yellow-400", children: [ '★'.repeat(review.rating), '☆'.repeat(5 - review.rating) ] }) ] }), review.comment && /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "text-sm text-gray-600", children: review.comment }), /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "text-xs text-gray-400 mt-1", children: new Date(review.createdAt).toLocaleDateString(dateLocale) }) ] }) ] }) }, review.id); }) }) ] }) ] }); } function ReadOnlyCalendar(param) { let { year, month, availMap, today, onPrev, onNext } = param; const { locale, t } = (0,context_locale/* useLocale */.Y)(); var _WEEK_DAYS_BY_LOCALE_locale; const weekDays = (_WEEK_DAYS_BY_LOCALE_locale = WEEK_DAYS_BY_LOCALE[locale]) !== null && _WEEK_DAYS_BY_LOCALE_locale !== void 0 ? _WEEK_DAYS_BY_LOCALE_locale : WEEK_DAYS_BY_LOCALE.ru; var _MONTHS_BY_LOCALE_locale; const months = (_MONTHS_BY_LOCALE_locale = MONTHS_BY_LOCALE[locale]) !== null && _MONTHS_BY_LOCALE_locale !== void 0 ? _MONTHS_BY_LOCALE_locale : MONTHS_BY_LOCALE.ru; const firstDay = new Date(year, month, 1); const startDow = (firstDay.getDay() + 6) % 7; const daysInMonth = new Date(year, month + 1, 0).getDate(); const prevMonthDays = new Date(year, month, 0).getDate(); const cells = []; for(let i = startDow - 1; i >= 0; i--){ cells.push({ day: prevMonthDays - i, cur: false, dateKey: '' }); } for(let d = 1; d <= daysInMonth; d++){ const dateKey = "".concat(year, "-").concat(String(month + 1).padStart(2, '0'), "-").concat(String(d).padStart(2, '0')); cells.push({ day: d, cur: true, dateKey }); } const remainder = cells.length % 7; if (remainder !== 0) { for(let d = 1; d <= 7 - remainder; d++){ cells.push({ day: d, cur: false, dateKey: '' }); } } const monthPrefix = "".concat(year, "-").concat(String(month + 1).padStart(2, '0')); const availCount = Object.entries(availMap).filter((param)=>{ let [k, v] = param; return k.startsWith(monthPrefix) && k >= today && v === 'available'; }).length; return /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex items-center justify-between mb-3", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { onClick: onPrev, className: "w-7 h-7 rounded-lg hover:bg-gray-100 flex items-center justify-center text-gray-500", children: "‹" }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "text-center", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("span", { className: "font-medium text-gray-800 text-sm", children: [ months[month], " ", year ] }), availCount > 0 && /*#__PURE__*/ (0,jsx_runtime.jsxs)("span", { className: "ml-2 text-xs text-emerald-600", children: [ availCount, " ", t('schedule.free_days') ] }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { onClick: onNext, className: "w-7 h-7 rounded-lg hover:bg-gray-100 flex items-center justify-center text-gray-500", children: "›" }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "grid grid-cols-7 mb-1", children: weekDays.map((d)=>/*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "text-center text-xs text-gray-400 py-1", children: d }, d)) }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "grid grid-cols-7 gap-0.5", children: cells.map((cell, idx)=>{ if (!cell.cur) { return /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "h-9 flex items-center justify-center text-xs text-gray-200", children: cell.day }, "e-".concat(idx)); } const status = availMap[cell.dateKey]; const isPast = cell.dateKey < today; const isToday = cell.dateKey === today; let cls = 'h-9 flex items-center justify-center rounded-lg text-sm font-medium '; if (isPast) { cls += 'text-gray-200 '; } else if (status === 'available') { cls += 'bg-emerald-100 border border-emerald-300 text-emerald-700 '; } else if (status === 'busy') { cls += 'bg-red-100 border border-red-300 text-red-600 '; } else { cls += 'text-gray-500 '; } if (isToday) cls += 'ring-2 ring-blue-400 ring-offset-1 '; return /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: cls, children: cell.day }, cell.dateKey); }) }) ] }); } // ─── Public card view ───────────────────────────────────────────────────────── function flattenTree(nodes) { return nodes.flatMap((n)=>{ var _n_children; return [ n, ...flattenTree((_n_children = n.children) !== null && _n_children !== void 0 ? _n_children : []) ]; }); } function PublicCardView(param) { let { card, locale, catMap, locMap, t, priceList } = param; const [lightbox, setLightbox] = (0,react.useState)(null); const [expandedAreas, setExpandedAreas] = (0,react.useState)([]); const locById = new Map(); for (const node of locMap.values()){ if (node === null || node === void 0 ? void 0 : node.id) locById.set(node.id, node); } const getLocName = (loc, fallback)=>{ var _loc_names, _loc_names1; return (loc === null || loc === void 0 ? void 0 : (_loc_names = loc.names) === null || _loc_names === void 0 ? void 0 : _loc_names[locale]) || (loc === null || loc === void 0 ? void 0 : (_loc_names1 = loc.names) === null || _loc_names1 === void 0 ? void 0 : _loc_names1.el) || fallback; }; const locationGroups = (()=>{ const grouped = new Map(); var _card_locations; for (const slug of (_card_locations = card.locations) !== null && _card_locations !== void 0 ? _card_locations : []){ const loc = locMap.get(slug); if (!loc) { if (!grouped.has(slug)) { grouped.set(slug, { root: { slug, names: { el: slug } }, rootSlug: slug, districts: [], districtSlugs: new Set() }); } continue; } let root = loc; const seenIds = new Set(); while((root === null || root === void 0 ? void 0 : root.parentId) && locById.has(root.parentId) && !seenIds.has(root.parentId)){ seenIds.add(root.parentId); root = locById.get(root.parentId); } var _root_slug; const rootSlug = (_root_slug = root === null || root === void 0 ? void 0 : root.slug) !== null && _root_slug !== void 0 ? _root_slug : slug; if (!grouped.has(rootSlug)) { grouped.set(rootSlug, { root, rootSlug, districts: [], districtSlugs: new Set() }); } const group = grouped.get(rootSlug); if (loc.slug !== rootSlug && !group.districtSlugs.has(loc.slug)) { group.districtSlugs.add(loc.slug); group.districts.push(loc); } } return Array.from(grouped.values()); })(); var _lightbox_title; return /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 overflow-hidden", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "px-5 py-4 border-b border-gray-100", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("h3", { className: "font-bold text-gray-900", children: card.title }), card.description && /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "text-sm text-gray-600 mt-1", children: card.description }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "p-5 space-y-4", children: [ card.skills && card.skills.length > 0 && /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "text-xs font-semibold text-gray-500 uppercase tracking-wide mb-2", children: t('card.skills') }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "flex flex-wrap gap-2", children: card.skills.map((s)=>/*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "bg-green-50 text-green-700 text-sm px-3 py-1 rounded-full", children: s }, s)) }) ] }), card.categories && card.categories.length > 0 && /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "text-xs font-semibold text-gray-500 uppercase tracking-wide mb-2", children: t('card.categories') }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "flex flex-wrap gap-2", children: card.categories.map((s)=>{ var _cat_names, _cat_names1; const cat = catMap.get(s); const name = cat ? ((_cat_names = cat.names) === null || _cat_names === void 0 ? void 0 : _cat_names[locale]) || ((_cat_names1 = cat.names) === null || _cat_names1 === void 0 ? void 0 : _cat_names1.el) || s : s; return /*#__PURE__*/ (0,jsx_runtime.jsxs)("span", { className: "bg-purple-50 text-purple-700 text-sm px-3 py-1 rounded-full", children: [ (cat === null || cat === void 0 ? void 0 : cat.icon) ? /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "mr-1 inline-flex align-middle", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(CategoryIcon/* CategoryIcon */.Ez, { icon: cat.icon, alt: name, className: (0,CategoryIcon/* isCategoryIconUrl */.V)(cat.icon) ? 'h-4 w-4 object-contain' : 'text-sm leading-none', fallback: "\uD83D\uDCE6" }) }) : null, name ] }, s); }) }) ] }), card.locations && card.locations.length > 0 && /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "text-xs font-semibold text-gray-500 uppercase tracking-wide mb-2", children: t('user.work_area') }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "space-y-2", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "flex flex-wrap gap-2", children: locationGroups.map((group)=>{ const expanded = expandedAreas.includes(group.rootSlug); const canExpand = group.districts.length > 0; return /*#__PURE__*/ (0,jsx_runtime.jsxs)("button", { type: "button", onClick: ()=>{ if (!canExpand) return; setExpandedAreas((prev)=>prev.includes(group.rootSlug) ? prev.filter((slug)=>slug !== group.rootSlug) : [ ...prev, group.rootSlug ]); }, className: "inline-flex items-center gap-1.5 text-sm px-3 py-1.5 rounded-full border transition ".concat(expanded ? 'bg-emerald-100 text-emerald-800 border-emerald-300' : 'bg-emerald-50 text-emerald-700 border-emerald-200 hover:bg-emerald-100', " ").concat(canExpand ? 'cursor-pointer' : 'cursor-default'), children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { children: "\uD83D\uDCCD" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { children: getLocName(group.root, group.rootSlug) }), canExpand && /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "text-[11px] font-semibold px-1.5 py-0.5 rounded-full bg-white/80 text-emerald-700 border border-emerald-200", children: expanded ? '−' : "+".concat(group.districts.length) }) ] }, group.rootSlug); }) }), locationGroups.filter((group)=>expandedAreas.includes(group.rootSlug) && group.districts.length > 0).map((group)=>/*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "rounded-xl border border-emerald-100 bg-emerald-50/40 p-3", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "text-xs text-emerald-700 font-medium mb-2", children: getLocName(group.root, group.rootSlug) }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "flex flex-wrap gap-1.5", children: group.districts.map((district)=>/*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "text-xs px-2.5 py-1 rounded-full bg-white border border-emerald-200 text-emerald-700", children: getLocName(district, district.slug) }, district.slug)) }) ] }, "".concat(group.rootSlug, "-children"))) ] }) ] }), priceList.length > 0 && /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "text-xs font-semibold text-gray-500 uppercase tracking-wide mb-3", children: t('profile.card.tab.pricelist') }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "space-y-3", children: priceList.map((group)=>/*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "border border-gray-200 rounded-xl overflow-hidden", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "bg-gray-50 px-4 py-2 border-b border-gray-200", children: /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "font-semibold text-sm text-gray-800", children: group.title }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "divide-y divide-gray-100", children: group.items.map((item)=>/*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex items-center gap-3 px-4 py-2.5 text-sm", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "font-medium text-gray-800", children: item.name }), item.description && /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "text-xs text-gray-500", children: item.description }) ] }), (item.price || item.unit) && /*#__PURE__*/ (0,jsx_runtime.jsxs)("span", { className: "text-green-700 font-semibold whitespace-nowrap", children: [ item.price ? "€".concat(item.price) : '', item.unit ? " ".concat(item.unit) : '' ] }) ] }, item.id)) }) ] }, group.id)) }) ] }), card.portfolio && card.portfolio.length > 0 && /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "text-xs font-semibold text-gray-500 uppercase tracking-wide mb-2", children: t('card.portfolio') }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "grid grid-cols-2 sm:grid-cols-3 gap-3", children: card.portfolio.map((item)=>{ var _item_title; return /*#__PURE__*/ (0,jsx_runtime.jsxs)("button", { type: "button", onClick: ()=>setLightbox(item), className: "group relative rounded-xl overflow-hidden border border-gray-200 bg-gray-50 text-left", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("img", { src: item.imageUrl, alt: (_item_title = item.title) !== null && _item_title !== void 0 ? _item_title : '', className: "w-full aspect-square object-cover group-hover:scale-105 transition-transform duration-200" }), item.title && /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "px-2 py-1.5", children: /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "text-xs font-medium text-gray-700 truncate", children: item.title }) }) ] }, item.id); }) }) ] }) ] }), lightbox && /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "fixed inset-0 z-50 flex items-center justify-center bg-black/80 px-4", onClick: ()=>setLightbox(null), children: /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "bg-white rounded-2xl overflow-hidden max-w-lg w-full shadow-2xl", onClick: (e)=>e.stopPropagation(), children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("img", { src: lightbox.imageUrl, alt: (_lightbox_title = lightbox.title) !== null && _lightbox_title !== void 0 ? _lightbox_title : '', className: "w-full max-h-[60vh] object-contain bg-gray-900" }), (lightbox.title || lightbox.description) && /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "p-4", children: [ lightbox.title && /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "font-semibold text-gray-800 mb-1", children: lightbox.title }), lightbox.description && /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "text-sm text-gray-600", children: lightbox.description }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "flex justify-end px-4 pb-4", children: /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { type: "button", onClick: ()=>setLightbox(null), className: "text-sm text-gray-500 hover:text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-100", children: t('card.close') }) }) ] }) }) ] }); } pÿÿÿsÿÿÿ ` tÿÿÿà// ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); // EXPORTS __webpack_require__.d(__webpack_exports__, { "default": () => (/* binding */ UserProfilePage) }); // EXTERNAL MODULE: ../../node_modules/next/dist/compiled/react/jsx-runtime.js var jsx_runtime = __webpack_require__(4568); // EXTERNAL MODULE: ../../node_modules/next/dist/compiled/react/index.js var react = __webpack_require__(7620); // EXTERNAL MODULE: ../../node_modules/next/dist/api/navigation.js var navigation = __webpack_require__(7541); // EXTERNAL MODULE: ./src/context/locale.tsx var context_locale = __webpack_require__(9906); // EXTERNAL MODULE: ./src/lib/auth.ts var auth = __webpack_require__(1592); // EXTERNAL MODULE: ./src/lib/api.ts var api = __webpack_require__(2982); // EXTERNAL MODULE: ../../node_modules/next/dist/client/app-dir/link.js var app_dir_link = __webpack_require__(9664); var link_default = /*#__PURE__*/__webpack_require__.n(app_dir_link); ;// ./src/components/UpgradePrompt.tsx ßuÿÿÿÄþÿÿ%062undefined6492undefined565571undefined795799__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined10151019__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined11661169__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined13181322__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined16831686__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined19151918__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined19201923__WEBPACK_MODULE_REFERENCE__6_5b2264656661756c74225d_directImport_asiSafe1__._undefined23032307__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined24902493__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined26222625__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined27852789__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined30273030__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined31863189__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined31913194__WEBPACK_MODULE_REFERENCE__6_5b2264656661756c74225d_directImport_asiSafe1__._undefined35683572__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined37023705__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined38213825__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined40314034__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined42474250__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined42524255__WEBPACK_MODULE_REFERENCE__6_5b2264656661756c74225d_directImport_asiSafe1__._undefined46294632__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined47654768__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined696772(0,jsx_runtime.jsxs)undefined9881064(0,jsx_runtime.jsxs)undefined12111285(0,jsx_runtime.jsx)undefined14341510(0,jsx_runtime.jsxs)undefined18711945(0,jsx_runtime.jsx)undefined21742248(0,jsx_runtime.jsx)undefined22502327(link_default())undefined27072783(0,jsx_runtime.jsxs)undefined29663040(0,jsx_runtime.jsx)undefined31693243(0,jsx_runtime.jsx)undefined34033479(0,jsx_runtime.jsxs)undefined37173791(0,jsx_runtime.jsx)undefined39474021(0,jsx_runtime.jsx)undefined40234100(link_default())undefined44744550(0,jsx_runtime.jsxs)undefined46804754(0,jsx_runtime.jsx)undefined48704946(0,jsx_runtime.jsxs)undefined51525226(0,jsx_runtime.jsx)undefined54395513(0,jsx_runtime.jsx)undefined55155592(link_default())undefined59666040(0,jsx_runtime.jsx)undefined61736247(0,jsx_runtime.jsx)undefinedRawSource // EXTERNAL MODULE: ./src/lib/formatName.ts var formatName = __webpack_require__(1258); // EXTERNAL MODULE: ./src/lib/formatLastSeen.ts var formatLastSeen = __webpack_require__(5338); // EXTERNAL MODULE: ./src/components/PlanBadge.tsx var PlanBadge = __webpack_require__(2035); // EXTERNAL MODULE: ./src/components/CategoryIcon.tsx var CategoryIcon = __webpack_require__(5940); ;// ./src/app/users/[id]/page.tsx Ürÿÿÿ\ëÿÿåR61123undefined125168undefined170224undefined226270undefined272311undefined313587undefined589647undefined649710undefined712765undefined767817undefined819894undefined23812395undefined25452553__WEBPACK_MODULE_REFERENCE__2_5b22757365506172616d73225d_call_directImport_asiSafe1__._undefined25842592__WEBPACK_MODULE_REFERENCE__3_5b227573654c6f63616c65225d_call_directImport_asiSafe1__._undefined26272636__WEBPACK_MODULE_REFERENCE__4_5b2275736553657373696f6e225d_call_directImport_asiSafe1__._undefined26602668__WEBPACK_MODULE_REFERENCE__2_5b22757365526f75746572225d_call_directImport_asiSafe1__._undefined27012708__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined27512758__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined27972804__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined28472854__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined29132920__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined29672974__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined30133020__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined30663073__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined31273134__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined31843191__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined32413248__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined32903297__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined33923399__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined34613468__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined35233530__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined37143722__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined37893802__WEBPACK_MODULE_REFERENCE__5_5b226765745573657250726f66696c65225d_call_directImport_asiSafe1__._undefined38293842__WEBPACK_MODULE_REFERENCE__5_5b226765745573657252657669657773225d_call_directImport_asiSafe1__._undefined38613873__WEBPACK_MODULE_REFERENCE__5_5b2267657455736572526174696e67225d_call_directImport_asiSafe1__._undefined38923904__WEBPACK_MODULE_REFERENCE__5_5b2267657443617465676f72696573225d_call_directImport_asiSafe1__._undefined39353946__WEBPACK_MODULE_REFERENCE__5_5b226765744c6f636174696f6e73225d_call_directImport_asiSafe1__._undefined44644481__WEBPACK_MODULE_REFERENCE__5_5b226765745370656369616c6973744361726473225d_call_directImport_asiSafe1__._undefined46234634__WEBPACK_MODULE_REFERENCE__5_5b2267657450726963654c697374225d_call_directImport_asiSafe1__._undefined51345142__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined52225243__WEBPACK_MODULE_REFERENCE__5_5b226765745370656369616c6973744661766f7269746573225d_call_directImport_asiSafe1__._undefined57095721__WEBPACK_MODULE_REFERENCE__5_5b2267657443616e4d657373616765225d_call_directImport_asiSafe1__._undefined60386061__WEBPACK_MODULE_REFERENCE__5_5b2272656d6f76655370656369616c6973744661766f72697465225d_call_directImport_asiSafe1__._undefined61496169__WEBPACK_MODULE_REFERENCE__5_5b226164645370656369616c6973744661766f72697465225d_call_directImport_asiSafe1__._undefined64906510__WEBPACK_MODULE_REFERENCE__5_5b226765744f72437265617465446972656374526f6f6d225d_call_directImport_asiSafe1__._undefined66366644__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined67856809__WEBPACK_MODULE_REFERENCE__5_5b226765745370656369616c697374417661696c6162696c697479225d_call_directImport_asiSafe1__._undefined72297232__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined73767379__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined81658179__WEBPACK_MODULE_REFERENCE__8_5b22666f726d617453686f72744e616d65225d_call_directImport_asiSafe1__._undefined85558559__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined86678671__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined88268830__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined94439446__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined96369640__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined98499853__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1006010063__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1037410377__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1078710791__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1099811001__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1131811322__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1210112105__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1233412337__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1233912347__WEBPACK_MODULE_REFERENCE__10_5b22506c616e4261646765225d_directImport_asiSafe1__._undefined1272012723__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1272512733__WEBPACK_MODULE_REFERENCE__10_5b22506c616e4261646765225d_directImport_asiSafe1__._undefined1320013204__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1335413357__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1364113644__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1395813962__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1412814132__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1434614349__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1467414677__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1467914687__WEBPACK_MODULE_REFERENCE__10_5b22506c616e4261646765225d_directImport_asiSafe1__._undefined1506015063__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1506515073__WEBPACK_MODULE_REFERENCE__10_5b22506c616e4261646765225d_directImport_asiSafe1__._undefined1545515459__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1578615789__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1631116315__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1664216645__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1719017194__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1753817542__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1798817991__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1851018513__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1914619149__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1953319536__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1953819550__WEBPACK_MODULE_REFERENCE__7_5b225570677261646550726f6d7074225d_directImport_asiSafe1__._undefined1993419938__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2049220495__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2101421017__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2165021653__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2200222006__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2278222785__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2303423037__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2360523609__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2381523818__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2408424087__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2437924383__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2509425098__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2553325537__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2578925802__WEBPACK_MODULE_REFERENCE__9_5b22666f726d61744c6173745365656e225d_call_directImport_asiSafe1__._undefined2616326166__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2640126405__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2659126594__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2694426947__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2744427447__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2781527819__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2797527978__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2832828331__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2869128695__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2933129335__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2949729500__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2975729760__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3226332267__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3255432557__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3274332746__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3318533189__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3335133354__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3361433617__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3377633779__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3425234256__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3441834421__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3467634679__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3485134854__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3532535329__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3549135494__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3574835751__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3592235926__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3647436478__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3663336637__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3680336807__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3715437158__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3735537359__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3756137564__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3795537959__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3816138164__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3864038643__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3957639580__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3969839701__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4000140004__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4050340507__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4065740661__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4089640900__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4134841351__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4151741520__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4187741880__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4204642050__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4223642239__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4256942572__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4329843302__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4349643500__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4374043743__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4394743955__WEBPACK_MODULE_REFERENCE__8_5b2273686f72744e616d65225d_call_directImport_asiSafe1__._undefined4420244206__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4487244875__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4516345166__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4587445882__WEBPACK_MODULE_REFERENCE__3_5b227573654c6f63616c65225d_call_directImport_asiSafe1__._undefined4755647560__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4761747621__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4776347766__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4803948043__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4818248186__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4858148585__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4901549018__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4931649319__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4944049443__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4963649639__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4983849841__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5093250935__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5158551592__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined5164751654__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined5409754101__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5423954243__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5438154384__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5457954582__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5479054794__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5495254956__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5504555048__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5530155304__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5545955462__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5584555849__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5593855941__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5619856201__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5678156785__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5707657079__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5725557258__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5726057271__WEBPACK_MODULE_REFERENCE__11_5b2243617465676f727949636f6e225d_directImport_asiSafe1__._undefined5747057486__WEBPACK_MODULE_REFERENCE__11_5b22697343617465676f727949636f6e55726c225d_call_directImport_asiSafe1__._undefined5806558069__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5815858161__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5841758421__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5858258585__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5900759011__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined6012260125__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6034060343__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6059560598__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6132261326__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined6157161574__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6190661909__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6211762120__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6282662830__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined6291962922__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6319063193__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6333963343__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined6356863571__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6376263765__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6411064113__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6430764311__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined6457864582__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined6484464847__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6523465237__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6575765761__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined6674466748__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined6683766840__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6709667099__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6737567379__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined6777167774__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6825968262__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6841968422__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6898968992__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6919069194__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined6942869431__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6982369827__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined6998869991__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7025070253__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7053270535__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7066770670__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined(!17061792(0,navigation.useParams)undefined18231909(0,context_locale/* useLocale */.Y)undefined19442032(0,auth/* useSession */.wV)undefined20562142(0,navigation.useRouter)undefined21752259(0,react.useState)undefined23022386(0,react.useState)undefined24252509(0,react.useState)undefined25522636(0,react.useState)undefined26952779(0,react.useState)undefined28262910(0,react.useState)undefined29493033(0,react.useState)undefined30793163(0,react.useState)undefined32173301(0,react.useState)undefined33513435(0,react.useState)undefined34853569(0,react.useState)undefined36113695(0,react.useState)undefined37903874(0,react.useState)undefined39364020(0,react.useState)undefined40754159(0,react.useState)undefined43434429(0,react.useEffect)undefined44964592(0,api/* getUserProfile */.VM)undefined46194715(0,api/* getUserReviews */.v9)undefined47344828(0,api/* getUserRating */.Bm)undefined48474941(0,api/* getCategories */.bW)undefined49725064(0,api/* getLocations */.Vs)undefined55825686(0,api/* getSpecialistCards */.Bq)undefined58285920(0,api/* getPriceList */.Ck)undefined64206506(0,react.useEffect)undefined65866698(0,api/* getSpecialistFavorites */.pD)undefined71647258(0,api/* getCanMessage */.On)undefined75757691(0,api/* removeSpecialistFavorite */.sD)undefined77797889(0,api/* addSpecialistFavorite */.V)undefined82108320(0,api/* getOrCreateDirectRoom */.QN)undefined84468532(0,react.useEffect)undefined86738791(0,api/* getSpecialistAvailability */.Xz)undefined92119285(0,jsx_runtime.jsx)undefined94299503(0,jsx_runtime.jsx)undefined1028910387(0,formatName/* formatShortName */.H)undefined1076310839(0,jsx_runtime.jsxs)undefined1094711023(0,jsx_runtime.jsxs)undefined1117811254(0,jsx_runtime.jsxs)undefined1186711941(0,jsx_runtime.jsx)undefined1213112207(0,jsx_runtime.jsxs)undefined1241612492(0,jsx_runtime.jsxs)undefined1269912773(0,jsx_runtime.jsx)undefined1308413158(0,jsx_runtime.jsx)undefined1356813644(0,jsx_runtime.jsxs)undefined1385113925(0,jsx_runtime.jsx)undefined1424214318(0,jsx_runtime.jsxs)undefined1509715173(0,jsx_runtime.jsxs)undefined1540215476(0,jsx_runtime.jsx)undefined1547815560PlanBadge/* PlanBadge */.dundefined1593316007(0,jsx_runtime.jsx)undefined1600916091PlanBadge/* PlanBadge */.dundefined1655816634(0,jsx_runtime.jsxs)undefined1678416858(0,jsx_runtime.jsx)undefined1714217216(0,jsx_runtime.jsx)undefined1753017606(0,jsx_runtime.jsxs)undefined1777217848(0,jsx_runtime.jsxs)undefined1806218136(0,jsx_runtime.jsx)undefined1846118535(0,jsx_runtime.jsx)undefined1853718619PlanBadge/* PlanBadge */.dundefined1899219066(0,jsx_runtime.jsx)undefined1906819150PlanBadge/* PlanBadge */.dundefined1953219608(0,jsx_runtime.jsxs)undefined1993520009(0,jsx_runtime.jsx)undefined2053120607(0,jsx_runtime.jsxs)undefined2093421008(0,jsx_runtime.jsx)undefined2155321629(0,jsx_runtime.jsxs)undefined2197322049(0,jsx_runtime.jsxs)undefined2249522569(0,jsx_runtime.jsx)undefined2308823162(0,jsx_runtime.jsx)undefined2379523869(0,jsx_runtime.jsx)undefined2425324327(0,jsx_runtime.jsx)undefined2432924418UpgradePromptundefined2480224878(0,jsx_runtime.jsxs)undefined2543225506(0,jsx_runtime.jsx)undefined2602526099(0,jsx_runtime.jsx)undefined2673226806(0,jsx_runtime.jsx)undefined2715527231(0,jsx_runtime.jsxs)undefined2800728081(0,jsx_runtime.jsx)undefined2833028404(0,jsx_runtime.jsx)undefined2897229048(0,jsx_runtime.jsxs)undefined2925429328(0,jsx_runtime.jsx)undefined2959429668(0,jsx_runtime.jsx)undefined2996030036(0,jsx_runtime.jsxs)undefined3074730823(0,jsx_runtime.jsxs)undefined3125831334(0,jsx_runtime.jsxs)undefined3158631682(0,formatLastSeen/* formatLastSeen */.V)undefined3204332117(0,jsx_runtime.jsx)undefined3235232428(0,jsx_runtime.jsxs)undefined3261432688(0,jsx_runtime.jsx)undefined3303833112(0,jsx_runtime.jsx)undefined3360933683(0,jsx_runtime.jsx)undefined3405134127(0,jsx_runtime.jsxs)undefined3428334357(0,jsx_runtime.jsx)undefined3470734781(0,jsx_runtime.jsx)undefined3514135217(0,jsx_runtime.jsxs)undefined3585335929(0,jsx_runtime.jsxs)undefined3609136165(0,jsx_runtime.jsx)undefined3642236496(0,jsx_runtime.jsx)undefined3899939075(0,jsx_runtime.jsxs)undefined3936239436(0,jsx_runtime.jsx)undefined3962239696(0,jsx_runtime.jsx)undefined4013540211(0,jsx_runtime.jsxs)undefined4037340447(0,jsx_runtime.jsx)undefined4070740781(0,jsx_runtime.jsx)undefined4094041014(0,jsx_runtime.jsx)undefined4148741563(0,jsx_runtime.jsxs)undefined4172541799(0,jsx_runtime.jsx)undefined4205442128(0,jsx_runtime.jsx)undefined4230042374(0,jsx_runtime.jsx)undefined4284542921(0,jsx_runtime.jsxs)undefined4308343157(0,jsx_runtime.jsx)undefined4341143485(0,jsx_runtime.jsx)undefined4365643732(0,jsx_runtime.jsxs)undefined4428044356(0,jsx_runtime.jsxs)undefined4451144587(0,jsx_runtime.jsxs)undefined4475344829(0,jsx_runtime.jsxs)undefined4517645252(0,jsx_runtime.jsxs)undefined4544945525(0,jsx_runtime.jsxs)undefined4572745801(0,jsx_runtime.jsx)undefined4619246268(0,jsx_runtime.jsxs)undefined4647046544(0,jsx_runtime.jsx)undefined4702047094(0,jsx_runtime.jsx)undefined4802748103(0,jsx_runtime.jsxs)undefined4822148295(0,jsx_runtime.jsx)undefined4859548669(0,jsx_runtime.jsx)undefined4916849244(0,jsx_runtime.jsxs)undefined4939449470(0,jsx_runtime.jsxs)undefined4970549781(0,jsx_runtime.jsxs)undefined5022950303(0,jsx_runtime.jsx)undefined5046950543(0,jsx_runtime.jsx)undefined5090050974(0,jsx_runtime.jsx)undefined5114051216(0,jsx_runtime.jsxs)undefined5140251476(0,jsx_runtime.jsx)undefined5180651880(0,jsx_runtime.jsx)undefined5260652682(0,jsx_runtime.jsxs)undefined5287652952(0,jsx_runtime.jsxs)undefined5319253266(0,jsx_runtime.jsx)undefined5347053556(0,formatName/* shortName */.E)undefined5380353879(0,jsx_runtime.jsxs)undefined5454554619(0,jsx_runtime.jsx)undefined5490754981(0,jsx_runtime.jsx)undefined5568955775(0,context_locale/* useLocale */.Y)undefined5744957525(0,jsx_runtime.jsxs)undefined5758257658(0,jsx_runtime.jsxs)undefined5780057874(0,jsx_runtime.jsx)undefined5814758223(0,jsx_runtime.jsxs)undefined5836258438(0,jsx_runtime.jsxs)undefined5883358909(0,jsx_runtime.jsxs)undefined5933959413(0,jsx_runtime.jsx)undefined5971159785(0,jsx_runtime.jsx)undefined5990659980(0,jsx_runtime.jsx)undefined6017360247(0,jsx_runtime.jsx)undefined6044660520(0,jsx_runtime.jsx)undefined6161161685(0,jsx_runtime.jsx)undefined6233562419(0,react.useState)undefined6247462558(0,react.useState)undefined6500165077(0,jsx_runtime.jsxs)undefined6521565291(0,jsx_runtime.jsxs)undefined6542965503(0,jsx_runtime.jsx)undefined6569865772(0,jsx_runtime.jsx)undefined6598066056(0,jsx_runtime.jsxs)undefined6621466290(0,jsx_runtime.jsxs)undefined6637966453(0,jsx_runtime.jsx)undefined6670666780(0,jsx_runtime.jsx)undefined6693567009(0,jsx_runtime.jsx)undefined6739267468(0,jsx_runtime.jsxs)undefined6755767631(0,jsx_runtime.jsx)undefined6788867962(0,jsx_runtime.jsx)undefined6854268618(0,jsx_runtime.jsxs)undefined6890968983(0,jsx_runtime.jsx)undefined6915969233(0,jsx_runtime.jsx)undefined6923569323CategoryIcon/* CategoryIcon */.Ezundefined6952269625(0,CategoryIcon/* isCategoryIconUrl */.V)undefined7020470280(0,jsx_runtime.jsxs)undefined7036970443(0,jsx_runtime.jsx)undefined7069970775(0,jsx_runtime.jsxs)undefined7093671010(0,jsx_runtime.jsx)undefined7143271508(0,jsx_runtime.jsxs)undefined7261972693(0,jsx_runtime.jsx)undefined7290872982(0,jsx_runtime.jsx)undefined7323473308(0,jsx_runtime.jsx)undefined7403274108(0,jsx_runtime.jsxs)undefined7435374427(0,jsx_runtime.jsx)undefined7475974833(0,jsx_runtime.jsx)undefined7504175115(0,jsx_runtime.jsx)undefined7582175897(0,jsx_runtime.jsxs)undefined7598676060(0,jsx_runtime.jsx)undefined7632876402(0,jsx_runtime.jsx)undefined7654876624(0,jsx_runtime.jsxs)undefined7684976923(0,jsx_runtime.jsx)undefined7711477188(0,jsx_runtime.jsx)undefined7753377607(0,jsx_runtime.jsx)undefined7780177877(0,jsx_runtime.jsxs)undefined7814478220(0,jsx_runtime.jsxs)undefined7848278556(0,jsx_runtime.jsx)undefined7894379017(0,jsx_runtime.jsx)undefined7953779613(0,jsx_runtime.jsxs)undefined8059680672(0,jsx_runtime.jsxs)undefined8076180835(0,jsx_runtime.jsx)undefined8109181165(0,jsx_runtime.jsx)undefined8144181517(0,jsx_runtime.jsxs)undefined8190981983(0,jsx_runtime.jsx)undefined8246882542(0,jsx_runtime.jsx)undefined8269982773(0,jsx_runtime.jsx)undefined8334083414(0,jsx_runtime.jsx)undefined8361283688(0,jsx_runtime.jsxs)undefined8392283996(0,jsx_runtime.jsx)undefined8438884464(0,jsx_runtime.jsxs)undefined8462584699(0,jsx_runtime.jsx)undefined8495885032(0,jsx_runtime.jsx)undefined8531185385(0,jsx_runtime.jsx)undefined8551785591(0,jsx_runtime.jsx)undefinedü»ÿÿ `áâãÁ¹ÿÿäåæëêÉÿÿçèéÄþÿÿÅþÿÿÃÿÿÂìÿÿÃþÿÿUpgradePrompt_namespaceObjectŠformatNameùìÿÿ»Ÿÿÿ=Åÿÿ_ëÿÿ`ëÿÿaëÿÿ\ëÿÿ]ëÿÿ^ëÿÿì Œÿÿoÿÿÿ|ÿÿÿnÿÿÿ{ÿÿÿ Eœ«webpack/lib/util/registerExternalSerializerœwebpack-sources/ConcatSource€`%«webpack/lib/util/registerExternalSerializer™webpack-sources/RawSourceW(self["webpackChunk_N_E"] = self["webpackChunk_N_E"] || []).push([[7177],{ /***/ 300: «webpack/lib/util/registerExternalSerializerœwebpack-sources/CachedSource Qj«webpack/lib/util/registerExternalSerializerœwebpack-sources/ConcatSource€«webpack/lib/util/registerExternalSerializer™webpack-sources/RawSource_/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; «webpack/lib/util/registerExternalSerializerœwebpack-sources/CachedSource ö!«webpack/lib/util/registerExternalSerializerœwebpack-sources/ConcatSource€«webpack/lib/util/registerExternalSerializer™webpack-sources/RawSource…/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ AdminRolePreview: () => (/* binding */ AdminRolePreview) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1592); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7541); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(7620); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(2982); «webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourceé/* __next_internal_client_entry_do_not_use__ AdminRolePreview auto */ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime"; import { useSession } from '@/lib/auth'; import { useRouter } from 'next/navigation'; import { useEffect, useState, useRef } from 'react'; import { getPlans, updateAdminUser } from '@/lib/api'; const ORIG_PLAN_KEY = 'canhelp_admin_orig_plan'; function getPreviewRole() { return null; } const TIER_COLORS = { free: 'bg-slate-100 text-slate-600', pro: 'bg-green-100 text-green-700', ultimate: 'bg-amber-100 text-amber-700' }; export function AdminRolePreview() { var _session_user, _session_user1; const { data: session } = useSession(); const router = useRouter(); const isAdmin = (session === null || session === void 0 ? void 0 : (_session_user = session.user) === null || _session_user === void 0 ? void 0 : _session_user.role) === 'admin'; const userId = session === null || session === void 0 ? void 0 : (_session_user1 = session.user) === null || _session_user1 === void 0 ? void 0 : _session_user1.id; const [mounted, setMounted] = useState(false); const [plans, setPlans] = useState([]); const [activePlanId, setActivePlanId] = useState(null); const [loading, setLoading] = useState(false); const [expanded, setExpanded] = useState(false); const origPlanRef = useRef(null); useEffect(()=>setMounted(true), []); useEffect(()=>{ if ("object" !== 'undefined') { origPlanRef.current = localStorage.getItem(ORIG_PLAN_KEY); } }, []); useEffect(()=>{ if (!isAdmin) return; getPlans().then(setPlans).catch(()=>{}); }, [ isAdmin ]); useEffect(()=>{ var _session_user; var _session_user_planId; // Sync active plan from session const currentPlanId = (_session_user_planId = session === null || session === void 0 ? void 0 : (_session_user = session.user) === null || _session_user === void 0 ? void 0 : _session_user.planId) !== null && _session_user_planId !== void 0 ? _session_user_planId : null; setActivePlanId(currentPlanId); }, [ session ]); if (!mounted || !isAdmin) return null; const setPlan = async (planId)=>{ if (!userId) return; setLoading(true); try { // Save original plan on first change if (!origPlanRef.current && activePlanId) { localStorage.setItem(ORIG_PLAN_KEY, activePlanId); origPlanRef.current = activePlanId; } await updateAdminUser(userId, { planId }); setActivePlanId(planId); window.dispatchEvent(new CustomEvent('canhelp:plan-changed', { detail: { planId } })); router.refresh(); } catch (e) {} setLoading(false); }; const restorePlan = async ()=>{ const orig = origPlanRef.current; localStorage.removeItem(ORIG_PLAN_KEY); origPlanRef.current = null; await setPlan(orig !== null && orig !== void 0 ? orig : null); }; const visiblePlans = plans; const hasOrigPlan = !!origPlanRef.current; return /*#__PURE__*/ _jsxs("div", { className: "fixed bottom-20 right-4 z-50 bg-white border border-slate-200 rounded-2xl shadow-lg text-xs font-medium select-none", style: { minWidth: 130 }, children: [ /*#__PURE__*/ _jsxs("button", { onClick: ()=>setExpanded((v)=>!v), className: "flex items-center justify-between gap-2 w-full px-3 py-2 text-slate-500 hover:text-slate-700 transition rounded-2xl", children: [ /*#__PURE__*/ _jsx("span", { children: "\uD83D\uDC41 Preview" }), /*#__PURE__*/ _jsx("span", { className: "text-slate-300", children: expanded ? '▲' : 'â–Œ' }) ] }), expanded && /*#__PURE__*/ _jsx("div", { className: "flex flex-col gap-1 px-2 pb-2 border-t border-slate-100 pt-2", children: visiblePlans.length > 0 && /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx("div", { className: "text-slate-400 px-1 mt-2 mb-0.5", children: "Plan" }), visiblePlans.map((plan)=>{ var _TIER_COLORS_plan_tier; return /*#__PURE__*/ _jsxs("button", { disabled: loading, onClick: ()=>setPlan(plan.id === activePlanId ? null : plan.id), className: "flex items-center justify-between gap-2 px-3 py-1.5 rounded-xl transition text-left ".concat(activePlanId === plan.id ? 'bg-indigo-600 text-white' : 'text-slate-600 hover:bg-slate-100', " ").concat(loading ? 'opacity-50' : ''), children: [ /*#__PURE__*/ _jsx("span", { className: "truncate max-w-[90px]", children: plan.name }), /*#__PURE__*/ _jsx("span", { className: "px-1.5 py-0.5 rounded-full text-[10px] font-semibold ".concat(activePlanId === plan.id ? 'bg-white/20 text-white' : (_TIER_COLORS_plan_tier = TIER_COLORS[plan.tier]) !== null && _TIER_COLORS_plan_tier !== void 0 ? _TIER_COLORS_plan_tier : TIER_COLORS.free), children: plan.tier }) ] }, plan.id); }), activePlanId && /*#__PURE__*/ _jsx("button", { disabled: loading, onClick: ()=>setPlan(null), className: "px-3 py-1 rounded-xl text-slate-400 hover:text-red-500 hover:bg-red-50 transition text-left", children: "✕ No plan" }), hasOrigPlan && /*#__PURE__*/ _jsx("button", { disabled: loading, onClick: restorePlan, className: "px-3 py-1 rounded-xl text-green-600 hover:bg-green-50 transition text-left", children: "↩ Restore" }) ] }) }) ] }); } a"F_›ÄÆñó&(]U[¿Èàèovž¥Øß ?Fhmz‚£«¿_Ö<DryÀÈ. < æ ê ã ç øûz}TWY\–šª­›žàBãad€€€€€€¿(0,_lib_auth__WEBPACK_IMPORTED_MODULE_1__/* .useSession */ .wV)º(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)¯(0,react__WEBPACK_IMPORTED_MODULE_3__.useState)ÿÿÿÿ­(0,react__WEBPACK_IMPORTED_MODULE_3__.useRef)°(0,react__WEBPACK_IMPORTED_MODULE_3__.useEffect)ÿ„trueþŒ(0,_lib_api__WEBPACK_IMPORTED_MODULE_4__/* .getPlans */ .T9)ýÃ(0,_lib_api__WEBPACK_IMPORTED_MODULE_4__/* .updateAdminUser */ .wl)·(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)ÿ¶(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)ÿÿþ·react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragmentþýþþþþ€†buffer†source„size„maps„hash!/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ AdminRolePreview: () => (/* binding */ AdminRolePreview) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1592); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7541); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(7620); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(2982); /* __next_internal_client_entry_do_not_use__ AdminRolePreview auto */ const ORIG_PLAN_KEY = 'canhelp_admin_orig_plan'; function getPreviewRole() { return null; } const TIER_COLORS = { free: 'bg-slate-100 text-slate-600', pro: 'bg-green-100 text-green-700', ultimate: 'bg-amber-100 text-amber-700' }; function AdminRolePreview() { var _session_user, _session_user1; const { data: session } = (0,_lib_auth__WEBPACK_IMPORTED_MODULE_1__/* .useSession */ .wV)(); const router = (0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)(); const isAdmin = (session === null || session === void 0 ? void 0 : (_session_user = session.user) === null || _session_user === void 0 ? void 0 : _session_user.role) === 'admin'; const userId = session === null || session === void 0 ? void 0 : (_session_user1 = session.user) === null || _session_user1 === void 0 ? void 0 : _session_user1.id; const [mounted, setMounted] = (0,react__WEBPACK_IMPORTED_MODULE_3__.useState)(false); const [plans, setPlans] = (0,react__WEBPACK_IMPORTED_MODULE_3__.useState)([]); const [activePlanId, setActivePlanId] = (0,react__WEBPACK_IMPORTED_MODULE_3__.useState)(null); const [loading, setLoading] = (0,react__WEBPACK_IMPORTED_MODULE_3__.useState)(false); const [expanded, setExpanded] = (0,react__WEBPACK_IMPORTED_MODULE_3__.useState)(false); const origPlanRef = (0,react__WEBPACK_IMPORTED_MODULE_3__.useRef)(null); (0,react__WEBPACK_IMPORTED_MODULE_3__.useEffect)(()=>setMounted(true), []); (0,react__WEBPACK_IMPORTED_MODULE_3__.useEffect)(()=>{ if (true) { origPlanRef.current = localStorage.getItem(ORIG_PLAN_KEY); } }, []); (0,react__WEBPACK_IMPORTED_MODULE_3__.useEffect)(()=>{ if (!isAdmin) return; (0,_lib_api__WEBPACK_IMPORTED_MODULE_4__/* .getPlans */ .T9)().then(setPlans).catch(()=>{}); }, [ isAdmin ]); (0,react__WEBPACK_IMPORTED_MODULE_3__.useEffect)(()=>{ var _session_user; var _session_user_planId; // Sync active plan from session const currentPlanId = (_session_user_planId = session === null || session === void 0 ? void 0 : (_session_user = session.user) === null || _session_user === void 0 ? void 0 : _session_user.planId) !== null && _session_user_planId !== void 0 ? _session_user_planId : null; setActivePlanId(currentPlanId); }, [ session ]); if (!mounted || !isAdmin) return null; const setPlan = async (planId)=>{ if (!userId) return; setLoading(true); try { // Save original plan on first change if (!origPlanRef.current && activePlanId) { localStorage.setItem(ORIG_PLAN_KEY, activePlanId); origPlanRef.current = activePlanId; } await (0,_lib_api__WEBPACK_IMPORTED_MODULE_4__/* .updateAdminUser */ .wl)(userId, { planId }); setActivePlanId(planId); window.dispatchEvent(new CustomEvent('canhelp:plan-changed', { detail: { planId } })); router.refresh(); } catch (e) {} setLoading(false); }; const restorePlan = async ()=>{ const orig = origPlanRef.current; localStorage.removeItem(ORIG_PLAN_KEY); origPlanRef.current = null; await setPlan(orig !== null && orig !== void 0 ? orig : null); }; const visiblePlans = plans; const hasOrigPlan = !!origPlanRef.current; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "fixed bottom-20 right-4 z-50 bg-white border border-slate-200 rounded-2xl shadow-lg text-xs font-medium select-none", style: { minWidth: 130 }, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { onClick: ()=>setExpanded((v)=>!v), className: "flex items-center justify-between gap-2 w-full px-3 py-2 text-slate-500 hover:text-slate-700 transition rounded-2xl", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { children: "\uD83D\uDC41 Preview" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-slate-300", children: expanded ? '▲' : 'â–Œ' }) ] }), expanded && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex flex-col gap-1 px-2 pb-2 border-t border-slate-100 pt-2", children: visiblePlans.length > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-slate-400 px-1 mt-2 mb-0.5", children: "Plan" }), visiblePlans.map((plan)=>{ var _TIER_COLORS_plan_tier; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { disabled: loading, onClick: ()=>setPlan(plan.id === activePlanId ? null : plan.id), className: "flex items-center justify-between gap-2 px-3 py-1.5 rounded-xl transition text-left ".concat(activePlanId === plan.id ? 'bg-indigo-600 text-white' : 'text-slate-600 hover:bg-slate-100', " ").concat(loading ? 'opacity-50' : ''), children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "truncate max-w-[90px]", children: plan.name }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "px-1.5 py-0.5 rounded-full text-[10px] font-semibold ".concat(activePlanId === plan.id ? 'bg-white/20 text-white' : (_TIER_COLORS_plan_tier = TIER_COLORS[plan.tier]) !== null && _TIER_COLORS_plan_tier !== void 0 ? _TIER_COLORS_plan_tier : TIER_COLORS.free), children: plan.tier }) ] }, plan.id); }), activePlanId && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { disabled: loading, onClick: ()=>setPlan(null), className: "px-3 py-1 rounded-xl text-slate-400 hover:text-red-500 hover:bg-red-50 transition text-left", children: "✕ No plan" }), hasOrigPlan && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { disabled: loading, onClick: restorePlan, className: "px-3 py-1 rounded-xl text-green-600 hover:bg-green-50 transition text-left", children: "↩ Restore" }) ] }) }) ] }); } €”{"finalSource":true}ƒmap‹bufferedMap ConcatSourceRawSource…/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ AdminRolePreview: () => (/* binding */ AdminRolePreview) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1592); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7541); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(7620); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(2982); ReplaceSourceRawSourceé/* __next_internal_client_entry_do_not_use__ AdminRolePreview auto */ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime"; import { useSession } from '@/lib/auth'; import { useRouter } from 'next/navigation'; import { useEffect, useState, useRef } from 'react'; import { getPlans, updateAdminUser } from '@/lib/api'; const ORIG_PLAN_KEY = 'canhelp_admin_orig_plan'; function getPreviewRole() { return null; } const TIER_COLORS = { free: 'bg-slate-100 text-slate-600', pro: 'bg-green-100 text-green-700', ultimate: 'bg-amber-100 text-amber-700' }; export function AdminRolePreview() { var _session_user, _session_user1; const { data: session } = useSession(); const router = useRouter(); const isAdmin = (session === null || session === void 0 ? void 0 : (_session_user = session.user) === null || _session_user === void 0 ? void 0 : _session_user.role) === 'admin'; const userId = session === null || session === void 0 ? void 0 : (_session_user1 = session.user) === null || _session_user1 === void 0 ? void 0 : _session_user1.id; const [mounted, setMounted] = useState(false); const [plans, setPlans] = useState([]); const [activePlanId, setActivePlanId] = useState(null); const [loading, setLoading] = useState(false); const [expanded, setExpanded] = useState(false); const origPlanRef = useRef(null); useEffect(()=>setMounted(true), []); useEffect(()=>{ if ("object" !== 'undefined') { origPlanRef.current = localStorage.getItem(ORIG_PLAN_KEY); } }, []); useEffect(()=>{ if (!isAdmin) return; getPlans().then(setPlans).catch(()=>{}); }, [ isAdmin ]); useEffect(()=>{ var _session_user; var _session_user_planId; // Sync active plan from session const currentPlanId = (_session_user_planId = session === null || session === void 0 ? void 0 : (_session_user = session.user) === null || _session_user === void 0 ? void 0 : _session_user.planId) !== null && _session_user_planId !== void 0 ? _session_user_planId : null; setActivePlanId(currentPlanId); }, [ session ]); if (!mounted || !isAdmin) return null; const setPlan = async (planId)=>{ if (!userId) return; setLoading(true); try { // Save original plan on first change if (!origPlanRef.current && activePlanId) { localStorage.setItem(ORIG_PLAN_KEY, activePlanId); origPlanRef.current = activePlanId; } await updateAdminUser(userId, { planId }); setActivePlanId(planId); window.dispatchEvent(new CustomEvent('canhelp:plan-changed', { detail: { planId } })); router.refresh(); } catch (e) {} setLoading(false); }; const restorePlan = async ()=>{ const orig = origPlanRef.current; localStorage.removeItem(ORIG_PLAN_KEY); origPlanRef.current = null; await setPlan(orig !== null && orig !== void 0 ? orig : null); }; const visiblePlans = plans; const hasOrigPlan = !!origPlanRef.current; return /*#__PURE__*/ _jsxs("div", { className: "fixed bottom-20 right-4 z-50 bg-white border border-slate-200 rounded-2xl shadow-lg text-xs font-medium select-none", style: { minWidth: 130 }, children: [ /*#__PURE__*/ _jsxs("button", { onClick: ()=>setExpanded((v)=>!v), className: "flex items-center justify-between gap-2 w-full px-3 py-2 text-slate-500 hover:text-slate-700 transition rounded-2xl", children: [ /*#__PURE__*/ _jsx("span", { children: "\uD83D\uDC41 Preview" }), /*#__PURE__*/ _jsx("span", { className: "text-slate-300", children: expanded ? '▲' : 'â–Œ' }) ] }), expanded && /*#__PURE__*/ _jsx("div", { className: "flex flex-col gap-1 px-2 pb-2 border-t border-slate-100 pt-2", children: visiblePlans.length > 0 && /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx("div", { className: "text-slate-400 px-1 mt-2 mb-0.5", children: "Plan" }), visiblePlans.map((plan)=>{ var _TIER_COLORS_plan_tier; return /*#__PURE__*/ _jsxs("button", { disabled: loading, onClick: ()=>setPlan(plan.id === activePlanId ? null : plan.id), className: "flex items-center justify-between gap-2 px-3 py-1.5 rounded-xl transition text-left ".concat(activePlanId === plan.id ? 'bg-indigo-600 text-white' : 'text-slate-600 hover:bg-slate-100', " ").concat(loading ? 'opacity-50' : ''), children: [ /*#__PURE__*/ _jsx("span", { className: "truncate max-w-[90px]", children: plan.name }), /*#__PURE__*/ _jsx("span", { className: "px-1.5 py-0.5 rounded-full text-[10px] font-semibold ".concat(activePlanId === plan.id ? 'bg-white/20 text-white' : (_TIER_COLORS_plan_tier = TIER_COLORS[plan.tier]) !== null && _TIER_COLORS_plan_tier !== void 0 ? _TIER_COLORS_plan_tier : TIER_COLORS.free), children: plan.tier }) ] }, plan.id); }), activePlanId && /*#__PURE__*/ _jsx("button", { disabled: loading, onClick: ()=>setPlan(null), className: "px-3 py-1 rounded-xl text-slate-400 hover:text-red-500 hover:bg-red-50 transition text-left", children: "✕ No plan" }), hasOrigPlan && /*#__PURE__*/ _jsx("button", { disabled: loading, onClick: restorePlan, className: "px-3 py-1 rounded-xl text-green-600 hover:bg-green-50 transition text-left", children: "↩ Restore" }) ] }) }) ] }); } È70155undefined157196undefined198241undefined243294undefined296349undefined597603undefined703712(0,_lib_auth__WEBPACK_IMPORTED_MODULE_1__/* .useSession */ .wV)undefined736744(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)undefined11351142(0,react__WEBPACK_IMPORTED_MODULE_3__.useState)undefined11821189(0,react__WEBPACK_IMPORTED_MODULE_3__.useState)undefined12401247(0,react__WEBPACK_IMPORTED_MODULE_3__.useState)undefined12901297(0,react__WEBPACK_IMPORTED_MODULE_3__.useState)undefined13431350(0,react__WEBPACK_IMPORTED_MODULE_3__.useState)undefined13841389(0,react__WEBPACK_IMPORTED_MODULE_3__.useRef)undefined14021410(0,react__WEBPACK_IMPORTED_MODULE_3__.useEffect)undefined14431451(0,react__WEBPACK_IMPORTED_MODULE_3__.useEffect)undefined14711494trueundefined15961604(0,react__WEBPACK_IMPORTED_MODULE_3__.useEffect)undefined16501657(0,_lib_api__WEBPACK_IMPORTED_MODULE_4__/* .getPlans */ .T9)undefined17281736(0,react__WEBPACK_IMPORTED_MODULE_3__.useEffect)undefined26062620(0,_lib_api__WEBPACK_IMPORTED_MODULE_4__/* .updateAdminUser */ .wl)undefined33023306(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined35553559(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined38323835(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined39623965(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined41804183(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined43524356(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined43584366react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragmentundefined44414444(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined47584762(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined52905293(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined55315534(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined61126115(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined64976500(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined /***/ }) €†buffer†source„size„maps„hash‚!/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ AdminRolePreview: () => (/* binding */ AdminRolePreview) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1592); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7541); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(7620); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(2982); /* __next_internal_client_entry_do_not_use__ AdminRolePreview auto */ const ORIG_PLAN_KEY = 'canhelp_admin_orig_plan'; function getPreviewRole() { return null; } const TIER_COLORS = { free: 'bg-slate-100 text-slate-600', pro: 'bg-green-100 text-green-700', ultimate: 'bg-amber-100 text-amber-700' }; function AdminRolePreview() { var _session_user, _session_user1; const { data: session } = (0,_lib_auth__WEBPACK_IMPORTED_MODULE_1__/* .useSession */ .wV)(); const router = (0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)(); const isAdmin = (session === null || session === void 0 ? void 0 : (_session_user = session.user) === null || _session_user === void 0 ? void 0 : _session_user.role) === 'admin'; const userId = session === null || session === void 0 ? void 0 : (_session_user1 = session.user) === null || _session_user1 === void 0 ? void 0 : _session_user1.id; const [mounted, setMounted] = (0,react__WEBPACK_IMPORTED_MODULE_3__.useState)(false); const [plans, setPlans] = (0,react__WEBPACK_IMPORTED_MODULE_3__.useState)([]); const [activePlanId, setActivePlanId] = (0,react__WEBPACK_IMPORTED_MODULE_3__.useState)(null); const [loading, setLoading] = (0,react__WEBPACK_IMPORTED_MODULE_3__.useState)(false); const [expanded, setExpanded] = (0,react__WEBPACK_IMPORTED_MODULE_3__.useState)(false); const origPlanRef = (0,react__WEBPACK_IMPORTED_MODULE_3__.useRef)(null); (0,react__WEBPACK_IMPORTED_MODULE_3__.useEffect)(()=>setMounted(true), []); (0,react__WEBPACK_IMPORTED_MODULE_3__.useEffect)(()=>{ if (true) { origPlanRef.current = localStorage.getItem(ORIG_PLAN_KEY); } }, []); (0,react__WEBPACK_IMPORTED_MODULE_3__.useEffect)(()=>{ if (!isAdmin) return; (0,_lib_api__WEBPACK_IMPORTED_MODULE_4__/* .getPlans */ .T9)().then(setPlans).catch(()=>{}); }, [ isAdmin ]); (0,react__WEBPACK_IMPORTED_MODULE_3__.useEffect)(()=>{ var _session_user; var _session_user_planId; // Sync active plan from session const currentPlanId = (_session_user_planId = session === null || session === void 0 ? void 0 : (_session_user = session.user) === null || _session_user === void 0 ? void 0 : _session_user.planId) !== null && _session_user_planId !== void 0 ? _session_user_planId : null; setActivePlanId(currentPlanId); }, [ session ]); if (!mounted || !isAdmin) return null; const setPlan = async (planId)=>{ if (!userId) return; setLoading(true); try { // Save original plan on first change if (!origPlanRef.current && activePlanId) { localStorage.setItem(ORIG_PLAN_KEY, activePlanId); origPlanRef.current = activePlanId; } await (0,_lib_api__WEBPACK_IMPORTED_MODULE_4__/* .updateAdminUser */ .wl)(userId, { planId }); setActivePlanId(planId); window.dispatchEvent(new CustomEvent('canhelp:plan-changed', { detail: { planId } })); router.refresh(); } catch (e) {} setLoading(false); }; const restorePlan = async ()=>{ const orig = origPlanRef.current; localStorage.removeItem(ORIG_PLAN_KEY); origPlanRef.current = null; await setPlan(orig !== null && orig !== void 0 ? orig : null); }; const visiblePlans = plans; const hasOrigPlan = !!origPlanRef.current; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "fixed bottom-20 right-4 z-50 bg-white border border-slate-200 rounded-2xl shadow-lg text-xs font-medium select-none", style: { minWidth: 130 }, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { onClick: ()=>setExpanded((v)=>!v), className: "flex items-center justify-between gap-2 w-full px-3 py-2 text-slate-500 hover:text-slate-700 transition rounded-2xl", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { children: "\uD83D\uDC41 Preview" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-slate-300", children: expanded ? '▲' : 'â–Œ' }) ] }), expanded && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex flex-col gap-1 px-2 pb-2 border-t border-slate-100 pt-2", children: visiblePlans.length > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-slate-400 px-1 mt-2 mb-0.5", children: "Plan" }), visiblePlans.map((plan)=>{ var _TIER_COLORS_plan_tier; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { disabled: loading, onClick: ()=>setPlan(plan.id === activePlanId ? null : plan.id), className: "flex items-center justify-between gap-2 px-3 py-1.5 rounded-xl transition text-left ".concat(activePlanId === plan.id ? 'bg-indigo-600 text-white' : 'text-slate-600 hover:bg-slate-100', " ").concat(loading ? 'opacity-50' : ''), children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "truncate max-w-[90px]", children: plan.name }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "px-1.5 py-0.5 rounded-full text-[10px] font-semibold ".concat(activePlanId === plan.id ? 'bg-white/20 text-white' : (_TIER_COLORS_plan_tier = TIER_COLORS[plan.tier]) !== null && _TIER_COLORS_plan_tier !== void 0 ? _TIER_COLORS_plan_tier : TIER_COLORS.free), children: plan.tier }) ] }, plan.id); }), activePlanId && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { disabled: loading, onClick: ()=>setPlan(null), className: "px-3 py-1 rounded-xl text-slate-400 hover:text-red-500 hover:bg-red-50 transition text-left", children: "✕ No plan" }), hasOrigPlan && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { disabled: loading, onClick: restorePlan, className: "px-3 py-1 rounded-xl text-green-600 hover:bg-green-50 transition text-left", children: "↩ Restore" }) ] }) }) ] }); } /***/ }) €”{"finalSource":true}ƒmap‹bufferedMap  ConcatSourceRawSource_/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; þ…/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ AdminRolePreview: () => (/* binding */ AdminRolePreview) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1592); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7541); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(7620); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(2982); ReplaceSourceRawSourceé/* __next_internal_client_entry_do_not_use__ AdminRolePreview auto */ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime"; import { useSession } from '@/lib/auth'; import { useRouter } from 'next/navigation'; import { useEffect, useState, useRef } from 'react'; import { getPlans, updateAdminUser } from '@/lib/api'; const ORIG_PLAN_KEY = 'canhelp_admin_orig_plan'; function getPreviewRole() { return null; } const TIER_COLORS = { free: 'bg-slate-100 text-slate-600', pro: 'bg-green-100 text-green-700', ultimate: 'bg-amber-100 text-amber-700' }; export function AdminRolePreview() { var _session_user, _session_user1; const { data: session } = useSession(); const router = useRouter(); const isAdmin = (session === null || session === void 0 ? void 0 : (_session_user = session.user) === null || _session_user === void 0 ? void 0 : _session_user.role) === 'admin'; const userId = session === null || session === void 0 ? void 0 : (_session_user1 = session.user) === null || _session_user1 === void 0 ? void 0 : _session_user1.id; const [mounted, setMounted] = useState(false); const [plans, setPlans] = useState([]); const [activePlanId, setActivePlanId] = useState(null); const [loading, setLoading] = useState(false); const [expanded, setExpanded] = useState(false); const origPlanRef = useRef(null); useEffect(()=>setMounted(true), []); useEffect(()=>{ if ("object" !== 'undefined') { origPlanRef.current = localStorage.getItem(ORIG_PLAN_KEY); } }, []); useEffect(()=>{ if (!isAdmin) return; getPlans().then(setPlans).catch(()=>{}); }, [ isAdmin ]); useEffect(()=>{ var _session_user; var _session_user_planId; // Sync active plan from session const currentPlanId = (_session_user_planId = session === null || session === void 0 ? void 0 : (_session_user = session.user) === null || _session_user === void 0 ? void 0 : _session_user.planId) !== null && _session_user_planId !== void 0 ? _session_user_planId : null; setActivePlanId(currentPlanId); }, [ session ]); if (!mounted || !isAdmin) return null; const setPlan = async (planId)=>{ if (!userId) return; setLoading(true); try { // Save original plan on first change if (!origPlanRef.current && activePlanId) { localStorage.setItem(ORIG_PLAN_KEY, activePlanId); origPlanRef.current = activePlanId; } await updateAdminUser(userId, { planId }); setActivePlanId(planId); window.dispatchEvent(new CustomEvent('canhelp:plan-changed', { detail: { planId } })); router.refresh(); } catch (e) {} setLoading(false); }; const restorePlan = async ()=>{ const orig = origPlanRef.current; localStorage.removeItem(ORIG_PLAN_KEY); origPlanRef.current = null; await setPlan(orig !== null && orig !== void 0 ? orig : null); }; const visiblePlans = plans; const hasOrigPlan = !!origPlanRef.current; return /*#__PURE__*/ _jsxs("div", { className: "fixed bottom-20 right-4 z-50 bg-white border border-slate-200 rounded-2xl shadow-lg text-xs font-medium select-none", style: { minWidth: 130 }, children: [ /*#__PURE__*/ _jsxs("button", { onClick: ()=>setExpanded((v)=>!v), className: "flex items-center justify-between gap-2 w-full px-3 py-2 text-slate-500 hover:text-slate-700 transition rounded-2xl", children: [ /*#__PURE__*/ _jsx("span", { children: "\uD83D\uDC41 Preview" }), /*#__PURE__*/ _jsx("span", { className: "text-slate-300", children: expanded ? '▲' : 'â–Œ' }) ] }), expanded && /*#__PURE__*/ _jsx("div", { className: "flex flex-col gap-1 px-2 pb-2 border-t border-slate-100 pt-2", children: visiblePlans.length > 0 && /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx("div", { className: "text-slate-400 px-1 mt-2 mb-0.5", children: "Plan" }), visiblePlans.map((plan)=>{ var _TIER_COLORS_plan_tier; return /*#__PURE__*/ _jsxs("button", { disabled: loading, onClick: ()=>setPlan(plan.id === activePlanId ? null : plan.id), className: "flex items-center justify-between gap-2 px-3 py-1.5 rounded-xl transition text-left ".concat(activePlanId === plan.id ? 'bg-indigo-600 text-white' : 'text-slate-600 hover:bg-slate-100', " ").concat(loading ? 'opacity-50' : ''), children: [ /*#__PURE__*/ _jsx("span", { className: "truncate max-w-[90px]", children: plan.name }), /*#__PURE__*/ _jsx("span", { className: "px-1.5 py-0.5 rounded-full text-[10px] font-semibold ".concat(activePlanId === plan.id ? 'bg-white/20 text-white' : (_TIER_COLORS_plan_tier = TIER_COLORS[plan.tier]) !== null && _TIER_COLORS_plan_tier !== void 0 ? _TIER_COLORS_plan_tier : TIER_COLORS.free), children: plan.tier }) ] }, plan.id); }), activePlanId && /*#__PURE__*/ _jsx("button", { disabled: loading, onClick: ()=>setPlan(null), className: "px-3 py-1 rounded-xl text-slate-400 hover:text-red-500 hover:bg-red-50 transition text-left", children: "✕ No plan" }), hasOrigPlan && /*#__PURE__*/ _jsx("button", { disabled: loading, onClick: restorePlan, className: "px-3 py-1 rounded-xl text-green-600 hover:bg-green-50 transition text-left", children: "↩ Restore" }) ] }) }) ] }); } È70155undefined157196undefined198241undefined243294undefined296349undefined597603undefined703712(0,_lib_auth__WEBPACK_IMPORTED_MODULE_1__/* .useSession */ .wV)undefined736744(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)undefined11351142(0,react__WEBPACK_IMPORTED_MODULE_3__.useState)undefined11821189(0,react__WEBPACK_IMPORTED_MODULE_3__.useState)undefined12401247(0,react__WEBPACK_IMPORTED_MODULE_3__.useState)undefined12901297(0,react__WEBPACK_IMPORTED_MODULE_3__.useState)undefined13431350(0,react__WEBPACK_IMPORTED_MODULE_3__.useState)undefined13841389(0,react__WEBPACK_IMPORTED_MODULE_3__.useRef)undefined14021410(0,react__WEBPACK_IMPORTED_MODULE_3__.useEffect)undefined14431451(0,react__WEBPACK_IMPORTED_MODULE_3__.useEffect)undefined14711494trueundefined15961604(0,react__WEBPACK_IMPORTED_MODULE_3__.useEffect)undefined16501657(0,_lib_api__WEBPACK_IMPORTED_MODULE_4__/* .getPlans */ .T9)undefined17281736(0,react__WEBPACK_IMPORTED_MODULE_3__.useEffect)undefined26062620(0,_lib_api__WEBPACK_IMPORTED_MODULE_4__/* .updateAdminUser */ .wl)undefined33023306(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined35553559(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined38323835(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined39623965(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined41804183(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined43524356(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined43584366react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragmentundefined44414444(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined47584762(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined52905293(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined55315534(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined61126115(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined64976500(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined RawSource /***/ }), /***/ 1258:  d«webpack/lib/util/registerExternalSerializerœwebpack-sources/ConcatSource€«webpack/lib/util/registerExternalSerializer™webpack-sources/RawSource_/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; «webpack/lib/util/registerExternalSerializerœwebpack-sources/CachedSource Ê«webpack/lib/util/registerExternalSerializerœwebpack-sources/ConcatSource€«webpack/lib/util/registerExternalSerializer™webpack-sources/RawSourceÖ/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ E: () => (/* binding */ shortName), /* harmony export */ H: () => (/* binding */ formatShortName) /* harmony export */ }); «webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourceé/** * Shortens the last name to first letter + period. * "ИваМ ПетрПв" → "ИваМ П." * Works with a pre-composed full name string. */ export function shortName(fullName) { if (!(fullName === null || fullName === void 0 ? void 0 : fullName.trim())) return '—'; const parts = fullName.trim().split(/\s+/); if (parts.length < 2 || !parts[1]) return parts[0]; return "".concat(parts[0], " ").concat(parts[1][0].toUpperCase(), "."); } /** * Formats separate firstName + lastName fields, shortening the last name. * Falls back to parsing fullName if firstName is not available. */ export function formatShortName(firstName, lastName, fallbackName) { if (firstName === null || firstName === void 0 ? void 0 : firstName.trim()) { const l = lastName === null || lastName === void 0 ? void 0 : lastName.trim(); return l ? "".concat(firstName.trim(), " ").concat(l[0].toUpperCase(), ".") : firstName.trim(); } return shortName(fallbackName); } CˆŽTZ€€€†buffer†source„size„maps„hash±/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ E: () => (/* binding */ shortName), /* harmony export */ H: () => (/* binding */ formatShortName) /* harmony export */ }); /** * Shortens the last name to first letter + period. * "ИваМ ПетрПв" → "ИваМ П." * Works with a pre-composed full name string. */ function shortName(fullName) { if (!(fullName === null || fullName === void 0 ? void 0 : fullName.trim())) return '—'; const parts = fullName.trim().split(/\s+/); if (parts.length < 2 || !parts[1]) return parts[0]; return "".concat(parts[0], " ").concat(parts[1][0].toUpperCase(), "."); } /** * Formats separate firstName + lastName fields, shortening the last name. * Falls back to parsing fullName if firstName is not available. */ function formatShortName(firstName, lastName, fallbackName) { if (firstName === null || firstName === void 0 ? void 0 : firstName.trim()) { const l = lastName === null || lastName === void 0 ? void 0 : lastName.trim(); return l ? "".concat(firstName.trim(), " ").concat(l[0].toUpperCase(), ".") : firstName.trim(); } return shortName(fallbackName); } €”{"finalSource":true}ƒmap‹bufferedMap ConcatSourceRawSourceÖ/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ E: () => (/* binding */ shortName), /* harmony export */ H: () => (/* binding */ formatShortName) /* harmony export */ }); ReplaceSourceRawSourceé/** * Shortens the last name to first letter + period. * "ИваМ ПетрПв" → "ИваМ П." * Works with a pre-composed full name string. */ export function shortName(fullName) { if (!(fullName === null || fullName === void 0 ? void 0 : fullName.trim())) return '—'; const parts = fullName.trim().split(/\s+/); if (parts.length < 2 || !parts[1]) return parts[0]; return "".concat(parts[0], " ").concat(parts[1][0].toUpperCase(), "."); } /** * Formats separate firstName + lastName fields, shortening the last name. * Falls back to parsing fullName if firstName is not available. */ export function formatShortName(firstName, lastName, fallbackName) { if (firstName === null || firstName === void 0 ? void 0 : firstName.trim()) { const l = lastName === null || lastName === void 0 ? void 0 : lastName.trim(); return l ? "".concat(firstName.trim(), " ").concat(l[0].toUpperCase(), ".") : firstName.trim(); } return shortName(fallbackName); } 136142undefined596602undefined /***/ }) ë/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ E: () => (/* binding */ shortName), /* harmony export */ H: () => (/* binding */ formatShortName) /* harmony export */ }); /** * Shortens the last name to first letter + period. * "ИваМ ПетрПв" → "ИваМ П." * Works with a pre-composed full name string. */ function shortName(fullName) { if (!(fullName === null || fullName === void 0 ? void 0 : fullName.trim())) return '—'; const parts = fullName.trim().split(/\s+/); if (parts.length < 2 || !parts[1]) return parts[0]; return "".concat(parts[0], " ").concat(parts[1][0].toUpperCase(), "."); } /** * Formats separate firstName + lastName fields, shortening the last name. * Falls back to parsing fullName if firstName is not available. */ function formatShortName(firstName, lastName, fallbackName) { if (firstName === null || firstName === void 0 ? void 0 : firstName.trim()) { const l = lastName === null || lastName === void 0 ? void 0 : lastName.trim(); return l ? "".concat(firstName.trim(), " ").concat(l[0].toUpperCase(), ".") : firstName.trim(); } return shortName(fallbackName); } /***/ }) ìï  ðñðÖ/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ E: () => (/* binding */ shortName), /* harmony export */ H: () => (/* binding */ formatShortName) /* harmony export */ }); òé/** * Shortens the last name to first letter + period. * "ИваМ ПетрПв" → "ИваМ П." * Works with a pre-composed full name string. */ export function shortName(fullName) { if (!(fullName === null || fullName === void 0 ? void 0 : fullName.trim())) return '—'; const parts = fullName.trim().split(/\s+/); if (parts.length < 2 || !parts[1]) return parts[0]; return "".concat(parts[0], " ").concat(parts[1][0].toUpperCase(), "."); } /** * Formats separate firstName + lastName fields, shortening the last name. * Falls back to parsing fullName if firstName is not available. */ export function formatShortName(firstName, lastName, fallbackName) { if (firstName === null || firstName === void 0 ? void 0 : firstName.trim()) { const l = lastName === null || lastName === void 0 ? void 0 : lastName.trim(); return l ? "".concat(firstName.trim(), " ").concat(l[0].toUpperCase(), ".") : firstName.trim(); } return shortName(fallbackName); } 136142undefined596602undefinedóô, /***/ 1592:  ú «webpack/lib/util/registerExternalSerializerœwebpack-sources/ConcatSource€«webpack/lib/util/registerExternalSerializer™webpack-sources/RawSource_/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; «webpack/lib/util/registerExternalSerializerœwebpack-sources/CachedSource w«webpack/lib/util/registerExternalSerializerœwebpack-sources/ConcatSource€«webpack/lib/util/registerExternalSerializer™webpack-sources/RawSourceå/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ CI: () => (/* binding */ signOut), /* harmony export */ Hh: () => (/* binding */ signUp), /* harmony export */ Jv: () => (/* binding */ signIn), /* harmony export */ wV: () => (/* binding */ useSession), /* harmony export */ yK: () => (/* binding */ authClient) /* harmony export */ }); /* harmony import */ var better_auth_react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6504); «webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSource import { createAuthClient } from 'better-auth/react'; const API_URL = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; export const authClient = createAuthClient({ baseURL: API_URL }); export const { signIn, signOut, signUp, useSession } = authClient; d4FdiE‚ˆœ«È΀˜"https://api.canhelp.gr"0€Ì(0,better_auth_react__WEBPACK_IMPORTED_MODULE_0__/* .createAuthClient */ .M)€€†buffer†source„size„maps„hashÌ/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ CI: () => (/* binding */ signOut), /* harmony export */ Hh: () => (/* binding */ signUp), /* harmony export */ Jv: () => (/* binding */ signIn), /* harmony export */ wV: () => (/* binding */ useSession), /* harmony export */ yK: () => (/* binding */ authClient) /* harmony export */ }); /* harmony import */ var better_auth_react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6504); const API_URL = "https://api.canhelp.gr" || 0; const authClient = (0,better_auth_react__WEBPACK_IMPORTED_MODULE_0__/* .createAuthClient */ .M)({ baseURL: API_URL }); const { signIn, signOut, signUp, useSession } = authClient; €”{"finalSource":true}ƒmap‹bufferedMap ConcatSourceRawSourceå/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ CI: () => (/* binding */ signOut), /* harmony export */ Hh: () => (/* binding */ signUp), /* harmony export */ Jv: () => (/* binding */ signIn), /* harmony export */ wV: () => (/* binding */ useSession), /* harmony export */ yK: () => (/* binding */ authClient) /* harmony export */ }); /* harmony import */ var better_auth_react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6504); ReplaceSourceRawSource import { createAuthClient } from 'better-auth/react'; const API_URL = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; export const authClient = createAuthClient({ baseURL: API_URL }); export const { signIn, signOut, signUp, useSession } = authClient; »052undefined70100"https://api.canhelp.gr"undefined1051270undefined130136undefined156171(0,better_auth_react__WEBPACK_IMPORTED_MODULE_0__/* .createAuthClient */ .M)undefined200206undefined /***/ }) à5/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ CI: () => (/* binding */ signOut), /* harmony export */ Hh: () => (/* binding */ signUp), /* harmony export */ Jv: () => (/* binding */ signIn), /* harmony export */ wV: () => (/* binding */ useSession), /* harmony export */ yK: () => (/* binding */ authClient) /* harmony export */ }); /* harmony import */ var better_auth_react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6504); const API_URL = "https://api.canhelp.gr" || 0; const authClient = (0,better_auth_react__WEBPACK_IMPORTED_MODULE_0__/* .createAuthClient */ .M)({ baseURL: API_URL }); const { signIn, signOut, signUp, useSession } = authClient; /***/ }) áä  åæåå/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ CI: () => (/* binding */ signOut), /* harmony export */ Hh: () => (/* binding */ signUp), /* harmony export */ Jv: () => (/* binding */ signIn), /* harmony export */ wV: () => (/* binding */ useSession), /* harmony export */ yK: () => (/* binding */ authClient) /* harmony export */ }); /* harmony import */ var better_auth_react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6504); ç import { createAuthClient } from 'better-auth/react'; const API_URL = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; export const authClient = createAuthClient({ baseURL: API_URL }); export const { signIn, signOut, signUp, useSession } = authClient; »052undefined70100"https://api.canhelp.gr"undefined1051270undefined130136undefined156171(0,better_auth_react__WEBPACK_IMPORTED_MODULE_0__/* .createAuthClient */ .M)undefined200206undefinedèé, /***/ 2568:  ™«webpack/lib/util/registerExternalSerializerœwebpack-sources/ConcatSource€«webpack/lib/util/registerExternalSerializer™webpack-sources/RawSourceV/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { «webpack/lib/util/registerExternalSerializerœwebpack-sources/CachedSource º«webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSource«webpack/lib/util/registerExternalSerializer™webpack-sources/RawSource@import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/globals.css"); ; import(/* webpackMode: "eager", webpackExports: ["AdminRolePreview"] */ "/opt/canhelp/apps/web/src/components/AdminRolePreview.tsx"); ; import(/* webpackMode: "eager", webpackExports: ["Footer"] */ "/opt/canhelp/apps/web/src/components/Footer.tsx"); ; import(/* webpackMode: "eager", webpackExports: ["Header"] */ "/opt/canhelp/apps/web/src/components/Header.tsx"); ; import(/* webpackMode: "eager", webpackExports: ["ScrollToTopButton"] */ "/opt/canhelp/apps/web/src/components/ScrollToTopButton.tsx"); ; import(/* webpackMode: "eager", webpackExports: ["LocaleProvider"] */ "/opt/canhelp/apps/web/src/context/locale.tsx"); ; import(/* webpackMode: "eager", webpackExports: ["LocationProvider"] */ "/opt/canhelp/apps/web/src/context/location.tsx"); aMRJÕÚINœÂGLÀÅ=åPromise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 8761, 23))ÞPromise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 300))ßPromise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 9808))ßPromise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 9649))ßPromise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 7380))ßPromise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 9906))ßPromise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 4029))€†buffer†source„size„maps„hashžPromise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 8761, 23)); ; Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 300)); ; Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 9808)); ; Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 9649)); ; Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 7380)); ; Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 9906)); ; Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 4029)); €”{"finalSource":true}ƒmap‹bufferedMap ReplaceSourceRawSource@import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/globals.css"); ; import(/* webpackMode: "eager", webpackExports: ["AdminRolePreview"] */ "/opt/canhelp/apps/web/src/components/AdminRolePreview.tsx"); ; import(/* webpackMode: "eager", webpackExports: ["Footer"] */ "/opt/canhelp/apps/web/src/components/Footer.tsx"); ; import(/* webpackMode: "eager", webpackExports: ["Header"] */ "/opt/canhelp/apps/web/src/components/Header.tsx"); ; import(/* webpackMode: "eager", webpackExports: ["ScrollToTopButton"] */ "/opt/canhelp/apps/web/src/components/ScrollToTopButton.tsx"); ; import(/* webpackMode: "eager", webpackExports: ["LocaleProvider"] */ "/opt/canhelp/apps/web/src/context/locale.tsx"); ; import(/* webpackMode: "eager", webpackExports: ["LocationProvider"] */ "/opt/canhelp/apps/web/src/context/location.tsx"); 077Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 8761, 23))undefined82213Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 300))undefined218329Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 9808))undefined334445Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 9649))undefined450583Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 7380))undefined588704Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 9906))undefined709829Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 4029))undefined /***/ }) Õ/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 8761, 23)); ; Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 300)); ; Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 9808)); ; Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 9649)); ; Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 7380)); ; Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 9906)); ; Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 4029)); /***/ }) ÖÙ ÚV/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { Ü@import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/globals.css"); ; import(/* webpackMode: "eager", webpackExports: ["AdminRolePreview"] */ "/opt/canhelp/apps/web/src/components/AdminRolePreview.tsx"); ; import(/* webpackMode: "eager", webpackExports: ["Footer"] */ "/opt/canhelp/apps/web/src/components/Footer.tsx"); ; import(/* webpackMode: "eager", webpackExports: ["Header"] */ "/opt/canhelp/apps/web/src/components/Header.tsx"); ; import(/* webpackMode: "eager", webpackExports: ["ScrollToTopButton"] */ "/opt/canhelp/apps/web/src/components/ScrollToTopButton.tsx"); ; import(/* webpackMode: "eager", webpackExports: ["LocaleProvider"] */ "/opt/canhelp/apps/web/src/context/locale.tsx"); ; import(/* webpackMode: "eager", webpackExports: ["LocationProvider"] */ "/opt/canhelp/apps/web/src/context/location.tsx"); 077Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 8761, 23))undefined82213Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 300))undefined218329Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 9808))undefined334445Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 9649))undefined450583Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 7380))undefined588704Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 9906))undefined709829Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 4029))undefinedÝÞ, /***/ 3042:  |«webpack/lib/util/registerExternalSerializerœwebpack-sources/ConcatSource€«webpack/lib/util/registerExternalSerializer™webpack-sources/RawSourceS/***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; «webpack/lib/util/registerExternalSerializerœwebpack-sources/CachedSource Ï«webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSource«webpack/lib/util/registerExternalSerializer™webpack-sources/RawSourceƒ"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "workAsyncStorage", { enumerable: true, get: function() { return _workasyncstorageinstance.workAsyncStorageInstance; } }); const _workasyncstorageinstance = require("./work-async-storage-instance"); //# sourceMappingURL=work-async-storage.external.js.map e :NNQFƒüü!')G€®Object.defineProperty(exports, "__esModule", (‚))ŽObject.defineProperty(exports, "workAsyncStorage", (þ“__webpack_require__„6035€†buffer†source„size„maps„hashk Object.defineProperty(exports, "__esModule", ({ value: true })); Object.defineProperty(exports, "workAsyncStorage", ({ enumerable: true, get: function() { return _workasyncstorageinstance.workAsyncStorageInstance; } })); const _workasyncstorageinstance = __webpack_require__(6035); //# sourceMappingURL=work-async-storage.external.js.map €”{"finalSource":true}ƒmap‹bufferedMap ReplaceSourceRawSourceƒ"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "workAsyncStorage", { enumerable: true, get: function() { return _workasyncstorageinstance.workAsyncStorageInstance; } }); const _workasyncstorageinstance = require("./work-async-storage-instance"); //# sourceMappingURL=work-async-storage.external.js.mapÞ012undefined1458Object.defineProperty(exports, "__esModule", (undefined7878))undefined81131Object.defineProperty(exports, "workAsyncStorage", (undefined252252))undefined289295__webpack_require__undefined2973276035undefined /***/ }) ÊÈ/***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); Object.defineProperty(exports, "workAsyncStorage", ({ enumerable: true, get: function() { return _workasyncstorageinstance.workAsyncStorageInstance; } })); const _workasyncstorageinstance = __webpack_require__(6035); //# sourceMappingURL=work-async-storage.external.js.map /***/ }) ËÎ ÏS/***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; у"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "workAsyncStorage", { enumerable: true, get: function() { return _workasyncstorageinstance.workAsyncStorageInstance; } }); const _workasyncstorageinstance = require("./work-async-storage-instance"); //# sourceMappingURL=work-async-storage.external.js.mapÞ012undefined1458Object.defineProperty(exports, "__esModule", (undefined7878))undefined81131Object.defineProperty(exports, "workAsyncStorage", (undefined252252))undefined289295__webpack_require__undefined2973276035undefinedÒÓ, /***/ 3625:  €$«webpack/lib/util/registerExternalSerializerœwebpack-sources/ConcatSource€«webpack/lib/util/registerExternalSerializer™webpack-sources/RawSourceS/***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; «webpack/lib/util/registerExternalSerializerœwebpack-sources/CachedSource R «webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSource«webpack/lib/util/registerExternalSerializer™webpack-sources/RawSourceŒ /* __next_internal_client_entry_do_not_use__ cjs */ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "PreloadChunks", { enumerable: true, get: function() { return PreloadChunks; } }); const _jsxruntime = require("react/jsx-runtime"); const _reactdom = require("react-dom"); const _workasyncstorageexternal = require("../../../server/app-render/work-async-storage.external"); const _encodeuripath = require("../encode-uri-path"); function PreloadChunks(param) { let { moduleIds } = param; // Early return in client compilation and only load requestStore on server side if ("object" !== 'undefined') { return null; } const workStore = _workasyncstorageexternal.workAsyncStorage.getStore(); if (workStore === undefined) { return null; } const allFiles = []; // Search the current dynamic call unique key id in react loadable manifest, // and find the corresponding CSS files to preload if (workStore.reactLoadableManifest && moduleIds) { const manifest = workStore.reactLoadableManifest; for (const key of moduleIds){ if (!manifest[key]) continue; const chunks = manifest[key].files; allFiles.push(...chunks); } } if (allFiles.length === 0) { return null; } const dplId = process.env.NEXT_DEPLOYMENT_ID ? "?dpl=" + process.env.NEXT_DEPLOYMENT_ID : ''; return /*#__PURE__*/ (0, _jsxruntime.jsx)(_jsxruntime.Fragment, { children: allFiles.map((chunk)=>{ const href = workStore.assetPrefix + "/_next/" + (0, _encodeuripath.encodeURIPath)(chunk) + dplId; const isCss = chunk.endsWith('.css'); // If it's stylesheet we use `precedence` o help hoist with React Float. // For stylesheets we actually need to render the CSS because nothing else is going to do it so it needs to be part of the component tree. // The `preload` for stylesheet is not optional. if (isCss) { return /*#__PURE__*/ (0, _jsxruntime.jsx)("link", { // @ts-ignore precedence: "dynamic", href: href, rel: "stylesheet", as: "style" }, chunk); } else { // If it's script we use ReactDOM.preload to preload the resources (0, _reactdom.preload)(href, { as: 'script', fetchPriority: 'low' }); return null; } }) }); } //# sourceMappingURL=preload-chunks.js.map d5ACo[ƒƒ†µ   &(:PVXbˆŽÇâèêýœ³u’–œ€®Object.defineProperty(exports, "__esModule", (‚))±Object.defineProperty(exports, "PreloadChunks", (þ“__webpack_require__„4568þ„7509ý„3042ü„1271„true† false0€†buffer†source„size„maps„hash /* __next_internal_client_entry_do_not_use__ cjs */ Object.defineProperty(exports, "__esModule", ({ value: true })); Object.defineProperty(exports, "PreloadChunks", ({ enumerable: true, get: function() { return PreloadChunks; } })); const _jsxruntime = __webpack_require__(4568); const _reactdom = __webpack_require__(7509); const _workasyncstorageexternal = __webpack_require__(3042); const _encodeuripath = __webpack_require__(1271); function PreloadChunks(param) { let { moduleIds } = param; // Early return in client compilation and only load requestStore on server side if (true) { return null; } const workStore = _workasyncstorageexternal.workAsyncStorage.getStore(); if (workStore === undefined) { return null; } const allFiles = []; // Search the current dynamic call unique key id in react loadable manifest, // and find the corresponding CSS files to preload if (workStore.reactLoadableManifest && moduleIds) { const manifest = workStore.reactLoadableManifest; for (const key of moduleIds){ if (!manifest[key]) continue; const chunks = manifest[key].files; allFiles.push(...chunks); } } if (allFiles.length === 0) { return null; } const dplId = false ? 0 : ''; return /*#__PURE__*/ (0, _jsxruntime.jsx)(_jsxruntime.Fragment, { children: allFiles.map((chunk)=>{ const href = workStore.assetPrefix + "/_next/" + (0, _encodeuripath.encodeURIPath)(chunk) + dplId; const isCss = chunk.endsWith('.css'); // If it's stylesheet we use `precedence` o help hoist with React Float. // For stylesheets we actually need to render the CSS because nothing else is going to do it so it needs to be part of the component tree. // The `preload` for stylesheet is not optional. if (isCss) { return /*#__PURE__*/ (0, _jsxruntime.jsx)("link", { // @ts-ignore precedence: "dynamic", href: href, rel: "stylesheet", as: "style" }, chunk); } else { // If it's script we use ReactDOM.preload to preload the resources (0, _reactdom.preload)(href, { as: 'script', fetchPriority: 'low' }); return null; } }) }); } //# sourceMappingURL=preload-chunks.js.map €”{"finalSource":true}ƒmap‹bufferedMap ReplaceSourceRawSourceŒ /* __next_internal_client_entry_do_not_use__ cjs */ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "PreloadChunks", { enumerable: true, get: function() { return PreloadChunks; } }); const _jsxruntime = require("react/jsx-runtime"); const _reactdom = require("react-dom"); const _workasyncstorageexternal = require("../../../server/app-render/work-async-storage.external"); const _encodeuripath = require("../encode-uri-path"); function PreloadChunks(param) { let { moduleIds } = param; // Early return in client compilation and only load requestStore on server side if ("object" !== 'undefined') { return null; } const workStore = _workasyncstorageexternal.workAsyncStorage.getStore(); if (workStore === undefined) { return null; } const allFiles = []; // Search the current dynamic call unique key id in react loadable manifest, // and find the corresponding CSS files to preload if (workStore.reactLoadableManifest && moduleIds) { const manifest = workStore.reactLoadableManifest; for (const key of moduleIds){ if (!manifest[key]) continue; const chunks = manifest[key].files; allFiles.push(...chunks); } } if (allFiles.length === 0) { return null; } const dplId = process.env.NEXT_DEPLOYMENT_ID ? "?dpl=" + process.env.NEXT_DEPLOYMENT_ID : ''; return /*#__PURE__*/ (0, _jsxruntime.jsx)(_jsxruntime.Fragment, { children: allFiles.map((chunk)=>{ const href = workStore.assetPrefix + "/_next/" + (0, _encodeuripath.encodeURIPath)(chunk) + dplId; const isCss = chunk.endsWith('.css'); // If it's stylesheet we use `precedence` o help hoist with React Float. // For stylesheets we actually need to render the CSS because nothing else is going to do it so it needs to be part of the component tree. // The `preload` for stylesheet is not optional. if (isCss) { return /*#__PURE__*/ (0, _jsxruntime.jsx)("link", { // @ts-ignore precedence: "dynamic", href: href, rel: "stylesheet", as: "style" }, chunk); } else { // If it's script we use ReactDOM.preload to preload the resources (0, _reactdom.preload)(href, { as: 'script', fetchPriority: 'low' }); return null; } }) }); } //# sourceMappingURL=preload-chunks.js.map »5365undefined67111Object.defineProperty(exports, "__esModule", (undefined131131))undefined134181Object.defineProperty(exports, "PreloadChunks", (undefined265265))undefined288294__webpack_require__undefined2963144568undefined336342__webpack_require__undefined3443547509undefined392398__webpack_require__undefined4004553042undefined482488__webpack_require__undefined4905091271undefined668691trueundefined13971426 falseundefined143014690undefined /***/ }) ¿c /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /* __next_internal_client_entry_do_not_use__ cjs */ Object.defineProperty(exports, "__esModule", ({ value: true })); Object.defineProperty(exports, "PreloadChunks", ({ enumerable: true, get: function() { return PreloadChunks; } })); const _jsxruntime = __webpack_require__(4568); const _reactdom = __webpack_require__(7509); const _workasyncstorageexternal = __webpack_require__(3042); const _encodeuripath = __webpack_require__(1271); function PreloadChunks(param) { let { moduleIds } = param; // Early return in client compilation and only load requestStore on server side if (true) { return null; } const workStore = _workasyncstorageexternal.workAsyncStorage.getStore(); if (workStore === undefined) { return null; } const allFiles = []; // Search the current dynamic call unique key id in react loadable manifest, // and find the corresponding CSS files to preload if (workStore.reactLoadableManifest && moduleIds) { const manifest = workStore.reactLoadableManifest; for (const key of moduleIds){ if (!manifest[key]) continue; const chunks = manifest[key].files; allFiles.push(...chunks); } } if (allFiles.length === 0) { return null; } const dplId = false ? 0 : ''; return /*#__PURE__*/ (0, _jsxruntime.jsx)(_jsxruntime.Fragment, { children: allFiles.map((chunk)=>{ const href = workStore.assetPrefix + "/_next/" + (0, _encodeuripath.encodeURIPath)(chunk) + dplId; const isCss = chunk.endsWith('.css'); // If it's stylesheet we use `precedence` o help hoist with React Float. // For stylesheets we actually need to render the CSS because nothing else is going to do it so it needs to be part of the component tree. // The `preload` for stylesheet is not optional. if (isCss) { return /*#__PURE__*/ (0, _jsxruntime.jsx)("link", { // @ts-ignore precedence: "dynamic", href: href, rel: "stylesheet", as: "style" }, chunk); } else { // If it's script we use ReactDOM.preload to preload the resources (0, _reactdom.preload)(href, { as: 'script', fetchPriority: 'low' }); return null; } }) }); } //# sourceMappingURL=preload-chunks.js.map /***/ }) Àà ÄõÇŒ /* __next_internal_client_entry_do_not_use__ cjs */ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "PreloadChunks", { enumerable: true, get: function() { return PreloadChunks; } }); const _jsxruntime = require("react/jsx-runtime"); const _reactdom = require("react-dom"); const _workasyncstorageexternal = require("../../../server/app-render/work-async-storage.external"); const _encodeuripath = require("../encode-uri-path"); function PreloadChunks(param) { let { moduleIds } = param; // Early return in client compilation and only load requestStore on server side if ("object" !== 'undefined') { return null; } const workStore = _workasyncstorageexternal.workAsyncStorage.getStore(); if (workStore === undefined) { return null; } const allFiles = []; // Search the current dynamic call unique key id in react loadable manifest, // and find the corresponding CSS files to preload if (workStore.reactLoadableManifest && moduleIds) { const manifest = workStore.reactLoadableManifest; for (const key of moduleIds){ if (!manifest[key]) continue; const chunks = manifest[key].files; allFiles.push(...chunks); } } if (allFiles.length === 0) { return null; } const dplId = process.env.NEXT_DEPLOYMENT_ID ? "?dpl=" + process.env.NEXT_DEPLOYMENT_ID : ''; return /*#__PURE__*/ (0, _jsxruntime.jsx)(_jsxruntime.Fragment, { children: allFiles.map((chunk)=>{ const href = workStore.assetPrefix + "/_next/" + (0, _encodeuripath.encodeURIPath)(chunk) + dplId; const isCss = chunk.endsWith('.css'); // If it's stylesheet we use `precedence` o help hoist with React Float. // For stylesheets we actually need to render the CSS because nothing else is going to do it so it needs to be part of the component tree. // The `preload` for stylesheet is not optional. if (isCss) { return /*#__PURE__*/ (0, _jsxruntime.jsx)("link", { // @ts-ignore precedence: "dynamic", href: href, rel: "stylesheet", as: "style" }, chunk); } else { // If it's script we use ReactDOM.preload to preload the resources (0, _reactdom.preload)(href, { as: 'script', fetchPriority: 'low' }); return null; } }) }); } //# sourceMappingURL=preload-chunks.js.map »5365undefined67111Object.defineProperty(exports, "__esModule", (undefined131131))undefined134181Object.defineProperty(exports, "PreloadChunks", (undefined265265))undefined288294__webpack_require__undefined2963144568undefined336342__webpack_require__undefined3443547509undefined392398__webpack_require__undefined4004553042undefined482488__webpack_require__undefined4905091271undefined668691trueundefined13971426 falseundefined143014690undefinedÈÉ, /***/ 4029:  Æ.«webpack/lib/util/registerExternalSerializerœwebpack-sources/ConcatSource€«webpack/lib/util/registerExternalSerializer™webpack-sources/RawSource_/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; «webpack/lib/util/registerExternalSerializerœwebpack-sources/CachedSource …«webpack/lib/util/registerExternalSerializerœwebpack-sources/ConcatSource€«webpack/lib/util/registerExternalSerializer™webpack-sources/RawSource/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ LocationProvider: () => (/* binding */ LocationProvider), /* harmony export */ z: () => (/* binding */ useLocation) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(2982); «webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSource~ /* __next_internal_client_entry_do_not_use__ LocationProvider,useLocation auto */ import { jsx as _jsx } from "react/jsx-runtime"; import { createContext, useContext, useState, useEffect, useCallback } from 'react'; import { getLocations } from '@/lib/api'; const LocationContext = /*#__PURE__*/ createContext({ locationSlug: '', locationTree: [], locationLoading: true, setLocation: ()=>{}, getLabel: ()=>'' }); function readCookieLocation() { if (typeof document === 'undefined') return ''; const match = document.cookie.match(/(?:^|;\s*)canhelp_location=([^;]+)/); return (match === null || match === void 0 ? void 0 : match[1]) ? decodeURIComponent(match[1]) : ''; } export function LocationProvider(param) { let { children, initialSlug = '' } = param; const [locationSlug, setLocationSlug] = useState(initialSlug); const [locationTree, setLocationTree] = useState([]); const [locationLoading, setLocationLoading] = useState(true); // Sync from cookie on client mount useEffect(()=>{ const cookieSlug = readCookieLocation(); setLocationSlug(cookieSlug); }, []); // Load location tree once useEffect(()=>{ getLocations().then((tree)=>setLocationTree(tree)).catch(()=>{}).finally(()=>setLocationLoading(false)); }, []); const setLocation = useCallback((slug)=>{ setLocationSlug(slug); const encoded = encodeURIComponent(slug); document.cookie = "canhelp_location=".concat(encoded, "; path=/; max-age=31536000; SameSite=Lax"); }, []); const getLabel = useCallback((locale)=>{ if (!locationSlug) return ''; for (const city of locationTree){ var _city_names_locale; if (city.slug === locationSlug) return (_city_names_locale = city.names[locale]) !== null && _city_names_locale !== void 0 ? _city_names_locale : city.names.el; var _city_children; for (const d of (_city_children = city.children) !== null && _city_children !== void 0 ? _city_children : []){ var _d_names_locale; if (d.slug === locationSlug) return (_d_names_locale = d.names[locale]) !== null && _d_names_locale !== void 0 ? _d_names_locale : d.names.el; } } return locationSlug; }, [ locationSlug, locationTree ]); return /*#__PURE__*/ _jsx(LocationContext.Provider, { value: { locationSlug, locationTree, locationLoading, setLocation, getLabel }, children: children }); } export function useLocation() { return useContext(LocationContext); } aR^ƒÖØ(4¿ÅELˆÈÏ ™¡±Œ>H1;S V 4 : _ h €€€Ž(0,react__WEBPACK_IMPORTED_MODULE_1__.createContext)€¯(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)ÿÿ°(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)ÿÀ(0,_lib_api__WEBPACK_IMPORTED_MODULE_2__/* .getLocations */ .Vs)²(0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)ÿ¶(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)€±(0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)€†buffer†source„size„maps„hashŠ /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ LocationProvider: () => (/* binding */ LocationProvider), /* harmony export */ z: () => (/* binding */ useLocation) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(2982); /* __next_internal_client_entry_do_not_use__ LocationProvider,useLocation auto */ const LocationContext = /*#__PURE__*/ (0,react__WEBPACK_IMPORTED_MODULE_1__.createContext)({ locationSlug: '', locationTree: [], locationLoading: true, setLocation: ()=>{}, getLabel: ()=>'' }); function readCookieLocation() { if (typeof document === 'undefined') return ''; const match = document.cookie.match(/(?:^|;\s*)canhelp_location=([^;]+)/); return (match === null || match === void 0 ? void 0 : match[1]) ? decodeURIComponent(match[1]) : ''; } function LocationProvider(param) { let { children, initialSlug = '' } = param; const [locationSlug, setLocationSlug] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(initialSlug); const [locationTree, setLocationTree] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [locationLoading, setLocationLoading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(true); // Sync from cookie on client mount (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ const cookieSlug = readCookieLocation(); setLocationSlug(cookieSlug); }, []); // Load location tree once (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ (0,_lib_api__WEBPACK_IMPORTED_MODULE_2__/* .getLocations */ .Vs)().then((tree)=>setLocationTree(tree)).catch(()=>{}).finally(()=>setLocationLoading(false)); }, []); const setLocation = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)((slug)=>{ setLocationSlug(slug); const encoded = encodeURIComponent(slug); document.cookie = "canhelp_location=".concat(encoded, "; path=/; max-age=31536000; SameSite=Lax"); }, []); const getLabel = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)((locale)=>{ if (!locationSlug) return ''; for (const city of locationTree){ var _city_names_locale; if (city.slug === locationSlug) return (_city_names_locale = city.names[locale]) !== null && _city_names_locale !== void 0 ? _city_names_locale : city.names.el; var _city_children; for (const d of (_city_children = city.children) !== null && _city_children !== void 0 ? _city_children : []){ var _d_names_locale; if (d.slug === locationSlug) return (_d_names_locale = d.names[locale]) !== null && _d_names_locale !== void 0 ? _d_names_locale : d.names.el; } } return locationSlug; }, [ locationSlug, locationTree ]); return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(LocationContext.Provider, { value: { locationSlug, locationTree, locationLoading, setLocation, getLabel }, children: children }); } function useLocation() { return (0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)(LocationContext); } €”{"finalSource":true}ƒmap‹bufferedMap ConcatSourceRawSource/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ LocationProvider: () => (/* binding */ LocationProvider), /* harmony export */ z: () => (/* binding */ useLocation) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(2982); ReplaceSourceRawSource~ /* __next_internal_client_entry_do_not_use__ LocationProvider,useLocation auto */ import { jsx as _jsx } from "react/jsx-runtime"; import { createContext, useContext, useState, useEffect, useCallback } from 'react'; import { getLocations } from '@/lib/api'; const LocationContext = /*#__PURE__*/ createContext({ locationSlug: '', locationTree: [], locationLoading: true, setLocation: ()=>{}, getLabel: ()=>'' }); function readCookieLocation() { if (typeof document === 'undefined') return ''; const match = document.cookie.match(/(?:^|;\s*)canhelp_location=([^;]+)/); return (match === null || match === void 0 ? void 0 : match[1]) ? decodeURIComponent(match[1]) : ''; } export function LocationProvider(param) { let { children, initialSlug = '' } = param; const [locationSlug, setLocationSlug] = useState(initialSlug); const [locationTree, setLocationTree] = useState([]); const [locationLoading, setLocationLoading] = useState(true); // Sync from cookie on client mount useEffect(()=>{ const cookieSlug = readCookieLocation(); setLocationSlug(cookieSlug); }, []); // Load location tree once useEffect(()=>{ getLocations().then((tree)=>setLocationTree(tree)).catch(()=>{}).finally(()=>setLocationLoading(false)); }, []); const setLocation = useCallback((slug)=>{ setLocationSlug(slug); const encoded = encodeURIComponent(slug); document.cookie = "canhelp_location=".concat(encoded, "; path=/; max-age=31536000; SameSite=Lax"); }, []); const getLabel = useCallback((locale)=>{ if (!locationSlug) return ''; for (const city of locationTree){ var _city_names_locale; if (city.slug === locationSlug) return (_city_names_locale = city.names[locale]) !== null && _city_names_locale !== void 0 ? _city_names_locale : city.names.el; var _city_children; for (const d of (_city_children = city.children) !== null && _city_children !== void 0 ? _city_children : []){ var _d_names_locale; if (d.slug === locationSlug) return (_d_names_locale = d.names[locale]) !== null && _d_names_locale !== void 0 ? _d_names_locale : d.names.el; } } return locationSlug; }, [ locationSlug, locationTree ]); return /*#__PURE__*/ _jsx(LocationContext.Provider, { value: { locationSlug, locationTree, locationLoading, setLocation, getLabel }, children: children }); } export function useLocation() { return useContext(LocationContext); } +82129undefined131214undefined216256undefined296308(0,react__WEBPACK_IMPORTED_MODULE_1__.createContext)undefined703709undefined837844(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined904911(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined968975(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined10281036(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined11771185(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined12011212(0,_lib_api__WEBPACK_IMPORTED_MODULE_2__/* .getLocations */ .Vs)undefined13421352(0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)undefined15851595(0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)undefined23872390(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined26122618undefined26552664(0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)undefined /***/ }) µó /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ LocationProvider: () => (/* binding */ LocationProvider), /* harmony export */ z: () => (/* binding */ useLocation) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(2982); /* __next_internal_client_entry_do_not_use__ LocationProvider,useLocation auto */ const LocationContext = /*#__PURE__*/ (0,react__WEBPACK_IMPORTED_MODULE_1__.createContext)({ locationSlug: '', locationTree: [], locationLoading: true, setLocation: ()=>{}, getLabel: ()=>'' }); function readCookieLocation() { if (typeof document === 'undefined') return ''; const match = document.cookie.match(/(?:^|;\s*)canhelp_location=([^;]+)/); return (match === null || match === void 0 ? void 0 : match[1]) ? decodeURIComponent(match[1]) : ''; } function LocationProvider(param) { let { children, initialSlug = '' } = param; const [locationSlug, setLocationSlug] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(initialSlug); const [locationTree, setLocationTree] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [locationLoading, setLocationLoading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(true); // Sync from cookie on client mount (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ const cookieSlug = readCookieLocation(); setLocationSlug(cookieSlug); }, []); // Load location tree once (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ (0,_lib_api__WEBPACK_IMPORTED_MODULE_2__/* .getLocations */ .Vs)().then((tree)=>setLocationTree(tree)).catch(()=>{}).finally(()=>setLocationLoading(false)); }, []); const setLocation = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)((slug)=>{ setLocationSlug(slug); const encoded = encodeURIComponent(slug); document.cookie = "canhelp_location=".concat(encoded, "; path=/; max-age=31536000; SameSite=Lax"); }, []); const getLabel = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)((locale)=>{ if (!locationSlug) return ''; for (const city of locationTree){ var _city_names_locale; if (city.slug === locationSlug) return (_city_names_locale = city.names[locale]) !== null && _city_names_locale !== void 0 ? _city_names_locale : city.names.el; var _city_children; for (const d of (_city_children = city.children) !== null && _city_children !== void 0 ? _city_children : []){ var _d_names_locale; if (d.slug === locationSlug) return (_d_names_locale = d.names[locale]) !== null && _d_names_locale !== void 0 ? _d_names_locale : d.names.el; } } return locationSlug; }, [ locationSlug, locationTree ]); return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(LocationContext.Provider, { value: { locationSlug, locationTree, locationLoading, setLocation, getLabel }, children: children }); } function useLocation() { return (0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)(LocationContext); } /***/ }) ¶¹  º»º/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ LocationProvider: () => (/* binding */ LocationProvider), /* harmony export */ z: () => (/* binding */ useLocation) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(2982); Œ~ /* __next_internal_client_entry_do_not_use__ LocationProvider,useLocation auto */ import { jsx as _jsx } from "react/jsx-runtime"; import { createContext, useContext, useState, useEffect, useCallback } from 'react'; import { getLocations } from '@/lib/api'; const LocationContext = /*#__PURE__*/ createContext({ locationSlug: '', locationTree: [], locationLoading: true, setLocation: ()=>{}, getLabel: ()=>'' }); function readCookieLocation() { if (typeof document === 'undefined') return ''; const match = document.cookie.match(/(?:^|;\s*)canhelp_location=([^;]+)/); return (match === null || match === void 0 ? void 0 : match[1]) ? decodeURIComponent(match[1]) : ''; } export function LocationProvider(param) { let { children, initialSlug = '' } = param; const [locationSlug, setLocationSlug] = useState(initialSlug); const [locationTree, setLocationTree] = useState([]); const [locationLoading, setLocationLoading] = useState(true); // Sync from cookie on client mount useEffect(()=>{ const cookieSlug = readCookieLocation(); setLocationSlug(cookieSlug); }, []); // Load location tree once useEffect(()=>{ getLocations().then((tree)=>setLocationTree(tree)).catch(()=>{}).finally(()=>setLocationLoading(false)); }, []); const setLocation = useCallback((slug)=>{ setLocationSlug(slug); const encoded = encodeURIComponent(slug); document.cookie = "canhelp_location=".concat(encoded, "; path=/; max-age=31536000; SameSite=Lax"); }, []); const getLabel = useCallback((locale)=>{ if (!locationSlug) return ''; for (const city of locationTree){ var _city_names_locale; if (city.slug === locationSlug) return (_city_names_locale = city.names[locale]) !== null && _city_names_locale !== void 0 ? _city_names_locale : city.names.el; var _city_children; for (const d of (_city_children = city.children) !== null && _city_children !== void 0 ? _city_children : []){ var _d_names_locale; if (d.slug === locationSlug) return (_d_names_locale = d.names[locale]) !== null && _d_names_locale !== void 0 ? _d_names_locale : d.names.el; } } return locationSlug; }, [ locationSlug, locationTree ]); return /*#__PURE__*/ _jsx(LocationContext.Provider, { value: { locationSlug, locationTree, locationLoading, setLocation, getLabel }, children: children }); } export function useLocation() { return useContext(LocationContext); } +82129undefined131214undefined216256undefined296308(0,react__WEBPACK_IMPORTED_MODULE_1__.createContext)undefined703709undefined837844(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined904911(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined968975(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined10281036(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined11771185(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined12011212(0,_lib_api__WEBPACK_IMPORTED_MODULE_2__/* .getLocations */ .Vs)undefined13421352(0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)undefined15851595(0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)undefined23872390(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined26122618undefined26552664(0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)undefinedœŸ, /***/ 5575:  «webpack/lib/util/registerExternalSerializerœwebpack-sources/ConcatSource€«webpack/lib/util/registerExternalSerializer™webpack-sources/RawSourceB/***/ ((module, exports, __webpack_require__) => { "use strict"; «webpack/lib/util/registerExternalSerializerœwebpack-sources/CachedSource ]«webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSource«webpack/lib/util/registerExternalSerializer™webpack-sources/RawSource"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "default", { enumerable: true, get: function() { return dynamic; } }); const _interop_require_default = require("@swc/helpers/_/_interop_require_default"); const _loadable = /*#__PURE__*/ _interop_require_default._(require("./lazy-dynamic/loadable")); function dynamic(dynamicOptions, options) { var _mergedOptions_loadableGenerated; const loadableOptions = {}; if (typeof dynamicOptions === 'function') { loadableOptions.loader = dynamicOptions; } const mergedOptions = { ...loadableOptions, ...options }; return (0, _loadable.default)({ ...mergedOptions, modules: (_mergedOptions_loadableGenerated = mergedOptions.loadableGenerated) == null ? void 0 : _mergedOptions_loadableGenerated.modules }); } if ((typeof exports.default === 'function' || typeof exports.default === 'object' && exports.default !== null) && typeof exports.default.__esModule === 'undefined') { Object.defineProperty(exports.default, '__esModule', { value: true }); Object.assign(exports.default, exports); module.exports = exports.default; } //# sourceMappingURL=app-dynamic.js.map  f :NNQzIÈÈìòô[ac{€®Object.defineProperty(exports, "__esModule", (‚))«Object.defineProperty(exports, "default", (þ“__webpack_require__„4931þ„7007€†buffer†source„size„maps„hashÙ Object.defineProperty(exports, "__esModule", ({ value: true })); Object.defineProperty(exports, "default", ({ enumerable: true, get: function() { return dynamic; } })); const _interop_require_default = __webpack_require__(4931); const _loadable = /*#__PURE__*/ _interop_require_default._(__webpack_require__(7007)); function dynamic(dynamicOptions, options) { var _mergedOptions_loadableGenerated; const loadableOptions = {}; if (typeof dynamicOptions === 'function') { loadableOptions.loader = dynamicOptions; } const mergedOptions = { ...loadableOptions, ...options }; return (0, _loadable.default)({ ...mergedOptions, modules: (_mergedOptions_loadableGenerated = mergedOptions.loadableGenerated) == null ? void 0 : _mergedOptions_loadableGenerated.modules }); } if ((typeof exports.default === 'function' || typeof exports.default === 'object' && exports.default !== null) && typeof exports.default.__esModule === 'undefined') { Object.defineProperty(exports.default, '__esModule', { value: true }); Object.assign(exports.default, exports); module.exports = exports.default; } //# sourceMappingURL=app-dynamic.js.map €”{"finalSource":true}ƒmap‹bufferedMap ReplaceSourceRawSource"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "default", { enumerable: true, get: function() { return dynamic; } }); const _interop_require_default = require("@swc/helpers/_/_interop_require_default"); const _loadable = /*#__PURE__*/ _interop_require_default._(require("./lazy-dynamic/loadable")); function dynamic(dynamicOptions, options) { var _mergedOptions_loadableGenerated; const loadableOptions = {}; if (typeof dynamicOptions === 'function') { loadableOptions.loader = dynamicOptions; } const mergedOptions = { ...loadableOptions, ...options }; return (0, _loadable.default)({ ...mergedOptions, modules: (_mergedOptions_loadableGenerated = mergedOptions.loadableGenerated) == null ? void 0 : _mergedOptions_loadableGenerated.modules }); } if ((typeof exports.default === 'function' || typeof exports.default === 'object' && exports.default !== null) && typeof exports.default.__esModule === 'undefined') { Object.defineProperty(exports.default, '__esModule', { value: true }); Object.assign(exports.default, exports); module.exports = exports.default; } //# sourceMappingURL=app-dynamic.js.map  012undefined1458Object.defineProperty(exports, "__esModule", (undefined7878))undefined81122Object.defineProperty(exports, "default", (undefined200200))undefined236242__webpack_require__undefined2442844931undefined347353__webpack_require__undefined3553797007undefined /***/ }) ª%/***/ ((module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); Object.defineProperty(exports, "default", ({ enumerable: true, get: function() { return dynamic; } })); const _interop_require_default = __webpack_require__(4931); const _loadable = /*#__PURE__*/ _interop_require_default._(__webpack_require__(7007)); function dynamic(dynamicOptions, options) { var _mergedOptions_loadableGenerated; const loadableOptions = {}; if (typeof dynamicOptions === 'function') { loadableOptions.loader = dynamicOptions; } const mergedOptions = { ...loadableOptions, ...options }; return (0, _loadable.default)({ ...mergedOptions, modules: (_mergedOptions_loadableGenerated = mergedOptions.loadableGenerated) == null ? void 0 : _mergedOptions_loadableGenerated.modules }); } if ((typeof exports.default === 'function' || typeof exports.default === 'object' && exports.default !== null) && typeof exports.default.__esModule === 'undefined') { Object.defineProperty(exports.default, '__esModule', { value: true }); Object.assign(exports.default, exports); module.exports = exports.default; } //# sourceMappingURL=app-dynamic.js.map /***/ }) «® ¯B/***/ ((module, exports, __webpack_require__) => { "use strict"; ±"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "default", { enumerable: true, get: function() { return dynamic; } }); const _interop_require_default = require("@swc/helpers/_/_interop_require_default"); const _loadable = /*#__PURE__*/ _interop_require_default._(require("./lazy-dynamic/loadable")); function dynamic(dynamicOptions, options) { var _mergedOptions_loadableGenerated; const loadableOptions = {}; if (typeof dynamicOptions === 'function') { loadableOptions.loader = dynamicOptions; } const mergedOptions = { ...loadableOptions, ...options }; return (0, _loadable.default)({ ...mergedOptions, modules: (_mergedOptions_loadableGenerated = mergedOptions.loadableGenerated) == null ? void 0 : _mergedOptions_loadableGenerated.modules }); } if ((typeof exports.default === 'function' || typeof exports.default === 'object' && exports.default !== null) && typeof exports.default.__esModule === 'undefined') { Object.defineProperty(exports.default, '__esModule', { value: true }); Object.assign(exports.default, exports); module.exports = exports.default; } //# sourceMappingURL=app-dynamic.js.map  012undefined1458Object.defineProperty(exports, "__esModule", (undefined7878))undefined81122Object.defineProperty(exports, "default", (undefined200200))undefined236242__webpack_require__undefined2442844931undefined347353__webpack_require__undefined3553797007undefined²³, /***/ 6035:  - «webpack/lib/util/registerExternalSerializerœwebpack-sources/ConcatSource€«webpack/lib/util/registerExternalSerializer™webpack-sources/RawSourceS/***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; «webpack/lib/util/registerExternalSerializerœwebpack-sources/CachedSource  «webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSource«webpack/lib/util/registerExternalSerializer™webpack-sources/RawSource¶"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "workAsyncStorageInstance", { enumerable: true, get: function() { return workAsyncStorageInstance; } }); const _asynclocalstorage = require("./async-local-storage"); const workAsyncStorageInstance = (0, _asynclocalstorage.createAsyncLocalStorage)(); //# sourceMappingURL=work-async-storage-instance.js.map e :NNQF‹êê&€®Object.defineProperty(exports, "__esModule", (‚))ŒObject.defineProperty(exports, "workAsyncStorageInstance", (þ“__webpack_require__„9113€†buffer†source„size„maps„hashŠ Object.defineProperty(exports, "__esModule", ({ value: true })); Object.defineProperty(exports, "workAsyncStorageInstance", ({ enumerable: true, get: function() { return workAsyncStorageInstance; } })); const _asynclocalstorage = __webpack_require__(9113); const workAsyncStorageInstance = (0, _asynclocalstorage.createAsyncLocalStorage)(); //# sourceMappingURL=work-async-storage-instance.js.map €”{"finalSource":true}ƒmap‹bufferedMap ReplaceSourceRawSource¶"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "workAsyncStorageInstance", { enumerable: true, get: function() { return workAsyncStorageInstance; } }); const _asynclocalstorage = require("./async-local-storage"); const workAsyncStorageInstance = (0, _asynclocalstorage.createAsyncLocalStorage)(); //# sourceMappingURL=work-async-storage-instance.js.mapæ012undefined1458Object.defineProperty(exports, "__esModule", (undefined7878))undefined81139Object.defineProperty(exports, "workAsyncStorageInstance", (undefined234234))undefined264270__webpack_require__undefined2722949113undefined /***/ }) Ÿ/***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); Object.defineProperty(exports, "workAsyncStorageInstance", ({ enumerable: true, get: function() { return workAsyncStorageInstance; } })); const _asynclocalstorage = __webpack_require__(9113); const workAsyncStorageInstance = (0, _asynclocalstorage.createAsyncLocalStorage)(); //# sourceMappingURL=work-async-storage-instance.js.map /***/ })  £ €Õ§¶"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "workAsyncStorageInstance", { enumerable: true, get: function() { return workAsyncStorageInstance; } }); const _asynclocalstorage = require("./async-local-storage"); const workAsyncStorageInstance = (0, _asynclocalstorage.createAsyncLocalStorage)(); //# sourceMappingURL=work-async-storage-instance.js.mapæ012undefined1458Object.defineProperty(exports, "__esModule", (undefined7878))undefined81139Object.defineProperty(exports, "workAsyncStorageInstance", (undefined234234))undefined264270__webpack_require__undefined2722949113undefinedš©, /***/ 6442:  m «webpack/lib/util/registerExternalSerializerœwebpack-sources/ConcatSource€«webpack/lib/util/registerExternalSerializer™webpack-sources/RawSource_/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; «webpack/lib/util/registerExternalSerializerœwebpack-sources/CachedSource Œ«webpack/lib/util/registerExternalSerializerœwebpack-sources/ConcatSource€«webpack/lib/util/registerExternalSerializer™webpack-sources/RawSource/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* reexport default from dynamic */ _shared_lib_app_dynamic__WEBPACK_IMPORTED_MODULE_0___default.a) /* harmony export */ }); /* harmony import */ var _shared_lib_app_dynamic__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(5575); /* harmony import */ var _shared_lib_app_dynamic__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_shared_lib_app_dynamic__WEBPACK_IMPORTED_MODULE_0__); «webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourceˆexport * from '../shared/lib/app-dynamic'; export { default } from '../shared/lib/app-dynamic'; //# sourceMappingURL=app-dynamic.js.map b)+^€€€†buffer†source„size„maps„hash//* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* reexport default from dynamic */ _shared_lib_app_dynamic__WEBPACK_IMPORTED_MODULE_0___default.a) /* harmony export */ }); /* harmony import */ var _shared_lib_app_dynamic__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(5575); /* harmony import */ var _shared_lib_app_dynamic__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_shared_lib_app_dynamic__WEBPACK_IMPORTED_MODULE_0__); //# sourceMappingURL=app-dynamic.js.map €”{"finalSource":true}ƒmap‹bufferedMap ConcatSourceRawSource/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* reexport default from dynamic */ _shared_lib_app_dynamic__WEBPACK_IMPORTED_MODULE_0___default.a) /* harmony export */ }); /* harmony import */ var _shared_lib_app_dynamic__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(5575); /* harmony import */ var _shared_lib_app_dynamic__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_shared_lib_app_dynamic__WEBPACK_IMPORTED_MODULE_0__); ReplaceSourceRawSourceˆexport * from '../shared/lib/app-dynamic'; export { default } from '../shared/lib/app-dynamic'; //# sourceMappingURL=app-dynamic.js.map041undefined4394undefined /***/ }) •˜/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* reexport default from dynamic */ _shared_lib_app_dynamic__WEBPACK_IMPORTED_MODULE_0___default.a) /* harmony export */ }); /* harmony import */ var _shared_lib_app_dynamic__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(5575); /* harmony import */ var _shared_lib_app_dynamic__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_shared_lib_app_dynamic__WEBPACK_IMPORTED_MODULE_0__); //# sourceMappingURL=app-dynamic.js.map /***/ }) –™  š›š/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* reexport default from dynamic */ _shared_lib_app_dynamic__WEBPACK_IMPORTED_MODULE_0___default.a) /* harmony export */ }); /* harmony import */ var _shared_lib_app_dynamic__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(5575); /* harmony import */ var _shared_lib_app_dynamic__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_shared_lib_app_dynamic__WEBPACK_IMPORTED_MODULE_0__); œˆexport * from '../shared/lib/app-dynamic'; export { default } from '../shared/lib/app-dynamic'; //# sourceMappingURL=app-dynamic.js.map041undefined4394undefinedž, /***/ 6452:  ª «webpack/lib/util/registerExternalSerializerœwebpack-sources/ConcatSource€«webpack/lib/util/registerExternalSerializer™webpack-sources/RawSourceS/***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; «webpack/lib/util/registerExternalSerializerœwebpack-sources/CachedSource /«webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSource«webpack/lib/util/registerExternalSerializer™webpack-sources/RawSourceÃ/* __next_internal_client_entry_do_not_use__ cjs */ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "BailoutToCSR", { enumerable: true, get: function() { return BailoutToCSR; } }); const _bailouttocsr = require("./bailout-to-csr"); function BailoutToCSR(param) { let { reason, children } = param; if ("object" === 'undefined') { throw Object.defineProperty(new _bailouttocsr.BailoutToCSRError(reason), "__NEXT_ERROR_CODE", { value: "E394", enumerable: false, configurable: true }); } return children; } //# sourceMappingURL=dynamic-bailout-to-csr.js.map  c5ACoMƒƒ†Ž &(9Š¡€w€®Object.defineProperty(exports, "__esModule", (‚))°Object.defineProperty(exports, "BailoutToCSR", (þ“__webpack_require__„9800…false‚{}€†buffer†source„size„maps„hashÓ/* __next_internal_client_entry_do_not_use__ cjs */ Object.defineProperty(exports, "__esModule", ({ value: true })); Object.defineProperty(exports, "BailoutToCSR", ({ enumerable: true, get: function() { return BailoutToCSR; } })); const _bailouttocsr = __webpack_require__(9800); function BailoutToCSR(param) { let { reason, children } = param; if (false) {} return children; } //# sourceMappingURL=dynamic-bailout-to-csr.js.map €”{"finalSource":true}ƒmap‹bufferedMap ReplaceSourceRawSourceÃ/* __next_internal_client_entry_do_not_use__ cjs */ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "BailoutToCSR", { enumerable: true, get: function() { return BailoutToCSR; } }); const _bailouttocsr = require("./bailout-to-csr"); function BailoutToCSR(param) { let { reason, children } = param; if ("object" === 'undefined') { throw Object.defineProperty(new _bailouttocsr.BailoutToCSRError(reason), "__NEXT_ERROR_CODE", { value: "E394", enumerable: false, configurable: true }); } return children; } //# sourceMappingURL=dynamic-bailout-to-csr.js.map 5365undefined67111Object.defineProperty(exports, "__esModule", (undefined131131))undefined134180Object.defineProperty(exports, "BailoutToCSR", (undefined263263))undefined288294__webpack_require__undefined2963139800undefined394417falseundefined420631{}undefined /***/ }) Š0/***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /* __next_internal_client_entry_do_not_use__ cjs */ Object.defineProperty(exports, "__esModule", ({ value: true })); Object.defineProperty(exports, "BailoutToCSR", ({ enumerable: true, get: function() { return BailoutToCSR; } })); const _bailouttocsr = __webpack_require__(9800); function BailoutToCSR(param) { let { reason, children } = param; if (false) {} return children; } //# sourceMappingURL=dynamic-bailout-to-csr.js.map /***/ }) ‹Ž À’Ã/* __next_internal_client_entry_do_not_use__ cjs */ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "BailoutToCSR", { enumerable: true, get: function() { return BailoutToCSR; } }); const _bailouttocsr = require("./bailout-to-csr"); function BailoutToCSR(param) { let { reason, children } = param; if ("object" === 'undefined') { throw Object.defineProperty(new _bailouttocsr.BailoutToCSRError(reason), "__NEXT_ERROR_CODE", { value: "E394", enumerable: false, configurable: true }); } return children; } //# sourceMappingURL=dynamic-bailout-to-csr.js.map 5365undefined67111Object.defineProperty(exports, "__esModule", (undefined131131))undefined134180Object.defineProperty(exports, "BailoutToCSR", (undefined263263))undefined288294__webpack_require__undefined2963139800undefined394417falseundefined420631{}undefined“”, /***/ 7007:  ç&«webpack/lib/util/registerExternalSerializerœwebpack-sources/ConcatSource€«webpack/lib/util/registerExternalSerializer™webpack-sources/RawSourceS/***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; «webpack/lib/util/registerExternalSerializerœwebpack-sources/CachedSource  «webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSource«webpack/lib/util/registerExternalSerializer™webpack-sources/RawSourcer "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "default", { enumerable: true, get: function() { return _default; } }); const _jsxruntime = require("react/jsx-runtime"); const _react = require("react"); const _dynamicbailouttocsr = require("./dynamic-bailout-to-csr"); const _preloadchunks = require("./preload-chunks"); // Normalize loader to return the module as form { default: Component } for `React.lazy`. // Also for backward compatible since next/dynamic allows to resolve a component directly with loader // Client component reference proxy need to be converted to a module. function convertModule(mod) { // Check "default" prop before accessing it, as it could be client reference proxy that could break it reference. // Cases: // mod: { default: Component } // mod: Component // mod: { default: proxy(Component) } // mod: proxy(Component) const hasDefault = mod && 'default' in mod; return { default: hasDefault ? mod.default : mod }; } const defaultOptions = { loader: ()=>Promise.resolve(convertModule(()=>null)), loading: null, ssr: true }; function Loadable(options) { const opts = { ...defaultOptions, ...options }; const Lazy = /*#__PURE__*/ (0, _react.lazy)(()=>opts.loader().then(convertModule)); const Loading = opts.loading; function LoadableComponent(props) { const fallbackElement = Loading ? /*#__PURE__*/ (0, _jsxruntime.jsx)(Loading, { isLoading: true, pastDelay: true, error: null }) : null; // If it's non-SSR or provided a loading component, wrap it in a suspense boundary const hasSuspenseBoundary = !opts.ssr || !!opts.loading; const Wrap = hasSuspenseBoundary ? _react.Suspense : _react.Fragment; const wrapProps = hasSuspenseBoundary ? { fallback: fallbackElement } : {}; const children = opts.ssr ? /*#__PURE__*/ (0, _jsxruntime.jsxs)(_jsxruntime.Fragment, { children: [ "object" === 'undefined' ? /*#__PURE__*/ (0, _jsxruntime.jsx)(_preloadchunks.PreloadChunks, { moduleIds: opts.modules }) : null, /*#__PURE__*/ (0, _jsxruntime.jsx)(Lazy, { ...props }) ] }) : /*#__PURE__*/ (0, _jsxruntime.jsx)(_dynamicbailouttocsr.BailoutToCSR, { reason: "next/dynamic", children: /*#__PURE__*/ (0, _jsxruntime.jsx)(Lazy, { ...props }) }); return /*#__PURE__*/ (0, _jsxruntime.jsx)(Wrap, { ...wrapProps, children: children }); } LoadableComponent.displayName = 'LoadableComponent'; return LoadableComponent; } const _default = Loadable; //# sourceMappingURL=loadable.js.map h :NNQzUÉÉàæèú <BD]x~€‘H_q〮Object.defineProperty(exports, "__esModule", (‚))«Object.defineProperty(exports, "default", (þ“__webpack_require__„4568þ„7620ý„6452ü„3625† false0€†buffer†source„size„maps„hashß Object.defineProperty(exports, "__esModule", ({ value: true })); Object.defineProperty(exports, "default", ({ enumerable: true, get: function() { return _default; } })); const _jsxruntime = __webpack_require__(4568); const _react = __webpack_require__(7620); const _dynamicbailouttocsr = __webpack_require__(6452); const _preloadchunks = __webpack_require__(3625); // Normalize loader to return the module as form { default: Component } for `React.lazy`. // Also for backward compatible since next/dynamic allows to resolve a component directly with loader // Client component reference proxy need to be converted to a module. function convertModule(mod) { // Check "default" prop before accessing it, as it could be client reference proxy that could break it reference. // Cases: // mod: { default: Component } // mod: Component // mod: { default: proxy(Component) } // mod: proxy(Component) const hasDefault = mod && 'default' in mod; return { default: hasDefault ? mod.default : mod }; } const defaultOptions = { loader: ()=>Promise.resolve(convertModule(()=>null)), loading: null, ssr: true }; function Loadable(options) { const opts = { ...defaultOptions, ...options }; const Lazy = /*#__PURE__*/ (0, _react.lazy)(()=>opts.loader().then(convertModule)); const Loading = opts.loading; function LoadableComponent(props) { const fallbackElement = Loading ? /*#__PURE__*/ (0, _jsxruntime.jsx)(Loading, { isLoading: true, pastDelay: true, error: null }) : null; // If it's non-SSR or provided a loading component, wrap it in a suspense boundary const hasSuspenseBoundary = !opts.ssr || !!opts.loading; const Wrap = hasSuspenseBoundary ? _react.Suspense : _react.Fragment; const wrapProps = hasSuspenseBoundary ? { fallback: fallbackElement } : {}; const children = opts.ssr ? /*#__PURE__*/ (0, _jsxruntime.jsxs)(_jsxruntime.Fragment, { children: [ false ? /*#__PURE__*/ 0 : null, /*#__PURE__*/ (0, _jsxruntime.jsx)(Lazy, { ...props }) ] }) : /*#__PURE__*/ (0, _jsxruntime.jsx)(_dynamicbailouttocsr.BailoutToCSR, { reason: "next/dynamic", children: /*#__PURE__*/ (0, _jsxruntime.jsx)(Lazy, { ...props }) }); return /*#__PURE__*/ (0, _jsxruntime.jsx)(Wrap, { ...wrapProps, children: children }); } LoadableComponent.displayName = 'LoadableComponent'; return LoadableComponent; } const _default = Loadable; //# sourceMappingURL=loadable.js.map €”{"finalSource":true}ƒmap‹bufferedMap ReplaceSourceRawSourcer "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "default", { enumerable: true, get: function() { return _default; } }); const _jsxruntime = require("react/jsx-runtime"); const _react = require("react"); const _dynamicbailouttocsr = require("./dynamic-bailout-to-csr"); const _preloadchunks = require("./preload-chunks"); // Normalize loader to return the module as form { default: Component } for `React.lazy`. // Also for backward compatible since next/dynamic allows to resolve a component directly with loader // Client component reference proxy need to be converted to a module. function convertModule(mod) { // Check "default" prop before accessing it, as it could be client reference proxy that could break it reference. // Cases: // mod: { default: Component } // mod: Component // mod: { default: proxy(Component) } // mod: proxy(Component) const hasDefault = mod && 'default' in mod; return { default: hasDefault ? mod.default : mod }; } const defaultOptions = { loader: ()=>Promise.resolve(convertModule(()=>null)), loading: null, ssr: true }; function Loadable(options) { const opts = { ...defaultOptions, ...options }; const Lazy = /*#__PURE__*/ (0, _react.lazy)(()=>opts.loader().then(convertModule)); const Loading = opts.loading; function LoadableComponent(props) { const fallbackElement = Loading ? /*#__PURE__*/ (0, _jsxruntime.jsx)(Loading, { isLoading: true, pastDelay: true, error: null }) : null; // If it's non-SSR or provided a loading component, wrap it in a suspense boundary const hasSuspenseBoundary = !opts.ssr || !!opts.loading; const Wrap = hasSuspenseBoundary ? _react.Suspense : _react.Fragment; const wrapProps = hasSuspenseBoundary ? { fallback: fallbackElement } : {}; const children = opts.ssr ? /*#__PURE__*/ (0, _jsxruntime.jsxs)(_jsxruntime.Fragment, { children: [ "object" === 'undefined' ? /*#__PURE__*/ (0, _jsxruntime.jsx)(_preloadchunks.PreloadChunks, { moduleIds: opts.modules }) : null, /*#__PURE__*/ (0, _jsxruntime.jsx)(Lazy, { ...props }) ] }) : /*#__PURE__*/ (0, _jsxruntime.jsx)(_dynamicbailouttocsr.BailoutToCSR, { reason: "next/dynamic", children: /*#__PURE__*/ (0, _jsxruntime.jsx)(Lazy, { ...props }) }); return /*#__PURE__*/ (0, _jsxruntime.jsx)(Wrap, { ...wrapProps, children: children }); } LoadableComponent.displayName = 'LoadableComponent'; return LoadableComponent; } const _default = Loadable; //# sourceMappingURL=loadable.js.map 012undefined1458Object.defineProperty(exports, "__esModule", (undefined7878))undefined81122Object.defineProperty(exports, "default", (undefined201201))undefined224230__webpack_require__undefined2322504568undefined269275__webpack_require__undefined2772837620undefined316322__webpack_require__undefined3243496452undefined376382__webpack_require__undefined3844013625undefined21202143 falseundefined216122750undefined /***/ }) €< /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); Object.defineProperty(exports, "default", ({ enumerable: true, get: function() { return _default; } })); const _jsxruntime = __webpack_require__(4568); const _react = __webpack_require__(7620); const _dynamicbailouttocsr = __webpack_require__(6452); const _preloadchunks = __webpack_require__(3625); // Normalize loader to return the module as form { default: Component } for `React.lazy`. // Also for backward compatible since next/dynamic allows to resolve a component directly with loader // Client component reference proxy need to be converted to a module. function convertModule(mod) { // Check "default" prop before accessing it, as it could be client reference proxy that could break it reference. // Cases: // mod: { default: Component } // mod: Component // mod: { default: proxy(Component) } // mod: proxy(Component) const hasDefault = mod && 'default' in mod; return { default: hasDefault ? mod.default : mod }; } const defaultOptions = { loader: ()=>Promise.resolve(convertModule(()=>null)), loading: null, ssr: true }; function Loadable(options) { const opts = { ...defaultOptions, ...options }; const Lazy = /*#__PURE__*/ (0, _react.lazy)(()=>opts.loader().then(convertModule)); const Loading = opts.loading; function LoadableComponent(props) { const fallbackElement = Loading ? /*#__PURE__*/ (0, _jsxruntime.jsx)(Loading, { isLoading: true, pastDelay: true, error: null }) : null; // If it's non-SSR or provided a loading component, wrap it in a suspense boundary const hasSuspenseBoundary = !opts.ssr || !!opts.loading; const Wrap = hasSuspenseBoundary ? _react.Suspense : _react.Fragment; const wrapProps = hasSuspenseBoundary ? { fallback: fallbackElement } : {}; const children = opts.ssr ? /*#__PURE__*/ (0, _jsxruntime.jsxs)(_jsxruntime.Fragment, { children: [ false ? /*#__PURE__*/ 0 : null, /*#__PURE__*/ (0, _jsxruntime.jsx)(Lazy, { ...props }) ] }) : /*#__PURE__*/ (0, _jsxruntime.jsx)(_dynamicbailouttocsr.BailoutToCSR, { reason: "next/dynamic", children: /*#__PURE__*/ (0, _jsxruntime.jsx)(Lazy, { ...props }) }); return /*#__PURE__*/ (0, _jsxruntime.jsx)(Wrap, { ...wrapProps, children: children }); } LoadableComponent.displayName = 'LoadableComponent'; return LoadableComponent; } const _default = Loadable; //# sourceMappingURL=loadable.js.map /***/ }) „ …¶ˆr "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "default", { enumerable: true, get: function() { return _default; } }); const _jsxruntime = require("react/jsx-runtime"); const _react = require("react"); const _dynamicbailouttocsr = require("./dynamic-bailout-to-csr"); const _preloadchunks = require("./preload-chunks"); // Normalize loader to return the module as form { default: Component } for `React.lazy`. // Also for backward compatible since next/dynamic allows to resolve a component directly with loader // Client component reference proxy need to be converted to a module. function convertModule(mod) { // Check "default" prop before accessing it, as it could be client reference proxy that could break it reference. // Cases: // mod: { default: Component } // mod: Component // mod: { default: proxy(Component) } // mod: proxy(Component) const hasDefault = mod && 'default' in mod; return { default: hasDefault ? mod.default : mod }; } const defaultOptions = { loader: ()=>Promise.resolve(convertModule(()=>null)), loading: null, ssr: true }; function Loadable(options) { const opts = { ...defaultOptions, ...options }; const Lazy = /*#__PURE__*/ (0, _react.lazy)(()=>opts.loader().then(convertModule)); const Loading = opts.loading; function LoadableComponent(props) { const fallbackElement = Loading ? /*#__PURE__*/ (0, _jsxruntime.jsx)(Loading, { isLoading: true, pastDelay: true, error: null }) : null; // If it's non-SSR or provided a loading component, wrap it in a suspense boundary const hasSuspenseBoundary = !opts.ssr || !!opts.loading; const Wrap = hasSuspenseBoundary ? _react.Suspense : _react.Fragment; const wrapProps = hasSuspenseBoundary ? { fallback: fallbackElement } : {}; const children = opts.ssr ? /*#__PURE__*/ (0, _jsxruntime.jsxs)(_jsxruntime.Fragment, { children: [ "object" === 'undefined' ? /*#__PURE__*/ (0, _jsxruntime.jsx)(_preloadchunks.PreloadChunks, { moduleIds: opts.modules }) : null, /*#__PURE__*/ (0, _jsxruntime.jsx)(Lazy, { ...props }) ] }) : /*#__PURE__*/ (0, _jsxruntime.jsx)(_dynamicbailouttocsr.BailoutToCSR, { reason: "next/dynamic", children: /*#__PURE__*/ (0, _jsxruntime.jsx)(Lazy, { ...props }) }); return /*#__PURE__*/ (0, _jsxruntime.jsx)(Wrap, { ...wrapProps, children: children }); } LoadableComponent.displayName = 'LoadableComponent'; return LoadableComponent; } const _default = Loadable; //# sourceMappingURL=loadable.js.map 012undefined1458Object.defineProperty(exports, "__esModule", (undefined7878))undefined81122Object.defineProperty(exports, "default", (undefined201201))undefined224230__webpack_require__undefined2322504568undefined269275__webpack_require__undefined2772837620undefined316322__webpack_require__undefined3243496452undefined376382__webpack_require__undefined3844013625undefined21202143 falseundefined216122750undefined‰Š, /***/ 7380:  Ó«webpack/lib/util/registerExternalSerializerœwebpack-sources/ConcatSource€«webpack/lib/util/registerExternalSerializer™webpack-sources/RawSource_/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; «webpack/lib/util/registerExternalSerializerœwebpack-sources/CachedSource («webpack/lib/util/registerExternalSerializerœwebpack-sources/ConcatSource€«webpack/lib/util/registerExternalSerializer™webpack-sources/RawSourcek/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ ScrollToTopButton: () => (/* binding */ ScrollToTopButton) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); «webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourceç/* __next_internal_client_entry_do_not_use__ ScrollToTopButton auto */ import { jsx as _jsx } from "react/jsx-runtime"; import { useEffect, useState } from 'react'; export function ScrollToTopButton() { const [visible, setVisible] = useState(false); useEffect(()=>{ const onScroll = ()=>{ setVisible(window.scrollY > 200); }; window.addEventListener('scroll', onScroll); return ()=>window.removeEventListener('scroll', onScroll); }, []); return /*#__PURE__*/ _jsx("button", { className: "scroll-to-top-btn".concat(visible ? ' visible' : ''), "aria-label": "Back to top", onClick: ()=>window.scrollTo({ top: 0, behavior: 'smooth' }), children: /*#__PURE__*/ _jsx("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /*#__PURE__*/ _jsx("path", { d: "M10 16V4M10 4L4 10M10 4L16 10", stroke: "white", strokeWidth: "2.8", strokeLinecap: "round", strokeLinejoin: "round" }) }) }); } bGvxL£¥«íô  ë€¯(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)°(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)¶(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)ÿÿ€†buffer†source„size„maps„hashÓ/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ ScrollToTopButton: () => (/* binding */ ScrollToTopButton) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* __next_internal_client_entry_do_not_use__ ScrollToTopButton auto */ function ScrollToTopButton() { const [visible, setVisible] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ const onScroll = ()=>{ setVisible(window.scrollY > 200); }; window.addEventListener('scroll', onScroll); return ()=>window.removeEventListener('scroll', onScroll); }, []); return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { className: "scroll-to-top-btn".concat(visible ? ' visible' : ''), "aria-label": "Back to top", onClick: ()=>window.scrollTo({ top: 0, behavior: 'smooth' }), children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M10 16V4M10 4L4 10M10 4L16 10", stroke: "white", strokeWidth: "2.8", strokeLinecap: "round", strokeLinejoin: "round" }) }) }); } €”{"finalSource":true}ƒmap‹bufferedMap ConcatSourceRawSourcek/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ ScrollToTopButton: () => (/* binding */ ScrollToTopButton) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); ReplaceSourceRawSourceç/* __next_internal_client_entry_do_not_use__ ScrollToTopButton auto */ import { jsx as _jsx } from "react/jsx-runtime"; import { useEffect, useState } from 'react'; export function ScrollToTopButton() { const [visible, setVisible] = useState(false); useEffect(()=>{ const onScroll = ()=>{ setVisible(window.scrollY > 200); }; window.addEventListener('scroll', onScroll); return ()=>window.removeEventListener('scroll', onScroll); }, []); return /*#__PURE__*/ _jsx("button", { className: "scroll-to-top-btn".concat(visible ? ' visible' : ''), "aria-label": "Back to top", onClick: ()=>window.scrollTo({ top: 0, behavior: 'smooth' }), children: /*#__PURE__*/ _jsx("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /*#__PURE__*/ _jsx("path", { d: "M10 16V4M10 4L4 10M10 4L16 10", stroke: "white", strokeWidth: "2.8", strokeLinecap: "round", strokeLinejoin: "round" }) }) }); } z71118undefined120163undefined165171undefined237244(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined258266(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined519522(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined793796(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined10031006(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined /***/ }) vÿÿÿ</***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ ScrollToTopButton: () => (/* binding */ ScrollToTopButton) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* __next_internal_client_entry_do_not_use__ ScrollToTopButton auto */ function ScrollToTopButton() { const [visible, setVisible] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ const onScroll = ()=>{ setVisible(window.scrollY > 200); }; window.addEventListener('scroll', onScroll); return ()=>window.removeEventListener('scroll', onScroll); }, []); return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { className: "scroll-to-top-btn".concat(visible ? ' visible' : ''), "aria-label": "Back to top", onClick: ()=>window.scrollTo({ top: 0, behavior: 'smooth' }), children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M10 16V4M10 4L4 10M10 4L16 10", stroke: "white", strokeWidth: "2.8", strokeLinecap: "round", strokeLinejoin: "round" }) }) }); } /***/ }) wÿÿÿzÿÿÿ  {ÿÿÿ|ÿÿÿ{ÿÿÿk/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ ScrollToTopButton: () => (/* binding */ ScrollToTopButton) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); }ÿÿÿç/* __next_internal_client_entry_do_not_use__ ScrollToTopButton auto */ import { jsx as _jsx } from "react/jsx-runtime"; import { useEffect, useState } from 'react'; export function ScrollToTopButton() { const [visible, setVisible] = useState(false); useEffect(()=>{ const onScroll = ()=>{ setVisible(window.scrollY > 200); }; window.addEventListener('scroll', onScroll); return ()=>window.removeEventListener('scroll', onScroll); }, []); return /*#__PURE__*/ _jsx("button", { className: "scroll-to-top-btn".concat(visible ? ' visible' : ''), "aria-label": "Back to top", onClick: ()=>window.scrollTo({ top: 0, behavior: 'smooth' }), children: /*#__PURE__*/ _jsx("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /*#__PURE__*/ _jsx("path", { d: "M10 16V4M10 4L4 10M10 4L16 10", stroke: "white", strokeWidth: "2.8", strokeLinecap: "round", strokeLinejoin: "round" }) }) }); } z71118undefined120163undefined165171undefined237244(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined258266(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined519522(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined793796(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined10031006(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined~ÿÿÿÿÿÿ, /***/ 8761:  †«webpack/lib/util/registerExternalSerializerœwebpack-sources/ConcatSource€«webpack/lib/util/registerExternalSerializer™webpack-sources/RawSource/***/ (() => { «webpack/lib/util/registerExternalSerializerœwebpack-sources/CachedSource Ä«webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSource«webpack/lib/util/registerExternalSerializer™webpack-sources/RawSource'// extracted by mini-css-extract-plugin €†buffer†source„size„maps„hash'// extracted by mini-css-extract-plugin €”{"finalSource":true}ƒmap‹bufferedMap ReplaceSourceRawSourceø /***/ }) kÿÿÿA/***/ (() => { // extracted by mini-css-extract-plugin /***/ }) lÿÿÿoÿÿÿ pÿÿÿ/***/ (() => { rÿÿÿ'// extracted by mini-css-extract-pluginsÿÿÿtÿÿÿ, /***/ 9113:  ç«webpack/lib/util/registerExternalSerializerœwebpack-sources/ConcatSource€«webpack/lib/util/registerExternalSerializer™webpack-sources/RawSource>/***/ ((__unused_webpack_module, exports) => { "use strict"; «webpack/lib/util/registerExternalSerializerœwebpack-sources/CachedSource ú«webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSource«webpack/lib/util/registerExternalSerializer™webpack-sources/RawSource"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); 0 && (module.exports = { bindSnapshot: null, createAsyncLocalStorage: null, createSnapshot: null }); function _export(target, all) { for(var name in all)Object.defineProperty(target, name, { enumerable: true, get: all[name] }); } _export(exports, { bindSnapshot: function() { return bindSnapshot; }, createAsyncLocalStorage: function() { return createAsyncLocalStorage; }, createSnapshot: function() { return createSnapshot; } }); const sharedAsyncLocalStorageNotAvailableError = Object.defineProperty(new Error('Invariant: AsyncLocalStorage accessed in runtime where it is not available'), "__NEXT_ERROR_CODE", { value: "E504", enumerable: false, configurable: true }); class FakeAsyncLocalStorage { disable() { throw sharedAsyncLocalStorageNotAvailableError; } getStore() { // This fake implementation of AsyncLocalStorage always returns `undefined`. return undefined; } run() { throw sharedAsyncLocalStorageNotAvailableError; } exit() { throw sharedAsyncLocalStorageNotAvailableError; } enterWith() { throw sharedAsyncLocalStorageNotAvailableError; } static bind(fn) { return fn; } } const maybeGlobalAsyncLocalStorage = typeof globalThis !== 'undefined' && globalThis.AsyncLocalStorage; function createAsyncLocalStorage() { if (maybeGlobalAsyncLocalStorage) { return new maybeGlobalAsyncLocalStorage(); } return new FakeAsyncLocalStorage(); } function bindSnapshot(fn) { if (maybeGlobalAsyncLocalStorage) { return maybeGlobalAsyncLocalStorage.bind(fn); } return FakeAsyncLocalStorage.bind(fn); } function createSnapshot() { if (maybeGlobalAsyncLocalStorage) { return maybeGlobalAsyncLocalStorage.snapshot(); } return function(fn, ...args) { return fn(...args); }; } //# sourceMappingURL=async-local-storage.js.map e :NNW@Ÿ€®Object.defineProperty(exports, "__esModule", (‚))0€†buffer†source„size„maps„hash¥ Object.defineProperty(exports, "__esModule", ({ value: true })); 0 && (0); function _export(target, all) { for(var name in all)Object.defineProperty(target, name, { enumerable: true, get: all[name] }); } _export(exports, { bindSnapshot: function() { return bindSnapshot; }, createAsyncLocalStorage: function() { return createAsyncLocalStorage; }, createSnapshot: function() { return createSnapshot; } }); const sharedAsyncLocalStorageNotAvailableError = Object.defineProperty(new Error('Invariant: AsyncLocalStorage accessed in runtime where it is not available'), "__NEXT_ERROR_CODE", { value: "E504", enumerable: false, configurable: true }); class FakeAsyncLocalStorage { disable() { throw sharedAsyncLocalStorageNotAvailableError; } getStore() { // This fake implementation of AsyncLocalStorage always returns `undefined`. return undefined; } run() { throw sharedAsyncLocalStorageNotAvailableError; } exit() { throw sharedAsyncLocalStorageNotAvailableError; } enterWith() { throw sharedAsyncLocalStorageNotAvailableError; } static bind(fn) { return fn; } } const maybeGlobalAsyncLocalStorage = typeof globalThis !== 'undefined' && globalThis.AsyncLocalStorage; function createAsyncLocalStorage() { if (maybeGlobalAsyncLocalStorage) { return new maybeGlobalAsyncLocalStorage(); } return new FakeAsyncLocalStorage(); } function bindSnapshot(fn) { if (maybeGlobalAsyncLocalStorage) { return maybeGlobalAsyncLocalStorage.bind(fn); } return FakeAsyncLocalStorage.bind(fn); } function createSnapshot() { if (maybeGlobalAsyncLocalStorage) { return maybeGlobalAsyncLocalStorage.snapshot(); } return function(fn, ...args) { return fn(...args); }; } //# sourceMappingURL=async-local-storage.js.map €”{"finalSource":true}ƒmap‹bufferedMap ReplaceSourceRawSource"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); 0 && (module.exports = { bindSnapshot: null, createAsyncLocalStorage: null, createSnapshot: null }); function _export(target, all) { for(var name in all)Object.defineProperty(target, name, { enumerable: true, get: all[name] }); } _export(exports, { bindSnapshot: function() { return bindSnapshot; }, createAsyncLocalStorage: function() { return createAsyncLocalStorage; }, createSnapshot: function() { return createSnapshot; } }); const sharedAsyncLocalStorageNotAvailableError = Object.defineProperty(new Error('Invariant: AsyncLocalStorage accessed in runtime where it is not available'), "__NEXT_ERROR_CODE", { value: "E504", enumerable: false, configurable: true }); class FakeAsyncLocalStorage { disable() { throw sharedAsyncLocalStorageNotAvailableError; } getStore() { // This fake implementation of AsyncLocalStorage always returns `undefined`. return undefined; } run() { throw sharedAsyncLocalStorageNotAvailableError; } exit() { throw sharedAsyncLocalStorageNotAvailableError; } enterWith() { throw sharedAsyncLocalStorageNotAvailableError; } static bind(fn) { return fn; } } const maybeGlobalAsyncLocalStorage = typeof globalThis !== 'undefined' && globalThis.AsyncLocalStorage; function createAsyncLocalStorage() { if (maybeGlobalAsyncLocalStorage) { return new maybeGlobalAsyncLocalStorage(); } return new FakeAsyncLocalStorage(); } function bindSnapshot(fn) { if (maybeGlobalAsyncLocalStorage) { return maybeGlobalAsyncLocalStorage.bind(fn); } return FakeAsyncLocalStorage.bind(fn); } function createSnapshot() { if (maybeGlobalAsyncLocalStorage) { return maybeGlobalAsyncLocalStorage.snapshot(); } return function(fn, ...args) { return fn(...args); }; } //# sourceMappingURL=async-local-storage.js.mape012undefined1458Object.defineProperty(exports, "__esModule", (undefined7878))undefined871900undefined /***/ }) `ÿÿÿí/***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); 0 && (0); function _export(target, all) { for(var name in all)Object.defineProperty(target, name, { enumerable: true, get: all[name] }); } _export(exports, { bindSnapshot: function() { return bindSnapshot; }, createAsyncLocalStorage: function() { return createAsyncLocalStorage; }, createSnapshot: function() { return createSnapshot; } }); const sharedAsyncLocalStorageNotAvailableError = Object.defineProperty(new Error('Invariant: AsyncLocalStorage accessed in runtime where it is not available'), "__NEXT_ERROR_CODE", { value: "E504", enumerable: false, configurable: true }); class FakeAsyncLocalStorage { disable() { throw sharedAsyncLocalStorageNotAvailableError; } getStore() { // This fake implementation of AsyncLocalStorage always returns `undefined`. return undefined; } run() { throw sharedAsyncLocalStorageNotAvailableError; } exit() { throw sharedAsyncLocalStorageNotAvailableError; } enterWith() { throw sharedAsyncLocalStorageNotAvailableError; } static bind(fn) { return fn; } } const maybeGlobalAsyncLocalStorage = typeof globalThis !== 'undefined' && globalThis.AsyncLocalStorage; function createAsyncLocalStorage() { if (maybeGlobalAsyncLocalStorage) { return new maybeGlobalAsyncLocalStorage(); } return new FakeAsyncLocalStorage(); } function bindSnapshot(fn) { if (maybeGlobalAsyncLocalStorage) { return maybeGlobalAsyncLocalStorage.bind(fn); } return FakeAsyncLocalStorage.bind(fn); } function createSnapshot() { if (maybeGlobalAsyncLocalStorage) { return maybeGlobalAsyncLocalStorage.snapshot(); } return function(fn, ...args) { return fn(...args); }; } //# sourceMappingURL=async-local-storage.js.map /***/ }) aÿÿÿdÿÿÿ eÿÿÿ>/***/ ((__unused_webpack_module, exports) => { "use strict"; gÿÿÿ"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); 0 && (module.exports = { bindSnapshot: null, createAsyncLocalStorage: null, createSnapshot: null }); function _export(target, all) { for(var name in all)Object.defineProperty(target, name, { enumerable: true, get: all[name] }); } _export(exports, { bindSnapshot: function() { return bindSnapshot; }, createAsyncLocalStorage: function() { return createAsyncLocalStorage; }, createSnapshot: function() { return createSnapshot; } }); const sharedAsyncLocalStorageNotAvailableError = Object.defineProperty(new Error('Invariant: AsyncLocalStorage accessed in runtime where it is not available'), "__NEXT_ERROR_CODE", { value: "E504", enumerable: false, configurable: true }); class FakeAsyncLocalStorage { disable() { throw sharedAsyncLocalStorageNotAvailableError; } getStore() { // This fake implementation of AsyncLocalStorage always returns `undefined`. return undefined; } run() { throw sharedAsyncLocalStorageNotAvailableError; } exit() { throw sharedAsyncLocalStorageNotAvailableError; } enterWith() { throw sharedAsyncLocalStorageNotAvailableError; } static bind(fn) { return fn; } } const maybeGlobalAsyncLocalStorage = typeof globalThis !== 'undefined' && globalThis.AsyncLocalStorage; function createAsyncLocalStorage() { if (maybeGlobalAsyncLocalStorage) { return new maybeGlobalAsyncLocalStorage(); } return new FakeAsyncLocalStorage(); } function bindSnapshot(fn) { if (maybeGlobalAsyncLocalStorage) { return maybeGlobalAsyncLocalStorage.bind(fn); } return FakeAsyncLocalStorage.bind(fn); } function createSnapshot() { if (maybeGlobalAsyncLocalStorage) { return maybeGlobalAsyncLocalStorage.snapshot(); } return function(fn, ...args) { return fn(...args); }; } //# sourceMappingURL=async-local-storage.js.mape012undefined1458Object.defineProperty(exports, "__esModule", (undefined7878))undefined871900undefinedhÿÿÿiÿÿÿ, /***/ 9649:  ï«webpack/lib/util/registerExternalSerializerœwebpack-sources/ConcatSource€«webpack/lib/util/registerExternalSerializer™webpack-sources/RawSource_/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; «webpack/lib/util/registerExternalSerializerœwebpack-sources/CachedSource µ·«webpack/lib/util/registerExternalSerializerœwebpack-sources/ConcatSource€«webpack/lib/util/registerExternalSerializer™webpack-sources/RawSource // EXPORTS __webpack_require__.d(__webpack_exports__, { Header: () => (/* binding */ Header) }); // EXTERNAL MODULE: ../../node_modules/next/dist/compiled/react/jsx-runtime.js var jsx_runtime = __webpack_require__(4568); // EXTERNAL MODULE: ../../node_modules/next/dist/client/app-dir/link.js var app_dir_link = __webpack_require__(9664); var link_default = /*#__PURE__*/__webpack_require__.n(app_dir_link); // EXTERNAL MODULE: ../../node_modules/next/dist/api/navigation.js var navigation = __webpack_require__(7541); // EXTERNAL MODULE: ./src/lib/auth.ts var auth = __webpack_require__(1592); // EXTERNAL MODULE: ./src/context/locale.tsx var context_locale = __webpack_require__(9906); // EXTERNAL MODULE: ./src/lib/formatName.ts var formatName = __webpack_require__(1258); // EXTERNAL MODULE: ../../node_modules/next/dist/compiled/react/index.js var react = __webpack_require__(7620); // EXTERNAL MODULE: ./src/lib/translations.ts var translations = __webpack_require__(4962); ;// ./src/components/LanguageSwitcher.tsx «webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSource«webpack/lib/util/registerExternalSerializerœwebpack-sources/CachedSource Ž«webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSource«webpack/lib/util/registerExternalSerializer™webpack-sources/RawSource™/* __next_internal_client_entry_do_not_use__ LanguageSwitcher auto */ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { useState, useRef, useEffect } from 'react'; import { useLocale } from '@/context/locale'; import { LOCALES } from '@/lib/translations'; export function LanguageSwitcher() { const { locale, setLocale } = useLocale(); const [open, setOpen] = useState(false); const ref = useRef(null); var _LOCALES_find; const current = (_LOCALES_find = LOCALES.find((l)=>l.code === locale)) !== null && _LOCALES_find !== void 0 ? _LOCALES_find : LOCALES[0]; // Close on outside click useEffect(()=>{ function handleClick(e) { if (ref.current && !ref.current.contains(e.target)) setOpen(false); } document.addEventListener('mousedown', handleClick); return ()=>document.removeEventListener('mousedown', handleClick); }, []); return /*#__PURE__*/ _jsxs("div", { ref: ref, className: "relative", children: [ /*#__PURE__*/ _jsxs("button", { onClick: ()=>setOpen(!open), className: "flex items-center gap-1.5 px-2.5 py-1.5 rounded-lg border border-gray-200 hover:border-green-400 hover:bg-green-50 transition text-sm font-medium text-gray-700", "aria-label": "Change language", children: [ /*#__PURE__*/ _jsx("span", { children: current.code.toUpperCase() }), /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5 text-gray-400 transition-transform ".concat(open ? 'rotate-180' : ''), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19 9l-7 7-7-7" }) }) ] }), open && /*#__PURE__*/ _jsx("div", { className: "absolute right-0 mt-1 w-40 bg-white border border-gray-200 rounded-xl shadow-lg z-50 overflow-hidden", children: LOCALES.map((loc)=>/*#__PURE__*/ _jsxs("button", { onClick: ()=>{ setLocale(loc.code); setOpen(false); }, className: "w-full flex items-center gap-2.5 px-3.5 py-2.5 text-sm hover:bg-green-50 transition ".concat(locale === loc.code ? 'bg-green-50 text-green-700 font-medium' : 'text-gray-700'), children: [ /*#__PURE__*/ _jsx("span", { children: loc.label }), locale === loc.code && /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5 ml-auto text-green-600", fill: "currentColor", viewBox: "0 0 20 20", children: /*#__PURE__*/ _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" }) }) ] }, loc.code)) }) ] }); } aF_„†¹»çé^f‡Žš­òøOU}…¶º$(“wz•J˜@ F a e 4 7 Ø Û Û Þ €€€€€×__WEBPACK_MODULE_REFERENCE__4_5b227573654c6f63616c65225d_call_directImport_asiSafe1__._Õ__WEBPACK_MODULE_REFERENCE__6_5b227573655374617465225d_call_directImport_asiSafe1__._Ñ__WEBPACK_MODULE_REFERENCE__6_5b22757365526566225d_call_directImport_asiSafe1__._Æ__WEBPACK_MODULE_REFERENCE__7_5b224c4f43414c4553225d_call_asiSafe1__._Á__WEBPACK_MODULE_REFERENCE__7_5b224c4f43414c4553225d_asiSafe1__._×__WEBPACK_MODULE_REFERENCE__6_5b22757365456666656374225d_call_directImport_asiSafe1__._Í__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._ÿË__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._ÿÿÿûþÿÿÿ€†buffer†source„size„maps„hashz/* __next_internal_client_entry_do_not_use__ LanguageSwitcher auto */ function LanguageSwitcher() { const { locale, setLocale } = __WEBPACK_MODULE_REFERENCE__4_5b227573654c6f63616c65225d_call_directImport_asiSafe1__._(); const [open, setOpen] = __WEBPACK_MODULE_REFERENCE__6_5b227573655374617465225d_call_directImport_asiSafe1__._(false); const ref = __WEBPACK_MODULE_REFERENCE__6_5b22757365526566225d_call_directImport_asiSafe1__._(null); var _LOCALES_find; const current = (_LOCALES_find = __WEBPACK_MODULE_REFERENCE__7_5b224c4f43414c4553225d_call_asiSafe1__._.find((l)=>l.code === locale)) !== null && _LOCALES_find !== void 0 ? _LOCALES_find : __WEBPACK_MODULE_REFERENCE__7_5b224c4f43414c4553225d_asiSafe1__._[0]; // Close on outside click __WEBPACK_MODULE_REFERENCE__6_5b22757365456666656374225d_call_directImport_asiSafe1__._(()=>{ function handleClick(e) { if (ref.current && !ref.current.contains(e.target)) setOpen(false); } document.addEventListener('mousedown', handleClick); return ()=>document.removeEventListener('mousedown', handleClick); }, []); return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { ref: ref, className: "relative", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("button", { onClick: ()=>setOpen(!open), className: "flex items-center gap-1.5 px-2.5 py-1.5 rounded-lg border border-gray-200 hover:border-green-400 hover:bg-green-50 transition text-sm font-medium text-gray-700", "aria-label": "Change language", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { children: current.code.toUpperCase() }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("svg", { className: "w-3.5 h-3.5 text-gray-400 transition-transform ".concat(open ? 'rotate-180' : ''), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19 9l-7 7-7-7" }) }) ] }), open && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "absolute right-0 mt-1 w-40 bg-white border border-gray-200 rounded-xl shadow-lg z-50 overflow-hidden", children: __WEBPACK_MODULE_REFERENCE__7_5b224c4f43414c4553225d_call_asiSafe1__._.map((loc)=>/*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("button", { onClick: ()=>{ setLocale(loc.code); setOpen(false); }, className: "w-full flex items-center gap-2.5 px-3.5 py-2.5 text-sm hover:bg-green-50 transition ".concat(locale === loc.code ? 'bg-green-50 text-green-700 font-medium' : 'text-gray-700'), children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { children: loc.label }), locale === loc.code && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("svg", { className: "w-3.5 h-3.5 ml-auto text-green-600", fill: "currentColor", viewBox: "0 0 20 20", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("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" }) }) ] }, loc.code)) }) ] }); } €•{"finalSource":false}ƒmap‹bufferedMap ReplaceSourceRawSource™/* __next_internal_client_entry_do_not_use__ LanguageSwitcher auto */ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { useState, useRef, useEffect } from 'react'; import { useLocale } from '@/context/locale'; import { LOCALES } from '@/lib/translations'; export function LanguageSwitcher() { const { locale, setLocale } = useLocale(); const [open, setOpen] = useState(false); const ref = useRef(null); var _LOCALES_find; const current = (_LOCALES_find = LOCALES.find((l)=>l.code === locale)) !== null && _LOCALES_find !== void 0 ? _LOCALES_find : LOCALES[0]; // Close on outside click useEffect(()=>{ function handleClick(e) { if (ref.current && !ref.current.contains(e.target)) setOpen(false); } document.addEventListener('mousedown', handleClick); return ()=>document.removeEventListener('mousedown', handleClick); }, []); return /*#__PURE__*/ _jsxs("div", { ref: ref, className: "relative", children: [ /*#__PURE__*/ _jsxs("button", { onClick: ()=>setOpen(!open), className: "flex items-center gap-1.5 px-2.5 py-1.5 rounded-lg border border-gray-200 hover:border-green-400 hover:bg-green-50 transition text-sm font-medium text-gray-700", "aria-label": "Change language", children: [ /*#__PURE__*/ _jsx("span", { children: current.code.toUpperCase() }), /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5 text-gray-400 transition-transform ".concat(open ? 'rotate-180' : ''), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19 9l-7 7-7-7" }) }) ] }), open && /*#__PURE__*/ _jsx("div", { className: "absolute right-0 mt-1 w-40 bg-white border border-gray-200 rounded-xl shadow-lg z-50 overflow-hidden", children: LOCALES.map((loc)=>/*#__PURE__*/ _jsxs("button", { onClick: ()=>{ setLocale(loc.code); setOpen(false); }, className: "w-full flex items-center gap-2.5 px-3.5 py-2.5 text-sm hover:bg-green-50 transition ".concat(locale === loc.code ? 'bg-green-50 text-green-700 font-medium' : 'text-gray-700'), children: [ /*#__PURE__*/ _jsx("span", { children: loc.label }), locale === loc.code && /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5 ml-auto text-green-600", fill: "currentColor", viewBox: "0 0 20 20", children: /*#__PURE__*/ _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" }) }) ] }, loc.code)) }) ] }); } r70132undefined134185undefined187231undefined233277undefined279285undefined350358__WEBPACK_MODULE_REFERENCE__4_5b227573654c6f63616c65225d_call_directImport_asiSafe1__._undefined391398__WEBPACK_MODULE_REFERENCE__6_5b227573655374617465225d_call_directImport_asiSafe1__._undefined424429__WEBPACK_MODULE_REFERENCE__6_5b22757365526566225d_call_directImport_asiSafe1__._undefined498504__WEBPACK_MODULE_REFERENCE__7_5b224c4f43414c4553225d_call_asiSafe1__._undefined591597__WEBPACK_MODULE_REFERENCE__7_5b224c4f43414c4553225d_asiSafe1__._undefined637645__WEBPACK_MODULE_REFERENCE__6_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined950954__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined10601064__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined14241427__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined15581561__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined19111914__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined21972200__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined23682374__WEBPACK_MODULE_REFERENCE__7_5b224c4f43414c4553225d_call_asiSafe1__._undefined24012405__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined28682871__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined30323035__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined32913294__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined`_ŠàUo¿I à^ÛE‘ùCÆn ž Ó  Å % q @Š+uAu¿£(0,context_locale/* useLocale */.Y)’(0,react.useState)(0,react.useRef)œtranslations/* LOCALES */.YZÿ“(0,react.useEffect)”(0,jsx_runtime.jsxs)ÿ“(0,jsx_runtime.jsx)ÿÿÿüþÿÿÿì // EXTERNAL MODULE: ./src/lib/api.ts var api = __webpack_require__(2982); // EXTERNAL MODULE: ../../node_modules/socket.io-client/build/esm/index.js + 28 modules var esm = __webpack_require__(2838); ;// ./src/hooks/useEffectiveRole.ts  +«webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSource«webpack/lib/util/registerExternalSerializer™webpack-sources/RawSourceT/* __next_internal_client_entry_do_not_use__ useEffectiveRole auto */ import { useSession } from '@/lib/auth'; import { useEffect, useState } from 'react'; function readPreviewRole() { if (typeof document === 'undefined') return null; const m = document.cookie.match(/(?:^|;\s*)canhelp_preview_role=([^;]+)/); var _m_; return (_m_ = m === null || m === void 0 ? void 0 : m[1]) !== null && _m_ !== void 0 ? _m_ : null; } /** * Returns the effective role for the current user. * For admins, respects the `canhelp_preview_role` cookie set by AdminRolePreview widget. * Updates reactively when the widget dispatches `canhelp:preview-role`. */ export function useEffectiveRole() { var _session_user; const { data: session } = useSession(); const userRole = session === null || session === void 0 ? void 0 : (_session_user = session.user) === null || _session_user === void 0 ? void 0 : _session_user.role; const isAdmin = userRole === 'admin'; const [previewRole, setPreviewRole] = useState(null); useEffect(()=>{ if (!isAdmin) return; setPreviewRole(readPreviewRole()); const sync = ()=>setPreviewRole(readPreviewRole()); window.addEventListener('canhelp:preview-role', sync); document.addEventListener('visibilitychange', sync); return ()=>{ window.removeEventListener('canhelp:preview-role', sync); document.removeEventListener('visibilitychange', sync); }; }, [ isAdmin ]); if (!userRole) return null; if (isAdmin && previewRole) return previewRole; return userRole; } bFmoHš“™íöù €€€Ù__WEBPACK_MODULE_REFERENCE__3_5b2275736553657373696f6e225d_call_directImport_asiSafe1__._Õ__WEBPACK_MODULE_REFERENCE__6_5b227573655374617465225d_call_directImport_asiSafe1__._×__WEBPACK_MODULE_REFERENCE__6_5b22757365456666656374225d_call_directImport_asiSafe1__._èã/* __next_internal_client_entry_do_not_use__ useEffectiveRole auto */ function readPreviewRole() { if (typeof document === 'undefined') return null; const m = document.cookie.match(/(?:^|;\s*)canhelp_preview_role=([^;]+)/); var _m_; return (_m_ = m === null || m === void 0 ? void 0 : m[1]) !== null && _m_ !== void 0 ? _m_ : null; } /** * Returns the effective role for the current user. * For admins, respects the `canhelp_preview_role` cookie set by AdminRolePreview widget. * Updates reactively when the widget dispatches `canhelp:preview-role`. */ function useEffectiveRole() { var _session_user; const { data: session } = __WEBPACK_MODULE_REFERENCE__3_5b2275736553657373696f6e225d_call_directImport_asiSafe1__._(); const userRole = session === null || session === void 0 ? void 0 : (_session_user = session.user) === null || _session_user === void 0 ? void 0 : _session_user.role; const isAdmin = userRole === 'admin'; const [previewRole, setPreviewRole] = __WEBPACK_MODULE_REFERENCE__6_5b227573655374617465225d_call_directImport_asiSafe1__._(null); __WEBPACK_MODULE_REFERENCE__6_5b22757365456666656374225d_call_directImport_asiSafe1__._(()=>{ if (!isAdmin) return; setPreviewRole(readPreviewRole()); const sync = ()=>setPreviewRole(readPreviewRole()); window.addEventListener('canhelp:preview-role', sync); document.addEventListener('visibilitychange', sync); return ()=>{ window.removeEventListener('canhelp:preview-role', sync); document.removeEventListener('visibilitychange', sync); }; }, [ isAdmin ]); if (!userRole) return null; if (isAdmin && previewRole) return previewRole; return userRole; } éì íT/* __next_internal_client_entry_do_not_use__ useEffectiveRole auto */ import { useSession } from '@/lib/auth'; import { useEffect, useState } from 'react'; function readPreviewRole() { if (typeof document === 'undefined') return null; const m = document.cookie.match(/(?:^|;\s*)canhelp_preview_role=([^;]+)/); var _m_; return (_m_ = m === null || m === void 0 ? void 0 : m[1]) !== null && _m_ !== void 0 ? _m_ : null; } /** * Returns the effective role for the current user. * For admins, respects the `canhelp_preview_role` cookie set by AdminRolePreview widget. * Updates reactively when the widget dispatches `canhelp:preview-role`. */ export function useEffectiveRole() { var _session_user; const { data: session } = useSession(); const userRole = session === null || session === void 0 ? void 0 : (_session_user = session.user) === null || _session_user === void 0 ? void 0 : _session_user.role; const isAdmin = userRole === 'admin'; const [previewRole, setPreviewRole] = useState(null); useEffect(()=>{ if (!isAdmin) return; setPreviewRole(readPreviewRole()); const sync = ()=>setPreviewRole(readPreviewRole()); window.addEventListener('canhelp:preview-role', sync); document.addEventListener('visibilitychange', sync); return ()=>{ window.removeEventListener('canhelp:preview-role', sync); document.removeEventListener('visibilitychange', sync); }; }, [ isAdmin ]); if (!userRole) return null; if (isAdmin && previewRole) return previewRole; return userRole; } b70109undefined111154undefined659665undefined749758__WEBPACK_MODULE_REFERENCE__3_5b2275736553657373696f6e225d_call_directImport_asiSafe1__._undefined10171024__WEBPACK_MODULE_REFERENCE__6_5b227573655374617465225d_call_directImport_asiSafe1__._undefined10371045__WEBPACK_MODULE_REFERENCE__6_5b22757365456666656374225d_call_directImport_asiSafe1__._undefinedE’êíAN€›(0,auth/* useSession */.wV)îñ’ // EXTERNAL MODULE: ../../node_modules/next/dist/api/app-dynamic.js var app_dynamic = __webpack_require__(6442); ;// ./src/components/Header.tsx  ˆI«webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSource«webpack/lib/util/registerExternalSerializer™webpack-sources/RawSource7/* __next_internal_client_entry_do_not_use__ Header auto */ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime"; import Link from 'next/link'; import { useRouter, usePathname } from 'next/navigation'; import { useSession, signOut } from '@/lib/auth'; import { useLocale } from '@/context/locale'; import { formatShortName } from '@/lib/formatName'; import { LanguageSwitcher } from './LanguageSwitcher'; import { useState, useRef, useEffect } from 'react'; import { getUnreadCount, getMyDashboard } from '@/lib/api'; import { io } from 'socket.io-client'; import { useEffectiveRole } from '@/hooks/useEffectiveRole'; import dynamic from 'next/dynamic'; const SupportModal = dynamic(()=>import('./SupportModal'), { loadableGenerated: { webpack: ()=>[ require.resolveWeak("./SupportModal") ] }, ssr: false }); const API_URL = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; export function Header() { var _session_user; const router = useRouter(); const pathname = usePathname(); const { data: session } = useSession(); const { t, locale } = useLocale(); const [menuOpen, setMenuOpen] = useState(false); const [profileOpen, setProfileOpen] = useState(false); const [supportOpen, setSupportOpen] = useState(false); const [unreadNotif, setUnreadNotif] = useState(0); const [unreadChat, setUnreadChat] = useState(0); const [msgToast, setMsgToast] = useState(null); const [planTier, setPlanTier] = useState(null); const profileRef = useRef(null); const headerRef = useRef(null); const toastTimer = useRef(null); const pathnameRef = useRef(pathname); useEffect(()=>{ pathnameRef.current = pathname; }, [ pathname ]); // Close dropdowns on outside click useEffect(()=>{ function handleClick(e) { if (profileRef.current && !profileRef.current.contains(e.target)) { setProfileOpen(false); } } document.addEventListener('mousedown', handleClick); return ()=>document.removeEventListener('mousedown', handleClick); }, []); const isAdmin = (session === null || session === void 0 ? void 0 : (_session_user = session.user) === null || _session_user === void 0 ? void 0 : _session_user.role) === 'admin'; const effectiveRole = useEffectiveRole(); const isSpecialist = effectiveRole === 'specialist'; const isActive = function(href) { let exact = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false; return exact ? pathname === href : pathname === href || pathname.startsWith(href + '/'); }; const navCls = function(href) { let exact = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false; return "font-medium text-sm transition ".concat(isActive(href, exact) ? 'text-green-600' : 'text-gray-600 hover:text-green-600'); }; const mobileNavCls = function(href) { let exact = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false; return "flex items-center gap-2 font-medium py-1 ".concat(isActive(href, exact) ? 'text-green-600' : 'text-gray-700'); }; // Reset chat badge when entering chat useEffect(()=>{ if (pathname === '/chat') setUnreadChat(0); }, [ pathname ]); useEffect(()=>{ if (!session) return; const socket = io(API_URL, { withCredentials: true, transports: [ 'websocket', 'polling' ] }); socket.on('new_message', (msg)=>{ if (pathnameRef.current === '/chat') return; setUnreadChat((c)=>c + 1); if (toastTimer.current) clearTimeout(toastTimer.current); setMsgToast(msg); toastTimer.current = setTimeout(()=>setMsgToast(null), 5000); }); return ()=>{ socket.disconnect(); if (toastTimer.current) clearTimeout(toastTimer.current); }; }, [ session ]); useEffect(()=>{ if (!session) { setUnreadNotif(0); return; } const fetch = ()=>getUnreadCount().then((r)=>setUnreadNotif(r.count)).catch(()=>{}); fetch(); const timer = setInterval(fetch, 30000); return ()=>clearInterval(timer); }, [ session ]); useEffect(()=>{ if (!session) { setPlanTier(null); return; } getMyDashboard().then((d)=>{ var _d_plan; var _d_plan_tier; return setPlanTier((_d_plan_tier = (_d_plan = d.plan) === null || _d_plan === void 0 ? void 0 : _d_plan.tier) !== null && _d_plan_tier !== void 0 ? _d_plan_tier : null); }).catch(()=>{}); }, [ session ]); useEffect(()=>{ const onScroll = ()=>{ if (!headerRef.current) return; if (window.scrollY > 40) { headerRef.current.classList.add('header-shrink'); } else { headerRef.current.classList.remove('header-shrink'); } }; window.addEventListener('scroll', onScroll); return ()=>window.removeEventListener('scroll', onScroll); }, []); return /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx("header", { ref: headerRef, className: "header-base bg-white border-b border-gray-200 sticky top-0 z-50 transition-all duration-300", children: /*#__PURE__*/ _jsxs("div", { className: "max-w-7xl mx-auto px-4 sm:px-6 lg:px-8", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between h-16 header-content transition-all duration-300", children: [ /*#__PURE__*/ _jsxs(Link, { href: "/", className: "flex items-center gap-2 shrink-0", children: [ /*#__PURE__*/ _jsx("img", { src: "/logo.png", alt: "CanHelp", className: "w-8 h-8 object-contain" }), /*#__PURE__*/ _jsx("span", { className: "logo-text text-2xl font-bold text-green-600 transition-all duration-300", children: "CanHelp" }) ] }), /*#__PURE__*/ _jsxs("nav", { className: "hidden md:flex items-center gap-5 ml-auto", children: [ isSpecialist ? /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx(Link, { href: "/tasks", className: navCls('/tasks'), children: t('nav.find_tasks') }), /*#__PURE__*/ _jsx(Link, { href: "/dashboard", className: navCls('/dashboard'), children: t('nav.dashboard') }) ] }) : /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx(Link, { href: "/tasks/new", className: navCls('/tasks/new', true), children: t('dashboard.new_task') }), " ", /*#__PURE__*/ _jsx(Link, { href: "/tasks", className: navCls('/tasks'), children: t('nav.tasks') }), " ", /*#__PURE__*/ _jsx(Link, { href: "/specialists", className: navCls('/specialists'), children: t('nav.specialists') }) ] }), /*#__PURE__*/ _jsx(Link, { href: "/pricing", className: navCls('/pricing', true), children: t('nav.pricing', 'Pricing') }), session ? /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs(Link, { href: "/notifications", className: "relative text-gray-600 hover:text-gray-900 flex items-center", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5 ".concat(unreadNotif > 0 ? 'text-green-600' : ''), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M14.857 17.082a23.848 23.848 0 005.454-1.31A8.967 8.967 0 0118 9.75v-.7V9A6 6 0 006 9v.75a8.967 8.967 0 01-2.312 6.022c1.733.64 3.56 1.085 5.455 1.31m5.714 0a24.255 24.255 0 01-5.714 0m5.714 0a3 3 0 11-5.714 0" }) }), unreadNotif > 0 && /*#__PURE__*/ _jsx("span", { className: "absolute -top-1.5 -right-1.5 min-w-[16px] h-4 px-0.5 bg-red-500 text-white text-[10px] font-bold rounded-full flex items-center justify-center leading-none", children: unreadNotif > 99 ? '99+' : unreadNotif }) ] }), /*#__PURE__*/ _jsxs(Link, { href: "/chat", className: "relative text-gray-600 hover:text-gray-900 flex items-center", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5 ".concat(unreadChat > 0 ? 'text-green-500' : ''), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }), unreadChat > 0 && /*#__PURE__*/ _jsx("span", { className: "absolute -top-1.5 -right-1.5 min-w-[16px] h-4 px-0.5 bg-green-500 text-white text-[10px] font-bold rounded-full flex items-center justify-center leading-none", children: unreadChat > 99 ? '99+' : unreadChat }) ] }), /*#__PURE__*/ _jsxs("div", { className: "relative", ref: profileRef, children: [ /*#__PURE__*/ _jsxs("button", { onClick: ()=>setProfileOpen(!profileOpen), className: "flex items-center gap-1.5 text-sm font-medium text-gray-600 hover:text-green-600", children: [ /*#__PURE__*/ _jsx("span", { className: "truncate max-w-[100px]", children: formatShortName(session.user.firstName, session.user.lastName, session.user.name) }), planTier === 'pro' && /*#__PURE__*/ _jsx("span", { className: "inline-flex items-center px-1.5 py-0.5 rounded-full text-[10px] font-bold bg-green-100 text-green-700 leading-none", children: "Pro" }), planTier === 'ultimate' && /*#__PURE__*/ _jsx("span", { className: "inline-flex items-center px-1.5 py-0.5 rounded-full text-[10px] font-bold bg-gradient-to-r from-amber-400 via-yellow-400 to-amber-400 text-gray-900 shadow-sm shadow-amber-300/50 leading-none", children: "★" }), /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19 9l-7 7-7-7" }) }) ] }), profileOpen && /*#__PURE__*/ _jsxs("div", { className: "absolute right-0 mt-2 w-52 bg-white border border-gray-200 rounded-xl shadow-lg py-1 z-50", children: [ isSpecialist ? /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs(Link, { href: "/tasks/new", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 4v16m8-8H4" }) }), t('nav.new_task') ] }), /*#__PURE__*/ _jsxs(Link, { href: "/specialists", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _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" }) }), t('nav.specialists') ] }) ] }) : /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs(Link, { href: "/notifications", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0 ".concat(unreadNotif > 0 ? 'text-green-600' : 'text-gray-400'), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M14.857 17.082a23.848 23.848 0 005.454-1.31A8.967 8.967 0 0118 9.75v-.7V9A6 6 0 006 9v.75a8.967 8.967 0 01-2.312 6.022c1.733.64 3.56 1.085 5.455 1.31m5.714 0a24.255 24.255 0 01-5.714 0m5.714 0a3 3 0 11-5.714 0" }) }), /*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-1.5", children: [ t('nav.notifications'), unreadNotif > 0 && /*#__PURE__*/ _jsx("span", { className: "px-1.5 py-0.5 bg-red-500 text-white text-[10px] font-bold rounded-full leading-none", children: unreadNotif > 99 ? '99+' : unreadNotif }) ] }) ] }), /*#__PURE__*/ _jsxs(Link, { href: "/chat", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0 ".concat(unreadChat > 0 ? 'text-green-500' : 'text-gray-400'), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }), /*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-1.5", children: [ t('nav.chat'), unreadChat > 0 && /*#__PURE__*/ _jsx("span", { className: "px-1.5 py-0.5 bg-green-500 text-white text-[10px] font-bold rounded-full leading-none", children: unreadChat > 99 ? '99+' : unreadChat }) ] }) ] }), /*#__PURE__*/ _jsxs(Link, { href: "/dashboard", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6" }) }), t('nav.dashboard') ] }) ] }), (isSpecialist || isAdmin) && /*#__PURE__*/ _jsxs(Link, { href: "/schedule", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _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" }) }), t('nav.schedule') ] }), isAdmin && /*#__PURE__*/ _jsxs(Link, { href: "/admin", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ _jsxs("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: [ /*#__PURE__*/ _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" }), /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 12a3 3 0 11-6 0 3 3 0 016 0z" }) ] }), t('nav.admin') ] }), /*#__PURE__*/ _jsxs(Link, { href: "/profile", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _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" }) }), t('nav.profile') ] }), /*#__PURE__*/ _jsxs(Link, { href: "/favorites", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4.318 6.318a4.5 4.5 0 000 6.364L12 20.364l7.682-7.682a4.5 4.5 0 00-6.364-6.364L12 7.636l-1.318-1.318a4.5 4.5 0 00-6.364 0z" }) }), t('nav.favorites') ] }), /*#__PURE__*/ _jsx("hr", { className: "my-1 border-gray-100" }), /*#__PURE__*/ _jsxs("button", { className: "w-full flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-green-50", onClick: ()=>{ setProfileOpen(false); setSupportOpen(true); }, children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _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" }) }), t('support.title') ] }), /*#__PURE__*/ _jsx("hr", { className: "my-1 border-gray-100" }), /*#__PURE__*/ _jsxs("button", { className: "w-full flex items-center gap-2.5 px-4 py-2 text-sm text-red-500 hover:bg-red-50", onClick: ()=>{ setProfileOpen(false); signOut().then(()=>{ window.location.href = '/'; }); }, children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M17 16l4-4m0 0l-4-4m4 4H7m6 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h4a3 3 0 013 3v1" }) }), t('nav.logout') ] }) ] }) ] }) ] }) : /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx(Link, { href: "/login", className: "text-gray-600 hover:text-green-600 font-medium text-sm", children: t('nav.login') }), /*#__PURE__*/ _jsx(Link, { href: "/register", className: "bg-green-600 text-white px-4 py-2 rounded-lg hover:bg-green-700 font-medium text-sm", children: t('nav.register') }) ] }), /*#__PURE__*/ _jsx(LanguageSwitcher, {}) ] }), /*#__PURE__*/ _jsxs("div", { className: "md:hidden flex items-center gap-2", children: [ /*#__PURE__*/ _jsx(LanguageSwitcher, {}), /*#__PURE__*/ _jsx("button", { className: "p-2", onClick: ()=>setMenuOpen(!menuOpen), "aria-label": "Toggle menu", children: /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5 text-gray-600", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: menuOpen ? /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" }) : /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4 6h16M4 12h16M4 18h16" }) }) }) ] }) ] }), menuOpen && /*#__PURE__*/ _jsxs("div", { className: "md:hidden py-4 border-t border-gray-100 flex flex-col gap-3", children: [ isSpecialist ? /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs(Link, { href: "/tasks", className: mobileNavCls('/tasks'), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z" }) }), t('nav.find_tasks') ] }), /*#__PURE__*/ _jsxs(Link, { href: "/dashboard", className: mobileNavCls('/dashboard'), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6" }) }), t('nav.dashboard') ] }) ] }) : /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs(Link, { href: "/tasks/new", className: mobileNavCls('/tasks/new', true), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 4v16m8-8H4" }) }), t('nav.new_task') ] }), /*#__PURE__*/ _jsxs(Link, { href: "/tasks", className: mobileNavCls('/tasks'), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _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" }) }), t('nav.tasks') ] }), /*#__PURE__*/ _jsxs(Link, { href: "/specialists", className: mobileNavCls('/specialists'), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _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" }) }), t('nav.specialists') ] }) ] }), session ? /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs(Link, { href: "/chat", className: mobileNavCls('/chat', true), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0 ".concat(unreadChat > 0 ? 'text-green-500' : ''), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }), t('nav.chat'), unreadChat > 0 && /*#__PURE__*/ _jsx("span", { className: "ml-1 px-1.5 py-0.5 bg-green-500 text-white text-[10px] font-bold rounded-full", children: unreadChat }) ] }), isSpecialist ? /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs(Link, { href: "/tasks/new", className: mobileNavCls('/tasks/new', true), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 4v16m8-8H4" }) }), t('nav.new_task') ] }), /*#__PURE__*/ _jsxs(Link, { href: "/specialists", className: mobileNavCls('/specialists'), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _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" }) }), t('nav.specialists') ] }) ] }) : /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs(Link, { href: "/notifications", className: mobileNavCls('/notifications', true), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0 ".concat(unreadNotif > 0 ? 'text-green-600' : ''), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M14.857 17.082a23.848 23.848 0 005.454-1.31A8.967 8.967 0 0118 9.75v-.7V9A6 6 0 006 9v.75a8.967 8.967 0 01-2.312 6.022c1.733.64 3.56 1.085 5.455 1.31m5.714 0a24.255 24.255 0 01-5.714 0m5.714 0a3 3 0 11-5.714 0" }) }), /*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-1.5", children: [ t('nav.notifications'), unreadNotif > 0 && /*#__PURE__*/ _jsx("span", { className: "px-1.5 py-0.5 bg-red-500 text-white text-[10px] font-bold rounded-full", children: unreadNotif > 99 ? '99+' : unreadNotif }) ] }) ] }), /*#__PURE__*/ _jsxs(Link, { href: "/dashboard", className: mobileNavCls('/dashboard'), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6" }) }), t('nav.dashboard') ] }) ] }), /*#__PURE__*/ _jsxs(Link, { href: "/favorites", className: mobileNavCls('/favorites', true), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4.318 6.318a4.5 4.5 0 000 6.364L12 20.364l7.682-7.682a4.5 4.5 0 00-6.364-6.364L12 7.636l-1.318-1.318a4.5 4.5 0 00-6.364 0z" }) }), t('nav.favorites') ] }), (isSpecialist || isAdmin) && /*#__PURE__*/ _jsxs(Link, { href: "/schedule", className: mobileNavCls('/schedule', true), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-gray-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _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" }) }), t('nav.schedule') ] }), isAdmin && /*#__PURE__*/ _jsxs(Link, { href: "/admin", className: mobileNavCls('/admin'), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ _jsxs("svg", { className: "w-4 h-4 text-gray-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: [ /*#__PURE__*/ _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" }), /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 12a3 3 0 11-6 0 3 3 0 016 0z" }) ] }), t('nav.admin') ] }), /*#__PURE__*/ _jsxs(Link, { href: "/profile", className: mobileNavCls('/profile', true), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-gray-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _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" }) }), t('nav.profile') ] }), /*#__PURE__*/ _jsxs("button", { onClick: ()=>{ setMenuOpen(false); signOut().then(()=>{ window.location.href = '/'; }); }, className: "flex items-center gap-2 text-left text-red-500 py-1 font-medium", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M17 16l4-4m0 0l-4-4m4 4H7m6 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h4a3 3 0 013 3v1" }) }), t('nav.logout') ] }) ] }) : /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx(Link, { href: "/login", className: "text-gray-700 font-medium py-1", onClick: ()=>setMenuOpen(false), children: t('nav.login') }), /*#__PURE__*/ _jsx(Link, { href: "/register", className: "text-green-600 font-medium py-1", onClick: ()=>setMenuOpen(false), children: t('nav.register') }) ] }) ] }) ] }) }), msgToast && /*#__PURE__*/ _jsx("div", { className: "fixed bottom-5 right-5 z-[200] max-w-sm w-full", children: /*#__PURE__*/ _jsxs("div", { className: "bg-white border border-gray-200 rounded-xl shadow-xl p-4 flex items-start gap-3 animate-fade-in", children: [ /*#__PURE__*/ _jsx("span", { className: "text-2xl shrink-0", children: "\uD83D\uDCAC" }), /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ _jsx("p", { className: "font-semibold text-gray-900 text-sm", children: t('chat.toast_title') }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-500 truncate mt-0.5", children: msgToast.body }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex flex-col items-end gap-2 shrink-0", children: [ /*#__PURE__*/ _jsx("button", { onClick: ()=>setMsgToast(null), className: "text-gray-400 hover:text-gray-600 text-lg leading-none", "aria-label": "close", children: "\xd7" }), /*#__PURE__*/ _jsx(Link, { href: "/chat?room=".concat(msgToast.roomId), onClick: ()=>setMsgToast(null), className: "text-xs text-green-600 hover:underline font-medium", children: t('chat.toast_open') }) ] }) ] }) }), supportOpen && /*#__PURE__*/ _jsx(SupportModal, { onClose: ()=>setSupportOpen(false) }) ] }); } @ý`<_‘“¯±éëIK}޶éë%'LN‰‹­ÄÊÐç,>@OŠ_š­ÃÆÌ -7Zc‚гºîõ)0dk™ ÊÑþ%*INn_s”™ª²08V e Ù á C K ˆ ‰ “ fnÓà$ðôöþ14_¢Šƒ‡‰Œy|³¶'+  “•˜öùûþ‘“›   _ Ò!Õ!×!Ú!w#z#|##;%>%@%C%•&™&›&£&'"'$'''}(€( *£*K-N-/”/–/™/æ0_é03 3~55Ã7Ç7è8ì8’:•:X;f;R<U<'>*>+@.@TBWBÙDÝD1F5F7F?FêFîFðFóF#I_&IŒK¿KOOOOPQSQéSìSBXFXHXPXûXÿXYY8[;[^^)a-aþbcLfPfRfUf€h_ƒhHkKkΩέίβÎÐ_ÐÞÑáÑÔÔÔ ÔsÕvÕ>×A×åÙéÙëÙîÙMÛPÛÝÝZà^à`àhàÓà×àÙàÜà3â6â.ä1䳿_¶æmèqèsè{èöèúèüèÿèˆê‹êƒì†ìïï ï ï”ð—ðò’òøõüõþõöö…ö‡öŠöøøGú_JúßüãüTþWþÕÙÛÞad\_±µ·º  æ é ª ® ° ³ âånrt_wÊÎÕØ47ÂÆÈË(+øûe"i"&#,#Þ$á$ &£&D)H)J)R)œ)À)Â)Å)S+XV+X+[+š--.!.ô.÷.¶/º/T0W0L1O1o2s2%3(3¥4š4ª4­4­6°6€€€€€€€€€€€€Ô__WEBPACK_MODULE_REFERENCE__12_5b2264656661756c74225d_call_directImport_asiSafe1__._ä__webpack_require__.e(/* import() */ 6467).then(__webpack_require__.bind(__webpack_require__, 6467))“/*require.resolve*/„6467˜"https://api.canhelp.gr"0€×__WEBPACK_MODULE_REFERENCE__2_5b22757365526f75746572225d_call_directImport_asiSafe1__._Û__WEBPACK_MODULE_REFERENCE__2_5b22757365506174686e616d65225d_call_directImport_asiSafe1__._Ù__WEBPACK_MODULE_REFERENCE__3_5b2275736553657373696f6e225d_call_directImport_asiSafe1__._×__WEBPACK_MODULE_REFERENCE__4_5b227573654c6f63616c65225d_call_directImport_asiSafe1__._Õ__WEBPACK_MODULE_REFERENCE__6_5b227573655374617465225d_call_directImport_asiSafe1__._ÿÿÿÿÿÿÑ__WEBPACK_MODULE_REFERENCE__6_5b22757365526566225d_call_directImport_asiSafe1__._ÿÿÿ×__WEBPACK_MODULE_REFERENCE__6_5b22757365456666656374225d_call_directImport_asiSafe1__._ÿæ__WEBPACK_MODULE_REFERENCE__11_5b22757365456666656374697665526f6c65225d_call_directImport_asiSafe1__._þþÊ__WEBPACK_MODULE_REFERENCE__10_5b22696f225d_call_directImport_asiSafe1__._ýá__WEBPACK_MODULE_REFERENCE__9_5b22676574556e72656164436f756e74225d_call_directImport_asiSafe1__._üá__WEBPACK_MODULE_REFERENCE__9_5b226765744d7944617368626f617264225d_call_directImport_asiSafe1__._ûÍ__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._Ð__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._Ë__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._ýýýÎ__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._þþüüýþÿþÿüýþÿþÿþÿþÿüýüÿþþþüÿþþþüüþã__WEBPACK_MODULE_REFERENCE__5_5b22666f726d617453686f72744e616d65225d_call_directImport_asiSafe1__._ýýýýûûüûþýýûþýýûüûþýýûýûþýýûýûþýýûþýýûþûýýûþýýûþýýýûýýýûÓ__WEBPACK_MODULE_REFERENCE__3_5b227369676e4f7574225d_call_directImport_asiSafe1__._üüúûüýüýüà__WEBPACK_MODULE_REFERENCE__8_5b224c616e67756167655377697463686572225d_directImport_asiSafe1__._ùûÿûûûûùùúùüûûùüûûùúùüûûùüûûùüûûùúùüûûûùúùüûûùüûûùúùüûûùûùüûûùüûûùüûûùüùûûùüûûùþûûùúûüûüûùûùûûùûûüû܆w/* __next_internal_client_entry_do_not_use__ Header auto */ const SupportModal = __WEBPACK_MODULE_REFERENCE__12_5b2264656661756c74225d_call_directImport_asiSafe1__._(()=>__webpack_require__.e(/* import() */ 6467).then(__webpack_require__.bind(__webpack_require__, 6467)), { loadableGenerated: { webpack: ()=>[ /*require.resolve*/(6467) ] }, ssr: false }); const API_URL = "https://api.canhelp.gr" || 0; function Header() { var _session_user; const router = __WEBPACK_MODULE_REFERENCE__2_5b22757365526f75746572225d_call_directImport_asiSafe1__._(); const pathname = __WEBPACK_MODULE_REFERENCE__2_5b22757365506174686e616d65225d_call_directImport_asiSafe1__._(); const { data: session } = __WEBPACK_MODULE_REFERENCE__3_5b2275736553657373696f6e225d_call_directImport_asiSafe1__._(); const { t, locale } = __WEBPACK_MODULE_REFERENCE__4_5b227573654c6f63616c65225d_call_directImport_asiSafe1__._(); const [menuOpen, setMenuOpen] = __WEBPACK_MODULE_REFERENCE__6_5b227573655374617465225d_call_directImport_asiSafe1__._(false); const [profileOpen, setProfileOpen] = __WEBPACK_MODULE_REFERENCE__6_5b227573655374617465225d_call_directImport_asiSafe1__._(false); const [supportOpen, setSupportOpen] = __WEBPACK_MODULE_REFERENCE__6_5b227573655374617465225d_call_directImport_asiSafe1__._(false); const [unreadNotif, setUnreadNotif] = __WEBPACK_MODULE_REFERENCE__6_5b227573655374617465225d_call_directImport_asiSafe1__._(0); const [unreadChat, setUnreadChat] = __WEBPACK_MODULE_REFERENCE__6_5b227573655374617465225d_call_directImport_asiSafe1__._(0); const [msgToast, setMsgToast] = __WEBPACK_MODULE_REFERENCE__6_5b227573655374617465225d_call_directImport_asiSafe1__._(null); const [planTier, setPlanTier] = __WEBPACK_MODULE_REFERENCE__6_5b227573655374617465225d_call_directImport_asiSafe1__._(null); const profileRef = __WEBPACK_MODULE_REFERENCE__6_5b22757365526566225d_call_directImport_asiSafe1__._(null); const headerRef = __WEBPACK_MODULE_REFERENCE__6_5b22757365526566225d_call_directImport_asiSafe1__._(null); const toastTimer = __WEBPACK_MODULE_REFERENCE__6_5b22757365526566225d_call_directImport_asiSafe1__._(null); const pathnameRef = __WEBPACK_MODULE_REFERENCE__6_5b22757365526566225d_call_directImport_asiSafe1__._(pathname); __WEBPACK_MODULE_REFERENCE__6_5b22757365456666656374225d_call_directImport_asiSafe1__._(()=>{ pathnameRef.current = pathname; }, [ pathname ]); // Close dropdowns on outside click __WEBPACK_MODULE_REFERENCE__6_5b22757365456666656374225d_call_directImport_asiSafe1__._(()=>{ function handleClick(e) { if (profileRef.current && !profileRef.current.contains(e.target)) { setProfileOpen(false); } } document.addEventListener('mousedown', handleClick); return ()=>document.removeEventListener('mousedown', handleClick); }, []); const isAdmin = (session === null || session === void 0 ? void 0 : (_session_user = session.user) === null || _session_user === void 0 ? void 0 : _session_user.role) === 'admin'; const effectiveRole = __WEBPACK_MODULE_REFERENCE__11_5b22757365456666656374697665526f6c65225d_call_directImport_asiSafe1__._(); const isSpecialist = effectiveRole === 'specialist'; const isActive = function(href) { let exact = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false; return exact ? pathname === href : pathname === href || pathname.startsWith(href + '/'); }; const navCls = function(href) { let exact = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false; return "font-medium text-sm transition ".concat(isActive(href, exact) ? 'text-green-600' : 'text-gray-600 hover:text-green-600'); }; const mobileNavCls = function(href) { let exact = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false; return "flex items-center gap-2 font-medium py-1 ".concat(isActive(href, exact) ? 'text-green-600' : 'text-gray-700'); }; // Reset chat badge when entering chat __WEBPACK_MODULE_REFERENCE__6_5b22757365456666656374225d_call_directImport_asiSafe1__._(()=>{ if (pathname === '/chat') setUnreadChat(0); }, [ pathname ]); __WEBPACK_MODULE_REFERENCE__6_5b22757365456666656374225d_call_directImport_asiSafe1__._(()=>{ if (!session) return; const socket = __WEBPACK_MODULE_REFERENCE__10_5b22696f225d_call_directImport_asiSafe1__._(API_URL, { withCredentials: true, transports: [ 'websocket', 'polling' ] }); socket.on('new_message', (msg)=>{ if (pathnameRef.current === '/chat') return; setUnreadChat((c)=>c + 1); if (toastTimer.current) clearTimeout(toastTimer.current); setMsgToast(msg); toastTimer.current = setTimeout(()=>setMsgToast(null), 5000); }); return ()=>{ socket.disconnect(); if (toastTimer.current) clearTimeout(toastTimer.current); }; }, [ session ]); __WEBPACK_MODULE_REFERENCE__6_5b22757365456666656374225d_call_directImport_asiSafe1__._(()=>{ if (!session) { setUnreadNotif(0); return; } const fetch = ()=>__WEBPACK_MODULE_REFERENCE__9_5b22676574556e72656164436f756e74225d_call_directImport_asiSafe1__._().then((r)=>setUnreadNotif(r.count)).catch(()=>{}); fetch(); const timer = setInterval(fetch, 30000); return ()=>clearInterval(timer); }, [ session ]); __WEBPACK_MODULE_REFERENCE__6_5b22757365456666656374225d_call_directImport_asiSafe1__._(()=>{ if (!session) { setPlanTier(null); return; } __WEBPACK_MODULE_REFERENCE__9_5b226765744d7944617368626f617264225d_call_directImport_asiSafe1__._().then((d)=>{ var _d_plan; var _d_plan_tier; return setPlanTier((_d_plan_tier = (_d_plan = d.plan) === null || _d_plan === void 0 ? void 0 : _d_plan.tier) !== null && _d_plan_tier !== void 0 ? _d_plan_tier : null); }).catch(()=>{}); }, [ session ]); __WEBPACK_MODULE_REFERENCE__6_5b22757365456666656374225d_call_directImport_asiSafe1__._(()=>{ const onScroll = ()=>{ if (!headerRef.current) return; if (window.scrollY > 40) { headerRef.current.classList.add('header-shrink'); } else { headerRef.current.classList.remove('header-shrink'); } }; window.addEventListener('scroll', onScroll); return ()=>window.removeEventListener('scroll', onScroll); }, []); return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._, { children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("header", { ref: headerRef, className: "header-base bg-white border-b border-gray-200 sticky top-0 z-50 transition-all duration-300", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "max-w-7xl mx-auto px-4 sm:px-6 lg:px-8", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "flex items-center justify-between h-16 header-content transition-all duration-300", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._, { href: "/", className: "flex items-center gap-2 shrink-0", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("img", { src: "/logo.png", alt: "CanHelp", className: "w-8 h-8 object-contain" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { className: "logo-text text-2xl font-bold text-green-600 transition-all duration-300", children: "CanHelp" }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("nav", { className: "hidden md:flex items-center gap-5 ml-auto", children: [ isSpecialist ? /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._, { children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._, { href: "/tasks", className: navCls('/tasks'), children: t('nav.find_tasks') }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._, { href: "/dashboard", className: navCls('/dashboard'), children: t('nav.dashboard') }) ] }) : /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._, { children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._, { href: "/tasks/new", className: navCls('/tasks/new', true), children: t('dashboard.new_task') }), " ", /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._, { href: "/tasks", className: navCls('/tasks'), children: t('nav.tasks') }), " ", /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._, { href: "/specialists", className: navCls('/specialists'), children: t('nav.specialists') }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._, { href: "/pricing", className: navCls('/pricing', true), children: t('nav.pricing', 'Pricing') }), session ? /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._, { children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._, { href: "/notifications", className: "relative text-gray-600 hover:text-gray-900 flex items-center", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("svg", { className: "w-5 h-5 ".concat(unreadNotif > 0 ? 'text-green-600' : ''), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M14.857 17.082a23.848 23.848 0 005.454-1.31A8.967 8.967 0 0118 9.75v-.7V9A6 6 0 006 9v.75a8.967 8.967 0 01-2.312 6.022c1.733.64 3.56 1.085 5.455 1.31m5.714 0a24.255 24.255 0 01-5.714 0m5.714 0a3 3 0 11-5.714 0" }) }), unreadNotif > 0 && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { className: "absolute -top-1.5 -right-1.5 min-w-[16px] h-4 px-0.5 bg-red-500 text-white text-[10px] font-bold rounded-full flex items-center justify-center leading-none", children: unreadNotif > 99 ? '99+' : unreadNotif }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._, { href: "/chat", className: "relative text-gray-600 hover:text-gray-900 flex items-center", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("svg", { className: "w-5 h-5 ".concat(unreadChat > 0 ? 'text-green-500' : ''), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }), unreadChat > 0 && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { className: "absolute -top-1.5 -right-1.5 min-w-[16px] h-4 px-0.5 bg-green-500 text-white text-[10px] font-bold rounded-full flex items-center justify-center leading-none", children: unreadChat > 99 ? '99+' : unreadChat }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "relative", ref: profileRef, children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("button", { onClick: ()=>setProfileOpen(!profileOpen), className: "flex items-center gap-1.5 text-sm font-medium text-gray-600 hover:text-green-600", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { className: "truncate max-w-[100px]", children: __WEBPACK_MODULE_REFERENCE__5_5b22666f726d617453686f72744e616d65225d_call_directImport_asiSafe1__._(session.user.firstName, session.user.lastName, session.user.name) }), planTier === 'pro' && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { className: "inline-flex items-center px-1.5 py-0.5 rounded-full text-[10px] font-bold bg-green-100 text-green-700 leading-none", children: "Pro" }), planTier === 'ultimate' && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { className: "inline-flex items-center px-1.5 py-0.5 rounded-full text-[10px] font-bold bg-gradient-to-r from-amber-400 via-yellow-400 to-amber-400 text-gray-900 shadow-sm shadow-amber-300/50 leading-none", children: "★" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19 9l-7 7-7-7" }) }) ] }), profileOpen && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "absolute right-0 mt-2 w-52 bg-white border border-gray-200 rounded-xl shadow-lg py-1 z-50", children: [ isSpecialist ? /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._, { children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._, { href: "/tasks/new", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 4v16m8-8H4" }) }), t('nav.new_task') ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._, { href: "/specialists", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("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" }) }), t('nav.specialists') ] }) ] }) : /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._, { children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._, { href: "/notifications", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("svg", { className: "w-4 h-4 shrink-0 ".concat(unreadNotif > 0 ? 'text-green-600' : 'text-gray-400'), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M14.857 17.082a23.848 23.848 0 005.454-1.31A8.967 8.967 0 0118 9.75v-.7V9A6 6 0 006 9v.75a8.967 8.967 0 01-2.312 6.022c1.733.64 3.56 1.085 5.455 1.31m5.714 0a24.255 24.255 0 01-5.714 0m5.714 0a3 3 0 11-5.714 0" }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("span", { className: "flex items-center gap-1.5", children: [ t('nav.notifications'), unreadNotif > 0 && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { className: "px-1.5 py-0.5 bg-red-500 text-white text-[10px] font-bold rounded-full leading-none", children: unreadNotif > 99 ? '99+' : unreadNotif }) ] }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._, { href: "/chat", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("svg", { className: "w-4 h-4 shrink-0 ".concat(unreadChat > 0 ? 'text-green-500' : 'text-gray-400'), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("span", { className: "flex items-center gap-1.5", children: [ t('nav.chat'), unreadChat > 0 && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { className: "px-1.5 py-0.5 bg-green-500 text-white text-[10px] font-bold rounded-full leading-none", children: unreadChat > 99 ? '99+' : unreadChat }) ] }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._, { href: "/dashboard", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6" }) }), t('nav.dashboard') ] }) ] }), (isSpecialist || isAdmin) && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._, { href: "/schedule", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("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" }) }), t('nav.schedule') ] }), isAdmin && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._, { href: "/admin", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("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" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 12a3 3 0 11-6 0 3 3 0 016 0z" }) ] }), t('nav.admin') ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._, { href: "/profile", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("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" }) }), t('nav.profile') ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._, { href: "/favorites", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4.318 6.318a4.5 4.5 0 000 6.364L12 20.364l7.682-7.682a4.5 4.5 0 00-6.364-6.364L12 7.636l-1.318-1.318a4.5 4.5 0 00-6.364 0z" }) }), t('nav.favorites') ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("hr", { className: "my-1 border-gray-100" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("button", { className: "w-full flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-green-50", onClick: ()=>{ setProfileOpen(false); setSupportOpen(true); }, children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("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" }) }), t('support.title') ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("hr", { className: "my-1 border-gray-100" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("button", { className: "w-full flex items-center gap-2.5 px-4 py-2 text-sm text-red-500 hover:bg-red-50", onClick: ()=>{ setProfileOpen(false); __WEBPACK_MODULE_REFERENCE__3_5b227369676e4f7574225d_call_directImport_asiSafe1__._().then(()=>{ window.location.href = '/'; }); }, children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M17 16l4-4m0 0l-4-4m4 4H7m6 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h4a3 3 0 013 3v1" }) }), t('nav.logout') ] }) ] }) ] }) ] }) : /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._, { children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._, { href: "/login", className: "text-gray-600 hover:text-green-600 font-medium text-sm", children: t('nav.login') }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._, { href: "/register", className: "bg-green-600 text-white px-4 py-2 rounded-lg hover:bg-green-700 font-medium text-sm", children: t('nav.register') }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__8_5b224c616e67756167655377697463686572225d_directImport_asiSafe1__._, {}) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "md:hidden flex items-center gap-2", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__8_5b224c616e67756167655377697463686572225d_directImport_asiSafe1__._, {}), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("button", { className: "p-2", onClick: ()=>setMenuOpen(!menuOpen), "aria-label": "Toggle menu", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("svg", { className: "w-5 h-5 text-gray-600", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: menuOpen ? /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" }) : /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4 6h16M4 12h16M4 18h16" }) }) }) ] }) ] }), menuOpen && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "md:hidden py-4 border-t border-gray-100 flex flex-col gap-3", children: [ isSpecialist ? /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._, { children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._, { href: "/tasks", className: mobileNavCls('/tasks'), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z" }) }), t('nav.find_tasks') ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._, { href: "/dashboard", className: mobileNavCls('/dashboard'), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6" }) }), t('nav.dashboard') ] }) ] }) : /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._, { children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._, { href: "/tasks/new", className: mobileNavCls('/tasks/new', true), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 4v16m8-8H4" }) }), t('nav.new_task') ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._, { href: "/tasks", className: mobileNavCls('/tasks'), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("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" }) }), t('nav.tasks') ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._, { href: "/specialists", className: mobileNavCls('/specialists'), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("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" }) }), t('nav.specialists') ] }) ] }), session ? /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._, { children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._, { href: "/chat", className: mobileNavCls('/chat', true), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("svg", { className: "w-4 h-4 shrink-0 ".concat(unreadChat > 0 ? 'text-green-500' : ''), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }), t('nav.chat'), unreadChat > 0 && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { className: "ml-1 px-1.5 py-0.5 bg-green-500 text-white text-[10px] font-bold rounded-full", children: unreadChat }) ] }), isSpecialist ? /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._, { children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._, { href: "/tasks/new", className: mobileNavCls('/tasks/new', true), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 4v16m8-8H4" }) }), t('nav.new_task') ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._, { href: "/specialists", className: mobileNavCls('/specialists'), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("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" }) }), t('nav.specialists') ] }) ] }) : /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._, { children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._, { href: "/notifications", className: mobileNavCls('/notifications', true), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("svg", { className: "w-4 h-4 shrink-0 ".concat(unreadNotif > 0 ? 'text-green-600' : ''), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M14.857 17.082a23.848 23.848 0 005.454-1.31A8.967 8.967 0 0118 9.75v-.7V9A6 6 0 006 9v.75a8.967 8.967 0 01-2.312 6.022c1.733.64 3.56 1.085 5.455 1.31m5.714 0a24.255 24.255 0 01-5.714 0m5.714 0a3 3 0 11-5.714 0" }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("span", { className: "flex items-center gap-1.5", children: [ t('nav.notifications'), unreadNotif > 0 && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { className: "px-1.5 py-0.5 bg-red-500 text-white text-[10px] font-bold rounded-full", children: unreadNotif > 99 ? '99+' : unreadNotif }) ] }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._, { href: "/dashboard", className: mobileNavCls('/dashboard'), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6" }) }), t('nav.dashboard') ] }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._, { href: "/favorites", className: mobileNavCls('/favorites', true), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4.318 6.318a4.5 4.5 0 000 6.364L12 20.364l7.682-7.682a4.5 4.5 0 00-6.364-6.364L12 7.636l-1.318-1.318a4.5 4.5 0 00-6.364 0z" }) }), t('nav.favorites') ] }), (isSpecialist || isAdmin) && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._, { href: "/schedule", className: mobileNavCls('/schedule', true), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("svg", { className: "w-4 h-4 text-gray-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("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" }) }), t('nav.schedule') ] }), isAdmin && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._, { href: "/admin", className: mobileNavCls('/admin'), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("svg", { className: "w-4 h-4 text-gray-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("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" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 12a3 3 0 11-6 0 3 3 0 016 0z" }) ] }), t('nav.admin') ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._, { href: "/profile", className: mobileNavCls('/profile', true), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("svg", { className: "w-4 h-4 text-gray-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("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" }) }), t('nav.profile') ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("button", { onClick: ()=>{ setMenuOpen(false); __WEBPACK_MODULE_REFERENCE__3_5b227369676e4f7574225d_call_directImport_asiSafe1__._().then(()=>{ window.location.href = '/'; }); }, className: "flex items-center gap-2 text-left text-red-500 py-1 font-medium", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M17 16l4-4m0 0l-4-4m4 4H7m6 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h4a3 3 0 013 3v1" }) }), t('nav.logout') ] }) ] }) : /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._, { children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._, { href: "/login", className: "text-gray-700 font-medium py-1", onClick: ()=>setMenuOpen(false), children: t('nav.login') }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._, { href: "/register", className: "text-green-600 font-medium py-1", onClick: ()=>setMenuOpen(false), children: t('nav.register') }) ] }) ] }) ] }) }), msgToast && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "fixed bottom-5 right-5 z-[200] max-w-sm w-full", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "bg-white border border-gray-200 rounded-xl shadow-xl p-4 flex items-start gap-3 animate-fade-in", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { className: "text-2xl shrink-0", children: "\uD83D\uDCAC" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { className: "font-semibold text-gray-900 text-sm", children: t('chat.toast_title') }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { className: "text-xs text-gray-500 truncate mt-0.5", children: msgToast.body }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "flex flex-col items-end gap-2 shrink-0", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("button", { onClick: ()=>setMsgToast(null), className: "text-gray-400 hover:text-gray-600 text-lg leading-none", "aria-label": "close", children: "\xd7" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._, { href: "/chat?room=".concat(msgToast.roomId), onClick: ()=>setMsgToast(null), className: "text-xs text-green-600 hover:underline font-medium", children: t('chat.toast_open') }) ] }) ] }) }), supportOpen && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(SupportModal, { onClose: ()=>setSupportOpen(false) }) ] }); } Ýà á7/* __next_internal_client_entry_do_not_use__ Header auto */ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime"; import Link from 'next/link'; import { useRouter, usePathname } from 'next/navigation'; import { useSession, signOut } from '@/lib/auth'; import { useLocale } from '@/context/locale'; import { formatShortName } from '@/lib/formatName'; import { LanguageSwitcher } from './LanguageSwitcher'; import { useState, useRef, useEffect } from 'react'; import { getUnreadCount, getMyDashboard } from '@/lib/api'; import { io } from 'socket.io-client'; import { useEffectiveRole } from '@/hooks/useEffectiveRole'; import dynamic from 'next/dynamic'; const SupportModal = dynamic(()=>import('./SupportModal'), { loadableGenerated: { webpack: ()=>[ require.resolveWeak("./SupportModal") ] }, ssr: false }); const API_URL = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; export function Header() { var _session_user; const router = useRouter(); const pathname = usePathname(); const { data: session } = useSession(); const { t, locale } = useLocale(); const [menuOpen, setMenuOpen] = useState(false); const [profileOpen, setProfileOpen] = useState(false); const [supportOpen, setSupportOpen] = useState(false); const [unreadNotif, setUnreadNotif] = useState(0); const [unreadChat, setUnreadChat] = useState(0); const [msgToast, setMsgToast] = useState(null); const [planTier, setPlanTier] = useState(null); const profileRef = useRef(null); const headerRef = useRef(null); const toastTimer = useRef(null); const pathnameRef = useRef(pathname); useEffect(()=>{ pathnameRef.current = pathname; }, [ pathname ]); // Close dropdowns on outside click useEffect(()=>{ function handleClick(e) { if (profileRef.current && !profileRef.current.contains(e.target)) { setProfileOpen(false); } } document.addEventListener('mousedown', handleClick); return ()=>document.removeEventListener('mousedown', handleClick); }, []); const isAdmin = (session === null || session === void 0 ? void 0 : (_session_user = session.user) === null || _session_user === void 0 ? void 0 : _session_user.role) === 'admin'; const effectiveRole = useEffectiveRole(); const isSpecialist = effectiveRole === 'specialist'; const isActive = function(href) { let exact = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false; return exact ? pathname === href : pathname === href || pathname.startsWith(href + '/'); }; const navCls = function(href) { let exact = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false; return "font-medium text-sm transition ".concat(isActive(href, exact) ? 'text-green-600' : 'text-gray-600 hover:text-green-600'); }; const mobileNavCls = function(href) { let exact = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false; return "flex items-center gap-2 font-medium py-1 ".concat(isActive(href, exact) ? 'text-green-600' : 'text-gray-700'); }; // Reset chat badge when entering chat useEffect(()=>{ if (pathname === '/chat') setUnreadChat(0); }, [ pathname ]); useEffect(()=>{ if (!session) return; const socket = io(API_URL, { withCredentials: true, transports: [ 'websocket', 'polling' ] }); socket.on('new_message', (msg)=>{ if (pathnameRef.current === '/chat') return; setUnreadChat((c)=>c + 1); if (toastTimer.current) clearTimeout(toastTimer.current); setMsgToast(msg); toastTimer.current = setTimeout(()=>setMsgToast(null), 5000); }); return ()=>{ socket.disconnect(); if (toastTimer.current) clearTimeout(toastTimer.current); }; }, [ session ]); useEffect(()=>{ if (!session) { setUnreadNotif(0); return; } const fetch = ()=>getUnreadCount().then((r)=>setUnreadNotif(r.count)).catch(()=>{}); fetch(); const timer = setInterval(fetch, 30000); return ()=>clearInterval(timer); }, [ session ]); useEffect(()=>{ if (!session) { setPlanTier(null); return; } getMyDashboard().then((d)=>{ var _d_plan; var _d_plan_tier; return setPlanTier((_d_plan_tier = (_d_plan = d.plan) === null || _d_plan === void 0 ? void 0 : _d_plan.tier) !== null && _d_plan_tier !== void 0 ? _d_plan_tier : null); }).catch(()=>{}); }, [ session ]); useEffect(()=>{ const onScroll = ()=>{ if (!headerRef.current) return; if (window.scrollY > 40) { headerRef.current.classList.add('header-shrink'); } else { headerRef.current.classList.remove('header-shrink'); } }; window.addEventListener('scroll', onScroll); return ()=>window.removeEventListener('scroll', onScroll); }, []); return /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx("header", { ref: headerRef, className: "header-base bg-white border-b border-gray-200 sticky top-0 z-50 transition-all duration-300", children: /*#__PURE__*/ _jsxs("div", { className: "max-w-7xl mx-auto px-4 sm:px-6 lg:px-8", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between h-16 header-content transition-all duration-300", children: [ /*#__PURE__*/ _jsxs(Link, { href: "/", className: "flex items-center gap-2 shrink-0", children: [ /*#__PURE__*/ _jsx("img", { src: "/logo.png", alt: "CanHelp", className: "w-8 h-8 object-contain" }), /*#__PURE__*/ _jsx("span", { className: "logo-text text-2xl font-bold text-green-600 transition-all duration-300", children: "CanHelp" }) ] }), /*#__PURE__*/ _jsxs("nav", { className: "hidden md:flex items-center gap-5 ml-auto", children: [ isSpecialist ? /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx(Link, { href: "/tasks", className: navCls('/tasks'), children: t('nav.find_tasks') }), /*#__PURE__*/ _jsx(Link, { href: "/dashboard", className: navCls('/dashboard'), children: t('nav.dashboard') }) ] }) : /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx(Link, { href: "/tasks/new", className: navCls('/tasks/new', true), children: t('dashboard.new_task') }), " ", /*#__PURE__*/ _jsx(Link, { href: "/tasks", className: navCls('/tasks'), children: t('nav.tasks') }), " ", /*#__PURE__*/ _jsx(Link, { href: "/specialists", className: navCls('/specialists'), children: t('nav.specialists') }) ] }), /*#__PURE__*/ _jsx(Link, { href: "/pricing", className: navCls('/pricing', true), children: t('nav.pricing', 'Pricing') }), session ? /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs(Link, { href: "/notifications", className: "relative text-gray-600 hover:text-gray-900 flex items-center", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5 ".concat(unreadNotif > 0 ? 'text-green-600' : ''), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M14.857 17.082a23.848 23.848 0 005.454-1.31A8.967 8.967 0 0118 9.75v-.7V9A6 6 0 006 9v.75a8.967 8.967 0 01-2.312 6.022c1.733.64 3.56 1.085 5.455 1.31m5.714 0a24.255 24.255 0 01-5.714 0m5.714 0a3 3 0 11-5.714 0" }) }), unreadNotif > 0 && /*#__PURE__*/ _jsx("span", { className: "absolute -top-1.5 -right-1.5 min-w-[16px] h-4 px-0.5 bg-red-500 text-white text-[10px] font-bold rounded-full flex items-center justify-center leading-none", children: unreadNotif > 99 ? '99+' : unreadNotif }) ] }), /*#__PURE__*/ _jsxs(Link, { href: "/chat", className: "relative text-gray-600 hover:text-gray-900 flex items-center", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5 ".concat(unreadChat > 0 ? 'text-green-500' : ''), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }), unreadChat > 0 && /*#__PURE__*/ _jsx("span", { className: "absolute -top-1.5 -right-1.5 min-w-[16px] h-4 px-0.5 bg-green-500 text-white text-[10px] font-bold rounded-full flex items-center justify-center leading-none", children: unreadChat > 99 ? '99+' : unreadChat }) ] }), /*#__PURE__*/ _jsxs("div", { className: "relative", ref: profileRef, children: [ /*#__PURE__*/ _jsxs("button", { onClick: ()=>setProfileOpen(!profileOpen), className: "flex items-center gap-1.5 text-sm font-medium text-gray-600 hover:text-green-600", children: [ /*#__PURE__*/ _jsx("span", { className: "truncate max-w-[100px]", children: formatShortName(session.user.firstName, session.user.lastName, session.user.name) }), planTier === 'pro' && /*#__PURE__*/ _jsx("span", { className: "inline-flex items-center px-1.5 py-0.5 rounded-full text-[10px] font-bold bg-green-100 text-green-700 leading-none", children: "Pro" }), planTier === 'ultimate' && /*#__PURE__*/ _jsx("span", { className: "inline-flex items-center px-1.5 py-0.5 rounded-full text-[10px] font-bold bg-gradient-to-r from-amber-400 via-yellow-400 to-amber-400 text-gray-900 shadow-sm shadow-amber-300/50 leading-none", children: "★" }), /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19 9l-7 7-7-7" }) }) ] }), profileOpen && /*#__PURE__*/ _jsxs("div", { className: "absolute right-0 mt-2 w-52 bg-white border border-gray-200 rounded-xl shadow-lg py-1 z-50", children: [ isSpecialist ? /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs(Link, { href: "/tasks/new", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 4v16m8-8H4" }) }), t('nav.new_task') ] }), /*#__PURE__*/ _jsxs(Link, { href: "/specialists", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _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" }) }), t('nav.specialists') ] }) ] }) : /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs(Link, { href: "/notifications", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0 ".concat(unreadNotif > 0 ? 'text-green-600' : 'text-gray-400'), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M14.857 17.082a23.848 23.848 0 005.454-1.31A8.967 8.967 0 0118 9.75v-.7V9A6 6 0 006 9v.75a8.967 8.967 0 01-2.312 6.022c1.733.64 3.56 1.085 5.455 1.31m5.714 0a24.255 24.255 0 01-5.714 0m5.714 0a3 3 0 11-5.714 0" }) }), /*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-1.5", children: [ t('nav.notifications'), unreadNotif > 0 && /*#__PURE__*/ _jsx("span", { className: "px-1.5 py-0.5 bg-red-500 text-white text-[10px] font-bold rounded-full leading-none", children: unreadNotif > 99 ? '99+' : unreadNotif }) ] }) ] }), /*#__PURE__*/ _jsxs(Link, { href: "/chat", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0 ".concat(unreadChat > 0 ? 'text-green-500' : 'text-gray-400'), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }), /*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-1.5", children: [ t('nav.chat'), unreadChat > 0 && /*#__PURE__*/ _jsx("span", { className: "px-1.5 py-0.5 bg-green-500 text-white text-[10px] font-bold rounded-full leading-none", children: unreadChat > 99 ? '99+' : unreadChat }) ] }) ] }), /*#__PURE__*/ _jsxs(Link, { href: "/dashboard", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6" }) }), t('nav.dashboard') ] }) ] }), (isSpecialist || isAdmin) && /*#__PURE__*/ _jsxs(Link, { href: "/schedule", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _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" }) }), t('nav.schedule') ] }), isAdmin && /*#__PURE__*/ _jsxs(Link, { href: "/admin", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ _jsxs("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: [ /*#__PURE__*/ _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" }), /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 12a3 3 0 11-6 0 3 3 0 016 0z" }) ] }), t('nav.admin') ] }), /*#__PURE__*/ _jsxs(Link, { href: "/profile", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _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" }) }), t('nav.profile') ] }), /*#__PURE__*/ _jsxs(Link, { href: "/favorites", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4.318 6.318a4.5 4.5 0 000 6.364L12 20.364l7.682-7.682a4.5 4.5 0 00-6.364-6.364L12 7.636l-1.318-1.318a4.5 4.5 0 00-6.364 0z" }) }), t('nav.favorites') ] }), /*#__PURE__*/ _jsx("hr", { className: "my-1 border-gray-100" }), /*#__PURE__*/ _jsxs("button", { className: "w-full flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-green-50", onClick: ()=>{ setProfileOpen(false); setSupportOpen(true); }, children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _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" }) }), t('support.title') ] }), /*#__PURE__*/ _jsx("hr", { className: "my-1 border-gray-100" }), /*#__PURE__*/ _jsxs("button", { className: "w-full flex items-center gap-2.5 px-4 py-2 text-sm text-red-500 hover:bg-red-50", onClick: ()=>{ setProfileOpen(false); signOut().then(()=>{ window.location.href = '/'; }); }, children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M17 16l4-4m0 0l-4-4m4 4H7m6 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h4a3 3 0 013 3v1" }) }), t('nav.logout') ] }) ] }) ] }) ] }) : /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx(Link, { href: "/login", className: "text-gray-600 hover:text-green-600 font-medium text-sm", children: t('nav.login') }), /*#__PURE__*/ _jsx(Link, { href: "/register", className: "bg-green-600 text-white px-4 py-2 rounded-lg hover:bg-green-700 font-medium text-sm", children: t('nav.register') }) ] }), /*#__PURE__*/ _jsx(LanguageSwitcher, {}) ] }), /*#__PURE__*/ _jsxs("div", { className: "md:hidden flex items-center gap-2", children: [ /*#__PURE__*/ _jsx(LanguageSwitcher, {}), /*#__PURE__*/ _jsx("button", { className: "p-2", onClick: ()=>setMenuOpen(!menuOpen), "aria-label": "Toggle menu", children: /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5 text-gray-600", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: menuOpen ? /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" }) : /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4 6h16M4 12h16M4 18h16" }) }) }) ] }) ] }), menuOpen && /*#__PURE__*/ _jsxs("div", { className: "md:hidden py-4 border-t border-gray-100 flex flex-col gap-3", children: [ isSpecialist ? /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs(Link, { href: "/tasks", className: mobileNavCls('/tasks'), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z" }) }), t('nav.find_tasks') ] }), /*#__PURE__*/ _jsxs(Link, { href: "/dashboard", className: mobileNavCls('/dashboard'), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6" }) }), t('nav.dashboard') ] }) ] }) : /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs(Link, { href: "/tasks/new", className: mobileNavCls('/tasks/new', true), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 4v16m8-8H4" }) }), t('nav.new_task') ] }), /*#__PURE__*/ _jsxs(Link, { href: "/tasks", className: mobileNavCls('/tasks'), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _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" }) }), t('nav.tasks') ] }), /*#__PURE__*/ _jsxs(Link, { href: "/specialists", className: mobileNavCls('/specialists'), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _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" }) }), t('nav.specialists') ] }) ] }), session ? /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs(Link, { href: "/chat", className: mobileNavCls('/chat', true), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0 ".concat(unreadChat > 0 ? 'text-green-500' : ''), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }), t('nav.chat'), unreadChat > 0 && /*#__PURE__*/ _jsx("span", { className: "ml-1 px-1.5 py-0.5 bg-green-500 text-white text-[10px] font-bold rounded-full", children: unreadChat }) ] }), isSpecialist ? /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs(Link, { href: "/tasks/new", className: mobileNavCls('/tasks/new', true), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 4v16m8-8H4" }) }), t('nav.new_task') ] }), /*#__PURE__*/ _jsxs(Link, { href: "/specialists", className: mobileNavCls('/specialists'), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _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" }) }), t('nav.specialists') ] }) ] }) : /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs(Link, { href: "/notifications", className: mobileNavCls('/notifications', true), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0 ".concat(unreadNotif > 0 ? 'text-green-600' : ''), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M14.857 17.082a23.848 23.848 0 005.454-1.31A8.967 8.967 0 0118 9.75v-.7V9A6 6 0 006 9v.75a8.967 8.967 0 01-2.312 6.022c1.733.64 3.56 1.085 5.455 1.31m5.714 0a24.255 24.255 0 01-5.714 0m5.714 0a3 3 0 11-5.714 0" }) }), /*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-1.5", children: [ t('nav.notifications'), unreadNotif > 0 && /*#__PURE__*/ _jsx("span", { className: "px-1.5 py-0.5 bg-red-500 text-white text-[10px] font-bold rounded-full", children: unreadNotif > 99 ? '99+' : unreadNotif }) ] }) ] }), /*#__PURE__*/ _jsxs(Link, { href: "/dashboard", className: mobileNavCls('/dashboard'), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6" }) }), t('nav.dashboard') ] }) ] }), /*#__PURE__*/ _jsxs(Link, { href: "/favorites", className: mobileNavCls('/favorites', true), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4.318 6.318a4.5 4.5 0 000 6.364L12 20.364l7.682-7.682a4.5 4.5 0 00-6.364-6.364L12 7.636l-1.318-1.318a4.5 4.5 0 00-6.364 0z" }) }), t('nav.favorites') ] }), (isSpecialist || isAdmin) && /*#__PURE__*/ _jsxs(Link, { href: "/schedule", className: mobileNavCls('/schedule', true), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-gray-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _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" }) }), t('nav.schedule') ] }), isAdmin && /*#__PURE__*/ _jsxs(Link, { href: "/admin", className: mobileNavCls('/admin'), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ _jsxs("svg", { className: "w-4 h-4 text-gray-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: [ /*#__PURE__*/ _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" }), /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 12a3 3 0 11-6 0 3 3 0 016 0z" }) ] }), t('nav.admin') ] }), /*#__PURE__*/ _jsxs(Link, { href: "/profile", className: mobileNavCls('/profile', true), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-gray-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _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" }) }), t('nav.profile') ] }), /*#__PURE__*/ _jsxs("button", { onClick: ()=>{ setMenuOpen(false); signOut().then(()=>{ window.location.href = '/'; }); }, className: "flex items-center gap-2 text-left text-red-500 py-1 font-medium", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M17 16l4-4m0 0l-4-4m4 4H7m6 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h4a3 3 0 013 3v1" }) }), t('nav.logout') ] }) ] }) : /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx(Link, { href: "/login", className: "text-gray-700 font-medium py-1", onClick: ()=>setMenuOpen(false), children: t('nav.login') }), /*#__PURE__*/ _jsx(Link, { href: "/register", className: "text-green-600 font-medium py-1", onClick: ()=>setMenuOpen(false), children: t('nav.register') }) ] }) ] }) ] }) }), msgToast && /*#__PURE__*/ _jsx("div", { className: "fixed bottom-5 right-5 z-[200] max-w-sm w-full", children: /*#__PURE__*/ _jsxs("div", { className: "bg-white border border-gray-200 rounded-xl shadow-xl p-4 flex items-start gap-3 animate-fade-in", children: [ /*#__PURE__*/ _jsx("span", { className: "text-2xl shrink-0", children: "\uD83D\uDCAC" }), /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ _jsx("p", { className: "font-semibold text-gray-900 text-sm", children: t('chat.toast_title') }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-500 truncate mt-0.5", children: msgToast.body }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex flex-col items-end gap-2 shrink-0", children: [ /*#__PURE__*/ _jsx("button", { onClick: ()=>setMsgToast(null), className: "text-gray-400 hover:text-gray-600 text-lg leading-none", "aria-label": "close", children: "\xd7" }), /*#__PURE__*/ _jsx(Link, { href: "/chat?room=".concat(msgToast.roomId), onClick: ()=>setMsgToast(null), className: "text-xs text-green-600 hover:underline font-medium", children: t('chat.toast_open') }) ] }) ] }) }), supportOpen && /*#__PURE__*/ _jsx(SupportModal, { onClose: ()=>setSupportOpen(false) }) ] }); } (Z60145undefined147175undefined177233undefined235283undefined285329undefined331381undefined383436undefined438489undefined491549undefined551588undefined590649undefined651685undefined708714__WEBPACK_MODULE_REFERENCE__12_5b2264656661756c74225d_call_directImport_asiSafe1__._undefined720743__webpack_require__.e(/* import() */ 6467).then(__webpack_require__.bind(__webpack_require__, 6467))undefined812830/*require.resolve*/undefined8328476467undefined906936"https://api.canhelp.gr"undefined9419630undefined966972undefined10351043__WEBPACK_MODULE_REFERENCE__2_5b22757365526f75746572225d_call_directImport_asiSafe1__._undefined10691079__WEBPACK_MODULE_REFERENCE__2_5b22757365506174686e616d65225d_call_directImport_asiSafe1__._undefined11141123__WEBPACK_MODULE_REFERENCE__3_5b2275736553657373696f6e225d_call_directImport_asiSafe1__._undefined11541162__WEBPACK_MODULE_REFERENCE__4_5b227573654c6f63616c65225d_call_directImport_asiSafe1__._undefined12031210__WEBPACK_MODULE_REFERENCE__6_5b227573655374617465225d_call_directImport_asiSafe1__._undefined12621269__WEBPACK_MODULE_REFERENCE__6_5b227573655374617465225d_call_directImport_asiSafe1__._undefined13211328__WEBPACK_MODULE_REFERENCE__6_5b227573655374617465225d_call_directImport_asiSafe1__._undefined13801387__WEBPACK_MODULE_REFERENCE__6_5b227573655374617465225d_call_directImport_asiSafe1__._undefined14331440__WEBPACK_MODULE_REFERENCE__6_5b227573655374617465225d_call_directImport_asiSafe1__._undefined14821489__WEBPACK_MODULE_REFERENCE__6_5b227573655374617465225d_call_directImport_asiSafe1__._undefined15341541__WEBPACK_MODULE_REFERENCE__6_5b227573655374617465225d_call_directImport_asiSafe1__._undefined15731578__WEBPACK_MODULE_REFERENCE__6_5b22757365526566225d_call_directImport_asiSafe1__._undefined16091614__WEBPACK_MODULE_REFERENCE__6_5b22757365526566225d_call_directImport_asiSafe1__._undefined16461651__WEBPACK_MODULE_REFERENCE__6_5b22757365526566225d_call_directImport_asiSafe1__._undefined16841689__WEBPACK_MODULE_REFERENCE__6_5b22757365526566225d_call_directImport_asiSafe1__._undefined17061714__WEBPACK_MODULE_REFERENCE__6_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined18401848__WEBPACK_MODULE_REFERENCE__6_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined23902405__WEBPACK_MODULE_REFERENCE__11_5b22757365456666656374697665526f6c65225d_call_directImport_asiSafe1__._undefined32893297__WEBPACK_MODULE_REFERENCE__6_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined33953403__WEBPACK_MODULE_REFERENCE__6_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined34643465__WEBPACK_MODULE_REFERENCE__10_5b22696f225d_call_directImport_asiSafe1__._undefined41164124__WEBPACK_MODULE_REFERENCE__6_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined42434256__WEBPACK_MODULE_REFERENCE__9_5b22676574556e72656164436f756e74225d_call_directImport_asiSafe1__._undefined44544462__WEBPACK_MODULE_REFERENCE__6_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined45634576__WEBPACK_MODULE_REFERENCE__9_5b226765744d7944617368626f617264225d_call_directImport_asiSafe1__._undefined48924900__WEBPACK_MODULE_REFERENCE__6_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined53605364__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined53665374__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined54255428__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined56365640__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined57945798__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined60196023__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined60256028__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined62656268__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined65796582__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined69516955__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined71757179__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined71817189__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined73127315__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined73177320__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined76707673__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined76757678__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined80778081__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined80838091__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined82148217__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined82198222__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined86588661__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined86638666__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined90799082__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined90849087__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined95319534__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined95369539__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined98779881__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined98839891__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined1001410018__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1002010023__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined1036510368__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1091210915__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1159511598__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1217612180__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1218212185__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined1251812521__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1306413067__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1369413697__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1427514279__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1456814572__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1499414997__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1519215206__WEBPACK_MODULE_REFERENCE__5_5b22666f726d617453686f72744e616d65225d_call_directImport_asiSafe1__._undefined1544215445__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1591115914__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1642716430__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1698016983__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1762517629__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1796917973__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1797517983__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined1815418158__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1816018163__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined1872318726__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1938819391__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2024520249__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2025120254__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined2081620819__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2148121484__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2259422598__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2260022608__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined2277922783__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2278522788__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined2335223355__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2406524068__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2487324877__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2534225345__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2618826192__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2619426197__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined2675226755__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2746427467__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2822028224__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2867928682__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2952529529__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2953129534__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined3009430097__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3075930762__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3190531909__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3191131914__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined3243332436__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3305033053__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3391833922__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3392433927__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined3444334447__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3514335146__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3612636129__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3702037024__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3702637029__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined3754737550__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3816438167__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3900139005__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3900739010__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined3953039533__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4014740150__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4104241045__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4130341307__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4199541998__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4261242615__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4354443547__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4380543809__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4423544241__WEBPACK_MODULE_REFERENCE__3_5b227369676e4f7574225d_call_directImport_asiSafe1__._undefined4467344676__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4527645279__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4638646390__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4639246400__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined4652346526__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4652846531__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined4691646919__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4692146924__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined4742547428__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4743047445__WEBPACK_MODULE_REFERENCE__8_5b224c616e67756167655377697463686572225d_directImport_asiSafe1__._undefined4757247576__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4777347776__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4777847793__WEBPACK_MODULE_REFERENCE__8_5b224c616e67756167655377697463686572225d_directImport_asiSafe1__._undefined4785547858__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4815648159__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4860548608__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4891848921__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4948949493__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4970749711__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4971349721__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined4982849832__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4983449837__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined5017650179__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5063550638__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5123551239__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5124151244__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined5159151594__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5205052053__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5278452788__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5279052798__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined5290552909__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5291152914__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined5326753270__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5372653729__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5429554299__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5430154304__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined5464354646__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5510255105__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5578155785__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5578755790__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined5614156144__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5660056603__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5743457438__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5744057448__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined5755557559__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5756157564__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined5790757910__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5841458417__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5905959062__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5950159505__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5950759515__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined5963859642__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5964459647__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined6004060043__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6054760550__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6118861192__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined6119461197__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined6158861591__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6209562098__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6296862972__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined6297462982__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined6310563109__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined6311163114__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined6351563518__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6407164074__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6473564739__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined6510865111__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6574965753__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined6575565758__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined6614566148__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6665266655__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6750567509__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined6751167514__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined6786767870__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6832668329__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6903469038__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined6904069043__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined6939469397__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6985869861__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7051070514__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined7051670519__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined7085870862__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined7138171384__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7224472247__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7289872902__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined7290472907__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined7325673259__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7372073723__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7434174345__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined7453474540__WEBPACK_MODULE_REFERENCE__3_5b227369676e4f7574225d_call_directImport_asiSafe1__._undefined7497474977__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7542475427__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7610076104__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined7610676114__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined7622176224__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7622676229__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined7662776630__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7663276635__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined7721077213__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7734177345__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined7755677559__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7775077754__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined7790877911__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7815678159__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7844778451__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined7862978632__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7901379016__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7901879021__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined7953379536__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined@ë`]_° c}×úRqÇðDxÌTˆÜ ^ˆÜ ]}Íì<\¬Í . _„  X v Û O¥]šãnÄ;›a·|žÚ&(wªôĪöÓ_!n[ ¥ Ü!&"—#ã#¿$ % %\%×%!&#&p&Î'((g(ö)B*D*“*+X+Z+§+[-¥-§-_ô-‘/Û/Ý/*0æ102222Ñ344n4é45575„5Ú6$7D9Ž96<€<Â>??]?ª@ô@C]CÐE_F\HšHÉIJ»KLÈL*MN`N2P|P}RÇRíT7U¹WXYY¥Y§YöY¡ZíZïZ<[l]¶]L`–`ìc_8d:d‡d¹fg™iãi9n…n‡nÖnoÍoÏopPršr`uªuÏxyìz6{~Í~Ï~G‘V„ „‘‡_݇€‰î‰9…‡ÔNä’.“¥—ñ—ó—@˜Gš‘š÷œA¢ î ð =¡A££EŠŠcª­ª(®t®v®_îɰ±y³Ã³·Q·S· ·š¹ò¹XŒ¢ŒÀhÀjÁ¶ÁfİÄÇ`ÇËKËM̙ÌCΕÎEЏÐçÒ1ӄ×_Ð×Ò×!ØœØæØèØ5Ù¶ÚÛÛOÛDݎݐÝïÝnÞºÞßÉßËß*àhà²àÜá&âäã.ädå®åæç2èé_TéVé¥éê\ê^ê«êþëHìîZî¯ðûðýðJñ¥òïò·ôõÜ÷(ø*øyøäø0ù2ùùàú*ûòü<ýrÿ_ŸÿÀÿ `ªrŒ`¬®ûZ€l ¶ õ AC’ýIK˜ï91{ýGþJL_›bd±:„|ÆD  ’ ß f"°"š$ò$X(€(Š(õ(p)Œ)Ÿ) *œ+æ+.Y.î0:1«2_õ2s5¿5Á56‘7Û7Ó9:o=»=œ= >k?µ?}AÇAˆDÔDÖD#E‚FÌF™HãHlKžKºKLZMŠM­O_÷OSSS(VtVvVÃV XjX7ZZë\7]ô]F^ø_B`bKbìd8e:e‰eôe>f@ffhehghŽhójT=kœk lÜl&måm1nËno pTptqÀqrrŒr9tƒt…tÒtÒvwš(0,app_dynamic["default"])˜(0,navigation.useRouter)š(0,navigation.usePathname)ñßàààààààááááããuseEffectiveRoleââŠ(0,esm.io)áž(0,api/* getUnreadCount */.$M)à(0,api/* getMyDashboard */.H)ßà”jsx_runtime.Fragmentàßßߐ(link_default())ßßÞÞþßÿßÿÞþßÿßÿßÿßÿÞþÞÿßßßÞÿßßßÞÞߥ(0,formatName/* formatShortName */.H)ÞÞÞÞÝÝýÝþÞÞÝþÞÞÝýÝþÞÞÝÞÝþÞÞÝÞÝþÞÞÝþÞÞÝþÝÞÞÝþÞÞÝþÞÞÞÝÞÞÞݘ(0,auth/* signOut */.CI)ÝÝÜüÝýÝýݐLanguageSwitcherÛÜÿÜÜÜÜÛÛûÛüÜÜÛüÜÜÛûÛüÜÜÛüÜÜÛüÜÜÛûÛüÜÜÜÛûÛüÜÜÛüÜÜÛûÛüÜÜÛÜÛüÜÜÛüÜÜÛüÜÜÛüÛÜÜÛüÜÜÛþÜÜÛûÜüÜüÜÛÜÛÜÜÛÜÜüÜ€†buffer†source„size„maps„hashð[ // EXPORTS __webpack_require__.d(__webpack_exports__, { Header: () => (/* binding */ Header) }); // EXTERNAL MODULE: ../../node_modules/next/dist/compiled/react/jsx-runtime.js var jsx_runtime = __webpack_require__(4568); // EXTERNAL MODULE: ../../node_modules/next/dist/client/app-dir/link.js var app_dir_link = __webpack_require__(9664); var link_default = /*#__PURE__*/__webpack_require__.n(app_dir_link); // EXTERNAL MODULE: ../../node_modules/next/dist/api/navigation.js var navigation = __webpack_require__(7541); // EXTERNAL MODULE: ./src/lib/auth.ts var auth = __webpack_require__(1592); // EXTERNAL MODULE: ./src/context/locale.tsx var context_locale = __webpack_require__(9906); // EXTERNAL MODULE: ./src/lib/formatName.ts var formatName = __webpack_require__(1258); // EXTERNAL MODULE: ../../node_modules/next/dist/compiled/react/index.js var react = __webpack_require__(7620); // EXTERNAL MODULE: ./src/lib/translations.ts var translations = __webpack_require__(4962); ;// ./src/components/LanguageSwitcher.tsx /* __next_internal_client_entry_do_not_use__ LanguageSwitcher auto */ function LanguageSwitcher() { const { locale, setLocale } = (0,context_locale/* useLocale */.Y)(); const [open, setOpen] = (0,react.useState)(false); const ref = (0,react.useRef)(null); var _LOCALES_find; const current = (_LOCALES_find = translations/* LOCALES */.YZ.find((l)=>l.code === locale)) !== null && _LOCALES_find !== void 0 ? _LOCALES_find : translations/* LOCALES */.YZ[0]; // Close on outside click (0,react.useEffect)(()=>{ function handleClick(e) { if (ref.current && !ref.current.contains(e.target)) setOpen(false); } document.addEventListener('mousedown', handleClick); return ()=>document.removeEventListener('mousedown', handleClick); }, []); return /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { ref: ref, className: "relative", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("button", { onClick: ()=>setOpen(!open), className: "flex items-center gap-1.5 px-2.5 py-1.5 rounded-lg border border-gray-200 hover:border-green-400 hover:bg-green-50 transition text-sm font-medium text-gray-700", "aria-label": "Change language", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { children: current.code.toUpperCase() }), /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { className: "w-3.5 h-3.5 text-gray-400 transition-transform ".concat(open ? 'rotate-180' : ''), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19 9l-7 7-7-7" }) }) ] }), open && /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "absolute right-0 mt-1 w-40 bg-white border border-gray-200 rounded-xl shadow-lg z-50 overflow-hidden", children: translations/* LOCALES */.YZ.map((loc)=>/*#__PURE__*/ (0,jsx_runtime.jsxs)("button", { onClick: ()=>{ setLocale(loc.code); setOpen(false); }, className: "w-full flex items-center gap-2.5 px-3.5 py-2.5 text-sm hover:bg-green-50 transition ".concat(locale === loc.code ? 'bg-green-50 text-green-700 font-medium' : 'text-gray-700'), children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { children: loc.label }), locale === loc.code && /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { className: "w-3.5 h-3.5 ml-auto text-green-600", fill: "currentColor", viewBox: "0 0 20 20", children: /*#__PURE__*/ (0,jsx_runtime.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" }) }) ] }, loc.code)) }) ] }); } // EXTERNAL MODULE: ./src/lib/api.ts var api = __webpack_require__(2982); // EXTERNAL MODULE: ../../node_modules/socket.io-client/build/esm/index.js + 28 modules var esm = __webpack_require__(2838); ;// ./src/hooks/useEffectiveRole.ts /* __next_internal_client_entry_do_not_use__ useEffectiveRole auto */ function readPreviewRole() { if (typeof document === 'undefined') return null; const m = document.cookie.match(/(?:^|;\s*)canhelp_preview_role=([^;]+)/); var _m_; return (_m_ = m === null || m === void 0 ? void 0 : m[1]) !== null && _m_ !== void 0 ? _m_ : null; } /** * Returns the effective role for the current user. * For admins, respects the `canhelp_preview_role` cookie set by AdminRolePreview widget. * Updates reactively when the widget dispatches `canhelp:preview-role`. */ function useEffectiveRole() { var _session_user; const { data: session } = (0,auth/* useSession */.wV)(); const userRole = session === null || session === void 0 ? void 0 : (_session_user = session.user) === null || _session_user === void 0 ? void 0 : _session_user.role; const isAdmin = userRole === 'admin'; const [previewRole, setPreviewRole] = (0,react.useState)(null); (0,react.useEffect)(()=>{ if (!isAdmin) return; setPreviewRole(readPreviewRole()); const sync = ()=>setPreviewRole(readPreviewRole()); window.addEventListener('canhelp:preview-role', sync); document.addEventListener('visibilitychange', sync); return ()=>{ window.removeEventListener('canhelp:preview-role', sync); document.removeEventListener('visibilitychange', sync); }; }, [ isAdmin ]); if (!userRole) return null; if (isAdmin && previewRole) return previewRole; return userRole; } // EXTERNAL MODULE: ../../node_modules/next/dist/api/app-dynamic.js var app_dynamic = __webpack_require__(6442); ;// ./src/components/Header.tsx /* __next_internal_client_entry_do_not_use__ Header auto */ const SupportModal = (0,app_dynamic["default"])(()=>__webpack_require__.e(/* import() */ 6467).then(__webpack_require__.bind(__webpack_require__, 6467)), { loadableGenerated: { webpack: ()=>[ /*require.resolve*/(6467) ] }, ssr: false }); const API_URL = "https://api.canhelp.gr" || 0; function Header() { var _session_user; const router = (0,navigation.useRouter)(); const pathname = (0,navigation.usePathname)(); const { data: session } = (0,auth/* useSession */.wV)(); const { t, locale } = (0,context_locale/* useLocale */.Y)(); const [menuOpen, setMenuOpen] = (0,react.useState)(false); const [profileOpen, setProfileOpen] = (0,react.useState)(false); const [supportOpen, setSupportOpen] = (0,react.useState)(false); const [unreadNotif, setUnreadNotif] = (0,react.useState)(0); const [unreadChat, setUnreadChat] = (0,react.useState)(0); const [msgToast, setMsgToast] = (0,react.useState)(null); const [planTier, setPlanTier] = (0,react.useState)(null); const profileRef = (0,react.useRef)(null); const headerRef = (0,react.useRef)(null); const toastTimer = (0,react.useRef)(null); const pathnameRef = (0,react.useRef)(pathname); (0,react.useEffect)(()=>{ pathnameRef.current = pathname; }, [ pathname ]); // Close dropdowns on outside click (0,react.useEffect)(()=>{ function handleClick(e) { if (profileRef.current && !profileRef.current.contains(e.target)) { setProfileOpen(false); } } document.addEventListener('mousedown', handleClick); return ()=>document.removeEventListener('mousedown', handleClick); }, []); const isAdmin = (session === null || session === void 0 ? void 0 : (_session_user = session.user) === null || _session_user === void 0 ? void 0 : _session_user.role) === 'admin'; const effectiveRole = useEffectiveRole(); const isSpecialist = effectiveRole === 'specialist'; const isActive = function(href) { let exact = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false; return exact ? pathname === href : pathname === href || pathname.startsWith(href + '/'); }; const navCls = function(href) { let exact = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false; return "font-medium text-sm transition ".concat(isActive(href, exact) ? 'text-green-600' : 'text-gray-600 hover:text-green-600'); }; const mobileNavCls = function(href) { let exact = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false; return "flex items-center gap-2 font-medium py-1 ".concat(isActive(href, exact) ? 'text-green-600' : 'text-gray-700'); }; // Reset chat badge when entering chat (0,react.useEffect)(()=>{ if (pathname === '/chat') setUnreadChat(0); }, [ pathname ]); (0,react.useEffect)(()=>{ if (!session) return; const socket = (0,esm.io)(API_URL, { withCredentials: true, transports: [ 'websocket', 'polling' ] }); socket.on('new_message', (msg)=>{ if (pathnameRef.current === '/chat') return; setUnreadChat((c)=>c + 1); if (toastTimer.current) clearTimeout(toastTimer.current); setMsgToast(msg); toastTimer.current = setTimeout(()=>setMsgToast(null), 5000); }); return ()=>{ socket.disconnect(); if (toastTimer.current) clearTimeout(toastTimer.current); }; }, [ session ]); (0,react.useEffect)(()=>{ if (!session) { setUnreadNotif(0); return; } const fetch = ()=>(0,api/* getUnreadCount */.$M)().then((r)=>setUnreadNotif(r.count)).catch(()=>{}); fetch(); const timer = setInterval(fetch, 30000); return ()=>clearInterval(timer); }, [ session ]); (0,react.useEffect)(()=>{ if (!session) { setPlanTier(null); return; } (0,api/* getMyDashboard */.H)().then((d)=>{ var _d_plan; var _d_plan_tier; return setPlanTier((_d_plan_tier = (_d_plan = d.plan) === null || _d_plan === void 0 ? void 0 : _d_plan.tier) !== null && _d_plan_tier !== void 0 ? _d_plan_tier : null); }).catch(()=>{}); }, [ session ]); (0,react.useEffect)(()=>{ const onScroll = ()=>{ if (!headerRef.current) return; if (window.scrollY > 40) { headerRef.current.classList.add('header-shrink'); } else { headerRef.current.classList.remove('header-shrink'); } }; window.addEventListener('scroll', onScroll); return ()=>window.removeEventListener('scroll', onScroll); }, []); return /*#__PURE__*/ (0,jsx_runtime.jsxs)(jsx_runtime.Fragment, { children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("header", { ref: headerRef, className: "header-base bg-white border-b border-gray-200 sticky top-0 z-50 transition-all duration-300", children: /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "max-w-7xl mx-auto px-4 sm:px-6 lg:px-8", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex items-center justify-between h-16 header-content transition-all duration-300", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)((link_default()), { href: "/", className: "flex items-center gap-2 shrink-0", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("img", { src: "/logo.png", alt: "CanHelp", className: "w-8 h-8 object-contain" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "logo-text text-2xl font-bold text-green-600 transition-all duration-300", children: "CanHelp" }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("nav", { className: "hidden md:flex items-center gap-5 ml-auto", children: [ isSpecialist ? /*#__PURE__*/ (0,jsx_runtime.jsxs)(jsx_runtime.Fragment, { children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)((link_default()), { href: "/tasks", className: navCls('/tasks'), children: t('nav.find_tasks') }), /*#__PURE__*/ (0,jsx_runtime.jsx)((link_default()), { href: "/dashboard", className: navCls('/dashboard'), children: t('nav.dashboard') }) ] }) : /*#__PURE__*/ (0,jsx_runtime.jsxs)(jsx_runtime.Fragment, { children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)((link_default()), { href: "/tasks/new", className: navCls('/tasks/new', true), children: t('dashboard.new_task') }), " ", /*#__PURE__*/ (0,jsx_runtime.jsx)((link_default()), { href: "/tasks", className: navCls('/tasks'), children: t('nav.tasks') }), " ", /*#__PURE__*/ (0,jsx_runtime.jsx)((link_default()), { href: "/specialists", className: navCls('/specialists'), children: t('nav.specialists') }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)((link_default()), { href: "/pricing", className: navCls('/pricing', true), children: t('nav.pricing', 'Pricing') }), session ? /*#__PURE__*/ (0,jsx_runtime.jsxs)(jsx_runtime.Fragment, { children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)((link_default()), { href: "/notifications", className: "relative text-gray-600 hover:text-gray-900 flex items-center", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { className: "w-5 h-5 ".concat(unreadNotif > 0 ? 'text-green-600' : ''), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ (0,jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M14.857 17.082a23.848 23.848 0 005.454-1.31A8.967 8.967 0 0118 9.75v-.7V9A6 6 0 006 9v.75a8.967 8.967 0 01-2.312 6.022c1.733.64 3.56 1.085 5.455 1.31m5.714 0a24.255 24.255 0 01-5.714 0m5.714 0a3 3 0 11-5.714 0" }) }), unreadNotif > 0 && /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "absolute -top-1.5 -right-1.5 min-w-[16px] h-4 px-0.5 bg-red-500 text-white text-[10px] font-bold rounded-full flex items-center justify-center leading-none", children: unreadNotif > 99 ? '99+' : unreadNotif }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)((link_default()), { href: "/chat", className: "relative text-gray-600 hover:text-gray-900 flex items-center", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { className: "w-5 h-5 ".concat(unreadChat > 0 ? 'text-green-500' : ''), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ (0,jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }), unreadChat > 0 && /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "absolute -top-1.5 -right-1.5 min-w-[16px] h-4 px-0.5 bg-green-500 text-white text-[10px] font-bold rounded-full flex items-center justify-center leading-none", children: unreadChat > 99 ? '99+' : unreadChat }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "relative", ref: profileRef, children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("button", { onClick: ()=>setProfileOpen(!profileOpen), className: "flex items-center gap-1.5 text-sm font-medium text-gray-600 hover:text-green-600", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "truncate max-w-[100px]", children: (0,formatName/* formatShortName */.H)(session.user.firstName, session.user.lastName, session.user.name) }), planTier === 'pro' && /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "inline-flex items-center px-1.5 py-0.5 rounded-full text-[10px] font-bold bg-green-100 text-green-700 leading-none", children: "Pro" }), planTier === 'ultimate' && /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "inline-flex items-center px-1.5 py-0.5 rounded-full text-[10px] font-bold bg-gradient-to-r from-amber-400 via-yellow-400 to-amber-400 text-gray-900 shadow-sm shadow-amber-300/50 leading-none", children: "★" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19 9l-7 7-7-7" }) }) ] }), profileOpen && /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "absolute right-0 mt-2 w-52 bg-white border border-gray-200 rounded-xl shadow-lg py-1 z-50", children: [ isSpecialist ? /*#__PURE__*/ (0,jsx_runtime.jsxs)(jsx_runtime.Fragment, { children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)((link_default()), { href: "/tasks/new", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 4v16m8-8H4" }) }), t('nav.new_task') ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)((link_default()), { href: "/specialists", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,jsx_runtime.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" }) }), t('nav.specialists') ] }) ] }) : /*#__PURE__*/ (0,jsx_runtime.jsxs)(jsx_runtime.Fragment, { children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)((link_default()), { href: "/notifications", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { className: "w-4 h-4 shrink-0 ".concat(unreadNotif > 0 ? 'text-green-600' : 'text-gray-400'), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M14.857 17.082a23.848 23.848 0 005.454-1.31A8.967 8.967 0 0118 9.75v-.7V9A6 6 0 006 9v.75a8.967 8.967 0 01-2.312 6.022c1.733.64 3.56 1.085 5.455 1.31m5.714 0a24.255 24.255 0 01-5.714 0m5.714 0a3 3 0 11-5.714 0" }) }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("span", { className: "flex items-center gap-1.5", children: [ t('nav.notifications'), unreadNotif > 0 && /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "px-1.5 py-0.5 bg-red-500 text-white text-[10px] font-bold rounded-full leading-none", children: unreadNotif > 99 ? '99+' : unreadNotif }) ] }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)((link_default()), { href: "/chat", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { className: "w-4 h-4 shrink-0 ".concat(unreadChat > 0 ? 'text-green-500' : 'text-gray-400'), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("span", { className: "flex items-center gap-1.5", children: [ t('nav.chat'), unreadChat > 0 && /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "px-1.5 py-0.5 bg-green-500 text-white text-[10px] font-bold rounded-full leading-none", children: unreadChat > 99 ? '99+' : unreadChat }) ] }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)((link_default()), { href: "/dashboard", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6" }) }), t('nav.dashboard') ] }) ] }), (isSpecialist || isAdmin) && /*#__PURE__*/ (0,jsx_runtime.jsxs)((link_default()), { href: "/schedule", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,jsx_runtime.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" }) }), t('nav.schedule') ] }), isAdmin && /*#__PURE__*/ (0,jsx_runtime.jsxs)((link_default()), { href: "/admin", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: [ /*#__PURE__*/ (0,jsx_runtime.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" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 12a3 3 0 11-6 0 3 3 0 016 0z" }) ] }), t('nav.admin') ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)((link_default()), { href: "/profile", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,jsx_runtime.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" }) }), t('nav.profile') ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)((link_default()), { href: "/favorites", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4.318 6.318a4.5 4.5 0 000 6.364L12 20.364l7.682-7.682a4.5 4.5 0 00-6.364-6.364L12 7.636l-1.318-1.318a4.5 4.5 0 00-6.364 0z" }) }), t('nav.favorites') ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("hr", { className: "my-1 border-gray-100" }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("button", { className: "w-full flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-green-50", onClick: ()=>{ setProfileOpen(false); setSupportOpen(true); }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,jsx_runtime.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" }) }), t('support.title') ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("hr", { className: "my-1 border-gray-100" }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("button", { className: "w-full flex items-center gap-2.5 px-4 py-2 text-sm text-red-500 hover:bg-red-50", onClick: ()=>{ setProfileOpen(false); (0,auth/* signOut */.CI)().then(()=>{ window.location.href = '/'; }); }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M17 16l4-4m0 0l-4-4m4 4H7m6 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h4a3 3 0 013 3v1" }) }), t('nav.logout') ] }) ] }) ] }) ] }) : /*#__PURE__*/ (0,jsx_runtime.jsxs)(jsx_runtime.Fragment, { children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)((link_default()), { href: "/login", className: "text-gray-600 hover:text-green-600 font-medium text-sm", children: t('nav.login') }), /*#__PURE__*/ (0,jsx_runtime.jsx)((link_default()), { href: "/register", className: "bg-green-600 text-white px-4 py-2 rounded-lg hover:bg-green-700 font-medium text-sm", children: t('nav.register') }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)(LanguageSwitcher, {}) ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "md:hidden flex items-center gap-2", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)(LanguageSwitcher, {}), /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "p-2", onClick: ()=>setMenuOpen(!menuOpen), "aria-label": "Toggle menu", children: /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { className: "w-5 h-5 text-gray-600", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: menuOpen ? /*#__PURE__*/ (0,jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" }) : /*#__PURE__*/ (0,jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4 6h16M4 12h16M4 18h16" }) }) }) ] }) ] }), menuOpen && /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "md:hidden py-4 border-t border-gray-100 flex flex-col gap-3", children: [ isSpecialist ? /*#__PURE__*/ (0,jsx_runtime.jsxs)(jsx_runtime.Fragment, { children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)((link_default()), { href: "/tasks", className: mobileNavCls('/tasks'), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z" }) }), t('nav.find_tasks') ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)((link_default()), { href: "/dashboard", className: mobileNavCls('/dashboard'), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6" }) }), t('nav.dashboard') ] }) ] }) : /*#__PURE__*/ (0,jsx_runtime.jsxs)(jsx_runtime.Fragment, { children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)((link_default()), { href: "/tasks/new", className: mobileNavCls('/tasks/new', true), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 4v16m8-8H4" }) }), t('nav.new_task') ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)((link_default()), { href: "/tasks", className: mobileNavCls('/tasks'), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,jsx_runtime.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" }) }), t('nav.tasks') ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)((link_default()), { href: "/specialists", className: mobileNavCls('/specialists'), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,jsx_runtime.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" }) }), t('nav.specialists') ] }) ] }), session ? /*#__PURE__*/ (0,jsx_runtime.jsxs)(jsx_runtime.Fragment, { children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)((link_default()), { href: "/chat", className: mobileNavCls('/chat', true), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { className: "w-4 h-4 shrink-0 ".concat(unreadChat > 0 ? 'text-green-500' : ''), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }), t('nav.chat'), unreadChat > 0 && /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "ml-1 px-1.5 py-0.5 bg-green-500 text-white text-[10px] font-bold rounded-full", children: unreadChat }) ] }), isSpecialist ? /*#__PURE__*/ (0,jsx_runtime.jsxs)(jsx_runtime.Fragment, { children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)((link_default()), { href: "/tasks/new", className: mobileNavCls('/tasks/new', true), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 4v16m8-8H4" }) }), t('nav.new_task') ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)((link_default()), { href: "/specialists", className: mobileNavCls('/specialists'), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,jsx_runtime.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" }) }), t('nav.specialists') ] }) ] }) : /*#__PURE__*/ (0,jsx_runtime.jsxs)(jsx_runtime.Fragment, { children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)((link_default()), { href: "/notifications", className: mobileNavCls('/notifications', true), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { className: "w-4 h-4 shrink-0 ".concat(unreadNotif > 0 ? 'text-green-600' : ''), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M14.857 17.082a23.848 23.848 0 005.454-1.31A8.967 8.967 0 0118 9.75v-.7V9A6 6 0 006 9v.75a8.967 8.967 0 01-2.312 6.022c1.733.64 3.56 1.085 5.455 1.31m5.714 0a24.255 24.255 0 01-5.714 0m5.714 0a3 3 0 11-5.714 0" }) }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("span", { className: "flex items-center gap-1.5", children: [ t('nav.notifications'), unreadNotif > 0 && /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "px-1.5 py-0.5 bg-red-500 text-white text-[10px] font-bold rounded-full", children: unreadNotif > 99 ? '99+' : unreadNotif }) ] }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)((link_default()), { href: "/dashboard", className: mobileNavCls('/dashboard'), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6" }) }), t('nav.dashboard') ] }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)((link_default()), { href: "/favorites", className: mobileNavCls('/favorites', true), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4.318 6.318a4.5 4.5 0 000 6.364L12 20.364l7.682-7.682a4.5 4.5 0 00-6.364-6.364L12 7.636l-1.318-1.318a4.5 4.5 0 00-6.364 0z" }) }), t('nav.favorites') ] }), (isSpecialist || isAdmin) && /*#__PURE__*/ (0,jsx_runtime.jsxs)((link_default()), { href: "/schedule", className: mobileNavCls('/schedule', true), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { className: "w-4 h-4 text-gray-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,jsx_runtime.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" }) }), t('nav.schedule') ] }), isAdmin && /*#__PURE__*/ (0,jsx_runtime.jsxs)((link_default()), { href: "/admin", className: mobileNavCls('/admin'), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("svg", { className: "w-4 h-4 text-gray-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: [ /*#__PURE__*/ (0,jsx_runtime.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" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 12a3 3 0 11-6 0 3 3 0 016 0z" }) ] }), t('nav.admin') ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)((link_default()), { href: "/profile", className: mobileNavCls('/profile', true), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { className: "w-4 h-4 text-gray-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,jsx_runtime.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" }) }), t('nav.profile') ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("button", { onClick: ()=>{ setMenuOpen(false); (0,auth/* signOut */.CI)().then(()=>{ window.location.href = '/'; }); }, className: "flex items-center gap-2 text-left text-red-500 py-1 font-medium", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M17 16l4-4m0 0l-4-4m4 4H7m6 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h4a3 3 0 013 3v1" }) }), t('nav.logout') ] }) ] }) : /*#__PURE__*/ (0,jsx_runtime.jsxs)(jsx_runtime.Fragment, { children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)((link_default()), { href: "/login", className: "text-gray-700 font-medium py-1", onClick: ()=>setMenuOpen(false), children: t('nav.login') }), /*#__PURE__*/ (0,jsx_runtime.jsx)((link_default()), { href: "/register", className: "text-green-600 font-medium py-1", onClick: ()=>setMenuOpen(false), children: t('nav.register') }) ] }) ] }) ] }) }), msgToast && /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "fixed bottom-5 right-5 z-[200] max-w-sm w-full", children: /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "bg-white border border-gray-200 rounded-xl shadow-xl p-4 flex items-start gap-3 animate-fade-in", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "text-2xl shrink-0", children: "\uD83D\uDCAC" }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "font-semibold text-gray-900 text-sm", children: t('chat.toast_title') }), /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "text-xs text-gray-500 truncate mt-0.5", children: msgToast.body }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex flex-col items-end gap-2 shrink-0", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { onClick: ()=>setMsgToast(null), className: "text-gray-400 hover:text-gray-600 text-lg leading-none", "aria-label": "close", children: "\xd7" }), /*#__PURE__*/ (0,jsx_runtime.jsx)((link_default()), { href: "/chat?room=".concat(msgToast.roomId), onClick: ()=>setMsgToast(null), className: "text-xs text-green-600 hover:underline font-medium", children: t('chat.toast_open') }) ] }) ] }) }), supportOpen && /*#__PURE__*/ (0,jsx_runtime.jsx)(SupportModal, { onClose: ()=>setSupportOpen(false) }) ] }); } €”{"finalSource":true}ƒmap‹bufferedMap `ConcatSourceRawSource // EXPORTS __webpack_require__.d(__webpack_exports__, { Header: () => (/* binding */ Header) }); // EXTERNAL MODULE: ../../node_modules/next/dist/compiled/react/jsx-runtime.js var jsx_runtime = __webpack_require__(4568); // EXTERNAL MODULE: ../../node_modules/next/dist/client/app-dir/link.js var app_dir_link = __webpack_require__(9664); var link_default = /*#__PURE__*/__webpack_require__.n(app_dir_link); // EXTERNAL MODULE: ../../node_modules/next/dist/api/navigation.js var navigation = __webpack_require__(7541); // EXTERNAL MODULE: ./src/lib/auth.ts var auth = __webpack_require__(1592); // EXTERNAL MODULE: ./src/context/locale.tsx var context_locale = __webpack_require__(9906); // EXTERNAL MODULE: ./src/lib/formatName.ts var formatName = __webpack_require__(1258); // EXTERNAL MODULE: ../../node_modules/next/dist/compiled/react/index.js var react = __webpack_require__(7620); // EXTERNAL MODULE: ./src/lib/translations.ts var translations = __webpack_require__(4962); ;// ./src/components/LanguageSwitcher.tsx  ReplaceSourceReplaceSourceRawSource™/* __next_internal_client_entry_do_not_use__ LanguageSwitcher auto */ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { useState, useRef, useEffect } from 'react'; import { useLocale } from '@/context/locale'; import { LOCALES } from '@/lib/translations'; export function LanguageSwitcher() { const { locale, setLocale } = useLocale(); const [open, setOpen] = useState(false); const ref = useRef(null); var _LOCALES_find; const current = (_LOCALES_find = LOCALES.find((l)=>l.code === locale)) !== null && _LOCALES_find !== void 0 ? _LOCALES_find : LOCALES[0]; // Close on outside click useEffect(()=>{ function handleClick(e) { if (ref.current && !ref.current.contains(e.target)) setOpen(false); } document.addEventListener('mousedown', handleClick); return ()=>document.removeEventListener('mousedown', handleClick); }, []); return /*#__PURE__*/ _jsxs("div", { ref: ref, className: "relative", children: [ /*#__PURE__*/ _jsxs("button", { onClick: ()=>setOpen(!open), className: "flex items-center gap-1.5 px-2.5 py-1.5 rounded-lg border border-gray-200 hover:border-green-400 hover:bg-green-50 transition text-sm font-medium text-gray-700", "aria-label": "Change language", children: [ /*#__PURE__*/ _jsx("span", { children: current.code.toUpperCase() }), /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5 text-gray-400 transition-transform ".concat(open ? 'rotate-180' : ''), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19 9l-7 7-7-7" }) }) ] }), open && /*#__PURE__*/ _jsx("div", { className: "absolute right-0 mt-1 w-40 bg-white border border-gray-200 rounded-xl shadow-lg z-50 overflow-hidden", children: LOCALES.map((loc)=>/*#__PURE__*/ _jsxs("button", { onClick: ()=>{ setLocale(loc.code); setOpen(false); }, className: "w-full flex items-center gap-2.5 px-3.5 py-2.5 text-sm hover:bg-green-50 transition ".concat(locale === loc.code ? 'bg-green-50 text-green-700 font-medium' : 'text-gray-700'), children: [ /*#__PURE__*/ _jsx("span", { children: loc.label }), locale === loc.code && /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5 ml-auto text-green-600", fill: "currentColor", viewBox: "0 0 20 20", children: /*#__PURE__*/ _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" }) }) ] }, loc.code)) }) ] }); } r70132undefined134185undefined187231undefined233277undefined279285undefined350358__WEBPACK_MODULE_REFERENCE__4_5b227573654c6f63616c65225d_call_directImport_asiSafe1__._undefined391398__WEBPACK_MODULE_REFERENCE__6_5b227573655374617465225d_call_directImport_asiSafe1__._undefined424429__WEBPACK_MODULE_REFERENCE__6_5b22757365526566225d_call_directImport_asiSafe1__._undefined498504__WEBPACK_MODULE_REFERENCE__7_5b224c4f43414c4553225d_call_asiSafe1__._undefined591597__WEBPACK_MODULE_REFERENCE__7_5b224c4f43414c4553225d_asiSafe1__._undefined637645__WEBPACK_MODULE_REFERENCE__6_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined950954__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined10601064__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined14241427__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined15581561__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined19111914__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined21972200__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined23682374__WEBPACK_MODULE_REFERENCE__7_5b224c4f43414c4553225d_call_asiSafe1__._undefined24012405__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined28682871__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined30323035__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined32913294__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined‹138224(0,context_locale/* useLocale */.Y)undefined257341(0,react.useState)undefined367447(0,react.useRef)undefined516585translations/* LOCALES */.YZundefined672736translations/* LOCALES */.YZundefined776862(0,react.useEffect)undefined11671243(0,jsx_runtime.jsxs)undefined13491425(0,jsx_runtime.jsxs)undefined17851859(0,jsx_runtime.jsx)undefined19902064(0,jsx_runtime.jsx)undefined24142488(0,jsx_runtime.jsx)undefined27712845(0,jsx_runtime.jsx)undefined30133082translations/* LOCALES */.YZundefined31093185(0,jsx_runtime.jsxs)undefined36483722(0,jsx_runtime.jsx)undefined38833957(0,jsx_runtime.jsx)undefined42134287(0,jsx_runtime.jsx)undefinedRawSourceì // EXTERNAL MODULE: ./src/lib/api.ts var api = __webpack_require__(2982); // EXTERNAL MODULE: ../../node_modules/socket.io-client/build/esm/index.js + 28 modules var esm = __webpack_require__(2838); ;// ./src/hooks/useEffectiveRole.ts úûT/* __next_internal_client_entry_do_not_use__ useEffectiveRole auto */ import { useSession } from '@/lib/auth'; import { useEffect, useState } from 'react'; function readPreviewRole() { if (typeof document === 'undefined') return null; const m = document.cookie.match(/(?:^|;\s*)canhelp_preview_role=([^;]+)/); var _m_; return (_m_ = m === null || m === void 0 ? void 0 : m[1]) !== null && _m_ !== void 0 ? _m_ : null; } /** * Returns the effective role for the current user. * For admins, respects the `canhelp_preview_role` cookie set by AdminRolePreview widget. * Updates reactively when the widget dispatches `canhelp:preview-role`. */ export function useEffectiveRole() { var _session_user; const { data: session } = useSession(); const userRole = session === null || session === void 0 ? void 0 : (_session_user = session.user) === null || _session_user === void 0 ? void 0 : _session_user.role; const isAdmin = userRole === 'admin'; const [previewRole, setPreviewRole] = useState(null); useEffect(()=>{ if (!isAdmin) return; setPreviewRole(readPreviewRole()); const sync = ()=>setPreviewRole(readPreviewRole()); window.addEventListener('canhelp:preview-role', sync); document.addEventListener('visibilitychange', sync); return ()=>{ window.removeEventListener('canhelp:preview-role', sync); document.removeEventListener('visibilitychange', sync); }; }, [ isAdmin ]); if (!userRole) return null; if (isAdmin && previewRole) return previewRole; return userRole; } b70109undefined111154undefined659665undefined749758__WEBPACK_MODULE_REFERENCE__3_5b2275736553657373696f6e225d_call_directImport_asiSafe1__._undefined10171024__WEBPACK_MODULE_REFERENCE__6_5b227573655374617465225d_call_directImport_asiSafe1__._undefined10371045__WEBPACK_MODULE_REFERENCE__6_5b22757365456666656374225d_call_directImport_asiSafe1__._undefinedz658746(0,auth/* useSession */.wV)undefined10051089(0,react.useState)undefined11021188(0,react.useEffect)undefinedRawSource’ // EXTERNAL MODULE: ../../node_modules/next/dist/api/app-dynamic.js var app_dynamic = __webpack_require__(6442); ;// ./src/components/Header.tsx ö÷7/* __next_internal_client_entry_do_not_use__ Header auto */ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime"; import Link from 'next/link'; import { useRouter, usePathname } from 'next/navigation'; import { useSession, signOut } from '@/lib/auth'; import { useLocale } from '@/context/locale'; import { formatShortName } from '@/lib/formatName'; import { LanguageSwitcher } from './LanguageSwitcher'; import { useState, useRef, useEffect } from 'react'; import { getUnreadCount, getMyDashboard } from '@/lib/api'; import { io } from 'socket.io-client'; import { useEffectiveRole } from '@/hooks/useEffectiveRole'; import dynamic from 'next/dynamic'; const SupportModal = dynamic(()=>import('./SupportModal'), { loadableGenerated: { webpack: ()=>[ require.resolveWeak("./SupportModal") ] }, ssr: false }); const API_URL = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; export function Header() { var _session_user; const router = useRouter(); const pathname = usePathname(); const { data: session } = useSession(); const { t, locale } = useLocale(); const [menuOpen, setMenuOpen] = useState(false); const [profileOpen, setProfileOpen] = useState(false); const [supportOpen, setSupportOpen] = useState(false); const [unreadNotif, setUnreadNotif] = useState(0); const [unreadChat, setUnreadChat] = useState(0); const [msgToast, setMsgToast] = useState(null); const [planTier, setPlanTier] = useState(null); const profileRef = useRef(null); const headerRef = useRef(null); const toastTimer = useRef(null); const pathnameRef = useRef(pathname); useEffect(()=>{ pathnameRef.current = pathname; }, [ pathname ]); // Close dropdowns on outside click useEffect(()=>{ function handleClick(e) { if (profileRef.current && !profileRef.current.contains(e.target)) { setProfileOpen(false); } } document.addEventListener('mousedown', handleClick); return ()=>document.removeEventListener('mousedown', handleClick); }, []); const isAdmin = (session === null || session === void 0 ? void 0 : (_session_user = session.user) === null || _session_user === void 0 ? void 0 : _session_user.role) === 'admin'; const effectiveRole = useEffectiveRole(); const isSpecialist = effectiveRole === 'specialist'; const isActive = function(href) { let exact = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false; return exact ? pathname === href : pathname === href || pathname.startsWith(href + '/'); }; const navCls = function(href) { let exact = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false; return "font-medium text-sm transition ".concat(isActive(href, exact) ? 'text-green-600' : 'text-gray-600 hover:text-green-600'); }; const mobileNavCls = function(href) { let exact = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false; return "flex items-center gap-2 font-medium py-1 ".concat(isActive(href, exact) ? 'text-green-600' : 'text-gray-700'); }; // Reset chat badge when entering chat useEffect(()=>{ if (pathname === '/chat') setUnreadChat(0); }, [ pathname ]); useEffect(()=>{ if (!session) return; const socket = io(API_URL, { withCredentials: true, transports: [ 'websocket', 'polling' ] }); socket.on('new_message', (msg)=>{ if (pathnameRef.current === '/chat') return; setUnreadChat((c)=>c + 1); if (toastTimer.current) clearTimeout(toastTimer.current); setMsgToast(msg); toastTimer.current = setTimeout(()=>setMsgToast(null), 5000); }); return ()=>{ socket.disconnect(); if (toastTimer.current) clearTimeout(toastTimer.current); }; }, [ session ]); useEffect(()=>{ if (!session) { setUnreadNotif(0); return; } const fetch = ()=>getUnreadCount().then((r)=>setUnreadNotif(r.count)).catch(()=>{}); fetch(); const timer = setInterval(fetch, 30000); return ()=>clearInterval(timer); }, [ session ]); useEffect(()=>{ if (!session) { setPlanTier(null); return; } getMyDashboard().then((d)=>{ var _d_plan; var _d_plan_tier; return setPlanTier((_d_plan_tier = (_d_plan = d.plan) === null || _d_plan === void 0 ? void 0 : _d_plan.tier) !== null && _d_plan_tier !== void 0 ? _d_plan_tier : null); }).catch(()=>{}); }, [ session ]); useEffect(()=>{ const onScroll = ()=>{ if (!headerRef.current) return; if (window.scrollY > 40) { headerRef.current.classList.add('header-shrink'); } else { headerRef.current.classList.remove('header-shrink'); } }; window.addEventListener('scroll', onScroll); return ()=>window.removeEventListener('scroll', onScroll); }, []); return /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx("header", { ref: headerRef, className: "header-base bg-white border-b border-gray-200 sticky top-0 z-50 transition-all duration-300", children: /*#__PURE__*/ _jsxs("div", { className: "max-w-7xl mx-auto px-4 sm:px-6 lg:px-8", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between h-16 header-content transition-all duration-300", children: [ /*#__PURE__*/ _jsxs(Link, { href: "/", className: "flex items-center gap-2 shrink-0", children: [ /*#__PURE__*/ _jsx("img", { src: "/logo.png", alt: "CanHelp", className: "w-8 h-8 object-contain" }), /*#__PURE__*/ _jsx("span", { className: "logo-text text-2xl font-bold text-green-600 transition-all duration-300", children: "CanHelp" }) ] }), /*#__PURE__*/ _jsxs("nav", { className: "hidden md:flex items-center gap-5 ml-auto", children: [ isSpecialist ? /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx(Link, { href: "/tasks", className: navCls('/tasks'), children: t('nav.find_tasks') }), /*#__PURE__*/ _jsx(Link, { href: "/dashboard", className: navCls('/dashboard'), children: t('nav.dashboard') }) ] }) : /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx(Link, { href: "/tasks/new", className: navCls('/tasks/new', true), children: t('dashboard.new_task') }), " ", /*#__PURE__*/ _jsx(Link, { href: "/tasks", className: navCls('/tasks'), children: t('nav.tasks') }), " ", /*#__PURE__*/ _jsx(Link, { href: "/specialists", className: navCls('/specialists'), children: t('nav.specialists') }) ] }), /*#__PURE__*/ _jsx(Link, { href: "/pricing", className: navCls('/pricing', true), children: t('nav.pricing', 'Pricing') }), session ? /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs(Link, { href: "/notifications", className: "relative text-gray-600 hover:text-gray-900 flex items-center", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5 ".concat(unreadNotif > 0 ? 'text-green-600' : ''), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M14.857 17.082a23.848 23.848 0 005.454-1.31A8.967 8.967 0 0118 9.75v-.7V9A6 6 0 006 9v.75a8.967 8.967 0 01-2.312 6.022c1.733.64 3.56 1.085 5.455 1.31m5.714 0a24.255 24.255 0 01-5.714 0m5.714 0a3 3 0 11-5.714 0" }) }), unreadNotif > 0 && /*#__PURE__*/ _jsx("span", { className: "absolute -top-1.5 -right-1.5 min-w-[16px] h-4 px-0.5 bg-red-500 text-white text-[10px] font-bold rounded-full flex items-center justify-center leading-none", children: unreadNotif > 99 ? '99+' : unreadNotif }) ] }), /*#__PURE__*/ _jsxs(Link, { href: "/chat", className: "relative text-gray-600 hover:text-gray-900 flex items-center", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5 ".concat(unreadChat > 0 ? 'text-green-500' : ''), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }), unreadChat > 0 && /*#__PURE__*/ _jsx("span", { className: "absolute -top-1.5 -right-1.5 min-w-[16px] h-4 px-0.5 bg-green-500 text-white text-[10px] font-bold rounded-full flex items-center justify-center leading-none", children: unreadChat > 99 ? '99+' : unreadChat }) ] }), /*#__PURE__*/ _jsxs("div", { className: "relative", ref: profileRef, children: [ /*#__PURE__*/ _jsxs("button", { onClick: ()=>setProfileOpen(!profileOpen), className: "flex items-center gap-1.5 text-sm font-medium text-gray-600 hover:text-green-600", children: [ /*#__PURE__*/ _jsx("span", { className: "truncate max-w-[100px]", children: formatShortName(session.user.firstName, session.user.lastName, session.user.name) }), planTier === 'pro' && /*#__PURE__*/ _jsx("span", { className: "inline-flex items-center px-1.5 py-0.5 rounded-full text-[10px] font-bold bg-green-100 text-green-700 leading-none", children: "Pro" }), planTier === 'ultimate' && /*#__PURE__*/ _jsx("span", { className: "inline-flex items-center px-1.5 py-0.5 rounded-full text-[10px] font-bold bg-gradient-to-r from-amber-400 via-yellow-400 to-amber-400 text-gray-900 shadow-sm shadow-amber-300/50 leading-none", children: "★" }), /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19 9l-7 7-7-7" }) }) ] }), profileOpen && /*#__PURE__*/ _jsxs("div", { className: "absolute right-0 mt-2 w-52 bg-white border border-gray-200 rounded-xl shadow-lg py-1 z-50", children: [ isSpecialist ? /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs(Link, { href: "/tasks/new", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 4v16m8-8H4" }) }), t('nav.new_task') ] }), /*#__PURE__*/ _jsxs(Link, { href: "/specialists", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _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" }) }), t('nav.specialists') ] }) ] }) : /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs(Link, { href: "/notifications", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0 ".concat(unreadNotif > 0 ? 'text-green-600' : 'text-gray-400'), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M14.857 17.082a23.848 23.848 0 005.454-1.31A8.967 8.967 0 0118 9.75v-.7V9A6 6 0 006 9v.75a8.967 8.967 0 01-2.312 6.022c1.733.64 3.56 1.085 5.455 1.31m5.714 0a24.255 24.255 0 01-5.714 0m5.714 0a3 3 0 11-5.714 0" }) }), /*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-1.5", children: [ t('nav.notifications'), unreadNotif > 0 && /*#__PURE__*/ _jsx("span", { className: "px-1.5 py-0.5 bg-red-500 text-white text-[10px] font-bold rounded-full leading-none", children: unreadNotif > 99 ? '99+' : unreadNotif }) ] }) ] }), /*#__PURE__*/ _jsxs(Link, { href: "/chat", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0 ".concat(unreadChat > 0 ? 'text-green-500' : 'text-gray-400'), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }), /*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-1.5", children: [ t('nav.chat'), unreadChat > 0 && /*#__PURE__*/ _jsx("span", { className: "px-1.5 py-0.5 bg-green-500 text-white text-[10px] font-bold rounded-full leading-none", children: unreadChat > 99 ? '99+' : unreadChat }) ] }) ] }), /*#__PURE__*/ _jsxs(Link, { href: "/dashboard", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6" }) }), t('nav.dashboard') ] }) ] }), (isSpecialist || isAdmin) && /*#__PURE__*/ _jsxs(Link, { href: "/schedule", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _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" }) }), t('nav.schedule') ] }), isAdmin && /*#__PURE__*/ _jsxs(Link, { href: "/admin", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ _jsxs("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: [ /*#__PURE__*/ _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" }), /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 12a3 3 0 11-6 0 3 3 0 016 0z" }) ] }), t('nav.admin') ] }), /*#__PURE__*/ _jsxs(Link, { href: "/profile", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _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" }) }), t('nav.profile') ] }), /*#__PURE__*/ _jsxs(Link, { href: "/favorites", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4.318 6.318a4.5 4.5 0 000 6.364L12 20.364l7.682-7.682a4.5 4.5 0 00-6.364-6.364L12 7.636l-1.318-1.318a4.5 4.5 0 00-6.364 0z" }) }), t('nav.favorites') ] }), /*#__PURE__*/ _jsx("hr", { className: "my-1 border-gray-100" }), /*#__PURE__*/ _jsxs("button", { className: "w-full flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-green-50", onClick: ()=>{ setProfileOpen(false); setSupportOpen(true); }, children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _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" }) }), t('support.title') ] }), /*#__PURE__*/ _jsx("hr", { className: "my-1 border-gray-100" }), /*#__PURE__*/ _jsxs("button", { className: "w-full flex items-center gap-2.5 px-4 py-2 text-sm text-red-500 hover:bg-red-50", onClick: ()=>{ setProfileOpen(false); signOut().then(()=>{ window.location.href = '/'; }); }, children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M17 16l4-4m0 0l-4-4m4 4H7m6 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h4a3 3 0 013 3v1" }) }), t('nav.logout') ] }) ] }) ] }) ] }) : /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx(Link, { href: "/login", className: "text-gray-600 hover:text-green-600 font-medium text-sm", children: t('nav.login') }), /*#__PURE__*/ _jsx(Link, { href: "/register", className: "bg-green-600 text-white px-4 py-2 rounded-lg hover:bg-green-700 font-medium text-sm", children: t('nav.register') }) ] }), /*#__PURE__*/ _jsx(LanguageSwitcher, {}) ] }), /*#__PURE__*/ _jsxs("div", { className: "md:hidden flex items-center gap-2", children: [ /*#__PURE__*/ _jsx(LanguageSwitcher, {}), /*#__PURE__*/ _jsx("button", { className: "p-2", onClick: ()=>setMenuOpen(!menuOpen), "aria-label": "Toggle menu", children: /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5 text-gray-600", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: menuOpen ? /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" }) : /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4 6h16M4 12h16M4 18h16" }) }) }) ] }) ] }), menuOpen && /*#__PURE__*/ _jsxs("div", { className: "md:hidden py-4 border-t border-gray-100 flex flex-col gap-3", children: [ isSpecialist ? /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs(Link, { href: "/tasks", className: mobileNavCls('/tasks'), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z" }) }), t('nav.find_tasks') ] }), /*#__PURE__*/ _jsxs(Link, { href: "/dashboard", className: mobileNavCls('/dashboard'), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6" }) }), t('nav.dashboard') ] }) ] }) : /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs(Link, { href: "/tasks/new", className: mobileNavCls('/tasks/new', true), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 4v16m8-8H4" }) }), t('nav.new_task') ] }), /*#__PURE__*/ _jsxs(Link, { href: "/tasks", className: mobileNavCls('/tasks'), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _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" }) }), t('nav.tasks') ] }), /*#__PURE__*/ _jsxs(Link, { href: "/specialists", className: mobileNavCls('/specialists'), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _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" }) }), t('nav.specialists') ] }) ] }), session ? /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs(Link, { href: "/chat", className: mobileNavCls('/chat', true), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0 ".concat(unreadChat > 0 ? 'text-green-500' : ''), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }), t('nav.chat'), unreadChat > 0 && /*#__PURE__*/ _jsx("span", { className: "ml-1 px-1.5 py-0.5 bg-green-500 text-white text-[10px] font-bold rounded-full", children: unreadChat }) ] }), isSpecialist ? /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs(Link, { href: "/tasks/new", className: mobileNavCls('/tasks/new', true), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 4v16m8-8H4" }) }), t('nav.new_task') ] }), /*#__PURE__*/ _jsxs(Link, { href: "/specialists", className: mobileNavCls('/specialists'), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _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" }) }), t('nav.specialists') ] }) ] }) : /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs(Link, { href: "/notifications", className: mobileNavCls('/notifications', true), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0 ".concat(unreadNotif > 0 ? 'text-green-600' : ''), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M14.857 17.082a23.848 23.848 0 005.454-1.31A8.967 8.967 0 0118 9.75v-.7V9A6 6 0 006 9v.75a8.967 8.967 0 01-2.312 6.022c1.733.64 3.56 1.085 5.455 1.31m5.714 0a24.255 24.255 0 01-5.714 0m5.714 0a3 3 0 11-5.714 0" }) }), /*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-1.5", children: [ t('nav.notifications'), unreadNotif > 0 && /*#__PURE__*/ _jsx("span", { className: "px-1.5 py-0.5 bg-red-500 text-white text-[10px] font-bold rounded-full", children: unreadNotif > 99 ? '99+' : unreadNotif }) ] }) ] }), /*#__PURE__*/ _jsxs(Link, { href: "/dashboard", className: mobileNavCls('/dashboard'), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6" }) }), t('nav.dashboard') ] }) ] }), /*#__PURE__*/ _jsxs(Link, { href: "/favorites", className: mobileNavCls('/favorites', true), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4.318 6.318a4.5 4.5 0 000 6.364L12 20.364l7.682-7.682a4.5 4.5 0 00-6.364-6.364L12 7.636l-1.318-1.318a4.5 4.5 0 00-6.364 0z" }) }), t('nav.favorites') ] }), (isSpecialist || isAdmin) && /*#__PURE__*/ _jsxs(Link, { href: "/schedule", className: mobileNavCls('/schedule', true), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-gray-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _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" }) }), t('nav.schedule') ] }), isAdmin && /*#__PURE__*/ _jsxs(Link, { href: "/admin", className: mobileNavCls('/admin'), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ _jsxs("svg", { className: "w-4 h-4 text-gray-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: [ /*#__PURE__*/ _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" }), /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 12a3 3 0 11-6 0 3 3 0 016 0z" }) ] }), t('nav.admin') ] }), /*#__PURE__*/ _jsxs(Link, { href: "/profile", className: mobileNavCls('/profile', true), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-gray-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _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" }) }), t('nav.profile') ] }), /*#__PURE__*/ _jsxs("button", { onClick: ()=>{ setMenuOpen(false); signOut().then(()=>{ window.location.href = '/'; }); }, className: "flex items-center gap-2 text-left text-red-500 py-1 font-medium", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M17 16l4-4m0 0l-4-4m4 4H7m6 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h4a3 3 0 013 3v1" }) }), t('nav.logout') ] }) ] }) : /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx(Link, { href: "/login", className: "text-gray-700 font-medium py-1", onClick: ()=>setMenuOpen(false), children: t('nav.login') }), /*#__PURE__*/ _jsx(Link, { href: "/register", className: "text-green-600 font-medium py-1", onClick: ()=>setMenuOpen(false), children: t('nav.register') }) ] }) ] }) ] }) }), msgToast && /*#__PURE__*/ _jsx("div", { className: "fixed bottom-5 right-5 z-[200] max-w-sm w-full", children: /*#__PURE__*/ _jsxs("div", { className: "bg-white border border-gray-200 rounded-xl shadow-xl p-4 flex items-start gap-3 animate-fade-in", children: [ /*#__PURE__*/ _jsx("span", { className: "text-2xl shrink-0", children: "\uD83D\uDCAC" }), /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ _jsx("p", { className: "font-semibold text-gray-900 text-sm", children: t('chat.toast_title') }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-500 truncate mt-0.5", children: msgToast.body }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex flex-col items-end gap-2 shrink-0", children: [ /*#__PURE__*/ _jsx("button", { onClick: ()=>setMsgToast(null), className: "text-gray-400 hover:text-gray-600 text-lg leading-none", "aria-label": "close", children: "\xd7" }), /*#__PURE__*/ _jsx(Link, { href: "/chat?room=".concat(msgToast.roomId), onClick: ()=>setMsgToast(null), className: "text-xs text-green-600 hover:underline font-medium", children: t('chat.toast_open') }) ] }) ] }) }), supportOpen && /*#__PURE__*/ _jsx(SupportModal, { onClose: ()=>setSupportOpen(false) }) ] }); } (Z60145undefined147175undefined177233undefined235283undefined285329undefined331381undefined383436undefined438489undefined491549undefined551588undefined590649undefined651685undefined708714__WEBPACK_MODULE_REFERENCE__12_5b2264656661756c74225d_call_directImport_asiSafe1__._undefined720743__webpack_require__.e(/* import() */ 6467).then(__webpack_require__.bind(__webpack_require__, 6467))undefined812830/*require.resolve*/undefined8328476467undefined906936"https://api.canhelp.gr"undefined9419630undefined966972undefined10351043__WEBPACK_MODULE_REFERENCE__2_5b22757365526f75746572225d_call_directImport_asiSafe1__._undefined10691079__WEBPACK_MODULE_REFERENCE__2_5b22757365506174686e616d65225d_call_directImport_asiSafe1__._undefined11141123__WEBPACK_MODULE_REFERENCE__3_5b2275736553657373696f6e225d_call_directImport_asiSafe1__._undefined11541162__WEBPACK_MODULE_REFERENCE__4_5b227573654c6f63616c65225d_call_directImport_asiSafe1__._undefined12031210__WEBPACK_MODULE_REFERENCE__6_5b227573655374617465225d_call_directImport_asiSafe1__._undefined12621269__WEBPACK_MODULE_REFERENCE__6_5b227573655374617465225d_call_directImport_asiSafe1__._undefined13211328__WEBPACK_MODULE_REFERENCE__6_5b227573655374617465225d_call_directImport_asiSafe1__._undefined13801387__WEBPACK_MODULE_REFERENCE__6_5b227573655374617465225d_call_directImport_asiSafe1__._undefined14331440__WEBPACK_MODULE_REFERENCE__6_5b227573655374617465225d_call_directImport_asiSafe1__._undefined14821489__WEBPACK_MODULE_REFERENCE__6_5b227573655374617465225d_call_directImport_asiSafe1__._undefined15341541__WEBPACK_MODULE_REFERENCE__6_5b227573655374617465225d_call_directImport_asiSafe1__._undefined15731578__WEBPACK_MODULE_REFERENCE__6_5b22757365526566225d_call_directImport_asiSafe1__._undefined16091614__WEBPACK_MODULE_REFERENCE__6_5b22757365526566225d_call_directImport_asiSafe1__._undefined16461651__WEBPACK_MODULE_REFERENCE__6_5b22757365526566225d_call_directImport_asiSafe1__._undefined16841689__WEBPACK_MODULE_REFERENCE__6_5b22757365526566225d_call_directImport_asiSafe1__._undefined17061714__WEBPACK_MODULE_REFERENCE__6_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined18401848__WEBPACK_MODULE_REFERENCE__6_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined23902405__WEBPACK_MODULE_REFERENCE__11_5b22757365456666656374697665526f6c65225d_call_directImport_asiSafe1__._undefined32893297__WEBPACK_MODULE_REFERENCE__6_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined33953403__WEBPACK_MODULE_REFERENCE__6_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined34643465__WEBPACK_MODULE_REFERENCE__10_5b22696f225d_call_directImport_asiSafe1__._undefined41164124__WEBPACK_MODULE_REFERENCE__6_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined42434256__WEBPACK_MODULE_REFERENCE__9_5b22676574556e72656164436f756e74225d_call_directImport_asiSafe1__._undefined44544462__WEBPACK_MODULE_REFERENCE__6_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined45634576__WEBPACK_MODULE_REFERENCE__9_5b226765744d7944617368626f617264225d_call_directImport_asiSafe1__._undefined48924900__WEBPACK_MODULE_REFERENCE__6_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined53605364__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined53665374__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined54255428__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined56365640__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined57945798__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined60196023__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined60256028__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined62656268__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined65796582__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined69516955__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined71757179__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined71817189__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined73127315__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined73177320__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined76707673__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined76757678__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined80778081__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined80838091__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined82148217__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined82198222__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined86588661__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined86638666__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined90799082__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined90849087__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined95319534__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined95369539__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined98779881__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined98839891__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined1001410018__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1002010023__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined1036510368__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1091210915__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1159511598__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1217612180__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1218212185__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined1251812521__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1306413067__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1369413697__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1427514279__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1456814572__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1499414997__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1519215206__WEBPACK_MODULE_REFERENCE__5_5b22666f726d617453686f72744e616d65225d_call_directImport_asiSafe1__._undefined1544215445__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1591115914__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1642716430__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1698016983__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1762517629__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1796917973__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1797517983__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined1815418158__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1816018163__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined1872318726__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1938819391__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2024520249__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2025120254__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined2081620819__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2148121484__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2259422598__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2260022608__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined2277922783__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2278522788__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined2335223355__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2406524068__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2487324877__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2534225345__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2618826192__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2619426197__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined2675226755__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2746427467__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2822028224__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2867928682__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2952529529__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2953129534__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined3009430097__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3075930762__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3190531909__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3191131914__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined3243332436__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3305033053__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3391833922__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3392433927__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined3444334447__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3514335146__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3612636129__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3702037024__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3702637029__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined3754737550__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3816438167__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3900139005__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3900739010__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined3953039533__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4014740150__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4104241045__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4130341307__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4199541998__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4261242615__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4354443547__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4380543809__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4423544241__WEBPACK_MODULE_REFERENCE__3_5b227369676e4f7574225d_call_directImport_asiSafe1__._undefined4467344676__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4527645279__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4638646390__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4639246400__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined4652346526__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4652846531__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined4691646919__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4692146924__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined4742547428__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4743047445__WEBPACK_MODULE_REFERENCE__8_5b224c616e67756167655377697463686572225d_directImport_asiSafe1__._undefined4757247576__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4777347776__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4777847793__WEBPACK_MODULE_REFERENCE__8_5b224c616e67756167655377697463686572225d_directImport_asiSafe1__._undefined4785547858__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4815648159__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4860548608__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4891848921__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4948949493__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4970749711__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4971349721__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined4982849832__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4983449837__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined5017650179__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5063550638__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5123551239__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5124151244__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined5159151594__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5205052053__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5278452788__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5279052798__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined5290552909__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5291152914__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined5326753270__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5372653729__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5429554299__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5430154304__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined5464354646__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5510255105__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5578155785__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5578755790__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined5614156144__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5660056603__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5743457438__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5744057448__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined5755557559__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5756157564__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined5790757910__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5841458417__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5905959062__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5950159505__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5950759515__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined5963859642__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5964459647__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined6004060043__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6054760550__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6118861192__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined6119461197__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined6158861591__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6209562098__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6296862972__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined6297462982__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined6310563109__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined6311163114__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined6351563518__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6407164074__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6473564739__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined6510865111__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6574965753__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined6575565758__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined6614566148__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6665266655__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6750567509__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined6751167514__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined6786767870__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6832668329__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6903469038__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined6904069043__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined6939469397__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6985869861__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7051070514__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined7051670519__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined7085870862__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined7138171384__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7224472247__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7289872902__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined7290472907__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined7325673259__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7372073723__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7434174345__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined7453474540__WEBPACK_MODULE_REFERENCE__3_5b227369676e4f7574225d_call_directImport_asiSafe1__._undefined7497474977__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7542475427__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7610076104__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined7610676114__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined7622176224__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7622676229__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined7662776630__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7663276635__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined7721077213__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7734177345__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined7755677559__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7775077754__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined7790877911__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7815678159__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7844778451__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined7862978632__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7901379016__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7901879021__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined7953379536__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined”"93176(0,app_dynamic["default"])undefined525611(0,navigation.useRouter)undefined637727(0,navigation.usePathname)undefined762850(0,auth/* useSession */.wV)undefined881967(0,context_locale/* useLocale */.Y)undefined10081092(0,react.useState)undefined11441228(0,react.useState)undefined12801364(0,react.useState)undefined14161500(0,react.useState)undefined15461630(0,react.useState)undefined16721756(0,react.useState)undefined18011885(0,react.useState)undefined19171997(0,react.useRef)undefined20282108(0,react.useRef)undefined21402220(0,react.useRef)undefined22532333(0,react.useRef)undefined23502436(0,react.useEffect)undefined25622648(0,react.useEffect)undefined31903291useEffectiveRoleundefined41754261(0,react.useEffect)undefined43594445(0,react.useEffect)undefined45064579(0,esm.io)undefined52305316(0,react.useEffect)undefined54355531(0,api/* getUnreadCount */.$M)undefined57295815(0,react.useEffect)undefined59166012(0,api/* getMyDashboard */.H)undefined63286414(0,react.useEffect)undefined68746950(0,jsx_runtime.jsxs)undefined69527031jsx_runtime.Fragmentundefined70827156(0,jsx_runtime.jsx)undefined73647440(0,jsx_runtime.jsxs)undefined75947670(0,jsx_runtime.jsxs)undefined78917967(0,jsx_runtime.jsxs)undefined79698046(link_default())undefined82838357(0,jsx_runtime.jsx)undefined86688742(0,jsx_runtime.jsx)undefined91119187(0,jsx_runtime.jsxs)undefined94079483(0,jsx_runtime.jsxs)undefined94859564jsx_runtime.Fragmentundefined96879761(0,jsx_runtime.jsx)undefined97639840(link_default())undefined1019010264(0,jsx_runtime.jsx)undefined1026610343(link_default())undefined1074210818(0,jsx_runtime.jsxs)undefined1082010899jsx_runtime.Fragmentundefined1102211096(0,jsx_runtime.jsx)undefined1109811175(link_default())undefined1161111685(0,jsx_runtime.jsx)undefined1168711764(link_default())undefined1217712251(0,jsx_runtime.jsx)undefined1225312330(link_default())undefined1277412848(0,jsx_runtime.jsx)undefined1285012927(link_default())undefined1326513341(0,jsx_runtime.jsxs)undefined1334313422jsx_runtime.Fragmentundefined1354513621(0,jsx_runtime.jsxs)undefined1362313700(link_default())undefined1404214116(0,jsx_runtime.jsx)undefined1466014734(0,jsx_runtime.jsx)undefined1541415488(0,jsx_runtime.jsx)undefined1606616142(0,jsx_runtime.jsxs)undefined1614416221(link_default())undefined1655416628(0,jsx_runtime.jsx)undefined1717117245(0,jsx_runtime.jsx)undefined1787217946(0,jsx_runtime.jsx)undefined1852418600(0,jsx_runtime.jsxs)undefined1888918965(0,jsx_runtime.jsxs)undefined1938719461(0,jsx_runtime.jsx)undefined1965619754(0,formatName/* formatShortName */.H)undefined1999020064(0,jsx_runtime.jsx)undefined2053020604(0,jsx_runtime.jsx)undefined2111721191(0,jsx_runtime.jsx)undefined2174121815(0,jsx_runtime.jsx)undefined2245722533(0,jsx_runtime.jsxs)undefined2287322949(0,jsx_runtime.jsxs)undefined2295123030jsx_runtime.Fragmentundefined2320123277(0,jsx_runtime.jsxs)undefined2327923356(link_default())undefined2391623990(0,jsx_runtime.jsx)undefined2465224726(0,jsx_runtime.jsx)undefined2558025656(0,jsx_runtime.jsxs)undefined2565825735(link_default())undefined2629726371(0,jsx_runtime.jsx)undefined2703327107(0,jsx_runtime.jsx)undefined2821728293(0,jsx_runtime.jsxs)undefined2829528374jsx_runtime.Fragmentundefined2854528621(0,jsx_runtime.jsxs)undefined2862328700(link_default())undefined2926429338(0,jsx_runtime.jsx)undefined3004830122(0,jsx_runtime.jsx)undefined3092731003(0,jsx_runtime.jsxs)undefined3146831542(0,jsx_runtime.jsx)undefined3238532461(0,jsx_runtime.jsxs)undefined3246332540(link_default())undefined3309533169(0,jsx_runtime.jsx)undefined3387833952(0,jsx_runtime.jsx)undefined3470534781(0,jsx_runtime.jsxs)undefined3523635310(0,jsx_runtime.jsx)undefined3615336229(0,jsx_runtime.jsxs)undefined3623136308(link_default())undefined3686836942(0,jsx_runtime.jsx)undefined3760437678(0,jsx_runtime.jsx)undefined3882138897(0,jsx_runtime.jsxs)undefined3889938976(link_default())undefined3949539569(0,jsx_runtime.jsx)undefined4018340257(0,jsx_runtime.jsx)undefined4112241198(0,jsx_runtime.jsxs)undefined4120041277(link_default())undefined4179341869(0,jsx_runtime.jsxs)undefined4256542639(0,jsx_runtime.jsx)undefined4361943693(0,jsx_runtime.jsx)undefined4458444660(0,jsx_runtime.jsxs)undefined4466244739(link_default())undefined4525745331(0,jsx_runtime.jsx)undefined4594546019(0,jsx_runtime.jsx)undefined4685346929(0,jsx_runtime.jsxs)undefined4693147008(link_default())undefined4752847602(0,jsx_runtime.jsx)undefined4821648290(0,jsx_runtime.jsx)undefined4918249256(0,jsx_runtime.jsx)undefined4951449590(0,jsx_runtime.jsxs)undefined5027850352(0,jsx_runtime.jsx)undefined5096651040(0,jsx_runtime.jsx)undefined5196952043(0,jsx_runtime.jsx)undefined5230152377(0,jsx_runtime.jsxs)undefined5280352885(0,auth/* signOut */.CI)undefined5331753391(0,jsx_runtime.jsx)undefined5399154065(0,jsx_runtime.jsx)undefined5517255248(0,jsx_runtime.jsxs)undefined5525055329jsx_runtime.Fragmentundefined5545255526(0,jsx_runtime.jsx)undefined5552855605(link_default())undefined5599056064(0,jsx_runtime.jsx)undefined5606656143(link_default())undefined5664456718(0,jsx_runtime.jsx)undefined5672056815LanguageSwitcherundefined5694257018(0,jsx_runtime.jsxs)undefined5721557289(0,jsx_runtime.jsx)undefined5729157386LanguageSwitcherundefined5744857522(0,jsx_runtime.jsx)undefined5782057894(0,jsx_runtime.jsx)undefined5834058414(0,jsx_runtime.jsx)undefined5872458798(0,jsx_runtime.jsx)undefined5936659442(0,jsx_runtime.jsxs)undefined5965659732(0,jsx_runtime.jsxs)undefined5973459813jsx_runtime.Fragmentundefined5992059996(0,jsx_runtime.jsxs)undefined5999860075(link_default())undefined6041460488(0,jsx_runtime.jsx)undefined6094461018(0,jsx_runtime.jsx)undefined6161561691(0,jsx_runtime.jsxs)undefined6169361770(link_default())undefined6211762191(0,jsx_runtime.jsx)undefined6264762721(0,jsx_runtime.jsx)undefined6345263528(0,jsx_runtime.jsxs)undefined6353063609jsx_runtime.Fragmentundefined6371663792(0,jsx_runtime.jsxs)undefined6379463871(link_default())undefined6422464298(0,jsx_runtime.jsx)undefined6475464828(0,jsx_runtime.jsx)undefined6539465470(0,jsx_runtime.jsxs)undefined6547265549(link_default())undefined6588865962(0,jsx_runtime.jsx)undefined6641866492(0,jsx_runtime.jsx)undefined6716867244(0,jsx_runtime.jsxs)undefined6724667323(link_default())undefined6767467748(0,jsx_runtime.jsx)undefined6820468278(0,jsx_runtime.jsx)undefined6910969185(0,jsx_runtime.jsxs)undefined6918769266jsx_runtime.Fragmentundefined6937369449(0,jsx_runtime.jsxs)undefined6945169528(link_default())undefined6987169945(0,jsx_runtime.jsx)undefined7044970523(0,jsx_runtime.jsx)undefined7116571239(0,jsx_runtime.jsx)undefined7167871754(0,jsx_runtime.jsxs)undefined7175671835jsx_runtime.Fragmentundefined7195872034(0,jsx_runtime.jsxs)undefined7203672113(link_default())undefined7250672580(0,jsx_runtime.jsx)undefined7308473158(0,jsx_runtime.jsx)undefined7379673872(0,jsx_runtime.jsxs)undefined7387473951(link_default())undefined7434274416(0,jsx_runtime.jsx)undefined7492074994(0,jsx_runtime.jsx)undefined7586475940(0,jsx_runtime.jsxs)undefined7594276021jsx_runtime.Fragmentundefined7614476220(0,jsx_runtime.jsxs)undefined7622276299(link_default())undefined7670076774(0,jsx_runtime.jsx)undefined7732777401(0,jsx_runtime.jsx)undefined7806278138(0,jsx_runtime.jsxs)undefined7850778581(0,jsx_runtime.jsx)undefined7921979295(0,jsx_runtime.jsxs)undefined7929779374(link_default())undefined7976179835(0,jsx_runtime.jsx)undefined8033980413(0,jsx_runtime.jsx)undefined8126381339(0,jsx_runtime.jsxs)undefined8134181418(link_default())undefined8177181845(0,jsx_runtime.jsx)undefined8230182375(0,jsx_runtime.jsx)undefined8308083156(0,jsx_runtime.jsxs)undefined8315883235(link_default())undefined8358683660(0,jsx_runtime.jsx)undefined8412184195(0,jsx_runtime.jsx)undefined8484484920(0,jsx_runtime.jsxs)undefined8492284999(link_default())undefined8533885414(0,jsx_runtime.jsxs)undefined8593386007(0,jsx_runtime.jsx)undefined8686786941(0,jsx_runtime.jsx)undefined8759287668(0,jsx_runtime.jsxs)undefined8767087747(link_default())undefined8809688170(0,jsx_runtime.jsx)undefined8863188705(0,jsx_runtime.jsx)undefined8932389399(0,jsx_runtime.jsxs)undefined8958889670(0,auth/* signOut */.CI)undefined9010490178(0,jsx_runtime.jsx)undefined9062590699(0,jsx_runtime.jsx)undefined9137291448(0,jsx_runtime.jsxs)undefined9145091529jsx_runtime.Fragmentundefined9163691710(0,jsx_runtime.jsx)undefined9171291789(link_default())undefined9218792261(0,jsx_runtime.jsx)undefined9226392340(link_default())undefined9291592989(0,jsx_runtime.jsx)undefined9311793193(0,jsx_runtime.jsxs)undefined9340493478(0,jsx_runtime.jsx)undefined9366993745(0,jsx_runtime.jsxs)undefined9389993973(0,jsx_runtime.jsx)undefined9421894292(0,jsx_runtime.jsx)undefined9458094656(0,jsx_runtime.jsxs)undefined9483494908(0,jsx_runtime.jsx)undefined9528995363(0,jsx_runtime.jsx)undefined9536595442(link_default())undefined9595496028(0,jsx_runtime.jsx)undefined /***/ }) UÿÿÿY\/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; // EXPORTS __webpack_require__.d(__webpack_exports__, { Header: () => (/* binding */ Header) }); // EXTERNAL MODULE: ../../node_modules/next/dist/compiled/react/jsx-runtime.js var jsx_runtime = __webpack_require__(4568); // EXTERNAL MODULE: ../../node_modules/next/dist/client/app-dir/link.js var app_dir_link = __webpack_require__(9664); var link_default = /*#__PURE__*/__webpack_require__.n(app_dir_link); // EXTERNAL MODULE: ../../node_modules/next/dist/api/navigation.js var navigation = __webpack_require__(7541); // EXTERNAL MODULE: ./src/lib/auth.ts var auth = __webpack_require__(1592); // EXTERNAL MODULE: ./src/context/locale.tsx var context_locale = __webpack_require__(9906); // EXTERNAL MODULE: ./src/lib/formatName.ts var formatName = __webpack_require__(1258); // EXTERNAL MODULE: ../../node_modules/next/dist/compiled/react/index.js var react = __webpack_require__(7620); // EXTERNAL MODULE: ./src/lib/translations.ts var translations = __webpack_require__(4962); ;// ./src/components/LanguageSwitcher.tsx /* __next_internal_client_entry_do_not_use__ LanguageSwitcher auto */ function LanguageSwitcher() { const { locale, setLocale } = (0,context_locale/* useLocale */.Y)(); const [open, setOpen] = (0,react.useState)(false); const ref = (0,react.useRef)(null); var _LOCALES_find; const current = (_LOCALES_find = translations/* LOCALES */.YZ.find((l)=>l.code === locale)) !== null && _LOCALES_find !== void 0 ? _LOCALES_find : translations/* LOCALES */.YZ[0]; // Close on outside click (0,react.useEffect)(()=>{ function handleClick(e) { if (ref.current && !ref.current.contains(e.target)) setOpen(false); } document.addEventListener('mousedown', handleClick); return ()=>document.removeEventListener('mousedown', handleClick); }, []); return /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { ref: ref, className: "relative", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("button", { onClick: ()=>setOpen(!open), className: "flex items-center gap-1.5 px-2.5 py-1.5 rounded-lg border border-gray-200 hover:border-green-400 hover:bg-green-50 transition text-sm font-medium text-gray-700", "aria-label": "Change language", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { children: current.code.toUpperCase() }), /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { className: "w-3.5 h-3.5 text-gray-400 transition-transform ".concat(open ? 'rotate-180' : ''), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19 9l-7 7-7-7" }) }) ] }), open && /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "absolute right-0 mt-1 w-40 bg-white border border-gray-200 rounded-xl shadow-lg z-50 overflow-hidden", children: translations/* LOCALES */.YZ.map((loc)=>/*#__PURE__*/ (0,jsx_runtime.jsxs)("button", { onClick: ()=>{ setLocale(loc.code); setOpen(false); }, className: "w-full flex items-center gap-2.5 px-3.5 py-2.5 text-sm hover:bg-green-50 transition ".concat(locale === loc.code ? 'bg-green-50 text-green-700 font-medium' : 'text-gray-700'), children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { children: loc.label }), locale === loc.code && /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { className: "w-3.5 h-3.5 ml-auto text-green-600", fill: "currentColor", viewBox: "0 0 20 20", children: /*#__PURE__*/ (0,jsx_runtime.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" }) }) ] }, loc.code)) }) ] }); } // EXTERNAL MODULE: ./src/lib/api.ts var api = __webpack_require__(2982); // EXTERNAL MODULE: ../../node_modules/socket.io-client/build/esm/index.js + 28 modules var esm = __webpack_require__(2838); ;// ./src/hooks/useEffectiveRole.ts /* __next_internal_client_entry_do_not_use__ useEffectiveRole auto */ function readPreviewRole() { if (typeof document === 'undefined') return null; const m = document.cookie.match(/(?:^|;\s*)canhelp_preview_role=([^;]+)/); var _m_; return (_m_ = m === null || m === void 0 ? void 0 : m[1]) !== null && _m_ !== void 0 ? _m_ : null; } /** * Returns the effective role for the current user. * For admins, respects the `canhelp_preview_role` cookie set by AdminRolePreview widget. * Updates reactively when the widget dispatches `canhelp:preview-role`. */ function useEffectiveRole() { var _session_user; const { data: session } = (0,auth/* useSession */.wV)(); const userRole = session === null || session === void 0 ? void 0 : (_session_user = session.user) === null || _session_user === void 0 ? void 0 : _session_user.role; const isAdmin = userRole === 'admin'; const [previewRole, setPreviewRole] = (0,react.useState)(null); (0,react.useEffect)(()=>{ if (!isAdmin) return; setPreviewRole(readPreviewRole()); const sync = ()=>setPreviewRole(readPreviewRole()); window.addEventListener('canhelp:preview-role', sync); document.addEventListener('visibilitychange', sync); return ()=>{ window.removeEventListener('canhelp:preview-role', sync); document.removeEventListener('visibilitychange', sync); }; }, [ isAdmin ]); if (!userRole) return null; if (isAdmin && previewRole) return previewRole; return userRole; } // EXTERNAL MODULE: ../../node_modules/next/dist/api/app-dynamic.js var app_dynamic = __webpack_require__(6442); ;// ./src/components/Header.tsx /* __next_internal_client_entry_do_not_use__ Header auto */ const SupportModal = (0,app_dynamic["default"])(()=>__webpack_require__.e(/* import() */ 6467).then(__webpack_require__.bind(__webpack_require__, 6467)), { loadableGenerated: { webpack: ()=>[ /*require.resolve*/(6467) ] }, ssr: false }); const API_URL = "https://api.canhelp.gr" || 0; function Header() { var _session_user; const router = (0,navigation.useRouter)(); const pathname = (0,navigation.usePathname)(); const { data: session } = (0,auth/* useSession */.wV)(); const { t, locale } = (0,context_locale/* useLocale */.Y)(); const [menuOpen, setMenuOpen] = (0,react.useState)(false); const [profileOpen, setProfileOpen] = (0,react.useState)(false); const [supportOpen, setSupportOpen] = (0,react.useState)(false); const [unreadNotif, setUnreadNotif] = (0,react.useState)(0); const [unreadChat, setUnreadChat] = (0,react.useState)(0); const [msgToast, setMsgToast] = (0,react.useState)(null); const [planTier, setPlanTier] = (0,react.useState)(null); const profileRef = (0,react.useRef)(null); const headerRef = (0,react.useRef)(null); const toastTimer = (0,react.useRef)(null); const pathnameRef = (0,react.useRef)(pathname); (0,react.useEffect)(()=>{ pathnameRef.current = pathname; }, [ pathname ]); // Close dropdowns on outside click (0,react.useEffect)(()=>{ function handleClick(e) { if (profileRef.current && !profileRef.current.contains(e.target)) { setProfileOpen(false); } } document.addEventListener('mousedown', handleClick); return ()=>document.removeEventListener('mousedown', handleClick); }, []); const isAdmin = (session === null || session === void 0 ? void 0 : (_session_user = session.user) === null || _session_user === void 0 ? void 0 : _session_user.role) === 'admin'; const effectiveRole = useEffectiveRole(); const isSpecialist = effectiveRole === 'specialist'; const isActive = function(href) { let exact = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false; return exact ? pathname === href : pathname === href || pathname.startsWith(href + '/'); }; const navCls = function(href) { let exact = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false; return "font-medium text-sm transition ".concat(isActive(href, exact) ? 'text-green-600' : 'text-gray-600 hover:text-green-600'); }; const mobileNavCls = function(href) { let exact = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false; return "flex items-center gap-2 font-medium py-1 ".concat(isActive(href, exact) ? 'text-green-600' : 'text-gray-700'); }; // Reset chat badge when entering chat (0,react.useEffect)(()=>{ if (pathname === '/chat') setUnreadChat(0); }, [ pathname ]); (0,react.useEffect)(()=>{ if (!session) return; const socket = (0,esm.io)(API_URL, { withCredentials: true, transports: [ 'websocket', 'polling' ] }); socket.on('new_message', (msg)=>{ if (pathnameRef.current === '/chat') return; setUnreadChat((c)=>c + 1); if (toastTimer.current) clearTimeout(toastTimer.current); setMsgToast(msg); toastTimer.current = setTimeout(()=>setMsgToast(null), 5000); }); return ()=>{ socket.disconnect(); if (toastTimer.current) clearTimeout(toastTimer.current); }; }, [ session ]); (0,react.useEffect)(()=>{ if (!session) { setUnreadNotif(0); return; } const fetch = ()=>(0,api/* getUnreadCount */.$M)().then((r)=>setUnreadNotif(r.count)).catch(()=>{}); fetch(); const timer = setInterval(fetch, 30000); return ()=>clearInterval(timer); }, [ session ]); (0,react.useEffect)(()=>{ if (!session) { setPlanTier(null); return; } (0,api/* getMyDashboard */.H)().then((d)=>{ var _d_plan; var _d_plan_tier; return setPlanTier((_d_plan_tier = (_d_plan = d.plan) === null || _d_plan === void 0 ? void 0 : _d_plan.tier) !== null && _d_plan_tier !== void 0 ? _d_plan_tier : null); }).catch(()=>{}); }, [ session ]); (0,react.useEffect)(()=>{ const onScroll = ()=>{ if (!headerRef.current) return; if (window.scrollY > 40) { headerRef.current.classList.add('header-shrink'); } else { headerRef.current.classList.remove('header-shrink'); } }; window.addEventListener('scroll', onScroll); return ()=>window.removeEventListener('scroll', onScroll); }, []); return /*#__PURE__*/ (0,jsx_runtime.jsxs)(jsx_runtime.Fragment, { children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("header", { ref: headerRef, className: "header-base bg-white border-b border-gray-200 sticky top-0 z-50 transition-all duration-300", children: /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "max-w-7xl mx-auto px-4 sm:px-6 lg:px-8", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex items-center justify-between h-16 header-content transition-all duration-300", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)((link_default()), { href: "/", className: "flex items-center gap-2 shrink-0", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("img", { src: "/logo.png", alt: "CanHelp", className: "w-8 h-8 object-contain" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "logo-text text-2xl font-bold text-green-600 transition-all duration-300", children: "CanHelp" }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("nav", { className: "hidden md:flex items-center gap-5 ml-auto", children: [ isSpecialist ? /*#__PURE__*/ (0,jsx_runtime.jsxs)(jsx_runtime.Fragment, { children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)((link_default()), { href: "/tasks", className: navCls('/tasks'), children: t('nav.find_tasks') }), /*#__PURE__*/ (0,jsx_runtime.jsx)((link_default()), { href: "/dashboard", className: navCls('/dashboard'), children: t('nav.dashboard') }) ] }) : /*#__PURE__*/ (0,jsx_runtime.jsxs)(jsx_runtime.Fragment, { children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)((link_default()), { href: "/tasks/new", className: navCls('/tasks/new', true), children: t('dashboard.new_task') }), " ", /*#__PURE__*/ (0,jsx_runtime.jsx)((link_default()), { href: "/tasks", className: navCls('/tasks'), children: t('nav.tasks') }), " ", /*#__PURE__*/ (0,jsx_runtime.jsx)((link_default()), { href: "/specialists", className: navCls('/specialists'), children: t('nav.specialists') }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)((link_default()), { href: "/pricing", className: navCls('/pricing', true), children: t('nav.pricing', 'Pricing') }), session ? /*#__PURE__*/ (0,jsx_runtime.jsxs)(jsx_runtime.Fragment, { children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)((link_default()), { href: "/notifications", className: "relative text-gray-600 hover:text-gray-900 flex items-center", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { className: "w-5 h-5 ".concat(unreadNotif > 0 ? 'text-green-600' : ''), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ (0,jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M14.857 17.082a23.848 23.848 0 005.454-1.31A8.967 8.967 0 0118 9.75v-.7V9A6 6 0 006 9v.75a8.967 8.967 0 01-2.312 6.022c1.733.64 3.56 1.085 5.455 1.31m5.714 0a24.255 24.255 0 01-5.714 0m5.714 0a3 3 0 11-5.714 0" }) }), unreadNotif > 0 && /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "absolute -top-1.5 -right-1.5 min-w-[16px] h-4 px-0.5 bg-red-500 text-white text-[10px] font-bold rounded-full flex items-center justify-center leading-none", children: unreadNotif > 99 ? '99+' : unreadNotif }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)((link_default()), { href: "/chat", className: "relative text-gray-600 hover:text-gray-900 flex items-center", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { className: "w-5 h-5 ".concat(unreadChat > 0 ? 'text-green-500' : ''), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ (0,jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }), unreadChat > 0 && /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "absolute -top-1.5 -right-1.5 min-w-[16px] h-4 px-0.5 bg-green-500 text-white text-[10px] font-bold rounded-full flex items-center justify-center leading-none", children: unreadChat > 99 ? '99+' : unreadChat }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "relative", ref: profileRef, children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("button", { onClick: ()=>setProfileOpen(!profileOpen), className: "flex items-center gap-1.5 text-sm font-medium text-gray-600 hover:text-green-600", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "truncate max-w-[100px]", children: (0,formatName/* formatShortName */.H)(session.user.firstName, session.user.lastName, session.user.name) }), planTier === 'pro' && /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "inline-flex items-center px-1.5 py-0.5 rounded-full text-[10px] font-bold bg-green-100 text-green-700 leading-none", children: "Pro" }), planTier === 'ultimate' && /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "inline-flex items-center px-1.5 py-0.5 rounded-full text-[10px] font-bold bg-gradient-to-r from-amber-400 via-yellow-400 to-amber-400 text-gray-900 shadow-sm shadow-amber-300/50 leading-none", children: "★" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19 9l-7 7-7-7" }) }) ] }), profileOpen && /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "absolute right-0 mt-2 w-52 bg-white border border-gray-200 rounded-xl shadow-lg py-1 z-50", children: [ isSpecialist ? /*#__PURE__*/ (0,jsx_runtime.jsxs)(jsx_runtime.Fragment, { children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)((link_default()), { href: "/tasks/new", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 4v16m8-8H4" }) }), t('nav.new_task') ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)((link_default()), { href: "/specialists", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,jsx_runtime.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" }) }), t('nav.specialists') ] }) ] }) : /*#__PURE__*/ (0,jsx_runtime.jsxs)(jsx_runtime.Fragment, { children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)((link_default()), { href: "/notifications", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { className: "w-4 h-4 shrink-0 ".concat(unreadNotif > 0 ? 'text-green-600' : 'text-gray-400'), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M14.857 17.082a23.848 23.848 0 005.454-1.31A8.967 8.967 0 0118 9.75v-.7V9A6 6 0 006 9v.75a8.967 8.967 0 01-2.312 6.022c1.733.64 3.56 1.085 5.455 1.31m5.714 0a24.255 24.255 0 01-5.714 0m5.714 0a3 3 0 11-5.714 0" }) }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("span", { className: "flex items-center gap-1.5", children: [ t('nav.notifications'), unreadNotif > 0 && /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "px-1.5 py-0.5 bg-red-500 text-white text-[10px] font-bold rounded-full leading-none", children: unreadNotif > 99 ? '99+' : unreadNotif }) ] }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)((link_default()), { href: "/chat", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { className: "w-4 h-4 shrink-0 ".concat(unreadChat > 0 ? 'text-green-500' : 'text-gray-400'), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("span", { className: "flex items-center gap-1.5", children: [ t('nav.chat'), unreadChat > 0 && /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "px-1.5 py-0.5 bg-green-500 text-white text-[10px] font-bold rounded-full leading-none", children: unreadChat > 99 ? '99+' : unreadChat }) ] }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)((link_default()), { href: "/dashboard", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6" }) }), t('nav.dashboard') ] }) ] }), (isSpecialist || isAdmin) && /*#__PURE__*/ (0,jsx_runtime.jsxs)((link_default()), { href: "/schedule", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,jsx_runtime.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" }) }), t('nav.schedule') ] }), isAdmin && /*#__PURE__*/ (0,jsx_runtime.jsxs)((link_default()), { href: "/admin", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: [ /*#__PURE__*/ (0,jsx_runtime.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" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 12a3 3 0 11-6 0 3 3 0 016 0z" }) ] }), t('nav.admin') ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)((link_default()), { href: "/profile", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,jsx_runtime.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" }) }), t('nav.profile') ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)((link_default()), { href: "/favorites", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4.318 6.318a4.5 4.5 0 000 6.364L12 20.364l7.682-7.682a4.5 4.5 0 00-6.364-6.364L12 7.636l-1.318-1.318a4.5 4.5 0 00-6.364 0z" }) }), t('nav.favorites') ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("hr", { className: "my-1 border-gray-100" }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("button", { className: "w-full flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-green-50", onClick: ()=>{ setProfileOpen(false); setSupportOpen(true); }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,jsx_runtime.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" }) }), t('support.title') ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("hr", { className: "my-1 border-gray-100" }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("button", { className: "w-full flex items-center gap-2.5 px-4 py-2 text-sm text-red-500 hover:bg-red-50", onClick: ()=>{ setProfileOpen(false); (0,auth/* signOut */.CI)().then(()=>{ window.location.href = '/'; }); }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M17 16l4-4m0 0l-4-4m4 4H7m6 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h4a3 3 0 013 3v1" }) }), t('nav.logout') ] }) ] }) ] }) ] }) : /*#__PURE__*/ (0,jsx_runtime.jsxs)(jsx_runtime.Fragment, { children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)((link_default()), { href: "/login", className: "text-gray-600 hover:text-green-600 font-medium text-sm", children: t('nav.login') }), /*#__PURE__*/ (0,jsx_runtime.jsx)((link_default()), { href: "/register", className: "bg-green-600 text-white px-4 py-2 rounded-lg hover:bg-green-700 font-medium text-sm", children: t('nav.register') }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)(LanguageSwitcher, {}) ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "md:hidden flex items-center gap-2", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)(LanguageSwitcher, {}), /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "p-2", onClick: ()=>setMenuOpen(!menuOpen), "aria-label": "Toggle menu", children: /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { className: "w-5 h-5 text-gray-600", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: menuOpen ? /*#__PURE__*/ (0,jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" }) : /*#__PURE__*/ (0,jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4 6h16M4 12h16M4 18h16" }) }) }) ] }) ] }), menuOpen && /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "md:hidden py-4 border-t border-gray-100 flex flex-col gap-3", children: [ isSpecialist ? /*#__PURE__*/ (0,jsx_runtime.jsxs)(jsx_runtime.Fragment, { children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)((link_default()), { href: "/tasks", className: mobileNavCls('/tasks'), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z" }) }), t('nav.find_tasks') ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)((link_default()), { href: "/dashboard", className: mobileNavCls('/dashboard'), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6" }) }), t('nav.dashboard') ] }) ] }) : /*#__PURE__*/ (0,jsx_runtime.jsxs)(jsx_runtime.Fragment, { children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)((link_default()), { href: "/tasks/new", className: mobileNavCls('/tasks/new', true), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 4v16m8-8H4" }) }), t('nav.new_task') ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)((link_default()), { href: "/tasks", className: mobileNavCls('/tasks'), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,jsx_runtime.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" }) }), t('nav.tasks') ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)((link_default()), { href: "/specialists", className: mobileNavCls('/specialists'), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,jsx_runtime.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" }) }), t('nav.specialists') ] }) ] }), session ? /*#__PURE__*/ (0,jsx_runtime.jsxs)(jsx_runtime.Fragment, { children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)((link_default()), { href: "/chat", className: mobileNavCls('/chat', true), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { className: "w-4 h-4 shrink-0 ".concat(unreadChat > 0 ? 'text-green-500' : ''), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }), t('nav.chat'), unreadChat > 0 && /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "ml-1 px-1.5 py-0.5 bg-green-500 text-white text-[10px] font-bold rounded-full", children: unreadChat }) ] }), isSpecialist ? /*#__PURE__*/ (0,jsx_runtime.jsxs)(jsx_runtime.Fragment, { children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)((link_default()), { href: "/tasks/new", className: mobileNavCls('/tasks/new', true), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 4v16m8-8H4" }) }), t('nav.new_task') ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)((link_default()), { href: "/specialists", className: mobileNavCls('/specialists'), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,jsx_runtime.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" }) }), t('nav.specialists') ] }) ] }) : /*#__PURE__*/ (0,jsx_runtime.jsxs)(jsx_runtime.Fragment, { children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)((link_default()), { href: "/notifications", className: mobileNavCls('/notifications', true), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { className: "w-4 h-4 shrink-0 ".concat(unreadNotif > 0 ? 'text-green-600' : ''), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M14.857 17.082a23.848 23.848 0 005.454-1.31A8.967 8.967 0 0118 9.75v-.7V9A6 6 0 006 9v.75a8.967 8.967 0 01-2.312 6.022c1.733.64 3.56 1.085 5.455 1.31m5.714 0a24.255 24.255 0 01-5.714 0m5.714 0a3 3 0 11-5.714 0" }) }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("span", { className: "flex items-center gap-1.5", children: [ t('nav.notifications'), unreadNotif > 0 && /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "px-1.5 py-0.5 bg-red-500 text-white text-[10px] font-bold rounded-full", children: unreadNotif > 99 ? '99+' : unreadNotif }) ] }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)((link_default()), { href: "/dashboard", className: mobileNavCls('/dashboard'), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6" }) }), t('nav.dashboard') ] }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)((link_default()), { href: "/favorites", className: mobileNavCls('/favorites', true), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4.318 6.318a4.5 4.5 0 000 6.364L12 20.364l7.682-7.682a4.5 4.5 0 00-6.364-6.364L12 7.636l-1.318-1.318a4.5 4.5 0 00-6.364 0z" }) }), t('nav.favorites') ] }), (isSpecialist || isAdmin) && /*#__PURE__*/ (0,jsx_runtime.jsxs)((link_default()), { href: "/schedule", className: mobileNavCls('/schedule', true), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { className: "w-4 h-4 text-gray-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,jsx_runtime.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" }) }), t('nav.schedule') ] }), isAdmin && /*#__PURE__*/ (0,jsx_runtime.jsxs)((link_default()), { href: "/admin", className: mobileNavCls('/admin'), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("svg", { className: "w-4 h-4 text-gray-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: [ /*#__PURE__*/ (0,jsx_runtime.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" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 12a3 3 0 11-6 0 3 3 0 016 0z" }) ] }), t('nav.admin') ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)((link_default()), { href: "/profile", className: mobileNavCls('/profile', true), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { className: "w-4 h-4 text-gray-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,jsx_runtime.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" }) }), t('nav.profile') ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("button", { onClick: ()=>{ setMenuOpen(false); (0,auth/* signOut */.CI)().then(()=>{ window.location.href = '/'; }); }, className: "flex items-center gap-2 text-left text-red-500 py-1 font-medium", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M17 16l4-4m0 0l-4-4m4 4H7m6 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h4a3 3 0 013 3v1" }) }), t('nav.logout') ] }) ] }) : /*#__PURE__*/ (0,jsx_runtime.jsxs)(jsx_runtime.Fragment, { children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)((link_default()), { href: "/login", className: "text-gray-700 font-medium py-1", onClick: ()=>setMenuOpen(false), children: t('nav.login') }), /*#__PURE__*/ (0,jsx_runtime.jsx)((link_default()), { href: "/register", className: "text-green-600 font-medium py-1", onClick: ()=>setMenuOpen(false), children: t('nav.register') }) ] }) ] }) ] }) }), msgToast && /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "fixed bottom-5 right-5 z-[200] max-w-sm w-full", children: /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "bg-white border border-gray-200 rounded-xl shadow-xl p-4 flex items-start gap-3 animate-fade-in", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "text-2xl shrink-0", children: "\uD83D\uDCAC" }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "font-semibold text-gray-900 text-sm", children: t('chat.toast_title') }), /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "text-xs text-gray-500 truncate mt-0.5", children: msgToast.body }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex flex-col items-end gap-2 shrink-0", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { onClick: ()=>setMsgToast(null), className: "text-gray-400 hover:text-gray-600 text-lg leading-none", "aria-label": "close", children: "\xd7" }), /*#__PURE__*/ (0,jsx_runtime.jsx)((link_default()), { href: "/chat?room=".concat(msgToast.roomId), onClick: ()=>setMsgToast(null), className: "text-xs text-green-600 hover:underline font-medium", children: t('chat.toast_open') }) ] }) ] }) }), supportOpen && /*#__PURE__*/ (0,jsx_runtime.jsx)(SupportModal, { onClose: ()=>setSupportOpen(false) }) ] }); } /***/ }) VÿÿÿYÿÿÿ `Zÿÿÿ[ÿÿÿZÿÿÿ // EXPORTS __webpack_require__.d(__webpack_exports__, { Header: () => (/* binding */ Header) }); // EXTERNAL MODULE: ../../node_modules/next/dist/compiled/react/jsx-runtime.js var jsx_runtime = __webpack_require__(4568); // EXTERNAL MODULE: ../../node_modules/next/dist/client/app-dir/link.js var app_dir_link = __webpack_require__(9664); var link_default = /*#__PURE__*/__webpack_require__.n(app_dir_link); // EXTERNAL MODULE: ../../node_modules/next/dist/api/navigation.js var navigation = __webpack_require__(7541); // EXTERNAL MODULE: ./src/lib/auth.ts var auth = __webpack_require__(1592); // EXTERNAL MODULE: ./src/context/locale.tsx var context_locale = __webpack_require__(9906); // EXTERNAL MODULE: ./src/lib/formatName.ts var formatName = __webpack_require__(1258); // EXTERNAL MODULE: ../../node_modules/next/dist/compiled/react/index.js var react = __webpack_require__(7620); // EXTERNAL MODULE: ./src/lib/translations.ts var translations = __webpack_require__(4962); ;// ./src/components/LanguageSwitcher.tsx  ReplaceSource[ÿÿÿ™/* __next_internal_client_entry_do_not_use__ LanguageSwitcher auto */ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { useState, useRef, useEffect } from 'react'; import { useLocale } from '@/context/locale'; import { LOCALES } from '@/lib/translations'; export function LanguageSwitcher() { const { locale, setLocale } = useLocale(); const [open, setOpen] = useState(false); const ref = useRef(null); var _LOCALES_find; const current = (_LOCALES_find = LOCALES.find((l)=>l.code === locale)) !== null && _LOCALES_find !== void 0 ? _LOCALES_find : LOCALES[0]; // Close on outside click useEffect(()=>{ function handleClick(e) { if (ref.current && !ref.current.contains(e.target)) setOpen(false); } document.addEventListener('mousedown', handleClick); return ()=>document.removeEventListener('mousedown', handleClick); }, []); return /*#__PURE__*/ _jsxs("div", { ref: ref, className: "relative", children: [ /*#__PURE__*/ _jsxs("button", { onClick: ()=>setOpen(!open), className: "flex items-center gap-1.5 px-2.5 py-1.5 rounded-lg border border-gray-200 hover:border-green-400 hover:bg-green-50 transition text-sm font-medium text-gray-700", "aria-label": "Change language", children: [ /*#__PURE__*/ _jsx("span", { children: current.code.toUpperCase() }), /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5 text-gray-400 transition-transform ".concat(open ? 'rotate-180' : ''), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19 9l-7 7-7-7" }) }) ] }), open && /*#__PURE__*/ _jsx("div", { className: "absolute right-0 mt-1 w-40 bg-white border border-gray-200 rounded-xl shadow-lg z-50 overflow-hidden", children: LOCALES.map((loc)=>/*#__PURE__*/ _jsxs("button", { onClick: ()=>{ setLocale(loc.code); setOpen(false); }, className: "w-full flex items-center gap-2.5 px-3.5 py-2.5 text-sm hover:bg-green-50 transition ".concat(locale === loc.code ? 'bg-green-50 text-green-700 font-medium' : 'text-gray-700'), children: [ /*#__PURE__*/ _jsx("span", { children: loc.label }), locale === loc.code && /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5 ml-auto text-green-600", fill: "currentColor", viewBox: "0 0 20 20", children: /*#__PURE__*/ _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" }) }) ] }, loc.code)) }) ] }); } r70132undefined134185undefined187231undefined233277undefined279285undefined350358__WEBPACK_MODULE_REFERENCE__4_5b227573654c6f63616c65225d_call_directImport_asiSafe1__._undefined391398__WEBPACK_MODULE_REFERENCE__6_5b227573655374617465225d_call_directImport_asiSafe1__._undefined424429__WEBPACK_MODULE_REFERENCE__6_5b22757365526566225d_call_directImport_asiSafe1__._undefined498504__WEBPACK_MODULE_REFERENCE__7_5b224c4f43414c4553225d_call_asiSafe1__._undefined591597__WEBPACK_MODULE_REFERENCE__7_5b224c4f43414c4553225d_asiSafe1__._undefined637645__WEBPACK_MODULE_REFERENCE__6_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined950954__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined10601064__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined14241427__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined15581561__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined19111914__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined21972200__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined23682374__WEBPACK_MODULE_REFERENCE__7_5b224c4f43414c4553225d_call_asiSafe1__._undefined24012405__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined28682871__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined30323035__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined32913294__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined‹138224(0,context_locale/* useLocale */.Y)undefined257341(0,react.useState)undefined367447(0,react.useRef)undefined516585translations/* LOCALES */.YZundefined672736translations/* LOCALES */.YZundefined776862(0,react.useEffect)undefined11671243(0,jsx_runtime.jsxs)undefined13491425(0,jsx_runtime.jsxs)undefined17851859(0,jsx_runtime.jsx)undefined19902064(0,jsx_runtime.jsx)undefined24142488(0,jsx_runtime.jsx)undefined27712845(0,jsx_runtime.jsx)undefined30133082translations/* LOCALES */.YZundefined31093185(0,jsx_runtime.jsxs)undefined36483722(0,jsx_runtime.jsx)undefined38833957(0,jsx_runtime.jsx)undefined42134287(0,jsx_runtime.jsx)undefinedRawSourceì // EXTERNAL MODULE: ./src/lib/api.ts var api = __webpack_require__(2982); // EXTERNAL MODULE: ../../node_modules/socket.io-client/build/esm/index.js + 28 modules var esm = __webpack_require__(2838); ;// ./src/hooks/useEffectiveRole.ts ûWÿÿÿT/* __next_internal_client_entry_do_not_use__ useEffectiveRole auto */ import { useSession } from '@/lib/auth'; import { useEffect, useState } from 'react'; function readPreviewRole() { if (typeof document === 'undefined') return null; const m = document.cookie.match(/(?:^|;\s*)canhelp_preview_role=([^;]+)/); var _m_; return (_m_ = m === null || m === void 0 ? void 0 : m[1]) !== null && _m_ !== void 0 ? _m_ : null; } /** * Returns the effective role for the current user. * For admins, respects the `canhelp_preview_role` cookie set by AdminRolePreview widget. * Updates reactively when the widget dispatches `canhelp:preview-role`. */ export function useEffectiveRole() { var _session_user; const { data: session } = useSession(); const userRole = session === null || session === void 0 ? void 0 : (_session_user = session.user) === null || _session_user === void 0 ? void 0 : _session_user.role; const isAdmin = userRole === 'admin'; const [previewRole, setPreviewRole] = useState(null); useEffect(()=>{ if (!isAdmin) return; setPreviewRole(readPreviewRole()); const sync = ()=>setPreviewRole(readPreviewRole()); window.addEventListener('canhelp:preview-role', sync); document.addEventListener('visibilitychange', sync); return ()=>{ window.removeEventListener('canhelp:preview-role', sync); document.removeEventListener('visibilitychange', sync); }; }, [ isAdmin ]); if (!userRole) return null; if (isAdmin && previewRole) return previewRole; return userRole; } b70109undefined111154undefined659665undefined749758__WEBPACK_MODULE_REFERENCE__3_5b2275736553657373696f6e225d_call_directImport_asiSafe1__._undefined10171024__WEBPACK_MODULE_REFERENCE__6_5b227573655374617465225d_call_directImport_asiSafe1__._undefined10371045__WEBPACK_MODULE_REFERENCE__6_5b22757365456666656374225d_call_directImport_asiSafe1__._undefinedz658746(0,auth/* useSession */.wV)undefined10051089(0,react.useState)undefined11021188(0,react.useEffect)undefinedRawSource’ // EXTERNAL MODULE: ../../node_modules/next/dist/api/app-dynamic.js var app_dynamic = __webpack_require__(6442); ;// ./src/components/Header.tsx ÷Sÿÿÿ7/* __next_internal_client_entry_do_not_use__ Header auto */ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime"; import Link from 'next/link'; import { useRouter, usePathname } from 'next/navigation'; import { useSession, signOut } from '@/lib/auth'; import { useLocale } from '@/context/locale'; import { formatShortName } from '@/lib/formatName'; import { LanguageSwitcher } from './LanguageSwitcher'; import { useState, useRef, useEffect } from 'react'; import { getUnreadCount, getMyDashboard } from '@/lib/api'; import { io } from 'socket.io-client'; import { useEffectiveRole } from '@/hooks/useEffectiveRole'; import dynamic from 'next/dynamic'; const SupportModal = dynamic(()=>import('./SupportModal'), { loadableGenerated: { webpack: ()=>[ require.resolveWeak("./SupportModal") ] }, ssr: false }); const API_URL = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; export function Header() { var _session_user; const router = useRouter(); const pathname = usePathname(); const { data: session } = useSession(); const { t, locale } = useLocale(); const [menuOpen, setMenuOpen] = useState(false); const [profileOpen, setProfileOpen] = useState(false); const [supportOpen, setSupportOpen] = useState(false); const [unreadNotif, setUnreadNotif] = useState(0); const [unreadChat, setUnreadChat] = useState(0); const [msgToast, setMsgToast] = useState(null); const [planTier, setPlanTier] = useState(null); const profileRef = useRef(null); const headerRef = useRef(null); const toastTimer = useRef(null); const pathnameRef = useRef(pathname); useEffect(()=>{ pathnameRef.current = pathname; }, [ pathname ]); // Close dropdowns on outside click useEffect(()=>{ function handleClick(e) { if (profileRef.current && !profileRef.current.contains(e.target)) { setProfileOpen(false); } } document.addEventListener('mousedown', handleClick); return ()=>document.removeEventListener('mousedown', handleClick); }, []); const isAdmin = (session === null || session === void 0 ? void 0 : (_session_user = session.user) === null || _session_user === void 0 ? void 0 : _session_user.role) === 'admin'; const effectiveRole = useEffectiveRole(); const isSpecialist = effectiveRole === 'specialist'; const isActive = function(href) { let exact = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false; return exact ? pathname === href : pathname === href || pathname.startsWith(href + '/'); }; const navCls = function(href) { let exact = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false; return "font-medium text-sm transition ".concat(isActive(href, exact) ? 'text-green-600' : 'text-gray-600 hover:text-green-600'); }; const mobileNavCls = function(href) { let exact = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false; return "flex items-center gap-2 font-medium py-1 ".concat(isActive(href, exact) ? 'text-green-600' : 'text-gray-700'); }; // Reset chat badge when entering chat useEffect(()=>{ if (pathname === '/chat') setUnreadChat(0); }, [ pathname ]); useEffect(()=>{ if (!session) return; const socket = io(API_URL, { withCredentials: true, transports: [ 'websocket', 'polling' ] }); socket.on('new_message', (msg)=>{ if (pathnameRef.current === '/chat') return; setUnreadChat((c)=>c + 1); if (toastTimer.current) clearTimeout(toastTimer.current); setMsgToast(msg); toastTimer.current = setTimeout(()=>setMsgToast(null), 5000); }); return ()=>{ socket.disconnect(); if (toastTimer.current) clearTimeout(toastTimer.current); }; }, [ session ]); useEffect(()=>{ if (!session) { setUnreadNotif(0); return; } const fetch = ()=>getUnreadCount().then((r)=>setUnreadNotif(r.count)).catch(()=>{}); fetch(); const timer = setInterval(fetch, 30000); return ()=>clearInterval(timer); }, [ session ]); useEffect(()=>{ if (!session) { setPlanTier(null); return; } getMyDashboard().then((d)=>{ var _d_plan; var _d_plan_tier; return setPlanTier((_d_plan_tier = (_d_plan = d.plan) === null || _d_plan === void 0 ? void 0 : _d_plan.tier) !== null && _d_plan_tier !== void 0 ? _d_plan_tier : null); }).catch(()=>{}); }, [ session ]); useEffect(()=>{ const onScroll = ()=>{ if (!headerRef.current) return; if (window.scrollY > 40) { headerRef.current.classList.add('header-shrink'); } else { headerRef.current.classList.remove('header-shrink'); } }; window.addEventListener('scroll', onScroll); return ()=>window.removeEventListener('scroll', onScroll); }, []); return /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx("header", { ref: headerRef, className: "header-base bg-white border-b border-gray-200 sticky top-0 z-50 transition-all duration-300", children: /*#__PURE__*/ _jsxs("div", { className: "max-w-7xl mx-auto px-4 sm:px-6 lg:px-8", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between h-16 header-content transition-all duration-300", children: [ /*#__PURE__*/ _jsxs(Link, { href: "/", className: "flex items-center gap-2 shrink-0", children: [ /*#__PURE__*/ _jsx("img", { src: "/logo.png", alt: "CanHelp", className: "w-8 h-8 object-contain" }), /*#__PURE__*/ _jsx("span", { className: "logo-text text-2xl font-bold text-green-600 transition-all duration-300", children: "CanHelp" }) ] }), /*#__PURE__*/ _jsxs("nav", { className: "hidden md:flex items-center gap-5 ml-auto", children: [ isSpecialist ? /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx(Link, { href: "/tasks", className: navCls('/tasks'), children: t('nav.find_tasks') }), /*#__PURE__*/ _jsx(Link, { href: "/dashboard", className: navCls('/dashboard'), children: t('nav.dashboard') }) ] }) : /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx(Link, { href: "/tasks/new", className: navCls('/tasks/new', true), children: t('dashboard.new_task') }), " ", /*#__PURE__*/ _jsx(Link, { href: "/tasks", className: navCls('/tasks'), children: t('nav.tasks') }), " ", /*#__PURE__*/ _jsx(Link, { href: "/specialists", className: navCls('/specialists'), children: t('nav.specialists') }) ] }), /*#__PURE__*/ _jsx(Link, { href: "/pricing", className: navCls('/pricing', true), children: t('nav.pricing', 'Pricing') }), session ? /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs(Link, { href: "/notifications", className: "relative text-gray-600 hover:text-gray-900 flex items-center", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5 ".concat(unreadNotif > 0 ? 'text-green-600' : ''), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M14.857 17.082a23.848 23.848 0 005.454-1.31A8.967 8.967 0 0118 9.75v-.7V9A6 6 0 006 9v.75a8.967 8.967 0 01-2.312 6.022c1.733.64 3.56 1.085 5.455 1.31m5.714 0a24.255 24.255 0 01-5.714 0m5.714 0a3 3 0 11-5.714 0" }) }), unreadNotif > 0 && /*#__PURE__*/ _jsx("span", { className: "absolute -top-1.5 -right-1.5 min-w-[16px] h-4 px-0.5 bg-red-500 text-white text-[10px] font-bold rounded-full flex items-center justify-center leading-none", children: unreadNotif > 99 ? '99+' : unreadNotif }) ] }), /*#__PURE__*/ _jsxs(Link, { href: "/chat", className: "relative text-gray-600 hover:text-gray-900 flex items-center", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5 ".concat(unreadChat > 0 ? 'text-green-500' : ''), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }), unreadChat > 0 && /*#__PURE__*/ _jsx("span", { className: "absolute -top-1.5 -right-1.5 min-w-[16px] h-4 px-0.5 bg-green-500 text-white text-[10px] font-bold rounded-full flex items-center justify-center leading-none", children: unreadChat > 99 ? '99+' : unreadChat }) ] }), /*#__PURE__*/ _jsxs("div", { className: "relative", ref: profileRef, children: [ /*#__PURE__*/ _jsxs("button", { onClick: ()=>setProfileOpen(!profileOpen), className: "flex items-center gap-1.5 text-sm font-medium text-gray-600 hover:text-green-600", children: [ /*#__PURE__*/ _jsx("span", { className: "truncate max-w-[100px]", children: formatShortName(session.user.firstName, session.user.lastName, session.user.name) }), planTier === 'pro' && /*#__PURE__*/ _jsx("span", { className: "inline-flex items-center px-1.5 py-0.5 rounded-full text-[10px] font-bold bg-green-100 text-green-700 leading-none", children: "Pro" }), planTier === 'ultimate' && /*#__PURE__*/ _jsx("span", { className: "inline-flex items-center px-1.5 py-0.5 rounded-full text-[10px] font-bold bg-gradient-to-r from-amber-400 via-yellow-400 to-amber-400 text-gray-900 shadow-sm shadow-amber-300/50 leading-none", children: "★" }), /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19 9l-7 7-7-7" }) }) ] }), profileOpen && /*#__PURE__*/ _jsxs("div", { className: "absolute right-0 mt-2 w-52 bg-white border border-gray-200 rounded-xl shadow-lg py-1 z-50", children: [ isSpecialist ? /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs(Link, { href: "/tasks/new", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 4v16m8-8H4" }) }), t('nav.new_task') ] }), /*#__PURE__*/ _jsxs(Link, { href: "/specialists", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _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" }) }), t('nav.specialists') ] }) ] }) : /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs(Link, { href: "/notifications", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0 ".concat(unreadNotif > 0 ? 'text-green-600' : 'text-gray-400'), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M14.857 17.082a23.848 23.848 0 005.454-1.31A8.967 8.967 0 0118 9.75v-.7V9A6 6 0 006 9v.75a8.967 8.967 0 01-2.312 6.022c1.733.64 3.56 1.085 5.455 1.31m5.714 0a24.255 24.255 0 01-5.714 0m5.714 0a3 3 0 11-5.714 0" }) }), /*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-1.5", children: [ t('nav.notifications'), unreadNotif > 0 && /*#__PURE__*/ _jsx("span", { className: "px-1.5 py-0.5 bg-red-500 text-white text-[10px] font-bold rounded-full leading-none", children: unreadNotif > 99 ? '99+' : unreadNotif }) ] }) ] }), /*#__PURE__*/ _jsxs(Link, { href: "/chat", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0 ".concat(unreadChat > 0 ? 'text-green-500' : 'text-gray-400'), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }), /*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-1.5", children: [ t('nav.chat'), unreadChat > 0 && /*#__PURE__*/ _jsx("span", { className: "px-1.5 py-0.5 bg-green-500 text-white text-[10px] font-bold rounded-full leading-none", children: unreadChat > 99 ? '99+' : unreadChat }) ] }) ] }), /*#__PURE__*/ _jsxs(Link, { href: "/dashboard", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6" }) }), t('nav.dashboard') ] }) ] }), (isSpecialist || isAdmin) && /*#__PURE__*/ _jsxs(Link, { href: "/schedule", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _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" }) }), t('nav.schedule') ] }), isAdmin && /*#__PURE__*/ _jsxs(Link, { href: "/admin", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ _jsxs("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: [ /*#__PURE__*/ _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" }), /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 12a3 3 0 11-6 0 3 3 0 016 0z" }) ] }), t('nav.admin') ] }), /*#__PURE__*/ _jsxs(Link, { href: "/profile", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _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" }) }), t('nav.profile') ] }), /*#__PURE__*/ _jsxs(Link, { href: "/favorites", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4.318 6.318a4.5 4.5 0 000 6.364L12 20.364l7.682-7.682a4.5 4.5 0 00-6.364-6.364L12 7.636l-1.318-1.318a4.5 4.5 0 00-6.364 0z" }) }), t('nav.favorites') ] }), /*#__PURE__*/ _jsx("hr", { className: "my-1 border-gray-100" }), /*#__PURE__*/ _jsxs("button", { className: "w-full flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-green-50", onClick: ()=>{ setProfileOpen(false); setSupportOpen(true); }, children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _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" }) }), t('support.title') ] }), /*#__PURE__*/ _jsx("hr", { className: "my-1 border-gray-100" }), /*#__PURE__*/ _jsxs("button", { className: "w-full flex items-center gap-2.5 px-4 py-2 text-sm text-red-500 hover:bg-red-50", onClick: ()=>{ setProfileOpen(false); signOut().then(()=>{ window.location.href = '/'; }); }, children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M17 16l4-4m0 0l-4-4m4 4H7m6 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h4a3 3 0 013 3v1" }) }), t('nav.logout') ] }) ] }) ] }) ] }) : /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx(Link, { href: "/login", className: "text-gray-600 hover:text-green-600 font-medium text-sm", children: t('nav.login') }), /*#__PURE__*/ _jsx(Link, { href: "/register", className: "bg-green-600 text-white px-4 py-2 rounded-lg hover:bg-green-700 font-medium text-sm", children: t('nav.register') }) ] }), /*#__PURE__*/ _jsx(LanguageSwitcher, {}) ] }), /*#__PURE__*/ _jsxs("div", { className: "md:hidden flex items-center gap-2", children: [ /*#__PURE__*/ _jsx(LanguageSwitcher, {}), /*#__PURE__*/ _jsx("button", { className: "p-2", onClick: ()=>setMenuOpen(!menuOpen), "aria-label": "Toggle menu", children: /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5 text-gray-600", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: menuOpen ? /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" }) : /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4 6h16M4 12h16M4 18h16" }) }) }) ] }) ] }), menuOpen && /*#__PURE__*/ _jsxs("div", { className: "md:hidden py-4 border-t border-gray-100 flex flex-col gap-3", children: [ isSpecialist ? /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs(Link, { href: "/tasks", className: mobileNavCls('/tasks'), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z" }) }), t('nav.find_tasks') ] }), /*#__PURE__*/ _jsxs(Link, { href: "/dashboard", className: mobileNavCls('/dashboard'), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6" }) }), t('nav.dashboard') ] }) ] }) : /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs(Link, { href: "/tasks/new", className: mobileNavCls('/tasks/new', true), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 4v16m8-8H4" }) }), t('nav.new_task') ] }), /*#__PURE__*/ _jsxs(Link, { href: "/tasks", className: mobileNavCls('/tasks'), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _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" }) }), t('nav.tasks') ] }), /*#__PURE__*/ _jsxs(Link, { href: "/specialists", className: mobileNavCls('/specialists'), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _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" }) }), t('nav.specialists') ] }) ] }), session ? /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs(Link, { href: "/chat", className: mobileNavCls('/chat', true), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0 ".concat(unreadChat > 0 ? 'text-green-500' : ''), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }), t('nav.chat'), unreadChat > 0 && /*#__PURE__*/ _jsx("span", { className: "ml-1 px-1.5 py-0.5 bg-green-500 text-white text-[10px] font-bold rounded-full", children: unreadChat }) ] }), isSpecialist ? /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs(Link, { href: "/tasks/new", className: mobileNavCls('/tasks/new', true), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 4v16m8-8H4" }) }), t('nav.new_task') ] }), /*#__PURE__*/ _jsxs(Link, { href: "/specialists", className: mobileNavCls('/specialists'), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _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" }) }), t('nav.specialists') ] }) ] }) : /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs(Link, { href: "/notifications", className: mobileNavCls('/notifications', true), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0 ".concat(unreadNotif > 0 ? 'text-green-600' : ''), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M14.857 17.082a23.848 23.848 0 005.454-1.31A8.967 8.967 0 0118 9.75v-.7V9A6 6 0 006 9v.75a8.967 8.967 0 01-2.312 6.022c1.733.64 3.56 1.085 5.455 1.31m5.714 0a24.255 24.255 0 01-5.714 0m5.714 0a3 3 0 11-5.714 0" }) }), /*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-1.5", children: [ t('nav.notifications'), unreadNotif > 0 && /*#__PURE__*/ _jsx("span", { className: "px-1.5 py-0.5 bg-red-500 text-white text-[10px] font-bold rounded-full", children: unreadNotif > 99 ? '99+' : unreadNotif }) ] }) ] }), /*#__PURE__*/ _jsxs(Link, { href: "/dashboard", className: mobileNavCls('/dashboard'), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6" }) }), t('nav.dashboard') ] }) ] }), /*#__PURE__*/ _jsxs(Link, { href: "/favorites", className: mobileNavCls('/favorites', true), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4.318 6.318a4.5 4.5 0 000 6.364L12 20.364l7.682-7.682a4.5 4.5 0 00-6.364-6.364L12 7.636l-1.318-1.318a4.5 4.5 0 00-6.364 0z" }) }), t('nav.favorites') ] }), (isSpecialist || isAdmin) && /*#__PURE__*/ _jsxs(Link, { href: "/schedule", className: mobileNavCls('/schedule', true), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-gray-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _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" }) }), t('nav.schedule') ] }), isAdmin && /*#__PURE__*/ _jsxs(Link, { href: "/admin", className: mobileNavCls('/admin'), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ _jsxs("svg", { className: "w-4 h-4 text-gray-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: [ /*#__PURE__*/ _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" }), /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 12a3 3 0 11-6 0 3 3 0 016 0z" }) ] }), t('nav.admin') ] }), /*#__PURE__*/ _jsxs(Link, { href: "/profile", className: mobileNavCls('/profile', true), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-gray-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _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" }) }), t('nav.profile') ] }), /*#__PURE__*/ _jsxs("button", { onClick: ()=>{ setMenuOpen(false); signOut().then(()=>{ window.location.href = '/'; }); }, className: "flex items-center gap-2 text-left text-red-500 py-1 font-medium", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M17 16l4-4m0 0l-4-4m4 4H7m6 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h4a3 3 0 013 3v1" }) }), t('nav.logout') ] }) ] }) : /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx(Link, { href: "/login", className: "text-gray-700 font-medium py-1", onClick: ()=>setMenuOpen(false), children: t('nav.login') }), /*#__PURE__*/ _jsx(Link, { href: "/register", className: "text-green-600 font-medium py-1", onClick: ()=>setMenuOpen(false), children: t('nav.register') }) ] }) ] }) ] }) }), msgToast && /*#__PURE__*/ _jsx("div", { className: "fixed bottom-5 right-5 z-[200] max-w-sm w-full", children: /*#__PURE__*/ _jsxs("div", { className: "bg-white border border-gray-200 rounded-xl shadow-xl p-4 flex items-start gap-3 animate-fade-in", children: [ /*#__PURE__*/ _jsx("span", { className: "text-2xl shrink-0", children: "\uD83D\uDCAC" }), /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ _jsx("p", { className: "font-semibold text-gray-900 text-sm", children: t('chat.toast_title') }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-500 truncate mt-0.5", children: msgToast.body }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex flex-col items-end gap-2 shrink-0", children: [ /*#__PURE__*/ _jsx("button", { onClick: ()=>setMsgToast(null), className: "text-gray-400 hover:text-gray-600 text-lg leading-none", "aria-label": "close", children: "\xd7" }), /*#__PURE__*/ _jsx(Link, { href: "/chat?room=".concat(msgToast.roomId), onClick: ()=>setMsgToast(null), className: "text-xs text-green-600 hover:underline font-medium", children: t('chat.toast_open') }) ] }) ] }) }), supportOpen && /*#__PURE__*/ _jsx(SupportModal, { onClose: ()=>setSupportOpen(false) }) ] }); } (Z60145undefined147175undefined177233undefined235283undefined285329undefined331381undefined383436undefined438489undefined491549undefined551588undefined590649undefined651685undefined708714__WEBPACK_MODULE_REFERENCE__12_5b2264656661756c74225d_call_directImport_asiSafe1__._undefined720743__webpack_require__.e(/* import() */ 6467).then(__webpack_require__.bind(__webpack_require__, 6467))undefined812830/*require.resolve*/undefined8328476467undefined906936"https://api.canhelp.gr"undefined9419630undefined966972undefined10351043__WEBPACK_MODULE_REFERENCE__2_5b22757365526f75746572225d_call_directImport_asiSafe1__._undefined10691079__WEBPACK_MODULE_REFERENCE__2_5b22757365506174686e616d65225d_call_directImport_asiSafe1__._undefined11141123__WEBPACK_MODULE_REFERENCE__3_5b2275736553657373696f6e225d_call_directImport_asiSafe1__._undefined11541162__WEBPACK_MODULE_REFERENCE__4_5b227573654c6f63616c65225d_call_directImport_asiSafe1__._undefined12031210__WEBPACK_MODULE_REFERENCE__6_5b227573655374617465225d_call_directImport_asiSafe1__._undefined12621269__WEBPACK_MODULE_REFERENCE__6_5b227573655374617465225d_call_directImport_asiSafe1__._undefined13211328__WEBPACK_MODULE_REFERENCE__6_5b227573655374617465225d_call_directImport_asiSafe1__._undefined13801387__WEBPACK_MODULE_REFERENCE__6_5b227573655374617465225d_call_directImport_asiSafe1__._undefined14331440__WEBPACK_MODULE_REFERENCE__6_5b227573655374617465225d_call_directImport_asiSafe1__._undefined14821489__WEBPACK_MODULE_REFERENCE__6_5b227573655374617465225d_call_directImport_asiSafe1__._undefined15341541__WEBPACK_MODULE_REFERENCE__6_5b227573655374617465225d_call_directImport_asiSafe1__._undefined15731578__WEBPACK_MODULE_REFERENCE__6_5b22757365526566225d_call_directImport_asiSafe1__._undefined16091614__WEBPACK_MODULE_REFERENCE__6_5b22757365526566225d_call_directImport_asiSafe1__._undefined16461651__WEBPACK_MODULE_REFERENCE__6_5b22757365526566225d_call_directImport_asiSafe1__._undefined16841689__WEBPACK_MODULE_REFERENCE__6_5b22757365526566225d_call_directImport_asiSafe1__._undefined17061714__WEBPACK_MODULE_REFERENCE__6_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined18401848__WEBPACK_MODULE_REFERENCE__6_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined23902405__WEBPACK_MODULE_REFERENCE__11_5b22757365456666656374697665526f6c65225d_call_directImport_asiSafe1__._undefined32893297__WEBPACK_MODULE_REFERENCE__6_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined33953403__WEBPACK_MODULE_REFERENCE__6_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined34643465__WEBPACK_MODULE_REFERENCE__10_5b22696f225d_call_directImport_asiSafe1__._undefined41164124__WEBPACK_MODULE_REFERENCE__6_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined42434256__WEBPACK_MODULE_REFERENCE__9_5b22676574556e72656164436f756e74225d_call_directImport_asiSafe1__._undefined44544462__WEBPACK_MODULE_REFERENCE__6_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined45634576__WEBPACK_MODULE_REFERENCE__9_5b226765744d7944617368626f617264225d_call_directImport_asiSafe1__._undefined48924900__WEBPACK_MODULE_REFERENCE__6_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined53605364__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined53665374__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined54255428__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined56365640__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined57945798__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined60196023__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined60256028__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined62656268__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined65796582__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined69516955__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined71757179__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined71817189__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined73127315__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined73177320__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined76707673__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined76757678__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined80778081__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined80838091__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined82148217__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined82198222__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined86588661__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined86638666__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined90799082__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined90849087__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined95319534__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined95369539__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined98779881__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined98839891__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined1001410018__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1002010023__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined1036510368__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1091210915__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1159511598__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1217612180__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1218212185__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined1251812521__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1306413067__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1369413697__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1427514279__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1456814572__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1499414997__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1519215206__WEBPACK_MODULE_REFERENCE__5_5b22666f726d617453686f72744e616d65225d_call_directImport_asiSafe1__._undefined1544215445__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1591115914__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1642716430__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1698016983__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1762517629__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1796917973__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1797517983__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined1815418158__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1816018163__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined1872318726__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1938819391__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2024520249__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2025120254__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined2081620819__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2148121484__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2259422598__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2260022608__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined2277922783__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2278522788__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined2335223355__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2406524068__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2487324877__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2534225345__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2618826192__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2619426197__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined2675226755__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2746427467__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2822028224__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2867928682__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2952529529__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2953129534__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined3009430097__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3075930762__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3190531909__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3191131914__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined3243332436__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3305033053__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3391833922__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3392433927__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined3444334447__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3514335146__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3612636129__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3702037024__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3702637029__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined3754737550__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3816438167__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3900139005__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3900739010__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined3953039533__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4014740150__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4104241045__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4130341307__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4199541998__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4261242615__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4354443547__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4380543809__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4423544241__WEBPACK_MODULE_REFERENCE__3_5b227369676e4f7574225d_call_directImport_asiSafe1__._undefined4467344676__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4527645279__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4638646390__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4639246400__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined4652346526__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4652846531__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined4691646919__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4692146924__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined4742547428__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4743047445__WEBPACK_MODULE_REFERENCE__8_5b224c616e67756167655377697463686572225d_directImport_asiSafe1__._undefined4757247576__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4777347776__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4777847793__WEBPACK_MODULE_REFERENCE__8_5b224c616e67756167655377697463686572225d_directImport_asiSafe1__._undefined4785547858__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4815648159__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4860548608__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4891848921__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4948949493__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4970749711__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4971349721__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined4982849832__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4983449837__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined5017650179__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5063550638__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5123551239__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5124151244__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined5159151594__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5205052053__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5278452788__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5279052798__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined5290552909__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5291152914__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined5326753270__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5372653729__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5429554299__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5430154304__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined5464354646__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5510255105__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5578155785__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5578755790__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined5614156144__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5660056603__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5743457438__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5744057448__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined5755557559__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5756157564__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined5790757910__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5841458417__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5905959062__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5950159505__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5950759515__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined5963859642__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5964459647__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined6004060043__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6054760550__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6118861192__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined6119461197__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined6158861591__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6209562098__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6296862972__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined6297462982__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined6310563109__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined6311163114__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined6351563518__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6407164074__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6473564739__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined6510865111__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6574965753__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined6575565758__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined6614566148__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6665266655__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6750567509__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined6751167514__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined6786767870__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6832668329__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6903469038__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined6904069043__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined6939469397__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6985869861__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7051070514__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined7051670519__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined7085870862__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined7138171384__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7224472247__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7289872902__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined7290472907__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined7325673259__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7372073723__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7434174345__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined7453474540__WEBPACK_MODULE_REFERENCE__3_5b227369676e4f7574225d_call_directImport_asiSafe1__._undefined7497474977__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7542475427__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7610076104__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined7610676114__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined7622176224__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7622676229__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined7662776630__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7663276635__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined7721077213__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7734177345__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined7755677559__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7775077754__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined7790877911__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7815678159__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7844778451__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined7862978632__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7901379016__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7901879021__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined7953379536__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined”"93176(0,app_dynamic["default"])undefined525611(0,navigation.useRouter)undefined637727(0,navigation.usePathname)undefined762850(0,auth/* useSession */.wV)undefined881967(0,context_locale/* useLocale */.Y)undefined10081092(0,react.useState)undefined11441228(0,react.useState)undefined12801364(0,react.useState)undefined14161500(0,react.useState)undefined15461630(0,react.useState)undefined16721756(0,react.useState)undefined18011885(0,react.useState)undefined19171997(0,react.useRef)undefined20282108(0,react.useRef)undefined21402220(0,react.useRef)undefined22532333(0,react.useRef)undefined23502436(0,react.useEffect)undefined25622648(0,react.useEffect)undefined31903291useEffectiveRoleundefined41754261(0,react.useEffect)undefined43594445(0,react.useEffect)undefined45064579(0,esm.io)undefined52305316(0,react.useEffect)undefined54355531(0,api/* getUnreadCount */.$M)undefined57295815(0,react.useEffect)undefined59166012(0,api/* getMyDashboard */.H)undefined63286414(0,react.useEffect)undefined68746950(0,jsx_runtime.jsxs)undefined69527031jsx_runtime.Fragmentundefined70827156(0,jsx_runtime.jsx)undefined73647440(0,jsx_runtime.jsxs)undefined75947670(0,jsx_runtime.jsxs)undefined78917967(0,jsx_runtime.jsxs)undefined79698046(link_default())undefined82838357(0,jsx_runtime.jsx)undefined86688742(0,jsx_runtime.jsx)undefined91119187(0,jsx_runtime.jsxs)undefined94079483(0,jsx_runtime.jsxs)undefined94859564jsx_runtime.Fragmentundefined96879761(0,jsx_runtime.jsx)undefined97639840(link_default())undefined1019010264(0,jsx_runtime.jsx)undefined1026610343(link_default())undefined1074210818(0,jsx_runtime.jsxs)undefined1082010899jsx_runtime.Fragmentundefined1102211096(0,jsx_runtime.jsx)undefined1109811175(link_default())undefined1161111685(0,jsx_runtime.jsx)undefined1168711764(link_default())undefined1217712251(0,jsx_runtime.jsx)undefined1225312330(link_default())undefined1277412848(0,jsx_runtime.jsx)undefined1285012927(link_default())undefined1326513341(0,jsx_runtime.jsxs)undefined1334313422jsx_runtime.Fragmentundefined1354513621(0,jsx_runtime.jsxs)undefined1362313700(link_default())undefined1404214116(0,jsx_runtime.jsx)undefined1466014734(0,jsx_runtime.jsx)undefined1541415488(0,jsx_runtime.jsx)undefined1606616142(0,jsx_runtime.jsxs)undefined1614416221(link_default())undefined1655416628(0,jsx_runtime.jsx)undefined1717117245(0,jsx_runtime.jsx)undefined1787217946(0,jsx_runtime.jsx)undefined1852418600(0,jsx_runtime.jsxs)undefined1888918965(0,jsx_runtime.jsxs)undefined1938719461(0,jsx_runtime.jsx)undefined1965619754(0,formatName/* formatShortName */.H)undefined1999020064(0,jsx_runtime.jsx)undefined2053020604(0,jsx_runtime.jsx)undefined2111721191(0,jsx_runtime.jsx)undefined2174121815(0,jsx_runtime.jsx)undefined2245722533(0,jsx_runtime.jsxs)undefined2287322949(0,jsx_runtime.jsxs)undefined2295123030jsx_runtime.Fragmentundefined2320123277(0,jsx_runtime.jsxs)undefined2327923356(link_default())undefined2391623990(0,jsx_runtime.jsx)undefined2465224726(0,jsx_runtime.jsx)undefined2558025656(0,jsx_runtime.jsxs)undefined2565825735(link_default())undefined2629726371(0,jsx_runtime.jsx)undefined2703327107(0,jsx_runtime.jsx)undefined2821728293(0,jsx_runtime.jsxs)undefined2829528374jsx_runtime.Fragmentundefined2854528621(0,jsx_runtime.jsxs)undefined2862328700(link_default())undefined2926429338(0,jsx_runtime.jsx)undefined3004830122(0,jsx_runtime.jsx)undefined3092731003(0,jsx_runtime.jsxs)undefined3146831542(0,jsx_runtime.jsx)undefined3238532461(0,jsx_runtime.jsxs)undefined3246332540(link_default())undefined3309533169(0,jsx_runtime.jsx)undefined3387833952(0,jsx_runtime.jsx)undefined3470534781(0,jsx_runtime.jsxs)undefined3523635310(0,jsx_runtime.jsx)undefined3615336229(0,jsx_runtime.jsxs)undefined3623136308(link_default())undefined3686836942(0,jsx_runtime.jsx)undefined3760437678(0,jsx_runtime.jsx)undefined3882138897(0,jsx_runtime.jsxs)undefined3889938976(link_default())undefined3949539569(0,jsx_runtime.jsx)undefined4018340257(0,jsx_runtime.jsx)undefined4112241198(0,jsx_runtime.jsxs)undefined4120041277(link_default())undefined4179341869(0,jsx_runtime.jsxs)undefined4256542639(0,jsx_runtime.jsx)undefined4361943693(0,jsx_runtime.jsx)undefined4458444660(0,jsx_runtime.jsxs)undefined4466244739(link_default())undefined4525745331(0,jsx_runtime.jsx)undefined4594546019(0,jsx_runtime.jsx)undefined4685346929(0,jsx_runtime.jsxs)undefined4693147008(link_default())undefined4752847602(0,jsx_runtime.jsx)undefined4821648290(0,jsx_runtime.jsx)undefined4918249256(0,jsx_runtime.jsx)undefined4951449590(0,jsx_runtime.jsxs)undefined5027850352(0,jsx_runtime.jsx)undefined5096651040(0,jsx_runtime.jsx)undefined5196952043(0,jsx_runtime.jsx)undefined5230152377(0,jsx_runtime.jsxs)undefined5280352885(0,auth/* signOut */.CI)undefined5331753391(0,jsx_runtime.jsx)undefined5399154065(0,jsx_runtime.jsx)undefined5517255248(0,jsx_runtime.jsxs)undefined5525055329jsx_runtime.Fragmentundefined5545255526(0,jsx_runtime.jsx)undefined5552855605(link_default())undefined5599056064(0,jsx_runtime.jsx)undefined5606656143(link_default())undefined5664456718(0,jsx_runtime.jsx)undefined5672056815LanguageSwitcherundefined5694257018(0,jsx_runtime.jsxs)undefined5721557289(0,jsx_runtime.jsx)undefined5729157386LanguageSwitcherundefined5744857522(0,jsx_runtime.jsx)undefined5782057894(0,jsx_runtime.jsx)undefined5834058414(0,jsx_runtime.jsx)undefined5872458798(0,jsx_runtime.jsx)undefined5936659442(0,jsx_runtime.jsxs)undefined5965659732(0,jsx_runtime.jsxs)undefined5973459813jsx_runtime.Fragmentundefined5992059996(0,jsx_runtime.jsxs)undefined5999860075(link_default())undefined6041460488(0,jsx_runtime.jsx)undefined6094461018(0,jsx_runtime.jsx)undefined6161561691(0,jsx_runtime.jsxs)undefined6169361770(link_default())undefined6211762191(0,jsx_runtime.jsx)undefined6264762721(0,jsx_runtime.jsx)undefined6345263528(0,jsx_runtime.jsxs)undefined6353063609jsx_runtime.Fragmentundefined6371663792(0,jsx_runtime.jsxs)undefined6379463871(link_default())undefined6422464298(0,jsx_runtime.jsx)undefined6475464828(0,jsx_runtime.jsx)undefined6539465470(0,jsx_runtime.jsxs)undefined6547265549(link_default())undefined6588865962(0,jsx_runtime.jsx)undefined6641866492(0,jsx_runtime.jsx)undefined6716867244(0,jsx_runtime.jsxs)undefined6724667323(link_default())undefined6767467748(0,jsx_runtime.jsx)undefined6820468278(0,jsx_runtime.jsx)undefined6910969185(0,jsx_runtime.jsxs)undefined6918769266jsx_runtime.Fragmentundefined6937369449(0,jsx_runtime.jsxs)undefined6945169528(link_default())undefined6987169945(0,jsx_runtime.jsx)undefined7044970523(0,jsx_runtime.jsx)undefined7116571239(0,jsx_runtime.jsx)undefined7167871754(0,jsx_runtime.jsxs)undefined7175671835jsx_runtime.Fragmentundefined7195872034(0,jsx_runtime.jsxs)undefined7203672113(link_default())undefined7250672580(0,jsx_runtime.jsx)undefined7308473158(0,jsx_runtime.jsx)undefined7379673872(0,jsx_runtime.jsxs)undefined7387473951(link_default())undefined7434274416(0,jsx_runtime.jsx)undefined7492074994(0,jsx_runtime.jsx)undefined7586475940(0,jsx_runtime.jsxs)undefined7594276021jsx_runtime.Fragmentundefined7614476220(0,jsx_runtime.jsxs)undefined7622276299(link_default())undefined7670076774(0,jsx_runtime.jsx)undefined7732777401(0,jsx_runtime.jsx)undefined7806278138(0,jsx_runtime.jsxs)undefined7850778581(0,jsx_runtime.jsx)undefined7921979295(0,jsx_runtime.jsxs)undefined7929779374(link_default())undefined7976179835(0,jsx_runtime.jsx)undefined8033980413(0,jsx_runtime.jsx)undefined8126381339(0,jsx_runtime.jsxs)undefined8134181418(link_default())undefined8177181845(0,jsx_runtime.jsx)undefined8230182375(0,jsx_runtime.jsx)undefined8308083156(0,jsx_runtime.jsxs)undefined8315883235(link_default())undefined8358683660(0,jsx_runtime.jsx)undefined8412184195(0,jsx_runtime.jsx)undefined8484484920(0,jsx_runtime.jsxs)undefined8492284999(link_default())undefined8533885414(0,jsx_runtime.jsxs)undefined8593386007(0,jsx_runtime.jsx)undefined8686786941(0,jsx_runtime.jsx)undefined8759287668(0,jsx_runtime.jsxs)undefined8767087747(link_default())undefined8809688170(0,jsx_runtime.jsx)undefined8863188705(0,jsx_runtime.jsx)undefined8932389399(0,jsx_runtime.jsxs)undefined8958889670(0,auth/* signOut */.CI)undefined9010490178(0,jsx_runtime.jsx)undefined9062590699(0,jsx_runtime.jsx)undefined9137291448(0,jsx_runtime.jsxs)undefined9145091529jsx_runtime.Fragmentundefined9163691710(0,jsx_runtime.jsx)undefined9171291789(link_default())undefined9218792261(0,jsx_runtime.jsx)undefined9226392340(link_default())undefined9291592989(0,jsx_runtime.jsx)undefined9311793193(0,jsx_runtime.jsxs)undefined9340493478(0,jsx_runtime.jsx)undefined9366993745(0,jsx_runtime.jsxs)undefined9389993973(0,jsx_runtime.jsx)undefined9421894292(0,jsx_runtime.jsx)undefined9458094656(0,jsx_runtime.jsxs)undefined9483494908(0,jsx_runtime.jsx)undefined9528995363(0,jsx_runtime.jsx)undefined9536595442(link_default())undefined9595496028(0,jsx_runtime.jsx)undefinedSÿÿÿTÿÿÿ, /***/ 9808:  Áh«webpack/lib/util/registerExternalSerializerœwebpack-sources/ConcatSource€«webpack/lib/util/registerExternalSerializer™webpack-sources/RawSource_/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; «webpack/lib/util/registerExternalSerializerœwebpack-sources/CachedSource Ö«webpack/lib/util/registerExternalSerializerœwebpack-sources/ConcatSource€«webpack/lib/util/registerExternalSerializer™webpack-sources/RawSource† // EXPORTS __webpack_require__.d(__webpack_exports__, { Footer: () => (/* binding */ Footer) }); // EXTERNAL MODULE: ../../node_modules/next/dist/compiled/react/jsx-runtime.js var jsx_runtime = __webpack_require__(4568); // EXTERNAL MODULE: ./src/context/locale.tsx var locale = __webpack_require__(9906); // EXTERNAL MODULE: ../../node_modules/next/dist/compiled/react/index.js var react = __webpack_require__(7620); // EXTERNAL MODULE: ../../node_modules/next/dist/client/app-dir/link.js var app_dir_link = __webpack_require__(9664); var link_default = /*#__PURE__*/__webpack_require__.n(app_dir_link); ;// ./src/components/SocialIcons.tsx «webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSource«webpack/lib/util/registerExternalSerializerœwebpack-sources/CachedSource J«webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSource«webpack/lib/util/registerExternalSerializer™webpack-sources/RawSource2import { jsx as _jsx } from "react/jsx-runtime"; const ICONS = [ { key: 'telegram', label: 'Telegram', hoverClass: 'hover:text-sky-500', svg: '' }, { key: 'instagram', label: 'Instagram', hoverClass: 'hover:text-pink-500', svg: '' }, { key: 'facebook', label: 'Facebook', hoverClass: 'hover:text-green-600', svg: '' }, { key: 'twitter', label: 'X', hoverClass: 'hover:text-gray-900', svg: '' }, { key: 'youtube', label: 'YouTube', hoverClass: 'hover:text-red-600', svg: '' }, { key: 'tiktok', label: 'TikTok', hoverClass: 'hover:text-black', svg: '' }, { key: 'whatsapp', label: 'WhatsApp', hoverClass: 'hover:text-green-500', svg: '' }, { key: 'viber', label: 'Viber', hoverClass: 'hover:text-purple-600', svg: '' } ]; export function SocialIcons(param) { let { className = '', links } = param; const active = ICONS.filter((param)=>{ let { key } = param; return links === null || links === void 0 ? void 0 : links[key]; }); if (active.length === 0) return null; return /*#__PURE__*/ _jsx("div", { className: "flex gap-4 flex-wrap ".concat(className), children: active.map((param)=>{ let { key, label, hoverClass, svg } = param; return /*#__PURE__*/ _jsx("a", { href: links[key], target: "_blank", rel: "noopener noreferrer", "aria-label": label, className: "text-gray-500 transition ".concat(hoverClass), children: /*#__PURE__*/ _jsx("svg", { width: "22", height: "22", viewBox: "0 0 24 24", fill: "currentColor", dangerouslySetInnerHTML: { __html: svg } }) }, key); }) }); } `/GÙßÓÖçꀀË__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._ÿÿ€†buffer†source„size„maps„hashÐ const ICONS = [ { key: 'telegram', label: 'Telegram', hoverClass: 'hover:text-sky-500', svg: '' }, { key: 'instagram', label: 'Instagram', hoverClass: 'hover:text-pink-500', svg: '' }, { key: 'facebook', label: 'Facebook', hoverClass: 'hover:text-green-600', svg: '' }, { key: 'twitter', label: 'X', hoverClass: 'hover:text-gray-900', svg: '' }, { key: 'youtube', label: 'YouTube', hoverClass: 'hover:text-red-600', svg: '' }, { key: 'tiktok', label: 'TikTok', hoverClass: 'hover:text-black', svg: '' }, { key: 'whatsapp', label: 'WhatsApp', hoverClass: 'hover:text-green-500', svg: '' }, { key: 'viber', label: 'Viber', hoverClass: 'hover:text-purple-600', svg: '' } ]; function SocialIcons(param) { let { className = '', links } = param; const active = ICONS.filter((param)=>{ let { key } = param; return links === null || links === void 0 ? void 0 : links[key]; }); if (active.length === 0) return null; return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "flex gap-4 flex-wrap ".concat(className), children: active.map((param)=>{ let { key, label, hoverClass, svg } = param; return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("a", { href: links[key], target: "_blank", rel: "noopener noreferrer", "aria-label": label, className: "text-gray-500 transition ".concat(hoverClass), children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("svg", { width: "22", height: "22", viewBox: "0 0 24 24", fill: "currentColor", dangerouslySetInnerHTML: { __html: svg } }) }, key); }) }); } €•{"finalSource":false}ƒmap‹bufferedMap ReplaceSourceRawSource2import { jsx as _jsx } from "react/jsx-runtime"; const ICONS = [ { key: 'telegram', label: 'Telegram', hoverClass: 'hover:text-sky-500', svg: '' }, { key: 'instagram', label: 'Instagram', hoverClass: 'hover:text-pink-500', svg: '' }, { key: 'facebook', label: 'Facebook', hoverClass: 'hover:text-green-600', svg: '' }, { key: 'twitter', label: 'X', hoverClass: 'hover:text-gray-900', svg: '' }, { key: 'youtube', label: 'YouTube', hoverClass: 'hover:text-red-600', svg: '' }, { key: 'tiktok', label: 'TikTok', hoverClass: 'hover:text-black', svg: '' }, { key: 'whatsapp', label: 'WhatsApp', hoverClass: 'hover:text-green-500', svg: '' }, { key: 'viber', label: 'Viber', hoverClass: 'hover:text-purple-600', svg: '' } ]; export function SocialIcons(param) { let { className = '', links } = param; const active = ICONS.filter((param)=>{ let { key } = param; return links === null || links === void 0 ? void 0 : links[key]; }); if (active.length === 0) return null; return /*#__PURE__*/ _jsx("div", { className: "flex gap-4 flex-wrap ".concat(className), children: active.map((param)=>{ let { key, label, hoverClass, svg } = param; return /*#__PURE__*/ _jsx("a", { href: links[key], target: "_blank", rel: "noopener noreferrer", "aria-label": label, className: "text-gray-500 transition ".concat(hoverClass), children: /*#__PURE__*/ _jsx("svg", { width: "22", height: "22", viewBox: "0 0 24 24", fill: "currentColor", dangerouslySetInnerHTML: { __html: svg } }) }, key); }) }); } 1047undefined63616367undefined66616664__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined68676870__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined71437146__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefinedEÎã->ˆ“(0,jsx_runtime.jsx)ÿÿ! ;// ./src/components/Footer.tsx  Ò!«webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSource«webpack/lib/util/registerExternalSerializer™webpack-sources/RawSourceì/* __next_internal_client_entry_do_not_use__ Footer auto */ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { useLocale } from '@/context/locale'; import { useEffect, useState } from 'react'; import Link from 'next/link'; import { SocialIcons } from './SocialIcons'; const API = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; export function Footer() { const { t } = useLocale(); const year = new Date().getFullYear(); const [socialLinks, setSocialLinks] = useState({}); useEffect(()=>{ fetch("".concat(API, "/api/admin/social-public")).then((r)=>r.ok ? r.json() : {}).then((kv)=>{ const links = {}; for (const [k, v] of Object.entries(kv)){ if (v) links[k.replace('social.', '')] = v; } setSocialLinks(links); }).catch(()=>{}); }, []); return /*#__PURE__*/ _jsx("footer", { className: "bg-white border-t border-gray-200 mt-16", children: /*#__PURE__*/ _jsxs("div", { className: "max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-12", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex flex-col md:flex-row justify-between items-start gap-10", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-[200px] flex flex-col items-start", children: [ /*#__PURE__*/ _jsx("span", { className: "logo-text text-3xl text-green-700 font-bold mb-2", children: "CanHelp" }), /*#__PURE__*/ _jsx("p", { className: "text-base text-gray-600 mb-4", children: t('footer.slogan') }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-[180px]", children: [ /*#__PURE__*/ _jsx("h3", { className: "text-lg font-semibold text-gray-900 mb-3", children: t('footer.links') }), /*#__PURE__*/ _jsxs("ul", { className: "space-y-2", children: [ /*#__PURE__*/ _jsx("li", { children: /*#__PURE__*/ _jsx(Link, { href: "/", className: "hover:text-green-600 transition", children: t('nav.home') }) }), /*#__PURE__*/ _jsx("li", { children: /*#__PURE__*/ _jsx(Link, { href: "/tasks", className: "hover:text-green-600 transition", children: t('nav.tasks') }) }), /*#__PURE__*/ _jsx("li", { children: /*#__PURE__*/ _jsx(Link, { href: "/specialists", className: "hover:text-green-600 transition", children: t('nav.specialists') }) }), /*#__PURE__*/ _jsx("li", { children: /*#__PURE__*/ _jsx(Link, { href: "/pricing", className: "hover:text-green-600 transition", children: t('nav.pricing') }) }), /*#__PURE__*/ _jsx("li", { children: /*#__PURE__*/ _jsx(Link, { href: "/support", className: "hover:text-green-600 transition", children: t('support.title') }) }), /*#__PURE__*/ _jsx("li", { children: /*#__PURE__*/ _jsx(Link, { href: "/privacy", className: "hover:text-green-600 transition", children: t('nav.privacy') }) }), /*#__PURE__*/ _jsx("li", { children: /*#__PURE__*/ _jsx(Link, { href: "/delete-account", className: "hover:text-red-500 transition", children: t('nav.delete_account') }) }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-[180px]", children: [ /*#__PURE__*/ _jsx("h3", { className: "text-lg font-semibold text-gray-900 mb-3", children: t('footer.socials') }), /*#__PURE__*/ _jsx("p", { className: "text-gray-500 text-sm mb-2", children: "info@canhelp.gr" }), /*#__PURE__*/ _jsx(SocialIcons, { className: "mt-2", links: socialLinks }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "mt-10 border-t border-gray-100 pt-6 text-center text-gray-400 text-sm", children: [ "\xa9 ", year, " CanHelp. ", t('footer.rights') ] }) ] }) }); } c/{ fetch("".concat(API, "/api/admin/social-public")).then((r)=>r.ok ? r.json() : {}).then((kv)=>{ const links = {}; for (const [k, v] of Object.entries(kv)){ if (v) links[k.replace('social.', '')] = v; } setSocialLinks(links); }).catch(()=>{}); }, []); return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("footer", { className: "bg-white border-t border-gray-200 mt-16", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-12", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "flex flex-col md:flex-row justify-between items-start gap-10", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "flex-1 min-w-[200px] flex flex-col items-start", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { className: "logo-text text-3xl text-green-700 font-bold mb-2", children: "CanHelp" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { className: "text-base text-gray-600 mb-4", children: t('footer.slogan') }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "flex-1 min-w-[180px]", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("h3", { className: "text-lg font-semibold text-gray-900 mb-3", children: t('footer.links') }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("ul", { className: "space-y-2", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("li", { children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__3_5b2264656661756c74225d_directImport_asiSafe1__._, { href: "/", className: "hover:text-green-600 transition", children: t('nav.home') }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("li", { children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__3_5b2264656661756c74225d_directImport_asiSafe1__._, { href: "/tasks", className: "hover:text-green-600 transition", children: t('nav.tasks') }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("li", { children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__3_5b2264656661756c74225d_directImport_asiSafe1__._, { href: "/specialists", className: "hover:text-green-600 transition", children: t('nav.specialists') }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("li", { children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__3_5b2264656661756c74225d_directImport_asiSafe1__._, { href: "/pricing", className: "hover:text-green-600 transition", children: t('nav.pricing') }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("li", { children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__3_5b2264656661756c74225d_directImport_asiSafe1__._, { href: "/support", className: "hover:text-green-600 transition", children: t('support.title') }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("li", { children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__3_5b2264656661756c74225d_directImport_asiSafe1__._, { href: "/privacy", className: "hover:text-green-600 transition", children: t('nav.privacy') }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("li", { children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__3_5b2264656661756c74225d_directImport_asiSafe1__._, { href: "/delete-account", className: "hover:text-red-500 transition", children: t('nav.delete_account') }) }) ] }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "flex-1 min-w-[180px]", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("h3", { className: "text-lg font-semibold text-gray-900 mb-3", children: t('footer.socials') }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { className: "text-gray-500 text-sm mb-2", children: "info@canhelp.gr" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__4_5b22536f6369616c49636f6e73225d_directImport_asiSafe1__._, { className: "mt-2", links: socialLinks }) ] }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "mt-10 border-t border-gray-100 pt-6 text-center text-gray-400 text-sm", children: [ "\xa9 ", year, " CanHelp. ", t('footer.rights') ] }) ] }) }); } ïò óì/* __next_internal_client_entry_do_not_use__ Footer auto */ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { useLocale } from '@/context/locale'; import { useEffect, useState } from 'react'; import Link from 'next/link'; import { SocialIcons } from './SocialIcons'; const API = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; export function Footer() { const { t } = useLocale(); const year = new Date().getFullYear(); const [socialLinks, setSocialLinks] = useState({}); useEffect(()=>{ fetch("".concat(API, "/api/admin/social-public")).then((r)=>r.ok ? r.json() : {}).then((kv)=>{ const links = {}; for (const [k, v] of Object.entries(kv)){ if (v) links[k.replace('social.', '')] = v; } setSocialLinks(links); }).catch(()=>{}); }, []); return /*#__PURE__*/ _jsx("footer", { className: "bg-white border-t border-gray-200 mt-16", children: /*#__PURE__*/ _jsxs("div", { className: "max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-12", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex flex-col md:flex-row justify-between items-start gap-10", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-[200px] flex flex-col items-start", children: [ /*#__PURE__*/ _jsx("span", { className: "logo-text text-3xl text-green-700 font-bold mb-2", children: "CanHelp" }), /*#__PURE__*/ _jsx("p", { className: "text-base text-gray-600 mb-4", children: t('footer.slogan') }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-[180px]", children: [ /*#__PURE__*/ _jsx("h3", { className: "text-lg font-semibold text-gray-900 mb-3", children: t('footer.links') }), /*#__PURE__*/ _jsxs("ul", { className: "space-y-2", children: [ /*#__PURE__*/ _jsx("li", { children: /*#__PURE__*/ _jsx(Link, { href: "/", className: "hover:text-green-600 transition", children: t('nav.home') }) }), /*#__PURE__*/ _jsx("li", { children: /*#__PURE__*/ _jsx(Link, { href: "/tasks", className: "hover:text-green-600 transition", children: t('nav.tasks') }) }), /*#__PURE__*/ _jsx("li", { children: /*#__PURE__*/ _jsx(Link, { href: "/specialists", className: "hover:text-green-600 transition", children: t('nav.specialists') }) }), /*#__PURE__*/ _jsx("li", { children: /*#__PURE__*/ _jsx(Link, { href: "/pricing", className: "hover:text-green-600 transition", children: t('nav.pricing') }) }), /*#__PURE__*/ _jsx("li", { children: /*#__PURE__*/ _jsx(Link, { href: "/support", className: "hover:text-green-600 transition", children: t('support.title') }) }), /*#__PURE__*/ _jsx("li", { children: /*#__PURE__*/ _jsx(Link, { href: "/privacy", className: "hover:text-green-600 transition", children: t('nav.privacy') }) }), /*#__PURE__*/ _jsx("li", { children: /*#__PURE__*/ _jsx(Link, { href: "/delete-account", className: "hover:text-red-500 transition", children: t('nav.delete_account') }) }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-[180px]", children: [ /*#__PURE__*/ _jsx("h3", { className: "text-lg font-semibold text-gray-900 mb-3", children: t('footer.socials') }), /*#__PURE__*/ _jsx("p", { className: "text-gray-500 text-sm mb-2", children: "info@canhelp.gr" }), /*#__PURE__*/ _jsx(SocialIcons, { className: "mt-2", links: socialLinks }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "mt-10 border-t border-gray-100 pt-6 text-center text-gray-400 text-sm", children: [ "\xa9 ", year, " CanHelp. ", t('footer.rights') ] }) ] }) }); } Ü60122undefined124168undefined170213undefined215243undefined245288undefined302332"https://api.canhelp.gr"undefined3373590undefined362368undefined407415__WEBPACK_MODULE_REFERENCE__1_5b227573654c6f63616c65225d_call_directImport_asiSafe1__._undefined505512__WEBPACK_MODULE_REFERENCE__2_5b227573655374617465225d_call_directImport_asiSafe1__._undefined523531__WEBPACK_MODULE_REFERENCE__2_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined898901__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined10091013__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined11491153__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined13291333__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined15191522__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined17711774__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined20582062__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined22222225__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined24722476__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined26482651__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined27292732__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined27342737__WEBPACK_MODULE_REFERENCE__3_5b2264656661756c74225d_directImport_asiSafe1__._undefined31123115__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined31933196__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined31983201__WEBPACK_MODULE_REFERENCE__3_5b2264656661756c74225d_directImport_asiSafe1__._undefined35823585__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined36633666__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined36683671__WEBPACK_MODULE_REFERENCE__3_5b2264656661756c74225d_directImport_asiSafe1__._undefined40644067__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined41454148__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined41504153__WEBPACK_MODULE_REFERENCE__3_5b2264656661756c74225d_directImport_asiSafe1__._undefined45384541__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined46194622__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined46244627__WEBPACK_MODULE_REFERENCE__3_5b2264656661756c74225d_directImport_asiSafe1__._undefined50145017__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined50955098__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined51005103__WEBPACK_MODULE_REFERENCE__3_5b2264656661756c74225d_directImport_asiSafe1__._undefined54885491__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined55695572__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined55745577__WEBPACK_MODULE_REFERENCE__3_5b2264656661756c74225d_directImport_asiSafe1__._undefined60886092__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined62526255__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined65046507__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined67396742__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined67446754__WEBPACK_MODULE_REFERENCE__4_5b22536f6369616c49636f6e73225d_directImport_asiSafe1__._undefined70337037__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined`'_’èB–¡÷f°hð<ì8ò<5› ç ‡ Ñ È  À X ¢ € ñ h²_JL™`®øúGÐh²Ž‚Ìdf³6€Îgè2€ÊMÌ d !N!G"‘"y#Ã#Å#$1%}%›(0,locale/* useLocale */.Y)’(0,react.useState)“(0,react.useEffect)ñ”(0,jsx_runtime.jsxs)ÿÿððÿðÿðð(link_default())ïïÿïïÿïïÿïïÿïïÿïïÿþïïï‹SocialIconsý€†buffer†source„size„maps„hashÔ= // EXPORTS __webpack_require__.d(__webpack_exports__, { Footer: () => (/* binding */ Footer) }); // EXTERNAL MODULE: ../../node_modules/next/dist/compiled/react/jsx-runtime.js var jsx_runtime = __webpack_require__(4568); // EXTERNAL MODULE: ./src/context/locale.tsx var locale = __webpack_require__(9906); // EXTERNAL MODULE: ../../node_modules/next/dist/compiled/react/index.js var react = __webpack_require__(7620); // EXTERNAL MODULE: ../../node_modules/next/dist/client/app-dir/link.js var app_dir_link = __webpack_require__(9664); var link_default = /*#__PURE__*/__webpack_require__.n(app_dir_link); ;// ./src/components/SocialIcons.tsx const ICONS = [ { key: 'telegram', label: 'Telegram', hoverClass: 'hover:text-sky-500', svg: '' }, { key: 'instagram', label: 'Instagram', hoverClass: 'hover:text-pink-500', svg: '' }, { key: 'facebook', label: 'Facebook', hoverClass: 'hover:text-green-600', svg: '' }, { key: 'twitter', label: 'X', hoverClass: 'hover:text-gray-900', svg: '' }, { key: 'youtube', label: 'YouTube', hoverClass: 'hover:text-red-600', svg: '' }, { key: 'tiktok', label: 'TikTok', hoverClass: 'hover:text-black', svg: '' }, { key: 'whatsapp', label: 'WhatsApp', hoverClass: 'hover:text-green-500', svg: '' }, { key: 'viber', label: 'Viber', hoverClass: 'hover:text-purple-600', svg: '' } ]; function SocialIcons(param) { let { className = '', links } = param; const active = ICONS.filter((param)=>{ let { key } = param; return links === null || links === void 0 ? void 0 : links[key]; }); if (active.length === 0) return null; return /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "flex gap-4 flex-wrap ".concat(className), children: active.map((param)=>{ let { key, label, hoverClass, svg } = param; return /*#__PURE__*/ (0,jsx_runtime.jsx)("a", { href: links[key], target: "_blank", rel: "noopener noreferrer", "aria-label": label, className: "text-gray-500 transition ".concat(hoverClass), children: /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { width: "22", height: "22", viewBox: "0 0 24 24", fill: "currentColor", dangerouslySetInnerHTML: { __html: svg } }) }, key); }) }); } ;// ./src/components/Footer.tsx /* __next_internal_client_entry_do_not_use__ Footer auto */ const API = "https://api.canhelp.gr" || 0; function Footer() { const { t } = (0,locale/* useLocale */.Y)(); const year = new Date().getFullYear(); const [socialLinks, setSocialLinks] = (0,react.useState)({}); (0,react.useEffect)(()=>{ fetch("".concat(API, "/api/admin/social-public")).then((r)=>r.ok ? r.json() : {}).then((kv)=>{ const links = {}; for (const [k, v] of Object.entries(kv)){ if (v) links[k.replace('social.', '')] = v; } setSocialLinks(links); }).catch(()=>{}); }, []); return /*#__PURE__*/ (0,jsx_runtime.jsx)("footer", { className: "bg-white border-t border-gray-200 mt-16", children: /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-12", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex flex-col md:flex-row justify-between items-start gap-10", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex-1 min-w-[200px] flex flex-col items-start", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "logo-text text-3xl text-green-700 font-bold mb-2", children: "CanHelp" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "text-base text-gray-600 mb-4", children: t('footer.slogan') }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex-1 min-w-[180px]", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("h3", { className: "text-lg font-semibold text-gray-900 mb-3", children: t('footer.links') }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("ul", { className: "space-y-2", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("li", { children: /*#__PURE__*/ (0,jsx_runtime.jsx)((link_default()), { href: "/", className: "hover:text-green-600 transition", children: t('nav.home') }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)("li", { children: /*#__PURE__*/ (0,jsx_runtime.jsx)((link_default()), { href: "/tasks", className: "hover:text-green-600 transition", children: t('nav.tasks') }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)("li", { children: /*#__PURE__*/ (0,jsx_runtime.jsx)((link_default()), { href: "/specialists", className: "hover:text-green-600 transition", children: t('nav.specialists') }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)("li", { children: /*#__PURE__*/ (0,jsx_runtime.jsx)((link_default()), { href: "/pricing", className: "hover:text-green-600 transition", children: t('nav.pricing') }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)("li", { children: /*#__PURE__*/ (0,jsx_runtime.jsx)((link_default()), { href: "/support", className: "hover:text-green-600 transition", children: t('support.title') }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)("li", { children: /*#__PURE__*/ (0,jsx_runtime.jsx)((link_default()), { href: "/privacy", className: "hover:text-green-600 transition", children: t('nav.privacy') }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)("li", { children: /*#__PURE__*/ (0,jsx_runtime.jsx)((link_default()), { href: "/delete-account", className: "hover:text-red-500 transition", children: t('nav.delete_account') }) }) ] }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex-1 min-w-[180px]", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("h3", { className: "text-lg font-semibold text-gray-900 mb-3", children: t('footer.socials') }), /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "text-gray-500 text-sm mb-2", children: "info@canhelp.gr" }), /*#__PURE__*/ (0,jsx_runtime.jsx)(SocialIcons, { className: "mt-2", links: socialLinks }) ] }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "mt-10 border-t border-gray-100 pt-6 text-center text-gray-400 text-sm", children: [ "\xa9 ", year, " CanHelp. ", t('footer.rights') ] }) ] }) }); } €”{"finalSource":true}ƒmap‹bufferedMap ` ConcatSourceRawSource† // EXPORTS __webpack_require__.d(__webpack_exports__, { Footer: () => (/* binding */ Footer) }); // EXTERNAL MODULE: ../../node_modules/next/dist/compiled/react/jsx-runtime.js var jsx_runtime = __webpack_require__(4568); // EXTERNAL MODULE: ./src/context/locale.tsx var locale = __webpack_require__(9906); // EXTERNAL MODULE: ../../node_modules/next/dist/compiled/react/index.js var react = __webpack_require__(7620); // EXTERNAL MODULE: ../../node_modules/next/dist/client/app-dir/link.js var app_dir_link = __webpack_require__(9664); var link_default = /*#__PURE__*/__webpack_require__.n(app_dir_link); ;// ./src/components/SocialIcons.tsx  ReplaceSourceReplaceSourceRawSource2import { jsx as _jsx } from "react/jsx-runtime"; const ICONS = [ { key: 'telegram', label: 'Telegram', hoverClass: 'hover:text-sky-500', svg: '' }, { key: 'instagram', label: 'Instagram', hoverClass: 'hover:text-pink-500', svg: '' }, { key: 'facebook', label: 'Facebook', hoverClass: 'hover:text-green-600', svg: '' }, { key: 'twitter', label: 'X', hoverClass: 'hover:text-gray-900', svg: '' }, { key: 'youtube', label: 'YouTube', hoverClass: 'hover:text-red-600', svg: '' }, { key: 'tiktok', label: 'TikTok', hoverClass: 'hover:text-black', svg: '' }, { key: 'whatsapp', label: 'WhatsApp', hoverClass: 'hover:text-green-500', svg: '' }, { key: 'viber', label: 'Viber', hoverClass: 'hover:text-purple-600', svg: '' } ]; export function SocialIcons(param) { let { className = '', links } = param; const active = ICONS.filter((param)=>{ let { key } = param; return links === null || links === void 0 ? void 0 : links[key]; }); if (active.length === 0) return null; return /*#__PURE__*/ _jsx("div", { className: "flex gap-4 flex-wrap ".concat(className), children: active.map((param)=>{ let { key, label, hoverClass, svg } = param; return /*#__PURE__*/ _jsx("a", { href: links[key], target: "_blank", rel: "noopener noreferrer", "aria-label": label, className: "text-gray-500 transition ".concat(hoverClass), children: /*#__PURE__*/ _jsx("svg", { width: "22", height: "22", viewBox: "0 0 24 24", fill: "currentColor", dangerouslySetInnerHTML: { __html: svg } }) }, key); }) }); } 1047undefined63616367undefined66616664__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined68676870__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined71437146__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefinedu66066680(0,jsx_runtime.jsx)undefined68836957(0,jsx_runtime.jsx)undefined72307304(0,jsx_runtime.jsx)undefinedRawSource! ;// ./src/components/Footer.tsx úûì/* __next_internal_client_entry_do_not_use__ Footer auto */ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { useLocale } from '@/context/locale'; import { useEffect, useState } from 'react'; import Link from 'next/link'; import { SocialIcons } from './SocialIcons'; const API = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; export function Footer() { const { t } = useLocale(); const year = new Date().getFullYear(); const [socialLinks, setSocialLinks] = useState({}); useEffect(()=>{ fetch("".concat(API, "/api/admin/social-public")).then((r)=>r.ok ? r.json() : {}).then((kv)=>{ const links = {}; for (const [k, v] of Object.entries(kv)){ if (v) links[k.replace('social.', '')] = v; } setSocialLinks(links); }).catch(()=>{}); }, []); return /*#__PURE__*/ _jsx("footer", { className: "bg-white border-t border-gray-200 mt-16", children: /*#__PURE__*/ _jsxs("div", { className: "max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-12", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex flex-col md:flex-row justify-between items-start gap-10", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-[200px] flex flex-col items-start", children: [ /*#__PURE__*/ _jsx("span", { className: "logo-text text-3xl text-green-700 font-bold mb-2", children: "CanHelp" }), /*#__PURE__*/ _jsx("p", { className: "text-base text-gray-600 mb-4", children: t('footer.slogan') }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-[180px]", children: [ /*#__PURE__*/ _jsx("h3", { className: "text-lg font-semibold text-gray-900 mb-3", children: t('footer.links') }), /*#__PURE__*/ _jsxs("ul", { className: "space-y-2", children: [ /*#__PURE__*/ _jsx("li", { children: /*#__PURE__*/ _jsx(Link, { href: "/", className: "hover:text-green-600 transition", children: t('nav.home') }) }), /*#__PURE__*/ _jsx("li", { children: /*#__PURE__*/ _jsx(Link, { href: "/tasks", className: "hover:text-green-600 transition", children: t('nav.tasks') }) }), /*#__PURE__*/ _jsx("li", { children: /*#__PURE__*/ _jsx(Link, { href: "/specialists", className: "hover:text-green-600 transition", children: t('nav.specialists') }) }), /*#__PURE__*/ _jsx("li", { children: /*#__PURE__*/ _jsx(Link, { href: "/pricing", className: "hover:text-green-600 transition", children: t('nav.pricing') }) }), /*#__PURE__*/ _jsx("li", { children: /*#__PURE__*/ _jsx(Link, { href: "/support", className: "hover:text-green-600 transition", children: t('support.title') }) }), /*#__PURE__*/ _jsx("li", { children: /*#__PURE__*/ _jsx(Link, { href: "/privacy", className: "hover:text-green-600 transition", children: t('nav.privacy') }) }), /*#__PURE__*/ _jsx("li", { children: /*#__PURE__*/ _jsx(Link, { href: "/delete-account", className: "hover:text-red-500 transition", children: t('nav.delete_account') }) }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-[180px]", children: [ /*#__PURE__*/ _jsx("h3", { className: "text-lg font-semibold text-gray-900 mb-3", children: t('footer.socials') }), /*#__PURE__*/ _jsx("p", { className: "text-gray-500 text-sm mb-2", children: "info@canhelp.gr" }), /*#__PURE__*/ _jsx(SocialIcons, { className: "mt-2", links: socialLinks }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "mt-10 border-t border-gray-100 pt-6 text-center text-gray-400 text-sm", children: [ "\xa9 ", year, " CanHelp. ", t('footer.rights') ] }) ] }) }); } Ü60122undefined124168undefined170213undefined215243undefined245288undefined302332"https://api.canhelp.gr"undefined3373590undefined362368undefined407415__WEBPACK_MODULE_REFERENCE__1_5b227573654c6f63616c65225d_call_directImport_asiSafe1__._undefined505512__WEBPACK_MODULE_REFERENCE__2_5b227573655374617465225d_call_directImport_asiSafe1__._undefined523531__WEBPACK_MODULE_REFERENCE__2_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined898901__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined10091013__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined11491153__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined13291333__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined15191522__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined17711774__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined20582062__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined22222225__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined24722476__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined26482651__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined27292732__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined27342737__WEBPACK_MODULE_REFERENCE__3_5b2264656661756c74225d_directImport_asiSafe1__._undefined31123115__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined31933196__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined31983201__WEBPACK_MODULE_REFERENCE__3_5b2264656661756c74225d_directImport_asiSafe1__._undefined35823585__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined36633666__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined36683671__WEBPACK_MODULE_REFERENCE__3_5b2264656661756c74225d_directImport_asiSafe1__._undefined40644067__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined41454148__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined41504153__WEBPACK_MODULE_REFERENCE__3_5b2264656661756c74225d_directImport_asiSafe1__._undefined45384541__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined46194622__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined46244627__WEBPACK_MODULE_REFERENCE__3_5b2264656661756c74225d_directImport_asiSafe1__._undefined50145017__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined50955098__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined51005103__WEBPACK_MODULE_REFERENCE__3_5b2264656661756c74225d_directImport_asiSafe1__._undefined54885491__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined55695572__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined55745577__WEBPACK_MODULE_REFERENCE__3_5b2264656661756c74225d_directImport_asiSafe1__._undefined60886092__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined62526255__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined65046507__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined67396742__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined67446754__WEBPACK_MODULE_REFERENCE__4_5b22536f6369616c49636f6e73225d_directImport_asiSafe1__._undefined70337037__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefinede146232(0,locale/* useLocale */.Y)undefined322406(0,react.useState)undefined417503(0,react.useEffect)undefined870944(0,jsx_runtime.jsx)undefined10521128(0,jsx_runtime.jsxs)undefined12641340(0,jsx_runtime.jsxs)undefined15161592(0,jsx_runtime.jsxs)undefined17781852(0,jsx_runtime.jsx)undefined21012175(0,jsx_runtime.jsx)undefined24592535(0,jsx_runtime.jsxs)undefined26952769(0,jsx_runtime.jsx)undefined30163092(0,jsx_runtime.jsxs)undefined32643338(0,jsx_runtime.jsx)undefined34163490(0,jsx_runtime.jsx)undefined34923569(link_default())undefined39444018(0,jsx_runtime.jsx)undefined40964170(0,jsx_runtime.jsx)undefined41724249(link_default())undefined46304704(0,jsx_runtime.jsx)undefined47824856(0,jsx_runtime.jsx)undefined48584935(link_default())undefined53285402(0,jsx_runtime.jsx)undefined54805554(0,jsx_runtime.jsx)undefined55565633(link_default())undefined60186092(0,jsx_runtime.jsx)undefined61706244(0,jsx_runtime.jsx)undefined62466323(link_default())undefined67106784(0,jsx_runtime.jsx)undefined68626936(0,jsx_runtime.jsx)undefined69387015(link_default())undefined74007474(0,jsx_runtime.jsx)undefined75527626(0,jsx_runtime.jsx)undefined76287705(link_default())undefined82168292(0,jsx_runtime.jsxs)undefined84528526(0,jsx_runtime.jsx)undefined87758849(0,jsx_runtime.jsx)undefined90819155(0,jsx_runtime.jsx)undefined91579242SocialIconsundefined95219597(0,jsx_runtime.jsxs)undefined /***/ }) @ÿÿÿ=>/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; // EXPORTS __webpack_require__.d(__webpack_exports__, { Footer: () => (/* binding */ Footer) }); // EXTERNAL MODULE: ../../node_modules/next/dist/compiled/react/jsx-runtime.js var jsx_runtime = __webpack_require__(4568); // EXTERNAL MODULE: ./src/context/locale.tsx var locale = __webpack_require__(9906); // EXTERNAL MODULE: ../../node_modules/next/dist/compiled/react/index.js var react = __webpack_require__(7620); // EXTERNAL MODULE: ../../node_modules/next/dist/client/app-dir/link.js var app_dir_link = __webpack_require__(9664); var link_default = /*#__PURE__*/__webpack_require__.n(app_dir_link); ;// ./src/components/SocialIcons.tsx const ICONS = [ { key: 'telegram', label: 'Telegram', hoverClass: 'hover:text-sky-500', svg: '' }, { key: 'instagram', label: 'Instagram', hoverClass: 'hover:text-pink-500', svg: '' }, { key: 'facebook', label: 'Facebook', hoverClass: 'hover:text-green-600', svg: '' }, { key: 'twitter', label: 'X', hoverClass: 'hover:text-gray-900', svg: '' }, { key: 'youtube', label: 'YouTube', hoverClass: 'hover:text-red-600', svg: '' }, { key: 'tiktok', label: 'TikTok', hoverClass: 'hover:text-black', svg: '' }, { key: 'whatsapp', label: 'WhatsApp', hoverClass: 'hover:text-green-500', svg: '' }, { key: 'viber', label: 'Viber', hoverClass: 'hover:text-purple-600', svg: '' } ]; function SocialIcons(param) { let { className = '', links } = param; const active = ICONS.filter((param)=>{ let { key } = param; return links === null || links === void 0 ? void 0 : links[key]; }); if (active.length === 0) return null; return /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "flex gap-4 flex-wrap ".concat(className), children: active.map((param)=>{ let { key, label, hoverClass, svg } = param; return /*#__PURE__*/ (0,jsx_runtime.jsx)("a", { href: links[key], target: "_blank", rel: "noopener noreferrer", "aria-label": label, className: "text-gray-500 transition ".concat(hoverClass), children: /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { width: "22", height: "22", viewBox: "0 0 24 24", fill: "currentColor", dangerouslySetInnerHTML: { __html: svg } }) }, key); }) }); } ;// ./src/components/Footer.tsx /* __next_internal_client_entry_do_not_use__ Footer auto */ const API = "https://api.canhelp.gr" || 0; function Footer() { const { t } = (0,locale/* useLocale */.Y)(); const year = new Date().getFullYear(); const [socialLinks, setSocialLinks] = (0,react.useState)({}); (0,react.useEffect)(()=>{ fetch("".concat(API, "/api/admin/social-public")).then((r)=>r.ok ? r.json() : {}).then((kv)=>{ const links = {}; for (const [k, v] of Object.entries(kv)){ if (v) links[k.replace('social.', '')] = v; } setSocialLinks(links); }).catch(()=>{}); }, []); return /*#__PURE__*/ (0,jsx_runtime.jsx)("footer", { className: "bg-white border-t border-gray-200 mt-16", children: /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-12", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex flex-col md:flex-row justify-between items-start gap-10", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex-1 min-w-[200px] flex flex-col items-start", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "logo-text text-3xl text-green-700 font-bold mb-2", children: "CanHelp" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "text-base text-gray-600 mb-4", children: t('footer.slogan') }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex-1 min-w-[180px]", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("h3", { className: "text-lg font-semibold text-gray-900 mb-3", children: t('footer.links') }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("ul", { className: "space-y-2", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("li", { children: /*#__PURE__*/ (0,jsx_runtime.jsx)((link_default()), { href: "/", className: "hover:text-green-600 transition", children: t('nav.home') }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)("li", { children: /*#__PURE__*/ (0,jsx_runtime.jsx)((link_default()), { href: "/tasks", className: "hover:text-green-600 transition", children: t('nav.tasks') }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)("li", { children: /*#__PURE__*/ (0,jsx_runtime.jsx)((link_default()), { href: "/specialists", className: "hover:text-green-600 transition", children: t('nav.specialists') }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)("li", { children: /*#__PURE__*/ (0,jsx_runtime.jsx)((link_default()), { href: "/pricing", className: "hover:text-green-600 transition", children: t('nav.pricing') }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)("li", { children: /*#__PURE__*/ (0,jsx_runtime.jsx)((link_default()), { href: "/support", className: "hover:text-green-600 transition", children: t('support.title') }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)("li", { children: /*#__PURE__*/ (0,jsx_runtime.jsx)((link_default()), { href: "/privacy", className: "hover:text-green-600 transition", children: t('nav.privacy') }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)("li", { children: /*#__PURE__*/ (0,jsx_runtime.jsx)((link_default()), { href: "/delete-account", className: "hover:text-red-500 transition", children: t('nav.delete_account') }) }) ] }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex-1 min-w-[180px]", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("h3", { className: "text-lg font-semibold text-gray-900 mb-3", children: t('footer.socials') }), /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "text-gray-500 text-sm mb-2", children: "info@canhelp.gr" }), /*#__PURE__*/ (0,jsx_runtime.jsx)(SocialIcons, { className: "mt-2", links: socialLinks }) ] }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "mt-10 border-t border-gray-100 pt-6 text-center text-gray-400 text-sm", children: [ "\xa9 ", year, " CanHelp. ", t('footer.rights') ] }) ] }) }); } /***/ }) AÿÿÿDÿÿÿ `EÿÿÿFÿÿÿEÿÿÿ† // EXPORTS __webpack_require__.d(__webpack_exports__, { Footer: () => (/* binding */ Footer) }); // EXTERNAL MODULE: ../../node_modules/next/dist/compiled/react/jsx-runtime.js var jsx_runtime = __webpack_require__(4568); // EXTERNAL MODULE: ./src/context/locale.tsx var locale = __webpack_require__(9906); // EXTERNAL MODULE: ../../node_modules/next/dist/compiled/react/index.js var react = __webpack_require__(7620); // EXTERNAL MODULE: ../../node_modules/next/dist/client/app-dir/link.js var app_dir_link = __webpack_require__(9664); var link_default = /*#__PURE__*/__webpack_require__.n(app_dir_link); ;// ./src/components/SocialIcons.tsx ëGÿÿÿ2import { jsx as _jsx } from "react/jsx-runtime"; const ICONS = [ { key: 'telegram', label: 'Telegram', hoverClass: 'hover:text-sky-500', svg: '' }, { key: 'instagram', label: 'Instagram', hoverClass: 'hover:text-pink-500', svg: '' }, { key: 'facebook', label: 'Facebook', hoverClass: 'hover:text-green-600', svg: '' }, { key: 'twitter', label: 'X', hoverClass: 'hover:text-gray-900', svg: '' }, { key: 'youtube', label: 'YouTube', hoverClass: 'hover:text-red-600', svg: '' }, { key: 'tiktok', label: 'TikTok', hoverClass: 'hover:text-black', svg: '' }, { key: 'whatsapp', label: 'WhatsApp', hoverClass: 'hover:text-green-500', svg: '' }, { key: 'viber', label: 'Viber', hoverClass: 'hover:text-purple-600', svg: '' } ]; export function SocialIcons(param) { let { className = '', links } = param; const active = ICONS.filter((param)=>{ let { key } = param; return links === null || links === void 0 ? void 0 : links[key]; }); if (active.length === 0) return null; return /*#__PURE__*/ _jsx("div", { className: "flex gap-4 flex-wrap ".concat(className), children: active.map((param)=>{ let { key, label, hoverClass, svg } = param; return /*#__PURE__*/ _jsx("a", { href: links[key], target: "_blank", rel: "noopener noreferrer", "aria-label": label, className: "text-gray-500 transition ".concat(hoverClass), children: /*#__PURE__*/ _jsx("svg", { width: "22", height: "22", viewBox: "0 0 24 24", fill: "currentColor", dangerouslySetInnerHTML: { __html: svg } }) }, key); }) }); } 1047undefined63616367undefined66616664__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined68676870__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined71437146__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefinedu66066680(0,jsx_runtime.jsx)undefined68836957(0,jsx_runtime.jsx)undefined72307304(0,jsx_runtime.jsx)undefinedRawSource! ;// ./src/components/Footer.tsx çCÿÿÿì/* __next_internal_client_entry_do_not_use__ Footer auto */ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { useLocale } from '@/context/locale'; import { useEffect, useState } from 'react'; import Link from 'next/link'; import { SocialIcons } from './SocialIcons'; const API = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; export function Footer() { const { t } = useLocale(); const year = new Date().getFullYear(); const [socialLinks, setSocialLinks] = useState({}); useEffect(()=>{ fetch("".concat(API, "/api/admin/social-public")).then((r)=>r.ok ? r.json() : {}).then((kv)=>{ const links = {}; for (const [k, v] of Object.entries(kv)){ if (v) links[k.replace('social.', '')] = v; } setSocialLinks(links); }).catch(()=>{}); }, []); return /*#__PURE__*/ _jsx("footer", { className: "bg-white border-t border-gray-200 mt-16", children: /*#__PURE__*/ _jsxs("div", { className: "max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-12", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex flex-col md:flex-row justify-between items-start gap-10", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-[200px] flex flex-col items-start", children: [ /*#__PURE__*/ _jsx("span", { className: "logo-text text-3xl text-green-700 font-bold mb-2", children: "CanHelp" }), /*#__PURE__*/ _jsx("p", { className: "text-base text-gray-600 mb-4", children: t('footer.slogan') }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-[180px]", children: [ /*#__PURE__*/ _jsx("h3", { className: "text-lg font-semibold text-gray-900 mb-3", children: t('footer.links') }), /*#__PURE__*/ _jsxs("ul", { className: "space-y-2", children: [ /*#__PURE__*/ _jsx("li", { children: /*#__PURE__*/ _jsx(Link, { href: "/", className: "hover:text-green-600 transition", children: t('nav.home') }) }), /*#__PURE__*/ _jsx("li", { children: /*#__PURE__*/ _jsx(Link, { href: "/tasks", className: "hover:text-green-600 transition", children: t('nav.tasks') }) }), /*#__PURE__*/ _jsx("li", { children: /*#__PURE__*/ _jsx(Link, { href: "/specialists", className: "hover:text-green-600 transition", children: t('nav.specialists') }) }), /*#__PURE__*/ _jsx("li", { children: /*#__PURE__*/ _jsx(Link, { href: "/pricing", className: "hover:text-green-600 transition", children: t('nav.pricing') }) }), /*#__PURE__*/ _jsx("li", { children: /*#__PURE__*/ _jsx(Link, { href: "/support", className: "hover:text-green-600 transition", children: t('support.title') }) }), /*#__PURE__*/ _jsx("li", { children: /*#__PURE__*/ _jsx(Link, { href: "/privacy", className: "hover:text-green-600 transition", children: t('nav.privacy') }) }), /*#__PURE__*/ _jsx("li", { children: /*#__PURE__*/ _jsx(Link, { href: "/delete-account", className: "hover:text-red-500 transition", children: t('nav.delete_account') }) }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-[180px]", children: [ /*#__PURE__*/ _jsx("h3", { className: "text-lg font-semibold text-gray-900 mb-3", children: t('footer.socials') }), /*#__PURE__*/ _jsx("p", { className: "text-gray-500 text-sm mb-2", children: "info@canhelp.gr" }), /*#__PURE__*/ _jsx(SocialIcons, { className: "mt-2", links: socialLinks }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "mt-10 border-t border-gray-100 pt-6 text-center text-gray-400 text-sm", children: [ "\xa9 ", year, " CanHelp. ", t('footer.rights') ] }) ] }) }); } Ü60122undefined124168undefined170213undefined215243undefined245288undefined302332"https://api.canhelp.gr"undefined3373590undefined362368undefined407415__WEBPACK_MODULE_REFERENCE__1_5b227573654c6f63616c65225d_call_directImport_asiSafe1__._undefined505512__WEBPACK_MODULE_REFERENCE__2_5b227573655374617465225d_call_directImport_asiSafe1__._undefined523531__WEBPACK_MODULE_REFERENCE__2_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined898901__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined10091013__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined11491153__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined13291333__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined15191522__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined17711774__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined20582062__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined22222225__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined24722476__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined26482651__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined27292732__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined27342737__WEBPACK_MODULE_REFERENCE__3_5b2264656661756c74225d_directImport_asiSafe1__._undefined31123115__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined31933196__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined31983201__WEBPACK_MODULE_REFERENCE__3_5b2264656661756c74225d_directImport_asiSafe1__._undefined35823585__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined36633666__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined36683671__WEBPACK_MODULE_REFERENCE__3_5b2264656661756c74225d_directImport_asiSafe1__._undefined40644067__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined41454148__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined41504153__WEBPACK_MODULE_REFERENCE__3_5b2264656661756c74225d_directImport_asiSafe1__._undefined45384541__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined46194622__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined46244627__WEBPACK_MODULE_REFERENCE__3_5b2264656661756c74225d_directImport_asiSafe1__._undefined50145017__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined50955098__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined51005103__WEBPACK_MODULE_REFERENCE__3_5b2264656661756c74225d_directImport_asiSafe1__._undefined54885491__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined55695572__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined55745577__WEBPACK_MODULE_REFERENCE__3_5b2264656661756c74225d_directImport_asiSafe1__._undefined60886092__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined62526255__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined65046507__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined67396742__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined67446754__WEBPACK_MODULE_REFERENCE__4_5b22536f6369616c49636f6e73225d_directImport_asiSafe1__._undefined70337037__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefinede146232(0,locale/* useLocale */.Y)undefined322406(0,react.useState)undefined417503(0,react.useEffect)undefined870944(0,jsx_runtime.jsx)undefined10521128(0,jsx_runtime.jsxs)undefined12641340(0,jsx_runtime.jsxs)undefined15161592(0,jsx_runtime.jsxs)undefined17781852(0,jsx_runtime.jsx)undefined21012175(0,jsx_runtime.jsx)undefined24592535(0,jsx_runtime.jsxs)undefined26952769(0,jsx_runtime.jsx)undefined30163092(0,jsx_runtime.jsxs)undefined32643338(0,jsx_runtime.jsx)undefined34163490(0,jsx_runtime.jsx)undefined34923569(link_default())undefined39444018(0,jsx_runtime.jsx)undefined40964170(0,jsx_runtime.jsx)undefined41724249(link_default())undefined46304704(0,jsx_runtime.jsx)undefined47824856(0,jsx_runtime.jsx)undefined48584935(link_default())undefined53285402(0,jsx_runtime.jsx)undefined54805554(0,jsx_runtime.jsx)undefined55565633(link_default())undefined60186092(0,jsx_runtime.jsx)undefined61706244(0,jsx_runtime.jsx)undefined62466323(link_default())undefined67106784(0,jsx_runtime.jsx)undefined68626936(0,jsx_runtime.jsx)undefined69387015(link_default())undefined74007474(0,jsx_runtime.jsx)undefined75527626(0,jsx_runtime.jsx)undefined76287705(link_default())undefined82168292(0,jsx_runtime.jsxs)undefined84528526(0,jsx_runtime.jsx)undefined87758849(0,jsx_runtime.jsx)undefined90819155(0,jsx_runtime.jsx)undefined91579242SocialIconsundefined95219597(0,jsx_runtime.jsxs)undefinedCÿÿÿDÿÿÿ }, «webpack/lib/util/registerExternalSerializerœwebpack-sources/PrefixSource‰/******/ 2__webpack_require__ => { // webpackRuntimeModules ÷var __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId)) __webpack_require__.O(0, [9950,1516,9664,2838,9906,2982,587,18,7358], () => (__webpack_exec__(2568))); var __webpack_exports__ = __webpack_require__.O(); _N_E = __webpack_exports__; } ]); \ÿÿÿÿ (self["webpackChunk_N_E"] = self["webpackChunk_N_E"] || []).push([[7177],{ /***/ 300: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ AdminRolePreview: () => (/* binding */ AdminRolePreview) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1592); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7541); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(7620); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(2982); /* __next_internal_client_entry_do_not_use__ AdminRolePreview auto */ const ORIG_PLAN_KEY = 'canhelp_admin_orig_plan'; function getPreviewRole() { return null; } const TIER_COLORS = { free: 'bg-slate-100 text-slate-600', pro: 'bg-green-100 text-green-700', ultimate: 'bg-amber-100 text-amber-700' }; function AdminRolePreview() { var _session_user, _session_user1; const { data: session } = (0,_lib_auth__WEBPACK_IMPORTED_MODULE_1__/* .useSession */ .wV)(); const router = (0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)(); const isAdmin = (session === null || session === void 0 ? void 0 : (_session_user = session.user) === null || _session_user === void 0 ? void 0 : _session_user.role) === 'admin'; const userId = session === null || session === void 0 ? void 0 : (_session_user1 = session.user) === null || _session_user1 === void 0 ? void 0 : _session_user1.id; const [mounted, setMounted] = (0,react__WEBPACK_IMPORTED_MODULE_3__.useState)(false); const [plans, setPlans] = (0,react__WEBPACK_IMPORTED_MODULE_3__.useState)([]); const [activePlanId, setActivePlanId] = (0,react__WEBPACK_IMPORTED_MODULE_3__.useState)(null); const [loading, setLoading] = (0,react__WEBPACK_IMPORTED_MODULE_3__.useState)(false); const [expanded, setExpanded] = (0,react__WEBPACK_IMPORTED_MODULE_3__.useState)(false); const origPlanRef = (0,react__WEBPACK_IMPORTED_MODULE_3__.useRef)(null); (0,react__WEBPACK_IMPORTED_MODULE_3__.useEffect)(()=>setMounted(true), []); (0,react__WEBPACK_IMPORTED_MODULE_3__.useEffect)(()=>{ if (true) { origPlanRef.current = localStorage.getItem(ORIG_PLAN_KEY); } }, []); (0,react__WEBPACK_IMPORTED_MODULE_3__.useEffect)(()=>{ if (!isAdmin) return; (0,_lib_api__WEBPACK_IMPORTED_MODULE_4__/* .getPlans */ .T9)().then(setPlans).catch(()=>{}); }, [ isAdmin ]); (0,react__WEBPACK_IMPORTED_MODULE_3__.useEffect)(()=>{ var _session_user; var _session_user_planId; // Sync active plan from session const currentPlanId = (_session_user_planId = session === null || session === void 0 ? void 0 : (_session_user = session.user) === null || _session_user === void 0 ? void 0 : _session_user.planId) !== null && _session_user_planId !== void 0 ? _session_user_planId : null; setActivePlanId(currentPlanId); }, [ session ]); if (!mounted || !isAdmin) return null; const setPlan = async (planId)=>{ if (!userId) return; setLoading(true); try { // Save original plan on first change if (!origPlanRef.current && activePlanId) { localStorage.setItem(ORIG_PLAN_KEY, activePlanId); origPlanRef.current = activePlanId; } await (0,_lib_api__WEBPACK_IMPORTED_MODULE_4__/* .updateAdminUser */ .wl)(userId, { planId }); setActivePlanId(planId); window.dispatchEvent(new CustomEvent('canhelp:plan-changed', { detail: { planId } })); router.refresh(); } catch (e) {} setLoading(false); }; const restorePlan = async ()=>{ const orig = origPlanRef.current; localStorage.removeItem(ORIG_PLAN_KEY); origPlanRef.current = null; await setPlan(orig !== null && orig !== void 0 ? orig : null); }; const visiblePlans = plans; const hasOrigPlan = !!origPlanRef.current; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "fixed bottom-20 right-4 z-50 bg-white border border-slate-200 rounded-2xl shadow-lg text-xs font-medium select-none", style: { minWidth: 130 }, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { onClick: ()=>setExpanded((v)=>!v), className: "flex items-center justify-between gap-2 w-full px-3 py-2 text-slate-500 hover:text-slate-700 transition rounded-2xl", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { children: "\uD83D\uDC41 Preview" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-slate-300", children: expanded ? '▲' : 'â–Œ' }) ] }), expanded && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex flex-col gap-1 px-2 pb-2 border-t border-slate-100 pt-2", children: visiblePlans.length > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-slate-400 px-1 mt-2 mb-0.5", children: "Plan" }), visiblePlans.map((plan)=>{ var _TIER_COLORS_plan_tier; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { disabled: loading, onClick: ()=>setPlan(plan.id === activePlanId ? null : plan.id), className: "flex items-center justify-between gap-2 px-3 py-1.5 rounded-xl transition text-left ".concat(activePlanId === plan.id ? 'bg-indigo-600 text-white' : 'text-slate-600 hover:bg-slate-100', " ").concat(loading ? 'opacity-50' : ''), children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "truncate max-w-[90px]", children: plan.name }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "px-1.5 py-0.5 rounded-full text-[10px] font-semibold ".concat(activePlanId === plan.id ? 'bg-white/20 text-white' : (_TIER_COLORS_plan_tier = TIER_COLORS[plan.tier]) !== null && _TIER_COLORS_plan_tier !== void 0 ? _TIER_COLORS_plan_tier : TIER_COLORS.free), children: plan.tier }) ] }, plan.id); }), activePlanId && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { disabled: loading, onClick: ()=>setPlan(null), className: "px-3 py-1 rounded-xl text-slate-400 hover:text-red-500 hover:bg-red-50 transition text-left", children: "✕ No plan" }), hasOrigPlan && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { disabled: loading, onClick: restorePlan, className: "px-3 py-1 rounded-xl text-green-600 hover:bg-green-50 transition text-left", children: "↩ Restore" }) ] }) }) ] }); } /***/ }), /***/ 1258: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ E: () => (/* binding */ shortName), /* harmony export */ H: () => (/* binding */ formatShortName) /* harmony export */ }); /** * Shortens the last name to first letter + period. * "ИваМ ПетрПв" → "ИваМ П." * Works with a pre-composed full name string. */ function shortName(fullName) { if (!(fullName === null || fullName === void 0 ? void 0 : fullName.trim())) return '—'; const parts = fullName.trim().split(/\s+/); if (parts.length < 2 || !parts[1]) return parts[0]; return "".concat(parts[0], " ").concat(parts[1][0].toUpperCase(), "."); } /** * Formats separate firstName + lastName fields, shortening the last name. * Falls back to parsing fullName if firstName is not available. */ function formatShortName(firstName, lastName, fallbackName) { if (firstName === null || firstName === void 0 ? void 0 : firstName.trim()) { const l = lastName === null || lastName === void 0 ? void 0 : lastName.trim(); return l ? "".concat(firstName.trim(), " ").concat(l[0].toUpperCase(), ".") : firstName.trim(); } return shortName(fallbackName); } /***/ }), /***/ 1592: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ CI: () => (/* binding */ signOut), /* harmony export */ Hh: () => (/* binding */ signUp), /* harmony export */ Jv: () => (/* binding */ signIn), /* harmony export */ wV: () => (/* binding */ useSession), /* harmony export */ yK: () => (/* binding */ authClient) /* harmony export */ }); /* harmony import */ var better_auth_react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6504); const API_URL = "https://api.canhelp.gr" || 0; const authClient = (0,better_auth_react__WEBPACK_IMPORTED_MODULE_0__/* .createAuthClient */ .M)({ baseURL: API_URL }); const { signIn, signOut, signUp, useSession } = authClient; /***/ }), /***/ 2568: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 8761, 23)); ; Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 300)); ; Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 9808)); ; Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 9649)); ; Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 7380)); ; Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 9906)); ; Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 4029)); /***/ }), /***/ 3042: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); Object.defineProperty(exports, "workAsyncStorage", ({ enumerable: true, get: function() { return _workasyncstorageinstance.workAsyncStorageInstance; } })); const _workasyncstorageinstance = __webpack_require__(6035); //# sourceMappingURL=work-async-storage.external.js.map /***/ }), /***/ 3625: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /* __next_internal_client_entry_do_not_use__ cjs */ Object.defineProperty(exports, "__esModule", ({ value: true })); Object.defineProperty(exports, "PreloadChunks", ({ enumerable: true, get: function() { return PreloadChunks; } })); const _jsxruntime = __webpack_require__(4568); const _reactdom = __webpack_require__(7509); const _workasyncstorageexternal = __webpack_require__(3042); const _encodeuripath = __webpack_require__(1271); function PreloadChunks(param) { let { moduleIds } = param; // Early return in client compilation and only load requestStore on server side if (true) { return null; } const workStore = _workasyncstorageexternal.workAsyncStorage.getStore(); if (workStore === undefined) { return null; } const allFiles = []; // Search the current dynamic call unique key id in react loadable manifest, // and find the corresponding CSS files to preload if (workStore.reactLoadableManifest && moduleIds) { const manifest = workStore.reactLoadableManifest; for (const key of moduleIds){ if (!manifest[key]) continue; const chunks = manifest[key].files; allFiles.push(...chunks); } } if (allFiles.length === 0) { return null; } const dplId = false ? 0 : ''; return /*#__PURE__*/ (0, _jsxruntime.jsx)(_jsxruntime.Fragment, { children: allFiles.map((chunk)=>{ const href = workStore.assetPrefix + "/_next/" + (0, _encodeuripath.encodeURIPath)(chunk) + dplId; const isCss = chunk.endsWith('.css'); // If it's stylesheet we use `precedence` o help hoist with React Float. // For stylesheets we actually need to render the CSS because nothing else is going to do it so it needs to be part of the component tree. // The `preload` for stylesheet is not optional. if (isCss) { return /*#__PURE__*/ (0, _jsxruntime.jsx)("link", { // @ts-ignore precedence: "dynamic", href: href, rel: "stylesheet", as: "style" }, chunk); } else { // If it's script we use ReactDOM.preload to preload the resources (0, _reactdom.preload)(href, { as: 'script', fetchPriority: 'low' }); return null; } }) }); } //# sourceMappingURL=preload-chunks.js.map /***/ }), /***/ 4029: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ LocationProvider: () => (/* binding */ LocationProvider), /* harmony export */ z: () => (/* binding */ useLocation) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(2982); /* __next_internal_client_entry_do_not_use__ LocationProvider,useLocation auto */ const LocationContext = /*#__PURE__*/ (0,react__WEBPACK_IMPORTED_MODULE_1__.createContext)({ locationSlug: '', locationTree: [], locationLoading: true, setLocation: ()=>{}, getLabel: ()=>'' }); function readCookieLocation() { if (typeof document === 'undefined') return ''; const match = document.cookie.match(/(?:^|;\s*)canhelp_location=([^;]+)/); return (match === null || match === void 0 ? void 0 : match[1]) ? decodeURIComponent(match[1]) : ''; } function LocationProvider(param) { let { children, initialSlug = '' } = param; const [locationSlug, setLocationSlug] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(initialSlug); const [locationTree, setLocationTree] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [locationLoading, setLocationLoading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(true); // Sync from cookie on client mount (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ const cookieSlug = readCookieLocation(); setLocationSlug(cookieSlug); }, []); // Load location tree once (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ (0,_lib_api__WEBPACK_IMPORTED_MODULE_2__/* .getLocations */ .Vs)().then((tree)=>setLocationTree(tree)).catch(()=>{}).finally(()=>setLocationLoading(false)); }, []); const setLocation = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)((slug)=>{ setLocationSlug(slug); const encoded = encodeURIComponent(slug); document.cookie = "canhelp_location=".concat(encoded, "; path=/; max-age=31536000; SameSite=Lax"); }, []); const getLabel = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)((locale)=>{ if (!locationSlug) return ''; for (const city of locationTree){ var _city_names_locale; if (city.slug === locationSlug) return (_city_names_locale = city.names[locale]) !== null && _city_names_locale !== void 0 ? _city_names_locale : city.names.el; var _city_children; for (const d of (_city_children = city.children) !== null && _city_children !== void 0 ? _city_children : []){ var _d_names_locale; if (d.slug === locationSlug) return (_d_names_locale = d.names[locale]) !== null && _d_names_locale !== void 0 ? _d_names_locale : d.names.el; } } return locationSlug; }, [ locationSlug, locationTree ]); return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(LocationContext.Provider, { value: { locationSlug, locationTree, locationLoading, setLocation, getLabel }, children: children }); } function useLocation() { return (0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)(LocationContext); } /***/ }), /***/ 5575: /***/ ((module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); Object.defineProperty(exports, "default", ({ enumerable: true, get: function() { return dynamic; } })); const _interop_require_default = __webpack_require__(4931); const _loadable = /*#__PURE__*/ _interop_require_default._(__webpack_require__(7007)); function dynamic(dynamicOptions, options) { var _mergedOptions_loadableGenerated; const loadableOptions = {}; if (typeof dynamicOptions === 'function') { loadableOptions.loader = dynamicOptions; } const mergedOptions = { ...loadableOptions, ...options }; return (0, _loadable.default)({ ...mergedOptions, modules: (_mergedOptions_loadableGenerated = mergedOptions.loadableGenerated) == null ? void 0 : _mergedOptions_loadableGenerated.modules }); } if ((typeof exports.default === 'function' || typeof exports.default === 'object' && exports.default !== null) && typeof exports.default.__esModule === 'undefined') { Object.defineProperty(exports.default, '__esModule', { value: true }); Object.assign(exports.default, exports); module.exports = exports.default; } //# sourceMappingURL=app-dynamic.js.map /***/ }), /***/ 6035: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); Object.defineProperty(exports, "workAsyncStorageInstance", ({ enumerable: true, get: function() { return workAsyncStorageInstance; } })); const _asynclocalstorage = __webpack_require__(9113); const workAsyncStorageInstance = (0, _asynclocalstorage.createAsyncLocalStorage)(); //# sourceMappingURL=work-async-storage-instance.js.map /***/ }), /***/ 6442: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* reexport default from dynamic */ _shared_lib_app_dynamic__WEBPACK_IMPORTED_MODULE_0___default.a) /* harmony export */ }); /* harmony import */ var _shared_lib_app_dynamic__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(5575); /* harmony import */ var _shared_lib_app_dynamic__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_shared_lib_app_dynamic__WEBPACK_IMPORTED_MODULE_0__); //# sourceMappingURL=app-dynamic.js.map /***/ }), /***/ 6452: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; /* __next_internal_client_entry_do_not_use__ cjs */ Object.defineProperty(exports, "__esModule", ({ value: true })); Object.defineProperty(exports, "BailoutToCSR", ({ enumerable: true, get: function() { return BailoutToCSR; } })); const _bailouttocsr = __webpack_require__(9800); function BailoutToCSR(param) { let { reason, children } = param; if (false) {} return children; } //# sourceMappingURL=dynamic-bailout-to-csr.js.map /***/ }), /***/ 7007: /***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); Object.defineProperty(exports, "default", ({ enumerable: true, get: function() { return _default; } })); const _jsxruntime = __webpack_require__(4568); const _react = __webpack_require__(7620); const _dynamicbailouttocsr = __webpack_require__(6452); const _preloadchunks = __webpack_require__(3625); // Normalize loader to return the module as form { default: Component } for `React.lazy`. // Also for backward compatible since next/dynamic allows to resolve a component directly with loader // Client component reference proxy need to be converted to a module. function convertModule(mod) { // Check "default" prop before accessing it, as it could be client reference proxy that could break it reference. // Cases: // mod: { default: Component } // mod: Component // mod: { default: proxy(Component) } // mod: proxy(Component) const hasDefault = mod && 'default' in mod; return { default: hasDefault ? mod.default : mod }; } const defaultOptions = { loader: ()=>Promise.resolve(convertModule(()=>null)), loading: null, ssr: true }; function Loadable(options) { const opts = { ...defaultOptions, ...options }; const Lazy = /*#__PURE__*/ (0, _react.lazy)(()=>opts.loader().then(convertModule)); const Loading = opts.loading; function LoadableComponent(props) { const fallbackElement = Loading ? /*#__PURE__*/ (0, _jsxruntime.jsx)(Loading, { isLoading: true, pastDelay: true, error: null }) : null; // If it's non-SSR or provided a loading component, wrap it in a suspense boundary const hasSuspenseBoundary = !opts.ssr || !!opts.loading; const Wrap = hasSuspenseBoundary ? _react.Suspense : _react.Fragment; const wrapProps = hasSuspenseBoundary ? { fallback: fallbackElement } : {}; const children = opts.ssr ? /*#__PURE__*/ (0, _jsxruntime.jsxs)(_jsxruntime.Fragment, { children: [ false ? /*#__PURE__*/ 0 : null, /*#__PURE__*/ (0, _jsxruntime.jsx)(Lazy, { ...props }) ] }) : /*#__PURE__*/ (0, _jsxruntime.jsx)(_dynamicbailouttocsr.BailoutToCSR, { reason: "next/dynamic", children: /*#__PURE__*/ (0, _jsxruntime.jsx)(Lazy, { ...props }) }); return /*#__PURE__*/ (0, _jsxruntime.jsx)(Wrap, { ...wrapProps, children: children }); } LoadableComponent.displayName = 'LoadableComponent'; return LoadableComponent; } const _default = Loadable; //# sourceMappingURL=loadable.js.map /***/ }), /***/ 7380: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ ScrollToTopButton: () => (/* binding */ ScrollToTopButton) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* __next_internal_client_entry_do_not_use__ ScrollToTopButton auto */ function ScrollToTopButton() { const [visible, setVisible] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ const onScroll = ()=>{ setVisible(window.scrollY > 200); }; window.addEventListener('scroll', onScroll); return ()=>window.removeEventListener('scroll', onScroll); }, []); return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { className: "scroll-to-top-btn".concat(visible ? ' visible' : ''), "aria-label": "Back to top", onClick: ()=>window.scrollTo({ top: 0, behavior: 'smooth' }), children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M10 16V4M10 4L4 10M10 4L16 10", stroke: "white", strokeWidth: "2.8", strokeLinecap: "round", strokeLinejoin: "round" }) }) }); } /***/ }), /***/ 8761: /***/ (() => { // extracted by mini-css-extract-plugin /***/ }), /***/ 9113: /***/ ((__unused_webpack_module, exports) => { "use strict"; Object.defineProperty(exports, "__esModule", ({ value: true })); 0 && (0); function _export(target, all) { for(var name in all)Object.defineProperty(target, name, { enumerable: true, get: all[name] }); } _export(exports, { bindSnapshot: function() { return bindSnapshot; }, createAsyncLocalStorage: function() { return createAsyncLocalStorage; }, createSnapshot: function() { return createSnapshot; } }); const sharedAsyncLocalStorageNotAvailableError = Object.defineProperty(new Error('Invariant: AsyncLocalStorage accessed in runtime where it is not available'), "__NEXT_ERROR_CODE", { value: "E504", enumerable: false, configurable: true }); class FakeAsyncLocalStorage { disable() { throw sharedAsyncLocalStorageNotAvailableError; } getStore() { // This fake implementation of AsyncLocalStorage always returns `undefined`. return undefined; } run() { throw sharedAsyncLocalStorageNotAvailableError; } exit() { throw sharedAsyncLocalStorageNotAvailableError; } enterWith() { throw sharedAsyncLocalStorageNotAvailableError; } static bind(fn) { return fn; } } const maybeGlobalAsyncLocalStorage = typeof globalThis !== 'undefined' && globalThis.AsyncLocalStorage; function createAsyncLocalStorage() { if (maybeGlobalAsyncLocalStorage) { return new maybeGlobalAsyncLocalStorage(); } return new FakeAsyncLocalStorage(); } function bindSnapshot(fn) { if (maybeGlobalAsyncLocalStorage) { return maybeGlobalAsyncLocalStorage.bind(fn); } return FakeAsyncLocalStorage.bind(fn); } function createSnapshot() { if (maybeGlobalAsyncLocalStorage) { return maybeGlobalAsyncLocalStorage.snapshot(); } return function(fn, ...args) { return fn(...args); }; } //# sourceMappingURL=async-local-storage.js.map /***/ }), /***/ 9649: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; // EXPORTS __webpack_require__.d(__webpack_exports__, { Header: () => (/* binding */ Header) }); // EXTERNAL MODULE: ../../node_modules/next/dist/compiled/react/jsx-runtime.js var jsx_runtime = __webpack_require__(4568); // EXTERNAL MODULE: ../../node_modules/next/dist/client/app-dir/link.js var app_dir_link = __webpack_require__(9664); var link_default = /*#__PURE__*/__webpack_require__.n(app_dir_link); // EXTERNAL MODULE: ../../node_modules/next/dist/api/navigation.js var navigation = __webpack_require__(7541); // EXTERNAL MODULE: ./src/lib/auth.ts var auth = __webpack_require__(1592); // EXTERNAL MODULE: ./src/context/locale.tsx var context_locale = __webpack_require__(9906); // EXTERNAL MODULE: ./src/lib/formatName.ts var formatName = __webpack_require__(1258); // EXTERNAL MODULE: ../../node_modules/next/dist/compiled/react/index.js var react = __webpack_require__(7620); // EXTERNAL MODULE: ./src/lib/translations.ts var translations = __webpack_require__(4962); ;// ./src/components/LanguageSwitcher.tsx /* __next_internal_client_entry_do_not_use__ LanguageSwitcher auto */ function LanguageSwitcher() { const { locale, setLocale } = (0,context_locale/* useLocale */.Y)(); const [open, setOpen] = (0,react.useState)(false); const ref = (0,react.useRef)(null); var _LOCALES_find; const current = (_LOCALES_find = translations/* LOCALES */.YZ.find((l)=>l.code === locale)) !== null && _LOCALES_find !== void 0 ? _LOCALES_find : translations/* LOCALES */.YZ[0]; // Close on outside click (0,react.useEffect)(()=>{ function handleClick(e) { if (ref.current && !ref.current.contains(e.target)) setOpen(false); } document.addEventListener('mousedown', handleClick); return ()=>document.removeEventListener('mousedown', handleClick); }, []); return /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { ref: ref, className: "relative", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("button", { onClick: ()=>setOpen(!open), className: "flex items-center gap-1.5 px-2.5 py-1.5 rounded-lg border border-gray-200 hover:border-green-400 hover:bg-green-50 transition text-sm font-medium text-gray-700", "aria-label": "Change language", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { children: current.code.toUpperCase() }), /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { className: "w-3.5 h-3.5 text-gray-400 transition-transform ".concat(open ? 'rotate-180' : ''), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19 9l-7 7-7-7" }) }) ] }), open && /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "absolute right-0 mt-1 w-40 bg-white border border-gray-200 rounded-xl shadow-lg z-50 overflow-hidden", children: translations/* LOCALES */.YZ.map((loc)=>/*#__PURE__*/ (0,jsx_runtime.jsxs)("button", { onClick: ()=>{ setLocale(loc.code); setOpen(false); }, className: "w-full flex items-center gap-2.5 px-3.5 py-2.5 text-sm hover:bg-green-50 transition ".concat(locale === loc.code ? 'bg-green-50 text-green-700 font-medium' : 'text-gray-700'), children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { children: loc.label }), locale === loc.code && /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { className: "w-3.5 h-3.5 ml-auto text-green-600", fill: "currentColor", viewBox: "0 0 20 20", children: /*#__PURE__*/ (0,jsx_runtime.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" }) }) ] }, loc.code)) }) ] }); } // EXTERNAL MODULE: ./src/lib/api.ts var api = __webpack_require__(2982); // EXTERNAL MODULE: ../../node_modules/socket.io-client/build/esm/index.js + 28 modules var esm = __webpack_require__(2838); ;// ./src/hooks/useEffectiveRole.ts /* __next_internal_client_entry_do_not_use__ useEffectiveRole auto */ function readPreviewRole() { if (typeof document === 'undefined') return null; const m = document.cookie.match(/(?:^|;\s*)canhelp_preview_role=([^;]+)/); var _m_; return (_m_ = m === null || m === void 0 ? void 0 : m[1]) !== null && _m_ !== void 0 ? _m_ : null; } /** * Returns the effective role for the current user. * For admins, respects the `canhelp_preview_role` cookie set by AdminRolePreview widget. * Updates reactively when the widget dispatches `canhelp:preview-role`. */ function useEffectiveRole() { var _session_user; const { data: session } = (0,auth/* useSession */.wV)(); const userRole = session === null || session === void 0 ? void 0 : (_session_user = session.user) === null || _session_user === void 0 ? void 0 : _session_user.role; const isAdmin = userRole === 'admin'; const [previewRole, setPreviewRole] = (0,react.useState)(null); (0,react.useEffect)(()=>{ if (!isAdmin) return; setPreviewRole(readPreviewRole()); const sync = ()=>setPreviewRole(readPreviewRole()); window.addEventListener('canhelp:preview-role', sync); document.addEventListener('visibilitychange', sync); return ()=>{ window.removeEventListener('canhelp:preview-role', sync); document.removeEventListener('visibilitychange', sync); }; }, [ isAdmin ]); if (!userRole) return null; if (isAdmin && previewRole) return previewRole; return userRole; } // EXTERNAL MODULE: ../../node_modules/next/dist/api/app-dynamic.js var app_dynamic = __webpack_require__(6442); ;// ./src/components/Header.tsx /* __next_internal_client_entry_do_not_use__ Header auto */ const SupportModal = (0,app_dynamic["default"])(()=>__webpack_require__.e(/* import() */ 6467).then(__webpack_require__.bind(__webpack_require__, 6467)), { loadableGenerated: { webpack: ()=>[ /*require.resolve*/(6467) ] }, ssr: false }); const API_URL = "https://api.canhelp.gr" || 0; function Header() { var _session_user; const router = (0,navigation.useRouter)(); const pathname = (0,navigation.usePathname)(); const { data: session } = (0,auth/* useSession */.wV)(); const { t, locale } = (0,context_locale/* useLocale */.Y)(); const [menuOpen, setMenuOpen] = (0,react.useState)(false); const [profileOpen, setProfileOpen] = (0,react.useState)(false); const [supportOpen, setSupportOpen] = (0,react.useState)(false); const [unreadNotif, setUnreadNotif] = (0,react.useState)(0); const [unreadChat, setUnreadChat] = (0,react.useState)(0); const [msgToast, setMsgToast] = (0,react.useState)(null); const [planTier, setPlanTier] = (0,react.useState)(null); const profileRef = (0,react.useRef)(null); const headerRef = (0,react.useRef)(null); const toastTimer = (0,react.useRef)(null); const pathnameRef = (0,react.useRef)(pathname); (0,react.useEffect)(()=>{ pathnameRef.current = pathname; }, [ pathname ]); // Close dropdowns on outside click (0,react.useEffect)(()=>{ function handleClick(e) { if (profileRef.current && !profileRef.current.contains(e.target)) { setProfileOpen(false); } } document.addEventListener('mousedown', handleClick); return ()=>document.removeEventListener('mousedown', handleClick); }, []); const isAdmin = (session === null || session === void 0 ? void 0 : (_session_user = session.user) === null || _session_user === void 0 ? void 0 : _session_user.role) === 'admin'; const effectiveRole = useEffectiveRole(); const isSpecialist = effectiveRole === 'specialist'; const isActive = function(href) { let exact = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false; return exact ? pathname === href : pathname === href || pathname.startsWith(href + '/'); }; const navCls = function(href) { let exact = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false; return "font-medium text-sm transition ".concat(isActive(href, exact) ? 'text-green-600' : 'text-gray-600 hover:text-green-600'); }; const mobileNavCls = function(href) { let exact = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false; return "flex items-center gap-2 font-medium py-1 ".concat(isActive(href, exact) ? 'text-green-600' : 'text-gray-700'); }; // Reset chat badge when entering chat (0,react.useEffect)(()=>{ if (pathname === '/chat') setUnreadChat(0); }, [ pathname ]); (0,react.useEffect)(()=>{ if (!session) return; const socket = (0,esm.io)(API_URL, { withCredentials: true, transports: [ 'websocket', 'polling' ] }); socket.on('new_message', (msg)=>{ if (pathnameRef.current === '/chat') return; setUnreadChat((c)=>c + 1); if (toastTimer.current) clearTimeout(toastTimer.current); setMsgToast(msg); toastTimer.current = setTimeout(()=>setMsgToast(null), 5000); }); return ()=>{ socket.disconnect(); if (toastTimer.current) clearTimeout(toastTimer.current); }; }, [ session ]); (0,react.useEffect)(()=>{ if (!session) { setUnreadNotif(0); return; } const fetch = ()=>(0,api/* getUnreadCount */.$M)().then((r)=>setUnreadNotif(r.count)).catch(()=>{}); fetch(); const timer = setInterval(fetch, 30000); return ()=>clearInterval(timer); }, [ session ]); (0,react.useEffect)(()=>{ if (!session) { setPlanTier(null); return; } (0,api/* getMyDashboard */.H)().then((d)=>{ var _d_plan; var _d_plan_tier; return setPlanTier((_d_plan_tier = (_d_plan = d.plan) === null || _d_plan === void 0 ? void 0 : _d_plan.tier) !== null && _d_plan_tier !== void 0 ? _d_plan_tier : null); }).catch(()=>{}); }, [ session ]); (0,react.useEffect)(()=>{ const onScroll = ()=>{ if (!headerRef.current) return; if (window.scrollY > 40) { headerRef.current.classList.add('header-shrink'); } else { headerRef.current.classList.remove('header-shrink'); } }; window.addEventListener('scroll', onScroll); return ()=>window.removeEventListener('scroll', onScroll); }, []); return /*#__PURE__*/ (0,jsx_runtime.jsxs)(jsx_runtime.Fragment, { children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("header", { ref: headerRef, className: "header-base bg-white border-b border-gray-200 sticky top-0 z-50 transition-all duration-300", children: /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "max-w-7xl mx-auto px-4 sm:px-6 lg:px-8", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex items-center justify-between h-16 header-content transition-all duration-300", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)((link_default()), { href: "/", className: "flex items-center gap-2 shrink-0", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("img", { src: "/logo.png", alt: "CanHelp", className: "w-8 h-8 object-contain" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "logo-text text-2xl font-bold text-green-600 transition-all duration-300", children: "CanHelp" }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("nav", { className: "hidden md:flex items-center gap-5 ml-auto", children: [ isSpecialist ? /*#__PURE__*/ (0,jsx_runtime.jsxs)(jsx_runtime.Fragment, { children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)((link_default()), { href: "/tasks", className: navCls('/tasks'), children: t('nav.find_tasks') }), /*#__PURE__*/ (0,jsx_runtime.jsx)((link_default()), { href: "/dashboard", className: navCls('/dashboard'), children: t('nav.dashboard') }) ] }) : /*#__PURE__*/ (0,jsx_runtime.jsxs)(jsx_runtime.Fragment, { children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)((link_default()), { href: "/tasks/new", className: navCls('/tasks/new', true), children: t('dashboard.new_task') }), " ", /*#__PURE__*/ (0,jsx_runtime.jsx)((link_default()), { href: "/tasks", className: navCls('/tasks'), children: t('nav.tasks') }), " ", /*#__PURE__*/ (0,jsx_runtime.jsx)((link_default()), { href: "/specialists", className: navCls('/specialists'), children: t('nav.specialists') }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)((link_default()), { href: "/pricing", className: navCls('/pricing', true), children: t('nav.pricing', 'Pricing') }), session ? /*#__PURE__*/ (0,jsx_runtime.jsxs)(jsx_runtime.Fragment, { children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)((link_default()), { href: "/notifications", className: "relative text-gray-600 hover:text-gray-900 flex items-center", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { className: "w-5 h-5 ".concat(unreadNotif > 0 ? 'text-green-600' : ''), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ (0,jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M14.857 17.082a23.848 23.848 0 005.454-1.31A8.967 8.967 0 0118 9.75v-.7V9A6 6 0 006 9v.75a8.967 8.967 0 01-2.312 6.022c1.733.64 3.56 1.085 5.455 1.31m5.714 0a24.255 24.255 0 01-5.714 0m5.714 0a3 3 0 11-5.714 0" }) }), unreadNotif > 0 && /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "absolute -top-1.5 -right-1.5 min-w-[16px] h-4 px-0.5 bg-red-500 text-white text-[10px] font-bold rounded-full flex items-center justify-center leading-none", children: unreadNotif > 99 ? '99+' : unreadNotif }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)((link_default()), { href: "/chat", className: "relative text-gray-600 hover:text-gray-900 flex items-center", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { className: "w-5 h-5 ".concat(unreadChat > 0 ? 'text-green-500' : ''), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ (0,jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }), unreadChat > 0 && /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "absolute -top-1.5 -right-1.5 min-w-[16px] h-4 px-0.5 bg-green-500 text-white text-[10px] font-bold rounded-full flex items-center justify-center leading-none", children: unreadChat > 99 ? '99+' : unreadChat }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "relative", ref: profileRef, children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("button", { onClick: ()=>setProfileOpen(!profileOpen), className: "flex items-center gap-1.5 text-sm font-medium text-gray-600 hover:text-green-600", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "truncate max-w-[100px]", children: (0,formatName/* formatShortName */.H)(session.user.firstName, session.user.lastName, session.user.name) }), planTier === 'pro' && /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "inline-flex items-center px-1.5 py-0.5 rounded-full text-[10px] font-bold bg-green-100 text-green-700 leading-none", children: "Pro" }), planTier === 'ultimate' && /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "inline-flex items-center px-1.5 py-0.5 rounded-full text-[10px] font-bold bg-gradient-to-r from-amber-400 via-yellow-400 to-amber-400 text-gray-900 shadow-sm shadow-amber-300/50 leading-none", children: "★" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19 9l-7 7-7-7" }) }) ] }), profileOpen && /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "absolute right-0 mt-2 w-52 bg-white border border-gray-200 rounded-xl shadow-lg py-1 z-50", children: [ isSpecialist ? /*#__PURE__*/ (0,jsx_runtime.jsxs)(jsx_runtime.Fragment, { children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)((link_default()), { href: "/tasks/new", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 4v16m8-8H4" }) }), t('nav.new_task') ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)((link_default()), { href: "/specialists", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,jsx_runtime.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" }) }), t('nav.specialists') ] }) ] }) : /*#__PURE__*/ (0,jsx_runtime.jsxs)(jsx_runtime.Fragment, { children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)((link_default()), { href: "/notifications", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { className: "w-4 h-4 shrink-0 ".concat(unreadNotif > 0 ? 'text-green-600' : 'text-gray-400'), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M14.857 17.082a23.848 23.848 0 005.454-1.31A8.967 8.967 0 0118 9.75v-.7V9A6 6 0 006 9v.75a8.967 8.967 0 01-2.312 6.022c1.733.64 3.56 1.085 5.455 1.31m5.714 0a24.255 24.255 0 01-5.714 0m5.714 0a3 3 0 11-5.714 0" }) }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("span", { className: "flex items-center gap-1.5", children: [ t('nav.notifications'), unreadNotif > 0 && /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "px-1.5 py-0.5 bg-red-500 text-white text-[10px] font-bold rounded-full leading-none", children: unreadNotif > 99 ? '99+' : unreadNotif }) ] }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)((link_default()), { href: "/chat", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { className: "w-4 h-4 shrink-0 ".concat(unreadChat > 0 ? 'text-green-500' : 'text-gray-400'), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("span", { className: "flex items-center gap-1.5", children: [ t('nav.chat'), unreadChat > 0 && /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "px-1.5 py-0.5 bg-green-500 text-white text-[10px] font-bold rounded-full leading-none", children: unreadChat > 99 ? '99+' : unreadChat }) ] }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)((link_default()), { href: "/dashboard", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6" }) }), t('nav.dashboard') ] }) ] }), (isSpecialist || isAdmin) && /*#__PURE__*/ (0,jsx_runtime.jsxs)((link_default()), { href: "/schedule", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,jsx_runtime.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" }) }), t('nav.schedule') ] }), isAdmin && /*#__PURE__*/ (0,jsx_runtime.jsxs)((link_default()), { href: "/admin", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: [ /*#__PURE__*/ (0,jsx_runtime.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" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 12a3 3 0 11-6 0 3 3 0 016 0z" }) ] }), t('nav.admin') ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)((link_default()), { href: "/profile", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,jsx_runtime.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" }) }), t('nav.profile') ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)((link_default()), { href: "/favorites", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4.318 6.318a4.5 4.5 0 000 6.364L12 20.364l7.682-7.682a4.5 4.5 0 00-6.364-6.364L12 7.636l-1.318-1.318a4.5 4.5 0 00-6.364 0z" }) }), t('nav.favorites') ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("hr", { className: "my-1 border-gray-100" }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("button", { className: "w-full flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-green-50", onClick: ()=>{ setProfileOpen(false); setSupportOpen(true); }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,jsx_runtime.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" }) }), t('support.title') ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("hr", { className: "my-1 border-gray-100" }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("button", { className: "w-full flex items-center gap-2.5 px-4 py-2 text-sm text-red-500 hover:bg-red-50", onClick: ()=>{ setProfileOpen(false); (0,auth/* signOut */.CI)().then(()=>{ window.location.href = '/'; }); }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M17 16l4-4m0 0l-4-4m4 4H7m6 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h4a3 3 0 013 3v1" }) }), t('nav.logout') ] }) ] }) ] }) ] }) : /*#__PURE__*/ (0,jsx_runtime.jsxs)(jsx_runtime.Fragment, { children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)((link_default()), { href: "/login", className: "text-gray-600 hover:text-green-600 font-medium text-sm", children: t('nav.login') }), /*#__PURE__*/ (0,jsx_runtime.jsx)((link_default()), { href: "/register", className: "bg-green-600 text-white px-4 py-2 rounded-lg hover:bg-green-700 font-medium text-sm", children: t('nav.register') }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)(LanguageSwitcher, {}) ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "md:hidden flex items-center gap-2", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)(LanguageSwitcher, {}), /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { className: "p-2", onClick: ()=>setMenuOpen(!menuOpen), "aria-label": "Toggle menu", children: /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { className: "w-5 h-5 text-gray-600", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: menuOpen ? /*#__PURE__*/ (0,jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" }) : /*#__PURE__*/ (0,jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4 6h16M4 12h16M4 18h16" }) }) }) ] }) ] }), menuOpen && /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "md:hidden py-4 border-t border-gray-100 flex flex-col gap-3", children: [ isSpecialist ? /*#__PURE__*/ (0,jsx_runtime.jsxs)(jsx_runtime.Fragment, { children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)((link_default()), { href: "/tasks", className: mobileNavCls('/tasks'), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z" }) }), t('nav.find_tasks') ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)((link_default()), { href: "/dashboard", className: mobileNavCls('/dashboard'), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6" }) }), t('nav.dashboard') ] }) ] }) : /*#__PURE__*/ (0,jsx_runtime.jsxs)(jsx_runtime.Fragment, { children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)((link_default()), { href: "/tasks/new", className: mobileNavCls('/tasks/new', true), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 4v16m8-8H4" }) }), t('nav.new_task') ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)((link_default()), { href: "/tasks", className: mobileNavCls('/tasks'), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,jsx_runtime.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" }) }), t('nav.tasks') ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)((link_default()), { href: "/specialists", className: mobileNavCls('/specialists'), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,jsx_runtime.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" }) }), t('nav.specialists') ] }) ] }), session ? /*#__PURE__*/ (0,jsx_runtime.jsxs)(jsx_runtime.Fragment, { children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)((link_default()), { href: "/chat", className: mobileNavCls('/chat', true), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { className: "w-4 h-4 shrink-0 ".concat(unreadChat > 0 ? 'text-green-500' : ''), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }), t('nav.chat'), unreadChat > 0 && /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "ml-1 px-1.5 py-0.5 bg-green-500 text-white text-[10px] font-bold rounded-full", children: unreadChat }) ] }), isSpecialist ? /*#__PURE__*/ (0,jsx_runtime.jsxs)(jsx_runtime.Fragment, { children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)((link_default()), { href: "/tasks/new", className: mobileNavCls('/tasks/new', true), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 4v16m8-8H4" }) }), t('nav.new_task') ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)((link_default()), { href: "/specialists", className: mobileNavCls('/specialists'), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,jsx_runtime.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" }) }), t('nav.specialists') ] }) ] }) : /*#__PURE__*/ (0,jsx_runtime.jsxs)(jsx_runtime.Fragment, { children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)((link_default()), { href: "/notifications", className: mobileNavCls('/notifications', true), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { className: "w-4 h-4 shrink-0 ".concat(unreadNotif > 0 ? 'text-green-600' : ''), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M14.857 17.082a23.848 23.848 0 005.454-1.31A8.967 8.967 0 0118 9.75v-.7V9A6 6 0 006 9v.75a8.967 8.967 0 01-2.312 6.022c1.733.64 3.56 1.085 5.455 1.31m5.714 0a24.255 24.255 0 01-5.714 0m5.714 0a3 3 0 11-5.714 0" }) }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("span", { className: "flex items-center gap-1.5", children: [ t('nav.notifications'), unreadNotif > 0 && /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "px-1.5 py-0.5 bg-red-500 text-white text-[10px] font-bold rounded-full", children: unreadNotif > 99 ? '99+' : unreadNotif }) ] }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)((link_default()), { href: "/dashboard", className: mobileNavCls('/dashboard'), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6" }) }), t('nav.dashboard') ] }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)((link_default()), { href: "/favorites", className: mobileNavCls('/favorites', true), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4.318 6.318a4.5 4.5 0 000 6.364L12 20.364l7.682-7.682a4.5 4.5 0 00-6.364-6.364L12 7.636l-1.318-1.318a4.5 4.5 0 00-6.364 0z" }) }), t('nav.favorites') ] }), (isSpecialist || isAdmin) && /*#__PURE__*/ (0,jsx_runtime.jsxs)((link_default()), { href: "/schedule", className: mobileNavCls('/schedule', true), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { className: "w-4 h-4 text-gray-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,jsx_runtime.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" }) }), t('nav.schedule') ] }), isAdmin && /*#__PURE__*/ (0,jsx_runtime.jsxs)((link_default()), { href: "/admin", className: mobileNavCls('/admin'), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("svg", { className: "w-4 h-4 text-gray-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: [ /*#__PURE__*/ (0,jsx_runtime.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" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 12a3 3 0 11-6 0 3 3 0 016 0z" }) ] }), t('nav.admin') ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)((link_default()), { href: "/profile", className: mobileNavCls('/profile', true), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { className: "w-4 h-4 text-gray-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,jsx_runtime.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" }) }), t('nav.profile') ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("button", { onClick: ()=>{ setMenuOpen(false); (0,auth/* signOut */.CI)().then(()=>{ window.location.href = '/'; }); }, className: "flex items-center gap-2 text-left text-red-500 py-1 font-medium", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M17 16l4-4m0 0l-4-4m4 4H7m6 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h4a3 3 0 013 3v1" }) }), t('nav.logout') ] }) ] }) : /*#__PURE__*/ (0,jsx_runtime.jsxs)(jsx_runtime.Fragment, { children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)((link_default()), { href: "/login", className: "text-gray-700 font-medium py-1", onClick: ()=>setMenuOpen(false), children: t('nav.login') }), /*#__PURE__*/ (0,jsx_runtime.jsx)((link_default()), { href: "/register", className: "text-green-600 font-medium py-1", onClick: ()=>setMenuOpen(false), children: t('nav.register') }) ] }) ] }) ] }) }), msgToast && /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "fixed bottom-5 right-5 z-[200] max-w-sm w-full", children: /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "bg-white border border-gray-200 rounded-xl shadow-xl p-4 flex items-start gap-3 animate-fade-in", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "text-2xl shrink-0", children: "\uD83D\uDCAC" }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "font-semibold text-gray-900 text-sm", children: t('chat.toast_title') }), /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "text-xs text-gray-500 truncate mt-0.5", children: msgToast.body }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex flex-col items-end gap-2 shrink-0", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { onClick: ()=>setMsgToast(null), className: "text-gray-400 hover:text-gray-600 text-lg leading-none", "aria-label": "close", children: "\xd7" }), /*#__PURE__*/ (0,jsx_runtime.jsx)((link_default()), { href: "/chat?room=".concat(msgToast.roomId), onClick: ()=>setMsgToast(null), className: "text-xs text-green-600 hover:underline font-medium", children: t('chat.toast_open') }) ] }) ] }) }), supportOpen && /*#__PURE__*/ (0,jsx_runtime.jsx)(SupportModal, { onClose: ()=>setSupportOpen(false) }) ] }); } /***/ }), /***/ 9808: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; // EXPORTS __webpack_require__.d(__webpack_exports__, { Footer: () => (/* binding */ Footer) }); // EXTERNAL MODULE: ../../node_modules/next/dist/compiled/react/jsx-runtime.js var jsx_runtime = __webpack_require__(4568); // EXTERNAL MODULE: ./src/context/locale.tsx var locale = __webpack_require__(9906); // EXTERNAL MODULE: ../../node_modules/next/dist/compiled/react/index.js var react = __webpack_require__(7620); // EXTERNAL MODULE: ../../node_modules/next/dist/client/app-dir/link.js var app_dir_link = __webpack_require__(9664); var link_default = /*#__PURE__*/__webpack_require__.n(app_dir_link); ;// ./src/components/SocialIcons.tsx const ICONS = [ { key: 'telegram', label: 'Telegram', hoverClass: 'hover:text-sky-500', svg: '' }, { key: 'instagram', label: 'Instagram', hoverClass: 'hover:text-pink-500', svg: '' }, { key: 'facebook', label: 'Facebook', hoverClass: 'hover:text-green-600', svg: '' }, { key: 'twitter', label: 'X', hoverClass: 'hover:text-gray-900', svg: '' }, { key: 'youtube', label: 'YouTube', hoverClass: 'hover:text-red-600', svg: '' }, { key: 'tiktok', label: 'TikTok', hoverClass: 'hover:text-black', svg: '' }, { key: 'whatsapp', label: 'WhatsApp', hoverClass: 'hover:text-green-500', svg: '' }, { key: 'viber', label: 'Viber', hoverClass: 'hover:text-purple-600', svg: '' } ]; function SocialIcons(param) { let { className = '', links } = param; const active = ICONS.filter((param)=>{ let { key } = param; return links === null || links === void 0 ? void 0 : links[key]; }); if (active.length === 0) return null; return /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "flex gap-4 flex-wrap ".concat(className), children: active.map((param)=>{ let { key, label, hoverClass, svg } = param; return /*#__PURE__*/ (0,jsx_runtime.jsx)("a", { href: links[key], target: "_blank", rel: "noopener noreferrer", "aria-label": label, className: "text-gray-500 transition ".concat(hoverClass), children: /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { width: "22", height: "22", viewBox: "0 0 24 24", fill: "currentColor", dangerouslySetInnerHTML: { __html: svg } }) }, key); }) }); } ;// ./src/components/Footer.tsx /* __next_internal_client_entry_do_not_use__ Footer auto */ const API = "https://api.canhelp.gr" || 0; function Footer() { const { t } = (0,locale/* useLocale */.Y)(); const year = new Date().getFullYear(); const [socialLinks, setSocialLinks] = (0,react.useState)({}); (0,react.useEffect)(()=>{ fetch("".concat(API, "/api/admin/social-public")).then((r)=>r.ok ? r.json() : {}).then((kv)=>{ const links = {}; for (const [k, v] of Object.entries(kv)){ if (v) links[k.replace('social.', '')] = v; } setSocialLinks(links); }).catch(()=>{}); }, []); return /*#__PURE__*/ (0,jsx_runtime.jsx)("footer", { className: "bg-white border-t border-gray-200 mt-16", children: /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-12", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex flex-col md:flex-row justify-between items-start gap-10", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex-1 min-w-[200px] flex flex-col items-start", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "logo-text text-3xl text-green-700 font-bold mb-2", children: "CanHelp" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "text-base text-gray-600 mb-4", children: t('footer.slogan') }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex-1 min-w-[180px]", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("h3", { className: "text-lg font-semibold text-gray-900 mb-3", children: t('footer.links') }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("ul", { className: "space-y-2", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("li", { children: /*#__PURE__*/ (0,jsx_runtime.jsx)((link_default()), { href: "/", className: "hover:text-green-600 transition", children: t('nav.home') }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)("li", { children: /*#__PURE__*/ (0,jsx_runtime.jsx)((link_default()), { href: "/tasks", className: "hover:text-green-600 transition", children: t('nav.tasks') }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)("li", { children: /*#__PURE__*/ (0,jsx_runtime.jsx)((link_default()), { href: "/specialists", className: "hover:text-green-600 transition", children: t('nav.specialists') }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)("li", { children: /*#__PURE__*/ (0,jsx_runtime.jsx)((link_default()), { href: "/pricing", className: "hover:text-green-600 transition", children: t('nav.pricing') }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)("li", { children: /*#__PURE__*/ (0,jsx_runtime.jsx)((link_default()), { href: "/support", className: "hover:text-green-600 transition", children: t('support.title') }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)("li", { children: /*#__PURE__*/ (0,jsx_runtime.jsx)((link_default()), { href: "/privacy", className: "hover:text-green-600 transition", children: t('nav.privacy') }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)("li", { children: /*#__PURE__*/ (0,jsx_runtime.jsx)((link_default()), { href: "/delete-account", className: "hover:text-red-500 transition", children: t('nav.delete_account') }) }) ] }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex-1 min-w-[180px]", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("h3", { className: "text-lg font-semibold text-gray-900 mb-3", children: t('footer.socials') }), /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "text-gray-500 text-sm mb-2", children: "info@canhelp.gr" }), /*#__PURE__*/ (0,jsx_runtime.jsx)(SocialIcons, { className: "mt-2", links: socialLinks }) ] }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "mt-10 border-t border-gray-100 pt-6 text-center text-gray-400 text-sm", children: [ "\xa9 ", year, " CanHelp. ", t('footer.rights') ] }) ] }) }); } /***/ }) }, /******/ __webpack_require__ => { // webpackRuntimeModules /******/ var __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId)) /******/ __webpack_require__.O(0, [9950,1516,9664,2838,9906,2982,587,18,7358], () => (__webpack_exec__(2568))); /******/ var __webpack_exports__ = __webpack_require__.O(); /******/ _N_E = __webpack_exports__; /******/ } ]); ‚{}_ÿÿÿ @É`ÿÿÿW(self["webpackChunk_N_E"] = self["webpackChunk_N_E"] || []).push([[7177],{ /***/ 300: _ÿÿÿ_/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; ^ÿÿÿ…/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ AdminRolePreview: () => (/* binding */ AdminRolePreview) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1592); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7541); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(7620); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(2982); _ÿÿÿé/* __next_internal_client_entry_do_not_use__ AdminRolePreview auto */ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime"; import { useSession } from '@/lib/auth'; import { useRouter } from 'next/navigation'; import { useEffect, useState, useRef } from 'react'; import { getPlans, updateAdminUser } from '@/lib/api'; const ORIG_PLAN_KEY = 'canhelp_admin_orig_plan'; function getPreviewRole() { return null; } const TIER_COLORS = { free: 'bg-slate-100 text-slate-600', pro: 'bg-green-100 text-green-700', ultimate: 'bg-amber-100 text-amber-700' }; export function AdminRolePreview() { var _session_user, _session_user1; const { data: session } = useSession(); const router = useRouter(); const isAdmin = (session === null || session === void 0 ? void 0 : (_session_user = session.user) === null || _session_user === void 0 ? void 0 : _session_user.role) === 'admin'; const userId = session === null || session === void 0 ? void 0 : (_session_user1 = session.user) === null || _session_user1 === void 0 ? void 0 : _session_user1.id; const [mounted, setMounted] = useState(false); const [plans, setPlans] = useState([]); const [activePlanId, setActivePlanId] = useState(null); const [loading, setLoading] = useState(false); const [expanded, setExpanded] = useState(false); const origPlanRef = useRef(null); useEffect(()=>setMounted(true), []); useEffect(()=>{ if ("object" !== 'undefined') { origPlanRef.current = localStorage.getItem(ORIG_PLAN_KEY); } }, []); useEffect(()=>{ if (!isAdmin) return; getPlans().then(setPlans).catch(()=>{}); }, [ isAdmin ]); useEffect(()=>{ var _session_user; var _session_user_planId; // Sync active plan from session const currentPlanId = (_session_user_planId = session === null || session === void 0 ? void 0 : (_session_user = session.user) === null || _session_user === void 0 ? void 0 : _session_user.planId) !== null && _session_user_planId !== void 0 ? _session_user_planId : null; setActivePlanId(currentPlanId); }, [ session ]); if (!mounted || !isAdmin) return null; const setPlan = async (planId)=>{ if (!userId) return; setLoading(true); try { // Save original plan on first change if (!origPlanRef.current && activePlanId) { localStorage.setItem(ORIG_PLAN_KEY, activePlanId); origPlanRef.current = activePlanId; } await updateAdminUser(userId, { planId }); setActivePlanId(planId); window.dispatchEvent(new CustomEvent('canhelp:plan-changed', { detail: { planId } })); router.refresh(); } catch (e) {} setLoading(false); }; const restorePlan = async ()=>{ const orig = origPlanRef.current; localStorage.removeItem(ORIG_PLAN_KEY); origPlanRef.current = null; await setPlan(orig !== null && orig !== void 0 ? orig : null); }; const visiblePlans = plans; const hasOrigPlan = !!origPlanRef.current; return /*#__PURE__*/ _jsxs("div", { className: "fixed bottom-20 right-4 z-50 bg-white border border-slate-200 rounded-2xl shadow-lg text-xs font-medium select-none", style: { minWidth: 130 }, children: [ /*#__PURE__*/ _jsxs("button", { onClick: ()=>setExpanded((v)=>!v), className: "flex items-center justify-between gap-2 w-full px-3 py-2 text-slate-500 hover:text-slate-700 transition rounded-2xl", children: [ /*#__PURE__*/ _jsx("span", { children: "\uD83D\uDC41 Preview" }), /*#__PURE__*/ _jsx("span", { className: "text-slate-300", children: expanded ? '▲' : 'â–Œ' }) ] }), expanded && /*#__PURE__*/ _jsx("div", { className: "flex flex-col gap-1 px-2 pb-2 border-t border-slate-100 pt-2", children: visiblePlans.length > 0 && /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx("div", { className: "text-slate-400 px-1 mt-2 mb-0.5", children: "Plan" }), visiblePlans.map((plan)=>{ var _TIER_COLORS_plan_tier; return /*#__PURE__*/ _jsxs("button", { disabled: loading, onClick: ()=>setPlan(plan.id === activePlanId ? null : plan.id), className: "flex items-center justify-between gap-2 px-3 py-1.5 rounded-xl transition text-left ".concat(activePlanId === plan.id ? 'bg-indigo-600 text-white' : 'text-slate-600 hover:bg-slate-100', " ").concat(loading ? 'opacity-50' : ''), children: [ /*#__PURE__*/ _jsx("span", { className: "truncate max-w-[90px]", children: plan.name }), /*#__PURE__*/ _jsx("span", { className: "px-1.5 py-0.5 rounded-full text-[10px] font-semibold ".concat(activePlanId === plan.id ? 'bg-white/20 text-white' : (_TIER_COLORS_plan_tier = TIER_COLORS[plan.tier]) !== null && _TIER_COLORS_plan_tier !== void 0 ? _TIER_COLORS_plan_tier : TIER_COLORS.free), children: plan.tier }) ] }, plan.id); }), activePlanId && /*#__PURE__*/ _jsx("button", { disabled: loading, onClick: ()=>setPlan(null), className: "px-3 py-1 rounded-xl text-slate-400 hover:text-red-500 hover:bg-red-50 transition text-left", children: "✕ No plan" }), hasOrigPlan && /*#__PURE__*/ _jsx("button", { disabled: loading, onClick: restorePlan, className: "px-3 py-1 rounded-xl text-green-600 hover:bg-green-50 transition text-left", children: "↩ Restore" }) ] }) }) ] }); } È70155undefined157196undefined198241undefined243294undefined296349undefined597603undefined703712(0,_lib_auth__WEBPACK_IMPORTED_MODULE_1__/* .useSession */ .wV)undefined736744(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)undefined11351142(0,react__WEBPACK_IMPORTED_MODULE_3__.useState)undefined11821189(0,react__WEBPACK_IMPORTED_MODULE_3__.useState)undefined12401247(0,react__WEBPACK_IMPORTED_MODULE_3__.useState)undefined12901297(0,react__WEBPACK_IMPORTED_MODULE_3__.useState)undefined13431350(0,react__WEBPACK_IMPORTED_MODULE_3__.useState)undefined13841389(0,react__WEBPACK_IMPORTED_MODULE_3__.useRef)undefined14021410(0,react__WEBPACK_IMPORTED_MODULE_3__.useEffect)undefined14431451(0,react__WEBPACK_IMPORTED_MODULE_3__.useEffect)undefined14711494trueundefined15961604(0,react__WEBPACK_IMPORTED_MODULE_3__.useEffect)undefined16501657(0,_lib_api__WEBPACK_IMPORTED_MODULE_4__/* .getPlans */ .T9)undefined17281736(0,react__WEBPACK_IMPORTED_MODULE_3__.useEffect)undefined26062620(0,_lib_api__WEBPACK_IMPORTED_MODULE_4__/* .updateAdminUser */ .wl)undefined33023306(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined35553559(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined38323835(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined39623965(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined41804183(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined43524356(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined43584366react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragmentundefined44414444(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined47584762(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined52905293(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined55315534(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined61126115(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined64976500(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined RawSource /***/ })þ, /***/ 1258: XÿÿÿùXÿÿÿÖ/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ E: () => (/* binding */ shortName), /* harmony export */ H: () => (/* binding */ formatShortName) /* harmony export */ }); Yÿÿÿé/** * Shortens the last name to first letter + period. * "ИваМ ПетрПв" → "ИваМ П." * Works with a pre-composed full name string. */ export function shortName(fullName) { if (!(fullName === null || fullName === void 0 ? void 0 : fullName.trim())) return '—'; const parts = fullName.trim().split(/\s+/); if (parts.length < 2 || !parts[1]) return parts[0]; return "".concat(parts[0], " ").concat(parts[1][0].toUpperCase(), "."); } /** * Formats separate firstName + lastName fields, shortening the last name. * Falls back to parsing fullName if firstName is not available. */ export function formatShortName(firstName, lastName, fallbackName) { if (firstName === null || firstName === void 0 ? void 0 : firstName.trim()) { const l = lastName === null || lastName === void 0 ? void 0 : lastName.trim(); return l ? "".concat(firstName.trim(), " ").concat(l[0].toUpperCase(), ".") : firstName.trim(); } return shortName(fallbackName); } 136142undefined596602undefinedúûú, /***/ 1592: TÿÿÿõTÿÿÿå/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ CI: () => (/* binding */ signOut), /* harmony export */ Hh: () => (/* binding */ signUp), /* harmony export */ Jv: () => (/* binding */ signIn), /* harmony export */ wV: () => (/* binding */ useSession), /* harmony export */ yK: () => (/* binding */ authClient) /* harmony export */ }); /* harmony import */ var better_auth_react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6504); Uÿÿÿ import { createAuthClient } from 'better-auth/react'; const API_URL = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; export const authClient = createAuthClient({ baseURL: API_URL }); export const { signIn, signOut, signUp, useSession } = authClient; »052undefined70100"https://api.canhelp.gr"undefined1051270undefined130136undefined156171(0,better_auth_react__WEBPACK_IMPORTED_MODULE_0__/* .createAuthClient */ .M)undefined200206undefinedö÷ö, /***/ 2568: PÿÿÿV/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { Qÿÿÿ@import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/globals.css"); ; import(/* webpackMode: "eager", webpackExports: ["AdminRolePreview"] */ "/opt/canhelp/apps/web/src/components/AdminRolePreview.tsx"); ; import(/* webpackMode: "eager", webpackExports: ["Footer"] */ "/opt/canhelp/apps/web/src/components/Footer.tsx"); ; import(/* webpackMode: "eager", webpackExports: ["Header"] */ "/opt/canhelp/apps/web/src/components/Header.tsx"); ; import(/* webpackMode: "eager", webpackExports: ["ScrollToTopButton"] */ "/opt/canhelp/apps/web/src/components/ScrollToTopButton.tsx"); ; import(/* webpackMode: "eager", webpackExports: ["LocaleProvider"] */ "/opt/canhelp/apps/web/src/context/locale.tsx"); ; import(/* webpackMode: "eager", webpackExports: ["LocationProvider"] */ "/opt/canhelp/apps/web/src/context/location.tsx"); 077Promise.resolve(/* import() eager */).then(__webpack_require__.t.bind(__webpack_require__, 8761, 23))undefined82213Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 300))undefined218329Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 9808))undefined334445Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 9649))undefined450583Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 7380))undefined588704Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 9906))undefined709829Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 4029))undefinedòóò, /***/ 3042: LÿÿÿS/***/ ((__unused_webpack_module, exports, __webpack_require__) => { "use strict"; Mÿÿÿƒ"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "workAsyncStorage", { enumerable: true, get: function() { return _workasyncstorageinstance.workAsyncStorageInstance; } }); const _workasyncstorageinstance = require("./work-async-storage-instance"); //# sourceMappingURL=work-async-storage.external.js.mapÞ012undefined1458Object.defineProperty(exports, "__esModule", (undefined7878))undefined81131Object.defineProperty(exports, "workAsyncStorage", (undefined252252))undefined289295__webpack_require__undefined2973276035undefinedîïî, /***/ 3625: HÿÿÿüJÿÿÿŒ /* __next_internal_client_entry_do_not_use__ cjs */ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "PreloadChunks", { enumerable: true, get: function() { return PreloadChunks; } }); const _jsxruntime = require("react/jsx-runtime"); const _reactdom = require("react-dom"); const _workasyncstorageexternal = require("../../../server/app-render/work-async-storage.external"); const _encodeuripath = require("../encode-uri-path"); function PreloadChunks(param) { let { moduleIds } = param; // Early return in client compilation and only load requestStore on server side if ("object" !== 'undefined') { return null; } const workStore = _workasyncstorageexternal.workAsyncStorage.getStore(); if (workStore === undefined) { return null; } const allFiles = []; // Search the current dynamic call unique key id in react loadable manifest, // and find the corresponding CSS files to preload if (workStore.reactLoadableManifest && moduleIds) { const manifest = workStore.reactLoadableManifest; for (const key of moduleIds){ if (!manifest[key]) continue; const chunks = manifest[key].files; allFiles.push(...chunks); } } if (allFiles.length === 0) { return null; } const dplId = process.env.NEXT_DEPLOYMENT_ID ? "?dpl=" + process.env.NEXT_DEPLOYMENT_ID : ''; return /*#__PURE__*/ (0, _jsxruntime.jsx)(_jsxruntime.Fragment, { children: allFiles.map((chunk)=>{ const href = workStore.assetPrefix + "/_next/" + (0, _encodeuripath.encodeURIPath)(chunk) + dplId; const isCss = chunk.endsWith('.css'); // If it's stylesheet we use `precedence` o help hoist with React Float. // For stylesheets we actually need to render the CSS because nothing else is going to do it so it needs to be part of the component tree. // The `preload` for stylesheet is not optional. if (isCss) { return /*#__PURE__*/ (0, _jsxruntime.jsx)("link", { // @ts-ignore precedence: "dynamic", href: href, rel: "stylesheet", as: "style" }, chunk); } else { // If it's script we use ReactDOM.preload to preload the resources (0, _reactdom.preload)(href, { as: 'script', fetchPriority: 'low' }); return null; } }) }); } //# sourceMappingURL=preload-chunks.js.map »5365undefined67111Object.defineProperty(exports, "__esModule", (undefined131131))undefined134181Object.defineProperty(exports, "PreloadChunks", (undefined265265))undefined288294__webpack_require__undefined2963144568undefined336342__webpack_require__undefined3443547509undefined392398__webpack_require__undefined4004553042undefined482488__webpack_require__undefined4905091271undefined668691trueundefined13971426 falseundefined143014690undefinedëìë, /***/ 4029: EÿÿÿæEÿÿÿ/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ LocationProvider: () => (/* binding */ LocationProvider), /* harmony export */ z: () => (/* binding */ useLocation) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(2982); Fÿÿÿ~ /* __next_internal_client_entry_do_not_use__ LocationProvider,useLocation auto */ import { jsx as _jsx } from "react/jsx-runtime"; import { createContext, useContext, useState, useEffect, useCallback } from 'react'; import { getLocations } from '@/lib/api'; const LocationContext = /*#__PURE__*/ createContext({ locationSlug: '', locationTree: [], locationLoading: true, setLocation: ()=>{}, getLabel: ()=>'' }); function readCookieLocation() { if (typeof document === 'undefined') return ''; const match = document.cookie.match(/(?:^|;\s*)canhelp_location=([^;]+)/); return (match === null || match === void 0 ? void 0 : match[1]) ? decodeURIComponent(match[1]) : ''; } export function LocationProvider(param) { let { children, initialSlug = '' } = param; const [locationSlug, setLocationSlug] = useState(initialSlug); const [locationTree, setLocationTree] = useState([]); const [locationLoading, setLocationLoading] = useState(true); // Sync from cookie on client mount useEffect(()=>{ const cookieSlug = readCookieLocation(); setLocationSlug(cookieSlug); }, []); // Load location tree once useEffect(()=>{ getLocations().then((tree)=>setLocationTree(tree)).catch(()=>{}).finally(()=>setLocationLoading(false)); }, []); const setLocation = useCallback((slug)=>{ setLocationSlug(slug); const encoded = encodeURIComponent(slug); document.cookie = "canhelp_location=".concat(encoded, "; path=/; max-age=31536000; SameSite=Lax"); }, []); const getLabel = useCallback((locale)=>{ if (!locationSlug) return ''; for (const city of locationTree){ var _city_names_locale; if (city.slug === locationSlug) return (_city_names_locale = city.names[locale]) !== null && _city_names_locale !== void 0 ? _city_names_locale : city.names.el; var _city_children; for (const d of (_city_children = city.children) !== null && _city_children !== void 0 ? _city_children : []){ var _d_names_locale; if (d.slug === locationSlug) return (_d_names_locale = d.names[locale]) !== null && _d_names_locale !== void 0 ? _d_names_locale : d.names.el; } } return locationSlug; }, [ locationSlug, locationTree ]); return /*#__PURE__*/ _jsx(LocationContext.Provider, { value: { locationSlug, locationTree, locationLoading, setLocation, getLabel }, children: children }); } export function useLocation() { return useContext(LocationContext); } +82129undefined131214undefined216256undefined296308(0,react__WEBPACK_IMPORTED_MODULE_1__.createContext)undefined703709undefined837844(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined904911(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined968975(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined10281036(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined11771185(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined12011212(0,_lib_api__WEBPACK_IMPORTED_MODULE_2__/* .getLocations */ .Vs)undefined13421352(0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)undefined15851595(0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)undefined23872390(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined26122618undefined26552664(0,react__WEBPACK_IMPORTED_MODULE_1__.useContext)undefinedçèç, /***/ 5575: AÿÿÿB/***/ ((module, exports, __webpack_require__) => { "use strict"; Bÿÿÿ"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "default", { enumerable: true, get: function() { return dynamic; } }); const _interop_require_default = require("@swc/helpers/_/_interop_require_default"); const _loadable = /*#__PURE__*/ _interop_require_default._(require("./lazy-dynamic/loadable")); function dynamic(dynamicOptions, options) { var _mergedOptions_loadableGenerated; const loadableOptions = {}; if (typeof dynamicOptions === 'function') { loadableOptions.loader = dynamicOptions; } const mergedOptions = { ...loadableOptions, ...options }; return (0, _loadable.default)({ ...mergedOptions, modules: (_mergedOptions_loadableGenerated = mergedOptions.loadableGenerated) == null ? void 0 : _mergedOptions_loadableGenerated.modules }); } if ((typeof exports.default === 'function' || typeof exports.default === 'object' && exports.default !== null) && typeof exports.default.__esModule === 'undefined') { Object.defineProperty(exports.default, '__esModule', { value: true }); Object.assign(exports.default, exports); module.exports = exports.default; } //# sourceMappingURL=app-dynamic.js.map  012undefined1458Object.defineProperty(exports, "__esModule", (undefined7878))undefined81122Object.defineProperty(exports, "default", (undefined200200))undefined236242__webpack_require__undefined2442844931undefined347353__webpack_require__undefined3553797007undefinedãäã, /***/ 6035: =ÿÿÿñ?ÿÿÿ¶"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "workAsyncStorageInstance", { enumerable: true, get: function() { return workAsyncStorageInstance; } }); const _asynclocalstorage = require("./async-local-storage"); const workAsyncStorageInstance = (0, _asynclocalstorage.createAsyncLocalStorage)(); //# sourceMappingURL=work-async-storage-instance.js.mapæ012undefined1458Object.defineProperty(exports, "__esModule", (undefined7878))undefined81139Object.defineProperty(exports, "workAsyncStorageInstance", (undefined234234))undefined264270__webpack_require__undefined2722949113undefinedàáà, /***/ 6442: :ÿÿÿÛ:ÿÿÿ/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* reexport default from dynamic */ _shared_lib_app_dynamic__WEBPACK_IMPORTED_MODULE_0___default.a) /* harmony export */ }); /* harmony import */ var _shared_lib_app_dynamic__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(5575); /* harmony import */ var _shared_lib_app_dynamic__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_shared_lib_app_dynamic__WEBPACK_IMPORTED_MODULE_0__); ;ÿÿÿˆexport * from '../shared/lib/app-dynamic'; export { default } from '../shared/lib/app-dynamic'; //# sourceMappingURL=app-dynamic.js.map041undefined4394undefinedÜÝÜ, /***/ 6452: 6ÿÿÿê8ÿÿÿÃ/* __next_internal_client_entry_do_not_use__ cjs */ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "BailoutToCSR", { enumerable: true, get: function() { return BailoutToCSR; } }); const _bailouttocsr = require("./bailout-to-csr"); function BailoutToCSR(param) { let { reason, children } = param; if ("object" === 'undefined') { throw Object.defineProperty(new _bailouttocsr.BailoutToCSRError(reason), "__NEXT_ERROR_CODE", { value: "E394", enumerable: false, configurable: true }); } return children; } //# sourceMappingURL=dynamic-bailout-to-csr.js.map 5365undefined67111Object.defineProperty(exports, "__esModule", (undefined131131))undefined134180Object.defineProperty(exports, "BailoutToCSR", (undefined263263))undefined288294__webpack_require__undefined2963139800undefined394417falseundefined420631{}undefinedÙÚÙ, /***/ 7007: 3ÿÿÿç5ÿÿÿr "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "default", { enumerable: true, get: function() { return _default; } }); const _jsxruntime = require("react/jsx-runtime"); const _react = require("react"); const _dynamicbailouttocsr = require("./dynamic-bailout-to-csr"); const _preloadchunks = require("./preload-chunks"); // Normalize loader to return the module as form { default: Component } for `React.lazy`. // Also for backward compatible since next/dynamic allows to resolve a component directly with loader // Client component reference proxy need to be converted to a module. function convertModule(mod) { // Check "default" prop before accessing it, as it could be client reference proxy that could break it reference. // Cases: // mod: { default: Component } // mod: Component // mod: { default: proxy(Component) } // mod: proxy(Component) const hasDefault = mod && 'default' in mod; return { default: hasDefault ? mod.default : mod }; } const defaultOptions = { loader: ()=>Promise.resolve(convertModule(()=>null)), loading: null, ssr: true }; function Loadable(options) { const opts = { ...defaultOptions, ...options }; const Lazy = /*#__PURE__*/ (0, _react.lazy)(()=>opts.loader().then(convertModule)); const Loading = opts.loading; function LoadableComponent(props) { const fallbackElement = Loading ? /*#__PURE__*/ (0, _jsxruntime.jsx)(Loading, { isLoading: true, pastDelay: true, error: null }) : null; // If it's non-SSR or provided a loading component, wrap it in a suspense boundary const hasSuspenseBoundary = !opts.ssr || !!opts.loading; const Wrap = hasSuspenseBoundary ? _react.Suspense : _react.Fragment; const wrapProps = hasSuspenseBoundary ? { fallback: fallbackElement } : {}; const children = opts.ssr ? /*#__PURE__*/ (0, _jsxruntime.jsxs)(_jsxruntime.Fragment, { children: [ "object" === 'undefined' ? /*#__PURE__*/ (0, _jsxruntime.jsx)(_preloadchunks.PreloadChunks, { moduleIds: opts.modules }) : null, /*#__PURE__*/ (0, _jsxruntime.jsx)(Lazy, { ...props }) ] }) : /*#__PURE__*/ (0, _jsxruntime.jsx)(_dynamicbailouttocsr.BailoutToCSR, { reason: "next/dynamic", children: /*#__PURE__*/ (0, _jsxruntime.jsx)(Lazy, { ...props }) }); return /*#__PURE__*/ (0, _jsxruntime.jsx)(Wrap, { ...wrapProps, children: children }); } LoadableComponent.displayName = 'LoadableComponent'; return LoadableComponent; } const _default = Loadable; //# sourceMappingURL=loadable.js.map 012undefined1458Object.defineProperty(exports, "__esModule", (undefined7878))undefined81122Object.defineProperty(exports, "default", (undefined201201))undefined224230__webpack_require__undefined2322504568undefined269275__webpack_require__undefined2772837620undefined316322__webpack_require__undefined3243496452undefined376382__webpack_require__undefined3844013625undefined21202143 falseundefined216122750undefinedÖ×Ö, /***/ 7380: 0ÿÿÿÑ0ÿÿÿ1ÿÿÿ2ÿÿÿ4»ÿÿ3ÿÿÿÕÖÕ, /***/ 8761: /ÿÿÿ/***/ (() => { 0ÿÿÿ'// extracted by mini-css-extract-pluginÑÒÑ, /***/ 9113: +ÿÿÿ>/***/ ((__unused_webpack_module, exports) => { "use strict"; ,ÿÿÿ"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); 0 && (module.exports = { bindSnapshot: null, createAsyncLocalStorage: null, createSnapshot: null }); function _export(target, all) { for(var name in all)Object.defineProperty(target, name, { enumerable: true, get: all[name] }); } _export(exports, { bindSnapshot: function() { return bindSnapshot; }, createAsyncLocalStorage: function() { return createAsyncLocalStorage; }, createSnapshot: function() { return createSnapshot; } }); const sharedAsyncLocalStorageNotAvailableError = Object.defineProperty(new Error('Invariant: AsyncLocalStorage accessed in runtime where it is not available'), "__NEXT_ERROR_CODE", { value: "E504", enumerable: false, configurable: true }); class FakeAsyncLocalStorage { disable() { throw sharedAsyncLocalStorageNotAvailableError; } getStore() { // This fake implementation of AsyncLocalStorage always returns `undefined`. return undefined; } run() { throw sharedAsyncLocalStorageNotAvailableError; } exit() { throw sharedAsyncLocalStorageNotAvailableError; } enterWith() { throw sharedAsyncLocalStorageNotAvailableError; } static bind(fn) { return fn; } } const maybeGlobalAsyncLocalStorage = typeof globalThis !== 'undefined' && globalThis.AsyncLocalStorage; function createAsyncLocalStorage() { if (maybeGlobalAsyncLocalStorage) { return new maybeGlobalAsyncLocalStorage(); } return new FakeAsyncLocalStorage(); } function bindSnapshot(fn) { if (maybeGlobalAsyncLocalStorage) { return maybeGlobalAsyncLocalStorage.bind(fn); } return FakeAsyncLocalStorage.bind(fn); } function createSnapshot() { if (maybeGlobalAsyncLocalStorage) { return maybeGlobalAsyncLocalStorage.snapshot(); } return function(fn, ...args) { return fn(...args); }; } //# sourceMappingURL=async-local-storage.js.mape012undefined1458Object.defineProperty(exports, "__esModule", (undefined7878))undefined871900undefinedÍÎÍ, /***/ 9649: 'ÿÿÿÈ'ÿÿÿ // EXPORTS __webpack_require__.d(__webpack_exports__, { Header: () => (/* binding */ Header) }); // EXTERNAL MODULE: ../../node_modules/next/dist/compiled/react/jsx-runtime.js var jsx_runtime = __webpack_require__(4568); // EXTERNAL MODULE: ../../node_modules/next/dist/client/app-dir/link.js var app_dir_link = __webpack_require__(9664); var link_default = /*#__PURE__*/__webpack_require__.n(app_dir_link); // EXTERNAL MODULE: ../../node_modules/next/dist/api/navigation.js var navigation = __webpack_require__(7541); // EXTERNAL MODULE: ./src/lib/auth.ts var auth = __webpack_require__(1592); // EXTERNAL MODULE: ./src/context/locale.tsx var context_locale = __webpack_require__(9906); // EXTERNAL MODULE: ./src/lib/formatName.ts var formatName = __webpack_require__(1258); // EXTERNAL MODULE: ../../node_modules/next/dist/compiled/react/index.js var react = __webpack_require__(7620); // EXTERNAL MODULE: ./src/lib/translations.ts var translations = __webpack_require__(4962); ;// ./src/components/LanguageSwitcher.tsx ’(ÿÿÿ™/* __next_internal_client_entry_do_not_use__ LanguageSwitcher auto */ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { useState, useRef, useEffect } from 'react'; import { useLocale } from '@/context/locale'; import { LOCALES } from '@/lib/translations'; export function LanguageSwitcher() { const { locale, setLocale } = useLocale(); const [open, setOpen] = useState(false); const ref = useRef(null); var _LOCALES_find; const current = (_LOCALES_find = LOCALES.find((l)=>l.code === locale)) !== null && _LOCALES_find !== void 0 ? _LOCALES_find : LOCALES[0]; // Close on outside click useEffect(()=>{ function handleClick(e) { if (ref.current && !ref.current.contains(e.target)) setOpen(false); } document.addEventListener('mousedown', handleClick); return ()=>document.removeEventListener('mousedown', handleClick); }, []); return /*#__PURE__*/ _jsxs("div", { ref: ref, className: "relative", children: [ /*#__PURE__*/ _jsxs("button", { onClick: ()=>setOpen(!open), className: "flex items-center gap-1.5 px-2.5 py-1.5 rounded-lg border border-gray-200 hover:border-green-400 hover:bg-green-50 transition text-sm font-medium text-gray-700", "aria-label": "Change language", children: [ /*#__PURE__*/ _jsx("span", { children: current.code.toUpperCase() }), /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5 text-gray-400 transition-transform ".concat(open ? 'rotate-180' : ''), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19 9l-7 7-7-7" }) }) ] }), open && /*#__PURE__*/ _jsx("div", { className: "absolute right-0 mt-1 w-40 bg-white border border-gray-200 rounded-xl shadow-lg z-50 overflow-hidden", children: LOCALES.map((loc)=>/*#__PURE__*/ _jsxs("button", { onClick: ()=>{ setLocale(loc.code); setOpen(false); }, className: "w-full flex items-center gap-2.5 px-3.5 py-2.5 text-sm hover:bg-green-50 transition ".concat(locale === loc.code ? 'bg-green-50 text-green-700 font-medium' : 'text-gray-700'), children: [ /*#__PURE__*/ _jsx("span", { children: loc.label }), locale === loc.code && /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5 ml-auto text-green-600", fill: "currentColor", viewBox: "0 0 20 20", children: /*#__PURE__*/ _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" }) }) ] }, loc.code)) }) ] }); } r70132undefined134185undefined187231undefined233277undefined279285undefined350358__WEBPACK_MODULE_REFERENCE__4_5b227573654c6f63616c65225d_call_directImport_asiSafe1__._undefined391398__WEBPACK_MODULE_REFERENCE__6_5b227573655374617465225d_call_directImport_asiSafe1__._undefined424429__WEBPACK_MODULE_REFERENCE__6_5b22757365526566225d_call_directImport_asiSafe1__._undefined498504__WEBPACK_MODULE_REFERENCE__7_5b224c4f43414c4553225d_call_asiSafe1__._undefined591597__WEBPACK_MODULE_REFERENCE__7_5b224c4f43414c4553225d_asiSafe1__._undefined637645__WEBPACK_MODULE_REFERENCE__6_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined950954__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined10601064__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined14241427__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined15581561__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined19111914__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined21972200__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined23682374__WEBPACK_MODULE_REFERENCE__7_5b224c4f43414c4553225d_call_asiSafe1__._undefined24012405__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined28682871__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined30323035__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined32913294__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined‹138224(0,context_locale/* useLocale */.Y)undefined257341(0,react.useState)undefined367447(0,react.useRef)undefined516585translations/* LOCALES */.YZundefined672736translations/* LOCALES */.YZundefined776862(0,react.useEffect)undefined11671243(0,jsx_runtime.jsxs)undefined13491425(0,jsx_runtime.jsxs)undefined17851859(0,jsx_runtime.jsx)undefined19902064(0,jsx_runtime.jsx)undefined24142488(0,jsx_runtime.jsx)undefined27712845(0,jsx_runtime.jsx)undefined30133082translations/* LOCALES */.YZundefined31093185(0,jsx_runtime.jsxs)undefined36483722(0,jsx_runtime.jsx)undefined38833957(0,jsx_runtime.jsx)undefined42134287(0,jsx_runtime.jsx)undefinedRawSourceì // EXTERNAL MODULE: ./src/lib/api.ts var api = __webpack_require__(2982); // EXTERNAL MODULE: ../../node_modules/socket.io-client/build/esm/index.js + 28 modules var esm = __webpack_require__(2838); ;// ./src/hooks/useEffectiveRole.ts Ž$ÿÿÿT/* __next_internal_client_entry_do_not_use__ useEffectiveRole auto */ import { useSession } from '@/lib/auth'; import { useEffect, useState } from 'react'; function readPreviewRole() { if (typeof document === 'undefined') return null; const m = document.cookie.match(/(?:^|;\s*)canhelp_preview_role=([^;]+)/); var _m_; return (_m_ = m === null || m === void 0 ? void 0 : m[1]) !== null && _m_ !== void 0 ? _m_ : null; } /** * Returns the effective role for the current user. * For admins, respects the `canhelp_preview_role` cookie set by AdminRolePreview widget. * Updates reactively when the widget dispatches `canhelp:preview-role`. */ export function useEffectiveRole() { var _session_user; const { data: session } = useSession(); const userRole = session === null || session === void 0 ? void 0 : (_session_user = session.user) === null || _session_user === void 0 ? void 0 : _session_user.role; const isAdmin = userRole === 'admin'; const [previewRole, setPreviewRole] = useState(null); useEffect(()=>{ if (!isAdmin) return; setPreviewRole(readPreviewRole()); const sync = ()=>setPreviewRole(readPreviewRole()); window.addEventListener('canhelp:preview-role', sync); document.addEventListener('visibilitychange', sync); return ()=>{ window.removeEventListener('canhelp:preview-role', sync); document.removeEventListener('visibilitychange', sync); }; }, [ isAdmin ]); if (!userRole) return null; if (isAdmin && previewRole) return previewRole; return userRole; } b70109undefined111154undefined659665undefined749758__WEBPACK_MODULE_REFERENCE__3_5b2275736553657373696f6e225d_call_directImport_asiSafe1__._undefined10171024__WEBPACK_MODULE_REFERENCE__6_5b227573655374617465225d_call_directImport_asiSafe1__._undefined10371045__WEBPACK_MODULE_REFERENCE__6_5b22757365456666656374225d_call_directImport_asiSafe1__._undefinedz658746(0,auth/* useSession */.wV)undefined10051089(0,react.useState)undefined11021188(0,react.useEffect)undefinedRawSource’ // EXTERNAL MODULE: ../../node_modules/next/dist/api/app-dynamic.js var app_dynamic = __webpack_require__(6442); ;// ./src/components/Header.tsx Š ÿÿÿ7/* __next_internal_client_entry_do_not_use__ Header auto */ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime"; import Link from 'next/link'; import { useRouter, usePathname } from 'next/navigation'; import { useSession, signOut } from '@/lib/auth'; import { useLocale } from '@/context/locale'; import { formatShortName } from '@/lib/formatName'; import { LanguageSwitcher } from './LanguageSwitcher'; import { useState, useRef, useEffect } from 'react'; import { getUnreadCount, getMyDashboard } from '@/lib/api'; import { io } from 'socket.io-client'; import { useEffectiveRole } from '@/hooks/useEffectiveRole'; import dynamic from 'next/dynamic'; const SupportModal = dynamic(()=>import('./SupportModal'), { loadableGenerated: { webpack: ()=>[ require.resolveWeak("./SupportModal") ] }, ssr: false }); const API_URL = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; export function Header() { var _session_user; const router = useRouter(); const pathname = usePathname(); const { data: session } = useSession(); const { t, locale } = useLocale(); const [menuOpen, setMenuOpen] = useState(false); const [profileOpen, setProfileOpen] = useState(false); const [supportOpen, setSupportOpen] = useState(false); const [unreadNotif, setUnreadNotif] = useState(0); const [unreadChat, setUnreadChat] = useState(0); const [msgToast, setMsgToast] = useState(null); const [planTier, setPlanTier] = useState(null); const profileRef = useRef(null); const headerRef = useRef(null); const toastTimer = useRef(null); const pathnameRef = useRef(pathname); useEffect(()=>{ pathnameRef.current = pathname; }, [ pathname ]); // Close dropdowns on outside click useEffect(()=>{ function handleClick(e) { if (profileRef.current && !profileRef.current.contains(e.target)) { setProfileOpen(false); } } document.addEventListener('mousedown', handleClick); return ()=>document.removeEventListener('mousedown', handleClick); }, []); const isAdmin = (session === null || session === void 0 ? void 0 : (_session_user = session.user) === null || _session_user === void 0 ? void 0 : _session_user.role) === 'admin'; const effectiveRole = useEffectiveRole(); const isSpecialist = effectiveRole === 'specialist'; const isActive = function(href) { let exact = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false; return exact ? pathname === href : pathname === href || pathname.startsWith(href + '/'); }; const navCls = function(href) { let exact = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false; return "font-medium text-sm transition ".concat(isActive(href, exact) ? 'text-green-600' : 'text-gray-600 hover:text-green-600'); }; const mobileNavCls = function(href) { let exact = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false; return "flex items-center gap-2 font-medium py-1 ".concat(isActive(href, exact) ? 'text-green-600' : 'text-gray-700'); }; // Reset chat badge when entering chat useEffect(()=>{ if (pathname === '/chat') setUnreadChat(0); }, [ pathname ]); useEffect(()=>{ if (!session) return; const socket = io(API_URL, { withCredentials: true, transports: [ 'websocket', 'polling' ] }); socket.on('new_message', (msg)=>{ if (pathnameRef.current === '/chat') return; setUnreadChat((c)=>c + 1); if (toastTimer.current) clearTimeout(toastTimer.current); setMsgToast(msg); toastTimer.current = setTimeout(()=>setMsgToast(null), 5000); }); return ()=>{ socket.disconnect(); if (toastTimer.current) clearTimeout(toastTimer.current); }; }, [ session ]); useEffect(()=>{ if (!session) { setUnreadNotif(0); return; } const fetch = ()=>getUnreadCount().then((r)=>setUnreadNotif(r.count)).catch(()=>{}); fetch(); const timer = setInterval(fetch, 30000); return ()=>clearInterval(timer); }, [ session ]); useEffect(()=>{ if (!session) { setPlanTier(null); return; } getMyDashboard().then((d)=>{ var _d_plan; var _d_plan_tier; return setPlanTier((_d_plan_tier = (_d_plan = d.plan) === null || _d_plan === void 0 ? void 0 : _d_plan.tier) !== null && _d_plan_tier !== void 0 ? _d_plan_tier : null); }).catch(()=>{}); }, [ session ]); useEffect(()=>{ const onScroll = ()=>{ if (!headerRef.current) return; if (window.scrollY > 40) { headerRef.current.classList.add('header-shrink'); } else { headerRef.current.classList.remove('header-shrink'); } }; window.addEventListener('scroll', onScroll); return ()=>window.removeEventListener('scroll', onScroll); }, []); return /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx("header", { ref: headerRef, className: "header-base bg-white border-b border-gray-200 sticky top-0 z-50 transition-all duration-300", children: /*#__PURE__*/ _jsxs("div", { className: "max-w-7xl mx-auto px-4 sm:px-6 lg:px-8", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between h-16 header-content transition-all duration-300", children: [ /*#__PURE__*/ _jsxs(Link, { href: "/", className: "flex items-center gap-2 shrink-0", children: [ /*#__PURE__*/ _jsx("img", { src: "/logo.png", alt: "CanHelp", className: "w-8 h-8 object-contain" }), /*#__PURE__*/ _jsx("span", { className: "logo-text text-2xl font-bold text-green-600 transition-all duration-300", children: "CanHelp" }) ] }), /*#__PURE__*/ _jsxs("nav", { className: "hidden md:flex items-center gap-5 ml-auto", children: [ isSpecialist ? /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx(Link, { href: "/tasks", className: navCls('/tasks'), children: t('nav.find_tasks') }), /*#__PURE__*/ _jsx(Link, { href: "/dashboard", className: navCls('/dashboard'), children: t('nav.dashboard') }) ] }) : /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx(Link, { href: "/tasks/new", className: navCls('/tasks/new', true), children: t('dashboard.new_task') }), " ", /*#__PURE__*/ _jsx(Link, { href: "/tasks", className: navCls('/tasks'), children: t('nav.tasks') }), " ", /*#__PURE__*/ _jsx(Link, { href: "/specialists", className: navCls('/specialists'), children: t('nav.specialists') }) ] }), /*#__PURE__*/ _jsx(Link, { href: "/pricing", className: navCls('/pricing', true), children: t('nav.pricing', 'Pricing') }), session ? /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs(Link, { href: "/notifications", className: "relative text-gray-600 hover:text-gray-900 flex items-center", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5 ".concat(unreadNotif > 0 ? 'text-green-600' : ''), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M14.857 17.082a23.848 23.848 0 005.454-1.31A8.967 8.967 0 0118 9.75v-.7V9A6 6 0 006 9v.75a8.967 8.967 0 01-2.312 6.022c1.733.64 3.56 1.085 5.455 1.31m5.714 0a24.255 24.255 0 01-5.714 0m5.714 0a3 3 0 11-5.714 0" }) }), unreadNotif > 0 && /*#__PURE__*/ _jsx("span", { className: "absolute -top-1.5 -right-1.5 min-w-[16px] h-4 px-0.5 bg-red-500 text-white text-[10px] font-bold rounded-full flex items-center justify-center leading-none", children: unreadNotif > 99 ? '99+' : unreadNotif }) ] }), /*#__PURE__*/ _jsxs(Link, { href: "/chat", className: "relative text-gray-600 hover:text-gray-900 flex items-center", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5 ".concat(unreadChat > 0 ? 'text-green-500' : ''), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }), unreadChat > 0 && /*#__PURE__*/ _jsx("span", { className: "absolute -top-1.5 -right-1.5 min-w-[16px] h-4 px-0.5 bg-green-500 text-white text-[10px] font-bold rounded-full flex items-center justify-center leading-none", children: unreadChat > 99 ? '99+' : unreadChat }) ] }), /*#__PURE__*/ _jsxs("div", { className: "relative", ref: profileRef, children: [ /*#__PURE__*/ _jsxs("button", { onClick: ()=>setProfileOpen(!profileOpen), className: "flex items-center gap-1.5 text-sm font-medium text-gray-600 hover:text-green-600", children: [ /*#__PURE__*/ _jsx("span", { className: "truncate max-w-[100px]", children: formatShortName(session.user.firstName, session.user.lastName, session.user.name) }), planTier === 'pro' && /*#__PURE__*/ _jsx("span", { className: "inline-flex items-center px-1.5 py-0.5 rounded-full text-[10px] font-bold bg-green-100 text-green-700 leading-none", children: "Pro" }), planTier === 'ultimate' && /*#__PURE__*/ _jsx("span", { className: "inline-flex items-center px-1.5 py-0.5 rounded-full text-[10px] font-bold bg-gradient-to-r from-amber-400 via-yellow-400 to-amber-400 text-gray-900 shadow-sm shadow-amber-300/50 leading-none", children: "★" }), /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19 9l-7 7-7-7" }) }) ] }), profileOpen && /*#__PURE__*/ _jsxs("div", { className: "absolute right-0 mt-2 w-52 bg-white border border-gray-200 rounded-xl shadow-lg py-1 z-50", children: [ isSpecialist ? /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs(Link, { href: "/tasks/new", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 4v16m8-8H4" }) }), t('nav.new_task') ] }), /*#__PURE__*/ _jsxs(Link, { href: "/specialists", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _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" }) }), t('nav.specialists') ] }) ] }) : /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs(Link, { href: "/notifications", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0 ".concat(unreadNotif > 0 ? 'text-green-600' : 'text-gray-400'), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M14.857 17.082a23.848 23.848 0 005.454-1.31A8.967 8.967 0 0118 9.75v-.7V9A6 6 0 006 9v.75a8.967 8.967 0 01-2.312 6.022c1.733.64 3.56 1.085 5.455 1.31m5.714 0a24.255 24.255 0 01-5.714 0m5.714 0a3 3 0 11-5.714 0" }) }), /*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-1.5", children: [ t('nav.notifications'), unreadNotif > 0 && /*#__PURE__*/ _jsx("span", { className: "px-1.5 py-0.5 bg-red-500 text-white text-[10px] font-bold rounded-full leading-none", children: unreadNotif > 99 ? '99+' : unreadNotif }) ] }) ] }), /*#__PURE__*/ _jsxs(Link, { href: "/chat", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0 ".concat(unreadChat > 0 ? 'text-green-500' : 'text-gray-400'), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }), /*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-1.5", children: [ t('nav.chat'), unreadChat > 0 && /*#__PURE__*/ _jsx("span", { className: "px-1.5 py-0.5 bg-green-500 text-white text-[10px] font-bold rounded-full leading-none", children: unreadChat > 99 ? '99+' : unreadChat }) ] }) ] }), /*#__PURE__*/ _jsxs(Link, { href: "/dashboard", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6" }) }), t('nav.dashboard') ] }) ] }), (isSpecialist || isAdmin) && /*#__PURE__*/ _jsxs(Link, { href: "/schedule", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _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" }) }), t('nav.schedule') ] }), isAdmin && /*#__PURE__*/ _jsxs(Link, { href: "/admin", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ _jsxs("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: [ /*#__PURE__*/ _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" }), /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 12a3 3 0 11-6 0 3 3 0 016 0z" }) ] }), t('nav.admin') ] }), /*#__PURE__*/ _jsxs(Link, { href: "/profile", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _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" }) }), t('nav.profile') ] }), /*#__PURE__*/ _jsxs(Link, { href: "/favorites", className: "flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50", onClick: ()=>setProfileOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4.318 6.318a4.5 4.5 0 000 6.364L12 20.364l7.682-7.682a4.5 4.5 0 00-6.364-6.364L12 7.636l-1.318-1.318a4.5 4.5 0 00-6.364 0z" }) }), t('nav.favorites') ] }), /*#__PURE__*/ _jsx("hr", { className: "my-1 border-gray-100" }), /*#__PURE__*/ _jsxs("button", { className: "w-full flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-green-50", onClick: ()=>{ setProfileOpen(false); setSupportOpen(true); }, children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _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" }) }), t('support.title') ] }), /*#__PURE__*/ _jsx("hr", { className: "my-1 border-gray-100" }), /*#__PURE__*/ _jsxs("button", { className: "w-full flex items-center gap-2.5 px-4 py-2 text-sm text-red-500 hover:bg-red-50", onClick: ()=>{ setProfileOpen(false); signOut().then(()=>{ window.location.href = '/'; }); }, children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M17 16l4-4m0 0l-4-4m4 4H7m6 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h4a3 3 0 013 3v1" }) }), t('nav.logout') ] }) ] }) ] }) ] }) : /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx(Link, { href: "/login", className: "text-gray-600 hover:text-green-600 font-medium text-sm", children: t('nav.login') }), /*#__PURE__*/ _jsx(Link, { href: "/register", className: "bg-green-600 text-white px-4 py-2 rounded-lg hover:bg-green-700 font-medium text-sm", children: t('nav.register') }) ] }), /*#__PURE__*/ _jsx(LanguageSwitcher, {}) ] }), /*#__PURE__*/ _jsxs("div", { className: "md:hidden flex items-center gap-2", children: [ /*#__PURE__*/ _jsx(LanguageSwitcher, {}), /*#__PURE__*/ _jsx("button", { className: "p-2", onClick: ()=>setMenuOpen(!menuOpen), "aria-label": "Toggle menu", children: /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5 text-gray-600", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: menuOpen ? /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" }) : /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4 6h16M4 12h16M4 18h16" }) }) }) ] }) ] }), menuOpen && /*#__PURE__*/ _jsxs("div", { className: "md:hidden py-4 border-t border-gray-100 flex flex-col gap-3", children: [ isSpecialist ? /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs(Link, { href: "/tasks", className: mobileNavCls('/tasks'), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z" }) }), t('nav.find_tasks') ] }), /*#__PURE__*/ _jsxs(Link, { href: "/dashboard", className: mobileNavCls('/dashboard'), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6" }) }), t('nav.dashboard') ] }) ] }) : /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs(Link, { href: "/tasks/new", className: mobileNavCls('/tasks/new', true), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 4v16m8-8H4" }) }), t('nav.new_task') ] }), /*#__PURE__*/ _jsxs(Link, { href: "/tasks", className: mobileNavCls('/tasks'), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _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" }) }), t('nav.tasks') ] }), /*#__PURE__*/ _jsxs(Link, { href: "/specialists", className: mobileNavCls('/specialists'), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _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" }) }), t('nav.specialists') ] }) ] }), session ? /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs(Link, { href: "/chat", className: mobileNavCls('/chat', true), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0 ".concat(unreadChat > 0 ? 'text-green-500' : ''), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }), t('nav.chat'), unreadChat > 0 && /*#__PURE__*/ _jsx("span", { className: "ml-1 px-1.5 py-0.5 bg-green-500 text-white text-[10px] font-bold rounded-full", children: unreadChat }) ] }), isSpecialist ? /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs(Link, { href: "/tasks/new", className: mobileNavCls('/tasks/new', true), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 4v16m8-8H4" }) }), t('nav.new_task') ] }), /*#__PURE__*/ _jsxs(Link, { href: "/specialists", className: mobileNavCls('/specialists'), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _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" }) }), t('nav.specialists') ] }) ] }) : /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs(Link, { href: "/notifications", className: mobileNavCls('/notifications', true), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0 ".concat(unreadNotif > 0 ? 'text-green-600' : ''), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M14.857 17.082a23.848 23.848 0 005.454-1.31A8.967 8.967 0 0118 9.75v-.7V9A6 6 0 006 9v.75a8.967 8.967 0 01-2.312 6.022c1.733.64 3.56 1.085 5.455 1.31m5.714 0a24.255 24.255 0 01-5.714 0m5.714 0a3 3 0 11-5.714 0" }) }), /*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-1.5", children: [ t('nav.notifications'), unreadNotif > 0 && /*#__PURE__*/ _jsx("span", { className: "px-1.5 py-0.5 bg-red-500 text-white text-[10px] font-bold rounded-full", children: unreadNotif > 99 ? '99+' : unreadNotif }) ] }) ] }), /*#__PURE__*/ _jsxs(Link, { href: "/dashboard", className: mobileNavCls('/dashboard'), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6" }) }), t('nav.dashboard') ] }) ] }), /*#__PURE__*/ _jsxs(Link, { href: "/favorites", className: mobileNavCls('/favorites', true), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4.318 6.318a4.5 4.5 0 000 6.364L12 20.364l7.682-7.682a4.5 4.5 0 00-6.364-6.364L12 7.636l-1.318-1.318a4.5 4.5 0 00-6.364 0z" }) }), t('nav.favorites') ] }), (isSpecialist || isAdmin) && /*#__PURE__*/ _jsxs(Link, { href: "/schedule", className: mobileNavCls('/schedule', true), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-gray-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _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" }) }), t('nav.schedule') ] }), isAdmin && /*#__PURE__*/ _jsxs(Link, { href: "/admin", className: mobileNavCls('/admin'), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ _jsxs("svg", { className: "w-4 h-4 text-gray-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: [ /*#__PURE__*/ _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" }), /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 12a3 3 0 11-6 0 3 3 0 016 0z" }) ] }), t('nav.admin') ] }), /*#__PURE__*/ _jsxs(Link, { href: "/profile", className: mobileNavCls('/profile', true), onClick: ()=>setMenuOpen(false), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-gray-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _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" }) }), t('nav.profile') ] }), /*#__PURE__*/ _jsxs("button", { onClick: ()=>{ setMenuOpen(false); signOut().then(()=>{ window.location.href = '/'; }); }, className: "flex items-center gap-2 text-left text-red-500 py-1 font-medium", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M17 16l4-4m0 0l-4-4m4 4H7m6 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h4a3 3 0 013 3v1" }) }), t('nav.logout') ] }) ] }) : /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx(Link, { href: "/login", className: "text-gray-700 font-medium py-1", onClick: ()=>setMenuOpen(false), children: t('nav.login') }), /*#__PURE__*/ _jsx(Link, { href: "/register", className: "text-green-600 font-medium py-1", onClick: ()=>setMenuOpen(false), children: t('nav.register') }) ] }) ] }) ] }) }), msgToast && /*#__PURE__*/ _jsx("div", { className: "fixed bottom-5 right-5 z-[200] max-w-sm w-full", children: /*#__PURE__*/ _jsxs("div", { className: "bg-white border border-gray-200 rounded-xl shadow-xl p-4 flex items-start gap-3 animate-fade-in", children: [ /*#__PURE__*/ _jsx("span", { className: "text-2xl shrink-0", children: "\uD83D\uDCAC" }), /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ _jsx("p", { className: "font-semibold text-gray-900 text-sm", children: t('chat.toast_title') }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-500 truncate mt-0.5", children: msgToast.body }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex flex-col items-end gap-2 shrink-0", children: [ /*#__PURE__*/ _jsx("button", { onClick: ()=>setMsgToast(null), className: "text-gray-400 hover:text-gray-600 text-lg leading-none", "aria-label": "close", children: "\xd7" }), /*#__PURE__*/ _jsx(Link, { href: "/chat?room=".concat(msgToast.roomId), onClick: ()=>setMsgToast(null), className: "text-xs text-green-600 hover:underline font-medium", children: t('chat.toast_open') }) ] }) ] }) }), supportOpen && /*#__PURE__*/ _jsx(SupportModal, { onClose: ()=>setSupportOpen(false) }) ] }); } (Z60145undefined147175undefined177233undefined235283undefined285329undefined331381undefined383436undefined438489undefined491549undefined551588undefined590649undefined651685undefined708714__WEBPACK_MODULE_REFERENCE__12_5b2264656661756c74225d_call_directImport_asiSafe1__._undefined720743__webpack_require__.e(/* import() */ 6467).then(__webpack_require__.bind(__webpack_require__, 6467))undefined812830/*require.resolve*/undefined8328476467undefined906936"https://api.canhelp.gr"undefined9419630undefined966972undefined10351043__WEBPACK_MODULE_REFERENCE__2_5b22757365526f75746572225d_call_directImport_asiSafe1__._undefined10691079__WEBPACK_MODULE_REFERENCE__2_5b22757365506174686e616d65225d_call_directImport_asiSafe1__._undefined11141123__WEBPACK_MODULE_REFERENCE__3_5b2275736553657373696f6e225d_call_directImport_asiSafe1__._undefined11541162__WEBPACK_MODULE_REFERENCE__4_5b227573654c6f63616c65225d_call_directImport_asiSafe1__._undefined12031210__WEBPACK_MODULE_REFERENCE__6_5b227573655374617465225d_call_directImport_asiSafe1__._undefined12621269__WEBPACK_MODULE_REFERENCE__6_5b227573655374617465225d_call_directImport_asiSafe1__._undefined13211328__WEBPACK_MODULE_REFERENCE__6_5b227573655374617465225d_call_directImport_asiSafe1__._undefined13801387__WEBPACK_MODULE_REFERENCE__6_5b227573655374617465225d_call_directImport_asiSafe1__._undefined14331440__WEBPACK_MODULE_REFERENCE__6_5b227573655374617465225d_call_directImport_asiSafe1__._undefined14821489__WEBPACK_MODULE_REFERENCE__6_5b227573655374617465225d_call_directImport_asiSafe1__._undefined15341541__WEBPACK_MODULE_REFERENCE__6_5b227573655374617465225d_call_directImport_asiSafe1__._undefined15731578__WEBPACK_MODULE_REFERENCE__6_5b22757365526566225d_call_directImport_asiSafe1__._undefined16091614__WEBPACK_MODULE_REFERENCE__6_5b22757365526566225d_call_directImport_asiSafe1__._undefined16461651__WEBPACK_MODULE_REFERENCE__6_5b22757365526566225d_call_directImport_asiSafe1__._undefined16841689__WEBPACK_MODULE_REFERENCE__6_5b22757365526566225d_call_directImport_asiSafe1__._undefined17061714__WEBPACK_MODULE_REFERENCE__6_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined18401848__WEBPACK_MODULE_REFERENCE__6_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined23902405__WEBPACK_MODULE_REFERENCE__11_5b22757365456666656374697665526f6c65225d_call_directImport_asiSafe1__._undefined32893297__WEBPACK_MODULE_REFERENCE__6_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined33953403__WEBPACK_MODULE_REFERENCE__6_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined34643465__WEBPACK_MODULE_REFERENCE__10_5b22696f225d_call_directImport_asiSafe1__._undefined41164124__WEBPACK_MODULE_REFERENCE__6_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined42434256__WEBPACK_MODULE_REFERENCE__9_5b22676574556e72656164436f756e74225d_call_directImport_asiSafe1__._undefined44544462__WEBPACK_MODULE_REFERENCE__6_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined45634576__WEBPACK_MODULE_REFERENCE__9_5b226765744d7944617368626f617264225d_call_directImport_asiSafe1__._undefined48924900__WEBPACK_MODULE_REFERENCE__6_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined53605364__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined53665374__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined54255428__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined56365640__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined57945798__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined60196023__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined60256028__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined62656268__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined65796582__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined69516955__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined71757179__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined71817189__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined73127315__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined73177320__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined76707673__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined76757678__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined80778081__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined80838091__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined82148217__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined82198222__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined86588661__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined86638666__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined90799082__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined90849087__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined95319534__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined95369539__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined98779881__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined98839891__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined1001410018__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1002010023__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined1036510368__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1091210915__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1159511598__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1217612180__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1218212185__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined1251812521__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1306413067__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1369413697__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1427514279__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1456814572__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1499414997__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1519215206__WEBPACK_MODULE_REFERENCE__5_5b22666f726d617453686f72744e616d65225d_call_directImport_asiSafe1__._undefined1544215445__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1591115914__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1642716430__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1698016983__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1762517629__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1796917973__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1797517983__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined1815418158__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1816018163__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined1872318726__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1938819391__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2024520249__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2025120254__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined2081620819__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2148121484__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2259422598__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2260022608__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined2277922783__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2278522788__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined2335223355__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2406524068__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2487324877__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2534225345__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2618826192__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2619426197__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined2675226755__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2746427467__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2822028224__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2867928682__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2952529529__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2953129534__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined3009430097__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3075930762__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3190531909__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3191131914__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined3243332436__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3305033053__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3391833922__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3392433927__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined3444334447__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3514335146__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3612636129__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3702037024__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3702637029__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined3754737550__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3816438167__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3900139005__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3900739010__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined3953039533__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4014740150__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4104241045__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4130341307__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4199541998__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4261242615__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4354443547__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4380543809__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4423544241__WEBPACK_MODULE_REFERENCE__3_5b227369676e4f7574225d_call_directImport_asiSafe1__._undefined4467344676__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4527645279__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4638646390__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4639246400__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined4652346526__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4652846531__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined4691646919__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4692146924__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined4742547428__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4743047445__WEBPACK_MODULE_REFERENCE__8_5b224c616e67756167655377697463686572225d_directImport_asiSafe1__._undefined4757247576__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4777347776__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4777847793__WEBPACK_MODULE_REFERENCE__8_5b224c616e67756167655377697463686572225d_directImport_asiSafe1__._undefined4785547858__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4815648159__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4860548608__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4891848921__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4948949493__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4970749711__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4971349721__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined4982849832__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4983449837__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined5017650179__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5063550638__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5123551239__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5124151244__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined5159151594__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5205052053__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5278452788__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5279052798__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined5290552909__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5291152914__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined5326753270__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5372653729__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5429554299__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5430154304__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined5464354646__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5510255105__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5578155785__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5578755790__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined5614156144__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5660056603__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5743457438__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5744057448__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined5755557559__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5756157564__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined5790757910__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5841458417__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5905959062__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5950159505__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5950759515__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined5963859642__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5964459647__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined6004060043__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6054760550__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6118861192__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined6119461197__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined6158861591__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6209562098__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6296862972__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined6297462982__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined6310563109__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined6311163114__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined6351563518__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6407164074__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6473564739__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined6510865111__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6574965753__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined6575565758__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined6614566148__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6665266655__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6750567509__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined6751167514__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined6786767870__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6832668329__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6903469038__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined6904069043__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined6939469397__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6985869861__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7051070514__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined7051670519__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined7085870862__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined7138171384__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7224472247__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7289872902__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined7290472907__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined7325673259__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7372073723__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7434174345__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined7453474540__WEBPACK_MODULE_REFERENCE__3_5b227369676e4f7574225d_call_directImport_asiSafe1__._undefined7497474977__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7542475427__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7610076104__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined7610676114__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined7622176224__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7622676229__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined7662776630__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7663276635__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined7721077213__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7734177345__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined7755677559__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7775077754__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined7790877911__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7815678159__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7844778451__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined7862978632__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7901379016__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7901879021__WEBPACK_MODULE_REFERENCE__1_5b2264656661756c74225d_directImport_asiSafe1__._undefined7953379536__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined”"93176(0,app_dynamic["default"])undefined525611(0,navigation.useRouter)undefined637727(0,navigation.usePathname)undefined762850(0,auth/* useSession */.wV)undefined881967(0,context_locale/* useLocale */.Y)undefined10081092(0,react.useState)undefined11441228(0,react.useState)undefined12801364(0,react.useState)undefined14161500(0,react.useState)undefined15461630(0,react.useState)undefined16721756(0,react.useState)undefined18011885(0,react.useState)undefined19171997(0,react.useRef)undefined20282108(0,react.useRef)undefined21402220(0,react.useRef)undefined22532333(0,react.useRef)undefined23502436(0,react.useEffect)undefined25622648(0,react.useEffect)undefined31903291useEffectiveRoleundefined41754261(0,react.useEffect)undefined43594445(0,react.useEffect)undefined45064579(0,esm.io)undefined52305316(0,react.useEffect)undefined54355531(0,api/* getUnreadCount */.$M)undefined57295815(0,react.useEffect)undefined59166012(0,api/* getMyDashboard */.H)undefined63286414(0,react.useEffect)undefined68746950(0,jsx_runtime.jsxs)undefined69527031jsx_runtime.Fragmentundefined70827156(0,jsx_runtime.jsx)undefined73647440(0,jsx_runtime.jsxs)undefined75947670(0,jsx_runtime.jsxs)undefined78917967(0,jsx_runtime.jsxs)undefined79698046(link_default())undefined82838357(0,jsx_runtime.jsx)undefined86688742(0,jsx_runtime.jsx)undefined91119187(0,jsx_runtime.jsxs)undefined94079483(0,jsx_runtime.jsxs)undefined94859564jsx_runtime.Fragmentundefined96879761(0,jsx_runtime.jsx)undefined97639840(link_default())undefined1019010264(0,jsx_runtime.jsx)undefined1026610343(link_default())undefined1074210818(0,jsx_runtime.jsxs)undefined1082010899jsx_runtime.Fragmentundefined1102211096(0,jsx_runtime.jsx)undefined1109811175(link_default())undefined1161111685(0,jsx_runtime.jsx)undefined1168711764(link_default())undefined1217712251(0,jsx_runtime.jsx)undefined1225312330(link_default())undefined1277412848(0,jsx_runtime.jsx)undefined1285012927(link_default())undefined1326513341(0,jsx_runtime.jsxs)undefined1334313422jsx_runtime.Fragmentundefined1354513621(0,jsx_runtime.jsxs)undefined1362313700(link_default())undefined1404214116(0,jsx_runtime.jsx)undefined1466014734(0,jsx_runtime.jsx)undefined1541415488(0,jsx_runtime.jsx)undefined1606616142(0,jsx_runtime.jsxs)undefined1614416221(link_default())undefined1655416628(0,jsx_runtime.jsx)undefined1717117245(0,jsx_runtime.jsx)undefined1787217946(0,jsx_runtime.jsx)undefined1852418600(0,jsx_runtime.jsxs)undefined1888918965(0,jsx_runtime.jsxs)undefined1938719461(0,jsx_runtime.jsx)undefined1965619754(0,formatName/* formatShortName */.H)undefined1999020064(0,jsx_runtime.jsx)undefined2053020604(0,jsx_runtime.jsx)undefined2111721191(0,jsx_runtime.jsx)undefined2174121815(0,jsx_runtime.jsx)undefined2245722533(0,jsx_runtime.jsxs)undefined2287322949(0,jsx_runtime.jsxs)undefined2295123030jsx_runtime.Fragmentundefined2320123277(0,jsx_runtime.jsxs)undefined2327923356(link_default())undefined2391623990(0,jsx_runtime.jsx)undefined2465224726(0,jsx_runtime.jsx)undefined2558025656(0,jsx_runtime.jsxs)undefined2565825735(link_default())undefined2629726371(0,jsx_runtime.jsx)undefined2703327107(0,jsx_runtime.jsx)undefined2821728293(0,jsx_runtime.jsxs)undefined2829528374jsx_runtime.Fragmentundefined2854528621(0,jsx_runtime.jsxs)undefined2862328700(link_default())undefined2926429338(0,jsx_runtime.jsx)undefined3004830122(0,jsx_runtime.jsx)undefined3092731003(0,jsx_runtime.jsxs)undefined3146831542(0,jsx_runtime.jsx)undefined3238532461(0,jsx_runtime.jsxs)undefined3246332540(link_default())undefined3309533169(0,jsx_runtime.jsx)undefined3387833952(0,jsx_runtime.jsx)undefined3470534781(0,jsx_runtime.jsxs)undefined3523635310(0,jsx_runtime.jsx)undefined3615336229(0,jsx_runtime.jsxs)undefined3623136308(link_default())undefined3686836942(0,jsx_runtime.jsx)undefined3760437678(0,jsx_runtime.jsx)undefined3882138897(0,jsx_runtime.jsxs)undefined3889938976(link_default())undefined3949539569(0,jsx_runtime.jsx)undefined4018340257(0,jsx_runtime.jsx)undefined4112241198(0,jsx_runtime.jsxs)undefined4120041277(link_default())undefined4179341869(0,jsx_runtime.jsxs)undefined4256542639(0,jsx_runtime.jsx)undefined4361943693(0,jsx_runtime.jsx)undefined4458444660(0,jsx_runtime.jsxs)undefined4466244739(link_default())undefined4525745331(0,jsx_runtime.jsx)undefined4594546019(0,jsx_runtime.jsx)undefined4685346929(0,jsx_runtime.jsxs)undefined4693147008(link_default())undefined4752847602(0,jsx_runtime.jsx)undefined4821648290(0,jsx_runtime.jsx)undefined4918249256(0,jsx_runtime.jsx)undefined4951449590(0,jsx_runtime.jsxs)undefined5027850352(0,jsx_runtime.jsx)undefined5096651040(0,jsx_runtime.jsx)undefined5196952043(0,jsx_runtime.jsx)undefined5230152377(0,jsx_runtime.jsxs)undefined5280352885(0,auth/* signOut */.CI)undefined5331753391(0,jsx_runtime.jsx)undefined5399154065(0,jsx_runtime.jsx)undefined5517255248(0,jsx_runtime.jsxs)undefined5525055329jsx_runtime.Fragmentundefined5545255526(0,jsx_runtime.jsx)undefined5552855605(link_default())undefined5599056064(0,jsx_runtime.jsx)undefined5606656143(link_default())undefined5664456718(0,jsx_runtime.jsx)undefined5672056815LanguageSwitcherundefined5694257018(0,jsx_runtime.jsxs)undefined5721557289(0,jsx_runtime.jsx)undefined5729157386LanguageSwitcherundefined5744857522(0,jsx_runtime.jsx)undefined5782057894(0,jsx_runtime.jsx)undefined5834058414(0,jsx_runtime.jsx)undefined5872458798(0,jsx_runtime.jsx)undefined5936659442(0,jsx_runtime.jsxs)undefined5965659732(0,jsx_runtime.jsxs)undefined5973459813jsx_runtime.Fragmentundefined5992059996(0,jsx_runtime.jsxs)undefined5999860075(link_default())undefined6041460488(0,jsx_runtime.jsx)undefined6094461018(0,jsx_runtime.jsx)undefined6161561691(0,jsx_runtime.jsxs)undefined6169361770(link_default())undefined6211762191(0,jsx_runtime.jsx)undefined6264762721(0,jsx_runtime.jsx)undefined6345263528(0,jsx_runtime.jsxs)undefined6353063609jsx_runtime.Fragmentundefined6371663792(0,jsx_runtime.jsxs)undefined6379463871(link_default())undefined6422464298(0,jsx_runtime.jsx)undefined6475464828(0,jsx_runtime.jsx)undefined6539465470(0,jsx_runtime.jsxs)undefined6547265549(link_default())undefined6588865962(0,jsx_runtime.jsx)undefined6641866492(0,jsx_runtime.jsx)undefined6716867244(0,jsx_runtime.jsxs)undefined6724667323(link_default())undefined6767467748(0,jsx_runtime.jsx)undefined6820468278(0,jsx_runtime.jsx)undefined6910969185(0,jsx_runtime.jsxs)undefined6918769266jsx_runtime.Fragmentundefined6937369449(0,jsx_runtime.jsxs)undefined6945169528(link_default())undefined6987169945(0,jsx_runtime.jsx)undefined7044970523(0,jsx_runtime.jsx)undefined7116571239(0,jsx_runtime.jsx)undefined7167871754(0,jsx_runtime.jsxs)undefined7175671835jsx_runtime.Fragmentundefined7195872034(0,jsx_runtime.jsxs)undefined7203672113(link_default())undefined7250672580(0,jsx_runtime.jsx)undefined7308473158(0,jsx_runtime.jsx)undefined7379673872(0,jsx_runtime.jsxs)undefined7387473951(link_default())undefined7434274416(0,jsx_runtime.jsx)undefined7492074994(0,jsx_runtime.jsx)undefined7586475940(0,jsx_runtime.jsxs)undefined7594276021jsx_runtime.Fragmentundefined7614476220(0,jsx_runtime.jsxs)undefined7622276299(link_default())undefined7670076774(0,jsx_runtime.jsx)undefined7732777401(0,jsx_runtime.jsx)undefined7806278138(0,jsx_runtime.jsxs)undefined7850778581(0,jsx_runtime.jsx)undefined7921979295(0,jsx_runtime.jsxs)undefined7929779374(link_default())undefined7976179835(0,jsx_runtime.jsx)undefined8033980413(0,jsx_runtime.jsx)undefined8126381339(0,jsx_runtime.jsxs)undefined8134181418(link_default())undefined8177181845(0,jsx_runtime.jsx)undefined8230182375(0,jsx_runtime.jsx)undefined8308083156(0,jsx_runtime.jsxs)undefined8315883235(link_default())undefined8358683660(0,jsx_runtime.jsx)undefined8412184195(0,jsx_runtime.jsx)undefined8484484920(0,jsx_runtime.jsxs)undefined8492284999(link_default())undefined8533885414(0,jsx_runtime.jsxs)undefined8593386007(0,jsx_runtime.jsx)undefined8686786941(0,jsx_runtime.jsx)undefined8759287668(0,jsx_runtime.jsxs)undefined8767087747(link_default())undefined8809688170(0,jsx_runtime.jsx)undefined8863188705(0,jsx_runtime.jsx)undefined8932389399(0,jsx_runtime.jsxs)undefined8958889670(0,auth/* signOut */.CI)undefined9010490178(0,jsx_runtime.jsx)undefined9062590699(0,jsx_runtime.jsx)undefined9137291448(0,jsx_runtime.jsxs)undefined9145091529jsx_runtime.Fragmentundefined9163691710(0,jsx_runtime.jsx)undefined9171291789(link_default())undefined9218792261(0,jsx_runtime.jsx)undefined9226392340(link_default())undefined9291592989(0,jsx_runtime.jsx)undefined9311793193(0,jsx_runtime.jsxs)undefined9340493478(0,jsx_runtime.jsx)undefined9366993745(0,jsx_runtime.jsxs)undefined9389993973(0,jsx_runtime.jsx)undefined9421894292(0,jsx_runtime.jsx)undefined9458094656(0,jsx_runtime.jsxs)undefined9483494908(0,jsx_runtime.jsx)undefined9528995363(0,jsx_runtime.jsx)undefined9536595442(link_default())undefined9595496028(0,jsx_runtime.jsx)undefinedÀÁÀ, /***/ 9808: ÿÿÿ»ÿÿÿ† // EXPORTS __webpack_require__.d(__webpack_exports__, { Footer: () => (/* binding */ Footer) }); // EXTERNAL MODULE: ../../node_modules/next/dist/compiled/react/jsx-runtime.js var jsx_runtime = __webpack_require__(4568); // EXTERNAL MODULE: ./src/context/locale.tsx var locale = __webpack_require__(9906); // EXTERNAL MODULE: ../../node_modules/next/dist/compiled/react/index.js var react = __webpack_require__(7620); // EXTERNAL MODULE: ../../node_modules/next/dist/client/app-dir/link.js var app_dir_link = __webpack_require__(9664); var link_default = /*#__PURE__*/__webpack_require__.n(app_dir_link); ;// ./src/components/SocialIcons.tsx …ÿÿÿ2import { jsx as _jsx } from "react/jsx-runtime"; const ICONS = [ { key: 'telegram', label: 'Telegram', hoverClass: 'hover:text-sky-500', svg: '' }, { key: 'instagram', label: 'Instagram', hoverClass: 'hover:text-pink-500', svg: '' }, { key: 'facebook', label: 'Facebook', hoverClass: 'hover:text-green-600', svg: '' }, { key: 'twitter', label: 'X', hoverClass: 'hover:text-gray-900', svg: '' }, { key: 'youtube', label: 'YouTube', hoverClass: 'hover:text-red-600', svg: '' }, { key: 'tiktok', label: 'TikTok', hoverClass: 'hover:text-black', svg: '' }, { key: 'whatsapp', label: 'WhatsApp', hoverClass: 'hover:text-green-500', svg: '' }, { key: 'viber', label: 'Viber', hoverClass: 'hover:text-purple-600', svg: '' } ]; export function SocialIcons(param) { let { className = '', links } = param; const active = ICONS.filter((param)=>{ let { key } = param; return links === null || links === void 0 ? void 0 : links[key]; }); if (active.length === 0) return null; return /*#__PURE__*/ _jsx("div", { className: "flex gap-4 flex-wrap ".concat(className), children: active.map((param)=>{ let { key, label, hoverClass, svg } = param; return /*#__PURE__*/ _jsx("a", { href: links[key], target: "_blank", rel: "noopener noreferrer", "aria-label": label, className: "text-gray-500 transition ".concat(hoverClass), children: /*#__PURE__*/ _jsx("svg", { width: "22", height: "22", viewBox: "0 0 24 24", fill: "currentColor", dangerouslySetInnerHTML: { __html: svg } }) }, key); }) }); } 1047undefined63616367undefined66616664__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined68676870__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined71437146__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefinedu66066680(0,jsx_runtime.jsx)undefined68836957(0,jsx_runtime.jsx)undefined72307304(0,jsx_runtime.jsx)undefinedRawSource! ;// ./src/components/Footer.tsx ÿÿÿì/* __next_internal_client_entry_do_not_use__ Footer auto */ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { useLocale } from '@/context/locale'; import { useEffect, useState } from 'react'; import Link from 'next/link'; import { SocialIcons } from './SocialIcons'; const API = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; export function Footer() { const { t } = useLocale(); const year = new Date().getFullYear(); const [socialLinks, setSocialLinks] = useState({}); useEffect(()=>{ fetch("".concat(API, "/api/admin/social-public")).then((r)=>r.ok ? r.json() : {}).then((kv)=>{ const links = {}; for (const [k, v] of Object.entries(kv)){ if (v) links[k.replace('social.', '')] = v; } setSocialLinks(links); }).catch(()=>{}); }, []); return /*#__PURE__*/ _jsx("footer", { className: "bg-white border-t border-gray-200 mt-16", children: /*#__PURE__*/ _jsxs("div", { className: "max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-12", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex flex-col md:flex-row justify-between items-start gap-10", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-[200px] flex flex-col items-start", children: [ /*#__PURE__*/ _jsx("span", { className: "logo-text text-3xl text-green-700 font-bold mb-2", children: "CanHelp" }), /*#__PURE__*/ _jsx("p", { className: "text-base text-gray-600 mb-4", children: t('footer.slogan') }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-[180px]", children: [ /*#__PURE__*/ _jsx("h3", { className: "text-lg font-semibold text-gray-900 mb-3", children: t('footer.links') }), /*#__PURE__*/ _jsxs("ul", { className: "space-y-2", children: [ /*#__PURE__*/ _jsx("li", { children: /*#__PURE__*/ _jsx(Link, { href: "/", className: "hover:text-green-600 transition", children: t('nav.home') }) }), /*#__PURE__*/ _jsx("li", { children: /*#__PURE__*/ _jsx(Link, { href: "/tasks", className: "hover:text-green-600 transition", children: t('nav.tasks') }) }), /*#__PURE__*/ _jsx("li", { children: /*#__PURE__*/ _jsx(Link, { href: "/specialists", className: "hover:text-green-600 transition", children: t('nav.specialists') }) }), /*#__PURE__*/ _jsx("li", { children: /*#__PURE__*/ _jsx(Link, { href: "/pricing", className: "hover:text-green-600 transition", children: t('nav.pricing') }) }), /*#__PURE__*/ _jsx("li", { children: /*#__PURE__*/ _jsx(Link, { href: "/support", className: "hover:text-green-600 transition", children: t('support.title') }) }), /*#__PURE__*/ _jsx("li", { children: /*#__PURE__*/ _jsx(Link, { href: "/privacy", className: "hover:text-green-600 transition", children: t('nav.privacy') }) }), /*#__PURE__*/ _jsx("li", { children: /*#__PURE__*/ _jsx(Link, { href: "/delete-account", className: "hover:text-red-500 transition", children: t('nav.delete_account') }) }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-[180px]", children: [ /*#__PURE__*/ _jsx("h3", { className: "text-lg font-semibold text-gray-900 mb-3", children: t('footer.socials') }), /*#__PURE__*/ _jsx("p", { className: "text-gray-500 text-sm mb-2", children: "info@canhelp.gr" }), /*#__PURE__*/ _jsx(SocialIcons, { className: "mt-2", links: socialLinks }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "mt-10 border-t border-gray-100 pt-6 text-center text-gray-400 text-sm", children: [ "\xa9 ", year, " CanHelp. ", t('footer.rights') ] }) ] }) }); } Ü60122undefined124168undefined170213undefined215243undefined245288undefined302332"https://api.canhelp.gr"undefined3373590undefined362368undefined407415__WEBPACK_MODULE_REFERENCE__1_5b227573654c6f63616c65225d_call_directImport_asiSafe1__._undefined505512__WEBPACK_MODULE_REFERENCE__2_5b227573655374617465225d_call_directImport_asiSafe1__._undefined523531__WEBPACK_MODULE_REFERENCE__2_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined898901__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined10091013__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined11491153__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined13291333__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined15191522__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined17711774__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined20582062__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined22222225__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined24722476__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined26482651__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined27292732__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined27342737__WEBPACK_MODULE_REFERENCE__3_5b2264656661756c74225d_directImport_asiSafe1__._undefined31123115__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined31933196__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined31983201__WEBPACK_MODULE_REFERENCE__3_5b2264656661756c74225d_directImport_asiSafe1__._undefined35823585__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined36633666__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined36683671__WEBPACK_MODULE_REFERENCE__3_5b2264656661756c74225d_directImport_asiSafe1__._undefined40644067__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined41454148__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined41504153__WEBPACK_MODULE_REFERENCE__3_5b2264656661756c74225d_directImport_asiSafe1__._undefined45384541__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined46194622__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined46244627__WEBPACK_MODULE_REFERENCE__3_5b2264656661756c74225d_directImport_asiSafe1__._undefined50145017__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined50955098__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined51005103__WEBPACK_MODULE_REFERENCE__3_5b2264656661756c74225d_directImport_asiSafe1__._undefined54885491__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined55695572__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined55745577__WEBPACK_MODULE_REFERENCE__3_5b2264656661756c74225d_directImport_asiSafe1__._undefined60886092__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined62526255__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined65046507__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined67396742__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined67446754__WEBPACK_MODULE_REFERENCE__4_5b22536f6369616c49636f6e73225d_directImport_asiSafe1__._undefined70337037__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefinede146232(0,locale/* useLocale */.Y)undefined322406(0,react.useState)undefined417503(0,react.useEffect)undefined870944(0,jsx_runtime.jsx)undefined10521128(0,jsx_runtime.jsxs)undefined12641340(0,jsx_runtime.jsxs)undefined15161592(0,jsx_runtime.jsxs)undefined17781852(0,jsx_runtime.jsx)undefined21012175(0,jsx_runtime.jsx)undefined24592535(0,jsx_runtime.jsxs)undefined26952769(0,jsx_runtime.jsx)undefined30163092(0,jsx_runtime.jsxs)undefined32643338(0,jsx_runtime.jsx)undefined34163490(0,jsx_runtime.jsx)undefined34923569(link_default())undefined39444018(0,jsx_runtime.jsx)undefined40964170(0,jsx_runtime.jsx)undefined41724249(link_default())undefined46304704(0,jsx_runtime.jsx)undefined47824856(0,jsx_runtime.jsx)undefined48584935(link_default())undefined53285402(0,jsx_runtime.jsx)undefined54805554(0,jsx_runtime.jsx)undefined55565633(link_default())undefined60186092(0,jsx_runtime.jsx)undefined61706244(0,jsx_runtime.jsx)undefined62466323(link_default())undefined67106784(0,jsx_runtime.jsx)undefined68626936(0,jsx_runtime.jsx)undefined69387015(link_default())undefined74007474(0,jsx_runtime.jsx)undefined75527626(0,jsx_runtime.jsx)undefined76287705(link_default())undefined82168292(0,jsx_runtime.jsxs)undefined84528526(0,jsx_runtime.jsx)undefined87758849(0,jsx_runtime.jsx)undefined90819155(0,jsx_runtime.jsx)undefined91579242SocialIconsundefined95219597(0,jsx_runtime.jsxs)undefined·ž· }, !PrefixSourceConcatSourceRawSource2__webpack_require__ => { // webpackRuntimeModules Ž÷var __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId)) __webpack_require__.O(0, [9950,1516,9664,2838,9906,2982,587,18,7358], () => (__webpack_exec__(2568))); var __webpack_exports__ = __webpack_require__.O(); ³_N_E = __webpack_exports__; } /******/ RawSource]); º!«webpack/lib/util/registerExternalSerializerœwebpack-sources/ConcatSource€` «webpack/lib/util/registerExternalSerializer™webpack-sources/RawSourceX(self["webpackChunk_N_E"] = self["webpackChunk_N_E"] || []).push([[8457],{ /***/ 1258: «webpack/lib/util/registerExternalSerializerœwebpack-sources/CachedSource d«webpack/lib/util/registerExternalSerializerœwebpack-sources/ConcatSource€«webpack/lib/util/registerExternalSerializer™webpack-sources/RawSource_/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; «webpack/lib/util/registerExternalSerializerœwebpack-sources/CachedSource Ê«webpack/lib/util/registerExternalSerializerœwebpack-sources/ConcatSource€«webpack/lib/util/registerExternalSerializer™webpack-sources/RawSourceÖ/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ E: () => (/* binding */ shortName), /* harmony export */ H: () => (/* binding */ formatShortName) /* harmony export */ }); «webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourceé/** * Shortens the last name to first letter + period. * "ИваМ ПетрПв" → "ИваМ П." * Works with a pre-composed full name string. */ export function shortName(fullName) { if (!(fullName === null || fullName === void 0 ? void 0 : fullName.trim())) return '—'; const parts = fullName.trim().split(/\s+/); if (parts.length < 2 || !parts[1]) return parts[0]; return "".concat(parts[0], " ").concat(parts[1][0].toUpperCase(), "."); } /** * Formats separate firstName + lastName fields, shortening the last name. * Falls back to parsing fullName if firstName is not available. */ export function formatShortName(firstName, lastName, fallbackName) { if (firstName === null || firstName === void 0 ? void 0 : firstName.trim()) { const l = lastName === null || lastName === void 0 ? void 0 : lastName.trim(); return l ? "".concat(firstName.trim(), " ").concat(l[0].toUpperCase(), ".") : firstName.trim(); } return shortName(fallbackName); } CˆŽTZ€€€†buffer†source„size„maps„hash±/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ E: () => (/* binding */ shortName), /* harmony export */ H: () => (/* binding */ formatShortName) /* harmony export */ }); /** * Shortens the last name to first letter + period. * "ИваМ ПетрПв" → "ИваМ П." * Works with a pre-composed full name string. */ function shortName(fullName) { if (!(fullName === null || fullName === void 0 ? void 0 : fullName.trim())) return '—'; const parts = fullName.trim().split(/\s+/); if (parts.length < 2 || !parts[1]) return parts[0]; return "".concat(parts[0], " ").concat(parts[1][0].toUpperCase(), "."); } /** * Formats separate firstName + lastName fields, shortening the last name. * Falls back to parsing fullName if firstName is not available. */ function formatShortName(firstName, lastName, fallbackName) { if (firstName === null || firstName === void 0 ? void 0 : firstName.trim()) { const l = lastName === null || lastName === void 0 ? void 0 : lastName.trim(); return l ? "".concat(firstName.trim(), " ").concat(l[0].toUpperCase(), ".") : firstName.trim(); } return shortName(fallbackName); } €”{"finalSource":true}ƒmap‹bufferedMap ConcatSourceRawSourceÖ/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ E: () => (/* binding */ shortName), /* harmony export */ H: () => (/* binding */ formatShortName) /* harmony export */ }); ReplaceSourceRawSourceé/** * Shortens the last name to first letter + period. * "ИваМ ПетрПв" → "ИваМ П." * Works with a pre-composed full name string. */ export function shortName(fullName) { if (!(fullName === null || fullName === void 0 ? void 0 : fullName.trim())) return '—'; const parts = fullName.trim().split(/\s+/); if (parts.length < 2 || !parts[1]) return parts[0]; return "".concat(parts[0], " ").concat(parts[1][0].toUpperCase(), "."); } /** * Formats separate firstName + lastName fields, shortening the last name. * Falls back to parsing fullName if firstName is not available. */ export function formatShortName(firstName, lastName, fallbackName) { if (firstName === null || firstName === void 0 ? void 0 : firstName.trim()) { const l = lastName === null || lastName === void 0 ? void 0 : lastName.trim(); return l ? "".concat(firstName.trim(), " ").concat(l[0].toUpperCase(), ".") : firstName.trim(); } return shortName(fallbackName); } 136142undefined596602undefined /***/ }) €†buffer†source„size„maps„hash/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ E: () => (/* binding */ shortName), /* harmony export */ H: () => (/* binding */ formatShortName) /* harmony export */ }); /** * Shortens the last name to first letter + period. * "ИваМ ПетрПв" → "ИваМ П." * Works with a pre-composed full name string. */ function shortName(fullName) { if (!(fullName === null || fullName === void 0 ? void 0 : fullName.trim())) return '—'; const parts = fullName.trim().split(/\s+/); if (parts.length < 2 || !parts[1]) return parts[0]; return "".concat(parts[0], " ").concat(parts[1][0].toUpperCase(), "."); } /** * Formats separate firstName + lastName fields, shortening the last name. * Falls back to parsing fullName if firstName is not available. */ function formatShortName(firstName, lastName, fallbackName) { if (firstName === null || firstName === void 0 ? void 0 : firstName.trim()) { const l = lastName === null || lastName === void 0 ? void 0 : lastName.trim(); return l ? "".concat(firstName.trim(), " ").concat(l[0].toUpperCase(), ".") : firstName.trim(); } return shortName(fallbackName); } /***/ }) €”{"finalSource":true}ƒmap‹bufferedMap  ConcatSourceRawSource_/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; þÖ/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ E: () => (/* binding */ shortName), /* harmony export */ H: () => (/* binding */ formatShortName) /* harmony export */ }); ReplaceSourceRawSourceé/** * Shortens the last name to first letter + period. * "ИваМ ПетрПв" → "ИваМ П." * Works with a pre-composed full name string. */ export function shortName(fullName) { if (!(fullName === null || fullName === void 0 ? void 0 : fullName.trim())) return '—'; const parts = fullName.trim().split(/\s+/); if (parts.length < 2 || !parts[1]) return parts[0]; return "".concat(parts[0], " ").concat(parts[1][0].toUpperCase(), "."); } /** * Formats separate firstName + lastName fields, shortening the last name. * Falls back to parsing fullName if firstName is not available. */ export function formatShortName(firstName, lastName, fallbackName) { if (firstName === null || firstName === void 0 ? void 0 : firstName.trim()) { const l = lastName === null || lastName === void 0 ? void 0 : lastName.trim(); return l ? "".concat(firstName.trim(), " ").concat(l[0].toUpperCase(), ".") : firstName.trim(); } return shortName(fallbackName); } 136142undefined596602undefined RawSource /***/ }), /***/ 1592:  ú «webpack/lib/util/registerExternalSerializerœwebpack-sources/ConcatSource€«webpack/lib/util/registerExternalSerializer™webpack-sources/RawSource_/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; «webpack/lib/util/registerExternalSerializerœwebpack-sources/CachedSource w«webpack/lib/util/registerExternalSerializerœwebpack-sources/ConcatSource€«webpack/lib/util/registerExternalSerializer™webpack-sources/RawSourceå/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ CI: () => (/* binding */ signOut), /* harmony export */ Hh: () => (/* binding */ signUp), /* harmony export */ Jv: () => (/* binding */ signIn), /* harmony export */ wV: () => (/* binding */ useSession), /* harmony export */ yK: () => (/* binding */ authClient) /* harmony export */ }); /* harmony import */ var better_auth_react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6504); «webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSource import { createAuthClient } from 'better-auth/react'; const API_URL = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; export const authClient = createAuthClient({ baseURL: API_URL }); export const { signIn, signOut, signUp, useSession } = authClient; d4FdiE‚ˆœ«È΀˜"https://api.canhelp.gr"0€Ì(0,better_auth_react__WEBPACK_IMPORTED_MODULE_0__/* .createAuthClient */ .M)€€†buffer†source„size„maps„hashÌ/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ CI: () => (/* binding */ signOut), /* harmony export */ Hh: () => (/* binding */ signUp), /* harmony export */ Jv: () => (/* binding */ signIn), /* harmony export */ wV: () => (/* binding */ useSession), /* harmony export */ yK: () => (/* binding */ authClient) /* harmony export */ }); /* harmony import */ var better_auth_react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6504); const API_URL = "https://api.canhelp.gr" || 0; const authClient = (0,better_auth_react__WEBPACK_IMPORTED_MODULE_0__/* .createAuthClient */ .M)({ baseURL: API_URL }); const { signIn, signOut, signUp, useSession } = authClient; €”{"finalSource":true}ƒmap‹bufferedMap ConcatSourceRawSourceå/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ CI: () => (/* binding */ signOut), /* harmony export */ Hh: () => (/* binding */ signUp), /* harmony export */ Jv: () => (/* binding */ signIn), /* harmony export */ wV: () => (/* binding */ useSession), /* harmony export */ yK: () => (/* binding */ authClient) /* harmony export */ }); /* harmony import */ var better_auth_react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6504); ReplaceSourceRawSource import { createAuthClient } from 'better-auth/react'; const API_URL = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; export const authClient = createAuthClient({ baseURL: API_URL }); export const { signIn, signOut, signUp, useSession } = authClient; »052undefined70100"https://api.canhelp.gr"undefined1051270undefined130136undefined156171(0,better_auth_react__WEBPACK_IMPORTED_MODULE_0__/* .createAuthClient */ .M)undefined200206undefined /***/ }) ë5/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ CI: () => (/* binding */ signOut), /* harmony export */ Hh: () => (/* binding */ signUp), /* harmony export */ Jv: () => (/* binding */ signIn), /* harmony export */ wV: () => (/* binding */ useSession), /* harmony export */ yK: () => (/* binding */ authClient) /* harmony export */ }); /* harmony import */ var better_auth_react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6504); const API_URL = "https://api.canhelp.gr" || 0; const authClient = (0,better_auth_react__WEBPACK_IMPORTED_MODULE_0__/* .createAuthClient */ .M)({ baseURL: API_URL }); const { signIn, signOut, signUp, useSession } = authClient; /***/ }) ìï  ðñðå/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ CI: () => (/* binding */ signOut), /* harmony export */ Hh: () => (/* binding */ signUp), /* harmony export */ Jv: () => (/* binding */ signIn), /* harmony export */ wV: () => (/* binding */ useSession), /* harmony export */ yK: () => (/* binding */ authClient) /* harmony export */ }); /* harmony import */ var better_auth_react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6504); ò import { createAuthClient } from 'better-auth/react'; const API_URL = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; export const authClient = createAuthClient({ baseURL: API_URL }); export const { signIn, signOut, signUp, useSession } = authClient; »052undefined70100"https://api.canhelp.gr"undefined1051270undefined130136undefined156171(0,better_auth_react__WEBPACK_IMPORTED_MODULE_0__/* .createAuthClient */ .M)undefined200206undefinedóô, /***/ 4251:  "Q«webpack/lib/util/registerExternalSerializerœwebpack-sources/ConcatSource€«webpack/lib/util/registerExternalSerializer™webpack-sources/RawSource_/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; «webpack/lib/util/registerExternalSerializerœwebpack-sources/CachedSource ž¹«webpack/lib/util/registerExternalSerializerœwebpack-sources/ConcatSource€«webpack/lib/util/registerExternalSerializer™webpack-sources/RawSource¿__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ ChatPage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7541); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(9664); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(next_link__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(1592); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(9906); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(2982); /* harmony import */ var _lib_formatName__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(1258); /* harmony import */ var socket_io_client__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(2838); «webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSource4ª/* __next_internal_client_entry_do_not_use__ default auto */ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime"; import { useState, useEffect, useRef, useCallback, Suspense } from 'react'; import { useRouter, useSearchParams } from 'next/navigation'; import Link from 'next/link'; import { useSession } from '@/lib/auth'; import { useLocale } from '@/context/locale'; import { getChatRooms, getMessages, getDailyUsage } from '@/lib/api'; import { formatShortName } from '@/lib/formatName'; import { io } from 'socket.io-client'; const API_URL = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; function ChatPageInner() { var _session_user, _activeRoom_task, _activeRoom_otherUser, _activeRoom_otherUser1, _activeRoom_otherUser2; const router = useRouter(); const searchParams = useSearchParams(); const { data: session, isPending } = useSession(); const { t, locale } = useLocale(); const [rooms, setRooms] = useState([]); const [loadingRooms, setLoadingRooms] = useState(true); const [activeRoomId, setActiveRoomId] = useState(null); const [messages, setMessages] = useState([]); const [loadingMessages, setLoadingMessages] = useState(false); const [input, setInput] = useState(''); const [connected, setConnected] = useState(false); const [msgLimit, setMsgLimit] = useState(null); const [uploadingImage, setUploadingImage] = useState(false); const [lightboxUrl, setLightboxUrl] = useState(null); const socketRef = useRef(null); const messagesEndRef = useRef(null); const inputRef = useRef(null); const fileInputRef = useRef(null); useEffect(()=>{ if (!isPending && !session) router.push('/login'); }, [ session, isPending ]); // Load chat rooms useEffect(()=>{ if (!session) return; getChatRooms().then((data)=>{ setRooms(data); const roomParam = searchParams.get('room'); if (roomParam) setActiveRoomId(roomParam); }).catch((err)=>console.error('[chat] getChatRooms error:', err)).finally(()=>setLoadingRooms(false)); getDailyUsage().then((u)=>setMsgLimit({ left: u.messagesLeft, sent: u.messagesSent })).catch((err)=>console.error('[chat] getDailyUsage error:', err)); }, [ session ]); // Setup Socket.IO useEffect(()=>{ if (!session) return; const socket = io(API_URL, { withCredentials: true, transports: [ 'websocket', 'polling' ] }); socketRef.current = socket; socket.on('connect', ()=>setConnected(true)); socket.on('disconnect', ()=>setConnected(false)); socket.on('new_message', (msg)=>{ setMessages((prev)=>{ // avoid duplicate if we get it back from our own send if (prev.some((m)=>m.message.id === msg.id)) return prev; var _session_user_name, _session_user_image; // sender info: only known for current user; others show placeholder (? avatar) const sender = session.user && session.user.id === msg.senderId ? { id: session.user.id, name: (_session_user_name = session.user.name) !== null && _session_user_name !== void 0 ? _session_user_name : '', image: (_session_user_image = session.user.image) !== null && _session_user_image !== void 0 ? _session_user_image : undefined } : null; return [ ...prev, { message: msg, sender } ]; }); // Update lastMessage in rooms list and bubble room to top setRooms((prev)=>{ const updated = prev.map((r)=>{ var _msg_translations, _msg_imageUrl; return r.room.id === msg.roomId ? { ...r, lastMessage: { body: msg.body, createdAt: msg.createdAt, translations: (_msg_translations = msg.translations) !== null && _msg_translations !== void 0 ? _msg_translations : null, imageUrl: (_msg_imageUrl = msg.imageUrl) !== null && _msg_imageUrl !== void 0 ? _msg_imageUrl : null } } : r; }); return updated.sort((a, b)=>{ var _a_lastMessage, _b_lastMessage; const aTime = ((_a_lastMessage = a.lastMessage) === null || _a_lastMessage === void 0 ? void 0 : _a_lastMessage.createdAt) ? new Date(a.lastMessage.createdAt).getTime() : new Date(a.room.createdAt).getTime(); const bTime = ((_b_lastMessage = b.lastMessage) === null || _b_lastMessage === void 0 ? void 0 : _b_lastMessage.createdAt) ? new Date(b.lastMessage.createdAt).getTime() : new Date(b.room.createdAt).getTime(); return bTime - aTime; }); }); }); socket.on('message_translated', (param)=>{ let { id, roomId, translations } = param; setMessages((prev)=>prev.map((m)=>m.message.id === id ? { ...m, message: { ...m.message, translations } } : m)); // Also update lastMessage in sidebar if this is the last message of that room if (roomId) { setRooms((prev)=>prev.map((r)=>r.room.id === roomId && r.lastMessage ? { ...r, lastMessage: { ...r.lastMessage, translations } } : r)); } }); return ()=>{ socket.disconnect(); socketRef.current = null; }; }, [ session ]); // Join room and load messages when activeRoomId changes useEffect(()=>{ var _socketRef_current, _socketRef_current1; if (!activeRoomId) return; setLoadingMessages(true); setMessages([]); getMessages(activeRoomId).then(setMessages).catch((err)=>console.error('[chat] getMessages error:', err)).finally(()=>setLoadingMessages(false)); (_socketRef_current = socketRef.current) === null || _socketRef_current === void 0 ? void 0 : _socketRef_current.emit('join_room', activeRoomId); (_socketRef_current1 = socketRef.current) === null || _socketRef_current1 === void 0 ? void 0 : _socketRef_current1.emit('mark_read', activeRoomId); }, [ activeRoomId ]); // Focus input when active room changes useEffect(()=>{ if (!activeRoomId) return; const t = setTimeout(()=>{ var _inputRef_current; return (_inputRef_current = inputRef.current) === null || _inputRef_current === void 0 ? void 0 : _inputRef_current.focus(); }, 50); return ()=>clearTimeout(t); }, [ activeRoomId ]); // Auto-scroll on new messages (within container only) useEffect(()=>{ var _messagesEndRef_current; (_messagesEndRef_current = messagesEndRef.current) === null || _messagesEndRef_current === void 0 ? void 0 : _messagesEndRef_current.scrollIntoView({ behavior: 'smooth', block: 'nearest' }); }, [ messages ]); // Close lightbox on Escape useEffect(()=>{ const onKey = (e)=>{ if (e.key === 'Escape') setLightboxUrl(null); }; window.addEventListener('keydown', onKey); return ()=>window.removeEventListener('keydown', onKey); }, []); const sendMessage = useCallback(()=>{ const body = input.trim(); if (!body || !activeRoomId || !socketRef.current) return; if (msgLimit && msgLimit.left !== null && msgLimit.left <= 0) return; socketRef.current.emit('send_message', { roomId: activeRoomId, body, locale }); setInput(''); // decrement local counter setMsgLimit((prev)=>prev && prev.left !== null ? { ...prev, left: prev.left - 1, sent: prev.sent + 1 } : prev); }, [ input, activeRoomId, msgLimit ]); const uploadAndSendImage = useCallback(async (file)=>{ if (!activeRoomId || !socketRef.current) return; setUploadingImage(true); try { const formData = new FormData(); formData.append('file', file); const res = await fetch("".concat(API_URL, "/api/uploads"), { method: 'POST', credentials: 'include', body: formData }); if (!res.ok) throw new Error('Upload failed'); const { url } = await res.json(); socketRef.current.emit('send_message', { roomId: activeRoomId, body: '', imageUrl: url, locale }); } catch (_) { // silent } finally{ setUploadingImage(false); if (fileInputRef.current) fileInputRef.current.value = ''; } }, [ activeRoomId, locale ]); const handleKeyDown = (e)=>{ if (e.key === 'Enter' && !e.shiftKey) { e.preventDefault(); sendMessage(); } }; const LOCALE_TAG = { ru: 'ru-RU', en: 'en-US', el: 'el-GR' }; var _LOCALE_TAG_locale; const localeTag = (_LOCALE_TAG_locale = LOCALE_TAG[locale]) !== null && _LOCALE_TAG_locale !== void 0 ? _LOCALE_TAG_locale : 'el-GR'; function fmtMsgTime(iso) { const d = new Date(iso); const now = new Date(); const diffMin = Math.floor((now.getTime() - d.getTime()) / 60000); if (diffMin < 1) return t('chat.just_now'); if (diffMin < 60) return "".concat(diffMin).concat(t('chat.min_ago')); if (d.toDateString() === now.toDateString()) return d.toLocaleTimeString(localeTag, { hour: '2-digit', minute: '2-digit' }); return d.toLocaleDateString(localeTag, { day: '2-digit', month: '2-digit' }); } if (isPending || loadingRooms) { return /*#__PURE__*/ _jsx("div", { className: "text-center py-20 text-white", children: t('common.loading') }); } const activeRoom = rooms.find((r)=>r.room.id === activeRoomId); const currentUserId = session === null || session === void 0 ? void 0 : (_session_user = session.user) === null || _session_user === void 0 ? void 0 : _session_user.id; var _activeRoom_task_title; return /*#__PURE__*/ _jsxs("div", { className: "max-w-5xl mx-auto px-4 py-6 h-[calc(100vh-80px)] flex gap-4", children: [ /*#__PURE__*/ _jsxs("div", { className: "w-72 flex-shrink-0 bg-white rounded-xl border border-gray-200 overflow-hidden flex flex-col", children: [ /*#__PURE__*/ _jsxs("div", { className: "p-4 border-b border-gray-100", children: [ /*#__PURE__*/ _jsx("h1", { className: "font-bold text-gray-900 text-lg", children: t('nav.chat') }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-1.5 mt-1", children: [ /*#__PURE__*/ _jsx("span", { className: "w-2 h-2 rounded-full ".concat(connected ? 'bg-green-400' : 'bg-gray-300') }), /*#__PURE__*/ _jsx("span", { className: "text-xs text-gray-400", children: connected ? t('chat.connected') : t('chat.disconnected') }) ] }) ] }), /*#__PURE__*/ _jsx("div", { className: "flex-1 overflow-y-auto", children: rooms.length === 0 ? /*#__PURE__*/ _jsx("div", { className: "p-6 text-center text-gray-400 text-sm", children: t('chat.no_rooms') }) : rooms.map((param)=>{ let { room, task, otherUser, lastMessage } = param; var _lastMessage_translations; var _task_title; const roomLabel = (_task_title = task === null || task === void 0 ? void 0 : task.title) !== null && _task_title !== void 0 ? _task_title : formatShortName(otherUser === null || otherUser === void 0 ? void 0 : otherUser.firstName, otherUser === null || otherUser === void 0 ? void 0 : otherUser.lastName, otherUser === null || otherUser === void 0 ? void 0 : otherUser.name) || t('chat.direct_chat'); const roomSub = task ? formatShortName(otherUser === null || otherUser === void 0 ? void 0 : otherUser.firstName, otherUser === null || otherUser === void 0 ? void 0 : otherUser.lastName, otherUser === null || otherUser === void 0 ? void 0 : otherUser.name) || '' : t('chat.direct_chat'); var _lastMessage_translations_locale; return /*#__PURE__*/ _jsxs("button", { onClick: ()=>{ setActiveRoomId(room.id); setTimeout(()=>{ var _inputRef_current; return (_inputRef_current = inputRef.current) === null || _inputRef_current === void 0 ? void 0 : _inputRef_current.focus(); }, 50); }, className: "w-full text-left px-4 py-3 border-b border-gray-50 hover:bg-gray-50 transition ".concat(activeRoomId === room.id ? 'bg-green-50 border-l-2 border-l-green-500' : ''), children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-start justify-between gap-1", children: [ /*#__PURE__*/ _jsx("p", { className: "text-sm font-medium text-gray-800 line-clamp-1 flex-1", children: roomLabel }), lastMessage && /*#__PURE__*/ _jsx("span", { className: "text-[10px] text-gray-400 shrink-0 mt-0.5", children: fmtMsgTime(lastMessage.createdAt) }) ] }), lastMessage ? /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-0.5 line-clamp-1", children: lastMessage.imageUrl && !lastMessage.body ? '📷' : (_lastMessage_translations_locale = (_lastMessage_translations = lastMessage.translations) === null || _lastMessage_translations === void 0 ? void 0 : _lastMessage_translations[locale]) !== null && _lastMessage_translations_locale !== void 0 ? _lastMessage_translations_locale : lastMessage.body }) : task ? /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-0.5 line-clamp-1", children: roomSub }) : null ] }, room.id); }) }) ] }), /*#__PURE__*/ _jsx("div", { className: "flex-1 bg-white rounded-xl border border-gray-200 flex flex-col overflow-hidden", children: !activeRoomId ? /*#__PURE__*/ _jsx("div", { className: "flex-1 flex items-center justify-center text-gray-400 text-sm", children: t('chat.select') }) : /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx("div", { className: "px-5 py-4 border-b border-gray-100", children: /*#__PURE__*/ _jsx("p", { className: "font-semibold text-gray-800 text-sm", children: (_activeRoom_task_title = activeRoom === null || activeRoom === void 0 ? void 0 : (_activeRoom_task = activeRoom.task) === null || _activeRoom_task === void 0 ? void 0 : _activeRoom_task.title) !== null && _activeRoom_task_title !== void 0 ? _activeRoom_task_title : formatShortName(activeRoom === null || activeRoom === void 0 ? void 0 : (_activeRoom_otherUser = activeRoom.otherUser) === null || _activeRoom_otherUser === void 0 ? void 0 : _activeRoom_otherUser.firstName, activeRoom === null || activeRoom === void 0 ? void 0 : (_activeRoom_otherUser1 = activeRoom.otherUser) === null || _activeRoom_otherUser1 === void 0 ? void 0 : _activeRoom_otherUser1.lastName, activeRoom === null || activeRoom === void 0 ? void 0 : (_activeRoom_otherUser2 = activeRoom.otherUser) === null || _activeRoom_otherUser2 === void 0 ? void 0 : _activeRoom_otherUser2.name) || t('chat.direct_chat') }) }), (activeRoom === null || activeRoom === void 0 ? void 0 : activeRoom.task) && /*#__PURE__*/ _jsxs(Link, { href: "/tasks/".concat(activeRoom.task.id), className: "flex items-center gap-3 mx-5 mt-4 px-4 py-3 bg-green-50 border border-green-200 rounded-xl hover:bg-green-100 transition group", children: [ /*#__PURE__*/ _jsx("div", { className: "w-8 h-8 rounded-lg bg-green-600 flex items-center justify-center flex-shrink-0", children: /*#__PURE__*/ _jsxs("svg", { className: "w-4 h-4 text-white", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", children: [ /*#__PURE__*/ _jsx("path", { d: "M16 4h2a2 2 0 012 2v14a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2h2" }), /*#__PURE__*/ _jsx("rect", { x: "8", y: "2", width: "8", height: "4", rx: "1", ry: "1" }) ] }) }), /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-500 font-medium", children: t('chat.linked_task') }), /*#__PURE__*/ _jsx("p", { className: "text-sm font-semibold text-gray-800 truncate group-hover:underline", children: activeRoom.task.title }) ] }), /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-gray-400 flex-shrink-0", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", children: /*#__PURE__*/ _jsx("polyline", { points: "9 18 15 12 9 6" }) }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex-1 overflow-y-auto px-5 py-4 space-y-3", children: [ loadingMessages ? /*#__PURE__*/ _jsx("div", { className: "text-center text-gray-400 text-sm py-10", children: t('common.loading') }) : messages.length === 0 ? /*#__PURE__*/ _jsx("div", { className: "text-center text-gray-400 text-sm py-10", children: t('chat.no_messages') }) : messages.map((param)=>{ let { message, sender } = param; var _sender_name_, _sender_name, _message_translations; const isMe = message.senderId === currentUserId; var _sender_name__toUpperCase, _message_translations_locale; return /*#__PURE__*/ _jsxs("div", { className: "flex gap-2.5 ".concat(isMe ? 'flex-row-reverse' : ''), children: [ /*#__PURE__*/ _jsx("div", { className: "w-8 h-8 rounded-full bg-green-100 flex-shrink-0 flex items-center justify-center text-green-700 text-xs font-bold overflow-hidden", children: (sender === null || sender === void 0 ? void 0 : sender.image) ? /*#__PURE__*/ _jsx("img", { src: sender.image, alt: sender.name, className: "w-full h-full object-cover" }) : (_sender_name__toUpperCase = sender === null || sender === void 0 ? void 0 : (_sender_name = sender.name) === null || _sender_name === void 0 ? void 0 : (_sender_name_ = _sender_name[0]) === null || _sender_name_ === void 0 ? void 0 : _sender_name_.toUpperCase()) !== null && _sender_name__toUpperCase !== void 0 ? _sender_name__toUpperCase : '?' }), /*#__PURE__*/ _jsxs("div", { className: "max-w-[70%] ".concat(isMe ? 'items-end' : 'items-start', " flex flex-col gap-1"), children: [ !isMe && /*#__PURE__*/ _jsx("span", { className: "text-xs text-gray-400 px-1", children: formatShortName(sender === null || sender === void 0 ? void 0 : sender.firstName, sender === null || sender === void 0 ? void 0 : sender.lastName, sender === null || sender === void 0 ? void 0 : sender.name) }), message.imageUrl ? /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setLightboxUrl("".concat(API_URL).concat(message.imageUrl)), className: "block focus:outline-none", children: /*#__PURE__*/ _jsx("img", { src: "".concat(API_URL).concat(message.imageUrl), alt: "photo", className: "rounded-2xl max-w-[240px] max-h-[320px] object-cover cursor-pointer hover:opacity-90 transition" }) }) : /*#__PURE__*/ _jsx("div", { className: "px-4 py-2 rounded-2xl text-sm leading-relaxed ".concat(isMe ? 'bg-green-600 text-white rounded-tr-sm' : 'bg-gray-100 text-gray-800 rounded-tl-sm'), children: (_message_translations_locale = (_message_translations = message.translations) === null || _message_translations === void 0 ? void 0 : _message_translations[locale]) !== null && _message_translations_locale !== void 0 ? _message_translations_locale : message.body }), /*#__PURE__*/ _jsx("span", { className: "text-xs text-gray-300 px-1", children: new Date(message.createdAt).toLocaleTimeString(localeTag, { hour: '2-digit', minute: '2-digit' }) }) ] }) ] }, message.id); }), /*#__PURE__*/ _jsx("div", { ref: messagesEndRef }) ] }), lightboxUrl && /*#__PURE__*/ _jsx("div", { className: "fixed inset-0 z-50 flex items-center justify-center bg-black/80 backdrop-blur-sm", onClick: ()=>setLightboxUrl(null), children: /*#__PURE__*/ _jsxs("div", { className: "relative max-w-[90vw] max-h-[90vh]", onClick: (e)=>e.stopPropagation(), children: [ /*#__PURE__*/ _jsx("img", { src: lightboxUrl, alt: "photo", className: "max-w-[90vw] max-h-[90vh] rounded-2xl object-contain shadow-2xl" }), /*#__PURE__*/ _jsx("button", { onClick: ()=>setLightboxUrl(null), className: "absolute -top-3 -right-3 w-8 h-8 bg-white rounded-full flex items-center justify-center shadow-lg hover:bg-gray-100 transition", "aria-label": "Close", children: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-gray-700", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" }) }) }), /*#__PURE__*/ _jsx("a", { href: lightboxUrl, download: true, target: "_blank", rel: "noreferrer", className: "absolute -bottom-3 -right-3 w-8 h-8 bg-white rounded-full flex items-center justify-center shadow-lg hover:bg-gray-100 transition", "aria-label": "Download", onClick: (e)=>e.stopPropagation(), children: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-gray-700", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4 16v2a2 2 0 002 2h12a2 2 0 002-2v-2M7 10l5 5 5-5M12 15V3" }) }) }) ] }) }), /*#__PURE__*/ _jsxs("div", { className: "px-4 py-3 border-t border-gray-100", children: [ " ", /*#__PURE__*/ _jsx("input", { ref: fileInputRef, type: "file", accept: "image/jpeg,image/png,image/gif,image/webp", className: "hidden", onChange: (e)=>{ var _e_target_files; const file = (_e_target_files = e.target.files) === null || _e_target_files === void 0 ? void 0 : _e_target_files[0]; if (file) uploadAndSendImage(file); } }), " ", msgLimit && msgLimit.left !== null && msgLimit.left <= 0 && /*#__PURE__*/ _jsxs("div", { className: "mb-2 flex items-center gap-2 bg-red-50 border border-red-200 rounded-xl px-3 py-2", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-red-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 9v2m0 4h.01M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z" }) }), /*#__PURE__*/ _jsx("span", { className: "text-xs text-red-700 flex-1", children: t('chat.limit_reached', 'Daily message limit reached') }), /*#__PURE__*/ _jsx(Link, { href: "/pricing", className: "text-xs font-medium text-red-700 underline", children: t('dashboard.plan.upgrade', 'Upgrade plan') }) ] }), msgLimit && msgLimit.left !== null && msgLimit.left > 0 && msgLimit.left <= Math.ceil((msgLimit.left + msgLimit.sent) * 0.2) && /*#__PURE__*/ _jsxs("div", { className: "mb-2 flex items-center gap-2 bg-amber-50 border border-amber-200 rounded-xl px-3 py-2", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-amber-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 9v2m0 4h.01M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z" }) }), /*#__PURE__*/ _jsx("span", { className: "text-xs text-amber-700 flex-1", children: t('chat.limit_warning', '{n} messages left today').replace('{n}', String(msgLimit.left)) }), /*#__PURE__*/ _jsx(Link, { href: "/pricing", className: "text-xs font-medium text-amber-700 underline", children: t('dashboard.plan.upgrade', 'Upgrade plan') }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-2 items-end", children: [ /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>{ var _fileInputRef_current; return (_fileInputRef_current = fileInputRef.current) === null || _fileInputRef_current === void 0 ? void 0 : _fileInputRef_current.click(); }, disabled: uploadingImage || !connected || !!(msgLimit && msgLimit.left !== null && msgLimit.left <= 0), className: "h-10 w-10 text-gray-400 hover:text-gray-500 disabled:opacity-40 disabled:cursor-not-allowed flex-shrink-0 flex items-center justify-center rounded-xl hover:bg-gray-50 transition", title: "Send photo", children: uploadingImage ? /*#__PURE__*/ _jsxs("svg", { className: "w-5 h-5 animate-spin", fill: "none", viewBox: "0 0 24 24", children: [ /*#__PURE__*/ _jsx("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }), /*#__PURE__*/ _jsx("path", { className: "opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8v8H4z" }) ] }) : /*#__PURE__*/ _jsxs("svg", { className: "w-5 h-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: [ /*#__PURE__*/ _jsx("rect", { x: "3", y: "3", width: "18", height: "18", rx: "3", ry: "3" }), /*#__PURE__*/ _jsx("circle", { cx: "8.5", cy: "8.5", r: "1.5" }), /*#__PURE__*/ _jsx("polyline", { points: "21 15 16 10 5 21" }) ] }) }), /*#__PURE__*/ _jsx("textarea", { ref: inputRef, value: input, onChange: (e)=>setInput(e.target.value), onKeyDown: handleKeyDown, rows: 1, placeholder: t('chat.placeholder'), disabled: !!(msgLimit && msgLimit.left !== null && msgLimit.left <= 0), className: "flex-1 border border-gray-300 rounded-xl px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 resize-none max-h-32 disabled:bg-gray-50 disabled:text-gray-400", style: { minHeight: '40px' } }), /*#__PURE__*/ _jsx("button", { onClick: sendMessage, disabled: !input.trim() || !connected || !!(msgLimit && msgLimit.left !== null && msgLimit.left <= 0), className: "h-10 w-10 bg-green-600 text-white rounded-xl hover:bg-green-700 disabled:opacity-40 disabled:cursor-not-allowed flex-shrink-0 flex items-center justify-center", children: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 12h14M12 5l7 7-7 7" }) }) }) ] }) ] }) ] }) }) ] }); } export default function ChatPage() { return /*#__PURE__*/ _jsx(Suspense, { fallback: /*#__PURE__*/ _jsx("div", { className: "text-center py-20 text-white", children: "..." }), children: /*#__PURE__*/ _jsx(ChatPageInner, {}) }); } @…`=_’”Þà:<ce‘“×Ù  2Dbg}&DR€‰š°ÓÚ _IP}„œÄìó 'U\•œÐ×öû$BGin{ƒKVk_wk s ° ± …0:OWêòLTV`ò!ü!Í)Ð)x+|+, ,Î,Ò,n-q-K.O./_/ì/ï/n1q1þ12'454_5m5Ü6à6ó9÷9Í:Ð: < <ž=¡=Õ?Ø?bAeABBÖBÚBÜBäB/C_2CŸCÁCQE_EhHlHnHqHœIÀIˆJŒJ»LŸL¬M¯MçOëOP P³Q¶Q+S.S U#UV"VêVíVßW_âWXZ\Z@[C[—\š\ˆ_Œ_¬`¯`^ala»bŸbEdHd6f9fàhãhìkïkÄlÇlÀmÄmÁnÄnppžq_¡q>sAsÜtßtUwXwóxöx{ {í{ð{:>3€6€ÙÜ¢ƒ¥ƒÖ„Ù„Û„Þ„ ‡‡ˆ ˆ°‰³‰y‹_|‹ÑŒÔŒÖŒÙŒˆŽŒŽDG““}”€”·–º–a˜e˜BšEšWœZœ©¬ Ÿ Ÿ££¥¥ÂŠÅŠ©H"©R©U©W©^©ƒ©†©ªª€€€€€€€€€˜"https://api.canhelp.gr"0º(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)À(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useSearchParams)¿(0,_lib_auth__WEBPACK_IMPORTED_MODULE_4__/* .useSession */ .wV)Ã(0,_context_locale__WEBPACK_IMPORTED_MODULE_5__/* .useLocale */ .Y)¯(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)ÿÿÿÿÿÿÿÿÿ­(0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)ÿÿÿ°(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)ÿÀ(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getChatRooms */ .Zp)Á(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getDailyUsage */ .z4)ýŽ(0,socket_io_client__WEBPACK_IMPORTED_MODULE_7__.io)ü¿(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getMessages */ .VL)ûûû²(0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)ÿ¶(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)·(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)ÿÿþÿþþþþÉ(0,_lib_formatName__WEBPACK_IMPORTED_MODULE_8__/* .formatShortName */ .H)ÿþþýýýýýýþ·react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragmentüüþý²(next_link__WEBPACK_IMPORTED_MODULE_3___default())ûüûûüûûûûüûûüûûüûýûûûûûûüûûûûûûûüûüûûûûÿüûûûûÿüûüûûüûûûûûûû€û«react__WEBPACK_IMPORTED_MODULE_1__.Suspenseúú€†buffer†source„size„maps„hashŽÃ__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ ChatPage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7541); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(9664); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(next_link__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(1592); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(9906); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(2982); /* harmony import */ var _lib_formatName__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(1258); /* harmony import */ var socket_io_client__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(2838); /* __next_internal_client_entry_do_not_use__ default auto */ const API_URL = "https://api.canhelp.gr" || 0; function ChatPageInner() { var _session_user, _activeRoom_task, _activeRoom_otherUser, _activeRoom_otherUser1, _activeRoom_otherUser2; const router = (0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)(); const searchParams = (0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useSearchParams)(); const { data: session, isPending } = (0,_lib_auth__WEBPACK_IMPORTED_MODULE_4__/* .useSession */ .wV)(); const { t, locale } = (0,_context_locale__WEBPACK_IMPORTED_MODULE_5__/* .useLocale */ .Y)(); const [rooms, setRooms] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [loadingRooms, setLoadingRooms] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(true); const [activeRoomId, setActiveRoomId] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [messages, setMessages] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [loadingMessages, setLoadingMessages] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [input, setInput] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [connected, setConnected] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [msgLimit, setMsgLimit] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [uploadingImage, setUploadingImage] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [lightboxUrl, setLightboxUrl] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const socketRef = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null); const messagesEndRef = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null); const inputRef = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null); const fileInputRef = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!isPending && !session) router.push('/login'); }, [ session, isPending ]); // Load chat rooms (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!session) return; (0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getChatRooms */ .Zp)().then((data)=>{ setRooms(data); const roomParam = searchParams.get('room'); if (roomParam) setActiveRoomId(roomParam); }).catch((err)=>console.error('[chat] getChatRooms error:', err)).finally(()=>setLoadingRooms(false)); (0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getDailyUsage */ .z4)().then((u)=>setMsgLimit({ left: u.messagesLeft, sent: u.messagesSent })).catch((err)=>console.error('[chat] getDailyUsage error:', err)); }, [ session ]); // Setup Socket.IO (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!session) return; const socket = (0,socket_io_client__WEBPACK_IMPORTED_MODULE_7__.io)(API_URL, { withCredentials: true, transports: [ 'websocket', 'polling' ] }); socketRef.current = socket; socket.on('connect', ()=>setConnected(true)); socket.on('disconnect', ()=>setConnected(false)); socket.on('new_message', (msg)=>{ setMessages((prev)=>{ // avoid duplicate if we get it back from our own send if (prev.some((m)=>m.message.id === msg.id)) return prev; var _session_user_name, _session_user_image; // sender info: only known for current user; others show placeholder (? avatar) const sender = session.user && session.user.id === msg.senderId ? { id: session.user.id, name: (_session_user_name = session.user.name) !== null && _session_user_name !== void 0 ? _session_user_name : '', image: (_session_user_image = session.user.image) !== null && _session_user_image !== void 0 ? _session_user_image : undefined } : null; return [ ...prev, { message: msg, sender } ]; }); // Update lastMessage in rooms list and bubble room to top setRooms((prev)=>{ const updated = prev.map((r)=>{ var _msg_translations, _msg_imageUrl; return r.room.id === msg.roomId ? { ...r, lastMessage: { body: msg.body, createdAt: msg.createdAt, translations: (_msg_translations = msg.translations) !== null && _msg_translations !== void 0 ? _msg_translations : null, imageUrl: (_msg_imageUrl = msg.imageUrl) !== null && _msg_imageUrl !== void 0 ? _msg_imageUrl : null } } : r; }); return updated.sort((a, b)=>{ var _a_lastMessage, _b_lastMessage; const aTime = ((_a_lastMessage = a.lastMessage) === null || _a_lastMessage === void 0 ? void 0 : _a_lastMessage.createdAt) ? new Date(a.lastMessage.createdAt).getTime() : new Date(a.room.createdAt).getTime(); const bTime = ((_b_lastMessage = b.lastMessage) === null || _b_lastMessage === void 0 ? void 0 : _b_lastMessage.createdAt) ? new Date(b.lastMessage.createdAt).getTime() : new Date(b.room.createdAt).getTime(); return bTime - aTime; }); }); }); socket.on('message_translated', (param)=>{ let { id, roomId, translations } = param; setMessages((prev)=>prev.map((m)=>m.message.id === id ? { ...m, message: { ...m.message, translations } } : m)); // Also update lastMessage in sidebar if this is the last message of that room if (roomId) { setRooms((prev)=>prev.map((r)=>r.room.id === roomId && r.lastMessage ? { ...r, lastMessage: { ...r.lastMessage, translations } } : r)); } }); return ()=>{ socket.disconnect(); socketRef.current = null; }; }, [ session ]); // Join room and load messages when activeRoomId changes (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ var _socketRef_current, _socketRef_current1; if (!activeRoomId) return; setLoadingMessages(true); setMessages([]); (0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getMessages */ .VL)(activeRoomId).then(setMessages).catch((err)=>console.error('[chat] getMessages error:', err)).finally(()=>setLoadingMessages(false)); (_socketRef_current = socketRef.current) === null || _socketRef_current === void 0 ? void 0 : _socketRef_current.emit('join_room', activeRoomId); (_socketRef_current1 = socketRef.current) === null || _socketRef_current1 === void 0 ? void 0 : _socketRef_current1.emit('mark_read', activeRoomId); }, [ activeRoomId ]); // Focus input when active room changes (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!activeRoomId) return; const t = setTimeout(()=>{ var _inputRef_current; return (_inputRef_current = inputRef.current) === null || _inputRef_current === void 0 ? void 0 : _inputRef_current.focus(); }, 50); return ()=>clearTimeout(t); }, [ activeRoomId ]); // Auto-scroll on new messages (within container only) (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ var _messagesEndRef_current; (_messagesEndRef_current = messagesEndRef.current) === null || _messagesEndRef_current === void 0 ? void 0 : _messagesEndRef_current.scrollIntoView({ behavior: 'smooth', block: 'nearest' }); }, [ messages ]); // Close lightbox on Escape (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ const onKey = (e)=>{ if (e.key === 'Escape') setLightboxUrl(null); }; window.addEventListener('keydown', onKey); return ()=>window.removeEventListener('keydown', onKey); }, []); const sendMessage = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)(()=>{ const body = input.trim(); if (!body || !activeRoomId || !socketRef.current) return; if (msgLimit && msgLimit.left !== null && msgLimit.left <= 0) return; socketRef.current.emit('send_message', { roomId: activeRoomId, body, locale }); setInput(''); // decrement local counter setMsgLimit((prev)=>prev && prev.left !== null ? { ...prev, left: prev.left - 1, sent: prev.sent + 1 } : prev); }, [ input, activeRoomId, msgLimit ]); const uploadAndSendImage = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)(async (file)=>{ if (!activeRoomId || !socketRef.current) return; setUploadingImage(true); try { const formData = new FormData(); formData.append('file', file); const res = await fetch("".concat(API_URL, "/api/uploads"), { method: 'POST', credentials: 'include', body: formData }); if (!res.ok) throw new Error('Upload failed'); const { url } = await res.json(); socketRef.current.emit('send_message', { roomId: activeRoomId, body: '', imageUrl: url, locale }); } catch (_) { // silent } finally{ setUploadingImage(false); if (fileInputRef.current) fileInputRef.current.value = ''; } }, [ activeRoomId, locale ]); const handleKeyDown = (e)=>{ if (e.key === 'Enter' && !e.shiftKey) { e.preventDefault(); sendMessage(); } }; const LOCALE_TAG = { ru: 'ru-RU', en: 'en-US', el: 'el-GR' }; var _LOCALE_TAG_locale; const localeTag = (_LOCALE_TAG_locale = LOCALE_TAG[locale]) !== null && _LOCALE_TAG_locale !== void 0 ? _LOCALE_TAG_locale : 'el-GR'; function fmtMsgTime(iso) { const d = new Date(iso); const now = new Date(); const diffMin = Math.floor((now.getTime() - d.getTime()) / 60000); if (diffMin < 1) return t('chat.just_now'); if (diffMin < 60) return "".concat(diffMin).concat(t('chat.min_ago')); if (d.toDateString() === now.toDateString()) return d.toLocaleTimeString(localeTag, { hour: '2-digit', minute: '2-digit' }); return d.toLocaleDateString(localeTag, { day: '2-digit', month: '2-digit' }); } if (isPending || loadingRooms) { return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-center py-20 text-white", children: t('common.loading') }); } const activeRoom = rooms.find((r)=>r.room.id === activeRoomId); const currentUserId = session === null || session === void 0 ? void 0 : (_session_user = session.user) === null || _session_user === void 0 ? void 0 : _session_user.id; var _activeRoom_task_title; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "max-w-5xl mx-auto px-4 py-6 h-[calc(100vh-80px)] flex gap-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "w-72 flex-shrink-0 bg-white rounded-xl border border-gray-200 overflow-hidden flex flex-col", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "p-4 border-b border-gray-100", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h1", { className: "font-bold text-gray-900 text-lg", children: t('nav.chat') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-1.5 mt-1", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "w-2 h-2 rounded-full ".concat(connected ? 'bg-green-400' : 'bg-gray-300') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-xs text-gray-400", children: connected ? t('chat.connected') : t('chat.disconnected') }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex-1 overflow-y-auto", children: rooms.length === 0 ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "p-6 text-center text-gray-400 text-sm", children: t('chat.no_rooms') }) : rooms.map((param)=>{ let { room, task, otherUser, lastMessage } = param; var _lastMessage_translations; var _task_title; const roomLabel = (_task_title = task === null || task === void 0 ? void 0 : task.title) !== null && _task_title !== void 0 ? _task_title : (0,_lib_formatName__WEBPACK_IMPORTED_MODULE_8__/* .formatShortName */ .H)(otherUser === null || otherUser === void 0 ? void 0 : otherUser.firstName, otherUser === null || otherUser === void 0 ? void 0 : otherUser.lastName, otherUser === null || otherUser === void 0 ? void 0 : otherUser.name) || t('chat.direct_chat'); const roomSub = task ? (0,_lib_formatName__WEBPACK_IMPORTED_MODULE_8__/* .formatShortName */ .H)(otherUser === null || otherUser === void 0 ? void 0 : otherUser.firstName, otherUser === null || otherUser === void 0 ? void 0 : otherUser.lastName, otherUser === null || otherUser === void 0 ? void 0 : otherUser.name) || '' : t('chat.direct_chat'); var _lastMessage_translations_locale; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { onClick: ()=>{ setActiveRoomId(room.id); setTimeout(()=>{ var _inputRef_current; return (_inputRef_current = inputRef.current) === null || _inputRef_current === void 0 ? void 0 : _inputRef_current.focus(); }, 50); }, className: "w-full text-left px-4 py-3 border-b border-gray-50 hover:bg-gray-50 transition ".concat(activeRoomId === room.id ? 'bg-green-50 border-l-2 border-l-green-500' : ''), children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-start justify-between gap-1", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm font-medium text-gray-800 line-clamp-1 flex-1", children: roomLabel }), lastMessage && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-[10px] text-gray-400 shrink-0 mt-0.5", children: fmtMsgTime(lastMessage.createdAt) }) ] }), lastMessage ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400 mt-0.5 line-clamp-1", children: lastMessage.imageUrl && !lastMessage.body ? '📷' : (_lastMessage_translations_locale = (_lastMessage_translations = lastMessage.translations) === null || _lastMessage_translations === void 0 ? void 0 : _lastMessage_translations[locale]) !== null && _lastMessage_translations_locale !== void 0 ? _lastMessage_translations_locale : lastMessage.body }) : task ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400 mt-0.5 line-clamp-1", children: roomSub }) : null ] }, room.id); }) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex-1 bg-white rounded-xl border border-gray-200 flex flex-col overflow-hidden", children: !activeRoomId ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex-1 flex items-center justify-center text-gray-400 text-sm", children: t('chat.select') }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "px-5 py-4 border-b border-gray-100", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "font-semibold text-gray-800 text-sm", children: (_activeRoom_task_title = activeRoom === null || activeRoom === void 0 ? void 0 : (_activeRoom_task = activeRoom.task) === null || _activeRoom_task === void 0 ? void 0 : _activeRoom_task.title) !== null && _activeRoom_task_title !== void 0 ? _activeRoom_task_title : (0,_lib_formatName__WEBPACK_IMPORTED_MODULE_8__/* .formatShortName */ .H)(activeRoom === null || activeRoom === void 0 ? void 0 : (_activeRoom_otherUser = activeRoom.otherUser) === null || _activeRoom_otherUser === void 0 ? void 0 : _activeRoom_otherUser.firstName, activeRoom === null || activeRoom === void 0 ? void 0 : (_activeRoom_otherUser1 = activeRoom.otherUser) === null || _activeRoom_otherUser1 === void 0 ? void 0 : _activeRoom_otherUser1.lastName, activeRoom === null || activeRoom === void 0 ? void 0 : (_activeRoom_otherUser2 = activeRoom.otherUser) === null || _activeRoom_otherUser2 === void 0 ? void 0 : _activeRoom_otherUser2.name) || t('chat.direct_chat') }) }), (activeRoom === null || activeRoom === void 0 ? void 0 : activeRoom.task) && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)((next_link__WEBPACK_IMPORTED_MODULE_3___default()), { href: "/tasks/".concat(activeRoom.task.id), className: "flex items-center gap-3 mx-5 mt-4 px-4 py-3 bg-green-50 border border-green-200 rounded-xl hover:bg-green-100 transition group", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "w-8 h-8 rounded-lg bg-green-600 flex items-center justify-center flex-shrink-0", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-4 h-4 text-white", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M16 4h2a2 2 0 012 2v14a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2h2" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("rect", { x: "8", y: "2", width: "8", height: "4", rx: "1", ry: "1" }) ] }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-500 font-medium", children: t('chat.linked_task') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm font-semibold text-gray-800 truncate group-hover:underline", children: activeRoom.task.title }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 text-gray-400 flex-shrink-0", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("polyline", { points: "9 18 15 12 9 6" }) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex-1 overflow-y-auto px-5 py-4 space-y-3", children: [ loadingMessages ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-center text-gray-400 text-sm py-10", children: t('common.loading') }) : messages.length === 0 ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-center text-gray-400 text-sm py-10", children: t('chat.no_messages') }) : messages.map((param)=>{ let { message, sender } = param; var _sender_name_, _sender_name, _message_translations; const isMe = message.senderId === currentUserId; var _sender_name__toUpperCase, _message_translations_locale; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-2.5 ".concat(isMe ? 'flex-row-reverse' : ''), children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "w-8 h-8 rounded-full bg-green-100 flex-shrink-0 flex items-center justify-center text-green-700 text-xs font-bold overflow-hidden", children: (sender === null || sender === void 0 ? void 0 : sender.image) ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: sender.image, alt: sender.name, className: "w-full h-full object-cover" }) : (_sender_name__toUpperCase = sender === null || sender === void 0 ? void 0 : (_sender_name = sender.name) === null || _sender_name === void 0 ? void 0 : (_sender_name_ = _sender_name[0]) === null || _sender_name_ === void 0 ? void 0 : _sender_name_.toUpperCase()) !== null && _sender_name__toUpperCase !== void 0 ? _sender_name__toUpperCase : '?' }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "max-w-[70%] ".concat(isMe ? 'items-end' : 'items-start', " flex flex-col gap-1"), children: [ !isMe && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-xs text-gray-400 px-1", children: (0,_lib_formatName__WEBPACK_IMPORTED_MODULE_8__/* .formatShortName */ .H)(sender === null || sender === void 0 ? void 0 : sender.firstName, sender === null || sender === void 0 ? void 0 : sender.lastName, sender === null || sender === void 0 ? void 0 : sender.name) }), message.imageUrl ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>setLightboxUrl("".concat(API_URL).concat(message.imageUrl)), className: "block focus:outline-none", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: "".concat(API_URL).concat(message.imageUrl), alt: "photo", className: "rounded-2xl max-w-[240px] max-h-[320px] object-cover cursor-pointer hover:opacity-90 transition" }) }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "px-4 py-2 rounded-2xl text-sm leading-relaxed ".concat(isMe ? 'bg-green-600 text-white rounded-tr-sm' : 'bg-gray-100 text-gray-800 rounded-tl-sm'), children: (_message_translations_locale = (_message_translations = message.translations) === null || _message_translations === void 0 ? void 0 : _message_translations[locale]) !== null && _message_translations_locale !== void 0 ? _message_translations_locale : message.body }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-xs text-gray-300 px-1", children: new Date(message.createdAt).toLocaleTimeString(localeTag, { hour: '2-digit', minute: '2-digit' }) }) ] }) ] }, message.id); }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { ref: messagesEndRef }) ] }), lightboxUrl && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "fixed inset-0 z-50 flex items-center justify-center bg-black/80 backdrop-blur-sm", onClick: ()=>setLightboxUrl(null), children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "relative max-w-[90vw] max-h-[90vh]", onClick: (e)=>e.stopPropagation(), children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: lightboxUrl, alt: "photo", className: "max-w-[90vw] max-h-[90vh] rounded-2xl object-contain shadow-2xl" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>setLightboxUrl(null), className: "absolute -top-3 -right-3 w-8 h-8 bg-white rounded-full flex items-center justify-center shadow-lg hover:bg-gray-100 transition", "aria-label": "Close", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 text-gray-700", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" }) }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("a", { href: lightboxUrl, download: true, target: "_blank", rel: "noreferrer", className: "absolute -bottom-3 -right-3 w-8 h-8 bg-white rounded-full flex items-center justify-center shadow-lg hover:bg-gray-100 transition", "aria-label": "Download", onClick: (e)=>e.stopPropagation(), children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 text-gray-700", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4 16v2a2 2 0 002 2h12a2 2 0 002-2v-2M7 10l5 5 5-5M12 15V3" }) }) }) ] }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "px-4 py-3 border-t border-gray-100", children: [ " ", /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { ref: fileInputRef, type: "file", accept: "image/jpeg,image/png,image/gif,image/webp", className: "hidden", onChange: (e)=>{ var _e_target_files; const file = (_e_target_files = e.target.files) === null || _e_target_files === void 0 ? void 0 : _e_target_files[0]; if (file) uploadAndSendImage(file); } }), " ", msgLimit && msgLimit.left !== null && msgLimit.left <= 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "mb-2 flex items-center gap-2 bg-red-50 border border-red-200 rounded-xl px-3 py-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 text-red-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 9v2m0 4h.01M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z" }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-xs text-red-700 flex-1", children: t('chat.limit_reached', 'Daily message limit reached') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)((next_link__WEBPACK_IMPORTED_MODULE_3___default()), { href: "/pricing", className: "text-xs font-medium text-red-700 underline", children: t('dashboard.plan.upgrade', 'Upgrade plan') }) ] }), msgLimit && msgLimit.left !== null && msgLimit.left > 0 && msgLimit.left <= Math.ceil((msgLimit.left + msgLimit.sent) * 0.2) && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "mb-2 flex items-center gap-2 bg-amber-50 border border-amber-200 rounded-xl px-3 py-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 text-amber-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 9v2m0 4h.01M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z" }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-xs text-amber-700 flex-1", children: t('chat.limit_warning', '{n} messages left today').replace('{n}', String(msgLimit.left)) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)((next_link__WEBPACK_IMPORTED_MODULE_3___default()), { href: "/pricing", className: "text-xs font-medium text-amber-700 underline", children: t('dashboard.plan.upgrade', 'Upgrade plan') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-2 items-end", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>{ var _fileInputRef_current; return (_fileInputRef_current = fileInputRef.current) === null || _fileInputRef_current === void 0 ? void 0 : _fileInputRef_current.click(); }, disabled: uploadingImage || !connected || !!(msgLimit && msgLimit.left !== null && msgLimit.left <= 0), className: "h-10 w-10 text-gray-400 hover:text-gray-500 disabled:opacity-40 disabled:cursor-not-allowed flex-shrink-0 flex items-center justify-center rounded-xl hover:bg-gray-50 transition", title: "Send photo", children: uploadingImage ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-5 h-5 animate-spin", fill: "none", viewBox: "0 0 24 24", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { className: "opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8v8H4z" }) ] }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-5 h-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("rect", { x: "3", y: "3", width: "18", height: "18", rx: "3", ry: "3" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("circle", { cx: "8.5", cy: "8.5", r: "1.5" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("polyline", { points: "21 15 16 10 5 21" }) ] }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("textarea", { ref: inputRef, value: input, onChange: (e)=>setInput(e.target.value), onKeyDown: handleKeyDown, rows: 1, placeholder: t('chat.placeholder'), disabled: !!(msgLimit && msgLimit.left !== null && msgLimit.left <= 0), className: "flex-1 border border-gray-300 rounded-xl px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 resize-none max-h-32 disabled:bg-gray-50 disabled:text-gray-400", style: { minHeight: '40px' } }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: sendMessage, disabled: !input.trim() || !connected || !!(msgLimit && msgLimit.left !== null && msgLimit.left <= 0), className: "h-10 w-10 bg-green-600 text-white rounded-xl hover:bg-green-700 disabled:opacity-40 disabled:cursor-not-allowed flex-shrink-0 flex items-center justify-center", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 12h14M12 5l7 7-7 7" }) }) }) ] }) ] }) ] }) }) ] }); } function ChatPage() { return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(react__WEBPACK_IMPORTED_MODULE_1__.Suspense, { fallback: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-center py-20 text-white", children: "..." }), children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(ChatPageInner, {}) }); } €”{"finalSource":true}ƒmap‹bufferedMap ConcatSourceRawSource¿__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ ChatPage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7541); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(9664); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(next_link__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(1592); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(9906); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(2982); /* harmony import */ var _lib_formatName__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(1258); /* harmony import */ var socket_io_client__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(2838); ReplaceSourceRawSource4ª/* __next_internal_client_entry_do_not_use__ default auto */ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime"; import { useState, useEffect, useRef, useCallback, Suspense } from 'react'; import { useRouter, useSearchParams } from 'next/navigation'; import Link from 'next/link'; import { useSession } from '@/lib/auth'; import { useLocale } from '@/context/locale'; import { getChatRooms, getMessages, getDailyUsage } from '@/lib/api'; import { formatShortName } from '@/lib/formatName'; import { io } from 'socket.io-client'; const API_URL = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; function ChatPageInner() { var _session_user, _activeRoom_task, _activeRoom_otherUser, _activeRoom_otherUser1, _activeRoom_otherUser2; const router = useRouter(); const searchParams = useSearchParams(); const { data: session, isPending } = useSession(); const { t, locale } = useLocale(); const [rooms, setRooms] = useState([]); const [loadingRooms, setLoadingRooms] = useState(true); const [activeRoomId, setActiveRoomId] = useState(null); const [messages, setMessages] = useState([]); const [loadingMessages, setLoadingMessages] = useState(false); const [input, setInput] = useState(''); const [connected, setConnected] = useState(false); const [msgLimit, setMsgLimit] = useState(null); const [uploadingImage, setUploadingImage] = useState(false); const [lightboxUrl, setLightboxUrl] = useState(null); const socketRef = useRef(null); const messagesEndRef = useRef(null); const inputRef = useRef(null); const fileInputRef = useRef(null); useEffect(()=>{ if (!isPending && !session) router.push('/login'); }, [ session, isPending ]); // Load chat rooms useEffect(()=>{ if (!session) return; getChatRooms().then((data)=>{ setRooms(data); const roomParam = searchParams.get('room'); if (roomParam) setActiveRoomId(roomParam); }).catch((err)=>console.error('[chat] getChatRooms error:', err)).finally(()=>setLoadingRooms(false)); getDailyUsage().then((u)=>setMsgLimit({ left: u.messagesLeft, sent: u.messagesSent })).catch((err)=>console.error('[chat] getDailyUsage error:', err)); }, [ session ]); // Setup Socket.IO useEffect(()=>{ if (!session) return; const socket = io(API_URL, { withCredentials: true, transports: [ 'websocket', 'polling' ] }); socketRef.current = socket; socket.on('connect', ()=>setConnected(true)); socket.on('disconnect', ()=>setConnected(false)); socket.on('new_message', (msg)=>{ setMessages((prev)=>{ // avoid duplicate if we get it back from our own send if (prev.some((m)=>m.message.id === msg.id)) return prev; var _session_user_name, _session_user_image; // sender info: only known for current user; others show placeholder (? avatar) const sender = session.user && session.user.id === msg.senderId ? { id: session.user.id, name: (_session_user_name = session.user.name) !== null && _session_user_name !== void 0 ? _session_user_name : '', image: (_session_user_image = session.user.image) !== null && _session_user_image !== void 0 ? _session_user_image : undefined } : null; return [ ...prev, { message: msg, sender } ]; }); // Update lastMessage in rooms list and bubble room to top setRooms((prev)=>{ const updated = prev.map((r)=>{ var _msg_translations, _msg_imageUrl; return r.room.id === msg.roomId ? { ...r, lastMessage: { body: msg.body, createdAt: msg.createdAt, translations: (_msg_translations = msg.translations) !== null && _msg_translations !== void 0 ? _msg_translations : null, imageUrl: (_msg_imageUrl = msg.imageUrl) !== null && _msg_imageUrl !== void 0 ? _msg_imageUrl : null } } : r; }); return updated.sort((a, b)=>{ var _a_lastMessage, _b_lastMessage; const aTime = ((_a_lastMessage = a.lastMessage) === null || _a_lastMessage === void 0 ? void 0 : _a_lastMessage.createdAt) ? new Date(a.lastMessage.createdAt).getTime() : new Date(a.room.createdAt).getTime(); const bTime = ((_b_lastMessage = b.lastMessage) === null || _b_lastMessage === void 0 ? void 0 : _b_lastMessage.createdAt) ? new Date(b.lastMessage.createdAt).getTime() : new Date(b.room.createdAt).getTime(); return bTime - aTime; }); }); }); socket.on('message_translated', (param)=>{ let { id, roomId, translations } = param; setMessages((prev)=>prev.map((m)=>m.message.id === id ? { ...m, message: { ...m.message, translations } } : m)); // Also update lastMessage in sidebar if this is the last message of that room if (roomId) { setRooms((prev)=>prev.map((r)=>r.room.id === roomId && r.lastMessage ? { ...r, lastMessage: { ...r.lastMessage, translations } } : r)); } }); return ()=>{ socket.disconnect(); socketRef.current = null; }; }, [ session ]); // Join room and load messages when activeRoomId changes useEffect(()=>{ var _socketRef_current, _socketRef_current1; if (!activeRoomId) return; setLoadingMessages(true); setMessages([]); getMessages(activeRoomId).then(setMessages).catch((err)=>console.error('[chat] getMessages error:', err)).finally(()=>setLoadingMessages(false)); (_socketRef_current = socketRef.current) === null || _socketRef_current === void 0 ? void 0 : _socketRef_current.emit('join_room', activeRoomId); (_socketRef_current1 = socketRef.current) === null || _socketRef_current1 === void 0 ? void 0 : _socketRef_current1.emit('mark_read', activeRoomId); }, [ activeRoomId ]); // Focus input when active room changes useEffect(()=>{ if (!activeRoomId) return; const t = setTimeout(()=>{ var _inputRef_current; return (_inputRef_current = inputRef.current) === null || _inputRef_current === void 0 ? void 0 : _inputRef_current.focus(); }, 50); return ()=>clearTimeout(t); }, [ activeRoomId ]); // Auto-scroll on new messages (within container only) useEffect(()=>{ var _messagesEndRef_current; (_messagesEndRef_current = messagesEndRef.current) === null || _messagesEndRef_current === void 0 ? void 0 : _messagesEndRef_current.scrollIntoView({ behavior: 'smooth', block: 'nearest' }); }, [ messages ]); // Close lightbox on Escape useEffect(()=>{ const onKey = (e)=>{ if (e.key === 'Escape') setLightboxUrl(null); }; window.addEventListener('keydown', onKey); return ()=>window.removeEventListener('keydown', onKey); }, []); const sendMessage = useCallback(()=>{ const body = input.trim(); if (!body || !activeRoomId || !socketRef.current) return; if (msgLimit && msgLimit.left !== null && msgLimit.left <= 0) return; socketRef.current.emit('send_message', { roomId: activeRoomId, body, locale }); setInput(''); // decrement local counter setMsgLimit((prev)=>prev && prev.left !== null ? { ...prev, left: prev.left - 1, sent: prev.sent + 1 } : prev); }, [ input, activeRoomId, msgLimit ]); const uploadAndSendImage = useCallback(async (file)=>{ if (!activeRoomId || !socketRef.current) return; setUploadingImage(true); try { const formData = new FormData(); formData.append('file', file); const res = await fetch("".concat(API_URL, "/api/uploads"), { method: 'POST', credentials: 'include', body: formData }); if (!res.ok) throw new Error('Upload failed'); const { url } = await res.json(); socketRef.current.emit('send_message', { roomId: activeRoomId, body: '', imageUrl: url, locale }); } catch (_) { // silent } finally{ setUploadingImage(false); if (fileInputRef.current) fileInputRef.current.value = ''; } }, [ activeRoomId, locale ]); const handleKeyDown = (e)=>{ if (e.key === 'Enter' && !e.shiftKey) { e.preventDefault(); sendMessage(); } }; const LOCALE_TAG = { ru: 'ru-RU', en: 'en-US', el: 'el-GR' }; var _LOCALE_TAG_locale; const localeTag = (_LOCALE_TAG_locale = LOCALE_TAG[locale]) !== null && _LOCALE_TAG_locale !== void 0 ? _LOCALE_TAG_locale : 'el-GR'; function fmtMsgTime(iso) { const d = new Date(iso); const now = new Date(); const diffMin = Math.floor((now.getTime() - d.getTime()) / 60000); if (diffMin < 1) return t('chat.just_now'); if (diffMin < 60) return "".concat(diffMin).concat(t('chat.min_ago')); if (d.toDateString() === now.toDateString()) return d.toLocaleTimeString(localeTag, { hour: '2-digit', minute: '2-digit' }); return d.toLocaleDateString(localeTag, { day: '2-digit', month: '2-digit' }); } if (isPending || loadingRooms) { return /*#__PURE__*/ _jsx("div", { className: "text-center py-20 text-white", children: t('common.loading') }); } const activeRoom = rooms.find((r)=>r.room.id === activeRoomId); const currentUserId = session === null || session === void 0 ? void 0 : (_session_user = session.user) === null || _session_user === void 0 ? void 0 : _session_user.id; var _activeRoom_task_title; return /*#__PURE__*/ _jsxs("div", { className: "max-w-5xl mx-auto px-4 py-6 h-[calc(100vh-80px)] flex gap-4", children: [ /*#__PURE__*/ _jsxs("div", { className: "w-72 flex-shrink-0 bg-white rounded-xl border border-gray-200 overflow-hidden flex flex-col", children: [ /*#__PURE__*/ _jsxs("div", { className: "p-4 border-b border-gray-100", children: [ /*#__PURE__*/ _jsx("h1", { className: "font-bold text-gray-900 text-lg", children: t('nav.chat') }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-1.5 mt-1", children: [ /*#__PURE__*/ _jsx("span", { className: "w-2 h-2 rounded-full ".concat(connected ? 'bg-green-400' : 'bg-gray-300') }), /*#__PURE__*/ _jsx("span", { className: "text-xs text-gray-400", children: connected ? t('chat.connected') : t('chat.disconnected') }) ] }) ] }), /*#__PURE__*/ _jsx("div", { className: "flex-1 overflow-y-auto", children: rooms.length === 0 ? /*#__PURE__*/ _jsx("div", { className: "p-6 text-center text-gray-400 text-sm", children: t('chat.no_rooms') }) : rooms.map((param)=>{ let { room, task, otherUser, lastMessage } = param; var _lastMessage_translations; var _task_title; const roomLabel = (_task_title = task === null || task === void 0 ? void 0 : task.title) !== null && _task_title !== void 0 ? _task_title : formatShortName(otherUser === null || otherUser === void 0 ? void 0 : otherUser.firstName, otherUser === null || otherUser === void 0 ? void 0 : otherUser.lastName, otherUser === null || otherUser === void 0 ? void 0 : otherUser.name) || t('chat.direct_chat'); const roomSub = task ? formatShortName(otherUser === null || otherUser === void 0 ? void 0 : otherUser.firstName, otherUser === null || otherUser === void 0 ? void 0 : otherUser.lastName, otherUser === null || otherUser === void 0 ? void 0 : otherUser.name) || '' : t('chat.direct_chat'); var _lastMessage_translations_locale; return /*#__PURE__*/ _jsxs("button", { onClick: ()=>{ setActiveRoomId(room.id); setTimeout(()=>{ var _inputRef_current; return (_inputRef_current = inputRef.current) === null || _inputRef_current === void 0 ? void 0 : _inputRef_current.focus(); }, 50); }, className: "w-full text-left px-4 py-3 border-b border-gray-50 hover:bg-gray-50 transition ".concat(activeRoomId === room.id ? 'bg-green-50 border-l-2 border-l-green-500' : ''), children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-start justify-between gap-1", children: [ /*#__PURE__*/ _jsx("p", { className: "text-sm font-medium text-gray-800 line-clamp-1 flex-1", children: roomLabel }), lastMessage && /*#__PURE__*/ _jsx("span", { className: "text-[10px] text-gray-400 shrink-0 mt-0.5", children: fmtMsgTime(lastMessage.createdAt) }) ] }), lastMessage ? /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-0.5 line-clamp-1", children: lastMessage.imageUrl && !lastMessage.body ? '📷' : (_lastMessage_translations_locale = (_lastMessage_translations = lastMessage.translations) === null || _lastMessage_translations === void 0 ? void 0 : _lastMessage_translations[locale]) !== null && _lastMessage_translations_locale !== void 0 ? _lastMessage_translations_locale : lastMessage.body }) : task ? /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-0.5 line-clamp-1", children: roomSub }) : null ] }, room.id); }) }) ] }), /*#__PURE__*/ _jsx("div", { className: "flex-1 bg-white rounded-xl border border-gray-200 flex flex-col overflow-hidden", children: !activeRoomId ? /*#__PURE__*/ _jsx("div", { className: "flex-1 flex items-center justify-center text-gray-400 text-sm", children: t('chat.select') }) : /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx("div", { className: "px-5 py-4 border-b border-gray-100", children: /*#__PURE__*/ _jsx("p", { className: "font-semibold text-gray-800 text-sm", children: (_activeRoom_task_title = activeRoom === null || activeRoom === void 0 ? void 0 : (_activeRoom_task = activeRoom.task) === null || _activeRoom_task === void 0 ? void 0 : _activeRoom_task.title) !== null && _activeRoom_task_title !== void 0 ? _activeRoom_task_title : formatShortName(activeRoom === null || activeRoom === void 0 ? void 0 : (_activeRoom_otherUser = activeRoom.otherUser) === null || _activeRoom_otherUser === void 0 ? void 0 : _activeRoom_otherUser.firstName, activeRoom === null || activeRoom === void 0 ? void 0 : (_activeRoom_otherUser1 = activeRoom.otherUser) === null || _activeRoom_otherUser1 === void 0 ? void 0 : _activeRoom_otherUser1.lastName, activeRoom === null || activeRoom === void 0 ? void 0 : (_activeRoom_otherUser2 = activeRoom.otherUser) === null || _activeRoom_otherUser2 === void 0 ? void 0 : _activeRoom_otherUser2.name) || t('chat.direct_chat') }) }), (activeRoom === null || activeRoom === void 0 ? void 0 : activeRoom.task) && /*#__PURE__*/ _jsxs(Link, { href: "/tasks/".concat(activeRoom.task.id), className: "flex items-center gap-3 mx-5 mt-4 px-4 py-3 bg-green-50 border border-green-200 rounded-xl hover:bg-green-100 transition group", children: [ /*#__PURE__*/ _jsx("div", { className: "w-8 h-8 rounded-lg bg-green-600 flex items-center justify-center flex-shrink-0", children: /*#__PURE__*/ _jsxs("svg", { className: "w-4 h-4 text-white", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", children: [ /*#__PURE__*/ _jsx("path", { d: "M16 4h2a2 2 0 012 2v14a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2h2" }), /*#__PURE__*/ _jsx("rect", { x: "8", y: "2", width: "8", height: "4", rx: "1", ry: "1" }) ] }) }), /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-500 font-medium", children: t('chat.linked_task') }), /*#__PURE__*/ _jsx("p", { className: "text-sm font-semibold text-gray-800 truncate group-hover:underline", children: activeRoom.task.title }) ] }), /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-gray-400 flex-shrink-0", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", children: /*#__PURE__*/ _jsx("polyline", { points: "9 18 15 12 9 6" }) }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex-1 overflow-y-auto px-5 py-4 space-y-3", children: [ loadingMessages ? /*#__PURE__*/ _jsx("div", { className: "text-center text-gray-400 text-sm py-10", children: t('common.loading') }) : messages.length === 0 ? /*#__PURE__*/ _jsx("div", { className: "text-center text-gray-400 text-sm py-10", children: t('chat.no_messages') }) : messages.map((param)=>{ let { message, sender } = param; var _sender_name_, _sender_name, _message_translations; const isMe = message.senderId === currentUserId; var _sender_name__toUpperCase, _message_translations_locale; return /*#__PURE__*/ _jsxs("div", { className: "flex gap-2.5 ".concat(isMe ? 'flex-row-reverse' : ''), children: [ /*#__PURE__*/ _jsx("div", { className: "w-8 h-8 rounded-full bg-green-100 flex-shrink-0 flex items-center justify-center text-green-700 text-xs font-bold overflow-hidden", children: (sender === null || sender === void 0 ? void 0 : sender.image) ? /*#__PURE__*/ _jsx("img", { src: sender.image, alt: sender.name, className: "w-full h-full object-cover" }) : (_sender_name__toUpperCase = sender === null || sender === void 0 ? void 0 : (_sender_name = sender.name) === null || _sender_name === void 0 ? void 0 : (_sender_name_ = _sender_name[0]) === null || _sender_name_ === void 0 ? void 0 : _sender_name_.toUpperCase()) !== null && _sender_name__toUpperCase !== void 0 ? _sender_name__toUpperCase : '?' }), /*#__PURE__*/ _jsxs("div", { className: "max-w-[70%] ".concat(isMe ? 'items-end' : 'items-start', " flex flex-col gap-1"), children: [ !isMe && /*#__PURE__*/ _jsx("span", { className: "text-xs text-gray-400 px-1", children: formatShortName(sender === null || sender === void 0 ? void 0 : sender.firstName, sender === null || sender === void 0 ? void 0 : sender.lastName, sender === null || sender === void 0 ? void 0 : sender.name) }), message.imageUrl ? /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setLightboxUrl("".concat(API_URL).concat(message.imageUrl)), className: "block focus:outline-none", children: /*#__PURE__*/ _jsx("img", { src: "".concat(API_URL).concat(message.imageUrl), alt: "photo", className: "rounded-2xl max-w-[240px] max-h-[320px] object-cover cursor-pointer hover:opacity-90 transition" }) }) : /*#__PURE__*/ _jsx("div", { className: "px-4 py-2 rounded-2xl text-sm leading-relaxed ".concat(isMe ? 'bg-green-600 text-white rounded-tr-sm' : 'bg-gray-100 text-gray-800 rounded-tl-sm'), children: (_message_translations_locale = (_message_translations = message.translations) === null || _message_translations === void 0 ? void 0 : _message_translations[locale]) !== null && _message_translations_locale !== void 0 ? _message_translations_locale : message.body }), /*#__PURE__*/ _jsx("span", { className: "text-xs text-gray-300 px-1", children: new Date(message.createdAt).toLocaleTimeString(localeTag, { hour: '2-digit', minute: '2-digit' }) }) ] }) ] }, message.id); }), /*#__PURE__*/ _jsx("div", { ref: messagesEndRef }) ] }), lightboxUrl && /*#__PURE__*/ _jsx("div", { className: "fixed inset-0 z-50 flex items-center justify-center bg-black/80 backdrop-blur-sm", onClick: ()=>setLightboxUrl(null), children: /*#__PURE__*/ _jsxs("div", { className: "relative max-w-[90vw] max-h-[90vh]", onClick: (e)=>e.stopPropagation(), children: [ /*#__PURE__*/ _jsx("img", { src: lightboxUrl, alt: "photo", className: "max-w-[90vw] max-h-[90vh] rounded-2xl object-contain shadow-2xl" }), /*#__PURE__*/ _jsx("button", { onClick: ()=>setLightboxUrl(null), className: "absolute -top-3 -right-3 w-8 h-8 bg-white rounded-full flex items-center justify-center shadow-lg hover:bg-gray-100 transition", "aria-label": "Close", children: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-gray-700", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" }) }) }), /*#__PURE__*/ _jsx("a", { href: lightboxUrl, download: true, target: "_blank", rel: "noreferrer", className: "absolute -bottom-3 -right-3 w-8 h-8 bg-white rounded-full flex items-center justify-center shadow-lg hover:bg-gray-100 transition", "aria-label": "Download", onClick: (e)=>e.stopPropagation(), children: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-gray-700", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4 16v2a2 2 0 002 2h12a2 2 0 002-2v-2M7 10l5 5 5-5M12 15V3" }) }) }) ] }) }), /*#__PURE__*/ _jsxs("div", { className: "px-4 py-3 border-t border-gray-100", children: [ " ", /*#__PURE__*/ _jsx("input", { ref: fileInputRef, type: "file", accept: "image/jpeg,image/png,image/gif,image/webp", className: "hidden", onChange: (e)=>{ var _e_target_files; const file = (_e_target_files = e.target.files) === null || _e_target_files === void 0 ? void 0 : _e_target_files[0]; if (file) uploadAndSendImage(file); } }), " ", msgLimit && msgLimit.left !== null && msgLimit.left <= 0 && /*#__PURE__*/ _jsxs("div", { className: "mb-2 flex items-center gap-2 bg-red-50 border border-red-200 rounded-xl px-3 py-2", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-red-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 9v2m0 4h.01M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z" }) }), /*#__PURE__*/ _jsx("span", { className: "text-xs text-red-700 flex-1", children: t('chat.limit_reached', 'Daily message limit reached') }), /*#__PURE__*/ _jsx(Link, { href: "/pricing", className: "text-xs font-medium text-red-700 underline", children: t('dashboard.plan.upgrade', 'Upgrade plan') }) ] }), msgLimit && msgLimit.left !== null && msgLimit.left > 0 && msgLimit.left <= Math.ceil((msgLimit.left + msgLimit.sent) * 0.2) && /*#__PURE__*/ _jsxs("div", { className: "mb-2 flex items-center gap-2 bg-amber-50 border border-amber-200 rounded-xl px-3 py-2", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-amber-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 9v2m0 4h.01M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z" }) }), /*#__PURE__*/ _jsx("span", { className: "text-xs text-amber-700 flex-1", children: t('chat.limit_warning', '{n} messages left today').replace('{n}', String(msgLimit.left)) }), /*#__PURE__*/ _jsx(Link, { href: "/pricing", className: "text-xs font-medium text-amber-700 underline", children: t('dashboard.plan.upgrade', 'Upgrade plan') }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-2 items-end", children: [ /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>{ var _fileInputRef_current; return (_fileInputRef_current = fileInputRef.current) === null || _fileInputRef_current === void 0 ? void 0 : _fileInputRef_current.click(); }, disabled: uploadingImage || !connected || !!(msgLimit && msgLimit.left !== null && msgLimit.left <= 0), className: "h-10 w-10 text-gray-400 hover:text-gray-500 disabled:opacity-40 disabled:cursor-not-allowed flex-shrink-0 flex items-center justify-center rounded-xl hover:bg-gray-50 transition", title: "Send photo", children: uploadingImage ? /*#__PURE__*/ _jsxs("svg", { className: "w-5 h-5 animate-spin", fill: "none", viewBox: "0 0 24 24", children: [ /*#__PURE__*/ _jsx("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }), /*#__PURE__*/ _jsx("path", { className: "opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8v8H4z" }) ] }) : /*#__PURE__*/ _jsxs("svg", { className: "w-5 h-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: [ /*#__PURE__*/ _jsx("rect", { x: "3", y: "3", width: "18", height: "18", rx: "3", ry: "3" }), /*#__PURE__*/ _jsx("circle", { cx: "8.5", cy: "8.5", r: "1.5" }), /*#__PURE__*/ _jsx("polyline", { points: "21 15 16 10 5 21" }) ] }) }), /*#__PURE__*/ _jsx("textarea", { ref: inputRef, value: input, onChange: (e)=>setInput(e.target.value), onKeyDown: handleKeyDown, rows: 1, placeholder: t('chat.placeholder'), disabled: !!(msgLimit && msgLimit.left !== null && msgLimit.left <= 0), className: "flex-1 border border-gray-300 rounded-xl px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 resize-none max-h-32 disabled:bg-gray-50 disabled:text-gray-400", style: { minHeight: '40px' } }), /*#__PURE__*/ _jsx("button", { onClick: sendMessage, disabled: !input.trim() || !connected || !!(msgLimit && msgLimit.left !== null && msgLimit.left <= 0), className: "h-10 w-10 bg-green-600 text-white rounded-xl hover:bg-green-700 disabled:opacity-40 disabled:cursor-not-allowed flex-shrink-0 flex items-center justify-center", children: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 12h14M12 5l7 7-7 7" }) }) }) ] }) ] }) ] }) }) ] }); } export default function ChatPage() { return /*#__PURE__*/ _jsx(Suspense, { fallback: /*#__PURE__*/ _jsx("div", { className: "text-center py-20 text-white", children: "..." }), children: /*#__PURE__*/ _jsx(ChatPageInner, {}) }); } ÷"61146undefined148222undefined224284undefined286314undefined316355undefined357401undefined403471undefined473523undefined525562undefined580610"https://api.canhelp.gr"undefined6156370undefined798806(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)undefined836850(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useSearchParams)undefined896905(0,_lib_auth__WEBPACK_IMPORTED_MODULE_4__/* .useSession */ .wV)undefined936944(0,_context_locale__WEBPACK_IMPORTED_MODULE_5__/* .useLocale */ .Y)undefined979986(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined10371044(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined10971104(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined11491156(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined12131220(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined12601267(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined13121319(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined13651372(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined14291436(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined14881495(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined15261531(0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)undefined15671572(0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)undefined16021607(0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)undefined16411646(0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)undefined16591667(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined18131821(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined18671878(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getChatRooms */ .Zp)undefined21552167(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getDailyUsage */ .z4)undefined24112419(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined24802481(0,socket_io_client__WEBPACK_IMPORTED_MODULE_7__.io)undefined62776285(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined64486458(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getMessages */ .VL)undefined69916999(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined74027410(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined77567764(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined80228032(0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)undefined86908700(0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)undefined1070110704(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1112811132(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1127111275(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1147011474(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1163011633(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1185111855(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1203712040(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1226812271(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1265412657(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1279812801(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1335113365(0,_lib_formatName__WEBPACK_IMPORTED_MODULE_8__/* .formatShortName */ .H)undefined1366313677(0,_lib_formatName__WEBPACK_IMPORTED_MODULE_8__/* .formatShortName */ .H)undefined1404414048(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1483514839(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1505315056(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1537015373(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1577415777(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1634116344(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1673816741(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1691816921(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1711017114(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1711617124react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragmentundefined1719917202(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1734217345(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1774517759(0,_lib_formatName__WEBPACK_IMPORTED_MODULE_8__/* .formatShortName */ .H)undefined1853618540(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1854218545(next_link__WEBPACK_IMPORTED_MODULE_3___default())undefined1887718880(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1908019084(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1964319646(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1988419887(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2045520459(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2063720640(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2091520918(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2129121294(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2179221795(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2204622050(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2225022253(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2249522498(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2312823132(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2336023363(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2370323706(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2445624460(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2474824751(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2492624940(0,_lib_formatName__WEBPACK_IMPORTED_MODULE_8__/* .formatShortName */ .H)undefined2527525278(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2566925672(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2616626169(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2684826851(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2762827631(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2784427847(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2809628100(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2835328356(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2868628689(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2908629089(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2950229505(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2991629919(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3054930552(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3096330966(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3149531499(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3172531728(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3257032574(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3281932822(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3324133244(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3369833701(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3400634009(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3401134014(next_link__WEBPACK_IMPORTED_MODULE_3___default())undefined3457134575(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3482434827(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3524835251(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3570535708(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3604936052(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3605436057(next_link__WEBPACK_IMPORTED_MODULE_3___default())undefined3648836492(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3667636679(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3765737661(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3801338016(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3858338586(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3900939013(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3949039493(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4002340026(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4036140364(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4071340716(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4174941752(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4226442267(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4269042693(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4328443298undefined4334643349(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4335143358react__WEBPACK_IMPORTED_MODULE_1__.Suspenseundefined4339543398(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4353643539(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined /***/ }) à÷Ã/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ ChatPage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7541); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(9664); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(next_link__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(1592); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(9906); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(2982); /* harmony import */ var _lib_formatName__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(1258); /* harmony import */ var socket_io_client__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(2838); /* __next_internal_client_entry_do_not_use__ default auto */ const API_URL = "https://api.canhelp.gr" || 0; function ChatPageInner() { var _session_user, _activeRoom_task, _activeRoom_otherUser, _activeRoom_otherUser1, _activeRoom_otherUser2; const router = (0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)(); const searchParams = (0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useSearchParams)(); const { data: session, isPending } = (0,_lib_auth__WEBPACK_IMPORTED_MODULE_4__/* .useSession */ .wV)(); const { t, locale } = (0,_context_locale__WEBPACK_IMPORTED_MODULE_5__/* .useLocale */ .Y)(); const [rooms, setRooms] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [loadingRooms, setLoadingRooms] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(true); const [activeRoomId, setActiveRoomId] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [messages, setMessages] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [loadingMessages, setLoadingMessages] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [input, setInput] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [connected, setConnected] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [msgLimit, setMsgLimit] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [uploadingImage, setUploadingImage] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [lightboxUrl, setLightboxUrl] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const socketRef = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null); const messagesEndRef = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null); const inputRef = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null); const fileInputRef = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!isPending && !session) router.push('/login'); }, [ session, isPending ]); // Load chat rooms (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!session) return; (0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getChatRooms */ .Zp)().then((data)=>{ setRooms(data); const roomParam = searchParams.get('room'); if (roomParam) setActiveRoomId(roomParam); }).catch((err)=>console.error('[chat] getChatRooms error:', err)).finally(()=>setLoadingRooms(false)); (0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getDailyUsage */ .z4)().then((u)=>setMsgLimit({ left: u.messagesLeft, sent: u.messagesSent })).catch((err)=>console.error('[chat] getDailyUsage error:', err)); }, [ session ]); // Setup Socket.IO (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!session) return; const socket = (0,socket_io_client__WEBPACK_IMPORTED_MODULE_7__.io)(API_URL, { withCredentials: true, transports: [ 'websocket', 'polling' ] }); socketRef.current = socket; socket.on('connect', ()=>setConnected(true)); socket.on('disconnect', ()=>setConnected(false)); socket.on('new_message', (msg)=>{ setMessages((prev)=>{ // avoid duplicate if we get it back from our own send if (prev.some((m)=>m.message.id === msg.id)) return prev; var _session_user_name, _session_user_image; // sender info: only known for current user; others show placeholder (? avatar) const sender = session.user && session.user.id === msg.senderId ? { id: session.user.id, name: (_session_user_name = session.user.name) !== null && _session_user_name !== void 0 ? _session_user_name : '', image: (_session_user_image = session.user.image) !== null && _session_user_image !== void 0 ? _session_user_image : undefined } : null; return [ ...prev, { message: msg, sender } ]; }); // Update lastMessage in rooms list and bubble room to top setRooms((prev)=>{ const updated = prev.map((r)=>{ var _msg_translations, _msg_imageUrl; return r.room.id === msg.roomId ? { ...r, lastMessage: { body: msg.body, createdAt: msg.createdAt, translations: (_msg_translations = msg.translations) !== null && _msg_translations !== void 0 ? _msg_translations : null, imageUrl: (_msg_imageUrl = msg.imageUrl) !== null && _msg_imageUrl !== void 0 ? _msg_imageUrl : null } } : r; }); return updated.sort((a, b)=>{ var _a_lastMessage, _b_lastMessage; const aTime = ((_a_lastMessage = a.lastMessage) === null || _a_lastMessage === void 0 ? void 0 : _a_lastMessage.createdAt) ? new Date(a.lastMessage.createdAt).getTime() : new Date(a.room.createdAt).getTime(); const bTime = ((_b_lastMessage = b.lastMessage) === null || _b_lastMessage === void 0 ? void 0 : _b_lastMessage.createdAt) ? new Date(b.lastMessage.createdAt).getTime() : new Date(b.room.createdAt).getTime(); return bTime - aTime; }); }); }); socket.on('message_translated', (param)=>{ let { id, roomId, translations } = param; setMessages((prev)=>prev.map((m)=>m.message.id === id ? { ...m, message: { ...m.message, translations } } : m)); // Also update lastMessage in sidebar if this is the last message of that room if (roomId) { setRooms((prev)=>prev.map((r)=>r.room.id === roomId && r.lastMessage ? { ...r, lastMessage: { ...r.lastMessage, translations } } : r)); } }); return ()=>{ socket.disconnect(); socketRef.current = null; }; }, [ session ]); // Join room and load messages when activeRoomId changes (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ var _socketRef_current, _socketRef_current1; if (!activeRoomId) return; setLoadingMessages(true); setMessages([]); (0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getMessages */ .VL)(activeRoomId).then(setMessages).catch((err)=>console.error('[chat] getMessages error:', err)).finally(()=>setLoadingMessages(false)); (_socketRef_current = socketRef.current) === null || _socketRef_current === void 0 ? void 0 : _socketRef_current.emit('join_room', activeRoomId); (_socketRef_current1 = socketRef.current) === null || _socketRef_current1 === void 0 ? void 0 : _socketRef_current1.emit('mark_read', activeRoomId); }, [ activeRoomId ]); // Focus input when active room changes (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!activeRoomId) return; const t = setTimeout(()=>{ var _inputRef_current; return (_inputRef_current = inputRef.current) === null || _inputRef_current === void 0 ? void 0 : _inputRef_current.focus(); }, 50); return ()=>clearTimeout(t); }, [ activeRoomId ]); // Auto-scroll on new messages (within container only) (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ var _messagesEndRef_current; (_messagesEndRef_current = messagesEndRef.current) === null || _messagesEndRef_current === void 0 ? void 0 : _messagesEndRef_current.scrollIntoView({ behavior: 'smooth', block: 'nearest' }); }, [ messages ]); // Close lightbox on Escape (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ const onKey = (e)=>{ if (e.key === 'Escape') setLightboxUrl(null); }; window.addEventListener('keydown', onKey); return ()=>window.removeEventListener('keydown', onKey); }, []); const sendMessage = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)(()=>{ const body = input.trim(); if (!body || !activeRoomId || !socketRef.current) return; if (msgLimit && msgLimit.left !== null && msgLimit.left <= 0) return; socketRef.current.emit('send_message', { roomId: activeRoomId, body, locale }); setInput(''); // decrement local counter setMsgLimit((prev)=>prev && prev.left !== null ? { ...prev, left: prev.left - 1, sent: prev.sent + 1 } : prev); }, [ input, activeRoomId, msgLimit ]); const uploadAndSendImage = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)(async (file)=>{ if (!activeRoomId || !socketRef.current) return; setUploadingImage(true); try { const formData = new FormData(); formData.append('file', file); const res = await fetch("".concat(API_URL, "/api/uploads"), { method: 'POST', credentials: 'include', body: formData }); if (!res.ok) throw new Error('Upload failed'); const { url } = await res.json(); socketRef.current.emit('send_message', { roomId: activeRoomId, body: '', imageUrl: url, locale }); } catch (_) { // silent } finally{ setUploadingImage(false); if (fileInputRef.current) fileInputRef.current.value = ''; } }, [ activeRoomId, locale ]); const handleKeyDown = (e)=>{ if (e.key === 'Enter' && !e.shiftKey) { e.preventDefault(); sendMessage(); } }; const LOCALE_TAG = { ru: 'ru-RU', en: 'en-US', el: 'el-GR' }; var _LOCALE_TAG_locale; const localeTag = (_LOCALE_TAG_locale = LOCALE_TAG[locale]) !== null && _LOCALE_TAG_locale !== void 0 ? _LOCALE_TAG_locale : 'el-GR'; function fmtMsgTime(iso) { const d = new Date(iso); const now = new Date(); const diffMin = Math.floor((now.getTime() - d.getTime()) / 60000); if (diffMin < 1) return t('chat.just_now'); if (diffMin < 60) return "".concat(diffMin).concat(t('chat.min_ago')); if (d.toDateString() === now.toDateString()) return d.toLocaleTimeString(localeTag, { hour: '2-digit', minute: '2-digit' }); return d.toLocaleDateString(localeTag, { day: '2-digit', month: '2-digit' }); } if (isPending || loadingRooms) { return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-center py-20 text-white", children: t('common.loading') }); } const activeRoom = rooms.find((r)=>r.room.id === activeRoomId); const currentUserId = session === null || session === void 0 ? void 0 : (_session_user = session.user) === null || _session_user === void 0 ? void 0 : _session_user.id; var _activeRoom_task_title; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "max-w-5xl mx-auto px-4 py-6 h-[calc(100vh-80px)] flex gap-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "w-72 flex-shrink-0 bg-white rounded-xl border border-gray-200 overflow-hidden flex flex-col", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "p-4 border-b border-gray-100", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h1", { className: "font-bold text-gray-900 text-lg", children: t('nav.chat') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-1.5 mt-1", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "w-2 h-2 rounded-full ".concat(connected ? 'bg-green-400' : 'bg-gray-300') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-xs text-gray-400", children: connected ? t('chat.connected') : t('chat.disconnected') }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex-1 overflow-y-auto", children: rooms.length === 0 ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "p-6 text-center text-gray-400 text-sm", children: t('chat.no_rooms') }) : rooms.map((param)=>{ let { room, task, otherUser, lastMessage } = param; var _lastMessage_translations; var _task_title; const roomLabel = (_task_title = task === null || task === void 0 ? void 0 : task.title) !== null && _task_title !== void 0 ? _task_title : (0,_lib_formatName__WEBPACK_IMPORTED_MODULE_8__/* .formatShortName */ .H)(otherUser === null || otherUser === void 0 ? void 0 : otherUser.firstName, otherUser === null || otherUser === void 0 ? void 0 : otherUser.lastName, otherUser === null || otherUser === void 0 ? void 0 : otherUser.name) || t('chat.direct_chat'); const roomSub = task ? (0,_lib_formatName__WEBPACK_IMPORTED_MODULE_8__/* .formatShortName */ .H)(otherUser === null || otherUser === void 0 ? void 0 : otherUser.firstName, otherUser === null || otherUser === void 0 ? void 0 : otherUser.lastName, otherUser === null || otherUser === void 0 ? void 0 : otherUser.name) || '' : t('chat.direct_chat'); var _lastMessage_translations_locale; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { onClick: ()=>{ setActiveRoomId(room.id); setTimeout(()=>{ var _inputRef_current; return (_inputRef_current = inputRef.current) === null || _inputRef_current === void 0 ? void 0 : _inputRef_current.focus(); }, 50); }, className: "w-full text-left px-4 py-3 border-b border-gray-50 hover:bg-gray-50 transition ".concat(activeRoomId === room.id ? 'bg-green-50 border-l-2 border-l-green-500' : ''), children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-start justify-between gap-1", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm font-medium text-gray-800 line-clamp-1 flex-1", children: roomLabel }), lastMessage && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-[10px] text-gray-400 shrink-0 mt-0.5", children: fmtMsgTime(lastMessage.createdAt) }) ] }), lastMessage ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400 mt-0.5 line-clamp-1", children: lastMessage.imageUrl && !lastMessage.body ? '📷' : (_lastMessage_translations_locale = (_lastMessage_translations = lastMessage.translations) === null || _lastMessage_translations === void 0 ? void 0 : _lastMessage_translations[locale]) !== null && _lastMessage_translations_locale !== void 0 ? _lastMessage_translations_locale : lastMessage.body }) : task ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400 mt-0.5 line-clamp-1", children: roomSub }) : null ] }, room.id); }) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex-1 bg-white rounded-xl border border-gray-200 flex flex-col overflow-hidden", children: !activeRoomId ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex-1 flex items-center justify-center text-gray-400 text-sm", children: t('chat.select') }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "px-5 py-4 border-b border-gray-100", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "font-semibold text-gray-800 text-sm", children: (_activeRoom_task_title = activeRoom === null || activeRoom === void 0 ? void 0 : (_activeRoom_task = activeRoom.task) === null || _activeRoom_task === void 0 ? void 0 : _activeRoom_task.title) !== null && _activeRoom_task_title !== void 0 ? _activeRoom_task_title : (0,_lib_formatName__WEBPACK_IMPORTED_MODULE_8__/* .formatShortName */ .H)(activeRoom === null || activeRoom === void 0 ? void 0 : (_activeRoom_otherUser = activeRoom.otherUser) === null || _activeRoom_otherUser === void 0 ? void 0 : _activeRoom_otherUser.firstName, activeRoom === null || activeRoom === void 0 ? void 0 : (_activeRoom_otherUser1 = activeRoom.otherUser) === null || _activeRoom_otherUser1 === void 0 ? void 0 : _activeRoom_otherUser1.lastName, activeRoom === null || activeRoom === void 0 ? void 0 : (_activeRoom_otherUser2 = activeRoom.otherUser) === null || _activeRoom_otherUser2 === void 0 ? void 0 : _activeRoom_otherUser2.name) || t('chat.direct_chat') }) }), (activeRoom === null || activeRoom === void 0 ? void 0 : activeRoom.task) && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)((next_link__WEBPACK_IMPORTED_MODULE_3___default()), { href: "/tasks/".concat(activeRoom.task.id), className: "flex items-center gap-3 mx-5 mt-4 px-4 py-3 bg-green-50 border border-green-200 rounded-xl hover:bg-green-100 transition group", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "w-8 h-8 rounded-lg bg-green-600 flex items-center justify-center flex-shrink-0", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-4 h-4 text-white", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M16 4h2a2 2 0 012 2v14a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2h2" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("rect", { x: "8", y: "2", width: "8", height: "4", rx: "1", ry: "1" }) ] }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-500 font-medium", children: t('chat.linked_task') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm font-semibold text-gray-800 truncate group-hover:underline", children: activeRoom.task.title }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 text-gray-400 flex-shrink-0", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("polyline", { points: "9 18 15 12 9 6" }) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex-1 overflow-y-auto px-5 py-4 space-y-3", children: [ loadingMessages ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-center text-gray-400 text-sm py-10", children: t('common.loading') }) : messages.length === 0 ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-center text-gray-400 text-sm py-10", children: t('chat.no_messages') }) : messages.map((param)=>{ let { message, sender } = param; var _sender_name_, _sender_name, _message_translations; const isMe = message.senderId === currentUserId; var _sender_name__toUpperCase, _message_translations_locale; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-2.5 ".concat(isMe ? 'flex-row-reverse' : ''), children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "w-8 h-8 rounded-full bg-green-100 flex-shrink-0 flex items-center justify-center text-green-700 text-xs font-bold overflow-hidden", children: (sender === null || sender === void 0 ? void 0 : sender.image) ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: sender.image, alt: sender.name, className: "w-full h-full object-cover" }) : (_sender_name__toUpperCase = sender === null || sender === void 0 ? void 0 : (_sender_name = sender.name) === null || _sender_name === void 0 ? void 0 : (_sender_name_ = _sender_name[0]) === null || _sender_name_ === void 0 ? void 0 : _sender_name_.toUpperCase()) !== null && _sender_name__toUpperCase !== void 0 ? _sender_name__toUpperCase : '?' }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "max-w-[70%] ".concat(isMe ? 'items-end' : 'items-start', " flex flex-col gap-1"), children: [ !isMe && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-xs text-gray-400 px-1", children: (0,_lib_formatName__WEBPACK_IMPORTED_MODULE_8__/* .formatShortName */ .H)(sender === null || sender === void 0 ? void 0 : sender.firstName, sender === null || sender === void 0 ? void 0 : sender.lastName, sender === null || sender === void 0 ? void 0 : sender.name) }), message.imageUrl ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>setLightboxUrl("".concat(API_URL).concat(message.imageUrl)), className: "block focus:outline-none", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: "".concat(API_URL).concat(message.imageUrl), alt: "photo", className: "rounded-2xl max-w-[240px] max-h-[320px] object-cover cursor-pointer hover:opacity-90 transition" }) }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "px-4 py-2 rounded-2xl text-sm leading-relaxed ".concat(isMe ? 'bg-green-600 text-white rounded-tr-sm' : 'bg-gray-100 text-gray-800 rounded-tl-sm'), children: (_message_translations_locale = (_message_translations = message.translations) === null || _message_translations === void 0 ? void 0 : _message_translations[locale]) !== null && _message_translations_locale !== void 0 ? _message_translations_locale : message.body }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-xs text-gray-300 px-1", children: new Date(message.createdAt).toLocaleTimeString(localeTag, { hour: '2-digit', minute: '2-digit' }) }) ] }) ] }, message.id); }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { ref: messagesEndRef }) ] }), lightboxUrl && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "fixed inset-0 z-50 flex items-center justify-center bg-black/80 backdrop-blur-sm", onClick: ()=>setLightboxUrl(null), children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "relative max-w-[90vw] max-h-[90vh]", onClick: (e)=>e.stopPropagation(), children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: lightboxUrl, alt: "photo", className: "max-w-[90vw] max-h-[90vh] rounded-2xl object-contain shadow-2xl" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>setLightboxUrl(null), className: "absolute -top-3 -right-3 w-8 h-8 bg-white rounded-full flex items-center justify-center shadow-lg hover:bg-gray-100 transition", "aria-label": "Close", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 text-gray-700", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" }) }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("a", { href: lightboxUrl, download: true, target: "_blank", rel: "noreferrer", className: "absolute -bottom-3 -right-3 w-8 h-8 bg-white rounded-full flex items-center justify-center shadow-lg hover:bg-gray-100 transition", "aria-label": "Download", onClick: (e)=>e.stopPropagation(), children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 text-gray-700", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4 16v2a2 2 0 002 2h12a2 2 0 002-2v-2M7 10l5 5 5-5M12 15V3" }) }) }) ] }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "px-4 py-3 border-t border-gray-100", children: [ " ", /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { ref: fileInputRef, type: "file", accept: "image/jpeg,image/png,image/gif,image/webp", className: "hidden", onChange: (e)=>{ var _e_target_files; const file = (_e_target_files = e.target.files) === null || _e_target_files === void 0 ? void 0 : _e_target_files[0]; if (file) uploadAndSendImage(file); } }), " ", msgLimit && msgLimit.left !== null && msgLimit.left <= 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "mb-2 flex items-center gap-2 bg-red-50 border border-red-200 rounded-xl px-3 py-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 text-red-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 9v2m0 4h.01M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z" }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-xs text-red-700 flex-1", children: t('chat.limit_reached', 'Daily message limit reached') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)((next_link__WEBPACK_IMPORTED_MODULE_3___default()), { href: "/pricing", className: "text-xs font-medium text-red-700 underline", children: t('dashboard.plan.upgrade', 'Upgrade plan') }) ] }), msgLimit && msgLimit.left !== null && msgLimit.left > 0 && msgLimit.left <= Math.ceil((msgLimit.left + msgLimit.sent) * 0.2) && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "mb-2 flex items-center gap-2 bg-amber-50 border border-amber-200 rounded-xl px-3 py-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 text-amber-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 9v2m0 4h.01M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z" }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-xs text-amber-700 flex-1", children: t('chat.limit_warning', '{n} messages left today').replace('{n}', String(msgLimit.left)) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)((next_link__WEBPACK_IMPORTED_MODULE_3___default()), { href: "/pricing", className: "text-xs font-medium text-amber-700 underline", children: t('dashboard.plan.upgrade', 'Upgrade plan') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-2 items-end", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>{ var _fileInputRef_current; return (_fileInputRef_current = fileInputRef.current) === null || _fileInputRef_current === void 0 ? void 0 : _fileInputRef_current.click(); }, disabled: uploadingImage || !connected || !!(msgLimit && msgLimit.left !== null && msgLimit.left <= 0), className: "h-10 w-10 text-gray-400 hover:text-gray-500 disabled:opacity-40 disabled:cursor-not-allowed flex-shrink-0 flex items-center justify-center rounded-xl hover:bg-gray-50 transition", title: "Send photo", children: uploadingImage ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-5 h-5 animate-spin", fill: "none", viewBox: "0 0 24 24", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { className: "opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8v8H4z" }) ] }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-5 h-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("rect", { x: "3", y: "3", width: "18", height: "18", rx: "3", ry: "3" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("circle", { cx: "8.5", cy: "8.5", r: "1.5" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("polyline", { points: "21 15 16 10 5 21" }) ] }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("textarea", { ref: inputRef, value: input, onChange: (e)=>setInput(e.target.value), onKeyDown: handleKeyDown, rows: 1, placeholder: t('chat.placeholder'), disabled: !!(msgLimit && msgLimit.left !== null && msgLimit.left <= 0), className: "flex-1 border border-gray-300 rounded-xl px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 resize-none max-h-32 disabled:bg-gray-50 disabled:text-gray-400", style: { minHeight: '40px' } }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: sendMessage, disabled: !input.trim() || !connected || !!(msgLimit && msgLimit.left !== null && msgLimit.left <= 0), className: "h-10 w-10 bg-green-600 text-white rounded-xl hover:bg-green-700 disabled:opacity-40 disabled:cursor-not-allowed flex-shrink-0 flex items-center justify-center", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 12h14M12 5l7 7-7 7" }) }) }) ] }) ] }) ] }) }) ] }); } function ChatPage() { return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(react__WEBPACK_IMPORTED_MODULE_1__.Suspense, { fallback: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-center py-20 text-white", children: "..." }), children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(ChatPageInner, {}) }); } /***/ }) áä  åæå¿__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ ChatPage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7541); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(9664); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(next_link__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(1592); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(9906); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(2982); /* harmony import */ var _lib_formatName__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(1258); /* harmony import */ var socket_io_client__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(2838); ç4ª/* __next_internal_client_entry_do_not_use__ default auto */ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime"; import { useState, useEffect, useRef, useCallback, Suspense } from 'react'; import { useRouter, useSearchParams } from 'next/navigation'; import Link from 'next/link'; import { useSession } from '@/lib/auth'; import { useLocale } from '@/context/locale'; import { getChatRooms, getMessages, getDailyUsage } from '@/lib/api'; import { formatShortName } from '@/lib/formatName'; import { io } from 'socket.io-client'; const API_URL = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; function ChatPageInner() { var _session_user, _activeRoom_task, _activeRoom_otherUser, _activeRoom_otherUser1, _activeRoom_otherUser2; const router = useRouter(); const searchParams = useSearchParams(); const { data: session, isPending } = useSession(); const { t, locale } = useLocale(); const [rooms, setRooms] = useState([]); const [loadingRooms, setLoadingRooms] = useState(true); const [activeRoomId, setActiveRoomId] = useState(null); const [messages, setMessages] = useState([]); const [loadingMessages, setLoadingMessages] = useState(false); const [input, setInput] = useState(''); const [connected, setConnected] = useState(false); const [msgLimit, setMsgLimit] = useState(null); const [uploadingImage, setUploadingImage] = useState(false); const [lightboxUrl, setLightboxUrl] = useState(null); const socketRef = useRef(null); const messagesEndRef = useRef(null); const inputRef = useRef(null); const fileInputRef = useRef(null); useEffect(()=>{ if (!isPending && !session) router.push('/login'); }, [ session, isPending ]); // Load chat rooms useEffect(()=>{ if (!session) return; getChatRooms().then((data)=>{ setRooms(data); const roomParam = searchParams.get('room'); if (roomParam) setActiveRoomId(roomParam); }).catch((err)=>console.error('[chat] getChatRooms error:', err)).finally(()=>setLoadingRooms(false)); getDailyUsage().then((u)=>setMsgLimit({ left: u.messagesLeft, sent: u.messagesSent })).catch((err)=>console.error('[chat] getDailyUsage error:', err)); }, [ session ]); // Setup Socket.IO useEffect(()=>{ if (!session) return; const socket = io(API_URL, { withCredentials: true, transports: [ 'websocket', 'polling' ] }); socketRef.current = socket; socket.on('connect', ()=>setConnected(true)); socket.on('disconnect', ()=>setConnected(false)); socket.on('new_message', (msg)=>{ setMessages((prev)=>{ // avoid duplicate if we get it back from our own send if (prev.some((m)=>m.message.id === msg.id)) return prev; var _session_user_name, _session_user_image; // sender info: only known for current user; others show placeholder (? avatar) const sender = session.user && session.user.id === msg.senderId ? { id: session.user.id, name: (_session_user_name = session.user.name) !== null && _session_user_name !== void 0 ? _session_user_name : '', image: (_session_user_image = session.user.image) !== null && _session_user_image !== void 0 ? _session_user_image : undefined } : null; return [ ...prev, { message: msg, sender } ]; }); // Update lastMessage in rooms list and bubble room to top setRooms((prev)=>{ const updated = prev.map((r)=>{ var _msg_translations, _msg_imageUrl; return r.room.id === msg.roomId ? { ...r, lastMessage: { body: msg.body, createdAt: msg.createdAt, translations: (_msg_translations = msg.translations) !== null && _msg_translations !== void 0 ? _msg_translations : null, imageUrl: (_msg_imageUrl = msg.imageUrl) !== null && _msg_imageUrl !== void 0 ? _msg_imageUrl : null } } : r; }); return updated.sort((a, b)=>{ var _a_lastMessage, _b_lastMessage; const aTime = ((_a_lastMessage = a.lastMessage) === null || _a_lastMessage === void 0 ? void 0 : _a_lastMessage.createdAt) ? new Date(a.lastMessage.createdAt).getTime() : new Date(a.room.createdAt).getTime(); const bTime = ((_b_lastMessage = b.lastMessage) === null || _b_lastMessage === void 0 ? void 0 : _b_lastMessage.createdAt) ? new Date(b.lastMessage.createdAt).getTime() : new Date(b.room.createdAt).getTime(); return bTime - aTime; }); }); }); socket.on('message_translated', (param)=>{ let { id, roomId, translations } = param; setMessages((prev)=>prev.map((m)=>m.message.id === id ? { ...m, message: { ...m.message, translations } } : m)); // Also update lastMessage in sidebar if this is the last message of that room if (roomId) { setRooms((prev)=>prev.map((r)=>r.room.id === roomId && r.lastMessage ? { ...r, lastMessage: { ...r.lastMessage, translations } } : r)); } }); return ()=>{ socket.disconnect(); socketRef.current = null; }; }, [ session ]); // Join room and load messages when activeRoomId changes useEffect(()=>{ var _socketRef_current, _socketRef_current1; if (!activeRoomId) return; setLoadingMessages(true); setMessages([]); getMessages(activeRoomId).then(setMessages).catch((err)=>console.error('[chat] getMessages error:', err)).finally(()=>setLoadingMessages(false)); (_socketRef_current = socketRef.current) === null || _socketRef_current === void 0 ? void 0 : _socketRef_current.emit('join_room', activeRoomId); (_socketRef_current1 = socketRef.current) === null || _socketRef_current1 === void 0 ? void 0 : _socketRef_current1.emit('mark_read', activeRoomId); }, [ activeRoomId ]); // Focus input when active room changes useEffect(()=>{ if (!activeRoomId) return; const t = setTimeout(()=>{ var _inputRef_current; return (_inputRef_current = inputRef.current) === null || _inputRef_current === void 0 ? void 0 : _inputRef_current.focus(); }, 50); return ()=>clearTimeout(t); }, [ activeRoomId ]); // Auto-scroll on new messages (within container only) useEffect(()=>{ var _messagesEndRef_current; (_messagesEndRef_current = messagesEndRef.current) === null || _messagesEndRef_current === void 0 ? void 0 : _messagesEndRef_current.scrollIntoView({ behavior: 'smooth', block: 'nearest' }); }, [ messages ]); // Close lightbox on Escape useEffect(()=>{ const onKey = (e)=>{ if (e.key === 'Escape') setLightboxUrl(null); }; window.addEventListener('keydown', onKey); return ()=>window.removeEventListener('keydown', onKey); }, []); const sendMessage = useCallback(()=>{ const body = input.trim(); if (!body || !activeRoomId || !socketRef.current) return; if (msgLimit && msgLimit.left !== null && msgLimit.left <= 0) return; socketRef.current.emit('send_message', { roomId: activeRoomId, body, locale }); setInput(''); // decrement local counter setMsgLimit((prev)=>prev && prev.left !== null ? { ...prev, left: prev.left - 1, sent: prev.sent + 1 } : prev); }, [ input, activeRoomId, msgLimit ]); const uploadAndSendImage = useCallback(async (file)=>{ if (!activeRoomId || !socketRef.current) return; setUploadingImage(true); try { const formData = new FormData(); formData.append('file', file); const res = await fetch("".concat(API_URL, "/api/uploads"), { method: 'POST', credentials: 'include', body: formData }); if (!res.ok) throw new Error('Upload failed'); const { url } = await res.json(); socketRef.current.emit('send_message', { roomId: activeRoomId, body: '', imageUrl: url, locale }); } catch (_) { // silent } finally{ setUploadingImage(false); if (fileInputRef.current) fileInputRef.current.value = ''; } }, [ activeRoomId, locale ]); const handleKeyDown = (e)=>{ if (e.key === 'Enter' && !e.shiftKey) { e.preventDefault(); sendMessage(); } }; const LOCALE_TAG = { ru: 'ru-RU', en: 'en-US', el: 'el-GR' }; var _LOCALE_TAG_locale; const localeTag = (_LOCALE_TAG_locale = LOCALE_TAG[locale]) !== null && _LOCALE_TAG_locale !== void 0 ? _LOCALE_TAG_locale : 'el-GR'; function fmtMsgTime(iso) { const d = new Date(iso); const now = new Date(); const diffMin = Math.floor((now.getTime() - d.getTime()) / 60000); if (diffMin < 1) return t('chat.just_now'); if (diffMin < 60) return "".concat(diffMin).concat(t('chat.min_ago')); if (d.toDateString() === now.toDateString()) return d.toLocaleTimeString(localeTag, { hour: '2-digit', minute: '2-digit' }); return d.toLocaleDateString(localeTag, { day: '2-digit', month: '2-digit' }); } if (isPending || loadingRooms) { return /*#__PURE__*/ _jsx("div", { className: "text-center py-20 text-white", children: t('common.loading') }); } const activeRoom = rooms.find((r)=>r.room.id === activeRoomId); const currentUserId = session === null || session === void 0 ? void 0 : (_session_user = session.user) === null || _session_user === void 0 ? void 0 : _session_user.id; var _activeRoom_task_title; return /*#__PURE__*/ _jsxs("div", { className: "max-w-5xl mx-auto px-4 py-6 h-[calc(100vh-80px)] flex gap-4", children: [ /*#__PURE__*/ _jsxs("div", { className: "w-72 flex-shrink-0 bg-white rounded-xl border border-gray-200 overflow-hidden flex flex-col", children: [ /*#__PURE__*/ _jsxs("div", { className: "p-4 border-b border-gray-100", children: [ /*#__PURE__*/ _jsx("h1", { className: "font-bold text-gray-900 text-lg", children: t('nav.chat') }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-1.5 mt-1", children: [ /*#__PURE__*/ _jsx("span", { className: "w-2 h-2 rounded-full ".concat(connected ? 'bg-green-400' : 'bg-gray-300') }), /*#__PURE__*/ _jsx("span", { className: "text-xs text-gray-400", children: connected ? t('chat.connected') : t('chat.disconnected') }) ] }) ] }), /*#__PURE__*/ _jsx("div", { className: "flex-1 overflow-y-auto", children: rooms.length === 0 ? /*#__PURE__*/ _jsx("div", { className: "p-6 text-center text-gray-400 text-sm", children: t('chat.no_rooms') }) : rooms.map((param)=>{ let { room, task, otherUser, lastMessage } = param; var _lastMessage_translations; var _task_title; const roomLabel = (_task_title = task === null || task === void 0 ? void 0 : task.title) !== null && _task_title !== void 0 ? _task_title : formatShortName(otherUser === null || otherUser === void 0 ? void 0 : otherUser.firstName, otherUser === null || otherUser === void 0 ? void 0 : otherUser.lastName, otherUser === null || otherUser === void 0 ? void 0 : otherUser.name) || t('chat.direct_chat'); const roomSub = task ? formatShortName(otherUser === null || otherUser === void 0 ? void 0 : otherUser.firstName, otherUser === null || otherUser === void 0 ? void 0 : otherUser.lastName, otherUser === null || otherUser === void 0 ? void 0 : otherUser.name) || '' : t('chat.direct_chat'); var _lastMessage_translations_locale; return /*#__PURE__*/ _jsxs("button", { onClick: ()=>{ setActiveRoomId(room.id); setTimeout(()=>{ var _inputRef_current; return (_inputRef_current = inputRef.current) === null || _inputRef_current === void 0 ? void 0 : _inputRef_current.focus(); }, 50); }, className: "w-full text-left px-4 py-3 border-b border-gray-50 hover:bg-gray-50 transition ".concat(activeRoomId === room.id ? 'bg-green-50 border-l-2 border-l-green-500' : ''), children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-start justify-between gap-1", children: [ /*#__PURE__*/ _jsx("p", { className: "text-sm font-medium text-gray-800 line-clamp-1 flex-1", children: roomLabel }), lastMessage && /*#__PURE__*/ _jsx("span", { className: "text-[10px] text-gray-400 shrink-0 mt-0.5", children: fmtMsgTime(lastMessage.createdAt) }) ] }), lastMessage ? /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-0.5 line-clamp-1", children: lastMessage.imageUrl && !lastMessage.body ? '📷' : (_lastMessage_translations_locale = (_lastMessage_translations = lastMessage.translations) === null || _lastMessage_translations === void 0 ? void 0 : _lastMessage_translations[locale]) !== null && _lastMessage_translations_locale !== void 0 ? _lastMessage_translations_locale : lastMessage.body }) : task ? /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-0.5 line-clamp-1", children: roomSub }) : null ] }, room.id); }) }) ] }), /*#__PURE__*/ _jsx("div", { className: "flex-1 bg-white rounded-xl border border-gray-200 flex flex-col overflow-hidden", children: !activeRoomId ? /*#__PURE__*/ _jsx("div", { className: "flex-1 flex items-center justify-center text-gray-400 text-sm", children: t('chat.select') }) : /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx("div", { className: "px-5 py-4 border-b border-gray-100", children: /*#__PURE__*/ _jsx("p", { className: "font-semibold text-gray-800 text-sm", children: (_activeRoom_task_title = activeRoom === null || activeRoom === void 0 ? void 0 : (_activeRoom_task = activeRoom.task) === null || _activeRoom_task === void 0 ? void 0 : _activeRoom_task.title) !== null && _activeRoom_task_title !== void 0 ? _activeRoom_task_title : formatShortName(activeRoom === null || activeRoom === void 0 ? void 0 : (_activeRoom_otherUser = activeRoom.otherUser) === null || _activeRoom_otherUser === void 0 ? void 0 : _activeRoom_otherUser.firstName, activeRoom === null || activeRoom === void 0 ? void 0 : (_activeRoom_otherUser1 = activeRoom.otherUser) === null || _activeRoom_otherUser1 === void 0 ? void 0 : _activeRoom_otherUser1.lastName, activeRoom === null || activeRoom === void 0 ? void 0 : (_activeRoom_otherUser2 = activeRoom.otherUser) === null || _activeRoom_otherUser2 === void 0 ? void 0 : _activeRoom_otherUser2.name) || t('chat.direct_chat') }) }), (activeRoom === null || activeRoom === void 0 ? void 0 : activeRoom.task) && /*#__PURE__*/ _jsxs(Link, { href: "/tasks/".concat(activeRoom.task.id), className: "flex items-center gap-3 mx-5 mt-4 px-4 py-3 bg-green-50 border border-green-200 rounded-xl hover:bg-green-100 transition group", children: [ /*#__PURE__*/ _jsx("div", { className: "w-8 h-8 rounded-lg bg-green-600 flex items-center justify-center flex-shrink-0", children: /*#__PURE__*/ _jsxs("svg", { className: "w-4 h-4 text-white", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", children: [ /*#__PURE__*/ _jsx("path", { d: "M16 4h2a2 2 0 012 2v14a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2h2" }), /*#__PURE__*/ _jsx("rect", { x: "8", y: "2", width: "8", height: "4", rx: "1", ry: "1" }) ] }) }), /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-500 font-medium", children: t('chat.linked_task') }), /*#__PURE__*/ _jsx("p", { className: "text-sm font-semibold text-gray-800 truncate group-hover:underline", children: activeRoom.task.title }) ] }), /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-gray-400 flex-shrink-0", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", children: /*#__PURE__*/ _jsx("polyline", { points: "9 18 15 12 9 6" }) }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex-1 overflow-y-auto px-5 py-4 space-y-3", children: [ loadingMessages ? /*#__PURE__*/ _jsx("div", { className: "text-center text-gray-400 text-sm py-10", children: t('common.loading') }) : messages.length === 0 ? /*#__PURE__*/ _jsx("div", { className: "text-center text-gray-400 text-sm py-10", children: t('chat.no_messages') }) : messages.map((param)=>{ let { message, sender } = param; var _sender_name_, _sender_name, _message_translations; const isMe = message.senderId === currentUserId; var _sender_name__toUpperCase, _message_translations_locale; return /*#__PURE__*/ _jsxs("div", { className: "flex gap-2.5 ".concat(isMe ? 'flex-row-reverse' : ''), children: [ /*#__PURE__*/ _jsx("div", { className: "w-8 h-8 rounded-full bg-green-100 flex-shrink-0 flex items-center justify-center text-green-700 text-xs font-bold overflow-hidden", children: (sender === null || sender === void 0 ? void 0 : sender.image) ? /*#__PURE__*/ _jsx("img", { src: sender.image, alt: sender.name, className: "w-full h-full object-cover" }) : (_sender_name__toUpperCase = sender === null || sender === void 0 ? void 0 : (_sender_name = sender.name) === null || _sender_name === void 0 ? void 0 : (_sender_name_ = _sender_name[0]) === null || _sender_name_ === void 0 ? void 0 : _sender_name_.toUpperCase()) !== null && _sender_name__toUpperCase !== void 0 ? _sender_name__toUpperCase : '?' }), /*#__PURE__*/ _jsxs("div", { className: "max-w-[70%] ".concat(isMe ? 'items-end' : 'items-start', " flex flex-col gap-1"), children: [ !isMe && /*#__PURE__*/ _jsx("span", { className: "text-xs text-gray-400 px-1", children: formatShortName(sender === null || sender === void 0 ? void 0 : sender.firstName, sender === null || sender === void 0 ? void 0 : sender.lastName, sender === null || sender === void 0 ? void 0 : sender.name) }), message.imageUrl ? /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setLightboxUrl("".concat(API_URL).concat(message.imageUrl)), className: "block focus:outline-none", children: /*#__PURE__*/ _jsx("img", { src: "".concat(API_URL).concat(message.imageUrl), alt: "photo", className: "rounded-2xl max-w-[240px] max-h-[320px] object-cover cursor-pointer hover:opacity-90 transition" }) }) : /*#__PURE__*/ _jsx("div", { className: "px-4 py-2 rounded-2xl text-sm leading-relaxed ".concat(isMe ? 'bg-green-600 text-white rounded-tr-sm' : 'bg-gray-100 text-gray-800 rounded-tl-sm'), children: (_message_translations_locale = (_message_translations = message.translations) === null || _message_translations === void 0 ? void 0 : _message_translations[locale]) !== null && _message_translations_locale !== void 0 ? _message_translations_locale : message.body }), /*#__PURE__*/ _jsx("span", { className: "text-xs text-gray-300 px-1", children: new Date(message.createdAt).toLocaleTimeString(localeTag, { hour: '2-digit', minute: '2-digit' }) }) ] }) ] }, message.id); }), /*#__PURE__*/ _jsx("div", { ref: messagesEndRef }) ] }), lightboxUrl && /*#__PURE__*/ _jsx("div", { className: "fixed inset-0 z-50 flex items-center justify-center bg-black/80 backdrop-blur-sm", onClick: ()=>setLightboxUrl(null), children: /*#__PURE__*/ _jsxs("div", { className: "relative max-w-[90vw] max-h-[90vh]", onClick: (e)=>e.stopPropagation(), children: [ /*#__PURE__*/ _jsx("img", { src: lightboxUrl, alt: "photo", className: "max-w-[90vw] max-h-[90vh] rounded-2xl object-contain shadow-2xl" }), /*#__PURE__*/ _jsx("button", { onClick: ()=>setLightboxUrl(null), className: "absolute -top-3 -right-3 w-8 h-8 bg-white rounded-full flex items-center justify-center shadow-lg hover:bg-gray-100 transition", "aria-label": "Close", children: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-gray-700", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" }) }) }), /*#__PURE__*/ _jsx("a", { href: lightboxUrl, download: true, target: "_blank", rel: "noreferrer", className: "absolute -bottom-3 -right-3 w-8 h-8 bg-white rounded-full flex items-center justify-center shadow-lg hover:bg-gray-100 transition", "aria-label": "Download", onClick: (e)=>e.stopPropagation(), children: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-gray-700", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4 16v2a2 2 0 002 2h12a2 2 0 002-2v-2M7 10l5 5 5-5M12 15V3" }) }) }) ] }) }), /*#__PURE__*/ _jsxs("div", { className: "px-4 py-3 border-t border-gray-100", children: [ " ", /*#__PURE__*/ _jsx("input", { ref: fileInputRef, type: "file", accept: "image/jpeg,image/png,image/gif,image/webp", className: "hidden", onChange: (e)=>{ var _e_target_files; const file = (_e_target_files = e.target.files) === null || _e_target_files === void 0 ? void 0 : _e_target_files[0]; if (file) uploadAndSendImage(file); } }), " ", msgLimit && msgLimit.left !== null && msgLimit.left <= 0 && /*#__PURE__*/ _jsxs("div", { className: "mb-2 flex items-center gap-2 bg-red-50 border border-red-200 rounded-xl px-3 py-2", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-red-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 9v2m0 4h.01M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z" }) }), /*#__PURE__*/ _jsx("span", { className: "text-xs text-red-700 flex-1", children: t('chat.limit_reached', 'Daily message limit reached') }), /*#__PURE__*/ _jsx(Link, { href: "/pricing", className: "text-xs font-medium text-red-700 underline", children: t('dashboard.plan.upgrade', 'Upgrade plan') }) ] }), msgLimit && msgLimit.left !== null && msgLimit.left > 0 && msgLimit.left <= Math.ceil((msgLimit.left + msgLimit.sent) * 0.2) && /*#__PURE__*/ _jsxs("div", { className: "mb-2 flex items-center gap-2 bg-amber-50 border border-amber-200 rounded-xl px-3 py-2", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-amber-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 9v2m0 4h.01M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z" }) }), /*#__PURE__*/ _jsx("span", { className: "text-xs text-amber-700 flex-1", children: t('chat.limit_warning', '{n} messages left today').replace('{n}', String(msgLimit.left)) }), /*#__PURE__*/ _jsx(Link, { href: "/pricing", className: "text-xs font-medium text-amber-700 underline", children: t('dashboard.plan.upgrade', 'Upgrade plan') }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-2 items-end", children: [ /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>{ var _fileInputRef_current; return (_fileInputRef_current = fileInputRef.current) === null || _fileInputRef_current === void 0 ? void 0 : _fileInputRef_current.click(); }, disabled: uploadingImage || !connected || !!(msgLimit && msgLimit.left !== null && msgLimit.left <= 0), className: "h-10 w-10 text-gray-400 hover:text-gray-500 disabled:opacity-40 disabled:cursor-not-allowed flex-shrink-0 flex items-center justify-center rounded-xl hover:bg-gray-50 transition", title: "Send photo", children: uploadingImage ? /*#__PURE__*/ _jsxs("svg", { className: "w-5 h-5 animate-spin", fill: "none", viewBox: "0 0 24 24", children: [ /*#__PURE__*/ _jsx("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }), /*#__PURE__*/ _jsx("path", { className: "opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8v8H4z" }) ] }) : /*#__PURE__*/ _jsxs("svg", { className: "w-5 h-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: [ /*#__PURE__*/ _jsx("rect", { x: "3", y: "3", width: "18", height: "18", rx: "3", ry: "3" }), /*#__PURE__*/ _jsx("circle", { cx: "8.5", cy: "8.5", r: "1.5" }), /*#__PURE__*/ _jsx("polyline", { points: "21 15 16 10 5 21" }) ] }) }), /*#__PURE__*/ _jsx("textarea", { ref: inputRef, value: input, onChange: (e)=>setInput(e.target.value), onKeyDown: handleKeyDown, rows: 1, placeholder: t('chat.placeholder'), disabled: !!(msgLimit && msgLimit.left !== null && msgLimit.left <= 0), className: "flex-1 border border-gray-300 rounded-xl px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 resize-none max-h-32 disabled:bg-gray-50 disabled:text-gray-400", style: { minHeight: '40px' } }), /*#__PURE__*/ _jsx("button", { onClick: sendMessage, disabled: !input.trim() || !connected || !!(msgLimit && msgLimit.left !== null && msgLimit.left <= 0), className: "h-10 w-10 bg-green-600 text-white rounded-xl hover:bg-green-700 disabled:opacity-40 disabled:cursor-not-allowed flex-shrink-0 flex items-center justify-center", children: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 12h14M12 5l7 7-7 7" }) }) }) ] }) ] }) ] }) }) ] }); } export default function ChatPage() { return /*#__PURE__*/ _jsx(Suspense, { fallback: /*#__PURE__*/ _jsx("div", { className: "text-center py-20 text-white", children: "..." }), children: /*#__PURE__*/ _jsx(ChatPageInner, {}) }); } ÷"61146undefined148222undefined224284undefined286314undefined316355undefined357401undefined403471undefined473523undefined525562undefined580610"https://api.canhelp.gr"undefined6156370undefined798806(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)undefined836850(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useSearchParams)undefined896905(0,_lib_auth__WEBPACK_IMPORTED_MODULE_4__/* .useSession */ .wV)undefined936944(0,_context_locale__WEBPACK_IMPORTED_MODULE_5__/* .useLocale */ .Y)undefined979986(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined10371044(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined10971104(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined11491156(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined12131220(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined12601267(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined13121319(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined13651372(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined14291436(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined14881495(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined15261531(0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)undefined15671572(0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)undefined16021607(0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)undefined16411646(0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)undefined16591667(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined18131821(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined18671878(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getChatRooms */ .Zp)undefined21552167(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getDailyUsage */ .z4)undefined24112419(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined24802481(0,socket_io_client__WEBPACK_IMPORTED_MODULE_7__.io)undefined62776285(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined64486458(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getMessages */ .VL)undefined69916999(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined74027410(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined77567764(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined80228032(0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)undefined86908700(0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)undefined1070110704(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1112811132(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1127111275(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1147011474(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1163011633(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1185111855(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1203712040(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1226812271(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1265412657(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1279812801(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1335113365(0,_lib_formatName__WEBPACK_IMPORTED_MODULE_8__/* .formatShortName */ .H)undefined1366313677(0,_lib_formatName__WEBPACK_IMPORTED_MODULE_8__/* .formatShortName */ .H)undefined1404414048(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1483514839(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1505315056(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1537015373(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1577415777(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1634116344(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1673816741(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1691816921(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1711017114(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1711617124react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragmentundefined1719917202(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1734217345(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1774517759(0,_lib_formatName__WEBPACK_IMPORTED_MODULE_8__/* .formatShortName */ .H)undefined1853618540(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1854218545(next_link__WEBPACK_IMPORTED_MODULE_3___default())undefined1887718880(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1908019084(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1964319646(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1988419887(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2045520459(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2063720640(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2091520918(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2129121294(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2179221795(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2204622050(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2225022253(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2249522498(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2312823132(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2336023363(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2370323706(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2445624460(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2474824751(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2492624940(0,_lib_formatName__WEBPACK_IMPORTED_MODULE_8__/* .formatShortName */ .H)undefined2527525278(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2566925672(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2616626169(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2684826851(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2762827631(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2784427847(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2809628100(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2835328356(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2868628689(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2908629089(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2950229505(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2991629919(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3054930552(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3096330966(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3149531499(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3172531728(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3257032574(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3281932822(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3324133244(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3369833701(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3400634009(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3401134014(next_link__WEBPACK_IMPORTED_MODULE_3___default())undefined3457134575(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3482434827(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3524835251(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3570535708(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3604936052(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3605436057(next_link__WEBPACK_IMPORTED_MODULE_3___default())undefined3648836492(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3667636679(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3765737661(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3801338016(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3858338586(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3900939013(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3949039493(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4002340026(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4036140364(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4071340716(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4174941752(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4226442267(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4269042693(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4328443298undefined4334643349(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4335143358react__WEBPACK_IMPORTED_MODULE_1__.Suspenseundefined4339543398(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4353643539(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefinedèé, /***/ 7016:  U«webpack/lib/util/registerExternalSerializerœwebpack-sources/ConcatSource€«webpack/lib/util/registerExternalSerializer™webpack-sources/RawSourceV/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { «webpack/lib/util/registerExternalSerializerœwebpack-sources/CachedSource S«webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSource«webpack/lib/util/registerExternalSerializer™webpack-sources/RawSourceRimport(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/chat/page.tsx"); `OßPromise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 4251))€†buffer†source„size„maps„hashaPromise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 4251)); €”{"finalSource":true}ƒmap‹bufferedMap ReplaceSourceRawSourceRimport(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/chat/page.tsx"); k079Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 4251))undefined /***/ }) ÕÁ/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 4251)); /***/ }) ÖÙ ÚV/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { ÜRimport(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/chat/page.tsx"); k079Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 4251))undefinedÝÞ }, «webpack/lib/util/registerExternalSerializerœwebpack-sources/PrefixSource‰/******/ 2__webpack_require__ => { // webpackRuntimeModules òvar __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId)) __webpack_require__.O(0, [1516,9664,2838,9906,2982,587,18,7358], () => (__webpack_exec__(7016))); var __webpack_exports__ = __webpack_require__.O(); _N_E = __webpack_exports__; } ]); ÿÿÿ Ï(self["webpackChunk_N_E"] = self["webpackChunk_N_E"] || []).push([[8457],{ /***/ 1258: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ E: () => (/* binding */ shortName), /* harmony export */ H: () => (/* binding */ formatShortName) /* harmony export */ }); /** * Shortens the last name to first letter + period. * "ИваМ ПетрПв" → "ИваМ П." * Works with a pre-composed full name string. */ function shortName(fullName) { if (!(fullName === null || fullName === void 0 ? void 0 : fullName.trim())) return '—'; const parts = fullName.trim().split(/\s+/); if (parts.length < 2 || !parts[1]) return parts[0]; return "".concat(parts[0], " ").concat(parts[1][0].toUpperCase(), "."); } /** * Formats separate firstName + lastName fields, shortening the last name. * Falls back to parsing fullName if firstName is not available. */ function formatShortName(firstName, lastName, fallbackName) { if (firstName === null || firstName === void 0 ? void 0 : firstName.trim()) { const l = lastName === null || lastName === void 0 ? void 0 : lastName.trim(); return l ? "".concat(firstName.trim(), " ").concat(l[0].toUpperCase(), ".") : firstName.trim(); } return shortName(fallbackName); } /***/ }), /***/ 1592: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ CI: () => (/* binding */ signOut), /* harmony export */ Hh: () => (/* binding */ signUp), /* harmony export */ Jv: () => (/* binding */ signIn), /* harmony export */ wV: () => (/* binding */ useSession), /* harmony export */ yK: () => (/* binding */ authClient) /* harmony export */ }); /* harmony import */ var better_auth_react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6504); const API_URL = "https://api.canhelp.gr" || 0; const authClient = (0,better_auth_react__WEBPACK_IMPORTED_MODULE_0__/* .createAuthClient */ .M)({ baseURL: API_URL }); const { signIn, signOut, signUp, useSession } = authClient; /***/ }), /***/ 4251: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ ChatPage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7541); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(9664); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(next_link__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(1592); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(9906); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(2982); /* harmony import */ var _lib_formatName__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(1258); /* harmony import */ var socket_io_client__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(2838); /* __next_internal_client_entry_do_not_use__ default auto */ const API_URL = "https://api.canhelp.gr" || 0; function ChatPageInner() { var _session_user, _activeRoom_task, _activeRoom_otherUser, _activeRoom_otherUser1, _activeRoom_otherUser2; const router = (0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)(); const searchParams = (0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useSearchParams)(); const { data: session, isPending } = (0,_lib_auth__WEBPACK_IMPORTED_MODULE_4__/* .useSession */ .wV)(); const { t, locale } = (0,_context_locale__WEBPACK_IMPORTED_MODULE_5__/* .useLocale */ .Y)(); const [rooms, setRooms] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [loadingRooms, setLoadingRooms] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(true); const [activeRoomId, setActiveRoomId] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [messages, setMessages] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [loadingMessages, setLoadingMessages] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [input, setInput] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [connected, setConnected] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [msgLimit, setMsgLimit] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [uploadingImage, setUploadingImage] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [lightboxUrl, setLightboxUrl] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const socketRef = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null); const messagesEndRef = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null); const inputRef = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null); const fileInputRef = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!isPending && !session) router.push('/login'); }, [ session, isPending ]); // Load chat rooms (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!session) return; (0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getChatRooms */ .Zp)().then((data)=>{ setRooms(data); const roomParam = searchParams.get('room'); if (roomParam) setActiveRoomId(roomParam); }).catch((err)=>console.error('[chat] getChatRooms error:', err)).finally(()=>setLoadingRooms(false)); (0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getDailyUsage */ .z4)().then((u)=>setMsgLimit({ left: u.messagesLeft, sent: u.messagesSent })).catch((err)=>console.error('[chat] getDailyUsage error:', err)); }, [ session ]); // Setup Socket.IO (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!session) return; const socket = (0,socket_io_client__WEBPACK_IMPORTED_MODULE_7__.io)(API_URL, { withCredentials: true, transports: [ 'websocket', 'polling' ] }); socketRef.current = socket; socket.on('connect', ()=>setConnected(true)); socket.on('disconnect', ()=>setConnected(false)); socket.on('new_message', (msg)=>{ setMessages((prev)=>{ // avoid duplicate if we get it back from our own send if (prev.some((m)=>m.message.id === msg.id)) return prev; var _session_user_name, _session_user_image; // sender info: only known for current user; others show placeholder (? avatar) const sender = session.user && session.user.id === msg.senderId ? { id: session.user.id, name: (_session_user_name = session.user.name) !== null && _session_user_name !== void 0 ? _session_user_name : '', image: (_session_user_image = session.user.image) !== null && _session_user_image !== void 0 ? _session_user_image : undefined } : null; return [ ...prev, { message: msg, sender } ]; }); // Update lastMessage in rooms list and bubble room to top setRooms((prev)=>{ const updated = prev.map((r)=>{ var _msg_translations, _msg_imageUrl; return r.room.id === msg.roomId ? { ...r, lastMessage: { body: msg.body, createdAt: msg.createdAt, translations: (_msg_translations = msg.translations) !== null && _msg_translations !== void 0 ? _msg_translations : null, imageUrl: (_msg_imageUrl = msg.imageUrl) !== null && _msg_imageUrl !== void 0 ? _msg_imageUrl : null } } : r; }); return updated.sort((a, b)=>{ var _a_lastMessage, _b_lastMessage; const aTime = ((_a_lastMessage = a.lastMessage) === null || _a_lastMessage === void 0 ? void 0 : _a_lastMessage.createdAt) ? new Date(a.lastMessage.createdAt).getTime() : new Date(a.room.createdAt).getTime(); const bTime = ((_b_lastMessage = b.lastMessage) === null || _b_lastMessage === void 0 ? void 0 : _b_lastMessage.createdAt) ? new Date(b.lastMessage.createdAt).getTime() : new Date(b.room.createdAt).getTime(); return bTime - aTime; }); }); }); socket.on('message_translated', (param)=>{ let { id, roomId, translations } = param; setMessages((prev)=>prev.map((m)=>m.message.id === id ? { ...m, message: { ...m.message, translations } } : m)); // Also update lastMessage in sidebar if this is the last message of that room if (roomId) { setRooms((prev)=>prev.map((r)=>r.room.id === roomId && r.lastMessage ? { ...r, lastMessage: { ...r.lastMessage, translations } } : r)); } }); return ()=>{ socket.disconnect(); socketRef.current = null; }; }, [ session ]); // Join room and load messages when activeRoomId changes (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ var _socketRef_current, _socketRef_current1; if (!activeRoomId) return; setLoadingMessages(true); setMessages([]); (0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getMessages */ .VL)(activeRoomId).then(setMessages).catch((err)=>console.error('[chat] getMessages error:', err)).finally(()=>setLoadingMessages(false)); (_socketRef_current = socketRef.current) === null || _socketRef_current === void 0 ? void 0 : _socketRef_current.emit('join_room', activeRoomId); (_socketRef_current1 = socketRef.current) === null || _socketRef_current1 === void 0 ? void 0 : _socketRef_current1.emit('mark_read', activeRoomId); }, [ activeRoomId ]); // Focus input when active room changes (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!activeRoomId) return; const t = setTimeout(()=>{ var _inputRef_current; return (_inputRef_current = inputRef.current) === null || _inputRef_current === void 0 ? void 0 : _inputRef_current.focus(); }, 50); return ()=>clearTimeout(t); }, [ activeRoomId ]); // Auto-scroll on new messages (within container only) (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ var _messagesEndRef_current; (_messagesEndRef_current = messagesEndRef.current) === null || _messagesEndRef_current === void 0 ? void 0 : _messagesEndRef_current.scrollIntoView({ behavior: 'smooth', block: 'nearest' }); }, [ messages ]); // Close lightbox on Escape (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ const onKey = (e)=>{ if (e.key === 'Escape') setLightboxUrl(null); }; window.addEventListener('keydown', onKey); return ()=>window.removeEventListener('keydown', onKey); }, []); const sendMessage = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)(()=>{ const body = input.trim(); if (!body || !activeRoomId || !socketRef.current) return; if (msgLimit && msgLimit.left !== null && msgLimit.left <= 0) return; socketRef.current.emit('send_message', { roomId: activeRoomId, body, locale }); setInput(''); // decrement local counter setMsgLimit((prev)=>prev && prev.left !== null ? { ...prev, left: prev.left - 1, sent: prev.sent + 1 } : prev); }, [ input, activeRoomId, msgLimit ]); const uploadAndSendImage = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)(async (file)=>{ if (!activeRoomId || !socketRef.current) return; setUploadingImage(true); try { const formData = new FormData(); formData.append('file', file); const res = await fetch("".concat(API_URL, "/api/uploads"), { method: 'POST', credentials: 'include', body: formData }); if (!res.ok) throw new Error('Upload failed'); const { url } = await res.json(); socketRef.current.emit('send_message', { roomId: activeRoomId, body: '', imageUrl: url, locale }); } catch (_) { // silent } finally{ setUploadingImage(false); if (fileInputRef.current) fileInputRef.current.value = ''; } }, [ activeRoomId, locale ]); const handleKeyDown = (e)=>{ if (e.key === 'Enter' && !e.shiftKey) { e.preventDefault(); sendMessage(); } }; const LOCALE_TAG = { ru: 'ru-RU', en: 'en-US', el: 'el-GR' }; var _LOCALE_TAG_locale; const localeTag = (_LOCALE_TAG_locale = LOCALE_TAG[locale]) !== null && _LOCALE_TAG_locale !== void 0 ? _LOCALE_TAG_locale : 'el-GR'; function fmtMsgTime(iso) { const d = new Date(iso); const now = new Date(); const diffMin = Math.floor((now.getTime() - d.getTime()) / 60000); if (diffMin < 1) return t('chat.just_now'); if (diffMin < 60) return "".concat(diffMin).concat(t('chat.min_ago')); if (d.toDateString() === now.toDateString()) return d.toLocaleTimeString(localeTag, { hour: '2-digit', minute: '2-digit' }); return d.toLocaleDateString(localeTag, { day: '2-digit', month: '2-digit' }); } if (isPending || loadingRooms) { return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-center py-20 text-white", children: t('common.loading') }); } const activeRoom = rooms.find((r)=>r.room.id === activeRoomId); const currentUserId = session === null || session === void 0 ? void 0 : (_session_user = session.user) === null || _session_user === void 0 ? void 0 : _session_user.id; var _activeRoom_task_title; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "max-w-5xl mx-auto px-4 py-6 h-[calc(100vh-80px)] flex gap-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "w-72 flex-shrink-0 bg-white rounded-xl border border-gray-200 overflow-hidden flex flex-col", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "p-4 border-b border-gray-100", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h1", { className: "font-bold text-gray-900 text-lg", children: t('nav.chat') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-1.5 mt-1", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "w-2 h-2 rounded-full ".concat(connected ? 'bg-green-400' : 'bg-gray-300') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-xs text-gray-400", children: connected ? t('chat.connected') : t('chat.disconnected') }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex-1 overflow-y-auto", children: rooms.length === 0 ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "p-6 text-center text-gray-400 text-sm", children: t('chat.no_rooms') }) : rooms.map((param)=>{ let { room, task, otherUser, lastMessage } = param; var _lastMessage_translations; var _task_title; const roomLabel = (_task_title = task === null || task === void 0 ? void 0 : task.title) !== null && _task_title !== void 0 ? _task_title : (0,_lib_formatName__WEBPACK_IMPORTED_MODULE_8__/* .formatShortName */ .H)(otherUser === null || otherUser === void 0 ? void 0 : otherUser.firstName, otherUser === null || otherUser === void 0 ? void 0 : otherUser.lastName, otherUser === null || otherUser === void 0 ? void 0 : otherUser.name) || t('chat.direct_chat'); const roomSub = task ? (0,_lib_formatName__WEBPACK_IMPORTED_MODULE_8__/* .formatShortName */ .H)(otherUser === null || otherUser === void 0 ? void 0 : otherUser.firstName, otherUser === null || otherUser === void 0 ? void 0 : otherUser.lastName, otherUser === null || otherUser === void 0 ? void 0 : otherUser.name) || '' : t('chat.direct_chat'); var _lastMessage_translations_locale; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { onClick: ()=>{ setActiveRoomId(room.id); setTimeout(()=>{ var _inputRef_current; return (_inputRef_current = inputRef.current) === null || _inputRef_current === void 0 ? void 0 : _inputRef_current.focus(); }, 50); }, className: "w-full text-left px-4 py-3 border-b border-gray-50 hover:bg-gray-50 transition ".concat(activeRoomId === room.id ? 'bg-green-50 border-l-2 border-l-green-500' : ''), children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-start justify-between gap-1", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm font-medium text-gray-800 line-clamp-1 flex-1", children: roomLabel }), lastMessage && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-[10px] text-gray-400 shrink-0 mt-0.5", children: fmtMsgTime(lastMessage.createdAt) }) ] }), lastMessage ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400 mt-0.5 line-clamp-1", children: lastMessage.imageUrl && !lastMessage.body ? '📷' : (_lastMessage_translations_locale = (_lastMessage_translations = lastMessage.translations) === null || _lastMessage_translations === void 0 ? void 0 : _lastMessage_translations[locale]) !== null && _lastMessage_translations_locale !== void 0 ? _lastMessage_translations_locale : lastMessage.body }) : task ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400 mt-0.5 line-clamp-1", children: roomSub }) : null ] }, room.id); }) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex-1 bg-white rounded-xl border border-gray-200 flex flex-col overflow-hidden", children: !activeRoomId ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex-1 flex items-center justify-center text-gray-400 text-sm", children: t('chat.select') }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "px-5 py-4 border-b border-gray-100", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "font-semibold text-gray-800 text-sm", children: (_activeRoom_task_title = activeRoom === null || activeRoom === void 0 ? void 0 : (_activeRoom_task = activeRoom.task) === null || _activeRoom_task === void 0 ? void 0 : _activeRoom_task.title) !== null && _activeRoom_task_title !== void 0 ? _activeRoom_task_title : (0,_lib_formatName__WEBPACK_IMPORTED_MODULE_8__/* .formatShortName */ .H)(activeRoom === null || activeRoom === void 0 ? void 0 : (_activeRoom_otherUser = activeRoom.otherUser) === null || _activeRoom_otherUser === void 0 ? void 0 : _activeRoom_otherUser.firstName, activeRoom === null || activeRoom === void 0 ? void 0 : (_activeRoom_otherUser1 = activeRoom.otherUser) === null || _activeRoom_otherUser1 === void 0 ? void 0 : _activeRoom_otherUser1.lastName, activeRoom === null || activeRoom === void 0 ? void 0 : (_activeRoom_otherUser2 = activeRoom.otherUser) === null || _activeRoom_otherUser2 === void 0 ? void 0 : _activeRoom_otherUser2.name) || t('chat.direct_chat') }) }), (activeRoom === null || activeRoom === void 0 ? void 0 : activeRoom.task) && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)((next_link__WEBPACK_IMPORTED_MODULE_3___default()), { href: "/tasks/".concat(activeRoom.task.id), className: "flex items-center gap-3 mx-5 mt-4 px-4 py-3 bg-green-50 border border-green-200 rounded-xl hover:bg-green-100 transition group", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "w-8 h-8 rounded-lg bg-green-600 flex items-center justify-center flex-shrink-0", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-4 h-4 text-white", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M16 4h2a2 2 0 012 2v14a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2h2" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("rect", { x: "8", y: "2", width: "8", height: "4", rx: "1", ry: "1" }) ] }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-500 font-medium", children: t('chat.linked_task') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm font-semibold text-gray-800 truncate group-hover:underline", children: activeRoom.task.title }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 text-gray-400 flex-shrink-0", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("polyline", { points: "9 18 15 12 9 6" }) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex-1 overflow-y-auto px-5 py-4 space-y-3", children: [ loadingMessages ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-center text-gray-400 text-sm py-10", children: t('common.loading') }) : messages.length === 0 ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-center text-gray-400 text-sm py-10", children: t('chat.no_messages') }) : messages.map((param)=>{ let { message, sender } = param; var _sender_name_, _sender_name, _message_translations; const isMe = message.senderId === currentUserId; var _sender_name__toUpperCase, _message_translations_locale; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-2.5 ".concat(isMe ? 'flex-row-reverse' : ''), children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "w-8 h-8 rounded-full bg-green-100 flex-shrink-0 flex items-center justify-center text-green-700 text-xs font-bold overflow-hidden", children: (sender === null || sender === void 0 ? void 0 : sender.image) ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: sender.image, alt: sender.name, className: "w-full h-full object-cover" }) : (_sender_name__toUpperCase = sender === null || sender === void 0 ? void 0 : (_sender_name = sender.name) === null || _sender_name === void 0 ? void 0 : (_sender_name_ = _sender_name[0]) === null || _sender_name_ === void 0 ? void 0 : _sender_name_.toUpperCase()) !== null && _sender_name__toUpperCase !== void 0 ? _sender_name__toUpperCase : '?' }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "max-w-[70%] ".concat(isMe ? 'items-end' : 'items-start', " flex flex-col gap-1"), children: [ !isMe && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-xs text-gray-400 px-1", children: (0,_lib_formatName__WEBPACK_IMPORTED_MODULE_8__/* .formatShortName */ .H)(sender === null || sender === void 0 ? void 0 : sender.firstName, sender === null || sender === void 0 ? void 0 : sender.lastName, sender === null || sender === void 0 ? void 0 : sender.name) }), message.imageUrl ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>setLightboxUrl("".concat(API_URL).concat(message.imageUrl)), className: "block focus:outline-none", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: "".concat(API_URL).concat(message.imageUrl), alt: "photo", className: "rounded-2xl max-w-[240px] max-h-[320px] object-cover cursor-pointer hover:opacity-90 transition" }) }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "px-4 py-2 rounded-2xl text-sm leading-relaxed ".concat(isMe ? 'bg-green-600 text-white rounded-tr-sm' : 'bg-gray-100 text-gray-800 rounded-tl-sm'), children: (_message_translations_locale = (_message_translations = message.translations) === null || _message_translations === void 0 ? void 0 : _message_translations[locale]) !== null && _message_translations_locale !== void 0 ? _message_translations_locale : message.body }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-xs text-gray-300 px-1", children: new Date(message.createdAt).toLocaleTimeString(localeTag, { hour: '2-digit', minute: '2-digit' }) }) ] }) ] }, message.id); }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { ref: messagesEndRef }) ] }), lightboxUrl && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "fixed inset-0 z-50 flex items-center justify-center bg-black/80 backdrop-blur-sm", onClick: ()=>setLightboxUrl(null), children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "relative max-w-[90vw] max-h-[90vh]", onClick: (e)=>e.stopPropagation(), children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: lightboxUrl, alt: "photo", className: "max-w-[90vw] max-h-[90vh] rounded-2xl object-contain shadow-2xl" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>setLightboxUrl(null), className: "absolute -top-3 -right-3 w-8 h-8 bg-white rounded-full flex items-center justify-center shadow-lg hover:bg-gray-100 transition", "aria-label": "Close", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 text-gray-700", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" }) }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("a", { href: lightboxUrl, download: true, target: "_blank", rel: "noreferrer", className: "absolute -bottom-3 -right-3 w-8 h-8 bg-white rounded-full flex items-center justify-center shadow-lg hover:bg-gray-100 transition", "aria-label": "Download", onClick: (e)=>e.stopPropagation(), children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 text-gray-700", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4 16v2a2 2 0 002 2h12a2 2 0 002-2v-2M7 10l5 5 5-5M12 15V3" }) }) }) ] }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "px-4 py-3 border-t border-gray-100", children: [ " ", /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { ref: fileInputRef, type: "file", accept: "image/jpeg,image/png,image/gif,image/webp", className: "hidden", onChange: (e)=>{ var _e_target_files; const file = (_e_target_files = e.target.files) === null || _e_target_files === void 0 ? void 0 : _e_target_files[0]; if (file) uploadAndSendImage(file); } }), " ", msgLimit && msgLimit.left !== null && msgLimit.left <= 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "mb-2 flex items-center gap-2 bg-red-50 border border-red-200 rounded-xl px-3 py-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 text-red-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 9v2m0 4h.01M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z" }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-xs text-red-700 flex-1", children: t('chat.limit_reached', 'Daily message limit reached') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)((next_link__WEBPACK_IMPORTED_MODULE_3___default()), { href: "/pricing", className: "text-xs font-medium text-red-700 underline", children: t('dashboard.plan.upgrade', 'Upgrade plan') }) ] }), msgLimit && msgLimit.left !== null && msgLimit.left > 0 && msgLimit.left <= Math.ceil((msgLimit.left + msgLimit.sent) * 0.2) && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "mb-2 flex items-center gap-2 bg-amber-50 border border-amber-200 rounded-xl px-3 py-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 text-amber-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 9v2m0 4h.01M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z" }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-xs text-amber-700 flex-1", children: t('chat.limit_warning', '{n} messages left today').replace('{n}', String(msgLimit.left)) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)((next_link__WEBPACK_IMPORTED_MODULE_3___default()), { href: "/pricing", className: "text-xs font-medium text-amber-700 underline", children: t('dashboard.plan.upgrade', 'Upgrade plan') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-2 items-end", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>{ var _fileInputRef_current; return (_fileInputRef_current = fileInputRef.current) === null || _fileInputRef_current === void 0 ? void 0 : _fileInputRef_current.click(); }, disabled: uploadingImage || !connected || !!(msgLimit && msgLimit.left !== null && msgLimit.left <= 0), className: "h-10 w-10 text-gray-400 hover:text-gray-500 disabled:opacity-40 disabled:cursor-not-allowed flex-shrink-0 flex items-center justify-center rounded-xl hover:bg-gray-50 transition", title: "Send photo", children: uploadingImage ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-5 h-5 animate-spin", fill: "none", viewBox: "0 0 24 24", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { className: "opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8v8H4z" }) ] }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-5 h-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("rect", { x: "3", y: "3", width: "18", height: "18", rx: "3", ry: "3" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("circle", { cx: "8.5", cy: "8.5", r: "1.5" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("polyline", { points: "21 15 16 10 5 21" }) ] }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("textarea", { ref: inputRef, value: input, onChange: (e)=>setInput(e.target.value), onKeyDown: handleKeyDown, rows: 1, placeholder: t('chat.placeholder'), disabled: !!(msgLimit && msgLimit.left !== null && msgLimit.left <= 0), className: "flex-1 border border-gray-300 rounded-xl px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 resize-none max-h-32 disabled:bg-gray-50 disabled:text-gray-400", style: { minHeight: '40px' } }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: sendMessage, disabled: !input.trim() || !connected || !!(msgLimit && msgLimit.left !== null && msgLimit.left <= 0), className: "h-10 w-10 bg-green-600 text-white rounded-xl hover:bg-green-700 disabled:opacity-40 disabled:cursor-not-allowed flex-shrink-0 flex items-center justify-center", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 12h14M12 5l7 7-7 7" }) }) }) ] }) ] }) ] }) }) ] }); } function ChatPage() { return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(react__WEBPACK_IMPORTED_MODULE_1__.Suspense, { fallback: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-center py-20 text-white", children: "..." }), children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(ChatPageInner, {}) }); } /***/ }), /***/ 7016: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 4251)); /***/ }) }, /******/ __webpack_require__ => { // webpackRuntimeModules /******/ var __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId)) /******/ __webpack_require__.O(0, [1516,9664,2838,9906,2982,587,18,7358], () => (__webpack_exec__(7016))); /******/ var __webpack_exports__ = __webpack_require__.O(); /******/ _N_E = __webpack_exports__; /******/ } ]); €ÿÿÿ `4ÿÿÿX(self["webpackChunk_N_E"] = self["webpackChunk_N_E"] || []).push([[8457],{ /***/ 1258: ÿÿÿ¥ÿÿÿ¬ÿÿÿ­®©ª©¯ÿÿÿ¥ÿÿÿ°ÿÿÿ±²©ª©, /***/ 4251: ÿÿÿ€ÿÿÿÿÿÿÿÿÿÓ»ÿÿÿÿÿš©š, /***/ 7016: ÿÿÿ²ÿÿÿRimport(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/chat/page.tsx"); k079Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 4251))undefined¥Š¥î!PrefixSourceConcatSourceRawSourceï€òvar __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId)) __webpack_require__.O(0, [1516,9664,2838,9906,2982,587,18,7358], () => (__webpack_exec__(7016))); var __webpack_exports__ = __webpack_require__.O(); £ðñò ¶Í«webpack/lib/util/registerExternalSerializerœwebpack-sources/ConcatSource€` «webpack/lib/util/registerExternalSerializer™webpack-sources/RawSourceW(self["webpackChunk_N_E"] = self["webpackChunk_N_E"] || []).push([[5105],{ /***/ 252: «webpack/lib/util/registerExternalSerializerœwebpack-sources/CachedSource ÷Ï«webpack/lib/util/registerExternalSerializerœwebpack-sources/ConcatSource€«webpack/lib/util/registerExternalSerializer™webpack-sources/RawSource_/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; «webpack/lib/util/registerExternalSerializerœwebpack-sources/CachedSource žr«webpack/lib/util/registerExternalSerializerœwebpack-sources/ConcatSource€«webpack/lib/util/registerExternalSerializer™webpack-sources/RawSource‘// ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); // EXPORTS __webpack_require__.d(__webpack_exports__, { "default": () => (/* binding */ DashboardPage) }); // EXTERNAL MODULE: ../../node_modules/next/dist/compiled/react/jsx-runtime.js var jsx_runtime = __webpack_require__(4568); // EXTERNAL MODULE: ../../node_modules/next/dist/compiled/react/index.js var react = __webpack_require__(7620); // EXTERNAL MODULE: ../../node_modules/next/dist/api/navigation.js var navigation = __webpack_require__(7541); // EXTERNAL MODULE: ../../node_modules/next/dist/client/app-dir/link.js var app_dir_link = __webpack_require__(9664); var link_default = /*#__PURE__*/__webpack_require__.n(app_dir_link); // EXTERNAL MODULE: ./src/lib/auth.ts var auth = __webpack_require__(1592); // EXTERNAL MODULE: ./src/context/locale.tsx var context_locale = __webpack_require__(9906); // EXTERNAL MODULE: ./src/lib/api.ts var api = __webpack_require__(2982); // EXTERNAL MODULE: ./src/lib/taskLocale.ts var taskLocale = __webpack_require__(4017); // EXTERNAL MODULE: ./src/components/PlanBadge.tsx var PlanBadge = __webpack_require__(2035); ;// ./src/components/UsageMeter.tsx «webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSource«webpack/lib/util/registerExternalSerializerœwebpack-sources/CachedSource ? «webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSource«webpack/lib/util/registerExternalSerializer™webpack-sources/RawSource~ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; export function UsageMeter(param) { let { current, limit, label, className = '' } = param; if (limit === null) { return /*#__PURE__*/ _jsxs("div", { className: "".concat(className), children: [ /*#__PURE__*/ _jsxs("div", { className: "flex justify-between items-center mb-1", children: [ /*#__PURE__*/ _jsx("span", { className: "text-xs text-gray-500", children: label }), /*#__PURE__*/ _jsx("span", { className: "text-xs font-semibold text-green-600", children: "∞" }) ] }), /*#__PURE__*/ _jsx("div", { className: "h-1.5 rounded-full bg-green-100", children: /*#__PURE__*/ _jsx("div", { className: "h-full w-full rounded-full bg-green-400" }) }) ] }); } const pct = limit > 0 ? Math.min(100, Math.round(current / limit * 100)) : 100; const remaining = Math.max(0, limit - current); const barColor = pct >= 100 ? 'bg-red-500' : pct >= 80 ? 'bg-amber-400' : 'bg-green-500'; const textColor = pct >= 100 ? 'text-red-600' : pct >= 80 ? 'text-amber-600' : 'text-gray-600'; return /*#__PURE__*/ _jsxs("div", { className: className, children: [ /*#__PURE__*/ _jsxs("div", { className: "flex justify-between items-center mb-1", children: [ /*#__PURE__*/ _jsx("span", { className: "text-xs text-gray-500", children: label }), /*#__PURE__*/ _jsxs("span", { className: "text-xs font-semibold ".concat(textColor), children: [ remaining, " / ", limit ] }) ] }), /*#__PURE__*/ _jsx("div", { className: "h-1.5 rounded-full bg-gray-100", children: /*#__PURE__*/ _jsx("div", { className: "h-full rounded-full transition-all ".concat(barColor), style: { width: "".concat(pct, "%") } }) }) ] }); } d>@FWÖÚHLæé£ŠŽ‘  mqÿ¬° { ~ €€Í__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._ÿË__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._ÿÿÿþþÿþÿÿ€†buffer†source„size„maps„hash‘ function UsageMeter(param) { let { current, limit, label, className = '' } = param; if (limit === null) { return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "".concat(className), children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "flex justify-between items-center mb-1", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { className: "text-xs text-gray-500", children: label }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { className: "text-xs font-semibold text-green-600", children: "∞" }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "h-1.5 rounded-full bg-green-100", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "h-full w-full rounded-full bg-green-400" }) }) ] }); } const pct = limit > 0 ? Math.min(100, Math.round(current / limit * 100)) : 100; const remaining = Math.max(0, limit - current); const barColor = pct >= 100 ? 'bg-red-500' : pct >= 80 ? 'bg-amber-400' : 'bg-green-500'; const textColor = pct >= 100 ? 'text-red-600' : pct >= 80 ? 'text-amber-600' : 'text-gray-600'; return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: className, children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "flex justify-between items-center mb-1", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { className: "text-xs text-gray-500", children: label }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("span", { className: "text-xs font-semibold ".concat(textColor), children: [ remaining, " / ", limit ] }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "h-1.5 rounded-full bg-gray-100", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "h-full rounded-full transition-all ".concat(barColor), style: { width: "".concat(pct, "%") } }) }) ] }); } €•{"finalSource":false}ƒmap‹bufferedMap ReplaceSourceRawSource~ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; export function UsageMeter(param) { let { current, limit, label, className = '' } = param; if (limit === null) { return /*#__PURE__*/ _jsxs("div", { className: "".concat(className), children: [ /*#__PURE__*/ _jsxs("div", { className: "flex justify-between items-center mb-1", children: [ /*#__PURE__*/ _jsx("span", { className: "text-xs text-gray-500", children: label }), /*#__PURE__*/ _jsx("span", { className: "text-xs font-semibold text-green-600", children: "∞" }) ] }), /*#__PURE__*/ _jsx("div", { className: "h-1.5 rounded-full bg-green-100", children: /*#__PURE__*/ _jsx("div", { className: "h-full w-full rounded-full bg-green-400" }) }) ] }); } const pct = limit > 0 ? Math.min(100, Math.round(current / limit * 100)) : 100; const remaining = Math.max(0, limit - current); const barColor = pct >= 100 ? 'bg-red-500' : pct >= 80 ? 'bg-amber-400' : 'bg-green-500'; const textColor = pct >= 100 ? 'text-red-600' : pct >= 80 ? 'text-amber-600' : 'text-gray-600'; return /*#__PURE__*/ _jsxs("div", { className: className, children: [ /*#__PURE__*/ _jsxs("div", { className: "flex justify-between items-center mb-1", children: [ /*#__PURE__*/ _jsx("span", { className: "text-xs text-gray-500", children: label }), /*#__PURE__*/ _jsxs("span", { className: "text-xs font-semibold ".concat(textColor), children: [ remaining, " / ", limit ] }) ] }), /*#__PURE__*/ _jsx("div", { className: "h-1.5 rounded-full bg-gray-100", children: /*#__PURE__*/ _jsx("div", { className: "h-full rounded-full transition-all ".concat(barColor), style: { width: "".concat(pct, "%") } }) }) ] }); } i062undefined6470undefined214218__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined328332__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined486489__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined675678__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined910913__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined10341037__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined15541558__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined16451649__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined17911794__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined19641968__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined23122315__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined24272430__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined` WÜJ–0z4~f°)sxÄgõ? é 5  × G ‘ ”(0,jsx_runtime.jsxs)ÿ“(0,jsx_runtime.jsx)ÿÿÿþþÿþÿÿ" ;// ./src/app/dashboard/page.tsx  ñ«webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSource«webpack/lib/util/registerExternalSerializer™webpack-sources/RawSourceÉÞ/* __next_internal_client_entry_do_not_use__ default auto */ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime"; import { useEffect, useState } from 'react'; import { useRouter, useSearchParams } from 'next/navigation'; import Link from 'next/link'; import { useSession } from '@/lib/auth'; import { useLocale } from '@/context/locale'; import { getMyTasks, getMyOffers, getMyReviews, getNotifications, getMyDashboard, getSpecialistFomoDashboard, getCustomerFomoDashboard, getMySpecialistCards, applyMyReferral } from '@/lib/api'; import { formatPrice, taskTitle } from '@/lib/taskLocale'; import { PlanBadge } from '@/components/PlanBadge'; import { UsageMeter } from '@/components/UsageMeter'; /** Extract the quoted task title from a stored notification body (any locale) */ function extractNotifParam(body) { if (!body) return null; const m = body.match(/[«""](.+?)[»""]/); var _m_; return (_m_ = m === null || m === void 0 ? void 0 : m[1]) !== null && _m_ !== void 0 ? _m_ : null; } function PlanBlock(param) { let { dashboard, t } = param; const plan = dashboard.plan; const expiry = dashboard.planExpiration; const usage = dashboard.usage; const stats = dashboard.stats; const expiryPct = expiry ? Math.max(0, Math.min(100, Math.round(expiry.daysLeft / 30 * 100))) : 100; const expiryColor = expiry ? expiry.daysLeft <= 3 ? 'bg-red-500' : expiry.daysLeft <= 7 ? 'bg-amber-400' : 'bg-green-400' : 'bg-green-400'; return /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-2xl border border-gray-200 p-5 mb-6", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between mb-4", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2", children: [ /*#__PURE__*/ _jsx("h2", { className: "font-semibold text-gray-800 text-sm", children: t('dashboard.plan.title', 'My Plan') }), plan ? /*#__PURE__*/ _jsx(PlanBadge, { tier: plan.tier, size: "sm" }) : /*#__PURE__*/ _jsx("span", { className: "text-xs text-gray-400", children: t('dashboard.plan.no_plan', 'Free') }) ] }), /*#__PURE__*/ _jsx(Link, { href: "/pricing", className: "text-xs font-medium text-green-600 hover:underline", children: (plan === null || plan === void 0 ? void 0 : plan.tier) === 'ultimate' ? null : t('dashboard.plan.upgrade', 'Upgrade') }) ] }), expiry && /*#__PURE__*/ _jsxs("div", { className: "mb-4", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex justify-between text-xs text-gray-500 mb-1", children: [ /*#__PURE__*/ _jsx("span", { children: t('dashboard.plan.expires', 'Expires in {n} days').replace('{n}', String(expiry.daysLeft)) }), /*#__PURE__*/ _jsxs("span", { children: [ expiry.daysLeft, " ", t('pricing.days', 'days') ] }) ] }), /*#__PURE__*/ _jsx("div", { className: "h-1.5 rounded-full bg-gray-100", children: /*#__PURE__*/ _jsx("div", { className: "h-full rounded-full transition-all ".concat(expiryColor), style: { width: "".concat(expiryPct, "%") } }) }) ] }), (usage.messagesSent !== undefined || usage.ordersMade !== undefined) && /*#__PURE__*/ _jsxs("div", { className: "space-y-2 mb-4", children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs font-medium text-gray-500 uppercase tracking-wide", children: t('dashboard.plan.limits', 'Daily limits') }), /*#__PURE__*/ _jsx(UsageMeter, { current: usage.messagesSent, limit: usage.messagesLeft !== null ? usage.messagesSent + usage.messagesLeft : null, label: t('dashboard.plan.messages', 'Messages') }), /*#__PURE__*/ _jsx(UsageMeter, { current: usage.ordersMade, limit: usage.ordersLeft !== null ? usage.ordersMade + usage.ordersLeft : null, label: t('dashboard.plan.orders', 'Orders') }) ] }), Object.keys(stats).length > 0 && /*#__PURE__*/ _jsx("div", { className: "grid grid-cols-2 gap-2", children: Object.entries(stats).map((param)=>{ let [key, val] = param; return /*#__PURE__*/ _jsxs("div", { className: "bg-gray-50 rounded-xl px-3 py-2 text-center", children: [ /*#__PURE__*/ _jsx("p", { className: "text-lg font-bold text-gray-800", children: val }), /*#__PURE__*/ _jsx("p", { className: "text-[10px] text-gray-400 uppercase tracking-wide", children: t("dashboard.stats.".concat(key), key) }) ] }, key); }) }) ] }); } export default function DashboardPage() { var _session_user, _fomoData_topCategories; const { data: session, isPending } = useSession(); const router = useRouter(); const searchParams = useSearchParams(); const { t, locale } = useLocale(); const [tasks, setTasks] = useState([]); const [offers, setOffers] = useState([]); const [myReviews, setMyReviews] = useState([]); const [invitations, setInvitations] = useState([]); const [loading, setLoading] = useState(true); const [dashboard, setDashboard] = useState(null); const [fomoData, setFomoData] = useState(null); const [hasHelperCard, setHasHelperCard] = useState(null); useEffect(()=>{ if (!isPending && !session) router.push('/login'); }, [ session, isPending ]); // Apply pending referral code after Google OAuth redirect (?ref=CODE) useEffect(()=>{ if (!session) return; const refCode = searchParams.get('ref'); if (!refCode) return; applyMyReferral(refCode).catch(()=>{}); // Remove the ref param from the URL without reloading const params = new URLSearchParams(searchParams.toString()); params.delete('ref'); const newUrl = params.toString() ? "?".concat(params.toString()) : window.location.pathname; router.replace(newUrl); }, [ session ]); // Detect whether the user has completed their helper profile (has a card). // Used to show the getting-started onboarding card to users who haven't yet. useEffect(()=>{ if (!session) return; getMySpecialistCards().then((param)=>{ let { cards } = param; return setHasHelperCard(cards.length > 0); }).catch(()=>setHasHelperCard(null)); }, [ session ]); useEffect(()=>{ if (!session) return; Promise.all([ getMyTasks(), getMyOffers(), getMyReviews(), getNotifications(), getMyDashboard() ]).then((param)=>{ let [t, o, r, notifs, dash] = param; setTasks(t); setOffers(o); setMyReviews(r); setInvitations(notifs.filter((n)=>n.type === 'task_invite')); setDashboard(dash); }).catch(()=>{}).finally(()=>setLoading(false)); }, [ session ]); useEffect(()=>{ var _session_user; if (!session) return; const role = (_session_user = session.user) === null || _session_user === void 0 ? void 0 : _session_user.role; if (role === 'specialist') { getSpecialistFomoDashboard().then(setFomoData).catch(()=>{}); } else { getCustomerFomoDashboard().then(setFomoData).catch(()=>{}); } }, [ session ]); if (isPending || loading) return /*#__PURE__*/ _jsx("div", { className: "text-center py-20 text-white", children: t('common.loading') }); const dateLocale = locale === 'ru' ? 'ru-RU' : locale === 'uk' ? 'uk-UA' : locale === 'en' ? 'en-US' : 'el-GR'; const activeTasks = tasks.filter((task)=>task.status !== 'completed' && task.status !== 'cancelled'); const completedTasks = tasks.filter((task)=>task.status === 'completed' || task.status === 'cancelled'); const activeOffers = offers.filter((row)=>{ const offer = row.offer || row; const task = row.task; return offer.status !== 'other_accepted' && (task === null || task === void 0 ? void 0 : task.status) !== 'completed' && (task === null || task === void 0 ? void 0 : task.status) !== 'cancelled'; }); const completedOffers = offers.filter((row)=>{ const offer = row.offer || row; const task = row.task; return offer.status === 'other_accepted' || (task === null || task === void 0 ? void 0 : task.status) === 'completed' || (task === null || task === void 0 ? void 0 : task.status) === 'cancelled'; }); function TaskCard(param) { let { task } = param; var _task_offerCount; const offerCount = (_task_offerCount = task.offerCount) !== null && _task_offerCount !== void 0 ? _task_offerCount : 0; var _task_declinedCount; const declinedCount = (_task_declinedCount = task.declinedCount) !== null && _task_declinedCount !== void 0 ? _task_declinedCount : 0; const activeOfferCount = offerCount - declinedCount; return /*#__PURE__*/ _jsx(Link, { href: "/tasks/".concat(task.id), className: "block bg-white rounded-xl border border-gray-200 p-4 hover:shadow-sm hover:border-green-300 transition", children: /*#__PURE__*/ _jsxs("div", { className: "flex justify-between items-start", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ _jsx("p", { className: "font-medium text-gray-900 truncate", children: taskTitle(task, locale) }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-1", children: new Date(task.createdAt).toLocaleDateString(dateLocale) }), offerCount > 0 && /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 mt-1.5", children: [ /*#__PURE__*/ _jsxs("span", { className: "text-xs text-green-600 font-medium", children: [ "\uD83D\uDCBC ", offerCount, " ", t('dashboard.offers_count', 'offers') ] }), declinedCount > 0 && /*#__PURE__*/ _jsxs("span", { className: "text-xs text-red-400", children: [ "✕ ", declinedCount, " ", t('dashboard.declined_count', 'declined') ] }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "ml-3 text-right shrink-0", children: [ /*#__PURE__*/ _jsx("span", { className: "text-xs px-2 py-0.5 rounded-full ".concat(task.status === 'open' ? 'bg-green-100 text-green-700' : task.status === 'in_progress' ? 'bg-green-100 text-green-700' : task.status === 'completed' ? 'bg-gray-100 text-gray-600' : 'bg-red-100 text-red-600'), children: t("task.status.".concat(task.status), task.status) }), task.budget && /*#__PURE__*/ _jsxs("p", { className: "text-sm font-bold text-green-600 mt-1", children: [ formatPrice(task.budget), "€" ] }) ] }) ] }) }); } function OfferCard(param) { let { row } = param; var _myReviews_find; const offer = row.offer || row; const task = row.task; var _myReviews_find_review; const reviewReceived = (task === null || task === void 0 ? void 0 : task.status) === 'completed' && offer.status === 'accepted' ? (_myReviews_find_review = (_myReviews_find = myReviews.find((r)=>{ var _r_review; return ((_r_review = r.review) === null || _r_review === void 0 ? void 0 : _r_review.taskId) === (task === null || task === void 0 ? void 0 : task.id); })) === null || _myReviews_find === void 0 ? void 0 : _myReviews_find.review) !== null && _myReviews_find_review !== void 0 ? _myReviews_find_review : null : null; return /*#__PURE__*/ _jsxs(Link, { href: task ? "/tasks/".concat(task.id) : '#', className: "block bg-white rounded-xl border border-gray-200 p-4 hover:shadow-sm hover:border-green-300 transition", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex justify-between items-start", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ _jsx("p", { className: "font-medium text-gray-900 truncate", children: (task === null || task === void 0 ? void 0 : task.title) || t('chat.task_fallback') }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-1", children: new Date(offer.createdAt).toLocaleDateString(dateLocale) }) ] }), /*#__PURE__*/ _jsxs("div", { className: "ml-3 text-right shrink-0", children: [ /*#__PURE__*/ _jsxs("p", { className: "font-bold text-green-600", children: [ formatPrice(offer.price), "€" ] }), /*#__PURE__*/ _jsx("span", { className: "text-xs px-2 py-0.5 rounded-full mt-1 inline-block ".concat(offer.status === 'accepted' ? 'bg-green-100 text-green-700' : offer.status === 'declined' ? 'bg-red-100 text-red-700' : offer.status === 'other_accepted' ? 'bg-green-100 text-green-600' : 'bg-gray-100 text-gray-700'), children: t("offer.status.".concat(offer.status), offer.status) }) ] }) ] }), reviewReceived && /*#__PURE__*/ _jsxs("div", { className: "mt-3 pt-3 border-t border-gray-100 flex items-center gap-2", children: [ /*#__PURE__*/ _jsx("div", { className: "flex gap-0.5", children: [ 1, 2, 3, 4, 5 ].map((star)=>/*#__PURE__*/ _jsx("span", { className: "text-sm ".concat(star <= reviewReceived.rating ? 'text-yellow-400' : 'text-gray-200'), children: "★" }, star)) }), /*#__PURE__*/ _jsxs("span", { className: "text-sm font-semibold text-gray-700", children: [ reviewReceived.rating, "/5" ] }), reviewReceived.comment && /*#__PURE__*/ _jsx("span", { className: "text-xs text-gray-500 truncate", children: reviewReceived.comment }) ] }), (task === null || task === void 0 ? void 0 : task.status) === 'completed' && offer.status === 'accepted' && !reviewReceived && /*#__PURE__*/ _jsx("p", { className: "mt-2 text-xs text-gray-400", children: t('dashboard.review_pending') }) ] }); } const isSpecialist = (session === null || session === void 0 ? void 0 : (_session_user = session.user) === null || _session_user === void 0 ? void 0 : _session_user.role) === 'specialist'; var _fomoData_missedCount; return /*#__PURE__*/ _jsxs("div", { className: "max-w-5xl mx-auto px-4 py-8", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex justify-between items-center mb-8", children: [ /*#__PURE__*/ _jsx("h1", { className: "text-2xl font-bold text-white", children: t('dashboard.title') }), /*#__PURE__*/ _jsx(Link, { href: "/tasks/new", className: "bg-green-600 text-white px-4 py-2 rounded-lg text-sm font-medium hover:bg-green-700", children: t('dashboard.new_task') }) ] }), hasHelperCard === false && /*#__PURE__*/ _jsxs("div", { className: "mb-6 bg-white rounded-2xl border border-gray-200 overflow-hidden", children: [ /*#__PURE__*/ _jsxs("div", { className: "px-5 pt-5 pb-3", children: [ /*#__PURE__*/ _jsx("h2", { className: "text-lg font-bold text-gray-900", children: t('dashboard.onboarding.title') }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-500 mt-1", children: t('dashboard.onboarding.subtitle') }) ] }), /*#__PURE__*/ _jsxs("div", { className: "grid sm:grid-cols-2 gap-3 p-5 pt-2", children: [ /*#__PURE__*/ _jsxs(Link, { href: "/specialist-setup", className: "group flex flex-col rounded-xl border-2 border-green-500 bg-green-50 p-4 hover:bg-green-100 transition", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 mb-1", children: [ /*#__PURE__*/ _jsx("span", { className: "text-xl", children: "\uD83D\uDEE0" }), /*#__PURE__*/ _jsx("span", { className: "font-semibold text-gray-800", children: t('dashboard.onboarding.helper.title') }) ] }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-green-700/80 mb-3 flex-1", children: t('dashboard.onboarding.helper.desc') }), /*#__PURE__*/ _jsxs("span", { className: "inline-flex items-center gap-1 text-sm font-semibold text-green-700", children: [ t('dashboard.onboarding.helper.cta'), " →" ] }) ] }), /*#__PURE__*/ _jsxs(Link, { href: "/tasks/new", className: "group flex flex-col rounded-xl border border-gray-200 bg-gray-50 p-4 hover:bg-gray-100 transition", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 mb-1", children: [ /*#__PURE__*/ _jsx("span", { className: "text-xl", children: "\uD83D\uDCDD" }), /*#__PURE__*/ _jsx("span", { className: "font-semibold text-gray-800", children: t('dashboard.onboarding.requester.title') }) ] }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-500 mb-3 flex-1", children: t('dashboard.onboarding.requester.desc') }), /*#__PURE__*/ _jsxs("span", { className: "inline-flex items-center gap-1 text-sm font-semibold text-gray-700", children: [ t('dashboard.onboarding.requester.cta'), " →" ] }) ] }) ] }) ] }), dashboard && /*#__PURE__*/ _jsx(PlanBlock, { dashboard: dashboard, t: t }), fomoData && (isSpecialist ? (fomoData.missedCount > 0 || fomoData.missedEarnings > 0) && /*#__PURE__*/ _jsxs("div", { className: "mb-6 bg-amber-50 border border-amber-200 rounded-xl px-5 py-4 flex items-start gap-3", children: [ /*#__PURE__*/ _jsx("div", { className: "shrink-0 mt-0.5", children: /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5 text-amber-500", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 9v2m0 4h.01M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z" }) }) }), /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ _jsxs("p", { className: "text-base font-semibold text-amber-800", children: [ t('fomo.specialist_missed', 'You missed {n} tasks').replace('{n}', String((_fomoData_missedCount = fomoData.missedCount) !== null && _fomoData_missedCount !== void 0 ? _fomoData_missedCount : 0)), fomoData.missedEarnings > 0 && /*#__PURE__*/ _jsxs("span", { className: "ml-1 text-amber-600", children: [ "for €", fomoData.missedEarnings ] }) ] }), ((_fomoData_topCategories = fomoData.topCategories) === null || _fomoData_topCategories === void 0 ? void 0 : _fomoData_topCategories.length) > 0 && /*#__PURE__*/ _jsxs("p", { className: "text-sm text-amber-600 mt-0.5", children: [ t('fomo.top_categories', 'Categories'), ": ", fomoData.topCategories.slice(0, 3).join(', ') ] }) ] }), /*#__PURE__*/ _jsx(Link, { href: "/pricing", className: "shrink-0 text-xs font-medium text-amber-700 bg-amber-100 px-3 py-1.5 rounded-lg hover:bg-amber-200 transition", children: t('dashboard.plan.upgrade') }) ] }) : fomoData.totalTasks > 0 && /*#__PURE__*/ _jsx("div", { className: "mb-6 bg-green-50 border border-green-200 rounded-xl px-5 py-4", children: /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between gap-4 flex-wrap", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3", children: [ /*#__PURE__*/ _jsx("div", { className: "shrink-0 bg-green-100 rounded-xl p-2", children: /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5 text-green-600", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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" }) }) }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("p", { className: "text-base font-semibold text-gray-800", children: [ fomoData.totalOffers, " ", t('fomo.offers_received', 'offers received') ] }), fomoData.avgOffersPerTask > 0 && /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-500", children: t('fomo.avg_offers', 'Average {n}/task').replace('{n}', Number(fomoData.avgOffersPerTask).toFixed(1)) }) ] }) ] }), fomoData.completionRate !== undefined && /*#__PURE__*/ _jsxs("div", { className: "text-right", children: [ /*#__PURE__*/ _jsxs("p", { className: "text-2xl font-bold text-green-700", children: [ Math.round(fomoData.completionRate * 100), "%" ] }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-400", children: t('fomo.completion_rate', 'completed') }) ] }) ] }) })), isSpecialist && /*#__PURE__*/ _jsxs(Link, { href: "/tasks", className: "flex items-center justify-between gap-4 bg-green-600 text-white rounded-xl px-5 py-4 mb-8 hover:bg-green-700 transition", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-4", children: [ /*#__PURE__*/ _jsx("div", { className: "shrink-0 bg-white/20 rounded-xl p-2.5", children: /*#__PURE__*/ _jsxs("svg", { className: "w-6 h-6 text-white", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ _jsx("circle", { cx: "11", cy: "11", r: "7" }), /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M21 21l-4.35-4.35" }) ] }) }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "font-semibold text-base", children: t('find_tasks.title') }), /*#__PURE__*/ _jsx("p", { className: "text-green-100 text-sm mt-0.5", children: t('find_tasks.banner_hint') }) ] }) ] }), /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5 shrink-0 text-white/70", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 5l7 7-7 7" }) }) ] }), /*#__PURE__*/ _jsxs("div", { className: "grid md:grid-cols-2 gap-8", children: [ /*#__PURE__*/ _jsxs("div", { className: "space-y-8", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("h2", { className: "text-lg font-semibold text-white mb-4", children: [ t('dashboard.my_tasks'), " ", /*#__PURE__*/ _jsxs("span", { className: "text-white/60 font-normal text-base", children: [ "(", activeTasks.length, ")" ] }) ] }), activeTasks.length === 0 ? /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6 text-center text-gray-500", children: [ /*#__PURE__*/ _jsx("p", { children: t('dashboard.tasks.empty') }), /*#__PURE__*/ _jsx(Link, { href: "/tasks/new", className: "text-green-600 hover:underline text-sm mt-2 inline-block", children: t('dashboard.tasks.empty.cta') }) ] }) : /*#__PURE__*/ _jsx("div", { className: "space-y-3", children: activeTasks.map((task)=>/*#__PURE__*/ _jsx(TaskCard, { task: task }, task.id)) }) ] }), completedTasks.length > 0 && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("h2", { className: "text-lg font-semibold text-white/70 mb-4", children: [ t('dashboard.completed_tasks'), " ", /*#__PURE__*/ _jsxs("span", { className: "font-normal text-base text-white/50", children: [ "(", completedTasks.length, ")" ] }) ] }), /*#__PURE__*/ _jsx("div", { className: "space-y-3 opacity-75", children: completedTasks.map((task)=>/*#__PURE__*/ _jsx(TaskCard, { task: task }, task.id)) }) ] }) ] }), /*#__PURE__*/ _jsx("div", { className: "space-y-8", children: isSpecialist ? /*#__PURE__*/ _jsxs(_Fragment, { children: [ invitations.length > 0 && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("h2", { className: "text-lg font-semibold text-white mb-4", children: [ t('dashboard.invitations'), " ", /*#__PURE__*/ _jsxs("span", { className: "text-white/60 font-normal text-base", children: [ "(", invitations.length, ")" ] }) ] }), /*#__PURE__*/ _jsx("div", { className: "space-y-3", children: invitations.map((inv)=>/*#__PURE__*/ _jsxs(Link, { href: inv.referenceId ? "/tasks/".concat(inv.referenceId) : '/tasks', className: "flex items-start gap-3 p-4 rounded-xl border transition cursor-pointer ".concat(inv.isRead ? 'bg-white/90 border-white/20 hover:bg-white' : 'bg-white border-amber-300 shadow-sm hover:bg-amber-50'), children: [ /*#__PURE__*/ _jsx("span", { className: "text-2xl", children: "\uD83D\uDCCB" }), /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ _jsx("p", { className: "font-medium truncate ".concat(inv.isRead ? 'text-gray-600' : 'text-gray-900'), children: t('notif.type.task_invite', inv.title) }), inv.body && /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-500 mt-0.5 truncate", children: (()=>{ const title = extractNotifParam(inv.body); const tpl = t('notif.body.task_invite', ''); return title && tpl ? tpl.replace('{title}', title) : inv.body; })() }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-1", children: new Date(inv.createdAt).toLocaleDateString(dateLocale) }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex flex-col items-end gap-1.5 shrink-0", children: [ !inv.isRead && /*#__PURE__*/ _jsx("span", { className: "w-2 h-2 bg-amber-400 rounded-full mt-2" }), /*#__PURE__*/ _jsx("span", { className: "text-xs text-gray-400", children: "→" }) ] }) ] }, inv.id)) }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("h2", { className: "text-lg font-semibold text-white mb-4", children: [ t('dashboard.my_offers'), " ", /*#__PURE__*/ _jsxs("span", { className: "text-white/60 font-normal text-base", children: [ "(", activeOffers.length, ")" ] }) ] }), activeOffers.length === 0 ? /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6 text-center text-gray-500", children: [ /*#__PURE__*/ _jsx("p", { children: t('dashboard.offers.empty') }), /*#__PURE__*/ _jsx(Link, { href: "/tasks", className: "text-green-600 hover:underline text-sm mt-2 inline-block", children: t('dashboard.offers.empty.cta') }) ] }) : /*#__PURE__*/ _jsx("div", { className: "space-y-3", children: activeOffers.map((row)=>/*#__PURE__*/ _jsx(OfferCard, { row: row }, (row.offer || row).id)) }) ] }), completedOffers.length > 0 && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("h2", { className: "text-lg font-semibold text-white/70 mb-4", children: [ t('dashboard.completed_offers'), " ", /*#__PURE__*/ _jsxs("span", { className: "font-normal text-base text-white/50", children: [ "(", completedOffers.length, ")" ] }) ] }), /*#__PURE__*/ _jsx("div", { className: "space-y-3 opacity-75", children: completedOffers.map((row)=>/*#__PURE__*/ _jsx(OfferCard, { row: row }, (row.offer || row).id)) }) ] }) ] }) : /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs(Link, { href: "/specialists", className: "flex items-center justify-between gap-4 bg-green-600 text-white rounded-xl px-5 py-4 hover:bg-green-700 transition", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-4", children: [ /*#__PURE__*/ _jsx("div", { className: "shrink-0 bg-white/20 rounded-xl p-2.5", children: /*#__PURE__*/ _jsx("svg", { className: "w-6 h-6 text-white", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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" }) }) }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "font-semibold text-base", children: t('dashboard.customer.specialists_title') }), /*#__PURE__*/ _jsx("p", { className: "text-green-100 text-sm mt-0.5", children: t('dashboard.customer.specialists_hint') }) ] }) ] }), /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5 shrink-0 text-white/70", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 5l7 7-7 7" }) }) ] }), /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-5", children: [ /*#__PURE__*/ _jsx("h2", { className: "text-base font-semibold text-gray-800 mb-4", children: t('dashboard.customer.how_title') }), /*#__PURE__*/ _jsx("div", { className: "space-y-3", children: [ { num: '1', text: t('dashboard.customer.step1'), icon: 'M12 4v16m8-8H4' }, { num: '2', text: t('dashboard.customer.step2'), icon: 'M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z' }, { num: '3', text: t('dashboard.customer.step3'), icon: 'M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z' } ].map((param)=>{ let { num, text, icon } = param; return /*#__PURE__*/ _jsxs("div", { className: "flex items-start gap-3", children: [ /*#__PURE__*/ _jsx("span", { className: "shrink-0 w-7 h-7 rounded-full bg-green-100 text-green-600 text-sm font-bold flex items-center justify-center", children: num }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-600 pt-1", children: text }) ] }, num); }) }), /*#__PURE__*/ _jsxs(Link, { href: "/tasks/new", className: "mt-4 inline-block text-sm font-medium text-green-600 hover:underline", children: [ tasks.length > 0 ? t('dashboard.tasks.add_new') : t('dashboard.tasks.empty.cta'), " →" ] }) ] }) ] }) }) ] }) ] }); } @Ü`=_’”¿ÁýÿDFrt46oq£¥Ùó÷{ š«§ª¬ŽD _G X [ ] ` Þ â N R   ß ã LOÏÒy}óöæéëô "+‚…Y_] ÚÝ#1НÇÏíû"ELsz§®ßæELy€·ŸË_Ó™¡,4<j}> F Ž — š ² Ã Î ß î ÿ !t"|"f##Á#Ø#[$^$“*–*˜*_›*r+v+þ+,,“,--y-|-Œ..F/J/t1x1Ý3á3y4|4e6i67 7;;; ;<<®<_²<L=O=>„>Ä?È?l@p@A&AÚAÝAIDMDûDþDNFQF‚G†GÞHáHUJXJL LuLyLM MÉM_ÌMÎMÑM$O(OÐOÔObPePQQTQfRjR SSSSHTLTUU!V$VžW¡WžXŒX¶ZºZŒZ¿Zæ[_ê[¶\¹\Ÿ]Á]>_A_W`[`Šb©bvczc6d9dªd­déeìeegig÷gûg¿iÃillúmýmÿmnfo_ioøoüo¡p¥pHqKqéqìqpsss¢uŠuvvExHx:z>zÔzØz\|_|Å}É}Ë}Î}Ç~Ë~beü_€’•€‚§‚=„A„ª„­„Š…©…‡‡?ˆBˆS‰W‰Ø‰Ü‰eŠiŠÒŠÖŠ Œ$Œ‡Ž‹Žƒ†NQS_Vÿ‘’¥’š’Ú“Þ“G”K”Ÿ•£•î—ñ—¢˜¥˜ã™æ™`šdšfšnšãšçšX›\›œœÁœ1Ÿ4ŸÞŸâŸäŸ_çŸò¡õ¡+£/£)€,€ç¥ê¥ ©© ««3¬6¬L­O­æ¯ê¯[°_°Ÿ±Â±OŽSŽWµZµ/¶2¶4¶7¶õ·_ø·£žŠžþ¹ºsºwºà»ä»XŸ[Ÿ¿¿kÀoÀqÀyÀÔÀØÀÚÀÝÀ'Â+ÂþÂÃÀÃÃãŊÅJÈNÈßÈVâÈ?ÊBÊVÌYÌýÍαϵχЊгѶÑY×]×GØJØÙÙÜÙÐÛÔÛÖÛÙۀ€€€€€€€€€Í__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._ÿÿË__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._ÿÒ__WEBPACK_MODULE_REFERENCE__8_5b22506c616e4261646765225d_directImport_asiSafe1__._þþÎ__WEBPACK_MODULE_REFERENCE__3_5b2264656661756c74225d_directImport_asiSafe1__._üüýüýýüýýÔ__WEBPACK_MODULE_REFERENCE__9_5b2255736167654d65746572225d_directImport_asiSafe1__._üÿüûüü€Ù__WEBPACK_MODULE_REFERENCE__4_5b2275736553657373696f6e225d_call_directImport_asiSafe1__._×__WEBPACK_MODULE_REFERENCE__2_5b22757365526f75746572225d_call_directImport_asiSafe1__._ã__WEBPACK_MODULE_REFERENCE__2_5b22757365536561726368506172616d73225d_call_directImport_asiSafe1__._×__WEBPACK_MODULE_REFERENCE__5_5b227573654c6f63616c65225d_call_directImport_asiSafe1__._Õ__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._ÿÿÿÿÿÿÿ×__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._ÿã__WEBPACK_MODULE_REFERENCE__6_5b226170706c794d79526566657272616c225d_call_directImport_asiSafe1__._þí__WEBPACK_MODULE_REFERENCE__6_5b226765744d795370656369616c6973744361726473225d_call_directImport_asiSafe1__._ýÙ__WEBPACK_MODULE_REFERENCE__6_5b226765744d795461736b73225d_call_directImport_asiSafe1__._Û__WEBPACK_MODULE_REFERENCE__6_5b226765744d794f6666657273225d_call_directImport_asiSafe1__._Ý__WEBPACK_MODULE_REFERENCE__6_5b226765744d7952657669657773225d_call_directImport_asiSafe1__._å__WEBPACK_MODULE_REFERENCE__6_5b226765744e6f74696669636174696f6e73225d_call_directImport_asiSafe1__._á__WEBPACK_MODULE_REFERENCE__6_5b226765744d7944617368626f617264225d_call_directImport_asiSafe1__._øù__WEBPACK_MODULE_REFERENCE__6_5b226765745370656369616c697374466f6d6f44617368626f617264225d_call_directImport_asiSafe1__._õ__WEBPACK_MODULE_REFERENCE__6_5b22676574437573746f6d6572466f6d6f44617368626f617264225d_call_directImport_asiSafe1__._ííïììí×__WEBPACK_MODULE_REFERENCE__7_5b227461736b5469746c65225d_call_directImport_asiSafe1__._ìëëëëìëÛ__WEBPACK_MODULE_REFERENCE__7_5b22666f726d61745072696365225d_call_directImport_asiSafe1__._êíêêëëêêÿëêëëêëëêêëëíêêëëêêíêëëëêêíêëëëêëêëëëêêêêëíëêêëëëêêëêêëêíêëêëëêëëëëêêêêêêëëíëëêêêëëëêÐ__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._éééêéìêéêêêéêêééééêêìêêéééêêéÿéìéêêêéêêêêéêêéêêéìí«/* __next_internal_client_entry_do_not_use__ default auto */ /** Extract the quoted task title from a stored notification body (any locale) */ function extractNotifParam(body) { if (!body) return null; const m = body.match(/[«""](.+?)[»""]/); var _m_; return (_m_ = m === null || m === void 0 ? void 0 : m[1]) !== null && _m_ !== void 0 ? _m_ : null; } function PlanBlock(param) { let { dashboard, t } = param; const plan = dashboard.plan; const expiry = dashboard.planExpiration; const usage = dashboard.usage; const stats = dashboard.stats; const expiryPct = expiry ? Math.max(0, Math.min(100, Math.round(expiry.daysLeft / 30 * 100))) : 100; const expiryColor = expiry ? expiry.daysLeft <= 3 ? 'bg-red-500' : expiry.daysLeft <= 7 ? 'bg-amber-400' : 'bg-green-400' : 'bg-green-400'; return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "bg-white rounded-2xl border border-gray-200 p-5 mb-6", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "flex items-center justify-between mb-4", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "flex items-center gap-2", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("h2", { className: "font-semibold text-gray-800 text-sm", children: t('dashboard.plan.title', 'My Plan') }), plan ? /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__8_5b22506c616e4261646765225d_directImport_asiSafe1__._, { tier: plan.tier, size: "sm" }) : /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { className: "text-xs text-gray-400", children: t('dashboard.plan.no_plan', 'Free') }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__3_5b2264656661756c74225d_directImport_asiSafe1__._, { href: "/pricing", className: "text-xs font-medium text-green-600 hover:underline", children: (plan === null || plan === void 0 ? void 0 : plan.tier) === 'ultimate' ? null : t('dashboard.plan.upgrade', 'Upgrade') }) ] }), expiry && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "mb-4", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "flex justify-between text-xs text-gray-500 mb-1", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { children: t('dashboard.plan.expires', 'Expires in {n} days').replace('{n}', String(expiry.daysLeft)) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("span", { children: [ expiry.daysLeft, " ", t('pricing.days', 'days') ] }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "h-1.5 rounded-full bg-gray-100", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "h-full rounded-full transition-all ".concat(expiryColor), style: { width: "".concat(expiryPct, "%") } }) }) ] }), (usage.messagesSent !== undefined || usage.ordersMade !== undefined) && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "space-y-2 mb-4", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { className: "text-xs font-medium text-gray-500 uppercase tracking-wide", children: t('dashboard.plan.limits', 'Daily limits') }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__9_5b2255736167654d65746572225d_directImport_asiSafe1__._, { current: usage.messagesSent, limit: usage.messagesLeft !== null ? usage.messagesSent + usage.messagesLeft : null, label: t('dashboard.plan.messages', 'Messages') }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__9_5b2255736167654d65746572225d_directImport_asiSafe1__._, { current: usage.ordersMade, limit: usage.ordersLeft !== null ? usage.ordersMade + usage.ordersLeft : null, label: t('dashboard.plan.orders', 'Orders') }) ] }), Object.keys(stats).length > 0 && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "grid grid-cols-2 gap-2", children: Object.entries(stats).map((param)=>{ let [key, val] = param; return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "bg-gray-50 rounded-xl px-3 py-2 text-center", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { className: "text-lg font-bold text-gray-800", children: val }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { className: "text-[10px] text-gray-400 uppercase tracking-wide", children: t("dashboard.stats.".concat(key), key) }) ] }, key); }) }) ] }); } function DashboardPage() { var _session_user, _fomoData_topCategories; const { data: session, isPending } = __WEBPACK_MODULE_REFERENCE__4_5b2275736553657373696f6e225d_call_directImport_asiSafe1__._(); const router = __WEBPACK_MODULE_REFERENCE__2_5b22757365526f75746572225d_call_directImport_asiSafe1__._(); const searchParams = __WEBPACK_MODULE_REFERENCE__2_5b22757365536561726368506172616d73225d_call_directImport_asiSafe1__._(); const { t, locale } = __WEBPACK_MODULE_REFERENCE__5_5b227573654c6f63616c65225d_call_directImport_asiSafe1__._(); const [tasks, setTasks] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._([]); const [offers, setOffers] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._([]); const [myReviews, setMyReviews] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._([]); const [invitations, setInvitations] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._([]); const [loading, setLoading] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._(true); const [dashboard, setDashboard] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._(null); const [fomoData, setFomoData] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._(null); const [hasHelperCard, setHasHelperCard] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._(null); __WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._(()=>{ if (!isPending && !session) router.push('/login'); }, [ session, isPending ]); // Apply pending referral code after Google OAuth redirect (?ref=CODE) __WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._(()=>{ if (!session) return; const refCode = searchParams.get('ref'); if (!refCode) return; __WEBPACK_MODULE_REFERENCE__6_5b226170706c794d79526566657272616c225d_call_directImport_asiSafe1__._(refCode).catch(()=>{}); // Remove the ref param from the URL without reloading const params = new URLSearchParams(searchParams.toString()); params.delete('ref'); const newUrl = params.toString() ? "?".concat(params.toString()) : window.location.pathname; router.replace(newUrl); }, [ session ]); // Detect whether the user has completed their helper profile (has a card). // Used to show the getting-started onboarding card to users who haven't yet. __WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._(()=>{ if (!session) return; __WEBPACK_MODULE_REFERENCE__6_5b226765744d795370656369616c6973744361726473225d_call_directImport_asiSafe1__._().then((param)=>{ let { cards } = param; return setHasHelperCard(cards.length > 0); }).catch(()=>setHasHelperCard(null)); }, [ session ]); __WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._(()=>{ if (!session) return; Promise.all([ __WEBPACK_MODULE_REFERENCE__6_5b226765744d795461736b73225d_call_directImport_asiSafe1__._(), __WEBPACK_MODULE_REFERENCE__6_5b226765744d794f6666657273225d_call_directImport_asiSafe1__._(), __WEBPACK_MODULE_REFERENCE__6_5b226765744d7952657669657773225d_call_directImport_asiSafe1__._(), __WEBPACK_MODULE_REFERENCE__6_5b226765744e6f74696669636174696f6e73225d_call_directImport_asiSafe1__._(), __WEBPACK_MODULE_REFERENCE__6_5b226765744d7944617368626f617264225d_call_directImport_asiSafe1__._() ]).then((param)=>{ let [t, o, r, notifs, dash] = param; setTasks(t); setOffers(o); setMyReviews(r); setInvitations(notifs.filter((n)=>n.type === 'task_invite')); setDashboard(dash); }).catch(()=>{}).finally(()=>setLoading(false)); }, [ session ]); __WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._(()=>{ var _session_user; if (!session) return; const role = (_session_user = session.user) === null || _session_user === void 0 ? void 0 : _session_user.role; if (role === 'specialist') { __WEBPACK_MODULE_REFERENCE__6_5b226765745370656369616c697374466f6d6f44617368626f617264225d_call_directImport_asiSafe1__._().then(setFomoData).catch(()=>{}); } else { __WEBPACK_MODULE_REFERENCE__6_5b22676574437573746f6d6572466f6d6f44617368626f617264225d_call_directImport_asiSafe1__._().then(setFomoData).catch(()=>{}); } }, [ session ]); if (isPending || loading) return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "text-center py-20 text-white", children: t('common.loading') }); const dateLocale = locale === 'ru' ? 'ru-RU' : locale === 'uk' ? 'uk-UA' : locale === 'en' ? 'en-US' : 'el-GR'; const activeTasks = tasks.filter((task)=>task.status !== 'completed' && task.status !== 'cancelled'); const completedTasks = tasks.filter((task)=>task.status === 'completed' || task.status === 'cancelled'); const activeOffers = offers.filter((row)=>{ const offer = row.offer || row; const task = row.task; return offer.status !== 'other_accepted' && (task === null || task === void 0 ? void 0 : task.status) !== 'completed' && (task === null || task === void 0 ? void 0 : task.status) !== 'cancelled'; }); const completedOffers = offers.filter((row)=>{ const offer = row.offer || row; const task = row.task; return offer.status === 'other_accepted' || (task === null || task === void 0 ? void 0 : task.status) === 'completed' || (task === null || task === void 0 ? void 0 : task.status) === 'cancelled'; }); function TaskCard(param) { let { task } = param; var _task_offerCount; const offerCount = (_task_offerCount = task.offerCount) !== null && _task_offerCount !== void 0 ? _task_offerCount : 0; var _task_declinedCount; const declinedCount = (_task_declinedCount = task.declinedCount) !== null && _task_declinedCount !== void 0 ? _task_declinedCount : 0; const activeOfferCount = offerCount - declinedCount; return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__3_5b2264656661756c74225d_directImport_asiSafe1__._, { href: "/tasks/".concat(task.id), className: "block bg-white rounded-xl border border-gray-200 p-4 hover:shadow-sm hover:border-green-300 transition", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "flex justify-between items-start", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { className: "font-medium text-gray-900 truncate", children: __WEBPACK_MODULE_REFERENCE__7_5b227461736b5469746c65225d_call_directImport_asiSafe1__._(task, locale) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { className: "text-xs text-gray-400 mt-1", children: new Date(task.createdAt).toLocaleDateString(dateLocale) }), offerCount > 0 && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "flex items-center gap-2 mt-1.5", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("span", { className: "text-xs text-green-600 font-medium", children: [ "\uD83D\uDCBC ", offerCount, " ", t('dashboard.offers_count', 'offers') ] }), declinedCount > 0 && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("span", { className: "text-xs text-red-400", children: [ "✕ ", declinedCount, " ", t('dashboard.declined_count', 'declined') ] }) ] }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "ml-3 text-right shrink-0", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { className: "text-xs px-2 py-0.5 rounded-full ".concat(task.status === 'open' ? 'bg-green-100 text-green-700' : task.status === 'in_progress' ? 'bg-green-100 text-green-700' : task.status === 'completed' ? 'bg-gray-100 text-gray-600' : 'bg-red-100 text-red-600'), children: t("task.status.".concat(task.status), task.status) }), task.budget && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("p", { className: "text-sm font-bold text-green-600 mt-1", children: [ __WEBPACK_MODULE_REFERENCE__7_5b22666f726d61745072696365225d_call_directImport_asiSafe1__._(task.budget), "€" ] }) ] }) ] }) }); } function OfferCard(param) { let { row } = param; var _myReviews_find; const offer = row.offer || row; const task = row.task; var _myReviews_find_review; const reviewReceived = (task === null || task === void 0 ? void 0 : task.status) === 'completed' && offer.status === 'accepted' ? (_myReviews_find_review = (_myReviews_find = myReviews.find((r)=>{ var _r_review; return ((_r_review = r.review) === null || _r_review === void 0 ? void 0 : _r_review.taskId) === (task === null || task === void 0 ? void 0 : task.id); })) === null || _myReviews_find === void 0 ? void 0 : _myReviews_find.review) !== null && _myReviews_find_review !== void 0 ? _myReviews_find_review : null : null; return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__3_5b2264656661756c74225d_directImport_asiSafe1__._, { href: task ? "/tasks/".concat(task.id) : '#', className: "block bg-white rounded-xl border border-gray-200 p-4 hover:shadow-sm hover:border-green-300 transition", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "flex justify-between items-start", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { className: "font-medium text-gray-900 truncate", children: (task === null || task === void 0 ? void 0 : task.title) || t('chat.task_fallback') }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { className: "text-xs text-gray-400 mt-1", children: new Date(offer.createdAt).toLocaleDateString(dateLocale) }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "ml-3 text-right shrink-0", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("p", { className: "font-bold text-green-600", children: [ __WEBPACK_MODULE_REFERENCE__7_5b22666f726d61745072696365225d_call_directImport_asiSafe1__._(offer.price), "€" ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { className: "text-xs px-2 py-0.5 rounded-full mt-1 inline-block ".concat(offer.status === 'accepted' ? 'bg-green-100 text-green-700' : offer.status === 'declined' ? 'bg-red-100 text-red-700' : offer.status === 'other_accepted' ? 'bg-green-100 text-green-600' : 'bg-gray-100 text-gray-700'), children: t("offer.status.".concat(offer.status), offer.status) }) ] }) ] }), reviewReceived && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "mt-3 pt-3 border-t border-gray-100 flex items-center gap-2", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "flex gap-0.5", children: [ 1, 2, 3, 4, 5 ].map((star)=>/*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { className: "text-sm ".concat(star <= reviewReceived.rating ? 'text-yellow-400' : 'text-gray-200'), children: "★" }, star)) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("span", { className: "text-sm font-semibold text-gray-700", children: [ reviewReceived.rating, "/5" ] }), reviewReceived.comment && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { className: "text-xs text-gray-500 truncate", children: reviewReceived.comment }) ] }), (task === null || task === void 0 ? void 0 : task.status) === 'completed' && offer.status === 'accepted' && !reviewReceived && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { className: "mt-2 text-xs text-gray-400", children: t('dashboard.review_pending') }) ] }); } const isSpecialist = (session === null || session === void 0 ? void 0 : (_session_user = session.user) === null || _session_user === void 0 ? void 0 : _session_user.role) === 'specialist'; var _fomoData_missedCount; return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "max-w-5xl mx-auto px-4 py-8", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "flex justify-between items-center mb-8", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("h1", { className: "text-2xl font-bold text-white", children: t('dashboard.title') }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__3_5b2264656661756c74225d_directImport_asiSafe1__._, { href: "/tasks/new", className: "bg-green-600 text-white px-4 py-2 rounded-lg text-sm font-medium hover:bg-green-700", children: t('dashboard.new_task') }) ] }), hasHelperCard === false && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "mb-6 bg-white rounded-2xl border border-gray-200 overflow-hidden", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "px-5 pt-5 pb-3", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("h2", { className: "text-lg font-bold text-gray-900", children: t('dashboard.onboarding.title') }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { className: "text-sm text-gray-500 mt-1", children: t('dashboard.onboarding.subtitle') }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "grid sm:grid-cols-2 gap-3 p-5 pt-2", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__3_5b2264656661756c74225d_directImport_asiSafe1__._, { href: "/specialist-setup", className: "group flex flex-col rounded-xl border-2 border-green-500 bg-green-50 p-4 hover:bg-green-100 transition", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "flex items-center gap-2 mb-1", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { className: "text-xl", children: "\uD83D\uDEE0" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { className: "font-semibold text-gray-800", children: t('dashboard.onboarding.helper.title') }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { className: "text-sm text-green-700/80 mb-3 flex-1", children: t('dashboard.onboarding.helper.desc') }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("span", { className: "inline-flex items-center gap-1 text-sm font-semibold text-green-700", children: [ t('dashboard.onboarding.helper.cta'), " →" ] }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__3_5b2264656661756c74225d_directImport_asiSafe1__._, { href: "/tasks/new", className: "group flex flex-col rounded-xl border border-gray-200 bg-gray-50 p-4 hover:bg-gray-100 transition", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "flex items-center gap-2 mb-1", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { className: "text-xl", children: "\uD83D\uDCDD" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { className: "font-semibold text-gray-800", children: t('dashboard.onboarding.requester.title') }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { className: "text-sm text-gray-500 mb-3 flex-1", children: t('dashboard.onboarding.requester.desc') }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("span", { className: "inline-flex items-center gap-1 text-sm font-semibold text-gray-700", children: [ t('dashboard.onboarding.requester.cta'), " →" ] }) ] }) ] }) ] }), dashboard && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(PlanBlock, { dashboard: dashboard, t: t }), fomoData && (isSpecialist ? (fomoData.missedCount > 0 || fomoData.missedEarnings > 0) && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "mb-6 bg-amber-50 border border-amber-200 rounded-xl px-5 py-4 flex items-start gap-3", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "shrink-0 mt-0.5", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("svg", { className: "w-5 h-5 text-amber-500", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 9v2m0 4h.01M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z" }) }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("p", { className: "text-base font-semibold text-amber-800", children: [ t('fomo.specialist_missed', 'You missed {n} tasks').replace('{n}', String((_fomoData_missedCount = fomoData.missedCount) !== null && _fomoData_missedCount !== void 0 ? _fomoData_missedCount : 0)), fomoData.missedEarnings > 0 && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("span", { className: "ml-1 text-amber-600", children: [ "for €", fomoData.missedEarnings ] }) ] }), ((_fomoData_topCategories = fomoData.topCategories) === null || _fomoData_topCategories === void 0 ? void 0 : _fomoData_topCategories.length) > 0 && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("p", { className: "text-sm text-amber-600 mt-0.5", children: [ t('fomo.top_categories', 'Categories'), ": ", fomoData.topCategories.slice(0, 3).join(', ') ] }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__3_5b2264656661756c74225d_directImport_asiSafe1__._, { href: "/pricing", className: "shrink-0 text-xs font-medium text-amber-700 bg-amber-100 px-3 py-1.5 rounded-lg hover:bg-amber-200 transition", children: t('dashboard.plan.upgrade') }) ] }) : fomoData.totalTasks > 0 && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "mb-6 bg-green-50 border border-green-200 rounded-xl px-5 py-4", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "flex items-center justify-between gap-4 flex-wrap", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "flex items-center gap-3", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "shrink-0 bg-green-100 rounded-xl p-2", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("svg", { className: "w-5 h-5 text-green-600", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("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" }) }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("p", { className: "text-base font-semibold text-gray-800", children: [ fomoData.totalOffers, " ", t('fomo.offers_received', 'offers received') ] }), fomoData.avgOffersPerTask > 0 && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { className: "text-sm text-gray-500", children: t('fomo.avg_offers', 'Average {n}/task').replace('{n}', Number(fomoData.avgOffersPerTask).toFixed(1)) }) ] }) ] }), fomoData.completionRate !== undefined && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "text-right", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("p", { className: "text-2xl font-bold text-green-700", children: [ Math.round(fomoData.completionRate * 100), "%" ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { className: "text-sm text-gray-400", children: t('fomo.completion_rate', 'completed') }) ] }) ] }) })), isSpecialist && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__3_5b2264656661756c74225d_directImport_asiSafe1__._, { href: "/tasks", className: "flex items-center justify-between gap-4 bg-green-600 text-white rounded-xl px-5 py-4 mb-8 hover:bg-green-700 transition", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "flex items-center gap-4", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "shrink-0 bg-white/20 rounded-xl p-2.5", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("svg", { className: "w-6 h-6 text-white", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("circle", { cx: "11", cy: "11", r: "7" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M21 21l-4.35-4.35" }) ] }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { className: "font-semibold text-base", children: t('find_tasks.title') }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { className: "text-green-100 text-sm mt-0.5", children: t('find_tasks.banner_hint') }) ] }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("svg", { className: "w-5 h-5 shrink-0 text-white/70", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 5l7 7-7 7" }) }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "grid md:grid-cols-2 gap-8", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "space-y-8", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("h2", { className: "text-lg font-semibold text-white mb-4", children: [ t('dashboard.my_tasks'), " ", /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("span", { className: "text-white/60 font-normal text-base", children: [ "(", activeTasks.length, ")" ] }) ] }), activeTasks.length === 0 ? /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "bg-white rounded-xl border border-gray-200 p-6 text-center text-gray-500", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { children: t('dashboard.tasks.empty') }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__3_5b2264656661756c74225d_directImport_asiSafe1__._, { href: "/tasks/new", className: "text-green-600 hover:underline text-sm mt-2 inline-block", children: t('dashboard.tasks.empty.cta') }) ] }) : /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "space-y-3", children: activeTasks.map((task)=>/*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(TaskCard, { task: task }, task.id)) }) ] }), completedTasks.length > 0 && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("h2", { className: "text-lg font-semibold text-white/70 mb-4", children: [ t('dashboard.completed_tasks'), " ", /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("span", { className: "font-normal text-base text-white/50", children: [ "(", completedTasks.length, ")" ] }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "space-y-3 opacity-75", children: completedTasks.map((task)=>/*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(TaskCard, { task: task }, task.id)) }) ] }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "space-y-8", children: isSpecialist ? /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._, { children: [ invitations.length > 0 && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("h2", { className: "text-lg font-semibold text-white mb-4", children: [ t('dashboard.invitations'), " ", /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("span", { className: "text-white/60 font-normal text-base", children: [ "(", invitations.length, ")" ] }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "space-y-3", children: invitations.map((inv)=>/*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__3_5b2264656661756c74225d_directImport_asiSafe1__._, { href: inv.referenceId ? "/tasks/".concat(inv.referenceId) : '/tasks', className: "flex items-start gap-3 p-4 rounded-xl border transition cursor-pointer ".concat(inv.isRead ? 'bg-white/90 border-white/20 hover:bg-white' : 'bg-white border-amber-300 shadow-sm hover:bg-amber-50'), children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { className: "text-2xl", children: "\uD83D\uDCCB" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { className: "font-medium truncate ".concat(inv.isRead ? 'text-gray-600' : 'text-gray-900'), children: t('notif.type.task_invite', inv.title) }), inv.body && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { className: "text-sm text-gray-500 mt-0.5 truncate", children: (()=>{ const title = extractNotifParam(inv.body); const tpl = t('notif.body.task_invite', ''); return title && tpl ? tpl.replace('{title}', title) : inv.body; })() }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { className: "text-xs text-gray-400 mt-1", children: new Date(inv.createdAt).toLocaleDateString(dateLocale) }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "flex flex-col items-end gap-1.5 shrink-0", children: [ !inv.isRead && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { className: "w-2 h-2 bg-amber-400 rounded-full mt-2" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { className: "text-xs text-gray-400", children: "→" }) ] }) ] }, inv.id)) }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("h2", { className: "text-lg font-semibold text-white mb-4", children: [ t('dashboard.my_offers'), " ", /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("span", { className: "text-white/60 font-normal text-base", children: [ "(", activeOffers.length, ")" ] }) ] }), activeOffers.length === 0 ? /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "bg-white rounded-xl border border-gray-200 p-6 text-center text-gray-500", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { children: t('dashboard.offers.empty') }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__3_5b2264656661756c74225d_directImport_asiSafe1__._, { href: "/tasks", className: "text-green-600 hover:underline text-sm mt-2 inline-block", children: t('dashboard.offers.empty.cta') }) ] }) : /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "space-y-3", children: activeOffers.map((row)=>/*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(OfferCard, { row: row }, (row.offer || row).id)) }) ] }), completedOffers.length > 0 && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("h2", { className: "text-lg font-semibold text-white/70 mb-4", children: [ t('dashboard.completed_offers'), " ", /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("span", { className: "font-normal text-base text-white/50", children: [ "(", completedOffers.length, ")" ] }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "space-y-3 opacity-75", children: completedOffers.map((row)=>/*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(OfferCard, { row: row }, (row.offer || row).id)) }) ] }) ] }) : /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._, { children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__3_5b2264656661756c74225d_directImport_asiSafe1__._, { href: "/specialists", className: "flex items-center justify-between gap-4 bg-green-600 text-white rounded-xl px-5 py-4 hover:bg-green-700 transition", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "flex items-center gap-4", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "shrink-0 bg-white/20 rounded-xl p-2.5", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("svg", { className: "w-6 h-6 text-white", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("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" }) }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { className: "font-semibold text-base", children: t('dashboard.customer.specialists_title') }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { className: "text-green-100 text-sm mt-0.5", children: t('dashboard.customer.specialists_hint') }) ] }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("svg", { className: "w-5 h-5 shrink-0 text-white/70", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 5l7 7-7 7" }) }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "bg-white rounded-xl border border-gray-200 p-5", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("h2", { className: "text-base font-semibold text-gray-800 mb-4", children: t('dashboard.customer.how_title') }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "space-y-3", children: [ { num: '1', text: t('dashboard.customer.step1'), icon: 'M12 4v16m8-8H4' }, { num: '2', text: t('dashboard.customer.step2'), icon: 'M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z' }, { num: '3', text: t('dashboard.customer.step3'), icon: 'M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z' } ].map((param)=>{ let { num, text, icon } = param; return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "flex items-start gap-3", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { className: "shrink-0 w-7 h-7 rounded-full bg-green-100 text-green-600 text-sm font-bold flex items-center justify-center", children: num }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { className: "text-sm text-gray-600 pt-1", children: text }) ] }, num); }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__3_5b2264656661756c74225d_directImport_asiSafe1__._, { href: "/tasks/new", className: "mt-4 inline-block text-sm font-medium text-green-600 hover:underline", children: [ tasks.length > 0 ? t('dashboard.tasks.add_new') : t('dashboard.tasks.empty.cta'), " →" ] }) ] }) ] }) }) ] }) ] }); } îñ òÉÞ/* __next_internal_client_entry_do_not_use__ default auto */ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime"; import { useEffect, useState } from 'react'; import { useRouter, useSearchParams } from 'next/navigation'; import Link from 'next/link'; import { useSession } from '@/lib/auth'; import { useLocale } from '@/context/locale'; import { getMyTasks, getMyOffers, getMyReviews, getNotifications, getMyDashboard, getSpecialistFomoDashboard, getCustomerFomoDashboard, getMySpecialistCards, applyMyReferral } from '@/lib/api'; import { formatPrice, taskTitle } from '@/lib/taskLocale'; import { PlanBadge } from '@/components/PlanBadge'; import { UsageMeter } from '@/components/UsageMeter'; /** Extract the quoted task title from a stored notification body (any locale) */ function extractNotifParam(body) { if (!body) return null; const m = body.match(/[«""](.+?)[»""]/); var _m_; return (_m_ = m === null || m === void 0 ? void 0 : m[1]) !== null && _m_ !== void 0 ? _m_ : null; } function PlanBlock(param) { let { dashboard, t } = param; const plan = dashboard.plan; const expiry = dashboard.planExpiration; const usage = dashboard.usage; const stats = dashboard.stats; const expiryPct = expiry ? Math.max(0, Math.min(100, Math.round(expiry.daysLeft / 30 * 100))) : 100; const expiryColor = expiry ? expiry.daysLeft <= 3 ? 'bg-red-500' : expiry.daysLeft <= 7 ? 'bg-amber-400' : 'bg-green-400' : 'bg-green-400'; return /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-2xl border border-gray-200 p-5 mb-6", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between mb-4", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2", children: [ /*#__PURE__*/ _jsx("h2", { className: "font-semibold text-gray-800 text-sm", children: t('dashboard.plan.title', 'My Plan') }), plan ? /*#__PURE__*/ _jsx(PlanBadge, { tier: plan.tier, size: "sm" }) : /*#__PURE__*/ _jsx("span", { className: "text-xs text-gray-400", children: t('dashboard.plan.no_plan', 'Free') }) ] }), /*#__PURE__*/ _jsx(Link, { href: "/pricing", className: "text-xs font-medium text-green-600 hover:underline", children: (plan === null || plan === void 0 ? void 0 : plan.tier) === 'ultimate' ? null : t('dashboard.plan.upgrade', 'Upgrade') }) ] }), expiry && /*#__PURE__*/ _jsxs("div", { className: "mb-4", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex justify-between text-xs text-gray-500 mb-1", children: [ /*#__PURE__*/ _jsx("span", { children: t('dashboard.plan.expires', 'Expires in {n} days').replace('{n}', String(expiry.daysLeft)) }), /*#__PURE__*/ _jsxs("span", { children: [ expiry.daysLeft, " ", t('pricing.days', 'days') ] }) ] }), /*#__PURE__*/ _jsx("div", { className: "h-1.5 rounded-full bg-gray-100", children: /*#__PURE__*/ _jsx("div", { className: "h-full rounded-full transition-all ".concat(expiryColor), style: { width: "".concat(expiryPct, "%") } }) }) ] }), (usage.messagesSent !== undefined || usage.ordersMade !== undefined) && /*#__PURE__*/ _jsxs("div", { className: "space-y-2 mb-4", children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs font-medium text-gray-500 uppercase tracking-wide", children: t('dashboard.plan.limits', 'Daily limits') }), /*#__PURE__*/ _jsx(UsageMeter, { current: usage.messagesSent, limit: usage.messagesLeft !== null ? usage.messagesSent + usage.messagesLeft : null, label: t('dashboard.plan.messages', 'Messages') }), /*#__PURE__*/ _jsx(UsageMeter, { current: usage.ordersMade, limit: usage.ordersLeft !== null ? usage.ordersMade + usage.ordersLeft : null, label: t('dashboard.plan.orders', 'Orders') }) ] }), Object.keys(stats).length > 0 && /*#__PURE__*/ _jsx("div", { className: "grid grid-cols-2 gap-2", children: Object.entries(stats).map((param)=>{ let [key, val] = param; return /*#__PURE__*/ _jsxs("div", { className: "bg-gray-50 rounded-xl px-3 py-2 text-center", children: [ /*#__PURE__*/ _jsx("p", { className: "text-lg font-bold text-gray-800", children: val }), /*#__PURE__*/ _jsx("p", { className: "text-[10px] text-gray-400 uppercase tracking-wide", children: t("dashboard.stats.".concat(key), key) }) ] }, key); }) }) ] }); } export default function DashboardPage() { var _session_user, _fomoData_topCategories; const { data: session, isPending } = useSession(); const router = useRouter(); const searchParams = useSearchParams(); const { t, locale } = useLocale(); const [tasks, setTasks] = useState([]); const [offers, setOffers] = useState([]); const [myReviews, setMyReviews] = useState([]); const [invitations, setInvitations] = useState([]); const [loading, setLoading] = useState(true); const [dashboard, setDashboard] = useState(null); const [fomoData, setFomoData] = useState(null); const [hasHelperCard, setHasHelperCard] = useState(null); useEffect(()=>{ if (!isPending && !session) router.push('/login'); }, [ session, isPending ]); // Apply pending referral code after Google OAuth redirect (?ref=CODE) useEffect(()=>{ if (!session) return; const refCode = searchParams.get('ref'); if (!refCode) return; applyMyReferral(refCode).catch(()=>{}); // Remove the ref param from the URL without reloading const params = new URLSearchParams(searchParams.toString()); params.delete('ref'); const newUrl = params.toString() ? "?".concat(params.toString()) : window.location.pathname; router.replace(newUrl); }, [ session ]); // Detect whether the user has completed their helper profile (has a card). // Used to show the getting-started onboarding card to users who haven't yet. useEffect(()=>{ if (!session) return; getMySpecialistCards().then((param)=>{ let { cards } = param; return setHasHelperCard(cards.length > 0); }).catch(()=>setHasHelperCard(null)); }, [ session ]); useEffect(()=>{ if (!session) return; Promise.all([ getMyTasks(), getMyOffers(), getMyReviews(), getNotifications(), getMyDashboard() ]).then((param)=>{ let [t, o, r, notifs, dash] = param; setTasks(t); setOffers(o); setMyReviews(r); setInvitations(notifs.filter((n)=>n.type === 'task_invite')); setDashboard(dash); }).catch(()=>{}).finally(()=>setLoading(false)); }, [ session ]); useEffect(()=>{ var _session_user; if (!session) return; const role = (_session_user = session.user) === null || _session_user === void 0 ? void 0 : _session_user.role; if (role === 'specialist') { getSpecialistFomoDashboard().then(setFomoData).catch(()=>{}); } else { getCustomerFomoDashboard().then(setFomoData).catch(()=>{}); } }, [ session ]); if (isPending || loading) return /*#__PURE__*/ _jsx("div", { className: "text-center py-20 text-white", children: t('common.loading') }); const dateLocale = locale === 'ru' ? 'ru-RU' : locale === 'uk' ? 'uk-UA' : locale === 'en' ? 'en-US' : 'el-GR'; const activeTasks = tasks.filter((task)=>task.status !== 'completed' && task.status !== 'cancelled'); const completedTasks = tasks.filter((task)=>task.status === 'completed' || task.status === 'cancelled'); const activeOffers = offers.filter((row)=>{ const offer = row.offer || row; const task = row.task; return offer.status !== 'other_accepted' && (task === null || task === void 0 ? void 0 : task.status) !== 'completed' && (task === null || task === void 0 ? void 0 : task.status) !== 'cancelled'; }); const completedOffers = offers.filter((row)=>{ const offer = row.offer || row; const task = row.task; return offer.status === 'other_accepted' || (task === null || task === void 0 ? void 0 : task.status) === 'completed' || (task === null || task === void 0 ? void 0 : task.status) === 'cancelled'; }); function TaskCard(param) { let { task } = param; var _task_offerCount; const offerCount = (_task_offerCount = task.offerCount) !== null && _task_offerCount !== void 0 ? _task_offerCount : 0; var _task_declinedCount; const declinedCount = (_task_declinedCount = task.declinedCount) !== null && _task_declinedCount !== void 0 ? _task_declinedCount : 0; const activeOfferCount = offerCount - declinedCount; return /*#__PURE__*/ _jsx(Link, { href: "/tasks/".concat(task.id), className: "block bg-white rounded-xl border border-gray-200 p-4 hover:shadow-sm hover:border-green-300 transition", children: /*#__PURE__*/ _jsxs("div", { className: "flex justify-between items-start", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ _jsx("p", { className: "font-medium text-gray-900 truncate", children: taskTitle(task, locale) }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-1", children: new Date(task.createdAt).toLocaleDateString(dateLocale) }), offerCount > 0 && /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 mt-1.5", children: [ /*#__PURE__*/ _jsxs("span", { className: "text-xs text-green-600 font-medium", children: [ "\uD83D\uDCBC ", offerCount, " ", t('dashboard.offers_count', 'offers') ] }), declinedCount > 0 && /*#__PURE__*/ _jsxs("span", { className: "text-xs text-red-400", children: [ "✕ ", declinedCount, " ", t('dashboard.declined_count', 'declined') ] }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "ml-3 text-right shrink-0", children: [ /*#__PURE__*/ _jsx("span", { className: "text-xs px-2 py-0.5 rounded-full ".concat(task.status === 'open' ? 'bg-green-100 text-green-700' : task.status === 'in_progress' ? 'bg-green-100 text-green-700' : task.status === 'completed' ? 'bg-gray-100 text-gray-600' : 'bg-red-100 text-red-600'), children: t("task.status.".concat(task.status), task.status) }), task.budget && /*#__PURE__*/ _jsxs("p", { className: "text-sm font-bold text-green-600 mt-1", children: [ formatPrice(task.budget), "€" ] }) ] }) ] }) }); } function OfferCard(param) { let { row } = param; var _myReviews_find; const offer = row.offer || row; const task = row.task; var _myReviews_find_review; const reviewReceived = (task === null || task === void 0 ? void 0 : task.status) === 'completed' && offer.status === 'accepted' ? (_myReviews_find_review = (_myReviews_find = myReviews.find((r)=>{ var _r_review; return ((_r_review = r.review) === null || _r_review === void 0 ? void 0 : _r_review.taskId) === (task === null || task === void 0 ? void 0 : task.id); })) === null || _myReviews_find === void 0 ? void 0 : _myReviews_find.review) !== null && _myReviews_find_review !== void 0 ? _myReviews_find_review : null : null; return /*#__PURE__*/ _jsxs(Link, { href: task ? "/tasks/".concat(task.id) : '#', className: "block bg-white rounded-xl border border-gray-200 p-4 hover:shadow-sm hover:border-green-300 transition", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex justify-between items-start", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ _jsx("p", { className: "font-medium text-gray-900 truncate", children: (task === null || task === void 0 ? void 0 : task.title) || t('chat.task_fallback') }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-1", children: new Date(offer.createdAt).toLocaleDateString(dateLocale) }) ] }), /*#__PURE__*/ _jsxs("div", { className: "ml-3 text-right shrink-0", children: [ /*#__PURE__*/ _jsxs("p", { className: "font-bold text-green-600", children: [ formatPrice(offer.price), "€" ] }), /*#__PURE__*/ _jsx("span", { className: "text-xs px-2 py-0.5 rounded-full mt-1 inline-block ".concat(offer.status === 'accepted' ? 'bg-green-100 text-green-700' : offer.status === 'declined' ? 'bg-red-100 text-red-700' : offer.status === 'other_accepted' ? 'bg-green-100 text-green-600' : 'bg-gray-100 text-gray-700'), children: t("offer.status.".concat(offer.status), offer.status) }) ] }) ] }), reviewReceived && /*#__PURE__*/ _jsxs("div", { className: "mt-3 pt-3 border-t border-gray-100 flex items-center gap-2", children: [ /*#__PURE__*/ _jsx("div", { className: "flex gap-0.5", children: [ 1, 2, 3, 4, 5 ].map((star)=>/*#__PURE__*/ _jsx("span", { className: "text-sm ".concat(star <= reviewReceived.rating ? 'text-yellow-400' : 'text-gray-200'), children: "★" }, star)) }), /*#__PURE__*/ _jsxs("span", { className: "text-sm font-semibold text-gray-700", children: [ reviewReceived.rating, "/5" ] }), reviewReceived.comment && /*#__PURE__*/ _jsx("span", { className: "text-xs text-gray-500 truncate", children: reviewReceived.comment }) ] }), (task === null || task === void 0 ? void 0 : task.status) === 'completed' && offer.status === 'accepted' && !reviewReceived && /*#__PURE__*/ _jsx("p", { className: "mt-2 text-xs text-gray-400", children: t('dashboard.review_pending') }) ] }); } const isSpecialist = (session === null || session === void 0 ? void 0 : (_session_user = session.user) === null || _session_user === void 0 ? void 0 : _session_user.role) === 'specialist'; var _fomoData_missedCount; return /*#__PURE__*/ _jsxs("div", { className: "max-w-5xl mx-auto px-4 py-8", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex justify-between items-center mb-8", children: [ /*#__PURE__*/ _jsx("h1", { className: "text-2xl font-bold text-white", children: t('dashboard.title') }), /*#__PURE__*/ _jsx(Link, { href: "/tasks/new", className: "bg-green-600 text-white px-4 py-2 rounded-lg text-sm font-medium hover:bg-green-700", children: t('dashboard.new_task') }) ] }), hasHelperCard === false && /*#__PURE__*/ _jsxs("div", { className: "mb-6 bg-white rounded-2xl border border-gray-200 overflow-hidden", children: [ /*#__PURE__*/ _jsxs("div", { className: "px-5 pt-5 pb-3", children: [ /*#__PURE__*/ _jsx("h2", { className: "text-lg font-bold text-gray-900", children: t('dashboard.onboarding.title') }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-500 mt-1", children: t('dashboard.onboarding.subtitle') }) ] }), /*#__PURE__*/ _jsxs("div", { className: "grid sm:grid-cols-2 gap-3 p-5 pt-2", children: [ /*#__PURE__*/ _jsxs(Link, { href: "/specialist-setup", className: "group flex flex-col rounded-xl border-2 border-green-500 bg-green-50 p-4 hover:bg-green-100 transition", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 mb-1", children: [ /*#__PURE__*/ _jsx("span", { className: "text-xl", children: "\uD83D\uDEE0" }), /*#__PURE__*/ _jsx("span", { className: "font-semibold text-gray-800", children: t('dashboard.onboarding.helper.title') }) ] }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-green-700/80 mb-3 flex-1", children: t('dashboard.onboarding.helper.desc') }), /*#__PURE__*/ _jsxs("span", { className: "inline-flex items-center gap-1 text-sm font-semibold text-green-700", children: [ t('dashboard.onboarding.helper.cta'), " →" ] }) ] }), /*#__PURE__*/ _jsxs(Link, { href: "/tasks/new", className: "group flex flex-col rounded-xl border border-gray-200 bg-gray-50 p-4 hover:bg-gray-100 transition", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 mb-1", children: [ /*#__PURE__*/ _jsx("span", { className: "text-xl", children: "\uD83D\uDCDD" }), /*#__PURE__*/ _jsx("span", { className: "font-semibold text-gray-800", children: t('dashboard.onboarding.requester.title') }) ] }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-500 mb-3 flex-1", children: t('dashboard.onboarding.requester.desc') }), /*#__PURE__*/ _jsxs("span", { className: "inline-flex items-center gap-1 text-sm font-semibold text-gray-700", children: [ t('dashboard.onboarding.requester.cta'), " →" ] }) ] }) ] }) ] }), dashboard && /*#__PURE__*/ _jsx(PlanBlock, { dashboard: dashboard, t: t }), fomoData && (isSpecialist ? (fomoData.missedCount > 0 || fomoData.missedEarnings > 0) && /*#__PURE__*/ _jsxs("div", { className: "mb-6 bg-amber-50 border border-amber-200 rounded-xl px-5 py-4 flex items-start gap-3", children: [ /*#__PURE__*/ _jsx("div", { className: "shrink-0 mt-0.5", children: /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5 text-amber-500", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 9v2m0 4h.01M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z" }) }) }), /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ _jsxs("p", { className: "text-base font-semibold text-amber-800", children: [ t('fomo.specialist_missed', 'You missed {n} tasks').replace('{n}', String((_fomoData_missedCount = fomoData.missedCount) !== null && _fomoData_missedCount !== void 0 ? _fomoData_missedCount : 0)), fomoData.missedEarnings > 0 && /*#__PURE__*/ _jsxs("span", { className: "ml-1 text-amber-600", children: [ "for €", fomoData.missedEarnings ] }) ] }), ((_fomoData_topCategories = fomoData.topCategories) === null || _fomoData_topCategories === void 0 ? void 0 : _fomoData_topCategories.length) > 0 && /*#__PURE__*/ _jsxs("p", { className: "text-sm text-amber-600 mt-0.5", children: [ t('fomo.top_categories', 'Categories'), ": ", fomoData.topCategories.slice(0, 3).join(', ') ] }) ] }), /*#__PURE__*/ _jsx(Link, { href: "/pricing", className: "shrink-0 text-xs font-medium text-amber-700 bg-amber-100 px-3 py-1.5 rounded-lg hover:bg-amber-200 transition", children: t('dashboard.plan.upgrade') }) ] }) : fomoData.totalTasks > 0 && /*#__PURE__*/ _jsx("div", { className: "mb-6 bg-green-50 border border-green-200 rounded-xl px-5 py-4", children: /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between gap-4 flex-wrap", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3", children: [ /*#__PURE__*/ _jsx("div", { className: "shrink-0 bg-green-100 rounded-xl p-2", children: /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5 text-green-600", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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" }) }) }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("p", { className: "text-base font-semibold text-gray-800", children: [ fomoData.totalOffers, " ", t('fomo.offers_received', 'offers received') ] }), fomoData.avgOffersPerTask > 0 && /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-500", children: t('fomo.avg_offers', 'Average {n}/task').replace('{n}', Number(fomoData.avgOffersPerTask).toFixed(1)) }) ] }) ] }), fomoData.completionRate !== undefined && /*#__PURE__*/ _jsxs("div", { className: "text-right", children: [ /*#__PURE__*/ _jsxs("p", { className: "text-2xl font-bold text-green-700", children: [ Math.round(fomoData.completionRate * 100), "%" ] }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-400", children: t('fomo.completion_rate', 'completed') }) ] }) ] }) })), isSpecialist && /*#__PURE__*/ _jsxs(Link, { href: "/tasks", className: "flex items-center justify-between gap-4 bg-green-600 text-white rounded-xl px-5 py-4 mb-8 hover:bg-green-700 transition", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-4", children: [ /*#__PURE__*/ _jsx("div", { className: "shrink-0 bg-white/20 rounded-xl p-2.5", children: /*#__PURE__*/ _jsxs("svg", { className: "w-6 h-6 text-white", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ _jsx("circle", { cx: "11", cy: "11", r: "7" }), /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M21 21l-4.35-4.35" }) ] }) }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "font-semibold text-base", children: t('find_tasks.title') }), /*#__PURE__*/ _jsx("p", { className: "text-green-100 text-sm mt-0.5", children: t('find_tasks.banner_hint') }) ] }) ] }), /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5 shrink-0 text-white/70", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 5l7 7-7 7" }) }) ] }), /*#__PURE__*/ _jsxs("div", { className: "grid md:grid-cols-2 gap-8", children: [ /*#__PURE__*/ _jsxs("div", { className: "space-y-8", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("h2", { className: "text-lg font-semibold text-white mb-4", children: [ t('dashboard.my_tasks'), " ", /*#__PURE__*/ _jsxs("span", { className: "text-white/60 font-normal text-base", children: [ "(", activeTasks.length, ")" ] }) ] }), activeTasks.length === 0 ? /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6 text-center text-gray-500", children: [ /*#__PURE__*/ _jsx("p", { children: t('dashboard.tasks.empty') }), /*#__PURE__*/ _jsx(Link, { href: "/tasks/new", className: "text-green-600 hover:underline text-sm mt-2 inline-block", children: t('dashboard.tasks.empty.cta') }) ] }) : /*#__PURE__*/ _jsx("div", { className: "space-y-3", children: activeTasks.map((task)=>/*#__PURE__*/ _jsx(TaskCard, { task: task }, task.id)) }) ] }), completedTasks.length > 0 && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("h2", { className: "text-lg font-semibold text-white/70 mb-4", children: [ t('dashboard.completed_tasks'), " ", /*#__PURE__*/ _jsxs("span", { className: "font-normal text-base text-white/50", children: [ "(", completedTasks.length, ")" ] }) ] }), /*#__PURE__*/ _jsx("div", { className: "space-y-3 opacity-75", children: completedTasks.map((task)=>/*#__PURE__*/ _jsx(TaskCard, { task: task }, task.id)) }) ] }) ] }), /*#__PURE__*/ _jsx("div", { className: "space-y-8", children: isSpecialist ? /*#__PURE__*/ _jsxs(_Fragment, { children: [ invitations.length > 0 && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("h2", { className: "text-lg font-semibold text-white mb-4", children: [ t('dashboard.invitations'), " ", /*#__PURE__*/ _jsxs("span", { className: "text-white/60 font-normal text-base", children: [ "(", invitations.length, ")" ] }) ] }), /*#__PURE__*/ _jsx("div", { className: "space-y-3", children: invitations.map((inv)=>/*#__PURE__*/ _jsxs(Link, { href: inv.referenceId ? "/tasks/".concat(inv.referenceId) : '/tasks', className: "flex items-start gap-3 p-4 rounded-xl border transition cursor-pointer ".concat(inv.isRead ? 'bg-white/90 border-white/20 hover:bg-white' : 'bg-white border-amber-300 shadow-sm hover:bg-amber-50'), children: [ /*#__PURE__*/ _jsx("span", { className: "text-2xl", children: "\uD83D\uDCCB" }), /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ _jsx("p", { className: "font-medium truncate ".concat(inv.isRead ? 'text-gray-600' : 'text-gray-900'), children: t('notif.type.task_invite', inv.title) }), inv.body && /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-500 mt-0.5 truncate", children: (()=>{ const title = extractNotifParam(inv.body); const tpl = t('notif.body.task_invite', ''); return title && tpl ? tpl.replace('{title}', title) : inv.body; })() }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-1", children: new Date(inv.createdAt).toLocaleDateString(dateLocale) }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex flex-col items-end gap-1.5 shrink-0", children: [ !inv.isRead && /*#__PURE__*/ _jsx("span", { className: "w-2 h-2 bg-amber-400 rounded-full mt-2" }), /*#__PURE__*/ _jsx("span", { className: "text-xs text-gray-400", children: "→" }) ] }) ] }, inv.id)) }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("h2", { className: "text-lg font-semibold text-white mb-4", children: [ t('dashboard.my_offers'), " ", /*#__PURE__*/ _jsxs("span", { className: "text-white/60 font-normal text-base", children: [ "(", activeOffers.length, ")" ] }) ] }), activeOffers.length === 0 ? /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6 text-center text-gray-500", children: [ /*#__PURE__*/ _jsx("p", { children: t('dashboard.offers.empty') }), /*#__PURE__*/ _jsx(Link, { href: "/tasks", className: "text-green-600 hover:underline text-sm mt-2 inline-block", children: t('dashboard.offers.empty.cta') }) ] }) : /*#__PURE__*/ _jsx("div", { className: "space-y-3", children: activeOffers.map((row)=>/*#__PURE__*/ _jsx(OfferCard, { row: row }, (row.offer || row).id)) }) ] }), completedOffers.length > 0 && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("h2", { className: "text-lg font-semibold text-white/70 mb-4", children: [ t('dashboard.completed_offers'), " ", /*#__PURE__*/ _jsxs("span", { className: "font-normal text-base text-white/50", children: [ "(", completedOffers.length, ")" ] }) ] }), /*#__PURE__*/ _jsx("div", { className: "space-y-3 opacity-75", children: completedOffers.map((row)=>/*#__PURE__*/ _jsx(OfferCard, { row: row }, (row.offer || row).id)) }) ] }) ] }) : /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs(Link, { href: "/specialists", className: "flex items-center justify-between gap-4 bg-green-600 text-white rounded-xl px-5 py-4 hover:bg-green-700 transition", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-4", children: [ /*#__PURE__*/ _jsx("div", { className: "shrink-0 bg-white/20 rounded-xl p-2.5", children: /*#__PURE__*/ _jsx("svg", { className: "w-6 h-6 text-white", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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" }) }) }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "font-semibold text-base", children: t('dashboard.customer.specialists_title') }), /*#__PURE__*/ _jsx("p", { className: "text-green-100 text-sm mt-0.5", children: t('dashboard.customer.specialists_hint') }) ] }) ] }), /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5 shrink-0 text-white/70", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 5l7 7-7 7" }) }) ] }), /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-5", children: [ /*#__PURE__*/ _jsx("h2", { className: "text-base font-semibold text-gray-800 mb-4", children: t('dashboard.customer.how_title') }), /*#__PURE__*/ _jsx("div", { className: "space-y-3", children: [ { num: '1', text: t('dashboard.customer.step1'), icon: 'M12 4v16m8-8H4' }, { num: '2', text: t('dashboard.customer.step2'), icon: 'M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z' }, { num: '3', text: t('dashboard.customer.step3'), icon: 'M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z' } ].map((param)=>{ let { num, text, icon } = param; return /*#__PURE__*/ _jsxs("div", { className: "flex items-start gap-3", children: [ /*#__PURE__*/ _jsx("span", { className: "shrink-0 w-7 h-7 rounded-full bg-green-100 text-green-600 text-sm font-bold flex items-center justify-center", children: num }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-600 pt-1", children: text }) ] }, num); }) }), /*#__PURE__*/ _jsxs(Link, { href: "/tasks/new", className: "mt-4 inline-block text-sm font-medium text-green-600 hover:underline", children: [ tasks.length > 0 ? t('dashboard.tasks.add_new') : t('dashboard.tasks.empty.cta'), " →" ] }) ] }) ] }) }) ] }) ] }); } ÊO61146undefined148191undefined193253undefined255283undefined285324undefined326370undefined372564undefined566623undefined625675undefined677729undefined15231527__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined16591663__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined18051809__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined19601963__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined22152218__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined22202228__WEBPACK_MODULE_REFERENCE__8_5b22506c616e4261646765225d_directImport_asiSafe1__._undefined23722375__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined26482651__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined26532656__WEBPACK_MODULE_REFERENCE__3_5b2264656661756c74225d_directImport_asiSafe1__._undefined30383042__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined31503154__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined33293332__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined35513555__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined39163919__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined40474050__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined44734477__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined45954598__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined48384841__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined48434852__WEBPACK_MODULE_REFERENCE__9_5b2255736167654d65746572225d_directImport_asiSafe1__._undefined51495152__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined51545163__WEBPACK_MODULE_REFERENCE__9_5b2255736167654d65746572225d_directImport_asiSafe1__._undefined55065509__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined57215725__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined58965899__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined61066109__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined64356449undefined65666575__WEBPACK_MODULE_REFERENCE__4_5b2275736553657373696f6e225d_call_directImport_asiSafe1__._undefined65996607__WEBPACK_MODULE_REFERENCE__2_5b22757365526f75746572225d_call_directImport_asiSafe1__._undefined66376651__WEBPACK_MODULE_REFERENCE__2_5b22757365536561726368506172616d73225d_call_directImport_asiSafe1__._undefined66826690__WEBPACK_MODULE_REFERENCE__5_5b227573654c6f63616c65225d_call_directImport_asiSafe1__._undefined67256732__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined67716778__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined68236830__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined68796886__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined69276934__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined69816988__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined70337040__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined70957102__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined71157123__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined73217329__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined74547468__WEBPACK_MODULE_REFERENCE__6_5b226170706c794d79526566657272616c225d_call_directImport_asiSafe1__._undefined79887996__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined80428061__WEBPACK_MODULE_REFERENCE__6_5b226765744d795370656369616c6973744361726473225d_call_directImport_asiSafe1__._undefined82548262__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined83348343__WEBPACK_MODULE_REFERENCE__6_5b226765744d795461736b73225d_call_directImport_asiSafe1__._undefined83608370__WEBPACK_MODULE_REFERENCE__6_5b226765744d794f6666657273225d_call_directImport_asiSafe1__._undefined83878398__WEBPACK_MODULE_REFERENCE__6_5b226765744d7952657669657773225d_call_directImport_asiSafe1__._undefined84158430__WEBPACK_MODULE_REFERENCE__6_5b226765744e6f74696669636174696f6e73225d_call_directImport_asiSafe1__._undefined84478460__WEBPACK_MODULE_REFERENCE__6_5b226765744d7944617368626f617264225d_call_directImport_asiSafe1__._undefined88208828__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined90629087__WEBPACK_MODULE_REFERENCE__6_5b226765745370656369616c697374466f6d6f44617368626f617264225d_call_directImport_asiSafe1__._undefined91539176__WEBPACK_MODULE_REFERENCE__6_5b22676574437573746f6d6572466f6d6f44617368626f617264225d_call_directImport_asiSafe1__._undefined93079310__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1089910902__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1090410907__WEBPACK_MODULE_REFERENCE__3_5b2264656661756c74225d_directImport_asiSafe1__._undefined1112211126__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1126211266__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1140811411__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1154311551__WEBPACK_MODULE_REFERENCE__7_5b227461736b5469746c65225d_call_directImport_asiSafe1__._undefined1164111644__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1191611920__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1210212106__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1266012664__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1327713281__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1343313436__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1392513929__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1410214112__WEBPACK_MODULE_REFERENCE__7_5b22666f726d61745072696365225d_call_directImport_asiSafe1__._undefined1512715131__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1513315136__WEBPACK_MODULE_REFERENCE__3_5b2264656661756c74225d_directImport_asiSafe1__._undefined1538215386__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1553415538__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1569215695__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1600116004__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1632416328__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1649216496__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1666816678__WEBPACK_MODULE_REFERENCE__7_5b22666f726d61745072696365225d_call_directImport_asiSafe1__._undefined1685816861__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1748117485__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1765917662__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1799818001__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1830618310__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1865418657__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1902919032__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1946219466__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1957319577__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1971919722__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1991319916__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1991819921__WEBPACK_MODULE_REFERENCE__3_5b2264656661756c74225d_directImport_asiSafe1__._undefined2026020264__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2043220436__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2057820581__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2081720820__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2109421098__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2126021264__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2126621269__WEBPACK_MODULE_REFERENCE__3_5b2264656661756c74225d_directImport_asiSafe1__._undefined2157621580__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2178421787__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2204922052__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2243022433__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2271222716__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2322223226__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2322823231__WEBPACK_MODULE_REFERENCE__3_5b2264656661756c74225d_directImport_asiSafe1__._undefined2352623530__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2373423737__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2399824001__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2438224385__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2466324667__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2525425257__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2546225466__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2565425657__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2577025773__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2608926092__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2646926473__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2661526619__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2707127075__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2767227676__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2815428157__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2815928162__WEBPACK_MODULE_REFERENCE__3_5b2264656661756c74225d_directImport_asiSafe1__._undefined2851828521__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2866428668__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2883328837__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2900029003__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2916129164__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2955229555__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3011430118__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3023130235__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3078930792__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3129031294__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3144431448__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3183631839__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3219732201__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3220332206__WEBPACK_MODULE_REFERENCE__3_5b2264656661756c74225d_directImport_asiSafe1__._undefined3245532459__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3261032613__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3276432768__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3317033173__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3344433447__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3385333857__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3396233965__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3421434217__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3457634579__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3487934882__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3515535159__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3528835292__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3542935433__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3553835542__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3587235876__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3648736491__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3673936742__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3694236945__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3694736950__WEBPACK_MODULE_REFERENCE__3_5b2264656661756c74225d_directImport_asiSafe1__._undefined3737537378__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3754137544__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3785037854__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3795937963__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3830338307__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3889438897__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3907439077__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3939539398__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3952039524__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3952639534__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined3965139655__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3976839772__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4012540129__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4075340756__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4092640930__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4093240935__WEBPACK_MODULE_REFERENCE__3_5b2264656661756c74225d_directImport_asiSafe1__._undefined4145841461__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4177141775__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4202542028__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4247142474__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4327543278__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4378843792__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4408344086__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4436444367__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4503045034__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4514745151__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4550245506__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4615946163__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4642346426__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4663946642__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4664446647__WEBPACK_MODULE_REFERENCE__3_5b2264656661756c74225d_directImport_asiSafe1__._undefined4709347096__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4726747270__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4761447618__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4773147735__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4809648100__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4872848731__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4891648919__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4925949263__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4926549273__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined4936449368__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4937049373__WEBPACK_MODULE_REFERENCE__3_5b2264656661756c74225d_directImport_asiSafe1__._undefined4970349707__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4991849921__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5011250115__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5059550598__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5127451278__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5142351426__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5177551778__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5231052313__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5273352736__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5316953173__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5338353386__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5368353686__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5512955133__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5536755370__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5576955772__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5627256276__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5627856281__WEBPACK_MODULE_REFERENCE__3_5b2264656661756c74225d_directImport_asiSafe1__._undefined_Ñ_«/{ Uì62|~Ï_©º   S Ñ  ‰ Õ „ Î ©õ^š(r_eÛ%_aŽÝ')|Óñ=è2K]uËéKjÀã7 ^ ² ß _3!d!ž!á!5"d"ž"å"9#p#Ä#Ñ#'$í$C%À%"&*(€(®()Û)1*y*Ñ*â*<+M+©+º+,/,_,÷-M.7/¯/ñ/e0è021g7±7³78×8#9«9÷9…:Ï:S;©;<M<]=©=_>«>Õ@!A†CÒCjD_ŽDFéF–GðGçK3L5L‚LxMÄMXN€N>OˆOºPQDRR4S€S,T†T:U„UðW (/* binding */ DashboardPage) }); // EXTERNAL MODULE: ../../node_modules/next/dist/compiled/react/jsx-runtime.js var jsx_runtime = __webpack_require__(4568); // EXTERNAL MODULE: ../../node_modules/next/dist/compiled/react/index.js var react = __webpack_require__(7620); // EXTERNAL MODULE: ../../node_modules/next/dist/api/navigation.js var navigation = __webpack_require__(7541); // EXTERNAL MODULE: ../../node_modules/next/dist/client/app-dir/link.js var app_dir_link = __webpack_require__(9664); var link_default = /*#__PURE__*/__webpack_require__.n(app_dir_link); // EXTERNAL MODULE: ./src/lib/auth.ts var auth = __webpack_require__(1592); // EXTERNAL MODULE: ./src/context/locale.tsx var context_locale = __webpack_require__(9906); // EXTERNAL MODULE: ./src/lib/api.ts var api = __webpack_require__(2982); // EXTERNAL MODULE: ./src/lib/taskLocale.ts var taskLocale = __webpack_require__(4017); // EXTERNAL MODULE: ./src/components/PlanBadge.tsx var PlanBadge = __webpack_require__(2035); ;// ./src/components/UsageMeter.tsx function UsageMeter(param) { let { current, limit, label, className = '' } = param; if (limit === null) { return /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "".concat(className), children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex justify-between items-center mb-1", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "text-xs text-gray-500", children: label }), /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "text-xs font-semibold text-green-600", children: "∞" }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "h-1.5 rounded-full bg-green-100", children: /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "h-full w-full rounded-full bg-green-400" }) }) ] }); } const pct = limit > 0 ? Math.min(100, Math.round(current / limit * 100)) : 100; const remaining = Math.max(0, limit - current); const barColor = pct >= 100 ? 'bg-red-500' : pct >= 80 ? 'bg-amber-400' : 'bg-green-500'; const textColor = pct >= 100 ? 'text-red-600' : pct >= 80 ? 'text-amber-600' : 'text-gray-600'; return /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: className, children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex justify-between items-center mb-1", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "text-xs text-gray-500", children: label }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("span", { className: "text-xs font-semibold ".concat(textColor), children: [ remaining, " / ", limit ] }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "h-1.5 rounded-full bg-gray-100", children: /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "h-full rounded-full transition-all ".concat(barColor), style: { width: "".concat(pct, "%") } }) }) ] }); } ;// ./src/app/dashboard/page.tsx /* __next_internal_client_entry_do_not_use__ default auto */ /** Extract the quoted task title from a stored notification body (any locale) */ function extractNotifParam(body) { if (!body) return null; const m = body.match(/[«""](.+?)[»""]/); var _m_; return (_m_ = m === null || m === void 0 ? void 0 : m[1]) !== null && _m_ !== void 0 ? _m_ : null; } function PlanBlock(param) { let { dashboard, t } = param; const plan = dashboard.plan; const expiry = dashboard.planExpiration; const usage = dashboard.usage; const stats = dashboard.stats; const expiryPct = expiry ? Math.max(0, Math.min(100, Math.round(expiry.daysLeft / 30 * 100))) : 100; const expiryColor = expiry ? expiry.daysLeft <= 3 ? 'bg-red-500' : expiry.daysLeft <= 7 ? 'bg-amber-400' : 'bg-green-400' : 'bg-green-400'; return /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "bg-white rounded-2xl border border-gray-200 p-5 mb-6", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex items-center justify-between mb-4", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex items-center gap-2", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("h2", { className: "font-semibold text-gray-800 text-sm", children: t('dashboard.plan.title', 'My Plan') }), plan ? /*#__PURE__*/ (0,jsx_runtime.jsx)(PlanBadge/* PlanBadge */.d, { tier: plan.tier, size: "sm" }) : /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "text-xs text-gray-400", children: t('dashboard.plan.no_plan', 'Free') }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)((link_default()), { href: "/pricing", className: "text-xs font-medium text-green-600 hover:underline", children: (plan === null || plan === void 0 ? void 0 : plan.tier) === 'ultimate' ? null : t('dashboard.plan.upgrade', 'Upgrade') }) ] }), expiry && /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "mb-4", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex justify-between text-xs text-gray-500 mb-1", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { children: t('dashboard.plan.expires', 'Expires in {n} days').replace('{n}', String(expiry.daysLeft)) }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("span", { children: [ expiry.daysLeft, " ", t('pricing.days', 'days') ] }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "h-1.5 rounded-full bg-gray-100", children: /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "h-full rounded-full transition-all ".concat(expiryColor), style: { width: "".concat(expiryPct, "%") } }) }) ] }), (usage.messagesSent !== undefined || usage.ordersMade !== undefined) && /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "space-y-2 mb-4", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "text-xs font-medium text-gray-500 uppercase tracking-wide", children: t('dashboard.plan.limits', 'Daily limits') }), /*#__PURE__*/ (0,jsx_runtime.jsx)(UsageMeter, { current: usage.messagesSent, limit: usage.messagesLeft !== null ? usage.messagesSent + usage.messagesLeft : null, label: t('dashboard.plan.messages', 'Messages') }), /*#__PURE__*/ (0,jsx_runtime.jsx)(UsageMeter, { current: usage.ordersMade, limit: usage.ordersLeft !== null ? usage.ordersMade + usage.ordersLeft : null, label: t('dashboard.plan.orders', 'Orders') }) ] }), Object.keys(stats).length > 0 && /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "grid grid-cols-2 gap-2", children: Object.entries(stats).map((param)=>{ let [key, val] = param; return /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "bg-gray-50 rounded-xl px-3 py-2 text-center", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "text-lg font-bold text-gray-800", children: val }), /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "text-[10px] text-gray-400 uppercase tracking-wide", children: t("dashboard.stats.".concat(key), key) }) ] }, key); }) }) ] }); } function DashboardPage() { var _session_user, _fomoData_topCategories; const { data: session, isPending } = (0,auth/* useSession */.wV)(); const router = (0,navigation.useRouter)(); const searchParams = (0,navigation.useSearchParams)(); const { t, locale } = (0,context_locale/* useLocale */.Y)(); const [tasks, setTasks] = (0,react.useState)([]); const [offers, setOffers] = (0,react.useState)([]); const [myReviews, setMyReviews] = (0,react.useState)([]); const [invitations, setInvitations] = (0,react.useState)([]); const [loading, setLoading] = (0,react.useState)(true); const [dashboard, setDashboard] = (0,react.useState)(null); const [fomoData, setFomoData] = (0,react.useState)(null); const [hasHelperCard, setHasHelperCard] = (0,react.useState)(null); (0,react.useEffect)(()=>{ if (!isPending && !session) router.push('/login'); }, [ session, isPending ]); // Apply pending referral code after Google OAuth redirect (?ref=CODE) (0,react.useEffect)(()=>{ if (!session) return; const refCode = searchParams.get('ref'); if (!refCode) return; (0,api/* applyMyReferral */.C0)(refCode).catch(()=>{}); // Remove the ref param from the URL without reloading const params = new URLSearchParams(searchParams.toString()); params.delete('ref'); const newUrl = params.toString() ? "?".concat(params.toString()) : window.location.pathname; router.replace(newUrl); }, [ session ]); // Detect whether the user has completed their helper profile (has a card). // Used to show the getting-started onboarding card to users who haven't yet. (0,react.useEffect)(()=>{ if (!session) return; (0,api/* getMySpecialistCards */.Bb)().then((param)=>{ let { cards } = param; return setHasHelperCard(cards.length > 0); }).catch(()=>setHasHelperCard(null)); }, [ session ]); (0,react.useEffect)(()=>{ if (!session) return; Promise.all([ (0,api/* getMyTasks */.Fu)(), (0,api/* getMyOffers */.aT)(), (0,api/* getMyReviews */.q7)(), (0,api/* getNotifications */.Tr)(), (0,api/* getMyDashboard */.H)() ]).then((param)=>{ let [t, o, r, notifs, dash] = param; setTasks(t); setOffers(o); setMyReviews(r); setInvitations(notifs.filter((n)=>n.type === 'task_invite')); setDashboard(dash); }).catch(()=>{}).finally(()=>setLoading(false)); }, [ session ]); (0,react.useEffect)(()=>{ var _session_user; if (!session) return; const role = (_session_user = session.user) === null || _session_user === void 0 ? void 0 : _session_user.role; if (role === 'specialist') { (0,api/* getSpecialistFomoDashboard */.zk)().then(setFomoData).catch(()=>{}); } else { (0,api/* getCustomerFomoDashboard */.ML)().then(setFomoData).catch(()=>{}); } }, [ session ]); if (isPending || loading) return /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "text-center py-20 text-white", children: t('common.loading') }); const dateLocale = locale === 'ru' ? 'ru-RU' : locale === 'uk' ? 'uk-UA' : locale === 'en' ? 'en-US' : 'el-GR'; const activeTasks = tasks.filter((task)=>task.status !== 'completed' && task.status !== 'cancelled'); const completedTasks = tasks.filter((task)=>task.status === 'completed' || task.status === 'cancelled'); const activeOffers = offers.filter((row)=>{ const offer = row.offer || row; const task = row.task; return offer.status !== 'other_accepted' && (task === null || task === void 0 ? void 0 : task.status) !== 'completed' && (task === null || task === void 0 ? void 0 : task.status) !== 'cancelled'; }); const completedOffers = offers.filter((row)=>{ const offer = row.offer || row; const task = row.task; return offer.status === 'other_accepted' || (task === null || task === void 0 ? void 0 : task.status) === 'completed' || (task === null || task === void 0 ? void 0 : task.status) === 'cancelled'; }); function TaskCard(param) { let { task } = param; var _task_offerCount; const offerCount = (_task_offerCount = task.offerCount) !== null && _task_offerCount !== void 0 ? _task_offerCount : 0; var _task_declinedCount; const declinedCount = (_task_declinedCount = task.declinedCount) !== null && _task_declinedCount !== void 0 ? _task_declinedCount : 0; const activeOfferCount = offerCount - declinedCount; return /*#__PURE__*/ (0,jsx_runtime.jsx)((link_default()), { href: "/tasks/".concat(task.id), className: "block bg-white rounded-xl border border-gray-200 p-4 hover:shadow-sm hover:border-green-300 transition", children: /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex justify-between items-start", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "font-medium text-gray-900 truncate", children: (0,taskLocale/* taskTitle */.Oj)(task, locale) }), /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "text-xs text-gray-400 mt-1", children: new Date(task.createdAt).toLocaleDateString(dateLocale) }), offerCount > 0 && /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex items-center gap-2 mt-1.5", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("span", { className: "text-xs text-green-600 font-medium", children: [ "\uD83D\uDCBC ", offerCount, " ", t('dashboard.offers_count', 'offers') ] }), declinedCount > 0 && /*#__PURE__*/ (0,jsx_runtime.jsxs)("span", { className: "text-xs text-red-400", children: [ "✕ ", declinedCount, " ", t('dashboard.declined_count', 'declined') ] }) ] }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "ml-3 text-right shrink-0", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "text-xs px-2 py-0.5 rounded-full ".concat(task.status === 'open' ? 'bg-green-100 text-green-700' : task.status === 'in_progress' ? 'bg-green-100 text-green-700' : task.status === 'completed' ? 'bg-gray-100 text-gray-600' : 'bg-red-100 text-red-600'), children: t("task.status.".concat(task.status), task.status) }), task.budget && /*#__PURE__*/ (0,jsx_runtime.jsxs)("p", { className: "text-sm font-bold text-green-600 mt-1", children: [ (0,taskLocale/* formatPrice */.$g)(task.budget), "€" ] }) ] }) ] }) }); } function OfferCard(param) { let { row } = param; var _myReviews_find; const offer = row.offer || row; const task = row.task; var _myReviews_find_review; const reviewReceived = (task === null || task === void 0 ? void 0 : task.status) === 'completed' && offer.status === 'accepted' ? (_myReviews_find_review = (_myReviews_find = myReviews.find((r)=>{ var _r_review; return ((_r_review = r.review) === null || _r_review === void 0 ? void 0 : _r_review.taskId) === (task === null || task === void 0 ? void 0 : task.id); })) === null || _myReviews_find === void 0 ? void 0 : _myReviews_find.review) !== null && _myReviews_find_review !== void 0 ? _myReviews_find_review : null : null; return /*#__PURE__*/ (0,jsx_runtime.jsxs)((link_default()), { href: task ? "/tasks/".concat(task.id) : '#', className: "block bg-white rounded-xl border border-gray-200 p-4 hover:shadow-sm hover:border-green-300 transition", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex justify-between items-start", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "font-medium text-gray-900 truncate", children: (task === null || task === void 0 ? void 0 : task.title) || t('chat.task_fallback') }), /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "text-xs text-gray-400 mt-1", children: new Date(offer.createdAt).toLocaleDateString(dateLocale) }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "ml-3 text-right shrink-0", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("p", { className: "font-bold text-green-600", children: [ (0,taskLocale/* formatPrice */.$g)(offer.price), "€" ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "text-xs px-2 py-0.5 rounded-full mt-1 inline-block ".concat(offer.status === 'accepted' ? 'bg-green-100 text-green-700' : offer.status === 'declined' ? 'bg-red-100 text-red-700' : offer.status === 'other_accepted' ? 'bg-green-100 text-green-600' : 'bg-gray-100 text-gray-700'), children: t("offer.status.".concat(offer.status), offer.status) }) ] }) ] }), reviewReceived && /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "mt-3 pt-3 border-t border-gray-100 flex items-center gap-2", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "flex gap-0.5", children: [ 1, 2, 3, 4, 5 ].map((star)=>/*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "text-sm ".concat(star <= reviewReceived.rating ? 'text-yellow-400' : 'text-gray-200'), children: "★" }, star)) }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("span", { className: "text-sm font-semibold text-gray-700", children: [ reviewReceived.rating, "/5" ] }), reviewReceived.comment && /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "text-xs text-gray-500 truncate", children: reviewReceived.comment }) ] }), (task === null || task === void 0 ? void 0 : task.status) === 'completed' && offer.status === 'accepted' && !reviewReceived && /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "mt-2 text-xs text-gray-400", children: t('dashboard.review_pending') }) ] }); } const isSpecialist = (session === null || session === void 0 ? void 0 : (_session_user = session.user) === null || _session_user === void 0 ? void 0 : _session_user.role) === 'specialist'; var _fomoData_missedCount; return /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "max-w-5xl mx-auto px-4 py-8", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex justify-between items-center mb-8", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("h1", { className: "text-2xl font-bold text-white", children: t('dashboard.title') }), /*#__PURE__*/ (0,jsx_runtime.jsx)((link_default()), { href: "/tasks/new", className: "bg-green-600 text-white px-4 py-2 rounded-lg text-sm font-medium hover:bg-green-700", children: t('dashboard.new_task') }) ] }), hasHelperCard === false && /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "mb-6 bg-white rounded-2xl border border-gray-200 overflow-hidden", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "px-5 pt-5 pb-3", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("h2", { className: "text-lg font-bold text-gray-900", children: t('dashboard.onboarding.title') }), /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "text-sm text-gray-500 mt-1", children: t('dashboard.onboarding.subtitle') }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "grid sm:grid-cols-2 gap-3 p-5 pt-2", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)((link_default()), { href: "/specialist-setup", className: "group flex flex-col rounded-xl border-2 border-green-500 bg-green-50 p-4 hover:bg-green-100 transition", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex items-center gap-2 mb-1", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "text-xl", children: "\uD83D\uDEE0" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "font-semibold text-gray-800", children: t('dashboard.onboarding.helper.title') }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "text-sm text-green-700/80 mb-3 flex-1", children: t('dashboard.onboarding.helper.desc') }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("span", { className: "inline-flex items-center gap-1 text-sm font-semibold text-green-700", children: [ t('dashboard.onboarding.helper.cta'), " →" ] }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)((link_default()), { href: "/tasks/new", className: "group flex flex-col rounded-xl border border-gray-200 bg-gray-50 p-4 hover:bg-gray-100 transition", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex items-center gap-2 mb-1", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "text-xl", children: "\uD83D\uDCDD" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "font-semibold text-gray-800", children: t('dashboard.onboarding.requester.title') }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "text-sm text-gray-500 mb-3 flex-1", children: t('dashboard.onboarding.requester.desc') }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("span", { className: "inline-flex items-center gap-1 text-sm font-semibold text-gray-700", children: [ t('dashboard.onboarding.requester.cta'), " →" ] }) ] }) ] }) ] }), dashboard && /*#__PURE__*/ (0,jsx_runtime.jsx)(PlanBlock, { dashboard: dashboard, t: t }), fomoData && (isSpecialist ? (fomoData.missedCount > 0 || fomoData.missedEarnings > 0) && /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "mb-6 bg-amber-50 border border-amber-200 rounded-xl px-5 py-4 flex items-start gap-3", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "shrink-0 mt-0.5", children: /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { className: "w-5 h-5 text-amber-500", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 9v2m0 4h.01M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z" }) }) }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("p", { className: "text-base font-semibold text-amber-800", children: [ t('fomo.specialist_missed', 'You missed {n} tasks').replace('{n}', String((_fomoData_missedCount = fomoData.missedCount) !== null && _fomoData_missedCount !== void 0 ? _fomoData_missedCount : 0)), fomoData.missedEarnings > 0 && /*#__PURE__*/ (0,jsx_runtime.jsxs)("span", { className: "ml-1 text-amber-600", children: [ "for €", fomoData.missedEarnings ] }) ] }), ((_fomoData_topCategories = fomoData.topCategories) === null || _fomoData_topCategories === void 0 ? void 0 : _fomoData_topCategories.length) > 0 && /*#__PURE__*/ (0,jsx_runtime.jsxs)("p", { className: "text-sm text-amber-600 mt-0.5", children: [ t('fomo.top_categories', 'Categories'), ": ", fomoData.topCategories.slice(0, 3).join(', ') ] }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)((link_default()), { href: "/pricing", className: "shrink-0 text-xs font-medium text-amber-700 bg-amber-100 px-3 py-1.5 rounded-lg hover:bg-amber-200 transition", children: t('dashboard.plan.upgrade') }) ] }) : fomoData.totalTasks > 0 && /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "mb-6 bg-green-50 border border-green-200 rounded-xl px-5 py-4", children: /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex items-center justify-between gap-4 flex-wrap", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex items-center gap-3", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "shrink-0 bg-green-100 rounded-xl p-2", children: /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { className: "w-5 h-5 text-green-600", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,jsx_runtime.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" }) }) }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("p", { className: "text-base font-semibold text-gray-800", children: [ fomoData.totalOffers, " ", t('fomo.offers_received', 'offers received') ] }), fomoData.avgOffersPerTask > 0 && /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "text-sm text-gray-500", children: t('fomo.avg_offers', 'Average {n}/task').replace('{n}', Number(fomoData.avgOffersPerTask).toFixed(1)) }) ] }) ] }), fomoData.completionRate !== undefined && /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "text-right", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("p", { className: "text-2xl font-bold text-green-700", children: [ Math.round(fomoData.completionRate * 100), "%" ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "text-sm text-gray-400", children: t('fomo.completion_rate', 'completed') }) ] }) ] }) })), isSpecialist && /*#__PURE__*/ (0,jsx_runtime.jsxs)((link_default()), { href: "/tasks", className: "flex items-center justify-between gap-4 bg-green-600 text-white rounded-xl px-5 py-4 mb-8 hover:bg-green-700 transition", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex items-center gap-4", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "shrink-0 bg-white/20 rounded-xl p-2.5", children: /*#__PURE__*/ (0,jsx_runtime.jsxs)("svg", { className: "w-6 h-6 text-white", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("circle", { cx: "11", cy: "11", r: "7" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M21 21l-4.35-4.35" }) ] }) }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "font-semibold text-base", children: t('find_tasks.title') }), /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "text-green-100 text-sm mt-0.5", children: t('find_tasks.banner_hint') }) ] }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { className: "w-5 h-5 shrink-0 text-white/70", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 5l7 7-7 7" }) }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "grid md:grid-cols-2 gap-8", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "space-y-8", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("h2", { className: "text-lg font-semibold text-white mb-4", children: [ t('dashboard.my_tasks'), " ", /*#__PURE__*/ (0,jsx_runtime.jsxs)("span", { className: "text-white/60 font-normal text-base", children: [ "(", activeTasks.length, ")" ] }) ] }), activeTasks.length === 0 ? /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-6 text-center text-gray-500", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { children: t('dashboard.tasks.empty') }), /*#__PURE__*/ (0,jsx_runtime.jsx)((link_default()), { href: "/tasks/new", className: "text-green-600 hover:underline text-sm mt-2 inline-block", children: t('dashboard.tasks.empty.cta') }) ] }) : /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "space-y-3", children: activeTasks.map((task)=>/*#__PURE__*/ (0,jsx_runtime.jsx)(TaskCard, { task: task }, task.id)) }) ] }), completedTasks.length > 0 && /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("h2", { className: "text-lg font-semibold text-white/70 mb-4", children: [ t('dashboard.completed_tasks'), " ", /*#__PURE__*/ (0,jsx_runtime.jsxs)("span", { className: "font-normal text-base text-white/50", children: [ "(", completedTasks.length, ")" ] }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "space-y-3 opacity-75", children: completedTasks.map((task)=>/*#__PURE__*/ (0,jsx_runtime.jsx)(TaskCard, { task: task }, task.id)) }) ] }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "space-y-8", children: isSpecialist ? /*#__PURE__*/ (0,jsx_runtime.jsxs)(jsx_runtime.Fragment, { children: [ invitations.length > 0 && /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("h2", { className: "text-lg font-semibold text-white mb-4", children: [ t('dashboard.invitations'), " ", /*#__PURE__*/ (0,jsx_runtime.jsxs)("span", { className: "text-white/60 font-normal text-base", children: [ "(", invitations.length, ")" ] }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "space-y-3", children: invitations.map((inv)=>/*#__PURE__*/ (0,jsx_runtime.jsxs)((link_default()), { href: inv.referenceId ? "/tasks/".concat(inv.referenceId) : '/tasks', className: "flex items-start gap-3 p-4 rounded-xl border transition cursor-pointer ".concat(inv.isRead ? 'bg-white/90 border-white/20 hover:bg-white' : 'bg-white border-amber-300 shadow-sm hover:bg-amber-50'), children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "text-2xl", children: "\uD83D\uDCCB" }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "font-medium truncate ".concat(inv.isRead ? 'text-gray-600' : 'text-gray-900'), children: t('notif.type.task_invite', inv.title) }), inv.body && /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "text-sm text-gray-500 mt-0.5 truncate", children: (()=>{ const title = extractNotifParam(inv.body); const tpl = t('notif.body.task_invite', ''); return title && tpl ? tpl.replace('{title}', title) : inv.body; })() }), /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "text-xs text-gray-400 mt-1", children: new Date(inv.createdAt).toLocaleDateString(dateLocale) }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex flex-col items-end gap-1.5 shrink-0", children: [ !inv.isRead && /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "w-2 h-2 bg-amber-400 rounded-full mt-2" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "text-xs text-gray-400", children: "→" }) ] }) ] }, inv.id)) }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("h2", { className: "text-lg font-semibold text-white mb-4", children: [ t('dashboard.my_offers'), " ", /*#__PURE__*/ (0,jsx_runtime.jsxs)("span", { className: "text-white/60 font-normal text-base", children: [ "(", activeOffers.length, ")" ] }) ] }), activeOffers.length === 0 ? /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-6 text-center text-gray-500", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { children: t('dashboard.offers.empty') }), /*#__PURE__*/ (0,jsx_runtime.jsx)((link_default()), { href: "/tasks", className: "text-green-600 hover:underline text-sm mt-2 inline-block", children: t('dashboard.offers.empty.cta') }) ] }) : /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "space-y-3", children: activeOffers.map((row)=>/*#__PURE__*/ (0,jsx_runtime.jsx)(OfferCard, { row: row }, (row.offer || row).id)) }) ] }), completedOffers.length > 0 && /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("h2", { className: "text-lg font-semibold text-white/70 mb-4", children: [ t('dashboard.completed_offers'), " ", /*#__PURE__*/ (0,jsx_runtime.jsxs)("span", { className: "font-normal text-base text-white/50", children: [ "(", completedOffers.length, ")" ] }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "space-y-3 opacity-75", children: completedOffers.map((row)=>/*#__PURE__*/ (0,jsx_runtime.jsx)(OfferCard, { row: row }, (row.offer || row).id)) }) ] }) ] }) : /*#__PURE__*/ (0,jsx_runtime.jsxs)(jsx_runtime.Fragment, { children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)((link_default()), { href: "/specialists", className: "flex items-center justify-between gap-4 bg-green-600 text-white rounded-xl px-5 py-4 hover:bg-green-700 transition", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex items-center gap-4", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "shrink-0 bg-white/20 rounded-xl p-2.5", children: /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { className: "w-6 h-6 text-white", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,jsx_runtime.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" }) }) }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "font-semibold text-base", children: t('dashboard.customer.specialists_title') }), /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "text-green-100 text-sm mt-0.5", children: t('dashboard.customer.specialists_hint') }) ] }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { className: "w-5 h-5 shrink-0 text-white/70", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 5l7 7-7 7" }) }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-5", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("h2", { className: "text-base font-semibold text-gray-800 mb-4", children: t('dashboard.customer.how_title') }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "space-y-3", children: [ { num: '1', text: t('dashboard.customer.step1'), icon: 'M12 4v16m8-8H4' }, { num: '2', text: t('dashboard.customer.step2'), icon: 'M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z' }, { num: '3', text: t('dashboard.customer.step3'), icon: 'M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z' } ].map((param)=>{ let { num, text, icon } = param; return /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex items-start gap-3", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "shrink-0 w-7 h-7 rounded-full bg-green-100 text-green-600 text-sm font-bold flex items-center justify-center", children: num }), /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "text-sm text-gray-600 pt-1", children: text }) ] }, num); }) }), /*#__PURE__*/ (0,jsx_runtime.jsxs)((link_default()), { href: "/tasks/new", className: "mt-4 inline-block text-sm font-medium text-green-600 hover:underline", children: [ tasks.length > 0 ? t('dashboard.tasks.add_new') : t('dashboard.tasks.empty.cta'), " →" ] }) ] }) ] }) }) ] }) ] }); } €”{"finalSource":true}ƒmap‹bufferedMap ` ConcatSourceRawSource‘// ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); // EXPORTS __webpack_require__.d(__webpack_exports__, { "default": () => (/* binding */ DashboardPage) }); // EXTERNAL MODULE: ../../node_modules/next/dist/compiled/react/jsx-runtime.js var jsx_runtime = __webpack_require__(4568); // EXTERNAL MODULE: ../../node_modules/next/dist/compiled/react/index.js var react = __webpack_require__(7620); // EXTERNAL MODULE: ../../node_modules/next/dist/api/navigation.js var navigation = __webpack_require__(7541); // EXTERNAL MODULE: ../../node_modules/next/dist/client/app-dir/link.js var app_dir_link = __webpack_require__(9664); var link_default = /*#__PURE__*/__webpack_require__.n(app_dir_link); // EXTERNAL MODULE: ./src/lib/auth.ts var auth = __webpack_require__(1592); // EXTERNAL MODULE: ./src/context/locale.tsx var context_locale = __webpack_require__(9906); // EXTERNAL MODULE: ./src/lib/api.ts var api = __webpack_require__(2982); // EXTERNAL MODULE: ./src/lib/taskLocale.ts var taskLocale = __webpack_require__(4017); // EXTERNAL MODULE: ./src/components/PlanBadge.tsx var PlanBadge = __webpack_require__(2035); ;// ./src/components/UsageMeter.tsx  ReplaceSourceReplaceSourceRawSource~ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; export function UsageMeter(param) { let { current, limit, label, className = '' } = param; if (limit === null) { return /*#__PURE__*/ _jsxs("div", { className: "".concat(className), children: [ /*#__PURE__*/ _jsxs("div", { className: "flex justify-between items-center mb-1", children: [ /*#__PURE__*/ _jsx("span", { className: "text-xs text-gray-500", children: label }), /*#__PURE__*/ _jsx("span", { className: "text-xs font-semibold text-green-600", children: "∞" }) ] }), /*#__PURE__*/ _jsx("div", { className: "h-1.5 rounded-full bg-green-100", children: /*#__PURE__*/ _jsx("div", { className: "h-full w-full rounded-full bg-green-400" }) }) ] }); } const pct = limit > 0 ? Math.min(100, Math.round(current / limit * 100)) : 100; const remaining = Math.max(0, limit - current); const barColor = pct >= 100 ? 'bg-red-500' : pct >= 80 ? 'bg-amber-400' : 'bg-green-500'; const textColor = pct >= 100 ? 'text-red-600' : pct >= 80 ? 'text-amber-600' : 'text-gray-600'; return /*#__PURE__*/ _jsxs("div", { className: className, children: [ /*#__PURE__*/ _jsxs("div", { className: "flex justify-between items-center mb-1", children: [ /*#__PURE__*/ _jsx("span", { className: "text-xs text-gray-500", children: label }), /*#__PURE__*/ _jsxs("span", { className: "text-xs font-semibold ".concat(textColor), children: [ remaining, " / ", limit ] }) ] }), /*#__PURE__*/ _jsx("div", { className: "h-1.5 rounded-full bg-gray-100", children: /*#__PURE__*/ _jsx("div", { className: "h-full rounded-full transition-all ".concat(barColor), style: { width: "".concat(pct, "%") } }) }) ] }); } i062undefined6470undefined214218__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined328332__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined486489__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined675678__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined910913__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined10341037__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined15541558__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined16451649__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined17911794__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined19641968__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined23122315__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined24272430__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined¶144220(0,jsx_runtime.jsxs)undefined330406(0,jsx_runtime.jsxs)undefined560634(0,jsx_runtime.jsx)undefined820894(0,jsx_runtime.jsx)undefined11261200(0,jsx_runtime.jsx)undefined13211395(0,jsx_runtime.jsx)undefined19121988(0,jsx_runtime.jsxs)undefined20752151(0,jsx_runtime.jsxs)undefined22932367(0,jsx_runtime.jsx)undefined25372613(0,jsx_runtime.jsxs)undefined29573031(0,jsx_runtime.jsx)undefined31433217(0,jsx_runtime.jsx)undefinedRawSource" ;// ./src/app/dashboard/page.tsx úûÉÞ/* __next_internal_client_entry_do_not_use__ default auto */ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime"; import { useEffect, useState } from 'react'; import { useRouter, useSearchParams } from 'next/navigation'; import Link from 'next/link'; import { useSession } from '@/lib/auth'; import { useLocale } from '@/context/locale'; import { getMyTasks, getMyOffers, getMyReviews, getNotifications, getMyDashboard, getSpecialistFomoDashboard, getCustomerFomoDashboard, getMySpecialistCards, applyMyReferral } from '@/lib/api'; import { formatPrice, taskTitle } from '@/lib/taskLocale'; import { PlanBadge } from '@/components/PlanBadge'; import { UsageMeter } from '@/components/UsageMeter'; /** Extract the quoted task title from a stored notification body (any locale) */ function extractNotifParam(body) { if (!body) return null; const m = body.match(/[«""](.+?)[»""]/); var _m_; return (_m_ = m === null || m === void 0 ? void 0 : m[1]) !== null && _m_ !== void 0 ? _m_ : null; } function PlanBlock(param) { let { dashboard, t } = param; const plan = dashboard.plan; const expiry = dashboard.planExpiration; const usage = dashboard.usage; const stats = dashboard.stats; const expiryPct = expiry ? Math.max(0, Math.min(100, Math.round(expiry.daysLeft / 30 * 100))) : 100; const expiryColor = expiry ? expiry.daysLeft <= 3 ? 'bg-red-500' : expiry.daysLeft <= 7 ? 'bg-amber-400' : 'bg-green-400' : 'bg-green-400'; return /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-2xl border border-gray-200 p-5 mb-6", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between mb-4", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2", children: [ /*#__PURE__*/ _jsx("h2", { className: "font-semibold text-gray-800 text-sm", children: t('dashboard.plan.title', 'My Plan') }), plan ? /*#__PURE__*/ _jsx(PlanBadge, { tier: plan.tier, size: "sm" }) : /*#__PURE__*/ _jsx("span", { className: "text-xs text-gray-400", children: t('dashboard.plan.no_plan', 'Free') }) ] }), /*#__PURE__*/ _jsx(Link, { href: "/pricing", className: "text-xs font-medium text-green-600 hover:underline", children: (plan === null || plan === void 0 ? void 0 : plan.tier) === 'ultimate' ? null : t('dashboard.plan.upgrade', 'Upgrade') }) ] }), expiry && /*#__PURE__*/ _jsxs("div", { className: "mb-4", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex justify-between text-xs text-gray-500 mb-1", children: [ /*#__PURE__*/ _jsx("span", { children: t('dashboard.plan.expires', 'Expires in {n} days').replace('{n}', String(expiry.daysLeft)) }), /*#__PURE__*/ _jsxs("span", { children: [ expiry.daysLeft, " ", t('pricing.days', 'days') ] }) ] }), /*#__PURE__*/ _jsx("div", { className: "h-1.5 rounded-full bg-gray-100", children: /*#__PURE__*/ _jsx("div", { className: "h-full rounded-full transition-all ".concat(expiryColor), style: { width: "".concat(expiryPct, "%") } }) }) ] }), (usage.messagesSent !== undefined || usage.ordersMade !== undefined) && /*#__PURE__*/ _jsxs("div", { className: "space-y-2 mb-4", children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs font-medium text-gray-500 uppercase tracking-wide", children: t('dashboard.plan.limits', 'Daily limits') }), /*#__PURE__*/ _jsx(UsageMeter, { current: usage.messagesSent, limit: usage.messagesLeft !== null ? usage.messagesSent + usage.messagesLeft : null, label: t('dashboard.plan.messages', 'Messages') }), /*#__PURE__*/ _jsx(UsageMeter, { current: usage.ordersMade, limit: usage.ordersLeft !== null ? usage.ordersMade + usage.ordersLeft : null, label: t('dashboard.plan.orders', 'Orders') }) ] }), Object.keys(stats).length > 0 && /*#__PURE__*/ _jsx("div", { className: "grid grid-cols-2 gap-2", children: Object.entries(stats).map((param)=>{ let [key, val] = param; return /*#__PURE__*/ _jsxs("div", { className: "bg-gray-50 rounded-xl px-3 py-2 text-center", children: [ /*#__PURE__*/ _jsx("p", { className: "text-lg font-bold text-gray-800", children: val }), /*#__PURE__*/ _jsx("p", { className: "text-[10px] text-gray-400 uppercase tracking-wide", children: t("dashboard.stats.".concat(key), key) }) ] }, key); }) }) ] }); } export default function DashboardPage() { var _session_user, _fomoData_topCategories; const { data: session, isPending } = useSession(); const router = useRouter(); const searchParams = useSearchParams(); const { t, locale } = useLocale(); const [tasks, setTasks] = useState([]); const [offers, setOffers] = useState([]); const [myReviews, setMyReviews] = useState([]); const [invitations, setInvitations] = useState([]); const [loading, setLoading] = useState(true); const [dashboard, setDashboard] = useState(null); const [fomoData, setFomoData] = useState(null); const [hasHelperCard, setHasHelperCard] = useState(null); useEffect(()=>{ if (!isPending && !session) router.push('/login'); }, [ session, isPending ]); // Apply pending referral code after Google OAuth redirect (?ref=CODE) useEffect(()=>{ if (!session) return; const refCode = searchParams.get('ref'); if (!refCode) return; applyMyReferral(refCode).catch(()=>{}); // Remove the ref param from the URL without reloading const params = new URLSearchParams(searchParams.toString()); params.delete('ref'); const newUrl = params.toString() ? "?".concat(params.toString()) : window.location.pathname; router.replace(newUrl); }, [ session ]); // Detect whether the user has completed their helper profile (has a card). // Used to show the getting-started onboarding card to users who haven't yet. useEffect(()=>{ if (!session) return; getMySpecialistCards().then((param)=>{ let { cards } = param; return setHasHelperCard(cards.length > 0); }).catch(()=>setHasHelperCard(null)); }, [ session ]); useEffect(()=>{ if (!session) return; Promise.all([ getMyTasks(), getMyOffers(), getMyReviews(), getNotifications(), getMyDashboard() ]).then((param)=>{ let [t, o, r, notifs, dash] = param; setTasks(t); setOffers(o); setMyReviews(r); setInvitations(notifs.filter((n)=>n.type === 'task_invite')); setDashboard(dash); }).catch(()=>{}).finally(()=>setLoading(false)); }, [ session ]); useEffect(()=>{ var _session_user; if (!session) return; const role = (_session_user = session.user) === null || _session_user === void 0 ? void 0 : _session_user.role; if (role === 'specialist') { getSpecialistFomoDashboard().then(setFomoData).catch(()=>{}); } else { getCustomerFomoDashboard().then(setFomoData).catch(()=>{}); } }, [ session ]); if (isPending || loading) return /*#__PURE__*/ _jsx("div", { className: "text-center py-20 text-white", children: t('common.loading') }); const dateLocale = locale === 'ru' ? 'ru-RU' : locale === 'uk' ? 'uk-UA' : locale === 'en' ? 'en-US' : 'el-GR'; const activeTasks = tasks.filter((task)=>task.status !== 'completed' && task.status !== 'cancelled'); const completedTasks = tasks.filter((task)=>task.status === 'completed' || task.status === 'cancelled'); const activeOffers = offers.filter((row)=>{ const offer = row.offer || row; const task = row.task; return offer.status !== 'other_accepted' && (task === null || task === void 0 ? void 0 : task.status) !== 'completed' && (task === null || task === void 0 ? void 0 : task.status) !== 'cancelled'; }); const completedOffers = offers.filter((row)=>{ const offer = row.offer || row; const task = row.task; return offer.status === 'other_accepted' || (task === null || task === void 0 ? void 0 : task.status) === 'completed' || (task === null || task === void 0 ? void 0 : task.status) === 'cancelled'; }); function TaskCard(param) { let { task } = param; var _task_offerCount; const offerCount = (_task_offerCount = task.offerCount) !== null && _task_offerCount !== void 0 ? _task_offerCount : 0; var _task_declinedCount; const declinedCount = (_task_declinedCount = task.declinedCount) !== null && _task_declinedCount !== void 0 ? _task_declinedCount : 0; const activeOfferCount = offerCount - declinedCount; return /*#__PURE__*/ _jsx(Link, { href: "/tasks/".concat(task.id), className: "block bg-white rounded-xl border border-gray-200 p-4 hover:shadow-sm hover:border-green-300 transition", children: /*#__PURE__*/ _jsxs("div", { className: "flex justify-between items-start", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ _jsx("p", { className: "font-medium text-gray-900 truncate", children: taskTitle(task, locale) }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-1", children: new Date(task.createdAt).toLocaleDateString(dateLocale) }), offerCount > 0 && /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 mt-1.5", children: [ /*#__PURE__*/ _jsxs("span", { className: "text-xs text-green-600 font-medium", children: [ "\uD83D\uDCBC ", offerCount, " ", t('dashboard.offers_count', 'offers') ] }), declinedCount > 0 && /*#__PURE__*/ _jsxs("span", { className: "text-xs text-red-400", children: [ "✕ ", declinedCount, " ", t('dashboard.declined_count', 'declined') ] }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "ml-3 text-right shrink-0", children: [ /*#__PURE__*/ _jsx("span", { className: "text-xs px-2 py-0.5 rounded-full ".concat(task.status === 'open' ? 'bg-green-100 text-green-700' : task.status === 'in_progress' ? 'bg-green-100 text-green-700' : task.status === 'completed' ? 'bg-gray-100 text-gray-600' : 'bg-red-100 text-red-600'), children: t("task.status.".concat(task.status), task.status) }), task.budget && /*#__PURE__*/ _jsxs("p", { className: "text-sm font-bold text-green-600 mt-1", children: [ formatPrice(task.budget), "€" ] }) ] }) ] }) }); } function OfferCard(param) { let { row } = param; var _myReviews_find; const offer = row.offer || row; const task = row.task; var _myReviews_find_review; const reviewReceived = (task === null || task === void 0 ? void 0 : task.status) === 'completed' && offer.status === 'accepted' ? (_myReviews_find_review = (_myReviews_find = myReviews.find((r)=>{ var _r_review; return ((_r_review = r.review) === null || _r_review === void 0 ? void 0 : _r_review.taskId) === (task === null || task === void 0 ? void 0 : task.id); })) === null || _myReviews_find === void 0 ? void 0 : _myReviews_find.review) !== null && _myReviews_find_review !== void 0 ? _myReviews_find_review : null : null; return /*#__PURE__*/ _jsxs(Link, { href: task ? "/tasks/".concat(task.id) : '#', className: "block bg-white rounded-xl border border-gray-200 p-4 hover:shadow-sm hover:border-green-300 transition", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex justify-between items-start", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ _jsx("p", { className: "font-medium text-gray-900 truncate", children: (task === null || task === void 0 ? void 0 : task.title) || t('chat.task_fallback') }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-1", children: new Date(offer.createdAt).toLocaleDateString(dateLocale) }) ] }), /*#__PURE__*/ _jsxs("div", { className: "ml-3 text-right shrink-0", children: [ /*#__PURE__*/ _jsxs("p", { className: "font-bold text-green-600", children: [ formatPrice(offer.price), "€" ] }), /*#__PURE__*/ _jsx("span", { className: "text-xs px-2 py-0.5 rounded-full mt-1 inline-block ".concat(offer.status === 'accepted' ? 'bg-green-100 text-green-700' : offer.status === 'declined' ? 'bg-red-100 text-red-700' : offer.status === 'other_accepted' ? 'bg-green-100 text-green-600' : 'bg-gray-100 text-gray-700'), children: t("offer.status.".concat(offer.status), offer.status) }) ] }) ] }), reviewReceived && /*#__PURE__*/ _jsxs("div", { className: "mt-3 pt-3 border-t border-gray-100 flex items-center gap-2", children: [ /*#__PURE__*/ _jsx("div", { className: "flex gap-0.5", children: [ 1, 2, 3, 4, 5 ].map((star)=>/*#__PURE__*/ _jsx("span", { className: "text-sm ".concat(star <= reviewReceived.rating ? 'text-yellow-400' : 'text-gray-200'), children: "★" }, star)) }), /*#__PURE__*/ _jsxs("span", { className: "text-sm font-semibold text-gray-700", children: [ reviewReceived.rating, "/5" ] }), reviewReceived.comment && /*#__PURE__*/ _jsx("span", { className: "text-xs text-gray-500 truncate", children: reviewReceived.comment }) ] }), (task === null || task === void 0 ? void 0 : task.status) === 'completed' && offer.status === 'accepted' && !reviewReceived && /*#__PURE__*/ _jsx("p", { className: "mt-2 text-xs text-gray-400", children: t('dashboard.review_pending') }) ] }); } const isSpecialist = (session === null || session === void 0 ? void 0 : (_session_user = session.user) === null || _session_user === void 0 ? void 0 : _session_user.role) === 'specialist'; var _fomoData_missedCount; return /*#__PURE__*/ _jsxs("div", { className: "max-w-5xl mx-auto px-4 py-8", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex justify-between items-center mb-8", children: [ /*#__PURE__*/ _jsx("h1", { className: "text-2xl font-bold text-white", children: t('dashboard.title') }), /*#__PURE__*/ _jsx(Link, { href: "/tasks/new", className: "bg-green-600 text-white px-4 py-2 rounded-lg text-sm font-medium hover:bg-green-700", children: t('dashboard.new_task') }) ] }), hasHelperCard === false && /*#__PURE__*/ _jsxs("div", { className: "mb-6 bg-white rounded-2xl border border-gray-200 overflow-hidden", children: [ /*#__PURE__*/ _jsxs("div", { className: "px-5 pt-5 pb-3", children: [ /*#__PURE__*/ _jsx("h2", { className: "text-lg font-bold text-gray-900", children: t('dashboard.onboarding.title') }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-500 mt-1", children: t('dashboard.onboarding.subtitle') }) ] }), /*#__PURE__*/ _jsxs("div", { className: "grid sm:grid-cols-2 gap-3 p-5 pt-2", children: [ /*#__PURE__*/ _jsxs(Link, { href: "/specialist-setup", className: "group flex flex-col rounded-xl border-2 border-green-500 bg-green-50 p-4 hover:bg-green-100 transition", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 mb-1", children: [ /*#__PURE__*/ _jsx("span", { className: "text-xl", children: "\uD83D\uDEE0" }), /*#__PURE__*/ _jsx("span", { className: "font-semibold text-gray-800", children: t('dashboard.onboarding.helper.title') }) ] }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-green-700/80 mb-3 flex-1", children: t('dashboard.onboarding.helper.desc') }), /*#__PURE__*/ _jsxs("span", { className: "inline-flex items-center gap-1 text-sm font-semibold text-green-700", children: [ t('dashboard.onboarding.helper.cta'), " →" ] }) ] }), /*#__PURE__*/ _jsxs(Link, { href: "/tasks/new", className: "group flex flex-col rounded-xl border border-gray-200 bg-gray-50 p-4 hover:bg-gray-100 transition", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 mb-1", children: [ /*#__PURE__*/ _jsx("span", { className: "text-xl", children: "\uD83D\uDCDD" }), /*#__PURE__*/ _jsx("span", { className: "font-semibold text-gray-800", children: t('dashboard.onboarding.requester.title') }) ] }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-500 mb-3 flex-1", children: t('dashboard.onboarding.requester.desc') }), /*#__PURE__*/ _jsxs("span", { className: "inline-flex items-center gap-1 text-sm font-semibold text-gray-700", children: [ t('dashboard.onboarding.requester.cta'), " →" ] }) ] }) ] }) ] }), dashboard && /*#__PURE__*/ _jsx(PlanBlock, { dashboard: dashboard, t: t }), fomoData && (isSpecialist ? (fomoData.missedCount > 0 || fomoData.missedEarnings > 0) && /*#__PURE__*/ _jsxs("div", { className: "mb-6 bg-amber-50 border border-amber-200 rounded-xl px-5 py-4 flex items-start gap-3", children: [ /*#__PURE__*/ _jsx("div", { className: "shrink-0 mt-0.5", children: /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5 text-amber-500", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 9v2m0 4h.01M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z" }) }) }), /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ _jsxs("p", { className: "text-base font-semibold text-amber-800", children: [ t('fomo.specialist_missed', 'You missed {n} tasks').replace('{n}', String((_fomoData_missedCount = fomoData.missedCount) !== null && _fomoData_missedCount !== void 0 ? _fomoData_missedCount : 0)), fomoData.missedEarnings > 0 && /*#__PURE__*/ _jsxs("span", { className: "ml-1 text-amber-600", children: [ "for €", fomoData.missedEarnings ] }) ] }), ((_fomoData_topCategories = fomoData.topCategories) === null || _fomoData_topCategories === void 0 ? void 0 : _fomoData_topCategories.length) > 0 && /*#__PURE__*/ _jsxs("p", { className: "text-sm text-amber-600 mt-0.5", children: [ t('fomo.top_categories', 'Categories'), ": ", fomoData.topCategories.slice(0, 3).join(', ') ] }) ] }), /*#__PURE__*/ _jsx(Link, { href: "/pricing", className: "shrink-0 text-xs font-medium text-amber-700 bg-amber-100 px-3 py-1.5 rounded-lg hover:bg-amber-200 transition", children: t('dashboard.plan.upgrade') }) ] }) : fomoData.totalTasks > 0 && /*#__PURE__*/ _jsx("div", { className: "mb-6 bg-green-50 border border-green-200 rounded-xl px-5 py-4", children: /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between gap-4 flex-wrap", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3", children: [ /*#__PURE__*/ _jsx("div", { className: "shrink-0 bg-green-100 rounded-xl p-2", children: /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5 text-green-600", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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" }) }) }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("p", { className: "text-base font-semibold text-gray-800", children: [ fomoData.totalOffers, " ", t('fomo.offers_received', 'offers received') ] }), fomoData.avgOffersPerTask > 0 && /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-500", children: t('fomo.avg_offers', 'Average {n}/task').replace('{n}', Number(fomoData.avgOffersPerTask).toFixed(1)) }) ] }) ] }), fomoData.completionRate !== undefined && /*#__PURE__*/ _jsxs("div", { className: "text-right", children: [ /*#__PURE__*/ _jsxs("p", { className: "text-2xl font-bold text-green-700", children: [ Math.round(fomoData.completionRate * 100), "%" ] }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-400", children: t('fomo.completion_rate', 'completed') }) ] }) ] }) })), isSpecialist && /*#__PURE__*/ _jsxs(Link, { href: "/tasks", className: "flex items-center justify-between gap-4 bg-green-600 text-white rounded-xl px-5 py-4 mb-8 hover:bg-green-700 transition", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-4", children: [ /*#__PURE__*/ _jsx("div", { className: "shrink-0 bg-white/20 rounded-xl p-2.5", children: /*#__PURE__*/ _jsxs("svg", { className: "w-6 h-6 text-white", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ _jsx("circle", { cx: "11", cy: "11", r: "7" }), /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M21 21l-4.35-4.35" }) ] }) }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "font-semibold text-base", children: t('find_tasks.title') }), /*#__PURE__*/ _jsx("p", { className: "text-green-100 text-sm mt-0.5", children: t('find_tasks.banner_hint') }) ] }) ] }), /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5 shrink-0 text-white/70", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 5l7 7-7 7" }) }) ] }), /*#__PURE__*/ _jsxs("div", { className: "grid md:grid-cols-2 gap-8", children: [ /*#__PURE__*/ _jsxs("div", { className: "space-y-8", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("h2", { className: "text-lg font-semibold text-white mb-4", children: [ t('dashboard.my_tasks'), " ", /*#__PURE__*/ _jsxs("span", { className: "text-white/60 font-normal text-base", children: [ "(", activeTasks.length, ")" ] }) ] }), activeTasks.length === 0 ? /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6 text-center text-gray-500", children: [ /*#__PURE__*/ _jsx("p", { children: t('dashboard.tasks.empty') }), /*#__PURE__*/ _jsx(Link, { href: "/tasks/new", className: "text-green-600 hover:underline text-sm mt-2 inline-block", children: t('dashboard.tasks.empty.cta') }) ] }) : /*#__PURE__*/ _jsx("div", { className: "space-y-3", children: activeTasks.map((task)=>/*#__PURE__*/ _jsx(TaskCard, { task: task }, task.id)) }) ] }), completedTasks.length > 0 && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("h2", { className: "text-lg font-semibold text-white/70 mb-4", children: [ t('dashboard.completed_tasks'), " ", /*#__PURE__*/ _jsxs("span", { className: "font-normal text-base text-white/50", children: [ "(", completedTasks.length, ")" ] }) ] }), /*#__PURE__*/ _jsx("div", { className: "space-y-3 opacity-75", children: completedTasks.map((task)=>/*#__PURE__*/ _jsx(TaskCard, { task: task }, task.id)) }) ] }) ] }), /*#__PURE__*/ _jsx("div", { className: "space-y-8", children: isSpecialist ? /*#__PURE__*/ _jsxs(_Fragment, { children: [ invitations.length > 0 && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("h2", { className: "text-lg font-semibold text-white mb-4", children: [ t('dashboard.invitations'), " ", /*#__PURE__*/ _jsxs("span", { className: "text-white/60 font-normal text-base", children: [ "(", invitations.length, ")" ] }) ] }), /*#__PURE__*/ _jsx("div", { className: "space-y-3", children: invitations.map((inv)=>/*#__PURE__*/ _jsxs(Link, { href: inv.referenceId ? "/tasks/".concat(inv.referenceId) : '/tasks', className: "flex items-start gap-3 p-4 rounded-xl border transition cursor-pointer ".concat(inv.isRead ? 'bg-white/90 border-white/20 hover:bg-white' : 'bg-white border-amber-300 shadow-sm hover:bg-amber-50'), children: [ /*#__PURE__*/ _jsx("span", { className: "text-2xl", children: "\uD83D\uDCCB" }), /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ _jsx("p", { className: "font-medium truncate ".concat(inv.isRead ? 'text-gray-600' : 'text-gray-900'), children: t('notif.type.task_invite', inv.title) }), inv.body && /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-500 mt-0.5 truncate", children: (()=>{ const title = extractNotifParam(inv.body); const tpl = t('notif.body.task_invite', ''); return title && tpl ? tpl.replace('{title}', title) : inv.body; })() }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-1", children: new Date(inv.createdAt).toLocaleDateString(dateLocale) }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex flex-col items-end gap-1.5 shrink-0", children: [ !inv.isRead && /*#__PURE__*/ _jsx("span", { className: "w-2 h-2 bg-amber-400 rounded-full mt-2" }), /*#__PURE__*/ _jsx("span", { className: "text-xs text-gray-400", children: "→" }) ] }) ] }, inv.id)) }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("h2", { className: "text-lg font-semibold text-white mb-4", children: [ t('dashboard.my_offers'), " ", /*#__PURE__*/ _jsxs("span", { className: "text-white/60 font-normal text-base", children: [ "(", activeOffers.length, ")" ] }) ] }), activeOffers.length === 0 ? /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6 text-center text-gray-500", children: [ /*#__PURE__*/ _jsx("p", { children: t('dashboard.offers.empty') }), /*#__PURE__*/ _jsx(Link, { href: "/tasks", className: "text-green-600 hover:underline text-sm mt-2 inline-block", children: t('dashboard.offers.empty.cta') }) ] }) : /*#__PURE__*/ _jsx("div", { className: "space-y-3", children: activeOffers.map((row)=>/*#__PURE__*/ _jsx(OfferCard, { row: row }, (row.offer || row).id)) }) ] }), completedOffers.length > 0 && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("h2", { className: "text-lg font-semibold text-white/70 mb-4", children: [ t('dashboard.completed_offers'), " ", /*#__PURE__*/ _jsxs("span", { className: "font-normal text-base text-white/50", children: [ "(", completedOffers.length, ")" ] }) ] }), /*#__PURE__*/ _jsx("div", { className: "space-y-3 opacity-75", children: completedOffers.map((row)=>/*#__PURE__*/ _jsx(OfferCard, { row: row }, (row.offer || row).id)) }) ] }) ] }) : /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs(Link, { href: "/specialists", className: "flex items-center justify-between gap-4 bg-green-600 text-white rounded-xl px-5 py-4 hover:bg-green-700 transition", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-4", children: [ /*#__PURE__*/ _jsx("div", { className: "shrink-0 bg-white/20 rounded-xl p-2.5", children: /*#__PURE__*/ _jsx("svg", { className: "w-6 h-6 text-white", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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" }) }) }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "font-semibold text-base", children: t('dashboard.customer.specialists_title') }), /*#__PURE__*/ _jsx("p", { className: "text-green-100 text-sm mt-0.5", children: t('dashboard.customer.specialists_hint') }) ] }) ] }), /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5 shrink-0 text-white/70", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 5l7 7-7 7" }) }) ] }), /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-5", children: [ /*#__PURE__*/ _jsx("h2", { className: "text-base font-semibold text-gray-800 mb-4", children: t('dashboard.customer.how_title') }), /*#__PURE__*/ _jsx("div", { className: "space-y-3", children: [ { num: '1', text: t('dashboard.customer.step1'), icon: 'M12 4v16m8-8H4' }, { num: '2', text: t('dashboard.customer.step2'), icon: 'M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z' }, { num: '3', text: t('dashboard.customer.step3'), icon: 'M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z' } ].map((param)=>{ let { num, text, icon } = param; return /*#__PURE__*/ _jsxs("div", { className: "flex items-start gap-3", children: [ /*#__PURE__*/ _jsx("span", { className: "shrink-0 w-7 h-7 rounded-full bg-green-100 text-green-600 text-sm font-bold flex items-center justify-center", children: num }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-600 pt-1", children: text }) ] }, num); }) }), /*#__PURE__*/ _jsxs(Link, { href: "/tasks/new", className: "mt-4 inline-block text-sm font-medium text-green-600 hover:underline", children: [ tasks.length > 0 ? t('dashboard.tasks.add_new') : t('dashboard.tasks.empty.cta'), " →" ] }) ] }) ] }) }) ] }) ] }); } ÊO61146undefined148191undefined193253undefined255283undefined285324undefined326370undefined372564undefined566623undefined625675undefined677729undefined15231527__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined16591663__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined18051809__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined19601963__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined22152218__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined22202228__WEBPACK_MODULE_REFERENCE__8_5b22506c616e4261646765225d_directImport_asiSafe1__._undefined23722375__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined26482651__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined26532656__WEBPACK_MODULE_REFERENCE__3_5b2264656661756c74225d_directImport_asiSafe1__._undefined30383042__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined31503154__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined33293332__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined35513555__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined39163919__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined40474050__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined44734477__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined45954598__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined48384841__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined48434852__WEBPACK_MODULE_REFERENCE__9_5b2255736167654d65746572225d_directImport_asiSafe1__._undefined51495152__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined51545163__WEBPACK_MODULE_REFERENCE__9_5b2255736167654d65746572225d_directImport_asiSafe1__._undefined55065509__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined57215725__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined58965899__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined61066109__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined64356449undefined65666575__WEBPACK_MODULE_REFERENCE__4_5b2275736553657373696f6e225d_call_directImport_asiSafe1__._undefined65996607__WEBPACK_MODULE_REFERENCE__2_5b22757365526f75746572225d_call_directImport_asiSafe1__._undefined66376651__WEBPACK_MODULE_REFERENCE__2_5b22757365536561726368506172616d73225d_call_directImport_asiSafe1__._undefined66826690__WEBPACK_MODULE_REFERENCE__5_5b227573654c6f63616c65225d_call_directImport_asiSafe1__._undefined67256732__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined67716778__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined68236830__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined68796886__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined69276934__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined69816988__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined70337040__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined70957102__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined71157123__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined73217329__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined74547468__WEBPACK_MODULE_REFERENCE__6_5b226170706c794d79526566657272616c225d_call_directImport_asiSafe1__._undefined79887996__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined80428061__WEBPACK_MODULE_REFERENCE__6_5b226765744d795370656369616c6973744361726473225d_call_directImport_asiSafe1__._undefined82548262__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined83348343__WEBPACK_MODULE_REFERENCE__6_5b226765744d795461736b73225d_call_directImport_asiSafe1__._undefined83608370__WEBPACK_MODULE_REFERENCE__6_5b226765744d794f6666657273225d_call_directImport_asiSafe1__._undefined83878398__WEBPACK_MODULE_REFERENCE__6_5b226765744d7952657669657773225d_call_directImport_asiSafe1__._undefined84158430__WEBPACK_MODULE_REFERENCE__6_5b226765744e6f74696669636174696f6e73225d_call_directImport_asiSafe1__._undefined84478460__WEBPACK_MODULE_REFERENCE__6_5b226765744d7944617368626f617264225d_call_directImport_asiSafe1__._undefined88208828__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined90629087__WEBPACK_MODULE_REFERENCE__6_5b226765745370656369616c697374466f6d6f44617368626f617264225d_call_directImport_asiSafe1__._undefined91539176__WEBPACK_MODULE_REFERENCE__6_5b22676574437573746f6d6572466f6d6f44617368626f617264225d_call_directImport_asiSafe1__._undefined93079310__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1089910902__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1090410907__WEBPACK_MODULE_REFERENCE__3_5b2264656661756c74225d_directImport_asiSafe1__._undefined1112211126__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1126211266__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1140811411__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1154311551__WEBPACK_MODULE_REFERENCE__7_5b227461736b5469746c65225d_call_directImport_asiSafe1__._undefined1164111644__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1191611920__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1210212106__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1266012664__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1327713281__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1343313436__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1392513929__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1410214112__WEBPACK_MODULE_REFERENCE__7_5b22666f726d61745072696365225d_call_directImport_asiSafe1__._undefined1512715131__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1513315136__WEBPACK_MODULE_REFERENCE__3_5b2264656661756c74225d_directImport_asiSafe1__._undefined1538215386__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1553415538__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1569215695__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1600116004__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1632416328__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1649216496__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1666816678__WEBPACK_MODULE_REFERENCE__7_5b22666f726d61745072696365225d_call_directImport_asiSafe1__._undefined1685816861__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1748117485__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1765917662__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1799818001__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1830618310__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1865418657__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1902919032__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1946219466__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1957319577__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1971919722__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1991319916__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1991819921__WEBPACK_MODULE_REFERENCE__3_5b2264656661756c74225d_directImport_asiSafe1__._undefined2026020264__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2043220436__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2057820581__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2081720820__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2109421098__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2126021264__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2126621269__WEBPACK_MODULE_REFERENCE__3_5b2264656661756c74225d_directImport_asiSafe1__._undefined2157621580__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2178421787__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2204922052__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2243022433__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2271222716__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2322223226__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2322823231__WEBPACK_MODULE_REFERENCE__3_5b2264656661756c74225d_directImport_asiSafe1__._undefined2352623530__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2373423737__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2399824001__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2438224385__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2466324667__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2525425257__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2546225466__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2565425657__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2577025773__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2608926092__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2646926473__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2661526619__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2707127075__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2767227676__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2815428157__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2815928162__WEBPACK_MODULE_REFERENCE__3_5b2264656661756c74225d_directImport_asiSafe1__._undefined2851828521__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2866428668__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2883328837__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2900029003__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2916129164__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2955229555__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3011430118__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3023130235__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3078930792__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3129031294__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3144431448__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3183631839__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3219732201__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3220332206__WEBPACK_MODULE_REFERENCE__3_5b2264656661756c74225d_directImport_asiSafe1__._undefined3245532459__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3261032613__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3276432768__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3317033173__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3344433447__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3385333857__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3396233965__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3421434217__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3457634579__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3487934882__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3515535159__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3528835292__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3542935433__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3553835542__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3587235876__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3648736491__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3673936742__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3694236945__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3694736950__WEBPACK_MODULE_REFERENCE__3_5b2264656661756c74225d_directImport_asiSafe1__._undefined3737537378__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3754137544__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3785037854__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3795937963__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3830338307__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3889438897__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3907439077__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3939539398__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3952039524__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3952639534__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined3965139655__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3976839772__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4012540129__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4075340756__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4092640930__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4093240935__WEBPACK_MODULE_REFERENCE__3_5b2264656661756c74225d_directImport_asiSafe1__._undefined4145841461__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4177141775__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4202542028__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4247142474__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4327543278__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4378843792__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4408344086__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4436444367__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4503045034__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4514745151__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4550245506__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4615946163__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4642346426__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4663946642__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4664446647__WEBPACK_MODULE_REFERENCE__3_5b2264656661756c74225d_directImport_asiSafe1__._undefined4709347096__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4726747270__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4761447618__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4773147735__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4809648100__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4872848731__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4891648919__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4925949263__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4926549273__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined4936449368__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4937049373__WEBPACK_MODULE_REFERENCE__3_5b2264656661756c74225d_directImport_asiSafe1__._undefined4970349707__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4991849921__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5011250115__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5059550598__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5127451278__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5142351426__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5177551778__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5231052313__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5273352736__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5316953173__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5338353386__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5368353686__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5512955133__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5536755370__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5576955772__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5627256276__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5627856281__WEBPACK_MODULE_REFERENCE__3_5b2264656661756c74225d_directImport_asiSafe1__._undefined•863939(0,jsx_runtime.jsxs)undefined10711147(0,jsx_runtime.jsxs)undefined12891365(0,jsx_runtime.jsxs)undefined15161590(0,jsx_runtime.jsx)undefined18421916(0,jsx_runtime.jsx)undefined19181999PlanBadge/* PlanBadge */.dundefined21432217(0,jsx_runtime.jsx)undefined24902564(0,jsx_runtime.jsx)undefined25662643(link_default())undefined30253101(0,jsx_runtime.jsxs)undefined32093285(0,jsx_runtime.jsxs)undefined34603534(0,jsx_runtime.jsx)undefined37533829(0,jsx_runtime.jsxs)undefined41904264(0,jsx_runtime.jsx)undefined43924466(0,jsx_runtime.jsx)undefined48894965(0,jsx_runtime.jsxs)undefined50835157(0,jsx_runtime.jsx)undefined53975471(0,jsx_runtime.jsx)undefined54735556UsageMeterundefined58535927(0,jsx_runtime.jsx)undefined59296012UsageMeterundefined63556429(0,jsx_runtime.jsx)undefined66416717(0,jsx_runtime.jsxs)undefined68886962(0,jsx_runtime.jsx)undefined71697243(0,jsx_runtime.jsx)undefined76857773(0,auth/* useSession */.wV)undefined77977883(0,navigation.useRouter)undefined79138011(0,navigation.useSearchParams)undefined80428128(0,context_locale/* useLocale */.Y)undefined81638247(0,react.useState)undefined82868370(0,react.useState)undefined84158499(0,react.useState)undefined85488632(0,react.useState)undefined86738757(0,react.useState)undefined88048888(0,react.useState)undefined89339017(0,react.useState)undefined90729156(0,react.useState)undefined91699255(0,react.useEffect)undefined94539539(0,react.useEffect)undefined96649762(0,api/* applyMyReferral */.C0)undefined1028210368(0,react.useEffect)undefined1041410522(0,api/* getMySpecialistCards */.Bb)undefined1071510801(0,react.useEffect)undefined1087310961(0,api/* getMyTasks */.Fu)undefined1097811068(0,api/* getMyOffers */.aT)undefined1108511177(0,api/* getMyReviews */.q7)undefined1119411294(0,api/* getNotifications */.Tr)undefined1131111407(0,api/* getMyDashboard */.H)undefined1176711853(0,react.useEffect)undefined1208712207(0,api/* getSpecialistFomoDashboard */.zk)undefined1227312389(0,api/* getCustomerFomoDashboard */.ML)undefined1252012594(0,jsx_runtime.jsx)undefined1418314257(0,jsx_runtime.jsx)undefined1425914336(link_default())undefined1455114627(0,jsx_runtime.jsxs)undefined1476314839(0,jsx_runtime.jsxs)undefined1498115055(0,jsx_runtime.jsx)undefined1518715273(0,taskLocale/* taskTitle */.Oj)undefined1536315437(0,jsx_runtime.jsx)undefined1570915785(0,jsx_runtime.jsxs)undefined1596716043(0,jsx_runtime.jsxs)undefined1659716673(0,jsx_runtime.jsxs)undefined1728617362(0,jsx_runtime.jsxs)undefined1751417588(0,jsx_runtime.jsx)undefined1807718153(0,jsx_runtime.jsxs)undefined1832618416(0,taskLocale/* formatPrice */.$g)undefined1943119507(0,jsx_runtime.jsxs)undefined1950919586(link_default())undefined1983219908(0,jsx_runtime.jsxs)undefined2005620132(0,jsx_runtime.jsxs)undefined2028620360(0,jsx_runtime.jsx)undefined2066620740(0,jsx_runtime.jsx)undefined2106021136(0,jsx_runtime.jsxs)undefined2130021376(0,jsx_runtime.jsxs)undefined2154821638(0,taskLocale/* formatPrice */.$g)undefined2181821892(0,jsx_runtime.jsx)undefined2251222588(0,jsx_runtime.jsxs)undefined2276222836(0,jsx_runtime.jsx)undefined2317223246(0,jsx_runtime.jsx)undefined2355123627(0,jsx_runtime.jsxs)undefined2397124045(0,jsx_runtime.jsx)undefined2441724491(0,jsx_runtime.jsx)undefined2492124997(0,jsx_runtime.jsxs)undefined2510425180(0,jsx_runtime.jsxs)undefined2532225396(0,jsx_runtime.jsx)undefined2558725661(0,jsx_runtime.jsx)undefined2566325740(link_default())undefined2607926155(0,jsx_runtime.jsxs)undefined2632326399(0,jsx_runtime.jsxs)undefined2654126615(0,jsx_runtime.jsx)undefined2685126925(0,jsx_runtime.jsx)undefined2719927275(0,jsx_runtime.jsxs)undefined2743727513(0,jsx_runtime.jsxs)undefined2751527592(link_default())undefined2789927975(0,jsx_runtime.jsxs)undefined2817928253(0,jsx_runtime.jsx)undefined2851528589(0,jsx_runtime.jsx)undefined2896729041(0,jsx_runtime.jsx)undefined2932029396(0,jsx_runtime.jsxs)undefined2990229978(0,jsx_runtime.jsxs)undefined2998030057(link_default())undefined3035230428(0,jsx_runtime.jsxs)undefined3063230706(0,jsx_runtime.jsx)undefined3096731041(0,jsx_runtime.jsx)undefined3142231496(0,jsx_runtime.jsx)undefined3177431850(0,jsx_runtime.jsxs)undefined3243732511(0,jsx_runtime.jsx)undefined3271632792(0,jsx_runtime.jsxs)undefined3298033054(0,jsx_runtime.jsx)undefined3316733241(0,jsx_runtime.jsx)undefined3355733631(0,jsx_runtime.jsx)undefined3400834084(0,jsx_runtime.jsxs)undefined3422634302(0,jsx_runtime.jsxs)undefined3475434830(0,jsx_runtime.jsxs)undefined3542735503(0,jsx_runtime.jsxs)undefined3598136055(0,jsx_runtime.jsx)undefined3605736134(link_default())undefined3649036564(0,jsx_runtime.jsx)undefined3670736783(0,jsx_runtime.jsxs)undefined3694837024(0,jsx_runtime.jsxs)undefined3718737261(0,jsx_runtime.jsx)undefined3741937493(0,jsx_runtime.jsx)undefined3788137955(0,jsx_runtime.jsx)undefined3851438590(0,jsx_runtime.jsxs)undefined3870338779(0,jsx_runtime.jsxs)undefined3933339407(0,jsx_runtime.jsx)undefined3990539981(0,jsx_runtime.jsxs)undefined4013140207(0,jsx_runtime.jsxs)undefined4059540669(0,jsx_runtime.jsx)undefined4102741103(0,jsx_runtime.jsxs)undefined4110541182(link_default())undefined4143141507(0,jsx_runtime.jsxs)undefined4165841732(0,jsx_runtime.jsx)undefined4188341959(0,jsx_runtime.jsxs)undefined4236142435(0,jsx_runtime.jsx)undefined4270642780(0,jsx_runtime.jsx)undefined4318643262(0,jsx_runtime.jsxs)undefined4336743441(0,jsx_runtime.jsx)undefined4369043764(0,jsx_runtime.jsx)undefined4412344197(0,jsx_runtime.jsx)undefined4449744571(0,jsx_runtime.jsx)undefined4484444920(0,jsx_runtime.jsxs)undefined4504945125(0,jsx_runtime.jsxs)undefined4526245338(0,jsx_runtime.jsxs)undefined4544345519(0,jsx_runtime.jsxs)undefined4584945925(0,jsx_runtime.jsxs)undefined4653646612(0,jsx_runtime.jsxs)undefined4686046934(0,jsx_runtime.jsx)undefined4713447208(0,jsx_runtime.jsx)undefined4721047287(link_default())undefined4771247786(0,jsx_runtime.jsx)undefined4794948023(0,jsx_runtime.jsx)undefined4832948405(0,jsx_runtime.jsxs)undefined4851048586(0,jsx_runtime.jsxs)undefined4892649002(0,jsx_runtime.jsxs)undefined4958949663(0,jsx_runtime.jsx)undefined4984049914(0,jsx_runtime.jsx)undefined5023250306(0,jsx_runtime.jsx)undefined5042850504(0,jsx_runtime.jsxs)undefined5050650585jsx_runtime.Fragmentundefined5070250778(0,jsx_runtime.jsxs)undefined5089150967(0,jsx_runtime.jsxs)undefined5132051396(0,jsx_runtime.jsxs)undefined5202052094(0,jsx_runtime.jsx)undefined5226452340(0,jsx_runtime.jsxs)undefined5234252419(link_default())undefined5294253016(0,jsx_runtime.jsx)undefined5332653402(0,jsx_runtime.jsxs)undefined5365253726(0,jsx_runtime.jsx)undefined5416954243(0,jsx_runtime.jsx)undefined5504455118(0,jsx_runtime.jsx)undefined5562855704(0,jsx_runtime.jsxs)undefined5599556069(0,jsx_runtime.jsx)undefined5634756421(0,jsx_runtime.jsx)undefined5708457160(0,jsx_runtime.jsxs)undefined5727357349(0,jsx_runtime.jsxs)undefined5770057776(0,jsx_runtime.jsxs)undefined5842958505(0,jsx_runtime.jsxs)undefined5876558839(0,jsx_runtime.jsx)undefined5905259126(0,jsx_runtime.jsx)undefined5912859205(link_default())undefined5965159725(0,jsx_runtime.jsx)undefined5989659970(0,jsx_runtime.jsx)undefined6031460390(0,jsx_runtime.jsxs)undefined6050360579(0,jsx_runtime.jsxs)undefined6094061016(0,jsx_runtime.jsxs)undefined6164461718(0,jsx_runtime.jsx)undefined6190361977(0,jsx_runtime.jsx)undefined6231762393(0,jsx_runtime.jsxs)undefined6239562474jsx_runtime.Fragmentundefined6256562641(0,jsx_runtime.jsxs)undefined6264362720(link_default())undefined6305063126(0,jsx_runtime.jsxs)undefined6333763411(0,jsx_runtime.jsx)undefined6360263676(0,jsx_runtime.jsx)undefined6415664230(0,jsx_runtime.jsx)undefined6490664982(0,jsx_runtime.jsxs)undefined6512765201(0,jsx_runtime.jsx)undefined6555065624(0,jsx_runtime.jsx)undefined6615666230(0,jsx_runtime.jsx)undefined6665066724(0,jsx_runtime.jsx)undefined6715767233(0,jsx_runtime.jsxs)undefined6744367517(0,jsx_runtime.jsx)undefined6781467888(0,jsx_runtime.jsx)undefined6933169407(0,jsx_runtime.jsxs)undefined6964169715(0,jsx_runtime.jsx)undefined7011470188(0,jsx_runtime.jsx)undefined7068870764(0,jsx_runtime.jsxs)undefined7076670843(link_default())undefined /***/ }) €†buffer†source„size„maps„hashø/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; // ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); // EXPORTS __webpack_require__.d(__webpack_exports__, { "default": () => (/* binding */ DashboardPage) }); // EXTERNAL MODULE: ../../node_modules/next/dist/compiled/react/jsx-runtime.js var jsx_runtime = __webpack_require__(4568); // EXTERNAL MODULE: ../../node_modules/next/dist/compiled/react/index.js var react = __webpack_require__(7620); // EXTERNAL MODULE: ../../node_modules/next/dist/api/navigation.js var navigation = __webpack_require__(7541); // EXTERNAL MODULE: ../../node_modules/next/dist/client/app-dir/link.js var app_dir_link = __webpack_require__(9664); var link_default = /*#__PURE__*/__webpack_require__.n(app_dir_link); // EXTERNAL MODULE: ./src/lib/auth.ts var auth = __webpack_require__(1592); // EXTERNAL MODULE: ./src/context/locale.tsx var context_locale = __webpack_require__(9906); // EXTERNAL MODULE: ./src/lib/api.ts var api = __webpack_require__(2982); // EXTERNAL MODULE: ./src/lib/taskLocale.ts var taskLocale = __webpack_require__(4017); // EXTERNAL MODULE: ./src/components/PlanBadge.tsx var PlanBadge = __webpack_require__(2035); ;// ./src/components/UsageMeter.tsx function UsageMeter(param) { let { current, limit, label, className = '' } = param; if (limit === null) { return /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "".concat(className), children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex justify-between items-center mb-1", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "text-xs text-gray-500", children: label }), /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "text-xs font-semibold text-green-600", children: "∞" }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "h-1.5 rounded-full bg-green-100", children: /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "h-full w-full rounded-full bg-green-400" }) }) ] }); } const pct = limit > 0 ? Math.min(100, Math.round(current / limit * 100)) : 100; const remaining = Math.max(0, limit - current); const barColor = pct >= 100 ? 'bg-red-500' : pct >= 80 ? 'bg-amber-400' : 'bg-green-500'; const textColor = pct >= 100 ? 'text-red-600' : pct >= 80 ? 'text-amber-600' : 'text-gray-600'; return /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: className, children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex justify-between items-center mb-1", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "text-xs text-gray-500", children: label }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("span", { className: "text-xs font-semibold ".concat(textColor), children: [ remaining, " / ", limit ] }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "h-1.5 rounded-full bg-gray-100", children: /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "h-full rounded-full transition-all ".concat(barColor), style: { width: "".concat(pct, "%") } }) }) ] }); } ;// ./src/app/dashboard/page.tsx /* __next_internal_client_entry_do_not_use__ default auto */ /** Extract the quoted task title from a stored notification body (any locale) */ function extractNotifParam(body) { if (!body) return null; const m = body.match(/[«""](.+?)[»""]/); var _m_; return (_m_ = m === null || m === void 0 ? void 0 : m[1]) !== null && _m_ !== void 0 ? _m_ : null; } function PlanBlock(param) { let { dashboard, t } = param; const plan = dashboard.plan; const expiry = dashboard.planExpiration; const usage = dashboard.usage; const stats = dashboard.stats; const expiryPct = expiry ? Math.max(0, Math.min(100, Math.round(expiry.daysLeft / 30 * 100))) : 100; const expiryColor = expiry ? expiry.daysLeft <= 3 ? 'bg-red-500' : expiry.daysLeft <= 7 ? 'bg-amber-400' : 'bg-green-400' : 'bg-green-400'; return /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "bg-white rounded-2xl border border-gray-200 p-5 mb-6", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex items-center justify-between mb-4", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex items-center gap-2", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("h2", { className: "font-semibold text-gray-800 text-sm", children: t('dashboard.plan.title', 'My Plan') }), plan ? /*#__PURE__*/ (0,jsx_runtime.jsx)(PlanBadge/* PlanBadge */.d, { tier: plan.tier, size: "sm" }) : /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "text-xs text-gray-400", children: t('dashboard.plan.no_plan', 'Free') }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)((link_default()), { href: "/pricing", className: "text-xs font-medium text-green-600 hover:underline", children: (plan === null || plan === void 0 ? void 0 : plan.tier) === 'ultimate' ? null : t('dashboard.plan.upgrade', 'Upgrade') }) ] }), expiry && /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "mb-4", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex justify-between text-xs text-gray-500 mb-1", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { children: t('dashboard.plan.expires', 'Expires in {n} days').replace('{n}', String(expiry.daysLeft)) }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("span", { children: [ expiry.daysLeft, " ", t('pricing.days', 'days') ] }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "h-1.5 rounded-full bg-gray-100", children: /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "h-full rounded-full transition-all ".concat(expiryColor), style: { width: "".concat(expiryPct, "%") } }) }) ] }), (usage.messagesSent !== undefined || usage.ordersMade !== undefined) && /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "space-y-2 mb-4", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "text-xs font-medium text-gray-500 uppercase tracking-wide", children: t('dashboard.plan.limits', 'Daily limits') }), /*#__PURE__*/ (0,jsx_runtime.jsx)(UsageMeter, { current: usage.messagesSent, limit: usage.messagesLeft !== null ? usage.messagesSent + usage.messagesLeft : null, label: t('dashboard.plan.messages', 'Messages') }), /*#__PURE__*/ (0,jsx_runtime.jsx)(UsageMeter, { current: usage.ordersMade, limit: usage.ordersLeft !== null ? usage.ordersMade + usage.ordersLeft : null, label: t('dashboard.plan.orders', 'Orders') }) ] }), Object.keys(stats).length > 0 && /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "grid grid-cols-2 gap-2", children: Object.entries(stats).map((param)=>{ let [key, val] = param; return /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "bg-gray-50 rounded-xl px-3 py-2 text-center", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "text-lg font-bold text-gray-800", children: val }), /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "text-[10px] text-gray-400 uppercase tracking-wide", children: t("dashboard.stats.".concat(key), key) }) ] }, key); }) }) ] }); } function DashboardPage() { var _session_user, _fomoData_topCategories; const { data: session, isPending } = (0,auth/* useSession */.wV)(); const router = (0,navigation.useRouter)(); const searchParams = (0,navigation.useSearchParams)(); const { t, locale } = (0,context_locale/* useLocale */.Y)(); const [tasks, setTasks] = (0,react.useState)([]); const [offers, setOffers] = (0,react.useState)([]); const [myReviews, setMyReviews] = (0,react.useState)([]); const [invitations, setInvitations] = (0,react.useState)([]); const [loading, setLoading] = (0,react.useState)(true); const [dashboard, setDashboard] = (0,react.useState)(null); const [fomoData, setFomoData] = (0,react.useState)(null); const [hasHelperCard, setHasHelperCard] = (0,react.useState)(null); (0,react.useEffect)(()=>{ if (!isPending && !session) router.push('/login'); }, [ session, isPending ]); // Apply pending referral code after Google OAuth redirect (?ref=CODE) (0,react.useEffect)(()=>{ if (!session) return; const refCode = searchParams.get('ref'); if (!refCode) return; (0,api/* applyMyReferral */.C0)(refCode).catch(()=>{}); // Remove the ref param from the URL without reloading const params = new URLSearchParams(searchParams.toString()); params.delete('ref'); const newUrl = params.toString() ? "?".concat(params.toString()) : window.location.pathname; router.replace(newUrl); }, [ session ]); // Detect whether the user has completed their helper profile (has a card). // Used to show the getting-started onboarding card to users who haven't yet. (0,react.useEffect)(()=>{ if (!session) return; (0,api/* getMySpecialistCards */.Bb)().then((param)=>{ let { cards } = param; return setHasHelperCard(cards.length > 0); }).catch(()=>setHasHelperCard(null)); }, [ session ]); (0,react.useEffect)(()=>{ if (!session) return; Promise.all([ (0,api/* getMyTasks */.Fu)(), (0,api/* getMyOffers */.aT)(), (0,api/* getMyReviews */.q7)(), (0,api/* getNotifications */.Tr)(), (0,api/* getMyDashboard */.H)() ]).then((param)=>{ let [t, o, r, notifs, dash] = param; setTasks(t); setOffers(o); setMyReviews(r); setInvitations(notifs.filter((n)=>n.type === 'task_invite')); setDashboard(dash); }).catch(()=>{}).finally(()=>setLoading(false)); }, [ session ]); (0,react.useEffect)(()=>{ var _session_user; if (!session) return; const role = (_session_user = session.user) === null || _session_user === void 0 ? void 0 : _session_user.role; if (role === 'specialist') { (0,api/* getSpecialistFomoDashboard */.zk)().then(setFomoData).catch(()=>{}); } else { (0,api/* getCustomerFomoDashboard */.ML)().then(setFomoData).catch(()=>{}); } }, [ session ]); if (isPending || loading) return /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "text-center py-20 text-white", children: t('common.loading') }); const dateLocale = locale === 'ru' ? 'ru-RU' : locale === 'uk' ? 'uk-UA' : locale === 'en' ? 'en-US' : 'el-GR'; const activeTasks = tasks.filter((task)=>task.status !== 'completed' && task.status !== 'cancelled'); const completedTasks = tasks.filter((task)=>task.status === 'completed' || task.status === 'cancelled'); const activeOffers = offers.filter((row)=>{ const offer = row.offer || row; const task = row.task; return offer.status !== 'other_accepted' && (task === null || task === void 0 ? void 0 : task.status) !== 'completed' && (task === null || task === void 0 ? void 0 : task.status) !== 'cancelled'; }); const completedOffers = offers.filter((row)=>{ const offer = row.offer || row; const task = row.task; return offer.status === 'other_accepted' || (task === null || task === void 0 ? void 0 : task.status) === 'completed' || (task === null || task === void 0 ? void 0 : task.status) === 'cancelled'; }); function TaskCard(param) { let { task } = param; var _task_offerCount; const offerCount = (_task_offerCount = task.offerCount) !== null && _task_offerCount !== void 0 ? _task_offerCount : 0; var _task_declinedCount; const declinedCount = (_task_declinedCount = task.declinedCount) !== null && _task_declinedCount !== void 0 ? _task_declinedCount : 0; const activeOfferCount = offerCount - declinedCount; return /*#__PURE__*/ (0,jsx_runtime.jsx)((link_default()), { href: "/tasks/".concat(task.id), className: "block bg-white rounded-xl border border-gray-200 p-4 hover:shadow-sm hover:border-green-300 transition", children: /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex justify-between items-start", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "font-medium text-gray-900 truncate", children: (0,taskLocale/* taskTitle */.Oj)(task, locale) }), /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "text-xs text-gray-400 mt-1", children: new Date(task.createdAt).toLocaleDateString(dateLocale) }), offerCount > 0 && /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex items-center gap-2 mt-1.5", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("span", { className: "text-xs text-green-600 font-medium", children: [ "\uD83D\uDCBC ", offerCount, " ", t('dashboard.offers_count', 'offers') ] }), declinedCount > 0 && /*#__PURE__*/ (0,jsx_runtime.jsxs)("span", { className: "text-xs text-red-400", children: [ "✕ ", declinedCount, " ", t('dashboard.declined_count', 'declined') ] }) ] }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "ml-3 text-right shrink-0", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "text-xs px-2 py-0.5 rounded-full ".concat(task.status === 'open' ? 'bg-green-100 text-green-700' : task.status === 'in_progress' ? 'bg-green-100 text-green-700' : task.status === 'completed' ? 'bg-gray-100 text-gray-600' : 'bg-red-100 text-red-600'), children: t("task.status.".concat(task.status), task.status) }), task.budget && /*#__PURE__*/ (0,jsx_runtime.jsxs)("p", { className: "text-sm font-bold text-green-600 mt-1", children: [ (0,taskLocale/* formatPrice */.$g)(task.budget), "€" ] }) ] }) ] }) }); } function OfferCard(param) { let { row } = param; var _myReviews_find; const offer = row.offer || row; const task = row.task; var _myReviews_find_review; const reviewReceived = (task === null || task === void 0 ? void 0 : task.status) === 'completed' && offer.status === 'accepted' ? (_myReviews_find_review = (_myReviews_find = myReviews.find((r)=>{ var _r_review; return ((_r_review = r.review) === null || _r_review === void 0 ? void 0 : _r_review.taskId) === (task === null || task === void 0 ? void 0 : task.id); })) === null || _myReviews_find === void 0 ? void 0 : _myReviews_find.review) !== null && _myReviews_find_review !== void 0 ? _myReviews_find_review : null : null; return /*#__PURE__*/ (0,jsx_runtime.jsxs)((link_default()), { href: task ? "/tasks/".concat(task.id) : '#', className: "block bg-white rounded-xl border border-gray-200 p-4 hover:shadow-sm hover:border-green-300 transition", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex justify-between items-start", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "font-medium text-gray-900 truncate", children: (task === null || task === void 0 ? void 0 : task.title) || t('chat.task_fallback') }), /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "text-xs text-gray-400 mt-1", children: new Date(offer.createdAt).toLocaleDateString(dateLocale) }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "ml-3 text-right shrink-0", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("p", { className: "font-bold text-green-600", children: [ (0,taskLocale/* formatPrice */.$g)(offer.price), "€" ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "text-xs px-2 py-0.5 rounded-full mt-1 inline-block ".concat(offer.status === 'accepted' ? 'bg-green-100 text-green-700' : offer.status === 'declined' ? 'bg-red-100 text-red-700' : offer.status === 'other_accepted' ? 'bg-green-100 text-green-600' : 'bg-gray-100 text-gray-700'), children: t("offer.status.".concat(offer.status), offer.status) }) ] }) ] }), reviewReceived && /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "mt-3 pt-3 border-t border-gray-100 flex items-center gap-2", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "flex gap-0.5", children: [ 1, 2, 3, 4, 5 ].map((star)=>/*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "text-sm ".concat(star <= reviewReceived.rating ? 'text-yellow-400' : 'text-gray-200'), children: "★" }, star)) }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("span", { className: "text-sm font-semibold text-gray-700", children: [ reviewReceived.rating, "/5" ] }), reviewReceived.comment && /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "text-xs text-gray-500 truncate", children: reviewReceived.comment }) ] }), (task === null || task === void 0 ? void 0 : task.status) === 'completed' && offer.status === 'accepted' && !reviewReceived && /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "mt-2 text-xs text-gray-400", children: t('dashboard.review_pending') }) ] }); } const isSpecialist = (session === null || session === void 0 ? void 0 : (_session_user = session.user) === null || _session_user === void 0 ? void 0 : _session_user.role) === 'specialist'; var _fomoData_missedCount; return /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "max-w-5xl mx-auto px-4 py-8", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex justify-between items-center mb-8", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("h1", { className: "text-2xl font-bold text-white", children: t('dashboard.title') }), /*#__PURE__*/ (0,jsx_runtime.jsx)((link_default()), { href: "/tasks/new", className: "bg-green-600 text-white px-4 py-2 rounded-lg text-sm font-medium hover:bg-green-700", children: t('dashboard.new_task') }) ] }), hasHelperCard === false && /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "mb-6 bg-white rounded-2xl border border-gray-200 overflow-hidden", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "px-5 pt-5 pb-3", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("h2", { className: "text-lg font-bold text-gray-900", children: t('dashboard.onboarding.title') }), /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "text-sm text-gray-500 mt-1", children: t('dashboard.onboarding.subtitle') }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "grid sm:grid-cols-2 gap-3 p-5 pt-2", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)((link_default()), { href: "/specialist-setup", className: "group flex flex-col rounded-xl border-2 border-green-500 bg-green-50 p-4 hover:bg-green-100 transition", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex items-center gap-2 mb-1", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "text-xl", children: "\uD83D\uDEE0" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "font-semibold text-gray-800", children: t('dashboard.onboarding.helper.title') }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "text-sm text-green-700/80 mb-3 flex-1", children: t('dashboard.onboarding.helper.desc') }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("span", { className: "inline-flex items-center gap-1 text-sm font-semibold text-green-700", children: [ t('dashboard.onboarding.helper.cta'), " →" ] }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)((link_default()), { href: "/tasks/new", className: "group flex flex-col rounded-xl border border-gray-200 bg-gray-50 p-4 hover:bg-gray-100 transition", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex items-center gap-2 mb-1", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "text-xl", children: "\uD83D\uDCDD" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "font-semibold text-gray-800", children: t('dashboard.onboarding.requester.title') }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "text-sm text-gray-500 mb-3 flex-1", children: t('dashboard.onboarding.requester.desc') }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("span", { className: "inline-flex items-center gap-1 text-sm font-semibold text-gray-700", children: [ t('dashboard.onboarding.requester.cta'), " →" ] }) ] }) ] }) ] }), dashboard && /*#__PURE__*/ (0,jsx_runtime.jsx)(PlanBlock, { dashboard: dashboard, t: t }), fomoData && (isSpecialist ? (fomoData.missedCount > 0 || fomoData.missedEarnings > 0) && /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "mb-6 bg-amber-50 border border-amber-200 rounded-xl px-5 py-4 flex items-start gap-3", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "shrink-0 mt-0.5", children: /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { className: "w-5 h-5 text-amber-500", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 9v2m0 4h.01M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z" }) }) }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("p", { className: "text-base font-semibold text-amber-800", children: [ t('fomo.specialist_missed', 'You missed {n} tasks').replace('{n}', String((_fomoData_missedCount = fomoData.missedCount) !== null && _fomoData_missedCount !== void 0 ? _fomoData_missedCount : 0)), fomoData.missedEarnings > 0 && /*#__PURE__*/ (0,jsx_runtime.jsxs)("span", { className: "ml-1 text-amber-600", children: [ "for €", fomoData.missedEarnings ] }) ] }), ((_fomoData_topCategories = fomoData.topCategories) === null || _fomoData_topCategories === void 0 ? void 0 : _fomoData_topCategories.length) > 0 && /*#__PURE__*/ (0,jsx_runtime.jsxs)("p", { className: "text-sm text-amber-600 mt-0.5", children: [ t('fomo.top_categories', 'Categories'), ": ", fomoData.topCategories.slice(0, 3).join(', ') ] }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)((link_default()), { href: "/pricing", className: "shrink-0 text-xs font-medium text-amber-700 bg-amber-100 px-3 py-1.5 rounded-lg hover:bg-amber-200 transition", children: t('dashboard.plan.upgrade') }) ] }) : fomoData.totalTasks > 0 && /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "mb-6 bg-green-50 border border-green-200 rounded-xl px-5 py-4", children: /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex items-center justify-between gap-4 flex-wrap", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex items-center gap-3", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "shrink-0 bg-green-100 rounded-xl p-2", children: /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { className: "w-5 h-5 text-green-600", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,jsx_runtime.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" }) }) }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("p", { className: "text-base font-semibold text-gray-800", children: [ fomoData.totalOffers, " ", t('fomo.offers_received', 'offers received') ] }), fomoData.avgOffersPerTask > 0 && /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "text-sm text-gray-500", children: t('fomo.avg_offers', 'Average {n}/task').replace('{n}', Number(fomoData.avgOffersPerTask).toFixed(1)) }) ] }) ] }), fomoData.completionRate !== undefined && /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "text-right", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("p", { className: "text-2xl font-bold text-green-700", children: [ Math.round(fomoData.completionRate * 100), "%" ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "text-sm text-gray-400", children: t('fomo.completion_rate', 'completed') }) ] }) ] }) })), isSpecialist && /*#__PURE__*/ (0,jsx_runtime.jsxs)((link_default()), { href: "/tasks", className: "flex items-center justify-between gap-4 bg-green-600 text-white rounded-xl px-5 py-4 mb-8 hover:bg-green-700 transition", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex items-center gap-4", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "shrink-0 bg-white/20 rounded-xl p-2.5", children: /*#__PURE__*/ (0,jsx_runtime.jsxs)("svg", { className: "w-6 h-6 text-white", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("circle", { cx: "11", cy: "11", r: "7" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M21 21l-4.35-4.35" }) ] }) }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "font-semibold text-base", children: t('find_tasks.title') }), /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "text-green-100 text-sm mt-0.5", children: t('find_tasks.banner_hint') }) ] }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { className: "w-5 h-5 shrink-0 text-white/70", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 5l7 7-7 7" }) }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "grid md:grid-cols-2 gap-8", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "space-y-8", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("h2", { className: "text-lg font-semibold text-white mb-4", children: [ t('dashboard.my_tasks'), " ", /*#__PURE__*/ (0,jsx_runtime.jsxs)("span", { className: "text-white/60 font-normal text-base", children: [ "(", activeTasks.length, ")" ] }) ] }), activeTasks.length === 0 ? /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-6 text-center text-gray-500", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { children: t('dashboard.tasks.empty') }), /*#__PURE__*/ (0,jsx_runtime.jsx)((link_default()), { href: "/tasks/new", className: "text-green-600 hover:underline text-sm mt-2 inline-block", children: t('dashboard.tasks.empty.cta') }) ] }) : /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "space-y-3", children: activeTasks.map((task)=>/*#__PURE__*/ (0,jsx_runtime.jsx)(TaskCard, { task: task }, task.id)) }) ] }), completedTasks.length > 0 && /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("h2", { className: "text-lg font-semibold text-white/70 mb-4", children: [ t('dashboard.completed_tasks'), " ", /*#__PURE__*/ (0,jsx_runtime.jsxs)("span", { className: "font-normal text-base text-white/50", children: [ "(", completedTasks.length, ")" ] }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "space-y-3 opacity-75", children: completedTasks.map((task)=>/*#__PURE__*/ (0,jsx_runtime.jsx)(TaskCard, { task: task }, task.id)) }) ] }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "space-y-8", children: isSpecialist ? /*#__PURE__*/ (0,jsx_runtime.jsxs)(jsx_runtime.Fragment, { children: [ invitations.length > 0 && /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("h2", { className: "text-lg font-semibold text-white mb-4", children: [ t('dashboard.invitations'), " ", /*#__PURE__*/ (0,jsx_runtime.jsxs)("span", { className: "text-white/60 font-normal text-base", children: [ "(", invitations.length, ")" ] }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "space-y-3", children: invitations.map((inv)=>/*#__PURE__*/ (0,jsx_runtime.jsxs)((link_default()), { href: inv.referenceId ? "/tasks/".concat(inv.referenceId) : '/tasks', className: "flex items-start gap-3 p-4 rounded-xl border transition cursor-pointer ".concat(inv.isRead ? 'bg-white/90 border-white/20 hover:bg-white' : 'bg-white border-amber-300 shadow-sm hover:bg-amber-50'), children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "text-2xl", children: "\uD83D\uDCCB" }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "font-medium truncate ".concat(inv.isRead ? 'text-gray-600' : 'text-gray-900'), children: t('notif.type.task_invite', inv.title) }), inv.body && /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "text-sm text-gray-500 mt-0.5 truncate", children: (()=>{ const title = extractNotifParam(inv.body); const tpl = t('notif.body.task_invite', ''); return title && tpl ? tpl.replace('{title}', title) : inv.body; })() }), /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "text-xs text-gray-400 mt-1", children: new Date(inv.createdAt).toLocaleDateString(dateLocale) }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex flex-col items-end gap-1.5 shrink-0", children: [ !inv.isRead && /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "w-2 h-2 bg-amber-400 rounded-full mt-2" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "text-xs text-gray-400", children: "→" }) ] }) ] }, inv.id)) }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("h2", { className: "text-lg font-semibold text-white mb-4", children: [ t('dashboard.my_offers'), " ", /*#__PURE__*/ (0,jsx_runtime.jsxs)("span", { className: "text-white/60 font-normal text-base", children: [ "(", activeOffers.length, ")" ] }) ] }), activeOffers.length === 0 ? /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-6 text-center text-gray-500", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { children: t('dashboard.offers.empty') }), /*#__PURE__*/ (0,jsx_runtime.jsx)((link_default()), { href: "/tasks", className: "text-green-600 hover:underline text-sm mt-2 inline-block", children: t('dashboard.offers.empty.cta') }) ] }) : /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "space-y-3", children: activeOffers.map((row)=>/*#__PURE__*/ (0,jsx_runtime.jsx)(OfferCard, { row: row }, (row.offer || row).id)) }) ] }), completedOffers.length > 0 && /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("h2", { className: "text-lg font-semibold text-white/70 mb-4", children: [ t('dashboard.completed_offers'), " ", /*#__PURE__*/ (0,jsx_runtime.jsxs)("span", { className: "font-normal text-base text-white/50", children: [ "(", completedOffers.length, ")" ] }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "space-y-3 opacity-75", children: completedOffers.map((row)=>/*#__PURE__*/ (0,jsx_runtime.jsx)(OfferCard, { row: row }, (row.offer || row).id)) }) ] }) ] }) : /*#__PURE__*/ (0,jsx_runtime.jsxs)(jsx_runtime.Fragment, { children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)((link_default()), { href: "/specialists", className: "flex items-center justify-between gap-4 bg-green-600 text-white rounded-xl px-5 py-4 hover:bg-green-700 transition", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex items-center gap-4", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "shrink-0 bg-white/20 rounded-xl p-2.5", children: /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { className: "w-6 h-6 text-white", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,jsx_runtime.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" }) }) }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "font-semibold text-base", children: t('dashboard.customer.specialists_title') }), /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "text-green-100 text-sm mt-0.5", children: t('dashboard.customer.specialists_hint') }) ] }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { className: "w-5 h-5 shrink-0 text-white/70", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 5l7 7-7 7" }) }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-5", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("h2", { className: "text-base font-semibold text-gray-800 mb-4", children: t('dashboard.customer.how_title') }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "space-y-3", children: [ { num: '1', text: t('dashboard.customer.step1'), icon: 'M12 4v16m8-8H4' }, { num: '2', text: t('dashboard.customer.step2'), icon: 'M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z' }, { num: '3', text: t('dashboard.customer.step3'), icon: 'M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z' } ].map((param)=>{ let { num, text, icon } = param; return /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex items-start gap-3", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "shrink-0 w-7 h-7 rounded-full bg-green-100 text-green-600 text-sm font-bold flex items-center justify-center", children: num }), /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "text-sm text-gray-600 pt-1", children: text }) ] }, num); }) }), /*#__PURE__*/ (0,jsx_runtime.jsxs)((link_default()), { href: "/tasks/new", className: "mt-4 inline-block text-sm font-medium text-green-600 hover:underline", children: [ tasks.length > 0 ? t('dashboard.tasks.add_new') : t('dashboard.tasks.empty.cta'), " →" ] }) ] }) ] }) }) ] }) ] }); } /***/ }) €”{"finalSource":true}ƒmap‹bufferedMap `ConcatSourceRawSource_/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; þ‘// ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); // EXPORTS __webpack_require__.d(__webpack_exports__, { "default": () => (/* binding */ DashboardPage) }); // EXTERNAL MODULE: ../../node_modules/next/dist/compiled/react/jsx-runtime.js var jsx_runtime = __webpack_require__(4568); // EXTERNAL MODULE: ../../node_modules/next/dist/compiled/react/index.js var react = __webpack_require__(7620); // EXTERNAL MODULE: ../../node_modules/next/dist/api/navigation.js var navigation = __webpack_require__(7541); // EXTERNAL MODULE: ../../node_modules/next/dist/client/app-dir/link.js var app_dir_link = __webpack_require__(9664); var link_default = /*#__PURE__*/__webpack_require__.n(app_dir_link); // EXTERNAL MODULE: ./src/lib/auth.ts var auth = __webpack_require__(1592); // EXTERNAL MODULE: ./src/context/locale.tsx var context_locale = __webpack_require__(9906); // EXTERNAL MODULE: ./src/lib/api.ts var api = __webpack_require__(2982); // EXTERNAL MODULE: ./src/lib/taskLocale.ts var taskLocale = __webpack_require__(4017); // EXTERNAL MODULE: ./src/components/PlanBadge.tsx var PlanBadge = __webpack_require__(2035); ;// ./src/components/UsageMeter.tsx  ReplaceSourceReplaceSourceRawSource~ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; export function UsageMeter(param) { let { current, limit, label, className = '' } = param; if (limit === null) { return /*#__PURE__*/ _jsxs("div", { className: "".concat(className), children: [ /*#__PURE__*/ _jsxs("div", { className: "flex justify-between items-center mb-1", children: [ /*#__PURE__*/ _jsx("span", { className: "text-xs text-gray-500", children: label }), /*#__PURE__*/ _jsx("span", { className: "text-xs font-semibold text-green-600", children: "∞" }) ] }), /*#__PURE__*/ _jsx("div", { className: "h-1.5 rounded-full bg-green-100", children: /*#__PURE__*/ _jsx("div", { className: "h-full w-full rounded-full bg-green-400" }) }) ] }); } const pct = limit > 0 ? Math.min(100, Math.round(current / limit * 100)) : 100; const remaining = Math.max(0, limit - current); const barColor = pct >= 100 ? 'bg-red-500' : pct >= 80 ? 'bg-amber-400' : 'bg-green-500'; const textColor = pct >= 100 ? 'text-red-600' : pct >= 80 ? 'text-amber-600' : 'text-gray-600'; return /*#__PURE__*/ _jsxs("div", { className: className, children: [ /*#__PURE__*/ _jsxs("div", { className: "flex justify-between items-center mb-1", children: [ /*#__PURE__*/ _jsx("span", { className: "text-xs text-gray-500", children: label }), /*#__PURE__*/ _jsxs("span", { className: "text-xs font-semibold ".concat(textColor), children: [ remaining, " / ", limit ] }) ] }), /*#__PURE__*/ _jsx("div", { className: "h-1.5 rounded-full bg-gray-100", children: /*#__PURE__*/ _jsx("div", { className: "h-full rounded-full transition-all ".concat(barColor), style: { width: "".concat(pct, "%") } }) }) ] }); } i062undefined6470undefined214218__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined328332__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined486489__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined675678__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined910913__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined10341037__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined15541558__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined16451649__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined17911794__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined19641968__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined23122315__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined24272430__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined¶144220(0,jsx_runtime.jsxs)undefined330406(0,jsx_runtime.jsxs)undefined560634(0,jsx_runtime.jsx)undefined820894(0,jsx_runtime.jsx)undefined11261200(0,jsx_runtime.jsx)undefined13211395(0,jsx_runtime.jsx)undefined19121988(0,jsx_runtime.jsxs)undefined20752151(0,jsx_runtime.jsxs)undefined22932367(0,jsx_runtime.jsx)undefined25372613(0,jsx_runtime.jsxs)undefined29573031(0,jsx_runtime.jsx)undefined31433217(0,jsx_runtime.jsx)undefinedRawSource" ;// ./src/app/dashboard/page.tsx úûÉÞ/* __next_internal_client_entry_do_not_use__ default auto */ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime"; import { useEffect, useState } from 'react'; import { useRouter, useSearchParams } from 'next/navigation'; import Link from 'next/link'; import { useSession } from '@/lib/auth'; import { useLocale } from '@/context/locale'; import { getMyTasks, getMyOffers, getMyReviews, getNotifications, getMyDashboard, getSpecialistFomoDashboard, getCustomerFomoDashboard, getMySpecialistCards, applyMyReferral } from '@/lib/api'; import { formatPrice, taskTitle } from '@/lib/taskLocale'; import { PlanBadge } from '@/components/PlanBadge'; import { UsageMeter } from '@/components/UsageMeter'; /** Extract the quoted task title from a stored notification body (any locale) */ function extractNotifParam(body) { if (!body) return null; const m = body.match(/[«""](.+?)[»""]/); var _m_; return (_m_ = m === null || m === void 0 ? void 0 : m[1]) !== null && _m_ !== void 0 ? _m_ : null; } function PlanBlock(param) { let { dashboard, t } = param; const plan = dashboard.plan; const expiry = dashboard.planExpiration; const usage = dashboard.usage; const stats = dashboard.stats; const expiryPct = expiry ? Math.max(0, Math.min(100, Math.round(expiry.daysLeft / 30 * 100))) : 100; const expiryColor = expiry ? expiry.daysLeft <= 3 ? 'bg-red-500' : expiry.daysLeft <= 7 ? 'bg-amber-400' : 'bg-green-400' : 'bg-green-400'; return /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-2xl border border-gray-200 p-5 mb-6", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between mb-4", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2", children: [ /*#__PURE__*/ _jsx("h2", { className: "font-semibold text-gray-800 text-sm", children: t('dashboard.plan.title', 'My Plan') }), plan ? /*#__PURE__*/ _jsx(PlanBadge, { tier: plan.tier, size: "sm" }) : /*#__PURE__*/ _jsx("span", { className: "text-xs text-gray-400", children: t('dashboard.plan.no_plan', 'Free') }) ] }), /*#__PURE__*/ _jsx(Link, { href: "/pricing", className: "text-xs font-medium text-green-600 hover:underline", children: (plan === null || plan === void 0 ? void 0 : plan.tier) === 'ultimate' ? null : t('dashboard.plan.upgrade', 'Upgrade') }) ] }), expiry && /*#__PURE__*/ _jsxs("div", { className: "mb-4", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex justify-between text-xs text-gray-500 mb-1", children: [ /*#__PURE__*/ _jsx("span", { children: t('dashboard.plan.expires', 'Expires in {n} days').replace('{n}', String(expiry.daysLeft)) }), /*#__PURE__*/ _jsxs("span", { children: [ expiry.daysLeft, " ", t('pricing.days', 'days') ] }) ] }), /*#__PURE__*/ _jsx("div", { className: "h-1.5 rounded-full bg-gray-100", children: /*#__PURE__*/ _jsx("div", { className: "h-full rounded-full transition-all ".concat(expiryColor), style: { width: "".concat(expiryPct, "%") } }) }) ] }), (usage.messagesSent !== undefined || usage.ordersMade !== undefined) && /*#__PURE__*/ _jsxs("div", { className: "space-y-2 mb-4", children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs font-medium text-gray-500 uppercase tracking-wide", children: t('dashboard.plan.limits', 'Daily limits') }), /*#__PURE__*/ _jsx(UsageMeter, { current: usage.messagesSent, limit: usage.messagesLeft !== null ? usage.messagesSent + usage.messagesLeft : null, label: t('dashboard.plan.messages', 'Messages') }), /*#__PURE__*/ _jsx(UsageMeter, { current: usage.ordersMade, limit: usage.ordersLeft !== null ? usage.ordersMade + usage.ordersLeft : null, label: t('dashboard.plan.orders', 'Orders') }) ] }), Object.keys(stats).length > 0 && /*#__PURE__*/ _jsx("div", { className: "grid grid-cols-2 gap-2", children: Object.entries(stats).map((param)=>{ let [key, val] = param; return /*#__PURE__*/ _jsxs("div", { className: "bg-gray-50 rounded-xl px-3 py-2 text-center", children: [ /*#__PURE__*/ _jsx("p", { className: "text-lg font-bold text-gray-800", children: val }), /*#__PURE__*/ _jsx("p", { className: "text-[10px] text-gray-400 uppercase tracking-wide", children: t("dashboard.stats.".concat(key), key) }) ] }, key); }) }) ] }); } export default function DashboardPage() { var _session_user, _fomoData_topCategories; const { data: session, isPending } = useSession(); const router = useRouter(); const searchParams = useSearchParams(); const { t, locale } = useLocale(); const [tasks, setTasks] = useState([]); const [offers, setOffers] = useState([]); const [myReviews, setMyReviews] = useState([]); const [invitations, setInvitations] = useState([]); const [loading, setLoading] = useState(true); const [dashboard, setDashboard] = useState(null); const [fomoData, setFomoData] = useState(null); const [hasHelperCard, setHasHelperCard] = useState(null); useEffect(()=>{ if (!isPending && !session) router.push('/login'); }, [ session, isPending ]); // Apply pending referral code after Google OAuth redirect (?ref=CODE) useEffect(()=>{ if (!session) return; const refCode = searchParams.get('ref'); if (!refCode) return; applyMyReferral(refCode).catch(()=>{}); // Remove the ref param from the URL without reloading const params = new URLSearchParams(searchParams.toString()); params.delete('ref'); const newUrl = params.toString() ? "?".concat(params.toString()) : window.location.pathname; router.replace(newUrl); }, [ session ]); // Detect whether the user has completed their helper profile (has a card). // Used to show the getting-started onboarding card to users who haven't yet. useEffect(()=>{ if (!session) return; getMySpecialistCards().then((param)=>{ let { cards } = param; return setHasHelperCard(cards.length > 0); }).catch(()=>setHasHelperCard(null)); }, [ session ]); useEffect(()=>{ if (!session) return; Promise.all([ getMyTasks(), getMyOffers(), getMyReviews(), getNotifications(), getMyDashboard() ]).then((param)=>{ let [t, o, r, notifs, dash] = param; setTasks(t); setOffers(o); setMyReviews(r); setInvitations(notifs.filter((n)=>n.type === 'task_invite')); setDashboard(dash); }).catch(()=>{}).finally(()=>setLoading(false)); }, [ session ]); useEffect(()=>{ var _session_user; if (!session) return; const role = (_session_user = session.user) === null || _session_user === void 0 ? void 0 : _session_user.role; if (role === 'specialist') { getSpecialistFomoDashboard().then(setFomoData).catch(()=>{}); } else { getCustomerFomoDashboard().then(setFomoData).catch(()=>{}); } }, [ session ]); if (isPending || loading) return /*#__PURE__*/ _jsx("div", { className: "text-center py-20 text-white", children: t('common.loading') }); const dateLocale = locale === 'ru' ? 'ru-RU' : locale === 'uk' ? 'uk-UA' : locale === 'en' ? 'en-US' : 'el-GR'; const activeTasks = tasks.filter((task)=>task.status !== 'completed' && task.status !== 'cancelled'); const completedTasks = tasks.filter((task)=>task.status === 'completed' || task.status === 'cancelled'); const activeOffers = offers.filter((row)=>{ const offer = row.offer || row; const task = row.task; return offer.status !== 'other_accepted' && (task === null || task === void 0 ? void 0 : task.status) !== 'completed' && (task === null || task === void 0 ? void 0 : task.status) !== 'cancelled'; }); const completedOffers = offers.filter((row)=>{ const offer = row.offer || row; const task = row.task; return offer.status === 'other_accepted' || (task === null || task === void 0 ? void 0 : task.status) === 'completed' || (task === null || task === void 0 ? void 0 : task.status) === 'cancelled'; }); function TaskCard(param) { let { task } = param; var _task_offerCount; const offerCount = (_task_offerCount = task.offerCount) !== null && _task_offerCount !== void 0 ? _task_offerCount : 0; var _task_declinedCount; const declinedCount = (_task_declinedCount = task.declinedCount) !== null && _task_declinedCount !== void 0 ? _task_declinedCount : 0; const activeOfferCount = offerCount - declinedCount; return /*#__PURE__*/ _jsx(Link, { href: "/tasks/".concat(task.id), className: "block bg-white rounded-xl border border-gray-200 p-4 hover:shadow-sm hover:border-green-300 transition", children: /*#__PURE__*/ _jsxs("div", { className: "flex justify-between items-start", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ _jsx("p", { className: "font-medium text-gray-900 truncate", children: taskTitle(task, locale) }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-1", children: new Date(task.createdAt).toLocaleDateString(dateLocale) }), offerCount > 0 && /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 mt-1.5", children: [ /*#__PURE__*/ _jsxs("span", { className: "text-xs text-green-600 font-medium", children: [ "\uD83D\uDCBC ", offerCount, " ", t('dashboard.offers_count', 'offers') ] }), declinedCount > 0 && /*#__PURE__*/ _jsxs("span", { className: "text-xs text-red-400", children: [ "✕ ", declinedCount, " ", t('dashboard.declined_count', 'declined') ] }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "ml-3 text-right shrink-0", children: [ /*#__PURE__*/ _jsx("span", { className: "text-xs px-2 py-0.5 rounded-full ".concat(task.status === 'open' ? 'bg-green-100 text-green-700' : task.status === 'in_progress' ? 'bg-green-100 text-green-700' : task.status === 'completed' ? 'bg-gray-100 text-gray-600' : 'bg-red-100 text-red-600'), children: t("task.status.".concat(task.status), task.status) }), task.budget && /*#__PURE__*/ _jsxs("p", { className: "text-sm font-bold text-green-600 mt-1", children: [ formatPrice(task.budget), "€" ] }) ] }) ] }) }); } function OfferCard(param) { let { row } = param; var _myReviews_find; const offer = row.offer || row; const task = row.task; var _myReviews_find_review; const reviewReceived = (task === null || task === void 0 ? void 0 : task.status) === 'completed' && offer.status === 'accepted' ? (_myReviews_find_review = (_myReviews_find = myReviews.find((r)=>{ var _r_review; return ((_r_review = r.review) === null || _r_review === void 0 ? void 0 : _r_review.taskId) === (task === null || task === void 0 ? void 0 : task.id); })) === null || _myReviews_find === void 0 ? void 0 : _myReviews_find.review) !== null && _myReviews_find_review !== void 0 ? _myReviews_find_review : null : null; return /*#__PURE__*/ _jsxs(Link, { href: task ? "/tasks/".concat(task.id) : '#', className: "block bg-white rounded-xl border border-gray-200 p-4 hover:shadow-sm hover:border-green-300 transition", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex justify-between items-start", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ _jsx("p", { className: "font-medium text-gray-900 truncate", children: (task === null || task === void 0 ? void 0 : task.title) || t('chat.task_fallback') }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-1", children: new Date(offer.createdAt).toLocaleDateString(dateLocale) }) ] }), /*#__PURE__*/ _jsxs("div", { className: "ml-3 text-right shrink-0", children: [ /*#__PURE__*/ _jsxs("p", { className: "font-bold text-green-600", children: [ formatPrice(offer.price), "€" ] }), /*#__PURE__*/ _jsx("span", { className: "text-xs px-2 py-0.5 rounded-full mt-1 inline-block ".concat(offer.status === 'accepted' ? 'bg-green-100 text-green-700' : offer.status === 'declined' ? 'bg-red-100 text-red-700' : offer.status === 'other_accepted' ? 'bg-green-100 text-green-600' : 'bg-gray-100 text-gray-700'), children: t("offer.status.".concat(offer.status), offer.status) }) ] }) ] }), reviewReceived && /*#__PURE__*/ _jsxs("div", { className: "mt-3 pt-3 border-t border-gray-100 flex items-center gap-2", children: [ /*#__PURE__*/ _jsx("div", { className: "flex gap-0.5", children: [ 1, 2, 3, 4, 5 ].map((star)=>/*#__PURE__*/ _jsx("span", { className: "text-sm ".concat(star <= reviewReceived.rating ? 'text-yellow-400' : 'text-gray-200'), children: "★" }, star)) }), /*#__PURE__*/ _jsxs("span", { className: "text-sm font-semibold text-gray-700", children: [ reviewReceived.rating, "/5" ] }), reviewReceived.comment && /*#__PURE__*/ _jsx("span", { className: "text-xs text-gray-500 truncate", children: reviewReceived.comment }) ] }), (task === null || task === void 0 ? void 0 : task.status) === 'completed' && offer.status === 'accepted' && !reviewReceived && /*#__PURE__*/ _jsx("p", { className: "mt-2 text-xs text-gray-400", children: t('dashboard.review_pending') }) ] }); } const isSpecialist = (session === null || session === void 0 ? void 0 : (_session_user = session.user) === null || _session_user === void 0 ? void 0 : _session_user.role) === 'specialist'; var _fomoData_missedCount; return /*#__PURE__*/ _jsxs("div", { className: "max-w-5xl mx-auto px-4 py-8", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex justify-between items-center mb-8", children: [ /*#__PURE__*/ _jsx("h1", { className: "text-2xl font-bold text-white", children: t('dashboard.title') }), /*#__PURE__*/ _jsx(Link, { href: "/tasks/new", className: "bg-green-600 text-white px-4 py-2 rounded-lg text-sm font-medium hover:bg-green-700", children: t('dashboard.new_task') }) ] }), hasHelperCard === false && /*#__PURE__*/ _jsxs("div", { className: "mb-6 bg-white rounded-2xl border border-gray-200 overflow-hidden", children: [ /*#__PURE__*/ _jsxs("div", { className: "px-5 pt-5 pb-3", children: [ /*#__PURE__*/ _jsx("h2", { className: "text-lg font-bold text-gray-900", children: t('dashboard.onboarding.title') }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-500 mt-1", children: t('dashboard.onboarding.subtitle') }) ] }), /*#__PURE__*/ _jsxs("div", { className: "grid sm:grid-cols-2 gap-3 p-5 pt-2", children: [ /*#__PURE__*/ _jsxs(Link, { href: "/specialist-setup", className: "group flex flex-col rounded-xl border-2 border-green-500 bg-green-50 p-4 hover:bg-green-100 transition", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 mb-1", children: [ /*#__PURE__*/ _jsx("span", { className: "text-xl", children: "\uD83D\uDEE0" }), /*#__PURE__*/ _jsx("span", { className: "font-semibold text-gray-800", children: t('dashboard.onboarding.helper.title') }) ] }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-green-700/80 mb-3 flex-1", children: t('dashboard.onboarding.helper.desc') }), /*#__PURE__*/ _jsxs("span", { className: "inline-flex items-center gap-1 text-sm font-semibold text-green-700", children: [ t('dashboard.onboarding.helper.cta'), " →" ] }) ] }), /*#__PURE__*/ _jsxs(Link, { href: "/tasks/new", className: "group flex flex-col rounded-xl border border-gray-200 bg-gray-50 p-4 hover:bg-gray-100 transition", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 mb-1", children: [ /*#__PURE__*/ _jsx("span", { className: "text-xl", children: "\uD83D\uDCDD" }), /*#__PURE__*/ _jsx("span", { className: "font-semibold text-gray-800", children: t('dashboard.onboarding.requester.title') }) ] }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-500 mb-3 flex-1", children: t('dashboard.onboarding.requester.desc') }), /*#__PURE__*/ _jsxs("span", { className: "inline-flex items-center gap-1 text-sm font-semibold text-gray-700", children: [ t('dashboard.onboarding.requester.cta'), " →" ] }) ] }) ] }) ] }), dashboard && /*#__PURE__*/ _jsx(PlanBlock, { dashboard: dashboard, t: t }), fomoData && (isSpecialist ? (fomoData.missedCount > 0 || fomoData.missedEarnings > 0) && /*#__PURE__*/ _jsxs("div", { className: "mb-6 bg-amber-50 border border-amber-200 rounded-xl px-5 py-4 flex items-start gap-3", children: [ /*#__PURE__*/ _jsx("div", { className: "shrink-0 mt-0.5", children: /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5 text-amber-500", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 9v2m0 4h.01M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z" }) }) }), /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ _jsxs("p", { className: "text-base font-semibold text-amber-800", children: [ t('fomo.specialist_missed', 'You missed {n} tasks').replace('{n}', String((_fomoData_missedCount = fomoData.missedCount) !== null && _fomoData_missedCount !== void 0 ? _fomoData_missedCount : 0)), fomoData.missedEarnings > 0 && /*#__PURE__*/ _jsxs("span", { className: "ml-1 text-amber-600", children: [ "for €", fomoData.missedEarnings ] }) ] }), ((_fomoData_topCategories = fomoData.topCategories) === null || _fomoData_topCategories === void 0 ? void 0 : _fomoData_topCategories.length) > 0 && /*#__PURE__*/ _jsxs("p", { className: "text-sm text-amber-600 mt-0.5", children: [ t('fomo.top_categories', 'Categories'), ": ", fomoData.topCategories.slice(0, 3).join(', ') ] }) ] }), /*#__PURE__*/ _jsx(Link, { href: "/pricing", className: "shrink-0 text-xs font-medium text-amber-700 bg-amber-100 px-3 py-1.5 rounded-lg hover:bg-amber-200 transition", children: t('dashboard.plan.upgrade') }) ] }) : fomoData.totalTasks > 0 && /*#__PURE__*/ _jsx("div", { className: "mb-6 bg-green-50 border border-green-200 rounded-xl px-5 py-4", children: /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between gap-4 flex-wrap", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3", children: [ /*#__PURE__*/ _jsx("div", { className: "shrink-0 bg-green-100 rounded-xl p-2", children: /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5 text-green-600", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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" }) }) }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("p", { className: "text-base font-semibold text-gray-800", children: [ fomoData.totalOffers, " ", t('fomo.offers_received', 'offers received') ] }), fomoData.avgOffersPerTask > 0 && /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-500", children: t('fomo.avg_offers', 'Average {n}/task').replace('{n}', Number(fomoData.avgOffersPerTask).toFixed(1)) }) ] }) ] }), fomoData.completionRate !== undefined && /*#__PURE__*/ _jsxs("div", { className: "text-right", children: [ /*#__PURE__*/ _jsxs("p", { className: "text-2xl font-bold text-green-700", children: [ Math.round(fomoData.completionRate * 100), "%" ] }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-400", children: t('fomo.completion_rate', 'completed') }) ] }) ] }) })), isSpecialist && /*#__PURE__*/ _jsxs(Link, { href: "/tasks", className: "flex items-center justify-between gap-4 bg-green-600 text-white rounded-xl px-5 py-4 mb-8 hover:bg-green-700 transition", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-4", children: [ /*#__PURE__*/ _jsx("div", { className: "shrink-0 bg-white/20 rounded-xl p-2.5", children: /*#__PURE__*/ _jsxs("svg", { className: "w-6 h-6 text-white", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ _jsx("circle", { cx: "11", cy: "11", r: "7" }), /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M21 21l-4.35-4.35" }) ] }) }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "font-semibold text-base", children: t('find_tasks.title') }), /*#__PURE__*/ _jsx("p", { className: "text-green-100 text-sm mt-0.5", children: t('find_tasks.banner_hint') }) ] }) ] }), /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5 shrink-0 text-white/70", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 5l7 7-7 7" }) }) ] }), /*#__PURE__*/ _jsxs("div", { className: "grid md:grid-cols-2 gap-8", children: [ /*#__PURE__*/ _jsxs("div", { className: "space-y-8", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("h2", { className: "text-lg font-semibold text-white mb-4", children: [ t('dashboard.my_tasks'), " ", /*#__PURE__*/ _jsxs("span", { className: "text-white/60 font-normal text-base", children: [ "(", activeTasks.length, ")" ] }) ] }), activeTasks.length === 0 ? /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6 text-center text-gray-500", children: [ /*#__PURE__*/ _jsx("p", { children: t('dashboard.tasks.empty') }), /*#__PURE__*/ _jsx(Link, { href: "/tasks/new", className: "text-green-600 hover:underline text-sm mt-2 inline-block", children: t('dashboard.tasks.empty.cta') }) ] }) : /*#__PURE__*/ _jsx("div", { className: "space-y-3", children: activeTasks.map((task)=>/*#__PURE__*/ _jsx(TaskCard, { task: task }, task.id)) }) ] }), completedTasks.length > 0 && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("h2", { className: "text-lg font-semibold text-white/70 mb-4", children: [ t('dashboard.completed_tasks'), " ", /*#__PURE__*/ _jsxs("span", { className: "font-normal text-base text-white/50", children: [ "(", completedTasks.length, ")" ] }) ] }), /*#__PURE__*/ _jsx("div", { className: "space-y-3 opacity-75", children: completedTasks.map((task)=>/*#__PURE__*/ _jsx(TaskCard, { task: task }, task.id)) }) ] }) ] }), /*#__PURE__*/ _jsx("div", { className: "space-y-8", children: isSpecialist ? /*#__PURE__*/ _jsxs(_Fragment, { children: [ invitations.length > 0 && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("h2", { className: "text-lg font-semibold text-white mb-4", children: [ t('dashboard.invitations'), " ", /*#__PURE__*/ _jsxs("span", { className: "text-white/60 font-normal text-base", children: [ "(", invitations.length, ")" ] }) ] }), /*#__PURE__*/ _jsx("div", { className: "space-y-3", children: invitations.map((inv)=>/*#__PURE__*/ _jsxs(Link, { href: inv.referenceId ? "/tasks/".concat(inv.referenceId) : '/tasks', className: "flex items-start gap-3 p-4 rounded-xl border transition cursor-pointer ".concat(inv.isRead ? 'bg-white/90 border-white/20 hover:bg-white' : 'bg-white border-amber-300 shadow-sm hover:bg-amber-50'), children: [ /*#__PURE__*/ _jsx("span", { className: "text-2xl", children: "\uD83D\uDCCB" }), /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ _jsx("p", { className: "font-medium truncate ".concat(inv.isRead ? 'text-gray-600' : 'text-gray-900'), children: t('notif.type.task_invite', inv.title) }), inv.body && /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-500 mt-0.5 truncate", children: (()=>{ const title = extractNotifParam(inv.body); const tpl = t('notif.body.task_invite', ''); return title && tpl ? tpl.replace('{title}', title) : inv.body; })() }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-1", children: new Date(inv.createdAt).toLocaleDateString(dateLocale) }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex flex-col items-end gap-1.5 shrink-0", children: [ !inv.isRead && /*#__PURE__*/ _jsx("span", { className: "w-2 h-2 bg-amber-400 rounded-full mt-2" }), /*#__PURE__*/ _jsx("span", { className: "text-xs text-gray-400", children: "→" }) ] }) ] }, inv.id)) }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("h2", { className: "text-lg font-semibold text-white mb-4", children: [ t('dashboard.my_offers'), " ", /*#__PURE__*/ _jsxs("span", { className: "text-white/60 font-normal text-base", children: [ "(", activeOffers.length, ")" ] }) ] }), activeOffers.length === 0 ? /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6 text-center text-gray-500", children: [ /*#__PURE__*/ _jsx("p", { children: t('dashboard.offers.empty') }), /*#__PURE__*/ _jsx(Link, { href: "/tasks", className: "text-green-600 hover:underline text-sm mt-2 inline-block", children: t('dashboard.offers.empty.cta') }) ] }) : /*#__PURE__*/ _jsx("div", { className: "space-y-3", children: activeOffers.map((row)=>/*#__PURE__*/ _jsx(OfferCard, { row: row }, (row.offer || row).id)) }) ] }), completedOffers.length > 0 && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("h2", { className: "text-lg font-semibold text-white/70 mb-4", children: [ t('dashboard.completed_offers'), " ", /*#__PURE__*/ _jsxs("span", { className: "font-normal text-base text-white/50", children: [ "(", completedOffers.length, ")" ] }) ] }), /*#__PURE__*/ _jsx("div", { className: "space-y-3 opacity-75", children: completedOffers.map((row)=>/*#__PURE__*/ _jsx(OfferCard, { row: row }, (row.offer || row).id)) }) ] }) ] }) : /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs(Link, { href: "/specialists", className: "flex items-center justify-between gap-4 bg-green-600 text-white rounded-xl px-5 py-4 hover:bg-green-700 transition", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-4", children: [ /*#__PURE__*/ _jsx("div", { className: "shrink-0 bg-white/20 rounded-xl p-2.5", children: /*#__PURE__*/ _jsx("svg", { className: "w-6 h-6 text-white", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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" }) }) }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "font-semibold text-base", children: t('dashboard.customer.specialists_title') }), /*#__PURE__*/ _jsx("p", { className: "text-green-100 text-sm mt-0.5", children: t('dashboard.customer.specialists_hint') }) ] }) ] }), /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5 shrink-0 text-white/70", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 5l7 7-7 7" }) }) ] }), /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-5", children: [ /*#__PURE__*/ _jsx("h2", { className: "text-base font-semibold text-gray-800 mb-4", children: t('dashboard.customer.how_title') }), /*#__PURE__*/ _jsx("div", { className: "space-y-3", children: [ { num: '1', text: t('dashboard.customer.step1'), icon: 'M12 4v16m8-8H4' }, { num: '2', text: t('dashboard.customer.step2'), icon: 'M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z' }, { num: '3', text: t('dashboard.customer.step3'), icon: 'M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z' } ].map((param)=>{ let { num, text, icon } = param; return /*#__PURE__*/ _jsxs("div", { className: "flex items-start gap-3", children: [ /*#__PURE__*/ _jsx("span", { className: "shrink-0 w-7 h-7 rounded-full bg-green-100 text-green-600 text-sm font-bold flex items-center justify-center", children: num }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-600 pt-1", children: text }) ] }, num); }) }), /*#__PURE__*/ _jsxs(Link, { href: "/tasks/new", className: "mt-4 inline-block text-sm font-medium text-green-600 hover:underline", children: [ tasks.length > 0 ? t('dashboard.tasks.add_new') : t('dashboard.tasks.empty.cta'), " →" ] }) ] }) ] }) }) ] }) ] }); } ÊO61146undefined148191undefined193253undefined255283undefined285324undefined326370undefined372564undefined566623undefined625675undefined677729undefined15231527__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined16591663__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined18051809__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined19601963__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined22152218__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined22202228__WEBPACK_MODULE_REFERENCE__8_5b22506c616e4261646765225d_directImport_asiSafe1__._undefined23722375__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined26482651__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined26532656__WEBPACK_MODULE_REFERENCE__3_5b2264656661756c74225d_directImport_asiSafe1__._undefined30383042__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined31503154__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined33293332__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined35513555__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined39163919__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined40474050__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined44734477__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined45954598__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined48384841__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined48434852__WEBPACK_MODULE_REFERENCE__9_5b2255736167654d65746572225d_directImport_asiSafe1__._undefined51495152__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined51545163__WEBPACK_MODULE_REFERENCE__9_5b2255736167654d65746572225d_directImport_asiSafe1__._undefined55065509__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined57215725__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined58965899__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined61066109__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined64356449undefined65666575__WEBPACK_MODULE_REFERENCE__4_5b2275736553657373696f6e225d_call_directImport_asiSafe1__._undefined65996607__WEBPACK_MODULE_REFERENCE__2_5b22757365526f75746572225d_call_directImport_asiSafe1__._undefined66376651__WEBPACK_MODULE_REFERENCE__2_5b22757365536561726368506172616d73225d_call_directImport_asiSafe1__._undefined66826690__WEBPACK_MODULE_REFERENCE__5_5b227573654c6f63616c65225d_call_directImport_asiSafe1__._undefined67256732__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined67716778__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined68236830__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined68796886__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined69276934__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined69816988__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined70337040__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined70957102__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined71157123__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined73217329__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined74547468__WEBPACK_MODULE_REFERENCE__6_5b226170706c794d79526566657272616c225d_call_directImport_asiSafe1__._undefined79887996__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined80428061__WEBPACK_MODULE_REFERENCE__6_5b226765744d795370656369616c6973744361726473225d_call_directImport_asiSafe1__._undefined82548262__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined83348343__WEBPACK_MODULE_REFERENCE__6_5b226765744d795461736b73225d_call_directImport_asiSafe1__._undefined83608370__WEBPACK_MODULE_REFERENCE__6_5b226765744d794f6666657273225d_call_directImport_asiSafe1__._undefined83878398__WEBPACK_MODULE_REFERENCE__6_5b226765744d7952657669657773225d_call_directImport_asiSafe1__._undefined84158430__WEBPACK_MODULE_REFERENCE__6_5b226765744e6f74696669636174696f6e73225d_call_directImport_asiSafe1__._undefined84478460__WEBPACK_MODULE_REFERENCE__6_5b226765744d7944617368626f617264225d_call_directImport_asiSafe1__._undefined88208828__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined90629087__WEBPACK_MODULE_REFERENCE__6_5b226765745370656369616c697374466f6d6f44617368626f617264225d_call_directImport_asiSafe1__._undefined91539176__WEBPACK_MODULE_REFERENCE__6_5b22676574437573746f6d6572466f6d6f44617368626f617264225d_call_directImport_asiSafe1__._undefined93079310__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1089910902__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1090410907__WEBPACK_MODULE_REFERENCE__3_5b2264656661756c74225d_directImport_asiSafe1__._undefined1112211126__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1126211266__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1140811411__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1154311551__WEBPACK_MODULE_REFERENCE__7_5b227461736b5469746c65225d_call_directImport_asiSafe1__._undefined1164111644__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1191611920__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1210212106__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1266012664__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1327713281__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1343313436__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1392513929__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1410214112__WEBPACK_MODULE_REFERENCE__7_5b22666f726d61745072696365225d_call_directImport_asiSafe1__._undefined1512715131__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1513315136__WEBPACK_MODULE_REFERENCE__3_5b2264656661756c74225d_directImport_asiSafe1__._undefined1538215386__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1553415538__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1569215695__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1600116004__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1632416328__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1649216496__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1666816678__WEBPACK_MODULE_REFERENCE__7_5b22666f726d61745072696365225d_call_directImport_asiSafe1__._undefined1685816861__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1748117485__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1765917662__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1799818001__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1830618310__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1865418657__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1902919032__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1946219466__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1957319577__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1971919722__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1991319916__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1991819921__WEBPACK_MODULE_REFERENCE__3_5b2264656661756c74225d_directImport_asiSafe1__._undefined2026020264__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2043220436__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2057820581__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2081720820__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2109421098__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2126021264__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2126621269__WEBPACK_MODULE_REFERENCE__3_5b2264656661756c74225d_directImport_asiSafe1__._undefined2157621580__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2178421787__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2204922052__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2243022433__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2271222716__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2322223226__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2322823231__WEBPACK_MODULE_REFERENCE__3_5b2264656661756c74225d_directImport_asiSafe1__._undefined2352623530__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2373423737__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2399824001__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2438224385__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2466324667__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2525425257__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2546225466__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2565425657__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2577025773__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2608926092__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2646926473__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2661526619__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2707127075__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2767227676__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2815428157__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2815928162__WEBPACK_MODULE_REFERENCE__3_5b2264656661756c74225d_directImport_asiSafe1__._undefined2851828521__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2866428668__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2883328837__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2900029003__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2916129164__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2955229555__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3011430118__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3023130235__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3078930792__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3129031294__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3144431448__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3183631839__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3219732201__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3220332206__WEBPACK_MODULE_REFERENCE__3_5b2264656661756c74225d_directImport_asiSafe1__._undefined3245532459__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3261032613__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3276432768__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3317033173__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3344433447__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3385333857__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3396233965__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3421434217__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3457634579__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3487934882__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3515535159__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3528835292__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3542935433__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3553835542__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3587235876__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3648736491__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3673936742__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3694236945__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3694736950__WEBPACK_MODULE_REFERENCE__3_5b2264656661756c74225d_directImport_asiSafe1__._undefined3737537378__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3754137544__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3785037854__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3795937963__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3830338307__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3889438897__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3907439077__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3939539398__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3952039524__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3952639534__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined3965139655__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3976839772__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4012540129__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4075340756__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4092640930__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4093240935__WEBPACK_MODULE_REFERENCE__3_5b2264656661756c74225d_directImport_asiSafe1__._undefined4145841461__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4177141775__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4202542028__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4247142474__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4327543278__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4378843792__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4408344086__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4436444367__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4503045034__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4514745151__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4550245506__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4615946163__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4642346426__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4663946642__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4664446647__WEBPACK_MODULE_REFERENCE__3_5b2264656661756c74225d_directImport_asiSafe1__._undefined4709347096__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4726747270__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4761447618__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4773147735__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4809648100__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4872848731__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4891648919__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4925949263__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4926549273__WEBPACK_MODULE_REFERENCE__0_5b22467261676d656e74225d_directImport_asiSafe1__._undefined4936449368__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4937049373__WEBPACK_MODULE_REFERENCE__3_5b2264656661756c74225d_directImport_asiSafe1__._undefined4970349707__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4991849921__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5011250115__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5059550598__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5127451278__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5142351426__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5177551778__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5231052313__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5273352736__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5316953173__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5338353386__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5368353686__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5512955133__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5536755370__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5576955772__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5627256276__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5627856281__WEBPACK_MODULE_REFERENCE__3_5b2264656661756c74225d_directImport_asiSafe1__._undefined•863939(0,jsx_runtime.jsxs)undefined10711147(0,jsx_runtime.jsxs)undefined12891365(0,jsx_runtime.jsxs)undefined15161590(0,jsx_runtime.jsx)undefined18421916(0,jsx_runtime.jsx)undefined19181999PlanBadge/* PlanBadge */.dundefined21432217(0,jsx_runtime.jsx)undefined24902564(0,jsx_runtime.jsx)undefined25662643(link_default())undefined30253101(0,jsx_runtime.jsxs)undefined32093285(0,jsx_runtime.jsxs)undefined34603534(0,jsx_runtime.jsx)undefined37533829(0,jsx_runtime.jsxs)undefined41904264(0,jsx_runtime.jsx)undefined43924466(0,jsx_runtime.jsx)undefined48894965(0,jsx_runtime.jsxs)undefined50835157(0,jsx_runtime.jsx)undefined53975471(0,jsx_runtime.jsx)undefined54735556UsageMeterundefined58535927(0,jsx_runtime.jsx)undefined59296012UsageMeterundefined63556429(0,jsx_runtime.jsx)undefined66416717(0,jsx_runtime.jsxs)undefined68886962(0,jsx_runtime.jsx)undefined71697243(0,jsx_runtime.jsx)undefined76857773(0,auth/* useSession */.wV)undefined77977883(0,navigation.useRouter)undefined79138011(0,navigation.useSearchParams)undefined80428128(0,context_locale/* useLocale */.Y)undefined81638247(0,react.useState)undefined82868370(0,react.useState)undefined84158499(0,react.useState)undefined85488632(0,react.useState)undefined86738757(0,react.useState)undefined88048888(0,react.useState)undefined89339017(0,react.useState)undefined90729156(0,react.useState)undefined91699255(0,react.useEffect)undefined94539539(0,react.useEffect)undefined96649762(0,api/* applyMyReferral */.C0)undefined1028210368(0,react.useEffect)undefined1041410522(0,api/* getMySpecialistCards */.Bb)undefined1071510801(0,react.useEffect)undefined1087310961(0,api/* getMyTasks */.Fu)undefined1097811068(0,api/* getMyOffers */.aT)undefined1108511177(0,api/* getMyReviews */.q7)undefined1119411294(0,api/* getNotifications */.Tr)undefined1131111407(0,api/* getMyDashboard */.H)undefined1176711853(0,react.useEffect)undefined1208712207(0,api/* getSpecialistFomoDashboard */.zk)undefined1227312389(0,api/* getCustomerFomoDashboard */.ML)undefined1252012594(0,jsx_runtime.jsx)undefined1418314257(0,jsx_runtime.jsx)undefined1425914336(link_default())undefined1455114627(0,jsx_runtime.jsxs)undefined1476314839(0,jsx_runtime.jsxs)undefined1498115055(0,jsx_runtime.jsx)undefined1518715273(0,taskLocale/* taskTitle */.Oj)undefined1536315437(0,jsx_runtime.jsx)undefined1570915785(0,jsx_runtime.jsxs)undefined1596716043(0,jsx_runtime.jsxs)undefined1659716673(0,jsx_runtime.jsxs)undefined1728617362(0,jsx_runtime.jsxs)undefined1751417588(0,jsx_runtime.jsx)undefined1807718153(0,jsx_runtime.jsxs)undefined1832618416(0,taskLocale/* formatPrice */.$g)undefined1943119507(0,jsx_runtime.jsxs)undefined1950919586(link_default())undefined1983219908(0,jsx_runtime.jsxs)undefined2005620132(0,jsx_runtime.jsxs)undefined2028620360(0,jsx_runtime.jsx)undefined2066620740(0,jsx_runtime.jsx)undefined2106021136(0,jsx_runtime.jsxs)undefined2130021376(0,jsx_runtime.jsxs)undefined2154821638(0,taskLocale/* formatPrice */.$g)undefined2181821892(0,jsx_runtime.jsx)undefined2251222588(0,jsx_runtime.jsxs)undefined2276222836(0,jsx_runtime.jsx)undefined2317223246(0,jsx_runtime.jsx)undefined2355123627(0,jsx_runtime.jsxs)undefined2397124045(0,jsx_runtime.jsx)undefined2441724491(0,jsx_runtime.jsx)undefined2492124997(0,jsx_runtime.jsxs)undefined2510425180(0,jsx_runtime.jsxs)undefined2532225396(0,jsx_runtime.jsx)undefined2558725661(0,jsx_runtime.jsx)undefined2566325740(link_default())undefined2607926155(0,jsx_runtime.jsxs)undefined2632326399(0,jsx_runtime.jsxs)undefined2654126615(0,jsx_runtime.jsx)undefined2685126925(0,jsx_runtime.jsx)undefined2719927275(0,jsx_runtime.jsxs)undefined2743727513(0,jsx_runtime.jsxs)undefined2751527592(link_default())undefined2789927975(0,jsx_runtime.jsxs)undefined2817928253(0,jsx_runtime.jsx)undefined2851528589(0,jsx_runtime.jsx)undefined2896729041(0,jsx_runtime.jsx)undefined2932029396(0,jsx_runtime.jsxs)undefined2990229978(0,jsx_runtime.jsxs)undefined2998030057(link_default())undefined3035230428(0,jsx_runtime.jsxs)undefined3063230706(0,jsx_runtime.jsx)undefined3096731041(0,jsx_runtime.jsx)undefined3142231496(0,jsx_runtime.jsx)undefined3177431850(0,jsx_runtime.jsxs)undefined3243732511(0,jsx_runtime.jsx)undefined3271632792(0,jsx_runtime.jsxs)undefined3298033054(0,jsx_runtime.jsx)undefined3316733241(0,jsx_runtime.jsx)undefined3355733631(0,jsx_runtime.jsx)undefined3400834084(0,jsx_runtime.jsxs)undefined3422634302(0,jsx_runtime.jsxs)undefined3475434830(0,jsx_runtime.jsxs)undefined3542735503(0,jsx_runtime.jsxs)undefined3598136055(0,jsx_runtime.jsx)undefined3605736134(link_default())undefined3649036564(0,jsx_runtime.jsx)undefined3670736783(0,jsx_runtime.jsxs)undefined3694837024(0,jsx_runtime.jsxs)undefined3718737261(0,jsx_runtime.jsx)undefined3741937493(0,jsx_runtime.jsx)undefined3788137955(0,jsx_runtime.jsx)undefined3851438590(0,jsx_runtime.jsxs)undefined3870338779(0,jsx_runtime.jsxs)undefined3933339407(0,jsx_runtime.jsx)undefined3990539981(0,jsx_runtime.jsxs)undefined4013140207(0,jsx_runtime.jsxs)undefined4059540669(0,jsx_runtime.jsx)undefined4102741103(0,jsx_runtime.jsxs)undefined4110541182(link_default())undefined4143141507(0,jsx_runtime.jsxs)undefined4165841732(0,jsx_runtime.jsx)undefined4188341959(0,jsx_runtime.jsxs)undefined4236142435(0,jsx_runtime.jsx)undefined4270642780(0,jsx_runtime.jsx)undefined4318643262(0,jsx_runtime.jsxs)undefined4336743441(0,jsx_runtime.jsx)undefined4369043764(0,jsx_runtime.jsx)undefined4412344197(0,jsx_runtime.jsx)undefined4449744571(0,jsx_runtime.jsx)undefined4484444920(0,jsx_runtime.jsxs)undefined4504945125(0,jsx_runtime.jsxs)undefined4526245338(0,jsx_runtime.jsxs)undefined4544345519(0,jsx_runtime.jsxs)undefined4584945925(0,jsx_runtime.jsxs)undefined4653646612(0,jsx_runtime.jsxs)undefined4686046934(0,jsx_runtime.jsx)undefined4713447208(0,jsx_runtime.jsx)undefined4721047287(link_default())undefined4771247786(0,jsx_runtime.jsx)undefined4794948023(0,jsx_runtime.jsx)undefined4832948405(0,jsx_runtime.jsxs)undefined4851048586(0,jsx_runtime.jsxs)undefined4892649002(0,jsx_runtime.jsxs)undefined4958949663(0,jsx_runtime.jsx)undefined4984049914(0,jsx_runtime.jsx)undefined5023250306(0,jsx_runtime.jsx)undefined5042850504(0,jsx_runtime.jsxs)undefined5050650585jsx_runtime.Fragmentundefined5070250778(0,jsx_runtime.jsxs)undefined5089150967(0,jsx_runtime.jsxs)undefined5132051396(0,jsx_runtime.jsxs)undefined5202052094(0,jsx_runtime.jsx)undefined5226452340(0,jsx_runtime.jsxs)undefined5234252419(link_default())undefined5294253016(0,jsx_runtime.jsx)undefined5332653402(0,jsx_runtime.jsxs)undefined5365253726(0,jsx_runtime.jsx)undefined5416954243(0,jsx_runtime.jsx)undefined5504455118(0,jsx_runtime.jsx)undefined5562855704(0,jsx_runtime.jsxs)undefined5599556069(0,jsx_runtime.jsx)undefined5634756421(0,jsx_runtime.jsx)undefined5708457160(0,jsx_runtime.jsxs)undefined5727357349(0,jsx_runtime.jsxs)undefined5770057776(0,jsx_runtime.jsxs)undefined5842958505(0,jsx_runtime.jsxs)undefined5876558839(0,jsx_runtime.jsx)undefined5905259126(0,jsx_runtime.jsx)undefined5912859205(link_default())undefined5965159725(0,jsx_runtime.jsx)undefined5989659970(0,jsx_runtime.jsx)undefined6031460390(0,jsx_runtime.jsxs)undefined6050360579(0,jsx_runtime.jsxs)undefined6094061016(0,jsx_runtime.jsxs)undefined6164461718(0,jsx_runtime.jsx)undefined6190361977(0,jsx_runtime.jsx)undefined6231762393(0,jsx_runtime.jsxs)undefined6239562474jsx_runtime.Fragmentundefined6256562641(0,jsx_runtime.jsxs)undefined6264362720(link_default())undefined6305063126(0,jsx_runtime.jsxs)undefined6333763411(0,jsx_runtime.jsx)undefined6360263676(0,jsx_runtime.jsx)undefined6415664230(0,jsx_runtime.jsx)undefined6490664982(0,jsx_runtime.jsxs)undefined6512765201(0,jsx_runtime.jsx)undefined6555065624(0,jsx_runtime.jsx)undefined6615666230(0,jsx_runtime.jsx)undefined6665066724(0,jsx_runtime.jsx)undefined6715767233(0,jsx_runtime.jsxs)undefined6744367517(0,jsx_runtime.jsx)undefined6781467888(0,jsx_runtime.jsx)undefined6933169407(0,jsx_runtime.jsxs)undefined6964169715(0,jsx_runtime.jsx)undefined7011470188(0,jsx_runtime.jsx)undefined7068870764(0,jsx_runtime.jsxs)undefined7076670843(link_default())undefined RawSource /***/ }), /***/ 1592:  ú «webpack/lib/util/registerExternalSerializerœwebpack-sources/ConcatSource€«webpack/lib/util/registerExternalSerializer™webpack-sources/RawSource_/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; «webpack/lib/util/registerExternalSerializerœwebpack-sources/CachedSource w«webpack/lib/util/registerExternalSerializerœwebpack-sources/ConcatSource€«webpack/lib/util/registerExternalSerializer™webpack-sources/RawSourceå/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ CI: () => (/* binding */ signOut), /* harmony export */ Hh: () => (/* binding */ signUp), /* harmony export */ Jv: () => (/* binding */ signIn), /* harmony export */ wV: () => (/* binding */ useSession), /* harmony export */ yK: () => (/* binding */ authClient) /* harmony export */ }); /* harmony import */ var better_auth_react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6504); «webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSource import { createAuthClient } from 'better-auth/react'; const API_URL = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; export const authClient = createAuthClient({ baseURL: API_URL }); export const { signIn, signOut, signUp, useSession } = authClient; d4FdiE‚ˆœ«È΀˜"https://api.canhelp.gr"0€Ì(0,better_auth_react__WEBPACK_IMPORTED_MODULE_0__/* .createAuthClient */ .M)€€†buffer†source„size„maps„hashÌ/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ CI: () => (/* binding */ signOut), /* harmony export */ Hh: () => (/* binding */ signUp), /* harmony export */ Jv: () => (/* binding */ signIn), /* harmony export */ wV: () => (/* binding */ useSession), /* harmony export */ yK: () => (/* binding */ authClient) /* harmony export */ }); /* harmony import */ var better_auth_react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6504); const API_URL = "https://api.canhelp.gr" || 0; const authClient = (0,better_auth_react__WEBPACK_IMPORTED_MODULE_0__/* .createAuthClient */ .M)({ baseURL: API_URL }); const { signIn, signOut, signUp, useSession } = authClient; €”{"finalSource":true}ƒmap‹bufferedMap ConcatSourceRawSourceå/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ CI: () => (/* binding */ signOut), /* harmony export */ Hh: () => (/* binding */ signUp), /* harmony export */ Jv: () => (/* binding */ signIn), /* harmony export */ wV: () => (/* binding */ useSession), /* harmony export */ yK: () => (/* binding */ authClient) /* harmony export */ }); /* harmony import */ var better_auth_react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6504); ReplaceSourceRawSource import { createAuthClient } from 'better-auth/react'; const API_URL = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; export const authClient = createAuthClient({ baseURL: API_URL }); export const { signIn, signOut, signUp, useSession } = authClient; »052undefined70100"https://api.canhelp.gr"undefined1051270undefined130136undefined156171(0,better_auth_react__WEBPACK_IMPORTED_MODULE_0__/* .createAuthClient */ .M)undefined200206undefined /***/ }) å5/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ CI: () => (/* binding */ signOut), /* harmony export */ Hh: () => (/* binding */ signUp), /* harmony export */ Jv: () => (/* binding */ signIn), /* harmony export */ wV: () => (/* binding */ useSession), /* harmony export */ yK: () => (/* binding */ authClient) /* harmony export */ }); /* harmony import */ var better_auth_react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6504); const API_URL = "https://api.canhelp.gr" || 0; const authClient = (0,better_auth_react__WEBPACK_IMPORTED_MODULE_0__/* .createAuthClient */ .M)({ baseURL: API_URL }); const { signIn, signOut, signUp, useSession } = authClient; /***/ }) æé  êëêå/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ CI: () => (/* binding */ signOut), /* harmony export */ Hh: () => (/* binding */ signUp), /* harmony export */ Jv: () => (/* binding */ signIn), /* harmony export */ wV: () => (/* binding */ useSession), /* harmony export */ yK: () => (/* binding */ authClient) /* harmony export */ }); /* harmony import */ var better_auth_react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6504); í import { createAuthClient } from 'better-auth/react'; const API_URL = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; export const authClient = createAuthClient({ baseURL: API_URL }); export const { signIn, signOut, signUp, useSession } = authClient; »052undefined70100"https://api.canhelp.gr"undefined1051270undefined130136undefined156171(0,better_auth_react__WEBPACK_IMPORTED_MODULE_0__/* .createAuthClient */ .M)undefined200206undefinedóô, /***/ 2035:  R?«webpack/lib/util/registerExternalSerializerœwebpack-sources/ConcatSource€«webpack/lib/util/registerExternalSerializer™webpack-sources/RawSource_/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; «webpack/lib/util/registerExternalSerializerœwebpack-sources/CachedSource A«webpack/lib/util/registerExternalSerializerœwebpack-sources/ConcatSource€«webpack/lib/util/registerExternalSerializer™webpack-sources/RawSourceú/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ d: () => (/* binding */ PlanBadge) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); «webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourceimport { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; const tierConfig = { free: { label: 'Free', class: 'bg-gray-100 text-gray-500 border border-gray-200', icon: '' }, pro: { label: 'Pro', class: 'bg-green-100 text-green-700 border border-green-200', icon: /*#__PURE__*/ _jsx("svg", { viewBox: "0 0 16 16", fill: "none", className: "w-3 h-3 inline-block mr-0.5 -mt-px", children: /*#__PURE__*/ _jsx("path", { d: "M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z", fill: "currentColor" }) }) }, ultimate: { label: 'Ultimate', class: 'bg-gradient-to-r from-amber-400 via-yellow-400 to-amber-400 text-gray-900 border border-amber-500 shadow-sm shadow-amber-300/50', icon: /*#__PURE__*/ _jsx("svg", { viewBox: "0 0 16 16", fill: "none", className: "w-3 h-3 inline-block mr-0.5 -mt-px", children: /*#__PURE__*/ _jsx("path", { d: "M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z", fill: "currentColor" }) }) } }; export function PlanBadge(param) { let { tier, verified, size = 'sm', className = '' } = param; if (tier === 'free' && !verified) return null; const sizeClass = size === 'sm' ? 'text-[10px] px-1.5 py-0.5' : 'text-xs px-2 py-0.5'; if (verified && tier !== 'free') { return /*#__PURE__*/ _jsxs("span", { className: "inline-flex items-center gap-1 rounded-full font-semibold ".concat(sizeClass, " ").concat(tierConfig[tier].class, " ").concat(className), children: [ tier === 'ultimate' ? /*#__PURE__*/ _jsx(StarIcon, { className: "w-3 h-3 fill-gray-900" }) : /*#__PURE__*/ _jsx(VerifiedIcon, { className: "w-3 h-3" }), tierConfig[tier].label ] }); } if (verified) { return /*#__PURE__*/ _jsx("span", { className: "inline-flex items-center gap-0.5 rounded-full font-semibold ".concat(sizeClass, " bg-green-100 text-green-700 border border-green-200 ").concat(className), children: /*#__PURE__*/ _jsx(VerifiedIcon, { className: "w-3 h-3" }) }); } const cfg = tierConfig[tier]; return /*#__PURE__*/ _jsxs("span", { className: "inline-flex items-center rounded-full font-semibold ".concat(sizeClass, " ").concat(cfg.class, " ").concat(className), children: [ tier === 'pro' && /*#__PURE__*/ _jsx(StarIcon, { className: "w-3 h-3 mr-0.5 -mt-px" }), tier === 'ultimate' && /*#__PURE__*/ _jsx(StarIcon, { className: "w-3 h-3 mr-0.5 -mt-px fill-gray-900" }), cfg.label ] }); } function StarIcon(param) { let { className = '' } = param; return /*#__PURE__*/ _jsx("svg", { viewBox: "0 0 16 16", fill: "none", className: className, children: /*#__PURE__*/ _jsx("path", { d: "M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z", fill: "currentColor" }) }); } function VerifiedIcon(param) { let { className = '' } = param; return /*#__PURE__*/ _jsxs("svg", { viewBox: "0 0 16 16", fill: "none", className: className, children: [ /*#__PURE__*/ _jsx("path", { d: "M8 1l2 1.4 2.4-.4 1 2.2 2 1.2-.4 2.4L16 10l-1.8 1.6.4 2.4-2.2.8L10.8 17 8 16.2 5.2 17l-1.2-2.2-2.2-.8.4-2.4L0 10l1-2.2-.4-2.4 2-1.2 1-2.2 2.4.4L8 1z", fill: "#3B82F6" }), /*#__PURE__*/ _jsx("path", { d: "M5.5 8.5l1.5 1.5 3-3", stroke: "white", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) ] }); } b>_VYŽ‘9<ïõ%)#&Ž‘X[? B Õ Ù ° ³ 5 8   ™ œ • ™ C$'(+€¶(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)ÿÿÿ€·(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)þþþþÿþþþþÿþþ€†buffer†source„size„maps„hash /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ d: () => (/* binding */ PlanBadge) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); const tierConfig = { free: { label: 'Free', class: 'bg-gray-100 text-gray-500 border border-gray-200', icon: '' }, pro: { label: 'Pro', class: 'bg-green-100 text-green-700 border border-green-200', icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { viewBox: "0 0 16 16", fill: "none", className: "w-3 h-3 inline-block mr-0.5 -mt-px", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z", fill: "currentColor" }) }) }, ultimate: { label: 'Ultimate', class: 'bg-gradient-to-r from-amber-400 via-yellow-400 to-amber-400 text-gray-900 border border-amber-500 shadow-sm shadow-amber-300/50', icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { viewBox: "0 0 16 16", fill: "none", className: "w-3 h-3 inline-block mr-0.5 -mt-px", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z", fill: "currentColor" }) }) } }; function PlanBadge(param) { let { tier, verified, size = 'sm', className = '' } = param; if (tier === 'free' && !verified) return null; const sizeClass = size === 'sm' ? 'text-[10px] px-1.5 py-0.5' : 'text-xs px-2 py-0.5'; if (verified && tier !== 'free') { return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "inline-flex items-center gap-1 rounded-full font-semibold ".concat(sizeClass, " ").concat(tierConfig[tier].class, " ").concat(className), children: [ tier === 'ultimate' ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(StarIcon, { className: "w-3 h-3 fill-gray-900" }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(VerifiedIcon, { className: "w-3 h-3" }), tierConfig[tier].label ] }); } if (verified) { return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "inline-flex items-center gap-0.5 rounded-full font-semibold ".concat(sizeClass, " bg-green-100 text-green-700 border border-green-200 ").concat(className), children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(VerifiedIcon, { className: "w-3 h-3" }) }); } const cfg = tierConfig[tier]; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "inline-flex items-center rounded-full font-semibold ".concat(sizeClass, " ").concat(cfg.class, " ").concat(className), children: [ tier === 'pro' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(StarIcon, { className: "w-3 h-3 mr-0.5 -mt-px" }), tier === 'ultimate' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(StarIcon, { className: "w-3 h-3 mr-0.5 -mt-px fill-gray-900" }), cfg.label ] }); } function StarIcon(param) { let { className = '' } = param; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { viewBox: "0 0 16 16", fill: "none", className: className, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z", fill: "currentColor" }) }); } function VerifiedIcon(param) { let { className = '' } = param; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { viewBox: "0 0 16 16", fill: "none", className: className, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M8 1l2 1.4 2.4-.4 1 2.2 2 1.2-.4 2.4L16 10l-1.8 1.6.4 2.4-2.2.8L10.8 17 8 16.2 5.2 17l-1.2-2.2-2.2-.8.4-2.4L0 10l1-2.2-.4-2.4 2-1.2 1-2.2 2.4.4L8 1z", fill: "#3B82F6" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M5.5 8.5l1.5 1.5 3-3", stroke: "white", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) ] }); } €”{"finalSource":true}ƒmap‹bufferedMap ConcatSourceRawSourceú/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ d: () => (/* binding */ PlanBadge) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); ReplaceSourceRawSourceimport { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; const tierConfig = { free: { label: 'Free', class: 'bg-gray-100 text-gray-500 border border-gray-200', icon: '' }, pro: { label: 'Pro', class: 'bg-green-100 text-green-700 border border-green-200', icon: /*#__PURE__*/ _jsx("svg", { viewBox: "0 0 16 16", fill: "none", className: "w-3 h-3 inline-block mr-0.5 -mt-px", children: /*#__PURE__*/ _jsx("path", { d: "M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z", fill: "currentColor" }) }) }, ultimate: { label: 'Ultimate', class: 'bg-gradient-to-r from-amber-400 via-yellow-400 to-amber-400 text-gray-900 border border-amber-500 shadow-sm shadow-amber-300/50', icon: /*#__PURE__*/ _jsx("svg", { viewBox: "0 0 16 16", fill: "none", className: "w-3 h-3 inline-block mr-0.5 -mt-px", children: /*#__PURE__*/ _jsx("path", { d: "M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z", fill: "currentColor" }) }) } }; export function PlanBadge(param) { let { tier, verified, size = 'sm', className = '' } = param; if (tier === 'free' && !verified) return null; const sizeClass = size === 'sm' ? 'text-[10px] px-1.5 py-0.5' : 'text-xs px-2 py-0.5'; if (verified && tier !== 'free') { return /*#__PURE__*/ _jsxs("span", { className: "inline-flex items-center gap-1 rounded-full font-semibold ".concat(sizeClass, " ").concat(tierConfig[tier].class, " ").concat(className), children: [ tier === 'ultimate' ? /*#__PURE__*/ _jsx(StarIcon, { className: "w-3 h-3 fill-gray-900" }) : /*#__PURE__*/ _jsx(VerifiedIcon, { className: "w-3 h-3" }), tierConfig[tier].label ] }); } if (verified) { return /*#__PURE__*/ _jsx("span", { className: "inline-flex items-center gap-0.5 rounded-full font-semibold ".concat(sizeClass, " bg-green-100 text-green-700 border border-green-200 ").concat(className), children: /*#__PURE__*/ _jsx(VerifiedIcon, { className: "w-3 h-3" }) }); } const cfg = tierConfig[tier]; return /*#__PURE__*/ _jsxs("span", { className: "inline-flex items-center rounded-full font-semibold ".concat(sizeClass, " ").concat(cfg.class, " ").concat(className), children: [ tier === 'pro' && /*#__PURE__*/ _jsx(StarIcon, { className: "w-3 h-3 mr-0.5 -mt-px" }), tier === 'ultimate' && /*#__PURE__*/ _jsx(StarIcon, { className: "w-3 h-3 mr-0.5 -mt-px fill-gray-900" }), cfg.label ] }); } function StarIcon(param) { let { className = '' } = param; return /*#__PURE__*/ _jsx("svg", { viewBox: "0 0 16 16", fill: "none", className: className, children: /*#__PURE__*/ _jsx("path", { d: "M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z", fill: "currentColor" }) }); } function VerifiedIcon(param) { let { className = '' } = param; return /*#__PURE__*/ _jsxs("svg", { viewBox: "0 0 16 16", fill: "none", className: className, children: [ /*#__PURE__*/ _jsx("path", { d: "M8 1l2 1.4 2.4-.4 1 2.2 2 1.2-.4 2.4L16 10l-1.8 1.6.4 2.4-2.2.8L10.8 17 8 16.2 5.2 17l-1.2-2.2-2.2-.8.4-2.4L0 10l1-2.2-.4-2.4 2-1.2 1-2.2 2.4.4L8 1z", fill: "#3B82F6" }), /*#__PURE__*/ _jsx("path", { d: "M5.5 8.5l1.5 1.5 3-3", stroke: "white", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) ] }); } Ñ062undefined342345(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined513516(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined910913(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined10811084(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined12631269undefined15731577(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined18271830(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined19341937(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined21362139(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined23672370(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined25172521(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined27362739(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined28692872(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined30973100(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined32253228(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined34773481(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined36203623(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined38803883(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined /***/ }) Ú‰/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ d: () => (/* binding */ PlanBadge) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); const tierConfig = { free: { label: 'Free', class: 'bg-gray-100 text-gray-500 border border-gray-200', icon: '' }, pro: { label: 'Pro', class: 'bg-green-100 text-green-700 border border-green-200', icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { viewBox: "0 0 16 16", fill: "none", className: "w-3 h-3 inline-block mr-0.5 -mt-px", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z", fill: "currentColor" }) }) }, ultimate: { label: 'Ultimate', class: 'bg-gradient-to-r from-amber-400 via-yellow-400 to-amber-400 text-gray-900 border border-amber-500 shadow-sm shadow-amber-300/50', icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { viewBox: "0 0 16 16", fill: "none", className: "w-3 h-3 inline-block mr-0.5 -mt-px", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z", fill: "currentColor" }) }) } }; function PlanBadge(param) { let { tier, verified, size = 'sm', className = '' } = param; if (tier === 'free' && !verified) return null; const sizeClass = size === 'sm' ? 'text-[10px] px-1.5 py-0.5' : 'text-xs px-2 py-0.5'; if (verified && tier !== 'free') { return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "inline-flex items-center gap-1 rounded-full font-semibold ".concat(sizeClass, " ").concat(tierConfig[tier].class, " ").concat(className), children: [ tier === 'ultimate' ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(StarIcon, { className: "w-3 h-3 fill-gray-900" }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(VerifiedIcon, { className: "w-3 h-3" }), tierConfig[tier].label ] }); } if (verified) { return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "inline-flex items-center gap-0.5 rounded-full font-semibold ".concat(sizeClass, " bg-green-100 text-green-700 border border-green-200 ").concat(className), children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(VerifiedIcon, { className: "w-3 h-3" }) }); } const cfg = tierConfig[tier]; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "inline-flex items-center rounded-full font-semibold ".concat(sizeClass, " ").concat(cfg.class, " ").concat(className), children: [ tier === 'pro' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(StarIcon, { className: "w-3 h-3 mr-0.5 -mt-px" }), tier === 'ultimate' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(StarIcon, { className: "w-3 h-3 mr-0.5 -mt-px fill-gray-900" }), cfg.label ] }); } function StarIcon(param) { let { className = '' } = param; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { viewBox: "0 0 16 16", fill: "none", className: className, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z", fill: "currentColor" }) }); } function VerifiedIcon(param) { let { className = '' } = param; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { viewBox: "0 0 16 16", fill: "none", className: className, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M8 1l2 1.4 2.4-.4 1 2.2 2 1.2-.4 2.4L16 10l-1.8 1.6.4 2.4-2.2.8L10.8 17 8 16.2 5.2 17l-1.2-2.2-2.2-.8.4-2.4L0 10l1-2.2-.4-2.4 2-1.2 1-2.2 2.4.4L8 1z", fill: "#3B82F6" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M5.5 8.5l1.5 1.5 3-3", stroke: "white", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) ] }); } /***/ }) ÛÞ  ßàßú/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ d: () => (/* binding */ PlanBadge) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); âimport { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; const tierConfig = { free: { label: 'Free', class: 'bg-gray-100 text-gray-500 border border-gray-200', icon: '' }, pro: { label: 'Pro', class: 'bg-green-100 text-green-700 border border-green-200', icon: /*#__PURE__*/ _jsx("svg", { viewBox: "0 0 16 16", fill: "none", className: "w-3 h-3 inline-block mr-0.5 -mt-px", children: /*#__PURE__*/ _jsx("path", { d: "M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z", fill: "currentColor" }) }) }, ultimate: { label: 'Ultimate', class: 'bg-gradient-to-r from-amber-400 via-yellow-400 to-amber-400 text-gray-900 border border-amber-500 shadow-sm shadow-amber-300/50', icon: /*#__PURE__*/ _jsx("svg", { viewBox: "0 0 16 16", fill: "none", className: "w-3 h-3 inline-block mr-0.5 -mt-px", children: /*#__PURE__*/ _jsx("path", { d: "M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z", fill: "currentColor" }) }) } }; export function PlanBadge(param) { let { tier, verified, size = 'sm', className = '' } = param; if (tier === 'free' && !verified) return null; const sizeClass = size === 'sm' ? 'text-[10px] px-1.5 py-0.5' : 'text-xs px-2 py-0.5'; if (verified && tier !== 'free') { return /*#__PURE__*/ _jsxs("span", { className: "inline-flex items-center gap-1 rounded-full font-semibold ".concat(sizeClass, " ").concat(tierConfig[tier].class, " ").concat(className), children: [ tier === 'ultimate' ? /*#__PURE__*/ _jsx(StarIcon, { className: "w-3 h-3 fill-gray-900" }) : /*#__PURE__*/ _jsx(VerifiedIcon, { className: "w-3 h-3" }), tierConfig[tier].label ] }); } if (verified) { return /*#__PURE__*/ _jsx("span", { className: "inline-flex items-center gap-0.5 rounded-full font-semibold ".concat(sizeClass, " bg-green-100 text-green-700 border border-green-200 ").concat(className), children: /*#__PURE__*/ _jsx(VerifiedIcon, { className: "w-3 h-3" }) }); } const cfg = tierConfig[tier]; return /*#__PURE__*/ _jsxs("span", { className: "inline-flex items-center rounded-full font-semibold ".concat(sizeClass, " ").concat(cfg.class, " ").concat(className), children: [ tier === 'pro' && /*#__PURE__*/ _jsx(StarIcon, { className: "w-3 h-3 mr-0.5 -mt-px" }), tier === 'ultimate' && /*#__PURE__*/ _jsx(StarIcon, { className: "w-3 h-3 mr-0.5 -mt-px fill-gray-900" }), cfg.label ] }); } function StarIcon(param) { let { className = '' } = param; return /*#__PURE__*/ _jsx("svg", { viewBox: "0 0 16 16", fill: "none", className: className, children: /*#__PURE__*/ _jsx("path", { d: "M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z", fill: "currentColor" }) }); } function VerifiedIcon(param) { let { className = '' } = param; return /*#__PURE__*/ _jsxs("svg", { viewBox: "0 0 16 16", fill: "none", className: className, children: [ /*#__PURE__*/ _jsx("path", { d: "M8 1l2 1.4 2.4-.4 1 2.2 2 1.2-.4 2.4L16 10l-1.8 1.6.4 2.4-2.2.8L10.8 17 8 16.2 5.2 17l-1.2-2.2-2.2-.8.4-2.4L0 10l1-2.2-.4-2.4 2-1.2 1-2.2 2.4.4L8 1z", fill: "#3B82F6" }), /*#__PURE__*/ _jsx("path", { d: "M5.5 8.5l1.5 1.5 3-3", stroke: "white", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) ] }); } Ñ062undefined342345(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined513516(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined910913(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined10811084(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined12631269undefined15731577(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined18271830(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined19341937(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined21362139(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined23672370(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined25172521(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined27362739(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined28692872(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined30973100(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined32253228(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined34773481(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined36203623(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined38803883(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefinedèé, /***/ 4017:  ¶«webpack/lib/util/registerExternalSerializerœwebpack-sources/ConcatSource€«webpack/lib/util/registerExternalSerializer™webpack-sources/RawSource_/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; «webpack/lib/util/registerExternalSerializerœwebpack-sources/CachedSource <«webpack/lib/util/registerExternalSerializerœwebpack-sources/ConcatSource€«webpack/lib/util/registerExternalSerializer™webpack-sources/RawSource/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ $g: () => (/* binding */ formatPrice), /* harmony export */ GZ: () => (/* binding */ taskDescription), /* harmony export */ Oj: () => (/* binding */ taskTitle) /* harmony export */ }); «webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourceexport function taskTitle(task, locale) { if (locale === 'el' && task.titleEl) return task.titleEl; if (locale === 'en' && task.titleEn) return task.titleEn; if (locale === 'ru' && task.titleRu) return task.titleRu; return task.title; } /** Display a price without decimal cents: 100.00 → 100, 99.5 → 100 */ export function formatPrice(value) { if (value === null || value === undefined || value === '') return ''; return Math.round(Number(value)).toString(); } export function taskDescription(task, locale) { if (locale === 'el' && task.descriptionEl) return task.descriptionEl; if (locale === 'en' && task.descriptionEn) return task.descriptionEn; if (locale === 'ru' && task.descriptionRu) return task.descriptionRu; return task.description; } CDJæì€€€€†buffer†source„size„maps„hash/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ $g: () => (/* binding */ formatPrice), /* harmony export */ GZ: () => (/* binding */ taskDescription), /* harmony export */ Oj: () => (/* binding */ taskTitle) /* harmony export */ }); function taskTitle(task, locale) { if (locale === 'el' && task.titleEl) return task.titleEl; if (locale === 'en' && task.titleEn) return task.titleEn; if (locale === 'ru' && task.titleRu) return task.titleRu; return task.title; } /** Display a price without decimal cents: 100.00 → 100, 99.5 → 100 */ function formatPrice(value) { if (value === null || value === undefined || value === '') return ''; return Math.round(Number(value)).toString(); } function taskDescription(task, locale) { if (locale === 'el' && task.descriptionEl) return task.descriptionEl; if (locale === 'en' && task.descriptionEn) return task.descriptionEn; if (locale === 'ru' && task.descriptionRu) return task.descriptionRu; return task.description; } €”{"finalSource":true}ƒmap‹bufferedMap ConcatSourceRawSource/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ $g: () => (/* binding */ formatPrice), /* harmony export */ GZ: () => (/* binding */ taskDescription), /* harmony export */ Oj: () => (/* binding */ taskTitle) /* harmony export */ }); ReplaceSourceRawSourceexport function taskTitle(task, locale) { if (locale === 'el' && task.titleEl) return task.titleEl; if (locale === 'en' && task.titleEn) return task.titleEn; if (locale === 'ru' && task.titleRu) return task.titleRu; return task.title; } /** Display a price without decimal cents: 100.00 → 100, 99.5 → 100 */ export function formatPrice(value) { if (value === null || value === undefined || value === '') return ''; return Math.round(Number(value)).toString(); } export function taskDescription(task, locale) { if (locale === 'el' && task.descriptionEl) return task.descriptionEl; if (locale === 'en' && task.descriptionEn) return task.descriptionEn; if (locale === 'ru' && task.descriptionRu) return task.descriptionRu; return task.description; } )06undefined324330undefined486492undefined /***/ }) ρ/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ $g: () => (/* binding */ formatPrice), /* harmony export */ GZ: () => (/* binding */ taskDescription), /* harmony export */ Oj: () => (/* binding */ taskTitle) /* harmony export */ }); function taskTitle(task, locale) { if (locale === 'el' && task.titleEl) return task.titleEl; if (locale === 'en' && task.titleEn) return task.titleEn; if (locale === 'ru' && task.titleRu) return task.titleRu; return task.title; } /** Display a price without decimal cents: 100.00 → 100, 99.5 → 100 */ function formatPrice(value) { if (value === null || value === undefined || value === '') return ''; return Math.round(Number(value)).toString(); } function taskDescription(task, locale) { if (locale === 'el' && task.descriptionEl) return task.descriptionEl; if (locale === 'en' && task.descriptionEn) return task.descriptionEn; if (locale === 'ru' && task.descriptionRu) return task.descriptionRu; return task.description; } /***/ }) ÐÓ  ÔÕÔ/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ $g: () => (/* binding */ formatPrice), /* harmony export */ GZ: () => (/* binding */ taskDescription), /* harmony export */ Oj: () => (/* binding */ taskTitle) /* harmony export */ }); ×export function taskTitle(task, locale) { if (locale === 'el' && task.titleEl) return task.titleEl; if (locale === 'en' && task.titleEn) return task.titleEn; if (locale === 'ru' && task.titleRu) return task.titleRu; return task.title; } /** Display a price without decimal cents: 100.00 → 100, 99.5 → 100 */ export function formatPrice(value) { if (value === null || value === undefined || value === '') return ''; return Math.round(Number(value)).toString(); } export function taskDescription(task, locale) { if (locale === 'el' && task.descriptionEl) return task.descriptionEl; if (locale === 'en' && task.descriptionEn) return task.descriptionEn; if (locale === 'ru' && task.descriptionRu) return task.descriptionRu; return task.description; } )06undefined324330undefined486492undefinedÝÞ, /***/ 4658:  \«webpack/lib/util/registerExternalSerializerœwebpack-sources/ConcatSource€«webpack/lib/util/registerExternalSerializer™webpack-sources/RawSourceV/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { «webpack/lib/util/registerExternalSerializerœwebpack-sources/CachedSource W«webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSource«webpack/lib/util/registerExternalSerializer™webpack-sources/RawSourceWimport(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/dashboard/page.tsx"); `TÞPromise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 252))€†buffer†source„size„maps„hash`Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 252)); €”{"finalSource":true}ƒmap‹bufferedMap ReplaceSourceRawSourceWimport(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/dashboard/page.tsx"); j084Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 252))undefined /***/ }) ÄÀ/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 252)); /***/ }) ÅÈ ÉV/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { ÌWimport(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/dashboard/page.tsx"); j084Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 252))undefinedÒÓ }, «webpack/lib/util/registerExternalSerializerœwebpack-sources/PrefixSource‰/******/ 2__webpack_require__ => { // webpackRuntimeModules ívar __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId)) __webpack_require__.O(0, [1516,9664,9906,2982,587,18,7358], () => (__webpack_exec__(4658))); var __webpack_exports__ = __webpack_require__.O(); _N_E = __webpack_exports__; } ]); óþÿÿ(self["webpackChunk_N_E"] = self["webpackChunk_N_E"] || []).push([[5105],{ /***/ 252: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; // ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); // EXPORTS __webpack_require__.d(__webpack_exports__, { "default": () => (/* binding */ DashboardPage) }); // EXTERNAL MODULE: ../../node_modules/next/dist/compiled/react/jsx-runtime.js var jsx_runtime = __webpack_require__(4568); // EXTERNAL MODULE: ../../node_modules/next/dist/compiled/react/index.js var react = __webpack_require__(7620); // EXTERNAL MODULE: ../../node_modules/next/dist/api/navigation.js var navigation = __webpack_require__(7541); // EXTERNAL MODULE: ../../node_modules/next/dist/client/app-dir/link.js var app_dir_link = __webpack_require__(9664); var link_default = /*#__PURE__*/__webpack_require__.n(app_dir_link); // EXTERNAL MODULE: ./src/lib/auth.ts var auth = __webpack_require__(1592); // EXTERNAL MODULE: ./src/context/locale.tsx var context_locale = __webpack_require__(9906); // EXTERNAL MODULE: ./src/lib/api.ts var api = __webpack_require__(2982); // EXTERNAL MODULE: ./src/lib/taskLocale.ts var taskLocale = __webpack_require__(4017); // EXTERNAL MODULE: ./src/components/PlanBadge.tsx var PlanBadge = __webpack_require__(2035); ;// ./src/components/UsageMeter.tsx function UsageMeter(param) { let { current, limit, label, className = '' } = param; if (limit === null) { return /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "".concat(className), children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex justify-between items-center mb-1", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "text-xs text-gray-500", children: label }), /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "text-xs font-semibold text-green-600", children: "∞" }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "h-1.5 rounded-full bg-green-100", children: /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "h-full w-full rounded-full bg-green-400" }) }) ] }); } const pct = limit > 0 ? Math.min(100, Math.round(current / limit * 100)) : 100; const remaining = Math.max(0, limit - current); const barColor = pct >= 100 ? 'bg-red-500' : pct >= 80 ? 'bg-amber-400' : 'bg-green-500'; const textColor = pct >= 100 ? 'text-red-600' : pct >= 80 ? 'text-amber-600' : 'text-gray-600'; return /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: className, children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex justify-between items-center mb-1", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "text-xs text-gray-500", children: label }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("span", { className: "text-xs font-semibold ".concat(textColor), children: [ remaining, " / ", limit ] }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "h-1.5 rounded-full bg-gray-100", children: /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "h-full rounded-full transition-all ".concat(barColor), style: { width: "".concat(pct, "%") } }) }) ] }); } ;// ./src/app/dashboard/page.tsx /* __next_internal_client_entry_do_not_use__ default auto */ /** Extract the quoted task title from a stored notification body (any locale) */ function extractNotifParam(body) { if (!body) return null; const m = body.match(/[«""](.+?)[»""]/); var _m_; return (_m_ = m === null || m === void 0 ? void 0 : m[1]) !== null && _m_ !== void 0 ? _m_ : null; } function PlanBlock(param) { let { dashboard, t } = param; const plan = dashboard.plan; const expiry = dashboard.planExpiration; const usage = dashboard.usage; const stats = dashboard.stats; const expiryPct = expiry ? Math.max(0, Math.min(100, Math.round(expiry.daysLeft / 30 * 100))) : 100; const expiryColor = expiry ? expiry.daysLeft <= 3 ? 'bg-red-500' : expiry.daysLeft <= 7 ? 'bg-amber-400' : 'bg-green-400' : 'bg-green-400'; return /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "bg-white rounded-2xl border border-gray-200 p-5 mb-6", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex items-center justify-between mb-4", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex items-center gap-2", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("h2", { className: "font-semibold text-gray-800 text-sm", children: t('dashboard.plan.title', 'My Plan') }), plan ? /*#__PURE__*/ (0,jsx_runtime.jsx)(PlanBadge/* PlanBadge */.d, { tier: plan.tier, size: "sm" }) : /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "text-xs text-gray-400", children: t('dashboard.plan.no_plan', 'Free') }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)((link_default()), { href: "/pricing", className: "text-xs font-medium text-green-600 hover:underline", children: (plan === null || plan === void 0 ? void 0 : plan.tier) === 'ultimate' ? null : t('dashboard.plan.upgrade', 'Upgrade') }) ] }), expiry && /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "mb-4", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex justify-between text-xs text-gray-500 mb-1", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { children: t('dashboard.plan.expires', 'Expires in {n} days').replace('{n}', String(expiry.daysLeft)) }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("span", { children: [ expiry.daysLeft, " ", t('pricing.days', 'days') ] }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "h-1.5 rounded-full bg-gray-100", children: /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "h-full rounded-full transition-all ".concat(expiryColor), style: { width: "".concat(expiryPct, "%") } }) }) ] }), (usage.messagesSent !== undefined || usage.ordersMade !== undefined) && /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "space-y-2 mb-4", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "text-xs font-medium text-gray-500 uppercase tracking-wide", children: t('dashboard.plan.limits', 'Daily limits') }), /*#__PURE__*/ (0,jsx_runtime.jsx)(UsageMeter, { current: usage.messagesSent, limit: usage.messagesLeft !== null ? usage.messagesSent + usage.messagesLeft : null, label: t('dashboard.plan.messages', 'Messages') }), /*#__PURE__*/ (0,jsx_runtime.jsx)(UsageMeter, { current: usage.ordersMade, limit: usage.ordersLeft !== null ? usage.ordersMade + usage.ordersLeft : null, label: t('dashboard.plan.orders', 'Orders') }) ] }), Object.keys(stats).length > 0 && /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "grid grid-cols-2 gap-2", children: Object.entries(stats).map((param)=>{ let [key, val] = param; return /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "bg-gray-50 rounded-xl px-3 py-2 text-center", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "text-lg font-bold text-gray-800", children: val }), /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "text-[10px] text-gray-400 uppercase tracking-wide", children: t("dashboard.stats.".concat(key), key) }) ] }, key); }) }) ] }); } function DashboardPage() { var _session_user, _fomoData_topCategories; const { data: session, isPending } = (0,auth/* useSession */.wV)(); const router = (0,navigation.useRouter)(); const searchParams = (0,navigation.useSearchParams)(); const { t, locale } = (0,context_locale/* useLocale */.Y)(); const [tasks, setTasks] = (0,react.useState)([]); const [offers, setOffers] = (0,react.useState)([]); const [myReviews, setMyReviews] = (0,react.useState)([]); const [invitations, setInvitations] = (0,react.useState)([]); const [loading, setLoading] = (0,react.useState)(true); const [dashboard, setDashboard] = (0,react.useState)(null); const [fomoData, setFomoData] = (0,react.useState)(null); const [hasHelperCard, setHasHelperCard] = (0,react.useState)(null); (0,react.useEffect)(()=>{ if (!isPending && !session) router.push('/login'); }, [ session, isPending ]); // Apply pending referral code after Google OAuth redirect (?ref=CODE) (0,react.useEffect)(()=>{ if (!session) return; const refCode = searchParams.get('ref'); if (!refCode) return; (0,api/* applyMyReferral */.C0)(refCode).catch(()=>{}); // Remove the ref param from the URL without reloading const params = new URLSearchParams(searchParams.toString()); params.delete('ref'); const newUrl = params.toString() ? "?".concat(params.toString()) : window.location.pathname; router.replace(newUrl); }, [ session ]); // Detect whether the user has completed their helper profile (has a card). // Used to show the getting-started onboarding card to users who haven't yet. (0,react.useEffect)(()=>{ if (!session) return; (0,api/* getMySpecialistCards */.Bb)().then((param)=>{ let { cards } = param; return setHasHelperCard(cards.length > 0); }).catch(()=>setHasHelperCard(null)); }, [ session ]); (0,react.useEffect)(()=>{ if (!session) return; Promise.all([ (0,api/* getMyTasks */.Fu)(), (0,api/* getMyOffers */.aT)(), (0,api/* getMyReviews */.q7)(), (0,api/* getNotifications */.Tr)(), (0,api/* getMyDashboard */.H)() ]).then((param)=>{ let [t, o, r, notifs, dash] = param; setTasks(t); setOffers(o); setMyReviews(r); setInvitations(notifs.filter((n)=>n.type === 'task_invite')); setDashboard(dash); }).catch(()=>{}).finally(()=>setLoading(false)); }, [ session ]); (0,react.useEffect)(()=>{ var _session_user; if (!session) return; const role = (_session_user = session.user) === null || _session_user === void 0 ? void 0 : _session_user.role; if (role === 'specialist') { (0,api/* getSpecialistFomoDashboard */.zk)().then(setFomoData).catch(()=>{}); } else { (0,api/* getCustomerFomoDashboard */.ML)().then(setFomoData).catch(()=>{}); } }, [ session ]); if (isPending || loading) return /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "text-center py-20 text-white", children: t('common.loading') }); const dateLocale = locale === 'ru' ? 'ru-RU' : locale === 'uk' ? 'uk-UA' : locale === 'en' ? 'en-US' : 'el-GR'; const activeTasks = tasks.filter((task)=>task.status !== 'completed' && task.status !== 'cancelled'); const completedTasks = tasks.filter((task)=>task.status === 'completed' || task.status === 'cancelled'); const activeOffers = offers.filter((row)=>{ const offer = row.offer || row; const task = row.task; return offer.status !== 'other_accepted' && (task === null || task === void 0 ? void 0 : task.status) !== 'completed' && (task === null || task === void 0 ? void 0 : task.status) !== 'cancelled'; }); const completedOffers = offers.filter((row)=>{ const offer = row.offer || row; const task = row.task; return offer.status === 'other_accepted' || (task === null || task === void 0 ? void 0 : task.status) === 'completed' || (task === null || task === void 0 ? void 0 : task.status) === 'cancelled'; }); function TaskCard(param) { let { task } = param; var _task_offerCount; const offerCount = (_task_offerCount = task.offerCount) !== null && _task_offerCount !== void 0 ? _task_offerCount : 0; var _task_declinedCount; const declinedCount = (_task_declinedCount = task.declinedCount) !== null && _task_declinedCount !== void 0 ? _task_declinedCount : 0; const activeOfferCount = offerCount - declinedCount; return /*#__PURE__*/ (0,jsx_runtime.jsx)((link_default()), { href: "/tasks/".concat(task.id), className: "block bg-white rounded-xl border border-gray-200 p-4 hover:shadow-sm hover:border-green-300 transition", children: /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex justify-between items-start", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "font-medium text-gray-900 truncate", children: (0,taskLocale/* taskTitle */.Oj)(task, locale) }), /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "text-xs text-gray-400 mt-1", children: new Date(task.createdAt).toLocaleDateString(dateLocale) }), offerCount > 0 && /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex items-center gap-2 mt-1.5", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("span", { className: "text-xs text-green-600 font-medium", children: [ "\uD83D\uDCBC ", offerCount, " ", t('dashboard.offers_count', 'offers') ] }), declinedCount > 0 && /*#__PURE__*/ (0,jsx_runtime.jsxs)("span", { className: "text-xs text-red-400", children: [ "✕ ", declinedCount, " ", t('dashboard.declined_count', 'declined') ] }) ] }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "ml-3 text-right shrink-0", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "text-xs px-2 py-0.5 rounded-full ".concat(task.status === 'open' ? 'bg-green-100 text-green-700' : task.status === 'in_progress' ? 'bg-green-100 text-green-700' : task.status === 'completed' ? 'bg-gray-100 text-gray-600' : 'bg-red-100 text-red-600'), children: t("task.status.".concat(task.status), task.status) }), task.budget && /*#__PURE__*/ (0,jsx_runtime.jsxs)("p", { className: "text-sm font-bold text-green-600 mt-1", children: [ (0,taskLocale/* formatPrice */.$g)(task.budget), "€" ] }) ] }) ] }) }); } function OfferCard(param) { let { row } = param; var _myReviews_find; const offer = row.offer || row; const task = row.task; var _myReviews_find_review; const reviewReceived = (task === null || task === void 0 ? void 0 : task.status) === 'completed' && offer.status === 'accepted' ? (_myReviews_find_review = (_myReviews_find = myReviews.find((r)=>{ var _r_review; return ((_r_review = r.review) === null || _r_review === void 0 ? void 0 : _r_review.taskId) === (task === null || task === void 0 ? void 0 : task.id); })) === null || _myReviews_find === void 0 ? void 0 : _myReviews_find.review) !== null && _myReviews_find_review !== void 0 ? _myReviews_find_review : null : null; return /*#__PURE__*/ (0,jsx_runtime.jsxs)((link_default()), { href: task ? "/tasks/".concat(task.id) : '#', className: "block bg-white rounded-xl border border-gray-200 p-4 hover:shadow-sm hover:border-green-300 transition", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex justify-between items-start", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "font-medium text-gray-900 truncate", children: (task === null || task === void 0 ? void 0 : task.title) || t('chat.task_fallback') }), /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "text-xs text-gray-400 mt-1", children: new Date(offer.createdAt).toLocaleDateString(dateLocale) }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "ml-3 text-right shrink-0", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("p", { className: "font-bold text-green-600", children: [ (0,taskLocale/* formatPrice */.$g)(offer.price), "€" ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "text-xs px-2 py-0.5 rounded-full mt-1 inline-block ".concat(offer.status === 'accepted' ? 'bg-green-100 text-green-700' : offer.status === 'declined' ? 'bg-red-100 text-red-700' : offer.status === 'other_accepted' ? 'bg-green-100 text-green-600' : 'bg-gray-100 text-gray-700'), children: t("offer.status.".concat(offer.status), offer.status) }) ] }) ] }), reviewReceived && /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "mt-3 pt-3 border-t border-gray-100 flex items-center gap-2", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "flex gap-0.5", children: [ 1, 2, 3, 4, 5 ].map((star)=>/*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "text-sm ".concat(star <= reviewReceived.rating ? 'text-yellow-400' : 'text-gray-200'), children: "★" }, star)) }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("span", { className: "text-sm font-semibold text-gray-700", children: [ reviewReceived.rating, "/5" ] }), reviewReceived.comment && /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "text-xs text-gray-500 truncate", children: reviewReceived.comment }) ] }), (task === null || task === void 0 ? void 0 : task.status) === 'completed' && offer.status === 'accepted' && !reviewReceived && /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "mt-2 text-xs text-gray-400", children: t('dashboard.review_pending') }) ] }); } const isSpecialist = (session === null || session === void 0 ? void 0 : (_session_user = session.user) === null || _session_user === void 0 ? void 0 : _session_user.role) === 'specialist'; var _fomoData_missedCount; return /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "max-w-5xl mx-auto px-4 py-8", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex justify-between items-center mb-8", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("h1", { className: "text-2xl font-bold text-white", children: t('dashboard.title') }), /*#__PURE__*/ (0,jsx_runtime.jsx)((link_default()), { href: "/tasks/new", className: "bg-green-600 text-white px-4 py-2 rounded-lg text-sm font-medium hover:bg-green-700", children: t('dashboard.new_task') }) ] }), hasHelperCard === false && /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "mb-6 bg-white rounded-2xl border border-gray-200 overflow-hidden", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "px-5 pt-5 pb-3", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("h2", { className: "text-lg font-bold text-gray-900", children: t('dashboard.onboarding.title') }), /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "text-sm text-gray-500 mt-1", children: t('dashboard.onboarding.subtitle') }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "grid sm:grid-cols-2 gap-3 p-5 pt-2", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)((link_default()), { href: "/specialist-setup", className: "group flex flex-col rounded-xl border-2 border-green-500 bg-green-50 p-4 hover:bg-green-100 transition", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex items-center gap-2 mb-1", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "text-xl", children: "\uD83D\uDEE0" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "font-semibold text-gray-800", children: t('dashboard.onboarding.helper.title') }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "text-sm text-green-700/80 mb-3 flex-1", children: t('dashboard.onboarding.helper.desc') }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("span", { className: "inline-flex items-center gap-1 text-sm font-semibold text-green-700", children: [ t('dashboard.onboarding.helper.cta'), " →" ] }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)((link_default()), { href: "/tasks/new", className: "group flex flex-col rounded-xl border border-gray-200 bg-gray-50 p-4 hover:bg-gray-100 transition", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex items-center gap-2 mb-1", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "text-xl", children: "\uD83D\uDCDD" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "font-semibold text-gray-800", children: t('dashboard.onboarding.requester.title') }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "text-sm text-gray-500 mb-3 flex-1", children: t('dashboard.onboarding.requester.desc') }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("span", { className: "inline-flex items-center gap-1 text-sm font-semibold text-gray-700", children: [ t('dashboard.onboarding.requester.cta'), " →" ] }) ] }) ] }) ] }), dashboard && /*#__PURE__*/ (0,jsx_runtime.jsx)(PlanBlock, { dashboard: dashboard, t: t }), fomoData && (isSpecialist ? (fomoData.missedCount > 0 || fomoData.missedEarnings > 0) && /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "mb-6 bg-amber-50 border border-amber-200 rounded-xl px-5 py-4 flex items-start gap-3", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "shrink-0 mt-0.5", children: /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { className: "w-5 h-5 text-amber-500", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 9v2m0 4h.01M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z" }) }) }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("p", { className: "text-base font-semibold text-amber-800", children: [ t('fomo.specialist_missed', 'You missed {n} tasks').replace('{n}', String((_fomoData_missedCount = fomoData.missedCount) !== null && _fomoData_missedCount !== void 0 ? _fomoData_missedCount : 0)), fomoData.missedEarnings > 0 && /*#__PURE__*/ (0,jsx_runtime.jsxs)("span", { className: "ml-1 text-amber-600", children: [ "for €", fomoData.missedEarnings ] }) ] }), ((_fomoData_topCategories = fomoData.topCategories) === null || _fomoData_topCategories === void 0 ? void 0 : _fomoData_topCategories.length) > 0 && /*#__PURE__*/ (0,jsx_runtime.jsxs)("p", { className: "text-sm text-amber-600 mt-0.5", children: [ t('fomo.top_categories', 'Categories'), ": ", fomoData.topCategories.slice(0, 3).join(', ') ] }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)((link_default()), { href: "/pricing", className: "shrink-0 text-xs font-medium text-amber-700 bg-amber-100 px-3 py-1.5 rounded-lg hover:bg-amber-200 transition", children: t('dashboard.plan.upgrade') }) ] }) : fomoData.totalTasks > 0 && /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "mb-6 bg-green-50 border border-green-200 rounded-xl px-5 py-4", children: /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex items-center justify-between gap-4 flex-wrap", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex items-center gap-3", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "shrink-0 bg-green-100 rounded-xl p-2", children: /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { className: "w-5 h-5 text-green-600", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,jsx_runtime.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" }) }) }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("p", { className: "text-base font-semibold text-gray-800", children: [ fomoData.totalOffers, " ", t('fomo.offers_received', 'offers received') ] }), fomoData.avgOffersPerTask > 0 && /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "text-sm text-gray-500", children: t('fomo.avg_offers', 'Average {n}/task').replace('{n}', Number(fomoData.avgOffersPerTask).toFixed(1)) }) ] }) ] }), fomoData.completionRate !== undefined && /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "text-right", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("p", { className: "text-2xl font-bold text-green-700", children: [ Math.round(fomoData.completionRate * 100), "%" ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "text-sm text-gray-400", children: t('fomo.completion_rate', 'completed') }) ] }) ] }) })), isSpecialist && /*#__PURE__*/ (0,jsx_runtime.jsxs)((link_default()), { href: "/tasks", className: "flex items-center justify-between gap-4 bg-green-600 text-white rounded-xl px-5 py-4 mb-8 hover:bg-green-700 transition", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex items-center gap-4", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "shrink-0 bg-white/20 rounded-xl p-2.5", children: /*#__PURE__*/ (0,jsx_runtime.jsxs)("svg", { className: "w-6 h-6 text-white", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("circle", { cx: "11", cy: "11", r: "7" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M21 21l-4.35-4.35" }) ] }) }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "font-semibold text-base", children: t('find_tasks.title') }), /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "text-green-100 text-sm mt-0.5", children: t('find_tasks.banner_hint') }) ] }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { className: "w-5 h-5 shrink-0 text-white/70", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 5l7 7-7 7" }) }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "grid md:grid-cols-2 gap-8", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "space-y-8", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("h2", { className: "text-lg font-semibold text-white mb-4", children: [ t('dashboard.my_tasks'), " ", /*#__PURE__*/ (0,jsx_runtime.jsxs)("span", { className: "text-white/60 font-normal text-base", children: [ "(", activeTasks.length, ")" ] }) ] }), activeTasks.length === 0 ? /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-6 text-center text-gray-500", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { children: t('dashboard.tasks.empty') }), /*#__PURE__*/ (0,jsx_runtime.jsx)((link_default()), { href: "/tasks/new", className: "text-green-600 hover:underline text-sm mt-2 inline-block", children: t('dashboard.tasks.empty.cta') }) ] }) : /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "space-y-3", children: activeTasks.map((task)=>/*#__PURE__*/ (0,jsx_runtime.jsx)(TaskCard, { task: task }, task.id)) }) ] }), completedTasks.length > 0 && /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("h2", { className: "text-lg font-semibold text-white/70 mb-4", children: [ t('dashboard.completed_tasks'), " ", /*#__PURE__*/ (0,jsx_runtime.jsxs)("span", { className: "font-normal text-base text-white/50", children: [ "(", completedTasks.length, ")" ] }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "space-y-3 opacity-75", children: completedTasks.map((task)=>/*#__PURE__*/ (0,jsx_runtime.jsx)(TaskCard, { task: task }, task.id)) }) ] }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "space-y-8", children: isSpecialist ? /*#__PURE__*/ (0,jsx_runtime.jsxs)(jsx_runtime.Fragment, { children: [ invitations.length > 0 && /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("h2", { className: "text-lg font-semibold text-white mb-4", children: [ t('dashboard.invitations'), " ", /*#__PURE__*/ (0,jsx_runtime.jsxs)("span", { className: "text-white/60 font-normal text-base", children: [ "(", invitations.length, ")" ] }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "space-y-3", children: invitations.map((inv)=>/*#__PURE__*/ (0,jsx_runtime.jsxs)((link_default()), { href: inv.referenceId ? "/tasks/".concat(inv.referenceId) : '/tasks', className: "flex items-start gap-3 p-4 rounded-xl border transition cursor-pointer ".concat(inv.isRead ? 'bg-white/90 border-white/20 hover:bg-white' : 'bg-white border-amber-300 shadow-sm hover:bg-amber-50'), children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "text-2xl", children: "\uD83D\uDCCB" }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "font-medium truncate ".concat(inv.isRead ? 'text-gray-600' : 'text-gray-900'), children: t('notif.type.task_invite', inv.title) }), inv.body && /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "text-sm text-gray-500 mt-0.5 truncate", children: (()=>{ const title = extractNotifParam(inv.body); const tpl = t('notif.body.task_invite', ''); return title && tpl ? tpl.replace('{title}', title) : inv.body; })() }), /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "text-xs text-gray-400 mt-1", children: new Date(inv.createdAt).toLocaleDateString(dateLocale) }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex flex-col items-end gap-1.5 shrink-0", children: [ !inv.isRead && /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "w-2 h-2 bg-amber-400 rounded-full mt-2" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "text-xs text-gray-400", children: "→" }) ] }) ] }, inv.id)) }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("h2", { className: "text-lg font-semibold text-white mb-4", children: [ t('dashboard.my_offers'), " ", /*#__PURE__*/ (0,jsx_runtime.jsxs)("span", { className: "text-white/60 font-normal text-base", children: [ "(", activeOffers.length, ")" ] }) ] }), activeOffers.length === 0 ? /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-6 text-center text-gray-500", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { children: t('dashboard.offers.empty') }), /*#__PURE__*/ (0,jsx_runtime.jsx)((link_default()), { href: "/tasks", className: "text-green-600 hover:underline text-sm mt-2 inline-block", children: t('dashboard.offers.empty.cta') }) ] }) : /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "space-y-3", children: activeOffers.map((row)=>/*#__PURE__*/ (0,jsx_runtime.jsx)(OfferCard, { row: row }, (row.offer || row).id)) }) ] }), completedOffers.length > 0 && /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("h2", { className: "text-lg font-semibold text-white/70 mb-4", children: [ t('dashboard.completed_offers'), " ", /*#__PURE__*/ (0,jsx_runtime.jsxs)("span", { className: "font-normal text-base text-white/50", children: [ "(", completedOffers.length, ")" ] }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "space-y-3 opacity-75", children: completedOffers.map((row)=>/*#__PURE__*/ (0,jsx_runtime.jsx)(OfferCard, { row: row }, (row.offer || row).id)) }) ] }) ] }) : /*#__PURE__*/ (0,jsx_runtime.jsxs)(jsx_runtime.Fragment, { children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)((link_default()), { href: "/specialists", className: "flex items-center justify-between gap-4 bg-green-600 text-white rounded-xl px-5 py-4 hover:bg-green-700 transition", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex items-center gap-4", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "shrink-0 bg-white/20 rounded-xl p-2.5", children: /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { className: "w-6 h-6 text-white", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,jsx_runtime.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" }) }) }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "font-semibold text-base", children: t('dashboard.customer.specialists_title') }), /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "text-green-100 text-sm mt-0.5", children: t('dashboard.customer.specialists_hint') }) ] }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { className: "w-5 h-5 shrink-0 text-white/70", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 5l7 7-7 7" }) }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-5", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("h2", { className: "text-base font-semibold text-gray-800 mb-4", children: t('dashboard.customer.how_title') }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "space-y-3", children: [ { num: '1', text: t('dashboard.customer.step1'), icon: 'M12 4v16m8-8H4' }, { num: '2', text: t('dashboard.customer.step2'), icon: 'M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z' }, { num: '3', text: t('dashboard.customer.step3'), icon: 'M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z' } ].map((param)=>{ let { num, text, icon } = param; return /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex items-start gap-3", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "shrink-0 w-7 h-7 rounded-full bg-green-100 text-green-600 text-sm font-bold flex items-center justify-center", children: num }), /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "text-sm text-gray-600 pt-1", children: text }) ] }, num); }) }), /*#__PURE__*/ (0,jsx_runtime.jsxs)((link_default()), { href: "/tasks/new", className: "mt-4 inline-block text-sm font-medium text-green-600 hover:underline", children: [ tasks.length > 0 ? t('dashboard.tasks.add_new') : t('dashboard.tasks.empty.cta'), " →" ] }) ] }) ] }) }) ] }) ] }); } /***/ }), /***/ 1592: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ CI: () => (/* binding */ signOut), /* harmony export */ Hh: () => (/* binding */ signUp), /* harmony export */ Jv: () => (/* binding */ signIn), /* harmony export */ wV: () => (/* binding */ useSession), /* harmony export */ yK: () => (/* binding */ authClient) /* harmony export */ }); /* harmony import */ var better_auth_react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6504); const API_URL = "https://api.canhelp.gr" || 0; const authClient = (0,better_auth_react__WEBPACK_IMPORTED_MODULE_0__/* .createAuthClient */ .M)({ baseURL: API_URL }); const { signIn, signOut, signUp, useSession } = authClient; /***/ }), /***/ 2035: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ d: () => (/* binding */ PlanBadge) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); const tierConfig = { free: { label: 'Free', class: 'bg-gray-100 text-gray-500 border border-gray-200', icon: '' }, pro: { label: 'Pro', class: 'bg-green-100 text-green-700 border border-green-200', icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { viewBox: "0 0 16 16", fill: "none", className: "w-3 h-3 inline-block mr-0.5 -mt-px", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z", fill: "currentColor" }) }) }, ultimate: { label: 'Ultimate', class: 'bg-gradient-to-r from-amber-400 via-yellow-400 to-amber-400 text-gray-900 border border-amber-500 shadow-sm shadow-amber-300/50', icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { viewBox: "0 0 16 16", fill: "none", className: "w-3 h-3 inline-block mr-0.5 -mt-px", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z", fill: "currentColor" }) }) } }; function PlanBadge(param) { let { tier, verified, size = 'sm', className = '' } = param; if (tier === 'free' && !verified) return null; const sizeClass = size === 'sm' ? 'text-[10px] px-1.5 py-0.5' : 'text-xs px-2 py-0.5'; if (verified && tier !== 'free') { return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "inline-flex items-center gap-1 rounded-full font-semibold ".concat(sizeClass, " ").concat(tierConfig[tier].class, " ").concat(className), children: [ tier === 'ultimate' ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(StarIcon, { className: "w-3 h-3 fill-gray-900" }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(VerifiedIcon, { className: "w-3 h-3" }), tierConfig[tier].label ] }); } if (verified) { return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "inline-flex items-center gap-0.5 rounded-full font-semibold ".concat(sizeClass, " bg-green-100 text-green-700 border border-green-200 ").concat(className), children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(VerifiedIcon, { className: "w-3 h-3" }) }); } const cfg = tierConfig[tier]; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "inline-flex items-center rounded-full font-semibold ".concat(sizeClass, " ").concat(cfg.class, " ").concat(className), children: [ tier === 'pro' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(StarIcon, { className: "w-3 h-3 mr-0.5 -mt-px" }), tier === 'ultimate' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(StarIcon, { className: "w-3 h-3 mr-0.5 -mt-px fill-gray-900" }), cfg.label ] }); } function StarIcon(param) { let { className = '' } = param; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { viewBox: "0 0 16 16", fill: "none", className: className, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z", fill: "currentColor" }) }); } function VerifiedIcon(param) { let { className = '' } = param; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { viewBox: "0 0 16 16", fill: "none", className: className, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M8 1l2 1.4 2.4-.4 1 2.2 2 1.2-.4 2.4L16 10l-1.8 1.6.4 2.4-2.2.8L10.8 17 8 16.2 5.2 17l-1.2-2.2-2.2-.8.4-2.4L0 10l1-2.2-.4-2.4 2-1.2 1-2.2 2.4.4L8 1z", fill: "#3B82F6" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M5.5 8.5l1.5 1.5 3-3", stroke: "white", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) ] }); } /***/ }), /***/ 4017: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ $g: () => (/* binding */ formatPrice), /* harmony export */ GZ: () => (/* binding */ taskDescription), /* harmony export */ Oj: () => (/* binding */ taskTitle) /* harmony export */ }); function taskTitle(task, locale) { if (locale === 'el' && task.titleEl) return task.titleEl; if (locale === 'en' && task.titleEn) return task.titleEn; if (locale === 'ru' && task.titleRu) return task.titleRu; return task.title; } /** Display a price without decimal cents: 100.00 → 100, 99.5 → 100 */ function formatPrice(value) { if (value === null || value === undefined || value === '') return ''; return Math.round(Number(value)).toString(); } function taskDescription(task, locale) { if (locale === 'el' && task.descriptionEl) return task.descriptionEl; if (locale === 'en' && task.descriptionEn) return task.descriptionEn; if (locale === 'ru' && task.descriptionRu) return task.descriptionRu; return task.description; } /***/ }), /***/ 4658: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 252)); /***/ }) }, /******/ __webpack_require__ => { // webpackRuntimeModules /******/ var __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId)) /******/ __webpack_require__.O(0, [1516,9664,9906,2982,587,18,7358], () => (__webpack_exec__(4658))); /******/ var __webpack_exports__ = __webpack_require__.O(); /******/ _N_E = __webpack_exports__; /******/ } ]); —÷þÿÿ `GøþÿÿW(self["webpackChunk_N_E"] = self["webpackChunk_N_E"] || []).push([[5105],{ /***/ 252: ÷þÿÿ˜÷þÿÿbÿÿÿcÿÿÿùþÿÿdÿÿÿeÿÿÿfÿÿÿgÿÿÿcÿÿÿùþÿÿŸÿÿhÿÿÿiÿÿÿœœ¢÷þÿÿ˜÷þÿÿ£ùþÿÿ€¥œœ, /***/ 2035: öþÿÿ—öþÿÿú/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ d: () => (/* binding */ PlanBadge) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); ÷þÿÿimport { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; const tierConfig = { free: { label: 'Free', class: 'bg-gray-100 text-gray-500 border border-gray-200', icon: '' }, pro: { label: 'Pro', class: 'bg-green-100 text-green-700 border border-green-200', icon: /*#__PURE__*/ _jsx("svg", { viewBox: "0 0 16 16", fill: "none", className: "w-3 h-3 inline-block mr-0.5 -mt-px", children: /*#__PURE__*/ _jsx("path", { d: "M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z", fill: "currentColor" }) }) }, ultimate: { label: 'Ultimate', class: 'bg-gradient-to-r from-amber-400 via-yellow-400 to-amber-400 text-gray-900 border border-amber-500 shadow-sm shadow-amber-300/50', icon: /*#__PURE__*/ _jsx("svg", { viewBox: "0 0 16 16", fill: "none", className: "w-3 h-3 inline-block mr-0.5 -mt-px", children: /*#__PURE__*/ _jsx("path", { d: "M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z", fill: "currentColor" }) }) } }; export function PlanBadge(param) { let { tier, verified, size = 'sm', className = '' } = param; if (tier === 'free' && !verified) return null; const sizeClass = size === 'sm' ? 'text-[10px] px-1.5 py-0.5' : 'text-xs px-2 py-0.5'; if (verified && tier !== 'free') { return /*#__PURE__*/ _jsxs("span", { className: "inline-flex items-center gap-1 rounded-full font-semibold ".concat(sizeClass, " ").concat(tierConfig[tier].class, " ").concat(className), children: [ tier === 'ultimate' ? /*#__PURE__*/ _jsx(StarIcon, { className: "w-3 h-3 fill-gray-900" }) : /*#__PURE__*/ _jsx(VerifiedIcon, { className: "w-3 h-3" }), tierConfig[tier].label ] }); } if (verified) { return /*#__PURE__*/ _jsx("span", { className: "inline-flex items-center gap-0.5 rounded-full font-semibold ".concat(sizeClass, " bg-green-100 text-green-700 border border-green-200 ").concat(className), children: /*#__PURE__*/ _jsx(VerifiedIcon, { className: "w-3 h-3" }) }); } const cfg = tierConfig[tier]; return /*#__PURE__*/ _jsxs("span", { className: "inline-flex items-center rounded-full font-semibold ".concat(sizeClass, " ").concat(cfg.class, " ").concat(className), children: [ tier === 'pro' && /*#__PURE__*/ _jsx(StarIcon, { className: "w-3 h-3 mr-0.5 -mt-px" }), tier === 'ultimate' && /*#__PURE__*/ _jsx(StarIcon, { className: "w-3 h-3 mr-0.5 -mt-px fill-gray-900" }), cfg.label ] }); } function StarIcon(param) { let { className = '' } = param; return /*#__PURE__*/ _jsx("svg", { viewBox: "0 0 16 16", fill: "none", className: className, children: /*#__PURE__*/ _jsx("path", { d: "M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z", fill: "currentColor" }) }); } function VerifiedIcon(param) { let { className = '' } = param; return /*#__PURE__*/ _jsxs("svg", { viewBox: "0 0 16 16", fill: "none", className: className, children: [ /*#__PURE__*/ _jsx("path", { d: "M8 1l2 1.4 2.4-.4 1 2.2 2 1.2-.4 2.4L16 10l-1.8 1.6.4 2.4-2.2.8L10.8 17 8 16.2 5.2 17l-1.2-2.2-2.2-.8.4-2.4L0 10l1-2.2-.4-2.4 2-1.2 1-2.2 2.4.4L8 1z", fill: "#3B82F6" }), /*#__PURE__*/ _jsx("path", { d: "M5.5 8.5l1.5 1.5 3-3", stroke: "white", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) ] }); } Ñ062undefined342345(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined513516(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined910913(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined10811084(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined12631269undefined15731577(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined18271830(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined19341937(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined21362139(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined23672370(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined25172521(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined27362739(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined28692872(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined30973100(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined32253228(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined34773481(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined36203623(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined38803883(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined˜™˜, /***/ 4017: òþÿÿ“òþÿÿ/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ $g: () => (/* binding */ formatPrice), /* harmony export */ GZ: () => (/* binding */ taskDescription), /* harmony export */ Oj: () => (/* binding */ taskTitle) /* harmony export */ }); óþÿÿexport function taskTitle(task, locale) { if (locale === 'el' && task.titleEl) return task.titleEl; if (locale === 'en' && task.titleEn) return task.titleEn; if (locale === 'ru' && task.titleRu) return task.titleRu; return task.title; } /** Display a price without decimal cents: 100.00 → 100, 99.5 → 100 */ export function formatPrice(value) { if (value === null || value === undefined || value === '') return ''; return Math.round(Number(value)).toString(); } export function taskDescription(task, locale) { if (locale === 'el' && task.descriptionEl) return task.descriptionEl; if (locale === 'en' && task.descriptionEn) return task.descriptionEn; if (locale === 'ru' && task.descriptionRu) return task.descriptionRu; return task.description; } )06undefined324330undefined486492undefined”•”, /***/ 4658: îþÿÿžðþÿÿWimport(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/dashboard/page.tsx"); j084Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 252))undefined‘’‘ÚìÜ‘ívar __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId)) __webpack_require__.O(0, [1516,9664,9906,2982,587,18,7358], () => (__webpack_exec__(4658))); var __webpack_exports__ = __webpack_require__.O(); ÝÞß \ò«webpack/lib/util/registerExternalSerializerœwebpack-sources/ConcatSource€ «webpack/lib/util/registerExternalSerializer™webpack-sources/RawSourceX(self["webpackChunk_N_E"] = self["webpackChunk_N_E"] || []).push([[6173],{ /***/ 1592: «webpack/lib/util/registerExternalSerializerœwebpack-sources/CachedSource ú «webpack/lib/util/registerExternalSerializerœwebpack-sources/ConcatSource€«webpack/lib/util/registerExternalSerializer™webpack-sources/RawSource_/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; «webpack/lib/util/registerExternalSerializerœwebpack-sources/CachedSource w«webpack/lib/util/registerExternalSerializerœwebpack-sources/ConcatSource€«webpack/lib/util/registerExternalSerializer™webpack-sources/RawSourceå/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ CI: () => (/* binding */ signOut), /* harmony export */ Hh: () => (/* binding */ signUp), /* harmony export */ Jv: () => (/* binding */ signIn), /* harmony export */ wV: () => (/* binding */ useSession), /* harmony export */ yK: () => (/* binding */ authClient) /* harmony export */ }); /* harmony import */ var better_auth_react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6504); «webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSource import { createAuthClient } from 'better-auth/react'; const API_URL = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; export const authClient = createAuthClient({ baseURL: API_URL }); export const { signIn, signOut, signUp, useSession } = authClient; d4FdiE‚ˆœ«È΀˜"https://api.canhelp.gr"0€Ì(0,better_auth_react__WEBPACK_IMPORTED_MODULE_0__/* .createAuthClient */ .M)€€†buffer†source„size„maps„hashÌ/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ CI: () => (/* binding */ signOut), /* harmony export */ Hh: () => (/* binding */ signUp), /* harmony export */ Jv: () => (/* binding */ signIn), /* harmony export */ wV: () => (/* binding */ useSession), /* harmony export */ yK: () => (/* binding */ authClient) /* harmony export */ }); /* harmony import */ var better_auth_react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6504); const API_URL = "https://api.canhelp.gr" || 0; const authClient = (0,better_auth_react__WEBPACK_IMPORTED_MODULE_0__/* .createAuthClient */ .M)({ baseURL: API_URL }); const { signIn, signOut, signUp, useSession } = authClient; €”{"finalSource":true}ƒmap‹bufferedMap ConcatSourceRawSourceå/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ CI: () => (/* binding */ signOut), /* harmony export */ Hh: () => (/* binding */ signUp), /* harmony export */ Jv: () => (/* binding */ signIn), /* harmony export */ wV: () => (/* binding */ useSession), /* harmony export */ yK: () => (/* binding */ authClient) /* harmony export */ }); /* harmony import */ var better_auth_react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6504); ReplaceSourceRawSource import { createAuthClient } from 'better-auth/react'; const API_URL = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; export const authClient = createAuthClient({ baseURL: API_URL }); export const { signIn, signOut, signUp, useSession } = authClient; »052undefined70100"https://api.canhelp.gr"undefined1051270undefined130136undefined156171(0,better_auth_react__WEBPACK_IMPORTED_MODULE_0__/* .createAuthClient */ .M)undefined200206undefined /***/ }) €†buffer†source„size„maps„hash5/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ CI: () => (/* binding */ signOut), /* harmony export */ Hh: () => (/* binding */ signUp), /* harmony export */ Jv: () => (/* binding */ signIn), /* harmony export */ wV: () => (/* binding */ useSession), /* harmony export */ yK: () => (/* binding */ authClient) /* harmony export */ }); /* harmony import */ var better_auth_react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6504); const API_URL = "https://api.canhelp.gr" || 0; const authClient = (0,better_auth_react__WEBPACK_IMPORTED_MODULE_0__/* .createAuthClient */ .M)({ baseURL: API_URL }); const { signIn, signOut, signUp, useSession } = authClient; /***/ }) €”{"finalSource":true}ƒmap‹bufferedMap  ConcatSourceRawSource_/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; þå/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ CI: () => (/* binding */ signOut), /* harmony export */ Hh: () => (/* binding */ signUp), /* harmony export */ Jv: () => (/* binding */ signIn), /* harmony export */ wV: () => (/* binding */ useSession), /* harmony export */ yK: () => (/* binding */ authClient) /* harmony export */ }); /* harmony import */ var better_auth_react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6504); ReplaceSourceRawSource import { createAuthClient } from 'better-auth/react'; const API_URL = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; export const authClient = createAuthClient({ baseURL: API_URL }); export const { signIn, signOut, signUp, useSession } = authClient; »052undefined70100"https://api.canhelp.gr"undefined1051270undefined130136undefined156171(0,better_auth_react__WEBPACK_IMPORTED_MODULE_0__/* .createAuthClient */ .M)undefined200206undefined RawSource /***/ }), /***/ 3854:  g«webpack/lib/util/registerExternalSerializerœwebpack-sources/ConcatSource€«webpack/lib/util/registerExternalSerializer™webpack-sources/RawSourceV/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { «webpack/lib/util/registerExternalSerializerœwebpack-sources/CachedSource \«webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSource«webpack/lib/util/registerExternalSerializer™webpack-sources/RawSource[import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/notifications/page.tsx"); `XßPromise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 8666))€†buffer†source„size„maps„hashaPromise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 8666)); €”{"finalSource":true}ƒmap‹bufferedMap ReplaceSourceRawSource[import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/notifications/page.tsx"); k088Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 8666))undefined /***/ }) ëÁ/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 8666)); /***/ }) ìï ðV/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { ò[import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/notifications/page.tsx"); k088Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 8666))undefinedóô, /***/ 8666:  «webpack/lib/util/registerExternalSerializerœwebpack-sources/ConcatSource€«webpack/lib/util/registerExternalSerializer™webpack-sources/RawSource_/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; «webpack/lib/util/registerExternalSerializerœwebpack-sources/CachedSource W«webpack/lib/util/registerExternalSerializerœwebpack-sources/ConcatSource€«webpack/lib/util/registerExternalSerializer™webpack-sources/RawSource__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ NotificationsPage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7541); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(1592); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(9906); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(2982); «webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourceÂM/* __next_internal_client_entry_do_not_use__ default auto */ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { useEffect, useState } from 'react'; import { useRouter } from 'next/navigation'; import { useSession } from '@/lib/auth'; import { useLocale } from '@/context/locale'; import { getNotifications, markAllRead, markRead, dismissNotification } from '@/lib/api'; function NotifIcon(param) { let { type } = param; const cls = 'w-5 h-5'; switch(type){ case 'new_offer': return /*#__PURE__*/ _jsxs("svg", { className: cls, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", children: [ /*#__PURE__*/ _jsx("rect", { x: "2", y: "7", width: "20", height: "14", rx: "2" }), /*#__PURE__*/ _jsx("path", { d: "M16 21V5a2 2 0 00-2-2h-4a2 2 0 00-2 2v16" }) ] }); case 'offer_accepted': return /*#__PURE__*/ _jsxs("svg", { className: cls, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", children: [ /*#__PURE__*/ _jsx("circle", { cx: "12", cy: "12", r: "10" }), /*#__PURE__*/ _jsx("polyline", { points: "9 12 11 14 15 10" }) ] }); case 'offer_declined': return /*#__PURE__*/ _jsxs("svg", { className: cls, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", children: [ /*#__PURE__*/ _jsx("circle", { cx: "12", cy: "12", r: "10" }), /*#__PURE__*/ _jsx("line", { x1: "15", y1: "9", x2: "9", y2: "15" }), /*#__PURE__*/ _jsx("line", { x1: "9", y1: "9", x2: "15", y2: "15" }) ] }); case 'task_completed': return /*#__PURE__*/ _jsx("svg", { className: cls, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", children: /*#__PURE__*/ _jsx("polyline", { points: "20 6 9 17 4 12" }) }); case 'task_cancelled': return /*#__PURE__*/ _jsxs("svg", { className: cls, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", children: [ /*#__PURE__*/ _jsx("path", { d: "M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z" }), /*#__PURE__*/ _jsx("line", { x1: "12", y1: "9", x2: "12", y2: "13" }), /*#__PURE__*/ _jsx("line", { x1: "12", y1: "17", x2: "12.01", y2: "17" }) ] }); case 'new_message': return /*#__PURE__*/ _jsx("svg", { className: cls, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", children: /*#__PURE__*/ _jsx("path", { d: "M21 15a2 2 0 01-2 2H7l-4 4V5a2 2 0 012-2h14a2 2 0 012 2z" }) }); case 'new_review': return /*#__PURE__*/ _jsx("svg", { className: cls, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", children: /*#__PURE__*/ _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" }) }); case 'task_invite': return /*#__PURE__*/ _jsxs("svg", { className: cls, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", children: [ /*#__PURE__*/ _jsx("path", { d: "M16 4h2a2 2 0 012 2v14a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2h2" }), /*#__PURE__*/ _jsx("rect", { x: "8", y: "2", width: "8", height: "4", rx: "1", ry: "1" }) ] }); default: return /*#__PURE__*/ _jsxs("svg", { className: cls, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", children: [ /*#__PURE__*/ _jsx("path", { d: "M18 8A6 6 0 006 8c0 7-3 9-3 9h18s-3-2-3-9" }), /*#__PURE__*/ _jsx("path", { d: "M13.73 21a2 2 0 01-3.46 0" }) ] }); } } const typeColor = { new_offer: 'bg-green-100 text-green-600', offer_accepted: 'bg-green-100 text-green-600', offer_declined: 'bg-red-100 text-red-600', task_completed: 'bg-emerald-100 text-emerald-600', task_cancelled: 'bg-amber-100 text-amber-600', new_message: 'bg-purple-100 text-purple-600', new_review: 'bg-yellow-100 text-yellow-600', task_invite: 'bg-indigo-100 text-indigo-600', referral_reward: 'bg-cyan-100 text-cyan-700', specialist_card_submitted: 'bg-amber-100 text-amber-700', specialist_card_approved: 'bg-green-100 text-green-700', specialist_card_rejected: 'bg-rose-100 text-rose-700' }; /** Extract the quoted task title from a stored body string (any locale) */ function extractParam(body) { if (!body) return null; const m = body.match(/[«""](.+?)[»""]/); var _m_; return (_m_ = m === null || m === void 0 ? void 0 : m[1]) !== null && _m_ !== void 0 ? _m_ : null; } /** Extract rating number from a stored review body */ function extractRating(body) { if (!body) return null; const m = body.match(/(\d+)\s*[★\*]/); var _m_; return (_m_ = m === null || m === void 0 ? void 0 : m[1]) !== null && _m_ !== void 0 ? _m_ : null; } /** Extract first integer from text (for referral days, etc.) */ function extractNumber(body) { if (!body) return null; const m = body.match(/(\d+)/); var _m_; return (_m_ = m === null || m === void 0 ? void 0 : m[1]) !== null && _m_ !== void 0 ? _m_ : null; } export default function NotificationsPage() { const { data: session, isPending } = useSession(); const router = useRouter(); const { t, locale } = useLocale(); const [notifications, setNotifications] = useState([]); const [loading, setLoading] = useState(true); useEffect(()=>{ if (!isPending && !session) router.push('/login'); }, [ session, isPending ]); useEffect(()=>{ if (!session) return; getNotifications().then(setNotifications).catch(()=>{}).finally(()=>setLoading(false)); }, [ session ]); async function handleMarkAll() { await markAllRead(); setNotifications((prev)=>prev.map((n)=>({ ...n, isRead: true }))); } async function handleMark(id) { await markRead(id); setNotifications((prev)=>prev.map((n)=>n.id === id ? { ...n, isRead: true } : n)); } async function handleDismiss(e, id) { e.stopPropagation(); await dismissNotification(id).catch(()=>{}); setNotifications((prev)=>prev.filter((n)=>n.id !== id)); } if (isPending || loading) return /*#__PURE__*/ _jsx("div", { className: "text-center py-20 text-white", children: t('common.loading') }); function relativeTime(dateStr) { const diff = Date.now() - new Date(dateStr).getTime(); const sec = Math.floor(diff / 1000); const min = Math.floor(sec / 60); const hrs = Math.floor(min / 60); const days = Math.floor(hrs / 24); if (locale === 'ru') { if (sec < 60) return 'тПлькП чтП'; if (min < 60) return "".concat(min, " ЌОМ. МазаЎ"); if (hrs < 24) return "".concat(hrs, " ч. МазаЎ"); if (days === 1) return 'вчера'; if (days < 7) return "".concat(days, " ЎМ. МазаЎ"); } else if (locale === 'uk') { if (sec < 60) return 'щПйМП'; if (min < 60) return "".concat(min, " хв. тПЌу"); if (hrs < 24) return "".concat(hrs, " гПЎ. тПЌу"); if (days === 1) return 'вчПра'; if (days < 7) return "".concat(days, " ЎМ. тПЌу"); } else if (locale === 'en') { if (sec < 60) return 'just now'; if (min < 60) return "".concat(min, "m ago"); if (hrs < 24) return "".concat(hrs, "h ago"); if (days === 1) return 'yesterday'; if (days < 7) return "".concat(days, "d ago"); } else { if (sec < 60) return 'Όόλις τώρα'; if (min < 60) return "".concat(min, " λ. πριΜ"); if (hrs < 24) return "".concat(hrs, " ω. πριΜ"); if (days === 1) return 'χΞες'; if (days < 7) return "".concat(days, " ÎŒ. πριΜ"); } return new Date(dateStr).toLocaleDateString(dateLocale, { day: 'numeric', month: 'short', year: days > 365 ? 'numeric' : undefined }); } const unreadCount = notifications.filter((n)=>!n.isRead).length; const dateLocale = locale === 'ru' ? 'ru-RU' : locale === 'uk' ? 'uk-UA' : locale === 'en' ? 'en-US' : 'el-GR'; return /*#__PURE__*/ _jsxs("div", { className: "max-w-2xl mx-auto px-4 py-8", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex justify-between items-center mb-6", children: [ /*#__PURE__*/ _jsxs("h1", { className: "text-2xl font-bold text-white", children: [ t('notif.title'), " ", unreadCount > 0 && /*#__PURE__*/ _jsxs("span", { className: "text-white/70 font-normal text-xl", children: [ "(", unreadCount, ")" ] }) ] }), unreadCount > 0 && /*#__PURE__*/ _jsx("button", { onClick: handleMarkAll, className: "text-sm text-white/80 hover:text-white hover:underline transition", children: t('notif.mark_all') }) ] }), notifications.length === 0 ? /*#__PURE__*/ _jsx("div", { className: "text-center py-20 text-white/60", children: t('notif.empty') }) : /*#__PURE__*/ _jsx("div", { className: "space-y-2", children: notifications.map((n)=>{ const link = n.type === 'referral_reward' ? '/profile?tab=referral' : n.referenceId ? n.type === 'new_message' ? "/chat?room=".concat(n.referenceId) : "/tasks/".concat(n.referenceId) : null; const handleClick = async ()=>{ if (!n.isRead) await handleMark(n.id); if (link) router.push(link); }; var _typeColor_n_type; return /*#__PURE__*/ _jsxs("div", { onClick: handleClick, className: "flex items-start gap-3 p-4 rounded-xl border transition ".concat(link ? 'cursor-pointer' : 'cursor-default', " ").concat(n.isRead ? 'bg-white/90 border-white/20 hover:bg-white' : 'bg-white border-green-300 shadow-sm hover:bg-green-50'), children: [ /*#__PURE__*/ _jsx("div", { className: "p-2.5 rounded-xl flex-shrink-0 ".concat((_typeColor_n_type = typeColor[n.type]) !== null && _typeColor_n_type !== void 0 ? _typeColor_n_type : 'bg-gray-100 text-gray-500'), children: /*#__PURE__*/ _jsx(NotifIcon, { type: n.type }) }), /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ _jsx("p", { className: "font-medium ".concat(n.isRead ? 'text-gray-600' : 'text-gray-900'), children: t("notif.type.".concat(n.type), t('notif.type.generic', 'Notification')) }), n.body && /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-500 mt-0.5 truncate", children: (()=>{ if (n.type === 'new_message') return n.body; if (n.type === 'new_review') { const rating = extractRating(n.body); const tpl = t("notif.body.new_review", ''); return rating && tpl ? tpl.replace('{rating}', rating) : n.body; } if (n.type === 'referral_reward') { const days = extractNumber(n.body); const plan = extractParam(n.body); const tpl = t('notif.body.referral_reward', ''); if (tpl && days && plan) return tpl.replace('{days}', days).replace('{plan}', plan); return tpl || n.body; } const title = extractParam(n.body); const tpl = t("notif.body.".concat(n.type), ''); if (tpl && title) return tpl.replace('{title}', title); return tpl || n.body; })() }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-1", children: relativeTime(n.createdAt) }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex flex-col items-end gap-2 shrink-0", onClick: (e)=>e.stopPropagation(), children: [ /*#__PURE__*/ _jsx("button", { onClick: (e)=>handleDismiss(e, n.id), className: "p-1 rounded-md text-gray-300 hover:text-red-400 hover:bg-red-50 transition", title: t('common.delete', 'Delete'), children: /*#__PURE__*/ _jsxs("svg", { className: "w-4 h-4", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", children: [ /*#__PURE__*/ _jsx("line", { x1: "18", y1: "6", x2: "6", y2: "18" }), /*#__PURE__*/ _jsx("line", { x1: "6", y1: "6", x2: "18", y2: "18" }) ] }) }), /*#__PURE__*/ _jsx("div", { className: "flex items-center gap-1.5", children: !n.isRead && /*#__PURE__*/ _jsx("span", { className: "w-2 h-2 bg-green-500 rounded-full" }) }) ] }) ] }, n.id); }) }) ] }); } cB={}_šªÕ×þ,.†&*psdg26|+.êî4 7 ã æ ± Ž Ÿ Á ñ _ô ” ˜ Þᘛgjvy©¬ilœŸ‹ÕØ~ÂÆ œŸ!!X!_a!y!! !š!Û!â! """'"¢"ª"Ø"ç"„#Ž#N$U$J%\%ë%î%Ì-Ð-;.?.Í.Ñ.Ï/Ó/…1_ˆ1Ô2×2j3m3¹5œ5U7X7t8w8$9(9Î9Ñ91;4;òAõA.C2C3D6D E€EìGïGbIeILKOK÷K@úK€€€€€€·(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)¶(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)ÿþÿÿþÿÿÿÿÿþÿÿÿÿÿÿÿþÿÿþÿÿ€¿(0,_lib_auth__WEBPACK_IMPORTED_MODULE_3__/* .useSession */ .wV)º(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)Ã(0,_context_locale__WEBPACK_IMPORTED_MODULE_4__/* .useLocale */ .Y)¯(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)ÿ°(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)ÿÄ(0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getNotifications */ .Tr)¿(0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .markAllRead */ .NL)Œ(0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .markRead */ .Ip)Ç(0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .dismissNotification */ .yk)öõõõõöööõööõöööõöõöööö€†buffer†source„size„maps„hashèZ__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ NotificationsPage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7541); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(1592); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(9906); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(2982); /* __next_internal_client_entry_do_not_use__ default auto */ function NotifIcon(param) { let { type } = param; const cls = 'w-5 h-5'; switch(type){ case 'new_offer': return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: cls, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("rect", { x: "2", y: "7", width: "20", height: "14", rx: "2" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M16 21V5a2 2 0 00-2-2h-4a2 2 0 00-2 2v16" }) ] }); case 'offer_accepted': return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: cls, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("circle", { cx: "12", cy: "12", r: "10" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("polyline", { points: "9 12 11 14 15 10" }) ] }); case 'offer_declined': return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: cls, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("circle", { cx: "12", cy: "12", r: "10" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: "15", y1: "9", x2: "9", y2: "15" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: "9", y1: "9", x2: "15", y2: "15" }) ] }); case 'task_completed': return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: cls, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("polyline", { points: "20 6 9 17 4 12" }) }); case 'task_cancelled': return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: cls, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: "12", y1: "9", x2: "12", y2: "13" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: "12", y1: "17", x2: "12.01", y2: "17" }) ] }); case 'new_message': return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: cls, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M21 15a2 2 0 01-2 2H7l-4 4V5a2 2 0 012-2h14a2 2 0 012 2z" }) }); case 'new_review': return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: cls, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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" }) }); case 'task_invite': return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: cls, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M16 4h2a2 2 0 012 2v14a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2h2" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("rect", { x: "8", y: "2", width: "8", height: "4", rx: "1", ry: "1" }) ] }); default: return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: cls, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M18 8A6 6 0 006 8c0 7-3 9-3 9h18s-3-2-3-9" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M13.73 21a2 2 0 01-3.46 0" }) ] }); } } const typeColor = { new_offer: 'bg-green-100 text-green-600', offer_accepted: 'bg-green-100 text-green-600', offer_declined: 'bg-red-100 text-red-600', task_completed: 'bg-emerald-100 text-emerald-600', task_cancelled: 'bg-amber-100 text-amber-600', new_message: 'bg-purple-100 text-purple-600', new_review: 'bg-yellow-100 text-yellow-600', task_invite: 'bg-indigo-100 text-indigo-600', referral_reward: 'bg-cyan-100 text-cyan-700', specialist_card_submitted: 'bg-amber-100 text-amber-700', specialist_card_approved: 'bg-green-100 text-green-700', specialist_card_rejected: 'bg-rose-100 text-rose-700' }; /** Extract the quoted task title from a stored body string (any locale) */ function extractParam(body) { if (!body) return null; const m = body.match(/[«""](.+?)[»""]/); var _m_; return (_m_ = m === null || m === void 0 ? void 0 : m[1]) !== null && _m_ !== void 0 ? _m_ : null; } /** Extract rating number from a stored review body */ function extractRating(body) { if (!body) return null; const m = body.match(/(\d+)\s*[★\*]/); var _m_; return (_m_ = m === null || m === void 0 ? void 0 : m[1]) !== null && _m_ !== void 0 ? _m_ : null; } /** Extract first integer from text (for referral days, etc.) */ function extractNumber(body) { if (!body) return null; const m = body.match(/(\d+)/); var _m_; return (_m_ = m === null || m === void 0 ? void 0 : m[1]) !== null && _m_ !== void 0 ? _m_ : null; } function NotificationsPage() { const { data: session, isPending } = (0,_lib_auth__WEBPACK_IMPORTED_MODULE_3__/* .useSession */ .wV)(); const router = (0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)(); const { t, locale } = (0,_context_locale__WEBPACK_IMPORTED_MODULE_4__/* .useLocale */ .Y)(); const [notifications, setNotifications] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [loading, setLoading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(true); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!isPending && !session) router.push('/login'); }, [ session, isPending ]); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!session) return; (0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getNotifications */ .Tr)().then(setNotifications).catch(()=>{}).finally(()=>setLoading(false)); }, [ session ]); async function handleMarkAll() { await (0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .markAllRead */ .NL)(); setNotifications((prev)=>prev.map((n)=>({ ...n, isRead: true }))); } async function handleMark(id) { await (0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .markRead */ .Ip)(id); setNotifications((prev)=>prev.map((n)=>n.id === id ? { ...n, isRead: true } : n)); } async function handleDismiss(e, id) { e.stopPropagation(); await (0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .dismissNotification */ .yk)(id).catch(()=>{}); setNotifications((prev)=>prev.filter((n)=>n.id !== id)); } if (isPending || loading) return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-center py-20 text-white", children: t('common.loading') }); function relativeTime(dateStr) { const diff = Date.now() - new Date(dateStr).getTime(); const sec = Math.floor(diff / 1000); const min = Math.floor(sec / 60); const hrs = Math.floor(min / 60); const days = Math.floor(hrs / 24); if (locale === 'ru') { if (sec < 60) return 'тПлькП чтП'; if (min < 60) return "".concat(min, " ЌОМ. МазаЎ"); if (hrs < 24) return "".concat(hrs, " ч. МазаЎ"); if (days === 1) return 'вчера'; if (days < 7) return "".concat(days, " ЎМ. МазаЎ"); } else if (locale === 'uk') { if (sec < 60) return 'щПйМП'; if (min < 60) return "".concat(min, " хв. тПЌу"); if (hrs < 24) return "".concat(hrs, " гПЎ. тПЌу"); if (days === 1) return 'вчПра'; if (days < 7) return "".concat(days, " ЎМ. тПЌу"); } else if (locale === 'en') { if (sec < 60) return 'just now'; if (min < 60) return "".concat(min, "m ago"); if (hrs < 24) return "".concat(hrs, "h ago"); if (days === 1) return 'yesterday'; if (days < 7) return "".concat(days, "d ago"); } else { if (sec < 60) return 'Όόλις τώρα'; if (min < 60) return "".concat(min, " λ. πριΜ"); if (hrs < 24) return "".concat(hrs, " ω. πριΜ"); if (days === 1) return 'χΞες'; if (days < 7) return "".concat(days, " ÎŒ. πριΜ"); } return new Date(dateStr).toLocaleDateString(dateLocale, { day: 'numeric', month: 'short', year: days > 365 ? 'numeric' : undefined }); } const unreadCount = notifications.filter((n)=>!n.isRead).length; const dateLocale = locale === 'ru' ? 'ru-RU' : locale === 'uk' ? 'uk-UA' : locale === 'en' ? 'en-US' : 'el-GR'; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "max-w-2xl mx-auto px-4 py-8", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex justify-between items-center mb-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("h1", { className: "text-2xl font-bold text-white", children: [ t('notif.title'), " ", unreadCount > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "text-white/70 font-normal text-xl", children: [ "(", unreadCount, ")" ] }) ] }), unreadCount > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: handleMarkAll, className: "text-sm text-white/80 hover:text-white hover:underline transition", children: t('notif.mark_all') }) ] }), notifications.length === 0 ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-center py-20 text-white/60", children: t('notif.empty') }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "space-y-2", children: notifications.map((n)=>{ const link = n.type === 'referral_reward' ? '/profile?tab=referral' : n.referenceId ? n.type === 'new_message' ? "/chat?room=".concat(n.referenceId) : "/tasks/".concat(n.referenceId) : null; const handleClick = async ()=>{ if (!n.isRead) await handleMark(n.id); if (link) router.push(link); }; var _typeColor_n_type; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { onClick: handleClick, className: "flex items-start gap-3 p-4 rounded-xl border transition ".concat(link ? 'cursor-pointer' : 'cursor-default', " ").concat(n.isRead ? 'bg-white/90 border-white/20 hover:bg-white' : 'bg-white border-green-300 shadow-sm hover:bg-green-50'), children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "p-2.5 rounded-xl flex-shrink-0 ".concat((_typeColor_n_type = typeColor[n.type]) !== null && _typeColor_n_type !== void 0 ? _typeColor_n_type : 'bg-gray-100 text-gray-500'), children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(NotifIcon, { type: n.type }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "font-medium ".concat(n.isRead ? 'text-gray-600' : 'text-gray-900'), children: t("notif.type.".concat(n.type), t('notif.type.generic', 'Notification')) }), n.body && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-gray-500 mt-0.5 truncate", children: (()=>{ if (n.type === 'new_message') return n.body; if (n.type === 'new_review') { const rating = extractRating(n.body); const tpl = t("notif.body.new_review", ''); return rating && tpl ? tpl.replace('{rating}', rating) : n.body; } if (n.type === 'referral_reward') { const days = extractNumber(n.body); const plan = extractParam(n.body); const tpl = t('notif.body.referral_reward', ''); if (tpl && days && plan) return tpl.replace('{days}', days).replace('{plan}', plan); return tpl || n.body; } const title = extractParam(n.body); const tpl = t("notif.body.".concat(n.type), ''); if (tpl && title) return tpl.replace('{title}', title); return tpl || n.body; })() }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400 mt-1", children: relativeTime(n.createdAt) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex flex-col items-end gap-2 shrink-0", onClick: (e)=>e.stopPropagation(), children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: (e)=>handleDismiss(e, n.id), className: "p-1 rounded-md text-gray-300 hover:text-red-400 hover:bg-red-50 transition", title: t('common.delete', 'Delete'), children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-4 h-4", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: "18", y1: "6", x2: "6", y2: "18" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: "6", y1: "6", x2: "18", y2: "18" }) ] }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex items-center gap-1.5", children: !n.isRead && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "w-2 h-2 bg-green-500 rounded-full" }) }) ] }) ] }, n.id); }) }) ] }); } €”{"finalSource":true}ƒmap‹bufferedMap ConcatSourceRawSource__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ NotificationsPage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7541); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(1592); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(9906); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(2982); ReplaceSourceRawSourceÂM/* __next_internal_client_entry_do_not_use__ default auto */ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { useEffect, useState } from 'react'; import { useRouter } from 'next/navigation'; import { useSession } from '@/lib/auth'; import { useLocale } from '@/context/locale'; import { getNotifications, markAllRead, markRead, dismissNotification } from '@/lib/api'; function NotifIcon(param) { let { type } = param; const cls = 'w-5 h-5'; switch(type){ case 'new_offer': return /*#__PURE__*/ _jsxs("svg", { className: cls, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", children: [ /*#__PURE__*/ _jsx("rect", { x: "2", y: "7", width: "20", height: "14", rx: "2" }), /*#__PURE__*/ _jsx("path", { d: "M16 21V5a2 2 0 00-2-2h-4a2 2 0 00-2 2v16" }) ] }); case 'offer_accepted': return /*#__PURE__*/ _jsxs("svg", { className: cls, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", children: [ /*#__PURE__*/ _jsx("circle", { cx: "12", cy: "12", r: "10" }), /*#__PURE__*/ _jsx("polyline", { points: "9 12 11 14 15 10" }) ] }); case 'offer_declined': return /*#__PURE__*/ _jsxs("svg", { className: cls, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", children: [ /*#__PURE__*/ _jsx("circle", { cx: "12", cy: "12", r: "10" }), /*#__PURE__*/ _jsx("line", { x1: "15", y1: "9", x2: "9", y2: "15" }), /*#__PURE__*/ _jsx("line", { x1: "9", y1: "9", x2: "15", y2: "15" }) ] }); case 'task_completed': return /*#__PURE__*/ _jsx("svg", { className: cls, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", children: /*#__PURE__*/ _jsx("polyline", { points: "20 6 9 17 4 12" }) }); case 'task_cancelled': return /*#__PURE__*/ _jsxs("svg", { className: cls, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", children: [ /*#__PURE__*/ _jsx("path", { d: "M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z" }), /*#__PURE__*/ _jsx("line", { x1: "12", y1: "9", x2: "12", y2: "13" }), /*#__PURE__*/ _jsx("line", { x1: "12", y1: "17", x2: "12.01", y2: "17" }) ] }); case 'new_message': return /*#__PURE__*/ _jsx("svg", { className: cls, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", children: /*#__PURE__*/ _jsx("path", { d: "M21 15a2 2 0 01-2 2H7l-4 4V5a2 2 0 012-2h14a2 2 0 012 2z" }) }); case 'new_review': return /*#__PURE__*/ _jsx("svg", { className: cls, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", children: /*#__PURE__*/ _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" }) }); case 'task_invite': return /*#__PURE__*/ _jsxs("svg", { className: cls, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", children: [ /*#__PURE__*/ _jsx("path", { d: "M16 4h2a2 2 0 012 2v14a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2h2" }), /*#__PURE__*/ _jsx("rect", { x: "8", y: "2", width: "8", height: "4", rx: "1", ry: "1" }) ] }); default: return /*#__PURE__*/ _jsxs("svg", { className: cls, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", children: [ /*#__PURE__*/ _jsx("path", { d: "M18 8A6 6 0 006 8c0 7-3 9-3 9h18s-3-2-3-9" }), /*#__PURE__*/ _jsx("path", { d: "M13.73 21a2 2 0 01-3.46 0" }) ] }); } } const typeColor = { new_offer: 'bg-green-100 text-green-600', offer_accepted: 'bg-green-100 text-green-600', offer_declined: 'bg-red-100 text-red-600', task_completed: 'bg-emerald-100 text-emerald-600', task_cancelled: 'bg-amber-100 text-amber-600', new_message: 'bg-purple-100 text-purple-600', new_review: 'bg-yellow-100 text-yellow-600', task_invite: 'bg-indigo-100 text-indigo-600', referral_reward: 'bg-cyan-100 text-cyan-700', specialist_card_submitted: 'bg-amber-100 text-amber-700', specialist_card_approved: 'bg-green-100 text-green-700', specialist_card_rejected: 'bg-rose-100 text-rose-700' }; /** Extract the quoted task title from a stored body string (any locale) */ function extractParam(body) { if (!body) return null; const m = body.match(/[«""](.+?)[»""]/); var _m_; return (_m_ = m === null || m === void 0 ? void 0 : m[1]) !== null && _m_ !== void 0 ? _m_ : null; } /** Extract rating number from a stored review body */ function extractRating(body) { if (!body) return null; const m = body.match(/(\d+)\s*[★\*]/); var _m_; return (_m_ = m === null || m === void 0 ? void 0 : m[1]) !== null && _m_ !== void 0 ? _m_ : null; } /** Extract first integer from text (for referral days, etc.) */ function extractNumber(body) { if (!body) return null; const m = body.match(/(\d+)/); var _m_; return (_m_ = m === null || m === void 0 ? void 0 : m[1]) !== null && _m_ !== void 0 ? _m_ : null; } export default function NotificationsPage() { const { data: session, isPending } = useSession(); const router = useRouter(); const { t, locale } = useLocale(); const [notifications, setNotifications] = useState([]); const [loading, setLoading] = useState(true); useEffect(()=>{ if (!isPending && !session) router.push('/login'); }, [ session, isPending ]); useEffect(()=>{ if (!session) return; getNotifications().then(setNotifications).catch(()=>{}).finally(()=>setLoading(false)); }, [ session ]); async function handleMarkAll() { await markAllRead(); setNotifications((prev)=>prev.map((n)=>({ ...n, isRead: true }))); } async function handleMark(id) { await markRead(id); setNotifications((prev)=>prev.map((n)=>n.id === id ? { ...n, isRead: true } : n)); } async function handleDismiss(e, id) { e.stopPropagation(); await dismissNotification(id).catch(()=>{}); setNotifications((prev)=>prev.filter((n)=>n.id !== id)); } if (isPending || loading) return /*#__PURE__*/ _jsx("div", { className: "text-center py-20 text-white", children: t('common.loading') }); function relativeTime(dateStr) { const diff = Date.now() - new Date(dateStr).getTime(); const sec = Math.floor(diff / 1000); const min = Math.floor(sec / 60); const hrs = Math.floor(min / 60); const days = Math.floor(hrs / 24); if (locale === 'ru') { if (sec < 60) return 'тПлькП чтП'; if (min < 60) return "".concat(min, " ЌОМ. МазаЎ"); if (hrs < 24) return "".concat(hrs, " ч. МазаЎ"); if (days === 1) return 'вчера'; if (days < 7) return "".concat(days, " ЎМ. МазаЎ"); } else if (locale === 'uk') { if (sec < 60) return 'щПйМП'; if (min < 60) return "".concat(min, " хв. тПЌу"); if (hrs < 24) return "".concat(hrs, " гПЎ. тПЌу"); if (days === 1) return 'вчПра'; if (days < 7) return "".concat(days, " ЎМ. тПЌу"); } else if (locale === 'en') { if (sec < 60) return 'just now'; if (min < 60) return "".concat(min, "m ago"); if (hrs < 24) return "".concat(hrs, "h ago"); if (days === 1) return 'yesterday'; if (days < 7) return "".concat(days, "d ago"); } else { if (sec < 60) return 'Όόλις τώρα'; if (min < 60) return "".concat(min, " λ. πριΜ"); if (hrs < 24) return "".concat(hrs, " ω. πριΜ"); if (days === 1) return 'χΞες'; if (days < 7) return "".concat(days, " ÎŒ. πριΜ"); } return new Date(dateStr).toLocaleDateString(dateLocale, { day: 'numeric', month: 'short', year: days > 365 ? 'numeric' : undefined }); } const unreadCount = notifications.filter((n)=>!n.isRead).length; const dateLocale = locale === 'ru' ? 'ru-RU' : locale === 'uk' ? 'uk-UA' : locale === 'en' ? 'en-US' : 'el-GR'; return /*#__PURE__*/ _jsxs("div", { className: "max-w-2xl mx-auto px-4 py-8", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex justify-between items-center mb-6", children: [ /*#__PURE__*/ _jsxs("h1", { className: "text-2xl font-bold text-white", children: [ t('notif.title'), " ", unreadCount > 0 && /*#__PURE__*/ _jsxs("span", { className: "text-white/70 font-normal text-xl", children: [ "(", unreadCount, ")" ] }) ] }), unreadCount > 0 && /*#__PURE__*/ _jsx("button", { onClick: handleMarkAll, className: "text-sm text-white/80 hover:text-white hover:underline transition", children: t('notif.mark_all') }) ] }), notifications.length === 0 ? /*#__PURE__*/ _jsx("div", { className: "text-center py-20 text-white/60", children: t('notif.empty') }) : /*#__PURE__*/ _jsx("div", { className: "space-y-2", children: notifications.map((n)=>{ const link = n.type === 'referral_reward' ? '/profile?tab=referral' : n.referenceId ? n.type === 'new_message' ? "/chat?room=".concat(n.referenceId) : "/tasks/".concat(n.referenceId) : null; const handleClick = async ()=>{ if (!n.isRead) await handleMark(n.id); if (link) router.push(link); }; var _typeColor_n_type; return /*#__PURE__*/ _jsxs("div", { onClick: handleClick, className: "flex items-start gap-3 p-4 rounded-xl border transition ".concat(link ? 'cursor-pointer' : 'cursor-default', " ").concat(n.isRead ? 'bg-white/90 border-white/20 hover:bg-white' : 'bg-white border-green-300 shadow-sm hover:bg-green-50'), children: [ /*#__PURE__*/ _jsx("div", { className: "p-2.5 rounded-xl flex-shrink-0 ".concat((_typeColor_n_type = typeColor[n.type]) !== null && _typeColor_n_type !== void 0 ? _typeColor_n_type : 'bg-gray-100 text-gray-500'), children: /*#__PURE__*/ _jsx(NotifIcon, { type: n.type }) }), /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ _jsx("p", { className: "font-medium ".concat(n.isRead ? 'text-gray-600' : 'text-gray-900'), children: t("notif.type.".concat(n.type), t('notif.type.generic', 'Notification')) }), n.body && /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-500 mt-0.5 truncate", children: (()=>{ if (n.type === 'new_message') return n.body; if (n.type === 'new_review') { const rating = extractRating(n.body); const tpl = t("notif.body.new_review", ''); return rating && tpl ? tpl.replace('{rating}', rating) : n.body; } if (n.type === 'referral_reward') { const days = extractNumber(n.body); const plan = extractParam(n.body); const tpl = t('notif.body.referral_reward', ''); if (tpl && days && plan) return tpl.replace('{days}', days).replace('{plan}', plan); return tpl || n.body; } const title = extractParam(n.body); const tpl = t("notif.body.".concat(n.type), ''); if (tpl && title) return tpl.replace('{title}', title); return tpl || n.body; })() }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-1", children: relativeTime(n.createdAt) }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex flex-col items-end gap-2 shrink-0", onClick: (e)=>e.stopPropagation(), children: [ /*#__PURE__*/ _jsx("button", { onClick: (e)=>handleDismiss(e, n.id), className: "p-1 rounded-md text-gray-300 hover:text-red-400 hover:bg-red-50 transition", title: t('common.delete', 'Delete'), children: /*#__PURE__*/ _jsxs("svg", { className: "w-4 h-4", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", children: [ /*#__PURE__*/ _jsx("line", { x1: "18", y1: "6", x2: "6", y2: "18" }), /*#__PURE__*/ _jsx("line", { x1: "6", y1: "6", x2: "18", y2: "18" }) ] }) }), /*#__PURE__*/ _jsx("div", { className: "flex items-center gap-1.5", children: !n.isRead && /*#__PURE__*/ _jsx("span", { className: "w-2 h-2 bg-green-500 rounded-full" }) }) ] }) ] }, n.id); }) }) ] }); } )61123undefined125168undefined170213undefined215254undefined256300undefined302390undefined550554(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined880883(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined11241127(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined13301334(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined16601663(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined18351838(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined20262030(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined23562359(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined25312534(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined27372740(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined30063009(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined33133316(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined34763480(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined38063809(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined39923995(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined41994202(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined44704473(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined47774780(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined49694972(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined52765279(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined55155519(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined58455848(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined60146017(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined63386342(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined66686671(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined68126815(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined84498463undefined85368545(0,_lib_auth__WEBPACK_IMPORTED_MODULE_3__/* .useSession */ .wV)undefined85698577(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)undefined86088616(0,_context_locale__WEBPACK_IMPORTED_MODULE_4__/* .useLocale */ .Y)undefined86678674(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined87158722(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined87358743(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined88668874(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined89208935(0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getNotifications */ .Tr)undefined90929102(0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .markAllRead */ .NL)undefined92949301(0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .markRead */ .Ip)undefined95469564(0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .dismissNotification */ .yk)undefined97079710(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1172411728(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1183511839(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1198111985(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1223912243(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1267712680(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1301213015(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1316213165(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1375313757(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1416514168(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1445214455(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1462814632(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1479814801(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1515315156(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1688216885(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1719817202(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1745917462(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1782417828(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1841218415(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1878618789(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1927619279(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1944719450(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined /***/ }) àQ[/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ NotificationsPage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7541); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(1592); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(9906); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(2982); /* __next_internal_client_entry_do_not_use__ default auto */ function NotifIcon(param) { let { type } = param; const cls = 'w-5 h-5'; switch(type){ case 'new_offer': return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: cls, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("rect", { x: "2", y: "7", width: "20", height: "14", rx: "2" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M16 21V5a2 2 0 00-2-2h-4a2 2 0 00-2 2v16" }) ] }); case 'offer_accepted': return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: cls, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("circle", { cx: "12", cy: "12", r: "10" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("polyline", { points: "9 12 11 14 15 10" }) ] }); case 'offer_declined': return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: cls, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("circle", { cx: "12", cy: "12", r: "10" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: "15", y1: "9", x2: "9", y2: "15" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: "9", y1: "9", x2: "15", y2: "15" }) ] }); case 'task_completed': return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: cls, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("polyline", { points: "20 6 9 17 4 12" }) }); case 'task_cancelled': return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: cls, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: "12", y1: "9", x2: "12", y2: "13" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: "12", y1: "17", x2: "12.01", y2: "17" }) ] }); case 'new_message': return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: cls, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M21 15a2 2 0 01-2 2H7l-4 4V5a2 2 0 012-2h14a2 2 0 012 2z" }) }); case 'new_review': return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: cls, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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" }) }); case 'task_invite': return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: cls, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M16 4h2a2 2 0 012 2v14a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2h2" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("rect", { x: "8", y: "2", width: "8", height: "4", rx: "1", ry: "1" }) ] }); default: return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: cls, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M18 8A6 6 0 006 8c0 7-3 9-3 9h18s-3-2-3-9" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M13.73 21a2 2 0 01-3.46 0" }) ] }); } } const typeColor = { new_offer: 'bg-green-100 text-green-600', offer_accepted: 'bg-green-100 text-green-600', offer_declined: 'bg-red-100 text-red-600', task_completed: 'bg-emerald-100 text-emerald-600', task_cancelled: 'bg-amber-100 text-amber-600', new_message: 'bg-purple-100 text-purple-600', new_review: 'bg-yellow-100 text-yellow-600', task_invite: 'bg-indigo-100 text-indigo-600', referral_reward: 'bg-cyan-100 text-cyan-700', specialist_card_submitted: 'bg-amber-100 text-amber-700', specialist_card_approved: 'bg-green-100 text-green-700', specialist_card_rejected: 'bg-rose-100 text-rose-700' }; /** Extract the quoted task title from a stored body string (any locale) */ function extractParam(body) { if (!body) return null; const m = body.match(/[«""](.+?)[»""]/); var _m_; return (_m_ = m === null || m === void 0 ? void 0 : m[1]) !== null && _m_ !== void 0 ? _m_ : null; } /** Extract rating number from a stored review body */ function extractRating(body) { if (!body) return null; const m = body.match(/(\d+)\s*[★\*]/); var _m_; return (_m_ = m === null || m === void 0 ? void 0 : m[1]) !== null && _m_ !== void 0 ? _m_ : null; } /** Extract first integer from text (for referral days, etc.) */ function extractNumber(body) { if (!body) return null; const m = body.match(/(\d+)/); var _m_; return (_m_ = m === null || m === void 0 ? void 0 : m[1]) !== null && _m_ !== void 0 ? _m_ : null; } function NotificationsPage() { const { data: session, isPending } = (0,_lib_auth__WEBPACK_IMPORTED_MODULE_3__/* .useSession */ .wV)(); const router = (0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)(); const { t, locale } = (0,_context_locale__WEBPACK_IMPORTED_MODULE_4__/* .useLocale */ .Y)(); const [notifications, setNotifications] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [loading, setLoading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(true); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!isPending && !session) router.push('/login'); }, [ session, isPending ]); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!session) return; (0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getNotifications */ .Tr)().then(setNotifications).catch(()=>{}).finally(()=>setLoading(false)); }, [ session ]); async function handleMarkAll() { await (0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .markAllRead */ .NL)(); setNotifications((prev)=>prev.map((n)=>({ ...n, isRead: true }))); } async function handleMark(id) { await (0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .markRead */ .Ip)(id); setNotifications((prev)=>prev.map((n)=>n.id === id ? { ...n, isRead: true } : n)); } async function handleDismiss(e, id) { e.stopPropagation(); await (0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .dismissNotification */ .yk)(id).catch(()=>{}); setNotifications((prev)=>prev.filter((n)=>n.id !== id)); } if (isPending || loading) return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-center py-20 text-white", children: t('common.loading') }); function relativeTime(dateStr) { const diff = Date.now() - new Date(dateStr).getTime(); const sec = Math.floor(diff / 1000); const min = Math.floor(sec / 60); const hrs = Math.floor(min / 60); const days = Math.floor(hrs / 24); if (locale === 'ru') { if (sec < 60) return 'тПлькП чтП'; if (min < 60) return "".concat(min, " ЌОМ. МазаЎ"); if (hrs < 24) return "".concat(hrs, " ч. МазаЎ"); if (days === 1) return 'вчера'; if (days < 7) return "".concat(days, " ЎМ. МазаЎ"); } else if (locale === 'uk') { if (sec < 60) return 'щПйМП'; if (min < 60) return "".concat(min, " хв. тПЌу"); if (hrs < 24) return "".concat(hrs, " гПЎ. тПЌу"); if (days === 1) return 'вчПра'; if (days < 7) return "".concat(days, " ЎМ. тПЌу"); } else if (locale === 'en') { if (sec < 60) return 'just now'; if (min < 60) return "".concat(min, "m ago"); if (hrs < 24) return "".concat(hrs, "h ago"); if (days === 1) return 'yesterday'; if (days < 7) return "".concat(days, "d ago"); } else { if (sec < 60) return 'Όόλις τώρα'; if (min < 60) return "".concat(min, " λ. πριΜ"); if (hrs < 24) return "".concat(hrs, " ω. πριΜ"); if (days === 1) return 'χΞες'; if (days < 7) return "".concat(days, " ÎŒ. πριΜ"); } return new Date(dateStr).toLocaleDateString(dateLocale, { day: 'numeric', month: 'short', year: days > 365 ? 'numeric' : undefined }); } const unreadCount = notifications.filter((n)=>!n.isRead).length; const dateLocale = locale === 'ru' ? 'ru-RU' : locale === 'uk' ? 'uk-UA' : locale === 'en' ? 'en-US' : 'el-GR'; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "max-w-2xl mx-auto px-4 py-8", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex justify-between items-center mb-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("h1", { className: "text-2xl font-bold text-white", children: [ t('notif.title'), " ", unreadCount > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "text-white/70 font-normal text-xl", children: [ "(", unreadCount, ")" ] }) ] }), unreadCount > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: handleMarkAll, className: "text-sm text-white/80 hover:text-white hover:underline transition", children: t('notif.mark_all') }) ] }), notifications.length === 0 ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-center py-20 text-white/60", children: t('notif.empty') }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "space-y-2", children: notifications.map((n)=>{ const link = n.type === 'referral_reward' ? '/profile?tab=referral' : n.referenceId ? n.type === 'new_message' ? "/chat?room=".concat(n.referenceId) : "/tasks/".concat(n.referenceId) : null; const handleClick = async ()=>{ if (!n.isRead) await handleMark(n.id); if (link) router.push(link); }; var _typeColor_n_type; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { onClick: handleClick, className: "flex items-start gap-3 p-4 rounded-xl border transition ".concat(link ? 'cursor-pointer' : 'cursor-default', " ").concat(n.isRead ? 'bg-white/90 border-white/20 hover:bg-white' : 'bg-white border-green-300 shadow-sm hover:bg-green-50'), children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "p-2.5 rounded-xl flex-shrink-0 ".concat((_typeColor_n_type = typeColor[n.type]) !== null && _typeColor_n_type !== void 0 ? _typeColor_n_type : 'bg-gray-100 text-gray-500'), children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(NotifIcon, { type: n.type }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "font-medium ".concat(n.isRead ? 'text-gray-600' : 'text-gray-900'), children: t("notif.type.".concat(n.type), t('notif.type.generic', 'Notification')) }), n.body && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-gray-500 mt-0.5 truncate", children: (()=>{ if (n.type === 'new_message') return n.body; if (n.type === 'new_review') { const rating = extractRating(n.body); const tpl = t("notif.body.new_review", ''); return rating && tpl ? tpl.replace('{rating}', rating) : n.body; } if (n.type === 'referral_reward') { const days = extractNumber(n.body); const plan = extractParam(n.body); const tpl = t('notif.body.referral_reward', ''); if (tpl && days && plan) return tpl.replace('{days}', days).replace('{plan}', plan); return tpl || n.body; } const title = extractParam(n.body); const tpl = t("notif.body.".concat(n.type), ''); if (tpl && title) return tpl.replace('{title}', title); return tpl || n.body; })() }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400 mt-1", children: relativeTime(n.createdAt) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex flex-col items-end gap-2 shrink-0", onClick: (e)=>e.stopPropagation(), children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: (e)=>handleDismiss(e, n.id), className: "p-1 rounded-md text-gray-300 hover:text-red-400 hover:bg-red-50 transition", title: t('common.delete', 'Delete'), children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-4 h-4", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: "18", y1: "6", x2: "6", y2: "18" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: "6", y1: "6", x2: "18", y2: "18" }) ] }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex items-center gap-1.5", children: !n.isRead && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "w-2 h-2 bg-green-500 rounded-full" }) }) ] }) ] }, n.id); }) }) ] }); } /***/ }) áä  åæå__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ NotificationsPage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7541); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(1592); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(9906); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(2982); çÂM/* __next_internal_client_entry_do_not_use__ default auto */ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { useEffect, useState } from 'react'; import { useRouter } from 'next/navigation'; import { useSession } from '@/lib/auth'; import { useLocale } from '@/context/locale'; import { getNotifications, markAllRead, markRead, dismissNotification } from '@/lib/api'; function NotifIcon(param) { let { type } = param; const cls = 'w-5 h-5'; switch(type){ case 'new_offer': return /*#__PURE__*/ _jsxs("svg", { className: cls, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", children: [ /*#__PURE__*/ _jsx("rect", { x: "2", y: "7", width: "20", height: "14", rx: "2" }), /*#__PURE__*/ _jsx("path", { d: "M16 21V5a2 2 0 00-2-2h-4a2 2 0 00-2 2v16" }) ] }); case 'offer_accepted': return /*#__PURE__*/ _jsxs("svg", { className: cls, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", children: [ /*#__PURE__*/ _jsx("circle", { cx: "12", cy: "12", r: "10" }), /*#__PURE__*/ _jsx("polyline", { points: "9 12 11 14 15 10" }) ] }); case 'offer_declined': return /*#__PURE__*/ _jsxs("svg", { className: cls, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", children: [ /*#__PURE__*/ _jsx("circle", { cx: "12", cy: "12", r: "10" }), /*#__PURE__*/ _jsx("line", { x1: "15", y1: "9", x2: "9", y2: "15" }), /*#__PURE__*/ _jsx("line", { x1: "9", y1: "9", x2: "15", y2: "15" }) ] }); case 'task_completed': return /*#__PURE__*/ _jsx("svg", { className: cls, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", children: /*#__PURE__*/ _jsx("polyline", { points: "20 6 9 17 4 12" }) }); case 'task_cancelled': return /*#__PURE__*/ _jsxs("svg", { className: cls, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", children: [ /*#__PURE__*/ _jsx("path", { d: "M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z" }), /*#__PURE__*/ _jsx("line", { x1: "12", y1: "9", x2: "12", y2: "13" }), /*#__PURE__*/ _jsx("line", { x1: "12", y1: "17", x2: "12.01", y2: "17" }) ] }); case 'new_message': return /*#__PURE__*/ _jsx("svg", { className: cls, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", children: /*#__PURE__*/ _jsx("path", { d: "M21 15a2 2 0 01-2 2H7l-4 4V5a2 2 0 012-2h14a2 2 0 012 2z" }) }); case 'new_review': return /*#__PURE__*/ _jsx("svg", { className: cls, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", children: /*#__PURE__*/ _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" }) }); case 'task_invite': return /*#__PURE__*/ _jsxs("svg", { className: cls, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", children: [ /*#__PURE__*/ _jsx("path", { d: "M16 4h2a2 2 0 012 2v14a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2h2" }), /*#__PURE__*/ _jsx("rect", { x: "8", y: "2", width: "8", height: "4", rx: "1", ry: "1" }) ] }); default: return /*#__PURE__*/ _jsxs("svg", { className: cls, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", children: [ /*#__PURE__*/ _jsx("path", { d: "M18 8A6 6 0 006 8c0 7-3 9-3 9h18s-3-2-3-9" }), /*#__PURE__*/ _jsx("path", { d: "M13.73 21a2 2 0 01-3.46 0" }) ] }); } } const typeColor = { new_offer: 'bg-green-100 text-green-600', offer_accepted: 'bg-green-100 text-green-600', offer_declined: 'bg-red-100 text-red-600', task_completed: 'bg-emerald-100 text-emerald-600', task_cancelled: 'bg-amber-100 text-amber-600', new_message: 'bg-purple-100 text-purple-600', new_review: 'bg-yellow-100 text-yellow-600', task_invite: 'bg-indigo-100 text-indigo-600', referral_reward: 'bg-cyan-100 text-cyan-700', specialist_card_submitted: 'bg-amber-100 text-amber-700', specialist_card_approved: 'bg-green-100 text-green-700', specialist_card_rejected: 'bg-rose-100 text-rose-700' }; /** Extract the quoted task title from a stored body string (any locale) */ function extractParam(body) { if (!body) return null; const m = body.match(/[«""](.+?)[»""]/); var _m_; return (_m_ = m === null || m === void 0 ? void 0 : m[1]) !== null && _m_ !== void 0 ? _m_ : null; } /** Extract rating number from a stored review body */ function extractRating(body) { if (!body) return null; const m = body.match(/(\d+)\s*[★\*]/); var _m_; return (_m_ = m === null || m === void 0 ? void 0 : m[1]) !== null && _m_ !== void 0 ? _m_ : null; } /** Extract first integer from text (for referral days, etc.) */ function extractNumber(body) { if (!body) return null; const m = body.match(/(\d+)/); var _m_; return (_m_ = m === null || m === void 0 ? void 0 : m[1]) !== null && _m_ !== void 0 ? _m_ : null; } export default function NotificationsPage() { const { data: session, isPending } = useSession(); const router = useRouter(); const { t, locale } = useLocale(); const [notifications, setNotifications] = useState([]); const [loading, setLoading] = useState(true); useEffect(()=>{ if (!isPending && !session) router.push('/login'); }, [ session, isPending ]); useEffect(()=>{ if (!session) return; getNotifications().then(setNotifications).catch(()=>{}).finally(()=>setLoading(false)); }, [ session ]); async function handleMarkAll() { await markAllRead(); setNotifications((prev)=>prev.map((n)=>({ ...n, isRead: true }))); } async function handleMark(id) { await markRead(id); setNotifications((prev)=>prev.map((n)=>n.id === id ? { ...n, isRead: true } : n)); } async function handleDismiss(e, id) { e.stopPropagation(); await dismissNotification(id).catch(()=>{}); setNotifications((prev)=>prev.filter((n)=>n.id !== id)); } if (isPending || loading) return /*#__PURE__*/ _jsx("div", { className: "text-center py-20 text-white", children: t('common.loading') }); function relativeTime(dateStr) { const diff = Date.now() - new Date(dateStr).getTime(); const sec = Math.floor(diff / 1000); const min = Math.floor(sec / 60); const hrs = Math.floor(min / 60); const days = Math.floor(hrs / 24); if (locale === 'ru') { if (sec < 60) return 'тПлькП чтП'; if (min < 60) return "".concat(min, " ЌОМ. МазаЎ"); if (hrs < 24) return "".concat(hrs, " ч. МазаЎ"); if (days === 1) return 'вчера'; if (days < 7) return "".concat(days, " ЎМ. МазаЎ"); } else if (locale === 'uk') { if (sec < 60) return 'щПйМП'; if (min < 60) return "".concat(min, " хв. тПЌу"); if (hrs < 24) return "".concat(hrs, " гПЎ. тПЌу"); if (days === 1) return 'вчПра'; if (days < 7) return "".concat(days, " ЎМ. тПЌу"); } else if (locale === 'en') { if (sec < 60) return 'just now'; if (min < 60) return "".concat(min, "m ago"); if (hrs < 24) return "".concat(hrs, "h ago"); if (days === 1) return 'yesterday'; if (days < 7) return "".concat(days, "d ago"); } else { if (sec < 60) return 'Όόλις τώρα'; if (min < 60) return "".concat(min, " λ. πριΜ"); if (hrs < 24) return "".concat(hrs, " ω. πριΜ"); if (days === 1) return 'χΞες'; if (days < 7) return "".concat(days, " ÎŒ. πριΜ"); } return new Date(dateStr).toLocaleDateString(dateLocale, { day: 'numeric', month: 'short', year: days > 365 ? 'numeric' : undefined }); } const unreadCount = notifications.filter((n)=>!n.isRead).length; const dateLocale = locale === 'ru' ? 'ru-RU' : locale === 'uk' ? 'uk-UA' : locale === 'en' ? 'en-US' : 'el-GR'; return /*#__PURE__*/ _jsxs("div", { className: "max-w-2xl mx-auto px-4 py-8", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex justify-between items-center mb-6", children: [ /*#__PURE__*/ _jsxs("h1", { className: "text-2xl font-bold text-white", children: [ t('notif.title'), " ", unreadCount > 0 && /*#__PURE__*/ _jsxs("span", { className: "text-white/70 font-normal text-xl", children: [ "(", unreadCount, ")" ] }) ] }), unreadCount > 0 && /*#__PURE__*/ _jsx("button", { onClick: handleMarkAll, className: "text-sm text-white/80 hover:text-white hover:underline transition", children: t('notif.mark_all') }) ] }), notifications.length === 0 ? /*#__PURE__*/ _jsx("div", { className: "text-center py-20 text-white/60", children: t('notif.empty') }) : /*#__PURE__*/ _jsx("div", { className: "space-y-2", children: notifications.map((n)=>{ const link = n.type === 'referral_reward' ? '/profile?tab=referral' : n.referenceId ? n.type === 'new_message' ? "/chat?room=".concat(n.referenceId) : "/tasks/".concat(n.referenceId) : null; const handleClick = async ()=>{ if (!n.isRead) await handleMark(n.id); if (link) router.push(link); }; var _typeColor_n_type; return /*#__PURE__*/ _jsxs("div", { onClick: handleClick, className: "flex items-start gap-3 p-4 rounded-xl border transition ".concat(link ? 'cursor-pointer' : 'cursor-default', " ").concat(n.isRead ? 'bg-white/90 border-white/20 hover:bg-white' : 'bg-white border-green-300 shadow-sm hover:bg-green-50'), children: [ /*#__PURE__*/ _jsx("div", { className: "p-2.5 rounded-xl flex-shrink-0 ".concat((_typeColor_n_type = typeColor[n.type]) !== null && _typeColor_n_type !== void 0 ? _typeColor_n_type : 'bg-gray-100 text-gray-500'), children: /*#__PURE__*/ _jsx(NotifIcon, { type: n.type }) }), /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ _jsx("p", { className: "font-medium ".concat(n.isRead ? 'text-gray-600' : 'text-gray-900'), children: t("notif.type.".concat(n.type), t('notif.type.generic', 'Notification')) }), n.body && /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-500 mt-0.5 truncate", children: (()=>{ if (n.type === 'new_message') return n.body; if (n.type === 'new_review') { const rating = extractRating(n.body); const tpl = t("notif.body.new_review", ''); return rating && tpl ? tpl.replace('{rating}', rating) : n.body; } if (n.type === 'referral_reward') { const days = extractNumber(n.body); const plan = extractParam(n.body); const tpl = t('notif.body.referral_reward', ''); if (tpl && days && plan) return tpl.replace('{days}', days).replace('{plan}', plan); return tpl || n.body; } const title = extractParam(n.body); const tpl = t("notif.body.".concat(n.type), ''); if (tpl && title) return tpl.replace('{title}', title); return tpl || n.body; })() }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-1", children: relativeTime(n.createdAt) }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex flex-col items-end gap-2 shrink-0", onClick: (e)=>e.stopPropagation(), children: [ /*#__PURE__*/ _jsx("button", { onClick: (e)=>handleDismiss(e, n.id), className: "p-1 rounded-md text-gray-300 hover:text-red-400 hover:bg-red-50 transition", title: t('common.delete', 'Delete'), children: /*#__PURE__*/ _jsxs("svg", { className: "w-4 h-4", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", children: [ /*#__PURE__*/ _jsx("line", { x1: "18", y1: "6", x2: "6", y2: "18" }), /*#__PURE__*/ _jsx("line", { x1: "6", y1: "6", x2: "18", y2: "18" }) ] }) }), /*#__PURE__*/ _jsx("div", { className: "flex items-center gap-1.5", children: !n.isRead && /*#__PURE__*/ _jsx("span", { className: "w-2 h-2 bg-green-500 rounded-full" }) }) ] }) ] }, n.id); }) }) ] }); } )61123undefined125168undefined170213undefined215254undefined256300undefined302390undefined550554(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined880883(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined11241127(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined13301334(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined16601663(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined18351838(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined20262030(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined23562359(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined25312534(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined27372740(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined30063009(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined33133316(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined34763480(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined38063809(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined39923995(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined41994202(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined44704473(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined47774780(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined49694972(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined52765279(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined55155519(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined58455848(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined60146017(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined63386342(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined66686671(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined68126815(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined84498463undefined85368545(0,_lib_auth__WEBPACK_IMPORTED_MODULE_3__/* .useSession */ .wV)undefined85698577(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)undefined86088616(0,_context_locale__WEBPACK_IMPORTED_MODULE_4__/* .useLocale */ .Y)undefined86678674(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined87158722(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined87358743(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined88668874(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined89208935(0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getNotifications */ .Tr)undefined90929102(0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .markAllRead */ .NL)undefined92949301(0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .markRead */ .Ip)undefined95469564(0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .dismissNotification */ .yk)undefined97079710(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1172411728(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1183511839(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1198111985(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1223912243(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1267712680(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1301213015(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1316213165(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1375313757(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1416514168(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1445214455(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1462814632(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1479814801(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1515315156(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1688216885(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1719817202(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1745917462(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1782417828(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1841218415(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1878618789(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1927619279(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1944719450(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefinedèé }, «webpack/lib/util/registerExternalSerializerœwebpack-sources/PrefixSource‰/******/ 2__webpack_require__ => { // webpackRuntimeModules èvar __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId)) __webpack_require__.O(0, [1516,9906,2982,587,18,7358], () => (__webpack_exec__(3854))); var __webpack_exports__ = __webpack_require__.O(); _N_E = __webpack_exports__; } ]); àþÿÿ3a(self["webpackChunk_N_E"] = self["webpackChunk_N_E"] || []).push([[6173],{ /***/ 1592: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ CI: () => (/* binding */ signOut), /* harmony export */ Hh: () => (/* binding */ signUp), /* harmony export */ Jv: () => (/* binding */ signIn), /* harmony export */ wV: () => (/* binding */ useSession), /* harmony export */ yK: () => (/* binding */ authClient) /* harmony export */ }); /* harmony import */ var better_auth_react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6504); const API_URL = "https://api.canhelp.gr" || 0; const authClient = (0,better_auth_react__WEBPACK_IMPORTED_MODULE_0__/* .createAuthClient */ .M)({ baseURL: API_URL }); const { signIn, signOut, signUp, useSession } = authClient; /***/ }), /***/ 3854: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 8666)); /***/ }), /***/ 8666: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ NotificationsPage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7541); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(1592); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(9906); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(2982); /* __next_internal_client_entry_do_not_use__ default auto */ function NotifIcon(param) { let { type } = param; const cls = 'w-5 h-5'; switch(type){ case 'new_offer': return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: cls, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("rect", { x: "2", y: "7", width: "20", height: "14", rx: "2" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M16 21V5a2 2 0 00-2-2h-4a2 2 0 00-2 2v16" }) ] }); case 'offer_accepted': return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: cls, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("circle", { cx: "12", cy: "12", r: "10" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("polyline", { points: "9 12 11 14 15 10" }) ] }); case 'offer_declined': return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: cls, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("circle", { cx: "12", cy: "12", r: "10" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: "15", y1: "9", x2: "9", y2: "15" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: "9", y1: "9", x2: "15", y2: "15" }) ] }); case 'task_completed': return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: cls, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("polyline", { points: "20 6 9 17 4 12" }) }); case 'task_cancelled': return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: cls, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: "12", y1: "9", x2: "12", y2: "13" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: "12", y1: "17", x2: "12.01", y2: "17" }) ] }); case 'new_message': return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: cls, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M21 15a2 2 0 01-2 2H7l-4 4V5a2 2 0 012-2h14a2 2 0 012 2z" }) }); case 'new_review': return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: cls, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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" }) }); case 'task_invite': return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: cls, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M16 4h2a2 2 0 012 2v14a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2h2" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("rect", { x: "8", y: "2", width: "8", height: "4", rx: "1", ry: "1" }) ] }); default: return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: cls, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M18 8A6 6 0 006 8c0 7-3 9-3 9h18s-3-2-3-9" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M13.73 21a2 2 0 01-3.46 0" }) ] }); } } const typeColor = { new_offer: 'bg-green-100 text-green-600', offer_accepted: 'bg-green-100 text-green-600', offer_declined: 'bg-red-100 text-red-600', task_completed: 'bg-emerald-100 text-emerald-600', task_cancelled: 'bg-amber-100 text-amber-600', new_message: 'bg-purple-100 text-purple-600', new_review: 'bg-yellow-100 text-yellow-600', task_invite: 'bg-indigo-100 text-indigo-600', referral_reward: 'bg-cyan-100 text-cyan-700', specialist_card_submitted: 'bg-amber-100 text-amber-700', specialist_card_approved: 'bg-green-100 text-green-700', specialist_card_rejected: 'bg-rose-100 text-rose-700' }; /** Extract the quoted task title from a stored body string (any locale) */ function extractParam(body) { if (!body) return null; const m = body.match(/[«""](.+?)[»""]/); var _m_; return (_m_ = m === null || m === void 0 ? void 0 : m[1]) !== null && _m_ !== void 0 ? _m_ : null; } /** Extract rating number from a stored review body */ function extractRating(body) { if (!body) return null; const m = body.match(/(\d+)\s*[★\*]/); var _m_; return (_m_ = m === null || m === void 0 ? void 0 : m[1]) !== null && _m_ !== void 0 ? _m_ : null; } /** Extract first integer from text (for referral days, etc.) */ function extractNumber(body) { if (!body) return null; const m = body.match(/(\d+)/); var _m_; return (_m_ = m === null || m === void 0 ? void 0 : m[1]) !== null && _m_ !== void 0 ? _m_ : null; } function NotificationsPage() { const { data: session, isPending } = (0,_lib_auth__WEBPACK_IMPORTED_MODULE_3__/* .useSession */ .wV)(); const router = (0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)(); const { t, locale } = (0,_context_locale__WEBPACK_IMPORTED_MODULE_4__/* .useLocale */ .Y)(); const [notifications, setNotifications] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [loading, setLoading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(true); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!isPending && !session) router.push('/login'); }, [ session, isPending ]); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!session) return; (0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getNotifications */ .Tr)().then(setNotifications).catch(()=>{}).finally(()=>setLoading(false)); }, [ session ]); async function handleMarkAll() { await (0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .markAllRead */ .NL)(); setNotifications((prev)=>prev.map((n)=>({ ...n, isRead: true }))); } async function handleMark(id) { await (0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .markRead */ .Ip)(id); setNotifications((prev)=>prev.map((n)=>n.id === id ? { ...n, isRead: true } : n)); } async function handleDismiss(e, id) { e.stopPropagation(); await (0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .dismissNotification */ .yk)(id).catch(()=>{}); setNotifications((prev)=>prev.filter((n)=>n.id !== id)); } if (isPending || loading) return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-center py-20 text-white", children: t('common.loading') }); function relativeTime(dateStr) { const diff = Date.now() - new Date(dateStr).getTime(); const sec = Math.floor(diff / 1000); const min = Math.floor(sec / 60); const hrs = Math.floor(min / 60); const days = Math.floor(hrs / 24); if (locale === 'ru') { if (sec < 60) return 'тПлькП чтП'; if (min < 60) return "".concat(min, " ЌОМ. МазаЎ"); if (hrs < 24) return "".concat(hrs, " ч. МазаЎ"); if (days === 1) return 'вчера'; if (days < 7) return "".concat(days, " ЎМ. МазаЎ"); } else if (locale === 'uk') { if (sec < 60) return 'щПйМП'; if (min < 60) return "".concat(min, " хв. тПЌу"); if (hrs < 24) return "".concat(hrs, " гПЎ. тПЌу"); if (days === 1) return 'вчПра'; if (days < 7) return "".concat(days, " ЎМ. тПЌу"); } else if (locale === 'en') { if (sec < 60) return 'just now'; if (min < 60) return "".concat(min, "m ago"); if (hrs < 24) return "".concat(hrs, "h ago"); if (days === 1) return 'yesterday'; if (days < 7) return "".concat(days, "d ago"); } else { if (sec < 60) return 'Όόλις τώρα'; if (min < 60) return "".concat(min, " λ. πριΜ"); if (hrs < 24) return "".concat(hrs, " ω. πριΜ"); if (days === 1) return 'χΞες'; if (days < 7) return "".concat(days, " ÎŒ. πριΜ"); } return new Date(dateStr).toLocaleDateString(dateLocale, { day: 'numeric', month: 'short', year: days > 365 ? 'numeric' : undefined }); } const unreadCount = notifications.filter((n)=>!n.isRead).length; const dateLocale = locale === 'ru' ? 'ru-RU' : locale === 'uk' ? 'uk-UA' : locale === 'en' ? 'en-US' : 'el-GR'; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "max-w-2xl mx-auto px-4 py-8", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex justify-between items-center mb-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("h1", { className: "text-2xl font-bold text-white", children: [ t('notif.title'), " ", unreadCount > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "text-white/70 font-normal text-xl", children: [ "(", unreadCount, ")" ] }) ] }), unreadCount > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: handleMarkAll, className: "text-sm text-white/80 hover:text-white hover:underline transition", children: t('notif.mark_all') }) ] }), notifications.length === 0 ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-center py-20 text-white/60", children: t('notif.empty') }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "space-y-2", children: notifications.map((n)=>{ const link = n.type === 'referral_reward' ? '/profile?tab=referral' : n.referenceId ? n.type === 'new_message' ? "/chat?room=".concat(n.referenceId) : "/tasks/".concat(n.referenceId) : null; const handleClick = async ()=>{ if (!n.isRead) await handleMark(n.id); if (link) router.push(link); }; var _typeColor_n_type; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { onClick: handleClick, className: "flex items-start gap-3 p-4 rounded-xl border transition ".concat(link ? 'cursor-pointer' : 'cursor-default', " ").concat(n.isRead ? 'bg-white/90 border-white/20 hover:bg-white' : 'bg-white border-green-300 shadow-sm hover:bg-green-50'), children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "p-2.5 rounded-xl flex-shrink-0 ".concat((_typeColor_n_type = typeColor[n.type]) !== null && _typeColor_n_type !== void 0 ? _typeColor_n_type : 'bg-gray-100 text-gray-500'), children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(NotifIcon, { type: n.type }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "font-medium ".concat(n.isRead ? 'text-gray-600' : 'text-gray-900'), children: t("notif.type.".concat(n.type), t('notif.type.generic', 'Notification')) }), n.body && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-gray-500 mt-0.5 truncate", children: (()=>{ if (n.type === 'new_message') return n.body; if (n.type === 'new_review') { const rating = extractRating(n.body); const tpl = t("notif.body.new_review", ''); return rating && tpl ? tpl.replace('{rating}', rating) : n.body; } if (n.type === 'referral_reward') { const days = extractNumber(n.body); const plan = extractParam(n.body); const tpl = t('notif.body.referral_reward', ''); if (tpl && days && plan) return tpl.replace('{days}', days).replace('{plan}', plan); return tpl || n.body; } const title = extractParam(n.body); const tpl = t("notif.body.".concat(n.type), ''); if (tpl && title) return tpl.replace('{title}', title); return tpl || n.body; })() }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400 mt-1", children: relativeTime(n.createdAt) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex flex-col items-end gap-2 shrink-0", onClick: (e)=>e.stopPropagation(), children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: (e)=>handleDismiss(e, n.id), className: "p-1 rounded-md text-gray-300 hover:text-red-400 hover:bg-red-50 transition", title: t('common.delete', 'Delete'), children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-4 h-4", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: "18", y1: "6", x2: "6", y2: "18" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: "6", y1: "6", x2: "18", y2: "18" }) ] }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex items-center gap-1.5", children: !n.isRead && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "w-2 h-2 bg-green-500 rounded-full" }) }) ] }) ] }, n.id); }) }) ] }); } /***/ }) }, /******/ __webpack_require__ => { // webpackRuntimeModules /******/ var __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId)) /******/ __webpack_require__.O(0, [1516,9906,2982,587,18,7358], () => (__webpack_exec__(3854))); /******/ var __webpack_exports__ = __webpack_require__.O(); /******/ _N_E = __webpack_exports__; /******/ } ]); „äþÿÿ `)åþÿÿX(self["webpackChunk_N_E"] = self["webpackChunk_N_E"] || []).push([[6173],{ /***/ 1592: äþÿÿ…äþÿÿæþÿÿ‘’‰Š‰, /***/ 3854: ãþÿÿ“åþÿÿ[import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/notifications/page.tsx"); k088Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 8666))undefined†‡†, /***/ 8666: àþÿÿàþÿÿüþÿÿâþÿÿgÁÿÿýþÿÿ…†…ÎàÐ…èvar __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId)) __webpack_require__.O(0, [1516,9906,2982,587,18,7358], () => (__webpack_exec__(3854))); var __webpack_exports__ = __webpack_require__.O(); „ÑÒÓ îi«webpack/lib/util/registerExternalSerializerœwebpack-sources/ConcatSource€` «webpack/lib/util/registerExternalSerializer™webpack-sources/RawSourceW(self["webpackChunk_N_E"] = self["webpackChunk_N_E"] || []).push([[6907],{ /***/ 160: «webpack/lib/util/registerExternalSerializerœwebpack-sources/CachedSource [«webpack/lib/util/registerExternalSerializerœwebpack-sources/ConcatSource€«webpack/lib/util/registerExternalSerializer™webpack-sources/RawSourceV/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { «webpack/lib/util/registerExternalSerializerœwebpack-sources/CachedSource V«webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSource«webpack/lib/util/registerExternalSerializer™webpack-sources/RawSourceUimport(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/pricing/page.tsx"); `RßPromise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 8880))€†buffer†source„size„maps„hashaPromise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 8880)); €”{"finalSource":true}ƒmap‹bufferedMap ReplaceSourceRawSourceUimport(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/pricing/page.tsx"); k082Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 8880))undefined /***/ }) €†buffer†source„size„maps„hashÁ/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 8880)); /***/ }) €”{"finalSource":true}ƒmap‹bufferedMap ConcatSourceRawSourceV/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { ReplaceSourceRawSourceUimport(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/pricing/page.tsx"); k082Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 8880))undefined RawSource /***/ }), /***/ 1592:  ú «webpack/lib/util/registerExternalSerializerœwebpack-sources/ConcatSource€«webpack/lib/util/registerExternalSerializer™webpack-sources/RawSource_/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; «webpack/lib/util/registerExternalSerializerœwebpack-sources/CachedSource w«webpack/lib/util/registerExternalSerializerœwebpack-sources/ConcatSource€«webpack/lib/util/registerExternalSerializer™webpack-sources/RawSourceå/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ CI: () => (/* binding */ signOut), /* harmony export */ Hh: () => (/* binding */ signUp), /* harmony export */ Jv: () => (/* binding */ signIn), /* harmony export */ wV: () => (/* binding */ useSession), /* harmony export */ yK: () => (/* binding */ authClient) /* harmony export */ }); /* harmony import */ var better_auth_react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6504); «webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSource import { createAuthClient } from 'better-auth/react'; const API_URL = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; export const authClient = createAuthClient({ baseURL: API_URL }); export const { signIn, signOut, signUp, useSession } = authClient; d4FdiE‚ˆœ«È΀˜"https://api.canhelp.gr"0€Ì(0,better_auth_react__WEBPACK_IMPORTED_MODULE_0__/* .createAuthClient */ .M)€€†buffer†source„size„maps„hashÌ/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ CI: () => (/* binding */ signOut), /* harmony export */ Hh: () => (/* binding */ signUp), /* harmony export */ Jv: () => (/* binding */ signIn), /* harmony export */ wV: () => (/* binding */ useSession), /* harmony export */ yK: () => (/* binding */ authClient) /* harmony export */ }); /* harmony import */ var better_auth_react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6504); const API_URL = "https://api.canhelp.gr" || 0; const authClient = (0,better_auth_react__WEBPACK_IMPORTED_MODULE_0__/* .createAuthClient */ .M)({ baseURL: API_URL }); const { signIn, signOut, signUp, useSession } = authClient; €”{"finalSource":true}ƒmap‹bufferedMap ConcatSourceRawSourceå/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ CI: () => (/* binding */ signOut), /* harmony export */ Hh: () => (/* binding */ signUp), /* harmony export */ Jv: () => (/* binding */ signIn), /* harmony export */ wV: () => (/* binding */ useSession), /* harmony export */ yK: () => (/* binding */ authClient) /* harmony export */ }); /* harmony import */ var better_auth_react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6504); ReplaceSourceRawSource import { createAuthClient } from 'better-auth/react'; const API_URL = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; export const authClient = createAuthClient({ baseURL: API_URL }); export const { signIn, signOut, signUp, useSession } = authClient; »052undefined70100"https://api.canhelp.gr"undefined1051270undefined130136undefined156171(0,better_auth_react__WEBPACK_IMPORTED_MODULE_0__/* .createAuthClient */ .M)undefined200206undefined /***/ }) ì5/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ CI: () => (/* binding */ signOut), /* harmony export */ Hh: () => (/* binding */ signUp), /* harmony export */ Jv: () => (/* binding */ signIn), /* harmony export */ wV: () => (/* binding */ useSession), /* harmony export */ yK: () => (/* binding */ authClient) /* harmony export */ }); /* harmony import */ var better_auth_react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6504); const API_URL = "https://api.canhelp.gr" || 0; const authClient = (0,better_auth_react__WEBPACK_IMPORTED_MODULE_0__/* .createAuthClient */ .M)({ baseURL: API_URL }); const { signIn, signOut, signUp, useSession } = authClient; /***/ }) íð  ñ_/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; ðå/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ CI: () => (/* binding */ signOut), /* harmony export */ Hh: () => (/* binding */ signUp), /* harmony export */ Jv: () => (/* binding */ signIn), /* harmony export */ wV: () => (/* binding */ useSession), /* harmony export */ yK: () => (/* binding */ authClient) /* harmony export */ }); /* harmony import */ var better_auth_react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6504); ñ import { createAuthClient } from 'better-auth/react'; const API_URL = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; export const authClient = createAuthClient({ baseURL: API_URL }); export const { signIn, signOut, signUp, useSession } = authClient; »052undefined70100"https://api.canhelp.gr"undefined1051270undefined130136undefined156171(0,better_auth_react__WEBPACK_IMPORTED_MODULE_0__/* .createAuthClient */ .M)undefined200206undefinedòó, /***/ 2035:  R?«webpack/lib/util/registerExternalSerializerœwebpack-sources/ConcatSource€«webpack/lib/util/registerExternalSerializer™webpack-sources/RawSource_/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; «webpack/lib/util/registerExternalSerializerœwebpack-sources/CachedSource A«webpack/lib/util/registerExternalSerializerœwebpack-sources/ConcatSource€«webpack/lib/util/registerExternalSerializer™webpack-sources/RawSourceú/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ d: () => (/* binding */ PlanBadge) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); «webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourceimport { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; const tierConfig = { free: { label: 'Free', class: 'bg-gray-100 text-gray-500 border border-gray-200', icon: '' }, pro: { label: 'Pro', class: 'bg-green-100 text-green-700 border border-green-200', icon: /*#__PURE__*/ _jsx("svg", { viewBox: "0 0 16 16", fill: "none", className: "w-3 h-3 inline-block mr-0.5 -mt-px", children: /*#__PURE__*/ _jsx("path", { d: "M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z", fill: "currentColor" }) }) }, ultimate: { label: 'Ultimate', class: 'bg-gradient-to-r from-amber-400 via-yellow-400 to-amber-400 text-gray-900 border border-amber-500 shadow-sm shadow-amber-300/50', icon: /*#__PURE__*/ _jsx("svg", { viewBox: "0 0 16 16", fill: "none", className: "w-3 h-3 inline-block mr-0.5 -mt-px", children: /*#__PURE__*/ _jsx("path", { d: "M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z", fill: "currentColor" }) }) } }; export function PlanBadge(param) { let { tier, verified, size = 'sm', className = '' } = param; if (tier === 'free' && !verified) return null; const sizeClass = size === 'sm' ? 'text-[10px] px-1.5 py-0.5' : 'text-xs px-2 py-0.5'; if (verified && tier !== 'free') { return /*#__PURE__*/ _jsxs("span", { className: "inline-flex items-center gap-1 rounded-full font-semibold ".concat(sizeClass, " ").concat(tierConfig[tier].class, " ").concat(className), children: [ tier === 'ultimate' ? /*#__PURE__*/ _jsx(StarIcon, { className: "w-3 h-3 fill-gray-900" }) : /*#__PURE__*/ _jsx(VerifiedIcon, { className: "w-3 h-3" }), tierConfig[tier].label ] }); } if (verified) { return /*#__PURE__*/ _jsx("span", { className: "inline-flex items-center gap-0.5 rounded-full font-semibold ".concat(sizeClass, " bg-green-100 text-green-700 border border-green-200 ").concat(className), children: /*#__PURE__*/ _jsx(VerifiedIcon, { className: "w-3 h-3" }) }); } const cfg = tierConfig[tier]; return /*#__PURE__*/ _jsxs("span", { className: "inline-flex items-center rounded-full font-semibold ".concat(sizeClass, " ").concat(cfg.class, " ").concat(className), children: [ tier === 'pro' && /*#__PURE__*/ _jsx(StarIcon, { className: "w-3 h-3 mr-0.5 -mt-px" }), tier === 'ultimate' && /*#__PURE__*/ _jsx(StarIcon, { className: "w-3 h-3 mr-0.5 -mt-px fill-gray-900" }), cfg.label ] }); } function StarIcon(param) { let { className = '' } = param; return /*#__PURE__*/ _jsx("svg", { viewBox: "0 0 16 16", fill: "none", className: className, children: /*#__PURE__*/ _jsx("path", { d: "M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z", fill: "currentColor" }) }); } function VerifiedIcon(param) { let { className = '' } = param; return /*#__PURE__*/ _jsxs("svg", { viewBox: "0 0 16 16", fill: "none", className: className, children: [ /*#__PURE__*/ _jsx("path", { d: "M8 1l2 1.4 2.4-.4 1 2.2 2 1.2-.4 2.4L16 10l-1.8 1.6.4 2.4-2.2.8L10.8 17 8 16.2 5.2 17l-1.2-2.2-2.2-.8.4-2.4L0 10l1-2.2-.4-2.4 2-1.2 1-2.2 2.4.4L8 1z", fill: "#3B82F6" }), /*#__PURE__*/ _jsx("path", { d: "M5.5 8.5l1.5 1.5 3-3", stroke: "white", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) ] }); } b>_VYŽ‘9<ïõ%)#&Ž‘X[? B Õ Ù ° ³ 5 8   ™ œ • ™ C$'(+€¶(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)ÿÿÿ€·(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)þþþþÿþþþþÿþþ€†buffer†source„size„maps„hash /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ d: () => (/* binding */ PlanBadge) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); const tierConfig = { free: { label: 'Free', class: 'bg-gray-100 text-gray-500 border border-gray-200', icon: '' }, pro: { label: 'Pro', class: 'bg-green-100 text-green-700 border border-green-200', icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { viewBox: "0 0 16 16", fill: "none", className: "w-3 h-3 inline-block mr-0.5 -mt-px", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z", fill: "currentColor" }) }) }, ultimate: { label: 'Ultimate', class: 'bg-gradient-to-r from-amber-400 via-yellow-400 to-amber-400 text-gray-900 border border-amber-500 shadow-sm shadow-amber-300/50', icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { viewBox: "0 0 16 16", fill: "none", className: "w-3 h-3 inline-block mr-0.5 -mt-px", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z", fill: "currentColor" }) }) } }; function PlanBadge(param) { let { tier, verified, size = 'sm', className = '' } = param; if (tier === 'free' && !verified) return null; const sizeClass = size === 'sm' ? 'text-[10px] px-1.5 py-0.5' : 'text-xs px-2 py-0.5'; if (verified && tier !== 'free') { return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "inline-flex items-center gap-1 rounded-full font-semibold ".concat(sizeClass, " ").concat(tierConfig[tier].class, " ").concat(className), children: [ tier === 'ultimate' ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(StarIcon, { className: "w-3 h-3 fill-gray-900" }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(VerifiedIcon, { className: "w-3 h-3" }), tierConfig[tier].label ] }); } if (verified) { return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "inline-flex items-center gap-0.5 rounded-full font-semibold ".concat(sizeClass, " bg-green-100 text-green-700 border border-green-200 ").concat(className), children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(VerifiedIcon, { className: "w-3 h-3" }) }); } const cfg = tierConfig[tier]; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "inline-flex items-center rounded-full font-semibold ".concat(sizeClass, " ").concat(cfg.class, " ").concat(className), children: [ tier === 'pro' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(StarIcon, { className: "w-3 h-3 mr-0.5 -mt-px" }), tier === 'ultimate' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(StarIcon, { className: "w-3 h-3 mr-0.5 -mt-px fill-gray-900" }), cfg.label ] }); } function StarIcon(param) { let { className = '' } = param; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { viewBox: "0 0 16 16", fill: "none", className: className, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z", fill: "currentColor" }) }); } function VerifiedIcon(param) { let { className = '' } = param; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { viewBox: "0 0 16 16", fill: "none", className: className, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M8 1l2 1.4 2.4-.4 1 2.2 2 1.2-.4 2.4L16 10l-1.8 1.6.4 2.4-2.2.8L10.8 17 8 16.2 5.2 17l-1.2-2.2-2.2-.8.4-2.4L0 10l1-2.2-.4-2.4 2-1.2 1-2.2 2.4.4L8 1z", fill: "#3B82F6" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M5.5 8.5l1.5 1.5 3-3", stroke: "white", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) ] }); } €”{"finalSource":true}ƒmap‹bufferedMap ConcatSourceRawSourceú/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ d: () => (/* binding */ PlanBadge) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); ReplaceSourceRawSourceimport { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; const tierConfig = { free: { label: 'Free', class: 'bg-gray-100 text-gray-500 border border-gray-200', icon: '' }, pro: { label: 'Pro', class: 'bg-green-100 text-green-700 border border-green-200', icon: /*#__PURE__*/ _jsx("svg", { viewBox: "0 0 16 16", fill: "none", className: "w-3 h-3 inline-block mr-0.5 -mt-px", children: /*#__PURE__*/ _jsx("path", { d: "M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z", fill: "currentColor" }) }) }, ultimate: { label: 'Ultimate', class: 'bg-gradient-to-r from-amber-400 via-yellow-400 to-amber-400 text-gray-900 border border-amber-500 shadow-sm shadow-amber-300/50', icon: /*#__PURE__*/ _jsx("svg", { viewBox: "0 0 16 16", fill: "none", className: "w-3 h-3 inline-block mr-0.5 -mt-px", children: /*#__PURE__*/ _jsx("path", { d: "M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z", fill: "currentColor" }) }) } }; export function PlanBadge(param) { let { tier, verified, size = 'sm', className = '' } = param; if (tier === 'free' && !verified) return null; const sizeClass = size === 'sm' ? 'text-[10px] px-1.5 py-0.5' : 'text-xs px-2 py-0.5'; if (verified && tier !== 'free') { return /*#__PURE__*/ _jsxs("span", { className: "inline-flex items-center gap-1 rounded-full font-semibold ".concat(sizeClass, " ").concat(tierConfig[tier].class, " ").concat(className), children: [ tier === 'ultimate' ? /*#__PURE__*/ _jsx(StarIcon, { className: "w-3 h-3 fill-gray-900" }) : /*#__PURE__*/ _jsx(VerifiedIcon, { className: "w-3 h-3" }), tierConfig[tier].label ] }); } if (verified) { return /*#__PURE__*/ _jsx("span", { className: "inline-flex items-center gap-0.5 rounded-full font-semibold ".concat(sizeClass, " bg-green-100 text-green-700 border border-green-200 ").concat(className), children: /*#__PURE__*/ _jsx(VerifiedIcon, { className: "w-3 h-3" }) }); } const cfg = tierConfig[tier]; return /*#__PURE__*/ _jsxs("span", { className: "inline-flex items-center rounded-full font-semibold ".concat(sizeClass, " ").concat(cfg.class, " ").concat(className), children: [ tier === 'pro' && /*#__PURE__*/ _jsx(StarIcon, { className: "w-3 h-3 mr-0.5 -mt-px" }), tier === 'ultimate' && /*#__PURE__*/ _jsx(StarIcon, { className: "w-3 h-3 mr-0.5 -mt-px fill-gray-900" }), cfg.label ] }); } function StarIcon(param) { let { className = '' } = param; return /*#__PURE__*/ _jsx("svg", { viewBox: "0 0 16 16", fill: "none", className: className, children: /*#__PURE__*/ _jsx("path", { d: "M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z", fill: "currentColor" }) }); } function VerifiedIcon(param) { let { className = '' } = param; return /*#__PURE__*/ _jsxs("svg", { viewBox: "0 0 16 16", fill: "none", className: className, children: [ /*#__PURE__*/ _jsx("path", { d: "M8 1l2 1.4 2.4-.4 1 2.2 2 1.2-.4 2.4L16 10l-1.8 1.6.4 2.4-2.2.8L10.8 17 8 16.2 5.2 17l-1.2-2.2-2.2-.8.4-2.4L0 10l1-2.2-.4-2.4 2-1.2 1-2.2 2.4.4L8 1z", fill: "#3B82F6" }), /*#__PURE__*/ _jsx("path", { d: "M5.5 8.5l1.5 1.5 3-3", stroke: "white", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) ] }); } Ñ062undefined342345(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined513516(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined910913(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined10811084(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined12631269undefined15731577(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined18271830(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined19341937(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined21362139(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined23672370(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined25172521(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined27362739(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined28692872(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined30973100(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined32253228(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined34773481(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined36203623(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined38803883(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined /***/ }) à‰/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ d: () => (/* binding */ PlanBadge) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); const tierConfig = { free: { label: 'Free', class: 'bg-gray-100 text-gray-500 border border-gray-200', icon: '' }, pro: { label: 'Pro', class: 'bg-green-100 text-green-700 border border-green-200', icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { viewBox: "0 0 16 16", fill: "none", className: "w-3 h-3 inline-block mr-0.5 -mt-px", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z", fill: "currentColor" }) }) }, ultimate: { label: 'Ultimate', class: 'bg-gradient-to-r from-amber-400 via-yellow-400 to-amber-400 text-gray-900 border border-amber-500 shadow-sm shadow-amber-300/50', icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { viewBox: "0 0 16 16", fill: "none", className: "w-3 h-3 inline-block mr-0.5 -mt-px", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z", fill: "currentColor" }) }) } }; function PlanBadge(param) { let { tier, verified, size = 'sm', className = '' } = param; if (tier === 'free' && !verified) return null; const sizeClass = size === 'sm' ? 'text-[10px] px-1.5 py-0.5' : 'text-xs px-2 py-0.5'; if (verified && tier !== 'free') { return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "inline-flex items-center gap-1 rounded-full font-semibold ".concat(sizeClass, " ").concat(tierConfig[tier].class, " ").concat(className), children: [ tier === 'ultimate' ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(StarIcon, { className: "w-3 h-3 fill-gray-900" }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(VerifiedIcon, { className: "w-3 h-3" }), tierConfig[tier].label ] }); } if (verified) { return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "inline-flex items-center gap-0.5 rounded-full font-semibold ".concat(sizeClass, " bg-green-100 text-green-700 border border-green-200 ").concat(className), children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(VerifiedIcon, { className: "w-3 h-3" }) }); } const cfg = tierConfig[tier]; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "inline-flex items-center rounded-full font-semibold ".concat(sizeClass, " ").concat(cfg.class, " ").concat(className), children: [ tier === 'pro' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(StarIcon, { className: "w-3 h-3 mr-0.5 -mt-px" }), tier === 'ultimate' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(StarIcon, { className: "w-3 h-3 mr-0.5 -mt-px fill-gray-900" }), cfg.label ] }); } function StarIcon(param) { let { className = '' } = param; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { viewBox: "0 0 16 16", fill: "none", className: className, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z", fill: "currentColor" }) }); } function VerifiedIcon(param) { let { className = '' } = param; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { viewBox: "0 0 16 16", fill: "none", className: className, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M8 1l2 1.4 2.4-.4 1 2.2 2 1.2-.4 2.4L16 10l-1.8 1.6.4 2.4-2.2.8L10.8 17 8 16.2 5.2 17l-1.2-2.2-2.2-.8.4-2.4L0 10l1-2.2-.4-2.4 2-1.2 1-2.2 2.4.4L8 1z", fill: "#3B82F6" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M5.5 8.5l1.5 1.5 3-3", stroke: "white", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) ] }); } /***/ }) áä  åôåú/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ d: () => (/* binding */ PlanBadge) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); æimport { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; const tierConfig = { free: { label: 'Free', class: 'bg-gray-100 text-gray-500 border border-gray-200', icon: '' }, pro: { label: 'Pro', class: 'bg-green-100 text-green-700 border border-green-200', icon: /*#__PURE__*/ _jsx("svg", { viewBox: "0 0 16 16", fill: "none", className: "w-3 h-3 inline-block mr-0.5 -mt-px", children: /*#__PURE__*/ _jsx("path", { d: "M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z", fill: "currentColor" }) }) }, ultimate: { label: 'Ultimate', class: 'bg-gradient-to-r from-amber-400 via-yellow-400 to-amber-400 text-gray-900 border border-amber-500 shadow-sm shadow-amber-300/50', icon: /*#__PURE__*/ _jsx("svg", { viewBox: "0 0 16 16", fill: "none", className: "w-3 h-3 inline-block mr-0.5 -mt-px", children: /*#__PURE__*/ _jsx("path", { d: "M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z", fill: "currentColor" }) }) } }; export function PlanBadge(param) { let { tier, verified, size = 'sm', className = '' } = param; if (tier === 'free' && !verified) return null; const sizeClass = size === 'sm' ? 'text-[10px] px-1.5 py-0.5' : 'text-xs px-2 py-0.5'; if (verified && tier !== 'free') { return /*#__PURE__*/ _jsxs("span", { className: "inline-flex items-center gap-1 rounded-full font-semibold ".concat(sizeClass, " ").concat(tierConfig[tier].class, " ").concat(className), children: [ tier === 'ultimate' ? /*#__PURE__*/ _jsx(StarIcon, { className: "w-3 h-3 fill-gray-900" }) : /*#__PURE__*/ _jsx(VerifiedIcon, { className: "w-3 h-3" }), tierConfig[tier].label ] }); } if (verified) { return /*#__PURE__*/ _jsx("span", { className: "inline-flex items-center gap-0.5 rounded-full font-semibold ".concat(sizeClass, " bg-green-100 text-green-700 border border-green-200 ").concat(className), children: /*#__PURE__*/ _jsx(VerifiedIcon, { className: "w-3 h-3" }) }); } const cfg = tierConfig[tier]; return /*#__PURE__*/ _jsxs("span", { className: "inline-flex items-center rounded-full font-semibold ".concat(sizeClass, " ").concat(cfg.class, " ").concat(className), children: [ tier === 'pro' && /*#__PURE__*/ _jsx(StarIcon, { className: "w-3 h-3 mr-0.5 -mt-px" }), tier === 'ultimate' && /*#__PURE__*/ _jsx(StarIcon, { className: "w-3 h-3 mr-0.5 -mt-px fill-gray-900" }), cfg.label ] }); } function StarIcon(param) { let { className = '' } = param; return /*#__PURE__*/ _jsx("svg", { viewBox: "0 0 16 16", fill: "none", className: className, children: /*#__PURE__*/ _jsx("path", { d: "M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z", fill: "currentColor" }) }); } function VerifiedIcon(param) { let { className = '' } = param; return /*#__PURE__*/ _jsxs("svg", { viewBox: "0 0 16 16", fill: "none", className: className, children: [ /*#__PURE__*/ _jsx("path", { d: "M8 1l2 1.4 2.4-.4 1 2.2 2 1.2-.4 2.4L16 10l-1.8 1.6.4 2.4-2.2.8L10.8 17 8 16.2 5.2 17l-1.2-2.2-2.2-.8.4-2.4L0 10l1-2.2-.4-2.4 2-1.2 1-2.2 2.4.4L8 1z", fill: "#3B82F6" }), /*#__PURE__*/ _jsx("path", { d: "M5.5 8.5l1.5 1.5 3-3", stroke: "white", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) ] }); } Ñ062undefined342345(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined513516(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined910913(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined10811084(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined12631269undefined15731577(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined18271830(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined19341937(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined21362139(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined23672370(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined25172521(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined27362739(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined28692872(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined30973100(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined32253228(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined34773481(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined36203623(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined38803883(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefinedçè, /***/ 8880:  µ«webpack/lib/util/registerExternalSerializerœwebpack-sources/ConcatSource€«webpack/lib/util/registerExternalSerializer™webpack-sources/RawSource_/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; «webpack/lib/util/registerExternalSerializerœwebpack-sources/CachedSource ˇ«webpack/lib/util/registerExternalSerializerœwebpack-sources/ConcatSource€«webpack/lib/util/registerExternalSerializer™webpack-sources/RawSourced__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ PricingPage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(9664); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(next_link__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(7541); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(1592); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(9906); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(2982); /* harmony import */ var _components_PlanBadge__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(2035); «webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourceœz/* __next_internal_client_entry_do_not_use__ default auto */ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime"; import { useState, useEffect } from 'react'; import Link from 'next/link'; import { useRouter } from 'next/navigation'; import { useSession } from '@/lib/auth'; import { useLocale } from '@/context/locale'; import { getPlans, getMyDashboard, previewPlanChange, purchasePlan } from '@/lib/api'; import { PlanBadge } from '@/components/PlanBadge'; const FEATURE_ROWS = [ { key: 'maxMessagesPerDay', labelKey: 'pricing.feat.messages', format: (v)=>v === null ? '∞' : String(v) }, { key: 'maxOrdersPerDay', labelKey: 'pricing.feat.orders', format: (v)=>v === null ? '∞' : String(v) }, { key: 'canContactAll', labelKey: 'pricing.feat.contact_all' }, { key: 'canViewPhone', labelKey: 'pricing.feat.view_phone' }, { key: 'canShowContactInfo', labelKey: 'pricing.feat.show_contact' }, { key: 'hasFavorites', labelKey: 'pricing.feat.favorites' }, { key: 'hasVerifiedBadge', labelKey: 'pricing.feat.verified_badge' }, { key: 'hasGoogleCalendar', labelKey: 'pricing.feat.google_calendar' }, { key: 'hasPersonalSite', labelKey: 'pricing.feat.personal_site' }, { key: 'hasAutoResponse', labelKey: 'pricing.feat.auto_response' }, { key: 'hasAutoMatch', labelKey: 'pricing.feat.auto_match' }, { key: 'highlightedReviews', labelKey: 'pricing.feat.highlighted_reviews' }, { key: 'maxCards', labelKey: 'pricing.feat.cards', format: (v)=>v === null ? '∞' : String(v) }, { key: 'notifyNewTasks', labelKey: 'pricing.feat.notify_tasks' }, { key: 'canUploadVideo', labelKey: 'pricing.feat.video' } ]; function CheckIcon() { return /*#__PURE__*/ _jsx("svg", { viewBox: "0 0 20 20", fill: "currentColor", className: "w-5 h-5 text-green-500 mx-auto", children: /*#__PURE__*/ _jsx("path", { fillRule: "evenodd", d: "M16.704 4.153a.75.75 0 01.143 1.052l-8 10.5a.75.75 0 01-1.127.075l-4.5-4.5a.75.75 0 011.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 011.05-.143z", clipRule: "evenodd" }) }); } function XIcon() { return /*#__PURE__*/ _jsx("svg", { viewBox: "0 0 20 20", fill: "currentColor", className: "w-4 h-4 text-gray-300 mx-auto", children: /*#__PURE__*/ _jsx("path", { d: "M6.28 5.22a.75.75 0 00-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 101.06 1.06L10 11.06l3.72 3.72a.75.75 0 101.06-1.06L11.06 10l3.72-3.72a.75.75 0 00-1.06-1.06L10 8.94 6.28 5.22z" }) }); } const tierOrder = [ 'free', 'pro', 'ultimate' ]; const tierHeaderColors = { free: 'bg-gray-50 border-gray-200', pro: 'bg-green-50 border-green-200', ultimate: 'bg-gradient-to-br from-amber-50 to-yellow-50 border-amber-300' }; const tierPriceColors = { free: 'text-gray-700', pro: 'text-green-700', ultimate: 'text-amber-600' }; const tierBtnColors = { free: 'bg-gray-100 text-gray-700 hover:bg-gray-200', pro: 'bg-green-600 text-white hover:bg-green-700', ultimate: 'bg-gradient-to-r from-amber-500 to-yellow-500 text-white hover:from-amber-600 hover:to-yellow-600' }; export default function PricingPage() { const { data: session } = useSession(); const { t } = useLocale(); const router = useRouter(); const [plans, setPlans] = useState([]); const [currentPlanId, setCurrentPlanId] = useState(null); const [loading, setLoading] = useState(true); const [confirmPlan, setConfirmPlan] = useState(null); const [preview, setPreview] = useState(null); const [previewLoading, setPreviewLoading] = useState(false); const [purchasing, setPurchasing] = useState(false); // Fetch plans with abort to prevent stale race conditions useEffect(()=>{ let aborted = false; setLoading(true); getPlans().then((data)=>{ if (!aborted) setPlans(data.sort((a, b)=>tierOrder.indexOf(a.tier) - tierOrder.indexOf(b.tier))); }).catch(()=>{}).finally(()=>{ if (!aborted) setLoading(false); }); return ()=>{ aborted = true; }; }, []); const fetchCurrentPlan = ()=>{ if (!session) return; getMyDashboard().then((d)=>{ var _d_plan; var _d_plan_id; return setCurrentPlanId((_d_plan_id = (_d_plan = d.plan) === null || _d_plan === void 0 ? void 0 : _d_plan.id) !== null && _d_plan_id !== void 0 ? _d_plan_id : null); }).catch(()=>{}); }; useEffect(fetchCurrentPlan, [ session ]); // Refresh active plan when admin widget changes it useEffect(()=>{ const handler = ()=>fetchCurrentPlan(); window.addEventListener('canhelp:plan-changed', handler); document.addEventListener('visibilitychange', handler); return ()=>{ window.removeEventListener('canhelp:plan-changed', handler); document.removeEventListener('visibilitychange', handler); }; }, [ session ]); async function handleSelectPlan(plan) { if (!session) { router.push('/sign-in'); return; } setConfirmPlan(plan); setPreview(null); setPreviewLoading(true); try { const p = await previewPlanChange(plan.id); setPreview(p); } catch (e) { setConfirmPlan(null); } finally{ setPreviewLoading(false); } } async function handleConfirm() { if (!confirmPlan || !preview) return; setPurchasing(true); try { const result = await purchasePlan(confirmPlan.id, preview.canPayFromBalance); if (result.url && result.params) { const form = document.createElement('form'); form.method = 'POST'; form.action = result.url; Object.entries(result.params).forEach((param)=>{ let [k, v] = param; const inp = document.createElement('input'); inp.type = 'hidden'; inp.name = k; inp.value = v; form.appendChild(inp); }); document.body.appendChild(form); form.submit(); return; } setCurrentPlanId(confirmPlan.id); setConfirmPlan(null); setPreview(null); } catch (e) { // ignore } finally{ setPurchasing(false); } } const visibleFeatures = FEATURE_ROWS; return /*#__PURE__*/ _jsxs("main", { className: "min-h-screen py-12 px-4", children: [ /*#__PURE__*/ _jsxs("div", { className: "max-w-5xl mx-auto", children: [ /*#__PURE__*/ _jsxs("div", { className: "text-center mb-10", children: [ /*#__PURE__*/ _jsx("h1", { className: "text-4xl font-bold text-white mb-3", children: t('pricing.title', 'Pricing') }), /*#__PURE__*/ _jsx("p", { className: "text-white/70 text-lg", children: t('pricing.subtitle') }) ] }), loading ? /*#__PURE__*/ _jsx("div", { className: "text-center text-white/60 py-20", children: t('common.loading', 'Loading...') }) : /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx("div", { className: "grid grid-cols-1 md:grid-cols-3 gap-6 mb-12", children: plans.map((plan)=>{ const isCurrentPlan = plan.id === currentPlanId; const isFree = plan.tier === 'free'; return /*#__PURE__*/ _jsxs("div", { className: "rounded-2xl border-2 p-6 bg-white flex flex-col transition ".concat(isCurrentPlan ? 'ring-2 ring-green-500 ring-offset-2' : '', " ").concat(plan.tier === 'ultimate' ? 'border-amber-300 shadow-lg shadow-amber-100' : 'border-gray-200'), children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 mb-4", children: [ /*#__PURE__*/ _jsx(PlanBadge, { tier: plan.tier, size: "md" }), isCurrentPlan && /*#__PURE__*/ _jsx("span", { className: "text-xs font-medium text-green-600 bg-green-50 border border-green-200 px-2 py-0.5 rounded-full", children: t('pricing.current_plan', 'Your plan') }), plan.tier === 'pro' && !isCurrentPlan && /*#__PURE__*/ _jsx("span", { className: "text-xs font-medium text-green-600 bg-green-50 border border-green-100 px-2 py-0.5 rounded-full", children: t('pricing.popular', 'Popular') }) ] }), /*#__PURE__*/ _jsx("h2", { className: "text-xl font-bold text-gray-900 mb-1", children: plan.name }), /*#__PURE__*/ _jsx("p", { className: "text-gray-500 text-sm mb-4 min-h-[40px]", children: plan.description }), /*#__PURE__*/ _jsxs("div", { className: "text-3xl font-extrabold mb-1 ".concat(tierPriceColors[plan.tier]), children: [ isFree ? t('pricing.free', 'Free') : /*#__PURE__*/ _jsxs(_Fragment, { children: [ plan.oldPrice && /*#__PURE__*/ _jsxs("span", { className: "text-lg font-normal text-gray-400 line-through mr-2", children: [ "€", plan.oldPrice ] }), "€", plan.price ] }), !isFree && /*#__PURE__*/ _jsxs("span", { className: "text-base font-normal text-gray-400", children: [ "/", t('pricing.per_month', 'month') ] }) ] }), plan.durationDays && !isFree && /*#__PURE__*/ _jsxs("p", { className: "text-xs text-gray-400 mb-5", children: [ t('pricing.duration', 'Duration'), ": ", plan.durationDays, " ", t('pricing.days', 'days') ] }), isFree && /*#__PURE__*/ _jsx("div", { className: "mb-5" }), /*#__PURE__*/ _jsx("div", { className: "mt-auto", children: isCurrentPlan ? /*#__PURE__*/ _jsx("div", { className: "w-full py-2.5 text-center text-sm font-semibold text-green-700 bg-green-50 border border-green-200 rounded-xl", children: t('pricing.your_plan', 'Current plan') }) : isFree ? /*#__PURE__*/ _jsx("div", { className: "w-full py-2.5 text-center text-sm font-medium text-gray-400 bg-gray-50 border border-gray-200 rounded-xl", children: t('pricing.free_default', 'Default') }) : /*#__PURE__*/ _jsxs("button", { onClick: ()=>handleSelectPlan(plan), className: "block w-full py-2.5 text-center text-sm font-semibold rounded-xl transition ".concat(tierBtnColors[plan.tier]), children: [ t('pricing.choose', 'Choose'), " ", plan.name ] }) }) ] }, plan.id); }) }), /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-2xl border border-gray-200 overflow-hidden", children: [ /*#__PURE__*/ _jsx("div", { className: "px-6 py-4 border-b border-gray-100", children: /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-gray-900", children: t('pricing.compare', 'Feature comparison') }) }), /*#__PURE__*/ _jsx("div", { className: "overflow-x-auto", children: /*#__PURE__*/ _jsxs("table", { className: "w-full text-sm", children: [ /*#__PURE__*/ _jsx("thead", { children: /*#__PURE__*/ _jsxs("tr", { className: "border-b border-gray-100", children: [ /*#__PURE__*/ _jsx("th", { className: "text-left px-6 py-3 text-gray-500 font-medium w-1/2", children: t('pricing.feature', 'Feature') }), plans.map((plan)=>/*#__PURE__*/ _jsx("th", { className: "text-center px-4 py-3 font-medium text-gray-700", children: /*#__PURE__*/ _jsxs("div", { className: "flex flex-col items-center gap-1", children: [ /*#__PURE__*/ _jsx(PlanBadge, { tier: plan.tier, size: "sm" }), /*#__PURE__*/ _jsx("span", { className: "text-xs text-gray-400", children: plan.tier === 'free' ? t('pricing.free', 'Free') : "€".concat(plan.price) }) ] }) }, plan.id)) ] }) }), /*#__PURE__*/ _jsx("tbody", { children: visibleFeatures.map((param)=>{ let { key, labelKey, format } = param; return /*#__PURE__*/ _jsxs("tr", { className: "border-b border-gray-50 hover:bg-gray-50/50 transition", children: [ /*#__PURE__*/ _jsx("td", { className: "px-6 py-3 text-gray-600", children: t(labelKey, labelKey) }), plans.map((plan)=>{ const val = plan[key]; let cell; if (format) { cell = /*#__PURE__*/ _jsx("span", { className: "text-gray-700 font-medium", children: format(val) }); } else if (typeof val === 'boolean') { cell = val ? /*#__PURE__*/ _jsx(CheckIcon, {}) : /*#__PURE__*/ _jsx(XIcon, {}); } else { cell = /*#__PURE__*/ _jsx("span", { className: "text-gray-700", children: val === null ? '∞' : String(val !== null && val !== void 0 ? val : '—') }); } return /*#__PURE__*/ _jsx("td", { className: "text-center px-4 py-3", children: cell }, plan.id); }) ] }, key); }) }) ] }) }) ] }), /*#__PURE__*/ _jsx("p", { className: "text-center text-white/50 text-sm mt-8", children: t('pricing.faq_note', 'Payment is deducted from your CanHelp balance. Top up is available in Payments.') }) ] }) ] }), confirmPlan && /*#__PURE__*/ _jsx("div", { className: "fixed inset-0 z-50 flex items-center justify-center bg-black/50 px-4", children: /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-2xl shadow-2xl w-full max-w-md p-6", children: [ /*#__PURE__*/ _jsx("h2", { className: "text-lg font-bold text-gray-900 mb-4", children: t('pricing.confirm.title', 'Confirm plan selection') }), previewLoading ? /*#__PURE__*/ _jsx("div", { className: "py-10 text-center text-gray-400", children: t('common.loading', 'Loading...') }) : preview ? /*#__PURE__*/ _jsxs("div", { className: "space-y-3 text-sm text-gray-700", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex justify-between", children: [ /*#__PURE__*/ _jsx("span", { className: "text-gray-500", children: t('pricing.confirm.plan', 'Plan') }), /*#__PURE__*/ _jsx("span", { className: "font-semibold", children: confirmPlan.name }) ] }), preview.type === 'upgrade' && Number(preview.prorated) > 0 && /*#__PURE__*/ _jsxs("div", { className: "flex justify-between", children: [ /*#__PURE__*/ _jsx("span", { className: "text-gray-500", children: t('pricing.confirm.prorated', 'Prorated credit') }), /*#__PURE__*/ _jsxs("span", { className: "text-green-600 font-medium", children: [ "−€", preview.prorated ] }) ] }), preview.type !== 'downgrade' && /*#__PURE__*/ _jsxs("div", { className: "flex justify-between", children: [ /*#__PURE__*/ _jsx("span", { className: "text-gray-500", children: t('pricing.confirm.effective_price', 'To pay') }), /*#__PURE__*/ _jsxs("span", { className: "font-bold text-gray-900", children: [ "€", preview.effectivePrice ] }) ] }), preview.type !== 'downgrade' && /*#__PURE__*/ _jsxs("div", { className: "flex justify-between", children: [ /*#__PURE__*/ _jsx("span", { className: "text-gray-500", children: t('pricing.confirm.your_balance', 'Your balance') }), /*#__PURE__*/ _jsxs("span", { className: preview.canPayFromBalance ? 'text-green-600' : 'text-red-500', children: [ "€", preview.currentBalance ] }) ] }), preview.type === 'downgrade' && /*#__PURE__*/ _jsxs("div", { className: "bg-orange-50 border border-orange-200 rounded-xl p-3 text-orange-800 text-xs", children: [ t('pricing.confirm.downgrade_info', 'The switch to the new plan will happen automatically after the current period ends.'), preview.scheduledDate && /*#__PURE__*/ _jsxs(_Fragment, { children: [ " ", new Date(preview.scheduledDate).toLocaleDateString('ru-RU') ] }) ] }), preview.type !== 'downgrade' && !preview.canPayFromBalance && /*#__PURE__*/ _jsxs("div", { className: "bg-red-50 border border-red-200 rounded-xl p-3 text-red-700 text-xs", children: [ t('pricing.confirm.insufficient', 'Insufficient balance.'), ' ', /*#__PURE__*/ _jsx(Link, { href: "/payment", className: "underline font-medium", onClick: ()=>setConfirmPlan(null), children: t('pricing.confirm.top_up', 'Top up') }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-3 pt-2", children: [ /*#__PURE__*/ _jsx("button", { onClick: ()=>{ setConfirmPlan(null); setPreview(null); }, className: "flex-1 py-2.5 rounded-xl border border-gray-200 text-sm font-medium text-gray-600 hover:bg-gray-50 transition", children: t('common.cancel', 'Cancel') }), (preview.type === 'downgrade' || preview.canPayFromBalance) && /*#__PURE__*/ _jsx("button", { onClick: handleConfirm, disabled: purchasing, className: "flex-1 py-2.5 rounded-xl text-sm font-semibold text-white transition ".concat(preview.type === 'downgrade' ? 'bg-orange-500 hover:bg-orange-600' : tierBtnColors[confirmPlan.tier].replace('block w-full', '').trim(), " disabled:opacity-50"), children: purchasing ? t('common.loading', 'Loading...') : preview.type === 'downgrade' ? t('pricing.confirm.schedule_downgrade', 'Schedule switch') : t('pricing.confirm.pay', 'Pay') }) ] }) ] }) : null ] }) }) ] }); } aj=_’”¿ÁÝß  35acžºì  ©¬Ù Ü w z  Р(0HPs_z¯¶áè"MT”ÆÍ"ipâï ~†+r}RVŸÂ;_?ÐÓÀÃÍÐŒ’šíðj!n!# #î#ñ#ó#û#%%Ø&Û&Â(Å(à)ã)+ +8,_<,>,F,ê,î,,000Ž2ž2[5^566Á6Ä608389“9 =$=÷=ú=ž>¡>ç?ê?{@@KANA§A_«A¢B¥B7D:D"E&EVFYF[FcFÎGÑGKKL"LCMFMPP RR1R4RìRïRìTïT%X(XŽY_·YMZQZøZûZ\\×\Û\†]Š]B^E^S_V_Ò`Ö`Ža‘a®b²b³d·doeref‘f”h˜hPiSiqjRujœl lMnQnSn[nHpLpÄqÇqÉqÌq­s±sdtgtww€€€€€€€€¶(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)ÿÿÿ€¿(0,_lib_auth__WEBPACK_IMPORTED_MODULE_4__/* .useSession */ .wV)Ã(0,_context_locale__WEBPACK_IMPORTED_MODULE_5__/* .useLocale */ .Y)º(0,next_navigation__WEBPACK_IMPORTED_MODULE_3__.useRouter)¯(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)ÿÿÿÿÿÿ°(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)Œ(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getPlans */ .T9)Á(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getMyDashboard */ .H)ýýÅ(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .previewPlanChange */ .Cs)À(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .purchasePlan */ .Je)·(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)ÿÿõõõÿ·react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.FragmentôþþôÅ_components_PlanBadge__WEBPACK_IMPORTED_MODULE_7__/* .PlanBadge */ .dóóóóýýþýýýóóóóýýóóóýóýóóýóÿóóýóóóóóóóóýóóýýóóýóýýóýýóýýýþýó²(next_link__WEBPACK_IMPORTED_MODULE_2___default())üòò€†buffer†source„size„maps„hash__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ PricingPage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(9664); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(next_link__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(7541); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(1592); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(9906); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(2982); /* harmony import */ var _components_PlanBadge__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(2035); /* __next_internal_client_entry_do_not_use__ default auto */ const FEATURE_ROWS = [ { key: 'maxMessagesPerDay', labelKey: 'pricing.feat.messages', format: (v)=>v === null ? '∞' : String(v) }, { key: 'maxOrdersPerDay', labelKey: 'pricing.feat.orders', format: (v)=>v === null ? '∞' : String(v) }, { key: 'canContactAll', labelKey: 'pricing.feat.contact_all' }, { key: 'canViewPhone', labelKey: 'pricing.feat.view_phone' }, { key: 'canShowContactInfo', labelKey: 'pricing.feat.show_contact' }, { key: 'hasFavorites', labelKey: 'pricing.feat.favorites' }, { key: 'hasVerifiedBadge', labelKey: 'pricing.feat.verified_badge' }, { key: 'hasGoogleCalendar', labelKey: 'pricing.feat.google_calendar' }, { key: 'hasPersonalSite', labelKey: 'pricing.feat.personal_site' }, { key: 'hasAutoResponse', labelKey: 'pricing.feat.auto_response' }, { key: 'hasAutoMatch', labelKey: 'pricing.feat.auto_match' }, { key: 'highlightedReviews', labelKey: 'pricing.feat.highlighted_reviews' }, { key: 'maxCards', labelKey: 'pricing.feat.cards', format: (v)=>v === null ? '∞' : String(v) }, { key: 'notifyNewTasks', labelKey: 'pricing.feat.notify_tasks' }, { key: 'canUploadVideo', labelKey: 'pricing.feat.video' } ]; function CheckIcon() { return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { viewBox: "0 0 20 20", fill: "currentColor", className: "w-5 h-5 text-green-500 mx-auto", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { fillRule: "evenodd", d: "M16.704 4.153a.75.75 0 01.143 1.052l-8 10.5a.75.75 0 01-1.127.075l-4.5-4.5a.75.75 0 011.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 011.05-.143z", clipRule: "evenodd" }) }); } function XIcon() { return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { viewBox: "0 0 20 20", fill: "currentColor", className: "w-4 h-4 text-gray-300 mx-auto", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M6.28 5.22a.75.75 0 00-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 101.06 1.06L10 11.06l3.72 3.72a.75.75 0 101.06-1.06L11.06 10l3.72-3.72a.75.75 0 00-1.06-1.06L10 8.94 6.28 5.22z" }) }); } const tierOrder = [ 'free', 'pro', 'ultimate' ]; const tierHeaderColors = { free: 'bg-gray-50 border-gray-200', pro: 'bg-green-50 border-green-200', ultimate: 'bg-gradient-to-br from-amber-50 to-yellow-50 border-amber-300' }; const tierPriceColors = { free: 'text-gray-700', pro: 'text-green-700', ultimate: 'text-amber-600' }; const tierBtnColors = { free: 'bg-gray-100 text-gray-700 hover:bg-gray-200', pro: 'bg-green-600 text-white hover:bg-green-700', ultimate: 'bg-gradient-to-r from-amber-500 to-yellow-500 text-white hover:from-amber-600 hover:to-yellow-600' }; function PricingPage() { const { data: session } = (0,_lib_auth__WEBPACK_IMPORTED_MODULE_4__/* .useSession */ .wV)(); const { t } = (0,_context_locale__WEBPACK_IMPORTED_MODULE_5__/* .useLocale */ .Y)(); const router = (0,next_navigation__WEBPACK_IMPORTED_MODULE_3__.useRouter)(); const [plans, setPlans] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [currentPlanId, setCurrentPlanId] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [loading, setLoading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(true); const [confirmPlan, setConfirmPlan] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [preview, setPreview] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [previewLoading, setPreviewLoading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [purchasing, setPurchasing] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); // Fetch plans with abort to prevent stale race conditions (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ let aborted = false; setLoading(true); (0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getPlans */ .T9)().then((data)=>{ if (!aborted) setPlans(data.sort((a, b)=>tierOrder.indexOf(a.tier) - tierOrder.indexOf(b.tier))); }).catch(()=>{}).finally(()=>{ if (!aborted) setLoading(false); }); return ()=>{ aborted = true; }; }, []); const fetchCurrentPlan = ()=>{ if (!session) return; (0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getMyDashboard */ .H)().then((d)=>{ var _d_plan; var _d_plan_id; return setCurrentPlanId((_d_plan_id = (_d_plan = d.plan) === null || _d_plan === void 0 ? void 0 : _d_plan.id) !== null && _d_plan_id !== void 0 ? _d_plan_id : null); }).catch(()=>{}); }; (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(fetchCurrentPlan, [ session ]); // Refresh active plan when admin widget changes it (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ const handler = ()=>fetchCurrentPlan(); window.addEventListener('canhelp:plan-changed', handler); document.addEventListener('visibilitychange', handler); return ()=>{ window.removeEventListener('canhelp:plan-changed', handler); document.removeEventListener('visibilitychange', handler); }; }, [ session ]); async function handleSelectPlan(plan) { if (!session) { router.push('/sign-in'); return; } setConfirmPlan(plan); setPreview(null); setPreviewLoading(true); try { const p = await (0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .previewPlanChange */ .Cs)(plan.id); setPreview(p); } catch (e) { setConfirmPlan(null); } finally{ setPreviewLoading(false); } } async function handleConfirm() { if (!confirmPlan || !preview) return; setPurchasing(true); try { const result = await (0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .purchasePlan */ .Je)(confirmPlan.id, preview.canPayFromBalance); if (result.url && result.params) { const form = document.createElement('form'); form.method = 'POST'; form.action = result.url; Object.entries(result.params).forEach((param)=>{ let [k, v] = param; const inp = document.createElement('input'); inp.type = 'hidden'; inp.name = k; inp.value = v; form.appendChild(inp); }); document.body.appendChild(form); form.submit(); return; } setCurrentPlanId(confirmPlan.id); setConfirmPlan(null); setPreview(null); } catch (e) { // ignore } finally{ setPurchasing(false); } } const visibleFeatures = FEATURE_ROWS; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("main", { className: "min-h-screen py-12 px-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "max-w-5xl mx-auto", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "text-center mb-10", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h1", { className: "text-4xl font-bold text-white mb-3", children: t('pricing.title', 'Pricing') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-white/70 text-lg", children: t('pricing.subtitle') }) ] }), loading ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-center text-white/60 py-20", children: t('common.loading', 'Loading...') }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "grid grid-cols-1 md:grid-cols-3 gap-6 mb-12", children: plans.map((plan)=>{ const isCurrentPlan = plan.id === currentPlanId; const isFree = plan.tier === 'free'; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "rounded-2xl border-2 p-6 bg-white flex flex-col transition ".concat(isCurrentPlan ? 'ring-2 ring-green-500 ring-offset-2' : '', " ").concat(plan.tier === 'ultimate' ? 'border-amber-300 shadow-lg shadow-amber-100' : 'border-gray-200'), children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-2 mb-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components_PlanBadge__WEBPACK_IMPORTED_MODULE_7__/* .PlanBadge */ .d, { tier: plan.tier, size: "md" }), isCurrentPlan && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-xs font-medium text-green-600 bg-green-50 border border-green-200 px-2 py-0.5 rounded-full", children: t('pricing.current_plan', 'Your plan') }), plan.tier === 'pro' && !isCurrentPlan && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-xs font-medium text-green-600 bg-green-50 border border-green-100 px-2 py-0.5 rounded-full", children: t('pricing.popular', 'Popular') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "text-xl font-bold text-gray-900 mb-1", children: plan.name }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-gray-500 text-sm mb-4 min-h-[40px]", children: plan.description }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "text-3xl font-extrabold mb-1 ".concat(tierPriceColors[plan.tier]), children: [ isFree ? t('pricing.free', 'Free') : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [ plan.oldPrice && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "text-lg font-normal text-gray-400 line-through mr-2", children: [ "€", plan.oldPrice ] }), "€", plan.price ] }), !isFree && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "text-base font-normal text-gray-400", children: [ "/", t('pricing.per_month', 'month') ] }) ] }), plan.durationDays && !isFree && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { className: "text-xs text-gray-400 mb-5", children: [ t('pricing.duration', 'Duration'), ": ", plan.durationDays, " ", t('pricing.days', 'days') ] }), isFree && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "mb-5" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "mt-auto", children: isCurrentPlan ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "w-full py-2.5 text-center text-sm font-semibold text-green-700 bg-green-50 border border-green-200 rounded-xl", children: t('pricing.your_plan', 'Current plan') }) : isFree ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "w-full py-2.5 text-center text-sm font-medium text-gray-400 bg-gray-50 border border-gray-200 rounded-xl", children: t('pricing.free_default', 'Default') }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { onClick: ()=>handleSelectPlan(plan), className: "block w-full py-2.5 text-center text-sm font-semibold rounded-xl transition ".concat(tierBtnColors[plan.tier]), children: [ t('pricing.choose', 'Choose'), " ", plan.name ] }) }) ] }, plan.id); }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-2xl border border-gray-200 overflow-hidden", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "px-6 py-4 border-b border-gray-100", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h3", { className: "font-semibold text-gray-900", children: t('pricing.compare', 'Feature comparison') }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "overflow-x-auto", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("table", { className: "w-full text-sm", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("thead", { children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("tr", { className: "border-b border-gray-100", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "text-left px-6 py-3 text-gray-500 font-medium w-1/2", children: t('pricing.feature', 'Feature') }), plans.map((plan)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "text-center px-4 py-3 font-medium text-gray-700", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex flex-col items-center gap-1", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components_PlanBadge__WEBPACK_IMPORTED_MODULE_7__/* .PlanBadge */ .d, { tier: plan.tier, size: "sm" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-xs text-gray-400", children: plan.tier === 'free' ? t('pricing.free', 'Free') : "€".concat(plan.price) }) ] }) }, plan.id)) ] }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("tbody", { children: visibleFeatures.map((param)=>{ let { key, labelKey, format } = param; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("tr", { className: "border-b border-gray-50 hover:bg-gray-50/50 transition", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-6 py-3 text-gray-600", children: t(labelKey, labelKey) }), plans.map((plan)=>{ const val = plan[key]; let cell; if (format) { cell = /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-gray-700 font-medium", children: format(val) }); } else if (typeof val === 'boolean') { cell = val ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(CheckIcon, {}) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(XIcon, {}); } else { cell = /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-gray-700", children: val === null ? '∞' : String(val !== null && val !== void 0 ? val : '—') }); } return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "text-center px-4 py-3", children: cell }, plan.id); }) ] }, key); }) }) ] }) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-center text-white/50 text-sm mt-8", children: t('pricing.faq_note', 'Payment is deducted from your CanHelp balance. Top up is available in Payments.') }) ] }) ] }), confirmPlan && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "fixed inset-0 z-50 flex items-center justify-center bg-black/50 px-4", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-2xl shadow-2xl w-full max-w-md p-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "text-lg font-bold text-gray-900 mb-4", children: t('pricing.confirm.title', 'Confirm plan selection') }), previewLoading ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "py-10 text-center text-gray-400", children: t('common.loading', 'Loading...') }) : preview ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-3 text-sm text-gray-700", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex justify-between", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-gray-500", children: t('pricing.confirm.plan', 'Plan') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "font-semibold", children: confirmPlan.name }) ] }), preview.type === 'upgrade' && Number(preview.prorated) > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex justify-between", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-gray-500", children: t('pricing.confirm.prorated', 'Prorated credit') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "text-green-600 font-medium", children: [ "−€", preview.prorated ] }) ] }), preview.type !== 'downgrade' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex justify-between", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-gray-500", children: t('pricing.confirm.effective_price', 'To pay') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "font-bold text-gray-900", children: [ "€", preview.effectivePrice ] }) ] }), preview.type !== 'downgrade' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex justify-between", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-gray-500", children: t('pricing.confirm.your_balance', 'Your balance') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: preview.canPayFromBalance ? 'text-green-600' : 'text-red-500', children: [ "€", preview.currentBalance ] }) ] }), preview.type === 'downgrade' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-orange-50 border border-orange-200 rounded-xl p-3 text-orange-800 text-xs", children: [ t('pricing.confirm.downgrade_info', 'The switch to the new plan will happen automatically after the current period ends.'), preview.scheduledDate && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [ " ", new Date(preview.scheduledDate).toLocaleDateString('ru-RU') ] }) ] }), preview.type !== 'downgrade' && !preview.canPayFromBalance && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-red-50 border border-red-200 rounded-xl p-3 text-red-700 text-xs", children: [ t('pricing.confirm.insufficient', 'Insufficient balance.'), ' ', /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)((next_link__WEBPACK_IMPORTED_MODULE_2___default()), { href: "/payment", className: "underline font-medium", onClick: ()=>setConfirmPlan(null), children: t('pricing.confirm.top_up', 'Top up') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-3 pt-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>{ setConfirmPlan(null); setPreview(null); }, className: "flex-1 py-2.5 rounded-xl border border-gray-200 text-sm font-medium text-gray-600 hover:bg-gray-50 transition", children: t('common.cancel', 'Cancel') }), (preview.type === 'downgrade' || preview.canPayFromBalance) && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: handleConfirm, disabled: purchasing, className: "flex-1 py-2.5 rounded-xl text-sm font-semibold text-white transition ".concat(preview.type === 'downgrade' ? 'bg-orange-500 hover:bg-orange-600' : tierBtnColors[confirmPlan.tier].replace('block w-full', '').trim(), " disabled:opacity-50"), children: purchasing ? t('common.loading', 'Loading...') : preview.type === 'downgrade' ? t('pricing.confirm.schedule_downgrade', 'Schedule switch') : t('pricing.confirm.pay', 'Pay') }) ] }) ] }) : null ] }) }) ] }); } €”{"finalSource":true}ƒmap‹bufferedMap ConcatSourceRawSourced__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ PricingPage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(9664); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(next_link__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(7541); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(1592); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(9906); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(2982); /* harmony import */ var _components_PlanBadge__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(2035); ReplaceSourceRawSourceœz/* __next_internal_client_entry_do_not_use__ default auto */ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime"; import { useState, useEffect } from 'react'; import Link from 'next/link'; import { useRouter } from 'next/navigation'; import { useSession } from '@/lib/auth'; import { useLocale } from '@/context/locale'; import { getPlans, getMyDashboard, previewPlanChange, purchasePlan } from '@/lib/api'; import { PlanBadge } from '@/components/PlanBadge'; const FEATURE_ROWS = [ { key: 'maxMessagesPerDay', labelKey: 'pricing.feat.messages', format: (v)=>v === null ? '∞' : String(v) }, { key: 'maxOrdersPerDay', labelKey: 'pricing.feat.orders', format: (v)=>v === null ? '∞' : String(v) }, { key: 'canContactAll', labelKey: 'pricing.feat.contact_all' }, { key: 'canViewPhone', labelKey: 'pricing.feat.view_phone' }, { key: 'canShowContactInfo', labelKey: 'pricing.feat.show_contact' }, { key: 'hasFavorites', labelKey: 'pricing.feat.favorites' }, { key: 'hasVerifiedBadge', labelKey: 'pricing.feat.verified_badge' }, { key: 'hasGoogleCalendar', labelKey: 'pricing.feat.google_calendar' }, { key: 'hasPersonalSite', labelKey: 'pricing.feat.personal_site' }, { key: 'hasAutoResponse', labelKey: 'pricing.feat.auto_response' }, { key: 'hasAutoMatch', labelKey: 'pricing.feat.auto_match' }, { key: 'highlightedReviews', labelKey: 'pricing.feat.highlighted_reviews' }, { key: 'maxCards', labelKey: 'pricing.feat.cards', format: (v)=>v === null ? '∞' : String(v) }, { key: 'notifyNewTasks', labelKey: 'pricing.feat.notify_tasks' }, { key: 'canUploadVideo', labelKey: 'pricing.feat.video' } ]; function CheckIcon() { return /*#__PURE__*/ _jsx("svg", { viewBox: "0 0 20 20", fill: "currentColor", className: "w-5 h-5 text-green-500 mx-auto", children: /*#__PURE__*/ _jsx("path", { fillRule: "evenodd", d: "M16.704 4.153a.75.75 0 01.143 1.052l-8 10.5a.75.75 0 01-1.127.075l-4.5-4.5a.75.75 0 011.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 011.05-.143z", clipRule: "evenodd" }) }); } function XIcon() { return /*#__PURE__*/ _jsx("svg", { viewBox: "0 0 20 20", fill: "currentColor", className: "w-4 h-4 text-gray-300 mx-auto", children: /*#__PURE__*/ _jsx("path", { d: "M6.28 5.22a.75.75 0 00-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 101.06 1.06L10 11.06l3.72 3.72a.75.75 0 101.06-1.06L11.06 10l3.72-3.72a.75.75 0 00-1.06-1.06L10 8.94 6.28 5.22z" }) }); } const tierOrder = [ 'free', 'pro', 'ultimate' ]; const tierHeaderColors = { free: 'bg-gray-50 border-gray-200', pro: 'bg-green-50 border-green-200', ultimate: 'bg-gradient-to-br from-amber-50 to-yellow-50 border-amber-300' }; const tierPriceColors = { free: 'text-gray-700', pro: 'text-green-700', ultimate: 'text-amber-600' }; const tierBtnColors = { free: 'bg-gray-100 text-gray-700 hover:bg-gray-200', pro: 'bg-green-600 text-white hover:bg-green-700', ultimate: 'bg-gradient-to-r from-amber-500 to-yellow-500 text-white hover:from-amber-600 hover:to-yellow-600' }; export default function PricingPage() { const { data: session } = useSession(); const { t } = useLocale(); const router = useRouter(); const [plans, setPlans] = useState([]); const [currentPlanId, setCurrentPlanId] = useState(null); const [loading, setLoading] = useState(true); const [confirmPlan, setConfirmPlan] = useState(null); const [preview, setPreview] = useState(null); const [previewLoading, setPreviewLoading] = useState(false); const [purchasing, setPurchasing] = useState(false); // Fetch plans with abort to prevent stale race conditions useEffect(()=>{ let aborted = false; setLoading(true); getPlans().then((data)=>{ if (!aborted) setPlans(data.sort((a, b)=>tierOrder.indexOf(a.tier) - tierOrder.indexOf(b.tier))); }).catch(()=>{}).finally(()=>{ if (!aborted) setLoading(false); }); return ()=>{ aborted = true; }; }, []); const fetchCurrentPlan = ()=>{ if (!session) return; getMyDashboard().then((d)=>{ var _d_plan; var _d_plan_id; return setCurrentPlanId((_d_plan_id = (_d_plan = d.plan) === null || _d_plan === void 0 ? void 0 : _d_plan.id) !== null && _d_plan_id !== void 0 ? _d_plan_id : null); }).catch(()=>{}); }; useEffect(fetchCurrentPlan, [ session ]); // Refresh active plan when admin widget changes it useEffect(()=>{ const handler = ()=>fetchCurrentPlan(); window.addEventListener('canhelp:plan-changed', handler); document.addEventListener('visibilitychange', handler); return ()=>{ window.removeEventListener('canhelp:plan-changed', handler); document.removeEventListener('visibilitychange', handler); }; }, [ session ]); async function handleSelectPlan(plan) { if (!session) { router.push('/sign-in'); return; } setConfirmPlan(plan); setPreview(null); setPreviewLoading(true); try { const p = await previewPlanChange(plan.id); setPreview(p); } catch (e) { setConfirmPlan(null); } finally{ setPreviewLoading(false); } } async function handleConfirm() { if (!confirmPlan || !preview) return; setPurchasing(true); try { const result = await purchasePlan(confirmPlan.id, preview.canPayFromBalance); if (result.url && result.params) { const form = document.createElement('form'); form.method = 'POST'; form.action = result.url; Object.entries(result.params).forEach((param)=>{ let [k, v] = param; const inp = document.createElement('input'); inp.type = 'hidden'; inp.name = k; inp.value = v; form.appendChild(inp); }); document.body.appendChild(form); form.submit(); return; } setCurrentPlanId(confirmPlan.id); setConfirmPlan(null); setPreview(null); } catch (e) { // ignore } finally{ setPurchasing(false); } } const visibleFeatures = FEATURE_ROWS; return /*#__PURE__*/ _jsxs("main", { className: "min-h-screen py-12 px-4", children: [ /*#__PURE__*/ _jsxs("div", { className: "max-w-5xl mx-auto", children: [ /*#__PURE__*/ _jsxs("div", { className: "text-center mb-10", children: [ /*#__PURE__*/ _jsx("h1", { className: "text-4xl font-bold text-white mb-3", children: t('pricing.title', 'Pricing') }), /*#__PURE__*/ _jsx("p", { className: "text-white/70 text-lg", children: t('pricing.subtitle') }) ] }), loading ? /*#__PURE__*/ _jsx("div", { className: "text-center text-white/60 py-20", children: t('common.loading', 'Loading...') }) : /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx("div", { className: "grid grid-cols-1 md:grid-cols-3 gap-6 mb-12", children: plans.map((plan)=>{ const isCurrentPlan = plan.id === currentPlanId; const isFree = plan.tier === 'free'; return /*#__PURE__*/ _jsxs("div", { className: "rounded-2xl border-2 p-6 bg-white flex flex-col transition ".concat(isCurrentPlan ? 'ring-2 ring-green-500 ring-offset-2' : '', " ").concat(plan.tier === 'ultimate' ? 'border-amber-300 shadow-lg shadow-amber-100' : 'border-gray-200'), children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 mb-4", children: [ /*#__PURE__*/ _jsx(PlanBadge, { tier: plan.tier, size: "md" }), isCurrentPlan && /*#__PURE__*/ _jsx("span", { className: "text-xs font-medium text-green-600 bg-green-50 border border-green-200 px-2 py-0.5 rounded-full", children: t('pricing.current_plan', 'Your plan') }), plan.tier === 'pro' && !isCurrentPlan && /*#__PURE__*/ _jsx("span", { className: "text-xs font-medium text-green-600 bg-green-50 border border-green-100 px-2 py-0.5 rounded-full", children: t('pricing.popular', 'Popular') }) ] }), /*#__PURE__*/ _jsx("h2", { className: "text-xl font-bold text-gray-900 mb-1", children: plan.name }), /*#__PURE__*/ _jsx("p", { className: "text-gray-500 text-sm mb-4 min-h-[40px]", children: plan.description }), /*#__PURE__*/ _jsxs("div", { className: "text-3xl font-extrabold mb-1 ".concat(tierPriceColors[plan.tier]), children: [ isFree ? t('pricing.free', 'Free') : /*#__PURE__*/ _jsxs(_Fragment, { children: [ plan.oldPrice && /*#__PURE__*/ _jsxs("span", { className: "text-lg font-normal text-gray-400 line-through mr-2", children: [ "€", plan.oldPrice ] }), "€", plan.price ] }), !isFree && /*#__PURE__*/ _jsxs("span", { className: "text-base font-normal text-gray-400", children: [ "/", t('pricing.per_month', 'month') ] }) ] }), plan.durationDays && !isFree && /*#__PURE__*/ _jsxs("p", { className: "text-xs text-gray-400 mb-5", children: [ t('pricing.duration', 'Duration'), ": ", plan.durationDays, " ", t('pricing.days', 'days') ] }), isFree && /*#__PURE__*/ _jsx("div", { className: "mb-5" }), /*#__PURE__*/ _jsx("div", { className: "mt-auto", children: isCurrentPlan ? /*#__PURE__*/ _jsx("div", { className: "w-full py-2.5 text-center text-sm font-semibold text-green-700 bg-green-50 border border-green-200 rounded-xl", children: t('pricing.your_plan', 'Current plan') }) : isFree ? /*#__PURE__*/ _jsx("div", { className: "w-full py-2.5 text-center text-sm font-medium text-gray-400 bg-gray-50 border border-gray-200 rounded-xl", children: t('pricing.free_default', 'Default') }) : /*#__PURE__*/ _jsxs("button", { onClick: ()=>handleSelectPlan(plan), className: "block w-full py-2.5 text-center text-sm font-semibold rounded-xl transition ".concat(tierBtnColors[plan.tier]), children: [ t('pricing.choose', 'Choose'), " ", plan.name ] }) }) ] }, plan.id); }) }), /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-2xl border border-gray-200 overflow-hidden", children: [ /*#__PURE__*/ _jsx("div", { className: "px-6 py-4 border-b border-gray-100", children: /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-gray-900", children: t('pricing.compare', 'Feature comparison') }) }), /*#__PURE__*/ _jsx("div", { className: "overflow-x-auto", children: /*#__PURE__*/ _jsxs("table", { className: "w-full text-sm", children: [ /*#__PURE__*/ _jsx("thead", { children: /*#__PURE__*/ _jsxs("tr", { className: "border-b border-gray-100", children: [ /*#__PURE__*/ _jsx("th", { className: "text-left px-6 py-3 text-gray-500 font-medium w-1/2", children: t('pricing.feature', 'Feature') }), plans.map((plan)=>/*#__PURE__*/ _jsx("th", { className: "text-center px-4 py-3 font-medium text-gray-700", children: /*#__PURE__*/ _jsxs("div", { className: "flex flex-col items-center gap-1", children: [ /*#__PURE__*/ _jsx(PlanBadge, { tier: plan.tier, size: "sm" }), /*#__PURE__*/ _jsx("span", { className: "text-xs text-gray-400", children: plan.tier === 'free' ? t('pricing.free', 'Free') : "€".concat(plan.price) }) ] }) }, plan.id)) ] }) }), /*#__PURE__*/ _jsx("tbody", { children: visibleFeatures.map((param)=>{ let { key, labelKey, format } = param; return /*#__PURE__*/ _jsxs("tr", { className: "border-b border-gray-50 hover:bg-gray-50/50 transition", children: [ /*#__PURE__*/ _jsx("td", { className: "px-6 py-3 text-gray-600", children: t(labelKey, labelKey) }), plans.map((plan)=>{ const val = plan[key]; let cell; if (format) { cell = /*#__PURE__*/ _jsx("span", { className: "text-gray-700 font-medium", children: format(val) }); } else if (typeof val === 'boolean') { cell = val ? /*#__PURE__*/ _jsx(CheckIcon, {}) : /*#__PURE__*/ _jsx(XIcon, {}); } else { cell = /*#__PURE__*/ _jsx("span", { className: "text-gray-700", children: val === null ? '∞' : String(val !== null && val !== void 0 ? val : '—') }); } return /*#__PURE__*/ _jsx("td", { className: "text-center px-4 py-3", children: cell }, plan.id); }) ] }, key); }) }) ] }) }) ] }), /*#__PURE__*/ _jsx("p", { className: "text-center text-white/50 text-sm mt-8", children: t('pricing.faq_note', 'Payment is deducted from your CanHelp balance. Top up is available in Payments.') }) ] }) ] }), confirmPlan && /*#__PURE__*/ _jsx("div", { className: "fixed inset-0 z-50 flex items-center justify-center bg-black/50 px-4", children: /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-2xl shadow-2xl w-full max-w-md p-6", children: [ /*#__PURE__*/ _jsx("h2", { className: "text-lg font-bold text-gray-900 mb-4", children: t('pricing.confirm.title', 'Confirm plan selection') }), previewLoading ? /*#__PURE__*/ _jsx("div", { className: "py-10 text-center text-gray-400", children: t('common.loading', 'Loading...') }) : preview ? /*#__PURE__*/ _jsxs("div", { className: "space-y-3 text-sm text-gray-700", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex justify-between", children: [ /*#__PURE__*/ _jsx("span", { className: "text-gray-500", children: t('pricing.confirm.plan', 'Plan') }), /*#__PURE__*/ _jsx("span", { className: "font-semibold", children: confirmPlan.name }) ] }), preview.type === 'upgrade' && Number(preview.prorated) > 0 && /*#__PURE__*/ _jsxs("div", { className: "flex justify-between", children: [ /*#__PURE__*/ _jsx("span", { className: "text-gray-500", children: t('pricing.confirm.prorated', 'Prorated credit') }), /*#__PURE__*/ _jsxs("span", { className: "text-green-600 font-medium", children: [ "−€", preview.prorated ] }) ] }), preview.type !== 'downgrade' && /*#__PURE__*/ _jsxs("div", { className: "flex justify-between", children: [ /*#__PURE__*/ _jsx("span", { className: "text-gray-500", children: t('pricing.confirm.effective_price', 'To pay') }), /*#__PURE__*/ _jsxs("span", { className: "font-bold text-gray-900", children: [ "€", preview.effectivePrice ] }) ] }), preview.type !== 'downgrade' && /*#__PURE__*/ _jsxs("div", { className: "flex justify-between", children: [ /*#__PURE__*/ _jsx("span", { className: "text-gray-500", children: t('pricing.confirm.your_balance', 'Your balance') }), /*#__PURE__*/ _jsxs("span", { className: preview.canPayFromBalance ? 'text-green-600' : 'text-red-500', children: [ "€", preview.currentBalance ] }) ] }), preview.type === 'downgrade' && /*#__PURE__*/ _jsxs("div", { className: "bg-orange-50 border border-orange-200 rounded-xl p-3 text-orange-800 text-xs", children: [ t('pricing.confirm.downgrade_info', 'The switch to the new plan will happen automatically after the current period ends.'), preview.scheduledDate && /*#__PURE__*/ _jsxs(_Fragment, { children: [ " ", new Date(preview.scheduledDate).toLocaleDateString('ru-RU') ] }) ] }), preview.type !== 'downgrade' && !preview.canPayFromBalance && /*#__PURE__*/ _jsxs("div", { className: "bg-red-50 border border-red-200 rounded-xl p-3 text-red-700 text-xs", children: [ t('pricing.confirm.insufficient', 'Insufficient balance.'), ' ', /*#__PURE__*/ _jsx(Link, { href: "/payment", className: "underline font-medium", onClick: ()=>setConfirmPlan(null), children: t('pricing.confirm.top_up', 'Top up') }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-3 pt-2", children: [ /*#__PURE__*/ _jsx("button", { onClick: ()=>{ setConfirmPlan(null); setPreview(null); }, className: "flex-1 py-2.5 rounded-xl border border-gray-200 text-sm font-medium text-gray-600 hover:bg-gray-50 transition", children: t('common.cancel', 'Cancel') }), (preview.type === 'downgrade' || preview.canPayFromBalance) && /*#__PURE__*/ _jsx("button", { onClick: handleConfirm, disabled: purchasing, className: "flex-1 py-2.5 rounded-xl text-sm font-semibold text-white transition ".concat(preview.type === 'downgrade' ? 'bg-orange-500 hover:bg-orange-600' : tierBtnColors[confirmPlan.tier].replace('block w-full', '').trim(), " disabled:opacity-50"), children: purchasing ? t('common.loading', 'Loading...') : preview.type === 'downgrade' ? t('pricing.confirm.schedule_downgrade', 'Schedule switch') : t('pricing.confirm.pay', 'Pay') }) ] }) ] }) : null ] }) }) ] }); } %61146undefined148191undefined193221undefined223266undefined268307undefined309353undefined355440undefined442492undefined20582061(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined22172220(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined25212524(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined26792682(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined35223536undefined35923601(0,_lib_auth__WEBPACK_IMPORTED_MODULE_4__/* .useSession */ .wV)undefined36243632(0,_context_locale__WEBPACK_IMPORTED_MODULE_5__/* .useLocale */ .Y)undefined36563664(0,next_navigation__WEBPACK_IMPORTED_MODULE_3__.useRouter)undefined36993706(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined37593766(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined38093816(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined38673874(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined39173924(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined39813988(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined40384045(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined41224130(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined42014208(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getPlans */ .T9)undefined45784591(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getMyDashboard */ .H)undefined48764884(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined49904998(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined56595675(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .previewPlanChange */ .Cs)undefined60026013(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .purchasePlan */ .Je)undefined69946998(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined71027106(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined72277231(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined73767379(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined76167619(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined78857888(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined80768080(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined80828090react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragmentundefined81738176(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined85548558(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined89668970(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined91989201(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined92039211_components_PlanBadge__WEBPACK_IMPORTED_MODULE_7__/* .PlanBadge */ .dundefined94959498(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined99449947(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1043410437(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1072010723(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1101511019(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1132011324(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1132611334react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragmentundefined1149811502(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1233212336(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1298012984(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1365913662(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1384513848(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1401714020(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1438414387(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1473514739(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1564815652(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1586315866(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1603016033(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1635916362(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1650716511(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1671516718(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1680716811(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1705817061(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1746317466(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1769817702(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1800618009(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1801118019_components_PlanBadge__WEBPACK_IMPORTED_MODULE_7__/* .PlanBadge */ .dundefined1838218385(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1920519208(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1948619490(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1977919782(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2049420497(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2100521008(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2104121044(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2122821231(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2174021743(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2256522568(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2296422967(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2311723121(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2328823291(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2355423557(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2376723771(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2394223946(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2413024133(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2440324406(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2478624790(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2497424977(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2526225266(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2577925783(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2596725970(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2625326257(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2677226776(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2696026963(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2724927253(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2780427808(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2823728241(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2824328251react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragmentundefined2874428748(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2912429127(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2912929132(next_link__WEBPACK_IMPORTED_MODULE_2___default())undefined2961329617(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2979629799(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3046730470(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined /***/ }) Õk/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ PricingPage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(9664); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(next_link__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(7541); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(1592); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(9906); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(2982); /* harmony import */ var _components_PlanBadge__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(2035); /* __next_internal_client_entry_do_not_use__ default auto */ const FEATURE_ROWS = [ { key: 'maxMessagesPerDay', labelKey: 'pricing.feat.messages', format: (v)=>v === null ? '∞' : String(v) }, { key: 'maxOrdersPerDay', labelKey: 'pricing.feat.orders', format: (v)=>v === null ? '∞' : String(v) }, { key: 'canContactAll', labelKey: 'pricing.feat.contact_all' }, { key: 'canViewPhone', labelKey: 'pricing.feat.view_phone' }, { key: 'canShowContactInfo', labelKey: 'pricing.feat.show_contact' }, { key: 'hasFavorites', labelKey: 'pricing.feat.favorites' }, { key: 'hasVerifiedBadge', labelKey: 'pricing.feat.verified_badge' }, { key: 'hasGoogleCalendar', labelKey: 'pricing.feat.google_calendar' }, { key: 'hasPersonalSite', labelKey: 'pricing.feat.personal_site' }, { key: 'hasAutoResponse', labelKey: 'pricing.feat.auto_response' }, { key: 'hasAutoMatch', labelKey: 'pricing.feat.auto_match' }, { key: 'highlightedReviews', labelKey: 'pricing.feat.highlighted_reviews' }, { key: 'maxCards', labelKey: 'pricing.feat.cards', format: (v)=>v === null ? '∞' : String(v) }, { key: 'notifyNewTasks', labelKey: 'pricing.feat.notify_tasks' }, { key: 'canUploadVideo', labelKey: 'pricing.feat.video' } ]; function CheckIcon() { return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { viewBox: "0 0 20 20", fill: "currentColor", className: "w-5 h-5 text-green-500 mx-auto", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { fillRule: "evenodd", d: "M16.704 4.153a.75.75 0 01.143 1.052l-8 10.5a.75.75 0 01-1.127.075l-4.5-4.5a.75.75 0 011.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 011.05-.143z", clipRule: "evenodd" }) }); } function XIcon() { return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { viewBox: "0 0 20 20", fill: "currentColor", className: "w-4 h-4 text-gray-300 mx-auto", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M6.28 5.22a.75.75 0 00-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 101.06 1.06L10 11.06l3.72 3.72a.75.75 0 101.06-1.06L11.06 10l3.72-3.72a.75.75 0 00-1.06-1.06L10 8.94 6.28 5.22z" }) }); } const tierOrder = [ 'free', 'pro', 'ultimate' ]; const tierHeaderColors = { free: 'bg-gray-50 border-gray-200', pro: 'bg-green-50 border-green-200', ultimate: 'bg-gradient-to-br from-amber-50 to-yellow-50 border-amber-300' }; const tierPriceColors = { free: 'text-gray-700', pro: 'text-green-700', ultimate: 'text-amber-600' }; const tierBtnColors = { free: 'bg-gray-100 text-gray-700 hover:bg-gray-200', pro: 'bg-green-600 text-white hover:bg-green-700', ultimate: 'bg-gradient-to-r from-amber-500 to-yellow-500 text-white hover:from-amber-600 hover:to-yellow-600' }; function PricingPage() { const { data: session } = (0,_lib_auth__WEBPACK_IMPORTED_MODULE_4__/* .useSession */ .wV)(); const { t } = (0,_context_locale__WEBPACK_IMPORTED_MODULE_5__/* .useLocale */ .Y)(); const router = (0,next_navigation__WEBPACK_IMPORTED_MODULE_3__.useRouter)(); const [plans, setPlans] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [currentPlanId, setCurrentPlanId] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [loading, setLoading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(true); const [confirmPlan, setConfirmPlan] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [preview, setPreview] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [previewLoading, setPreviewLoading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [purchasing, setPurchasing] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); // Fetch plans with abort to prevent stale race conditions (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ let aborted = false; setLoading(true); (0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getPlans */ .T9)().then((data)=>{ if (!aborted) setPlans(data.sort((a, b)=>tierOrder.indexOf(a.tier) - tierOrder.indexOf(b.tier))); }).catch(()=>{}).finally(()=>{ if (!aborted) setLoading(false); }); return ()=>{ aborted = true; }; }, []); const fetchCurrentPlan = ()=>{ if (!session) return; (0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getMyDashboard */ .H)().then((d)=>{ var _d_plan; var _d_plan_id; return setCurrentPlanId((_d_plan_id = (_d_plan = d.plan) === null || _d_plan === void 0 ? void 0 : _d_plan.id) !== null && _d_plan_id !== void 0 ? _d_plan_id : null); }).catch(()=>{}); }; (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(fetchCurrentPlan, [ session ]); // Refresh active plan when admin widget changes it (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ const handler = ()=>fetchCurrentPlan(); window.addEventListener('canhelp:plan-changed', handler); document.addEventListener('visibilitychange', handler); return ()=>{ window.removeEventListener('canhelp:plan-changed', handler); document.removeEventListener('visibilitychange', handler); }; }, [ session ]); async function handleSelectPlan(plan) { if (!session) { router.push('/sign-in'); return; } setConfirmPlan(plan); setPreview(null); setPreviewLoading(true); try { const p = await (0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .previewPlanChange */ .Cs)(plan.id); setPreview(p); } catch (e) { setConfirmPlan(null); } finally{ setPreviewLoading(false); } } async function handleConfirm() { if (!confirmPlan || !preview) return; setPurchasing(true); try { const result = await (0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .purchasePlan */ .Je)(confirmPlan.id, preview.canPayFromBalance); if (result.url && result.params) { const form = document.createElement('form'); form.method = 'POST'; form.action = result.url; Object.entries(result.params).forEach((param)=>{ let [k, v] = param; const inp = document.createElement('input'); inp.type = 'hidden'; inp.name = k; inp.value = v; form.appendChild(inp); }); document.body.appendChild(form); form.submit(); return; } setCurrentPlanId(confirmPlan.id); setConfirmPlan(null); setPreview(null); } catch (e) { // ignore } finally{ setPurchasing(false); } } const visibleFeatures = FEATURE_ROWS; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("main", { className: "min-h-screen py-12 px-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "max-w-5xl mx-auto", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "text-center mb-10", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h1", { className: "text-4xl font-bold text-white mb-3", children: t('pricing.title', 'Pricing') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-white/70 text-lg", children: t('pricing.subtitle') }) ] }), loading ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-center text-white/60 py-20", children: t('common.loading', 'Loading...') }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "grid grid-cols-1 md:grid-cols-3 gap-6 mb-12", children: plans.map((plan)=>{ const isCurrentPlan = plan.id === currentPlanId; const isFree = plan.tier === 'free'; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "rounded-2xl border-2 p-6 bg-white flex flex-col transition ".concat(isCurrentPlan ? 'ring-2 ring-green-500 ring-offset-2' : '', " ").concat(plan.tier === 'ultimate' ? 'border-amber-300 shadow-lg shadow-amber-100' : 'border-gray-200'), children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-2 mb-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components_PlanBadge__WEBPACK_IMPORTED_MODULE_7__/* .PlanBadge */ .d, { tier: plan.tier, size: "md" }), isCurrentPlan && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-xs font-medium text-green-600 bg-green-50 border border-green-200 px-2 py-0.5 rounded-full", children: t('pricing.current_plan', 'Your plan') }), plan.tier === 'pro' && !isCurrentPlan && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-xs font-medium text-green-600 bg-green-50 border border-green-100 px-2 py-0.5 rounded-full", children: t('pricing.popular', 'Popular') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "text-xl font-bold text-gray-900 mb-1", children: plan.name }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-gray-500 text-sm mb-4 min-h-[40px]", children: plan.description }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "text-3xl font-extrabold mb-1 ".concat(tierPriceColors[plan.tier]), children: [ isFree ? t('pricing.free', 'Free') : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [ plan.oldPrice && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "text-lg font-normal text-gray-400 line-through mr-2", children: [ "€", plan.oldPrice ] }), "€", plan.price ] }), !isFree && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "text-base font-normal text-gray-400", children: [ "/", t('pricing.per_month', 'month') ] }) ] }), plan.durationDays && !isFree && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { className: "text-xs text-gray-400 mb-5", children: [ t('pricing.duration', 'Duration'), ": ", plan.durationDays, " ", t('pricing.days', 'days') ] }), isFree && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "mb-5" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "mt-auto", children: isCurrentPlan ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "w-full py-2.5 text-center text-sm font-semibold text-green-700 bg-green-50 border border-green-200 rounded-xl", children: t('pricing.your_plan', 'Current plan') }) : isFree ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "w-full py-2.5 text-center text-sm font-medium text-gray-400 bg-gray-50 border border-gray-200 rounded-xl", children: t('pricing.free_default', 'Default') }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { onClick: ()=>handleSelectPlan(plan), className: "block w-full py-2.5 text-center text-sm font-semibold rounded-xl transition ".concat(tierBtnColors[plan.tier]), children: [ t('pricing.choose', 'Choose'), " ", plan.name ] }) }) ] }, plan.id); }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-2xl border border-gray-200 overflow-hidden", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "px-6 py-4 border-b border-gray-100", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h3", { className: "font-semibold text-gray-900", children: t('pricing.compare', 'Feature comparison') }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "overflow-x-auto", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("table", { className: "w-full text-sm", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("thead", { children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("tr", { className: "border-b border-gray-100", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "text-left px-6 py-3 text-gray-500 font-medium w-1/2", children: t('pricing.feature', 'Feature') }), plans.map((plan)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "text-center px-4 py-3 font-medium text-gray-700", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex flex-col items-center gap-1", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components_PlanBadge__WEBPACK_IMPORTED_MODULE_7__/* .PlanBadge */ .d, { tier: plan.tier, size: "sm" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-xs text-gray-400", children: plan.tier === 'free' ? t('pricing.free', 'Free') : "€".concat(plan.price) }) ] }) }, plan.id)) ] }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("tbody", { children: visibleFeatures.map((param)=>{ let { key, labelKey, format } = param; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("tr", { className: "border-b border-gray-50 hover:bg-gray-50/50 transition", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-6 py-3 text-gray-600", children: t(labelKey, labelKey) }), plans.map((plan)=>{ const val = plan[key]; let cell; if (format) { cell = /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-gray-700 font-medium", children: format(val) }); } else if (typeof val === 'boolean') { cell = val ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(CheckIcon, {}) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(XIcon, {}); } else { cell = /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-gray-700", children: val === null ? '∞' : String(val !== null && val !== void 0 ? val : '—') }); } return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "text-center px-4 py-3", children: cell }, plan.id); }) ] }, key); }) }) ] }) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-center text-white/50 text-sm mt-8", children: t('pricing.faq_note', 'Payment is deducted from your CanHelp balance. Top up is available in Payments.') }) ] }) ] }), confirmPlan && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "fixed inset-0 z-50 flex items-center justify-center bg-black/50 px-4", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-2xl shadow-2xl w-full max-w-md p-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "text-lg font-bold text-gray-900 mb-4", children: t('pricing.confirm.title', 'Confirm plan selection') }), previewLoading ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "py-10 text-center text-gray-400", children: t('common.loading', 'Loading...') }) : preview ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-3 text-sm text-gray-700", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex justify-between", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-gray-500", children: t('pricing.confirm.plan', 'Plan') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "font-semibold", children: confirmPlan.name }) ] }), preview.type === 'upgrade' && Number(preview.prorated) > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex justify-between", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-gray-500", children: t('pricing.confirm.prorated', 'Prorated credit') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "text-green-600 font-medium", children: [ "−€", preview.prorated ] }) ] }), preview.type !== 'downgrade' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex justify-between", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-gray-500", children: t('pricing.confirm.effective_price', 'To pay') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "font-bold text-gray-900", children: [ "€", preview.effectivePrice ] }) ] }), preview.type !== 'downgrade' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex justify-between", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-gray-500", children: t('pricing.confirm.your_balance', 'Your balance') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: preview.canPayFromBalance ? 'text-green-600' : 'text-red-500', children: [ "€", preview.currentBalance ] }) ] }), preview.type === 'downgrade' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-orange-50 border border-orange-200 rounded-xl p-3 text-orange-800 text-xs", children: [ t('pricing.confirm.downgrade_info', 'The switch to the new plan will happen automatically after the current period ends.'), preview.scheduledDate && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [ " ", new Date(preview.scheduledDate).toLocaleDateString('ru-RU') ] }) ] }), preview.type !== 'downgrade' && !preview.canPayFromBalance && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-red-50 border border-red-200 rounded-xl p-3 text-red-700 text-xs", children: [ t('pricing.confirm.insufficient', 'Insufficient balance.'), ' ', /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)((next_link__WEBPACK_IMPORTED_MODULE_2___default()), { href: "/payment", className: "underline font-medium", onClick: ()=>setConfirmPlan(null), children: t('pricing.confirm.top_up', 'Top up') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-3 pt-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>{ setConfirmPlan(null); setPreview(null); }, className: "flex-1 py-2.5 rounded-xl border border-gray-200 text-sm font-medium text-gray-600 hover:bg-gray-50 transition", children: t('common.cancel', 'Cancel') }), (preview.type === 'downgrade' || preview.canPayFromBalance) && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: handleConfirm, disabled: purchasing, className: "flex-1 py-2.5 rounded-xl text-sm font-semibold text-white transition ".concat(preview.type === 'downgrade' ? 'bg-orange-500 hover:bg-orange-600' : tierBtnColors[confirmPlan.tier].replace('block w-full', '').trim(), " disabled:opacity-50"), children: purchasing ? t('common.loading', 'Loading...') : preview.type === 'downgrade' ? t('pricing.confirm.schedule_downgrade', 'Schedule switch') : t('pricing.confirm.pay', 'Pay') }) ] }) ] }) : null ] }) }) ] }); } /***/ }) ÖÙ  ÚéÚd__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ PricingPage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(9664); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(next_link__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(7541); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(1592); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(9906); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(2982); /* harmony import */ var _components_PlanBadge__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(2035); Ûœz/* __next_internal_client_entry_do_not_use__ default auto */ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime"; import { useState, useEffect } from 'react'; import Link from 'next/link'; import { useRouter } from 'next/navigation'; import { useSession } from '@/lib/auth'; import { useLocale } from '@/context/locale'; import { getPlans, getMyDashboard, previewPlanChange, purchasePlan } from '@/lib/api'; import { PlanBadge } from '@/components/PlanBadge'; const FEATURE_ROWS = [ { key: 'maxMessagesPerDay', labelKey: 'pricing.feat.messages', format: (v)=>v === null ? '∞' : String(v) }, { key: 'maxOrdersPerDay', labelKey: 'pricing.feat.orders', format: (v)=>v === null ? '∞' : String(v) }, { key: 'canContactAll', labelKey: 'pricing.feat.contact_all' }, { key: 'canViewPhone', labelKey: 'pricing.feat.view_phone' }, { key: 'canShowContactInfo', labelKey: 'pricing.feat.show_contact' }, { key: 'hasFavorites', labelKey: 'pricing.feat.favorites' }, { key: 'hasVerifiedBadge', labelKey: 'pricing.feat.verified_badge' }, { key: 'hasGoogleCalendar', labelKey: 'pricing.feat.google_calendar' }, { key: 'hasPersonalSite', labelKey: 'pricing.feat.personal_site' }, { key: 'hasAutoResponse', labelKey: 'pricing.feat.auto_response' }, { key: 'hasAutoMatch', labelKey: 'pricing.feat.auto_match' }, { key: 'highlightedReviews', labelKey: 'pricing.feat.highlighted_reviews' }, { key: 'maxCards', labelKey: 'pricing.feat.cards', format: (v)=>v === null ? '∞' : String(v) }, { key: 'notifyNewTasks', labelKey: 'pricing.feat.notify_tasks' }, { key: 'canUploadVideo', labelKey: 'pricing.feat.video' } ]; function CheckIcon() { return /*#__PURE__*/ _jsx("svg", { viewBox: "0 0 20 20", fill: "currentColor", className: "w-5 h-5 text-green-500 mx-auto", children: /*#__PURE__*/ _jsx("path", { fillRule: "evenodd", d: "M16.704 4.153a.75.75 0 01.143 1.052l-8 10.5a.75.75 0 01-1.127.075l-4.5-4.5a.75.75 0 011.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 011.05-.143z", clipRule: "evenodd" }) }); } function XIcon() { return /*#__PURE__*/ _jsx("svg", { viewBox: "0 0 20 20", fill: "currentColor", className: "w-4 h-4 text-gray-300 mx-auto", children: /*#__PURE__*/ _jsx("path", { d: "M6.28 5.22a.75.75 0 00-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 101.06 1.06L10 11.06l3.72 3.72a.75.75 0 101.06-1.06L11.06 10l3.72-3.72a.75.75 0 00-1.06-1.06L10 8.94 6.28 5.22z" }) }); } const tierOrder = [ 'free', 'pro', 'ultimate' ]; const tierHeaderColors = { free: 'bg-gray-50 border-gray-200', pro: 'bg-green-50 border-green-200', ultimate: 'bg-gradient-to-br from-amber-50 to-yellow-50 border-amber-300' }; const tierPriceColors = { free: 'text-gray-700', pro: 'text-green-700', ultimate: 'text-amber-600' }; const tierBtnColors = { free: 'bg-gray-100 text-gray-700 hover:bg-gray-200', pro: 'bg-green-600 text-white hover:bg-green-700', ultimate: 'bg-gradient-to-r from-amber-500 to-yellow-500 text-white hover:from-amber-600 hover:to-yellow-600' }; export default function PricingPage() { const { data: session } = useSession(); const { t } = useLocale(); const router = useRouter(); const [plans, setPlans] = useState([]); const [currentPlanId, setCurrentPlanId] = useState(null); const [loading, setLoading] = useState(true); const [confirmPlan, setConfirmPlan] = useState(null); const [preview, setPreview] = useState(null); const [previewLoading, setPreviewLoading] = useState(false); const [purchasing, setPurchasing] = useState(false); // Fetch plans with abort to prevent stale race conditions useEffect(()=>{ let aborted = false; setLoading(true); getPlans().then((data)=>{ if (!aborted) setPlans(data.sort((a, b)=>tierOrder.indexOf(a.tier) - tierOrder.indexOf(b.tier))); }).catch(()=>{}).finally(()=>{ if (!aborted) setLoading(false); }); return ()=>{ aborted = true; }; }, []); const fetchCurrentPlan = ()=>{ if (!session) return; getMyDashboard().then((d)=>{ var _d_plan; var _d_plan_id; return setCurrentPlanId((_d_plan_id = (_d_plan = d.plan) === null || _d_plan === void 0 ? void 0 : _d_plan.id) !== null && _d_plan_id !== void 0 ? _d_plan_id : null); }).catch(()=>{}); }; useEffect(fetchCurrentPlan, [ session ]); // Refresh active plan when admin widget changes it useEffect(()=>{ const handler = ()=>fetchCurrentPlan(); window.addEventListener('canhelp:plan-changed', handler); document.addEventListener('visibilitychange', handler); return ()=>{ window.removeEventListener('canhelp:plan-changed', handler); document.removeEventListener('visibilitychange', handler); }; }, [ session ]); async function handleSelectPlan(plan) { if (!session) { router.push('/sign-in'); return; } setConfirmPlan(plan); setPreview(null); setPreviewLoading(true); try { const p = await previewPlanChange(plan.id); setPreview(p); } catch (e) { setConfirmPlan(null); } finally{ setPreviewLoading(false); } } async function handleConfirm() { if (!confirmPlan || !preview) return; setPurchasing(true); try { const result = await purchasePlan(confirmPlan.id, preview.canPayFromBalance); if (result.url && result.params) { const form = document.createElement('form'); form.method = 'POST'; form.action = result.url; Object.entries(result.params).forEach((param)=>{ let [k, v] = param; const inp = document.createElement('input'); inp.type = 'hidden'; inp.name = k; inp.value = v; form.appendChild(inp); }); document.body.appendChild(form); form.submit(); return; } setCurrentPlanId(confirmPlan.id); setConfirmPlan(null); setPreview(null); } catch (e) { // ignore } finally{ setPurchasing(false); } } const visibleFeatures = FEATURE_ROWS; return /*#__PURE__*/ _jsxs("main", { className: "min-h-screen py-12 px-4", children: [ /*#__PURE__*/ _jsxs("div", { className: "max-w-5xl mx-auto", children: [ /*#__PURE__*/ _jsxs("div", { className: "text-center mb-10", children: [ /*#__PURE__*/ _jsx("h1", { className: "text-4xl font-bold text-white mb-3", children: t('pricing.title', 'Pricing') }), /*#__PURE__*/ _jsx("p", { className: "text-white/70 text-lg", children: t('pricing.subtitle') }) ] }), loading ? /*#__PURE__*/ _jsx("div", { className: "text-center text-white/60 py-20", children: t('common.loading', 'Loading...') }) : /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx("div", { className: "grid grid-cols-1 md:grid-cols-3 gap-6 mb-12", children: plans.map((plan)=>{ const isCurrentPlan = plan.id === currentPlanId; const isFree = plan.tier === 'free'; return /*#__PURE__*/ _jsxs("div", { className: "rounded-2xl border-2 p-6 bg-white flex flex-col transition ".concat(isCurrentPlan ? 'ring-2 ring-green-500 ring-offset-2' : '', " ").concat(plan.tier === 'ultimate' ? 'border-amber-300 shadow-lg shadow-amber-100' : 'border-gray-200'), children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 mb-4", children: [ /*#__PURE__*/ _jsx(PlanBadge, { tier: plan.tier, size: "md" }), isCurrentPlan && /*#__PURE__*/ _jsx("span", { className: "text-xs font-medium text-green-600 bg-green-50 border border-green-200 px-2 py-0.5 rounded-full", children: t('pricing.current_plan', 'Your plan') }), plan.tier === 'pro' && !isCurrentPlan && /*#__PURE__*/ _jsx("span", { className: "text-xs font-medium text-green-600 bg-green-50 border border-green-100 px-2 py-0.5 rounded-full", children: t('pricing.popular', 'Popular') }) ] }), /*#__PURE__*/ _jsx("h2", { className: "text-xl font-bold text-gray-900 mb-1", children: plan.name }), /*#__PURE__*/ _jsx("p", { className: "text-gray-500 text-sm mb-4 min-h-[40px]", children: plan.description }), /*#__PURE__*/ _jsxs("div", { className: "text-3xl font-extrabold mb-1 ".concat(tierPriceColors[plan.tier]), children: [ isFree ? t('pricing.free', 'Free') : /*#__PURE__*/ _jsxs(_Fragment, { children: [ plan.oldPrice && /*#__PURE__*/ _jsxs("span", { className: "text-lg font-normal text-gray-400 line-through mr-2", children: [ "€", plan.oldPrice ] }), "€", plan.price ] }), !isFree && /*#__PURE__*/ _jsxs("span", { className: "text-base font-normal text-gray-400", children: [ "/", t('pricing.per_month', 'month') ] }) ] }), plan.durationDays && !isFree && /*#__PURE__*/ _jsxs("p", { className: "text-xs text-gray-400 mb-5", children: [ t('pricing.duration', 'Duration'), ": ", plan.durationDays, " ", t('pricing.days', 'days') ] }), isFree && /*#__PURE__*/ _jsx("div", { className: "mb-5" }), /*#__PURE__*/ _jsx("div", { className: "mt-auto", children: isCurrentPlan ? /*#__PURE__*/ _jsx("div", { className: "w-full py-2.5 text-center text-sm font-semibold text-green-700 bg-green-50 border border-green-200 rounded-xl", children: t('pricing.your_plan', 'Current plan') }) : isFree ? /*#__PURE__*/ _jsx("div", { className: "w-full py-2.5 text-center text-sm font-medium text-gray-400 bg-gray-50 border border-gray-200 rounded-xl", children: t('pricing.free_default', 'Default') }) : /*#__PURE__*/ _jsxs("button", { onClick: ()=>handleSelectPlan(plan), className: "block w-full py-2.5 text-center text-sm font-semibold rounded-xl transition ".concat(tierBtnColors[plan.tier]), children: [ t('pricing.choose', 'Choose'), " ", plan.name ] }) }) ] }, plan.id); }) }), /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-2xl border border-gray-200 overflow-hidden", children: [ /*#__PURE__*/ _jsx("div", { className: "px-6 py-4 border-b border-gray-100", children: /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-gray-900", children: t('pricing.compare', 'Feature comparison') }) }), /*#__PURE__*/ _jsx("div", { className: "overflow-x-auto", children: /*#__PURE__*/ _jsxs("table", { className: "w-full text-sm", children: [ /*#__PURE__*/ _jsx("thead", { children: /*#__PURE__*/ _jsxs("tr", { className: "border-b border-gray-100", children: [ /*#__PURE__*/ _jsx("th", { className: "text-left px-6 py-3 text-gray-500 font-medium w-1/2", children: t('pricing.feature', 'Feature') }), plans.map((plan)=>/*#__PURE__*/ _jsx("th", { className: "text-center px-4 py-3 font-medium text-gray-700", children: /*#__PURE__*/ _jsxs("div", { className: "flex flex-col items-center gap-1", children: [ /*#__PURE__*/ _jsx(PlanBadge, { tier: plan.tier, size: "sm" }), /*#__PURE__*/ _jsx("span", { className: "text-xs text-gray-400", children: plan.tier === 'free' ? t('pricing.free', 'Free') : "€".concat(plan.price) }) ] }) }, plan.id)) ] }) }), /*#__PURE__*/ _jsx("tbody", { children: visibleFeatures.map((param)=>{ let { key, labelKey, format } = param; return /*#__PURE__*/ _jsxs("tr", { className: "border-b border-gray-50 hover:bg-gray-50/50 transition", children: [ /*#__PURE__*/ _jsx("td", { className: "px-6 py-3 text-gray-600", children: t(labelKey, labelKey) }), plans.map((plan)=>{ const val = plan[key]; let cell; if (format) { cell = /*#__PURE__*/ _jsx("span", { className: "text-gray-700 font-medium", children: format(val) }); } else if (typeof val === 'boolean') { cell = val ? /*#__PURE__*/ _jsx(CheckIcon, {}) : /*#__PURE__*/ _jsx(XIcon, {}); } else { cell = /*#__PURE__*/ _jsx("span", { className: "text-gray-700", children: val === null ? '∞' : String(val !== null && val !== void 0 ? val : '—') }); } return /*#__PURE__*/ _jsx("td", { className: "text-center px-4 py-3", children: cell }, plan.id); }) ] }, key); }) }) ] }) }) ] }), /*#__PURE__*/ _jsx("p", { className: "text-center text-white/50 text-sm mt-8", children: t('pricing.faq_note', 'Payment is deducted from your CanHelp balance. Top up is available in Payments.') }) ] }) ] }), confirmPlan && /*#__PURE__*/ _jsx("div", { className: "fixed inset-0 z-50 flex items-center justify-center bg-black/50 px-4", children: /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-2xl shadow-2xl w-full max-w-md p-6", children: [ /*#__PURE__*/ _jsx("h2", { className: "text-lg font-bold text-gray-900 mb-4", children: t('pricing.confirm.title', 'Confirm plan selection') }), previewLoading ? /*#__PURE__*/ _jsx("div", { className: "py-10 text-center text-gray-400", children: t('common.loading', 'Loading...') }) : preview ? /*#__PURE__*/ _jsxs("div", { className: "space-y-3 text-sm text-gray-700", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex justify-between", children: [ /*#__PURE__*/ _jsx("span", { className: "text-gray-500", children: t('pricing.confirm.plan', 'Plan') }), /*#__PURE__*/ _jsx("span", { className: "font-semibold", children: confirmPlan.name }) ] }), preview.type === 'upgrade' && Number(preview.prorated) > 0 && /*#__PURE__*/ _jsxs("div", { className: "flex justify-between", children: [ /*#__PURE__*/ _jsx("span", { className: "text-gray-500", children: t('pricing.confirm.prorated', 'Prorated credit') }), /*#__PURE__*/ _jsxs("span", { className: "text-green-600 font-medium", children: [ "−€", preview.prorated ] }) ] }), preview.type !== 'downgrade' && /*#__PURE__*/ _jsxs("div", { className: "flex justify-between", children: [ /*#__PURE__*/ _jsx("span", { className: "text-gray-500", children: t('pricing.confirm.effective_price', 'To pay') }), /*#__PURE__*/ _jsxs("span", { className: "font-bold text-gray-900", children: [ "€", preview.effectivePrice ] }) ] }), preview.type !== 'downgrade' && /*#__PURE__*/ _jsxs("div", { className: "flex justify-between", children: [ /*#__PURE__*/ _jsx("span", { className: "text-gray-500", children: t('pricing.confirm.your_balance', 'Your balance') }), /*#__PURE__*/ _jsxs("span", { className: preview.canPayFromBalance ? 'text-green-600' : 'text-red-500', children: [ "€", preview.currentBalance ] }) ] }), preview.type === 'downgrade' && /*#__PURE__*/ _jsxs("div", { className: "bg-orange-50 border border-orange-200 rounded-xl p-3 text-orange-800 text-xs", children: [ t('pricing.confirm.downgrade_info', 'The switch to the new plan will happen automatically after the current period ends.'), preview.scheduledDate && /*#__PURE__*/ _jsxs(_Fragment, { children: [ " ", new Date(preview.scheduledDate).toLocaleDateString('ru-RU') ] }) ] }), preview.type !== 'downgrade' && !preview.canPayFromBalance && /*#__PURE__*/ _jsxs("div", { className: "bg-red-50 border border-red-200 rounded-xl p-3 text-red-700 text-xs", children: [ t('pricing.confirm.insufficient', 'Insufficient balance.'), ' ', /*#__PURE__*/ _jsx(Link, { href: "/payment", className: "underline font-medium", onClick: ()=>setConfirmPlan(null), children: t('pricing.confirm.top_up', 'Top up') }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-3 pt-2", children: [ /*#__PURE__*/ _jsx("button", { onClick: ()=>{ setConfirmPlan(null); setPreview(null); }, className: "flex-1 py-2.5 rounded-xl border border-gray-200 text-sm font-medium text-gray-600 hover:bg-gray-50 transition", children: t('common.cancel', 'Cancel') }), (preview.type === 'downgrade' || preview.canPayFromBalance) && /*#__PURE__*/ _jsx("button", { onClick: handleConfirm, disabled: purchasing, className: "flex-1 py-2.5 rounded-xl text-sm font-semibold text-white transition ".concat(preview.type === 'downgrade' ? 'bg-orange-500 hover:bg-orange-600' : tierBtnColors[confirmPlan.tier].replace('block w-full', '').trim(), " disabled:opacity-50"), children: purchasing ? t('common.loading', 'Loading...') : preview.type === 'downgrade' ? t('pricing.confirm.schedule_downgrade', 'Schedule switch') : t('pricing.confirm.pay', 'Pay') }) ] }) ] }) : null ] }) }) ] }); } %61146undefined148191undefined193221undefined223266undefined268307undefined309353undefined355440undefined442492undefined20582061(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined22172220(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined25212524(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined26792682(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined35223536undefined35923601(0,_lib_auth__WEBPACK_IMPORTED_MODULE_4__/* .useSession */ .wV)undefined36243632(0,_context_locale__WEBPACK_IMPORTED_MODULE_5__/* .useLocale */ .Y)undefined36563664(0,next_navigation__WEBPACK_IMPORTED_MODULE_3__.useRouter)undefined36993706(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined37593766(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined38093816(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined38673874(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined39173924(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined39813988(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined40384045(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined41224130(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined42014208(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getPlans */ .T9)undefined45784591(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getMyDashboard */ .H)undefined48764884(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined49904998(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined56595675(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .previewPlanChange */ .Cs)undefined60026013(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .purchasePlan */ .Je)undefined69946998(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined71027106(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined72277231(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined73767379(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined76167619(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined78857888(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined80768080(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined80828090react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragmentundefined81738176(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined85548558(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined89668970(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined91989201(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined92039211_components_PlanBadge__WEBPACK_IMPORTED_MODULE_7__/* .PlanBadge */ .dundefined94959498(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined99449947(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1043410437(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1072010723(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1101511019(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1132011324(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1132611334react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragmentundefined1149811502(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1233212336(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1298012984(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1365913662(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1384513848(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1401714020(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1438414387(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1473514739(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1564815652(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1586315866(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1603016033(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1635916362(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1650716511(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1671516718(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1680716811(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1705817061(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1746317466(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1769817702(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1800618009(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1801118019_components_PlanBadge__WEBPACK_IMPORTED_MODULE_7__/* .PlanBadge */ .dundefined1838218385(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1920519208(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1948619490(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1977919782(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2049420497(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2100521008(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2104121044(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2122821231(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2174021743(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2256522568(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2296422967(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2311723121(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2328823291(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2355423557(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2376723771(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2394223946(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2413024133(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2440324406(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2478624790(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2497424977(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2526225266(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2577925783(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2596725970(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2625326257(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2677226776(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2696026963(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2724927253(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2780427808(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2823728241(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2824328251react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragmentundefined2874428748(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2912429127(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2912929132(next_link__WEBPACK_IMPORTED_MODULE_2___default())undefined2961329617(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2979629799(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3046730470(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefinedÜÝ }, «webpack/lib/util/registerExternalSerializerœwebpack-sources/PrefixSource‰/******/ 2__webpack_require__ => { // webpackRuntimeModules ìvar __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId)) __webpack_require__.O(0, [1516,9664,9906,2982,587,18,7358], () => (__webpack_exec__(160))); var __webpack_exports__ = __webpack_require__.O(); _N_E = __webpack_exports__; } ]); Ôþÿÿèª(self["webpackChunk_N_E"] = self["webpackChunk_N_E"] || []).push([[6907],{ /***/ 160: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 8880)); /***/ }), /***/ 1592: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ CI: () => (/* binding */ signOut), /* harmony export */ Hh: () => (/* binding */ signUp), /* harmony export */ Jv: () => (/* binding */ signIn), /* harmony export */ wV: () => (/* binding */ useSession), /* harmony export */ yK: () => (/* binding */ authClient) /* harmony export */ }); /* harmony import */ var better_auth_react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6504); const API_URL = "https://api.canhelp.gr" || 0; const authClient = (0,better_auth_react__WEBPACK_IMPORTED_MODULE_0__/* .createAuthClient */ .M)({ baseURL: API_URL }); const { signIn, signOut, signUp, useSession } = authClient; /***/ }), /***/ 2035: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ d: () => (/* binding */ PlanBadge) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); const tierConfig = { free: { label: 'Free', class: 'bg-gray-100 text-gray-500 border border-gray-200', icon: '' }, pro: { label: 'Pro', class: 'bg-green-100 text-green-700 border border-green-200', icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { viewBox: "0 0 16 16", fill: "none", className: "w-3 h-3 inline-block mr-0.5 -mt-px", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z", fill: "currentColor" }) }) }, ultimate: { label: 'Ultimate', class: 'bg-gradient-to-r from-amber-400 via-yellow-400 to-amber-400 text-gray-900 border border-amber-500 shadow-sm shadow-amber-300/50', icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { viewBox: "0 0 16 16", fill: "none", className: "w-3 h-3 inline-block mr-0.5 -mt-px", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z", fill: "currentColor" }) }) } }; function PlanBadge(param) { let { tier, verified, size = 'sm', className = '' } = param; if (tier === 'free' && !verified) return null; const sizeClass = size === 'sm' ? 'text-[10px] px-1.5 py-0.5' : 'text-xs px-2 py-0.5'; if (verified && tier !== 'free') { return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "inline-flex items-center gap-1 rounded-full font-semibold ".concat(sizeClass, " ").concat(tierConfig[tier].class, " ").concat(className), children: [ tier === 'ultimate' ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(StarIcon, { className: "w-3 h-3 fill-gray-900" }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(VerifiedIcon, { className: "w-3 h-3" }), tierConfig[tier].label ] }); } if (verified) { return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "inline-flex items-center gap-0.5 rounded-full font-semibold ".concat(sizeClass, " bg-green-100 text-green-700 border border-green-200 ").concat(className), children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(VerifiedIcon, { className: "w-3 h-3" }) }); } const cfg = tierConfig[tier]; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "inline-flex items-center rounded-full font-semibold ".concat(sizeClass, " ").concat(cfg.class, " ").concat(className), children: [ tier === 'pro' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(StarIcon, { className: "w-3 h-3 mr-0.5 -mt-px" }), tier === 'ultimate' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(StarIcon, { className: "w-3 h-3 mr-0.5 -mt-px fill-gray-900" }), cfg.label ] }); } function StarIcon(param) { let { className = '' } = param; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { viewBox: "0 0 16 16", fill: "none", className: className, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z", fill: "currentColor" }) }); } function VerifiedIcon(param) { let { className = '' } = param; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { viewBox: "0 0 16 16", fill: "none", className: className, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M8 1l2 1.4 2.4-.4 1 2.2 2 1.2-.4 2.4L16 10l-1.8 1.6.4 2.4-2.2.8L10.8 17 8 16.2 5.2 17l-1.2-2.2-2.2-.8.4-2.4L0 10l1-2.2-.4-2.4 2-1.2 1-2.2 2.4.4L8 1z", fill: "#3B82F6" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M5.5 8.5l1.5 1.5 3-3", stroke: "white", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) ] }); } /***/ }), /***/ 8880: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ PricingPage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(9664); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(next_link__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(7541); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(1592); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(9906); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(2982); /* harmony import */ var _components_PlanBadge__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(2035); /* __next_internal_client_entry_do_not_use__ default auto */ const FEATURE_ROWS = [ { key: 'maxMessagesPerDay', labelKey: 'pricing.feat.messages', format: (v)=>v === null ? '∞' : String(v) }, { key: 'maxOrdersPerDay', labelKey: 'pricing.feat.orders', format: (v)=>v === null ? '∞' : String(v) }, { key: 'canContactAll', labelKey: 'pricing.feat.contact_all' }, { key: 'canViewPhone', labelKey: 'pricing.feat.view_phone' }, { key: 'canShowContactInfo', labelKey: 'pricing.feat.show_contact' }, { key: 'hasFavorites', labelKey: 'pricing.feat.favorites' }, { key: 'hasVerifiedBadge', labelKey: 'pricing.feat.verified_badge' }, { key: 'hasGoogleCalendar', labelKey: 'pricing.feat.google_calendar' }, { key: 'hasPersonalSite', labelKey: 'pricing.feat.personal_site' }, { key: 'hasAutoResponse', labelKey: 'pricing.feat.auto_response' }, { key: 'hasAutoMatch', labelKey: 'pricing.feat.auto_match' }, { key: 'highlightedReviews', labelKey: 'pricing.feat.highlighted_reviews' }, { key: 'maxCards', labelKey: 'pricing.feat.cards', format: (v)=>v === null ? '∞' : String(v) }, { key: 'notifyNewTasks', labelKey: 'pricing.feat.notify_tasks' }, { key: 'canUploadVideo', labelKey: 'pricing.feat.video' } ]; function CheckIcon() { return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { viewBox: "0 0 20 20", fill: "currentColor", className: "w-5 h-5 text-green-500 mx-auto", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { fillRule: "evenodd", d: "M16.704 4.153a.75.75 0 01.143 1.052l-8 10.5a.75.75 0 01-1.127.075l-4.5-4.5a.75.75 0 011.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 011.05-.143z", clipRule: "evenodd" }) }); } function XIcon() { return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { viewBox: "0 0 20 20", fill: "currentColor", className: "w-4 h-4 text-gray-300 mx-auto", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M6.28 5.22a.75.75 0 00-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 101.06 1.06L10 11.06l3.72 3.72a.75.75 0 101.06-1.06L11.06 10l3.72-3.72a.75.75 0 00-1.06-1.06L10 8.94 6.28 5.22z" }) }); } const tierOrder = [ 'free', 'pro', 'ultimate' ]; const tierHeaderColors = { free: 'bg-gray-50 border-gray-200', pro: 'bg-green-50 border-green-200', ultimate: 'bg-gradient-to-br from-amber-50 to-yellow-50 border-amber-300' }; const tierPriceColors = { free: 'text-gray-700', pro: 'text-green-700', ultimate: 'text-amber-600' }; const tierBtnColors = { free: 'bg-gray-100 text-gray-700 hover:bg-gray-200', pro: 'bg-green-600 text-white hover:bg-green-700', ultimate: 'bg-gradient-to-r from-amber-500 to-yellow-500 text-white hover:from-amber-600 hover:to-yellow-600' }; function PricingPage() { const { data: session } = (0,_lib_auth__WEBPACK_IMPORTED_MODULE_4__/* .useSession */ .wV)(); const { t } = (0,_context_locale__WEBPACK_IMPORTED_MODULE_5__/* .useLocale */ .Y)(); const router = (0,next_navigation__WEBPACK_IMPORTED_MODULE_3__.useRouter)(); const [plans, setPlans] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [currentPlanId, setCurrentPlanId] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [loading, setLoading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(true); const [confirmPlan, setConfirmPlan] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [preview, setPreview] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [previewLoading, setPreviewLoading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [purchasing, setPurchasing] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); // Fetch plans with abort to prevent stale race conditions (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ let aborted = false; setLoading(true); (0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getPlans */ .T9)().then((data)=>{ if (!aborted) setPlans(data.sort((a, b)=>tierOrder.indexOf(a.tier) - tierOrder.indexOf(b.tier))); }).catch(()=>{}).finally(()=>{ if (!aborted) setLoading(false); }); return ()=>{ aborted = true; }; }, []); const fetchCurrentPlan = ()=>{ if (!session) return; (0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getMyDashboard */ .H)().then((d)=>{ var _d_plan; var _d_plan_id; return setCurrentPlanId((_d_plan_id = (_d_plan = d.plan) === null || _d_plan === void 0 ? void 0 : _d_plan.id) !== null && _d_plan_id !== void 0 ? _d_plan_id : null); }).catch(()=>{}); }; (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(fetchCurrentPlan, [ session ]); // Refresh active plan when admin widget changes it (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ const handler = ()=>fetchCurrentPlan(); window.addEventListener('canhelp:plan-changed', handler); document.addEventListener('visibilitychange', handler); return ()=>{ window.removeEventListener('canhelp:plan-changed', handler); document.removeEventListener('visibilitychange', handler); }; }, [ session ]); async function handleSelectPlan(plan) { if (!session) { router.push('/sign-in'); return; } setConfirmPlan(plan); setPreview(null); setPreviewLoading(true); try { const p = await (0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .previewPlanChange */ .Cs)(plan.id); setPreview(p); } catch (e) { setConfirmPlan(null); } finally{ setPreviewLoading(false); } } async function handleConfirm() { if (!confirmPlan || !preview) return; setPurchasing(true); try { const result = await (0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .purchasePlan */ .Je)(confirmPlan.id, preview.canPayFromBalance); if (result.url && result.params) { const form = document.createElement('form'); form.method = 'POST'; form.action = result.url; Object.entries(result.params).forEach((param)=>{ let [k, v] = param; const inp = document.createElement('input'); inp.type = 'hidden'; inp.name = k; inp.value = v; form.appendChild(inp); }); document.body.appendChild(form); form.submit(); return; } setCurrentPlanId(confirmPlan.id); setConfirmPlan(null); setPreview(null); } catch (e) { // ignore } finally{ setPurchasing(false); } } const visibleFeatures = FEATURE_ROWS; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("main", { className: "min-h-screen py-12 px-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "max-w-5xl mx-auto", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "text-center mb-10", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h1", { className: "text-4xl font-bold text-white mb-3", children: t('pricing.title', 'Pricing') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-white/70 text-lg", children: t('pricing.subtitle') }) ] }), loading ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-center text-white/60 py-20", children: t('common.loading', 'Loading...') }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "grid grid-cols-1 md:grid-cols-3 gap-6 mb-12", children: plans.map((plan)=>{ const isCurrentPlan = plan.id === currentPlanId; const isFree = plan.tier === 'free'; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "rounded-2xl border-2 p-6 bg-white flex flex-col transition ".concat(isCurrentPlan ? 'ring-2 ring-green-500 ring-offset-2' : '', " ").concat(plan.tier === 'ultimate' ? 'border-amber-300 shadow-lg shadow-amber-100' : 'border-gray-200'), children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-2 mb-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components_PlanBadge__WEBPACK_IMPORTED_MODULE_7__/* .PlanBadge */ .d, { tier: plan.tier, size: "md" }), isCurrentPlan && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-xs font-medium text-green-600 bg-green-50 border border-green-200 px-2 py-0.5 rounded-full", children: t('pricing.current_plan', 'Your plan') }), plan.tier === 'pro' && !isCurrentPlan && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-xs font-medium text-green-600 bg-green-50 border border-green-100 px-2 py-0.5 rounded-full", children: t('pricing.popular', 'Popular') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "text-xl font-bold text-gray-900 mb-1", children: plan.name }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-gray-500 text-sm mb-4 min-h-[40px]", children: plan.description }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "text-3xl font-extrabold mb-1 ".concat(tierPriceColors[plan.tier]), children: [ isFree ? t('pricing.free', 'Free') : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [ plan.oldPrice && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "text-lg font-normal text-gray-400 line-through mr-2", children: [ "€", plan.oldPrice ] }), "€", plan.price ] }), !isFree && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "text-base font-normal text-gray-400", children: [ "/", t('pricing.per_month', 'month') ] }) ] }), plan.durationDays && !isFree && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { className: "text-xs text-gray-400 mb-5", children: [ t('pricing.duration', 'Duration'), ": ", plan.durationDays, " ", t('pricing.days', 'days') ] }), isFree && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "mb-5" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "mt-auto", children: isCurrentPlan ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "w-full py-2.5 text-center text-sm font-semibold text-green-700 bg-green-50 border border-green-200 rounded-xl", children: t('pricing.your_plan', 'Current plan') }) : isFree ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "w-full py-2.5 text-center text-sm font-medium text-gray-400 bg-gray-50 border border-gray-200 rounded-xl", children: t('pricing.free_default', 'Default') }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { onClick: ()=>handleSelectPlan(plan), className: "block w-full py-2.5 text-center text-sm font-semibold rounded-xl transition ".concat(tierBtnColors[plan.tier]), children: [ t('pricing.choose', 'Choose'), " ", plan.name ] }) }) ] }, plan.id); }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-2xl border border-gray-200 overflow-hidden", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "px-6 py-4 border-b border-gray-100", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h3", { className: "font-semibold text-gray-900", children: t('pricing.compare', 'Feature comparison') }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "overflow-x-auto", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("table", { className: "w-full text-sm", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("thead", { children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("tr", { className: "border-b border-gray-100", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "text-left px-6 py-3 text-gray-500 font-medium w-1/2", children: t('pricing.feature', 'Feature') }), plans.map((plan)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "text-center px-4 py-3 font-medium text-gray-700", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex flex-col items-center gap-1", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components_PlanBadge__WEBPACK_IMPORTED_MODULE_7__/* .PlanBadge */ .d, { tier: plan.tier, size: "sm" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-xs text-gray-400", children: plan.tier === 'free' ? t('pricing.free', 'Free') : "€".concat(plan.price) }) ] }) }, plan.id)) ] }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("tbody", { children: visibleFeatures.map((param)=>{ let { key, labelKey, format } = param; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("tr", { className: "border-b border-gray-50 hover:bg-gray-50/50 transition", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-6 py-3 text-gray-600", children: t(labelKey, labelKey) }), plans.map((plan)=>{ const val = plan[key]; let cell; if (format) { cell = /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-gray-700 font-medium", children: format(val) }); } else if (typeof val === 'boolean') { cell = val ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(CheckIcon, {}) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(XIcon, {}); } else { cell = /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-gray-700", children: val === null ? '∞' : String(val !== null && val !== void 0 ? val : '—') }); } return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "text-center px-4 py-3", children: cell }, plan.id); }) ] }, key); }) }) ] }) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-center text-white/50 text-sm mt-8", children: t('pricing.faq_note', 'Payment is deducted from your CanHelp balance. Top up is available in Payments.') }) ] }) ] }), confirmPlan && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "fixed inset-0 z-50 flex items-center justify-center bg-black/50 px-4", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-2xl shadow-2xl w-full max-w-md p-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "text-lg font-bold text-gray-900 mb-4", children: t('pricing.confirm.title', 'Confirm plan selection') }), previewLoading ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "py-10 text-center text-gray-400", children: t('common.loading', 'Loading...') }) : preview ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-3 text-sm text-gray-700", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex justify-between", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-gray-500", children: t('pricing.confirm.plan', 'Plan') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "font-semibold", children: confirmPlan.name }) ] }), preview.type === 'upgrade' && Number(preview.prorated) > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex justify-between", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-gray-500", children: t('pricing.confirm.prorated', 'Prorated credit') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "text-green-600 font-medium", children: [ "−€", preview.prorated ] }) ] }), preview.type !== 'downgrade' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex justify-between", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-gray-500", children: t('pricing.confirm.effective_price', 'To pay') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "font-bold text-gray-900", children: [ "€", preview.effectivePrice ] }) ] }), preview.type !== 'downgrade' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex justify-between", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-gray-500", children: t('pricing.confirm.your_balance', 'Your balance') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: preview.canPayFromBalance ? 'text-green-600' : 'text-red-500', children: [ "€", preview.currentBalance ] }) ] }), preview.type === 'downgrade' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-orange-50 border border-orange-200 rounded-xl p-3 text-orange-800 text-xs", children: [ t('pricing.confirm.downgrade_info', 'The switch to the new plan will happen automatically after the current period ends.'), preview.scheduledDate && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [ " ", new Date(preview.scheduledDate).toLocaleDateString('ru-RU') ] }) ] }), preview.type !== 'downgrade' && !preview.canPayFromBalance && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-red-50 border border-red-200 rounded-xl p-3 text-red-700 text-xs", children: [ t('pricing.confirm.insufficient', 'Insufficient balance.'), ' ', /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)((next_link__WEBPACK_IMPORTED_MODULE_2___default()), { href: "/payment", className: "underline font-medium", onClick: ()=>setConfirmPlan(null), children: t('pricing.confirm.top_up', 'Top up') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-3 pt-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>{ setConfirmPlan(null); setPreview(null); }, className: "flex-1 py-2.5 rounded-xl border border-gray-200 text-sm font-medium text-gray-600 hover:bg-gray-50 transition", children: t('common.cancel', 'Cancel') }), (preview.type === 'downgrade' || preview.canPayFromBalance) && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: handleConfirm, disabled: purchasing, className: "flex-1 py-2.5 rounded-xl text-sm font-semibold text-white transition ".concat(preview.type === 'downgrade' ? 'bg-orange-500 hover:bg-orange-600' : tierBtnColors[confirmPlan.tier].replace('block w-full', '').trim(), " disabled:opacity-50"), children: purchasing ? t('common.loading', 'Loading...') : preview.type === 'downgrade' ? t('pricing.confirm.schedule_downgrade', 'Schedule switch') : t('pricing.confirm.pay', 'Pay') }) ] }) ] }) : null ] }) }) ] }); } /***/ }) }, /******/ __webpack_require__ => { // webpackRuntimeModules /******/ var __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId)) /******/ __webpack_require__.O(0, [1516,9664,9906,2982,587,18,7358], () => (__webpack_exec__(160))); /******/ var __webpack_exports__ = __webpack_require__.O(); /******/ _N_E = __webpack_exports__; /******/ } ]); xÿÿÿØþÿÿ `4ÙþÿÿW(self["webpackChunk_N_E"] = self["webpackChunk_N_E"] || []).push([[6907],{ /***/ 160: ØþÿÿˆÚþÿÿUimport(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/pricing/page.tsx"); k082Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 8880))undefined{ÿÿÿ|ÿÿÿ{ÿÿÿÖþÿÿwÿÿÿÖþÿÿ‚Øþÿÿƒ„{ÿÿÿ|ÿÿÿ{ÿÿÿßÖþÿÿwÿÿÿÖþÿÿàØþÿÿáâ{ÿÿÿ|ÿÿÿ{ÿÿÿ, /***/ 8880: ÕþÿÿvÿÿÿÕþÿÿüþÿÿ×þÿÿzÂÿÿýþÿÿzÿÿÿ{ÿÿÿzÿÿÿÃÕÅzÿÿÿìvar __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId)) __webpack_require__.O(0, [1516,9664,9906,2982,587,18,7358], () => (__webpack_exec__(160))); var __webpack_exports__ = __webpack_require__.O(); yÿÿÿÆÇÈ ÚT«webpack/lib/util/registerExternalSerializerœwebpack-sources/ConcatSource€`«webpack/lib/util/registerExternalSerializer™webpack-sources/RawSourceX(self["webpackChunk_N_E"] = self["webpackChunk_N_E"] || []).push([[3698],{ /***/ 1258: «webpack/lib/util/registerExternalSerializerœwebpack-sources/CachedSource d«webpack/lib/util/registerExternalSerializerœwebpack-sources/ConcatSource€«webpack/lib/util/registerExternalSerializer™webpack-sources/RawSource_/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; «webpack/lib/util/registerExternalSerializerœwebpack-sources/CachedSource Ê«webpack/lib/util/registerExternalSerializerœwebpack-sources/ConcatSource€«webpack/lib/util/registerExternalSerializer™webpack-sources/RawSourceÖ/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ E: () => (/* binding */ shortName), /* harmony export */ H: () => (/* binding */ formatShortName) /* harmony export */ }); «webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourceé/** * Shortens the last name to first letter + period. * "ИваМ ПетрПв" → "ИваМ П." * Works with a pre-composed full name string. */ export function shortName(fullName) { if (!(fullName === null || fullName === void 0 ? void 0 : fullName.trim())) return '—'; const parts = fullName.trim().split(/\s+/); if (parts.length < 2 || !parts[1]) return parts[0]; return "".concat(parts[0], " ").concat(parts[1][0].toUpperCase(), "."); } /** * Formats separate firstName + lastName fields, shortening the last name. * Falls back to parsing fullName if firstName is not available. */ export function formatShortName(firstName, lastName, fallbackName) { if (firstName === null || firstName === void 0 ? void 0 : firstName.trim()) { const l = lastName === null || lastName === void 0 ? void 0 : lastName.trim(); return l ? "".concat(firstName.trim(), " ").concat(l[0].toUpperCase(), ".") : firstName.trim(); } return shortName(fallbackName); } CˆŽTZ€€€†buffer†source„size„maps„hash±/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ E: () => (/* binding */ shortName), /* harmony export */ H: () => (/* binding */ formatShortName) /* harmony export */ }); /** * Shortens the last name to first letter + period. * "ИваМ ПетрПв" → "ИваМ П." * Works with a pre-composed full name string. */ function shortName(fullName) { if (!(fullName === null || fullName === void 0 ? void 0 : fullName.trim())) return '—'; const parts = fullName.trim().split(/\s+/); if (parts.length < 2 || !parts[1]) return parts[0]; return "".concat(parts[0], " ").concat(parts[1][0].toUpperCase(), "."); } /** * Formats separate firstName + lastName fields, shortening the last name. * Falls back to parsing fullName if firstName is not available. */ function formatShortName(firstName, lastName, fallbackName) { if (firstName === null || firstName === void 0 ? void 0 : firstName.trim()) { const l = lastName === null || lastName === void 0 ? void 0 : lastName.trim(); return l ? "".concat(firstName.trim(), " ").concat(l[0].toUpperCase(), ".") : firstName.trim(); } return shortName(fallbackName); } €”{"finalSource":true}ƒmap‹bufferedMap ConcatSourceRawSourceÖ/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ E: () => (/* binding */ shortName), /* harmony export */ H: () => (/* binding */ formatShortName) /* harmony export */ }); ReplaceSourceRawSourceé/** * Shortens the last name to first letter + period. * "ИваМ ПетрПв" → "ИваМ П." * Works with a pre-composed full name string. */ export function shortName(fullName) { if (!(fullName === null || fullName === void 0 ? void 0 : fullName.trim())) return '—'; const parts = fullName.trim().split(/\s+/); if (parts.length < 2 || !parts[1]) return parts[0]; return "".concat(parts[0], " ").concat(parts[1][0].toUpperCase(), "."); } /** * Formats separate firstName + lastName fields, shortening the last name. * Falls back to parsing fullName if firstName is not available. */ export function formatShortName(firstName, lastName, fallbackName) { if (firstName === null || firstName === void 0 ? void 0 : firstName.trim()) { const l = lastName === null || lastName === void 0 ? void 0 : lastName.trim(); return l ? "".concat(firstName.trim(), " ").concat(l[0].toUpperCase(), ".") : firstName.trim(); } return shortName(fallbackName); } 136142undefined596602undefined /***/ }) €†buffer†source„size„maps„hash/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ E: () => (/* binding */ shortName), /* harmony export */ H: () => (/* binding */ formatShortName) /* harmony export */ }); /** * Shortens the last name to first letter + period. * "ИваМ ПетрПв" → "ИваМ П." * Works with a pre-composed full name string. */ function shortName(fullName) { if (!(fullName === null || fullName === void 0 ? void 0 : fullName.trim())) return '—'; const parts = fullName.trim().split(/\s+/); if (parts.length < 2 || !parts[1]) return parts[0]; return "".concat(parts[0], " ").concat(parts[1][0].toUpperCase(), "."); } /** * Formats separate firstName + lastName fields, shortening the last name. * Falls back to parsing fullName if firstName is not available. */ function formatShortName(firstName, lastName, fallbackName) { if (firstName === null || firstName === void 0 ? void 0 : firstName.trim()) { const l = lastName === null || lastName === void 0 ? void 0 : lastName.trim(); return l ? "".concat(firstName.trim(), " ").concat(l[0].toUpperCase(), ".") : firstName.trim(); } return shortName(fallbackName); } /***/ }) €”{"finalSource":true}ƒmap‹bufferedMap  ConcatSourceRawSource_/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; þÖ/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ E: () => (/* binding */ shortName), /* harmony export */ H: () => (/* binding */ formatShortName) /* harmony export */ }); ReplaceSourceRawSourceé/** * Shortens the last name to first letter + period. * "ИваМ ПетрПв" → "ИваМ П." * Works with a pre-composed full name string. */ export function shortName(fullName) { if (!(fullName === null || fullName === void 0 ? void 0 : fullName.trim())) return '—'; const parts = fullName.trim().split(/\s+/); if (parts.length < 2 || !parts[1]) return parts[0]; return "".concat(parts[0], " ").concat(parts[1][0].toUpperCase(), "."); } /** * Formats separate firstName + lastName fields, shortening the last name. * Falls back to parsing fullName if firstName is not available. */ export function formatShortName(firstName, lastName, fallbackName) { if (firstName === null || firstName === void 0 ? void 0 : firstName.trim()) { const l = lastName === null || lastName === void 0 ? void 0 : lastName.trim(); return l ? "".concat(firstName.trim(), " ").concat(l[0].toUpperCase(), ".") : firstName.trim(); } return shortName(fallbackName); } 136142undefined596602undefined RawSource /***/ }), /***/ 1592:  ú «webpack/lib/util/registerExternalSerializerœwebpack-sources/ConcatSource€«webpack/lib/util/registerExternalSerializer™webpack-sources/RawSource_/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; «webpack/lib/util/registerExternalSerializerœwebpack-sources/CachedSource w«webpack/lib/util/registerExternalSerializerœwebpack-sources/ConcatSource€«webpack/lib/util/registerExternalSerializer™webpack-sources/RawSourceå/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ CI: () => (/* binding */ signOut), /* harmony export */ Hh: () => (/* binding */ signUp), /* harmony export */ Jv: () => (/* binding */ signIn), /* harmony export */ wV: () => (/* binding */ useSession), /* harmony export */ yK: () => (/* binding */ authClient) /* harmony export */ }); /* harmony import */ var better_auth_react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6504); «webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSource import { createAuthClient } from 'better-auth/react'; const API_URL = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; export const authClient = createAuthClient({ baseURL: API_URL }); export const { signIn, signOut, signUp, useSession } = authClient; d4FdiE‚ˆœ«È΀˜"https://api.canhelp.gr"0€Ì(0,better_auth_react__WEBPACK_IMPORTED_MODULE_0__/* .createAuthClient */ .M)€€†buffer†source„size„maps„hashÌ/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ CI: () => (/* binding */ signOut), /* harmony export */ Hh: () => (/* binding */ signUp), /* harmony export */ Jv: () => (/* binding */ signIn), /* harmony export */ wV: () => (/* binding */ useSession), /* harmony export */ yK: () => (/* binding */ authClient) /* harmony export */ }); /* harmony import */ var better_auth_react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6504); const API_URL = "https://api.canhelp.gr" || 0; const authClient = (0,better_auth_react__WEBPACK_IMPORTED_MODULE_0__/* .createAuthClient */ .M)({ baseURL: API_URL }); const { signIn, signOut, signUp, useSession } = authClient; €”{"finalSource":true}ƒmap‹bufferedMap ConcatSourceRawSourceå/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ CI: () => (/* binding */ signOut), /* harmony export */ Hh: () => (/* binding */ signUp), /* harmony export */ Jv: () => (/* binding */ signIn), /* harmony export */ wV: () => (/* binding */ useSession), /* harmony export */ yK: () => (/* binding */ authClient) /* harmony export */ }); /* harmony import */ var better_auth_react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6504); ReplaceSourceRawSource import { createAuthClient } from 'better-auth/react'; const API_URL = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; export const authClient = createAuthClient({ baseURL: API_URL }); export const { signIn, signOut, signUp, useSession } = authClient; »052undefined70100"https://api.canhelp.gr"undefined1051270undefined130136undefined156171(0,better_auth_react__WEBPACK_IMPORTED_MODULE_0__/* .createAuthClient */ .M)undefined200206undefined /***/ }) ë5/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ CI: () => (/* binding */ signOut), /* harmony export */ Hh: () => (/* binding */ signUp), /* harmony export */ Jv: () => (/* binding */ signIn), /* harmony export */ wV: () => (/* binding */ useSession), /* harmony export */ yK: () => (/* binding */ authClient) /* harmony export */ }); /* harmony import */ var better_auth_react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6504); const API_URL = "https://api.canhelp.gr" || 0; const authClient = (0,better_auth_react__WEBPACK_IMPORTED_MODULE_0__/* .createAuthClient */ .M)({ baseURL: API_URL }); const { signIn, signOut, signUp, useSession } = authClient; /***/ }) ìï  ðñðå/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ CI: () => (/* binding */ signOut), /* harmony export */ Hh: () => (/* binding */ signUp), /* harmony export */ Jv: () => (/* binding */ signIn), /* harmony export */ wV: () => (/* binding */ useSession), /* harmony export */ yK: () => (/* binding */ authClient) /* harmony export */ }); /* harmony import */ var better_auth_react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6504); ò import { createAuthClient } from 'better-auth/react'; const API_URL = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; export const authClient = createAuthClient({ baseURL: API_URL }); export const { signIn, signOut, signUp, useSession } = authClient; »052undefined70100"https://api.canhelp.gr"undefined1051270undefined130136undefined156171(0,better_auth_react__WEBPACK_IMPORTED_MODULE_0__/* .createAuthClient */ .M)undefined200206undefinedóô, /***/ 4017:  ¶«webpack/lib/util/registerExternalSerializerœwebpack-sources/ConcatSource€«webpack/lib/util/registerExternalSerializer™webpack-sources/RawSource_/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; «webpack/lib/util/registerExternalSerializerœwebpack-sources/CachedSource <«webpack/lib/util/registerExternalSerializerœwebpack-sources/ConcatSource€«webpack/lib/util/registerExternalSerializer™webpack-sources/RawSource/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ $g: () => (/* binding */ formatPrice), /* harmony export */ GZ: () => (/* binding */ taskDescription), /* harmony export */ Oj: () => (/* binding */ taskTitle) /* harmony export */ }); «webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourceexport function taskTitle(task, locale) { if (locale === 'el' && task.titleEl) return task.titleEl; if (locale === 'en' && task.titleEn) return task.titleEn; if (locale === 'ru' && task.titleRu) return task.titleRu; return task.title; } /** Display a price without decimal cents: 100.00 → 100, 99.5 → 100 */ export function formatPrice(value) { if (value === null || value === undefined || value === '') return ''; return Math.round(Number(value)).toString(); } export function taskDescription(task, locale) { if (locale === 'el' && task.descriptionEl) return task.descriptionEl; if (locale === 'en' && task.descriptionEn) return task.descriptionEn; if (locale === 'ru' && task.descriptionRu) return task.descriptionRu; return task.description; } CDJæì€€€€†buffer†source„size„maps„hash/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ $g: () => (/* binding */ formatPrice), /* harmony export */ GZ: () => (/* binding */ taskDescription), /* harmony export */ Oj: () => (/* binding */ taskTitle) /* harmony export */ }); function taskTitle(task, locale) { if (locale === 'el' && task.titleEl) return task.titleEl; if (locale === 'en' && task.titleEn) return task.titleEn; if (locale === 'ru' && task.titleRu) return task.titleRu; return task.title; } /** Display a price without decimal cents: 100.00 → 100, 99.5 → 100 */ function formatPrice(value) { if (value === null || value === undefined || value === '') return ''; return Math.round(Number(value)).toString(); } function taskDescription(task, locale) { if (locale === 'el' && task.descriptionEl) return task.descriptionEl; if (locale === 'en' && task.descriptionEn) return task.descriptionEn; if (locale === 'ru' && task.descriptionRu) return task.descriptionRu; return task.description; } €”{"finalSource":true}ƒmap‹bufferedMap ConcatSourceRawSource/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ $g: () => (/* binding */ formatPrice), /* harmony export */ GZ: () => (/* binding */ taskDescription), /* harmony export */ Oj: () => (/* binding */ taskTitle) /* harmony export */ }); ReplaceSourceRawSourceexport function taskTitle(task, locale) { if (locale === 'el' && task.titleEl) return task.titleEl; if (locale === 'en' && task.titleEn) return task.titleEn; if (locale === 'ru' && task.titleRu) return task.titleRu; return task.title; } /** Display a price without decimal cents: 100.00 → 100, 99.5 → 100 */ export function formatPrice(value) { if (value === null || value === undefined || value === '') return ''; return Math.round(Number(value)).toString(); } export function taskDescription(task, locale) { if (locale === 'el' && task.descriptionEl) return task.descriptionEl; if (locale === 'en' && task.descriptionEn) return task.descriptionEn; if (locale === 'ru' && task.descriptionRu) return task.descriptionRu; return task.description; } )06undefined324330undefined486492undefined /***/ }) à/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ $g: () => (/* binding */ formatPrice), /* harmony export */ GZ: () => (/* binding */ taskDescription), /* harmony export */ Oj: () => (/* binding */ taskTitle) /* harmony export */ }); function taskTitle(task, locale) { if (locale === 'el' && task.titleEl) return task.titleEl; if (locale === 'en' && task.titleEn) return task.titleEn; if (locale === 'ru' && task.titleRu) return task.titleRu; return task.title; } /** Display a price without decimal cents: 100.00 → 100, 99.5 → 100 */ function formatPrice(value) { if (value === null || value === undefined || value === '') return ''; return Math.round(Number(value)).toString(); } function taskDescription(task, locale) { if (locale === 'el' && task.descriptionEl) return task.descriptionEl; if (locale === 'en' && task.descriptionEn) return task.descriptionEn; if (locale === 'ru' && task.descriptionRu) return task.descriptionRu; return task.description; } /***/ }) áä  åæå/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ $g: () => (/* binding */ formatPrice), /* harmony export */ GZ: () => (/* binding */ taskDescription), /* harmony export */ Oj: () => (/* binding */ taskTitle) /* harmony export */ }); çexport function taskTitle(task, locale) { if (locale === 'el' && task.titleEl) return task.titleEl; if (locale === 'en' && task.titleEn) return task.titleEn; if (locale === 'ru' && task.titleRu) return task.titleRu; return task.title; } /** Display a price without decimal cents: 100.00 → 100, 99.5 → 100 */ export function formatPrice(value) { if (value === null || value === undefined || value === '') return ''; return Math.round(Number(value)).toString(); } export function taskDescription(task, locale) { if (locale === 'el' && task.descriptionEl) return task.descriptionEl; if (locale === 'en' && task.descriptionEn) return task.descriptionEn; if (locale === 'ru' && task.descriptionRu) return task.descriptionRu; return task.description; } )06undefined324330undefined486492undefinedèé, /***/ 5940:  /"«webpack/lib/util/registerExternalSerializerœwebpack-sources/ConcatSource€«webpack/lib/util/registerExternalSerializer™webpack-sources/RawSource_/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; «webpack/lib/util/registerExternalSerializerœwebpack-sources/CachedSource H «webpack/lib/util/registerExternalSerializerœwebpack-sources/ConcatSource€«webpack/lib/util/registerExternalSerializer™webpack-sources/RawSourceÍ/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ Ez: () => (/* binding */ CategoryIcon), /* harmony export */ V: () => (/* binding */ isCategoryIconUrl) /* harmony export */ }); /* unused harmony export resolveCategoryIconUrl */ /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); «webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSource'import { jsx as _jsx } from "react/jsx-runtime"; import React, { useEffect, useMemo, useState } from 'react'; const API_URL = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; export function isCategoryIconUrl(icon) { if (!icon) return false; const value = icon.trim(); return value.startsWith('http://') || value.startsWith('https://') || value.startsWith('/'); } export function resolveCategoryIconUrl(icon) { if (icon.startsWith('/api/')) return "".concat(API_URL).concat(icon); return icon; } export function CategoryIcon(param) { let { icon, alt = '', className, fallback = '📊' } = param; const value = (icon || '').trim(); const [hasError, setHasError] = useState(false); useEffect(()=>{ setHasError(false); }, [ value ]); const url = useMemo(()=>isCategoryIconUrl(value) ? resolveCategoryIconUrl(value) : '', [ value ]); const fallbackUrl = '/category-icons/package.svg'; if (isCategoryIconUrl(value)) { if (hasError && value !== fallbackUrl) { return /*#__PURE__*/ _jsx("img", { src: fallbackUrl, alt: alt, className: className, loading: "lazy", onError: ()=>setHasError(true) }); } if (hasError && value === fallbackUrl) { return /*#__PURE__*/ _jsx("span", { className: className, children: fallback }); } return /*#__PURE__*/ _jsx("img", { src: url, alt: alt, className: className, loading: "lazy", onError: ()=>setHasError(true) }); } return /*#__PURE__*/ _jsx("span", { className: className, children: value || fallback }); } e/1l~Vœ¡·ºÀƒ‰ÀÇÕÝ06@CloûþÊÍ€€˜"https://api.canhelp.gr"0€€€¯(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)°(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)®(0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)¶(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)ÿÿÿ€†buffer†source„size„maps„hash“ /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ Ez: () => (/* binding */ CategoryIcon), /* harmony export */ V: () => (/* binding */ isCategoryIconUrl) /* harmony export */ }); /* unused harmony export resolveCategoryIconUrl */ /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); const API_URL = "https://api.canhelp.gr" || 0; function isCategoryIconUrl(icon) { if (!icon) return false; const value = icon.trim(); return value.startsWith('http://') || value.startsWith('https://') || value.startsWith('/'); } function resolveCategoryIconUrl(icon) { if (icon.startsWith('/api/')) return "".concat(API_URL).concat(icon); return icon; } function CategoryIcon(param) { let { icon, alt = '', className, fallback = '📊' } = param; const value = (icon || '').trim(); const [hasError, setHasError] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ setHasError(false); }, [ value ]); const url = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(()=>isCategoryIconUrl(value) ? resolveCategoryIconUrl(value) : '', [ value ]); const fallbackUrl = '/category-icons/package.svg'; if (isCategoryIconUrl(value)) { if (hasError && value !== fallbackUrl) { return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: fallbackUrl, alt: alt, className: className, loading: "lazy", onError: ()=>setHasError(true) }); } if (hasError && value === fallbackUrl) { return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: className, children: fallback }); } return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: url, alt: alt, className: className, loading: "lazy", onError: ()=>setHasError(true) }); } return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: className, children: value || fallback }); } €”{"finalSource":true}ƒmap‹bufferedMap ConcatSourceRawSourceÍ/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ Ez: () => (/* binding */ CategoryIcon), /* harmony export */ V: () => (/* binding */ isCategoryIconUrl) /* harmony export */ }); /* unused harmony export resolveCategoryIconUrl */ /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); ReplaceSourceRawSource'import { jsx as _jsx } from "react/jsx-runtime"; import React, { useEffect, useMemo, useState } from 'react'; const API_URL = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; export function isCategoryIconUrl(icon) { if (!icon) return false; const value = icon.trim(); return value.startsWith('http://') || value.startsWith('https://') || value.startsWith('/'); } export function resolveCategoryIconUrl(icon) { if (icon.startsWith('/api/')) return "".concat(API_URL).concat(icon); return icon; } export function CategoryIcon(param) { let { icon, alt = '', className, fallback = '📊' } = param; const value = (icon || '').trim(); const [hasError, setHasError] = useState(false); useEffect(()=>{ setHasError(false); }, [ value ]); const url = useMemo(()=>isCategoryIconUrl(value) ? resolveCategoryIconUrl(value) : '', [ value ]); const fallbackUrl = '/category-icons/package.svg'; if (isCategoryIconUrl(value)) { if (hasError && value !== fallbackUrl) { return /*#__PURE__*/ _jsx("img", { src: fallbackUrl, alt: alt, className: className, loading: "lazy", onError: ()=>setHasError(true) }); } if (hasError && value === fallbackUrl) { return /*#__PURE__*/ _jsx("span", { className: className, children: fallback }); } return /*#__PURE__*/ _jsx("img", { src: url, alt: alt, className: className, loading: "lazy", onError: ()=>setHasError(true) }); } return /*#__PURE__*/ _jsx("span", { className: className, children: value || fallback }); } T047undefined49108undefined126156"https://api.canhelp.gr"undefined1611830undefined186192undefined387393undefined527533undefined704711(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined725733(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined816822(0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)undefined10881091(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined13881391(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined15311534(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined17381741(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined /***/ }) Õü /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ Ez: () => (/* binding */ CategoryIcon), /* harmony export */ V: () => (/* binding */ isCategoryIconUrl) /* harmony export */ }); /* unused harmony export resolveCategoryIconUrl */ /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); const API_URL = "https://api.canhelp.gr" || 0; function isCategoryIconUrl(icon) { if (!icon) return false; const value = icon.trim(); return value.startsWith('http://') || value.startsWith('https://') || value.startsWith('/'); } function resolveCategoryIconUrl(icon) { if (icon.startsWith('/api/')) return "".concat(API_URL).concat(icon); return icon; } function CategoryIcon(param) { let { icon, alt = '', className, fallback = '📊' } = param; const value = (icon || '').trim(); const [hasError, setHasError] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ setHasError(false); }, [ value ]); const url = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(()=>isCategoryIconUrl(value) ? resolveCategoryIconUrl(value) : '', [ value ]); const fallbackUrl = '/category-icons/package.svg'; if (isCategoryIconUrl(value)) { if (hasError && value !== fallbackUrl) { return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: fallbackUrl, alt: alt, className: className, loading: "lazy", onError: ()=>setHasError(true) }); } if (hasError && value === fallbackUrl) { return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: className, children: fallback }); } return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: url, alt: alt, className: className, loading: "lazy", onError: ()=>setHasError(true) }); } return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: className, children: value || fallback }); } /***/ }) ÖÙ  ÚÛÚÍ/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ Ez: () => (/* binding */ CategoryIcon), /* harmony export */ V: () => (/* binding */ isCategoryIconUrl) /* harmony export */ }); /* unused harmony export resolveCategoryIconUrl */ /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); Ü'import { jsx as _jsx } from "react/jsx-runtime"; import React, { useEffect, useMemo, useState } from 'react'; const API_URL = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; export function isCategoryIconUrl(icon) { if (!icon) return false; const value = icon.trim(); return value.startsWith('http://') || value.startsWith('https://') || value.startsWith('/'); } export function resolveCategoryIconUrl(icon) { if (icon.startsWith('/api/')) return "".concat(API_URL).concat(icon); return icon; } export function CategoryIcon(param) { let { icon, alt = '', className, fallback = '📊' } = param; const value = (icon || '').trim(); const [hasError, setHasError] = useState(false); useEffect(()=>{ setHasError(false); }, [ value ]); const url = useMemo(()=>isCategoryIconUrl(value) ? resolveCategoryIconUrl(value) : '', [ value ]); const fallbackUrl = '/category-icons/package.svg'; if (isCategoryIconUrl(value)) { if (hasError && value !== fallbackUrl) { return /*#__PURE__*/ _jsx("img", { src: fallbackUrl, alt: alt, className: className, loading: "lazy", onError: ()=>setHasError(true) }); } if (hasError && value === fallbackUrl) { return /*#__PURE__*/ _jsx("span", { className: className, children: fallback }); } return /*#__PURE__*/ _jsx("img", { src: url, alt: alt, className: className, loading: "lazy", onError: ()=>setHasError(true) }); } return /*#__PURE__*/ _jsx("span", { className: className, children: value || fallback }); } T047undefined49108undefined126156"https://api.canhelp.gr"undefined1611830undefined186192undefined387393undefined527533undefined704711(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined725733(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined816822(0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)undefined10881091(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined13881391(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined15311534(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined17381741(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefinedÝÞ, /***/ 6961:  ùþ1«webpack/lib/util/registerExternalSerializerœwebpack-sources/ConcatSource€«webpack/lib/util/registerExternalSerializer™webpack-sources/RawSource_/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; «webpack/lib/util/registerExternalSerializerœwebpack-sources/CachedSource /­«webpack/lib/util/registerExternalSerializerœwebpack-sources/ConcatSource€«webpack/lib/util/registerExternalSerializer™webpack-sources/RawSource+__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ AdminPage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7541); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(9664); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(next_link__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(1592); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(9906); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(2982); /* harmony import */ var _lib_formatName__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(1258); /* harmony import */ var _lib_taskLocale__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(4017); /* harmony import */ var _components_CategoryIcon__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(5940); «webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourceÞ;/* __next_internal_client_entry_do_not_use__ default auto */ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime"; import { useState, useEffect, useRef } from 'react'; import { useRouter } from 'next/navigation'; import Link from 'next/link'; import { useSession } from '@/lib/auth'; import { useLocale } from '@/context/locale'; import * as api from '@/lib/api'; import { request } from '@/lib/api'; import { formatShortName } from '@/lib/formatName'; import { formatPrice } from '@/lib/taskLocale'; import { CategoryIcon } from '@/components/CategoryIcon'; const TEMPLATE_VARS = { 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' ] }; const TEMPLATE_HINT_VARS = Array.from(new Set(Object.values(TEMPLATE_VARS).flat())); const DEFAULT_CATEGORY_ICON_PRESETS = [ { 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 getCatLabel(row, locale) { if (!row) return ''; if (locale === 'en') return row.namesEn || row.namesEl || row.slug || ''; if (locale === 'ru') return row.namesRu || row.namesEl || row.slug || ''; if (locale === 'uk') return row.namesUk || row.namesEl || row.slug || ''; return row.namesEl || row.namesEn || row.slug || ''; } function getLocLabel(row, locale) { if (!row) return ''; if (locale === 'en') return row.nameEn || row.nameEl || row.slug || ''; if (locale === 'ru') return row.nameRu || row.nameEl || row.slug || ''; if (locale === 'uk') return row.nameUk || row.nameEl || row.slug || ''; return row.nameEl || row.nameEn || row.slug || ''; } function CategoryIconPicker(param) { let { value, onChange, onUpload, uploading, error, presets } = param; return /*#__PURE__*/ _jsxs("div", { className: "space-y-2", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 rounded-xl border border-gray-200 bg-white px-3 py-2", children: [ /*#__PURE__*/ _jsx("div", { className: "flex h-12 w-12 items-center justify-center rounded-lg bg-green-50", children: /*#__PURE__*/ _jsx(CategoryIcon, { icon: value, alt: "category icon", className: "h-9 w-9 object-contain text-3xl leading-none", fallback: "\uD83D\uDCE6" }) }), /*#__PURE__*/ _jsx("input", { value: value, onChange: (e)=>onChange(e.target.value), className: "flex-1 border-0 bg-transparent p-0 text-sm outline-none ring-0", placeholder: "/category-icons/package.svg" }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2", children: [ /*#__PURE__*/ _jsxs("label", { className: "inline-flex cursor-pointer items-center rounded-lg border px-3 py-1.5 text-xs font-medium transition ".concat(uploading ? 'border-gray-200 bg-gray-100 text-gray-400' : 'border-green-300 bg-green-50 text-green-700 hover:bg-green-100'), children: [ uploading ? 'Uploading...' : 'Upload SVG', /*#__PURE__*/ _jsx("input", { type: "file", accept: ".svg,image/svg+xml", className: "hidden", disabled: uploading, onChange: async (e)=>{ var _e_target_files; const file = (_e_target_files = e.target.files) === null || _e_target_files === void 0 ? void 0 : _e_target_files[0]; if (!file) return; await onUpload(file); e.target.value = ''; } }) ] }), /*#__PURE__*/ _jsx("span", { className: "text-xs text-gray-500", children: "or choose from presets" }) ] }), /*#__PURE__*/ _jsx("p", { className: "text-[11px] text-gray-500", children: "Preset source: /public/category-icons/presets.json" }), error ? /*#__PURE__*/ _jsx("p", { className: "text-xs text-red-600", children: error }) : null, /*#__PURE__*/ _jsx("div", { className: "grid grid-cols-2 gap-2 sm:grid-cols-3 lg:grid-cols-4", children: presets.map((preset)=>{ const active = value === preset.value; return /*#__PURE__*/ _jsxs("button", { type: "button", onClick: ()=>onChange(preset.value), className: "flex h-20 flex-col items-center justify-center gap-1 rounded-lg border px-2 transition ".concat(active ? 'border-green-500 bg-green-50 shadow-sm' : 'border-gray-200 bg-white hover:border-green-300 hover:bg-green-50'), "aria-label": preset.label, title: preset.label, children: [ /*#__PURE__*/ _jsx(CategoryIcon, { icon: preset.value, alt: preset.label, className: "h-8 w-8 object-contain text-3xl leading-none", fallback: "\uD83D\uDCE6" }), /*#__PURE__*/ _jsx("span", { className: "max-w-full truncate text-[11px] font-medium text-gray-600 leading-tight", children: preset.label }) ] }, preset.value); }) }) ] }); } function AdminCatPicker(param) { let { catRows, locale, selected, onAdd, addLabel } = param; const [open, setOpen] = useState(false); const [search, setSearch] = useState(''); const [expandedParent, setExpandedParent] = useState(null); const ref = useRef(null); useEffect(()=>{ function h(e) { if (ref.current && !ref.current.contains(e.target)) { setOpen(false); setSearch(''); } } document.addEventListener('mousedown', h); return ()=>document.removeEventListener('mousedown', h); }, []); const parents = catRows.filter((r)=>!r.parentId); const lowerSearch = search.toLowerCase(); const matchesSearch = (r)=>{ var _r_slug; return !search || getCatLabel(r, locale).toLowerCase().includes(lowerSearch) || ((_r_slug = r.slug) !== null && _r_slug !== void 0 ? _r_slug : '').toLowerCase().includes(lowerSearch); }; return /*#__PURE__*/ _jsxs("div", { className: "relative", ref: ref, children: [ /*#__PURE__*/ _jsxs("button", { type: "button", onClick: ()=>setOpen((v)=>!v), className: "w-full flex items-center gap-1.5 px-3 py-1.5 text-xs transition-colors ".concat(open ? '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: [ /*#__PURE__*/ _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: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4 6h16M4 10h16M4 14h16M4 18h16" }) }), /*#__PURE__*/ _jsx("span", { className: "flex-1 text-left truncate", children: addLabel }), /*#__PURE__*/ _jsx("svg", { className: "w-3 h-3 text-gray-400 shrink-0 transition-transform ".concat(open ? 'rotate-180' : ''), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19 9l-7 7-7-7" }) }) ] }), open && /*#__PURE__*/ _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: [ /*#__PURE__*/ _jsx("div", { className: "sticky top-0 bg-white px-3 py-2 border-b border-gray-100", children: /*#__PURE__*/ _jsx("input", { autoFocus: true, value: search, onChange: (e)=>setSearch(e.target.value), placeholder: "ППОск...", className: "w-full text-xs border border-gray-200 rounded-lg px-2.5 py-1.5 focus:outline-none focus:ring-2 focus:ring-blue-300" }) }), parents.map((parent)=>{ const children = catRows.filter((r)=>r.parentId === parent.id); const parentLabel = getCatLabel(parent, locale); const isExpanded = expandedParent === parent.id; const matchingChildren = children.filter((c)=>!selected.includes(c.slug) && matchesSearch(c)); const parentAvail = !selected.includes(parent.slug) && matchesSearch(parent); const hasChildren = children.length > 0; if (!parentAvail && matchingChildren.length === 0 && search) return null; return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _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: ()=>{ if (hasChildren && !search) { setExpandedParent(isExpanded ? null : parent.id); } else if (parentAvail) { onAdd(parent.slug); setOpen(false); setSearch(''); } }, children: [ parent.icon ? /*#__PURE__*/ _jsx(CategoryIcon, { icon: parent.icon, alt: parentLabel, className: "h-5 w-5 shrink-0 object-contain text-sm leading-none", fallback: "\uD83D\uDCE6" }) : null, /*#__PURE__*/ _jsx("span", { className: "flex-1 font-medium", children: parentLabel }), hasChildren && !search ? /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5 text-gray-400 shrink-0 transition-transform ".concat(isExpanded ? 'rotate-90' : ''), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 5l7 7-7 7" }) }) : null ] }), (isExpanded || !!search) && matchingChildren.map((child)=>/*#__PURE__*/ _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: ()=>{ onAdd(child.slug); setOpen(false); setSearch(''); }, children: [ /*#__PURE__*/ _jsx("span", { className: "w-1.5 h-1.5 rounded-full bg-gray-300 shrink-0" }), /*#__PURE__*/ _jsx("span", { className: "flex-1", children: getCatLabel(child, locale) }) ] }, child.id)) ] }, parent.id); }) ] }) ] }); } function AdminLocPicker(param) { let { locRows, locale, selected, onAdd, addLabel } = param; const [open, setOpen] = useState(false); const [search, setSearch] = useState(''); const [expandedCity, setExpandedCity] = useState(null); const ref = useRef(null); useEffect(()=>{ function h(e) { if (ref.current && !ref.current.contains(e.target)) { setOpen(false); setSearch(''); } } document.addEventListener('mousedown', h); return ()=>document.removeEventListener('mousedown', h); }, []); const cities = locRows.filter((r)=>!r.parentId); const lowerSearch = search.toLowerCase(); const matchesSearch = (r)=>{ var _r_slug; return !search || getLocLabel(r, locale).toLowerCase().includes(lowerSearch) || ((_r_slug = r.slug) !== null && _r_slug !== void 0 ? _r_slug : '').toLowerCase().includes(lowerSearch); }; return /*#__PURE__*/ _jsxs("div", { className: "relative", ref: ref, children: [ /*#__PURE__*/ _jsxs("button", { type: "button", onClick: ()=>setOpen((v)=>!v), className: "w-full flex items-center gap-1.5 px-3 py-1.5 text-xs transition-colors ".concat(open ? '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: [ /*#__PURE__*/ _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: [ /*#__PURE__*/ _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" }), /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 11a3 3 0 11-6 0 3 3 0 016 0z" }) ] }), /*#__PURE__*/ _jsx("span", { className: "flex-1 text-left truncate", children: addLabel }), /*#__PURE__*/ _jsx("svg", { className: "w-3 h-3 text-gray-400 shrink-0 transition-transform ".concat(open ? 'rotate-180' : ''), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19 9l-7 7-7-7" }) }) ] }), open && /*#__PURE__*/ _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: [ /*#__PURE__*/ _jsx("div", { className: "sticky top-0 bg-white px-3 py-2 border-b border-gray-100", children: /*#__PURE__*/ _jsx("input", { autoFocus: true, value: search, onChange: (e)=>setSearch(e.target.value), placeholder: "ППОск...", className: "w-full text-xs border border-gray-200 rounded-lg px-2.5 py-1.5 focus:outline-none focus:ring-2 focus:ring-blue-300" }) }), cities.map((city)=>{ const districts = locRows.filter((r)=>r.parentId === city.id); const cityLabel = getLocLabel(city, locale); const isExpanded = expandedCity === city.id; const hasDistricts = districts.length > 0; const matchingDistricts = districts.filter((d)=>!selected.includes(d.slug) && matchesSearch(d)); const cityAvail = !selected.includes(city.slug) && matchesSearch(city); if (!cityAvail && matchingDistricts.length === 0 && search) return null; return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _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: ()=>{ if (hasDistricts && !search) { setExpandedCity(isExpanded ? null : city.id); } else if (cityAvail) { onAdd(city.slug); setOpen(false); setSearch(''); } }, children: [ /*#__PURE__*/ _jsx("svg", { className: "w-3 h-3 text-gray-300 shrink-0", fill: "currentColor", viewBox: "0 0 24 24", children: /*#__PURE__*/ _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" }) }), /*#__PURE__*/ _jsx("span", { className: "flex-1 font-medium", children: cityLabel }), hasDistricts && !search ? /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5 text-gray-400 shrink-0 transition-transform ".concat(isExpanded ? 'rotate-90' : ''), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 5l7 7-7 7" }) }) : null ] }), (isExpanded || !!search) && matchingDistricts.map((d)=>/*#__PURE__*/ _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: ()=>{ onAdd(d.slug); setOpen(false); setSearch(''); }, children: [ /*#__PURE__*/ _jsx("span", { className: "w-1.5 h-1.5 rounded-full bg-gray-300 shrink-0" }), /*#__PURE__*/ _jsx("span", { className: "flex-1", children: getLocLabel(d, locale) }) ] }, d.id)) ] }, city.id); }) ] }) ] }); } export default function AdminPage() { var _session_user, _stats_tokensByMonth; const router = useRouter(); const { data: session, isPending } = useSession(); const { t, locale } = useLocale(); const [tab, setTab] = useState('stats'); const [sidebarCollapsed, setSidebarCollapsed] = useState(false); useEffect(()=>{ setSidebarCollapsed(window.innerWidth < 1024); }, []); // Stats const [stats, setStats] = useState(null); // Users const [users, setUsers] = useState([]); const [usersPage, setUsersPage] = useState(1); const [usersTotal, setUsersTotal] = useState(0); const [usersQ, setUsersQ] = useState(''); const [usersQInput, setUsersQInput] = useState(''); const [usersRole, setUsersRole] = useState(''); // Tasks const [tasks, setTasks] = useState([]); const [tasksPage, setTasksPage] = useState(1); const [tasksTotal, setTasksTotal] = useState(0); const [tasksQ, setTasksQ] = useState(''); const [tasksQInput, setTasksQInput] = useState(''); const [tasksStatus, setTasksStatus] = useState(''); // Reports const [reports, setReports] = useState([]); const [reportsPage, setReportsPage] = useState(1); const [reportsTotal, setReportsTotal] = useState(0); const [pendingReportsCount, setPendingReportsCount] = useState(0); // Specialist card moderation const [moderationCards, setModerationCards] = useState([]); const [moderationCardsPage, setModerationCardsPage] = useState(1); const [moderationCardsTotal, setModerationCardsTotal] = useState(0); const [moderationCardsLoading, setModerationCardsLoading] = useState(false); const [pendingCardsCount, setPendingCardsCount] = useState(0); // Support tickets const [supportTickets, setSupportTickets] = useState([]); const [supportPage, setSupportPage] = useState(1); const [supportTotal, setSupportTotal] = useState(0); const [supportStatus, setSupportStatus] = useState(''); const [supportType, setSupportType] = useState(''); const [supportQ, setSupportQ] = useState(''); const [supportQInput, setSupportQInput] = useState(''); const [supportReplyId, setSupportReplyId] = useState(null); const [supportReplyText, setSupportReplyText] = useState(''); const [supportReplySaving, setSupportReplySaving] = useState(false); // AI Logs const [logs, setLogs] = useState([]); const [logsPage, setLogsPage] = useState(1); const [logsTotal, setLogsTotal] = useState(0); // Activity Logs const [activityLog, setActivityLog] = useState([]); const [activityTotal, setActivityTotal] = useState(0); const [activityPage, setActivityPage] = useState(1); const [activityEvent, setActivityEvent] = useState(''); const [activityUserId, setActivityUserId] = useState(''); const [activityDateFrom, setActivityDateFrom] = useState(''); const [activityDateTo, setActivityDateTo] = useState(''); const [activityEventTypes, setActivityEventTypes] = useState([]); // Mail Logs const [mailLog, setMailLog] = useState([]); const [mailTotal, setMailTotal] = useState(0); const [mailPage, setMailPage] = useState(1); const [mailEvent, setMailEvent] = useState(''); const [mailDateFrom, setMailDateFrom] = useState(''); const [mailDateTo, setMailDateTo] = useState(''); const [mailEventTypes, setMailEventTypes] = useState([]); // Logs sub-tab const [logsSubTab, setLogsSubTab] = useState('ai'); // Notification Logs const [notifLogs, setNotifLogs] = useState([]); const [notifLogsPage, setNotifLogsPage] = useState(1); const [notifLogsTotal, setNotifLogsTotal] = useState(0); const [notifLogsType, setNotifLogsType] = useState(''); const [notifLogsTypes, setNotifLogsTypes] = useState([]); const [notifLogsDateFrom, setNotifLogsDateFrom] = useState(''); const [notifLogsDateTo, setNotifLogsDateTo] = useState(''); // Notification stats chart const [notifsByDay, setNotifsByDay] = useState([]); const [mailByDay, setMailByDay] = useState([]); // Balance archive const [balanceRows, setBalanceRows] = useState([]); const [balanceTotal, setBalanceTotal] = useState(0); const [balancePage, setBalancePage] = useState(1); const [balanceUserId, setBalanceUserId] = useState(''); const [balanceKind, setBalanceKind] = useState(''); const [topUpSaving, setTopUpSaving] = useState(false); const [withdrawSaving, setWithdrawSaving] = useState(false); // User edit modal const [editUser, setEditUser] = useState(null); const [editUserSaving, setEditUserSaving] = useState(false); const [verifyingEmail, setVerifyingEmail] = useState(false); const [editUserTab, setEditUserTab] = useState('profile'); const [balanceModal, setBalanceModal] = useState(null); const [skillInput, setSkillInput] = useState(''); const [editUserCards, setEditUserCards] = useState([]); const [editUserCardsLoading, setEditUserCardsLoading] = useState(false); const [cardSkillInputs, setCardSkillInputs] = useState({}); const [cardSaving, setCardSaving] = useState({}); const [cardCatSelects, setCardCatSelects] = useState({}); const [cardLocSelects, setCardLocSelects] = useState({}); // Plans const [planRows, setPlanRows] = useState([]); const [planForm, setPlanForm] = useState(null); const [planSaving, setPlanSaving] = useState(false); // Locations const [locRows, setLocRows] = useState([]); const [locForm, setLocForm] = useState(null); const [locSaving, setLocSaving] = useState(false); const [locExpanded, setLocExpanded] = useState(new Set()); // Categories const [catRows, setCatRows] = useState([]); const [catForm, setCatForm] = useState(null); const [catSaving, setCatSaving] = useState(false); const [catExpanded, setCatExpanded] = useState(new Set()); const [catIconUploading, setCatIconUploading] = useState(false); const [catIconError, setCatIconError] = useState(null); const [categoryIconPresets, setCategoryIconPresets] = useState(DEFAULT_CATEGORY_ICON_PRESETS); // Category Skills const [catSkillsExpanded, setCatSkillsExpanded] = useState(new Set()); const [catSkillsCache, setCatSkillsCache] = useState({}); const [catSkillsLoading, setCatSkillsLoading] = useState(new Set()); const [skillForm, setSkillForm] = useState(null); const [skillSaving, setSkillSaving] = useState(false); // Settings const [settingsTab, setSettingsTab] = useState('general'); const [generalForm, setGeneralForm] = useState({ siteName: 'CanHelp', siteUrl: '', contactEmail: '', supportPhone: '' }); const [generalSaving, setGeneralSaving] = useState(false); const [generalSaved, setGeneralSaved] = useState(false); const [smtpForm, setSmtpForm] = useState({ host: '', port: '587', username: '', password: '', fromName: 'CanHelp', fromEmail: '', encryption: 'tls' }); const [smtpSaving, setSmtpSaving] = useState(false); const [smtpSaved, setSmtpSaved] = useState(false); const [testEmailSending, setTestEmailSending] = useState(false); const [testEmailResult, setTestEmailResult] = useState(null); const [notifTemplates, setNotifTemplates] = useState({ email_verification: { subject: 'ППЎтверЎОте ваш email — {{siteName}}', body: '' }, registration_success: { subject: 'ДПбрП пПжалПвать в {{siteName}}!', body: '' }, password_reset: { subject: 'ВПсстаМПвлеМОе парПля — {{siteName}}', body: '' }, new_offer: { subject: 'НПвПе преЎлПжеМОе пП вашей заЎаче «{{taskTitle}}»', body: '' }, new_task: { subject: 'НПвая заЎача: {{taskTitle}}', body: '' }, offer_accepted: { subject: 'Ваше преЎлПжеМОе прОМятП: {{taskTitle}}', body: '

Ваше преЎлПжеМОе прОМятП! 🎉

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

ЗаказчОк прОМял ваше преЎлПжеМОе Ма выпПлМеМОе заЎачО:

{{taskTitle}}

СуЌЌа: {{price}}€

Открыть чат →' }, new_message: { subject: 'НПвПе сППбщеМОе Пт {{senderName}}', body: '

НПвПе сППбщеМОе

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

ВаЌ МапОсал(а) {{senderName}}:

"{{preview}}"

ОтветОть →' }, offer_declined: { subject: 'Ваше преЎлПжеМОе ПтклПМеМП: {{taskTitle}}', body: '

Ваше преЎлПжеМОе ПтклПМеМП

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

К сПжалеМОю, заказчОк ПтклПМОл ваше преЎлПжеМОе Ма:

{{taskTitle}}

НайтО ЎругОе заказы →' }, offer_other_accepted: { subject: 'ВыбраМ ЎругПй ОспПлМОтель: {{taskTitle}}', body: '

ВыбраМ ЎругПй ОспПлМОтель

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

ЗаказчОк выбрал ЎругПгП ОспПлМОтеля Ўля заЎаМОя:

{{taskTitle}}

НайтО ЎругОе заказы →' }, task_updated: { subject: 'ЗаЎаМОе ПбМПвлеМП: {{taskTitle}}', body: '

ЗаЎаМОе ПбМПвлеМП

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

ЗаказчОк ПбМПвОл ЎеталО заЎаМОя:

{{taskTitle}}

СЌПтреть заказ →' }, deadline_reminder: { subject: 'ЗаЎаМОе Остекает завтра: {{taskTitle}}', body: '

НапПЌОМаМОе П ЎеЎлайМе

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

Ваше заЎаМОе Остекает через 24 часа. ОбМПвОте ЎеЎлайМ, ОМаче заЎаМОе буЎет автПЌатОческО сМятП с публОкацОО.

{{taskTitle}}

РеЎактОрПвать заЎаМОе →' }, task_archived: { subject: 'ЗаЎаМОе сМятП с публОкацОО: {{taskTitle}}', body: '

ЗаЎаМОе перевеЎеМП в черМПвОк

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

Ваше заЎаМОе ОстеклП О былП автПЌатОческО перевеЎеМП в черМПвОк. ОбМПвОте ЎеЎлайМ, чтПбы ПпублОкПвать егП сМПва.

{{taskTitle}}

РеЎактОрПвать заЎаМОе →' }, referral_reward: { subject: 'Вы пПлучОлО реферальМую МаграЎу — {{siteName}}', body: '

Вы пПлучОлО реферальМую МаграЎу! 🎁

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

Друг зарегОстрОрПвался пП вашей реферальМПй ссылке. На ваш аккауМт ЎПбавлеМП {{days}} ЎМей ЎПступа к плаМу {{planName}}!

+{{days}} ЎМей — {{planName}}

ПерейтО к аккауМту →' }, referral_reward_el: { subject: 'Λάβατε αΜταΌοιβή παραποΌπής — {{siteName}}', body: '

Λάβατε αΜταΌοιβή παραποΌπής! 🎁

Γεια {{userName}},

ΈΜας φίλος εγγράφηκε χρησιΌοποιώΜτας τοΜ σύΜΎεσΌο παραποΌπής σας. ΣτοΜ λογαριασΌό σας προστέΞηκαΜ {{days}} ηΌέρες πρόσβασης στο πλάΜο {{planName}}!

+{{days}} ηΌέρες — {{planName}}

Δες τοΜ λογαριασΌό σου →' }, referral_reward_en: { subject: 'You received a referral reward — {{siteName}}', body: '

You received a referral reward! 🎁

Hi {{userName}},

A friend registered using your referral link. {{days}} days of {{planName}} access have been added to your account!

+{{days}} days — {{planName}}

View your account →' }, referral_reward_ru: { subject: 'Вы пПлучОлО реферальМую МаграЎу — {{siteName}}', body: '

Вы пПлучОлО реферальМую МаграЎу! 🎁

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

Друг зарегОстрОрПвался пП вашей реферальМПй ссылке. На ваш аккауМт ЎПбавлеМП {{days}} ЎМей ЎПступа к плаМу {{planName}}!

+{{days}} ЎМей — {{planName}}

ПерейтО к аккауМту →' } }); const [editingTemplate, setEditingTemplate] = useState(null); const [templateLocale, setTemplateLocale] = useState('el'); const [templateSaving, setTemplateSaving] = useState(false); const [templateTranslating, setTemplateTranslating] = useState(false); const [ePayForm, setEPayForm] = useState({ merchantId: '', apiUser: '', apiPassword: '', environment: 'test', confirmationUrl: '', cancelUrl: '', enabled: false }); const [ePaySaving, setEPaySaving] = useState(false); const [ePaySaved, setEPaySaved] = useState(false); const [referralForm, setReferralForm] = useState({ enabled: false, planId: '', days: '30' }); const [referralSaving, setReferralSaving] = useState(false); const [referralSaved, setReferralSaved] = useState(false); const [seoForm, setSeoForm] = useState({ maintenanceMode: false, indexingEnabled: true, headScripts: '', siteTitleEl: '', siteTitleEn: '', siteTitleRu: '', siteTitleUk: '', siteDescriptionEl: '', siteDescriptionEn: '', siteDescriptionRu: '', siteDescriptionUk: '' }); const [seoSaving, setSeoSaving] = useState(false); const [seoSaved, setSeoSaved] = useState(false); const [seoLangTab, setSeoLangTab] = useState('el'); const [socialForm, setSocialForm] = useState({ telegram: '', instagram: '', facebook: '', twitter: '', youtube: '', tiktok: '', whatsapp: '', viber: '' }); const [socialSaving, setSocialSaving] = useState(false); const [socialSaved, setSocialSaved] = useState(false); const [telegramForm, setTelegramForm] = useState({ botToken: '', adminChatId: '', channelIdEl: '', channelIdEn: '', channelIdRu: '', channelIdUk: '', notifyRegistrations: false, postNewTasks: false }); const [telegramSaving, setTelegramSaving] = useState(false); const [telegramSaved, setTelegramSaved] = useState(false); const [testingTelegramAdmin, setTestingTelegramAdmin] = useState(false); const [testingTelegramChannel, setTestingTelegramChannel] = useState(false); const [testResultTelegramAdmin, setTestResultTelegramAdmin] = useState(null); const [testResultTelegramChannel, setTestResultTelegramChannel] = useState(null); const [testingLocale, setTestingLocale] = useState(null); const [testResultChannels, setTestResultChannels] = useState({}); const [verifyingTelegramToken, setVerifyingTelegramToken] = useState(false); const [verifyResultTelegramToken, setVerifyResultTelegramToken] = useState(null); // Backup const [backupAutoEnabled, setBackupAutoEnabled] = useState(false); const [backupAutoSaving, setBackupAutoSaving] = useState(false); const [backupTables, setBackupTables] = useState([]); const [backupTablesLoading, setBackupTablesLoading] = useState(false); const [backupStoredFiles, setBackupStoredFiles] = useState([]); const [backupExporting, setBackupExporting] = useState(false); const [backupImporting, setBackupImporting] = useState(null); const [backupRestoring, setBackupRestoring] = useState(null); const [backupMsg, setBackupMsg] = useState(null); const [backupMsgError, setBackupMsgError] = useState(false); const setBackupSuccess = (msg)=>{ setBackupMsg(msg); setBackupMsgError(false); }; const setBackupError = (msg)=>{ setBackupMsg(msg); setBackupMsgError(true); }; // ─── Translations state ─────────────────────────────────────────────────── const [transStats, setTransStats] = useState(null); const [transStatsLoading, setTransStatsLoading] = useState(false); const [transLang, setTransLang] = useState('uk'); const [transFromLang, setTransFromLang] = useState('el'); const [transTableTranslating, setTransTableTranslating] = useState({}); const [transMsg, setTransMsg] = useState(null); const [transPreview, setTransPreview] = useState(null); // ─── Referrals state ───────────────────────────────────────────────────── const [referralsData, setReferralsData] = useState(null); const [referralsLoading, setReferralsLoading] = useState(false); const [referralsExpanded, setReferralsExpanded] = useState(new Set()); // ─── Push state ────────────────────────────────────────────────────────── const [pushMode, setPushMode] = useState('broadcast'); const [pushTargetUserId, setPushTargetUserId] = useState(''); const [pushTitle, setPushTitle] = useState(''); const [pushBody, setPushBody] = useState(''); const [pushType, setPushType] = useState('general'); const [pushReferenceId, setPushReferenceId] = useState(''); const [pushOnlyActive, setPushOnlyActive] = useState(true); const [pushSending, setPushSending] = useState(false); const [pushResult, setPushResult] = useState(null); const [pushError, setPushError] = useState(null); const [loading, setLoading] = useState(false); const isAdmin = !isPending && session && ((_session_user = session.user) === null || _session_user === void 0 ? void 0 : _session_user.role) === 'admin'; useEffect(()=>{ var _session_user; if (!isPending && !session) router.push('/login'); if (!isPending && session && ((_session_user = session.user) === null || _session_user === void 0 ? void 0 : _session_user.role) !== 'admin') router.push('/'); }, [ session, isPending ]); useEffect(()=>{ if (!isAdmin) return; api.getAdminStats().then(setStats).catch(()=>{}); api.getAdminNotifStats().then(setNotifsByDay).catch(()=>{}); api.getAdminMailStats().then(setMailByDay).catch(()=>{}); api.getAdminReports(1, 'pending').then((d)=>setPendingReportsCount(d.total)).catch(()=>{}); api.getAdminSpecialistCards(1, 'pending').then((d)=>setPendingCardsCount(d.total)).catch(()=>{}); }, [ isAdmin ]); useEffect(()=>{ if (!isAdmin || tab !== 'users') return; setLoading(true); api.getAdminUsers(usersPage, usersQ || undefined, usersRole || undefined).then((d)=>{ setUsers(d.data); setUsersTotal(d.total); }).catch(()=>{}).finally(()=>setLoading(false)); }, [ isAdmin, tab, usersPage, usersQ, usersRole ]); useEffect(()=>{ if (!isAdmin || tab !== 'tasks') return; setLoading(true); api.getAdminTasks(tasksPage, tasksQ || undefined, tasksStatus || undefined).then((d)=>{ setTasks(d.data); setTasksTotal(d.total); }).catch(()=>{}).finally(()=>setLoading(false)); }, [ isAdmin, tab, tasksPage, tasksQ, tasksStatus ]); useEffect(()=>{ if (!isAdmin || tab !== 'reports') return; setLoading(true); api.getAdminReports(reportsPage).then((d)=>{ setReports(d.data); setReportsTotal(d.total); }).catch(()=>{}).finally(()=>setLoading(false)); }, [ isAdmin, tab, reportsPage ]); useEffect(()=>{ if (!isAdmin || tab !== 'moderation') return; setModerationCardsLoading(true); api.getAdminSpecialistCards(moderationCardsPage, 'review').then((d)=>{ setModerationCards(d.data); setModerationCardsTotal(d.total); }).catch(()=>{}).finally(()=>setModerationCardsLoading(false)); }, [ isAdmin, tab, moderationCardsPage ]); useEffect(()=>{ if (!isAdmin || tab !== 'support') return; setLoading(true); const params = { page: String(supportPage), limit: '30' }; if (supportStatus) params.status = supportStatus; if (supportType) params.type = supportType; if (supportQ) params.q = supportQ; api.getAdminSupportTickets(params).then((d)=>{ setSupportTickets(d.data); setSupportTotal(d.total); }).catch(()=>{}).finally(()=>setLoading(false)); }, [ isAdmin, tab, supportPage, supportStatus, supportType, supportQ ]); useEffect(()=>{ if (!isAdmin || tab !== 'balances') return; setLoading(true); api.getAdminBalanceHistory({ page: balancePage, userId: balanceUserId || undefined, kind: balanceKind || undefined }).then((d)=>{ setBalanceRows(d.data); setBalanceTotal(d.total); }).catch(()=>{}).finally(()=>setLoading(false)); }, [ isAdmin, tab, balancePage, balanceUserId, balanceKind ]); useEffect(()=>{ if (!isAdmin || tab !== 'logs') return; if (logsSubTab === 'ai') { setLoading(true); api.getAdminAiLogs(logsPage).then((d)=>{ setLogs(d.data); setLogsTotal(d.total); }).catch(()=>{}).finally(()=>setLoading(false)); } else if (logsSubTab === 'activity') { api.getAdminActivityLogs({ page: activityPage, event: activityEvent || undefined, userId: activityUserId || undefined, dateFrom: activityDateFrom || undefined, dateTo: activityDateTo || undefined }).then((d)=>{ var _d_eventTypes; setActivityLog(d.data); setActivityTotal(d.total); if ((_d_eventTypes = d.eventTypes) === null || _d_eventTypes === void 0 ? void 0 : _d_eventTypes.length) setActivityEventTypes(d.eventTypes); }).catch(()=>{}); } else if (logsSubTab === 'mail') { api.getAdminMailLogs({ page: mailPage, event: mailEvent || undefined, dateFrom: mailDateFrom || undefined, dateTo: mailDateTo || undefined }).then((d)=>{ var _d_eventTypes; setMailLog(d.data); setMailTotal(d.total); if ((_d_eventTypes = d.eventTypes) === null || _d_eventTypes === void 0 ? void 0 : _d_eventTypes.length) setMailEventTypes(d.eventTypes); }).catch(()=>{}); } else if (logsSubTab === 'notifications') { api.getAdminNotifLogs({ page: notifLogsPage, type: notifLogsType || undefined, dateFrom: notifLogsDateFrom || undefined, dateTo: notifLogsDateTo || undefined }).then((d)=>{ var _d_notifTypes; setNotifLogs(d.data); setNotifLogsTotal(d.total); if ((_d_notifTypes = d.notifTypes) === null || _d_notifTypes === void 0 ? void 0 : _d_notifTypes.length) setNotifLogsTypes(d.notifTypes); }).catch(()=>{}); } }, [ isAdmin, tab, logsSubTab, logsPage, activityPage, activityEvent, activityUserId, activityDateFrom, activityDateTo, mailPage, mailEvent, mailDateFrom, mailDateTo, notifLogsPage, notifLogsType, notifLogsDateFrom, notifLogsDateTo ]); useEffect(()=>{ setActivityPage(1); }, [ activityEvent, activityUserId, activityDateFrom, activityDateTo ]); useEffect(()=>{ setMailPage(1); }, [ mailEvent, mailDateFrom, mailDateTo ]); useEffect(()=>{ setNotifLogsPage(1); }, [ notifLogsType, notifLogsDateFrom, notifLogsDateTo ]); useEffect(()=>{ if (!isAdmin || tab !== 'plans') return; api.getAdminPlans().then(setPlanRows).catch(()=>{}); }, [ isAdmin, tab ]); useEffect(()=>{ if (!isAdmin || tab !== 'translations') return; setTransStatsLoading(true); api.getTranslationsStats().then((d)=>setTransStats(d.tables)).catch(()=>{}).finally(()=>setTransStatsLoading(false)); }, [ isAdmin, tab ]); useEffect(()=>{ if (!isAdmin || tab !== 'backup') return; request('/admin/backup/settings').then((d)=>setBackupAutoEnabled(!!d.autoEnabled)).catch(()=>{}); setBackupTablesLoading(true); request('/admin/backup/tables').then((d)=>setBackupTables(d.tables || [])).catch(()=>{}).finally(()=>setBackupTablesLoading(false)); request('/admin/backup/list').then((d)=>setBackupStoredFiles(d.files || [])).catch(()=>{}); }, [ isAdmin, tab ]); useEffect(()=>{ if (!isAdmin || tab !== 'referrals') return; setReferralsLoading(true); api.getAdminReferrals().then((d)=>setReferralsData(d)).catch(()=>{}).finally(()=>setReferralsLoading(false)); }, [ isAdmin, tab ]); // Load plans when users tab opens (for plan selector in edit modal) useEffect(()=>{ if (!isAdmin || tab !== 'users') return; if (planRows.length === 0) api.getAdminPlans().then(setPlanRows).catch(()=>{}); }, [ isAdmin, tab ]); // Reset page when filters change useEffect(()=>{ setUsersPage(1); }, [ usersQ, usersRole ]); useEffect(()=>{ setTasksPage(1); }, [ tasksQ, tasksStatus ]); useEffect(()=>{ setBalancePage(1); }, [ balanceUserId, balanceKind ]); async function sendAdminPush() { if (!pushTitle.trim()) return; if (pushMode === 'user' && !pushTargetUserId.trim()) { setPushError('УкажОте ID пПльзПвателя'); return; } setPushSending(true); setPushError(null); setPushResult(null); try { const payload = { title: pushTitle.trim(), body: pushBody.trim() || undefined, type: pushType.trim() || undefined, referenceId: pushReferenceId.trim() || undefined }; if (pushMode === 'broadcast') { const res = await api.adminBroadcastPush({ ...payload, onlyActive: pushOnlyActive }); setPushResult(res); } else { const res = await api.adminSendPushToUser(pushTargetUserId.trim(), payload); setPushResult(res); } } catch (err) { setPushError((err === null || err === void 0 ? void 0 : err.message) || 'Не уЎалПсь ПтправОть push'); } finally{ setPushSending(false); } } async function toggleUser(id, isActive) { const fn = isActive ? api.deactivateUser : api.activateUser; const updated = await fn(id).catch(()=>null); if (updated) setUsers((prev)=>prev.map((u)=>u.id === id ? updated : u)); } async function changeRole(id, role) { const updated = await api.changeUserRole(id, role).catch(()=>null); if (updated) setUsers((prev)=>prev.map((u)=>u.id === id ? updated : u)); } function openEditUser(u) { setEditUserTab('profile'); setSkillInput(''); setBalanceModal(null); setEditUserCards([]); setCardSkillInputs({}); setCardSaving({}); setCardCatSelects({}); setCardLocSelects({}); setEditUser({ ...u, topUpAmount: '', topUpDescription: '', withdrawAmount: '', withdrawDescription: '' }); api.getAdminUser(u.id).then((fresh)=>setEditUser((prev)=>prev && prev.id === fresh.id ? { ...fresh, topUpAmount: '', topUpDescription: '', withdrawAmount: '', withdrawDescription: '' } : prev)).catch(()=>{}); } function describeFcmFailure(key, message) { if (!key) return message || 'FCM прОМял 0 сППбщеМОй'; if (key === 'THIRD_PARTY_AUTH_ERROR') { return 'ОшОбка APNs/Firebase iOS: прПверьте Apple APNs Auth Key (.p8) О связку Firebase прПекта Ўля iOS-прОлПжеМОя'; } if (key === 'UNREGISTERED') { return 'ТПкеМ устрПйства бПльше Ме валОЎеМ'; } if (key === 'INVALID_ARGUMENT') { return 'НекПрректМый тПкеМ ОлО payload'; } if (key === 'REQUEST_FAILED') { return message || 'FCM request failed before response'; } return message ? "".concat(key, ": ").concat(message) : key; } async function saveEditUser() { if (!editUser) return; setEditUserSaving(true); try { var _editUser_languages, _editUser_showContactInfo, _editUser_notifyNewTasks, _editUser_notifMessages, _editUser_skills, _editUser_siteSettings; const updated = await api.updateAdminUser(editUser.id, { firstName: editUser.firstName, lastName: editUser.lastName, phone: editUser.phone || null, bio: editUser.bio || null, role: editUser.role, planId: editUser.planId || null, isActive: editUser.isActive, locale: editUser.locale, languages: (_editUser_languages = editUser.languages) !== null && _editUser_languages !== void 0 ? _editUser_languages : [], personalSiteSlug: editUser.personalSiteSlug || null, showContactInfo: (_editUser_showContactInfo = editUser.showContactInfo) !== null && _editUser_showContactInfo !== void 0 ? _editUser_showContactInfo : false, notifyNewTasks: (_editUser_notifyNewTasks = editUser.notifyNewTasks) !== null && _editUser_notifyNewTasks !== void 0 ? _editUser_notifyNewTasks : false, notifMessages: (_editUser_notifMessages = editUser.notifMessages) !== null && _editUser_notifMessages !== void 0 ? _editUser_notifMessages : true, skills: (_editUser_skills = editUser.skills) !== null && _editUser_skills !== void 0 ? _editUser_skills : [], siteSettings: (_editUser_siteSettings = editUser.siteSettings) !== null && _editUser_siteSettings !== void 0 ? _editUser_siteSettings : {} }); await Promise.all(editUserCards.map((card)=>{ var _card_skills, _card_categories, _card_locations; return api.adminUpdateSpecialistCard(card.id, { title: card.title, description: card.description || null, skills: (_card_skills = card.skills) !== null && _card_skills !== void 0 ? _card_skills : [], categories: (_card_categories = card.categories) !== null && _card_categories !== void 0 ? _card_categories : [], locations: (_card_locations = card.locations) !== null && _card_locations !== void 0 ? _card_locations : [], publicationStatus: card.publicationStatus, isActive: card.isActive }).catch(()=>null); })); setUsers((prev)=>prev.map((u)=>u.id === editUser.id ? updated : u)); setEditUser(null); } catch (e) {} finally{ setEditUserSaving(false); } } async function verifyEmail() { if (!editUser) return; setVerifyingEmail(true); try { const updated = await api.verifyAdminUserEmail(editUser.id); setEditUser((u)=>u ? { ...u, emailVerified: updated.emailVerified } : u); setUsers((prev)=>prev.map((u)=>u.id === editUser.id ? { ...u, emailVerified: updated.emailVerified } : u)); } catch (e) {} finally{ setVerifyingEmail(false); } } async function handleAdminTopUp() { if (!editUser) return; const amount = Number(editUser.topUpAmount); if (!amount || amount <= 0) return; setTopUpSaving(true); try { const result = await api.adminTopUpUserBalance(editUser.id, { amount, description: editUser.topUpDescription || undefined }); setUsers((prev)=>prev.map((u)=>u.id === editUser.id ? result.user : u)); setEditUser((prev)=>prev ? { ...prev, ...result.user, topUpAmount: '', topUpDescription: '' } : prev); if (tab === 'balances') { api.getAdminBalanceHistory({ page: balancePage, userId: balanceUserId || undefined, kind: balanceKind || undefined }).then((d)=>{ setBalanceRows(d.data); setBalanceTotal(d.total); }).catch(()=>{}); } } catch (e) { // ignore } finally{ setTopUpSaving(false); } } async function handleAdminWithdraw() { if (!editUser) return; const amount = Number(editUser.withdrawAmount); if (!amount || amount <= 0) return; setWithdrawSaving(true); try { const result = await api.adminWithdrawUserBalance(editUser.id, { amount, description: editUser.withdrawDescription || undefined }); setUsers((prev)=>prev.map((u)=>u.id === editUser.id ? result.user : u)); setEditUser((prev)=>prev ? { ...prev, ...result.user, withdrawAmount: '', withdrawDescription: '' } : prev); if (tab === 'balances') { api.getAdminBalanceHistory({ page: balancePage, userId: balanceUserId || undefined, kind: balanceKind || undefined }).then((d)=>{ setBalanceRows(d.data); setBalanceTotal(d.total); }).catch(()=>{}); } } catch (e) { // ignore } finally{ setWithdrawSaving(false); } } async function saveCard(cardId) { const card = editUserCards.find((c)=>c.id === cardId); if (!card) return; setCardSaving((prev)=>({ ...prev, [cardId]: true })); try { var _card_skills, _card_categories, _card_locations; const updated = await api.adminUpdateSpecialistCard(cardId, { title: card.title, description: card.description || null, skills: (_card_skills = card.skills) !== null && _card_skills !== void 0 ? _card_skills : [], categories: (_card_categories = card.categories) !== null && _card_categories !== void 0 ? _card_categories : [], locations: (_card_locations = card.locations) !== null && _card_locations !== void 0 ? _card_locations : [], publicationStatus: card.publicationStatus, isActive: card.isActive }); setEditUserCards((prev)=>prev.map((c)=>c.id === cardId ? updated : c)); } catch (e) {} finally{ setCardSaving((prev)=>({ ...prev, [cardId]: false })); } } async function updateModerationCard(cardId, publicationStatus) { const updated = await api.adminUpdateSpecialistCard(cardId, { publicationStatus, isActive: publicationStatus === 'active' }).catch(()=>null); if (!updated) return; setModerationCards((prev)=>prev.map((card)=>card.id === cardId ? updated : card)); if ((editUser === null || editUser === void 0 ? void 0 : editUser.id) === updated.specialistId) { setEditUserCards((prev)=>prev.map((card)=>card.id === cardId ? updated : card)); } api.getAdminReports(1, 'pending').then((d)=>setPendingReportsCount(d.total)).catch(()=>{}); api.getAdminSpecialistCards(1, 'pending').then((d)=>setPendingCardsCount(d.total)).catch(()=>{}); } async function cancelTask(id) { const updated = await api.cancelTaskAdmin(id).catch(()=>null); if (updated) { const task = updated.task || updated; setTasks((prev)=>prev.map((row)=>{ const t = row.task || row; return t.id === id ? { ...row, task: task } : row; })); } } async function deleteTask(id, title) { if (!window.confirm("".concat(t('admin.tasks.delete.confirm'), '\n"').concat(title, '"'))) return; const ok = await api.deleteTaskAdmin(id).catch(()=>null); if (ok) setTasks((prev)=>prev.filter((row)=>{ var _row_task; return (((_row_task = row.task) === null || _row_task === void 0 ? void 0 : _row_task.id) || row.id) !== id; })); } async function handleReport(id, status) { const updated = await api.updateReportStatus(id, status).catch(()=>null); if (updated) setReports((prev)=>prev.map((r)=>r.id === id ? { ...r, ...updated } : r)); } // Locations useEffect(()=>{ if (!isAdmin || tab !== 'locations') return; api.getAdminLocations().then(setLocRows).catch(()=>{}); }, [ isAdmin, tab ]); function openAddLoc(parentId) { setLocForm({ parentId: parentId !== null && parentId !== void 0 ? parentId : null, slug: '', nameEl: '', nameEn: '', nameRu: '', nameUk: '', order: 0, isActive: true }); } function openEditLoc(loc) { var _loc_names, _loc_names1, _loc_names2, _loc_names3; var _loc_parentId, _loc_nameEl, _ref, _loc_nameEn, _ref1, _loc_nameRu, _ref2, _loc_nameUk, _ref3, _loc_order, _loc_isActive; setLocForm({ id: loc.id, parentId: (_loc_parentId = loc.parentId) !== null && _loc_parentId !== void 0 ? _loc_parentId : null, slug: loc.slug, nameEl: (_ref = (_loc_nameEl = loc.nameEl) !== null && _loc_nameEl !== void 0 ? _loc_nameEl : (_loc_names = loc.names) === null || _loc_names === void 0 ? void 0 : _loc_names.el) !== null && _ref !== void 0 ? _ref : '', nameEn: (_ref1 = (_loc_nameEn = loc.nameEn) !== null && _loc_nameEn !== void 0 ? _loc_nameEn : (_loc_names1 = loc.names) === null || _loc_names1 === void 0 ? void 0 : _loc_names1.en) !== null && _ref1 !== void 0 ? _ref1 : '', nameRu: (_ref2 = (_loc_nameRu = loc.nameRu) !== null && _loc_nameRu !== void 0 ? _loc_nameRu : (_loc_names2 = loc.names) === null || _loc_names2 === void 0 ? void 0 : _loc_names2.ru) !== null && _ref2 !== void 0 ? _ref2 : '', nameUk: (_ref3 = (_loc_nameUk = loc.nameUk) !== null && _loc_nameUk !== void 0 ? _loc_nameUk : (_loc_names3 = loc.names) === null || _loc_names3 === void 0 ? void 0 : _loc_names3.uk) !== null && _ref3 !== void 0 ? _ref3 : '', order: (_loc_order = loc.order) !== null && _loc_order !== void 0 ? _loc_order : 0, isActive: (_loc_isActive = loc.isActive) !== null && _loc_isActive !== void 0 ? _loc_isActive : true }); } async function saveLoc() { if (!locForm) return; setLocSaving(true); try { if (locForm.id) { const updated = await api.updateLocation(locForm.id, locForm); setLocRows((prev)=>prev.map((r)=>r.id === locForm.id ? updated : r)); } else { const created = await api.createLocation({ slug: locForm.slug, nameEl: locForm.nameEl, nameEn: locForm.nameEn, nameRu: locForm.nameRu, nameUk: locForm.nameUk, parentId: locForm.parentId, order: locForm.order }); setLocRows((prev)=>[ ...prev, created ]); } setLocForm(null); } catch (e) { // ignore } finally{ setLocSaving(false); } } async function deleteLoc(id, name) { if (!window.confirm("".concat(t('admin.loc.delete.confirm'), '\n"').concat(name, '"'))) return; const ok = await api.deleteLocation(id).catch(()=>null); if (ok) setLocRows((prev)=>prev.filter((r)=>r.id !== id)); } function toggleLocExpand(id) { setLocExpanded((prev)=>{ const next = new Set(prev); next.has(id) ? next.delete(id) : next.add(id); return next; }); } // Categories useEffect(()=>{ if (!isAdmin || tab !== 'categories') return; api.getAdminCategories().then(setCatRows).catch(()=>{}); }, [ isAdmin, tab ]); useEffect(()=>{ if (!isAdmin) return; fetch('/category-icons/presets.json').then((res)=>res.ok ? res.json() : Promise.reject(new Error('Failed to load presets'))).then((data)=>{ if (!Array.isArray(data)) return; const cleaned = data.filter((x)=>!!x && typeof x === 'object' && typeof x.value === 'string' && typeof x.label === 'string').filter((x)=>x.value.startsWith('/category-icons/')); if (cleaned.length > 0) setCategoryIconPresets(cleaned); }).catch(()=>{}); }, [ isAdmin ]); function openAddCat(parentId) { setCatIconError(null); setCatForm({ parentId: parentId !== null && parentId !== void 0 ? parentId : null, slug: '', icon: '/category-icons/package.svg', namesEl: '', namesEn: '', namesRu: '', namesUk: '', order: 0, isActive: true }); } function openEditCat(cat) { var _cat_names, _cat_names1, _cat_names2, _cat_names3; const selectedIcon = typeof cat.icon === 'string' ? cat.icon : ''; const knownPreset = new Set(categoryIconPresets.map((p)=>p.value)); const normalizedIcon = selectedIcon.startsWith('/category-icons/') && !knownPreset.has(selectedIcon) ? '/category-icons/package.svg' : selectedIcon || '/category-icons/package.svg'; setCatIconError(null); var _cat_parentId, _cat_namesEl, _ref, _cat_namesEn, _ref1, _cat_namesRu, _ref2, _cat_namesUk, _ref3, _cat_order, _cat_isActive; setCatForm({ id: cat.id, parentId: (_cat_parentId = cat.parentId) !== null && _cat_parentId !== void 0 ? _cat_parentId : null, slug: cat.slug, icon: normalizedIcon, namesEl: (_ref = (_cat_namesEl = cat.namesEl) !== null && _cat_namesEl !== void 0 ? _cat_namesEl : (_cat_names = cat.names) === null || _cat_names === void 0 ? void 0 : _cat_names.el) !== null && _ref !== void 0 ? _ref : '', namesEn: (_ref1 = (_cat_namesEn = cat.namesEn) !== null && _cat_namesEn !== void 0 ? _cat_namesEn : (_cat_names1 = cat.names) === null || _cat_names1 === void 0 ? void 0 : _cat_names1.en) !== null && _ref1 !== void 0 ? _ref1 : '', namesRu: (_ref2 = (_cat_namesRu = cat.namesRu) !== null && _cat_namesRu !== void 0 ? _cat_namesRu : (_cat_names2 = cat.names) === null || _cat_names2 === void 0 ? void 0 : _cat_names2.ru) !== null && _ref2 !== void 0 ? _ref2 : '', namesUk: (_ref3 = (_cat_namesUk = cat.namesUk) !== null && _cat_namesUk !== void 0 ? _cat_namesUk : (_cat_names3 = cat.names) === null || _cat_names3 === void 0 ? void 0 : _cat_names3.uk) !== null && _ref3 !== void 0 ? _ref3 : '', order: (_cat_order = cat.order) !== null && _cat_order !== void 0 ? _cat_order : 0, isActive: (_cat_isActive = cat.isActive) !== null && _cat_isActive !== void 0 ? _cat_isActive : true }); } async function uploadCategoryIcon(file) { if (file.type !== 'image/svg+xml') { setCatIconError('Only SVG files are allowed'); return; } setCatIconUploading(true); setCatIconError(null); try { const fd = new FormData(); fd.append('file', file); const base = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; const res = await fetch("".concat(base, "/api/uploads"), { method: 'POST', credentials: 'include', body: fd }); if (!res.ok) { const err = await res.json().catch(()=>({ error: 'Upload failed' })); throw new Error(err.error || 'Upload failed'); } const data = await res.json(); setCatForm((f)=>f ? { ...f, icon: data.url } : f); } catch (err) { setCatIconError((err === null || err === void 0 ? void 0 : err.message) || 'Upload failed'); } finally{ setCatIconUploading(false); } } async function saveCat() { if (!catForm) return; setCatSaving(true); try { if (catForm.id) { const updated = await api.updateCategory(catForm.id, catForm); setCatRows((prev)=>prev.map((r)=>r.id === catForm.id ? updated : r)); } else { const created = await api.createCategory({ slug: catForm.slug, icon: catForm.icon, namesEl: catForm.namesEl, namesEn: catForm.namesEn, namesRu: catForm.namesRu, namesUk: catForm.namesUk, parentId: catForm.parentId, order: catForm.order }); setCatRows((prev)=>[ ...prev, created ]); } setCatForm(null); } catch (e) { // ignore } finally{ setCatSaving(false); } } async function deleteCat(id, name) { if (!window.confirm("".concat(t('admin.cat.delete.confirm'), '\n"').concat(name, '"'))) return; const ok = await api.deleteCategory(id).catch(()=>null); if (ok) setCatRows((prev)=>prev.filter((r)=>r.id !== id)); } function toggleCatExpand(id) { setCatExpanded((prev)=>{ const next = new Set(prev); next.has(id) ? next.delete(id) : next.add(id); return next; }); } async function toggleCatSkills(cat) { const id = cat.id; const slug = cat.slug; setCatSkillsExpanded((prev)=>{ const next = new Set(prev); if (next.has(id)) { next.delete(id); return next; } next.add(id); return next; }); if (!catSkillsCache[slug]) { setCatSkillsLoading((prev)=>new Set(prev).add(id)); try { const skills = await api.getAdminSkills(slug); setCatSkillsCache((prev)=>({ ...prev, [slug]: skills })); } catch (e) {} finally{ setCatSkillsLoading((prev)=>{ const n = new Set(prev); n.delete(id); return n; }); } } } function openAddSkill(catSlug) { setSkillForm({ catSlug, nameEl: '', nameEn: '', nameRu: '', nameUk: '', order: 0 }); } function openEditSkill(skill, catSlug) { var _skill_nameEl, _skill_nameEn, _skill_nameRu, _skill_nameUk, _skill_order; setSkillForm({ id: skill.id, catSlug, nameEl: (_skill_nameEl = skill.nameEl) !== null && _skill_nameEl !== void 0 ? _skill_nameEl : '', nameEn: (_skill_nameEn = skill.nameEn) !== null && _skill_nameEn !== void 0 ? _skill_nameEn : '', nameRu: (_skill_nameRu = skill.nameRu) !== null && _skill_nameRu !== void 0 ? _skill_nameRu : '', nameUk: (_skill_nameUk = skill.nameUk) !== null && _skill_nameUk !== void 0 ? _skill_nameUk : '', order: (_skill_order = skill.order) !== null && _skill_order !== void 0 ? _skill_order : 0 }); } async function saveSkill() { if (!skillForm) return; setSkillSaving(true); try { if (skillForm.id) { const updated = await api.updateSkill(skillForm.id, { nameEl: skillForm.nameEl, nameEn: skillForm.nameEn, nameRu: skillForm.nameRu, nameUk: skillForm.nameUk, order: skillForm.order }); setCatSkillsCache((prev)=>{ var _prev_skillForm_catSlug; return { ...prev, [skillForm.catSlug]: ((_prev_skillForm_catSlug = prev[skillForm.catSlug]) !== null && _prev_skillForm_catSlug !== void 0 ? _prev_skillForm_catSlug : []).map((s)=>s.id === skillForm.id ? updated : s) }; }); } else { const created = await api.createSkill({ categorySlug: skillForm.catSlug, nameEl: skillForm.nameEl, nameEn: skillForm.nameEn, nameRu: skillForm.nameRu, nameUk: skillForm.nameUk, order: skillForm.order }); setCatSkillsCache((prev)=>{ var _prev_skillForm_catSlug; return { ...prev, [skillForm.catSlug]: [ ...(_prev_skillForm_catSlug = prev[skillForm.catSlug]) !== null && _prev_skillForm_catSlug !== void 0 ? _prev_skillForm_catSlug : [], created ] }; }); } setSkillForm(null); } catch (e) {} finally{ setSkillSaving(false); } } async function deleteSkill(skill, catSlug) { if (!skill._skipConfirm && !window.confirm('УЎалОть Мавык "'.concat(skill.nameEl, '"?'))) return; const ok = skill._skipConfirm ? true : await api.deleteSkill(skill.id).catch(()=>null); if (ok) { setCatSkillsCache((prev)=>{ var _prev_catSlug; return { ...prev, [catSlug]: ((_prev_catSlug = prev[catSlug]) !== null && _prev_catSlug !== void 0 ? _prev_catSlug : []).filter((s)=>s.id !== skill.id) }; }); } } function openAddPlan() { setPlanForm({ 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: false, isActive: true, order: 0, notifyNewTasks: false, canContactFreePlan: false, canContactProPlan: true, canContactAll: false, canShowContactInfo: false, canViewPhone: false, canUploadVideo: false, hasFavorites: false, hasGoogleCalendar: false, hasVerifiedBadge: false, highlightedReviews: false, hasPersonalSite: false, hasCanHelpNowStatus: false, hasNeedHelpStatus: false, hasAutoResponse: false, hasAutoMatch: false, hasPriceList: false, receiveInstantDispatchFree: false, receiveInstantDispatchPro: false }); } function openEditPlan(plan) { var _plan_description, _plan_role, _plan_tier, _plan_price, _plan_oldPrice, _plan_currency, _plan_searchBoost, _plan_offersMultiplier, _plan_features, _plan_isDefault, _plan_isActive, _plan_order, _plan_notifyNewTasks, _plan_canContactFreePlan, _plan_canContactProPlan, _plan_canContactAll, _plan_canShowContactInfo, _plan_canViewPhone, _plan_canUploadVideo, _plan_hasFavorites, _plan_hasGoogleCalendar, _plan_hasVerifiedBadge, _plan_highlightedReviews, _plan_hasPersonalSite, _plan_hasCanHelpNowStatus, _plan_hasNeedHelpStatus, _plan_hasAutoResponse, _plan_hasAutoMatch, _plan_hasPriceList, _plan_receiveInstantDispatchFree, _plan_receiveInstantDispatchPro; setPlanForm({ id: plan.id, name: plan.name, description: (_plan_description = plan.description) !== null && _plan_description !== void 0 ? _plan_description : '', role: (_plan_role = plan.role) !== null && _plan_role !== void 0 ? _plan_role : 'customer', tier: (_plan_tier = plan.tier) !== null && _plan_tier !== void 0 ? _plan_tier : 'free', price: (_plan_price = plan.price) !== null && _plan_price !== void 0 ? _plan_price : '0', oldPrice: (_plan_oldPrice = plan.oldPrice) !== null && _plan_oldPrice !== void 0 ? _plan_oldPrice : '', currency: (_plan_currency = plan.currency) !== null && _plan_currency !== void 0 ? _plan_currency : 'EUR', maxTasks: plan.maxTasks != null ? String(plan.maxTasks) : '', maxOffers: plan.maxOffers != null ? String(plan.maxOffers) : '', maxCards: plan.maxCards != null ? String(plan.maxCards) : '', maxMessagesPerDay: plan.maxMessagesPerDay != null ? String(plan.maxMessagesPerDay) : '', maxOrdersPerDay: plan.maxOrdersPerDay != null ? String(plan.maxOrdersPerDay) : '', maxSkills: plan.maxSkills != null ? String(plan.maxSkills) : '', durationDays: plan.durationDays != null ? String(plan.durationDays) : '', searchBoost: (_plan_searchBoost = plan.searchBoost) !== null && _plan_searchBoost !== void 0 ? _plan_searchBoost : 0, offersMultiplier: (_plan_offersMultiplier = plan.offersMultiplier) !== null && _plan_offersMultiplier !== void 0 ? _plan_offersMultiplier : '1.00', features: ((_plan_features = plan.features) !== null && _plan_features !== void 0 ? _plan_features : []).join('\n'), isDefault: (_plan_isDefault = plan.isDefault) !== null && _plan_isDefault !== void 0 ? _plan_isDefault : false, isActive: (_plan_isActive = plan.isActive) !== null && _plan_isActive !== void 0 ? _plan_isActive : true, order: (_plan_order = plan.order) !== null && _plan_order !== void 0 ? _plan_order : 0, notifyNewTasks: (_plan_notifyNewTasks = plan.notifyNewTasks) !== null && _plan_notifyNewTasks !== void 0 ? _plan_notifyNewTasks : false, canContactFreePlan: (_plan_canContactFreePlan = plan.canContactFreePlan) !== null && _plan_canContactFreePlan !== void 0 ? _plan_canContactFreePlan : false, canContactProPlan: (_plan_canContactProPlan = plan.canContactProPlan) !== null && _plan_canContactProPlan !== void 0 ? _plan_canContactProPlan : true, canContactAll: (_plan_canContactAll = plan.canContactAll) !== null && _plan_canContactAll !== void 0 ? _plan_canContactAll : false, canShowContactInfo: (_plan_canShowContactInfo = plan.canShowContactInfo) !== null && _plan_canShowContactInfo !== void 0 ? _plan_canShowContactInfo : false, canViewPhone: (_plan_canViewPhone = plan.canViewPhone) !== null && _plan_canViewPhone !== void 0 ? _plan_canViewPhone : false, canUploadVideo: (_plan_canUploadVideo = plan.canUploadVideo) !== null && _plan_canUploadVideo !== void 0 ? _plan_canUploadVideo : false, hasFavorites: (_plan_hasFavorites = plan.hasFavorites) !== null && _plan_hasFavorites !== void 0 ? _plan_hasFavorites : false, hasGoogleCalendar: (_plan_hasGoogleCalendar = plan.hasGoogleCalendar) !== null && _plan_hasGoogleCalendar !== void 0 ? _plan_hasGoogleCalendar : false, hasVerifiedBadge: (_plan_hasVerifiedBadge = plan.hasVerifiedBadge) !== null && _plan_hasVerifiedBadge !== void 0 ? _plan_hasVerifiedBadge : false, highlightedReviews: (_plan_highlightedReviews = plan.highlightedReviews) !== null && _plan_highlightedReviews !== void 0 ? _plan_highlightedReviews : false, hasPersonalSite: (_plan_hasPersonalSite = plan.hasPersonalSite) !== null && _plan_hasPersonalSite !== void 0 ? _plan_hasPersonalSite : false, hasCanHelpNowStatus: (_plan_hasCanHelpNowStatus = plan.hasCanHelpNowStatus) !== null && _plan_hasCanHelpNowStatus !== void 0 ? _plan_hasCanHelpNowStatus : false, hasNeedHelpStatus: (_plan_hasNeedHelpStatus = plan.hasNeedHelpStatus) !== null && _plan_hasNeedHelpStatus !== void 0 ? _plan_hasNeedHelpStatus : false, hasAutoResponse: (_plan_hasAutoResponse = plan.hasAutoResponse) !== null && _plan_hasAutoResponse !== void 0 ? _plan_hasAutoResponse : false, hasAutoMatch: (_plan_hasAutoMatch = plan.hasAutoMatch) !== null && _plan_hasAutoMatch !== void 0 ? _plan_hasAutoMatch : false, hasPriceList: (_plan_hasPriceList = plan.hasPriceList) !== null && _plan_hasPriceList !== void 0 ? _plan_hasPriceList : false, receiveInstantDispatchFree: (_plan_receiveInstantDispatchFree = plan.receiveInstantDispatchFree) !== null && _plan_receiveInstantDispatchFree !== void 0 ? _plan_receiveInstantDispatchFree : false, receiveInstantDispatchPro: (_plan_receiveInstantDispatchPro = plan.receiveInstantDispatchPro) !== null && _plan_receiveInstantDispatchPro !== void 0 ? _plan_receiveInstantDispatchPro : false }); } async function savePlan() { if (!planForm) return; setPlanSaving(true); try { const payload = { name: planForm.name, description: planForm.description || undefined, role: planForm.role, tier: planForm.tier, price: planForm.price, oldPrice: planForm.oldPrice || null, currency: planForm.currency, maxTasks: planForm.maxTasks ? Number(planForm.maxTasks) : null, maxOffers: planForm.maxOffers ? Number(planForm.maxOffers) : null, maxCards: planForm.maxCards ? Number(planForm.maxCards) : null, maxMessagesPerDay: planForm.maxMessagesPerDay ? Number(planForm.maxMessagesPerDay) : null, maxOrdersPerDay: planForm.maxOrdersPerDay ? Number(planForm.maxOrdersPerDay) : null, maxSkills: planForm.maxSkills ? Number(planForm.maxSkills) : null, durationDays: planForm.durationDays ? Number(planForm.durationDays) : null, notifyNewTasks: planForm.notifyNewTasks, searchBoost: planForm.searchBoost, offersMultiplier: planForm.offersMultiplier, canContactFreePlan: planForm.canContactFreePlan, canContactProPlan: planForm.canContactProPlan, canContactAll: planForm.canContactAll, canShowContactInfo: planForm.canShowContactInfo, canViewPhone: planForm.canViewPhone, canUploadVideo: planForm.canUploadVideo, hasFavorites: planForm.hasFavorites, hasGoogleCalendar: planForm.hasGoogleCalendar, hasVerifiedBadge: planForm.hasVerifiedBadge, highlightedReviews: planForm.highlightedReviews, hasPersonalSite: planForm.hasPersonalSite, hasCanHelpNowStatus: planForm.hasCanHelpNowStatus, hasNeedHelpStatus: planForm.hasNeedHelpStatus, hasAutoResponse: planForm.hasAutoResponse, hasAutoMatch: planForm.hasAutoMatch, hasPriceList: planForm.hasPriceList, receiveInstantDispatchFree: planForm.receiveInstantDispatchFree, receiveInstantDispatchPro: planForm.receiveInstantDispatchPro, features: planForm.features ? planForm.features.split('\n').map((s)=>s.trim()).filter(Boolean) : [], isDefault: planForm.isDefault, isActive: planForm.isActive, order: planForm.order }; if (planForm.id) { const updated = await api.updatePlan(planForm.id, payload); setPlanRows((prev)=>prev.map((r)=>r.id === planForm.id ? updated : r)); } else { const created = await api.createPlan(payload); setPlanRows((prev)=>[ ...prev, created ]); } // If set as default — refresh all to sync isDefault flags if (planForm.isDefault) { api.getAdminPlans().then(setPlanRows).catch(()=>{}); } setPlanForm(null); } catch (e) { // ignore } finally{ setPlanSaving(false); } } async function deletePlan(id, name) { if (!window.confirm('Delete plan "'.concat(name, '"?'))) return; const ok = await api.deletePlan(id).catch(()=>null); if (ok) setPlanRows((prev)=>prev.filter((r)=>r.id !== id)); } // Settings useEffect(()=>{ if (!isAdmin || tab !== 'settings') return; if (planRows.length === 0) api.getAdminPlans().then(setPlanRows).catch(()=>{}); api.getAdminSettings().then((kv)=>{ var _kv_generalsiteName, _kv_generalsiteUrl, _kv_generalcontactEmail, _kv_generalsupportPhone; setGeneralForm({ siteName: (_kv_generalsiteName = kv['general.siteName']) !== null && _kv_generalsiteName !== void 0 ? _kv_generalsiteName : 'CanHelp', siteUrl: (_kv_generalsiteUrl = kv['general.siteUrl']) !== null && _kv_generalsiteUrl !== void 0 ? _kv_generalsiteUrl : '', contactEmail: (_kv_generalcontactEmail = kv['general.contactEmail']) !== null && _kv_generalcontactEmail !== void 0 ? _kv_generalcontactEmail : '', supportPhone: (_kv_generalsupportPhone = kv['general.supportPhone']) !== null && _kv_generalsupportPhone !== void 0 ? _kv_generalsupportPhone : '' }); var _kv_smtphost, _kv_smtpport, _kv_smtpusername, _kv_smtppassword, _kv_smtpfromName, _kv_smtpfromEmail, _kv_smtpencryption; setSmtpForm({ host: (_kv_smtphost = kv['smtp.host']) !== null && _kv_smtphost !== void 0 ? _kv_smtphost : '', port: (_kv_smtpport = kv['smtp.port']) !== null && _kv_smtpport !== void 0 ? _kv_smtpport : '587', username: (_kv_smtpusername = kv['smtp.username']) !== null && _kv_smtpusername !== void 0 ? _kv_smtpusername : '', password: (_kv_smtppassword = kv['smtp.password']) !== null && _kv_smtppassword !== void 0 ? _kv_smtppassword : '', fromName: (_kv_smtpfromName = kv['smtp.fromName']) !== null && _kv_smtpfromName !== void 0 ? _kv_smtpfromName : 'CanHelp', fromEmail: (_kv_smtpfromEmail = kv['smtp.fromEmail']) !== null && _kv_smtpfromEmail !== void 0 ? _kv_smtpfromEmail : '', encryption: (_kv_smtpencryption = kv['smtp.encryption']) !== null && _kv_smtpencryption !== void 0 ? _kv_smtpencryption : 'tls' }); var _kv_paymentepaymerchantId, _kv_paymentepayapiUser, _kv_paymentepayapiPassword, _kv_paymentepayenvironment, _kv_paymentepayconfirmationUrl, _kv_paymentepaycancelUrl; setEPayForm({ merchantId: (_kv_paymentepaymerchantId = kv['payment.epay.merchantId']) !== null && _kv_paymentepaymerchantId !== void 0 ? _kv_paymentepaymerchantId : '', apiUser: (_kv_paymentepayapiUser = kv['payment.epay.apiUser']) !== null && _kv_paymentepayapiUser !== void 0 ? _kv_paymentepayapiUser : '', apiPassword: (_kv_paymentepayapiPassword = kv['payment.epay.apiPassword']) !== null && _kv_paymentepayapiPassword !== void 0 ? _kv_paymentepayapiPassword : '', environment: (_kv_paymentepayenvironment = kv['payment.epay.environment']) !== null && _kv_paymentepayenvironment !== void 0 ? _kv_paymentepayenvironment : 'test', confirmationUrl: (_kv_paymentepayconfirmationUrl = kv['payment.epay.confirmationUrl']) !== null && _kv_paymentepayconfirmationUrl !== void 0 ? _kv_paymentepayconfirmationUrl : '', cancelUrl: (_kv_paymentepaycancelUrl = kv['payment.epay.cancelUrl']) !== null && _kv_paymentepaycancelUrl !== void 0 ? _kv_paymentepaycancelUrl : '', enabled: kv['payment.epay.enabled'] === 'true' }); var _kv_referral_plan_id, _ref, _ref1, _kv_referral_days, _ref2, _ref3; setReferralForm({ enabled: kv['referral_enabled'] === 'true', planId: (_ref1 = (_ref = (_kv_referral_plan_id = kv['referral_plan_id']) !== null && _kv_referral_plan_id !== void 0 ? _kv_referral_plan_id : kv['referral_customer_plan_id']) !== null && _ref !== void 0 ? _ref : kv['referral_specialist_plan_id']) !== null && _ref1 !== void 0 ? _ref1 : '', days: (_ref3 = (_ref2 = (_kv_referral_days = kv['referral_days']) !== null && _kv_referral_days !== void 0 ? _kv_referral_days : kv['referral_customer_days']) !== null && _ref2 !== void 0 ? _ref2 : kv['referral_specialist_days']) !== null && _ref3 !== void 0 ? _ref3 : '30' }); var _kv_seoheadScripts, _kv_seositeTitleel, _ref4, _kv_seositeTitleen, _kv_seositeTitleru, _kv_seositeTitleuk, _kv_seositeDescriptionel, _ref5, _kv_seositeDescriptionen, _kv_seositeDescriptionru, _kv_seositeDescriptionuk; setSeoForm({ maintenanceMode: kv['seo.maintenanceMode'] === 'true', indexingEnabled: kv['seo.indexingEnabled'] !== 'false', headScripts: (_kv_seoheadScripts = kv['seo.headScripts']) !== null && _kv_seoheadScripts !== void 0 ? _kv_seoheadScripts : '', siteTitleEl: (_ref4 = (_kv_seositeTitleel = kv['seo.siteTitle.el']) !== null && _kv_seositeTitleel !== void 0 ? _kv_seositeTitleel : kv['seo.siteTitle']) !== null && _ref4 !== void 0 ? _ref4 : '', siteTitleEn: (_kv_seositeTitleen = kv['seo.siteTitle.en']) !== null && _kv_seositeTitleen !== void 0 ? _kv_seositeTitleen : '', siteTitleRu: (_kv_seositeTitleru = kv['seo.siteTitle.ru']) !== null && _kv_seositeTitleru !== void 0 ? _kv_seositeTitleru : '', siteTitleUk: (_kv_seositeTitleuk = kv['seo.siteTitle.uk']) !== null && _kv_seositeTitleuk !== void 0 ? _kv_seositeTitleuk : '', siteDescriptionEl: (_ref5 = (_kv_seositeDescriptionel = kv['seo.siteDescription.el']) !== null && _kv_seositeDescriptionel !== void 0 ? _kv_seositeDescriptionel : kv['seo.siteDescription']) !== null && _ref5 !== void 0 ? _ref5 : '', siteDescriptionEn: (_kv_seositeDescriptionen = kv['seo.siteDescription.en']) !== null && _kv_seositeDescriptionen !== void 0 ? _kv_seositeDescriptionen : '', siteDescriptionRu: (_kv_seositeDescriptionru = kv['seo.siteDescription.ru']) !== null && _kv_seositeDescriptionru !== void 0 ? _kv_seositeDescriptionru : '', siteDescriptionUk: (_kv_seositeDescriptionuk = kv['seo.siteDescription.uk']) !== null && _kv_seositeDescriptionuk !== void 0 ? _kv_seositeDescriptionuk : '' }); var _kv_socialtelegram, _kv_socialinstagram, _kv_socialfacebook, _kv_socialtwitter, _kv_socialyoutube, _kv_socialtiktok, _kv_socialwhatsapp, _kv_socialviber; setSocialForm({ telegram: (_kv_socialtelegram = kv['social.telegram']) !== null && _kv_socialtelegram !== void 0 ? _kv_socialtelegram : '', instagram: (_kv_socialinstagram = kv['social.instagram']) !== null && _kv_socialinstagram !== void 0 ? _kv_socialinstagram : '', facebook: (_kv_socialfacebook = kv['social.facebook']) !== null && _kv_socialfacebook !== void 0 ? _kv_socialfacebook : '', twitter: (_kv_socialtwitter = kv['social.twitter']) !== null && _kv_socialtwitter !== void 0 ? _kv_socialtwitter : '', youtube: (_kv_socialyoutube = kv['social.youtube']) !== null && _kv_socialyoutube !== void 0 ? _kv_socialyoutube : '', tiktok: (_kv_socialtiktok = kv['social.tiktok']) !== null && _kv_socialtiktok !== void 0 ? _kv_socialtiktok : '', whatsapp: (_kv_socialwhatsapp = kv['social.whatsapp']) !== null && _kv_socialwhatsapp !== void 0 ? _kv_socialwhatsapp : '', viber: (_kv_socialviber = kv['social.viber']) !== null && _kv_socialviber !== void 0 ? _kv_socialviber : '' }); var _kv_telegrambotToken, _kv_telegramadminChatId, _kv_telegramchannelIdel, _kv_telegramchannelIden, _kv_telegramchannelIdru, _kv_telegramchannelIduk; setTelegramForm({ botToken: (_kv_telegrambotToken = kv['telegram.botToken']) !== null && _kv_telegrambotToken !== void 0 ? _kv_telegrambotToken : '', adminChatId: (_kv_telegramadminChatId = kv['telegram.adminChatId']) !== null && _kv_telegramadminChatId !== void 0 ? _kv_telegramadminChatId : '', channelIdEl: (_kv_telegramchannelIdel = kv['telegram.channelId.el']) !== null && _kv_telegramchannelIdel !== void 0 ? _kv_telegramchannelIdel : '', channelIdEn: (_kv_telegramchannelIden = kv['telegram.channelId.en']) !== null && _kv_telegramchannelIden !== void 0 ? _kv_telegramchannelIden : '', channelIdRu: (_kv_telegramchannelIdru = kv['telegram.channelId.ru']) !== null && _kv_telegramchannelIdru !== void 0 ? _kv_telegramchannelIdru : '', channelIdUk: (_kv_telegramchannelIduk = kv['telegram.channelId.uk']) !== null && _kv_telegramchannelIduk !== void 0 ? _kv_telegramchannelIduk : '', notifyRegistrations: kv['telegram.notifyRegistrations'] === 'true', postNewTasks: kv['telegram.postNewTasks'] === 'true' }); }).catch(()=>{}); api.getAdminEmailTemplates().then((rows)=>{ const map = {}; for (const r of rows)map[r.key] = { subject: r.subject, body: r.body }; setNotifTemplates((prev)=>({ ...prev, ...map })); }).catch(()=>{}); }, [ isAdmin, tab ]); async function saveGeneralSettings() { setGeneralSaving(true); try { await api.updateAdminSettings({ 'general.siteName': generalForm.siteName, 'general.siteUrl': generalForm.siteUrl, 'general.contactEmail': generalForm.contactEmail, 'general.supportPhone': generalForm.supportPhone }); setGeneralSaved(true); setTimeout(()=>setGeneralSaved(false), 2500); } catch (e) {} finally{ setGeneralSaving(false); } } async function saveSmtpSettings() { setSmtpSaving(true); try { await api.updateAdminSettings({ 'smtp.host': smtpForm.host, 'smtp.port': smtpForm.port, 'smtp.username': smtpForm.username, 'smtp.password': smtpForm.password, 'smtp.fromName': smtpForm.fromName, 'smtp.fromEmail': smtpForm.fromEmail, 'smtp.encryption': smtpForm.encryption }); setSmtpSaved(true); setTimeout(()=>setSmtpSaved(false), 2500); } catch (e) {} finally{ setSmtpSaving(false); } } async function autoTranslateTemplate(key) { const localeKey = "".concat(key, "_").concat(templateLocale); var _notifTemplates_localeKey, _ref; const current = (_ref = (_notifTemplates_localeKey = notifTemplates[localeKey]) !== null && _notifTemplates_localeKey !== void 0 ? _notifTemplates_localeKey : notifTemplates[key]) !== null && _ref !== void 0 ? _ref : { subject: '', body: '' }; if (!current.subject && !current.body) return; setTemplateTranslating(true); try { // СПхраМяеЌ ОсхПЎМый язык в БД (еслО ещё Ме сПхраМёМ) await api.updateAdminEmailTemplate(localeKey, current); // ПеревПЎОЌ Ма ПстальМые языкО const results = await api.translateAdminEmailTemplate({ subject: current.subject, body: current.body, fromLocale: templateLocale }); // ОбМПвляеЌ state setNotifTemplates((prev)=>{ const next = { ...prev, [localeKey]: current }; for (const [loc, tpl] of Object.entries(results)){ next["".concat(key, "_").concat(loc)] = tpl; } return next; }); // СПхраМяеЌ кажЎый перевПЎ в БД await Promise.all(Object.entries(results).map((param)=>{ let [loc, tpl] = param; return api.updateAdminEmailTemplate("".concat(key, "_").concat(loc), tpl); })); } catch (e) {} finally{ setTemplateTranslating(false); } } async function saveTemplate(key) { const localeKey = "".concat(key, "_").concat(templateLocale); setTemplateSaving(true); try { var _notifTemplates_localeKey; await api.updateAdminEmailTemplate(localeKey, (_notifTemplates_localeKey = notifTemplates[localeKey]) !== null && _notifTemplates_localeKey !== void 0 ? _notifTemplates_localeKey : { subject: '', body: '' }); setEditingTemplate(null); } catch (e) {} finally{ setTemplateSaving(false); } } async function saveEPaySettings() { setEPaySaving(true); try { await api.updateAdminSettings({ 'payment.epay.merchantId': ePayForm.merchantId, 'payment.epay.apiUser': ePayForm.apiUser, 'payment.epay.apiPassword': ePayForm.apiPassword, 'payment.epay.environment': ePayForm.environment, 'payment.epay.confirmationUrl': ePayForm.confirmationUrl, 'payment.epay.cancelUrl': ePayForm.cancelUrl, 'payment.epay.enabled': String(ePayForm.enabled) }); setEPaySaved(true); setTimeout(()=>setEPaySaved(false), 2500); } catch (e) {} finally{ setEPaySaving(false); } } async function saveReferralSettings() { setReferralSaving(true); try { await api.updateAdminSettings({ 'referral_enabled': String(referralForm.enabled), 'referral_plan_id': referralForm.planId, 'referral_days': referralForm.days }); setReferralSaved(true); setTimeout(()=>setReferralSaved(false), 2500); } catch (e) {} finally{ setReferralSaving(false); } } async function saveSeoSettings() { setSeoSaving(true); try { await api.updateAdminSettings({ 'seo.maintenanceMode': String(seoForm.maintenanceMode), 'seo.indexingEnabled': String(seoForm.indexingEnabled), 'seo.headScripts': seoForm.headScripts, 'seo.siteTitle.el': seoForm.siteTitleEl, 'seo.siteTitle.en': seoForm.siteTitleEn, 'seo.siteTitle.ru': seoForm.siteTitleRu, 'seo.siteTitle.uk': seoForm.siteTitleUk, 'seo.siteDescription.el': seoForm.siteDescriptionEl, 'seo.siteDescription.en': seoForm.siteDescriptionEn, 'seo.siteDescription.ru': seoForm.siteDescriptionRu, 'seo.siteDescription.uk': seoForm.siteDescriptionUk }); setSeoSaved(true); setTimeout(()=>setSeoSaved(false), 2500); } catch (e) {} finally{ setSeoSaving(false); } } async function saveSocialSettings() { setSocialSaving(true); try { await api.updateAdminSettings({ 'social.telegram': socialForm.telegram, 'social.instagram': socialForm.instagram, 'social.facebook': socialForm.facebook, 'social.twitter': socialForm.twitter, 'social.youtube': socialForm.youtube, 'social.tiktok': socialForm.tiktok, 'social.whatsapp': socialForm.whatsapp, 'social.viber': socialForm.viber }); setSocialSaved(true); setTimeout(()=>setSocialSaved(false), 2500); } catch (e) {} finally{ setSocialSaving(false); } } async function saveTelegramSettings() { setTelegramSaving(true); try { await api.updateAdminSettings({ 'telegram.botToken': telegramForm.botToken, 'telegram.adminChatId': telegramForm.adminChatId, 'telegram.channelId.el': telegramForm.channelIdEl, 'telegram.channelId.en': telegramForm.channelIdEn, 'telegram.channelId.ru': telegramForm.channelIdRu, 'telegram.channelId.uk': telegramForm.channelIdUk, 'telegram.notifyRegistrations': String(telegramForm.notifyRegistrations), 'telegram.postNewTasks': String(telegramForm.postNewTasks) }); setTelegramSaved(true); setTimeout(()=>setTelegramSaved(false), 2500); } catch (e) {} finally{ setTelegramSaving(false); } } async function testTelegram(type) { const chatIdMap = { admin: telegramForm.adminChatId, el: telegramForm.channelIdEl, en: telegramForm.channelIdEn, ru: telegramForm.channelIdRu, uk: telegramForm.channelIdUk }; var _chatIdMap_type; const chatId = (_chatIdMap_type = chatIdMap[type]) !== null && _chatIdMap_type !== void 0 ? _chatIdMap_type : ''; if (type === 'admin') { setTestingTelegramAdmin(true); setTestResultTelegramAdmin(null); } else { setTestingLocale(type); setTestResultChannels((p)=>{ const n = { ...p }; delete n[type]; return n; }); } try { const res = await api.testTelegramConnection(telegramForm.botToken, chatId); var _res_error; const result = { ok: res.ok, msg: res.ok ? res.botName ? "@".concat(res.botName) : t('admin.settings.telegram.test_ok') : (_res_error = res.error) !== null && _res_error !== void 0 ? _res_error : t('admin.settings.telegram.test_fail') }; if (type === 'admin') setTestResultTelegramAdmin(result); else setTestResultChannels((p)=>({ ...p, [type]: result })); } catch (e) { const result = { ok: false, msg: t('admin.settings.telegram.test_fail') }; if (type === 'admin') setTestResultTelegramAdmin(result); else setTestResultChannels((p)=>({ ...p, [type]: result })); } finally{ if (type === 'admin') setTestingTelegramAdmin(false); else setTestingLocale(null); } } async function verifyTelegramToken() { setVerifyingTelegramToken(true); setVerifyResultTelegramToken(null); try { const res = await api.verifyTelegramToken(telegramForm.botToken); var _res_error; setVerifyResultTelegramToken({ ok: res.ok, msg: res.ok ? "@".concat(res.botName) : (_res_error = res.error) !== null && _res_error !== void 0 ? _res_error : t('admin.settings.telegram.test_fail') }); } catch (e) { setVerifyResultTelegramToken({ ok: false, msg: t('admin.settings.telegram.test_fail') }); } finally{ setVerifyingTelegramToken(false); } } if (isPending) return /*#__PURE__*/ _jsx("div", { className: "text-center py-20 text-gray-500", children: t('common.loading') }); const dateLocale = locale === 'ru' ? 'ru-RU' : locale === 'en' ? 'en-US' : 'el-GR'; const catName = (id)=>{ const cat = catRows.find((c)=>c.id === id); if (!cat) return id; if (locale === 'en') return cat.namesEn || cat.namesEl; if (locale === 'ru') return cat.namesRu || cat.namesEl; if (locale === 'uk') return cat.namesUk || cat.namesEl; return cat.namesEl || cat.namesEn || id; }; const locName = (id)=>{ const loc = locRows.find((l)=>l.id === id); if (!loc) return id; if (locale === 'en') return loc.nameEn || loc.nameEl; if (locale === 'ru') return loc.nameRu || loc.nameEl; if (locale === 'uk') return loc.nameUk || loc.nameEl; return loc.nameEl || loc.nameEn || id; }; const TABS = [ { key: 'stats', label: t('admin.tab.stats'), icon: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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: t('admin.tab.users'), icon: /*#__PURE__*/ _jsxs("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M17 21v-2a4 4 0 00-4-4H5a4 4 0 00-4 4v2" }), /*#__PURE__*/ _jsx("circle", { cx: "9", cy: "7", r: "4" }), /*#__PURE__*/ _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: t('admin.tab.tasks'), icon: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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: t('admin.tab.reports'), badge: pendingReportsCount || undefined, icon: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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: t('admin.tab.moderation'), badge: pendingCardsCount || undefined, icon: /*#__PURE__*/ _jsxs("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ _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" }), /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 20h12" }) ] }) }, { key: 'categories', label: t('admin.tab.categories'), icon: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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: t('admin.tab.locations'), icon: /*#__PURE__*/ _jsxs("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ _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" }), /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 11a3 3 0 11-6 0 3 3 0 016 0z" }) ] }) }, { key: 'balances', label: t('admin.tab.balances', 'Balance'), icon: /*#__PURE__*/ _jsxs("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ _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" }), /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M20 12h-6m0 0a2 2 0 100 4h6v-8h-6a2 2 0 100 4z" }) ] }) }, { key: 'plans', label: t('admin.tab.plans'), icon: /*#__PURE__*/ _jsxs("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ _jsx("rect", { x: "1", y: "4", width: "22", height: "16", rx: "2", ry: "2" }), /*#__PURE__*/ _jsx("line", { x1: "1", y1: "10", x2: "23", y2: "10" }) ] }) }, { key: 'logs', label: t('admin.tab.logs'), icon: /*#__PURE__*/ _jsxs("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ _jsx("polyline", { points: "4 17 10 11 4 5" }), /*#__PURE__*/ _jsx("line", { x1: "12", y1: "19", x2: "20", y2: "19" }) ] }) }, { key: 'settings', label: t('admin.tab.settings'), icon: /*#__PURE__*/ _jsxs("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ _jsx("circle", { cx: "12", cy: "12", r: "3" }), /*#__PURE__*/ _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: t('admin.tab.support', 'Support'), icon: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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: t('admin.tab.push', 'Push'), icon: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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: t('admin.tab.backup', 'Backup'), icon: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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: t('admin.tab.translations', 'Translations'), icon: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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: t('admin.tab.dbcheck', 'DB check'), icon: /*#__PURE__*/ _jsxs("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ _jsx("ellipse", { cx: "12", cy: "5", rx: "9", ry: "3" }), /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M21 12c0 1.66-4.03 3-9 3S3 13.66 3 12" }), /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M3 5v14c0 1.66 4.03 3 9 3s9-1.34 9-3V5" }), /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 12l2 2 4-4" }) ] }) }, { key: 'referrals', label: t('admin.tab.referrals', 'Referrals'), icon: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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" }) }) } ]; const statusColors = { 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' }; const reportStatusColors = { pending: 'bg-yellow-100 text-yellow-700', reviewed: 'bg-green-100 text-green-700', dismissed: 'bg-gray-100 text-gray-500' }; const reasonColors = { 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' }; const cardStatus = (card)=>{ var _card_publicationStatus; return (_card_publicationStatus = card.publicationStatus) !== null && _card_publicationStatus !== void 0 ? _card_publicationStatus : card.isActive ? 'active' : 'inactive'; }; const pendingModerationCards = moderationCards.filter((card)=>cardStatus(card) === 'pending'); const activeModerationCards = moderationCards.filter((card)=>cardStatus(card) === 'active'); var _stats_totalCostUsd, _planForm_oldPrice, _pushResult_tokensFound, _pushResult_usersWithoutTokens, _pushResult_usersConfigBlocked, _pushResult_usersAuthFailed, _pushResult_usersAllFailed, _pushResult_usersWithoutTokens1, _pushResult_usersConfigBlocked1, _pushResult_usersAuthFailed1, _pushResult_usersAllFailed1, _referralsData_totalReferrers, _referralsData_totalReferrals, _referralsData_activeRewards, _editUser_firstName, _editUser_lastName, _editUser_phone, _editUser_bio, _editUser_planId, _editUser_locale, _editUser_balance, _editUser_showContactInfo, _editUser_notifyNewTasks, _editUser_notifMessages, _editUser_personalSiteSlug, _editUser_siteSettings, _siteTheme, _editUser_skills, _editUser_balance1, _editUser_topUpAmount, _editUser_withdrawAmount, _editUser_topUpDescription, _editUser_withdrawDescription; return /*#__PURE__*/ _jsx("div", { className: "min-h-screen bg-gray-50", children: /*#__PURE__*/ _jsxs("div", { className: "max-w-7xl mx-auto px-4 py-8", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between mb-6", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-7 h-7 text-yellow-500", fill: "currentColor", viewBox: "0 0 24 24", children: /*#__PURE__*/ _jsx("path", { d: "M5 16L3 5l5.5 5L12 4l3.5 6L21 5l-2 11H5zm0 3a1 1 0 000 2h14a1 1 0 000-2H5z" }) }), /*#__PURE__*/ _jsx("h1", { className: "text-2xl font-bold text-gray-900", children: t('admin.title') }) ] }), /*#__PURE__*/ _jsxs(Link, { href: "/", className: "flex items-center gap-1.5 text-sm text-gray-500 hover:text-green-600 transition", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 19l-7-7 7-7" }) }), t('admin.back_home') ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-6", children: [ /*#__PURE__*/ _jsx("aside", { className: "shrink-0 transition-all duration-200 ".concat(sidebarCollapsed ? 'w-12' : 'w-52'), children: /*#__PURE__*/ _jsxs("nav", { className: "bg-white rounded-xl border border-gray-200 overflow-hidden", children: [ /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setSidebarCollapsed((v)=>!v), title: sidebarCollapsed ? 'РазверМуть ЌеМю' : 'СверМуть ЌеМю', 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: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 transition-transform duration-200 ".concat(sidebarCollapsed ? 'rotate-180' : ''), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 19l-7-7 7-7" }) }) }), TABS.map((param)=>{ let { key, label, icon, badge } = param; return /*#__PURE__*/ _jsxs("button", { onClick: ()=>setTab(key), title: sidebarCollapsed ? label : undefined, className: "w-full flex items-center py-3 text-sm font-medium text-left transition ".concat(tab === key ? 'bg-green-50 text-green-700 border-r-2 border-green-600' : 'text-gray-600 hover:bg-gray-50 hover:text-gray-900', " ").concat(sidebarCollapsed ? 'justify-center px-3' : 'gap-3 px-4'), children: [ /*#__PURE__*/ _jsx("span", { className: "w-4 h-4 flex-shrink-0 flex items-center justify-center", children: icon }), !sidebarCollapsed && /*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-2 min-w-0", children: [ /*#__PURE__*/ _jsx("span", { children: label }), badge ? /*#__PURE__*/ _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: badge }) : null ] }) ] }, key); }) ] }) }), /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-0", children: [ tab === 'stats' && /*#__PURE__*/ _jsxs("div", { className: "space-y-6", children: [ /*#__PURE__*/ _jsx("div", { className: "grid grid-cols-2 md:grid-cols-5 gap-4", children: [ { label: t('admin.stats.users'), value: stats === null || stats === void 0 ? void 0 : stats.userCount, icon: /*#__PURE__*/ _jsx("svg", { className: "w-8 h-8", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ _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: t('admin.stats.specialists'), value: stats === null || stats === void 0 ? void 0 : stats.specialistCount, icon: /*#__PURE__*/ _jsxs("svg", { className: "w-8 h-8", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: [ /*#__PURE__*/ _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" }), /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 12a3 3 0 11-6 0 3 3 0 016 0z" }) ] }), color: 'text-purple-600' }, { label: t('admin.stats.tasks'), value: stats === null || stats === void 0 ? void 0 : stats.taskCount, icon: /*#__PURE__*/ _jsx("svg", { className: "w-8 h-8", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ _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: t('admin.stats.offers'), value: stats === null || stats === void 0 ? void 0 : stats.offerCount, icon: /*#__PURE__*/ _jsx("svg", { className: "w-8 h-8", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ _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: t('admin.stats.reviews'), value: stats === null || stats === void 0 ? void 0 : stats.reviewCount, icon: /*#__PURE__*/ _jsx("svg", { className: "w-8 h-8", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ _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((param)=>{ let { label, value, icon, color } = param; return /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-5", children: [ /*#__PURE__*/ _jsx("div", { className: "mb-2 ".concat(color), children: icon }), /*#__PURE__*/ _jsx("div", { className: "text-3xl font-bold ".concat(color), children: value !== null && value !== void 0 ? value : '—' }), /*#__PURE__*/ _jsx("div", { className: "text-sm text-gray-500 mt-1", children: label }) ] }, label); }) }), (stats === null || stats === void 0 ? void 0 : stats.tasksByDay) && /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between mb-4", children: [ /*#__PURE__*/ _jsx("h2", { className: "font-semibold text-gray-800", children: t('admin.stats.activity_30d') }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-4 text-xs text-gray-500", children: [ /*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-1.5", children: [ /*#__PURE__*/ _jsx("span", { className: "w-3 h-0.5 bg-green-500 inline-block rounded" }), t('admin.stats.users_label') ] }), /*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-1.5", children: [ /*#__PURE__*/ _jsx("span", { className: "w-3 h-0.5 bg-purple-400 inline-block rounded" }), t('admin.stats.specialists_label') ] }), /*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-1.5", children: [ /*#__PURE__*/ _jsx("span", { className: "w-3 h-0.5 bg-green-500 inline-block rounded" }), t('admin.stats.tasks_label') ] }) ] }) ] }), /*#__PURE__*/ _jsx(AdminAreaChart, { series: [ { data: stats.usersByDay, color: '#3b82f6', fill: '#3b82f615', label: t('admin.stats.users_label') }, { data: stats.specialistsByDay, color: '#a855f7', fill: '#a855f710', label: t('admin.stats.specialists_label') }, { data: stats.tasksByDay, color: '#22c55e', fill: '#22c55e10', label: t('admin.stats.tasks_label') } ] }) ] }), (stats === null || stats === void 0 ? void 0 : stats.tasksByStatus) && /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ _jsx("h2", { className: "font-semibold text-gray-800 mb-5", children: t('admin.stats.tasks_by_status') }), /*#__PURE__*/ _jsx("div", { className: "space-y-3", children: (()=>{ const total = stats.tasksByStatus.reduce((s, r)=>s + Number(r.count), 0) || 1; const statusMeta = { open: { label: t('admin.task_status.open'), bg: 'bg-green-50', bar: 'bg-green-500' }, in_progress: { label: t('admin.task_status.in_progress'), bg: 'bg-green-50', bar: 'bg-green-500' }, completed: { label: t('admin.task_status.completed'), bg: 'bg-gray-50', bar: 'bg-gray-400' }, cancelled: { label: t('admin.task_status.cancelled'), bg: 'bg-red-50', bar: 'bg-red-400' }, draft: { label: t('admin.task_status.draft'), bg: 'bg-yellow-50', bar: 'bg-yellow-400' } }; const order = [ 'open', 'in_progress', 'completed', 'draft', 'cancelled' ]; const sorted = [ ...stats.tasksByStatus ].sort((a, b)=>order.indexOf(a.status) - order.indexOf(b.status)); return sorted.map((param)=>{ let { status, count: c } = param; var _statusMeta_status; const meta = (_statusMeta_status = statusMeta[status]) !== null && _statusMeta_status !== void 0 ? _statusMeta_status : { label: status, bg: 'bg-gray-50', bar: 'bg-gray-300' }; const pct = Math.round(Number(c) / total * 100); return /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 px-3 py-2 rounded-lg ".concat(meta.bg), children: [ /*#__PURE__*/ _jsx("span", { className: "text-sm text-gray-600 w-28 shrink-0", children: meta.label }), /*#__PURE__*/ _jsx("div", { className: "flex-1 bg-gray-200 rounded-full h-2 overflow-hidden", children: /*#__PURE__*/ _jsx("div", { className: "h-full rounded-full ".concat(meta.bar, " transition-all"), style: { width: "".concat(pct, "%") } }) }), /*#__PURE__*/ _jsx("span", { className: "text-sm font-semibold text-gray-700 w-8 text-right", children: c }), /*#__PURE__*/ _jsxs("span", { className: "text-xs text-gray-400 w-8", children: [ pct, "%" ] }) ] }, status); }); })() }) ] }), notifsByDay.length > 0 && /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between mb-4", children: [ /*#__PURE__*/ _jsx("h2", { className: "font-semibold text-gray-800", children: t('admin.stats.notif_chart_title') }), /*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-1.5 text-xs text-gray-500", children: [ /*#__PURE__*/ _jsx("span", { className: "w-3 h-0.5 bg-orange-500 inline-block rounded" }), t('admin.stats.notif_label') ] }) ] }), /*#__PURE__*/ _jsx(AdminAreaChart, { series: [ { data: notifsByDay, color: '#f97316', fill: '#f9731615', label: t('admin.stats.notif_label') } ] }) ] }), mailByDay.length > 0 && /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between mb-4", children: [ /*#__PURE__*/ _jsx("h2", { className: "font-semibold text-gray-800", children: t('admin.stats.mail_chart_title') }), /*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-1.5 text-xs text-gray-500", children: [ /*#__PURE__*/ _jsx("span", { className: "w-3 h-0.5 bg-sky-500 inline-block rounded" }), t('admin.stats.mail_label') ] }) ] }), /*#__PURE__*/ _jsx(AdminAreaChart, { series: [ { data: mailByDay, color: '#0ea5e9', fill: '#0ea5e915', label: t('admin.stats.mail_label') } ] }) ] }), stats && /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6 space-y-5", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between", children: [ /*#__PURE__*/ _jsx("h2", { className: "font-semibold text-gray-800", children: t('admin.stats.tokens_title') }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-4 text-xs text-gray-500", children: [ /*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-1.5", children: [ /*#__PURE__*/ _jsx("span", { className: "w-3 h-0.5 bg-violet-500 inline-block rounded" }), t('admin.stats.tokens_out') ] }), /*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-1.5", children: [ /*#__PURE__*/ _jsx("span", { className: "w-3 h-0.5 bg-sky-500 inline-block rounded" }), t('admin.stats.tokens_in') ] }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "grid grid-cols-3 gap-4", children: [ /*#__PURE__*/ _jsxs("div", { className: "rounded-lg bg-violet-50 border border-violet-100 px-4 py-3", children: [ /*#__PURE__*/ _jsx("div", { className: "text-xs text-violet-600 mb-1", children: t('admin.stats.tokens_out_label') }), /*#__PURE__*/ _jsx("div", { className: "text-2xl font-bold text-violet-700", children: Number(stats.totalOutputTokens).toLocaleString() }) ] }), /*#__PURE__*/ _jsxs("div", { className: "rounded-lg bg-sky-50 border border-sky-100 px-4 py-3", children: [ /*#__PURE__*/ _jsx("div", { className: "text-xs text-sky-600 mb-1", children: t('admin.stats.tokens_in_label') }), /*#__PURE__*/ _jsx("div", { className: "text-2xl font-bold text-sky-700", children: Number(stats.totalInputTokens).toLocaleString() }) ] }), /*#__PURE__*/ _jsxs("div", { className: "rounded-lg bg-emerald-50 border border-emerald-100 px-4 py-3", children: [ /*#__PURE__*/ _jsx("div", { className: "text-xs text-emerald-600 mb-1", children: t('admin.stats.cost_label') }), /*#__PURE__*/ _jsxs("div", { className: "text-2xl font-bold text-emerald-700", children: [ "$", Number((_stats_totalCostUsd = stats.totalCostUsd) !== null && _stats_totalCostUsd !== void 0 ? _stats_totalCostUsd : 0).toFixed(4) ] }) ] }) ] }), ((_stats_tokensByMonth = stats.tokensByMonth) === null || _stats_tokensByMonth === void 0 ? void 0 : _stats_tokensByMonth.length) > 0 && /*#__PURE__*/ _jsx(AdminMonthChart, { dateLocale: dateLocale, series: [ { data: stats.tokensByMonth.map((r)=>({ month: r.month, count: Number(r.output) })), color: '#8b5cf6', fill: '#8b5cf610', label: t('admin.stats.tokens_out_label') }, { data: stats.tokensByMonth.map((r)=>({ month: r.month, count: Number(r.input) })), color: '#0ea5e9', fill: '#0ea5e915', label: t('admin.stats.tokens_in_label') } ] }) ] }) ] }), tab === 'users' && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("div", { className: "flex gap-3 mb-4", children: [ /*#__PURE__*/ _jsxs("form", { className: "flex gap-2 flex-1", onSubmit: (e)=>{ e.preventDefault(); setUsersQ(usersQInput); }, children: [ /*#__PURE__*/ _jsx("input", { value: usersQInput, onChange: (e)=>setUsersQInput(e.target.value), placeholder: t('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" }), /*#__PURE__*/ _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: t('tasks.search.btn') }) ] }), /*#__PURE__*/ _jsxs("select", { value: usersRole, onChange: (e)=>setUsersRole(e.target.value), className: "border border-gray-300 rounded-lg px-3 py-2 text-sm", children: [ /*#__PURE__*/ _jsx("option", { value: "", children: t('admin.filter.all_roles') }), /*#__PURE__*/ _jsx("option", { value: "user", children: t('admin.user_edit.role.user') }), /*#__PURE__*/ _jsx("option", { value: "admin", children: t('profile.role.admin') }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 overflow-hidden", children: [ /*#__PURE__*/ _jsxs("table", { className: "w-full text-sm", children: [ /*#__PURE__*/ _jsx("thead", { className: "bg-gray-50 text-left", children: /*#__PURE__*/ _jsxs("tr", { children: [ /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.col.user') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.col.email') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.col.role') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.col.plan', 'Plan') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.col.registered') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.col.status') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3" }) ] }) }), /*#__PURE__*/ _jsx("tbody", { className: "divide-y divide-gray-100", children: loading ? /*#__PURE__*/ _jsx("tr", { children: /*#__PURE__*/ _jsx("td", { colSpan: 6, className: "px-4 py-8 text-center text-gray-400", children: t('common.loading') }) }) : users.length === 0 ? /*#__PURE__*/ _jsx("tr", { children: /*#__PURE__*/ _jsx("td", { colSpan: 6, className: "px-4 py-8 text-center text-gray-400", children: "—" }) }) : users.map((u)=>{ var _planRows_find; var _planRows_find_name; return /*#__PURE__*/ _jsxs("tr", { className: "hover:bg-gray-50", children: [ /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 font-medium text-gray-800", children: formatShortName(u.firstName, u.lastName, u.name) }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-gray-500", children: u.email }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3", children: /*#__PURE__*/ _jsx("span", { className: "px-2 py-0.5 rounded-full text-xs font-medium ".concat(u.role === 'admin' ? 'bg-red-100 text-red-700' : u.role === 'specialist' ? 'bg-green-100 text-green-700' : 'bg-gray-100 text-gray-600'), children: t("profile.role.".concat(u.role)) || u.role }) }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-gray-400 text-xs", children: u.planId ? (_planRows_find_name = (_planRows_find = planRows.find((p)=>p.id === u.planId)) === null || _planRows_find === void 0 ? void 0 : _planRows_find.name) !== null && _planRows_find_name !== void 0 ? _planRows_find_name : /*#__PURE__*/ _jsxs("span", { className: "font-mono", children: [ u.planId.slice(0, 8), "
" ] }) : /*#__PURE__*/ _jsx("span", { className: "text-gray-300", children: "—" }) }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-gray-400", children: new Date(u.createdAt).toLocaleDateString(dateLocale) }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3", children: /*#__PURE__*/ _jsx("span", { className: "px-2 py-0.5 rounded-full text-xs font-medium ".concat(u.isActive !== false ? 'bg-green-100 text-green-700' : 'bg-red-100 text-red-600'), children: u.isActive !== false ? t('admin.users.active') : t('admin.users.inactive') }) }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-right", children: /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-end gap-1.5", children: [ /*#__PURE__*/ _jsx("button", { onClick: ()=>openEditUser(u), 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: /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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" }) }) }), u.role !== 'admin' && /*#__PURE__*/ _jsx("button", { onClick: ()=>toggleUser(u.id, u.isActive !== false), className: "text-xs px-3 py-1 rounded-lg font-medium ".concat(u.isActive !== false ? 'bg-red-50 text-red-600 hover:bg-red-100' : 'bg-green-50 text-green-600 hover:bg-green-100'), children: u.isActive !== false ? t('admin.users.deactivate') : t('admin.users.activate') }) ] }) }) ] }, u.id); }) }) ] }), /*#__PURE__*/ _jsx(Pagination, { page: usersPage, total: usersTotal, limit: 20, onChange: setUsersPage, totalLabel: t('admin.pagination.total') }) ] }) ] }), tab === 'balances' && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("div", { className: "flex flex-wrap gap-3 mb-4", children: [ /*#__PURE__*/ _jsx("input", { value: balanceUserId, onChange: (e)=>setBalanceUserId(e.target.value), placeholder: t('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" }), /*#__PURE__*/ _jsxs("select", { value: balanceKind, onChange: (e)=>setBalanceKind(e.target.value), className: "border border-gray-300 rounded-lg px-3 py-2 text-sm", children: [ /*#__PURE__*/ _jsx("option", { value: "", children: t('admin.balance.filter.all', 'All operations') }), /*#__PURE__*/ _jsx("option", { value: "topup", children: t('admin.balance.kind.topup', 'Top-up') }), /*#__PURE__*/ _jsx("option", { value: "plan_purchase", children: t('admin.balance.kind.plan_purchase', 'Plan charge') }), /*#__PURE__*/ _jsx("option", { value: "admin_topup", children: t('admin.balance.kind.admin_topup', 'Admin top-up') }), /*#__PURE__*/ _jsx("option", { value: "admin_adjustment", children: t('admin.balance.kind.admin_adjustment', 'Adjustment') }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 overflow-hidden", children: [ /*#__PURE__*/ _jsxs("table", { className: "w-full text-sm", children: [ /*#__PURE__*/ _jsx("thead", { className: "bg-gray-50 text-left", children: /*#__PURE__*/ _jsxs("tr", { children: [ /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.col.user') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.balance.col.operation', 'Operation') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.balance.col.amount', 'Amount') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.balance.col.result', 'Balance') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.balance.col.description', 'Description') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.balance.col.date', 'Date') }) ] }) }), /*#__PURE__*/ _jsx("tbody", { className: "divide-y divide-gray-100", children: loading ? /*#__PURE__*/ _jsx("tr", { children: /*#__PURE__*/ _jsx("td", { colSpan: 6, className: "px-4 py-8 text-center text-gray-400", children: t('common.loading') }) }) : balanceRows.length === 0 ? /*#__PURE__*/ _jsx("tr", { children: /*#__PURE__*/ _jsx("td", { colSpan: 6, className: "px-4 py-8 text-center text-gray-400", children: t('admin.balance.empty', 'No records yet') }) }) : balanceRows.map((row)=>{ const isCredit = row.direction === 'credit'; const kindLabel = row.kind === 'topup' ? t('admin.balance.kind.topup', 'Top-up') : row.kind === 'plan_purchase' ? t('admin.balance.kind.plan_purchase', 'Plan charge') : row.kind === 'admin_topup' ? t('admin.balance.kind.admin_topup', 'Admin top-up') : t('admin.balance.kind.admin_adjustment', 'Adjustment'); return /*#__PURE__*/ _jsxs("tr", { className: "hover:bg-gray-50 align-top", children: [ /*#__PURE__*/ _jsxs("td", { className: "px-4 py-3", children: [ /*#__PURE__*/ _jsx("div", { className: "font-medium text-gray-800", children: row.userName || '—' }), /*#__PURE__*/ _jsx("div", { className: "text-xs text-gray-500 mt-0.5", children: row.userEmail || row.userId }) ] }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3", children: /*#__PURE__*/ _jsx("span", { className: "inline-flex rounded-full px-2 py-0.5 text-xs font-medium ".concat(isCredit ? 'bg-emerald-50 text-emerald-700' : 'bg-rose-50 text-rose-700'), children: kindLabel }) }), /*#__PURE__*/ _jsxs("td", { className: "px-4 py-3 font-semibold ".concat(isCredit ? 'text-emerald-700' : 'text-rose-700'), children: [ isCredit ? '+' : '-', Number(row.amount).toFixed(2), " ", row.currency ] }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-gray-600", children: /*#__PURE__*/ _jsxs("div", { children: [ Number(row.balanceBefore).toFixed(2), " → ", Number(row.balanceAfter).toFixed(2), " ", row.currency ] }) }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-gray-500 max-w-sm", children: row.description || '—' }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-gray-500 whitespace-nowrap", children: new Date(row.createdAt).toLocaleString(dateLocale) }) ] }, row.id); }) }) ] }), /*#__PURE__*/ _jsx(Pagination, { page: balancePage, total: balanceTotal, limit: 50, onChange: setBalancePage, totalLabel: t('admin.pagination.total') }) ] }) ] }), tab === 'tasks' && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("div", { className: "flex gap-3 mb-4", children: [ /*#__PURE__*/ _jsxs("form", { className: "flex gap-2 flex-1", onSubmit: (e)=>{ e.preventDefault(); setTasksQ(tasksQInput); }, children: [ /*#__PURE__*/ _jsx("input", { value: tasksQInput, onChange: (e)=>setTasksQInput(e.target.value), placeholder: t('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" }), /*#__PURE__*/ _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: t('tasks.search.btn') }) ] }), /*#__PURE__*/ _jsxs("select", { value: tasksStatus, onChange: (e)=>setTasksStatus(e.target.value), className: "border border-gray-300 rounded-lg px-3 py-2 text-sm", children: [ /*#__PURE__*/ _jsx("option", { value: "", children: t('admin.filter.all_statuses') }), [ 'open', 'in_progress', 'completed', 'cancelled', 'draft' ].map((s)=>/*#__PURE__*/ _jsx("option", { value: s, children: t("task.status.".concat(s), s) }, s)) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 overflow-hidden", children: [ /*#__PURE__*/ _jsxs("table", { className: "w-full text-sm", children: [ /*#__PURE__*/ _jsx("thead", { className: "bg-gray-50 text-left", children: /*#__PURE__*/ _jsxs("tr", { children: [ /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.col.title') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.col.customer') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.col.status') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.col.budget') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.col.created') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3" }) ] }) }), /*#__PURE__*/ _jsx("tbody", { className: "divide-y divide-gray-100", children: loading ? /*#__PURE__*/ _jsx("tr", { children: /*#__PURE__*/ _jsx("td", { colSpan: 6, className: "px-4 py-8 text-center text-gray-400", children: t('common.loading') }) }) : tasks.length === 0 ? /*#__PURE__*/ _jsx("tr", { children: /*#__PURE__*/ _jsx("td", { colSpan: 6, className: "px-4 py-8 text-center text-gray-400", children: "—" }) }) : tasks.map((row)=>{ const task = row.task || row; const customer = row.customer; var _customer_name, _statusColors_task_status; return /*#__PURE__*/ _jsxs("tr", { className: "hover:bg-gray-50", children: [ /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 font-medium text-gray-800 max-w-xs", children: /*#__PURE__*/ _jsx(Link, { href: "/tasks/".concat(task.id), className: "hover:text-green-600 truncate block", target: "_blank", children: locale === 'en' && task.titleEn || locale === 'ru' && task.titleRu || locale === 'uk' && task.titleUk || task.titleEl || task.title }) }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-gray-500 text-xs", children: (_customer_name = customer === null || customer === void 0 ? void 0 : customer.name) !== null && _customer_name !== void 0 ? _customer_name : '—' }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3", children: /*#__PURE__*/ _jsx("span", { className: "px-2 py-0.5 rounded-full text-xs font-medium ".concat((_statusColors_task_status = statusColors[task.status]) !== null && _statusColors_task_status !== void 0 ? _statusColors_task_status : 'bg-gray-100 text-gray-600'), children: t("task.status.".concat(task.status), task.status) }) }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-gray-500", children: task.budget ? "".concat(formatPrice(task.budget), "€") : '—' }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-gray-400", children: new Date(task.createdAt).toLocaleDateString(dateLocale) }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-right", children: /*#__PURE__*/ _jsxs("div", { className: "flex gap-1.5 justify-end", children: [ task.status !== 'cancelled' && task.status !== 'completed' && /*#__PURE__*/ _jsx("button", { onClick: ()=>cancelTask(task.id), className: "text-xs px-2.5 py-1 rounded-lg font-medium bg-yellow-50 text-yellow-700 hover:bg-yellow-100", children: t('admin.tasks.cancel') }), /*#__PURE__*/ _jsx("button", { onClick: ()=>deleteTask(task.id, locale === 'en' && task.titleEn || locale === 'ru' && task.titleRu || locale === 'uk' && task.titleUk || task.titleEl || task.title), className: "text-xs px-2.5 py-1 rounded-lg font-medium bg-red-50 text-red-600 hover:bg-red-100", children: t('admin.tasks.delete') }) ] }) }) ] }, task.id); }) }) ] }), /*#__PURE__*/ _jsx(Pagination, { page: tasksPage, total: tasksTotal, limit: 20, onChange: setTasksPage, totalLabel: t('admin.pagination.total') }) ] }) ] }), tab === 'categories' && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("div", { className: "flex justify-between items-center mb-4", children: [ /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-500", children: t('admin.cat.hint') }), /*#__PURE__*/ _jsxs("button", { onClick: ()=>openAddCat(null), className: "px-4 py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700", children: [ "+ ", t('admin.cat.add_root') ] }) ] }), catForm && /*#__PURE__*/ _jsxs("div", { className: "bg-green-50 border border-green-200 rounded-xl p-5 mb-4", children: [ /*#__PURE__*/ _jsxs("h3", { className: "font-semibold text-gray-800 mb-4", children: [ catForm.id ? t('admin.cat.edit') : t('admin.cat.new'), catForm.parentId && /*#__PURE__*/ _jsxs("span", { className: "text-xs text-gray-400 ml-2", children: [ "(", t('admin.cat.subcategory'), ")" ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "grid grid-cols-2 md:grid-cols-3 gap-3 mb-3", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.cat.slug') }), /*#__PURE__*/ _jsx("input", { value: catForm.slug, onChange: (e)=>setCatForm((f)=>f && { ...f, slug: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm", placeholder: "e.g. repairs" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.cat.icon') }), /*#__PURE__*/ _jsx(CategoryIconPicker, { value: catForm.icon, onChange: (icon)=>setCatForm((f)=>f && { ...f, icon }), onUpload: uploadCategoryIcon, uploading: catIconUploading, error: catIconError, presets: categoryIconPresets }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.cat.order') }), /*#__PURE__*/ _jsx("input", { type: "number", value: catForm.order, onChange: (e)=>setCatForm((f)=>f && { ...f, order: Number(e.target.value) }), className: "w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: [ t('admin.cat.name_el'), " \uD83C\uDDEC\uD83C\uDDF7" ] }), /*#__PURE__*/ _jsx("input", { value: catForm.namesEl, onChange: (e)=>setCatForm((f)=>f && { ...f, namesEl: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: [ t('admin.cat.name_en'), " \uD83C\uDDEC\uD83C\uDDE7" ] }), /*#__PURE__*/ _jsx("input", { value: catForm.namesEn, onChange: (e)=>setCatForm((f)=>f && { ...f, namesEn: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: [ t('admin.cat.name_ru'), " \uD83C\uDDF7\uD83C\uDDFA" ] }), /*#__PURE__*/ _jsx("input", { value: catForm.namesRu, onChange: (e)=>setCatForm((f)=>f && { ...f, namesRu: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: [ t('admin.cat.name_uk'), " \uD83C\uDDFA\uD83C\uDDE6" ] }), /*#__PURE__*/ _jsx("input", { value: catForm.namesUk, onChange: (e)=>setCatForm((f)=>f && { ...f, namesUk: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }) ] }), catForm.id && /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-2 text-sm text-gray-700 mb-3", children: [ /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: catForm.isActive, onChange: (e)=>setCatForm((f)=>f && { ...f, isActive: e.target.checked }) }), t('admin.cat.active') ] }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-2", children: [ /*#__PURE__*/ _jsx("button", { onClick: saveCat, disabled: catSaving, className: "px-4 py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700 disabled:opacity-50", children: catSaving ? t('common.saving') : t('common.save') }), /*#__PURE__*/ _jsx("button", { onClick: ()=>setCatForm(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: t('common.cancel') }) ] }) ] }), /*#__PURE__*/ _jsx("div", { className: "bg-white rounded-xl border border-gray-200 divide-y divide-gray-100", children: catRows.length === 0 ? /*#__PURE__*/ _jsx("div", { className: "px-4 py-8 text-center text-gray-400", children: t('admin.cat.empty') }) : /*#__PURE__*/ _jsx(CatTree, { rows: catRows, parentId: null, depth: 0, locale: locale, expanded: catExpanded, onToggle: toggleCatExpand, onEdit: openEditCat, onDelete: deleteCat, onAddChild: openAddCat, skillsExpanded: catSkillsExpanded, skillsCache: catSkillsCache, skillsLoading: catSkillsLoading, onToggleSkills: toggleCatSkills, skillForm: skillForm, skillSaving: skillSaving, onOpenAddSkill: openAddSkill, onOpenEditSkill: openEditSkill, onSaveSkill: saveSkill, onDeleteSkill: deleteSkill, onCancelSkillForm: ()=>setSkillForm(null), onSkillFormChange: setSkillForm, t: t }) }) ] }), tab === 'locations' && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("div", { className: "flex justify-between items-center mb-4", children: [ /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-500", children: t('admin.loc.hint') }), /*#__PURE__*/ _jsxs("button", { onClick: ()=>openAddLoc(null), className: "px-4 py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700", children: [ "+ ", t('admin.loc.add_city') ] }) ] }), locForm && /*#__PURE__*/ _jsxs("div", { className: "bg-green-50 border border-green-200 rounded-xl p-5 mb-4", children: [ /*#__PURE__*/ _jsxs("h3", { className: "font-semibold text-gray-800 mb-4", children: [ locForm.id ? t('admin.loc.edit') : t('admin.loc.new'), locForm.parentId && /*#__PURE__*/ _jsxs("span", { className: "text-xs text-gray-400 ml-2", children: [ "(", t('admin.loc.district'), ")" ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "grid grid-cols-2 md:grid-cols-4 gap-3 mb-3", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.cat.slug') }), /*#__PURE__*/ _jsx("input", { value: locForm.slug, onChange: (e)=>setLocForm((f)=>f && { ...f, slug: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm", placeholder: "e.g. athens-center" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: [ t('admin.cat.name_el'), " \uD83C\uDDEC\uD83C\uDDF7" ] }), /*#__PURE__*/ _jsx("input", { value: locForm.nameEl, onChange: (e)=>setLocForm((f)=>f && { ...f, nameEl: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: [ t('admin.cat.name_en'), " \uD83C\uDDEC\uD83C\uDDE7" ] }), /*#__PURE__*/ _jsx("input", { value: locForm.nameEn, onChange: (e)=>setLocForm((f)=>f && { ...f, nameEn: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: [ t('admin.cat.name_ru'), " \uD83C\uDDF7\uD83C\uDDFA" ] }), /*#__PURE__*/ _jsx("input", { value: locForm.nameRu, onChange: (e)=>setLocForm((f)=>f && { ...f, nameRu: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: [ t('admin.cat.name_uk'), " \uD83C\uDDFA\uD83C\uDDE6" ] }), /*#__PURE__*/ _jsx("input", { value: locForm.nameUk, onChange: (e)=>setLocForm((f)=>f && { ...f, nameUk: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-4 mb-3", children: [ /*#__PURE__*/ _jsxs("div", { className: "w-24", children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.cat.order') }), /*#__PURE__*/ _jsx("input", { type: "number", value: locForm.order, onChange: (e)=>setLocForm((f)=>f && { ...f, order: Number(e.target.value) }), className: "w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), locForm.id && /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-2 text-sm text-gray-700 mt-4", children: [ /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: locForm.isActive, onChange: (e)=>setLocForm((f)=>f && { ...f, isActive: e.target.checked }) }), t('admin.cat.active') ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-2", children: [ /*#__PURE__*/ _jsx("button", { onClick: saveLoc, disabled: locSaving, className: "px-4 py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700 disabled:opacity-50", children: locSaving ? t('common.saving') : t('common.save') }), /*#__PURE__*/ _jsx("button", { onClick: ()=>setLocForm(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: t('common.cancel') }) ] }) ] }), /*#__PURE__*/ _jsx("div", { className: "bg-white rounded-xl border border-gray-200 divide-y divide-gray-100", children: locRows.length === 0 ? /*#__PURE__*/ _jsx("div", { className: "px-4 py-8 text-center text-gray-400", children: t('admin.loc.empty') }) : /*#__PURE__*/ _jsx(LocTree, { rows: locRows, parentId: null, depth: 0, locale: locale, expanded: locExpanded, onToggle: toggleLocExpand, onEdit: openEditLoc, onDelete: deleteLoc, onAddChild: openAddLoc, t: t }) }) ] }), tab === 'reports' && /*#__PURE__*/ _jsxs("div", { className: "space-y-3", children: [ loading ? /*#__PURE__*/ _jsx("div", { className: "text-center py-10 text-gray-400", children: t('common.loading') }) : reports.length === 0 ? /*#__PURE__*/ _jsx("div", { className: "text-center py-10 text-gray-400", children: t('admin.reports.none') }) : reports.map((r)=>{ var _r_targetId; var _reportStatusColors_r_status, _reasonColors_r_reason; return /*#__PURE__*/ _jsx("div", { className: "bg-white rounded-xl border border-gray-200 p-5", children: /*#__PURE__*/ _jsxs("div", { className: "flex items-start justify-between gap-4", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 flex-wrap mb-2", children: [ /*#__PURE__*/ _jsx("span", { className: "px-2 py-0.5 rounded-full text-xs font-medium ".concat((_reportStatusColors_r_status = reportStatusColors[r.status]) !== null && _reportStatusColors_r_status !== void 0 ? _reportStatusColors_r_status : 'bg-gray-100 text-gray-500'), children: r.status }), /*#__PURE__*/ _jsx("span", { className: "px-2 py-0.5 rounded-full text-xs font-medium ".concat((_reasonColors_r_reason = reasonColors[r.reason]) !== null && _reasonColors_r_reason !== void 0 ? _reasonColors_r_reason : 'bg-gray-100 text-gray-600'), children: r.reason }), /*#__PURE__*/ _jsxs("span", { className: "text-xs text-gray-400", children: [ r.targetType === 'task' ? t('admin.reports.target.task') : t('admin.reports.target.user'), ":", ' ', r.targetTitle ? /*#__PURE__*/ _jsx(Link, { href: r.targetType === 'task' ? "/tasks/".concat(r.targetId) : "/users/".concat(r.targetId), className: "text-green-600 hover:underline font-medium", target: "_blank", children: r.targetTitle }) : /*#__PURE__*/ _jsxs("span", { className: "font-mono", children: [ "#", (_r_targetId = r.targetId) === null || _r_targetId === void 0 ? void 0 : _r_targetId.slice(0, 8) ] }) ] }) ] }), r.reporterName && /*#__PURE__*/ _jsxs("p", { className: "text-xs text-gray-400 mb-1", children: [ t('admin.col.reporter'), ": ", /*#__PURE__*/ _jsx("span", { className: "font-medium text-gray-600", children: r.reporterName }) ] }), r.description && /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-700", children: r.description }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-1.5", children: new Date(r.createdAt).toLocaleString(dateLocale) }) ] }), r.status === 'pending' && /*#__PURE__*/ _jsxs("div", { className: "flex gap-2 flex-shrink-0", children: [ /*#__PURE__*/ _jsx("button", { onClick: ()=>handleReport(r.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: t('admin.reports.reviewed') }), /*#__PURE__*/ _jsx("button", { onClick: ()=>handleReport(r.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: t('admin.reports.dismiss') }) ] }) ] }) }, r.id); }), /*#__PURE__*/ _jsx(Pagination, { page: reportsPage, total: reportsTotal, limit: 20, onChange: setReportsPage, totalLabel: t('admin.pagination.total') }) ] }), tab === 'moderation' && /*#__PURE__*/ _jsxs("div", { className: "space-y-6", children: [ /*#__PURE__*/ _jsxs("div", { className: "grid md:grid-cols-2 gap-4", children: [ /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-5", children: [ /*#__PURE__*/ _jsx("div", { className: "text-sm text-gray-500", children: t('admin.moderation.pending_count', 'Pending') }), /*#__PURE__*/ _jsx("div", { className: "text-3xl font-bold text-gray-900 mt-1", children: pendingModerationCards.length }), /*#__PURE__*/ _jsx("div", { className: "text-xs text-gray-400 mt-1", children: t('admin.moderation.pending_hint', 'New proposals waiting for approval') }) ] }), /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-5", children: [ /*#__PURE__*/ _jsx("div", { className: "text-sm text-gray-500", children: t('admin.moderation.active_count', 'Active') }), /*#__PURE__*/ _jsx("div", { className: "text-3xl font-bold text-gray-900 mt-1", children: activeModerationCards.length }), /*#__PURE__*/ _jsx("div", { className: "text-xs text-gray-400 mt-1", children: t('admin.moderation.active_hint', 'Visible cards that can be blocked') }) ] }) ] }), moderationCardsLoading ? /*#__PURE__*/ _jsx("div", { className: "text-center py-10 text-gray-400", children: t('common.loading') }) : moderationCards.length === 0 ? /*#__PURE__*/ _jsx("div", { className: "text-center py-10 text-gray-400", children: t('admin.moderation.none', 'No specialist cards found') }) : /*#__PURE__*/ _jsxs("div", { className: "space-y-6", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-gray-800 mb-3", children: t('admin.moderation.pending_title', 'Pending approval') }), /*#__PURE__*/ _jsx("div", { className: "space-y-3", children: pendingModerationCards.length === 0 ? /*#__PURE__*/ _jsx("div", { className: "text-sm text-gray-400 bg-white border border-dashed border-gray-200 rounded-xl p-4", children: t('admin.moderation.pending_empty', 'No pending proposals right now') }) : pendingModerationCards.map((card)=>{ var _card_specialistName, _ref; return /*#__PURE__*/ _jsx("div", { className: "bg-white rounded-xl border border-gray-200 p-4", children: /*#__PURE__*/ _jsxs("div", { className: "flex flex-wrap items-start justify-between gap-3", children: [ /*#__PURE__*/ _jsxs("div", { className: "min-w-0 flex-1", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 flex-wrap mb-1", children: [ /*#__PURE__*/ _jsx("span", { className: "px-2 py-0.5 rounded-full text-xs font-medium bg-yellow-100 text-yellow-700", children: t('admin.moderation.pending', 'Pending') }), /*#__PURE__*/ _jsx("span", { className: "text-sm font-semibold text-gray-800 truncate", children: card.title }) ] }), /*#__PURE__*/ _jsx("div", { className: "text-xs text-gray-500 mb-2", children: /*#__PURE__*/ _jsx(Link, { href: "/users/".concat(card.specialistId), className: "hover:text-green-600 hover:underline font-medium", children: (_ref = (_card_specialistName = card.specialistName) !== null && _card_specialistName !== void 0 ? _card_specialistName : card.specialistEmail) !== null && _ref !== void 0 ? _ref : card.specialistId }) }), card.description && /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-700 line-clamp-3", children: card.description }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-2 flex-shrink-0", children: [ /*#__PURE__*/ _jsx("button", { onClick: ()=>updateModerationCard(card.id, 'active'), className: "px-3 py-1.5 rounded-lg text-xs font-medium bg-green-600 text-white hover:bg-green-700", children: t('admin.moderation.approve', 'Approve') }), /*#__PURE__*/ _jsx("button", { onClick: ()=>updateModerationCard(card.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: t('admin.moderation.block', 'Block') }) ] }) ] }) }, card.id); }) }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-gray-800 mb-3", children: t('admin.moderation.active_title', 'Active cards') }), /*#__PURE__*/ _jsx("div", { className: "space-y-3", children: activeModerationCards.length === 0 ? /*#__PURE__*/ _jsx("div", { className: "text-sm text-gray-400 bg-white border border-dashed border-gray-200 rounded-xl p-4", children: t('admin.moderation.active_empty', 'No active cards found') }) : activeModerationCards.map((card)=>{ var _card_specialistName, _ref; return /*#__PURE__*/ _jsx("div", { className: "bg-white rounded-xl border border-gray-200 p-4", children: /*#__PURE__*/ _jsxs("div", { className: "flex flex-wrap items-start justify-between gap-3", children: [ /*#__PURE__*/ _jsxs("div", { className: "min-w-0 flex-1", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 flex-wrap mb-1", children: [ /*#__PURE__*/ _jsx("span", { className: "px-2 py-0.5 rounded-full text-xs font-medium bg-green-100 text-green-700", children: t('admin.moderation.active', 'Active') }), /*#__PURE__*/ _jsx("span", { className: "text-sm font-semibold text-gray-800 truncate", children: card.title }) ] }), /*#__PURE__*/ _jsx("div", { className: "text-xs text-gray-500 mb-2", children: /*#__PURE__*/ _jsx(Link, { href: "/users/".concat(card.specialistId), className: "hover:text-green-600 hover:underline font-medium", children: (_ref = (_card_specialistName = card.specialistName) !== null && _card_specialistName !== void 0 ? _card_specialistName : card.specialistEmail) !== null && _ref !== void 0 ? _ref : card.specialistId }) }), card.description && /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-700 line-clamp-3", children: card.description }) ] }), /*#__PURE__*/ _jsx("button", { onClick: ()=>updateModerationCard(card.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: t('admin.moderation.block', 'Block') }) ] }) }, card.id); }) }) ] }), /*#__PURE__*/ _jsx(Pagination, { page: moderationCardsPage, total: moderationCardsTotal, limit: 20, onChange: setModerationCardsPage, totalLabel: t('admin.pagination.total') }) ] }) ] }), tab === 'logs' && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("div", { className: "flex gap-1 bg-gray-100 rounded-xl p-1 mb-5 w-fit", children: [ { key: 'ai', label: t('admin.logs.subtab.ai') }, { key: 'activity', label: t('admin.logs.subtab.activity') }, { key: 'mail', label: t('admin.logs.subtab.mail') }, { key: 'notifications', label: t('admin.logs.subtab.notifications') } ].map((param)=>{ let { key, label } = param; return /*#__PURE__*/ _jsx("button", { onClick: ()=>setLogsSubTab(key), className: "px-4 py-1.5 rounded-lg text-sm font-medium transition-colors ".concat(logsSubTab === key ? 'bg-white text-gray-900 shadow-sm' : 'text-gray-500 hover:text-gray-700'), children: label }, key); }) }), logsSubTab === 'ai' && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("div", { className: "flex justify-between items-center mb-4", children: [ /*#__PURE__*/ _jsxs("p", { className: "text-sm text-gray-500", children: [ t('admin.pagination.total'), ": ", logsTotal ] }), /*#__PURE__*/ _jsxs("button", { onClick: ()=>{ setLogsPage(1); api.getAdminAiLogs(1).then((d)=>{ setLogs(d.data); setLogsTotal(d.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: [ /*#__PURE__*/ _jsxs("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ _jsx("polyline", { points: "23 4 23 10 17 10" }), /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M20.49 15a9 9 0 11-2.12-9.36L23 10" }) ] }), t('common.refresh') ] }) ] }), loading ? /*#__PURE__*/ _jsx("div", { className: "text-center py-10 text-gray-400", children: t('common.loading') }) : logs.length === 0 ? /*#__PURE__*/ _jsx("div", { className: "text-center py-10 text-gray-400", children: t('admin.logs.empty') }) : /*#__PURE__*/ _jsx("div", { className: "overflow-x-auto rounded-xl border border-gray-200", children: /*#__PURE__*/ _jsxs("table", { className: "w-full text-sm", children: [ /*#__PURE__*/ _jsx("thead", { className: "bg-gray-50 text-gray-500 text-xs uppercase", children: /*#__PURE__*/ _jsxs("tr", { children: [ /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 text-left", children: t('admin.logs.date') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 text-left", children: t('admin.logs.provider') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 text-left", children: t('admin.logs.model') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 text-left", children: t('admin.logs.action') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 text-left", children: t('admin.logs.langs') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 text-right", children: t('admin.logs.in') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 text-right", children: t('admin.logs.out') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 text-right", children: t('admin.logs.total') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 text-right", children: t('admin.logs.ms') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 text-center", children: t('admin.logs.status') }) ] }) }), /*#__PURE__*/ _jsx("tbody", { className: "divide-y divide-gray-100", children: logs.map((log)=>{ var _log_inputTokens, _log_outputTokens, _log_totalTokens, _log_durationMs, _log_error; return /*#__PURE__*/ _jsxs("tr", { className: "bg-white hover:bg-gray-50", children: [ /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-gray-500 whitespace-nowrap", children: new Date(log.createdAt).toLocaleString(dateLocale) }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3", children: /*#__PURE__*/ _jsx("span", { className: "px-2 py-0.5 rounded-full text-xs font-medium ".concat(log.provider === 'anthropic' ? 'bg-purple-100 text-purple-700' : 'bg-green-100 text-green-700'), children: log.provider }) }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-gray-600 font-mono text-xs", children: log.model }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-gray-600", children: log.action }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-gray-500", children: log.fromLocale && log.toLocale ? "".concat(log.fromLocale, " → ").concat(log.toLocale) : '—' }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-right text-gray-600", children: (_log_inputTokens = log.inputTokens) !== null && _log_inputTokens !== void 0 ? _log_inputTokens : '—' }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-right text-gray-600", children: (_log_outputTokens = log.outputTokens) !== null && _log_outputTokens !== void 0 ? _log_outputTokens : '—' }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-right font-medium", children: (_log_totalTokens = log.totalTokens) !== null && _log_totalTokens !== void 0 ? _log_totalTokens : '—' }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-right text-gray-500", children: (_log_durationMs = log.durationMs) !== null && _log_durationMs !== void 0 ? _log_durationMs : '—' }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-center", children: log.success ? /*#__PURE__*/ _jsx("span", { className: "text-green-600 flex justify-center", children: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("polyline", { points: "20 6 9 17 4 12" }) }) }) : /*#__PURE__*/ _jsx("span", { className: "text-red-500 flex justify-center", title: (_log_error = log.error) !== null && _log_error !== void 0 ? _log_error : '', children: /*#__PURE__*/ _jsxs("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: [ /*#__PURE__*/ _jsx("line", { x1: "18", y1: "6", x2: "6", y2: "18" }), /*#__PURE__*/ _jsx("line", { x1: "6", y1: "6", x2: "18", y2: "18" }) ] }) }) }) ] }, log.id); }) }) ] }) }), /*#__PURE__*/ _jsx(Pagination, { page: logsPage, total: logsTotal, limit: 50, onChange: setLogsPage, totalLabel: t('admin.pagination.total') }) ] }), logsSubTab === 'activity' && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-4 mb-4 flex flex-wrap gap-3 items-end", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-500 mb-1", children: t('admin.activity.event') }), /*#__PURE__*/ _jsxs("select", { value: activityEvent, onChange: (e)=>setActivityEvent(e.target.value), className: "border border-gray-300 rounded-lg px-3 py-1.5 text-sm min-w-[180px]", children: [ /*#__PURE__*/ _jsx("option", { value: "", children: t('admin.activity.all_events') }), activityEventTypes.map((ev)=>/*#__PURE__*/ _jsx("option", { value: ev, children: ev }, ev)) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-500 mb-1", children: t('admin.activity.from') }), /*#__PURE__*/ _jsx("input", { type: "date", value: activityDateFrom, onChange: (e)=>setActivityDateFrom(e.target.value), className: "border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-500 mb-1", children: t('admin.activity.to') }), /*#__PURE__*/ _jsx("input", { type: "date", value: activityDateTo, onChange: (e)=>setActivityDateTo(e.target.value), className: "border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), (activityEvent || activityDateFrom || activityDateTo || activityUserId) && /*#__PURE__*/ _jsxs("button", { onClick: ()=>{ setActivityEvent(''); setActivityDateFrom(''); setActivityDateTo(''); setActivityUserId(''); }, 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: [ /*#__PURE__*/ _jsxs("svg", { className: "w-3 h-3", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: [ /*#__PURE__*/ _jsx("line", { x1: "18", y1: "6", x2: "6", y2: "18" }), /*#__PURE__*/ _jsx("line", { x1: "6", y1: "6", x2: "18", y2: "18" }) ] }), t('admin.activity.reset') ] }), /*#__PURE__*/ _jsxs("p", { className: "text-xs text-gray-400 self-end ml-auto", children: [ t('admin.activity.total'), ": ", activityTotal ] }) ] }), activityLog.length === 0 ? /*#__PURE__*/ _jsx("div", { className: "text-center py-10 text-gray-400", children: t('admin.activity.empty') }) : /*#__PURE__*/ _jsx("div", { className: "space-y-2", children: activityLog.map((entry)=>/*#__PURE__*/ _jsx(ActivityLogRow, { entry: entry, dateLocale: dateLocale, onFilterUser: (id)=>{ setActivityUserId(id); setActivityEvent(''); }, t: t }, entry.id)) }), /*#__PURE__*/ _jsx(Pagination, { page: activityPage, total: activityTotal, limit: 50, onChange: setActivityPage, totalLabel: t('admin.pagination.total') }) ] }), logsSubTab === 'mail' && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-4 mb-4 flex flex-wrap gap-3 items-end", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-500 mb-1", children: t('admin.mail.event') }), /*#__PURE__*/ _jsxs("select", { value: mailEvent, onChange: (e)=>setMailEvent(e.target.value), className: "border border-gray-300 rounded-lg px-3 py-1.5 text-sm min-w-[200px]", children: [ /*#__PURE__*/ _jsx("option", { value: "", children: t('admin.mail.all_events') }), mailEventTypes.map((ev)=>/*#__PURE__*/ _jsx("option", { value: ev, children: t("admin.event.".concat(ev.replace(/\./g, '_')), ev) }, ev)) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-500 mb-1", children: t('admin.mail.from') }), /*#__PURE__*/ _jsx("input", { type: "date", value: mailDateFrom, onChange: (e)=>setMailDateFrom(e.target.value), className: "border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-500 mb-1", children: t('admin.mail.to') }), /*#__PURE__*/ _jsx("input", { type: "date", value: mailDateTo, onChange: (e)=>setMailDateTo(e.target.value), className: "border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), (mailEvent || mailDateFrom || mailDateTo) && /*#__PURE__*/ _jsxs("button", { onClick: ()=>{ setMailEvent(''); setMailDateFrom(''); setMailDateTo(''); }, 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: [ /*#__PURE__*/ _jsxs("svg", { className: "w-3 h-3", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: [ /*#__PURE__*/ _jsx("line", { x1: "18", y1: "6", x2: "6", y2: "18" }), /*#__PURE__*/ _jsx("line", { x1: "6", y1: "6", x2: "18", y2: "18" }) ] }), t('admin.mail.reset') ] }), /*#__PURE__*/ _jsxs("p", { className: "text-xs text-gray-400 self-end ml-auto", children: [ t('admin.mail.total'), ": ", mailTotal ] }) ] }), mailLog.length === 0 ? /*#__PURE__*/ _jsx("div", { className: "text-center py-10 text-gray-400", children: t('admin.mail.empty') }) : /*#__PURE__*/ _jsx("div", { className: "overflow-x-auto rounded-xl border border-gray-200", children: /*#__PURE__*/ _jsxs("table", { className: "w-full text-sm", children: [ /*#__PURE__*/ _jsx("thead", { className: "bg-gray-50 text-gray-500 text-xs uppercase", children: /*#__PURE__*/ _jsxs("tr", { children: [ /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 text-left", children: t('admin.logs.date') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 text-left", children: t('admin.mail.recipient') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 text-left", children: t('admin.mail.event') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 text-left", children: t('admin.mail.provider') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 text-left", children: t('admin.mail.details') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 text-center", children: t('admin.mail.status') }) ] }) }), /*#__PURE__*/ _jsx("tbody", { className: "divide-y divide-gray-100", children: mailLog.map((entry)=>{ const details = parseLogDetails(entry.details); const provider = typeof (details === null || details === void 0 ? void 0 : details.provider) === 'string' ? details.provider : '—'; const recipient = typeof (details === null || details === void 0 ? void 0 : details.to) === 'string' ? details.to : entry.userEmail || '—'; const subject = typeof (details === null || details === void 0 ? void 0 : details.subject) === 'string' ? details.subject : ''; const error = typeof (details === null || details === void 0 ? void 0 : details.error) === 'string' ? details.error : ''; const success = entry.event === 'email.sent' || entry.event === 'admin.email.test.sent'; return /*#__PURE__*/ _jsxs("tr", { className: "bg-white hover:bg-gray-50 align-top", children: [ /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-gray-500 whitespace-nowrap", children: new Date(entry.createdAt).toLocaleString(dateLocale) }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-gray-700", children: recipient }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3", children: /*#__PURE__*/ _jsx("span", { className: "px-2 py-0.5 rounded-full text-xs font-medium bg-sky-50 text-sky-700", children: t("admin.event.".concat(entry.event.replace(/\./g, '_')), entry.event) }) }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-gray-600", children: provider }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-gray-600 max-w-md", children: /*#__PURE__*/ _jsx("div", { className: "truncate", title: subject || error || undefined, children: subject || error || '—' }) }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-center", children: success ? /*#__PURE__*/ _jsx("span", { className: "text-green-600 inline-flex justify-center", title: t('admin.mail.success'), children: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("polyline", { points: "20 6 9 17 4 12" }) }) }) : /*#__PURE__*/ _jsx("span", { className: "text-red-500 inline-flex justify-center", title: error || t('admin.mail.failed'), children: /*#__PURE__*/ _jsxs("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: [ /*#__PURE__*/ _jsx("line", { x1: "18", y1: "6", x2: "6", y2: "18" }), /*#__PURE__*/ _jsx("line", { x1: "6", y1: "6", x2: "18", y2: "18" }) ] }) }) }) ] }, entry.id); }) }) ] }) }), /*#__PURE__*/ _jsx(Pagination, { page: mailPage, total: mailTotal, limit: 50, onChange: setMailPage, totalLabel: t('admin.pagination.total') }) ] }), logsSubTab === 'notifications' && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-4 mb-4 flex flex-wrap gap-3 items-end", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-500 mb-1", children: t('admin.notif_logs.type') }), /*#__PURE__*/ _jsxs("select", { value: notifLogsType, onChange: (e)=>setNotifLogsType(e.target.value), className: "border border-gray-300 rounded-lg px-3 py-1.5 text-sm min-w-[200px]", children: [ /*#__PURE__*/ _jsx("option", { value: "", children: t('admin.filter.all') }), notifLogsTypes.map((tp)=>/*#__PURE__*/ _jsx("option", { value: tp, children: tp }, tp)) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-500 mb-1", children: t('admin.activity.from') }), /*#__PURE__*/ _jsx("input", { type: "date", value: notifLogsDateFrom, onChange: (e)=>setNotifLogsDateFrom(e.target.value), className: "border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-500 mb-1", children: t('admin.activity.to') }), /*#__PURE__*/ _jsx("input", { type: "date", value: notifLogsDateTo, onChange: (e)=>setNotifLogsDateTo(e.target.value), className: "border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), (notifLogsType || notifLogsDateFrom || notifLogsDateTo) && /*#__PURE__*/ _jsxs("button", { onClick: ()=>{ setNotifLogsType(''); setNotifLogsDateFrom(''); setNotifLogsDateTo(''); }, 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: [ /*#__PURE__*/ _jsxs("svg", { className: "w-3 h-3", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: [ /*#__PURE__*/ _jsx("line", { x1: "18", y1: "6", x2: "6", y2: "18" }), /*#__PURE__*/ _jsx("line", { x1: "6", y1: "6", x2: "18", y2: "18" }) ] }), t('admin.activity.reset') ] }), /*#__PURE__*/ _jsxs("p", { className: "text-xs text-gray-400 self-end ml-auto", children: [ t('admin.pagination.total'), ": ", notifLogsTotal ] }) ] }), notifLogs.length === 0 ? /*#__PURE__*/ _jsx("div", { className: "text-center py-10 text-gray-400", children: t('admin.notif_logs.empty') }) : /*#__PURE__*/ _jsx("div", { className: "overflow-x-auto rounded-xl border border-gray-200", children: /*#__PURE__*/ _jsxs("table", { className: "w-full text-sm", children: [ /*#__PURE__*/ _jsx("thead", { className: "bg-gray-50 text-gray-500 text-xs uppercase", children: /*#__PURE__*/ _jsxs("tr", { children: [ /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 text-left", children: t('admin.logs.date') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 text-left", children: t('admin.col.user') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 text-left", children: t('admin.notif_logs.type') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 text-left", children: t('admin.notif_logs.title') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 text-center", children: t('admin.notif_logs.read') }) ] }) }), /*#__PURE__*/ _jsx("tbody", { className: "divide-y divide-gray-100", children: notifLogs.map((n)=>{ var _n_recipientName, _ref; return /*#__PURE__*/ _jsxs("tr", { className: "bg-white hover:bg-gray-50", children: [ /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-gray-500 whitespace-nowrap", children: new Date(n.createdAt).toLocaleString(dateLocale) }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-gray-700", children: (_ref = (_n_recipientName = n.recipientName) !== null && _n_recipientName !== void 0 ? _n_recipientName : n.recipientEmail) !== null && _ref !== void 0 ? _ref : n.recipientId }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3", children: /*#__PURE__*/ _jsx("span", { className: "px-2 py-0.5 rounded-full text-xs font-medium bg-green-50 text-green-700", children: n.type }) }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-gray-600 max-w-xs truncate", children: n.title }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-center", children: n.isRead ? /*#__PURE__*/ _jsx("span", { className: "text-green-600 flex justify-center", children: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("polyline", { points: "20 6 9 17 4 12" }) }) }) : /*#__PURE__*/ _jsx("span", { className: "text-gray-400 flex justify-center", children: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("circle", { cx: "12", cy: "12", r: "10" }) }) }) }) ] }, n.id); }) }) ] }) }), /*#__PURE__*/ _jsx(Pagination, { page: notifLogsPage, total: notifLogsTotal, limit: 50, onChange: setNotifLogsPage, totalLabel: t('admin.pagination.total') }) ] }) ] }), tab === 'plans' && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between mb-4", children: [ /*#__PURE__*/ _jsxs("h2", { className: "text-lg font-semibold text-gray-800 flex items-center gap-2", children: [ /*#__PURE__*/ _jsxs("svg", { className: "w-5 h-5 text-green-600", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: [ /*#__PURE__*/ _jsx("rect", { x: "1", y: "4", width: "22", height: "16", rx: "2", ry: "2" }), /*#__PURE__*/ _jsx("line", { x1: "1", y1: "10", x2: "23", y2: "10" }) ] }), t('admin.plans.title') ] }), /*#__PURE__*/ _jsx("button", { onClick: openAddPlan, className: "bg-green-600 text-white text-sm px-4 py-2 rounded-lg hover:bg-green-700 font-medium", children: t('admin.plans.add') }) ] }), planForm && /*#__PURE__*/ _jsxs("div", { className: "bg-white border border-gray-200 rounded-xl p-5 mb-4 space-y-3", children: [ /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-gray-800", children: planForm.id ? t('admin.plans.form.edit') : t('admin.plans.form.new') }), /*#__PURE__*/ _jsxs("div", { className: "grid grid-cols-2 gap-3", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.name') }), /*#__PURE__*/ _jsx("input", { value: planForm.name, onChange: (e)=>setPlanForm({ ...planForm, name: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.price') }), /*#__PURE__*/ _jsx("input", { type: "number", min: "0", step: "0.01", value: planForm.price, onChange: (e)=>setPlanForm({ ...planForm, price: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.old_price') }), /*#__PURE__*/ _jsx("input", { type: "number", min: "0", step: "0.01", value: (_planForm_oldPrice = planForm.oldPrice) !== null && _planForm_oldPrice !== void 0 ? _planForm_oldPrice : '', onChange: (e)=>setPlanForm({ ...planForm, oldPrice: e.target.value }), placeholder: "—", className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.tier') }), /*#__PURE__*/ _jsxs("select", { value: planForm.tier, onChange: (e)=>setPlanForm({ ...planForm, tier: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400", children: [ /*#__PURE__*/ _jsx("option", { value: "free", children: t('admin.plans.form.tier.free') }), /*#__PURE__*/ _jsx("option", { value: "pro", children: t('admin.plans.form.tier.pro') }), /*#__PURE__*/ _jsx("option", { value: "ultimate", children: t('admin.plans.form.tier.ultimate') }) ] }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.description') }), /*#__PURE__*/ _jsx("input", { value: planForm.description, onChange: (e)=>setPlanForm({ ...planForm, description: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ _jsx("p", { className: "text-xs font-semibold text-gray-500 uppercase tracking-wide pt-1", children: t('admin.plans.form.section.limits') }), /*#__PURE__*/ _jsxs("div", { className: "grid grid-cols-3 gap-3", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.max_tasks') }), /*#__PURE__*/ _jsx("input", { type: "number", min: "0", placeholder: "∞", value: planForm.maxTasks, onChange: (e)=>setPlanForm({ ...planForm, maxTasks: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.max_offers') }), /*#__PURE__*/ _jsx("input", { type: "number", min: "0", placeholder: "∞", value: planForm.maxOffers, onChange: (e)=>setPlanForm({ ...planForm, maxOffers: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.max_cards') }), /*#__PURE__*/ _jsx("input", { type: "number", min: "0", placeholder: "∞", value: planForm.maxCards, onChange: (e)=>setPlanForm({ ...planForm, maxCards: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.max_messages_day') }), /*#__PURE__*/ _jsx("input", { type: "number", min: "0", placeholder: "∞", value: planForm.maxMessagesPerDay, onChange: (e)=>setPlanForm({ ...planForm, maxMessagesPerDay: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.max_orders_day') }), /*#__PURE__*/ _jsx("input", { type: "number", min: "0", placeholder: "∞", value: planForm.maxOrdersPerDay, onChange: (e)=>setPlanForm({ ...planForm, maxOrdersPerDay: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.max_skills') }), /*#__PURE__*/ _jsx("input", { type: "number", min: "0", placeholder: "∞", value: planForm.maxSkills, onChange: (e)=>setPlanForm({ ...planForm, maxSkills: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.duration_days') }), /*#__PURE__*/ _jsx("input", { type: "number", min: "0", placeholder: "∞", value: planForm.durationDays, onChange: (e)=>setPlanForm({ ...planForm, durationDays: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }) ] }), /*#__PURE__*/ _jsx("p", { className: "text-xs font-semibold text-gray-500 uppercase tracking-wide pt-1", children: t('admin.plans.form.section.boost') }), /*#__PURE__*/ _jsxs("div", { className: "grid grid-cols-2 gap-3", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.search_boost') }), /*#__PURE__*/ _jsx("input", { type: "number", min: "0", value: planForm.searchBoost, onChange: (e)=>setPlanForm({ ...planForm, searchBoost: Number(e.target.value) }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.offers_multiplier') }), /*#__PURE__*/ _jsx("input", { type: "number", min: "0", step: "0.01", value: planForm.offersMultiplier, onChange: (e)=>setPlanForm({ ...planForm, offersMultiplier: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.features') }), /*#__PURE__*/ _jsx("textarea", { rows: 3, value: planForm.features, onChange: (e)=>setPlanForm({ ...planForm, features: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 resize-none" }) ] }), /*#__PURE__*/ _jsx("p", { className: "text-xs font-semibold text-gray-500 uppercase tracking-wide pt-1", children: t('admin.plans.form.section.contact') }), /*#__PURE__*/ _jsx("div", { className: "grid grid-cols-2 gap-2", children: [ [ 'canContactFreePlan', t('admin.plans.form.can_contact_free') ], [ 'canContactProPlan', t('admin.plans.form.can_contact_pro') ], [ 'canContactAll', t('admin.plans.form.can_contact_all') ], [ 'canShowContactInfo', t('admin.plans.form.can_show_contact') ], [ 'canViewPhone', t('admin.plans.form.can_view_phone') ] ].map((param)=>{ let [key, label] = param; return /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-2 cursor-pointer text-sm text-gray-700", children: [ /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: planForm[key], onChange: (e)=>setPlanForm({ ...planForm, [key]: e.target.checked }), className: "w-4 h-4 rounded text-green-600" }), label ] }, key); }) }), /*#__PURE__*/ _jsx("p", { className: "text-xs font-semibold text-gray-500 uppercase tracking-wide pt-1", children: t('admin.plans.form.section.features') }), /*#__PURE__*/ _jsx("div", { className: "grid grid-cols-2 gap-2", children: [ [ 'notifyNewTasks', t('admin.plans.form.notify') ], [ 'canUploadVideo', t('admin.plans.form.upload_video') ], [ 'hasFavorites', t('admin.plans.form.favorites') ], [ 'hasGoogleCalendar', t('admin.plans.form.google_calendar') ], [ 'hasVerifiedBadge', t('admin.plans.form.verified_badge') ], [ 'highlightedReviews', t('admin.plans.form.highlighted_reviews') ], [ 'hasPersonalSite', t('admin.plans.form.personal_site') ], [ 'hasCanHelpNowStatus', t('admin.plans.form.can_help_now') ], [ 'hasNeedHelpStatus', t('admin.plans.form.need_help') ], [ 'hasAutoResponse', t('admin.plans.form.auto_response') ], [ 'hasAutoMatch', t('admin.plans.form.auto_match') ], [ 'hasPriceList', t('admin.plans.form.price_list') ], [ 'receiveInstantDispatchFree', t('admin.plans.form.instant_dispatch_free') ], [ 'receiveInstantDispatchPro', t('admin.plans.form.instant_dispatch_pro') ] ].map((param)=>{ let [key, label] = param; return /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-2 cursor-pointer text-sm text-gray-700", children: [ /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: planForm[key], onChange: (e)=>setPlanForm({ ...planForm, [key]: e.target.checked }), className: "w-4 h-4 rounded text-green-600" }), label ] }, key); }) }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-6 pt-1", children: [ /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-2 cursor-pointer text-sm text-gray-700", children: [ /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: planForm.isDefault, onChange: (e)=>setPlanForm({ ...planForm, isDefault: e.target.checked }), className: "w-4 h-4 rounded text-green-600" }), t('admin.plans.form.default') ] }), /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-2 cursor-pointer text-sm text-gray-700", children: [ /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: planForm.isActive, onChange: (e)=>setPlanForm({ ...planForm, isActive: e.target.checked }), className: "w-4 h-4 rounded text-green-600" }), t('admin.plans.form.active') ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2", children: [ /*#__PURE__*/ _jsx("label", { className: "text-xs text-gray-600", children: t('admin.plans.form.order') }), /*#__PURE__*/ _jsx("input", { type: "number", value: planForm.order, onChange: (e)=>setPlanForm({ ...planForm, order: Number(e.target.value) }), className: "w-16 border border-gray-300 rounded-lg px-2 py-1 text-sm focus:outline-none" }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-2 pt-1", children: [ /*#__PURE__*/ _jsx("button", { onClick: savePlan, disabled: planSaving || !planForm.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: planSaving ? '...' : t('common.save') }), /*#__PURE__*/ _jsx("button", { onClick: ()=>setPlanForm(null), className: "px-4 py-2 rounded-lg text-sm font-medium text-gray-600 hover:bg-gray-100", children: t('common.cancel') }) ] }) ] }), /*#__PURE__*/ _jsx("div", { className: "bg-white rounded-xl border border-gray-200 overflow-hidden", children: planRows.length === 0 ? /*#__PURE__*/ _jsx("div", { className: "px-4 py-8 text-center text-gray-400 text-sm", children: t('admin.plans.empty') }) : /*#__PURE__*/ _jsx("div", { className: "divide-y divide-gray-100", children: planRows.sort((a, b)=>{ var _a_order, _b_order; return ((_a_order = a.order) !== null && _a_order !== void 0 ? _a_order : 0) - ((_b_order = b.order) !== null && _b_order !== void 0 ? _b_order : 0); }).map((plan)=>{ var _plan_features; return /*#__PURE__*/ _jsxs("div", { className: "flex items-start gap-4 px-4 py-4 ".concat(!plan.isActive ? 'opacity-50' : ''), children: [ /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 flex-wrap", children: [ /*#__PURE__*/ _jsx("span", { className: "font-semibold text-gray-900", children: plan.name }), plan.isDefault && /*#__PURE__*/ _jsx("span", { className: "bg-green-100 text-green-700 text-xs px-2 py-0.5 rounded-full font-medium", children: t('admin.plans.badge.default') }), !plan.isActive && /*#__PURE__*/ _jsx("span", { className: "bg-gray-100 text-gray-500 text-xs px-2 py-0.5 rounded-full", children: t('admin.plans.badge.inactive') }) ] }), plan.description && /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-500 mt-0.5", children: plan.description }), /*#__PURE__*/ _jsxs("div", { className: "flex flex-wrap gap-3 mt-1 text-xs text-gray-500", children: [ /*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-1.5 font-semibold text-gray-800", children: [ plan.oldPrice && /*#__PURE__*/ _jsxs("span", { className: "font-normal text-gray-400 line-through", children: [ plan.oldPrice, " ", plan.currency ] }), /*#__PURE__*/ _jsxs("span", { children: [ plan.price, " ", plan.currency ] }) ] }), plan.maxTasks != null && /*#__PURE__*/ _jsxs("span", { children: [ t('admin.plans.tasks'), ": ", plan.maxTasks ] }), plan.maxOffers != null && /*#__PURE__*/ _jsxs("span", { children: [ t('admin.plans.offers'), ": ", plan.maxOffers ] }), plan.maxCards != null && /*#__PURE__*/ _jsxs("span", { children: [ t('admin.plans.cards'), ": ", plan.maxCards ] }), plan.notifyNewTasks && /*#__PURE__*/ _jsxs("span", { className: "text-green-700 flex items-center gap-1", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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" }) }), t('admin.plans.notify_tasks') ] }) ] }), ((_plan_features = plan.features) !== null && _plan_features !== void 0 ? _plan_features : []).length > 0 && /*#__PURE__*/ _jsx("ul", { className: "mt-1.5 space-y-0.5", children: plan.features.map((f, i)=>/*#__PURE__*/ _jsxs("li", { className: "text-xs text-gray-600 flex items-center gap-1.5", children: [ /*#__PURE__*/ _jsx("span", { className: "text-green-500", children: /*#__PURE__*/ _jsx("svg", { className: "w-3 h-3", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("polyline", { points: "20 6 9 17 4 12" }) }) }), " ", f ] }, i)) }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-1 shrink-0", children: [ !plan.isDefault && /*#__PURE__*/ _jsx("button", { onClick: ()=>api.updatePlan(plan.id, { isDefault: true }).then(()=>api.getAdminPlans().then(setPlanRows)).catch(()=>{}), className: "text-xs px-2 py-1 rounded-lg bg-green-50 text-green-600 hover:bg-green-100 font-medium", title: t('admin.plans.make_default'), children: /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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" }) }) }), /*#__PURE__*/ _jsx("button", { onClick: ()=>openEditPlan(plan), className: "text-xs px-2 py-1 rounded-lg bg-gray-100 text-gray-600 hover:bg-gray-200 font-medium", children: t('common.edit') }), /*#__PURE__*/ _jsx("button", { onClick: ()=>deletePlan(plan.id, plan.name), className: "text-xs px-2 py-1 rounded-lg bg-red-50 text-red-600 hover:bg-red-100 font-medium", children: t('common.delete') }) ] }) ] }, plan.id); }) }) }) ] }), tab === 'settings' && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _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((st)=>{ const labels = { general: t('admin.settings.tab.general'), smtp: t('admin.settings.tab.smtp'), notifications: t('admin.settings.tab.notifications'), payment: t('admin.settings.tab.payment'), referral: t('admin.settings.tab.referral'), seo: t('admin.settings.tab.seo'), socials: t('admin.settings.tab.socials'), telegram: t('admin.settings.tab.telegram') }; return /*#__PURE__*/ _jsx("button", { onClick: ()=>setSettingsTab(st), className: "px-4 py-2 rounded-lg text-sm font-medium transition ".concat(settingsTab === st ? 'bg-green-600 text-white shadow-sm' : 'text-gray-600 hover:bg-gray-100'), children: labels[st] }, st); }) }), settingsTab === 'general' && /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6 max-w-lg", children: [ /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-gray-800 mb-5", children: t('admin.settings.general.title') }), /*#__PURE__*/ _jsxs("div", { className: "space-y-4", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.general.site_name') }), /*#__PURE__*/ _jsx("input", { value: generalForm.siteName, onChange: (e)=>setGeneralForm((f)=>({ ...f, siteName: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400", placeholder: "CanHelp" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.general.site_url') }), /*#__PURE__*/ _jsx("input", { value: generalForm.siteUrl, onChange: (e)=>setGeneralForm((f)=>({ ...f, siteUrl: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400", placeholder: "https://canhelp.com" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.general.contact_email') }), /*#__PURE__*/ _jsx("input", { type: "email", value: generalForm.contactEmail, onChange: (e)=>setGeneralForm((f)=>({ ...f, contactEmail: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400", placeholder: "contact@canhelp.com" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.general.support_phone') }), /*#__PURE__*/ _jsx("input", { value: generalForm.supportPhone, onChange: (e)=>setGeneralForm((f)=>({ ...f, supportPhone: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400", placeholder: "+30 21 000 0000" }) ] }), /*#__PURE__*/ _jsx("button", { onClick: saveGeneralSettings, disabled: generalSaving, 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: generalSaving ? t('admin.settings.saving') : generalSaved ? t('admin.settings.saved') : t('common.save') }) ] }) ] }), settingsTab === 'smtp' && /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6 max-w-lg", children: [ /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-gray-800 mb-1", children: t('admin.settings.smtp.title') }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-400 mb-5", children: t('admin.settings.smtp.hint') }), /*#__PURE__*/ _jsxs("div", { className: "space-y-4", children: [ /*#__PURE__*/ _jsxs("div", { className: "grid grid-cols-3 gap-3", children: [ /*#__PURE__*/ _jsxs("div", { className: "col-span-2", children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.smtp.host') }), /*#__PURE__*/ _jsx("input", { value: smtpForm.host, onChange: (e)=>setSmtpForm((f)=>({ ...f, host: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400", placeholder: "smtp.gmail.com" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.smtp.port') }), /*#__PURE__*/ _jsx("input", { value: smtpForm.port, onChange: (e)=>setSmtpForm((f)=>({ ...f, port: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400", placeholder: "587" }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.smtp.encryption') }), /*#__PURE__*/ _jsxs("select", { value: smtpForm.encryption, onChange: (e)=>setSmtpForm((f)=>({ ...f, encryption: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400", children: [ /*#__PURE__*/ _jsx("option", { value: "none", children: t('admin.settings.smtp.enc.none') }), /*#__PURE__*/ _jsx("option", { value: "tls", children: "STARTTLS (587)" }), /*#__PURE__*/ _jsx("option", { value: "ssl", children: "SSL/TLS (465)" }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.smtp.username') }), /*#__PURE__*/ _jsx("input", { value: smtpForm.username, onChange: (e)=>setSmtpForm((f)=>({ ...f, username: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400", placeholder: "user@gmail.com", autoComplete: "off" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.smtp.password') }), /*#__PURE__*/ _jsx("input", { type: "password", value: smtpForm.password, onChange: (e)=>setSmtpForm((f)=>({ ...f, password: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400", autoComplete: "new-password", placeholder: "••••••••••••" }) ] }), /*#__PURE__*/ _jsxs("div", { className: "grid grid-cols-2 gap-3", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.smtp.from_name') }), /*#__PURE__*/ _jsx("input", { value: smtpForm.fromName, onChange: (e)=>setSmtpForm((f)=>({ ...f, fromName: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400", placeholder: "CanHelp" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.smtp.from_email') }), /*#__PURE__*/ _jsx("input", { type: "email", value: smtpForm.fromEmail, onChange: (e)=>setSmtpForm((f)=>({ ...f, fromEmail: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400", placeholder: "noreply@canhelp.com" }) ] }) ] }), /*#__PURE__*/ _jsx("button", { onClick: saveSmtpSettings, disabled: smtpSaving, 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: smtpSaving ? t('admin.settings.saving') : smtpSaved ? t('admin.settings.saved') : t('common.save') }), /*#__PURE__*/ _jsx("button", { onClick: async ()=>{ setTestEmailSending(true); setTestEmailResult(null); try { const res = await api.sendTestEmail(); setTestEmailResult("✓ Sent to ".concat(res.to)); } catch (e) { setTestEmailResult("✗ Error: ".concat(e.message)); } finally{ setTestEmailSending(false); setTimeout(()=>setTestEmailResult(null), 5000); } }, disabled: testEmailSending, 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: testEmailSending ? t('admin.settings.smtp.sending') : /*#__PURE__*/ _jsxs("span", { className: "flex items-center justify-center gap-2", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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" }) }), t('admin.settings.smtp.test') ] }) }), testEmailResult && /*#__PURE__*/ _jsx("p", { className: "text-sm text-center font-medium ".concat(testEmailResult.startsWith('✓') ? 'text-green-600' : 'text-red-500'), children: testEmailResult }) ] }) ] }), settingsTab === 'payment' && /*#__PURE__*/ _jsxs("div", { className: "space-y-6 max-w-lg", children: [ /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between mb-5", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3", children: [ /*#__PURE__*/ _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" }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-gray-800", children: "ePay — Piraeus Bank" }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400", children: "ГреческОй платёжМый шлюз" }) ] }) ] }), /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-2 cursor-pointer", children: [ /*#__PURE__*/ _jsx("span", { className: "text-sm text-gray-500", children: t('admin.settings.active') }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setEPayForm((f)=>({ ...f, enabled: !f.enabled })), className: "relative w-10 h-6 rounded-full p-0 transition-colors cursor-pointer ".concat(ePayForm.enabled ? 'bg-green-600' : 'bg-gray-300'), children: /*#__PURE__*/ _jsx("span", { className: "absolute left-0 top-1 w-4 h-4 bg-white rounded-full shadow transition-transform ".concat(ePayForm.enabled ? 'translate-x-5' : 'translate-x-1') }) }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "space-y-4", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.env.label') }), /*#__PURE__*/ _jsxs("select", { value: ePayForm.environment, onChange: (e)=>setEPayForm((f)=>({ ...f, environment: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm", children: [ /*#__PURE__*/ _jsx("option", { value: "test", children: t('admin.settings.env.test') }), /*#__PURE__*/ _jsx("option", { value: "production", children: t('admin.settings.env.prod') }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.merchant_id') }), /*#__PURE__*/ _jsx("input", { value: ePayForm.merchantId, onChange: (e)=>setEPayForm((f)=>({ ...f, merchantId: e.target.value })), placeholder: t('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" }) ] }), /*#__PURE__*/ _jsxs("div", { className: "grid grid-cols-2 gap-3", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: "API User" }), /*#__PURE__*/ _jsx("input", { value: ePayForm.apiUser, onChange: (e)=>setEPayForm((f)=>({ ...f, apiUser: e.target.value })), autoComplete: "off", className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: "API Password" }), /*#__PURE__*/ _jsx("input", { type: "password", value: ePayForm.apiPassword, onChange: (e)=>setEPayForm((f)=>({ ...f, apiPassword: e.target.value })), autoComplete: "new-password", className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: "Confirmation URL (webhook)" }), /*#__PURE__*/ _jsx("input", { value: ePayForm.confirmationUrl, onChange: (e)=>setEPayForm((f)=>({ ...f, confirmationUrl: e.target.value })), placeholder: "https://yoursite.com/api/payments/epay/confirm", className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: "Cancel URL" }), /*#__PURE__*/ _jsx("input", { value: ePayForm.cancelUrl, onChange: (e)=>setEPayForm((f)=>({ ...f, cancelUrl: e.target.value })), placeholder: "https://yoursite.com/payment/cancelled", className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 mt-5", children: [ /*#__PURE__*/ _jsx("button", { onClick: saveEPaySettings, disabled: ePaySaving, className: "px-5 py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700 disabled:opacity-50", children: ePaySaving ? t('admin.settings.saving') : t('common.save') }), ePaySaved && /*#__PURE__*/ _jsx("span", { className: "text-sm text-green-600", children: t('admin.settings.saved') }) ] }) ] }), /*#__PURE__*/ _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: [ /*#__PURE__*/ _jsxs("svg", { className: "w-4 h-4 shrink-0 mt-0.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ _jsx("circle", { cx: "12", cy: "12", r: "10" }), /*#__PURE__*/ _jsx("line", { x1: "12", y1: "8", x2: "12", y2: "12" }), /*#__PURE__*/ _jsx("line", { x1: "12", y1: "16", x2: "12.01", y2: "16" }) ] }), /*#__PURE__*/ _jsx("span", { children: t('admin.settings.payment.hint') }) ] }) ] }), settingsTab === 'notifications' && /*#__PURE__*/ _jsxs("div", { className: "space-y-3 max-w-2xl", children: [ /*#__PURE__*/ _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: [ /*#__PURE__*/ _jsxs("svg", { className: "w-4 h-4 shrink-0 mt-0.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ _jsx("circle", { cx: "12", cy: "12", r: "10" }), /*#__PURE__*/ _jsx("line", { x1: "12", y1: "8", x2: "12", y2: "12" }), /*#__PURE__*/ _jsx("line", { x1: "12", y1: "16", x2: "12.01", y2: "16" }) ] }), /*#__PURE__*/ _jsxs("p", { children: [ t('admin.notif.vars_hint'), ' ', TEMPLATE_HINT_VARS.map((name)=>{ const v = "{{".concat(name, "}}"); return /*#__PURE__*/ _jsx("code", { className: "mx-0.5 bg-green-100 text-gray-800 px-1.5 py-0.5 rounded text-xs font-mono", children: v }, v); }) ] }) ] }), [ { key: 'email_verification', label: t('admin.notif.email_verification'), icon: /*#__PURE__*/ _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: /*#__PURE__*/ _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: t('admin.notif.registration_success'), icon: /*#__PURE__*/ _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: /*#__PURE__*/ _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: t('admin.notif.password_reset'), icon: /*#__PURE__*/ _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: /*#__PURE__*/ _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: t('admin.notif.new_offer'), icon: /*#__PURE__*/ _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: /*#__PURE__*/ _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: t('admin.notif.new_task'), icon: /*#__PURE__*/ _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: /*#__PURE__*/ _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: t('admin.notif.offer_accepted'), icon: /*#__PURE__*/ _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: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" }) }) }, { key: 'new_message', label: t('admin.notif.new_message'), icon: /*#__PURE__*/ _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: /*#__PURE__*/ _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: t('admin.notif.offer_declined'), icon: /*#__PURE__*/ _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: /*#__PURE__*/ _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: t('admin.notif.offer_other_accepted'), icon: /*#__PURE__*/ _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: /*#__PURE__*/ _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: t('admin.notif.task_updated'), icon: /*#__PURE__*/ _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: /*#__PURE__*/ _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: t('admin.notif.deadline_reminder'), icon: /*#__PURE__*/ _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: /*#__PURE__*/ _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: t('admin.notif.task_archived'), icon: /*#__PURE__*/ _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: /*#__PURE__*/ _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: t('admin.notif.referral_reward'), icon: /*#__PURE__*/ _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: /*#__PURE__*/ _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" }) }) }, // ── Plan / subscription emails ───────────────────────────── { key: 'plan_activated', label: t('admin.email_template.plan_activated'), icon: /*#__PURE__*/ _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: /*#__PURE__*/ _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: t('admin.email_template.plan_upgraded'), icon: /*#__PURE__*/ _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: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 10l7-7m0 0l7 7m-7-7v18" }) }) }, { key: 'plan_downgrade_scheduled', label: t('admin.email_template.plan_downgrade_scheduled'), icon: /*#__PURE__*/ _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: /*#__PURE__*/ _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: t('admin.email_template.plan_downgrade_applied'), icon: /*#__PURE__*/ _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: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19 14l-7 7m0 0l-7-7m7 7V3" }) }) }, { key: 'plan_renewal_reminder', label: t('admin.email_template.plan_renewal_reminder'), icon: /*#__PURE__*/ _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: /*#__PURE__*/ _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: t('admin.email_template.plan_insufficient_funds'), icon: /*#__PURE__*/ _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: /*#__PURE__*/ _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((param)=>{ let { key, label, icon } = param; const localeKey = "".concat(key, "_").concat(templateLocale); var _notifTemplates_localeKey, _ref; const tmpl = (_ref = (_notifTemplates_localeKey = notifTemplates[localeKey]) !== null && _notifTemplates_localeKey !== void 0 ? _notifTemplates_localeKey : notifTemplates[key]) !== null && _ref !== void 0 ? _ref : { subject: '', body: '' }; const isEditing = editingTemplate === key; var _TEMPLATE_VARS_key; const templateVars = (_TEMPLATE_VARS_key = TEMPLATE_VARS[key]) !== null && _TEMPLATE_VARS_key !== void 0 ? _TEMPLATE_VARS_key : []; return /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 overflow-hidden", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 px-5 py-4 cursor-pointer hover:bg-gray-50 select-none", onClick: ()=>setEditingTemplate(isEditing ? null : key), children: [ /*#__PURE__*/ _jsx("span", { className: "text-xl shrink-0", children: icon }), /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ _jsx("div", { className: "font-medium text-gray-800 text-sm", children: label }), tmpl.subject ? /*#__PURE__*/ _jsxs("div", { className: "text-xs text-gray-400 mt-0.5 truncate", children: [ t('admin.notif.tmpl.subject_label'), ": ", tmpl.subject ] }) : /*#__PURE__*/ _jsx("div", { className: "text-xs text-gray-300 mt-0.5 italic", children: t('admin.notif.tmpl.not_set') }) ] }), /*#__PURE__*/ _jsx("span", { className: "text-gray-400 transition-transform ".concat(isEditing ? 'rotate-90' : ''), children: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("polyline", { points: "9 18 15 12 9 6" }) }) }) ] }), isEditing && /*#__PURE__*/ _jsxs("div", { className: "px-5 pb-5 border-t border-gray-100 pt-4 space-y-3", children: [ /*#__PURE__*/ _jsx("div", { className: "flex gap-1 pb-2", children: [ 'el', 'en', 'uk', 'ru' ].map((loc)=>/*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setTemplateLocale(loc), className: "px-3 py-1 text-xs font-medium rounded-md transition-colors ".concat(templateLocale === loc ? 'bg-green-600 text-white' : 'bg-gray-100 text-gray-600 hover:bg-gray-200'), children: loc === 'el' ? 'ΕλληΜικά' : loc === 'en' ? 'English' : loc === 'uk' ? 'УкраїМська' : 'РусскОй' }, loc)) }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.notif.tmpl.subject_label') }), /*#__PURE__*/ _jsx("input", { value: tmpl.subject, onChange: (e)=>setNotifTemplates((prev)=>{ var _prev_localeKey; return { ...prev, [localeKey]: { ...(_prev_localeKey = prev[localeKey]) !== null && _prev_localeKey !== void 0 ? _prev_localeKey : { subject: '', body: '' }, subject: e.target.value } }; }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.notif.tmpl.body_label') }), /*#__PURE__*/ _jsx("textarea", { rows: 7, value: tmpl.body, onChange: (e)=>setNotifTemplates((prev)=>{ var _prev_localeKey; return { ...prev, [localeKey]: { ...(_prev_localeKey = prev[localeKey]) !== null && _prev_localeKey !== void 0 ? _prev_localeKey : { subject: '', body: '' }, body: e.target.value } }; }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 font-mono resize-y", placeholder: "

УважаеЌый {{userName}},

..." }) ] }), templateVars.length > 0 && /*#__PURE__*/ _jsxs("div", { className: "rounded-lg border border-amber-200 bg-amber-50 px-3 py-2", children: [ /*#__PURE__*/ _jsx("div", { className: "text-xs font-medium text-amber-800 mb-1", children: t('admin.notif.vars_hint') }), /*#__PURE__*/ _jsx("div", { className: "flex flex-wrap gap-1.5", children: templateVars.map((name)=>{ const variable = "{{".concat(name, "}}"); return /*#__PURE__*/ _jsx("code", { className: "bg-amber-100 text-amber-900 px-1.5 py-0.5 rounded text-xs font-mono", children: variable }, variable); }) }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-2 flex-wrap", children: [ /*#__PURE__*/ _jsx("button", { onClick: ()=>saveTemplate(key), disabled: templateSaving || templateTranslating, className: "px-4 py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700 disabled:opacity-50", children: templateSaving ? t('admin.notif.tmpl.saving') : t('admin.notif.tmpl.save') }), /*#__PURE__*/ _jsxs("button", { onClick: ()=>autoTranslateTemplate(key), disabled: templateSaving || templateTranslating, 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: [ /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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" }) }), templateTranslating ? t('admin.notif.tmpl.translating') : t('admin.notif.tmpl.translate') ] }), /*#__PURE__*/ _jsx("button", { onClick: ()=>setEditingTemplate(null), className: "px-4 py-2 bg-gray-100 text-gray-700 rounded-lg text-sm font-medium hover:bg-gray-200", children: t('admin.notif.tmpl.close') }) ] }) ] }) ] }, key); }) ] }), settingsTab === 'referral' && /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6 max-w-lg space-y-5", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-gray-800", children: t('admin.settings.referral.title') }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-400 mt-1", children: t('admin.settings.referral.hint') }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "text-sm font-medium text-gray-700", children: t('admin.settings.referral.enabled_label') }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400", children: t('admin.settings.referral.enabled_hint') }) ] }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setReferralForm((f)=>({ ...f, enabled: !f.enabled })), className: "relative w-10 h-6 rounded-full p-0 transition-colors cursor-pointer ".concat(referralForm.enabled ? 'bg-green-600' : 'bg-gray-300'), children: /*#__PURE__*/ _jsx("span", { className: "absolute left-0 top-1 w-4 h-4 bg-white rounded-full shadow transition-transform ".concat(referralForm.enabled ? 'translate-x-5' : 'translate-x-1') }) }) ] }), /*#__PURE__*/ _jsxs("div", { className: "border border-gray-100 rounded-lg p-4 space-y-4", children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs font-semibold text-gray-500 uppercase tracking-wide", children: t('admin.settings.referral.shared_section') }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.referral.plan_label') }), /*#__PURE__*/ _jsxs("select", { value: referralForm.planId, onChange: (e)=>setReferralForm((f)=>({ ...f, planId: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400", children: [ /*#__PURE__*/ _jsx("option", { value: "", children: t('admin.settings.referral.no_plan') }), planRows.map((p)=>/*#__PURE__*/ _jsx("option", { value: p.id, children: p.name }, p.id)) ] }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-1", children: t('admin.settings.referral.plan_hint') }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.referral.days_label') }), /*#__PURE__*/ _jsx("input", { type: "number", min: "1", max: "365", value: referralForm.days, onChange: (e)=>setReferralForm((f)=>({ ...f, days: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-1", children: t('admin.settings.referral.days_hint') }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3", children: [ /*#__PURE__*/ _jsx("button", { onClick: saveReferralSettings, disabled: referralSaving, className: "px-5 py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700 disabled:opacity-50", children: referralSaving ? t('admin.settings.saving') : t('common.save') }), referralSaved && /*#__PURE__*/ _jsx("span", { className: "text-sm text-green-600", children: t('admin.settings.saved') }) ] }) ] }), settingsTab === 'socials' && /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6 max-w-lg space-y-5", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-gray-800 mb-1", children: t('admin.settings.socials.title') }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400", children: t('admin.settings.socials.hint') }) ] }), [ { key: 'telegram', label: 'Telegram', placeholder: 'https://t.me/yourname', icon: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", viewBox: "0 0 24 24", fill: "currentColor", children: /*#__PURE__*/ _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: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", viewBox: "0 0 24 24", fill: "currentColor", children: /*#__PURE__*/ _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: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", viewBox: "0 0 24 24", fill: "currentColor", children: /*#__PURE__*/ _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: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", viewBox: "0 0 24 24", fill: "currentColor", children: /*#__PURE__*/ _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: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", viewBox: "0 0 24 24", fill: "currentColor", children: /*#__PURE__*/ _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: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", viewBox: "0 0 24 24", fill: "currentColor", children: /*#__PURE__*/ _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: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", viewBox: "0 0 24 24", fill: "currentColor", children: /*#__PURE__*/ _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: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", viewBox: "0 0 24 24", fill: "currentColor", children: /*#__PURE__*/ _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((param)=>{ let { key, label, placeholder, icon } = param; return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("label", { className: "block text-sm font-medium text-gray-700 mb-1 flex items-center gap-2", children: [ /*#__PURE__*/ _jsx("span", { className: "".concat(socialForm[key] ? 'text-green-600' : 'text-gray-300'), children: icon }), label, !socialForm[key] && /*#__PURE__*/ _jsx("span", { className: "text-xs font-normal text-gray-400 ml-auto", children: "Ме запПлМеМП" }) ] }), /*#__PURE__*/ _jsx("input", { type: "url", value: socialForm[key], onChange: (e)=>setSocialForm((f)=>({ ...f, [key]: e.target.value })), placeholder: placeholder, className: "w-full border rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 ".concat(socialForm[key] ? 'border-green-300 bg-green-50/30' : 'border-gray-300') }) ] }, key); }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 pt-2", children: [ /*#__PURE__*/ _jsx("button", { onClick: saveSocialSettings, disabled: socialSaving, className: "px-5 py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700 disabled:opacity-50", children: socialSaving ? t('admin.settings.saving') : t('common.save') }), socialSaved && /*#__PURE__*/ _jsx("span", { className: "text-sm text-green-600", children: t('admin.settings.saved') }) ] }) ] }), settingsTab === 'seo' && /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6 max-w-lg space-y-6", children: [ /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-gray-800", children: t('admin.settings.seo.title') }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "text-sm font-medium text-gray-700", children: t('admin.settings.seo.maintenance_label') }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-0.5", children: t('admin.settings.seo.maintenance_hint') }) ] }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setSeoForm((f)=>({ ...f, maintenanceMode: !f.maintenanceMode })), className: "relative w-10 h-6 rounded-full p-0 transition-colors cursor-pointer flex-shrink-0 ".concat(seoForm.maintenanceMode ? 'bg-red-500' : 'bg-gray-300'), children: /*#__PURE__*/ _jsx("span", { className: "absolute left-0 top-1 w-4 h-4 bg-white rounded-full shadow transition-transform ".concat(seoForm.maintenanceMode ? 'translate-x-5' : 'translate-x-1') }) }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "text-sm font-medium text-gray-700", children: t('admin.settings.seo.indexing_label') }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-0.5", children: t('admin.settings.seo.indexing_hint') }) ] }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setSeoForm((f)=>({ ...f, indexingEnabled: !f.indexingEnabled })), className: "relative w-10 h-6 rounded-full p-0 transition-colors cursor-pointer flex-shrink-0 ".concat(seoForm.indexingEnabled ? 'bg-green-600' : 'bg-gray-300'), children: /*#__PURE__*/ _jsx("span", { className: "absolute left-0 top-1 w-4 h-4 bg-white rounded-full shadow transition-transform ".concat(seoForm.indexingEnabled ? 'translate-x-5' : 'translate-x-1') }) }) ] }), /*#__PURE__*/ _jsx("div", { className: "space-y-4", children: /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("p", { className: "text-sm font-medium text-gray-700 mb-2", children: [ t('admin.settings.seo.site_title_label'), " / ", t('admin.settings.seo.site_description_label') ] }), /*#__PURE__*/ _jsx("div", { className: "flex gap-1 mb-3", children: [ { code: 'el', flag: '🇬🇷', label: 'EL' }, { code: 'en', flag: '🇬🇧', label: 'EN' }, { code: 'ru', flag: '🇷🇺', label: 'RU' }, { code: 'uk', flag: '🇺🇊', label: 'UK' } ].map((param)=>{ let { code, flag, label } = param; return /*#__PURE__*/ _jsxs("button", { type: "button", onClick: ()=>setSeoLangTab(code), className: "flex items-center gap-1 px-3 py-1.5 rounded-lg text-sm font-medium transition-colors ".concat(seoLangTab === code ? 'bg-green-600 text-white' : 'bg-gray-100 text-gray-600 hover:bg-gray-200'), children: [ flag, " ", label ] }, code); }) }), /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-500 mb-1", children: t('admin.settings.seo.site_title_label') }), /*#__PURE__*/ _jsx("input", { value: seoForm["siteTitle".concat(seoLangTab.charAt(0).toUpperCase() + seoLangTab.slice(1))], onChange: (e)=>setSeoForm((f)=>({ ...f, ["siteTitle".concat(seoLangTab.charAt(0).toUpperCase() + seoLangTab.slice(1))]: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 mb-3", placeholder: seoLangTab === 'el' ? 'CanHelp — ΚάΞε άΜΞρωπος έχει κάτι Μα προσφέρει' : seoLangTab === 'en' ? 'CanHelp — Everyone has something valuable to offer' : seoLangTab === 'ru' ? 'CanHelp — КажЎый челПвек ЌПжет чеЌ-тП пПЌПчь' : 'CanHelp — КПжеМ Ќає МавОчку, яка ЌПже ЎПпПЌПгтО іМшПЌу' }), /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-500 mb-1", children: t('admin.settings.seo.site_description_label') }), /*#__PURE__*/ _jsx("textarea", { rows: 3, value: seoForm["siteDescription".concat(seoLangTab.charAt(0).toUpperCase() + seoLangTab.slice(1))], onChange: (e)=>setSeoForm((f)=>({ ...f, ["siteDescription".concat(seoLangTab.charAt(0).toUpperCase() + seoLangTab.slice(1))]: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 resize-none", placeholder: seoLangTab === 'el' ? 'Η ελληΜική πλατφόρΌα για online αΜάΞεση εργασιώΜ...' : seoLangTab === 'en' ? 'The Greek platform for online task delegation...' : seoLangTab === 'ru' ? 'Греческая платфПрЌа Ўля ПМлайМ-пПОска спецОалОстПв...' : 'Грецька платфПрЌа Ўля пПшуку фахівців ПМлайМ...' }) ] }) }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.seo.head_scripts_label') }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mb-2", children: t('admin.settings.seo.head_scripts_hint') }), /*#__PURE__*/ _jsx("textarea", { rows: 6, value: seoForm.headScripts, onChange: (e)=>setSeoForm((f)=>({ ...f, headScripts: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm font-mono focus:outline-none focus:ring-2 focus:ring-blue-400 resize-y", placeholder: '\n', spellCheck: false }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3", children: [ /*#__PURE__*/ _jsx("button", { onClick: saveSeoSettings, disabled: seoSaving, className: "px-5 py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700 disabled:opacity-50", children: seoSaving ? t('admin.settings.saving') : t('common.save') }), seoSaved && /*#__PURE__*/ _jsx("span", { className: "text-sm text-green-600", children: t('admin.settings.saved') }) ] }) ] }), settingsTab === 'telegram' && /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6 max-w-lg space-y-6", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-gray-800 mb-1", children: t('admin.settings.telegram.title') }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400", children: t('admin.settings.telegram.help') }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.telegram.bot_token') }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-2", children: [ /*#__PURE__*/ _jsx("input", { type: "text", value: telegramForm.botToken, onChange: (e)=>{ setTelegramForm((f)=>({ ...f, botToken: e.target.value })); setVerifyResultTelegramToken(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" }), /*#__PURE__*/ _jsx("button", { onClick: verifyTelegramToken, disabled: verifyingTelegramToken || !telegramForm.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: verifyingTelegramToken ? '...' : t('admin.settings.telegram.verify') }) ] }), verifyResultTelegramToken && /*#__PURE__*/ _jsx("p", { className: "text-xs mt-1 font-medium ".concat(verifyResultTelegramToken.ok ? 'text-green-600' : 'text-red-500'), children: verifyResultTelegramToken.ok ? "✓ ".concat(verifyResultTelegramToken.msg) : "✗ ".concat(verifyResultTelegramToken.msg) }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.telegram.admin_chat_id') }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-2", children: [ /*#__PURE__*/ _jsx("input", { type: "text", value: telegramForm.adminChatId, onChange: (e)=>setTelegramForm((f)=>({ ...f, adminChatId: e.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" }), /*#__PURE__*/ _jsx("button", { onClick: ()=>testTelegram('admin'), disabled: testingTelegramAdmin || !telegramForm.botToken || !telegramForm.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: testingTelegramAdmin ? '...' : t('admin.settings.telegram.test') }) ] }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-1", children: t('admin.settings.telegram.admin_chat_hint') }), testResultTelegramAdmin && /*#__PURE__*/ _jsx("p", { className: "text-xs mt-1 font-medium ".concat(testResultTelegramAdmin.ok ? 'text-green-600' : 'text-red-500'), children: testResultTelegramAdmin.ok ? "✓ ".concat(testResultTelegramAdmin.msg) : "✗ ".concat(testResultTelegramAdmin.msg) }) ] }), /*#__PURE__*/ _jsxs("div", { className: "space-y-3", children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700", children: t('admin.settings.telegram.channels_title') }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 -mt-2", children: t('admin.settings.telegram.channel_hint') }), [ { locale: 'el', flag: '🇬🇷', label: 'ΕλληΜικά', field: 'channelIdEl' }, { locale: 'en', flag: '🇬🇧', label: 'English', field: 'channelIdEn' }, { locale: 'ru', flag: '🇷🇺', label: 'РусскОй', field: 'channelIdRu' }, { locale: 'uk', flag: '🇺🇊', label: 'УкраїМська', field: 'channelIdUk' } ].map((param)=>{ let { locale: loc, flag, label, field } = param; return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-1.5 mb-1", children: [ /*#__PURE__*/ _jsx("span", { className: "text-base leading-none", children: flag }), /*#__PURE__*/ _jsx("span", { className: "text-xs font-medium text-gray-600", children: label }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-2", children: [ /*#__PURE__*/ _jsx("input", { type: "text", value: telegramForm[field], onChange: (e)=>setTelegramForm((f)=>({ ...f, [field]: e.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" }), /*#__PURE__*/ _jsx("button", { onClick: ()=>testTelegram(loc), disabled: testingLocale === loc || !telegramForm.botToken || !telegramForm[field], className: "px-3 py-2 border border-gray-300 rounded-lg text-sm hover:bg-gray-50 disabled:opacity-40 flex-shrink-0", children: testingLocale === loc ? '...' : t('admin.settings.telegram.test') }) ] }), testResultChannels[loc] && /*#__PURE__*/ _jsx("p", { className: "text-xs mt-1 font-medium ".concat(testResultChannels[loc].ok ? 'text-green-600' : 'text-red-500'), children: testResultChannels[loc].ok ? "✓ ".concat(testResultChannels[loc].msg) : "✗ ".concat(testResultChannels[loc].msg) }) ] }, loc); }) ] }), /*#__PURE__*/ _jsxs("div", { className: "space-y-4", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "text-sm font-medium text-gray-700", children: t('admin.settings.telegram.notify_registrations') }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-0.5", children: t('admin.settings.telegram.notify_registrations_hint') }) ] }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setTelegramForm((f)=>({ ...f, notifyRegistrations: !f.notifyRegistrations })), className: "relative w-10 h-6 rounded-full transition-colors cursor-pointer flex-shrink-0 p-0 border-0 outline-none ".concat(telegramForm.notifyRegistrations ? 'bg-green-600' : 'bg-gray-300'), children: /*#__PURE__*/ _jsx("span", { className: "absolute top-1 left-0 w-4 h-4 bg-white rounded-full shadow transition-transform ".concat(telegramForm.notifyRegistrations ? 'translate-x-5' : 'translate-x-1') }) }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "text-sm font-medium text-gray-700", children: t('admin.settings.telegram.post_new_tasks') }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-0.5", children: t('admin.settings.telegram.post_new_tasks_hint') }) ] }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setTelegramForm((f)=>({ ...f, postNewTasks: !f.postNewTasks })), className: "relative w-10 h-6 rounded-full transition-colors cursor-pointer flex-shrink-0 p-0 border-0 outline-none ".concat(telegramForm.postNewTasks ? 'bg-green-600' : 'bg-gray-300'), children: /*#__PURE__*/ _jsx("span", { className: "absolute top-1 left-0 w-4 h-4 bg-white rounded-full shadow transition-transform ".concat(telegramForm.postNewTasks ? 'translate-x-5' : 'translate-x-1') }) }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 pt-2", children: [ /*#__PURE__*/ _jsx("button", { onClick: saveTelegramSettings, disabled: telegramSaving, className: "px-5 py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700 disabled:opacity-50", children: telegramSaving ? t('admin.settings.saving') : t('common.save') }), telegramSaved && /*#__PURE__*/ _jsx("span", { className: "text-sm text-green-600", children: t('admin.settings.saved') }) ] }) ] }) ] }), tab === 'support' && /*#__PURE__*/ _jsxs("div", { className: "space-y-4", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex flex-wrap gap-3 mb-2", children: [ /*#__PURE__*/ _jsxs("form", { className: "flex gap-2", onSubmit: (e)=>{ e.preventDefault(); setSupportQ(supportQInput); setSupportPage(1); }, children: [ /*#__PURE__*/ _jsx("input", { value: supportQInput, onChange: (e)=>setSupportQInput(e.target.value), placeholder: t('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" }), /*#__PURE__*/ _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: t('admin.search', 'Search') }), supportQ && /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>{ setSupportQInput(''); setSupportQ(''); setSupportPage(1); }, className: "text-sm text-gray-500 hover:text-gray-700 px-2", children: "✕" }) ] }), /*#__PURE__*/ _jsxs("select", { value: supportStatus, onChange: (e)=>{ setSupportStatus(e.target.value); setSupportPage(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: [ /*#__PURE__*/ _jsx("option", { value: "", children: t('admin.support.all_statuses', 'All statuses') }), /*#__PURE__*/ _jsx("option", { value: "open", children: t('admin.support.status.open', 'Open') }), /*#__PURE__*/ _jsx("option", { value: "in_progress", children: t('admin.support.status.in_progress', 'In progress') }), /*#__PURE__*/ _jsx("option", { value: "resolved", children: t('admin.support.status.resolved', 'Resolved') }), /*#__PURE__*/ _jsx("option", { value: "closed", children: t('admin.support.status.closed', 'Closed') }) ] }), /*#__PURE__*/ _jsxs("select", { value: supportType, onChange: (e)=>{ setSupportType(e.target.value); setSupportPage(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: [ /*#__PURE__*/ _jsx("option", { value: "", children: t('admin.support.all_types', 'All types') }), /*#__PURE__*/ _jsxs("option", { value: "bug", children: [ "\uD83D\uDC1B ", t('support.type.bug', 'Bug') ] }), /*#__PURE__*/ _jsxs("option", { value: "suggestion", children: [ "\uD83D\uDCA1 ", t('support.type.suggestion', 'Suggestion') ] }), /*#__PURE__*/ _jsxs("option", { value: "other", children: [ "\uD83D\uDCAC ", t('support.type.other', 'Other') ] }) ] }), /*#__PURE__*/ _jsxs("span", { className: "ml-auto text-sm text-gray-400 self-center", children: [ supportTotal, " ", t('admin.pagination.total', 'total') ] }) ] }), loading ? /*#__PURE__*/ _jsx("div", { className: "text-center py-10 text-gray-400", children: t('common.loading') }) : supportTickets.length === 0 ? /*#__PURE__*/ _jsx("div", { className: "text-center py-10 text-gray-400", children: t('admin.support.none', 'No tickets') }) : supportTickets.map((ticket)=>{ const typeColors = { bug: 'bg-red-100 text-red-700', suggestion: 'bg-green-100 text-green-700', other: 'bg-gray-100 text-gray-600' }; const statusColors2 = { 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' }; const typeIcons = { bug: '🐛', suggestion: '💡', other: '💬' }; const isReplying = supportReplyId === ticket.id; var _typeColors_ticket_type, _statusColors2_ticket_status; return /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-5", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-start justify-between gap-4 mb-3", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 flex-wrap mb-1", children: [ /*#__PURE__*/ _jsxs("span", { className: "px-2 py-0.5 rounded-full text-xs font-medium ".concat((_typeColors_ticket_type = typeColors[ticket.type]) !== null && _typeColors_ticket_type !== void 0 ? _typeColors_ticket_type : 'bg-gray-100 text-gray-600'), children: [ typeIcons[ticket.type], " ", ticket.type ] }), /*#__PURE__*/ _jsx("span", { className: "px-2 py-0.5 rounded-full text-xs font-medium ".concat((_statusColors2_ticket_status = statusColors2[ticket.status]) !== null && _statusColors2_ticket_status !== void 0 ? _statusColors2_ticket_status : 'bg-gray-100 text-gray-500'), children: ticket.status }), /*#__PURE__*/ _jsxs("span", { className: "text-xs text-gray-400", children: [ "#", ticket.id.slice(0, 8) ] }) ] }), /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-gray-900 text-sm", children: ticket.subject }), ticket.userName && /*#__PURE__*/ _jsxs("p", { className: "text-xs text-gray-400 mt-0.5", children: [ ticket.userName, " \xb7 ", ticket.userEmail ] }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-0.5", children: new Date(ticket.createdAt).toLocaleString(dateLocale) }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-2 flex-shrink-0", children: [ ticket.status !== 'closed' && /*#__PURE__*/ _jsx("button", { onClick: ()=>{ setSupportReplyId(isReplying ? null : ticket.id); setSupportReplyText(ticket.adminReply || ''); }, className: "text-xs px-3 py-1.5 rounded-lg font-medium bg-green-50 text-green-700 hover:bg-green-100", children: isReplying ? t('admin.support.cancel', 'Cancel') : t('admin.support.reply', 'Reply') }), ticket.status === 'open' && /*#__PURE__*/ _jsx("button", { onClick: ()=>api.setSupportTicketStatus(ticket.id, 'closed').then(()=>setSupportTickets((prev)=>prev.map((t)=>t.id === ticket.id ? { ...t, status: 'closed' } : t))), className: "text-xs px-3 py-1.5 rounded-lg font-medium bg-gray-100 text-gray-600 hover:bg-gray-200", children: t('admin.support.close', 'Close') }) ] }) ] }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-700 whitespace-pre-wrap bg-gray-50 rounded-lg p-3 mb-3", children: ticket.body }), ticket.adminReply && !isReplying && /*#__PURE__*/ _jsxs("div", { className: "bg-green-50 border border-green-100 rounded-lg p-3 mb-2", children: [ /*#__PURE__*/ _jsxs("p", { className: "text-xs font-medium text-green-600 mb-1", children: [ t('admin.support.your_reply', 'Your reply'), ":" ] }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-800 whitespace-pre-wrap", children: ticket.adminReply }) ] }), isReplying && /*#__PURE__*/ _jsxs("div", { className: "space-y-2 mt-2", children: [ /*#__PURE__*/ _jsx("textarea", { rows: 3, value: supportReplyText, onChange: (e)=>setSupportReplyText(e.target.value), placeholder: t('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" }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-2 items-center", children: [ /*#__PURE__*/ _jsxs("select", { id: "status-".concat(ticket.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: [ /*#__PURE__*/ _jsx("option", { value: "open", children: t('admin.support.status.open', 'Open') }), /*#__PURE__*/ _jsx("option", { value: "in_progress", children: t('admin.support.status.in_progress', 'In progress') }), /*#__PURE__*/ _jsx("option", { value: "resolved", children: t('admin.support.status.resolved', 'Resolved') }), /*#__PURE__*/ _jsx("option", { value: "closed", children: t('admin.support.status.closed', 'Closed') }) ] }), /*#__PURE__*/ _jsx("button", { disabled: supportReplySaving || !supportReplyText.trim(), onClick: async ()=>{ const statusEl = document.getElementById("status-".concat(ticket.id)); setSupportReplySaving(true); try { const updated = await api.replyToSupportTicket(ticket.id, { adminReply: supportReplyText, status: statusEl === null || statusEl === void 0 ? void 0 : statusEl.value }); setSupportTickets((prev)=>prev.map((t)=>t.id === ticket.id ? { ...t, ...updated } : t)); setSupportReplyId(null); } catch (e) {} finally{ setSupportReplySaving(false); } }, 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: supportReplySaving ? '...' : t('admin.support.send_reply', 'Send') }) ] }) ] }) ] }, ticket.id); }), /*#__PURE__*/ _jsx(Pagination, { page: supportPage, total: supportTotal, limit: 30, onChange: setSupportPage, totalLabel: t('admin.pagination.total') }) ] }), tab === 'push' && /*#__PURE__*/ _jsxs("div", { className: "space-y-4", children: [ /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-5 space-y-4", children: [ /*#__PURE__*/ _jsx("h2", { className: "text-lg font-semibold text-gray-800", children: "Push-рассылка" }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-2", children: [ /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setPushMode('broadcast'), className: "px-3 py-1.5 text-sm rounded-lg border ".concat(pushMode === 'broadcast' ? 'bg-green-600 text-white border-green-600' : 'bg-white text-gray-700 border-gray-300'), children: "ВсеЌ пПльзПвателяЌ" }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setPushMode('user'), className: "px-3 py-1.5 text-sm rounded-lg border ".concat(pushMode === 'user' ? 'bg-green-600 text-white border-green-600' : 'bg-white text-gray-700 border-gray-300'), children: "КПМкретМПЌу пПльзПвателю" }) ] }), pushMode === 'user' && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "text-sm text-gray-600 block mb-1", children: "User ID" }), /*#__PURE__*/ _jsx("input", { value: pushTargetUserId, onChange: (e)=>setPushTargetUserId(e.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" }) ] }), pushMode === 'broadcast' && /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-2 text-sm text-gray-700", children: [ /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: pushOnlyActive, onChange: (e)=>setPushOnlyActive(e.target.checked) }), "ТПлькП актОвМыЌ пПльзПвателяЌ" ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "text-sm text-gray-600 block mb-1", children: "ЗагПлПвПк" }), /*#__PURE__*/ _jsx("input", { value: pushTitle, onChange: (e)=>setPushTitle(e.target.value), placeholder: "НапрОЌер: НПвые заЎачО ряЎПЌ с ваЌО", className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "text-sm text-gray-600 block mb-1", children: "Текст" }), /*#__PURE__*/ _jsx("textarea", { rows: 3, value: pushBody, onChange: (e)=>setPushBody(e.target.value), placeholder: "КПрПткОй текст увеЎПЌлеМОя", className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 resize-none" }) ] }), /*#__PURE__*/ _jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-3", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "text-sm text-gray-600 block mb-1", children: "ТОп" }), /*#__PURE__*/ _jsx("input", { value: pushType, onChange: (e)=>setPushType(e.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" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "text-sm text-gray-600 block mb-1", children: "Reference ID (ПпцОПМальМП)" }), /*#__PURE__*/ _jsx("input", { value: pushReferenceId, onChange: (e)=>setPushReferenceId(e.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" }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3", children: [ /*#__PURE__*/ _jsx("button", { type: "button", onClick: sendAdminPush, disabled: pushSending || !pushTitle.trim() || pushMode === 'user' && !pushTargetUserId.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: pushSending ? 'Отправка...' : 'ОтправОть Push' }), pushError && /*#__PURE__*/ _jsx("span", { className: "text-sm text-red-600", children: pushError }) ] }) ] }), pushResult && /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-5", children: [ /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-gray-800 mb-3", children: "Результат" }), 'usersTotal' in pushResult ? /*#__PURE__*/ _jsxs("div", { className: "grid grid-cols-2 md:grid-cols-5 gap-3 text-sm", children: [ /*#__PURE__*/ _jsxs("div", { className: "rounded-lg bg-gray-50 border border-gray-200 px-3 py-2", children: [ /*#__PURE__*/ _jsx("div", { className: "text-gray-500", children: "ППльзПвателей" }), /*#__PURE__*/ _jsx("div", { className: "text-gray-900 font-semibold", children: pushResult.usersTotal }) ] }), /*#__PURE__*/ _jsxs("div", { className: "rounded-lg bg-gray-50 border border-gray-200 px-3 py-2", children: [ /*#__PURE__*/ _jsx("div", { className: "text-gray-500", children: "ППлучОлО" }), /*#__PURE__*/ _jsx("div", { className: "text-gray-900 font-semibold", children: pushResult.usersWithSent }) ] }), /*#__PURE__*/ _jsxs("div", { className: "rounded-lg bg-gray-50 border border-gray-200 px-3 py-2", children: [ /*#__PURE__*/ _jsx("div", { className: "text-gray-500", children: "ОтправлеМП push" }), /*#__PURE__*/ _jsx("div", { className: "text-gray-900 font-semibold", children: pushResult.pushesSent }) ] }), /*#__PURE__*/ _jsxs("div", { className: "rounded-lg bg-gray-50 border border-gray-200 px-3 py-2", children: [ /*#__PURE__*/ _jsx("div", { className: "text-gray-500", children: "НевалОЎМые тПкеМы" }), /*#__PURE__*/ _jsx("div", { className: "text-gray-900 font-semibold", children: pushResult.invalidTokens }) ] }), /*#__PURE__*/ _jsxs("div", { className: "rounded-lg bg-gray-50 border border-gray-200 px-3 py-2", children: [ /*#__PURE__*/ _jsx("div", { className: "text-gray-500", children: "ОшОбкО пП userId" }), /*#__PURE__*/ _jsx("div", { className: "text-gray-900 font-semibold", children: pushResult.failedUsers.length }) ] }) ] }) : /*#__PURE__*/ _jsxs("div", { className: "grid grid-cols-2 md:grid-cols-4 gap-3 text-sm", children: [ /*#__PURE__*/ _jsxs("div", { className: "rounded-lg bg-gray-50 border border-gray-200 px-3 py-2", children: [ /*#__PURE__*/ _jsx("div", { className: "text-gray-500", children: "User ID" }), /*#__PURE__*/ _jsx("div", { className: "text-gray-900 font-mono text-xs break-all", children: pushResult.targetUserId }) ] }), /*#__PURE__*/ _jsxs("div", { className: "rounded-lg bg-gray-50 border border-gray-200 px-3 py-2", children: [ /*#__PURE__*/ _jsx("div", { className: "text-gray-500", children: "ТПкеМПв МайЎеМП" }), /*#__PURE__*/ _jsx("div", { className: "text-gray-900 font-semibold", children: (_pushResult_tokensFound = pushResult.tokensFound) !== null && _pushResult_tokensFound !== void 0 ? _pushResult_tokensFound : 0 }) ] }), /*#__PURE__*/ _jsxs("div", { className: "rounded-lg bg-gray-50 border border-gray-200 px-3 py-2", children: [ /*#__PURE__*/ _jsx("div", { className: "text-gray-500", children: "ОтправлеМП push" }), /*#__PURE__*/ _jsx("div", { className: "text-gray-900 font-semibold", children: pushResult.sent }) ] }), /*#__PURE__*/ _jsxs("div", { className: "rounded-lg bg-gray-50 border border-gray-200 px-3 py-2", children: [ /*#__PURE__*/ _jsx("div", { className: "text-gray-500", children: "НевалОЎМые тПкеМы" }), /*#__PURE__*/ _jsx("div", { className: "text-gray-900 font-semibold", children: pushResult.invalidTokens }) ] }) ] }), 'usersTotal' in pushResult ? /*#__PURE__*/ _jsx(_Fragment, { children: ((_pushResult_usersWithoutTokens = pushResult.usersWithoutTokens) !== null && _pushResult_usersWithoutTokens !== void 0 ? _pushResult_usersWithoutTokens : 0) > 0 || ((_pushResult_usersConfigBlocked = pushResult.usersConfigBlocked) !== null && _pushResult_usersConfigBlocked !== void 0 ? _pushResult_usersConfigBlocked : 0) > 0 || ((_pushResult_usersAuthFailed = pushResult.usersAuthFailed) !== null && _pushResult_usersAuthFailed !== void 0 ? _pushResult_usersAuthFailed : 0) > 0 || ((_pushResult_usersAllFailed = pushResult.usersAllFailed) !== null && _pushResult_usersAllFailed !== void 0 ? _pushResult_usersAllFailed : 0) > 0 ? /*#__PURE__*/ _jsxs("div", { className: "mt-3 rounded-lg border border-amber-200 bg-amber-50 px-3 py-2 text-xs text-amber-900", children: [ /*#__PURE__*/ _jsxs("div", { children: [ "ДОагМПстОка: без тПкеМПв — ", (_pushResult_usersWithoutTokens1 = pushResult.usersWithoutTokens) !== null && _pushResult_usersWithoutTokens1 !== void 0 ? _pushResult_usersWithoutTokens1 : 0, ", FCM Ме МастрПеМ — ", (_pushResult_usersConfigBlocked1 = pushResult.usersConfigBlocked) !== null && _pushResult_usersConfigBlocked1 !== void 0 ? _pushResult_usersConfigBlocked1 : 0, ", ПшОбка auth FCM — ", (_pushResult_usersAuthFailed1 = pushResult.usersAuthFailed) !== null && _pushResult_usersAuthFailed1 !== void 0 ? _pushResult_usersAuthFailed1 : 0, ", FCM send failed — ", (_pushResult_usersAllFailed1 = pushResult.usersAllFailed) !== null && _pushResult_usersAllFailed1 !== void 0 ? _pushResult_usersAllFailed1 : 0 ] }), pushResult.failedReasonStats && Object.keys(pushResult.failedReasonStats).length > 0 ? /*#__PURE__*/ _jsxs("div", { className: "mt-1", children: [ "КПЎы ПшОбПк FCM: ", Object.entries(pushResult.failedReasonStats).map((param)=>{ let [key, count] = param; return "".concat(key, ": ").concat(count); }).join(', ') ] }) : null, pushResult.failedReasonSample ? /*#__PURE__*/ _jsxs("div", { className: "mt-1", children: [ "ПрОЌер ПшОбкО: ", describeFcmFailure(pushResult.failedReasonStats ? Object.keys(pushResult.failedReasonStats)[0] : null, pushResult.failedReasonSample) ] }) : null ] }) : null }) : /*#__PURE__*/ _jsx(_Fragment, { children: pushResult.reason ? /*#__PURE__*/ _jsxs("div", { className: "mt-3 rounded-lg border border-amber-200 bg-amber-50 px-3 py-2 text-xs text-amber-900", children: [ /*#__PURE__*/ _jsxs("div", { children: [ "ДОагМПстОка: ", pushResult.reason === 'no_tokens' ? 'у пПльзПвателя Мет push-тПкеМПв' : pushResult.reason === 'fcm_not_configured' ? 'FCM Ме МастрПеМ Ма API (переЌеММые FCM_*)' : pushResult.reason === 'fcm_auth_failed' ? 'ПшОбка автПрОзацОО FCM (service account)' : describeFcmFailure(pushResult.failureKey, pushResult.failureMessage) ] }), pushResult.failureKey ? /*#__PURE__*/ _jsxs("div", { className: "mt-1", children: [ "КПЎ FCM: ", pushResult.failureKey ] }) : null, pushResult.failureMessage ? /*#__PURE__*/ _jsxs("div", { className: "mt-1", children: [ "СППбщеМОе FCM: ", pushResult.failureMessage ] }) : null ] }) : null }) ] }) ] }), tab === 'backup' && /*#__PURE__*/ _jsxs("div", { className: "space-y-6", children: [ /*#__PURE__*/ _jsxs("h2", { className: "text-lg font-semibold text-gray-800 flex items-center gap-2", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5 text-green-600", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ _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" }) }), t('admin.backup.title', 'Backup') ] }), backupMsg && /*#__PURE__*/ _jsxs("div", { className: "".concat(backupMsgError ? '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: [ /*#__PURE__*/ _jsx("span", { children: backupMsg }), /*#__PURE__*/ _jsx("button", { onClick: ()=>setBackupMsg(null), className: "".concat(backupMsgError ? 'text-red-500 hover:text-red-700' : 'text-green-500 hover:text-green-700', " ml-4"), children: "\xd7" }) ] }), /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-5 flex items-center justify-between", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "font-medium text-gray-800 text-sm", children: t('admin.backup.autoBackup', 'Auto Backup') }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-500 mt-0.5", children: t('admin.backup.autoBackupDesc', 'Create a backup every day automatically') }) ] }), /*#__PURE__*/ _jsx("button", { disabled: backupAutoSaving, onClick: async ()=>{ setBackupAutoSaving(true); try { await request('/admin/backup/settings', { method: 'PUT', body: JSON.stringify({ autoEnabled: !backupAutoEnabled }) }); setBackupAutoEnabled((v)=>!v); } catch (e) {} setBackupAutoSaving(false); }, className: "relative w-11 h-6 rounded-full transition-colors ".concat(backupAutoEnabled ? 'bg-green-600' : 'bg-gray-300', " ").concat(backupAutoSaving ? 'opacity-50' : ''), children: /*#__PURE__*/ _jsx("span", { className: "absolute top-0.5 left-0.5 w-5 h-5 rounded-full bg-white shadow transition-transform ".concat(backupAutoEnabled ? 'translate-x-5' : 'translate-x-0') }) }) ] }), /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-5", children: [ /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-gray-800 text-sm mb-4", children: t('admin.backup.title', 'Database Backup') }), /*#__PURE__*/ _jsxs("div", { className: "flex flex-wrap gap-3", children: [ /*#__PURE__*/ _jsxs("button", { disabled: backupExporting, onClick: async ()=>{ setBackupExporting(true); try { const BASE = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; const res = await fetch("".concat(BASE, "/api/admin/backup/export"), { credentials: 'include' }); if (!res.ok) throw new Error('Export failed'); const blob = await res.blob(); const url = URL.createObjectURL(blob); const a = document.createElement('a'); a.href = url; a.download = "backup_".concat(new Date().toISOString().slice(0, 10), ".sql.gz"); a.click(); URL.revokeObjectURL(url); setBackupSuccess(t('admin.backup.exportSuccess', 'Export successful')); } catch (e) { setBackupError(e.message || 'Error'); } setBackupExporting(false); }, 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: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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" }) }), backupExporting ? t('admin.backup.exporting', 'Exporting...') : t('admin.backup.exportAll', 'Export Full DB') ] }), /*#__PURE__*/ _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 ".concat(backupImporting === 'full' ? 'opacity-50 pointer-events-none' : ''), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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" }) }), backupImporting === 'full' ? t('admin.backup.importing', 'Importing...') : t('admin.backup.importAll', 'Import Full DB'), /*#__PURE__*/ _jsx("input", { type: "file", accept: ".sql.gz,.gz", className: "hidden", onChange: async (e)=>{ var _e_target_files; const file = (_e_target_files = e.target.files) === null || _e_target_files === void 0 ? void 0 : _e_target_files[0]; if (!file) return; if (!window.confirm(t('admin.backup.restoreConfirm', 'Restore from this backup?'))) return; setBackupImporting('full'); try { const fd = new FormData(); fd.append('file', file); const BASE = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; const res = await fetch("".concat(BASE, "/api/admin/backup/import"), { method: 'POST', credentials: 'include', body: fd }); if (!res.ok) throw new Error('Import failed'); setBackupSuccess(t('admin.backup.importSuccess', 'Import successful')); } catch (err) { setBackupError(err.message || 'Error'); } setBackupImporting(null); e.target.value = ''; } }) ] }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-5", children: [ /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-gray-800 text-sm mb-4", children: t('admin.backup.storedBackups', 'Stored Backups') }), backupStoredFiles.length === 0 ? /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-400", children: t('admin.backup.noStoredBackups', 'No stored backups') }) : /*#__PURE__*/ _jsx("div", { className: "space-y-2", children: backupStoredFiles.map((f)=>/*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between py-2 px-3 bg-gray-50 rounded-lg border border-gray-100", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "text-sm font-medium text-gray-800", children: f.name === 'backup_today' ? t('admin.backup.today', 'Today') : t('admin.backup.yesterday', 'Yesterday') }), /*#__PURE__*/ _jsxs("p", { className: "text-xs text-gray-400", children: [ t('admin.backup.size', 'Size'), ": ", (f.size / 1024).toFixed(1), " KB \xb7 ", t('admin.backup.date', 'Date'), ": ", new Date(f.date).toLocaleString() ] }) ] }), /*#__PURE__*/ _jsx("button", { disabled: backupRestoring === f.name, onClick: async ()=>{ if (!window.confirm(t('admin.backup.restoreConfirm', 'Restore from this backup?'))) return; setBackupRestoring(f.name); try { await request('/admin/backup/restore', { method: 'POST', body: JSON.stringify({ name: f.name }) }); setBackupSuccess(t('admin.backup.restoreSuccess', 'Restore successful')); } catch (err) { setBackupError(err.message || 'Error'); } setBackupRestoring(null); }, className: "text-sm text-green-600 hover:text-gray-800 font-medium disabled:opacity-50", children: backupRestoring === f.name ? t('admin.backup.restoring', 'Restoring...') : t('admin.backup.restore', 'Restore') }) ] }, f.name)) }) ] }), /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-5", children: [ /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-gray-800 text-sm mb-4", children: t('admin.backup.tables', 'Tables') }), backupTablesLoading ? /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 text-sm text-gray-400", children: [ /*#__PURE__*/ _jsxs("svg", { className: "w-4 h-4 animate-spin", fill: "none", viewBox: "0 0 24 24", children: [ /*#__PURE__*/ _jsx("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }), /*#__PURE__*/ _jsx("path", { className: "opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8v8z" }) ] }), t('common.loading', 'Loading...') ] }) : backupTables.length === 0 ? /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-400", children: t('admin.noData', 'No data') }) : /*#__PURE__*/ _jsx("div", { className: "overflow-x-auto", children: /*#__PURE__*/ _jsx("table", { className: "w-full text-sm", children: /*#__PURE__*/ _jsx("tbody", { className: "divide-y divide-gray-100", children: backupTables.map((tbl)=>/*#__PURE__*/ _jsxs("tr", { className: "hover:bg-gray-50", children: [ /*#__PURE__*/ _jsx("td", { className: "py-2 pr-4 font-mono text-gray-700", children: tbl }), /*#__PURE__*/ _jsx("td", { className: "py-2 text-right", children: /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-end gap-2", children: [ /*#__PURE__*/ _jsx("button", { onClick: async ()=>{ try { const BASE = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; const res = await fetch("".concat(BASE, "/api/admin/backup/export/").concat(tbl), { credentials: 'include' }); if (!res.ok) throw new Error('Export failed'); const blob = await res.blob(); const url = URL.createObjectURL(blob); const a = document.createElement('a'); a.href = url; a.download = "".concat(tbl, "_").concat(new Date().toISOString().slice(0, 10), ".sql.gz"); a.click(); URL.revokeObjectURL(url); } catch (err) { setBackupError(err.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: t('admin.backup.exportTable', 'Export') }), /*#__PURE__*/ _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: [ backupImporting === tbl ? t('admin.backup.importing', 'Importing...') : t('admin.backup.importTable', 'Import'), /*#__PURE__*/ _jsx("input", { type: "file", accept: ".sql.gz,.gz", className: "hidden", onChange: async (e)=>{ var _e_target_files; const file = (_e_target_files = e.target.files) === null || _e_target_files === void 0 ? void 0 : _e_target_files[0]; if (!file) return; if (!window.confirm(t('admin.backup.restoreConfirm', 'Restore from this backup?'))) return; setBackupImporting(tbl); try { const fd = new FormData(); fd.append('file', file); const BASE = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; const res = await fetch("".concat(BASE, "/api/admin/backup/import/").concat(tbl), { method: 'POST', credentials: 'include', body: fd }); if (!res.ok) { const errData = await res.json().catch(()=>({ error: 'Import failed' })); throw new Error(errData.error || 'Import failed'); } setBackupSuccess(t('admin.backup.importSuccess', 'Import successful')); } catch (err) { setBackupError(err.message || 'Error'); } setBackupImporting(null); e.target.value = ''; } }) ] }) ] }) }) ] }, tbl)) }) }) }) ] }) ] }), tab === 'translations' && /*#__PURE__*/ _jsxs("div", { className: "space-y-6", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("h2", { className: "text-base font-semibold text-gray-900", children: "ПеревПЎы" }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-500 mt-0.5", children: "АвтПЌатОческОй перевПЎ прПпущеММых зМачеМОй пП таблОцаЌ" }) ] }), /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-4 flex flex-wrap gap-4 items-end", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: "ИстПчМОк" }), /*#__PURE__*/ _jsxs("select", { value: transFromLang, onChange: (e)=>setTransFromLang(e.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: [ /*#__PURE__*/ _jsx("option", { value: "el", children: "\uD83C\uDDEC\uD83C\uDDF7 Greek" }), /*#__PURE__*/ _jsx("option", { value: "en", children: "\uD83C\uDDEC\uD83C\uDDE7 English" }), /*#__PURE__*/ _jsx("option", { value: "ru", children: "\uD83C\uDDF7\uD83C\uDDFA Russian" }), /*#__PURE__*/ _jsx("option", { value: "uk", children: "\uD83C\uDDFA\uD83C\uDDE6 Ukrainian" }) ] }) ] }), /*#__PURE__*/ _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: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M13 7l5 5-5 5M6 12h12" }) }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: "ПеревестО Ма" }), /*#__PURE__*/ _jsxs("select", { value: transLang, onChange: (e)=>setTransLang(e.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: [ /*#__PURE__*/ _jsx("option", { value: "el", children: "\uD83C\uDDEC\uD83C\uDDF7 Greek" }), /*#__PURE__*/ _jsx("option", { value: "en", children: "\uD83C\uDDEC\uD83C\uDDE7 English" }), /*#__PURE__*/ _jsx("option", { value: "ru", children: "\uD83C\uDDF7\uD83C\uDDFA Russian" }), /*#__PURE__*/ _jsx("option", { value: "uk", children: "\uD83C\uDDFA\uD83C\uDDE6 Ukrainian" }) ] }) ] }), /*#__PURE__*/ _jsx("div", { className: "ml-auto self-end", children: /*#__PURE__*/ _jsxs("span", { className: "text-sm font-semibold text-gray-700 flex items-center gap-2", children: [ { el: '🇬🇷', en: '🇬🇧', ru: '🇷🇺', uk: '🇺🇊' }[transFromLang], " ", transFromLang.toUpperCase(), /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-gray-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M13 7l5 5-5 5M6 12h12" }) }), { el: '🇬🇷', en: '🇬🇧', ru: '🇷🇺', uk: '🇺🇊' }[transLang], " ", transLang.toUpperCase() ] }) }) ] }), transMsg && /*#__PURE__*/ _jsx("div", { className: "text-sm px-4 py-2 rounded-lg ".concat(transMsg.error ? 'bg-red-50 text-red-700' : 'bg-green-50 text-green-700'), children: transMsg.text }), transStatsLoading ? /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 text-sm text-gray-400 py-6", children: [ /*#__PURE__*/ _jsxs("svg", { className: "w-4 h-4 animate-spin", fill: "none", viewBox: "0 0 24 24", children: [ /*#__PURE__*/ _jsx("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }), /*#__PURE__*/ _jsx("path", { className: "opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8v8z" }) ] }), "Загрузка " ] }) : /*#__PURE__*/ _jsx("div", { className: "grid gap-4 sm:grid-cols-2 lg:grid-cols-3", children: (transStats !== null && transStats !== void 0 ? transStats : []).map((tbl)=>{ const isTasks = tbl.name === 'tasks'; // For tasks: total missing across all langs (tasks may miss multiple langs each) const totalMissingAllLangs = Object.values(tbl.missing).reduce((a, b)=>a + b, 0); var _tbl_missing_transLang; const missingCount = isTasks ? totalMissingAllLangs : (_tbl_missing_transLang = tbl.missing[transLang]) !== null && _tbl_missing_transLang !== void 0 ? _tbl_missing_transLang : 0; const isTranslating = !!transTableTranslating[tbl.name]; const anyTranslating = Object.values(transTableTranslating).some(Boolean); return /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-5 flex flex-col", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-start justify-between", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "font-semibold text-gray-900 text-sm", children: tbl.label }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-0.5", children: tbl.name }) ] }), /*#__PURE__*/ _jsx("span", { className: "text-xs font-semibold px-2 py-0.5 rounded-full ".concat(missingCount > 0 ? 'bg-red-100 text-red-700' : 'bg-green-100 text-green-700'), children: missingCount > 0 ? "".concat(missingCount, " missing") : 'Complete' }) ] }), /*#__PURE__*/ _jsxs("p", { className: "text-xs text-gray-500 mt-3", children: [ "ВсегП: ", tbl.total, isTasks && ' · с языка ПрОгОМала Ма все ПстальМые' ] }), /*#__PURE__*/ _jsx("div", { className: "mt-2 flex flex-wrap gap-1", children: [ 'el', 'en', 'ru', 'uk' ].map((lang)=>{ var _tbl_missing_lang; const cnt = (_tbl_missing_lang = tbl.missing[lang]) !== null && _tbl_missing_lang !== void 0 ? _tbl_missing_lang : 0; const isClickable = isTasks && cnt > 0; return /*#__PURE__*/ _jsxs("button", { type: "button", disabled: !isClickable, onClick: isClickable ? async ()=>{ setTransPreview({ lang, loading: true, rows: [] }); try { const d = await api.getTasksTranslationPreview(lang, 50); setTransPreview({ lang, loading: false, rows: d.rows }); } catch (e) { setTransPreview({ lang, loading: false, rows: [] }); } } : undefined, className: "text-xs px-2 py-0.5 rounded-full border transition ".concat(cnt > 0 ? 'border-red-200 bg-red-50 text-red-600' + (isClickable ? ' cursor-pointer hover:bg-red-100' : '') : 'border-green-200 bg-green-50 text-green-600 cursor-default'), children: [ lang, ": ", cnt > 0 ? "-".concat(cnt) : '✓' ] }, lang); }) }), /*#__PURE__*/ _jsx("div", { className: "mt-4 mt-auto pt-4", children: missingCount === 0 ? /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-1.5 text-xs text-emerald-600", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" }) }), "Все перевПЎы запПлМеМы" ] }) : /*#__PURE__*/ _jsx("button", { disabled: anyTranslating, onClick: async ()=>{ if (!isTasks && transFromLang === transLang) { setTransMsg({ text: 'ИсхПЎМый О целевПй язык сПвпаЎают', error: true }); return; } setTransTableTranslating((prev)=>({ ...prev, [tbl.name]: true })); setTransMsg(null); try { const res = isTasks ? await api.autoTranslateTasks(500) : tbl.name === 'email_templates' ? await api.autoTranslateEmailTemplates(transLang, transFromLang) : await api.autoTranslate(tbl.name, transLang, transFromLang, 500); setTransMsg({ text: "".concat(tbl.label, ": translated ").concat(res.translated, " of ").concat(res.total) + (res.failed > 0 ? " \xb7 errors: ".concat(res.failed) : ''), error: res.failed > 0 && res.translated === 0 }); api.getTranslationsStats().then((d)=>setTransStats(d.tables)).catch(()=>{}); } catch (err) { const msg = (err === null || err === void 0 ? void 0 : err.response) ? await err.response.text().catch(()=>err.message) : err.message || 'Error'; setTransMsg({ text: "Error: ".concat(msg), error: true }); } finally{ setTransTableTranslating((prev)=>{ const n = { ...prev }; delete n[tbl.name]; return n; }); } }, 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: isTranslating ? /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs("svg", { className: "w-3.5 h-3.5 animate-spin flex-shrink-0", fill: "none", viewBox: "0 0 24 24", children: [ /*#__PURE__*/ _jsx("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }), /*#__PURE__*/ _jsx("path", { className: "opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8v8z" }) ] }), "Translating..." ] }) : isTasks ? /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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 ", missingCount ] }) : /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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 ", missingCount, " \xb7 ", { el: '🇬🇷', en: '🇬🇧', ru: '🇷🇺', uk: '🇺🇊' }[transFromLang], " ", transFromLang.toUpperCase(), /*#__PURE__*/ _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: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M13 7l5 5-5 5M6 12h12" }) }), { el: '🇬🇷', en: '🇬🇧', ru: '🇷🇺', uk: '🇺🇊' }[transLang], " ", transLang.toUpperCase() ] }) }) }) ] }, tbl.name); }) }) ] }), tab === 'dbcheck' && /*#__PURE__*/ _jsx(DbCheckTab, {}), tab === 'referrals' && /*#__PURE__*/ _jsxs("div", { className: "space-y-6", children: [ /*#__PURE__*/ _jsx("div", { className: "grid grid-cols-3 gap-4", children: [ { label: 'РеферерПв', value: (_referralsData_totalReferrers = referralsData === null || referralsData === void 0 ? void 0 : referralsData.totalReferrers) !== null && _referralsData_totalReferrers !== void 0 ? _referralsData_totalReferrers : '—', color: 'text-green-600' }, { label: 'ПрОглашеМОй', value: (_referralsData_totalReferrals = referralsData === null || referralsData === void 0 ? void 0 : referralsData.totalReferrals) !== null && _referralsData_totalReferrals !== void 0 ? _referralsData_totalReferrals : '—', color: 'text-purple-600' }, { label: 'АктОвМых МаграЎ', value: (_referralsData_activeRewards = referralsData === null || referralsData === void 0 ? void 0 : referralsData.activeRewards) !== null && _referralsData_activeRewards !== void 0 ? _referralsData_activeRewards : '—', color: 'text-green-600' } ].map((param)=>{ let { label, value, color } = param; return /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-2xl border border-gray-200 p-5 text-center", children: [ /*#__PURE__*/ _jsx("div", { className: "text-3xl font-bold ".concat(color), children: value }), /*#__PURE__*/ _jsx("div", { className: "text-xs text-gray-500 mt-1", children: label }) ] }, label); }) }), /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-2xl border border-gray-200 overflow-hidden", children: [ /*#__PURE__*/ _jsxs("div", { className: "px-5 py-4 border-b border-gray-100 flex items-center justify-between", children: [ /*#__PURE__*/ _jsx("h2", { className: "font-semibold text-gray-800", children: "ДеревП рефералПв" }), /*#__PURE__*/ _jsxs("button", { onClick: ()=>{ setReferralsLoading(true); api.getAdminReferrals().then(setReferralsData).catch(()=>{}).finally(()=>setReferralsLoading(false)); }, className: "text-xs text-green-600 hover:underline flex items-center gap-1", children: [ referralsLoading && /*#__PURE__*/ _jsxs("svg", { className: "w-3 h-3 animate-spin", fill: "none", viewBox: "0 0 24 24", children: [ /*#__PURE__*/ _jsx("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }), /*#__PURE__*/ _jsx("path", { className: "opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8v8z" }) ] }), "ОбМПвОть" ] }) ] }), referralsLoading && !referralsData ? /*#__PURE__*/ _jsx("div", { className: "flex justify-center py-16", children: /*#__PURE__*/ _jsxs("svg", { className: "w-6 h-6 animate-spin text-purple-600", fill: "none", viewBox: "0 0 24 24", children: [ /*#__PURE__*/ _jsx("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }), /*#__PURE__*/ _jsx("path", { className: "opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8v8z" }) ] }) }) : !referralsData || referralsData.tree.length === 0 ? /*#__PURE__*/ _jsx("div", { className: "py-16 text-center text-sm text-gray-400", children: "Нет ЎаММых П рефералах" }) : /*#__PURE__*/ _jsx("div", { className: "divide-y divide-gray-100", children: referralsData.tree.map((node)=>{ var _node_referrer, _node_referrer1; var _node_referrer_id; const rid = (_node_referrer_id = (_node_referrer = node.referrer) === null || _node_referrer === void 0 ? void 0 : _node_referrer.id) !== null && _node_referrer_id !== void 0 ? _node_referrer_id : 'unknown'; const isExpanded = referralsExpanded.has(rid); var _node_referrer_firstName, _node_referrer_lastName; const referrerName = node.referrer ? "".concat((_node_referrer_firstName = node.referrer.firstName) !== null && _node_referrer_firstName !== void 0 ? _node_referrer_firstName : '', " ").concat((_node_referrer_lastName = node.referrer.lastName) !== null && _node_referrer_lastName !== void 0 ? _node_referrer_lastName : '').trim() || node.referrer.email : '(уЎалёМ)'; return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("button", { className: "w-full flex items-center gap-3 px-5 py-3.5 hover:bg-gray-50 text-left transition-colors", onClick: ()=>setReferralsExpanded((prev)=>{ const next = new Set(prev); next.has(rid) ? next.delete(rid) : next.add(rid); return next; }), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-gray-400 flex-shrink-0 transition-transform ".concat(isExpanded ? 'rotate-90' : ''), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 5l7 7-7 7" }) }), /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ _jsx("span", { className: "font-medium text-sm text-gray-900", children: referrerName }), node.referrer && /*#__PURE__*/ _jsx("span", { className: "ml-2 text-xs text-gray-400", children: node.referrer.email }) ] }), ((_node_referrer1 = node.referrer) === null || _node_referrer1 === void 0 ? void 0 : _node_referrer1.referralCode) && /*#__PURE__*/ _jsx("code", { className: "text-xs bg-gray-100 text-gray-600 px-2 py-0.5 rounded font-mono", children: node.referrer.referralCode }), /*#__PURE__*/ _jsxs("span", { className: "ml-3 text-xs font-semibold text-purple-700 bg-purple-50 px-2 py-0.5 rounded-full", children: [ node.referees.length, " реф." ] }) ] }), isExpanded && /*#__PURE__*/ _jsx("div", { className: "bg-gray-50 border-t border-gray-100", children: /*#__PURE__*/ _jsxs("table", { className: "w-full text-xs", children: [ /*#__PURE__*/ _jsx("thead", { children: /*#__PURE__*/ _jsxs("tr", { className: "border-b border-gray-200", children: [ /*#__PURE__*/ _jsx("th", { className: "text-left px-10 py-2 font-semibold text-gray-500", children: "ПрОглашёММый" }), /*#__PURE__*/ _jsx("th", { className: "text-left px-3 py-2 font-semibold text-gray-500", children: "Email" }), /*#__PURE__*/ _jsx("th", { className: "text-center px-3 py-2 font-semibold text-gray-500", children: "+ЎМей" }), /*#__PURE__*/ _jsx("th", { className: "text-center px-3 py-2 font-semibold text-gray-500", children: "Истекает" }), /*#__PURE__*/ _jsx("th", { className: "text-center px-3 py-2 font-semibold text-gray-500", children: "Дата" }) ] }) }), /*#__PURE__*/ _jsx("tbody", { children: node.referees.map((referee)=>{ var _referee_firstName, _referee_lastName; const refName = "".concat((_referee_firstName = referee.firstName) !== null && _referee_firstName !== void 0 ? _referee_firstName : '', " ").concat((_referee_lastName = referee.lastName) !== null && _referee_lastName !== void 0 ? _referee_lastName : '').trim() || referee.email; const expiresAt = new Date(referee.expiresAt); const createdAt = new Date(referee.createdAt); const isActive = expiresAt > new Date(); return /*#__PURE__*/ _jsxs("tr", { className: "border-b border-gray-100 last:border-0 hover:bg-white transition-colors", children: [ /*#__PURE__*/ _jsx("td", { className: "px-10 py-2.5 font-medium text-gray-800", children: refName }), /*#__PURE__*/ _jsx("td", { className: "px-3 py-2.5 text-gray-500", children: referee.email }), /*#__PURE__*/ _jsx("td", { className: "px-3 py-2.5 text-center", children: /*#__PURE__*/ _jsxs("span", { className: "font-semibold text-green-700", children: [ "+", referee.daysAdded ] }) }), /*#__PURE__*/ _jsx("td", { className: "px-3 py-2.5 text-center", children: /*#__PURE__*/ _jsx("span", { className: "px-1.5 py-0.5 rounded text-xs font-medium ".concat(isActive ? 'bg-green-100 text-green-700' : 'bg-gray-100 text-gray-500'), children: expiresAt.toLocaleDateString('ru-RU', { day: '2-digit', month: '2-digit', year: '2-digit' }) }) }), /*#__PURE__*/ _jsx("td", { className: "px-3 py-2.5 text-center text-gray-400", children: createdAt.toLocaleDateString('ru-RU', { day: '2-digit', month: '2-digit', year: '2-digit' }) }) ] }, referee.id); }) }) ] }) }) ] }, rid); }) }) ] }) ] }), transPreview && /*#__PURE__*/ _jsx("div", { className: "fixed inset-0 z-50 flex items-center justify-center bg-black/50 px-4", onClick: ()=>setTransPreview(null), children: /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-2xl shadow-xl w-full max-w-3xl max-h-[80vh] flex flex-col", onClick: (e)=>e.stopPropagation(), children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between px-6 py-4 border-b border-gray-100 flex-shrink-0", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("h3", { className: "font-semibold text-gray-900", children: [ "ЗаЎачО без перевПЎа: ", /*#__PURE__*/ _jsx("span", { className: "uppercase font-bold text-red-600", children: transPreview.lang }) ] }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-0.5", children: "ППказаМы первые 50 запОсей" }) ] }), /*#__PURE__*/ _jsx("button", { onClick: ()=>setTransPreview(null), className: "text-gray-400 hover:text-gray-600 p-1", children: /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" }) }) }) ] }), /*#__PURE__*/ _jsx("div", { className: "overflow-y-auto flex-1 px-6 py-4", children: transPreview.loading ? /*#__PURE__*/ _jsx("div", { className: "flex justify-center py-12", children: /*#__PURE__*/ _jsxs("svg", { className: "w-6 h-6 animate-spin text-purple-600", fill: "none", viewBox: "0 0 24 24", children: [ /*#__PURE__*/ _jsx("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }), /*#__PURE__*/ _jsx("path", { className: "opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8v8z" }) ] }) }) : transPreview.rows.length === 0 ? /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-500 text-center py-12", children: "Нет заЎач без перевПЎа" }) : /*#__PURE__*/ _jsxs("table", { className: "w-full text-xs border-collapse", children: [ /*#__PURE__*/ _jsx("thead", { children: /*#__PURE__*/ _jsxs("tr", { className: "border-b border-gray-200", children: [ /*#__PURE__*/ _jsx("th", { className: "text-left py-2 pr-3 font-semibold text-gray-600 w-[35%]", children: "ОрОгОМал (title)" }), /*#__PURE__*/ _jsx("th", { className: "text-center py-2 px-2 font-semibold text-gray-600", children: "orig" }), [ 'el', 'en', 'ru', 'uk' ].map((l)=>/*#__PURE__*/ _jsx("th", { className: "text-center py-2 px-2 font-semibold text-gray-600 w-[14%]", children: l }, l)) ] }) }), /*#__PURE__*/ _jsx("tbody", { children: transPreview.rows.map((row)=>/*#__PURE__*/ _jsxs("tr", { className: "border-b border-gray-100 hover:bg-gray-50", children: [ /*#__PURE__*/ _jsx("td", { className: "py-2 pr-3 text-gray-800 truncate max-w-[200px]", title: row.title, children: row.title }), /*#__PURE__*/ _jsx("td", { className: "py-2 px-2 text-center", children: /*#__PURE__*/ _jsx("span", { className: "uppercase font-semibold text-purple-700 bg-purple-50 px-1.5 py-0.5 rounded", children: row.originalLocale }) }), [ [ 'el', row.titleEl ], [ 'en', row.titleEn ], [ 'ru', row.titleRu ], [ 'uk', row.titleUk ] ].map((param)=>{ let [l, val] = param; return /*#__PURE__*/ _jsx("td", { className: "py-2 px-2 text-center", title: val !== null && val !== void 0 ? val : '', children: val ? /*#__PURE__*/ _jsx("span", { className: "text-emerald-600 font-semibold", children: "✓" }) : /*#__PURE__*/ _jsx("span", { className: "text-red-500 font-semibold", children: "✗" }) }, l); }) ] }, row.id)) }) ] }) }) ] }) }), editUser && /*#__PURE__*/ _jsx("div", { className: "fixed inset-0 z-50 flex items-center justify-center bg-black/50 px-4", children: /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-2xl shadow-xl w-full max-w-4xl max-h-[90vh] flex flex-col", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between px-6 py-4 border-b border-gray-100 flex-shrink-0", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("h2", { className: "text-base font-semibold text-gray-900", children: t('admin.user_edit.title') }), /*#__PURE__*/ _jsxs("p", { className: "text-xs text-gray-400 mt-0.5", children: [ editUser.email, " \xb7 ID: ", editUser.id ] }) ] }), /*#__PURE__*/ _jsx("button", { onClick: ()=>setEditUser(null), className: "text-gray-400 hover:text-gray-600 text-2xl leading-none", children: "\xd7" }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex flex-1 min-h-0", children: [ /*#__PURE__*/ _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: t('admin.user_edit.tab.profile') }, { id: 'account', label: t('admin.user_edit.tab.account') }, { id: 'balance', label: t('admin.user_edit.tab.balance') }, { id: 'settings', label: t('admin.user_edit.tab.settings') }, { id: 'site', label: t('admin.user_edit.tab.site') }, { id: 'specialist', label: t('admin.user_edit.tab.specialist') } ].map((item)=>/*#__PURE__*/ _jsx("button", { onClick: ()=>{ setEditUserTab(item.id); if (item.id === 'specialist' && editUser) { setEditUserCardsLoading(true); const loadCards = api.getAdminUserSpecialistCards(editUser.id).then(setEditUserCards).catch(()=>{}); const loadCats = catRows.length === 0 ? api.getAdminCategories().then(setCatRows).catch(()=>{}) : Promise.resolve(); const loadLocs = locRows.length === 0 ? api.getAdminLocations().then(setLocRows).catch(()=>{}) : Promise.resolve(); Promise.all([ loadCards, loadCats, loadLocs ]).finally(()=>setEditUserCardsLoading(false)); } }, className: "w-full text-left px-3 py-2.5 text-sm rounded-lg transition-colors ".concat(editUserTab === item.id ? 'bg-green-50 text-green-700 font-medium' : 'text-gray-600 hover:bg-gray-50'), children: item.label }, item.id)) }), /*#__PURE__*/ _jsxs("div", { className: "flex-1 overflow-y-auto p-6", children: [ editUserTab === 'profile' && /*#__PURE__*/ _jsxs("div", { className: "space-y-4", children: [ /*#__PURE__*/ _jsxs("div", { className: "p-3 bg-gray-50 rounded-lg text-xs text-gray-500 space-y-0.5", children: [ /*#__PURE__*/ _jsxs("p", { children: [ /*#__PURE__*/ _jsxs("span", { className: "font-medium", children: [ t('admin.user_edit.registered'), ":" ] }), " ", new Date(editUser.createdAt).toLocaleDateString(dateLocale) ] }), editUser.lastSeenAt && /*#__PURE__*/ _jsxs("p", { children: [ /*#__PURE__*/ _jsxs("span", { className: "font-medium", children: [ t('admin.user_edit.last_seen'), ":" ] }), " ", new Date(editUser.lastSeenAt).toLocaleDateString(dateLocale) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "grid grid-cols-2 gap-3", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.user_edit.first_name') }), /*#__PURE__*/ _jsx("input", { value: (_editUser_firstName = editUser.firstName) !== null && _editUser_firstName !== void 0 ? _editUser_firstName : '', onChange: (e)=>setEditUser((u)=>({ ...u, firstName: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.user_edit.last_name') }), /*#__PURE__*/ _jsx("input", { value: (_editUser_lastName = editUser.lastName) !== null && _editUser_lastName !== void 0 ? _editUser_lastName : '', onChange: (e)=>setEditUser((u)=>({ ...u, lastName: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.user_edit.phone') }), /*#__PURE__*/ _jsx("input", { value: (_editUser_phone = editUser.phone) !== null && _editUser_phone !== void 0 ? _editUser_phone : '', onChange: (e)=>setEditUser((u)=>({ ...u, phone: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.user_edit.bio') }), /*#__PURE__*/ _jsx("textarea", { value: (_editUser_bio = editUser.bio) !== null && _editUser_bio !== void 0 ? _editUser_bio : '', onChange: (e)=>setEditUser((u)=>({ ...u, bio: e.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" }) ] }) ] }), editUserTab === 'account' && /*#__PURE__*/ _jsxs("div", { className: "space-y-4", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.user_edit.email') }), /*#__PURE__*/ _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: editUser.email }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between rounded-lg border px-3 py-2 bg-gray-50", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2", children: [ editUser.emailVerified ? /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-green-500 shrink-0", viewBox: "0 0 20 20", fill: "currentColor", children: /*#__PURE__*/ _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" }) }) : /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-red-400 shrink-0", viewBox: "0 0 20 20", fill: "currentColor", children: /*#__PURE__*/ _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" }) }), /*#__PURE__*/ _jsx("span", { className: "text-sm font-medium ".concat(editUser.emailVerified ? 'text-green-700' : 'text-red-600'), children: editUser.emailVerified ? t('admin.user_edit.email_verified') : t('admin.user_edit.email_not_verified') }) ] }), !editUser.emailVerified && /*#__PURE__*/ _jsx("button", { onClick: verifyEmail, disabled: verifyingEmail, className: "text-xs px-3 py-1 rounded-md bg-green-600 text-white hover:bg-green-700 disabled:opacity-50 transition-colors", children: verifyingEmail ? '...' : t('admin.user_edit.verify_email_btn') }) ] }), /*#__PURE__*/ _jsxs("div", { className: "grid grid-cols-2 gap-3", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.user_edit.role') }), /*#__PURE__*/ _jsxs("select", { value: editUser.role, onChange: (e)=>setEditUser((u)=>({ ...u, role: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm", children: [ /*#__PURE__*/ _jsx("option", { value: "user", children: t('admin.user_edit.role.user') }), /*#__PURE__*/ _jsx("option", { value: "admin", children: t('admin.user_edit.role.admin') }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.user_edit.plan') }), /*#__PURE__*/ _jsxs("select", { value: (_editUser_planId = editUser.planId) !== null && _editUser_planId !== void 0 ? _editUser_planId : '', onChange: (e)=>setEditUser((u)=>({ ...u, planId: e.target.value || null })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm", children: [ /*#__PURE__*/ _jsx("option", { value: "", children: t('admin.user_edit.no_plan') }), planRows.map((p)=>/*#__PURE__*/ _jsx("option", { value: p.id, children: p.name }, p.id)) ] }) ] }) ] }), editUser.planExpiresAt && /*#__PURE__*/ _jsxs("p", { className: "text-xs text-gray-500", children: [ t('admin.user_edit.plan_expires'), ": ", new Date(editUser.planExpiresAt).toLocaleDateString(dateLocale) ] }), /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-2 cursor-pointer", children: [ /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: editUser.isActive !== false, onChange: (e)=>setEditUser((u)=>({ ...u, isActive: e.target.checked })), className: "w-4 h-4 rounded border-gray-300 text-green-600" }), /*#__PURE__*/ _jsx("span", { className: "text-sm text-gray-700", children: t('admin.user_edit.active') }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.user_edit.interface_lang') }), /*#__PURE__*/ _jsxs("select", { value: (_editUser_locale = editUser.locale) !== null && _editUser_locale !== void 0 ? _editUser_locale : 'el', onChange: (e)=>setEditUser((u)=>({ ...u, locale: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm", children: [ /*#__PURE__*/ _jsx("option", { value: "el", children: "ΕλληΜικά" }), /*#__PURE__*/ _jsx("option", { value: "en", children: "English" }), /*#__PURE__*/ _jsx("option", { value: "ru", children: "РусскОй" }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: t('admin.user_edit.comm_languages') }), /*#__PURE__*/ _jsx("div", { className: "flex gap-5", children: [ 'el', 'en', 'uk', 'ru' ].map((lang)=>{ var _editUser_languages; return /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-1.5 cursor-pointer", children: [ /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: ((_editUser_languages = editUser.languages) !== null && _editUser_languages !== void 0 ? _editUser_languages : []).includes(lang), onChange: (e)=>{ var _editUser_languages; const langs = (_editUser_languages = editUser.languages) !== null && _editUser_languages !== void 0 ? _editUser_languages : []; setEditUser((u)=>({ ...u, languages: e.target.checked ? [ ...langs.filter((l)=>l !== lang), lang ] : langs.filter((l)=>l !== lang) })); }, className: "w-4 h-4 rounded border-gray-300 text-green-600" }), /*#__PURE__*/ _jsx("span", { className: "text-sm text-gray-700", children: lang === 'el' ? 'ΕλληΜικά' : lang === 'en' ? 'English' : lang === 'uk' ? 'УкраїМська' : 'РусскОй' }) ] }, lang); }) }) ] }) ] }), editUserTab === 'balance' && /*#__PURE__*/ _jsxs("div", { className: "space-y-6", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between p-5 bg-gray-50 rounded-xl border border-gray-200", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("div", { className: "text-xs text-gray-500 mb-1", children: t('admin.user_edit.balance') }), /*#__PURE__*/ _jsxs("div", { className: "text-2xl font-bold text-gray-900", children: [ Number((_editUser_balance = editUser.balance) !== null && _editUser_balance !== void 0 ? _editUser_balance : 0).toFixed(2), " EUR" ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-2", children: [ /*#__PURE__*/ _jsxs("button", { onClick: ()=>setBalanceModal('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: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M12 4v16m8-8H4" }) }), t('admin.balance.topup.btn') ] }), /*#__PURE__*/ _jsxs("button", { onClick: ()=>setBalanceModal('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: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M20 12H4" }) }), t('admin.balance.withdraw.btn') ] }) ] }) ] }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-center text-gray-400", children: t('admin.balance.modal_hint') }) ] }), editUserTab === 'settings' && /*#__PURE__*/ _jsx("div", { className: "space-y-4", children: /*#__PURE__*/ _jsxs("div", { className: "space-y-3 pt-1 divide-y divide-gray-100", children: [ /*#__PURE__*/ _jsxs("label", { className: "flex items-center justify-between cursor-pointer py-2", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("div", { className: "text-sm font-medium text-gray-700", children: t('admin.user_edit.show_contact_info') }), /*#__PURE__*/ _jsx("div", { className: "text-xs text-gray-400", children: t('admin.user_edit.show_contact_info.hint') }) ] }), /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: (_editUser_showContactInfo = editUser.showContactInfo) !== null && _editUser_showContactInfo !== void 0 ? _editUser_showContactInfo : false, onChange: (e)=>setEditUser((u)=>({ ...u, showContactInfo: e.target.checked })), className: "w-4 h-4 rounded border-gray-300 text-green-600" }) ] }), /*#__PURE__*/ _jsxs("label", { className: "flex items-center justify-between cursor-pointer py-2", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("div", { className: "text-sm font-medium text-gray-700", children: t('admin.user_edit.notify_new_tasks') }), /*#__PURE__*/ _jsx("div", { className: "text-xs text-gray-400", children: t('admin.user_edit.notify_new_tasks.hint') }) ] }), /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: (_editUser_notifyNewTasks = editUser.notifyNewTasks) !== null && _editUser_notifyNewTasks !== void 0 ? _editUser_notifyNewTasks : false, onChange: (e)=>setEditUser((u)=>({ ...u, notifyNewTasks: e.target.checked })), className: "w-4 h-4 rounded border-gray-300 text-green-600" }) ] }), /*#__PURE__*/ _jsxs("label", { className: "flex items-center justify-between cursor-pointer py-2", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("div", { className: "text-sm font-medium text-gray-700", children: t('admin.user_edit.notif_messages') }), /*#__PURE__*/ _jsx("div", { className: "text-xs text-gray-400", children: t('admin.user_edit.notif_messages.hint') }) ] }), /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: (_editUser_notifMessages = editUser.notifMessages) !== null && _editUser_notifMessages !== void 0 ? _editUser_notifMessages : true, onChange: (e)=>setEditUser((u)=>({ ...u, notifMessages: e.target.checked })), className: "w-4 h-4 rounded border-gray-300 text-green-600" }) ] }) ] }) }), editUserTab === 'site' && /*#__PURE__*/ _jsxs("div", { className: "space-y-4", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.user_edit.personal_site_slug') }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2", children: [ /*#__PURE__*/ _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: [ /*#__PURE__*/ _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/" }), /*#__PURE__*/ _jsx("input", { value: (_editUser_personalSiteSlug = editUser.personalSiteSlug) !== null && _editUser_personalSiteSlug !== void 0 ? _editUser_personalSiteSlug : '', onChange: (e)=>setEditUser((u)=>({ ...u, personalSiteSlug: e.target.value || null })), placeholder: "my-username", className: "flex-1 px-3 py-2 text-sm focus:outline-none" }) ] }), editUser.personalSiteSlug && /*#__PURE__*/ _jsx("a", { href: "/site/".concat(editUser.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: /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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" }) }) }) ] }) ] }), editUser.personalSiteSlug && /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx("h4", { className: "text-sm font-semibold text-gray-800 pt-3 border-t border-gray-100", children: t('profile.site.visible_title') }), /*#__PURE__*/ _jsx("div", { className: "space-y-1", children: [ { key: 'showBio', label: t('profile.site.visible.bio') }, { key: 'showRating', label: t('profile.site.visible.rating') }, { key: 'showServices', label: t('profile.site.visible.services') }, { key: 'showPortfolio', label: t('profile.site.visible.portfolio') }, { key: 'showReviews', label: t('profile.site.visible.reviews') }, { key: 'showPhone', label: t('profile.site.visible.contacts') }, { key: 'showFullLastName', label: t('profile.site.visible.full_last_name') }, { key: 'showStatus', label: t('profile.site.visible.status') } ].map((item)=>{ var _editUser_siteSettings; return /*#__PURE__*/ _jsxs("label", { className: "flex items-center justify-between cursor-pointer py-1.5", children: [ /*#__PURE__*/ _jsx("span", { className: "text-sm text-gray-700", children: item.label }), /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: ((_editUser_siteSettings = editUser.siteSettings) !== null && _editUser_siteSettings !== void 0 ? _editUser_siteSettings : {})[item.key] !== false, onChange: (e)=>setEditUser((u)=>{ var _u_siteSettings; return { ...u, siteSettings: { ...(_u_siteSettings = u.siteSettings) !== null && _u_siteSettings !== void 0 ? _u_siteSettings : {}, [item.key]: e.target.checked } }; }), className: "w-4 h-4 rounded border-gray-300 text-green-600" }) ] }, item.key); }) }), /*#__PURE__*/ _jsxs("div", { className: "pt-2", children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1.5", children: t('profile.site.theme') }), /*#__PURE__*/ _jsxs("select", { value: (_siteTheme = ((_editUser_siteSettings = editUser.siteSettings) !== null && _editUser_siteSettings !== void 0 ? _editUser_siteSettings : {}).siteTheme) !== null && _siteTheme !== void 0 ? _siteTheme : 'dark', onChange: (e)=>setEditUser((u)=>{ var _u_siteSettings; return { ...u, siteSettings: { ...(_u_siteSettings = u.siteSettings) !== null && _u_siteSettings !== void 0 ? _u_siteSettings : {}, siteTheme: e.target.value } }; }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm", children: [ /*#__PURE__*/ _jsx("option", { value: "dark", children: t('profile.site.theme.dark') }), /*#__PURE__*/ _jsx("option", { value: "light", children: t('profile.site.theme.light') }) ] }) ] }) ] }) ] }), editUserTab === 'specialist' && /*#__PURE__*/ _jsxs("div", { className: "space-y-6", children: [ (()=>{ if ((editUser === null || editUser === void 0 ? void 0 : editUser.role) === 'specialist') return null; var _editUser_bio; const bio = String((_editUser_bio = editUser === null || editUser === void 0 ? void 0 : editUser.bio) !== null && _editUser_bio !== void 0 ? _editUser_bio : '').trim(); const publishedCards = (editUserCards !== null && editUserCards !== void 0 ? editUserCards : []).filter((c)=>{ var _c_publicationStatus; return ((_c_publicationStatus = c.publicationStatus) !== null && _c_publicationStatus !== void 0 ? _c_publicationStatus : c.isActive ? 'active' : 'inactive') === 'active'; }); const hasPublishedCard = publishedCards.length > 0; const hasCategories = publishedCards.some((c)=>{ var _c_categories; var _c_categories_length; return ((_c_categories_length = (_c_categories = c.categories) === null || _c_categories === void 0 ? void 0 : _c_categories.length) !== null && _c_categories_length !== void 0 ? _c_categories_length : 0) > 0; }); const hasLocations = publishedCards.some((c)=>{ var _c_locations; var _c_locations_length; return ((_c_locations_length = (_c_locations = c.locations) === null || _c_locations === void 0 ? void 0 : _c_locations.length) !== null && _c_locations_length !== void 0 ? _c_locations_length : 0) > 0; }); const missing = []; if (!bio) missing.push(t('admin.user_edit.visibility_requirements.bio', 'Fill in bio')); if (!hasPublishedCard) missing.push(t('admin.user_edit.visibility_requirements.published_card', 'Publish at least one card')); if (!hasCategories) missing.push(t('admin.user_edit.visibility_requirements.categories', 'Add a category in a published card')); if (!hasLocations) missing.push(t('admin.user_edit.visibility_requirements.locations', 'Add a location in a published card')); if (missing.length === 0) return null; return /*#__PURE__*/ _jsxs("div", { className: "rounded-xl border border-amber-300 bg-amber-50 p-3", children: [ /*#__PURE__*/ _jsx("p", { className: "text-sm font-semibold text-amber-900", children: t('admin.user_edit.visibility_requirements.title', 'Profile is not yet visible in Offers') }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-amber-800 mt-1", children: t('admin.user_edit.visibility_requirements.hint', 'Visibility requirements to complete:') }), /*#__PURE__*/ _jsx("ul", { className: "mt-2 text-xs text-amber-900 list-disc pl-5 space-y-0.5", children: missing.map((m)=>/*#__PURE__*/ _jsx("li", { children: m }, m)) }) ] }); })(), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: t('admin.user_edit.skills') }), /*#__PURE__*/ _jsx("div", { className: "flex flex-wrap gap-1.5 mb-2 min-h-[28px]", children: ((_editUser_skills = editUser.skills) !== null && _editUser_skills !== void 0 ? _editUser_skills : []).map((s)=>/*#__PURE__*/ _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, /*#__PURE__*/ _jsx("button", { onClick: ()=>setEditUser((u)=>{ var _u_skills; return { ...u, skills: ((_u_skills = u.skills) !== null && _u_skills !== void 0 ? _u_skills : []).filter((x)=>x !== s) }; }), className: "text-gray-400 hover:text-green-700 leading-none", children: "\xd7" }) ] }, s)) }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-2", children: [ /*#__PURE__*/ _jsx("input", { value: skillInput, onChange: (e)=>setSkillInput(e.target.value), onKeyDown: (e)=>{ if ((e.key === 'Enter' || e.key === ',') && skillInput.trim()) { e.preventDefault(); const val = skillInput.trim().replace(/,$/, ''); var _editUser_skills; if (val && !((_editUser_skills = editUser.skills) !== null && _editUser_skills !== void 0 ? _editUser_skills : []).includes(val)) { setEditUser((u)=>{ var _u_skills; return { ...u, skills: [ ...(_u_skills = u.skills) !== null && _u_skills !== void 0 ? _u_skills : [], val ] }; }); } setSkillInput(''); } }, placeholder: t('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" }), /*#__PURE__*/ _jsx("button", { onClick: ()=>{ const val = skillInput.trim(); var _editUser_skills; if (val && !((_editUser_skills = editUser.skills) !== null && _editUser_skills !== void 0 ? _editUser_skills : []).includes(val)) { setEditUser((u)=>{ var _u_skills; return { ...u, skills: [ ...(_u_skills = u.skills) !== null && _u_skills !== void 0 ? _u_skills : [], val ] }; }); } setSkillInput(''); }, className: "px-3 py-2 bg-green-600 text-white rounded-lg text-sm hover:bg-green-700", children: t('common.add') }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "border-t border-gray-100 pt-4", children: [ /*#__PURE__*/ _jsx("div", { className: "text-sm font-medium text-gray-700 mb-3", children: t('admin.user_edit.specialist_cards') }), editUserCardsLoading ? /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 py-2", children: t('common.loading') }) : editUserCards.length === 0 ? /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 py-4 text-center", children: t('admin.user_edit.no_cards') }) : /*#__PURE__*/ _jsx("div", { className: "space-y-4", children: editUserCards.map((card)=>{ var _card_title, _card_description, _card_skills, _cardSkillInputs_card_id, _card_categories, _card_categories1, _card_locations, _card_locations1; return /*#__PURE__*/ _jsxs("div", { className: "border border-gray-200 bg-gray-50 rounded-xl p-4 space-y-3", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3", children: [ /*#__PURE__*/ _jsx("input", { value: (_card_title = card.title) !== null && _card_title !== void 0 ? _card_title : '', onChange: (e)=>setEditUserCards((prev)=>prev.map((c)=>c.id === card.id ? { ...c, title: e.target.value } : c)), placeholder: t('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" }), /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-1.5 cursor-pointer flex-shrink-0", children: [ /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: card.isActive !== false, onChange: (e)=>setEditUserCards((prev)=>prev.map((c)=>c.id === card.id ? { ...c, isActive: e.target.checked } : c)), className: "w-4 h-4 rounded border-gray-300 text-green-600" }), /*#__PURE__*/ _jsx("span", { className: "text-xs text-gray-600", children: t('admin.user_edit.published') }) ] }) ] }), /*#__PURE__*/ _jsx("textarea", { value: (_card_description = card.description) !== null && _card_description !== void 0 ? _card_description : '', onChange: (e)=>setEditUserCards((prev)=>prev.map((c)=>c.id === card.id ? { ...c, description: e.target.value } : c)), rows: 3, placeholder: t('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" }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("div", { className: "text-xs font-medium text-gray-500 mb-1.5", children: t('admin.user_edit.skills') }), /*#__PURE__*/ _jsx("div", { className: "flex flex-wrap gap-1.5 mb-1.5 min-h-[24px]", children: ((_card_skills = card.skills) !== null && _card_skills !== void 0 ? _card_skills : []).map((s)=>/*#__PURE__*/ _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, /*#__PURE__*/ _jsx("button", { onClick: ()=>setEditUserCards((prev)=>prev.map((c)=>{ var _c_skills; return c.id === card.id ? { ...c, skills: ((_c_skills = c.skills) !== null && _c_skills !== void 0 ? _c_skills : []).filter((x)=>x !== s) } : c; })), className: "text-gray-400 hover:text-green-700 leading-none", children: "\xd7" }) ] }, s)) }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-2", children: [ /*#__PURE__*/ _jsx("input", { value: (_cardSkillInputs_card_id = cardSkillInputs[card.id]) !== null && _cardSkillInputs_card_id !== void 0 ? _cardSkillInputs_card_id : '', onChange: (e)=>setCardSkillInputs((prev)=>({ ...prev, [card.id]: e.target.value })), onKeyDown: (e)=>{ var _cardSkillInputs_card_id; if ((e.key === 'Enter' || e.key === ',') && ((_cardSkillInputs_card_id = cardSkillInputs[card.id]) !== null && _cardSkillInputs_card_id !== void 0 ? _cardSkillInputs_card_id : '').trim()) { e.preventDefault(); var _cardSkillInputs_card_id1; const val = ((_cardSkillInputs_card_id1 = cardSkillInputs[card.id]) !== null && _cardSkillInputs_card_id1 !== void 0 ? _cardSkillInputs_card_id1 : '').trim().replace(/,$/, ''); var _card_skills; if (val && !((_card_skills = card.skills) !== null && _card_skills !== void 0 ? _card_skills : []).includes(val)) { setEditUserCards((prev)=>prev.map((c)=>{ var _c_skills; return c.id === card.id ? { ...c, skills: [ ...(_c_skills = c.skills) !== null && _c_skills !== void 0 ? _c_skills : [], val ] } : c; })); } setCardSkillInputs((prev)=>({ ...prev, [card.id]: '' })); } }, placeholder: t('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" }), /*#__PURE__*/ _jsx("button", { onClick: ()=>{ var _cardSkillInputs_card_id; const val = ((_cardSkillInputs_card_id = cardSkillInputs[card.id]) !== null && _cardSkillInputs_card_id !== void 0 ? _cardSkillInputs_card_id : '').trim(); var _card_skills; if (val && !((_card_skills = card.skills) !== null && _card_skills !== void 0 ? _card_skills : []).includes(val)) { setEditUserCards((prev)=>prev.map((c)=>{ var _c_skills; return c.id === card.id ? { ...c, skills: [ ...(_c_skills = c.skills) !== null && _c_skills !== void 0 ? _c_skills : [], val ] } : c; })); } setCardSkillInputs((prev)=>({ ...prev, [card.id]: '' })); }, className: "px-2.5 py-1.5 bg-green-600 text-white rounded-lg text-xs hover:bg-green-700", children: "+" }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("div", { className: "text-xs font-medium text-gray-500 mb-1.5", children: t('admin.user_edit.categories') }), /*#__PURE__*/ _jsx("div", { className: "flex flex-wrap gap-1.5 mb-1.5 min-h-[24px]", children: ((_card_categories = card.categories) !== null && _card_categories !== void 0 ? _card_categories : []).map((slug)=>{ var _catRows_find; return /*#__PURE__*/ _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: [ getCatLabel((_catRows_find = catRows.find((c)=>c.slug === slug)) !== null && _catRows_find !== void 0 ? _catRows_find : { slug }, locale), /*#__PURE__*/ _jsx("button", { onClick: ()=>setEditUserCards((prev)=>prev.map((c)=>{ var _c_categories; return c.id === card.id ? { ...c, categories: ((_c_categories = c.categories) !== null && _c_categories !== void 0 ? _c_categories : []).filter((x)=>x !== slug) } : c; })), className: "text-purple-400 hover:text-purple-700 leading-none", children: "\xd7" }) ] }, slug); }) }), /*#__PURE__*/ _jsx(AdminCatPicker, { catRows: catRows, locale: locale, selected: (_card_categories1 = card.categories) !== null && _card_categories1 !== void 0 ? _card_categories1 : [], onAdd: (id)=>setEditUserCards((prev)=>prev.map((c)=>{ var _c_categories; return c.id === card.id ? { ...c, categories: [ ...(_c_categories = c.categories) !== null && _c_categories !== void 0 ? _c_categories : [], id ] } : c; })), addLabel: t('admin.user_edit.add_category') }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("div", { className: "text-xs font-medium text-gray-500 mb-1.5", children: t('admin.user_edit.locations') }), /*#__PURE__*/ _jsx("div", { className: "flex flex-wrap gap-1.5 mb-1.5 min-h-[24px]", children: ((_card_locations = card.locations) !== null && _card_locations !== void 0 ? _card_locations : []).map((slug)=>{ var _locRows_find; return /*#__PURE__*/ _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: [ getLocLabel((_locRows_find = locRows.find((l)=>l.slug === slug)) !== null && _locRows_find !== void 0 ? _locRows_find : { slug }, locale), /*#__PURE__*/ _jsx("button", { onClick: ()=>setEditUserCards((prev)=>prev.map((c)=>{ var _c_locations; return c.id === card.id ? { ...c, locations: ((_c_locations = c.locations) !== null && _c_locations !== void 0 ? _c_locations : []).filter((x)=>x !== slug) } : c; })), className: "text-green-400 hover:text-green-700 leading-none", children: "\xd7" }) ] }, slug); }) }), /*#__PURE__*/ _jsx(AdminLocPicker, { locRows: locRows, locale: locale, selected: (_card_locations1 = card.locations) !== null && _card_locations1 !== void 0 ? _card_locations1 : [], onAdd: (id)=>setEditUserCards((prev)=>prev.map((c)=>{ var _c_locations; return c.id === card.id ? { ...c, locations: [ ...(_c_locations = c.locations) !== null && _c_locations !== void 0 ? _c_locations : [], id ] } : c; })), addLabel: t('admin.user_edit.add_location') }) ] }), /*#__PURE__*/ _jsx("div", { className: "flex justify-end pt-1", children: /*#__PURE__*/ _jsx("button", { onClick: ()=>saveCard(card.id), disabled: cardSaving[card.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: cardSaving[card.id] ? '...' : t('common.save') }) }) ] }, card.id); }) }) ] }) ] }) ] }) ] }), editUserTab !== 'balance' ? /*#__PURE__*/ _jsxs("div", { className: "border-t border-gray-100 px-6 py-4 flex gap-3 flex-shrink-0", children: [ /*#__PURE__*/ _jsx("button", { onClick: saveEditUser, disabled: editUserSaving, className: "flex-1 bg-green-600 hover:bg-green-700 text-white py-2 rounded-lg text-sm font-semibold disabled:opacity-50", children: editUserSaving ? '...' : t('common.save') }), /*#__PURE__*/ _jsx("button", { onClick: ()=>setEditUser(null), className: "flex-1 bg-gray-100 hover:bg-gray-200 text-gray-700 py-2 rounded-lg text-sm font-medium", children: t('common.cancel') }) ] }) : /*#__PURE__*/ _jsx("div", { className: "border-t border-gray-100 px-6 py-4 flex-shrink-0", children: /*#__PURE__*/ _jsx("button", { onClick: ()=>setEditUser(null), className: "w-full bg-gray-100 hover:bg-gray-200 text-gray-700 py-2 rounded-lg text-sm font-medium", children: t('common.close') }) }) ] }) }), editUser && balanceModal && /*#__PURE__*/ _jsx("div", { className: "fixed inset-0 z-[60] flex items-center justify-center bg-black/40 px-4", children: /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-2xl shadow-2xl p-6 w-full max-w-sm border-t-4 ".concat(balanceModal === 'topup' ? 'border-emerald-500' : 'border-rose-500'), children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between mb-4", children: [ /*#__PURE__*/ _jsx("h3", { className: "text-base font-semibold ".concat(balanceModal === 'topup' ? 'text-emerald-900' : 'text-rose-900'), children: balanceModal === 'topup' ? t('admin.balance.topup.title') : t('admin.balance.withdraw.title') }), /*#__PURE__*/ _jsx("button", { onClick: ()=>setBalanceModal(null), className: "text-gray-400 hover:text-gray-600 text-2xl leading-none", children: "\xd7" }) ] }), /*#__PURE__*/ _jsxs("p", { className: "text-xs text-gray-500 mb-4", children: [ t('admin.user_edit.balance'), ": ", /*#__PURE__*/ _jsxs("span", { className: "font-semibold text-gray-700", children: [ Number((_editUser_balance1 = editUser.balance) !== null && _editUser_balance1 !== void 0 ? _editUser_balance1 : 0).toFixed(2), " EUR" ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "space-y-3", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium mb-1 ".concat(balanceModal === 'topup' ? 'text-emerald-800' : 'text-rose-800'), children: balanceModal === 'topup' ? t('admin.balance.topup.amount') : t('admin.balance.withdraw.amount') }), /*#__PURE__*/ _jsx("input", { type: "number", min: "0.01", step: "0.01", value: balanceModal === 'topup' ? (_editUser_topUpAmount = editUser.topUpAmount) !== null && _editUser_topUpAmount !== void 0 ? _editUser_topUpAmount : '' : (_editUser_withdrawAmount = editUser.withdrawAmount) !== null && _editUser_withdrawAmount !== void 0 ? _editUser_withdrawAmount : '', onChange: (e)=>setEditUser((u)=>balanceModal === 'topup' ? { ...u, topUpAmount: e.target.value } : { ...u, withdrawAmount: e.target.value }), className: "w-full border rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 ".concat(balanceModal === 'topup' ? 'border-emerald-300 focus:ring-emerald-400' : 'border-rose-300 focus:ring-rose-400') }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium mb-1 ".concat(balanceModal === 'topup' ? 'text-emerald-800' : 'text-rose-800'), children: balanceModal === 'topup' ? t('admin.balance.topup.description') : t('admin.balance.withdraw.description') }), /*#__PURE__*/ _jsx("input", { value: balanceModal === 'topup' ? (_editUser_topUpDescription = editUser.topUpDescription) !== null && _editUser_topUpDescription !== void 0 ? _editUser_topUpDescription : '' : (_editUser_withdrawDescription = editUser.withdrawDescription) !== null && _editUser_withdrawDescription !== void 0 ? _editUser_withdrawDescription : '', onChange: (e)=>setEditUser((u)=>balanceModal === 'topup' ? { ...u, topUpDescription: e.target.value } : { ...u, withdrawDescription: e.target.value }), placeholder: balanceModal === 'topup' ? t('admin.balance.topup.description.placeholder') : t('admin.balance.withdraw.description.placeholder'), className: "w-full border rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 ".concat(balanceModal === 'topup' ? 'border-emerald-300 focus:ring-emerald-400' : 'border-rose-300 focus:ring-rose-400') }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-2 mt-5", children: [ /*#__PURE__*/ _jsx("button", { onClick: async ()=>{ if (balanceModal === 'topup') { await handleAdminTopUp(); } else { await handleAdminWithdraw(); } setBalanceModal(null); }, disabled: balanceModal === 'topup' ? topUpSaving || !Number(editUser.topUpAmount) : withdrawSaving || !Number(editUser.withdrawAmount), className: "flex-1 text-white py-2 rounded-lg text-sm font-semibold disabled:opacity-50 ".concat(balanceModal === 'topup' ? 'bg-emerald-600 hover:bg-emerald-700' : 'bg-rose-600 hover:bg-rose-700'), children: (balanceModal === 'topup' ? topUpSaving : withdrawSaving) ? t('common.loading') : balanceModal === 'topup' ? t('admin.balance.topup.submit') : t('admin.balance.withdraw.submit') }), /*#__PURE__*/ _jsx("button", { onClick: ()=>setBalanceModal(null), className: "flex-1 bg-gray-100 hover:bg-gray-200 text-gray-700 py-2 rounded-lg text-sm font-medium", children: t('common.cancel') }) ] }) ] }) }) ] }) ] }) ] }) }); } // ─── DbCheckTab ───────────────────────────────────────────────────────────── function DbCheckTab() { // ── Skill duplicates ────────────────────────────────────────────────────── const [dedupLoading, setDedupLoading] = useState(false); const [dedupGroups, setDedupGroups] = useState(null); const [keepIds, setKeepIds] = useState({}); const [merging, setMerging] = useState(null); function gk(group) { var _group__nameEl, _group_, _group_1; var _group__nameEl_toLowerCase_trim; return (_group__nameEl_toLowerCase_trim = (_group_ = group[0]) === null || _group_ === void 0 ? void 0 : (_group__nameEl = _group_.nameEl) === null || _group__nameEl === void 0 ? void 0 : _group__nameEl.toLowerCase().trim()) !== null && _group__nameEl_toLowerCase_trim !== void 0 ? _group__nameEl_toLowerCase_trim : (_group_1 = group[0]) === null || _group_1 === void 0 ? void 0 : _group_1.id; } async function findDuplicates() { setDedupLoading(true); setDedupGroups(null); setKeepIds({}); try { const groups = await api.getSkillDedup() // all categories ; setDedupGroups(groups); const auto = {}; groups.forEach((group)=>{ const best = [ ...group ].sort((a, b)=>{ var _b_usageCount, _a_usageCount; return ((_b_usageCount = b.usageCount) !== null && _b_usageCount !== void 0 ? _b_usageCount : 0) - ((_a_usageCount = a.usageCount) !== null && _a_usageCount !== void 0 ? _a_usageCount : 0); })[0]; auto[gk(group)] = best.id; }); setKeepIds(auto); } catch (e) { setDedupGroups([]); } finally{ setDedupLoading(false); } } async function mergeGroup(key, group) { const keepId = keepIds[key]; if (!keepId) return; const deleteIds = group.filter((s)=>s.id !== keepId).map((s)=>s.id); if (!deleteIds.length) return; setMerging(key); try { await api.mergeSkillDuplicates(keepId, deleteIds); setDedupGroups((prev)=>prev ? prev.filter((g)=>gk(g) !== key) : prev); } catch (e) {} finally{ setMerging(null); } } async function mergeAll() { if (!(dedupGroups === null || dedupGroups === void 0 ? void 0 : dedupGroups.length)) return; setMerging('__all__'); for (const group of [ ...dedupGroups ]){ const key = gk(group); const keepId = keepIds[key]; if (!keepId) continue; const deleteIds = group.filter((s)=>s.id !== keepId).map((s)=>s.id); if (!deleteIds.length) continue; try { await api.mergeSkillDuplicates(keepId, deleteIds); setDedupGroups((prev)=>prev ? prev.filter((g)=>gk(g) !== key) : prev); } catch (e) {} } setMerging(null); } var _dedupGroups_reduce; const totalDuplicates = (_dedupGroups_reduce = dedupGroups === null || dedupGroups === void 0 ? void 0 : dedupGroups.reduce((acc, g)=>acc + g.length - 1, 0)) !== null && _dedupGroups_reduce !== void 0 ? _dedupGroups_reduce : 0; return /*#__PURE__*/ _jsxs("div", { className: "space-y-6", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("h2", { className: "text-base font-semibold text-gray-900", children: "ПрПверка базы ЎаММых" }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-500 mt-0.5", children: "ДОагМПстОка О ОсправлеМОе прПблеЌ в базе ЎаММых" }) ] }), /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 overflow-hidden", children: [ /*#__PURE__*/ _jsxs("div", { className: "px-5 py-4 border-b border-gray-100 flex items-center justify-between", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("h3", { className: "text-sm font-semibold text-gray-800", children: "ДублОкаты МавыкПв" }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-0.5", children: "ППОск МавыкПв с ПЎОМакПвыЌ ОЌеМеЌ в ПЎМПй категПрОО. ПрО ПбъеЎОМеМОО — ссылкО в картПчках спецОалОстПв ПбМПвляются автПЌатОческО." }) ] }), /*#__PURE__*/ _jsxs("button", { onClick: findDuplicates, disabled: dedupLoading, 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: [ /*#__PURE__*/ _jsxs("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ _jsx("circle", { cx: "11", cy: "11", r: "8" }), /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M21 21l-4.35-4.35" }) ] }), dedupLoading ? 'Ищу ' : 'НайтО ЎублОкаты' ] }) ] }), dedupGroups !== null && /*#__PURE__*/ _jsx("div", { className: "p-5", children: dedupGroups.length === 0 ? /*#__PURE__*/ _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: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" }) }), "ДублОкатПв Ме МайЎеМП — база в пПряЎке" ] }) : /*#__PURE__*/ _jsxs("div", { className: "space-y-3", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between", children: [ /*#__PURE__*/ _jsxs("p", { className: "text-sm text-green-700 font-semibold", children: [ "НайЎеМП ", dedupGroups.length, " групп \xb7 ", totalDuplicates, " лОшМОх запОсей" ] }), /*#__PURE__*/ _jsx("button", { onClick: mergeAll, disabled: merging === '__all__', 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: merging === '__all__' ? 'ОбъеЎОМяю ' : "ОбъеЎОМОть все (".concat(dedupGroups.length, ")") }) ] }), dedupGroups.map((group)=>{ var _group_, _group_1; const key = gk(group); return /*#__PURE__*/ _jsxs("div", { className: "bg-white border border-orange-200 rounded-xl overflow-hidden shadow-sm", children: [ /*#__PURE__*/ _jsxs("div", { className: "px-4 py-2.5 bg-orange-50 border-b border-orange-100 flex items-center justify-between gap-3", children: [ /*#__PURE__*/ _jsxs("div", { className: "min-w-0", children: [ /*#__PURE__*/ _jsxs("span", { className: "text-sm font-semibold text-orange-800", children: [ "\xab", (_group_ = group[0]) === null || _group_ === void 0 ? void 0 : _group_.nameEl, "\xbb" ] }), /*#__PURE__*/ _jsx("span", { className: "ml-2 text-xs text-green-600 font-mono", children: (_group_1 = group[0]) === null || _group_1 === void 0 ? void 0 : _group_1.categorySlug }), /*#__PURE__*/ _jsxs("span", { className: "ml-2 text-xs text-orange-400", children: [ group.length, " варОаМта" ] }) ] }), /*#__PURE__*/ _jsx("button", { onClick: ()=>mergeGroup(key, group), disabled: !!merging, 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: merging === key ? 'ОбъеЎОМяю ' : 'ОбъеЎОМОть' }) ] }), /*#__PURE__*/ _jsx("div", { className: "divide-y divide-gray-50", children: group.map((skill)=>/*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-3 px-4 py-2.5 cursor-pointer hover:bg-gray-50 transition", children: [ /*#__PURE__*/ _jsx("input", { type: "radio", name: "dedup-global-".concat(key), checked: keepIds[key] === skill.id, onChange: ()=>setKeepIds((prev)=>({ ...prev, [key]: skill.id })), className: "accent-amber-600 shrink-0" }), /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 flex-wrap", children: [ /*#__PURE__*/ _jsx("span", { className: "text-sm font-medium text-gray-800", children: skill.nameEl }), skill.nameEn && skill.nameEn !== skill.nameEl && /*#__PURE__*/ _jsxs("span", { className: "text-xs text-gray-400", children: [ "EN: ", skill.nameEn ] }), skill.nameRu && skill.nameRu !== skill.nameEl && /*#__PURE__*/ _jsxs("span", { className: "text-xs text-gray-400", children: [ "RU: ", skill.nameRu ] }), skill.nameUk && /*#__PURE__*/ _jsxs("span", { className: "text-xs text-gray-400", children: [ "UK: ", skill.nameUk ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 mt-0.5", children: [ /*#__PURE__*/ _jsx("span", { className: "text-[11px] font-semibold ".concat(skill.usageCount > 0 ? 'text-green-600' : 'text-gray-400'), children: skill.usageCount > 0 ? "".concat(skill.usageCount, " ОспПльзПваМОй") : 'Ме ОспПльзПвался' }), /*#__PURE__*/ _jsxs("span", { className: "text-[11px] text-gray-300", children: [ "order: ", skill.order ] }), keepIds[key] === skill.id && /*#__PURE__*/ _jsx("span", { className: "text-[11px] font-bold text-amber-600 uppercase", children: "← ПставОть" }) ] }) ] }) ] }, skill.id)) }) ] }, key); }) ] }) }) ] }) ] }); } function LocTree(param) { let { rows, parentId, depth, locale, expanded, onToggle, onEdit, onDelete, onAddChild, t } = param; const children = rows.filter((r)=>{ var _r_parentId; return ((_r_parentId = r.parentId) !== null && _r_parentId !== void 0 ? _r_parentId : null) === parentId; }); if (children.length === 0) return null; return /*#__PURE__*/ _jsx(_Fragment, { children: children.sort((a, b)=>{ var _a_order, _b_order; return ((_a_order = a.order) !== null && _a_order !== void 0 ? _a_order : 0) - ((_b_order = b.order) !== null && _b_order !== void 0 ? _b_order : 0); }).map((loc)=>{ const hasChildren = rows.some((r)=>r.parentId === loc.id); const isOpen = expanded.has(loc.id); const name = (locale === 'en' ? loc.nameEn : locale === 'ru' ? loc.nameRu : locale === 'uk' ? loc.nameUk : loc.nameEl) || loc.nameEl || loc.slug; return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 px-4 py-3 hover:bg-gray-50 ".concat(!loc.isActive ? 'opacity-50' : ''), style: { paddingLeft: "".concat(16 + depth * 24, "px") }, children: [ /*#__PURE__*/ _jsx("button", { onClick: ()=>hasChildren && onToggle(loc.id), className: "w-5 h-5 flex items-center justify-center text-gray-400 rounded ".concat(hasChildren ? 'hover:bg-gray-200 cursor-pointer' : 'cursor-default'), children: hasChildren ? isOpen ? /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("polyline", { points: "6 9 12 15 18 9" }) }) : /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("polyline", { points: "9 18 15 12 9 6" }) }) : /*#__PURE__*/ _jsx("span", { className: "w-3.5 h-3.5 block" }) }), depth === 0 ? /*#__PURE__*/ _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: /*#__PURE__*/ _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" }) }) : /*#__PURE__*/ _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: [ /*#__PURE__*/ _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" }), /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 11a3 3 0 11-6 0 3 3 0 016 0z" }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ _jsx("span", { className: "font-medium text-gray-800 text-sm", children: name }), /*#__PURE__*/ _jsx("span", { className: "ml-2 text-xs text-gray-400", children: loc.nameEn }), /*#__PURE__*/ _jsxs("span", { className: "ml-1.5 font-mono text-xs text-gray-300", children: [ "/", loc.slug ] }) ] }), /*#__PURE__*/ _jsx("span", { className: "px-2 py-0.5 rounded-full text-xs font-medium ".concat(loc.isActive ? 'bg-green-100 text-green-700' : 'bg-gray-100 text-gray-500'), children: loc.isActive ? t('admin.cat.active') : t('admin.cat.inactive') }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-1 flex-shrink-0", children: [ depth === 0 && /*#__PURE__*/ _jsx("button", { onClick: ()=>onAddChild(loc.id), className: "text-xs px-2 py-1 rounded-lg bg-green-50 text-green-600 hover:bg-green-100 font-medium", title: t('admin.loc.add_district'), children: "+" }), /*#__PURE__*/ _jsx("button", { onClick: ()=>onEdit(loc), className: "text-xs px-2 py-1 rounded-lg bg-gray-100 text-gray-600 hover:bg-gray-200 font-medium", children: t('common.edit') }), /*#__PURE__*/ _jsx("button", { onClick: ()=>onDelete(loc.id, name), className: "text-xs px-2 py-1 rounded-lg bg-red-50 text-red-600 hover:bg-red-100 font-medium", children: t('common.delete') }) ] }) ] }), hasChildren && isOpen && /*#__PURE__*/ _jsx(LocTree, { rows: rows, parentId: loc.id, depth: depth + 1, locale: locale, expanded: expanded, onToggle: onToggle, onEdit: onEdit, onDelete: onDelete, onAddChild: onAddChild, t: t }) ] }, loc.id); }) }); } function CatTree(param) { let { rows, parentId, depth, locale, expanded, onToggle, onEdit, onDelete, onAddChild, skillsExpanded, skillsCache, skillsLoading, onToggleSkills, skillForm, skillSaving, onOpenAddSkill, onOpenEditSkill, onSaveSkill, onDeleteSkill, onCancelSkillForm, onSkillFormChange, t } = param; const children = rows.filter((r)=>{ var _r_parentId; return ((_r_parentId = r.parentId) !== null && _r_parentId !== void 0 ? _r_parentId : null) === parentId; }); if (children.length === 0) return null; return /*#__PURE__*/ _jsx(_Fragment, { children: children.sort((a, b)=>{ var _a_order, _b_order; return ((_a_order = a.order) !== null && _a_order !== void 0 ? _a_order : 0) - ((_b_order = b.order) !== null && _b_order !== void 0 ? _b_order : 0); }).map((cat)=>{ var _cat_names; const hasChildren = rows.some((r)=>r.parentId === cat.id); const isOpen = expanded.has(cat.id); const skillsOpen = skillsExpanded.has(cat.id); const isLoadingSkills = skillsLoading.has(cat.id); var _skillsCache_cat_slug; const skills = (_skillsCache_cat_slug = skillsCache[cat.slug]) !== null && _skillsCache_cat_slug !== void 0 ? _skillsCache_cat_slug : []; const name = (locale === 'en' ? cat.namesEn : locale === 'ru' ? cat.namesRu : locale === 'uk' ? cat.namesUk : cat.namesEl) || cat.namesEl || cat.slug; return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 px-4 py-3 hover:bg-gray-50 ".concat(!cat.isActive ? 'opacity-50' : ''), style: { paddingLeft: "".concat(16 + depth * 24, "px") }, children: [ /*#__PURE__*/ _jsx("button", { onClick: ()=>hasChildren && onToggle(cat.id), className: "w-5 h-5 flex items-center justify-center text-gray-400 rounded ".concat(hasChildren ? 'hover:bg-gray-200 cursor-pointer' : 'cursor-default'), children: hasChildren ? isOpen ? /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("polyline", { points: "6 9 12 15 18 9" }) }) : /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("polyline", { points: "9 18 15 12 9 6" }) }) : /*#__PURE__*/ _jsx("span", { className: "w-3.5 h-3.5 block" }) }), /*#__PURE__*/ _jsx("span", { className: "w-10 h-10 flex items-center justify-center rounded-xl bg-green-50", children: /*#__PURE__*/ _jsx(CategoryIcon, { icon: cat.icon, alt: name, className: "h-7 w-7 object-contain text-2xl leading-none", fallback: "\uD83D\uDCE6" }) }), /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ _jsx("span", { className: "font-medium text-gray-800 text-sm", children: name }), /*#__PURE__*/ _jsx("span", { className: "ml-2 text-xs text-gray-400", children: cat.namesEn || ((_cat_names = cat.names) === null || _cat_names === void 0 ? void 0 : _cat_names.en) }), /*#__PURE__*/ _jsxs("span", { className: "ml-1.5 font-mono text-xs text-gray-300", children: [ "/", cat.slug ] }) ] }), /*#__PURE__*/ _jsx("span", { className: "px-2 py-0.5 rounded-full text-xs font-medium ".concat(cat.isActive ? 'bg-green-100 text-green-700' : 'bg-gray-100 text-gray-500'), children: cat.isActive ? t('admin.cat.active') : t('admin.cat.inactive') }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-1 flex-shrink-0", children: [ /*#__PURE__*/ _jsxs("button", { onClick: ()=>onToggleSkills(cat), className: "text-xs px-2 py-1 rounded-lg font-medium flex items-center gap-1 ".concat(skillsOpen ? 'bg-amber-100 text-amber-700' : 'bg-amber-50 text-amber-600 hover:bg-amber-100'), title: "НавыкО", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-3 h-3", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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" }) }), skillsCache[cat.slug] ? skillsCache[cat.slug].length : t('admin.cat.skills', 'Skills') ] }), /*#__PURE__*/ _jsx("button", { onClick: ()=>onAddChild(cat.id), className: "text-xs px-2 py-1 rounded-lg bg-green-50 text-green-600 hover:bg-green-100 font-medium", title: t('admin.cat.add_child'), children: "+" }), /*#__PURE__*/ _jsx("button", { onClick: ()=>onEdit(cat), className: "text-xs px-2 py-1 rounded-lg bg-gray-100 text-gray-600 hover:bg-gray-200 font-medium", children: t('common.edit') }), /*#__PURE__*/ _jsx("button", { onClick: ()=>onDelete(cat.id, name), className: "text-xs px-2 py-1 rounded-lg bg-red-50 text-red-600 hover:bg-red-100 font-medium", children: t('common.delete') }) ] }) ] }), skillsOpen && /*#__PURE__*/ _jsx(SkillsPanel, { cat: cat, locale: locale, depth: depth, t: t, skills: skills, isLoading: isLoadingSkills, skillForm: skillForm, skillSaving: skillSaving, onOpenAddSkill: onOpenAddSkill, onOpenEditSkill: onOpenEditSkill, onSaveSkill: onSaveSkill, onDeleteSkill: onDeleteSkill, onCancelSkillForm: onCancelSkillForm, onSkillFormChange: onSkillFormChange }), hasChildren && isOpen && /*#__PURE__*/ _jsx(CatTree, { rows: rows, parentId: cat.id, depth: depth + 1, locale: locale, expanded: expanded, onToggle: onToggle, onEdit: onEdit, onDelete: onDelete, onAddChild: onAddChild, skillsExpanded: skillsExpanded, skillsCache: skillsCache, skillsLoading: skillsLoading, onToggleSkills: onToggleSkills, skillForm: skillForm, skillSaving: skillSaving, onOpenAddSkill: onOpenAddSkill, onOpenEditSkill: onOpenEditSkill, onSaveSkill: onSaveSkill, onDeleteSkill: onDeleteSkill, onCancelSkillForm: onCancelSkillForm, onSkillFormChange: onSkillFormChange, t: t }) ] }, cat.id); }) }); } // ─── SkillsPanel ──────────────────────────────────────────────────────────── // Self-contained component for the skill list + edit form + dedup panel per category const SKILL_LANG_LABELS = { nameEl: '🇬🇷 EL', nameEn: '🇬🇧 EN', nameRu: '🇷🇺 RU', nameUk: '🇺🇊 UK' }; function SkillForm(param) { let { form, saving, onSave, onCancel, onChange } = param; var _form_nameEl; var _form_order; return /*#__PURE__*/ _jsxs("div", { className: "bg-white border border-amber-200 rounded-xl p-4 shadow-sm", children: [ /*#__PURE__*/ _jsx("div", { className: "grid grid-cols-2 gap-3 mb-3", children: [ 'nameEl', 'nameEn', 'nameRu', 'nameUk' ].map((field, i)=>{ var _form_field; return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-[11px] font-semibold text-gray-500 mb-1 uppercase tracking-wide", children: SKILL_LANG_LABELS[field] }), /*#__PURE__*/ _jsx("input", { value: (_form_field = form[field]) !== null && _form_field !== void 0 ? _form_field : '', onChange: (e)=>onChange({ ...form, [field]: e.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: i === 0, placeholder: field === 'nameUk' ? 'МеПбПвʌязкПвП' : '' }) ] }, field); }) }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 pt-1 border-t border-gray-100", children: [ /*#__PURE__*/ _jsx("label", { className: "text-xs text-gray-400 font-medium", children: "ППряЎПк" }), /*#__PURE__*/ _jsx("input", { type: "number", value: (_form_order = form.order) !== null && _form_order !== void 0 ? _form_order : 0, onChange: (e)=>onChange({ ...form, order: Number(e.target.value) }), className: "w-16 border border-gray-200 rounded-lg px-2 py-1 text-xs text-center" }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-2 ml-auto", children: [ /*#__PURE__*/ _jsx("button", { onClick: onCancel, className: "px-3 py-1.5 bg-gray-100 text-gray-600 rounded-lg text-xs font-medium hover:bg-gray-200 transition", children: "ОтЌеМа" }), /*#__PURE__*/ _jsx("button", { onClick: onSave, disabled: saving || !((_form_nameEl = form.nameEl) === null || _form_nameEl === void 0 ? void 0 : _form_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: saving ? 'СПхраМяю ' : 'СПхраМОть' }) ] }) ] }) ] }); } function SkillsPanel(param) { let { cat, locale, depth, t, skills, isLoading, skillForm, skillSaving, onOpenAddSkill, onOpenEditSkill, onSaveSkill, onDeleteSkill, onCancelSkillForm, onSkillFormChange } = param; const showAddForm = (skillForm === null || skillForm === void 0 ? void 0 : skillForm.catSlug) === cat.slug && !(skillForm === null || skillForm === void 0 ? void 0 : skillForm.id); return /*#__PURE__*/ _jsxs("div", { className: "border-t border-amber-100 bg-gradient-to-b from-amber-50/60 to-white", style: { paddingLeft: "".concat(16 + depth * 24 + 36, "px"), paddingRight: '16px', paddingTop: '14px', paddingBottom: '14px' }, children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 mb-3", children: [ /*#__PURE__*/ _jsx("span", { className: "text-xs font-bold text-amber-700 uppercase tracking-wider", children: "НавыкО" }), /*#__PURE__*/ _jsxs("span", { className: "text-xs text-amber-500 font-mono", children: [ "/", cat.slug ] }), /*#__PURE__*/ _jsxs("span", { className: "ml-1 text-xs text-amber-400", children: [ "(", skills.length, ")" ] }), /*#__PURE__*/ _jsx("div", { className: "ml-auto", children: /*#__PURE__*/ _jsxs("button", { onClick: ()=>{ onCancelSkillForm(); onOpenAddSkill(cat.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: [ /*#__PURE__*/ _jsxs("svg", { className: "w-3 h-3", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: [ /*#__PURE__*/ _jsx("line", { x1: "12", y1: "5", x2: "12", y2: "19" }), /*#__PURE__*/ _jsx("line", { x1: "5", y1: "12", x2: "19", y2: "12" }) ] }), "ДПбавОть" ] }) }) ] }), isLoading ? /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 py-3 text-xs text-gray-400", children: [ /*#__PURE__*/ _jsxs("svg", { className: "w-3.5 h-3.5 animate-spin", fill: "none", viewBox: "0 0 24 24", children: [ /*#__PURE__*/ _jsx("circle", { cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4", className: "opacity-25" }), /*#__PURE__*/ _jsx("path", { fill: "currentColor", d: "M4 12a8 8 0 018-8v8z", className: "opacity-75" }) ] }), "Загрузка " ] }) : /*#__PURE__*/ _jsxs("div", { className: "space-y-1", children: [ skills.length === 0 && !showAddForm && /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 italic py-2", children: "НавыкО Ме ЎПбавлеМы" }), skills.map((skill)=>{ const isEditingThis = (skillForm === null || skillForm === void 0 ? void 0 : skillForm.id) === skill.id; const skillName = locale === 'en' ? skill.nameEn : locale === 'ru' ? skill.nameRu : locale === 'uk' ? skill.nameUk || skill.nameEn : skill.nameEl; return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 rounded-lg px-3 py-2 group transition ".concat(isEditingThis ? 'bg-amber-50 border border-amber-200' : 'bg-white border border-gray-100 hover:border-amber-200 hover:bg-amber-50/30'), children: [ /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ _jsx("span", { className: "text-sm font-medium text-gray-800", children: skillName }), locale !== 'en' && skill.nameEn && /*#__PURE__*/ _jsx("span", { className: "ml-2 text-xs text-gray-400", children: skill.nameEn }), locale !== 'ru' && skill.nameRu && skill.nameRu !== skill.nameEl && /*#__PURE__*/ _jsx("span", { className: "ml-1.5 text-xs text-gray-300", children: skill.nameRu }) ] }), skill.order > 0 && /*#__PURE__*/ _jsxs("span", { className: "text-[10px] text-gray-300 font-mono", children: [ "#", skill.order ] }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-1 transition-opacity ".concat(isEditingThis ? 'opacity-100' : 'opacity-0 group-hover:opacity-100'), children: [ /*#__PURE__*/ _jsx("button", { onClick: ()=>isEditingThis ? onCancelSkillForm() : (onCancelSkillForm(), onOpenEditSkill(skill, cat.slug)), className: "text-xs px-2 py-0.5 rounded-md font-medium transition ".concat(isEditingThis ? 'bg-amber-100 text-amber-700' : 'bg-gray-100 text-gray-600 hover:bg-amber-100 hover:text-amber-700'), children: isEditingThis ? '✕' : t('common.edit') }), /*#__PURE__*/ _jsx("button", { onClick: ()=>onDeleteSkill(skill, cat.slug), className: "text-xs px-2 py-0.5 rounded-md bg-red-50 text-red-600 hover:bg-red-100 transition", children: t('common.delete') }) ] }) ] }), isEditingThis && /*#__PURE__*/ _jsx("div", { className: "mt-1 mb-1 ml-0", children: /*#__PURE__*/ _jsx(SkillForm, { form: skillForm, saving: skillSaving, onSave: onSaveSkill, onCancel: onCancelSkillForm, onChange: onSkillFormChange }) }) ] }, skill.id); }), showAddForm && /*#__PURE__*/ _jsx("div", { className: "mt-2", children: /*#__PURE__*/ _jsx(SkillForm, { form: skillForm, saving: skillSaving, onSave: onSaveSkill, onCancel: onCancelSkillForm, onChange: onSkillFormChange }) }) ] }) ] }); } function Pagination(param) { let { page, total, limit, onChange, totalLabel } = param; const pages = Math.ceil(total / limit); if (pages <= 1) return null; return /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between px-4 py-3 border-t border-gray-100 text-sm text-gray-500", children: [ /*#__PURE__*/ _jsxs("span", { children: [ totalLabel, ": ", total ] }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-1", children: [ /*#__PURE__*/ _jsx("button", { onClick: ()=>onChange(page - 1), disabled: page === 1, className: "px-3 py-1 rounded-lg border border-gray-200 disabled:opacity-40 hover:bg-gray-50", children: "←" }), /*#__PURE__*/ _jsxs("span", { className: "px-3 py-1", children: [ page, " / ", pages ] }), /*#__PURE__*/ _jsx("button", { onClick: ()=>onChange(page + 1), disabled: page >= pages, className: "px-3 py-1 rounded-lg border border-gray-200 disabled:opacity-40 hover:bg-gray-50", children: "→" }) ] }) ] }); } // ── Activity log helpers ────────────────────────────────────────────────── function parseLogDetails(details) { try { return details ? JSON.parse(details) : null; } catch (e) { return null; } } const EVENT_META = { 'user.login': { icon: /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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: /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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: /*#__PURE__*/ _jsxs("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ _jsx("circle", { cx: "12", cy: "12", r: "10" }), /*#__PURE__*/ _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: /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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: /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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: /*#__PURE__*/ _jsxs("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ _jsx("circle", { cx: "12", cy: "12", r: "10" }), /*#__PURE__*/ _jsx("line", { x1: "15", y1: "9", x2: "9", y2: "15" }), /*#__PURE__*/ _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: /*#__PURE__*/ _jsxs("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ _jsx("polyline", { points: "3 6 5 6 21 6" }), /*#__PURE__*/ _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: /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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: /*#__PURE__*/ _jsxs("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ _jsx("line", { x1: "18", y1: "6", x2: "6", y2: "18" }), /*#__PURE__*/ _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: /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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 ActivityLogRow(param) { let { entry, dateLocale, onFilterUser, t } = param; var _EVENT_META_entry_event; const meta = (_EVENT_META_entry_event = EVENT_META[entry.event]) !== null && _EVENT_META_entry_event !== void 0 ? _EVENT_META_entry_event : { icon: /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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: entry.event, color: 'bg-gray-50 text-gray-700 border-gray-200' }; const details = parseLogDetails(entry.details); return /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 px-4 py-3 flex items-start gap-3", children: [ /*#__PURE__*/ _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 ".concat(meta.color), children: [ meta.icon, " ", t(meta.labelKey, meta.labelKey) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 flex-wrap", children: [ entry.userName && /*#__PURE__*/ _jsx("button", { onClick: ()=>entry.userId && onFilterUser(entry.userId), className: "text-sm font-medium text-gray-800 hover:text-green-600", children: entry.userName }), entry.userEmail && /*#__PURE__*/ _jsx("span", { className: "text-xs text-gray-400", children: entry.userEmail }) ] }), details && Object.keys(details).length > 0 && /*#__PURE__*/ _jsx("div", { className: "mt-1 flex flex-wrap gap-2", children: Object.entries(details).map((param)=>{ let [k, v] = param; return /*#__PURE__*/ _jsxs("span", { className: "text-xs bg-gray-100 text-gray-600 px-2 py-0.5 rounded", children: [ k, ": ", /*#__PURE__*/ _jsx("span", { className: "font-medium", children: String(v) }) ] }, k); }) }), entry.ipAddress && /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-0.5", children: entry.ipAddress }) ] }), /*#__PURE__*/ _jsx("time", { className: "shrink-0 text-xs text-gray-400 whitespace-nowrap", children: new Date(entry.createdAt).toLocaleString(dateLocale) }) ] }); } const MONTH_NAMES = [ 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec' ]; function AdminMonthChart(param) { let { series, dateLocale = 'en-US' } = param; // Collect all unique months from all series, sorted const monthSet = new Set(); series.forEach((s)=>s.data.forEach((r)=>monthSet.add(r.month))); const months = Array.from(monthSet).sort(); if (months.length === 0) return null; // Build lookup maps const seriesVals = series.map((s)=>{ const map = {}; s.data.forEach((r)=>{ map[r.month] = Number(r.count); }); return months.map((m)=>{ var _map_m; return (_map_m = map[m]) !== null && _map_m !== void 0 ? _map_m : 0; }); }); const allVals = seriesVals.flat(); const maxVal = Math.max(...allVals, 1); const W = 700; const H = 160; const padL = maxVal >= 1000000 ? 50 : maxVal >= 10000 ? 44 : maxVal >= 1000 ? 40 : 36; const padB = 24; const chartH = H - padB; const totalBars = months.length * series.length; const groupW = (W - padL - 8) / months.length; const barW = Math.max(4, Math.min(20, groupW / series.length - 2)); const yTicks = [ 0, Math.round(maxVal / 3), Math.round(maxVal * 2 / 3), maxVal ]; function barX(mi, si) { const groupStart = padL + mi * groupW + (groupW - series.length * (barW + 1)) / 2; return groupStart + si * (barW + 1); } function barHeight(v) { return v / maxVal * chartH; } return /*#__PURE__*/ _jsx("div", { className: "overflow-x-auto", children: /*#__PURE__*/ _jsxs("svg", { viewBox: "0 0 ".concat(W, " ").concat(H + 14), className: "w-full", style: { minWidth: Math.max(360, months.length * 40) }, children: [ yTicks.map((v, i)=>{ const y = chartH - v / maxVal * chartH; return /*#__PURE__*/ _jsxs("g", { children: [ /*#__PURE__*/ _jsx("line", { x1: padL, y1: y, x2: W - 4, y2: y, stroke: "#f3f4f6", strokeWidth: 1 }), /*#__PURE__*/ _jsx("text", { x: padL - 5, y: y + 3.5, textAnchor: "end", fontSize: 9, fill: "#9ca3af", children: fmtYLabel(v) }) ] }, i); }), months.map((m, mi)=>series.map((s, si)=>{ const v = seriesVals[si][mi]; const bh = barHeight(v); const x = barX(mi, si); return /*#__PURE__*/ _jsx("rect", { x: x, y: chartH - bh, width: barW, height: bh, fill: s.color, opacity: 0.8, rx: 2 }, "bar-".concat(mi, "-").concat(si)); })), months.map((m, mi)=>{ const [yr, mo] = m.slice(0, 7).split('-').map(Number); const d = new Date(Date.UTC(yr, mo - 1, 2)); const label = new Intl.DateTimeFormat(dateLocale, { month: 'short' }).format(d) + (mi === 0 || mo === 1 ? " ".concat(yr) : ''); const cx = padL + mi * groupW + groupW / 2; return /*#__PURE__*/ _jsx("text", { x: cx, y: H + 12, textAnchor: "middle", fontSize: 9, fill: "#9ca3af", children: label }, "xl-".concat(mi)); }), /*#__PURE__*/ _jsx("line", { x1: padL, y1: chartH, x2: W - 4, y2: chartH, stroke: "#e5e7eb", strokeWidth: 1 }) ] }) }); } function getLast30Days() { const days = []; for(let i = 29; i >= 0; i--){ const d = new Date(Date.now() - i * 86400000); days.push(d.toISOString().slice(0, 10)); } return days; } function smoothPath(pts) { if (pts.length < 2) return ''; let d = "M ".concat(pts[0][0].toFixed(1), " ").concat(pts[0][1].toFixed(1)); for(let i = 1; i < pts.length; i++){ const cpx = ((pts[i - 1][0] + pts[i][0]) / 2).toFixed(1); d += " C ".concat(cpx, " ").concat(pts[i - 1][1].toFixed(1), " ").concat(cpx, " ").concat(pts[i][1].toFixed(1), " ").concat(pts[i][0].toFixed(1), " ").concat(pts[i][1].toFixed(1)); } return d; } function fmtYLabel(v) { if (v >= 1000000) return "".concat(+(v / 1000000).toFixed(1), "M"); if (v >= 1000) return "".concat(Math.round(v / 1000), "K"); return String(v); } function AdminAreaChart(param) { let { series, days: daysProp } = param; const days = daysProp !== null && daysProp !== void 0 ? daysProp : getLast30Days(); const seriesVals = series.map((s)=>{ const map = {}; s.data.forEach((r)=>{ map[r.day] = Number(r.count); }); return days.map((d)=>{ var _map_d; return (_map_d = map[d]) !== null && _map_d !== void 0 ? _map_d : 0; }); }); const allVals = seriesVals.flat(); const maxVal = Math.max(...allVals, 1); const W = 700; const H = 160; const padL = maxVal >= 10000 ? 44 : maxVal >= 1000 ? 40 : 36; const padB = 22; const chartW = W - padL - 4; const chartH = H - padB; const stepX = chartW / (days.length - 1); function pts(vals) { return vals.map((v, i)=>[ padL + i * stepX, chartH - v / maxVal * chartH ]); } function areaPath(vals) { const points = pts(vals); const line = smoothPath(points); if (!line) return ''; const lastX = points[points.length - 1][0].toFixed(1); return "".concat(line, " L ").concat(lastX, " ").concat(chartH.toFixed(1), " L ").concat(padL.toFixed(1), " ").concat(chartH.toFixed(1), " Z"); } // Y-axis: 4 labels (0, 1/3, 2/3, max) const yTicks = [ 0, Math.round(maxVal / 3), Math.round(maxVal * 2 / 3), maxVal ]; // X-axis: every 7 days + last const xTicks = days.map((d, i)=>({ i, label: d.slice(8) })).filter((_, i)=>i % 7 === 0 || i === days.length - 1); return /*#__PURE__*/ _jsx("div", { className: "overflow-x-auto", children: /*#__PURE__*/ _jsxs("svg", { viewBox: "0 0 ".concat(W, " ").concat(H + 12), className: "w-full", style: { minWidth: 360 }, children: [ yTicks.map((v, i)=>{ const y = chartH - v / maxVal * chartH; return /*#__PURE__*/ _jsxs("g", { children: [ /*#__PURE__*/ _jsx("line", { x1: padL, y1: y, x2: W - 4, y2: y, stroke: "#f3f4f6", strokeWidth: 1 }), /*#__PURE__*/ _jsx("text", { x: padL - 5, y: y + 3.5, textAnchor: "end", fontSize: 9, fill: "#9ca3af", children: fmtYLabel(v) }) ] }, i); }), xTicks.map((param)=>{ let { i } = param; const x = padL + i * stepX; return /*#__PURE__*/ _jsx("line", { x1: x, y1: 0, x2: x, y2: chartH, stroke: "#f9fafb", strokeWidth: 1 }, "vg-".concat(i)); }), xTicks.map((param)=>{ let { i, label } = param; return /*#__PURE__*/ _jsx("text", { x: padL + i * stepX, y: H + 10, textAnchor: "middle", fontSize: 9, fill: "#9ca3af", children: label }, i); }), series.map((s, si)=>/*#__PURE__*/ _jsx("path", { d: areaPath(seriesVals[si]), fill: s.fill }, "fill-".concat(si))), series.map((s, si)=>/*#__PURE__*/ _jsx("path", { d: smoothPath(pts(seriesVals[si])), fill: "none", stroke: s.color, strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round" }, "line-".concat(si))), series.map((s, si)=>{ const points = pts(seriesVals[si]); const last = points[points.length - 1]; return /*#__PURE__*/ _jsx("g", { children: /*#__PURE__*/ _jsx("circle", { cx: last[0], cy: last[1], r: 4, fill: "white", stroke: s.color, strokeWidth: 2 }) }, "dot-".concat(si)); }), /*#__PURE__*/ _jsx("line", { x1: padL, y1: chartH, x2: W - 4, y2: chartH, stroke: "#e5e7eb", strokeWidth: 1 }) ] }) }); } @û`=_’”ÇÉôö;=ik‹°²äæNµ ¹ !!Ê!Í!p"s"u"€"Á#_Ä#3%7%¶%º%k'n'š**s+v+8,;,È,Ë,¿-Ã-ã/æ/è/ó/=1@1 33<3C3z33š3Ÿ3¬3_Ž3g6k6Õ6Ù6‰8Œ8Œ9¿9Ê:Í:~;;æ<é<>>þ>?›?ž?DDuDyDÜGßGáGìG‹IŽI€J_§JLL‚N†NõPøPÙQÜQT"TLTST†TTŠT«TžTÀTrWvWàWäW”Y˜YæZéZ(\+\a]d]^_^}_€_›`Ÿ`•a˜a2b5b˜fœfýfgOjRj~kkîlñln nïoòoáqåqPtSt4u7uïvývUw_]w‹w”w³w»wÚwáw!x(x6x>xŽx»xïxöx#y*yXy_y…yŒyœyÄyñyøy*z1z^zez“zšzÀz_Çzøzÿz0{7{o{v{§{®{à{ç{'|.|ˆ||Ð|×|} }f}m}­}Ž}~~9~@~r~y~­~Ž~å~_ì~SZ‘˜ÕÜ€"€W€^€‰€€Œ€Ã€DK}„ž¿öý8‚?‚v‚}‚Œ‚_Âý‚ƒ1ƒ8ƒbƒiƒ•ƒœƒÏƒÖƒ„ „C„J„„”„܄ㄅ…U…\……—…Î…Õ…††R†Y†ª†_±†Þ†å†-‡4‡g‡n‡ž‡¥‡Ù‡à‡ˆˆIˆPˆŠˆ‘ˆÖˆÝˆ‰‰W‰^‰’‰™‰Ó‰Ú‰ ŠŠGŠNŠ‘Š_˜ŠÔŠÛŠ ‹‹H‹O‹†‹‹Å‹Ì‹÷‹þ‹/Œ6ŒsŒzŒ£ŒªŒÙŒàŒ]d”ÃÊþŽGŽ_NބދŽÎŽÕŽDK‰ËÒ @G‹’ÊÑp‘w‘­‘Ž‘â‘鑟’Å’õ’ü’:“A“}“_„“œ“Ä“ð·÷·0ž7žpžwž»žÂžðž÷žÙ¹à¹ººMºTºÏºÖº»»A»H»±ŒžŒæŒíŒœ&œWœ_^œ?ŸFŸzŸŸ·ŸŸŸÍ¿Ô¿ ÀÀYÀ`ÀªÀ±ÀýÀÁSÁZÁ‘Á˜ÁÙÁàÁ'Â.Â~…ÂÒÂÙÂÃÃTÃ_[ÜãÃãÃêÃ#Ä*ÄfÄmĚįÄÞÄåÄÅ%ÅzƁÆÀÆÇÆ÷ÆþÆ5Ç<ǃNJǵnjÇñÇøÇ€È‡ÈÄÈ_ËÈ ÉɕɜÉàÉçÉÊÊFÊMÊxÊÊ¿ÊÆÊýÊË7Ë>ËpËwËŠË­ËØËßˋ̓ÌÑÍÙÍÎÎAÎ_VΆΚÎÈÎÚÎ,ÏFϳϻÏÐ&ÐOÑWѲÑÂÑïÒ÷ÒTÓfÓGÔOÔŸÔØÔòÕúÕS×l׍ؕØóØ Ù—Ú_ŸÚ$Û5ÛÜ%ܧ޺Þôàá€ä¬äEåMåŸåÆåJæRæ“æ£æúæçnç…çèè`èfèðèöè}éƒé ê_ê{êêdëlëÈëØëUì]ìµìœìííð#ðåðûðnòòƒò’òjó{óÁõÐõùú û %Â_Úµ Î y ” x‘œž`|J\®ÈXj‡™åúÌÔ-¢%³%\&m&v)‡)Ï*_×*+2+ˆ++™8·8Œ8Ò8<¡<J=[=”@¥@ÑCâCïIýIæLôLJQXQtyy-z:zP{`{«|ž|-}_5}”}€}Ñ}ä}ŸŸžŸ¡Š¡Æ£Ü£yš”šùš©׫ò«`­{­8¯N¯?²U²/ŽEŽ'ž=ž »6»‡Á ÁeÆ_{ÆÒÈÕÈÞÌáÌÔÍ×ÍŽÏžÏÁÐÄаѳÑ\Ò_ÒÊÓÍÓÀÔÃԎַ֪׭ׇًٔڗÚÒÛÕÛ"Ý%ÝÞ_Þ?àCàLáOáfâiâÕãÙãâäåäîåñåZç^çgèjè|éé¿êÃêÌëÏëJìMì–íší£îŠîQïTïéò_ìòßóâó¡õ€õ—öšö+ø.ø!ù$ù™úœúû’û0ý4ý=þ@þ ÿÿúÿýÿèëHK>Aë î G _K  Æ `d 157:69–™dhæé¥©{~z}Z]‡_‹û þ M"Q"E#H#*$-$' '¶'º'g(j(T*W*.,1,°/Ž/É1Ì1<5?5Ú8Ý8Ž:·:h>k>B@_E@DDðEóE J$J&K)K_LbLÒMÕMPPQQþQRWS[SgTkT‰UŒUŠWªWÈXËXìZðZ\_\ý^_ïeóeÝfàfh!h^xbx—yšy{{||£~Š~)€-€ „„ù„ý„÷…ú…U‡Y‡uˆxˆĊ_NJêî؎܎֏ُ3‘7‘S’V’ž”¡”²—¶—ª˜®˜£™Š™üš› œœ.1KŸOŸm p X£\£F€_J€p¥s¥ïŠòŠôšøšªª“«–«”­˜­À®î:°>°ZŽ]Žâ»æ»WŒ[Œ&œ*œ(¿+¿›ÁžÁÕÃÙÊÅ_ÅÆÆÉÆ È ÈøÉüÉòÊöÊÚËÝ˝̡ÌIÍLÍÐÎÓÎXÐ[ÐßÑâÑnÓqÓûÔþÔ„Ö‡Ö:Ø=Ø ÙÙpÙ_sÙLÛOÛ±ÛŽÛmÞqބ߇ßeàsà8á;á·âºâŒãã-æ0æüçèCêFê ìì¹íŒíŽî‘îññøñ_üñIóLóõõÇ÷Ê÷-û0û| ‘•jmÌÐ…ˆÕ Ø " % „ ‡ ã æ üö_úÞá¡¥MPÔ×ux¬¯QT˜›ilÎѰ ³ !!4%8%U&Y&}'_€'+).)u+x+J,M,—.›.2"233ž6»6O8R8h;k; >>€>„>O?S?QATAÄCÇCþEF·G_ºG J£J L€LšMžM‚N…NEOIOñOôOyQ|QSSTTVV W£WVYYY'Z*ZŒZZh\k\Í\_Ð\ ``!a$abbb!bJeMe[g^g0h3hôj÷jákëkšl«lWnZn7o;o¹pŒp:s=suxxx{_{Œ{{r|u|š}ž}g€k€^b؂܂›…Ÿ…†¡†B‡E‡ňȈ•Œ™Œ:=œŽÀŽ““Ÿ“Á“B•_E•™™Ž™ž™0œ3œ¥Ÿ©ŸJ N Æ¢É¢;Š?ŠàŠäŠ\©_©ѬÕ¬v­z­ò¯õ¯Ö³Ú³âŽåŽ#ž'ž¹_¹a»d» ŸŸóŸöŸñ¿ô¿,Ç0ǡǥLJȊȯɳÉ|Ì€ÌsÍwÍíÎñέѱѯҳÒTÓWÓ×ÔÚÔ­Ø_±ØRÙVÙÎÛÑÛAßEßæßêßbâeâÕåÙåzæ~æöèùèiìmìííŠïï^óbóRôVôFõIõÊöÍö¥ú_©úÉûÌûÃÿÇÿ¥š¬¯“–‘”  Õ Ø Ù Ü ³¶vztxrv £ï_ò&*ÁÄÆÉAE_ c ."1"J$M$¬%¯%Ã'Ç'Ë(Î(ô*÷*F.I.e0i011ï1ó1õ2_ø2Z4]4Ÿ5Á5£7§7©8¬8 ::o;r;Œ=¿=È>Ë>Ù?Ý?¢@Š@7A:A¯B²B‹CŽCåEèEÐFÔFH_HNIRIžJ»JÝLàLoOrOnPqPsPvPóSöSNVRV’W•W2Z5Z__€_§_aaòaõaAdDd,e_0epftfªg®gii5k8kÇmÊmÆnÉnËnÎnKrNrŠt©tŸxÁxx{|{í{ð{uxæƒêƒk„o„i…_m…ˇχžˆɈ`‹d‹ύҍëŽîŽ‹’Ž’€“§“«”®”y•}•m–p–N—R—˜˜Š™™››Ÿœ¢œ)ž_,ž²ŸµŸ9¡<¡Á¢Ä¢K€N€Ò¥Õ¥ššâ©æ©««Ú¬ݬ·­º­%°(°ȱ˱Z³]³>µAµ6·9·2¹_5¹(»+»œœŸŸ¿¿­Á°ÁJÃMÃñÄõÄêÇíÇhÊkÊÍÏÐÏ0Ò4ÒµÒ¹ÒßÓãÓ„Ô‡Ô ÖÖ*Ø_-ØÆÙÉÙ,Ü0ÜÑÜÔÜYÞ\Þáá¿áÂáEãHãMæQæ”é˜éììî îZñ^ñKôNôVõYõööù_ùlûpûñûõûýýÀýÃýEÿIÿZ]îñ†Š+.¯²h l    ’ quUYÂ_ÅÈËüÿÑÕÅÈŠ ª Z!]!â"å"o$r$ø%û%„'‡'))W+Z+³0·0é1_ì1·3º3H5K5%6(6|88 ::;;f=i=Y>\>Ô?×?nBqB DDŒEE…HˆHKKjPmPÒR_ÖRWS[ST…T&U)U°VŽVÍXÐX\Z_ZÂ\Æ\g]j]ï^ò^²a¶aWbZbÝcàc×fÛfÉiÍi6l9lyBy‘z”z-}0}‚_‚ò‚ö‚L„O„@…C…ò‡õ‡÷‹û‹ŒQŽaސV’Y’U”X”w–z–gškšܚߚ]¡`¡Σ_Ò£Å€È€Š ŠèŠìŠ§§"©%©,­0­Ñ­Ô­e¯h¯y³}³Ž!Ž·µºµ(º,ºͺкfŒiŒ€ÀƒÀüÃ_ÄóÄöÄ2Æ5ÆiÇmÇJÈNÈPÉTÉbÊeÊÌÌjÐnÐÑ"ÑÌÒÏҍב×2Ø5ØÅÙÉÙÝݝޠÞà_àvâzâãã¬ä¯äééµéžéFëIëð ð ññÂñÅñtówóÐ÷Ô÷…øˆø8ú;únÿqÿÅ_ÕVZy | ± Ž JMŽž†ŠŒ¢ŠÁď“TWÆÊöùˆ‹Â"_Å"Ÿ%£%˜&œ&M'P'ú(þ(Z,],û-þ-Ž0ž0i1l133Ž7’7¬8°8q9t9+;.;Ú?Þ?Ÿ@¢@]B_`BHH¹HŒHeJhJöNúN«O®OGQJQ5V9VAWDWíYðY1\5\i]m]¬_¯_7a:accZe]e'g_+gúgþg7i;izk}kmmÜnßn(q,q?sBsw!w'y*y|‚|‰~Œ~ž¡šƒ«ƒ‡‡ ‰‰PŒ_SŒ[Ž^Ž‘ő̓ϓŒ–¿–ŘȘœœžžQ¡T¡[£^£§ §©©u¬x¬€®ƒ®‘±”±™³œ³ß¶_â¶ëžîžœœ¿¿4Â7Â>ÄAÄ\Ç_ÇgÉjÉŸÌÁÌÈÎËÎáÑäÑìÓïӬׯ׎ٷÙÅàÉàãáçá¥ã_šã åå.æ1æÕçÙç©ê¬êäìçìòíõíDðGðzò~ò§óªóöö¬ù°ùiúlú,ü/üGKÄ_Çåé14äçÃÆÏÓ÷úºœV!Y!‚%…%ì)ð)í*ñ*‚+…+à,ã,œ. .•/_™/:0=0Å1È1Ž3·3†6‰6–8š89 9#;';È;Ë;_=c=±@Ž@HBKBEDHD6F:FÛFÞFrHuH›L_žLíNñNÜOßOhRkR‰TTŠUŽUV"VW„WŸZ¢Z÷[ú[ò`õ`JbMb\h_hŽi·iOmRm§nªnÅq_Èqs sövùvNxQx||\}_}4„7„Œ……<@ٍݍ‘‘““«—¯—Ÿ˜¢˜#›&›@_DAžDžzŸ~Ÿs w ¡¡¢¢¥¢—€š€ƒ§†§–©š©ª“ª4«7«»¬Ÿ¬­®°®›±ž±®³±³TŽXŽñŽ_õŽ··º·«¿¯¿AÄDÄÉÅÌÅÒÊÕÊ`ÌcÌeÒiÒúÒýÒtÔwÔ×ÕÚÕ[Ú_ÚJÛMÛÂÝÅÝäßèßåàéàzá_}áÝâàâ”ä˜ä)å,åŸæ£æ™çœçœìŸìûïþïTòXòéòìòcôgô]õ`õ`ùcù¿üÂü@þCþ‘ • r _u è ë J N ÷ û ) , ¶ ¹ Ø Ü ö ù o r B E y } Z ^ k o ! #! Ò" Õ" % % W( _Z( £* §* Ž+ ž+ i, l, . . B0 E0 3 ‚3 %6 )6 7 7 ¥9 š9 ÿ; < °< Ž< ‰= = Ó? Ö? KB NB 6D 9D œG _ÁG jJ mJ ºK œK M M eN hN ŒO ¿O nQ rQ T T aU eU sW wW šY žY \ \ ²^ µ^ œ_ À_ 7f ;f 1g 5g @h _Dh Ji Ni „j ˆj @n Cn €p šp Ìs Ïs au eu )x ,x Cz Gz u{ x{ , / ’ « ؃ ۃ _… c… z† ~† Έ ш ¯Š _³Š ¡‹ €‹ £Ž §Ž ¶ º ’ ’ œ“ Ÿ“ L• O• ó– ö– ™ ™ Á› ؛ 6€ 9€ OŠ SŠ § § ø§ û§ +© /© ª ª ”¬ _—¬ ¯ “¯ $° '° q± t± [Ž _Ž bµ eµ À· Ä· Už Xž €¹ §¹ vŒ zŒ œ œ VŸ YŸ qÁ uÁ n r à à |Ä Ä •Ç _™Ç :È =È ºÉ œÉ +Í /Í Î Î Ñ Ñ Ó Ó Ô Ô SÕ WÕ XÖ \Ö ~× × ÜØ ߨ ¿Ú ÃÚ åÛ èÛ >Ý AÝ $ß (ß Jà _Mà ªá ­á ã ‘ã ³ä ¶ä æ æ ûç ÿç !é $é ‚ê …ê Ÿì £ì €í ší Êî Íî "ð %ð ò ò ;ó >ó ›ô žô èö ìö ø _ø nù qù Kû Oû qü tü Óý Öý 7 : < D   D H ¬ ° M Q _ b d l Ñ Õ    $ h _l ã ç ” ˜ Ž ‘ _ b å! é! `# c# )$ ,$ F& J& V' Z' ë' î' W) Z) ?+ B+ Œ, Â, Ç0 Ê0 š2 ¬2 –3 _™3 é4 í4 Õ5 Ù5 €7 ž7 £7 ¹7 ®? ±? ÎA ÑA #E 'E ÜF ßF üH ÿH ëK îK MQ kQ pQ †Q lX pX ZY ]Y ÕZ ØZ ñ[ _ô[ ²\ ¶\ ú] þ] ¯^ ²^ —` ›` €e §e h &h Fo Jo 4p 7p •q ™q šr žr :t =t Ôv ×v €y §y Šz ©z R{ U{ | _ | æ| ê| ý} ~ ‚ … ]€ a€ ¬ ¯ ù‚ ƒ ƒ 2ƒ ŒŒ ÀŒ N Q – 7– <– R– š£ ž£ K€ O€ Ѐ Ó€ Š РЧ _ª§ ³š ·š H© K© ¢ª Šª Ÿ¬ Á¬ !® $® †¯ ‰¯ ë° î° $³ '³ µ µ ±¶ µ¶ F· I· €ž šž žº »º Œ Œ €œ ƒœ åŸ _èŸ Á !Á ËÁ ÏÁ @Å CÅ XÇ [Ç ŽÌ ‘Ì ÿÍ Î ñÎ õÎ iÐ lÐ ÃÒ ÆÒ Õ Õ ÁÙ ÅÙ ÕÚ ÙÚ åÛ éÛ šÜ Ü &Þ )Þ +à _.à Šâ ªâ )å ,å é é ‹ì šì õ õ ×õ Ûõ ÷ ÷ Où Rù ü ü ® à ó  5 E œ Ô 8 < > F ñ _õ ó ö   J N P X   e h û ÿ   Ž ·   e% h% Ð' Ó' À. Ã. / / Ì/ Ï/ e7 _i7 x8 {8 À9 Ã9 Œ; À; ·< »< Ó= Ö= !? %? @ -@ ñA õA ¹C ŒC “F –F 5J 8J ëJ ïJ ‡L ŠL O O @Q CQ RR _UR ˜W œW =X AX š[ [ B^ E^ u` y` £a Ša dc gc f f ×g Ûg 'k *k l l +m .m £m §m òn õn Ñp Ôp šr _«r t „t ]v `v !y $y €} „}   è€ ë€ ¿‚ ‚ ʃ ΃ S‡ V‡ ^ˆ aˆ íŒ ðŒ >” A” G• K• – ”– ®— ²— K˜ _O˜ Ÿ™ Á™ »› Ÿ› Œ  µž žž ¥  š  £ £ Ø£ Û£ Ž€ ’€ *Š -Š €š §š Ъ Óª à« ä« Ø¬ Û¬ <­ @­ O® R® é¯ _ì¯ ù² ü² Dµ Gµ ŵ ɵ õ¶ ø¶ ëž îž Ì¹ Ϲ - 0 žÃ ¡Ã óÄ öÄ æÈ éÈ §É «É ¥Ê ©Ê ÃË ÇË `Ì cÌ ÐÍ ÔÍ ¿Ð _ÂÐ ÂÒ ÆÒ ¡Ó €Ó Ü Ü öÝ Þ ¹Þ ÎÞ vß Šß 2ä 6ä Må Qå Ræ Væ ¡ç ¥ç lè pè Ýì áì ší ¬í ‹ò ò µó ¹ó ‚ô _…ô aö dö 1û 5û þû ü Üý ßý 0 4 í ð § ª   Ð Ó ˆ ‹ è ì í ñ ª ­ d g Ë Ï ' _+ ƒ † c f ê í È Ë $ $ ' ' „* ˆ* ®+ ²+ {, ~, T. X. 2 2 Ù3 Ü3 ð6 ô6 œ7 À7 –9 š9 ©= _¬= ˆ? ‹? 9C =C 7F ;F sG vG :K =K fM jM #N &N æO êO ³S ¶S PU SU ìV ïV ªY ®Y gZ jZ *\ -\ š_ ž_ a _ a ‰i Œi n n o $o †p Šp Sq Vq s s ýv w 3x 7x jz mz Â| Å|   :ƒ =ƒ ’… •… õŠ øŠ   ؍ _܍   ^ b 3‘ 6‘ “ “ Ÿ• ¢• ’š –š é› í› Ÿœ Áœ Šž ©ž (¡ +¡ Š Š m§ q§ Bš Eš (ª +ª 𬠫¬ f² _j² k³ o³ (Ž +Ž ïµ óµ 2· 6· ïž òž » » ŠÀ ©À fà ià Æ Æ Ê ƒÊ …Ê Ê @Ë CË Í Í ðÛ ôÛ mÝ pÝ ?ß _Bß sè wè £é Šé |ë €ë Ûò Þò ¬ô ¯ô ãø çø  # q t o r c f † ‰ ã ç   £ [ ^ È Ì Æ _É % ) [ ^ $+ '+ 6 "6 O7 R7 #9 &9 ’: •: ú; ý; 7> ;> µ? ¹? (A +A ‰F F 5H 8H PM SM øP ûP ­V _±V šW W ¯Y ²Y >[ B[ œ] Ÿ] ‘e •e g g c| f| ‘Œ •Œ ~  — š -’ 1’ – – ‚ž …ž š š õš øš « _« Ÿ­ £­ q± t± ê¹ í¹ fà ià pÄ sÄ [Ë _Ë bÌ eÌ ¬Î ¯Î ¯Ð ²Ð tÑ wÑ ãÓ æÓ ŠÔ ªÔ åÕ éÕ ×Ö ÚÖ ¥Ø šØ ¬Ú _°Ú Ü Ü ÝÞ áÞ ²ß ¶ß Oà Rà Iâ Lâ 8é <é Õé Øé Ùë Üë 8ó <ó ô ô Áù Äù —ý žý Òý Ùý þ þ 4þ ;þ û_ Ïæ¶ º   ` c , / " & È Ì  ” ý ¬°cg  03“_–„*.ÃÇŒ  <#@#6$:$]%a%H&L&))Œ*À*Z-]-0!0Ý0_á022Š5Ž5”6˜6É7Ì7š9ž9d<h< ??/B3BaCdC‰EEEHHHÕMØMÚMâM&P*PsPwPÚQ_ÝQBSESšT«TVUYUŒV¿VjWmW7X:X˜Y›Y%[)[­\°\^^ˆ_Œ_2`5`*a-a!b%båcècVe_ZeffÜgßgWiZiVkYkŽo‘o“o›o7s;s„sˆsëtîtSvVv¹wŒwgxjxÍyÐy{z~z:{={ñ{_ô{ö{|r}v}~~e€i€)‚,‚šƒžƒN„R„.†1†ևهÁŠĊŒ„Œüÿðóö’ù’A™_E™Ιљ››x›{›Žœ‘œџ՟r u 0¡3¡5£9£Ë£Σ¥¥©©nªrªöªùªÊ«Ϋ߬㬮_®®…®G°K°Ô±×±³³8µ<µÖµÚµƶɶ@žCžš¹ž¹6º9º]ŒaŒÂŒÆŒ6Ÿ:Ÿ¿¿TÀWÀÁÁ_ÄÁPÃTÃ÷ÄûÄ!Æ$ÆžÈ¡È Ë Ë•Ë˜ËºÍœÍ#Î&Î]ÐaÐ ÑÑÇÑËÑ=Ò@ҌӐӫԮÔ4×7ר_ ضٹيڍÚÜ!ÜÝÝŸÝ¢Ý ß ßÞßáßXá[á,â/â§ã«ãŽä‘ä)å,åßåâåDçHç+è.è›è_žèDêGêëë#ì'ì í íÀíÃíïïðïóïŸò¢òsóvó0õ4õÏõÓõ3÷7÷­÷±÷døgøÉùÌù÷ú_úúïûóûýýsþvþGÿJÿ+*±°†‰ÚÞGK¢¥  – ™ îñ?B03„TˆÓ×.1ŒÊ!Í!f#i#Ê$Í$’%•%€'§'à'ã'`)c)€€€€€€€€€€€·(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)ÿ¶(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)ÿÌ_components_CategoryIcon__WEBPACK_IMPORTED_MODULE_7__/* .CategoryIcon */ .Ezþýýþþþþþýþÿþ¯(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)ÿÿ­(0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)°(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)úúûûûûûúûûúúûüûûûúûûýýýþÿúúúûûûûûúûûúúûûûûûúûû€º(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)¿(0,_lib_auth__WEBPACK_IMPORTED_MODULE_4__/* .useSession */ .wV)Ã(0,_context_locale__WEBPACK_IMPORTED_MODULE_5__/* .useLocale */ .Y)úúüúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúúüüœ_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminStats */ .dEÂ_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminNotifStats */ .biÁ_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminMailStats */ .u4¿_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminReports */ .z5Ç_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminSpecialistCards */ .s_÷œ_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminUsers */ .cSöœ_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminTasks */ .YjõüõýõÆ_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminSupportTickets */ .KZôÆ_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminBalanceHistory */ .g0óŸ_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminAiLogs */ .j_Ä_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminActivityLogs */ .yOÀ_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminMailLogs */ .qtÁ_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminNotifLogs */ .Brïïïïœ_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminPlans */ .OXîÄ_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getTranslationsStats */ .YQí»(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .request */ .Em)ÿÿìÁ_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminReferrals */ .cJëüëëëÂ_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .adminBroadcastPush */ .V7Ã_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .adminSendPushToUser */ .g1Ÿ_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .deactivateUser */ .WiŒ_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .activateUser */ .HeŸ_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .changeUserRole */ .MmŒ_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminUser */ .jd¿_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updateAdminUser */ .wlÉ_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .adminUpdateSpecialistCard */ .oqÄ_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .verifyAdminUserEmail */ .uQÅ_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .adminTopUpUserBalance */ .P0íÈ_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .adminWithdrawUserBalance */ .hDìüüçè¿_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .cancelTaskAdmin */ .nf¿_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .deleteTaskAdmin */ .GBÂ_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updateReportStatus */ .eUÝÁ_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminLocations */ .k_Ÿ_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updateLocation */ .NtŸ_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .createLocation */ .yJŸ_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .deleteLocation */ .zRÙÂ_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminCategories */ .KDؘ"https://api.canhelp.gr"0Ÿ_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updateCategory */ .$7Ÿ_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .createCategory */ .zZŸ_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .deleteCategory */ .K7Ÿ_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminSkills */ .i_»_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updateSkill */ .fP»_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .createSkill */ .S9»_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .deleteSkill */ .hpº_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updatePlan */ .tdº_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .createPlan */ .qTߺ_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .deletePlan */ .bRÍÞÀ_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminSettings */ .rCÆ_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminEmailTemplates */ .LpÃ_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updateAdminSettings */ .CXÿÈ_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updateAdminEmailTemplate */ .jgË_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .translateAdminEmailTemplate */ .wcþþýýýýýÆ_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .testTelegramConnection */ .qXÃ_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .verifyTelegramToken */ .clÂÂÂÁÂÂÂÂÂÂÂÁÂÂÂÂÁÂÂÁÂÂÁÂÂÁÂÂÁÂÂÂÂÂÂÂÂÂÂÁÂÂÂÂÂÂÂÁÁÁÂÂÂÁ²(next_link__WEBPACK_IMPORTED_MODULE_3___default())ÁÁÀÁÀÁÁÁÀÁÀÁÁÀÀÁÁÁÀÁÁÁÁÁÁÁÁÀÁÁÁÀÀÁÀÀÁÀÁÀÁÁÀÁÁÀÁÁÁÁÀÀÀÁÀÁÁÀÀÁÀÁÁÀÀÁÀÀÁÀÁÀÀÁÁÀÁÁÀÁÀÁÀÀÀÁÁÀÁÁÁÀÀÁÀÁÁÁÁÁÁÁÁÁÁÁÁÀÁÉ(0,_lib_formatName__WEBPACK_IMPORTED_MODULE_8__/* .formatShortName */ .H)ÀÀÀÀ¿ÀÀÀÀÀ¿ÀÀÀÀÀ¿¿À¿ÀÀÀÀÀ¿¿À¿ÀÀÀÀÀÀÀÀÀÀÀ¿¿ÀÀÀÀ¿À¿ÀÀÀ¿¿¿ÀÀ¿ÀÀ¿¿À¿ÀÀÀÀÀÀÀÀÀÀÀ¿ÀÀþÀÀÀÀÆ(0,_lib_taskLocale__WEBPACK_IMPORTED_MODULE_9__/* .formatPrice */ .$g)¿¿Ÿ¿¿¿ŸŸ¿ŸŸŸŸŸŸ¿¿Ÿ¿¿Ÿ¿¿ŸŸ¿ŸŸ¿ŸŸ¿ŸŸ¿Ÿ¿Ÿ¿¿¿¿¿ŸŸ¿ŸŸŸŸŸŸ¿¿ŸŸ¿ŸŸ¿ŸŸ¿ŸŸ¿ŸŸ¿¿Ÿ¿Ÿ¿¿¿¿¿Ÿ¿¿¿ŸŸŸ¿¿Ÿ¿ýŸŸ¿¿¿Ÿ¿¿¿ŸŸŸ¿¿¿Ÿ¿¿¿¿¿ŸŸ¿¿¿¿ŸŸŸ¿¿¿¿ý¿Ÿ¿¿Ÿ¿¿¿¿ŸŸŸ¿¿¿¿ý¿¿¿Ÿ¿¿ŸŸŸŸÐŸ¿¿¿¿¿Ÿ¿Ÿ¿¿¿¿¿¿¿¿¿¿¿Ÿ¿¿¿¿¿¿¿¿¿¿¿¿¿¿¿Ÿ¿¿¿ŸŸŸ¿Ÿ¿¿Ÿ¿¿Ÿ¿¿ŸŸ¿¿Ÿ¿¿¿¿ŸŸŸ¿Ÿ¿¿Ÿ¿¿Ÿ¿¿ŸŸ¿¿Ÿ¿¿Ÿ¿Ÿ¿¿¿¿¿¿¿Ÿ¿¿¿¿¿¿¿¿¿¿¿¿Ÿ¿¿¿ŸŸŸ¿Ÿ¿¿Ÿ¿¿Ÿ¿¿ŸŸ¿¿Ÿ¿¿Ÿ¿Ÿ¿¿¿¿¿¿Ÿ¿¿¿¿¿¿¿¿¿¿¿¿¿ŸŸŸŸ¿¿¿Ÿ¿ŸŸ¿¿Ÿ¿¿Ÿ¿¿Ÿ¿Ÿ¿¿¿Ÿ¿¿¿ŸŸ¿¿Ÿ¿¿Ÿ¿¿Ÿ¿¿Ÿ¿¿Ÿ¿¿Ÿ¿¿¿ŸŸ¿¿Ÿ¿¿Ÿ¿¿¿¿Ÿ¿¿¿Ÿ¿ŸŸ¿Ÿ¿Ÿ¿¿Ÿ¿¿¿¿¿ŸŸŸ¿¿¿¿ŸŸŸŸŸŸŸŸ¿¿¿Ÿ¿¿¿Ÿ¿óÔ¿¿¿¿Ÿ¿¿Ÿ¿ŸŸ¿¿Ÿ¿¿Ÿ¿¿Ÿ¿¿¿Ÿ¿¿ŸŸŸ¿¿Ÿ¿¿Ÿ¿Ÿ¿¿¿Ÿ¿¿Ÿ¿¿ŸŸ¿¿Ÿ¿¿¿¿œ_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .sendTestEmail */ .FIœŸŸŸœœœœŸœŸŸœŸŸŸœœŸœŸŸœŸŸœœŸŸœŸŸœŸŸœŸŸœŸŸœœŸŸŸŸœœœŸŸŸœŸŸŸŸŸŸŸŸŸŸŸŸŸŸŸŸŸŸŸŸŸŸŸŸŸŸŸŸŸŸŸŸŸŸŸŸŸŸŸœœŸœŸœŸŸŸŸœŸŸœŸŸœŸŸœŸŸŸœŸœŸŸŸœœŸŸœœŸŸŸŸœŸœŸœŸŸŸœŸŸŸœŸŸœœŸŸŸŸŸŸŸŸŸŸŸŸŸŸŸŸŸŸœœŸŸŸœŸŸœŸœœŸŸŸŸœœŸŸŸŸŸœœŸœŸŸŸŸœŸŸŸœŸŸœœŸŸœŸœŸŸŸœŸœŸŸŸŸœŸŸœœŸŸœŸŸŸœœœŸŸŸŸœœŸŸŸŸœŸŸœœœŸŸŸœŸŸŸŸŸœŸœœœœŸŸœœœœœŸœŸœŸœŸŸÆ_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .setSupportTicketStatus */ .u0œŒŒœŒœŒŒœœœœœÄ_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .replyToSupportTicket */ .nTŒ»»Œ»ŒŒ»ŒŒ»Œ»ŒŒ»ŒŒ»»ŒŒ»ŒŒ»ŒŒ»Œ»»ŒŒ»ŒŒ»ŒŒ»ŒŒ»ŒŒ»»ŒŒ»ŒŒ»ŒŒ»ŒŒŒ·react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragmentºººº»ÿºººººº»»º»»ºº»»»Ò»º»ººç0»»º»»»ç0º»»»ºº»º»Òº»ºº»»»»»»º»»º»ç0º»ç0ºº»»ºº»º»»»»»»º»º»»»»»º»»»ºº»»»ººº»»»º»ºÊ_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getTasksTranslationPreview */ .QYº¹ºººÁ_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .autoTranslateTasks */ .IË_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .autoTranslateEmailTemplates */ .fuœ_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .autoTranslate */ .cpͶû¶··¶û··¶û·····¶·¶··¶¶·¶Ï¶···¶····¶¶··¶···¶·¶·¶······¶···¶····¶¶¶¶·······¶···¶·¶····¶·······¶¶¶·¶·¶··Ë_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminUserSpecialistCards */ .vyáݵµµµµµµµµ¶¶µ¶¶µ¶¶µ¶¶µµ¶¶µµ¶¶¶¶¶¶µµ¶µ¶¶µ¶µ¶¶µµ¶¶µ¶µ¶¶¶µ¶¶µ¶¶µµµ¶µµµ¶¶µ¶¶¶¶µµµ¶¶¶µµ¶¶¶µµ¶¶¶µµ¶µµ¶¶¶¶¶µú¶¶µ¶¶µ¶µ¶¶µµ¶¶¶¶µ¶¶µ¶µ¶¶µ¶¶¶¶µµ¶µ¶¶¶µ¶¶µ¶µ¶¶µ¶¶µ¶¶µ¶¶µ¶¶¶¶µ¶¶¶¶¶µµ¶¶µµµµ¶¶µ¶¶µ¶¶žžžžœ_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getSkillDedup */ .GEÄ_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .mergeSkillDuplicates */ .Uqÿ³³ŽŽ³³³ŽŽ³³ŽŽŽ³ŽŽ³³³Ž³³³³Ž³ŽŽ³Ž³³Ž³³³³Ž³ŽŽø³³ŽŽŽŽŽŽŽŽ³ŽŽ³ŽŽ³Ž³ŽŽŽŽŽø³³ŽŽŽŽŽŽŽŽµ³ŽŽ³Ž³³ŽŽŽŽŽŽŽ³Ž³ŽŽ³ŽŽ³ŽŽ³³Ž³³Ž³³ŽŽ³³ŽŽ³Ž³³³ŽŽŽ³³ŽŽŽŽŽŽ³³³Ž³ŽŽŽŽŽ³ŽŽŽŽŽŽ³ŽŽŽ³ŽŽŽŽ³ŽŽŽŽŽŽ³³³³ŽŽŽ³ŽŽŽ°(/* unused pure expression or super */ null && (‚))²±±²²²²²²±±²²²²²²²²²€†buffer†source„size„maps„hash Ÿ__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ AdminPage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7541); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(9664); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(next_link__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(1592); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(9906); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(2982); /* harmony import */ var _lib_formatName__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(1258); /* harmony import */ var _lib_taskLocale__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(4017); /* harmony import */ var _components_CategoryIcon__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(5940); /* __next_internal_client_entry_do_not_use__ default auto */ const TEMPLATE_VARS = { 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' ] }; const TEMPLATE_HINT_VARS = Array.from(new Set(Object.values(TEMPLATE_VARS).flat())); const DEFAULT_CATEGORY_ICON_PRESETS = [ { 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 getCatLabel(row, locale) { if (!row) return ''; if (locale === 'en') return row.namesEn || row.namesEl || row.slug || ''; if (locale === 'ru') return row.namesRu || row.namesEl || row.slug || ''; if (locale === 'uk') return row.namesUk || row.namesEl || row.slug || ''; return row.namesEl || row.namesEn || row.slug || ''; } function getLocLabel(row, locale) { if (!row) return ''; if (locale === 'en') return row.nameEn || row.nameEl || row.slug || ''; if (locale === 'ru') return row.nameRu || row.nameEl || row.slug || ''; if (locale === 'uk') return row.nameUk || row.nameEl || row.slug || ''; return row.nameEl || row.nameEn || row.slug || ''; } function CategoryIconPicker(param) { let { value, onChange, onUpload, uploading, error, presets } = param; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-3 rounded-xl border border-gray-200 bg-white px-3 py-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex h-12 w-12 items-center justify-center rounded-lg bg-green-50", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components_CategoryIcon__WEBPACK_IMPORTED_MODULE_7__/* .CategoryIcon */ .Ez, { icon: value, alt: "category icon", className: "h-9 w-9 object-contain text-3xl leading-none", fallback: "\uD83D\uDCE6" }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: value, onChange: (e)=>onChange(e.target.value), className: "flex-1 border-0 bg-transparent p-0 text-sm outline-none ring-0", placeholder: "/category-icons/package.svg" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "inline-flex cursor-pointer items-center rounded-lg border px-3 py-1.5 text-xs font-medium transition ".concat(uploading ? 'border-gray-200 bg-gray-100 text-gray-400' : 'border-green-300 bg-green-50 text-green-700 hover:bg-green-100'), children: [ uploading ? 'Uploading...' : 'Upload SVG', /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "file", accept: ".svg,image/svg+xml", className: "hidden", disabled: uploading, onChange: async (e)=>{ var _e_target_files; const file = (_e_target_files = e.target.files) === null || _e_target_files === void 0 ? void 0 : _e_target_files[0]; if (!file) return; await onUpload(file); e.target.value = ''; } }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-xs text-gray-500", children: "or choose from presets" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-[11px] text-gray-500", children: "Preset source: /public/category-icons/presets.json" }), error ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-red-600", children: error }) : null, /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "grid grid-cols-2 gap-2 sm:grid-cols-3 lg:grid-cols-4", children: presets.map((preset)=>{ const active = value === preset.value; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { type: "button", onClick: ()=>onChange(preset.value), className: "flex h-20 flex-col items-center justify-center gap-1 rounded-lg border px-2 transition ".concat(active ? 'border-green-500 bg-green-50 shadow-sm' : 'border-gray-200 bg-white hover:border-green-300 hover:bg-green-50'), "aria-label": preset.label, title: preset.label, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components_CategoryIcon__WEBPACK_IMPORTED_MODULE_7__/* .CategoryIcon */ .Ez, { icon: preset.value, alt: preset.label, className: "h-8 w-8 object-contain text-3xl leading-none", fallback: "\uD83D\uDCE6" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "max-w-full truncate text-[11px] font-medium text-gray-600 leading-tight", children: preset.label }) ] }, preset.value); }) }) ] }); } function AdminCatPicker(param) { let { catRows, locale, selected, onAdd, addLabel } = param; const [open, setOpen] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [search, setSearch] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [expandedParent, setExpandedParent] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const ref = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ function h(e) { if (ref.current && !ref.current.contains(e.target)) { setOpen(false); setSearch(''); } } document.addEventListener('mousedown', h); return ()=>document.removeEventListener('mousedown', h); }, []); const parents = catRows.filter((r)=>!r.parentId); const lowerSearch = search.toLowerCase(); const matchesSearch = (r)=>{ var _r_slug; return !search || getCatLabel(r, locale).toLowerCase().includes(lowerSearch) || ((_r_slug = r.slug) !== null && _r_slug !== void 0 ? _r_slug : '').toLowerCase().includes(lowerSearch); }; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "relative", ref: ref, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { type: "button", onClick: ()=>setOpen((v)=>!v), className: "w-full flex items-center gap-1.5 px-3 py-1.5 text-xs transition-colors ".concat(open ? '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: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4 6h16M4 10h16M4 14h16M4 18h16" }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "flex-1 text-left truncate", children: addLabel }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3 h-3 text-gray-400 shrink-0 transition-transform ".concat(open ? 'rotate-180' : ''), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19 9l-7 7-7-7" }) }) ] }), open && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "sticky top-0 bg-white px-3 py-2 border-b border-gray-100", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { autoFocus: true, value: search, onChange: (e)=>setSearch(e.target.value), placeholder: "ППОск...", className: "w-full text-xs border border-gray-200 rounded-lg px-2.5 py-1.5 focus:outline-none focus:ring-2 focus:ring-blue-300" }) }), parents.map((parent)=>{ const children = catRows.filter((r)=>r.parentId === parent.id); const parentLabel = getCatLabel(parent, locale); const isExpanded = expandedParent === parent.id; const matchingChildren = children.filter((c)=>!selected.includes(c.slug) && matchesSearch(c)); const parentAvail = !selected.includes(parent.slug) && matchesSearch(parent); const hasChildren = children.length > 0; if (!parentAvail && matchingChildren.length === 0 && search) return null; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: ()=>{ if (hasChildren && !search) { setExpandedParent(isExpanded ? null : parent.id); } else if (parentAvail) { onAdd(parent.slug); setOpen(false); setSearch(''); } }, children: [ parent.icon ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components_CategoryIcon__WEBPACK_IMPORTED_MODULE_7__/* .CategoryIcon */ .Ez, { icon: parent.icon, alt: parentLabel, className: "h-5 w-5 shrink-0 object-contain text-sm leading-none", fallback: "\uD83D\uDCE6" }) : null, /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "flex-1 font-medium", children: parentLabel }), hasChildren && !search ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3.5 h-3.5 text-gray-400 shrink-0 transition-transform ".concat(isExpanded ? 'rotate-90' : ''), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 5l7 7-7 7" }) }) : null ] }), (isExpanded || !!search) && matchingChildren.map((child)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: ()=>{ onAdd(child.slug); setOpen(false); setSearch(''); }, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "w-1.5 h-1.5 rounded-full bg-gray-300 shrink-0" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "flex-1", children: getCatLabel(child, locale) }) ] }, child.id)) ] }, parent.id); }) ] }) ] }); } function AdminLocPicker(param) { let { locRows, locale, selected, onAdd, addLabel } = param; const [open, setOpen] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [search, setSearch] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [expandedCity, setExpandedCity] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const ref = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ function h(e) { if (ref.current && !ref.current.contains(e.target)) { setOpen(false); setSearch(''); } } document.addEventListener('mousedown', h); return ()=>document.removeEventListener('mousedown', h); }, []); const cities = locRows.filter((r)=>!r.parentId); const lowerSearch = search.toLowerCase(); const matchesSearch = (r)=>{ var _r_slug; return !search || getLocLabel(r, locale).toLowerCase().includes(lowerSearch) || ((_r_slug = r.slug) !== null && _r_slug !== void 0 ? _r_slug : '').toLowerCase().includes(lowerSearch); }; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "relative", ref: ref, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { type: "button", onClick: ()=>setOpen((v)=>!v), className: "w-full flex items-center gap-1.5 px-3 py-1.5 text-xs transition-colors ".concat(open ? '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: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 11a3 3 0 11-6 0 3 3 0 016 0z" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "flex-1 text-left truncate", children: addLabel }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3 h-3 text-gray-400 shrink-0 transition-transform ".concat(open ? 'rotate-180' : ''), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19 9l-7 7-7-7" }) }) ] }), open && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "sticky top-0 bg-white px-3 py-2 border-b border-gray-100", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { autoFocus: true, value: search, onChange: (e)=>setSearch(e.target.value), placeholder: "ППОск...", className: "w-full text-xs border border-gray-200 rounded-lg px-2.5 py-1.5 focus:outline-none focus:ring-2 focus:ring-blue-300" }) }), cities.map((city)=>{ const districts = locRows.filter((r)=>r.parentId === city.id); const cityLabel = getLocLabel(city, locale); const isExpanded = expandedCity === city.id; const hasDistricts = districts.length > 0; const matchingDistricts = districts.filter((d)=>!selected.includes(d.slug) && matchesSearch(d)); const cityAvail = !selected.includes(city.slug) && matchesSearch(city); if (!cityAvail && matchingDistricts.length === 0 && search) return null; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: ()=>{ if (hasDistricts && !search) { setExpandedCity(isExpanded ? null : city.id); } else if (cityAvail) { onAdd(city.slug); setOpen(false); setSearch(''); } }, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3 h-3 text-gray-300 shrink-0", fill: "currentColor", viewBox: "0 0 24 24", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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" }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "flex-1 font-medium", children: cityLabel }), hasDistricts && !search ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3.5 h-3.5 text-gray-400 shrink-0 transition-transform ".concat(isExpanded ? 'rotate-90' : ''), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 5l7 7-7 7" }) }) : null ] }), (isExpanded || !!search) && matchingDistricts.map((d)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: ()=>{ onAdd(d.slug); setOpen(false); setSearch(''); }, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "w-1.5 h-1.5 rounded-full bg-gray-300 shrink-0" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "flex-1", children: getLocLabel(d, locale) }) ] }, d.id)) ] }, city.id); }) ] }) ] }); } function AdminPage() { var _session_user, _stats_tokensByMonth; const router = (0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)(); const { data: session, isPending } = (0,_lib_auth__WEBPACK_IMPORTED_MODULE_4__/* .useSession */ .wV)(); const { t, locale } = (0,_context_locale__WEBPACK_IMPORTED_MODULE_5__/* .useLocale */ .Y)(); const [tab, setTab] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)('stats'); const [sidebarCollapsed, setSidebarCollapsed] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ setSidebarCollapsed(window.innerWidth < 1024); }, []); // Stats const [stats, setStats] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); // Users const [users, setUsers] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [usersPage, setUsersPage] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(1); const [usersTotal, setUsersTotal] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(0); const [usersQ, setUsersQ] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [usersQInput, setUsersQInput] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [usersRole, setUsersRole] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); // Tasks const [tasks, setTasks] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [tasksPage, setTasksPage] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(1); const [tasksTotal, setTasksTotal] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(0); const [tasksQ, setTasksQ] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [tasksQInput, setTasksQInput] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [tasksStatus, setTasksStatus] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); // Reports const [reports, setReports] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [reportsPage, setReportsPage] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(1); const [reportsTotal, setReportsTotal] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(0); const [pendingReportsCount, setPendingReportsCount] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(0); // Specialist card moderation const [moderationCards, setModerationCards] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [moderationCardsPage, setModerationCardsPage] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(1); const [moderationCardsTotal, setModerationCardsTotal] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(0); const [moderationCardsLoading, setModerationCardsLoading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [pendingCardsCount, setPendingCardsCount] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(0); // Support tickets const [supportTickets, setSupportTickets] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [supportPage, setSupportPage] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(1); const [supportTotal, setSupportTotal] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(0); const [supportStatus, setSupportStatus] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [supportType, setSupportType] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [supportQ, setSupportQ] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [supportQInput, setSupportQInput] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [supportReplyId, setSupportReplyId] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [supportReplyText, setSupportReplyText] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [supportReplySaving, setSupportReplySaving] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); // AI Logs const [logs, setLogs] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [logsPage, setLogsPage] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(1); const [logsTotal, setLogsTotal] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(0); // Activity Logs const [activityLog, setActivityLog] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [activityTotal, setActivityTotal] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(0); const [activityPage, setActivityPage] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(1); const [activityEvent, setActivityEvent] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [activityUserId, setActivityUserId] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [activityDateFrom, setActivityDateFrom] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [activityDateTo, setActivityDateTo] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [activityEventTypes, setActivityEventTypes] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); // Mail Logs const [mailLog, setMailLog] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [mailTotal, setMailTotal] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(0); const [mailPage, setMailPage] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(1); const [mailEvent, setMailEvent] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [mailDateFrom, setMailDateFrom] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [mailDateTo, setMailDateTo] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [mailEventTypes, setMailEventTypes] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); // Logs sub-tab const [logsSubTab, setLogsSubTab] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)('ai'); // Notification Logs const [notifLogs, setNotifLogs] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [notifLogsPage, setNotifLogsPage] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(1); const [notifLogsTotal, setNotifLogsTotal] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(0); const [notifLogsType, setNotifLogsType] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [notifLogsTypes, setNotifLogsTypes] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [notifLogsDateFrom, setNotifLogsDateFrom] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [notifLogsDateTo, setNotifLogsDateTo] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); // Notification stats chart const [notifsByDay, setNotifsByDay] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [mailByDay, setMailByDay] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); // Balance archive const [balanceRows, setBalanceRows] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [balanceTotal, setBalanceTotal] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(0); const [balancePage, setBalancePage] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(1); const [balanceUserId, setBalanceUserId] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [balanceKind, setBalanceKind] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [topUpSaving, setTopUpSaving] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [withdrawSaving, setWithdrawSaving] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); // User edit modal const [editUser, setEditUser] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [editUserSaving, setEditUserSaving] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [verifyingEmail, setVerifyingEmail] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [editUserTab, setEditUserTab] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)('profile'); const [balanceModal, setBalanceModal] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [skillInput, setSkillInput] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [editUserCards, setEditUserCards] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [editUserCardsLoading, setEditUserCardsLoading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [cardSkillInputs, setCardSkillInputs] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)({}); const [cardSaving, setCardSaving] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)({}); const [cardCatSelects, setCardCatSelects] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)({}); const [cardLocSelects, setCardLocSelects] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)({}); // Plans const [planRows, setPlanRows] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [planForm, setPlanForm] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [planSaving, setPlanSaving] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); // Locations const [locRows, setLocRows] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [locForm, setLocForm] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [locSaving, setLocSaving] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [locExpanded, setLocExpanded] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(new Set()); // Categories const [catRows, setCatRows] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [catForm, setCatForm] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [catSaving, setCatSaving] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [catExpanded, setCatExpanded] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(new Set()); const [catIconUploading, setCatIconUploading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [catIconError, setCatIconError] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [categoryIconPresets, setCategoryIconPresets] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(DEFAULT_CATEGORY_ICON_PRESETS); // Category Skills const [catSkillsExpanded, setCatSkillsExpanded] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(new Set()); const [catSkillsCache, setCatSkillsCache] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)({}); const [catSkillsLoading, setCatSkillsLoading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(new Set()); const [skillForm, setSkillForm] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [skillSaving, setSkillSaving] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); // Settings const [settingsTab, setSettingsTab] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)('general'); const [generalForm, setGeneralForm] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)({ siteName: 'CanHelp', siteUrl: '', contactEmail: '', supportPhone: '' }); const [generalSaving, setGeneralSaving] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [generalSaved, setGeneralSaved] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [smtpForm, setSmtpForm] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)({ host: '', port: '587', username: '', password: '', fromName: 'CanHelp', fromEmail: '', encryption: 'tls' }); const [smtpSaving, setSmtpSaving] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [smtpSaved, setSmtpSaved] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [testEmailSending, setTestEmailSending] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [testEmailResult, setTestEmailResult] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [notifTemplates, setNotifTemplates] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)({ email_verification: { subject: 'ППЎтверЎОте ваш email — {{siteName}}', body: '' }, registration_success: { subject: 'ДПбрП пПжалПвать в {{siteName}}!', body: '' }, password_reset: { subject: 'ВПсстаМПвлеМОе парПля — {{siteName}}', body: '' }, new_offer: { subject: 'НПвПе преЎлПжеМОе пП вашей заЎаче «{{taskTitle}}»', body: '' }, new_task: { subject: 'НПвая заЎача: {{taskTitle}}', body: '' }, offer_accepted: { subject: 'Ваше преЎлПжеМОе прОМятП: {{taskTitle}}', body: '

Ваше преЎлПжеМОе прОМятП! 🎉

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

ЗаказчОк прОМял ваше преЎлПжеМОе Ма выпПлМеМОе заЎачО:

{{taskTitle}}

СуЌЌа: {{price}}€

Открыть чат →' }, new_message: { subject: 'НПвПе сППбщеМОе Пт {{senderName}}', body: '

НПвПе сППбщеМОе

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

ВаЌ МапОсал(а) {{senderName}}:

"{{preview}}"

ОтветОть →' }, offer_declined: { subject: 'Ваше преЎлПжеМОе ПтклПМеМП: {{taskTitle}}', body: '

Ваше преЎлПжеМОе ПтклПМеМП

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

К сПжалеМОю, заказчОк ПтклПМОл ваше преЎлПжеМОе Ма:

{{taskTitle}}

НайтО ЎругОе заказы →' }, offer_other_accepted: { subject: 'ВыбраМ ЎругПй ОспПлМОтель: {{taskTitle}}', body: '

ВыбраМ ЎругПй ОспПлМОтель

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

ЗаказчОк выбрал ЎругПгП ОспПлМОтеля Ўля заЎаМОя:

{{taskTitle}}

НайтО ЎругОе заказы →' }, task_updated: { subject: 'ЗаЎаМОе ПбМПвлеМП: {{taskTitle}}', body: '

ЗаЎаМОе ПбМПвлеМП

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

ЗаказчОк ПбМПвОл ЎеталО заЎаМОя:

{{taskTitle}}

СЌПтреть заказ →' }, deadline_reminder: { subject: 'ЗаЎаМОе Остекает завтра: {{taskTitle}}', body: '

НапПЌОМаМОе П ЎеЎлайМе

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

Ваше заЎаМОе Остекает через 24 часа. ОбМПвОте ЎеЎлайМ, ОМаче заЎаМОе буЎет автПЌатОческО сМятП с публОкацОО.

{{taskTitle}}

РеЎактОрПвать заЎаМОе →' }, task_archived: { subject: 'ЗаЎаМОе сМятП с публОкацОО: {{taskTitle}}', body: '

ЗаЎаМОе перевеЎеМП в черМПвОк

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

Ваше заЎаМОе ОстеклП О былП автПЌатОческО перевеЎеМП в черМПвОк. ОбМПвОте ЎеЎлайМ, чтПбы ПпублОкПвать егП сМПва.

{{taskTitle}}

РеЎактОрПвать заЎаМОе →' }, referral_reward: { subject: 'Вы пПлучОлО реферальМую МаграЎу — {{siteName}}', body: '

Вы пПлучОлО реферальМую МаграЎу! 🎁

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

Друг зарегОстрОрПвался пП вашей реферальМПй ссылке. На ваш аккауМт ЎПбавлеМП {{days}} ЎМей ЎПступа к плаМу {{planName}}!

+{{days}} ЎМей — {{planName}}

ПерейтО к аккауМту →' }, referral_reward_el: { subject: 'Λάβατε αΜταΌοιβή παραποΌπής — {{siteName}}', body: '

Λάβατε αΜταΌοιβή παραποΌπής! 🎁

Γεια {{userName}},

ΈΜας φίλος εγγράφηκε χρησιΌοποιώΜτας τοΜ σύΜΎεσΌο παραποΌπής σας. ΣτοΜ λογαριασΌό σας προστέΞηκαΜ {{days}} ηΌέρες πρόσβασης στο πλάΜο {{planName}}!

+{{days}} ηΌέρες — {{planName}}

Δες τοΜ λογαριασΌό σου →' }, referral_reward_en: { subject: 'You received a referral reward — {{siteName}}', body: '

You received a referral reward! 🎁

Hi {{userName}},

A friend registered using your referral link. {{days}} days of {{planName}} access have been added to your account!

+{{days}} days — {{planName}}

View your account →' }, referral_reward_ru: { subject: 'Вы пПлучОлО реферальМую МаграЎу — {{siteName}}', body: '

Вы пПлучОлО реферальМую МаграЎу! 🎁

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

Друг зарегОстрОрПвался пП вашей реферальМПй ссылке. На ваш аккауМт ЎПбавлеМП {{days}} ЎМей ЎПступа к плаМу {{planName}}!

+{{days}} ЎМей — {{planName}}

ПерейтО к аккауМту →' } }); const [editingTemplate, setEditingTemplate] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [templateLocale, setTemplateLocale] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)('el'); const [templateSaving, setTemplateSaving] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [templateTranslating, setTemplateTranslating] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [ePayForm, setEPayForm] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)({ merchantId: '', apiUser: '', apiPassword: '', environment: 'test', confirmationUrl: '', cancelUrl: '', enabled: false }); const [ePaySaving, setEPaySaving] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [ePaySaved, setEPaySaved] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [referralForm, setReferralForm] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)({ enabled: false, planId: '', days: '30' }); const [referralSaving, setReferralSaving] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [referralSaved, setReferralSaved] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [seoForm, setSeoForm] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)({ maintenanceMode: false, indexingEnabled: true, headScripts: '', siteTitleEl: '', siteTitleEn: '', siteTitleRu: '', siteTitleUk: '', siteDescriptionEl: '', siteDescriptionEn: '', siteDescriptionRu: '', siteDescriptionUk: '' }); const [seoSaving, setSeoSaving] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [seoSaved, setSeoSaved] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [seoLangTab, setSeoLangTab] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)('el'); const [socialForm, setSocialForm] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)({ telegram: '', instagram: '', facebook: '', twitter: '', youtube: '', tiktok: '', whatsapp: '', viber: '' }); const [socialSaving, setSocialSaving] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [socialSaved, setSocialSaved] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [telegramForm, setTelegramForm] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)({ botToken: '', adminChatId: '', channelIdEl: '', channelIdEn: '', channelIdRu: '', channelIdUk: '', notifyRegistrations: false, postNewTasks: false }); const [telegramSaving, setTelegramSaving] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [telegramSaved, setTelegramSaved] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [testingTelegramAdmin, setTestingTelegramAdmin] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [testingTelegramChannel, setTestingTelegramChannel] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [testResultTelegramAdmin, setTestResultTelegramAdmin] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [testResultTelegramChannel, setTestResultTelegramChannel] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [testingLocale, setTestingLocale] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [testResultChannels, setTestResultChannels] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)({}); const [verifyingTelegramToken, setVerifyingTelegramToken] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [verifyResultTelegramToken, setVerifyResultTelegramToken] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); // Backup const [backupAutoEnabled, setBackupAutoEnabled] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [backupAutoSaving, setBackupAutoSaving] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [backupTables, setBackupTables] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [backupTablesLoading, setBackupTablesLoading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [backupStoredFiles, setBackupStoredFiles] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [backupExporting, setBackupExporting] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [backupImporting, setBackupImporting] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [backupRestoring, setBackupRestoring] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [backupMsg, setBackupMsg] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [backupMsgError, setBackupMsgError] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const setBackupSuccess = (msg)=>{ setBackupMsg(msg); setBackupMsgError(false); }; const setBackupError = (msg)=>{ setBackupMsg(msg); setBackupMsgError(true); }; // ─── Translations state ─────────────────────────────────────────────────── const [transStats, setTransStats] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [transStatsLoading, setTransStatsLoading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [transLang, setTransLang] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)('uk'); const [transFromLang, setTransFromLang] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)('el'); const [transTableTranslating, setTransTableTranslating] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)({}); const [transMsg, setTransMsg] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [transPreview, setTransPreview] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); // ─── Referrals state ───────────────────────────────────────────────────── const [referralsData, setReferralsData] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [referralsLoading, setReferralsLoading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [referralsExpanded, setReferralsExpanded] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(new Set()); // ─── Push state ────────────────────────────────────────────────────────── const [pushMode, setPushMode] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)('broadcast'); const [pushTargetUserId, setPushTargetUserId] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [pushTitle, setPushTitle] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [pushBody, setPushBody] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [pushType, setPushType] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)('general'); const [pushReferenceId, setPushReferenceId] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [pushOnlyActive, setPushOnlyActive] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(true); const [pushSending, setPushSending] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [pushResult, setPushResult] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [pushError, setPushError] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [loading, setLoading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const isAdmin = !isPending && session && ((_session_user = session.user) === null || _session_user === void 0 ? void 0 : _session_user.role) === 'admin'; (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ var _session_user; if (!isPending && !session) router.push('/login'); if (!isPending && session && ((_session_user = session.user) === null || _session_user === void 0 ? void 0 : _session_user.role) !== 'admin') router.push('/'); }, [ session, isPending ]); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!isAdmin) return; _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminStats */ .dE().then(setStats).catch(()=>{}); _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminNotifStats */ .bi().then(setNotifsByDay).catch(()=>{}); _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminMailStats */ .u4().then(setMailByDay).catch(()=>{}); _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminReports */ .z5(1, 'pending').then((d)=>setPendingReportsCount(d.total)).catch(()=>{}); _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminSpecialistCards */ .s_(1, 'pending').then((d)=>setPendingCardsCount(d.total)).catch(()=>{}); }, [ isAdmin ]); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!isAdmin || tab !== 'users') return; setLoading(true); _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminUsers */ .cS(usersPage, usersQ || undefined, usersRole || undefined).then((d)=>{ setUsers(d.data); setUsersTotal(d.total); }).catch(()=>{}).finally(()=>setLoading(false)); }, [ isAdmin, tab, usersPage, usersQ, usersRole ]); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!isAdmin || tab !== 'tasks') return; setLoading(true); _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminTasks */ .Yj(tasksPage, tasksQ || undefined, tasksStatus || undefined).then((d)=>{ setTasks(d.data); setTasksTotal(d.total); }).catch(()=>{}).finally(()=>setLoading(false)); }, [ isAdmin, tab, tasksPage, tasksQ, tasksStatus ]); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!isAdmin || tab !== 'reports') return; setLoading(true); _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminReports */ .z5(reportsPage).then((d)=>{ setReports(d.data); setReportsTotal(d.total); }).catch(()=>{}).finally(()=>setLoading(false)); }, [ isAdmin, tab, reportsPage ]); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!isAdmin || tab !== 'moderation') return; setModerationCardsLoading(true); _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminSpecialistCards */ .s_(moderationCardsPage, 'review').then((d)=>{ setModerationCards(d.data); setModerationCardsTotal(d.total); }).catch(()=>{}).finally(()=>setModerationCardsLoading(false)); }, [ isAdmin, tab, moderationCardsPage ]); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!isAdmin || tab !== 'support') return; setLoading(true); const params = { page: String(supportPage), limit: '30' }; if (supportStatus) params.status = supportStatus; if (supportType) params.type = supportType; if (supportQ) params.q = supportQ; _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminSupportTickets */ .KZ(params).then((d)=>{ setSupportTickets(d.data); setSupportTotal(d.total); }).catch(()=>{}).finally(()=>setLoading(false)); }, [ isAdmin, tab, supportPage, supportStatus, supportType, supportQ ]); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!isAdmin || tab !== 'balances') return; setLoading(true); _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminBalanceHistory */ .g0({ page: balancePage, userId: balanceUserId || undefined, kind: balanceKind || undefined }).then((d)=>{ setBalanceRows(d.data); setBalanceTotal(d.total); }).catch(()=>{}).finally(()=>setLoading(false)); }, [ isAdmin, tab, balancePage, balanceUserId, balanceKind ]); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!isAdmin || tab !== 'logs') return; if (logsSubTab === 'ai') { setLoading(true); _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminAiLogs */ .j_(logsPage).then((d)=>{ setLogs(d.data); setLogsTotal(d.total); }).catch(()=>{}).finally(()=>setLoading(false)); } else if (logsSubTab === 'activity') { _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminActivityLogs */ .yO({ page: activityPage, event: activityEvent || undefined, userId: activityUserId || undefined, dateFrom: activityDateFrom || undefined, dateTo: activityDateTo || undefined }).then((d)=>{ var _d_eventTypes; setActivityLog(d.data); setActivityTotal(d.total); if ((_d_eventTypes = d.eventTypes) === null || _d_eventTypes === void 0 ? void 0 : _d_eventTypes.length) setActivityEventTypes(d.eventTypes); }).catch(()=>{}); } else if (logsSubTab === 'mail') { _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminMailLogs */ .qt({ page: mailPage, event: mailEvent || undefined, dateFrom: mailDateFrom || undefined, dateTo: mailDateTo || undefined }).then((d)=>{ var _d_eventTypes; setMailLog(d.data); setMailTotal(d.total); if ((_d_eventTypes = d.eventTypes) === null || _d_eventTypes === void 0 ? void 0 : _d_eventTypes.length) setMailEventTypes(d.eventTypes); }).catch(()=>{}); } else if (logsSubTab === 'notifications') { _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminNotifLogs */ .Br({ page: notifLogsPage, type: notifLogsType || undefined, dateFrom: notifLogsDateFrom || undefined, dateTo: notifLogsDateTo || undefined }).then((d)=>{ var _d_notifTypes; setNotifLogs(d.data); setNotifLogsTotal(d.total); if ((_d_notifTypes = d.notifTypes) === null || _d_notifTypes === void 0 ? void 0 : _d_notifTypes.length) setNotifLogsTypes(d.notifTypes); }).catch(()=>{}); } }, [ isAdmin, tab, logsSubTab, logsPage, activityPage, activityEvent, activityUserId, activityDateFrom, activityDateTo, mailPage, mailEvent, mailDateFrom, mailDateTo, notifLogsPage, notifLogsType, notifLogsDateFrom, notifLogsDateTo ]); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ setActivityPage(1); }, [ activityEvent, activityUserId, activityDateFrom, activityDateTo ]); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ setMailPage(1); }, [ mailEvent, mailDateFrom, mailDateTo ]); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ setNotifLogsPage(1); }, [ notifLogsType, notifLogsDateFrom, notifLogsDateTo ]); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!isAdmin || tab !== 'plans') return; _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminPlans */ .OX().then(setPlanRows).catch(()=>{}); }, [ isAdmin, tab ]); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!isAdmin || tab !== 'translations') return; setTransStatsLoading(true); _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getTranslationsStats */ .YQ().then((d)=>setTransStats(d.tables)).catch(()=>{}).finally(()=>setTransStatsLoading(false)); }, [ isAdmin, tab ]); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!isAdmin || tab !== 'backup') return; (0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .request */ .Em)('/admin/backup/settings').then((d)=>setBackupAutoEnabled(!!d.autoEnabled)).catch(()=>{}); setBackupTablesLoading(true); (0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .request */ .Em)('/admin/backup/tables').then((d)=>setBackupTables(d.tables || [])).catch(()=>{}).finally(()=>setBackupTablesLoading(false)); (0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .request */ .Em)('/admin/backup/list').then((d)=>setBackupStoredFiles(d.files || [])).catch(()=>{}); }, [ isAdmin, tab ]); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!isAdmin || tab !== 'referrals') return; setReferralsLoading(true); _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminReferrals */ .cJ().then((d)=>setReferralsData(d)).catch(()=>{}).finally(()=>setReferralsLoading(false)); }, [ isAdmin, tab ]); // Load plans when users tab opens (for plan selector in edit modal) (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!isAdmin || tab !== 'users') return; if (planRows.length === 0) _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminPlans */ .OX().then(setPlanRows).catch(()=>{}); }, [ isAdmin, tab ]); // Reset page when filters change (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ setUsersPage(1); }, [ usersQ, usersRole ]); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ setTasksPage(1); }, [ tasksQ, tasksStatus ]); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ setBalancePage(1); }, [ balanceUserId, balanceKind ]); async function sendAdminPush() { if (!pushTitle.trim()) return; if (pushMode === 'user' && !pushTargetUserId.trim()) { setPushError('УкажОте ID пПльзПвателя'); return; } setPushSending(true); setPushError(null); setPushResult(null); try { const payload = { title: pushTitle.trim(), body: pushBody.trim() || undefined, type: pushType.trim() || undefined, referenceId: pushReferenceId.trim() || undefined }; if (pushMode === 'broadcast') { const res = await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .adminBroadcastPush */ .V7({ ...payload, onlyActive: pushOnlyActive }); setPushResult(res); } else { const res = await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .adminSendPushToUser */ .g1(pushTargetUserId.trim(), payload); setPushResult(res); } } catch (err) { setPushError((err === null || err === void 0 ? void 0 : err.message) || 'Не уЎалПсь ПтправОть push'); } finally{ setPushSending(false); } } async function toggleUser(id, isActive) { const fn = isActive ? _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .deactivateUser */ .Wi : _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .activateUser */ .He; const updated = await fn(id).catch(()=>null); if (updated) setUsers((prev)=>prev.map((u)=>u.id === id ? updated : u)); } async function changeRole(id, role) { const updated = await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .changeUserRole */ .Mm(id, role).catch(()=>null); if (updated) setUsers((prev)=>prev.map((u)=>u.id === id ? updated : u)); } function openEditUser(u) { setEditUserTab('profile'); setSkillInput(''); setBalanceModal(null); setEditUserCards([]); setCardSkillInputs({}); setCardSaving({}); setCardCatSelects({}); setCardLocSelects({}); setEditUser({ ...u, topUpAmount: '', topUpDescription: '', withdrawAmount: '', withdrawDescription: '' }); _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminUser */ .jd(u.id).then((fresh)=>setEditUser((prev)=>prev && prev.id === fresh.id ? { ...fresh, topUpAmount: '', topUpDescription: '', withdrawAmount: '', withdrawDescription: '' } : prev)).catch(()=>{}); } function describeFcmFailure(key, message) { if (!key) return message || 'FCM прОМял 0 сППбщеМОй'; if (key === 'THIRD_PARTY_AUTH_ERROR') { return 'ОшОбка APNs/Firebase iOS: прПверьте Apple APNs Auth Key (.p8) О связку Firebase прПекта Ўля iOS-прОлПжеМОя'; } if (key === 'UNREGISTERED') { return 'ТПкеМ устрПйства бПльше Ме валОЎеМ'; } if (key === 'INVALID_ARGUMENT') { return 'НекПрректМый тПкеМ ОлО payload'; } if (key === 'REQUEST_FAILED') { return message || 'FCM request failed before response'; } return message ? "".concat(key, ": ").concat(message) : key; } async function saveEditUser() { if (!editUser) return; setEditUserSaving(true); try { var _editUser_languages, _editUser_showContactInfo, _editUser_notifyNewTasks, _editUser_notifMessages, _editUser_skills, _editUser_siteSettings; const updated = await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updateAdminUser */ .wl(editUser.id, { firstName: editUser.firstName, lastName: editUser.lastName, phone: editUser.phone || null, bio: editUser.bio || null, role: editUser.role, planId: editUser.planId || null, isActive: editUser.isActive, locale: editUser.locale, languages: (_editUser_languages = editUser.languages) !== null && _editUser_languages !== void 0 ? _editUser_languages : [], personalSiteSlug: editUser.personalSiteSlug || null, showContactInfo: (_editUser_showContactInfo = editUser.showContactInfo) !== null && _editUser_showContactInfo !== void 0 ? _editUser_showContactInfo : false, notifyNewTasks: (_editUser_notifyNewTasks = editUser.notifyNewTasks) !== null && _editUser_notifyNewTasks !== void 0 ? _editUser_notifyNewTasks : false, notifMessages: (_editUser_notifMessages = editUser.notifMessages) !== null && _editUser_notifMessages !== void 0 ? _editUser_notifMessages : true, skills: (_editUser_skills = editUser.skills) !== null && _editUser_skills !== void 0 ? _editUser_skills : [], siteSettings: (_editUser_siteSettings = editUser.siteSettings) !== null && _editUser_siteSettings !== void 0 ? _editUser_siteSettings : {} }); await Promise.all(editUserCards.map((card)=>{ var _card_skills, _card_categories, _card_locations; return _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .adminUpdateSpecialistCard */ .oq(card.id, { title: card.title, description: card.description || null, skills: (_card_skills = card.skills) !== null && _card_skills !== void 0 ? _card_skills : [], categories: (_card_categories = card.categories) !== null && _card_categories !== void 0 ? _card_categories : [], locations: (_card_locations = card.locations) !== null && _card_locations !== void 0 ? _card_locations : [], publicationStatus: card.publicationStatus, isActive: card.isActive }).catch(()=>null); })); setUsers((prev)=>prev.map((u)=>u.id === editUser.id ? updated : u)); setEditUser(null); } catch (e) {} finally{ setEditUserSaving(false); } } async function verifyEmail() { if (!editUser) return; setVerifyingEmail(true); try { const updated = await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .verifyAdminUserEmail */ .uQ(editUser.id); setEditUser((u)=>u ? { ...u, emailVerified: updated.emailVerified } : u); setUsers((prev)=>prev.map((u)=>u.id === editUser.id ? { ...u, emailVerified: updated.emailVerified } : u)); } catch (e) {} finally{ setVerifyingEmail(false); } } async function handleAdminTopUp() { if (!editUser) return; const amount = Number(editUser.topUpAmount); if (!amount || amount <= 0) return; setTopUpSaving(true); try { const result = await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .adminTopUpUserBalance */ .P0(editUser.id, { amount, description: editUser.topUpDescription || undefined }); setUsers((prev)=>prev.map((u)=>u.id === editUser.id ? result.user : u)); setEditUser((prev)=>prev ? { ...prev, ...result.user, topUpAmount: '', topUpDescription: '' } : prev); if (tab === 'balances') { _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminBalanceHistory */ .g0({ page: balancePage, userId: balanceUserId || undefined, kind: balanceKind || undefined }).then((d)=>{ setBalanceRows(d.data); setBalanceTotal(d.total); }).catch(()=>{}); } } catch (e) { // ignore } finally{ setTopUpSaving(false); } } async function handleAdminWithdraw() { if (!editUser) return; const amount = Number(editUser.withdrawAmount); if (!amount || amount <= 0) return; setWithdrawSaving(true); try { const result = await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .adminWithdrawUserBalance */ .hD(editUser.id, { amount, description: editUser.withdrawDescription || undefined }); setUsers((prev)=>prev.map((u)=>u.id === editUser.id ? result.user : u)); setEditUser((prev)=>prev ? { ...prev, ...result.user, withdrawAmount: '', withdrawDescription: '' } : prev); if (tab === 'balances') { _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminBalanceHistory */ .g0({ page: balancePage, userId: balanceUserId || undefined, kind: balanceKind || undefined }).then((d)=>{ setBalanceRows(d.data); setBalanceTotal(d.total); }).catch(()=>{}); } } catch (e) { // ignore } finally{ setWithdrawSaving(false); } } async function saveCard(cardId) { const card = editUserCards.find((c)=>c.id === cardId); if (!card) return; setCardSaving((prev)=>({ ...prev, [cardId]: true })); try { var _card_skills, _card_categories, _card_locations; const updated = await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .adminUpdateSpecialistCard */ .oq(cardId, { title: card.title, description: card.description || null, skills: (_card_skills = card.skills) !== null && _card_skills !== void 0 ? _card_skills : [], categories: (_card_categories = card.categories) !== null && _card_categories !== void 0 ? _card_categories : [], locations: (_card_locations = card.locations) !== null && _card_locations !== void 0 ? _card_locations : [], publicationStatus: card.publicationStatus, isActive: card.isActive }); setEditUserCards((prev)=>prev.map((c)=>c.id === cardId ? updated : c)); } catch (e) {} finally{ setCardSaving((prev)=>({ ...prev, [cardId]: false })); } } async function updateModerationCard(cardId, publicationStatus) { const updated = await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .adminUpdateSpecialistCard */ .oq(cardId, { publicationStatus, isActive: publicationStatus === 'active' }).catch(()=>null); if (!updated) return; setModerationCards((prev)=>prev.map((card)=>card.id === cardId ? updated : card)); if ((editUser === null || editUser === void 0 ? void 0 : editUser.id) === updated.specialistId) { setEditUserCards((prev)=>prev.map((card)=>card.id === cardId ? updated : card)); } _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminReports */ .z5(1, 'pending').then((d)=>setPendingReportsCount(d.total)).catch(()=>{}); _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminSpecialistCards */ .s_(1, 'pending').then((d)=>setPendingCardsCount(d.total)).catch(()=>{}); } async function cancelTask(id) { const updated = await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .cancelTaskAdmin */ .nf(id).catch(()=>null); if (updated) { const task = updated.task || updated; setTasks((prev)=>prev.map((row)=>{ const t = row.task || row; return t.id === id ? { ...row, task: task } : row; })); } } async function deleteTask(id, title) { if (!window.confirm("".concat(t('admin.tasks.delete.confirm'), '\n"').concat(title, '"'))) return; const ok = await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .deleteTaskAdmin */ .GB(id).catch(()=>null); if (ok) setTasks((prev)=>prev.filter((row)=>{ var _row_task; return (((_row_task = row.task) === null || _row_task === void 0 ? void 0 : _row_task.id) || row.id) !== id; })); } async function handleReport(id, status) { const updated = await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updateReportStatus */ .eU(id, status).catch(()=>null); if (updated) setReports((prev)=>prev.map((r)=>r.id === id ? { ...r, ...updated } : r)); } // Locations (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!isAdmin || tab !== 'locations') return; _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminLocations */ .k_().then(setLocRows).catch(()=>{}); }, [ isAdmin, tab ]); function openAddLoc(parentId) { setLocForm({ parentId: parentId !== null && parentId !== void 0 ? parentId : null, slug: '', nameEl: '', nameEn: '', nameRu: '', nameUk: '', order: 0, isActive: true }); } function openEditLoc(loc) { var _loc_names, _loc_names1, _loc_names2, _loc_names3; var _loc_parentId, _loc_nameEl, _ref, _loc_nameEn, _ref1, _loc_nameRu, _ref2, _loc_nameUk, _ref3, _loc_order, _loc_isActive; setLocForm({ id: loc.id, parentId: (_loc_parentId = loc.parentId) !== null && _loc_parentId !== void 0 ? _loc_parentId : null, slug: loc.slug, nameEl: (_ref = (_loc_nameEl = loc.nameEl) !== null && _loc_nameEl !== void 0 ? _loc_nameEl : (_loc_names = loc.names) === null || _loc_names === void 0 ? void 0 : _loc_names.el) !== null && _ref !== void 0 ? _ref : '', nameEn: (_ref1 = (_loc_nameEn = loc.nameEn) !== null && _loc_nameEn !== void 0 ? _loc_nameEn : (_loc_names1 = loc.names) === null || _loc_names1 === void 0 ? void 0 : _loc_names1.en) !== null && _ref1 !== void 0 ? _ref1 : '', nameRu: (_ref2 = (_loc_nameRu = loc.nameRu) !== null && _loc_nameRu !== void 0 ? _loc_nameRu : (_loc_names2 = loc.names) === null || _loc_names2 === void 0 ? void 0 : _loc_names2.ru) !== null && _ref2 !== void 0 ? _ref2 : '', nameUk: (_ref3 = (_loc_nameUk = loc.nameUk) !== null && _loc_nameUk !== void 0 ? _loc_nameUk : (_loc_names3 = loc.names) === null || _loc_names3 === void 0 ? void 0 : _loc_names3.uk) !== null && _ref3 !== void 0 ? _ref3 : '', order: (_loc_order = loc.order) !== null && _loc_order !== void 0 ? _loc_order : 0, isActive: (_loc_isActive = loc.isActive) !== null && _loc_isActive !== void 0 ? _loc_isActive : true }); } async function saveLoc() { if (!locForm) return; setLocSaving(true); try { if (locForm.id) { const updated = await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updateLocation */ .Nt(locForm.id, locForm); setLocRows((prev)=>prev.map((r)=>r.id === locForm.id ? updated : r)); } else { const created = await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .createLocation */ .yJ({ slug: locForm.slug, nameEl: locForm.nameEl, nameEn: locForm.nameEn, nameRu: locForm.nameRu, nameUk: locForm.nameUk, parentId: locForm.parentId, order: locForm.order }); setLocRows((prev)=>[ ...prev, created ]); } setLocForm(null); } catch (e) { // ignore } finally{ setLocSaving(false); } } async function deleteLoc(id, name) { if (!window.confirm("".concat(t('admin.loc.delete.confirm'), '\n"').concat(name, '"'))) return; const ok = await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .deleteLocation */ .zR(id).catch(()=>null); if (ok) setLocRows((prev)=>prev.filter((r)=>r.id !== id)); } function toggleLocExpand(id) { setLocExpanded((prev)=>{ const next = new Set(prev); next.has(id) ? next.delete(id) : next.add(id); return next; }); } // Categories (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!isAdmin || tab !== 'categories') return; _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminCategories */ .KD().then(setCatRows).catch(()=>{}); }, [ isAdmin, tab ]); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!isAdmin) return; fetch('/category-icons/presets.json').then((res)=>res.ok ? res.json() : Promise.reject(new Error('Failed to load presets'))).then((data)=>{ if (!Array.isArray(data)) return; const cleaned = data.filter((x)=>!!x && typeof x === 'object' && typeof x.value === 'string' && typeof x.label === 'string').filter((x)=>x.value.startsWith('/category-icons/')); if (cleaned.length > 0) setCategoryIconPresets(cleaned); }).catch(()=>{}); }, [ isAdmin ]); function openAddCat(parentId) { setCatIconError(null); setCatForm({ parentId: parentId !== null && parentId !== void 0 ? parentId : null, slug: '', icon: '/category-icons/package.svg', namesEl: '', namesEn: '', namesRu: '', namesUk: '', order: 0, isActive: true }); } function openEditCat(cat) { var _cat_names, _cat_names1, _cat_names2, _cat_names3; const selectedIcon = typeof cat.icon === 'string' ? cat.icon : ''; const knownPreset = new Set(categoryIconPresets.map((p)=>p.value)); const normalizedIcon = selectedIcon.startsWith('/category-icons/') && !knownPreset.has(selectedIcon) ? '/category-icons/package.svg' : selectedIcon || '/category-icons/package.svg'; setCatIconError(null); var _cat_parentId, _cat_namesEl, _ref, _cat_namesEn, _ref1, _cat_namesRu, _ref2, _cat_namesUk, _ref3, _cat_order, _cat_isActive; setCatForm({ id: cat.id, parentId: (_cat_parentId = cat.parentId) !== null && _cat_parentId !== void 0 ? _cat_parentId : null, slug: cat.slug, icon: normalizedIcon, namesEl: (_ref = (_cat_namesEl = cat.namesEl) !== null && _cat_namesEl !== void 0 ? _cat_namesEl : (_cat_names = cat.names) === null || _cat_names === void 0 ? void 0 : _cat_names.el) !== null && _ref !== void 0 ? _ref : '', namesEn: (_ref1 = (_cat_namesEn = cat.namesEn) !== null && _cat_namesEn !== void 0 ? _cat_namesEn : (_cat_names1 = cat.names) === null || _cat_names1 === void 0 ? void 0 : _cat_names1.en) !== null && _ref1 !== void 0 ? _ref1 : '', namesRu: (_ref2 = (_cat_namesRu = cat.namesRu) !== null && _cat_namesRu !== void 0 ? _cat_namesRu : (_cat_names2 = cat.names) === null || _cat_names2 === void 0 ? void 0 : _cat_names2.ru) !== null && _ref2 !== void 0 ? _ref2 : '', namesUk: (_ref3 = (_cat_namesUk = cat.namesUk) !== null && _cat_namesUk !== void 0 ? _cat_namesUk : (_cat_names3 = cat.names) === null || _cat_names3 === void 0 ? void 0 : _cat_names3.uk) !== null && _ref3 !== void 0 ? _ref3 : '', order: (_cat_order = cat.order) !== null && _cat_order !== void 0 ? _cat_order : 0, isActive: (_cat_isActive = cat.isActive) !== null && _cat_isActive !== void 0 ? _cat_isActive : true }); } async function uploadCategoryIcon(file) { if (file.type !== 'image/svg+xml') { setCatIconError('Only SVG files are allowed'); return; } setCatIconUploading(true); setCatIconError(null); try { const fd = new FormData(); fd.append('file', file); const base = "https://api.canhelp.gr" || 0; const res = await fetch("".concat(base, "/api/uploads"), { method: 'POST', credentials: 'include', body: fd }); if (!res.ok) { const err = await res.json().catch(()=>({ error: 'Upload failed' })); throw new Error(err.error || 'Upload failed'); } const data = await res.json(); setCatForm((f)=>f ? { ...f, icon: data.url } : f); } catch (err) { setCatIconError((err === null || err === void 0 ? void 0 : err.message) || 'Upload failed'); } finally{ setCatIconUploading(false); } } async function saveCat() { if (!catForm) return; setCatSaving(true); try { if (catForm.id) { const updated = await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updateCategory */ .$7(catForm.id, catForm); setCatRows((prev)=>prev.map((r)=>r.id === catForm.id ? updated : r)); } else { const created = await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .createCategory */ .zZ({ slug: catForm.slug, icon: catForm.icon, namesEl: catForm.namesEl, namesEn: catForm.namesEn, namesRu: catForm.namesRu, namesUk: catForm.namesUk, parentId: catForm.parentId, order: catForm.order }); setCatRows((prev)=>[ ...prev, created ]); } setCatForm(null); } catch (e) { // ignore } finally{ setCatSaving(false); } } async function deleteCat(id, name) { if (!window.confirm("".concat(t('admin.cat.delete.confirm'), '\n"').concat(name, '"'))) return; const ok = await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .deleteCategory */ .K7(id).catch(()=>null); if (ok) setCatRows((prev)=>prev.filter((r)=>r.id !== id)); } function toggleCatExpand(id) { setCatExpanded((prev)=>{ const next = new Set(prev); next.has(id) ? next.delete(id) : next.add(id); return next; }); } async function toggleCatSkills(cat) { const id = cat.id; const slug = cat.slug; setCatSkillsExpanded((prev)=>{ const next = new Set(prev); if (next.has(id)) { next.delete(id); return next; } next.add(id); return next; }); if (!catSkillsCache[slug]) { setCatSkillsLoading((prev)=>new Set(prev).add(id)); try { const skills = await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminSkills */ .i_(slug); setCatSkillsCache((prev)=>({ ...prev, [slug]: skills })); } catch (e) {} finally{ setCatSkillsLoading((prev)=>{ const n = new Set(prev); n.delete(id); return n; }); } } } function openAddSkill(catSlug) { setSkillForm({ catSlug, nameEl: '', nameEn: '', nameRu: '', nameUk: '', order: 0 }); } function openEditSkill(skill, catSlug) { var _skill_nameEl, _skill_nameEn, _skill_nameRu, _skill_nameUk, _skill_order; setSkillForm({ id: skill.id, catSlug, nameEl: (_skill_nameEl = skill.nameEl) !== null && _skill_nameEl !== void 0 ? _skill_nameEl : '', nameEn: (_skill_nameEn = skill.nameEn) !== null && _skill_nameEn !== void 0 ? _skill_nameEn : '', nameRu: (_skill_nameRu = skill.nameRu) !== null && _skill_nameRu !== void 0 ? _skill_nameRu : '', nameUk: (_skill_nameUk = skill.nameUk) !== null && _skill_nameUk !== void 0 ? _skill_nameUk : '', order: (_skill_order = skill.order) !== null && _skill_order !== void 0 ? _skill_order : 0 }); } async function saveSkill() { if (!skillForm) return; setSkillSaving(true); try { if (skillForm.id) { const updated = await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updateSkill */ .fP(skillForm.id, { nameEl: skillForm.nameEl, nameEn: skillForm.nameEn, nameRu: skillForm.nameRu, nameUk: skillForm.nameUk, order: skillForm.order }); setCatSkillsCache((prev)=>{ var _prev_skillForm_catSlug; return { ...prev, [skillForm.catSlug]: ((_prev_skillForm_catSlug = prev[skillForm.catSlug]) !== null && _prev_skillForm_catSlug !== void 0 ? _prev_skillForm_catSlug : []).map((s)=>s.id === skillForm.id ? updated : s) }; }); } else { const created = await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .createSkill */ .S9({ categorySlug: skillForm.catSlug, nameEl: skillForm.nameEl, nameEn: skillForm.nameEn, nameRu: skillForm.nameRu, nameUk: skillForm.nameUk, order: skillForm.order }); setCatSkillsCache((prev)=>{ var _prev_skillForm_catSlug; return { ...prev, [skillForm.catSlug]: [ ...(_prev_skillForm_catSlug = prev[skillForm.catSlug]) !== null && _prev_skillForm_catSlug !== void 0 ? _prev_skillForm_catSlug : [], created ] }; }); } setSkillForm(null); } catch (e) {} finally{ setSkillSaving(false); } } async function deleteSkill(skill, catSlug) { if (!skill._skipConfirm && !window.confirm('УЎалОть Мавык "'.concat(skill.nameEl, '"?'))) return; const ok = skill._skipConfirm ? true : await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .deleteSkill */ .hp(skill.id).catch(()=>null); if (ok) { setCatSkillsCache((prev)=>{ var _prev_catSlug; return { ...prev, [catSlug]: ((_prev_catSlug = prev[catSlug]) !== null && _prev_catSlug !== void 0 ? _prev_catSlug : []).filter((s)=>s.id !== skill.id) }; }); } } function openAddPlan() { setPlanForm({ 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: false, isActive: true, order: 0, notifyNewTasks: false, canContactFreePlan: false, canContactProPlan: true, canContactAll: false, canShowContactInfo: false, canViewPhone: false, canUploadVideo: false, hasFavorites: false, hasGoogleCalendar: false, hasVerifiedBadge: false, highlightedReviews: false, hasPersonalSite: false, hasCanHelpNowStatus: false, hasNeedHelpStatus: false, hasAutoResponse: false, hasAutoMatch: false, hasPriceList: false, receiveInstantDispatchFree: false, receiveInstantDispatchPro: false }); } function openEditPlan(plan) { var _plan_description, _plan_role, _plan_tier, _plan_price, _plan_oldPrice, _plan_currency, _plan_searchBoost, _plan_offersMultiplier, _plan_features, _plan_isDefault, _plan_isActive, _plan_order, _plan_notifyNewTasks, _plan_canContactFreePlan, _plan_canContactProPlan, _plan_canContactAll, _plan_canShowContactInfo, _plan_canViewPhone, _plan_canUploadVideo, _plan_hasFavorites, _plan_hasGoogleCalendar, _plan_hasVerifiedBadge, _plan_highlightedReviews, _plan_hasPersonalSite, _plan_hasCanHelpNowStatus, _plan_hasNeedHelpStatus, _plan_hasAutoResponse, _plan_hasAutoMatch, _plan_hasPriceList, _plan_receiveInstantDispatchFree, _plan_receiveInstantDispatchPro; setPlanForm({ id: plan.id, name: plan.name, description: (_plan_description = plan.description) !== null && _plan_description !== void 0 ? _plan_description : '', role: (_plan_role = plan.role) !== null && _plan_role !== void 0 ? _plan_role : 'customer', tier: (_plan_tier = plan.tier) !== null && _plan_tier !== void 0 ? _plan_tier : 'free', price: (_plan_price = plan.price) !== null && _plan_price !== void 0 ? _plan_price : '0', oldPrice: (_plan_oldPrice = plan.oldPrice) !== null && _plan_oldPrice !== void 0 ? _plan_oldPrice : '', currency: (_plan_currency = plan.currency) !== null && _plan_currency !== void 0 ? _plan_currency : 'EUR', maxTasks: plan.maxTasks != null ? String(plan.maxTasks) : '', maxOffers: plan.maxOffers != null ? String(plan.maxOffers) : '', maxCards: plan.maxCards != null ? String(plan.maxCards) : '', maxMessagesPerDay: plan.maxMessagesPerDay != null ? String(plan.maxMessagesPerDay) : '', maxOrdersPerDay: plan.maxOrdersPerDay != null ? String(plan.maxOrdersPerDay) : '', maxSkills: plan.maxSkills != null ? String(plan.maxSkills) : '', durationDays: plan.durationDays != null ? String(plan.durationDays) : '', searchBoost: (_plan_searchBoost = plan.searchBoost) !== null && _plan_searchBoost !== void 0 ? _plan_searchBoost : 0, offersMultiplier: (_plan_offersMultiplier = plan.offersMultiplier) !== null && _plan_offersMultiplier !== void 0 ? _plan_offersMultiplier : '1.00', features: ((_plan_features = plan.features) !== null && _plan_features !== void 0 ? _plan_features : []).join('\n'), isDefault: (_plan_isDefault = plan.isDefault) !== null && _plan_isDefault !== void 0 ? _plan_isDefault : false, isActive: (_plan_isActive = plan.isActive) !== null && _plan_isActive !== void 0 ? _plan_isActive : true, order: (_plan_order = plan.order) !== null && _plan_order !== void 0 ? _plan_order : 0, notifyNewTasks: (_plan_notifyNewTasks = plan.notifyNewTasks) !== null && _plan_notifyNewTasks !== void 0 ? _plan_notifyNewTasks : false, canContactFreePlan: (_plan_canContactFreePlan = plan.canContactFreePlan) !== null && _plan_canContactFreePlan !== void 0 ? _plan_canContactFreePlan : false, canContactProPlan: (_plan_canContactProPlan = plan.canContactProPlan) !== null && _plan_canContactProPlan !== void 0 ? _plan_canContactProPlan : true, canContactAll: (_plan_canContactAll = plan.canContactAll) !== null && _plan_canContactAll !== void 0 ? _plan_canContactAll : false, canShowContactInfo: (_plan_canShowContactInfo = plan.canShowContactInfo) !== null && _plan_canShowContactInfo !== void 0 ? _plan_canShowContactInfo : false, canViewPhone: (_plan_canViewPhone = plan.canViewPhone) !== null && _plan_canViewPhone !== void 0 ? _plan_canViewPhone : false, canUploadVideo: (_plan_canUploadVideo = plan.canUploadVideo) !== null && _plan_canUploadVideo !== void 0 ? _plan_canUploadVideo : false, hasFavorites: (_plan_hasFavorites = plan.hasFavorites) !== null && _plan_hasFavorites !== void 0 ? _plan_hasFavorites : false, hasGoogleCalendar: (_plan_hasGoogleCalendar = plan.hasGoogleCalendar) !== null && _plan_hasGoogleCalendar !== void 0 ? _plan_hasGoogleCalendar : false, hasVerifiedBadge: (_plan_hasVerifiedBadge = plan.hasVerifiedBadge) !== null && _plan_hasVerifiedBadge !== void 0 ? _plan_hasVerifiedBadge : false, highlightedReviews: (_plan_highlightedReviews = plan.highlightedReviews) !== null && _plan_highlightedReviews !== void 0 ? _plan_highlightedReviews : false, hasPersonalSite: (_plan_hasPersonalSite = plan.hasPersonalSite) !== null && _plan_hasPersonalSite !== void 0 ? _plan_hasPersonalSite : false, hasCanHelpNowStatus: (_plan_hasCanHelpNowStatus = plan.hasCanHelpNowStatus) !== null && _plan_hasCanHelpNowStatus !== void 0 ? _plan_hasCanHelpNowStatus : false, hasNeedHelpStatus: (_plan_hasNeedHelpStatus = plan.hasNeedHelpStatus) !== null && _plan_hasNeedHelpStatus !== void 0 ? _plan_hasNeedHelpStatus : false, hasAutoResponse: (_plan_hasAutoResponse = plan.hasAutoResponse) !== null && _plan_hasAutoResponse !== void 0 ? _plan_hasAutoResponse : false, hasAutoMatch: (_plan_hasAutoMatch = plan.hasAutoMatch) !== null && _plan_hasAutoMatch !== void 0 ? _plan_hasAutoMatch : false, hasPriceList: (_plan_hasPriceList = plan.hasPriceList) !== null && _plan_hasPriceList !== void 0 ? _plan_hasPriceList : false, receiveInstantDispatchFree: (_plan_receiveInstantDispatchFree = plan.receiveInstantDispatchFree) !== null && _plan_receiveInstantDispatchFree !== void 0 ? _plan_receiveInstantDispatchFree : false, receiveInstantDispatchPro: (_plan_receiveInstantDispatchPro = plan.receiveInstantDispatchPro) !== null && _plan_receiveInstantDispatchPro !== void 0 ? _plan_receiveInstantDispatchPro : false }); } async function savePlan() { if (!planForm) return; setPlanSaving(true); try { const payload = { name: planForm.name, description: planForm.description || undefined, role: planForm.role, tier: planForm.tier, price: planForm.price, oldPrice: planForm.oldPrice || null, currency: planForm.currency, maxTasks: planForm.maxTasks ? Number(planForm.maxTasks) : null, maxOffers: planForm.maxOffers ? Number(planForm.maxOffers) : null, maxCards: planForm.maxCards ? Number(planForm.maxCards) : null, maxMessagesPerDay: planForm.maxMessagesPerDay ? Number(planForm.maxMessagesPerDay) : null, maxOrdersPerDay: planForm.maxOrdersPerDay ? Number(planForm.maxOrdersPerDay) : null, maxSkills: planForm.maxSkills ? Number(planForm.maxSkills) : null, durationDays: planForm.durationDays ? Number(planForm.durationDays) : null, notifyNewTasks: planForm.notifyNewTasks, searchBoost: planForm.searchBoost, offersMultiplier: planForm.offersMultiplier, canContactFreePlan: planForm.canContactFreePlan, canContactProPlan: planForm.canContactProPlan, canContactAll: planForm.canContactAll, canShowContactInfo: planForm.canShowContactInfo, canViewPhone: planForm.canViewPhone, canUploadVideo: planForm.canUploadVideo, hasFavorites: planForm.hasFavorites, hasGoogleCalendar: planForm.hasGoogleCalendar, hasVerifiedBadge: planForm.hasVerifiedBadge, highlightedReviews: planForm.highlightedReviews, hasPersonalSite: planForm.hasPersonalSite, hasCanHelpNowStatus: planForm.hasCanHelpNowStatus, hasNeedHelpStatus: planForm.hasNeedHelpStatus, hasAutoResponse: planForm.hasAutoResponse, hasAutoMatch: planForm.hasAutoMatch, hasPriceList: planForm.hasPriceList, receiveInstantDispatchFree: planForm.receiveInstantDispatchFree, receiveInstantDispatchPro: planForm.receiveInstantDispatchPro, features: planForm.features ? planForm.features.split('\n').map((s)=>s.trim()).filter(Boolean) : [], isDefault: planForm.isDefault, isActive: planForm.isActive, order: planForm.order }; if (planForm.id) { const updated = await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updatePlan */ .td(planForm.id, payload); setPlanRows((prev)=>prev.map((r)=>r.id === planForm.id ? updated : r)); } else { const created = await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .createPlan */ .qT(payload); setPlanRows((prev)=>[ ...prev, created ]); } // If set as default — refresh all to sync isDefault flags if (planForm.isDefault) { _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminPlans */ .OX().then(setPlanRows).catch(()=>{}); } setPlanForm(null); } catch (e) { // ignore } finally{ setPlanSaving(false); } } async function deletePlan(id, name) { if (!window.confirm('Delete plan "'.concat(name, '"?'))) return; const ok = await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .deletePlan */ .bR(id).catch(()=>null); if (ok) setPlanRows((prev)=>prev.filter((r)=>r.id !== id)); } // Settings (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!isAdmin || tab !== 'settings') return; if (planRows.length === 0) _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminPlans */ .OX().then(setPlanRows).catch(()=>{}); _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminSettings */ .rC().then((kv)=>{ var _kv_generalsiteName, _kv_generalsiteUrl, _kv_generalcontactEmail, _kv_generalsupportPhone; setGeneralForm({ siteName: (_kv_generalsiteName = kv['general.siteName']) !== null && _kv_generalsiteName !== void 0 ? _kv_generalsiteName : 'CanHelp', siteUrl: (_kv_generalsiteUrl = kv['general.siteUrl']) !== null && _kv_generalsiteUrl !== void 0 ? _kv_generalsiteUrl : '', contactEmail: (_kv_generalcontactEmail = kv['general.contactEmail']) !== null && _kv_generalcontactEmail !== void 0 ? _kv_generalcontactEmail : '', supportPhone: (_kv_generalsupportPhone = kv['general.supportPhone']) !== null && _kv_generalsupportPhone !== void 0 ? _kv_generalsupportPhone : '' }); var _kv_smtphost, _kv_smtpport, _kv_smtpusername, _kv_smtppassword, _kv_smtpfromName, _kv_smtpfromEmail, _kv_smtpencryption; setSmtpForm({ host: (_kv_smtphost = kv['smtp.host']) !== null && _kv_smtphost !== void 0 ? _kv_smtphost : '', port: (_kv_smtpport = kv['smtp.port']) !== null && _kv_smtpport !== void 0 ? _kv_smtpport : '587', username: (_kv_smtpusername = kv['smtp.username']) !== null && _kv_smtpusername !== void 0 ? _kv_smtpusername : '', password: (_kv_smtppassword = kv['smtp.password']) !== null && _kv_smtppassword !== void 0 ? _kv_smtppassword : '', fromName: (_kv_smtpfromName = kv['smtp.fromName']) !== null && _kv_smtpfromName !== void 0 ? _kv_smtpfromName : 'CanHelp', fromEmail: (_kv_smtpfromEmail = kv['smtp.fromEmail']) !== null && _kv_smtpfromEmail !== void 0 ? _kv_smtpfromEmail : '', encryption: (_kv_smtpencryption = kv['smtp.encryption']) !== null && _kv_smtpencryption !== void 0 ? _kv_smtpencryption : 'tls' }); var _kv_paymentepaymerchantId, _kv_paymentepayapiUser, _kv_paymentepayapiPassword, _kv_paymentepayenvironment, _kv_paymentepayconfirmationUrl, _kv_paymentepaycancelUrl; setEPayForm({ merchantId: (_kv_paymentepaymerchantId = kv['payment.epay.merchantId']) !== null && _kv_paymentepaymerchantId !== void 0 ? _kv_paymentepaymerchantId : '', apiUser: (_kv_paymentepayapiUser = kv['payment.epay.apiUser']) !== null && _kv_paymentepayapiUser !== void 0 ? _kv_paymentepayapiUser : '', apiPassword: (_kv_paymentepayapiPassword = kv['payment.epay.apiPassword']) !== null && _kv_paymentepayapiPassword !== void 0 ? _kv_paymentepayapiPassword : '', environment: (_kv_paymentepayenvironment = kv['payment.epay.environment']) !== null && _kv_paymentepayenvironment !== void 0 ? _kv_paymentepayenvironment : 'test', confirmationUrl: (_kv_paymentepayconfirmationUrl = kv['payment.epay.confirmationUrl']) !== null && _kv_paymentepayconfirmationUrl !== void 0 ? _kv_paymentepayconfirmationUrl : '', cancelUrl: (_kv_paymentepaycancelUrl = kv['payment.epay.cancelUrl']) !== null && _kv_paymentepaycancelUrl !== void 0 ? _kv_paymentepaycancelUrl : '', enabled: kv['payment.epay.enabled'] === 'true' }); var _kv_referral_plan_id, _ref, _ref1, _kv_referral_days, _ref2, _ref3; setReferralForm({ enabled: kv['referral_enabled'] === 'true', planId: (_ref1 = (_ref = (_kv_referral_plan_id = kv['referral_plan_id']) !== null && _kv_referral_plan_id !== void 0 ? _kv_referral_plan_id : kv['referral_customer_plan_id']) !== null && _ref !== void 0 ? _ref : kv['referral_specialist_plan_id']) !== null && _ref1 !== void 0 ? _ref1 : '', days: (_ref3 = (_ref2 = (_kv_referral_days = kv['referral_days']) !== null && _kv_referral_days !== void 0 ? _kv_referral_days : kv['referral_customer_days']) !== null && _ref2 !== void 0 ? _ref2 : kv['referral_specialist_days']) !== null && _ref3 !== void 0 ? _ref3 : '30' }); var _kv_seoheadScripts, _kv_seositeTitleel, _ref4, _kv_seositeTitleen, _kv_seositeTitleru, _kv_seositeTitleuk, _kv_seositeDescriptionel, _ref5, _kv_seositeDescriptionen, _kv_seositeDescriptionru, _kv_seositeDescriptionuk; setSeoForm({ maintenanceMode: kv['seo.maintenanceMode'] === 'true', indexingEnabled: kv['seo.indexingEnabled'] !== 'false', headScripts: (_kv_seoheadScripts = kv['seo.headScripts']) !== null && _kv_seoheadScripts !== void 0 ? _kv_seoheadScripts : '', siteTitleEl: (_ref4 = (_kv_seositeTitleel = kv['seo.siteTitle.el']) !== null && _kv_seositeTitleel !== void 0 ? _kv_seositeTitleel : kv['seo.siteTitle']) !== null && _ref4 !== void 0 ? _ref4 : '', siteTitleEn: (_kv_seositeTitleen = kv['seo.siteTitle.en']) !== null && _kv_seositeTitleen !== void 0 ? _kv_seositeTitleen : '', siteTitleRu: (_kv_seositeTitleru = kv['seo.siteTitle.ru']) !== null && _kv_seositeTitleru !== void 0 ? _kv_seositeTitleru : '', siteTitleUk: (_kv_seositeTitleuk = kv['seo.siteTitle.uk']) !== null && _kv_seositeTitleuk !== void 0 ? _kv_seositeTitleuk : '', siteDescriptionEl: (_ref5 = (_kv_seositeDescriptionel = kv['seo.siteDescription.el']) !== null && _kv_seositeDescriptionel !== void 0 ? _kv_seositeDescriptionel : kv['seo.siteDescription']) !== null && _ref5 !== void 0 ? _ref5 : '', siteDescriptionEn: (_kv_seositeDescriptionen = kv['seo.siteDescription.en']) !== null && _kv_seositeDescriptionen !== void 0 ? _kv_seositeDescriptionen : '', siteDescriptionRu: (_kv_seositeDescriptionru = kv['seo.siteDescription.ru']) !== null && _kv_seositeDescriptionru !== void 0 ? _kv_seositeDescriptionru : '', siteDescriptionUk: (_kv_seositeDescriptionuk = kv['seo.siteDescription.uk']) !== null && _kv_seositeDescriptionuk !== void 0 ? _kv_seositeDescriptionuk : '' }); var _kv_socialtelegram, _kv_socialinstagram, _kv_socialfacebook, _kv_socialtwitter, _kv_socialyoutube, _kv_socialtiktok, _kv_socialwhatsapp, _kv_socialviber; setSocialForm({ telegram: (_kv_socialtelegram = kv['social.telegram']) !== null && _kv_socialtelegram !== void 0 ? _kv_socialtelegram : '', instagram: (_kv_socialinstagram = kv['social.instagram']) !== null && _kv_socialinstagram !== void 0 ? _kv_socialinstagram : '', facebook: (_kv_socialfacebook = kv['social.facebook']) !== null && _kv_socialfacebook !== void 0 ? _kv_socialfacebook : '', twitter: (_kv_socialtwitter = kv['social.twitter']) !== null && _kv_socialtwitter !== void 0 ? _kv_socialtwitter : '', youtube: (_kv_socialyoutube = kv['social.youtube']) !== null && _kv_socialyoutube !== void 0 ? _kv_socialyoutube : '', tiktok: (_kv_socialtiktok = kv['social.tiktok']) !== null && _kv_socialtiktok !== void 0 ? _kv_socialtiktok : '', whatsapp: (_kv_socialwhatsapp = kv['social.whatsapp']) !== null && _kv_socialwhatsapp !== void 0 ? _kv_socialwhatsapp : '', viber: (_kv_socialviber = kv['social.viber']) !== null && _kv_socialviber !== void 0 ? _kv_socialviber : '' }); var _kv_telegrambotToken, _kv_telegramadminChatId, _kv_telegramchannelIdel, _kv_telegramchannelIden, _kv_telegramchannelIdru, _kv_telegramchannelIduk; setTelegramForm({ botToken: (_kv_telegrambotToken = kv['telegram.botToken']) !== null && _kv_telegrambotToken !== void 0 ? _kv_telegrambotToken : '', adminChatId: (_kv_telegramadminChatId = kv['telegram.adminChatId']) !== null && _kv_telegramadminChatId !== void 0 ? _kv_telegramadminChatId : '', channelIdEl: (_kv_telegramchannelIdel = kv['telegram.channelId.el']) !== null && _kv_telegramchannelIdel !== void 0 ? _kv_telegramchannelIdel : '', channelIdEn: (_kv_telegramchannelIden = kv['telegram.channelId.en']) !== null && _kv_telegramchannelIden !== void 0 ? _kv_telegramchannelIden : '', channelIdRu: (_kv_telegramchannelIdru = kv['telegram.channelId.ru']) !== null && _kv_telegramchannelIdru !== void 0 ? _kv_telegramchannelIdru : '', channelIdUk: (_kv_telegramchannelIduk = kv['telegram.channelId.uk']) !== null && _kv_telegramchannelIduk !== void 0 ? _kv_telegramchannelIduk : '', notifyRegistrations: kv['telegram.notifyRegistrations'] === 'true', postNewTasks: kv['telegram.postNewTasks'] === 'true' }); }).catch(()=>{}); _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminEmailTemplates */ .Lp().then((rows)=>{ const map = {}; for (const r of rows)map[r.key] = { subject: r.subject, body: r.body }; setNotifTemplates((prev)=>({ ...prev, ...map })); }).catch(()=>{}); }, [ isAdmin, tab ]); async function saveGeneralSettings() { setGeneralSaving(true); try { await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updateAdminSettings */ .CX({ 'general.siteName': generalForm.siteName, 'general.siteUrl': generalForm.siteUrl, 'general.contactEmail': generalForm.contactEmail, 'general.supportPhone': generalForm.supportPhone }); setGeneralSaved(true); setTimeout(()=>setGeneralSaved(false), 2500); } catch (e) {} finally{ setGeneralSaving(false); } } async function saveSmtpSettings() { setSmtpSaving(true); try { await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updateAdminSettings */ .CX({ 'smtp.host': smtpForm.host, 'smtp.port': smtpForm.port, 'smtp.username': smtpForm.username, 'smtp.password': smtpForm.password, 'smtp.fromName': smtpForm.fromName, 'smtp.fromEmail': smtpForm.fromEmail, 'smtp.encryption': smtpForm.encryption }); setSmtpSaved(true); setTimeout(()=>setSmtpSaved(false), 2500); } catch (e) {} finally{ setSmtpSaving(false); } } async function autoTranslateTemplate(key) { const localeKey = "".concat(key, "_").concat(templateLocale); var _notifTemplates_localeKey, _ref; const current = (_ref = (_notifTemplates_localeKey = notifTemplates[localeKey]) !== null && _notifTemplates_localeKey !== void 0 ? _notifTemplates_localeKey : notifTemplates[key]) !== null && _ref !== void 0 ? _ref : { subject: '', body: '' }; if (!current.subject && !current.body) return; setTemplateTranslating(true); try { // СПхраМяеЌ ОсхПЎМый язык в БД (еслО ещё Ме сПхраМёМ) await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updateAdminEmailTemplate */ .jg(localeKey, current); // ПеревПЎОЌ Ма ПстальМые языкО const results = await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .translateAdminEmailTemplate */ .wc({ subject: current.subject, body: current.body, fromLocale: templateLocale }); // ОбМПвляеЌ state setNotifTemplates((prev)=>{ const next = { ...prev, [localeKey]: current }; for (const [loc, tpl] of Object.entries(results)){ next["".concat(key, "_").concat(loc)] = tpl; } return next; }); // СПхраМяеЌ кажЎый перевПЎ в БД await Promise.all(Object.entries(results).map((param)=>{ let [loc, tpl] = param; return _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updateAdminEmailTemplate */ .jg("".concat(key, "_").concat(loc), tpl); })); } catch (e) {} finally{ setTemplateTranslating(false); } } async function saveTemplate(key) { const localeKey = "".concat(key, "_").concat(templateLocale); setTemplateSaving(true); try { var _notifTemplates_localeKey; await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updateAdminEmailTemplate */ .jg(localeKey, (_notifTemplates_localeKey = notifTemplates[localeKey]) !== null && _notifTemplates_localeKey !== void 0 ? _notifTemplates_localeKey : { subject: '', body: '' }); setEditingTemplate(null); } catch (e) {} finally{ setTemplateSaving(false); } } async function saveEPaySettings() { setEPaySaving(true); try { await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updateAdminSettings */ .CX({ 'payment.epay.merchantId': ePayForm.merchantId, 'payment.epay.apiUser': ePayForm.apiUser, 'payment.epay.apiPassword': ePayForm.apiPassword, 'payment.epay.environment': ePayForm.environment, 'payment.epay.confirmationUrl': ePayForm.confirmationUrl, 'payment.epay.cancelUrl': ePayForm.cancelUrl, 'payment.epay.enabled': String(ePayForm.enabled) }); setEPaySaved(true); setTimeout(()=>setEPaySaved(false), 2500); } catch (e) {} finally{ setEPaySaving(false); } } async function saveReferralSettings() { setReferralSaving(true); try { await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updateAdminSettings */ .CX({ 'referral_enabled': String(referralForm.enabled), 'referral_plan_id': referralForm.planId, 'referral_days': referralForm.days }); setReferralSaved(true); setTimeout(()=>setReferralSaved(false), 2500); } catch (e) {} finally{ setReferralSaving(false); } } async function saveSeoSettings() { setSeoSaving(true); try { await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updateAdminSettings */ .CX({ 'seo.maintenanceMode': String(seoForm.maintenanceMode), 'seo.indexingEnabled': String(seoForm.indexingEnabled), 'seo.headScripts': seoForm.headScripts, 'seo.siteTitle.el': seoForm.siteTitleEl, 'seo.siteTitle.en': seoForm.siteTitleEn, 'seo.siteTitle.ru': seoForm.siteTitleRu, 'seo.siteTitle.uk': seoForm.siteTitleUk, 'seo.siteDescription.el': seoForm.siteDescriptionEl, 'seo.siteDescription.en': seoForm.siteDescriptionEn, 'seo.siteDescription.ru': seoForm.siteDescriptionRu, 'seo.siteDescription.uk': seoForm.siteDescriptionUk }); setSeoSaved(true); setTimeout(()=>setSeoSaved(false), 2500); } catch (e) {} finally{ setSeoSaving(false); } } async function saveSocialSettings() { setSocialSaving(true); try { await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updateAdminSettings */ .CX({ 'social.telegram': socialForm.telegram, 'social.instagram': socialForm.instagram, 'social.facebook': socialForm.facebook, 'social.twitter': socialForm.twitter, 'social.youtube': socialForm.youtube, 'social.tiktok': socialForm.tiktok, 'social.whatsapp': socialForm.whatsapp, 'social.viber': socialForm.viber }); setSocialSaved(true); setTimeout(()=>setSocialSaved(false), 2500); } catch (e) {} finally{ setSocialSaving(false); } } async function saveTelegramSettings() { setTelegramSaving(true); try { await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updateAdminSettings */ .CX({ 'telegram.botToken': telegramForm.botToken, 'telegram.adminChatId': telegramForm.adminChatId, 'telegram.channelId.el': telegramForm.channelIdEl, 'telegram.channelId.en': telegramForm.channelIdEn, 'telegram.channelId.ru': telegramForm.channelIdRu, 'telegram.channelId.uk': telegramForm.channelIdUk, 'telegram.notifyRegistrations': String(telegramForm.notifyRegistrations), 'telegram.postNewTasks': String(telegramForm.postNewTasks) }); setTelegramSaved(true); setTimeout(()=>setTelegramSaved(false), 2500); } catch (e) {} finally{ setTelegramSaving(false); } } async function testTelegram(type) { const chatIdMap = { admin: telegramForm.adminChatId, el: telegramForm.channelIdEl, en: telegramForm.channelIdEn, ru: telegramForm.channelIdRu, uk: telegramForm.channelIdUk }; var _chatIdMap_type; const chatId = (_chatIdMap_type = chatIdMap[type]) !== null && _chatIdMap_type !== void 0 ? _chatIdMap_type : ''; if (type === 'admin') { setTestingTelegramAdmin(true); setTestResultTelegramAdmin(null); } else { setTestingLocale(type); setTestResultChannels((p)=>{ const n = { ...p }; delete n[type]; return n; }); } try { const res = await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .testTelegramConnection */ .qX(telegramForm.botToken, chatId); var _res_error; const result = { ok: res.ok, msg: res.ok ? res.botName ? "@".concat(res.botName) : t('admin.settings.telegram.test_ok') : (_res_error = res.error) !== null && _res_error !== void 0 ? _res_error : t('admin.settings.telegram.test_fail') }; if (type === 'admin') setTestResultTelegramAdmin(result); else setTestResultChannels((p)=>({ ...p, [type]: result })); } catch (e) { const result = { ok: false, msg: t('admin.settings.telegram.test_fail') }; if (type === 'admin') setTestResultTelegramAdmin(result); else setTestResultChannels((p)=>({ ...p, [type]: result })); } finally{ if (type === 'admin') setTestingTelegramAdmin(false); else setTestingLocale(null); } } async function verifyTelegramToken() { setVerifyingTelegramToken(true); setVerifyResultTelegramToken(null); try { const res = await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .verifyTelegramToken */ .cl(telegramForm.botToken); var _res_error; setVerifyResultTelegramToken({ ok: res.ok, msg: res.ok ? "@".concat(res.botName) : (_res_error = res.error) !== null && _res_error !== void 0 ? _res_error : t('admin.settings.telegram.test_fail') }); } catch (e) { setVerifyResultTelegramToken({ ok: false, msg: t('admin.settings.telegram.test_fail') }); } finally{ setVerifyingTelegramToken(false); } } if (isPending) return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-center py-20 text-gray-500", children: t('common.loading') }); const dateLocale = locale === 'ru' ? 'ru-RU' : locale === 'en' ? 'en-US' : 'el-GR'; const catName = (id)=>{ const cat = catRows.find((c)=>c.id === id); if (!cat) return id; if (locale === 'en') return cat.namesEn || cat.namesEl; if (locale === 'ru') return cat.namesRu || cat.namesEl; if (locale === 'uk') return cat.namesUk || cat.namesEl; return cat.namesEl || cat.namesEn || id; }; const locName = (id)=>{ const loc = locRows.find((l)=>l.id === id); if (!loc) return id; if (locale === 'en') return loc.nameEn || loc.nameEl; if (locale === 'ru') return loc.nameRu || loc.nameEl; if (locale === 'uk') return loc.nameUk || loc.nameEl; return loc.nameEl || loc.nameEn || id; }; const TABS = [ { key: 'stats', label: t('admin.tab.stats'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: t('admin.tab.users'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M17 21v-2a4 4 0 00-4-4H5a4 4 0 00-4 4v2" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("circle", { cx: "9", cy: "7", r: "4" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: t('admin.tab.tasks'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: t('admin.tab.reports'), badge: pendingReportsCount || undefined, icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: t('admin.tab.moderation'), badge: pendingCardsCount || undefined, icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 20h12" }) ] }) }, { key: 'categories', label: t('admin.tab.categories'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: t('admin.tab.locations'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 11a3 3 0 11-6 0 3 3 0 016 0z" }) ] }) }, { key: 'balances', label: t('admin.tab.balances', 'Balance'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M20 12h-6m0 0a2 2 0 100 4h6v-8h-6a2 2 0 100 4z" }) ] }) }, { key: 'plans', label: t('admin.tab.plans'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("rect", { x: "1", y: "4", width: "22", height: "16", rx: "2", ry: "2" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: "1", y1: "10", x2: "23", y2: "10" }) ] }) }, { key: 'logs', label: t('admin.tab.logs'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("polyline", { points: "4 17 10 11 4 5" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: "12", y1: "19", x2: "20", y2: "19" }) ] }) }, { key: 'settings', label: t('admin.tab.settings'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("circle", { cx: "12", cy: "12", r: "3" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: t('admin.tab.support', 'Support'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: t('admin.tab.push', 'Push'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: t('admin.tab.backup', 'Backup'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: t('admin.tab.translations', 'Translations'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: t('admin.tab.dbcheck', 'DB check'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("ellipse", { cx: "12", cy: "5", rx: "9", ry: "3" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M21 12c0 1.66-4.03 3-9 3S3 13.66 3 12" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M3 5v14c0 1.66 4.03 3 9 3s9-1.34 9-3V5" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 12l2 2 4-4" }) ] }) }, { key: 'referrals', label: t('admin.tab.referrals', 'Referrals'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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" }) }) } ]; const statusColors = { 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' }; const reportStatusColors = { pending: 'bg-yellow-100 text-yellow-700', reviewed: 'bg-green-100 text-green-700', dismissed: 'bg-gray-100 text-gray-500' }; const reasonColors = { 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' }; const cardStatus = (card)=>{ var _card_publicationStatus; return (_card_publicationStatus = card.publicationStatus) !== null && _card_publicationStatus !== void 0 ? _card_publicationStatus : card.isActive ? 'active' : 'inactive'; }; const pendingModerationCards = moderationCards.filter((card)=>cardStatus(card) === 'pending'); const activeModerationCards = moderationCards.filter((card)=>cardStatus(card) === 'active'); var _stats_totalCostUsd, _planForm_oldPrice, _pushResult_tokensFound, _pushResult_usersWithoutTokens, _pushResult_usersConfigBlocked, _pushResult_usersAuthFailed, _pushResult_usersAllFailed, _pushResult_usersWithoutTokens1, _pushResult_usersConfigBlocked1, _pushResult_usersAuthFailed1, _pushResult_usersAllFailed1, _referralsData_totalReferrers, _referralsData_totalReferrals, _referralsData_activeRewards, _editUser_firstName, _editUser_lastName, _editUser_phone, _editUser_bio, _editUser_planId, _editUser_locale, _editUser_balance, _editUser_showContactInfo, _editUser_notifyNewTasks, _editUser_notifMessages, _editUser_personalSiteSlug, _editUser_siteSettings, _siteTheme, _editUser_skills, _editUser_balance1, _editUser_topUpAmount, _editUser_withdrawAmount, _editUser_topUpDescription, _editUser_withdrawDescription; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "min-h-screen bg-gray-50", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "max-w-7xl mx-auto px-4 py-8", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-between mb-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-7 h-7 text-yellow-500", fill: "currentColor", viewBox: "0 0 24 24", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M5 16L3 5l5.5 5L12 4l3.5 6L21 5l-2 11H5zm0 3a1 1 0 000 2h14a1 1 0 000-2H5z" }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h1", { className: "text-2xl font-bold text-gray-900", children: t('admin.title') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)((next_link__WEBPACK_IMPORTED_MODULE_3___default()), { href: "/", className: "flex items-center gap-1.5 text-sm text-gray-500 hover:text-green-600 transition", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 19l-7-7 7-7" }) }), t('admin.back_home') ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("aside", { className: "shrink-0 transition-all duration-200 ".concat(sidebarCollapsed ? 'w-12' : 'w-52'), children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("nav", { className: "bg-white rounded-xl border border-gray-200 overflow-hidden", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>setSidebarCollapsed((v)=>!v), title: sidebarCollapsed ? 'РазверМуть ЌеМю' : 'СверМуть ЌеМю', 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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 transition-transform duration-200 ".concat(sidebarCollapsed ? 'rotate-180' : ''), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 19l-7-7 7-7" }) }) }), TABS.map((param)=>{ let { key, label, icon, badge } = param; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { onClick: ()=>setTab(key), title: sidebarCollapsed ? label : undefined, className: "w-full flex items-center py-3 text-sm font-medium text-left transition ".concat(tab === key ? 'bg-green-50 text-green-700 border-r-2 border-green-600' : 'text-gray-600 hover:bg-gray-50 hover:text-gray-900', " ").concat(sidebarCollapsed ? 'justify-center px-3' : 'gap-3 px-4'), children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "w-4 h-4 flex-shrink-0 flex items-center justify-center", children: icon }), !sidebarCollapsed && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "flex items-center gap-2 min-w-0", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { children: label }), badge ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: badge }) : null ] }) ] }, key); }) ] }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex-1 min-w-0", children: [ tab === 'stats' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "grid grid-cols-2 md:grid-cols-5 gap-4", children: [ { label: t('admin.stats.users'), value: stats === null || stats === void 0 ? void 0 : stats.userCount, icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-8 h-8", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: t('admin.stats.specialists'), value: stats === null || stats === void 0 ? void 0 : stats.specialistCount, icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-8 h-8", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 12a3 3 0 11-6 0 3 3 0 016 0z" }) ] }), color: 'text-purple-600' }, { label: t('admin.stats.tasks'), value: stats === null || stats === void 0 ? void 0 : stats.taskCount, icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-8 h-8", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: t('admin.stats.offers'), value: stats === null || stats === void 0 ? void 0 : stats.offerCount, icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-8 h-8", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: t('admin.stats.reviews'), value: stats === null || stats === void 0 ? void 0 : stats.reviewCount, icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-8 h-8", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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((param)=>{ let { label, value, icon, color } = param; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "mb-2 ".concat(color), children: icon }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-3xl font-bold ".concat(color), children: value !== null && value !== void 0 ? value : '—' }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-sm text-gray-500 mt-1", children: label }) ] }, label); }) }), (stats === null || stats === void 0 ? void 0 : stats.tasksByDay) && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-between mb-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "font-semibold text-gray-800", children: t('admin.stats.activity_30d') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-4 text-xs text-gray-500", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "flex items-center gap-1.5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "w-3 h-0.5 bg-green-500 inline-block rounded" }), t('admin.stats.users_label') ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "flex items-center gap-1.5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "w-3 h-0.5 bg-purple-400 inline-block rounded" }), t('admin.stats.specialists_label') ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "flex items-center gap-1.5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "w-3 h-0.5 bg-green-500 inline-block rounded" }), t('admin.stats.tasks_label') ] }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(AdminAreaChart, { series: [ { data: stats.usersByDay, color: '#3b82f6', fill: '#3b82f615', label: t('admin.stats.users_label') }, { data: stats.specialistsByDay, color: '#a855f7', fill: '#a855f710', label: t('admin.stats.specialists_label') }, { data: stats.tasksByDay, color: '#22c55e', fill: '#22c55e10', label: t('admin.stats.tasks_label') } ] }) ] }), (stats === null || stats === void 0 ? void 0 : stats.tasksByStatus) && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "font-semibold text-gray-800 mb-5", children: t('admin.stats.tasks_by_status') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "space-y-3", children: (()=>{ const total = stats.tasksByStatus.reduce((s, r)=>s + Number(r.count), 0) || 1; const statusMeta = { open: { label: t('admin.task_status.open'), bg: 'bg-green-50', bar: 'bg-green-500' }, in_progress: { label: t('admin.task_status.in_progress'), bg: 'bg-green-50', bar: 'bg-green-500' }, completed: { label: t('admin.task_status.completed'), bg: 'bg-gray-50', bar: 'bg-gray-400' }, cancelled: { label: t('admin.task_status.cancelled'), bg: 'bg-red-50', bar: 'bg-red-400' }, draft: { label: t('admin.task_status.draft'), bg: 'bg-yellow-50', bar: 'bg-yellow-400' } }; const order = [ 'open', 'in_progress', 'completed', 'draft', 'cancelled' ]; const sorted = [ ...stats.tasksByStatus ].sort((a, b)=>order.indexOf(a.status) - order.indexOf(b.status)); return sorted.map((param)=>{ let { status, count: c } = param; var _statusMeta_status; const meta = (_statusMeta_status = statusMeta[status]) !== null && _statusMeta_status !== void 0 ? _statusMeta_status : { label: status, bg: 'bg-gray-50', bar: 'bg-gray-300' }; const pct = Math.round(Number(c) / total * 100); return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-3 px-3 py-2 rounded-lg ".concat(meta.bg), children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-sm text-gray-600 w-28 shrink-0", children: meta.label }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex-1 bg-gray-200 rounded-full h-2 overflow-hidden", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "h-full rounded-full ".concat(meta.bar, " transition-all"), style: { width: "".concat(pct, "%") } }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-sm font-semibold text-gray-700 w-8 text-right", children: c }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "text-xs text-gray-400 w-8", children: [ pct, "%" ] }) ] }, status); }); })() }) ] }), notifsByDay.length > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-between mb-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "font-semibold text-gray-800", children: t('admin.stats.notif_chart_title') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "flex items-center gap-1.5 text-xs text-gray-500", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "w-3 h-0.5 bg-orange-500 inline-block rounded" }), t('admin.stats.notif_label') ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(AdminAreaChart, { series: [ { data: notifsByDay, color: '#f97316', fill: '#f9731615', label: t('admin.stats.notif_label') } ] }) ] }), mailByDay.length > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-between mb-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "font-semibold text-gray-800", children: t('admin.stats.mail_chart_title') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "flex items-center gap-1.5 text-xs text-gray-500", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "w-3 h-0.5 bg-sky-500 inline-block rounded" }), t('admin.stats.mail_label') ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(AdminAreaChart, { series: [ { data: mailByDay, color: '#0ea5e9', fill: '#0ea5e915', label: t('admin.stats.mail_label') } ] }) ] }), stats && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-6 space-y-5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-between", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "font-semibold text-gray-800", children: t('admin.stats.tokens_title') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-4 text-xs text-gray-500", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "flex items-center gap-1.5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "w-3 h-0.5 bg-violet-500 inline-block rounded" }), t('admin.stats.tokens_out') ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "flex items-center gap-1.5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "w-3 h-0.5 bg-sky-500 inline-block rounded" }), t('admin.stats.tokens_in') ] }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "grid grid-cols-3 gap-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "rounded-lg bg-violet-50 border border-violet-100 px-4 py-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-xs text-violet-600 mb-1", children: t('admin.stats.tokens_out_label') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-2xl font-bold text-violet-700", children: Number(stats.totalOutputTokens).toLocaleString() }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "rounded-lg bg-sky-50 border border-sky-100 px-4 py-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-xs text-sky-600 mb-1", children: t('admin.stats.tokens_in_label') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-2xl font-bold text-sky-700", children: Number(stats.totalInputTokens).toLocaleString() }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "rounded-lg bg-emerald-50 border border-emerald-100 px-4 py-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-xs text-emerald-600 mb-1", children: t('admin.stats.cost_label') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "text-2xl font-bold text-emerald-700", children: [ "$", Number((_stats_totalCostUsd = stats.totalCostUsd) !== null && _stats_totalCostUsd !== void 0 ? _stats_totalCostUsd : 0).toFixed(4) ] }) ] }) ] }), ((_stats_tokensByMonth = stats.tokensByMonth) === null || _stats_tokensByMonth === void 0 ? void 0 : _stats_tokensByMonth.length) > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(AdminMonthChart, { dateLocale: dateLocale, series: [ { data: stats.tokensByMonth.map((r)=>({ month: r.month, count: Number(r.output) })), color: '#8b5cf6', fill: '#8b5cf610', label: t('admin.stats.tokens_out_label') }, { data: stats.tokensByMonth.map((r)=>({ month: r.month, count: Number(r.input) })), color: '#0ea5e9', fill: '#0ea5e915', label: t('admin.stats.tokens_in_label') } ] }) ] }) ] }), tab === 'users' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-3 mb-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("form", { className: "flex gap-2 flex-1", onSubmit: (e)=>{ e.preventDefault(); setUsersQ(usersQInput); }, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: usersQInput, onChange: (e)=>setUsersQInput(e.target.value), placeholder: t('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" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: t('tasks.search.btn') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("select", { value: usersRole, onChange: (e)=>setUsersRole(e.target.value), className: "border border-gray-300 rounded-lg px-3 py-2 text-sm", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "", children: t('admin.filter.all_roles') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "user", children: t('admin.user_edit.role.user') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "admin", children: t('profile.role.admin') }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 overflow-hidden", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("table", { className: "w-full text-sm", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("thead", { className: "bg-gray-50 text-left", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("tr", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.col.user') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.col.email') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.col.role') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.col.plan', 'Plan') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.col.registered') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.col.status') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3" }) ] }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("tbody", { className: "divide-y divide-gray-100", children: loading ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("tr", { children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { colSpan: 6, className: "px-4 py-8 text-center text-gray-400", children: t('common.loading') }) }) : users.length === 0 ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("tr", { children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { colSpan: 6, className: "px-4 py-8 text-center text-gray-400", children: "—" }) }) : users.map((u)=>{ var _planRows_find; var _planRows_find_name; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("tr", { className: "hover:bg-gray-50", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3 font-medium text-gray-800", children: (0,_lib_formatName__WEBPACK_IMPORTED_MODULE_8__/* .formatShortName */ .H)(u.firstName, u.lastName, u.name) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3 text-gray-500", children: u.email }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "px-2 py-0.5 rounded-full text-xs font-medium ".concat(u.role === 'admin' ? 'bg-red-100 text-red-700' : u.role === 'specialist' ? 'bg-green-100 text-green-700' : 'bg-gray-100 text-gray-600'), children: t("profile.role.".concat(u.role)) || u.role }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3 text-gray-400 text-xs", children: u.planId ? (_planRows_find_name = (_planRows_find = planRows.find((p)=>p.id === u.planId)) === null || _planRows_find === void 0 ? void 0 : _planRows_find.name) !== null && _planRows_find_name !== void 0 ? _planRows_find_name : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "font-mono", children: [ u.planId.slice(0, 8), "
" ] }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-gray-300", children: "—" }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3 text-gray-400", children: new Date(u.createdAt).toLocaleDateString(dateLocale) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "px-2 py-0.5 rounded-full text-xs font-medium ".concat(u.isActive !== false ? 'bg-green-100 text-green-700' : 'bg-red-100 text-red-600'), children: u.isActive !== false ? t('admin.users.active') : t('admin.users.inactive') }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3 text-right", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-end gap-1.5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>openEditUser(u), 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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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" }) }) }), u.role !== 'admin' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>toggleUser(u.id, u.isActive !== false), className: "text-xs px-3 py-1 rounded-lg font-medium ".concat(u.isActive !== false ? 'bg-red-50 text-red-600 hover:bg-red-100' : 'bg-green-50 text-green-600 hover:bg-green-100'), children: u.isActive !== false ? t('admin.users.deactivate') : t('admin.users.activate') }) ] }) }) ] }, u.id); }) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Pagination, { page: usersPage, total: usersTotal, limit: 20, onChange: setUsersPage, totalLabel: t('admin.pagination.total') }) ] }) ] }), tab === 'balances' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex flex-wrap gap-3 mb-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: balanceUserId, onChange: (e)=>setBalanceUserId(e.target.value), placeholder: t('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" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("select", { value: balanceKind, onChange: (e)=>setBalanceKind(e.target.value), className: "border border-gray-300 rounded-lg px-3 py-2 text-sm", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "", children: t('admin.balance.filter.all', 'All operations') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "topup", children: t('admin.balance.kind.topup', 'Top-up') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "plan_purchase", children: t('admin.balance.kind.plan_purchase', 'Plan charge') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "admin_topup", children: t('admin.balance.kind.admin_topup', 'Admin top-up') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "admin_adjustment", children: t('admin.balance.kind.admin_adjustment', 'Adjustment') }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 overflow-hidden", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("table", { className: "w-full text-sm", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("thead", { className: "bg-gray-50 text-left", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("tr", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.col.user') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.balance.col.operation', 'Operation') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.balance.col.amount', 'Amount') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.balance.col.result', 'Balance') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.balance.col.description', 'Description') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.balance.col.date', 'Date') }) ] }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("tbody", { className: "divide-y divide-gray-100", children: loading ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("tr", { children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { colSpan: 6, className: "px-4 py-8 text-center text-gray-400", children: t('common.loading') }) }) : balanceRows.length === 0 ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("tr", { children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { colSpan: 6, className: "px-4 py-8 text-center text-gray-400", children: t('admin.balance.empty', 'No records yet') }) }) : balanceRows.map((row)=>{ const isCredit = row.direction === 'credit'; const kindLabel = row.kind === 'topup' ? t('admin.balance.kind.topup', 'Top-up') : row.kind === 'plan_purchase' ? t('admin.balance.kind.plan_purchase', 'Plan charge') : row.kind === 'admin_topup' ? t('admin.balance.kind.admin_topup', 'Admin top-up') : t('admin.balance.kind.admin_adjustment', 'Adjustment'); return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("tr", { className: "hover:bg-gray-50 align-top", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("td", { className: "px-4 py-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "font-medium text-gray-800", children: row.userName || '—' }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-xs text-gray-500 mt-0.5", children: row.userEmail || row.userId }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "inline-flex rounded-full px-2 py-0.5 text-xs font-medium ".concat(isCredit ? 'bg-emerald-50 text-emerald-700' : 'bg-rose-50 text-rose-700'), children: kindLabel }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("td", { className: "px-4 py-3 font-semibold ".concat(isCredit ? 'text-emerald-700' : 'text-rose-700'), children: [ isCredit ? '+' : '-', Number(row.amount).toFixed(2), " ", row.currency ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3 text-gray-600", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ Number(row.balanceBefore).toFixed(2), " → ", Number(row.balanceAfter).toFixed(2), " ", row.currency ] }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3 text-gray-500 max-w-sm", children: row.description || '—' }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3 text-gray-500 whitespace-nowrap", children: new Date(row.createdAt).toLocaleString(dateLocale) }) ] }, row.id); }) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Pagination, { page: balancePage, total: balanceTotal, limit: 50, onChange: setBalancePage, totalLabel: t('admin.pagination.total') }) ] }) ] }), tab === 'tasks' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-3 mb-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("form", { className: "flex gap-2 flex-1", onSubmit: (e)=>{ e.preventDefault(); setTasksQ(tasksQInput); }, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: tasksQInput, onChange: (e)=>setTasksQInput(e.target.value), placeholder: t('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" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: t('tasks.search.btn') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("select", { value: tasksStatus, onChange: (e)=>setTasksStatus(e.target.value), className: "border border-gray-300 rounded-lg px-3 py-2 text-sm", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "", children: t('admin.filter.all_statuses') }), [ 'open', 'in_progress', 'completed', 'cancelled', 'draft' ].map((s)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: s, children: t("task.status.".concat(s), s) }, s)) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 overflow-hidden", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("table", { className: "w-full text-sm", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("thead", { className: "bg-gray-50 text-left", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("tr", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.col.title') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.col.customer') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.col.status') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.col.budget') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.col.created') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3" }) ] }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("tbody", { className: "divide-y divide-gray-100", children: loading ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("tr", { children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { colSpan: 6, className: "px-4 py-8 text-center text-gray-400", children: t('common.loading') }) }) : tasks.length === 0 ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("tr", { children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { colSpan: 6, className: "px-4 py-8 text-center text-gray-400", children: "—" }) }) : tasks.map((row)=>{ const task = row.task || row; const customer = row.customer; var _customer_name, _statusColors_task_status; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("tr", { className: "hover:bg-gray-50", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3 font-medium text-gray-800 max-w-xs", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)((next_link__WEBPACK_IMPORTED_MODULE_3___default()), { href: "/tasks/".concat(task.id), className: "hover:text-green-600 truncate block", target: "_blank", children: locale === 'en' && task.titleEn || locale === 'ru' && task.titleRu || locale === 'uk' && task.titleUk || task.titleEl || task.title }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3 text-gray-500 text-xs", children: (_customer_name = customer === null || customer === void 0 ? void 0 : customer.name) !== null && _customer_name !== void 0 ? _customer_name : '—' }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "px-2 py-0.5 rounded-full text-xs font-medium ".concat((_statusColors_task_status = statusColors[task.status]) !== null && _statusColors_task_status !== void 0 ? _statusColors_task_status : 'bg-gray-100 text-gray-600'), children: t("task.status.".concat(task.status), task.status) }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3 text-gray-500", children: task.budget ? "".concat((0,_lib_taskLocale__WEBPACK_IMPORTED_MODULE_9__/* .formatPrice */ .$g)(task.budget), "€") : '—' }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3 text-gray-400", children: new Date(task.createdAt).toLocaleDateString(dateLocale) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3 text-right", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-1.5 justify-end", children: [ task.status !== 'cancelled' && task.status !== 'completed' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>cancelTask(task.id), className: "text-xs px-2.5 py-1 rounded-lg font-medium bg-yellow-50 text-yellow-700 hover:bg-yellow-100", children: t('admin.tasks.cancel') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>deleteTask(task.id, locale === 'en' && task.titleEn || locale === 'ru' && task.titleRu || locale === 'uk' && task.titleUk || task.titleEl || task.title), className: "text-xs px-2.5 py-1 rounded-lg font-medium bg-red-50 text-red-600 hover:bg-red-100", children: t('admin.tasks.delete') }) ] }) }) ] }, task.id); }) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Pagination, { page: tasksPage, total: tasksTotal, limit: 20, onChange: setTasksPage, totalLabel: t('admin.pagination.total') }) ] }) ] }), tab === 'categories' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex justify-between items-center mb-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-gray-500", children: t('admin.cat.hint') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { onClick: ()=>openAddCat(null), className: "px-4 py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700", children: [ "+ ", t('admin.cat.add_root') ] }) ] }), catForm && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-green-50 border border-green-200 rounded-xl p-5 mb-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("h3", { className: "font-semibold text-gray-800 mb-4", children: [ catForm.id ? t('admin.cat.edit') : t('admin.cat.new'), catForm.parentId && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "text-xs text-gray-400 ml-2", children: [ "(", t('admin.cat.subcategory'), ")" ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "grid grid-cols-2 md:grid-cols-3 gap-3 mb-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.cat.slug') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: catForm.slug, onChange: (e)=>setCatForm((f)=>f && { ...f, slug: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm", placeholder: "e.g. repairs" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.cat.icon') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(CategoryIconPicker, { value: catForm.icon, onChange: (icon)=>setCatForm((f)=>f && { ...f, icon }), onUpload: uploadCategoryIcon, uploading: catIconUploading, error: catIconError, presets: categoryIconPresets }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.cat.order') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "number", value: catForm.order, onChange: (e)=>setCatForm((f)=>f && { ...f, order: Number(e.target.value) }), className: "w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: [ t('admin.cat.name_el'), " \uD83C\uDDEC\uD83C\uDDF7" ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: catForm.namesEl, onChange: (e)=>setCatForm((f)=>f && { ...f, namesEl: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: [ t('admin.cat.name_en'), " \uD83C\uDDEC\uD83C\uDDE7" ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: catForm.namesEn, onChange: (e)=>setCatForm((f)=>f && { ...f, namesEn: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: [ t('admin.cat.name_ru'), " \uD83C\uDDF7\uD83C\uDDFA" ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: catForm.namesRu, onChange: (e)=>setCatForm((f)=>f && { ...f, namesRu: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: [ t('admin.cat.name_uk'), " \uD83C\uDDFA\uD83C\uDDE6" ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: catForm.namesUk, onChange: (e)=>setCatForm((f)=>f && { ...f, namesUk: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }) ] }), catForm.id && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "flex items-center gap-2 text-sm text-gray-700 mb-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "checkbox", checked: catForm.isActive, onChange: (e)=>setCatForm((f)=>f && { ...f, isActive: e.target.checked }) }), t('admin.cat.active') ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: saveCat, disabled: catSaving, className: "px-4 py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700 disabled:opacity-50", children: catSaving ? t('common.saving') : t('common.save') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>setCatForm(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: t('common.cancel') }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "bg-white rounded-xl border border-gray-200 divide-y divide-gray-100", children: catRows.length === 0 ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "px-4 py-8 text-center text-gray-400", children: t('admin.cat.empty') }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(CatTree, { rows: catRows, parentId: null, depth: 0, locale: locale, expanded: catExpanded, onToggle: toggleCatExpand, onEdit: openEditCat, onDelete: deleteCat, onAddChild: openAddCat, skillsExpanded: catSkillsExpanded, skillsCache: catSkillsCache, skillsLoading: catSkillsLoading, onToggleSkills: toggleCatSkills, skillForm: skillForm, skillSaving: skillSaving, onOpenAddSkill: openAddSkill, onOpenEditSkill: openEditSkill, onSaveSkill: saveSkill, onDeleteSkill: deleteSkill, onCancelSkillForm: ()=>setSkillForm(null), onSkillFormChange: setSkillForm, t: t }) }) ] }), tab === 'locations' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex justify-between items-center mb-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-gray-500", children: t('admin.loc.hint') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { onClick: ()=>openAddLoc(null), className: "px-4 py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700", children: [ "+ ", t('admin.loc.add_city') ] }) ] }), locForm && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-green-50 border border-green-200 rounded-xl p-5 mb-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("h3", { className: "font-semibold text-gray-800 mb-4", children: [ locForm.id ? t('admin.loc.edit') : t('admin.loc.new'), locForm.parentId && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "text-xs text-gray-400 ml-2", children: [ "(", t('admin.loc.district'), ")" ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "grid grid-cols-2 md:grid-cols-4 gap-3 mb-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.cat.slug') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: locForm.slug, onChange: (e)=>setLocForm((f)=>f && { ...f, slug: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm", placeholder: "e.g. athens-center" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: [ t('admin.cat.name_el'), " \uD83C\uDDEC\uD83C\uDDF7" ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: locForm.nameEl, onChange: (e)=>setLocForm((f)=>f && { ...f, nameEl: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: [ t('admin.cat.name_en'), " \uD83C\uDDEC\uD83C\uDDE7" ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: locForm.nameEn, onChange: (e)=>setLocForm((f)=>f && { ...f, nameEn: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: [ t('admin.cat.name_ru'), " \uD83C\uDDF7\uD83C\uDDFA" ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: locForm.nameRu, onChange: (e)=>setLocForm((f)=>f && { ...f, nameRu: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: [ t('admin.cat.name_uk'), " \uD83C\uDDFA\uD83C\uDDE6" ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: locForm.nameUk, onChange: (e)=>setLocForm((f)=>f && { ...f, nameUk: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-4 mb-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "w-24", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.cat.order') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "number", value: locForm.order, onChange: (e)=>setLocForm((f)=>f && { ...f, order: Number(e.target.value) }), className: "w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), locForm.id && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "flex items-center gap-2 text-sm text-gray-700 mt-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "checkbox", checked: locForm.isActive, onChange: (e)=>setLocForm((f)=>f && { ...f, isActive: e.target.checked }) }), t('admin.cat.active') ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: saveLoc, disabled: locSaving, className: "px-4 py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700 disabled:opacity-50", children: locSaving ? t('common.saving') : t('common.save') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>setLocForm(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: t('common.cancel') }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "bg-white rounded-xl border border-gray-200 divide-y divide-gray-100", children: locRows.length === 0 ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "px-4 py-8 text-center text-gray-400", children: t('admin.loc.empty') }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(LocTree, { rows: locRows, parentId: null, depth: 0, locale: locale, expanded: locExpanded, onToggle: toggleLocExpand, onEdit: openEditLoc, onDelete: deleteLoc, onAddChild: openAddLoc, t: t }) }) ] }), tab === 'reports' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-3", children: [ loading ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-center py-10 text-gray-400", children: t('common.loading') }) : reports.length === 0 ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-center py-10 text-gray-400", children: t('admin.reports.none') }) : reports.map((r)=>{ var _r_targetId; var _reportStatusColors_r_status, _reasonColors_r_reason; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "bg-white rounded-xl border border-gray-200 p-5", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-start justify-between gap-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-2 flex-wrap mb-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "px-2 py-0.5 rounded-full text-xs font-medium ".concat((_reportStatusColors_r_status = reportStatusColors[r.status]) !== null && _reportStatusColors_r_status !== void 0 ? _reportStatusColors_r_status : 'bg-gray-100 text-gray-500'), children: r.status }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "px-2 py-0.5 rounded-full text-xs font-medium ".concat((_reasonColors_r_reason = reasonColors[r.reason]) !== null && _reasonColors_r_reason !== void 0 ? _reasonColors_r_reason : 'bg-gray-100 text-gray-600'), children: r.reason }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "text-xs text-gray-400", children: [ r.targetType === 'task' ? t('admin.reports.target.task') : t('admin.reports.target.user'), ":", ' ', r.targetTitle ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)((next_link__WEBPACK_IMPORTED_MODULE_3___default()), { href: r.targetType === 'task' ? "/tasks/".concat(r.targetId) : "/users/".concat(r.targetId), className: "text-green-600 hover:underline font-medium", target: "_blank", children: r.targetTitle }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "font-mono", children: [ "#", (_r_targetId = r.targetId) === null || _r_targetId === void 0 ? void 0 : _r_targetId.slice(0, 8) ] }) ] }) ] }), r.reporterName && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { className: "text-xs text-gray-400 mb-1", children: [ t('admin.col.reporter'), ": ", /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "font-medium text-gray-600", children: r.reporterName }) ] }), r.description && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-gray-700", children: r.description }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400 mt-1.5", children: new Date(r.createdAt).toLocaleString(dateLocale) }) ] }), r.status === 'pending' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-2 flex-shrink-0", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>handleReport(r.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: t('admin.reports.reviewed') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>handleReport(r.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: t('admin.reports.dismiss') }) ] }) ] }) }, r.id); }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Pagination, { page: reportsPage, total: reportsTotal, limit: 20, onChange: setReportsPage, totalLabel: t('admin.pagination.total') }) ] }), tab === 'moderation' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "grid md:grid-cols-2 gap-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-sm text-gray-500", children: t('admin.moderation.pending_count', 'Pending') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-3xl font-bold text-gray-900 mt-1", children: pendingModerationCards.length }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-xs text-gray-400 mt-1", children: t('admin.moderation.pending_hint', 'New proposals waiting for approval') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-sm text-gray-500", children: t('admin.moderation.active_count', 'Active') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-3xl font-bold text-gray-900 mt-1", children: activeModerationCards.length }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-xs text-gray-400 mt-1", children: t('admin.moderation.active_hint', 'Visible cards that can be blocked') }) ] }) ] }), moderationCardsLoading ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-center py-10 text-gray-400", children: t('common.loading') }) : moderationCards.length === 0 ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-center py-10 text-gray-400", children: t('admin.moderation.none', 'No specialist cards found') }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h3", { className: "font-semibold text-gray-800 mb-3", children: t('admin.moderation.pending_title', 'Pending approval') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "space-y-3", children: pendingModerationCards.length === 0 ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-sm text-gray-400 bg-white border border-dashed border-gray-200 rounded-xl p-4", children: t('admin.moderation.pending_empty', 'No pending proposals right now') }) : pendingModerationCards.map((card)=>{ var _card_specialistName, _ref; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "bg-white rounded-xl border border-gray-200 p-4", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex flex-wrap items-start justify-between gap-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "min-w-0 flex-1", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-2 flex-wrap mb-1", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "px-2 py-0.5 rounded-full text-xs font-medium bg-yellow-100 text-yellow-700", children: t('admin.moderation.pending', 'Pending') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-sm font-semibold text-gray-800 truncate", children: card.title }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-xs text-gray-500 mb-2", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)((next_link__WEBPACK_IMPORTED_MODULE_3___default()), { href: "/users/".concat(card.specialistId), className: "hover:text-green-600 hover:underline font-medium", children: (_ref = (_card_specialistName = card.specialistName) !== null && _card_specialistName !== void 0 ? _card_specialistName : card.specialistEmail) !== null && _ref !== void 0 ? _ref : card.specialistId }) }), card.description && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-gray-700 line-clamp-3", children: card.description }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-2 flex-shrink-0", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>updateModerationCard(card.id, 'active'), className: "px-3 py-1.5 rounded-lg text-xs font-medium bg-green-600 text-white hover:bg-green-700", children: t('admin.moderation.approve', 'Approve') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>updateModerationCard(card.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: t('admin.moderation.block', 'Block') }) ] }) ] }) }, card.id); }) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h3", { className: "font-semibold text-gray-800 mb-3", children: t('admin.moderation.active_title', 'Active cards') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "space-y-3", children: activeModerationCards.length === 0 ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-sm text-gray-400 bg-white border border-dashed border-gray-200 rounded-xl p-4", children: t('admin.moderation.active_empty', 'No active cards found') }) : activeModerationCards.map((card)=>{ var _card_specialistName, _ref; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "bg-white rounded-xl border border-gray-200 p-4", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex flex-wrap items-start justify-between gap-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "min-w-0 flex-1", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-2 flex-wrap mb-1", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "px-2 py-0.5 rounded-full text-xs font-medium bg-green-100 text-green-700", children: t('admin.moderation.active', 'Active') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-sm font-semibold text-gray-800 truncate", children: card.title }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-xs text-gray-500 mb-2", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)((next_link__WEBPACK_IMPORTED_MODULE_3___default()), { href: "/users/".concat(card.specialistId), className: "hover:text-green-600 hover:underline font-medium", children: (_ref = (_card_specialistName = card.specialistName) !== null && _card_specialistName !== void 0 ? _card_specialistName : card.specialistEmail) !== null && _ref !== void 0 ? _ref : card.specialistId }) }), card.description && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-gray-700 line-clamp-3", children: card.description }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>updateModerationCard(card.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: t('admin.moderation.block', 'Block') }) ] }) }, card.id); }) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Pagination, { page: moderationCardsPage, total: moderationCardsTotal, limit: 20, onChange: setModerationCardsPage, totalLabel: t('admin.pagination.total') }) ] }) ] }), tab === 'logs' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex gap-1 bg-gray-100 rounded-xl p-1 mb-5 w-fit", children: [ { key: 'ai', label: t('admin.logs.subtab.ai') }, { key: 'activity', label: t('admin.logs.subtab.activity') }, { key: 'mail', label: t('admin.logs.subtab.mail') }, { key: 'notifications', label: t('admin.logs.subtab.notifications') } ].map((param)=>{ let { key, label } = param; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>setLogsSubTab(key), className: "px-4 py-1.5 rounded-lg text-sm font-medium transition-colors ".concat(logsSubTab === key ? 'bg-white text-gray-900 shadow-sm' : 'text-gray-500 hover:text-gray-700'), children: label }, key); }) }), logsSubTab === 'ai' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex justify-between items-center mb-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { className: "text-sm text-gray-500", children: [ t('admin.pagination.total'), ": ", logsTotal ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { onClick: ()=>{ setLogsPage(1); _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminAiLogs */ .j_(1).then((d)=>{ setLogs(d.data); setLogsTotal(d.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: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("polyline", { points: "23 4 23 10 17 10" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M20.49 15a9 9 0 11-2.12-9.36L23 10" }) ] }), t('common.refresh') ] }) ] }), loading ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-center py-10 text-gray-400", children: t('common.loading') }) : logs.length === 0 ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-center py-10 text-gray-400", children: t('admin.logs.empty') }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "overflow-x-auto rounded-xl border border-gray-200", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("table", { className: "w-full text-sm", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("thead", { className: "bg-gray-50 text-gray-500 text-xs uppercase", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("tr", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 text-left", children: t('admin.logs.date') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 text-left", children: t('admin.logs.provider') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 text-left", children: t('admin.logs.model') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 text-left", children: t('admin.logs.action') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 text-left", children: t('admin.logs.langs') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 text-right", children: t('admin.logs.in') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 text-right", children: t('admin.logs.out') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 text-right", children: t('admin.logs.total') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 text-right", children: t('admin.logs.ms') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 text-center", children: t('admin.logs.status') }) ] }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("tbody", { className: "divide-y divide-gray-100", children: logs.map((log)=>{ var _log_inputTokens, _log_outputTokens, _log_totalTokens, _log_durationMs, _log_error; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("tr", { className: "bg-white hover:bg-gray-50", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3 text-gray-500 whitespace-nowrap", children: new Date(log.createdAt).toLocaleString(dateLocale) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "px-2 py-0.5 rounded-full text-xs font-medium ".concat(log.provider === 'anthropic' ? 'bg-purple-100 text-purple-700' : 'bg-green-100 text-green-700'), children: log.provider }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3 text-gray-600 font-mono text-xs", children: log.model }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3 text-gray-600", children: log.action }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3 text-gray-500", children: log.fromLocale && log.toLocale ? "".concat(log.fromLocale, " → ").concat(log.toLocale) : '—' }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3 text-right text-gray-600", children: (_log_inputTokens = log.inputTokens) !== null && _log_inputTokens !== void 0 ? _log_inputTokens : '—' }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3 text-right text-gray-600", children: (_log_outputTokens = log.outputTokens) !== null && _log_outputTokens !== void 0 ? _log_outputTokens : '—' }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3 text-right font-medium", children: (_log_totalTokens = log.totalTokens) !== null && _log_totalTokens !== void 0 ? _log_totalTokens : '—' }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3 text-right text-gray-500", children: (_log_durationMs = log.durationMs) !== null && _log_durationMs !== void 0 ? _log_durationMs : '—' }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3 text-center", children: log.success ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-green-600 flex justify-center", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("polyline", { points: "20 6 9 17 4 12" }) }) }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-red-500 flex justify-center", title: (_log_error = log.error) !== null && _log_error !== void 0 ? _log_error : '', children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: "18", y1: "6", x2: "6", y2: "18" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: "6", y1: "6", x2: "18", y2: "18" }) ] }) }) }) ] }, log.id); }) }) ] }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Pagination, { page: logsPage, total: logsTotal, limit: 50, onChange: setLogsPage, totalLabel: t('admin.pagination.total') }) ] }), logsSubTab === 'activity' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-4 mb-4 flex flex-wrap gap-3 items-end", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs font-medium text-gray-500 mb-1", children: t('admin.activity.event') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("select", { value: activityEvent, onChange: (e)=>setActivityEvent(e.target.value), className: "border border-gray-300 rounded-lg px-3 py-1.5 text-sm min-w-[180px]", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "", children: t('admin.activity.all_events') }), activityEventTypes.map((ev)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: ev, children: ev }, ev)) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs font-medium text-gray-500 mb-1", children: t('admin.activity.from') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "date", value: activityDateFrom, onChange: (e)=>setActivityDateFrom(e.target.value), className: "border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs font-medium text-gray-500 mb-1", children: t('admin.activity.to') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "date", value: activityDateTo, onChange: (e)=>setActivityDateTo(e.target.value), className: "border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), (activityEvent || activityDateFrom || activityDateTo || activityUserId) && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { onClick: ()=>{ setActivityEvent(''); setActivityDateFrom(''); setActivityDateTo(''); setActivityUserId(''); }, 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: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-3 h-3", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: "18", y1: "6", x2: "6", y2: "18" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: "6", y1: "6", x2: "18", y2: "18" }) ] }), t('admin.activity.reset') ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { className: "text-xs text-gray-400 self-end ml-auto", children: [ t('admin.activity.total'), ": ", activityTotal ] }) ] }), activityLog.length === 0 ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-center py-10 text-gray-400", children: t('admin.activity.empty') }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "space-y-2", children: activityLog.map((entry)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(ActivityLogRow, { entry: entry, dateLocale: dateLocale, onFilterUser: (id)=>{ setActivityUserId(id); setActivityEvent(''); }, t: t }, entry.id)) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Pagination, { page: activityPage, total: activityTotal, limit: 50, onChange: setActivityPage, totalLabel: t('admin.pagination.total') }) ] }), logsSubTab === 'mail' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-4 mb-4 flex flex-wrap gap-3 items-end", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs font-medium text-gray-500 mb-1", children: t('admin.mail.event') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("select", { value: mailEvent, onChange: (e)=>setMailEvent(e.target.value), className: "border border-gray-300 rounded-lg px-3 py-1.5 text-sm min-w-[200px]", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "", children: t('admin.mail.all_events') }), mailEventTypes.map((ev)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: ev, children: t("admin.event.".concat(ev.replace(/\./g, '_')), ev) }, ev)) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs font-medium text-gray-500 mb-1", children: t('admin.mail.from') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "date", value: mailDateFrom, onChange: (e)=>setMailDateFrom(e.target.value), className: "border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs font-medium text-gray-500 mb-1", children: t('admin.mail.to') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "date", value: mailDateTo, onChange: (e)=>setMailDateTo(e.target.value), className: "border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), (mailEvent || mailDateFrom || mailDateTo) && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { onClick: ()=>{ setMailEvent(''); setMailDateFrom(''); setMailDateTo(''); }, 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: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-3 h-3", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: "18", y1: "6", x2: "6", y2: "18" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: "6", y1: "6", x2: "18", y2: "18" }) ] }), t('admin.mail.reset') ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { className: "text-xs text-gray-400 self-end ml-auto", children: [ t('admin.mail.total'), ": ", mailTotal ] }) ] }), mailLog.length === 0 ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-center py-10 text-gray-400", children: t('admin.mail.empty') }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "overflow-x-auto rounded-xl border border-gray-200", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("table", { className: "w-full text-sm", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("thead", { className: "bg-gray-50 text-gray-500 text-xs uppercase", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("tr", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 text-left", children: t('admin.logs.date') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 text-left", children: t('admin.mail.recipient') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 text-left", children: t('admin.mail.event') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 text-left", children: t('admin.mail.provider') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 text-left", children: t('admin.mail.details') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 text-center", children: t('admin.mail.status') }) ] }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("tbody", { className: "divide-y divide-gray-100", children: mailLog.map((entry)=>{ const details = parseLogDetails(entry.details); const provider = typeof (details === null || details === void 0 ? void 0 : details.provider) === 'string' ? details.provider : '—'; const recipient = typeof (details === null || details === void 0 ? void 0 : details.to) === 'string' ? details.to : entry.userEmail || '—'; const subject = typeof (details === null || details === void 0 ? void 0 : details.subject) === 'string' ? details.subject : ''; const error = typeof (details === null || details === void 0 ? void 0 : details.error) === 'string' ? details.error : ''; const success = entry.event === 'email.sent' || entry.event === 'admin.email.test.sent'; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("tr", { className: "bg-white hover:bg-gray-50 align-top", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3 text-gray-500 whitespace-nowrap", children: new Date(entry.createdAt).toLocaleString(dateLocale) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3 text-gray-700", children: recipient }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "px-2 py-0.5 rounded-full text-xs font-medium bg-sky-50 text-sky-700", children: t("admin.event.".concat(entry.event.replace(/\./g, '_')), entry.event) }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3 text-gray-600", children: provider }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3 text-gray-600 max-w-md", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "truncate", title: subject || error || undefined, children: subject || error || '—' }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3 text-center", children: success ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-green-600 inline-flex justify-center", title: t('admin.mail.success'), children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("polyline", { points: "20 6 9 17 4 12" }) }) }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-red-500 inline-flex justify-center", title: error || t('admin.mail.failed'), children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: "18", y1: "6", x2: "6", y2: "18" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: "6", y1: "6", x2: "18", y2: "18" }) ] }) }) }) ] }, entry.id); }) }) ] }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Pagination, { page: mailPage, total: mailTotal, limit: 50, onChange: setMailPage, totalLabel: t('admin.pagination.total') }) ] }), logsSubTab === 'notifications' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-4 mb-4 flex flex-wrap gap-3 items-end", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs font-medium text-gray-500 mb-1", children: t('admin.notif_logs.type') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("select", { value: notifLogsType, onChange: (e)=>setNotifLogsType(e.target.value), className: "border border-gray-300 rounded-lg px-3 py-1.5 text-sm min-w-[200px]", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "", children: t('admin.filter.all') }), notifLogsTypes.map((tp)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: tp, children: tp }, tp)) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs font-medium text-gray-500 mb-1", children: t('admin.activity.from') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "date", value: notifLogsDateFrom, onChange: (e)=>setNotifLogsDateFrom(e.target.value), className: "border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs font-medium text-gray-500 mb-1", children: t('admin.activity.to') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "date", value: notifLogsDateTo, onChange: (e)=>setNotifLogsDateTo(e.target.value), className: "border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), (notifLogsType || notifLogsDateFrom || notifLogsDateTo) && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { onClick: ()=>{ setNotifLogsType(''); setNotifLogsDateFrom(''); setNotifLogsDateTo(''); }, 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: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-3 h-3", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: "18", y1: "6", x2: "6", y2: "18" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: "6", y1: "6", x2: "18", y2: "18" }) ] }), t('admin.activity.reset') ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { className: "text-xs text-gray-400 self-end ml-auto", children: [ t('admin.pagination.total'), ": ", notifLogsTotal ] }) ] }), notifLogs.length === 0 ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-center py-10 text-gray-400", children: t('admin.notif_logs.empty') }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "overflow-x-auto rounded-xl border border-gray-200", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("table", { className: "w-full text-sm", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("thead", { className: "bg-gray-50 text-gray-500 text-xs uppercase", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("tr", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 text-left", children: t('admin.logs.date') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 text-left", children: t('admin.col.user') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 text-left", children: t('admin.notif_logs.type') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 text-left", children: t('admin.notif_logs.title') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 text-center", children: t('admin.notif_logs.read') }) ] }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("tbody", { className: "divide-y divide-gray-100", children: notifLogs.map((n)=>{ var _n_recipientName, _ref; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("tr", { className: "bg-white hover:bg-gray-50", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3 text-gray-500 whitespace-nowrap", children: new Date(n.createdAt).toLocaleString(dateLocale) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3 text-gray-700", children: (_ref = (_n_recipientName = n.recipientName) !== null && _n_recipientName !== void 0 ? _n_recipientName : n.recipientEmail) !== null && _ref !== void 0 ? _ref : n.recipientId }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "px-2 py-0.5 rounded-full text-xs font-medium bg-green-50 text-green-700", children: n.type }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3 text-gray-600 max-w-xs truncate", children: n.title }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3 text-center", children: n.isRead ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-green-600 flex justify-center", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("polyline", { points: "20 6 9 17 4 12" }) }) }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-gray-400 flex justify-center", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("circle", { cx: "12", cy: "12", r: "10" }) }) }) }) ] }, n.id); }) }) ] }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Pagination, { page: notifLogsPage, total: notifLogsTotal, limit: 50, onChange: setNotifLogsPage, totalLabel: t('admin.pagination.total') }) ] }) ] }), tab === 'plans' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-between mb-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("h2", { className: "text-lg font-semibold text-gray-800 flex items-center gap-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-5 h-5 text-green-600", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("rect", { x: "1", y: "4", width: "22", height: "16", rx: "2", ry: "2" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: "1", y1: "10", x2: "23", y2: "10" }) ] }), t('admin.plans.title') ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: openAddPlan, className: "bg-green-600 text-white text-sm px-4 py-2 rounded-lg hover:bg-green-700 font-medium", children: t('admin.plans.add') }) ] }), planForm && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white border border-gray-200 rounded-xl p-5 mb-4 space-y-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h3", { className: "font-semibold text-gray-800", children: planForm.id ? t('admin.plans.form.edit') : t('admin.plans.form.new') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "grid grid-cols-2 gap-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.name') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: planForm.name, onChange: (e)=>setPlanForm({ ...planForm, name: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.price') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "number", min: "0", step: "0.01", value: planForm.price, onChange: (e)=>setPlanForm({ ...planForm, price: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.old_price') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "number", min: "0", step: "0.01", value: (_planForm_oldPrice = planForm.oldPrice) !== null && _planForm_oldPrice !== void 0 ? _planForm_oldPrice : '', onChange: (e)=>setPlanForm({ ...planForm, oldPrice: e.target.value }), placeholder: "—", className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.tier') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("select", { value: planForm.tier, onChange: (e)=>setPlanForm({ ...planForm, tier: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "free", children: t('admin.plans.form.tier.free') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "pro", children: t('admin.plans.form.tier.pro') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "ultimate", children: t('admin.plans.form.tier.ultimate') }) ] }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.description') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: planForm.description, onChange: (e)=>setPlanForm({ ...planForm, description: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs font-semibold text-gray-500 uppercase tracking-wide pt-1", children: t('admin.plans.form.section.limits') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "grid grid-cols-3 gap-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.max_tasks') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "number", min: "0", placeholder: "∞", value: planForm.maxTasks, onChange: (e)=>setPlanForm({ ...planForm, maxTasks: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.max_offers') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "number", min: "0", placeholder: "∞", value: planForm.maxOffers, onChange: (e)=>setPlanForm({ ...planForm, maxOffers: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.max_cards') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "number", min: "0", placeholder: "∞", value: planForm.maxCards, onChange: (e)=>setPlanForm({ ...planForm, maxCards: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.max_messages_day') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "number", min: "0", placeholder: "∞", value: planForm.maxMessagesPerDay, onChange: (e)=>setPlanForm({ ...planForm, maxMessagesPerDay: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.max_orders_day') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "number", min: "0", placeholder: "∞", value: planForm.maxOrdersPerDay, onChange: (e)=>setPlanForm({ ...planForm, maxOrdersPerDay: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.max_skills') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "number", min: "0", placeholder: "∞", value: planForm.maxSkills, onChange: (e)=>setPlanForm({ ...planForm, maxSkills: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.duration_days') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "number", min: "0", placeholder: "∞", value: planForm.durationDays, onChange: (e)=>setPlanForm({ ...planForm, durationDays: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs font-semibold text-gray-500 uppercase tracking-wide pt-1", children: t('admin.plans.form.section.boost') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "grid grid-cols-2 gap-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.search_boost') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "number", min: "0", value: planForm.searchBoost, onChange: (e)=>setPlanForm({ ...planForm, searchBoost: Number(e.target.value) }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.offers_multiplier') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "number", min: "0", step: "0.01", value: planForm.offersMultiplier, onChange: (e)=>setPlanForm({ ...planForm, offersMultiplier: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.features') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("textarea", { rows: 3, value: planForm.features, onChange: (e)=>setPlanForm({ ...planForm, features: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 resize-none" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs font-semibold text-gray-500 uppercase tracking-wide pt-1", children: t('admin.plans.form.section.contact') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "grid grid-cols-2 gap-2", children: [ [ 'canContactFreePlan', t('admin.plans.form.can_contact_free') ], [ 'canContactProPlan', t('admin.plans.form.can_contact_pro') ], [ 'canContactAll', t('admin.plans.form.can_contact_all') ], [ 'canShowContactInfo', t('admin.plans.form.can_show_contact') ], [ 'canViewPhone', t('admin.plans.form.can_view_phone') ] ].map((param)=>{ let [key, label] = param; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "flex items-center gap-2 cursor-pointer text-sm text-gray-700", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "checkbox", checked: planForm[key], onChange: (e)=>setPlanForm({ ...planForm, [key]: e.target.checked }), className: "w-4 h-4 rounded text-green-600" }), label ] }, key); }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs font-semibold text-gray-500 uppercase tracking-wide pt-1", children: t('admin.plans.form.section.features') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "grid grid-cols-2 gap-2", children: [ [ 'notifyNewTasks', t('admin.plans.form.notify') ], [ 'canUploadVideo', t('admin.plans.form.upload_video') ], [ 'hasFavorites', t('admin.plans.form.favorites') ], [ 'hasGoogleCalendar', t('admin.plans.form.google_calendar') ], [ 'hasVerifiedBadge', t('admin.plans.form.verified_badge') ], [ 'highlightedReviews', t('admin.plans.form.highlighted_reviews') ], [ 'hasPersonalSite', t('admin.plans.form.personal_site') ], [ 'hasCanHelpNowStatus', t('admin.plans.form.can_help_now') ], [ 'hasNeedHelpStatus', t('admin.plans.form.need_help') ], [ 'hasAutoResponse', t('admin.plans.form.auto_response') ], [ 'hasAutoMatch', t('admin.plans.form.auto_match') ], [ 'hasPriceList', t('admin.plans.form.price_list') ], [ 'receiveInstantDispatchFree', t('admin.plans.form.instant_dispatch_free') ], [ 'receiveInstantDispatchPro', t('admin.plans.form.instant_dispatch_pro') ] ].map((param)=>{ let [key, label] = param; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "flex items-center gap-2 cursor-pointer text-sm text-gray-700", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "checkbox", checked: planForm[key], onChange: (e)=>setPlanForm({ ...planForm, [key]: e.target.checked }), className: "w-4 h-4 rounded text-green-600" }), label ] }, key); }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-6 pt-1", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "flex items-center gap-2 cursor-pointer text-sm text-gray-700", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "checkbox", checked: planForm.isDefault, onChange: (e)=>setPlanForm({ ...planForm, isDefault: e.target.checked }), className: "w-4 h-4 rounded text-green-600" }), t('admin.plans.form.default') ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "flex items-center gap-2 cursor-pointer text-sm text-gray-700", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "checkbox", checked: planForm.isActive, onChange: (e)=>setPlanForm({ ...planForm, isActive: e.target.checked }), className: "w-4 h-4 rounded text-green-600" }), t('admin.plans.form.active') ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "text-xs text-gray-600", children: t('admin.plans.form.order') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "number", value: planForm.order, onChange: (e)=>setPlanForm({ ...planForm, order: Number(e.target.value) }), className: "w-16 border border-gray-300 rounded-lg px-2 py-1 text-sm focus:outline-none" }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-2 pt-1", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: savePlan, disabled: planSaving || !planForm.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: planSaving ? '...' : t('common.save') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>setPlanForm(null), className: "px-4 py-2 rounded-lg text-sm font-medium text-gray-600 hover:bg-gray-100", children: t('common.cancel') }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "bg-white rounded-xl border border-gray-200 overflow-hidden", children: planRows.length === 0 ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "px-4 py-8 text-center text-gray-400 text-sm", children: t('admin.plans.empty') }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "divide-y divide-gray-100", children: planRows.sort((a, b)=>{ var _a_order, _b_order; return ((_a_order = a.order) !== null && _a_order !== void 0 ? _a_order : 0) - ((_b_order = b.order) !== null && _b_order !== void 0 ? _b_order : 0); }).map((plan)=>{ var _plan_features; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-start gap-4 px-4 py-4 ".concat(!plan.isActive ? 'opacity-50' : ''), children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-2 flex-wrap", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "font-semibold text-gray-900", children: plan.name }), plan.isDefault && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "bg-green-100 text-green-700 text-xs px-2 py-0.5 rounded-full font-medium", children: t('admin.plans.badge.default') }), !plan.isActive && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "bg-gray-100 text-gray-500 text-xs px-2 py-0.5 rounded-full", children: t('admin.plans.badge.inactive') }) ] }), plan.description && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-gray-500 mt-0.5", children: plan.description }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex flex-wrap gap-3 mt-1 text-xs text-gray-500", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "flex items-center gap-1.5 font-semibold text-gray-800", children: [ plan.oldPrice && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "font-normal text-gray-400 line-through", children: [ plan.oldPrice, " ", plan.currency ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { children: [ plan.price, " ", plan.currency ] }) ] }), plan.maxTasks != null && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { children: [ t('admin.plans.tasks'), ": ", plan.maxTasks ] }), plan.maxOffers != null && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { children: [ t('admin.plans.offers'), ": ", plan.maxOffers ] }), plan.maxCards != null && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { children: [ t('admin.plans.cards'), ": ", plan.maxCards ] }), plan.notifyNewTasks && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "text-green-700 flex items-center gap-1", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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" }) }), t('admin.plans.notify_tasks') ] }) ] }), ((_plan_features = plan.features) !== null && _plan_features !== void 0 ? _plan_features : []).length > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("ul", { className: "mt-1.5 space-y-0.5", children: plan.features.map((f, i)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("li", { className: "text-xs text-gray-600 flex items-center gap-1.5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-green-500", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3 h-3", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("polyline", { points: "20 6 9 17 4 12" }) }) }), " ", f ] }, i)) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-1 shrink-0", children: [ !plan.isDefault && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updatePlan */ .td(plan.id, { isDefault: true }).then(()=>_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminPlans */ .OX().then(setPlanRows)).catch(()=>{}), className: "text-xs px-2 py-1 rounded-lg bg-green-50 text-green-600 hover:bg-green-100 font-medium", title: t('admin.plans.make_default'), children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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" }) }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>openEditPlan(plan), className: "text-xs px-2 py-1 rounded-lg bg-gray-100 text-gray-600 hover:bg-gray-200 font-medium", children: t('common.edit') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>deletePlan(plan.id, plan.name), className: "text-xs px-2 py-1 rounded-lg bg-red-50 text-red-600 hover:bg-red-100 font-medium", children: t('common.delete') }) ] }) ] }, plan.id); }) }) }) ] }), tab === 'settings' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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((st)=>{ const labels = { general: t('admin.settings.tab.general'), smtp: t('admin.settings.tab.smtp'), notifications: t('admin.settings.tab.notifications'), payment: t('admin.settings.tab.payment'), referral: t('admin.settings.tab.referral'), seo: t('admin.settings.tab.seo'), socials: t('admin.settings.tab.socials'), telegram: t('admin.settings.tab.telegram') }; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>setSettingsTab(st), className: "px-4 py-2 rounded-lg text-sm font-medium transition ".concat(settingsTab === st ? 'bg-green-600 text-white shadow-sm' : 'text-gray-600 hover:bg-gray-100'), children: labels[st] }, st); }) }), settingsTab === 'general' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-6 max-w-lg", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h3", { className: "font-semibold text-gray-800 mb-5", children: t('admin.settings.general.title') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.general.site_name') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: generalForm.siteName, onChange: (e)=>setGeneralForm((f)=>({ ...f, siteName: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400", placeholder: "CanHelp" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.general.site_url') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: generalForm.siteUrl, onChange: (e)=>setGeneralForm((f)=>({ ...f, siteUrl: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400", placeholder: "https://canhelp.com" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.general.contact_email') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "email", value: generalForm.contactEmail, onChange: (e)=>setGeneralForm((f)=>({ ...f, contactEmail: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400", placeholder: "contact@canhelp.com" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.general.support_phone') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: generalForm.supportPhone, onChange: (e)=>setGeneralForm((f)=>({ ...f, supportPhone: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400", placeholder: "+30 21 000 0000" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: saveGeneralSettings, disabled: generalSaving, 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: generalSaving ? t('admin.settings.saving') : generalSaved ? t('admin.settings.saved') : t('common.save') }) ] }) ] }), settingsTab === 'smtp' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-6 max-w-lg", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h3", { className: "font-semibold text-gray-800 mb-1", children: t('admin.settings.smtp.title') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-gray-400 mb-5", children: t('admin.settings.smtp.hint') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "grid grid-cols-3 gap-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "col-span-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.smtp.host') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: smtpForm.host, onChange: (e)=>setSmtpForm((f)=>({ ...f, host: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400", placeholder: "smtp.gmail.com" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.smtp.port') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: smtpForm.port, onChange: (e)=>setSmtpForm((f)=>({ ...f, port: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400", placeholder: "587" }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.smtp.encryption') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("select", { value: smtpForm.encryption, onChange: (e)=>setSmtpForm((f)=>({ ...f, encryption: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "none", children: t('admin.settings.smtp.enc.none') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "tls", children: "STARTTLS (587)" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "ssl", children: "SSL/TLS (465)" }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.smtp.username') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: smtpForm.username, onChange: (e)=>setSmtpForm((f)=>({ ...f, username: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400", placeholder: "user@gmail.com", autoComplete: "off" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.smtp.password') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "password", value: smtpForm.password, onChange: (e)=>setSmtpForm((f)=>({ ...f, password: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400", autoComplete: "new-password", placeholder: "••••••••••••" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "grid grid-cols-2 gap-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.smtp.from_name') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: smtpForm.fromName, onChange: (e)=>setSmtpForm((f)=>({ ...f, fromName: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400", placeholder: "CanHelp" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.smtp.from_email') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "email", value: smtpForm.fromEmail, onChange: (e)=>setSmtpForm((f)=>({ ...f, fromEmail: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400", placeholder: "noreply@canhelp.com" }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: saveSmtpSettings, disabled: smtpSaving, 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: smtpSaving ? t('admin.settings.saving') : smtpSaved ? t('admin.settings.saved') : t('common.save') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: async ()=>{ setTestEmailSending(true); setTestEmailResult(null); try { const res = await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .sendTestEmail */ .FI(); setTestEmailResult("✓ Sent to ".concat(res.to)); } catch (e) { setTestEmailResult("✗ Error: ".concat(e.message)); } finally{ setTestEmailSending(false); setTimeout(()=>setTestEmailResult(null), 5000); } }, disabled: testEmailSending, 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: testEmailSending ? t('admin.settings.smtp.sending') : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "flex items-center justify-center gap-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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" }) }), t('admin.settings.smtp.test') ] }) }), testEmailResult && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-center font-medium ".concat(testEmailResult.startsWith('✓') ? 'text-green-600' : 'text-red-500'), children: testEmailResult }) ] }) ] }), settingsTab === 'payment' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-6 max-w-lg", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-between mb-5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h3", { className: "font-semibold text-gray-800", children: "ePay — Piraeus Bank" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400", children: "ГреческОй платёжМый шлюз" }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "flex items-center gap-2 cursor-pointer", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-sm text-gray-500", children: t('admin.settings.active') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>setEPayForm((f)=>({ ...f, enabled: !f.enabled })), className: "relative w-10 h-6 rounded-full p-0 transition-colors cursor-pointer ".concat(ePayForm.enabled ? 'bg-green-600' : 'bg-gray-300'), children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "absolute left-0 top-1 w-4 h-4 bg-white rounded-full shadow transition-transform ".concat(ePayForm.enabled ? 'translate-x-5' : 'translate-x-1') }) }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.env.label') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("select", { value: ePayForm.environment, onChange: (e)=>setEPayForm((f)=>({ ...f, environment: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "test", children: t('admin.settings.env.test') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "production", children: t('admin.settings.env.prod') }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.merchant_id') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: ePayForm.merchantId, onChange: (e)=>setEPayForm((f)=>({ ...f, merchantId: e.target.value })), placeholder: t('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" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "grid grid-cols-2 gap-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: "API User" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: ePayForm.apiUser, onChange: (e)=>setEPayForm((f)=>({ ...f, apiUser: e.target.value })), autoComplete: "off", className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: "API Password" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "password", value: ePayForm.apiPassword, onChange: (e)=>setEPayForm((f)=>({ ...f, apiPassword: e.target.value })), autoComplete: "new-password", className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: "Confirmation URL (webhook)" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: ePayForm.confirmationUrl, onChange: (e)=>setEPayForm((f)=>({ ...f, confirmationUrl: e.target.value })), placeholder: "https://yoursite.com/api/payments/epay/confirm", className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: "Cancel URL" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: ePayForm.cancelUrl, onChange: (e)=>setEPayForm((f)=>({ ...f, cancelUrl: e.target.value })), placeholder: "https://yoursite.com/payment/cancelled", className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-3 mt-5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: saveEPaySettings, disabled: ePaySaving, className: "px-5 py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700 disabled:opacity-50", children: ePaySaving ? t('admin.settings.saving') : t('common.save') }), ePaySaved && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-sm text-green-600", children: t('admin.settings.saved') }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-4 h-4 shrink-0 mt-0.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("circle", { cx: "12", cy: "12", r: "10" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: "12", y1: "8", x2: "12", y2: "12" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: "12", y1: "16", x2: "12.01", y2: "16" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { children: t('admin.settings.payment.hint') }) ] }) ] }), settingsTab === 'notifications' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-3 max-w-2xl", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-4 h-4 shrink-0 mt-0.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("circle", { cx: "12", cy: "12", r: "10" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: "12", y1: "8", x2: "12", y2: "12" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: "12", y1: "16", x2: "12.01", y2: "16" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { children: [ t('admin.notif.vars_hint'), ' ', TEMPLATE_HINT_VARS.map((name)=>{ const v = "{{".concat(name, "}}"); return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("code", { className: "mx-0.5 bg-green-100 text-gray-800 px-1.5 py-0.5 rounded text-xs font-mono", children: v }, v); }) ] }) ] }), [ { key: 'email_verification', label: t('admin.notif.email_verification'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: t('admin.notif.registration_success'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: t('admin.notif.password_reset'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: t('admin.notif.new_offer'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: t('admin.notif.new_task'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: t('admin.notif.offer_accepted'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" }) }) }, { key: 'new_message', label: t('admin.notif.new_message'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: t('admin.notif.offer_declined'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: t('admin.notif.offer_other_accepted'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: t('admin.notif.task_updated'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: t('admin.notif.deadline_reminder'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: t('admin.notif.task_archived'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: t('admin.notif.referral_reward'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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" }) }) }, // ── Plan / subscription emails ───────────────────────────── { key: 'plan_activated', label: t('admin.email_template.plan_activated'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: t('admin.email_template.plan_upgraded'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 10l7-7m0 0l7 7m-7-7v18" }) }) }, { key: 'plan_downgrade_scheduled', label: t('admin.email_template.plan_downgrade_scheduled'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: t('admin.email_template.plan_downgrade_applied'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19 14l-7 7m0 0l-7-7m7 7V3" }) }) }, { key: 'plan_renewal_reminder', label: t('admin.email_template.plan_renewal_reminder'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: t('admin.email_template.plan_insufficient_funds'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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((param)=>{ let { key, label, icon } = param; const localeKey = "".concat(key, "_").concat(templateLocale); var _notifTemplates_localeKey, _ref; const tmpl = (_ref = (_notifTemplates_localeKey = notifTemplates[localeKey]) !== null && _notifTemplates_localeKey !== void 0 ? _notifTemplates_localeKey : notifTemplates[key]) !== null && _ref !== void 0 ? _ref : { subject: '', body: '' }; const isEditing = editingTemplate === key; var _TEMPLATE_VARS_key; const templateVars = (_TEMPLATE_VARS_key = TEMPLATE_VARS[key]) !== null && _TEMPLATE_VARS_key !== void 0 ? _TEMPLATE_VARS_key : []; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 overflow-hidden", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-3 px-5 py-4 cursor-pointer hover:bg-gray-50 select-none", onClick: ()=>setEditingTemplate(isEditing ? null : key), children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-xl shrink-0", children: icon }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "font-medium text-gray-800 text-sm", children: label }), tmpl.subject ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "text-xs text-gray-400 mt-0.5 truncate", children: [ t('admin.notif.tmpl.subject_label'), ": ", tmpl.subject ] }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-xs text-gray-300 mt-0.5 italic", children: t('admin.notif.tmpl.not_set') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-gray-400 transition-transform ".concat(isEditing ? 'rotate-90' : ''), children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("polyline", { points: "9 18 15 12 9 6" }) }) }) ] }), isEditing && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "px-5 pb-5 border-t border-gray-100 pt-4 space-y-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex gap-1 pb-2", children: [ 'el', 'en', 'uk', 'ru' ].map((loc)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>setTemplateLocale(loc), className: "px-3 py-1 text-xs font-medium rounded-md transition-colors ".concat(templateLocale === loc ? 'bg-green-600 text-white' : 'bg-gray-100 text-gray-600 hover:bg-gray-200'), children: loc === 'el' ? 'ΕλληΜικά' : loc === 'en' ? 'English' : loc === 'uk' ? 'УкраїМська' : 'РусскОй' }, loc)) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.notif.tmpl.subject_label') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: tmpl.subject, onChange: (e)=>setNotifTemplates((prev)=>{ var _prev_localeKey; return { ...prev, [localeKey]: { ...(_prev_localeKey = prev[localeKey]) !== null && _prev_localeKey !== void 0 ? _prev_localeKey : { subject: '', body: '' }, subject: e.target.value } }; }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.notif.tmpl.body_label') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("textarea", { rows: 7, value: tmpl.body, onChange: (e)=>setNotifTemplates((prev)=>{ var _prev_localeKey; return { ...prev, [localeKey]: { ...(_prev_localeKey = prev[localeKey]) !== null && _prev_localeKey !== void 0 ? _prev_localeKey : { subject: '', body: '' }, body: e.target.value } }; }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 font-mono resize-y", placeholder: "

УважаеЌый {{userName}},

..." }) ] }), templateVars.length > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "rounded-lg border border-amber-200 bg-amber-50 px-3 py-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-xs font-medium text-amber-800 mb-1", children: t('admin.notif.vars_hint') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex flex-wrap gap-1.5", children: templateVars.map((name)=>{ const variable = "{{".concat(name, "}}"); return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("code", { className: "bg-amber-100 text-amber-900 px-1.5 py-0.5 rounded text-xs font-mono", children: variable }, variable); }) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-2 flex-wrap", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>saveTemplate(key), disabled: templateSaving || templateTranslating, className: "px-4 py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700 disabled:opacity-50", children: templateSaving ? t('admin.notif.tmpl.saving') : t('admin.notif.tmpl.save') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { onClick: ()=>autoTranslateTemplate(key), disabled: templateSaving || templateTranslating, 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: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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" }) }), templateTranslating ? t('admin.notif.tmpl.translating') : t('admin.notif.tmpl.translate') ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>setEditingTemplate(null), className: "px-4 py-2 bg-gray-100 text-gray-700 rounded-lg text-sm font-medium hover:bg-gray-200", children: t('admin.notif.tmpl.close') }) ] }) ] }) ] }, key); }) ] }), settingsTab === 'referral' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-6 max-w-lg space-y-5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h3", { className: "font-semibold text-gray-800", children: t('admin.settings.referral.title') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-gray-400 mt-1", children: t('admin.settings.referral.hint') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-between", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm font-medium text-gray-700", children: t('admin.settings.referral.enabled_label') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400", children: t('admin.settings.referral.enabled_hint') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>setReferralForm((f)=>({ ...f, enabled: !f.enabled })), className: "relative w-10 h-6 rounded-full p-0 transition-colors cursor-pointer ".concat(referralForm.enabled ? 'bg-green-600' : 'bg-gray-300'), children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "absolute left-0 top-1 w-4 h-4 bg-white rounded-full shadow transition-transform ".concat(referralForm.enabled ? 'translate-x-5' : 'translate-x-1') }) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "border border-gray-100 rounded-lg p-4 space-y-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs font-semibold text-gray-500 uppercase tracking-wide", children: t('admin.settings.referral.shared_section') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.referral.plan_label') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("select", { value: referralForm.planId, onChange: (e)=>setReferralForm((f)=>({ ...f, planId: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "", children: t('admin.settings.referral.no_plan') }), planRows.map((p)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: p.id, children: p.name }, p.id)) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400 mt-1", children: t('admin.settings.referral.plan_hint') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.referral.days_label') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "number", min: "1", max: "365", value: referralForm.days, onChange: (e)=>setReferralForm((f)=>({ ...f, days: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400 mt-1", children: t('admin.settings.referral.days_hint') }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: saveReferralSettings, disabled: referralSaving, className: "px-5 py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700 disabled:opacity-50", children: referralSaving ? t('admin.settings.saving') : t('common.save') }), referralSaved && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-sm text-green-600", children: t('admin.settings.saved') }) ] }) ] }), settingsTab === 'socials' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-6 max-w-lg space-y-5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h3", { className: "font-semibold text-gray-800 mb-1", children: t('admin.settings.socials.title') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400", children: t('admin.settings.socials.hint') }) ] }), [ { key: 'telegram', label: 'Telegram', placeholder: 'https://t.me/yourname', icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4", viewBox: "0 0 24 24", fill: "currentColor", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4", viewBox: "0 0 24 24", fill: "currentColor", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4", viewBox: "0 0 24 24", fill: "currentColor", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4", viewBox: "0 0 24 24", fill: "currentColor", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4", viewBox: "0 0 24 24", fill: "currentColor", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4", viewBox: "0 0 24 24", fill: "currentColor", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4", viewBox: "0 0 24 24", fill: "currentColor", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4", viewBox: "0 0 24 24", fill: "currentColor", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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((param)=>{ let { key, label, placeholder, icon } = param; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "block text-sm font-medium text-gray-700 mb-1 flex items-center gap-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "".concat(socialForm[key] ? 'text-green-600' : 'text-gray-300'), children: icon }), label, !socialForm[key] && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-xs font-normal text-gray-400 ml-auto", children: "Ме запПлМеМП" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "url", value: socialForm[key], onChange: (e)=>setSocialForm((f)=>({ ...f, [key]: e.target.value })), placeholder: placeholder, className: "w-full border rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 ".concat(socialForm[key] ? 'border-green-300 bg-green-50/30' : 'border-gray-300') }) ] }, key); }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-3 pt-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: saveSocialSettings, disabled: socialSaving, className: "px-5 py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700 disabled:opacity-50", children: socialSaving ? t('admin.settings.saving') : t('common.save') }), socialSaved && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-sm text-green-600", children: t('admin.settings.saved') }) ] }) ] }), settingsTab === 'seo' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-6 max-w-lg space-y-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h3", { className: "font-semibold text-gray-800", children: t('admin.settings.seo.title') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-between", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm font-medium text-gray-700", children: t('admin.settings.seo.maintenance_label') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400 mt-0.5", children: t('admin.settings.seo.maintenance_hint') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>setSeoForm((f)=>({ ...f, maintenanceMode: !f.maintenanceMode })), className: "relative w-10 h-6 rounded-full p-0 transition-colors cursor-pointer flex-shrink-0 ".concat(seoForm.maintenanceMode ? 'bg-red-500' : 'bg-gray-300'), children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "absolute left-0 top-1 w-4 h-4 bg-white rounded-full shadow transition-transform ".concat(seoForm.maintenanceMode ? 'translate-x-5' : 'translate-x-1') }) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-between", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm font-medium text-gray-700", children: t('admin.settings.seo.indexing_label') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400 mt-0.5", children: t('admin.settings.seo.indexing_hint') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>setSeoForm((f)=>({ ...f, indexingEnabled: !f.indexingEnabled })), className: "relative w-10 h-6 rounded-full p-0 transition-colors cursor-pointer flex-shrink-0 ".concat(seoForm.indexingEnabled ? 'bg-green-600' : 'bg-gray-300'), children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "absolute left-0 top-1 w-4 h-4 bg-white rounded-full shadow transition-transform ".concat(seoForm.indexingEnabled ? 'translate-x-5' : 'translate-x-1') }) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "space-y-4", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { className: "text-sm font-medium text-gray-700 mb-2", children: [ t('admin.settings.seo.site_title_label'), " / ", t('admin.settings.seo.site_description_label') ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex gap-1 mb-3", children: [ { code: 'el', flag: '🇬🇷', label: 'EL' }, { code: 'en', flag: '🇬🇧', label: 'EN' }, { code: 'ru', flag: '🇷🇺', label: 'RU' }, { code: 'uk', flag: '🇺🇊', label: 'UK' } ].map((param)=>{ let { code, flag, label } = param; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { type: "button", onClick: ()=>setSeoLangTab(code), className: "flex items-center gap-1 px-3 py-1.5 rounded-lg text-sm font-medium transition-colors ".concat(seoLangTab === code ? 'bg-green-600 text-white' : 'bg-gray-100 text-gray-600 hover:bg-gray-200'), children: [ flag, " ", label ] }, code); }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs font-medium text-gray-500 mb-1", children: t('admin.settings.seo.site_title_label') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: seoForm["siteTitle".concat(seoLangTab.charAt(0).toUpperCase() + seoLangTab.slice(1))], onChange: (e)=>setSeoForm((f)=>({ ...f, ["siteTitle".concat(seoLangTab.charAt(0).toUpperCase() + seoLangTab.slice(1))]: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 mb-3", placeholder: seoLangTab === 'el' ? 'CanHelp — ΚάΞε άΜΞρωπος έχει κάτι Μα προσφέρει' : seoLangTab === 'en' ? 'CanHelp — Everyone has something valuable to offer' : seoLangTab === 'ru' ? 'CanHelp — КажЎый челПвек ЌПжет чеЌ-тП пПЌПчь' : 'CanHelp — КПжеМ Ќає МавОчку, яка ЌПже ЎПпПЌПгтО іМшПЌу' }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs font-medium text-gray-500 mb-1", children: t('admin.settings.seo.site_description_label') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("textarea", { rows: 3, value: seoForm["siteDescription".concat(seoLangTab.charAt(0).toUpperCase() + seoLangTab.slice(1))], onChange: (e)=>setSeoForm((f)=>({ ...f, ["siteDescription".concat(seoLangTab.charAt(0).toUpperCase() + seoLangTab.slice(1))]: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 resize-none", placeholder: seoLangTab === 'el' ? 'Η ελληΜική πλατφόρΌα για online αΜάΞεση εργασιώΜ...' : seoLangTab === 'en' ? 'The Greek platform for online task delegation...' : seoLangTab === 'ru' ? 'Греческая платфПрЌа Ўля ПМлайМ-пПОска спецОалОстПв...' : 'Грецька платфПрЌа Ўля пПшуку фахівців ПМлайМ...' }) ] }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.seo.head_scripts_label') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400 mb-2", children: t('admin.settings.seo.head_scripts_hint') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("textarea", { rows: 6, value: seoForm.headScripts, onChange: (e)=>setSeoForm((f)=>({ ...f, headScripts: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm font-mono focus:outline-none focus:ring-2 focus:ring-blue-400 resize-y", placeholder: '\n', spellCheck: false }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: saveSeoSettings, disabled: seoSaving, className: "px-5 py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700 disabled:opacity-50", children: seoSaving ? t('admin.settings.saving') : t('common.save') }), seoSaved && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-sm text-green-600", children: t('admin.settings.saved') }) ] }) ] }), settingsTab === 'telegram' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-6 max-w-lg space-y-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h3", { className: "font-semibold text-gray-800 mb-1", children: t('admin.settings.telegram.title') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400", children: t('admin.settings.telegram.help') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.telegram.bot_token') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "text", value: telegramForm.botToken, onChange: (e)=>{ setTelegramForm((f)=>({ ...f, botToken: e.target.value })); setVerifyResultTelegramToken(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" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: verifyTelegramToken, disabled: verifyingTelegramToken || !telegramForm.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: verifyingTelegramToken ? '...' : t('admin.settings.telegram.verify') }) ] }), verifyResultTelegramToken && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs mt-1 font-medium ".concat(verifyResultTelegramToken.ok ? 'text-green-600' : 'text-red-500'), children: verifyResultTelegramToken.ok ? "✓ ".concat(verifyResultTelegramToken.msg) : "✗ ".concat(verifyResultTelegramToken.msg) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.telegram.admin_chat_id') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "text", value: telegramForm.adminChatId, onChange: (e)=>setTelegramForm((f)=>({ ...f, adminChatId: e.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" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>testTelegram('admin'), disabled: testingTelegramAdmin || !telegramForm.botToken || !telegramForm.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: testingTelegramAdmin ? '...' : t('admin.settings.telegram.test') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400 mt-1", children: t('admin.settings.telegram.admin_chat_hint') }), testResultTelegramAdmin && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs mt-1 font-medium ".concat(testResultTelegramAdmin.ok ? 'text-green-600' : 'text-red-500'), children: testResultTelegramAdmin.ok ? "✓ ".concat(testResultTelegramAdmin.msg) : "✗ ".concat(testResultTelegramAdmin.msg) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700", children: t('admin.settings.telegram.channels_title') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400 -mt-2", children: t('admin.settings.telegram.channel_hint') }), [ { locale: 'el', flag: '🇬🇷', label: 'ΕλληΜικά', field: 'channelIdEl' }, { locale: 'en', flag: '🇬🇧', label: 'English', field: 'channelIdEn' }, { locale: 'ru', flag: '🇷🇺', label: 'РусскОй', field: 'channelIdRu' }, { locale: 'uk', flag: '🇺🇊', label: 'УкраїМська', field: 'channelIdUk' } ].map((param)=>{ let { locale: loc, flag, label, field } = param; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-1.5 mb-1", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-base leading-none", children: flag }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-xs font-medium text-gray-600", children: label }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "text", value: telegramForm[field], onChange: (e)=>setTelegramForm((f)=>({ ...f, [field]: e.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" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>testTelegram(loc), disabled: testingLocale === loc || !telegramForm.botToken || !telegramForm[field], className: "px-3 py-2 border border-gray-300 rounded-lg text-sm hover:bg-gray-50 disabled:opacity-40 flex-shrink-0", children: testingLocale === loc ? '...' : t('admin.settings.telegram.test') }) ] }), testResultChannels[loc] && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs mt-1 font-medium ".concat(testResultChannels[loc].ok ? 'text-green-600' : 'text-red-500'), children: testResultChannels[loc].ok ? "✓ ".concat(testResultChannels[loc].msg) : "✗ ".concat(testResultChannels[loc].msg) }) ] }, loc); }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-between", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm font-medium text-gray-700", children: t('admin.settings.telegram.notify_registrations') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400 mt-0.5", children: t('admin.settings.telegram.notify_registrations_hint') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>setTelegramForm((f)=>({ ...f, notifyRegistrations: !f.notifyRegistrations })), className: "relative w-10 h-6 rounded-full transition-colors cursor-pointer flex-shrink-0 p-0 border-0 outline-none ".concat(telegramForm.notifyRegistrations ? 'bg-green-600' : 'bg-gray-300'), children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "absolute top-1 left-0 w-4 h-4 bg-white rounded-full shadow transition-transform ".concat(telegramForm.notifyRegistrations ? 'translate-x-5' : 'translate-x-1') }) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-between", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm font-medium text-gray-700", children: t('admin.settings.telegram.post_new_tasks') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400 mt-0.5", children: t('admin.settings.telegram.post_new_tasks_hint') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>setTelegramForm((f)=>({ ...f, postNewTasks: !f.postNewTasks })), className: "relative w-10 h-6 rounded-full transition-colors cursor-pointer flex-shrink-0 p-0 border-0 outline-none ".concat(telegramForm.postNewTasks ? 'bg-green-600' : 'bg-gray-300'), children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "absolute top-1 left-0 w-4 h-4 bg-white rounded-full shadow transition-transform ".concat(telegramForm.postNewTasks ? 'translate-x-5' : 'translate-x-1') }) }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-3 pt-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: saveTelegramSettings, disabled: telegramSaving, className: "px-5 py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700 disabled:opacity-50", children: telegramSaving ? t('admin.settings.saving') : t('common.save') }), telegramSaved && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-sm text-green-600", children: t('admin.settings.saved') }) ] }) ] }) ] }), tab === 'support' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex flex-wrap gap-3 mb-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("form", { className: "flex gap-2", onSubmit: (e)=>{ e.preventDefault(); setSupportQ(supportQInput); setSupportPage(1); }, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: supportQInput, onChange: (e)=>setSupportQInput(e.target.value), placeholder: t('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" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: t('admin.search', 'Search') }), supportQ && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>{ setSupportQInput(''); setSupportQ(''); setSupportPage(1); }, className: "text-sm text-gray-500 hover:text-gray-700 px-2", children: "✕" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("select", { value: supportStatus, onChange: (e)=>{ setSupportStatus(e.target.value); setSupportPage(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: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "", children: t('admin.support.all_statuses', 'All statuses') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "open", children: t('admin.support.status.open', 'Open') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "in_progress", children: t('admin.support.status.in_progress', 'In progress') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "resolved", children: t('admin.support.status.resolved', 'Resolved') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "closed", children: t('admin.support.status.closed', 'Closed') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("select", { value: supportType, onChange: (e)=>{ setSupportType(e.target.value); setSupportPage(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: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "", children: t('admin.support.all_types', 'All types') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("option", { value: "bug", children: [ "\uD83D\uDC1B ", t('support.type.bug', 'Bug') ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("option", { value: "suggestion", children: [ "\uD83D\uDCA1 ", t('support.type.suggestion', 'Suggestion') ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("option", { value: "other", children: [ "\uD83D\uDCAC ", t('support.type.other', 'Other') ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "ml-auto text-sm text-gray-400 self-center", children: [ supportTotal, " ", t('admin.pagination.total', 'total') ] }) ] }), loading ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-center py-10 text-gray-400", children: t('common.loading') }) : supportTickets.length === 0 ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-center py-10 text-gray-400", children: t('admin.support.none', 'No tickets') }) : supportTickets.map((ticket)=>{ const typeColors = { bug: 'bg-red-100 text-red-700', suggestion: 'bg-green-100 text-green-700', other: 'bg-gray-100 text-gray-600' }; const statusColors2 = { 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' }; const typeIcons = { bug: '🐛', suggestion: '💡', other: '💬' }; const isReplying = supportReplyId === ticket.id; var _typeColors_ticket_type, _statusColors2_ticket_status; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-start justify-between gap-4 mb-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-2 flex-wrap mb-1", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "px-2 py-0.5 rounded-full text-xs font-medium ".concat((_typeColors_ticket_type = typeColors[ticket.type]) !== null && _typeColors_ticket_type !== void 0 ? _typeColors_ticket_type : 'bg-gray-100 text-gray-600'), children: [ typeIcons[ticket.type], " ", ticket.type ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "px-2 py-0.5 rounded-full text-xs font-medium ".concat((_statusColors2_ticket_status = statusColors2[ticket.status]) !== null && _statusColors2_ticket_status !== void 0 ? _statusColors2_ticket_status : 'bg-gray-100 text-gray-500'), children: ticket.status }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "text-xs text-gray-400", children: [ "#", ticket.id.slice(0, 8) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h3", { className: "font-semibold text-gray-900 text-sm", children: ticket.subject }), ticket.userName && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { className: "text-xs text-gray-400 mt-0.5", children: [ ticket.userName, " \xb7 ", ticket.userEmail ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400 mt-0.5", children: new Date(ticket.createdAt).toLocaleString(dateLocale) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-2 flex-shrink-0", children: [ ticket.status !== 'closed' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>{ setSupportReplyId(isReplying ? null : ticket.id); setSupportReplyText(ticket.adminReply || ''); }, className: "text-xs px-3 py-1.5 rounded-lg font-medium bg-green-50 text-green-700 hover:bg-green-100", children: isReplying ? t('admin.support.cancel', 'Cancel') : t('admin.support.reply', 'Reply') }), ticket.status === 'open' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .setSupportTicketStatus */ .u0(ticket.id, 'closed').then(()=>setSupportTickets((prev)=>prev.map((t)=>t.id === ticket.id ? { ...t, status: 'closed' } : t))), className: "text-xs px-3 py-1.5 rounded-lg font-medium bg-gray-100 text-gray-600 hover:bg-gray-200", children: t('admin.support.close', 'Close') }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-gray-700 whitespace-pre-wrap bg-gray-50 rounded-lg p-3 mb-3", children: ticket.body }), ticket.adminReply && !isReplying && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-green-50 border border-green-100 rounded-lg p-3 mb-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { className: "text-xs font-medium text-green-600 mb-1", children: [ t('admin.support.your_reply', 'Your reply'), ":" ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-gray-800 whitespace-pre-wrap", children: ticket.adminReply }) ] }), isReplying && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-2 mt-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("textarea", { rows: 3, value: supportReplyText, onChange: (e)=>setSupportReplyText(e.target.value), placeholder: t('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" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-2 items-center", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("select", { id: "status-".concat(ticket.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: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "open", children: t('admin.support.status.open', 'Open') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "in_progress", children: t('admin.support.status.in_progress', 'In progress') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "resolved", children: t('admin.support.status.resolved', 'Resolved') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "closed", children: t('admin.support.status.closed', 'Closed') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { disabled: supportReplySaving || !supportReplyText.trim(), onClick: async ()=>{ const statusEl = document.getElementById("status-".concat(ticket.id)); setSupportReplySaving(true); try { const updated = await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .replyToSupportTicket */ .nT(ticket.id, { adminReply: supportReplyText, status: statusEl === null || statusEl === void 0 ? void 0 : statusEl.value }); setSupportTickets((prev)=>prev.map((t)=>t.id === ticket.id ? { ...t, ...updated } : t)); setSupportReplyId(null); } catch (e) {} finally{ setSupportReplySaving(false); } }, 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: supportReplySaving ? '...' : t('admin.support.send_reply', 'Send') }) ] }) ] }) ] }, ticket.id); }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Pagination, { page: supportPage, total: supportTotal, limit: 30, onChange: setSupportPage, totalLabel: t('admin.pagination.total') }) ] }), tab === 'push' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-5 space-y-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "text-lg font-semibold text-gray-800", children: "Push-рассылка" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>setPushMode('broadcast'), className: "px-3 py-1.5 text-sm rounded-lg border ".concat(pushMode === 'broadcast' ? 'bg-green-600 text-white border-green-600' : 'bg-white text-gray-700 border-gray-300'), children: "ВсеЌ пПльзПвателяЌ" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>setPushMode('user'), className: "px-3 py-1.5 text-sm rounded-lg border ".concat(pushMode === 'user' ? 'bg-green-600 text-white border-green-600' : 'bg-white text-gray-700 border-gray-300'), children: "КПМкретМПЌу пПльзПвателю" }) ] }), pushMode === 'user' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "text-sm text-gray-600 block mb-1", children: "User ID" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: pushTargetUserId, onChange: (e)=>setPushTargetUserId(e.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" }) ] }), pushMode === 'broadcast' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "flex items-center gap-2 text-sm text-gray-700", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "checkbox", checked: pushOnlyActive, onChange: (e)=>setPushOnlyActive(e.target.checked) }), "ТПлькП актОвМыЌ пПльзПвателяЌ" ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "text-sm text-gray-600 block mb-1", children: "ЗагПлПвПк" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: pushTitle, onChange: (e)=>setPushTitle(e.target.value), placeholder: "НапрОЌер: НПвые заЎачО ряЎПЌ с ваЌО", className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "text-sm text-gray-600 block mb-1", children: "Текст" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("textarea", { rows: 3, value: pushBody, onChange: (e)=>setPushBody(e.target.value), placeholder: "КПрПткОй текст увеЎПЌлеМОя", className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 resize-none" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "text-sm text-gray-600 block mb-1", children: "ТОп" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: pushType, onChange: (e)=>setPushType(e.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" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "text-sm text-gray-600 block mb-1", children: "Reference ID (ПпцОПМальМП)" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: pushReferenceId, onChange: (e)=>setPushReferenceId(e.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" }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: sendAdminPush, disabled: pushSending || !pushTitle.trim() || pushMode === 'user' && !pushTargetUserId.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: pushSending ? 'Отправка...' : 'ОтправОть Push' }), pushError && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-sm text-red-600", children: pushError }) ] }) ] }), pushResult && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h3", { className: "font-semibold text-gray-800 mb-3", children: "Результат" }), 'usersTotal' in pushResult ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "grid grid-cols-2 md:grid-cols-5 gap-3 text-sm", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "rounded-lg bg-gray-50 border border-gray-200 px-3 py-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-gray-500", children: "ППльзПвателей" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-gray-900 font-semibold", children: pushResult.usersTotal }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "rounded-lg bg-gray-50 border border-gray-200 px-3 py-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-gray-500", children: "ППлучОлО" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-gray-900 font-semibold", children: pushResult.usersWithSent }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "rounded-lg bg-gray-50 border border-gray-200 px-3 py-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-gray-500", children: "ОтправлеМП push" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-gray-900 font-semibold", children: pushResult.pushesSent }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "rounded-lg bg-gray-50 border border-gray-200 px-3 py-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-gray-500", children: "НевалОЎМые тПкеМы" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-gray-900 font-semibold", children: pushResult.invalidTokens }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "rounded-lg bg-gray-50 border border-gray-200 px-3 py-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-gray-500", children: "ОшОбкО пП userId" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-gray-900 font-semibold", children: pushResult.failedUsers.length }) ] }) ] }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "grid grid-cols-2 md:grid-cols-4 gap-3 text-sm", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "rounded-lg bg-gray-50 border border-gray-200 px-3 py-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-gray-500", children: "User ID" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-gray-900 font-mono text-xs break-all", children: pushResult.targetUserId }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "rounded-lg bg-gray-50 border border-gray-200 px-3 py-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-gray-500", children: "ТПкеМПв МайЎеМП" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-gray-900 font-semibold", children: (_pushResult_tokensFound = pushResult.tokensFound) !== null && _pushResult_tokensFound !== void 0 ? _pushResult_tokensFound : 0 }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "rounded-lg bg-gray-50 border border-gray-200 px-3 py-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-gray-500", children: "ОтправлеМП push" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-gray-900 font-semibold", children: pushResult.sent }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "rounded-lg bg-gray-50 border border-gray-200 px-3 py-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-gray-500", children: "НевалОЎМые тПкеМы" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-gray-900 font-semibold", children: pushResult.invalidTokens }) ] }) ] }), 'usersTotal' in pushResult ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: ((_pushResult_usersWithoutTokens = pushResult.usersWithoutTokens) !== null && _pushResult_usersWithoutTokens !== void 0 ? _pushResult_usersWithoutTokens : 0) > 0 || ((_pushResult_usersConfigBlocked = pushResult.usersConfigBlocked) !== null && _pushResult_usersConfigBlocked !== void 0 ? _pushResult_usersConfigBlocked : 0) > 0 || ((_pushResult_usersAuthFailed = pushResult.usersAuthFailed) !== null && _pushResult_usersAuthFailed !== void 0 ? _pushResult_usersAuthFailed : 0) > 0 || ((_pushResult_usersAllFailed = pushResult.usersAllFailed) !== null && _pushResult_usersAllFailed !== void 0 ? _pushResult_usersAllFailed : 0) > 0 ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "mt-3 rounded-lg border border-amber-200 bg-amber-50 px-3 py-2 text-xs text-amber-900", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ "ДОагМПстОка: без тПкеМПв — ", (_pushResult_usersWithoutTokens1 = pushResult.usersWithoutTokens) !== null && _pushResult_usersWithoutTokens1 !== void 0 ? _pushResult_usersWithoutTokens1 : 0, ", FCM Ме МастрПеМ — ", (_pushResult_usersConfigBlocked1 = pushResult.usersConfigBlocked) !== null && _pushResult_usersConfigBlocked1 !== void 0 ? _pushResult_usersConfigBlocked1 : 0, ", ПшОбка auth FCM — ", (_pushResult_usersAuthFailed1 = pushResult.usersAuthFailed) !== null && _pushResult_usersAuthFailed1 !== void 0 ? _pushResult_usersAuthFailed1 : 0, ", FCM send failed — ", (_pushResult_usersAllFailed1 = pushResult.usersAllFailed) !== null && _pushResult_usersAllFailed1 !== void 0 ? _pushResult_usersAllFailed1 : 0 ] }), pushResult.failedReasonStats && Object.keys(pushResult.failedReasonStats).length > 0 ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "mt-1", children: [ "КПЎы ПшОбПк FCM: ", Object.entries(pushResult.failedReasonStats).map((param)=>{ let [key, count] = param; return "".concat(key, ": ").concat(count); }).join(', ') ] }) : null, pushResult.failedReasonSample ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "mt-1", children: [ "ПрОЌер ПшОбкО: ", describeFcmFailure(pushResult.failedReasonStats ? Object.keys(pushResult.failedReasonStats)[0] : null, pushResult.failedReasonSample) ] }) : null ] }) : null }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: pushResult.reason ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "mt-3 rounded-lg border border-amber-200 bg-amber-50 px-3 py-2 text-xs text-amber-900", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ "ДОагМПстОка: ", pushResult.reason === 'no_tokens' ? 'у пПльзПвателя Мет push-тПкеМПв' : pushResult.reason === 'fcm_not_configured' ? 'FCM Ме МастрПеМ Ма API (переЌеММые FCM_*)' : pushResult.reason === 'fcm_auth_failed' ? 'ПшОбка автПрОзацОО FCM (service account)' : describeFcmFailure(pushResult.failureKey, pushResult.failureMessage) ] }), pushResult.failureKey ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "mt-1", children: [ "КПЎ FCM: ", pushResult.failureKey ] }) : null, pushResult.failureMessage ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "mt-1", children: [ "СППбщеМОе FCM: ", pushResult.failureMessage ] }) : null ] }) : null }) ] }) ] }), tab === 'backup' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("h2", { className: "text-lg font-semibold text-gray-800 flex items-center gap-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-5 h-5 text-green-600", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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" }) }), t('admin.backup.title', 'Backup') ] }), backupMsg && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "".concat(backupMsgError ? '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: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { children: backupMsg }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>setBackupMsg(null), className: "".concat(backupMsgError ? 'text-red-500 hover:text-red-700' : 'text-green-500 hover:text-green-700', " ml-4"), children: "\xd7" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-5 flex items-center justify-between", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "font-medium text-gray-800 text-sm", children: t('admin.backup.autoBackup', 'Auto Backup') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-500 mt-0.5", children: t('admin.backup.autoBackupDesc', 'Create a backup every day automatically') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { disabled: backupAutoSaving, onClick: async ()=>{ setBackupAutoSaving(true); try { await (0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .request */ .Em)('/admin/backup/settings', { method: 'PUT', body: JSON.stringify({ autoEnabled: !backupAutoEnabled }) }); setBackupAutoEnabled((v)=>!v); } catch (e) {} setBackupAutoSaving(false); }, className: "relative w-11 h-6 rounded-full transition-colors ".concat(backupAutoEnabled ? 'bg-green-600' : 'bg-gray-300', " ").concat(backupAutoSaving ? 'opacity-50' : ''), children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "absolute top-0.5 left-0.5 w-5 h-5 rounded-full bg-white shadow transition-transform ".concat(backupAutoEnabled ? 'translate-x-5' : 'translate-x-0') }) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h3", { className: "font-semibold text-gray-800 text-sm mb-4", children: t('admin.backup.title', 'Database Backup') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex flex-wrap gap-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { disabled: backupExporting, onClick: async ()=>{ setBackupExporting(true); try { const BASE = "https://api.canhelp.gr" || 0; const res = await fetch("".concat(BASE, "/api/admin/backup/export"), { credentials: 'include' }); if (!res.ok) throw new Error('Export failed'); const blob = await res.blob(); const url = URL.createObjectURL(blob); const a = document.createElement('a'); a.href = url; a.download = "backup_".concat(new Date().toISOString().slice(0, 10), ".sql.gz"); a.click(); URL.revokeObjectURL(url); setBackupSuccess(t('admin.backup.exportSuccess', 'Export successful')); } catch (e) { setBackupError(e.message || 'Error'); } setBackupExporting(false); }, 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: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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" }) }), backupExporting ? t('admin.backup.exporting', 'Exporting...') : t('admin.backup.exportAll', 'Export Full DB') ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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 ".concat(backupImporting === 'full' ? 'opacity-50 pointer-events-none' : ''), children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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" }) }), backupImporting === 'full' ? t('admin.backup.importing', 'Importing...') : t('admin.backup.importAll', 'Import Full DB'), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "file", accept: ".sql.gz,.gz", className: "hidden", onChange: async (e)=>{ var _e_target_files; const file = (_e_target_files = e.target.files) === null || _e_target_files === void 0 ? void 0 : _e_target_files[0]; if (!file) return; if (!window.confirm(t('admin.backup.restoreConfirm', 'Restore from this backup?'))) return; setBackupImporting('full'); try { const fd = new FormData(); fd.append('file', file); const BASE = "https://api.canhelp.gr" || 0; const res = await fetch("".concat(BASE, "/api/admin/backup/import"), { method: 'POST', credentials: 'include', body: fd }); if (!res.ok) throw new Error('Import failed'); setBackupSuccess(t('admin.backup.importSuccess', 'Import successful')); } catch (err) { setBackupError(err.message || 'Error'); } setBackupImporting(null); e.target.value = ''; } }) ] }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h3", { className: "font-semibold text-gray-800 text-sm mb-4", children: t('admin.backup.storedBackups', 'Stored Backups') }), backupStoredFiles.length === 0 ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-gray-400", children: t('admin.backup.noStoredBackups', 'No stored backups') }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "space-y-2", children: backupStoredFiles.map((f)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-between py-2 px-3 bg-gray-50 rounded-lg border border-gray-100", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm font-medium text-gray-800", children: f.name === 'backup_today' ? t('admin.backup.today', 'Today') : t('admin.backup.yesterday', 'Yesterday') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { className: "text-xs text-gray-400", children: [ t('admin.backup.size', 'Size'), ": ", (f.size / 1024).toFixed(1), " KB \xb7 ", t('admin.backup.date', 'Date'), ": ", new Date(f.date).toLocaleString() ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { disabled: backupRestoring === f.name, onClick: async ()=>{ if (!window.confirm(t('admin.backup.restoreConfirm', 'Restore from this backup?'))) return; setBackupRestoring(f.name); try { await (0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .request */ .Em)('/admin/backup/restore', { method: 'POST', body: JSON.stringify({ name: f.name }) }); setBackupSuccess(t('admin.backup.restoreSuccess', 'Restore successful')); } catch (err) { setBackupError(err.message || 'Error'); } setBackupRestoring(null); }, className: "text-sm text-green-600 hover:text-gray-800 font-medium disabled:opacity-50", children: backupRestoring === f.name ? t('admin.backup.restoring', 'Restoring...') : t('admin.backup.restore', 'Restore') }) ] }, f.name)) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h3", { className: "font-semibold text-gray-800 text-sm mb-4", children: t('admin.backup.tables', 'Tables') }), backupTablesLoading ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-2 text-sm text-gray-400", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-4 h-4 animate-spin", fill: "none", viewBox: "0 0 24 24", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { className: "opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8v8z" }) ] }), t('common.loading', 'Loading...') ] }) : backupTables.length === 0 ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-gray-400", children: t('admin.noData', 'No data') }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "overflow-x-auto", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("table", { className: "w-full text-sm", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("tbody", { className: "divide-y divide-gray-100", children: backupTables.map((tbl)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("tr", { className: "hover:bg-gray-50", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "py-2 pr-4 font-mono text-gray-700", children: tbl }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "py-2 text-right", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-end gap-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: async ()=>{ try { const BASE = "https://api.canhelp.gr" || 0; const res = await fetch("".concat(BASE, "/api/admin/backup/export/").concat(tbl), { credentials: 'include' }); if (!res.ok) throw new Error('Export failed'); const blob = await res.blob(); const url = URL.createObjectURL(blob); const a = document.createElement('a'); a.href = url; a.download = "".concat(tbl, "_").concat(new Date().toISOString().slice(0, 10), ".sql.gz"); a.click(); URL.revokeObjectURL(url); } catch (err) { setBackupError(err.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: t('admin.backup.exportTable', 'Export') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: [ backupImporting === tbl ? t('admin.backup.importing', 'Importing...') : t('admin.backup.importTable', 'Import'), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "file", accept: ".sql.gz,.gz", className: "hidden", onChange: async (e)=>{ var _e_target_files; const file = (_e_target_files = e.target.files) === null || _e_target_files === void 0 ? void 0 : _e_target_files[0]; if (!file) return; if (!window.confirm(t('admin.backup.restoreConfirm', 'Restore from this backup?'))) return; setBackupImporting(tbl); try { const fd = new FormData(); fd.append('file', file); const BASE = "https://api.canhelp.gr" || 0; const res = await fetch("".concat(BASE, "/api/admin/backup/import/").concat(tbl), { method: 'POST', credentials: 'include', body: fd }); if (!res.ok) { const errData = await res.json().catch(()=>({ error: 'Import failed' })); throw new Error(errData.error || 'Import failed'); } setBackupSuccess(t('admin.backup.importSuccess', 'Import successful')); } catch (err) { setBackupError(err.message || 'Error'); } setBackupImporting(null); e.target.value = ''; } }) ] }) ] }) }) ] }, tbl)) }) }) }) ] }) ] }), tab === 'translations' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "text-base font-semibold text-gray-900", children: "ПеревПЎы" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-gray-500 mt-0.5", children: "АвтПЌатОческОй перевПЎ прПпущеММых зМачеМОй пП таблОцаЌ" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-4 flex flex-wrap gap-4 items-end", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: "ИстПчМОк" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("select", { value: transFromLang, onChange: (e)=>setTransFromLang(e.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: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "el", children: "\uD83C\uDDEC\uD83C\uDDF7 Greek" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "en", children: "\uD83C\uDDEC\uD83C\uDDE7 English" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "ru", children: "\uD83C\uDDF7\uD83C\uDDFA Russian" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "uk", children: "\uD83C\uDDFA\uD83C\uDDE6 Ukrainian" }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M13 7l5 5-5 5M6 12h12" }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: "ПеревестО Ма" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("select", { value: transLang, onChange: (e)=>setTransLang(e.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: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "el", children: "\uD83C\uDDEC\uD83C\uDDF7 Greek" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "en", children: "\uD83C\uDDEC\uD83C\uDDE7 English" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "ru", children: "\uD83C\uDDF7\uD83C\uDDFA Russian" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "uk", children: "\uD83C\uDDFA\uD83C\uDDE6 Ukrainian" }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "ml-auto self-end", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "text-sm font-semibold text-gray-700 flex items-center gap-2", children: [ { el: '🇬🇷', en: '🇬🇧', ru: '🇷🇺', uk: '🇺🇊' }[transFromLang], " ", transFromLang.toUpperCase(), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 text-gray-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M13 7l5 5-5 5M6 12h12" }) }), { el: '🇬🇷', en: '🇬🇧', ru: '🇷🇺', uk: '🇺🇊' }[transLang], " ", transLang.toUpperCase() ] }) }) ] }), transMsg && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-sm px-4 py-2 rounded-lg ".concat(transMsg.error ? 'bg-red-50 text-red-700' : 'bg-green-50 text-green-700'), children: transMsg.text }), transStatsLoading ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-2 text-sm text-gray-400 py-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-4 h-4 animate-spin", fill: "none", viewBox: "0 0 24 24", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { className: "opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8v8z" }) ] }), "Загрузка " ] }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "grid gap-4 sm:grid-cols-2 lg:grid-cols-3", children: (transStats !== null && transStats !== void 0 ? transStats : []).map((tbl)=>{ const isTasks = tbl.name === 'tasks'; // For tasks: total missing across all langs (tasks may miss multiple langs each) const totalMissingAllLangs = Object.values(tbl.missing).reduce((a, b)=>a + b, 0); var _tbl_missing_transLang; const missingCount = isTasks ? totalMissingAllLangs : (_tbl_missing_transLang = tbl.missing[transLang]) !== null && _tbl_missing_transLang !== void 0 ? _tbl_missing_transLang : 0; const isTranslating = !!transTableTranslating[tbl.name]; const anyTranslating = Object.values(transTableTranslating).some(Boolean); return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-5 flex flex-col", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-start justify-between", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "font-semibold text-gray-900 text-sm", children: tbl.label }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400 mt-0.5", children: tbl.name }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-xs font-semibold px-2 py-0.5 rounded-full ".concat(missingCount > 0 ? 'bg-red-100 text-red-700' : 'bg-green-100 text-green-700'), children: missingCount > 0 ? "".concat(missingCount, " missing") : 'Complete' }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { className: "text-xs text-gray-500 mt-3", children: [ "ВсегП: ", tbl.total, isTasks && ' · с языка ПрОгОМала Ма все ПстальМые' ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "mt-2 flex flex-wrap gap-1", children: [ 'el', 'en', 'ru', 'uk' ].map((lang)=>{ var _tbl_missing_lang; const cnt = (_tbl_missing_lang = tbl.missing[lang]) !== null && _tbl_missing_lang !== void 0 ? _tbl_missing_lang : 0; const isClickable = isTasks && cnt > 0; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { type: "button", disabled: !isClickable, onClick: isClickable ? async ()=>{ setTransPreview({ lang, loading: true, rows: [] }); try { const d = await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getTasksTranslationPreview */ .QY(lang, 50); setTransPreview({ lang, loading: false, rows: d.rows }); } catch (e) { setTransPreview({ lang, loading: false, rows: [] }); } } : undefined, className: "text-xs px-2 py-0.5 rounded-full border transition ".concat(cnt > 0 ? 'border-red-200 bg-red-50 text-red-600' + (isClickable ? ' cursor-pointer hover:bg-red-100' : '') : 'border-green-200 bg-green-50 text-green-600 cursor-default'), children: [ lang, ": ", cnt > 0 ? "-".concat(cnt) : '✓' ] }, lang); }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "mt-4 mt-auto pt-4", children: missingCount === 0 ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-1.5 text-xs text-emerald-600", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3.5 h-3.5 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" }) }), "Все перевПЎы запПлМеМы" ] }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { disabled: anyTranslating, onClick: async ()=>{ if (!isTasks && transFromLang === transLang) { setTransMsg({ text: 'ИсхПЎМый О целевПй язык сПвпаЎают', error: true }); return; } setTransTableTranslating((prev)=>({ ...prev, [tbl.name]: true })); setTransMsg(null); try { const res = isTasks ? await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .autoTranslateTasks */ .I(500) : tbl.name === 'email_templates' ? await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .autoTranslateEmailTemplates */ .fu(transLang, transFromLang) : await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .autoTranslate */ .cp(tbl.name, transLang, transFromLang, 500); setTransMsg({ text: "".concat(tbl.label, ": translated ").concat(res.translated, " of ").concat(res.total) + (res.failed > 0 ? " \xb7 errors: ".concat(res.failed) : ''), error: res.failed > 0 && res.translated === 0 }); _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getTranslationsStats */ .YQ().then((d)=>setTransStats(d.tables)).catch(()=>{}); } catch (err) { const msg = (err === null || err === void 0 ? void 0 : err.response) ? await err.response.text().catch(()=>err.message) : err.message || 'Error'; setTransMsg({ text: "Error: ".concat(msg), error: true }); } finally{ setTransTableTranslating((prev)=>{ const n = { ...prev }; delete n[tbl.name]; return n; }); } }, 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: isTranslating ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-3.5 h-3.5 animate-spin flex-shrink-0", fill: "none", viewBox: "0 0 24 24", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { className: "opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8v8z" }) ] }), "Translating..." ] }) : isTasks ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3.5 h-3.5 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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 ", missingCount ] }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3.5 h-3.5 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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 ", missingCount, " \xb7 ", { el: '🇬🇷', en: '🇬🇧', ru: '🇷🇺', uk: '🇺🇊' }[transFromLang], " ", transFromLang.toUpperCase(), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M13 7l5 5-5 5M6 12h12" }) }), { el: '🇬🇷', en: '🇬🇧', ru: '🇷🇺', uk: '🇺🇊' }[transLang], " ", transLang.toUpperCase() ] }) }) }) ] }, tbl.name); }) }) ] }), tab === 'dbcheck' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(DbCheckTab, {}), tab === 'referrals' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "grid grid-cols-3 gap-4", children: [ { label: 'РеферерПв', value: (_referralsData_totalReferrers = referralsData === null || referralsData === void 0 ? void 0 : referralsData.totalReferrers) !== null && _referralsData_totalReferrers !== void 0 ? _referralsData_totalReferrers : '—', color: 'text-green-600' }, { label: 'ПрОглашеМОй', value: (_referralsData_totalReferrals = referralsData === null || referralsData === void 0 ? void 0 : referralsData.totalReferrals) !== null && _referralsData_totalReferrals !== void 0 ? _referralsData_totalReferrals : '—', color: 'text-purple-600' }, { label: 'АктОвМых МаграЎ', value: (_referralsData_activeRewards = referralsData === null || referralsData === void 0 ? void 0 : referralsData.activeRewards) !== null && _referralsData_activeRewards !== void 0 ? _referralsData_activeRewards : '—', color: 'text-green-600' } ].map((param)=>{ let { label, value, color } = param; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-2xl border border-gray-200 p-5 text-center", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-3xl font-bold ".concat(color), children: value }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-xs text-gray-500 mt-1", children: label }) ] }, label); }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-2xl border border-gray-200 overflow-hidden", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "px-5 py-4 border-b border-gray-100 flex items-center justify-between", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "font-semibold text-gray-800", children: "ДеревП рефералПв" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { onClick: ()=>{ setReferralsLoading(true); _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminReferrals */ .cJ().then(setReferralsData).catch(()=>{}).finally(()=>setReferralsLoading(false)); }, className: "text-xs text-green-600 hover:underline flex items-center gap-1", children: [ referralsLoading && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-3 h-3 animate-spin", fill: "none", viewBox: "0 0 24 24", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { className: "opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8v8z" }) ] }), "ОбМПвОть" ] }) ] }), referralsLoading && !referralsData ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex justify-center py-16", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-6 h-6 animate-spin text-purple-600", fill: "none", viewBox: "0 0 24 24", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { className: "opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8v8z" }) ] }) }) : !referralsData || referralsData.tree.length === 0 ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "py-16 text-center text-sm text-gray-400", children: "Нет ЎаММых П рефералах" }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "divide-y divide-gray-100", children: referralsData.tree.map((node)=>{ var _node_referrer, _node_referrer1; var _node_referrer_id; const rid = (_node_referrer_id = (_node_referrer = node.referrer) === null || _node_referrer === void 0 ? void 0 : _node_referrer.id) !== null && _node_referrer_id !== void 0 ? _node_referrer_id : 'unknown'; const isExpanded = referralsExpanded.has(rid); var _node_referrer_firstName, _node_referrer_lastName; const referrerName = node.referrer ? "".concat((_node_referrer_firstName = node.referrer.firstName) !== null && _node_referrer_firstName !== void 0 ? _node_referrer_firstName : '', " ").concat((_node_referrer_lastName = node.referrer.lastName) !== null && _node_referrer_lastName !== void 0 ? _node_referrer_lastName : '').trim() || node.referrer.email : '(уЎалёМ)'; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { className: "w-full flex items-center gap-3 px-5 py-3.5 hover:bg-gray-50 text-left transition-colors", onClick: ()=>setReferralsExpanded((prev)=>{ const next = new Set(prev); next.has(rid) ? next.delete(rid) : next.add(rid); return next; }), children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 text-gray-400 flex-shrink-0 transition-transform ".concat(isExpanded ? 'rotate-90' : ''), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 5l7 7-7 7" }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "font-medium text-sm text-gray-900", children: referrerName }), node.referrer && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "ml-2 text-xs text-gray-400", children: node.referrer.email }) ] }), ((_node_referrer1 = node.referrer) === null || _node_referrer1 === void 0 ? void 0 : _node_referrer1.referralCode) && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("code", { className: "text-xs bg-gray-100 text-gray-600 px-2 py-0.5 rounded font-mono", children: node.referrer.referralCode }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "ml-3 text-xs font-semibold text-purple-700 bg-purple-50 px-2 py-0.5 rounded-full", children: [ node.referees.length, " реф." ] }) ] }), isExpanded && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "bg-gray-50 border-t border-gray-100", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("table", { className: "w-full text-xs", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("thead", { children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("tr", { className: "border-b border-gray-200", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "text-left px-10 py-2 font-semibold text-gray-500", children: "ПрОглашёММый" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "text-left px-3 py-2 font-semibold text-gray-500", children: "Email" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "text-center px-3 py-2 font-semibold text-gray-500", children: "+ЎМей" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "text-center px-3 py-2 font-semibold text-gray-500", children: "Истекает" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "text-center px-3 py-2 font-semibold text-gray-500", children: "Дата" }) ] }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("tbody", { children: node.referees.map((referee)=>{ var _referee_firstName, _referee_lastName; const refName = "".concat((_referee_firstName = referee.firstName) !== null && _referee_firstName !== void 0 ? _referee_firstName : '', " ").concat((_referee_lastName = referee.lastName) !== null && _referee_lastName !== void 0 ? _referee_lastName : '').trim() || referee.email; const expiresAt = new Date(referee.expiresAt); const createdAt = new Date(referee.createdAt); const isActive = expiresAt > new Date(); return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("tr", { className: "border-b border-gray-100 last:border-0 hover:bg-white transition-colors", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-10 py-2.5 font-medium text-gray-800", children: refName }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-3 py-2.5 text-gray-500", children: referee.email }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-3 py-2.5 text-center", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "font-semibold text-green-700", children: [ "+", referee.daysAdded ] }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-3 py-2.5 text-center", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "px-1.5 py-0.5 rounded text-xs font-medium ".concat(isActive ? 'bg-green-100 text-green-700' : 'bg-gray-100 text-gray-500'), children: expiresAt.toLocaleDateString('ru-RU', { day: '2-digit', month: '2-digit', year: '2-digit' }) }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-3 py-2.5 text-center text-gray-400", children: createdAt.toLocaleDateString('ru-RU', { day: '2-digit', month: '2-digit', year: '2-digit' }) }) ] }, referee.id); }) }) ] }) }) ] }, rid); }) }) ] }) ] }), transPreview && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "fixed inset-0 z-50 flex items-center justify-center bg-black/50 px-4", onClick: ()=>setTransPreview(null), children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-2xl shadow-xl w-full max-w-3xl max-h-[80vh] flex flex-col", onClick: (e)=>e.stopPropagation(), children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-between px-6 py-4 border-b border-gray-100 flex-shrink-0", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("h3", { className: "font-semibold text-gray-900", children: [ "ЗаЎачО без перевПЎа: ", /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "uppercase font-bold text-red-600", children: transPreview.lang }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400 mt-0.5", children: "ППказаМы первые 50 запОсей" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>setTransPreview(null), className: "text-gray-400 hover:text-gray-600 p-1", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-5 h-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" }) }) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "overflow-y-auto flex-1 px-6 py-4", children: transPreview.loading ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex justify-center py-12", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-6 h-6 animate-spin text-purple-600", fill: "none", viewBox: "0 0 24 24", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { className: "opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8v8z" }) ] }) }) : transPreview.rows.length === 0 ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-gray-500 text-center py-12", children: "Нет заЎач без перевПЎа" }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("table", { className: "w-full text-xs border-collapse", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("thead", { children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("tr", { className: "border-b border-gray-200", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "text-left py-2 pr-3 font-semibold text-gray-600 w-[35%]", children: "ОрОгОМал (title)" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "text-center py-2 px-2 font-semibold text-gray-600", children: "orig" }), [ 'el', 'en', 'ru', 'uk' ].map((l)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "text-center py-2 px-2 font-semibold text-gray-600 w-[14%]", children: l }, l)) ] }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("tbody", { children: transPreview.rows.map((row)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("tr", { className: "border-b border-gray-100 hover:bg-gray-50", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "py-2 pr-3 text-gray-800 truncate max-w-[200px]", title: row.title, children: row.title }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "py-2 px-2 text-center", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "uppercase font-semibold text-purple-700 bg-purple-50 px-1.5 py-0.5 rounded", children: row.originalLocale }) }), [ [ 'el', row.titleEl ], [ 'en', row.titleEn ], [ 'ru', row.titleRu ], [ 'uk', row.titleUk ] ].map((param)=>{ let [l, val] = param; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "py-2 px-2 text-center", title: val !== null && val !== void 0 ? val : '', children: val ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-emerald-600 font-semibold", children: "✓" }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-red-500 font-semibold", children: "✗" }) }, l); }) ] }, row.id)) }) ] }) }) ] }) }), editUser && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "fixed inset-0 z-50 flex items-center justify-center bg-black/50 px-4", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-2xl shadow-xl w-full max-w-4xl max-h-[90vh] flex flex-col", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-between px-6 py-4 border-b border-gray-100 flex-shrink-0", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "text-base font-semibold text-gray-900", children: t('admin.user_edit.title') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { className: "text-xs text-gray-400 mt-0.5", children: [ editUser.email, " \xb7 ID: ", editUser.id ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>setEditUser(null), className: "text-gray-400 hover:text-gray-600 text-2xl leading-none", children: "\xd7" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex flex-1 min-h-0", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: t('admin.user_edit.tab.profile') }, { id: 'account', label: t('admin.user_edit.tab.account') }, { id: 'balance', label: t('admin.user_edit.tab.balance') }, { id: 'settings', label: t('admin.user_edit.tab.settings') }, { id: 'site', label: t('admin.user_edit.tab.site') }, { id: 'specialist', label: t('admin.user_edit.tab.specialist') } ].map((item)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>{ setEditUserTab(item.id); if (item.id === 'specialist' && editUser) { setEditUserCardsLoading(true); const loadCards = _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminUserSpecialistCards */ .vy(editUser.id).then(setEditUserCards).catch(()=>{}); const loadCats = catRows.length === 0 ? _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminCategories */ .KD().then(setCatRows).catch(()=>{}) : Promise.resolve(); const loadLocs = locRows.length === 0 ? _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminLocations */ .k_().then(setLocRows).catch(()=>{}) : Promise.resolve(); Promise.all([ loadCards, loadCats, loadLocs ]).finally(()=>setEditUserCardsLoading(false)); } }, className: "w-full text-left px-3 py-2.5 text-sm rounded-lg transition-colors ".concat(editUserTab === item.id ? 'bg-green-50 text-green-700 font-medium' : 'text-gray-600 hover:bg-gray-50'), children: item.label }, item.id)) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex-1 overflow-y-auto p-6", children: [ editUserTab === 'profile' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "p-3 bg-gray-50 rounded-lg text-xs text-gray-500 space-y-0.5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "font-medium", children: [ t('admin.user_edit.registered'), ":" ] }), " ", new Date(editUser.createdAt).toLocaleDateString(dateLocale) ] }), editUser.lastSeenAt && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "font-medium", children: [ t('admin.user_edit.last_seen'), ":" ] }), " ", new Date(editUser.lastSeenAt).toLocaleDateString(dateLocale) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "grid grid-cols-2 gap-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.user_edit.first_name') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: (_editUser_firstName = editUser.firstName) !== null && _editUser_firstName !== void 0 ? _editUser_firstName : '', onChange: (e)=>setEditUser((u)=>({ ...u, firstName: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.user_edit.last_name') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: (_editUser_lastName = editUser.lastName) !== null && _editUser_lastName !== void 0 ? _editUser_lastName : '', onChange: (e)=>setEditUser((u)=>({ ...u, lastName: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.user_edit.phone') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: (_editUser_phone = editUser.phone) !== null && _editUser_phone !== void 0 ? _editUser_phone : '', onChange: (e)=>setEditUser((u)=>({ ...u, phone: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.user_edit.bio') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("textarea", { value: (_editUser_bio = editUser.bio) !== null && _editUser_bio !== void 0 ? _editUser_bio : '', onChange: (e)=>setEditUser((u)=>({ ...u, bio: e.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" }) ] }) ] }), editUserTab === 'account' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.user_edit.email') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: editUser.email }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-between rounded-lg border px-3 py-2 bg-gray-50", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-2", children: [ editUser.emailVerified ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 text-green-500 shrink-0", viewBox: "0 0 20 20", fill: "currentColor", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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" }) }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 text-red-400 shrink-0", viewBox: "0 0 20 20", fill: "currentColor", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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" }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-sm font-medium ".concat(editUser.emailVerified ? 'text-green-700' : 'text-red-600'), children: editUser.emailVerified ? t('admin.user_edit.email_verified') : t('admin.user_edit.email_not_verified') }) ] }), !editUser.emailVerified && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: verifyEmail, disabled: verifyingEmail, className: "text-xs px-3 py-1 rounded-md bg-green-600 text-white hover:bg-green-700 disabled:opacity-50 transition-colors", children: verifyingEmail ? '...' : t('admin.user_edit.verify_email_btn') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "grid grid-cols-2 gap-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.user_edit.role') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("select", { value: editUser.role, onChange: (e)=>setEditUser((u)=>({ ...u, role: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "user", children: t('admin.user_edit.role.user') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "admin", children: t('admin.user_edit.role.admin') }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.user_edit.plan') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("select", { value: (_editUser_planId = editUser.planId) !== null && _editUser_planId !== void 0 ? _editUser_planId : '', onChange: (e)=>setEditUser((u)=>({ ...u, planId: e.target.value || null })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "", children: t('admin.user_edit.no_plan') }), planRows.map((p)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: p.id, children: p.name }, p.id)) ] }) ] }) ] }), editUser.planExpiresAt && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { className: "text-xs text-gray-500", children: [ t('admin.user_edit.plan_expires'), ": ", new Date(editUser.planExpiresAt).toLocaleDateString(dateLocale) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "flex items-center gap-2 cursor-pointer", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "checkbox", checked: editUser.isActive !== false, onChange: (e)=>setEditUser((u)=>({ ...u, isActive: e.target.checked })), className: "w-4 h-4 rounded border-gray-300 text-green-600" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-sm text-gray-700", children: t('admin.user_edit.active') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.user_edit.interface_lang') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("select", { value: (_editUser_locale = editUser.locale) !== null && _editUser_locale !== void 0 ? _editUser_locale : 'el', onChange: (e)=>setEditUser((u)=>({ ...u, locale: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "el", children: "ΕλληΜικά" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "en", children: "English" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "ru", children: "РусскОй" }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: t('admin.user_edit.comm_languages') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex gap-5", children: [ 'el', 'en', 'uk', 'ru' ].map((lang)=>{ var _editUser_languages; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "flex items-center gap-1.5 cursor-pointer", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "checkbox", checked: ((_editUser_languages = editUser.languages) !== null && _editUser_languages !== void 0 ? _editUser_languages : []).includes(lang), onChange: (e)=>{ var _editUser_languages; const langs = (_editUser_languages = editUser.languages) !== null && _editUser_languages !== void 0 ? _editUser_languages : []; setEditUser((u)=>({ ...u, languages: e.target.checked ? [ ...langs.filter((l)=>l !== lang), lang ] : langs.filter((l)=>l !== lang) })); }, className: "w-4 h-4 rounded border-gray-300 text-green-600" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-sm text-gray-700", children: lang === 'el' ? 'ΕλληΜικά' : lang === 'en' ? 'English' : lang === 'uk' ? 'УкраїМська' : 'РусскОй' }) ] }, lang); }) }) ] }) ] }), editUserTab === 'balance' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-between p-5 bg-gray-50 rounded-xl border border-gray-200", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-xs text-gray-500 mb-1", children: t('admin.user_edit.balance') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "text-2xl font-bold text-gray-900", children: [ Number((_editUser_balance = editUser.balance) !== null && _editUser_balance !== void 0 ? _editUser_balance : 0).toFixed(2), " EUR" ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { onClick: ()=>setBalanceModal('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: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M12 4v16m8-8H4" }) }), t('admin.balance.topup.btn') ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { onClick: ()=>setBalanceModal('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: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M20 12H4" }) }), t('admin.balance.withdraw.btn') ] }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-center text-gray-400", children: t('admin.balance.modal_hint') }) ] }), editUserTab === 'settings' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "space-y-4", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-3 pt-1 divide-y divide-gray-100", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "flex items-center justify-between cursor-pointer py-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-sm font-medium text-gray-700", children: t('admin.user_edit.show_contact_info') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-xs text-gray-400", children: t('admin.user_edit.show_contact_info.hint') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "checkbox", checked: (_editUser_showContactInfo = editUser.showContactInfo) !== null && _editUser_showContactInfo !== void 0 ? _editUser_showContactInfo : false, onChange: (e)=>setEditUser((u)=>({ ...u, showContactInfo: e.target.checked })), className: "w-4 h-4 rounded border-gray-300 text-green-600" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "flex items-center justify-between cursor-pointer py-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-sm font-medium text-gray-700", children: t('admin.user_edit.notify_new_tasks') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-xs text-gray-400", children: t('admin.user_edit.notify_new_tasks.hint') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "checkbox", checked: (_editUser_notifyNewTasks = editUser.notifyNewTasks) !== null && _editUser_notifyNewTasks !== void 0 ? _editUser_notifyNewTasks : false, onChange: (e)=>setEditUser((u)=>({ ...u, notifyNewTasks: e.target.checked })), className: "w-4 h-4 rounded border-gray-300 text-green-600" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "flex items-center justify-between cursor-pointer py-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-sm font-medium text-gray-700", children: t('admin.user_edit.notif_messages') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-xs text-gray-400", children: t('admin.user_edit.notif_messages.hint') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "checkbox", checked: (_editUser_notifMessages = editUser.notifMessages) !== null && _editUser_notifMessages !== void 0 ? _editUser_notifMessages : true, onChange: (e)=>setEditUser((u)=>({ ...u, notifMessages: e.target.checked })), className: "w-4 h-4 rounded border-gray-300 text-green-600" }) ] }) ] }) }), editUserTab === 'site' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.user_edit.personal_site_slug') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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/" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: (_editUser_personalSiteSlug = editUser.personalSiteSlug) !== null && _editUser_personalSiteSlug !== void 0 ? _editUser_personalSiteSlug : '', onChange: (e)=>setEditUser((u)=>({ ...u, personalSiteSlug: e.target.value || null })), placeholder: "my-username", className: "flex-1 px-3 py-2 text-sm focus:outline-none" }) ] }), editUser.personalSiteSlug && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("a", { href: "/site/".concat(editUser.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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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" }) }) }) ] }) ] }), editUser.personalSiteSlug && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h4", { className: "text-sm font-semibold text-gray-800 pt-3 border-t border-gray-100", children: t('profile.site.visible_title') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "space-y-1", children: [ { key: 'showBio', label: t('profile.site.visible.bio') }, { key: 'showRating', label: t('profile.site.visible.rating') }, { key: 'showServices', label: t('profile.site.visible.services') }, { key: 'showPortfolio', label: t('profile.site.visible.portfolio') }, { key: 'showReviews', label: t('profile.site.visible.reviews') }, { key: 'showPhone', label: t('profile.site.visible.contacts') }, { key: 'showFullLastName', label: t('profile.site.visible.full_last_name') }, { key: 'showStatus', label: t('profile.site.visible.status') } ].map((item)=>{ var _editUser_siteSettings; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "flex items-center justify-between cursor-pointer py-1.5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-sm text-gray-700", children: item.label }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "checkbox", checked: ((_editUser_siteSettings = editUser.siteSettings) !== null && _editUser_siteSettings !== void 0 ? _editUser_siteSettings : {})[item.key] !== false, onChange: (e)=>setEditUser((u)=>{ var _u_siteSettings; return { ...u, siteSettings: { ...(_u_siteSettings = u.siteSettings) !== null && _u_siteSettings !== void 0 ? _u_siteSettings : {}, [item.key]: e.target.checked } }; }), className: "w-4 h-4 rounded border-gray-300 text-green-600" }) ] }, item.key); }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "pt-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1.5", children: t('profile.site.theme') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("select", { value: (_siteTheme = ((_editUser_siteSettings = editUser.siteSettings) !== null && _editUser_siteSettings !== void 0 ? _editUser_siteSettings : {}).siteTheme) !== null && _siteTheme !== void 0 ? _siteTheme : 'dark', onChange: (e)=>setEditUser((u)=>{ var _u_siteSettings; return { ...u, siteSettings: { ...(_u_siteSettings = u.siteSettings) !== null && _u_siteSettings !== void 0 ? _u_siteSettings : {}, siteTheme: e.target.value } }; }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "dark", children: t('profile.site.theme.dark') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "light", children: t('profile.site.theme.light') }) ] }) ] }) ] }) ] }), editUserTab === 'specialist' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-6", children: [ (()=>{ if ((editUser === null || editUser === void 0 ? void 0 : editUser.role) === 'specialist') return null; var _editUser_bio; const bio = String((_editUser_bio = editUser === null || editUser === void 0 ? void 0 : editUser.bio) !== null && _editUser_bio !== void 0 ? _editUser_bio : '').trim(); const publishedCards = (editUserCards !== null && editUserCards !== void 0 ? editUserCards : []).filter((c)=>{ var _c_publicationStatus; return ((_c_publicationStatus = c.publicationStatus) !== null && _c_publicationStatus !== void 0 ? _c_publicationStatus : c.isActive ? 'active' : 'inactive') === 'active'; }); const hasPublishedCard = publishedCards.length > 0; const hasCategories = publishedCards.some((c)=>{ var _c_categories; var _c_categories_length; return ((_c_categories_length = (_c_categories = c.categories) === null || _c_categories === void 0 ? void 0 : _c_categories.length) !== null && _c_categories_length !== void 0 ? _c_categories_length : 0) > 0; }); const hasLocations = publishedCards.some((c)=>{ var _c_locations; var _c_locations_length; return ((_c_locations_length = (_c_locations = c.locations) === null || _c_locations === void 0 ? void 0 : _c_locations.length) !== null && _c_locations_length !== void 0 ? _c_locations_length : 0) > 0; }); const missing = []; if (!bio) missing.push(t('admin.user_edit.visibility_requirements.bio', 'Fill in bio')); if (!hasPublishedCard) missing.push(t('admin.user_edit.visibility_requirements.published_card', 'Publish at least one card')); if (!hasCategories) missing.push(t('admin.user_edit.visibility_requirements.categories', 'Add a category in a published card')); if (!hasLocations) missing.push(t('admin.user_edit.visibility_requirements.locations', 'Add a location in a published card')); if (missing.length === 0) return null; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "rounded-xl border border-amber-300 bg-amber-50 p-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm font-semibold text-amber-900", children: t('admin.user_edit.visibility_requirements.title', 'Profile is not yet visible in Offers') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-amber-800 mt-1", children: t('admin.user_edit.visibility_requirements.hint', 'Visibility requirements to complete:') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("ul", { className: "mt-2 text-xs text-amber-900 list-disc pl-5 space-y-0.5", children: missing.map((m)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("li", { children: m }, m)) }) ] }); })(), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: t('admin.user_edit.skills') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex flex-wrap gap-1.5 mb-2 min-h-[28px]", children: ((_editUser_skills = editUser.skills) !== null && _editUser_skills !== void 0 ? _editUser_skills : []).map((s)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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, /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>setEditUser((u)=>{ var _u_skills; return { ...u, skills: ((_u_skills = u.skills) !== null && _u_skills !== void 0 ? _u_skills : []).filter((x)=>x !== s) }; }), className: "text-gray-400 hover:text-green-700 leading-none", children: "\xd7" }) ] }, s)) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: skillInput, onChange: (e)=>setSkillInput(e.target.value), onKeyDown: (e)=>{ if ((e.key === 'Enter' || e.key === ',') && skillInput.trim()) { e.preventDefault(); const val = skillInput.trim().replace(/,$/, ''); var _editUser_skills; if (val && !((_editUser_skills = editUser.skills) !== null && _editUser_skills !== void 0 ? _editUser_skills : []).includes(val)) { setEditUser((u)=>{ var _u_skills; return { ...u, skills: [ ...(_u_skills = u.skills) !== null && _u_skills !== void 0 ? _u_skills : [], val ] }; }); } setSkillInput(''); } }, placeholder: t('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" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>{ const val = skillInput.trim(); var _editUser_skills; if (val && !((_editUser_skills = editUser.skills) !== null && _editUser_skills !== void 0 ? _editUser_skills : []).includes(val)) { setEditUser((u)=>{ var _u_skills; return { ...u, skills: [ ...(_u_skills = u.skills) !== null && _u_skills !== void 0 ? _u_skills : [], val ] }; }); } setSkillInput(''); }, className: "px-3 py-2 bg-green-600 text-white rounded-lg text-sm hover:bg-green-700", children: t('common.add') }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "border-t border-gray-100 pt-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-sm font-medium text-gray-700 mb-3", children: t('admin.user_edit.specialist_cards') }), editUserCardsLoading ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400 py-2", children: t('common.loading') }) : editUserCards.length === 0 ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400 py-4 text-center", children: t('admin.user_edit.no_cards') }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "space-y-4", children: editUserCards.map((card)=>{ var _card_title, _card_description, _card_skills, _cardSkillInputs_card_id, _card_categories, _card_categories1, _card_locations, _card_locations1; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "border border-gray-200 bg-gray-50 rounded-xl p-4 space-y-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: (_card_title = card.title) !== null && _card_title !== void 0 ? _card_title : '', onChange: (e)=>setEditUserCards((prev)=>prev.map((c)=>c.id === card.id ? { ...c, title: e.target.value } : c)), placeholder: t('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" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "flex items-center gap-1.5 cursor-pointer flex-shrink-0", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "checkbox", checked: card.isActive !== false, onChange: (e)=>setEditUserCards((prev)=>prev.map((c)=>c.id === card.id ? { ...c, isActive: e.target.checked } : c)), className: "w-4 h-4 rounded border-gray-300 text-green-600" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-xs text-gray-600", children: t('admin.user_edit.published') }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("textarea", { value: (_card_description = card.description) !== null && _card_description !== void 0 ? _card_description : '', onChange: (e)=>setEditUserCards((prev)=>prev.map((c)=>c.id === card.id ? { ...c, description: e.target.value } : c)), rows: 3, placeholder: t('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" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-xs font-medium text-gray-500 mb-1.5", children: t('admin.user_edit.skills') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex flex-wrap gap-1.5 mb-1.5 min-h-[24px]", children: ((_card_skills = card.skills) !== null && _card_skills !== void 0 ? _card_skills : []).map((s)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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, /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>setEditUserCards((prev)=>prev.map((c)=>{ var _c_skills; return c.id === card.id ? { ...c, skills: ((_c_skills = c.skills) !== null && _c_skills !== void 0 ? _c_skills : []).filter((x)=>x !== s) } : c; })), className: "text-gray-400 hover:text-green-700 leading-none", children: "\xd7" }) ] }, s)) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: (_cardSkillInputs_card_id = cardSkillInputs[card.id]) !== null && _cardSkillInputs_card_id !== void 0 ? _cardSkillInputs_card_id : '', onChange: (e)=>setCardSkillInputs((prev)=>({ ...prev, [card.id]: e.target.value })), onKeyDown: (e)=>{ var _cardSkillInputs_card_id; if ((e.key === 'Enter' || e.key === ',') && ((_cardSkillInputs_card_id = cardSkillInputs[card.id]) !== null && _cardSkillInputs_card_id !== void 0 ? _cardSkillInputs_card_id : '').trim()) { e.preventDefault(); var _cardSkillInputs_card_id1; const val = ((_cardSkillInputs_card_id1 = cardSkillInputs[card.id]) !== null && _cardSkillInputs_card_id1 !== void 0 ? _cardSkillInputs_card_id1 : '').trim().replace(/,$/, ''); var _card_skills; if (val && !((_card_skills = card.skills) !== null && _card_skills !== void 0 ? _card_skills : []).includes(val)) { setEditUserCards((prev)=>prev.map((c)=>{ var _c_skills; return c.id === card.id ? { ...c, skills: [ ...(_c_skills = c.skills) !== null && _c_skills !== void 0 ? _c_skills : [], val ] } : c; })); } setCardSkillInputs((prev)=>({ ...prev, [card.id]: '' })); } }, placeholder: t('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" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>{ var _cardSkillInputs_card_id; const val = ((_cardSkillInputs_card_id = cardSkillInputs[card.id]) !== null && _cardSkillInputs_card_id !== void 0 ? _cardSkillInputs_card_id : '').trim(); var _card_skills; if (val && !((_card_skills = card.skills) !== null && _card_skills !== void 0 ? _card_skills : []).includes(val)) { setEditUserCards((prev)=>prev.map((c)=>{ var _c_skills; return c.id === card.id ? { ...c, skills: [ ...(_c_skills = c.skills) !== null && _c_skills !== void 0 ? _c_skills : [], val ] } : c; })); } setCardSkillInputs((prev)=>({ ...prev, [card.id]: '' })); }, className: "px-2.5 py-1.5 bg-green-600 text-white rounded-lg text-xs hover:bg-green-700", children: "+" }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-xs font-medium text-gray-500 mb-1.5", children: t('admin.user_edit.categories') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex flex-wrap gap-1.5 mb-1.5 min-h-[24px]", children: ((_card_categories = card.categories) !== null && _card_categories !== void 0 ? _card_categories : []).map((slug)=>{ var _catRows_find; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: [ getCatLabel((_catRows_find = catRows.find((c)=>c.slug === slug)) !== null && _catRows_find !== void 0 ? _catRows_find : { slug }, locale), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>setEditUserCards((prev)=>prev.map((c)=>{ var _c_categories; return c.id === card.id ? { ...c, categories: ((_c_categories = c.categories) !== null && _c_categories !== void 0 ? _c_categories : []).filter((x)=>x !== slug) } : c; })), className: "text-purple-400 hover:text-purple-700 leading-none", children: "\xd7" }) ] }, slug); }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(AdminCatPicker, { catRows: catRows, locale: locale, selected: (_card_categories1 = card.categories) !== null && _card_categories1 !== void 0 ? _card_categories1 : [], onAdd: (id)=>setEditUserCards((prev)=>prev.map((c)=>{ var _c_categories; return c.id === card.id ? { ...c, categories: [ ...(_c_categories = c.categories) !== null && _c_categories !== void 0 ? _c_categories : [], id ] } : c; })), addLabel: t('admin.user_edit.add_category') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-xs font-medium text-gray-500 mb-1.5", children: t('admin.user_edit.locations') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex flex-wrap gap-1.5 mb-1.5 min-h-[24px]", children: ((_card_locations = card.locations) !== null && _card_locations !== void 0 ? _card_locations : []).map((slug)=>{ var _locRows_find; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: [ getLocLabel((_locRows_find = locRows.find((l)=>l.slug === slug)) !== null && _locRows_find !== void 0 ? _locRows_find : { slug }, locale), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>setEditUserCards((prev)=>prev.map((c)=>{ var _c_locations; return c.id === card.id ? { ...c, locations: ((_c_locations = c.locations) !== null && _c_locations !== void 0 ? _c_locations : []).filter((x)=>x !== slug) } : c; })), className: "text-green-400 hover:text-green-700 leading-none", children: "\xd7" }) ] }, slug); }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(AdminLocPicker, { locRows: locRows, locale: locale, selected: (_card_locations1 = card.locations) !== null && _card_locations1 !== void 0 ? _card_locations1 : [], onAdd: (id)=>setEditUserCards((prev)=>prev.map((c)=>{ var _c_locations; return c.id === card.id ? { ...c, locations: [ ...(_c_locations = c.locations) !== null && _c_locations !== void 0 ? _c_locations : [], id ] } : c; })), addLabel: t('admin.user_edit.add_location') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex justify-end pt-1", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>saveCard(card.id), disabled: cardSaving[card.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: cardSaving[card.id] ? '...' : t('common.save') }) }) ] }, card.id); }) }) ] }) ] }) ] }) ] }), editUserTab !== 'balance' ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "border-t border-gray-100 px-6 py-4 flex gap-3 flex-shrink-0", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: saveEditUser, disabled: editUserSaving, className: "flex-1 bg-green-600 hover:bg-green-700 text-white py-2 rounded-lg text-sm font-semibold disabled:opacity-50", children: editUserSaving ? '...' : t('common.save') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>setEditUser(null), className: "flex-1 bg-gray-100 hover:bg-gray-200 text-gray-700 py-2 rounded-lg text-sm font-medium", children: t('common.cancel') }) ] }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "border-t border-gray-100 px-6 py-4 flex-shrink-0", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>setEditUser(null), className: "w-full bg-gray-100 hover:bg-gray-200 text-gray-700 py-2 rounded-lg text-sm font-medium", children: t('common.close') }) }) ] }) }), editUser && balanceModal && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "fixed inset-0 z-[60] flex items-center justify-center bg-black/40 px-4", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-2xl shadow-2xl p-6 w-full max-w-sm border-t-4 ".concat(balanceModal === 'topup' ? 'border-emerald-500' : 'border-rose-500'), children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-between mb-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h3", { className: "text-base font-semibold ".concat(balanceModal === 'topup' ? 'text-emerald-900' : 'text-rose-900'), children: balanceModal === 'topup' ? t('admin.balance.topup.title') : t('admin.balance.withdraw.title') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>setBalanceModal(null), className: "text-gray-400 hover:text-gray-600 text-2xl leading-none", children: "\xd7" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { className: "text-xs text-gray-500 mb-4", children: [ t('admin.user_edit.balance'), ": ", /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "font-semibold text-gray-700", children: [ Number((_editUser_balance1 = editUser.balance) !== null && _editUser_balance1 !== void 0 ? _editUser_balance1 : 0).toFixed(2), " EUR" ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium mb-1 ".concat(balanceModal === 'topup' ? 'text-emerald-800' : 'text-rose-800'), children: balanceModal === 'topup' ? t('admin.balance.topup.amount') : t('admin.balance.withdraw.amount') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "number", min: "0.01", step: "0.01", value: balanceModal === 'topup' ? (_editUser_topUpAmount = editUser.topUpAmount) !== null && _editUser_topUpAmount !== void 0 ? _editUser_topUpAmount : '' : (_editUser_withdrawAmount = editUser.withdrawAmount) !== null && _editUser_withdrawAmount !== void 0 ? _editUser_withdrawAmount : '', onChange: (e)=>setEditUser((u)=>balanceModal === 'topup' ? { ...u, topUpAmount: e.target.value } : { ...u, withdrawAmount: e.target.value }), className: "w-full border rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 ".concat(balanceModal === 'topup' ? 'border-emerald-300 focus:ring-emerald-400' : 'border-rose-300 focus:ring-rose-400') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium mb-1 ".concat(balanceModal === 'topup' ? 'text-emerald-800' : 'text-rose-800'), children: balanceModal === 'topup' ? t('admin.balance.topup.description') : t('admin.balance.withdraw.description') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: balanceModal === 'topup' ? (_editUser_topUpDescription = editUser.topUpDescription) !== null && _editUser_topUpDescription !== void 0 ? _editUser_topUpDescription : '' : (_editUser_withdrawDescription = editUser.withdrawDescription) !== null && _editUser_withdrawDescription !== void 0 ? _editUser_withdrawDescription : '', onChange: (e)=>setEditUser((u)=>balanceModal === 'topup' ? { ...u, topUpDescription: e.target.value } : { ...u, withdrawDescription: e.target.value }), placeholder: balanceModal === 'topup' ? t('admin.balance.topup.description.placeholder') : t('admin.balance.withdraw.description.placeholder'), className: "w-full border rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 ".concat(balanceModal === 'topup' ? 'border-emerald-300 focus:ring-emerald-400' : 'border-rose-300 focus:ring-rose-400') }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-2 mt-5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: async ()=>{ if (balanceModal === 'topup') { await handleAdminTopUp(); } else { await handleAdminWithdraw(); } setBalanceModal(null); }, disabled: balanceModal === 'topup' ? topUpSaving || !Number(editUser.topUpAmount) : withdrawSaving || !Number(editUser.withdrawAmount), className: "flex-1 text-white py-2 rounded-lg text-sm font-semibold disabled:opacity-50 ".concat(balanceModal === 'topup' ? 'bg-emerald-600 hover:bg-emerald-700' : 'bg-rose-600 hover:bg-rose-700'), children: (balanceModal === 'topup' ? topUpSaving : withdrawSaving) ? t('common.loading') : balanceModal === 'topup' ? t('admin.balance.topup.submit') : t('admin.balance.withdraw.submit') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>setBalanceModal(null), className: "flex-1 bg-gray-100 hover:bg-gray-200 text-gray-700 py-2 rounded-lg text-sm font-medium", children: t('common.cancel') }) ] }) ] }) }) ] }) ] }) ] }) }); } // ─── DbCheckTab ───────────────────────────────────────────────────────────── function DbCheckTab() { // ── Skill duplicates ────────────────────────────────────────────────────── const [dedupLoading, setDedupLoading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [dedupGroups, setDedupGroups] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [keepIds, setKeepIds] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)({}); const [merging, setMerging] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); function gk(group) { var _group__nameEl, _group_, _group_1; var _group__nameEl_toLowerCase_trim; return (_group__nameEl_toLowerCase_trim = (_group_ = group[0]) === null || _group_ === void 0 ? void 0 : (_group__nameEl = _group_.nameEl) === null || _group__nameEl === void 0 ? void 0 : _group__nameEl.toLowerCase().trim()) !== null && _group__nameEl_toLowerCase_trim !== void 0 ? _group__nameEl_toLowerCase_trim : (_group_1 = group[0]) === null || _group_1 === void 0 ? void 0 : _group_1.id; } async function findDuplicates() { setDedupLoading(true); setDedupGroups(null); setKeepIds({}); try { const groups = await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getSkillDedup */ .GE() // all categories ; setDedupGroups(groups); const auto = {}; groups.forEach((group)=>{ const best = [ ...group ].sort((a, b)=>{ var _b_usageCount, _a_usageCount; return ((_b_usageCount = b.usageCount) !== null && _b_usageCount !== void 0 ? _b_usageCount : 0) - ((_a_usageCount = a.usageCount) !== null && _a_usageCount !== void 0 ? _a_usageCount : 0); })[0]; auto[gk(group)] = best.id; }); setKeepIds(auto); } catch (e) { setDedupGroups([]); } finally{ setDedupLoading(false); } } async function mergeGroup(key, group) { const keepId = keepIds[key]; if (!keepId) return; const deleteIds = group.filter((s)=>s.id !== keepId).map((s)=>s.id); if (!deleteIds.length) return; setMerging(key); try { await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .mergeSkillDuplicates */ .Uq(keepId, deleteIds); setDedupGroups((prev)=>prev ? prev.filter((g)=>gk(g) !== key) : prev); } catch (e) {} finally{ setMerging(null); } } async function mergeAll() { if (!(dedupGroups === null || dedupGroups === void 0 ? void 0 : dedupGroups.length)) return; setMerging('__all__'); for (const group of [ ...dedupGroups ]){ const key = gk(group); const keepId = keepIds[key]; if (!keepId) continue; const deleteIds = group.filter((s)=>s.id !== keepId).map((s)=>s.id); if (!deleteIds.length) continue; try { await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .mergeSkillDuplicates */ .Uq(keepId, deleteIds); setDedupGroups((prev)=>prev ? prev.filter((g)=>gk(g) !== key) : prev); } catch (e) {} } setMerging(null); } var _dedupGroups_reduce; const totalDuplicates = (_dedupGroups_reduce = dedupGroups === null || dedupGroups === void 0 ? void 0 : dedupGroups.reduce((acc, g)=>acc + g.length - 1, 0)) !== null && _dedupGroups_reduce !== void 0 ? _dedupGroups_reduce : 0; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "text-base font-semibold text-gray-900", children: "ПрПверка базы ЎаММых" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-gray-500 mt-0.5", children: "ДОагМПстОка О ОсправлеМОе прПблеЌ в базе ЎаММых" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 overflow-hidden", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "px-5 py-4 border-b border-gray-100 flex items-center justify-between", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h3", { className: "text-sm font-semibold text-gray-800", children: "ДублОкаты МавыкПв" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400 mt-0.5", children: "ППОск МавыкПв с ПЎОМакПвыЌ ОЌеМеЌ в ПЎМПй категПрОО. ПрО ПбъеЎОМеМОО — ссылкО в картПчках спецОалОстПв ПбМПвляются автПЌатОческО." }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { onClick: findDuplicates, disabled: dedupLoading, 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: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("circle", { cx: "11", cy: "11", r: "8" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M21 21l-4.35-4.35" }) ] }), dedupLoading ? 'Ищу ' : 'НайтО ЎублОкаты' ] }) ] }), dedupGroups !== null && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "p-5", children: dedupGroups.length === 0 ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" }) }), "ДублОкатПв Ме МайЎеМП — база в пПряЎке" ] }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-between", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { className: "text-sm text-green-700 font-semibold", children: [ "НайЎеМП ", dedupGroups.length, " групп \xb7 ", totalDuplicates, " лОшМОх запОсей" ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: mergeAll, disabled: merging === '__all__', 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: merging === '__all__' ? 'ОбъеЎОМяю ' : "ОбъеЎОМОть все (".concat(dedupGroups.length, ")") }) ] }), dedupGroups.map((group)=>{ var _group_, _group_1; const key = gk(group); return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white border border-orange-200 rounded-xl overflow-hidden shadow-sm", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "px-4 py-2.5 bg-orange-50 border-b border-orange-100 flex items-center justify-between gap-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "min-w-0", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "text-sm font-semibold text-orange-800", children: [ "\xab", (_group_ = group[0]) === null || _group_ === void 0 ? void 0 : _group_.nameEl, "\xbb" ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "ml-2 text-xs text-green-600 font-mono", children: (_group_1 = group[0]) === null || _group_1 === void 0 ? void 0 : _group_1.categorySlug }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "ml-2 text-xs text-orange-400", children: [ group.length, " варОаМта" ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>mergeGroup(key, group), disabled: !!merging, 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: merging === key ? 'ОбъеЎОМяю ' : 'ОбъеЎОМОть' }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "divide-y divide-gray-50", children: group.map((skill)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "flex items-center gap-3 px-4 py-2.5 cursor-pointer hover:bg-gray-50 transition", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "radio", name: "dedup-global-".concat(key), checked: keepIds[key] === skill.id, onChange: ()=>setKeepIds((prev)=>({ ...prev, [key]: skill.id })), className: "accent-amber-600 shrink-0" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-3 flex-wrap", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-sm font-medium text-gray-800", children: skill.nameEl }), skill.nameEn && skill.nameEn !== skill.nameEl && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "text-xs text-gray-400", children: [ "EN: ", skill.nameEn ] }), skill.nameRu && skill.nameRu !== skill.nameEl && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "text-xs text-gray-400", children: [ "RU: ", skill.nameRu ] }), skill.nameUk && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "text-xs text-gray-400", children: [ "UK: ", skill.nameUk ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-3 mt-0.5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-[11px] font-semibold ".concat(skill.usageCount > 0 ? 'text-green-600' : 'text-gray-400'), children: skill.usageCount > 0 ? "".concat(skill.usageCount, " ОспПльзПваМОй") : 'Ме ОспПльзПвался' }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "text-[11px] text-gray-300", children: [ "order: ", skill.order ] }), keepIds[key] === skill.id && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-[11px] font-bold text-amber-600 uppercase", children: "← ПставОть" }) ] }) ] }) ] }, skill.id)) }) ] }, key); }) ] }) }) ] }) ] }); } function LocTree(param) { let { rows, parentId, depth, locale, expanded, onToggle, onEdit, onDelete, onAddChild, t } = param; const children = rows.filter((r)=>{ var _r_parentId; return ((_r_parentId = r.parentId) !== null && _r_parentId !== void 0 ? _r_parentId : null) === parentId; }); if (children.length === 0) return null; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: children.sort((a, b)=>{ var _a_order, _b_order; return ((_a_order = a.order) !== null && _a_order !== void 0 ? _a_order : 0) - ((_b_order = b.order) !== null && _b_order !== void 0 ? _b_order : 0); }).map((loc)=>{ const hasChildren = rows.some((r)=>r.parentId === loc.id); const isOpen = expanded.has(loc.id); const name = (locale === 'en' ? loc.nameEn : locale === 'ru' ? loc.nameRu : locale === 'uk' ? loc.nameUk : loc.nameEl) || loc.nameEl || loc.slug; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-2 px-4 py-3 hover:bg-gray-50 ".concat(!loc.isActive ? 'opacity-50' : ''), style: { paddingLeft: "".concat(16 + depth * 24, "px") }, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>hasChildren && onToggle(loc.id), className: "w-5 h-5 flex items-center justify-center text-gray-400 rounded ".concat(hasChildren ? 'hover:bg-gray-200 cursor-pointer' : 'cursor-default'), children: hasChildren ? isOpen ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("polyline", { points: "6 9 12 15 18 9" }) }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("polyline", { points: "9 18 15 12 9 6" }) }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "w-3.5 h-3.5 block" }) }), depth === 0 ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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" }) }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 11a3 3 0 11-6 0 3 3 0 016 0z" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "font-medium text-gray-800 text-sm", children: name }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "ml-2 text-xs text-gray-400", children: loc.nameEn }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "ml-1.5 font-mono text-xs text-gray-300", children: [ "/", loc.slug ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "px-2 py-0.5 rounded-full text-xs font-medium ".concat(loc.isActive ? 'bg-green-100 text-green-700' : 'bg-gray-100 text-gray-500'), children: loc.isActive ? t('admin.cat.active') : t('admin.cat.inactive') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-1 flex-shrink-0", children: [ depth === 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>onAddChild(loc.id), className: "text-xs px-2 py-1 rounded-lg bg-green-50 text-green-600 hover:bg-green-100 font-medium", title: t('admin.loc.add_district'), children: "+" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>onEdit(loc), className: "text-xs px-2 py-1 rounded-lg bg-gray-100 text-gray-600 hover:bg-gray-200 font-medium", children: t('common.edit') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>onDelete(loc.id, name), className: "text-xs px-2 py-1 rounded-lg bg-red-50 text-red-600 hover:bg-red-100 font-medium", children: t('common.delete') }) ] }) ] }), hasChildren && isOpen && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(LocTree, { rows: rows, parentId: loc.id, depth: depth + 1, locale: locale, expanded: expanded, onToggle: onToggle, onEdit: onEdit, onDelete: onDelete, onAddChild: onAddChild, t: t }) ] }, loc.id); }) }); } function CatTree(param) { let { rows, parentId, depth, locale, expanded, onToggle, onEdit, onDelete, onAddChild, skillsExpanded, skillsCache, skillsLoading, onToggleSkills, skillForm, skillSaving, onOpenAddSkill, onOpenEditSkill, onSaveSkill, onDeleteSkill, onCancelSkillForm, onSkillFormChange, t } = param; const children = rows.filter((r)=>{ var _r_parentId; return ((_r_parentId = r.parentId) !== null && _r_parentId !== void 0 ? _r_parentId : null) === parentId; }); if (children.length === 0) return null; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: children.sort((a, b)=>{ var _a_order, _b_order; return ((_a_order = a.order) !== null && _a_order !== void 0 ? _a_order : 0) - ((_b_order = b.order) !== null && _b_order !== void 0 ? _b_order : 0); }).map((cat)=>{ var _cat_names; const hasChildren = rows.some((r)=>r.parentId === cat.id); const isOpen = expanded.has(cat.id); const skillsOpen = skillsExpanded.has(cat.id); const isLoadingSkills = skillsLoading.has(cat.id); var _skillsCache_cat_slug; const skills = (_skillsCache_cat_slug = skillsCache[cat.slug]) !== null && _skillsCache_cat_slug !== void 0 ? _skillsCache_cat_slug : []; const name = (locale === 'en' ? cat.namesEn : locale === 'ru' ? cat.namesRu : locale === 'uk' ? cat.namesUk : cat.namesEl) || cat.namesEl || cat.slug; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-2 px-4 py-3 hover:bg-gray-50 ".concat(!cat.isActive ? 'opacity-50' : ''), style: { paddingLeft: "".concat(16 + depth * 24, "px") }, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>hasChildren && onToggle(cat.id), className: "w-5 h-5 flex items-center justify-center text-gray-400 rounded ".concat(hasChildren ? 'hover:bg-gray-200 cursor-pointer' : 'cursor-default'), children: hasChildren ? isOpen ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("polyline", { points: "6 9 12 15 18 9" }) }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("polyline", { points: "9 18 15 12 9 6" }) }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "w-3.5 h-3.5 block" }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "w-10 h-10 flex items-center justify-center rounded-xl bg-green-50", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components_CategoryIcon__WEBPACK_IMPORTED_MODULE_7__/* .CategoryIcon */ .Ez, { icon: cat.icon, alt: name, className: "h-7 w-7 object-contain text-2xl leading-none", fallback: "\uD83D\uDCE6" }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "font-medium text-gray-800 text-sm", children: name }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "ml-2 text-xs text-gray-400", children: cat.namesEn || ((_cat_names = cat.names) === null || _cat_names === void 0 ? void 0 : _cat_names.en) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "ml-1.5 font-mono text-xs text-gray-300", children: [ "/", cat.slug ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "px-2 py-0.5 rounded-full text-xs font-medium ".concat(cat.isActive ? 'bg-green-100 text-green-700' : 'bg-gray-100 text-gray-500'), children: cat.isActive ? t('admin.cat.active') : t('admin.cat.inactive') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-1 flex-shrink-0", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { onClick: ()=>onToggleSkills(cat), className: "text-xs px-2 py-1 rounded-lg font-medium flex items-center gap-1 ".concat(skillsOpen ? 'bg-amber-100 text-amber-700' : 'bg-amber-50 text-amber-600 hover:bg-amber-100'), title: "НавыкО", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3 h-3", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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" }) }), skillsCache[cat.slug] ? skillsCache[cat.slug].length : t('admin.cat.skills', 'Skills') ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>onAddChild(cat.id), className: "text-xs px-2 py-1 rounded-lg bg-green-50 text-green-600 hover:bg-green-100 font-medium", title: t('admin.cat.add_child'), children: "+" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>onEdit(cat), className: "text-xs px-2 py-1 rounded-lg bg-gray-100 text-gray-600 hover:bg-gray-200 font-medium", children: t('common.edit') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>onDelete(cat.id, name), className: "text-xs px-2 py-1 rounded-lg bg-red-50 text-red-600 hover:bg-red-100 font-medium", children: t('common.delete') }) ] }) ] }), skillsOpen && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(SkillsPanel, { cat: cat, locale: locale, depth: depth, t: t, skills: skills, isLoading: isLoadingSkills, skillForm: skillForm, skillSaving: skillSaving, onOpenAddSkill: onOpenAddSkill, onOpenEditSkill: onOpenEditSkill, onSaveSkill: onSaveSkill, onDeleteSkill: onDeleteSkill, onCancelSkillForm: onCancelSkillForm, onSkillFormChange: onSkillFormChange }), hasChildren && isOpen && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(CatTree, { rows: rows, parentId: cat.id, depth: depth + 1, locale: locale, expanded: expanded, onToggle: onToggle, onEdit: onEdit, onDelete: onDelete, onAddChild: onAddChild, skillsExpanded: skillsExpanded, skillsCache: skillsCache, skillsLoading: skillsLoading, onToggleSkills: onToggleSkills, skillForm: skillForm, skillSaving: skillSaving, onOpenAddSkill: onOpenAddSkill, onOpenEditSkill: onOpenEditSkill, onSaveSkill: onSaveSkill, onDeleteSkill: onDeleteSkill, onCancelSkillForm: onCancelSkillForm, onSkillFormChange: onSkillFormChange, t: t }) ] }, cat.id); }) }); } // ─── SkillsPanel ──────────────────────────────────────────────────────────── // Self-contained component for the skill list + edit form + dedup panel per category const SKILL_LANG_LABELS = { nameEl: '🇬🇷 EL', nameEn: '🇬🇧 EN', nameRu: '🇷🇺 RU', nameUk: '🇺🇊 UK' }; function SkillForm(param) { let { form, saving, onSave, onCancel, onChange } = param; var _form_nameEl; var _form_order; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white border border-amber-200 rounded-xl p-4 shadow-sm", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "grid grid-cols-2 gap-3 mb-3", children: [ 'nameEl', 'nameEn', 'nameRu', 'nameUk' ].map((field, i)=>{ var _form_field; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-[11px] font-semibold text-gray-500 mb-1 uppercase tracking-wide", children: SKILL_LANG_LABELS[field] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: (_form_field = form[field]) !== null && _form_field !== void 0 ? _form_field : '', onChange: (e)=>onChange({ ...form, [field]: e.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: i === 0, placeholder: field === 'nameUk' ? 'МеПбПвʌязкПвП' : '' }) ] }, field); }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-3 pt-1 border-t border-gray-100", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "text-xs text-gray-400 font-medium", children: "ППряЎПк" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "number", value: (_form_order = form.order) !== null && _form_order !== void 0 ? _form_order : 0, onChange: (e)=>onChange({ ...form, order: Number(e.target.value) }), className: "w-16 border border-gray-200 rounded-lg px-2 py-1 text-xs text-center" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-2 ml-auto", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: onCancel, className: "px-3 py-1.5 bg-gray-100 text-gray-600 rounded-lg text-xs font-medium hover:bg-gray-200 transition", children: "ОтЌеМа" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: onSave, disabled: saving || !((_form_nameEl = form.nameEl) === null || _form_nameEl === void 0 ? void 0 : _form_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: saving ? 'СПхраМяю ' : 'СПхраМОть' }) ] }) ] }) ] }); } function SkillsPanel(param) { let { cat, locale, depth, t, skills, isLoading, skillForm, skillSaving, onOpenAddSkill, onOpenEditSkill, onSaveSkill, onDeleteSkill, onCancelSkillForm, onSkillFormChange } = param; const showAddForm = (skillForm === null || skillForm === void 0 ? void 0 : skillForm.catSlug) === cat.slug && !(skillForm === null || skillForm === void 0 ? void 0 : skillForm.id); return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "border-t border-amber-100 bg-gradient-to-b from-amber-50/60 to-white", style: { paddingLeft: "".concat(16 + depth * 24 + 36, "px"), paddingRight: '16px', paddingTop: '14px', paddingBottom: '14px' }, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-2 mb-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-xs font-bold text-amber-700 uppercase tracking-wider", children: "НавыкО" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "text-xs text-amber-500 font-mono", children: [ "/", cat.slug ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "ml-1 text-xs text-amber-400", children: [ "(", skills.length, ")" ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "ml-auto", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { onClick: ()=>{ onCancelSkillForm(); onOpenAddSkill(cat.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: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-3 h-3", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: "12", y1: "5", x2: "12", y2: "19" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: "5", y1: "12", x2: "19", y2: "12" }) ] }), "ДПбавОть" ] }) }) ] }), isLoading ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-2 py-3 text-xs text-gray-400", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-3.5 h-3.5 animate-spin", fill: "none", viewBox: "0 0 24 24", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("circle", { cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4", className: "opacity-25" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { fill: "currentColor", d: "M4 12a8 8 0 018-8v8z", className: "opacity-75" }) ] }), "Загрузка " ] }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-1", children: [ skills.length === 0 && !showAddForm && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400 italic py-2", children: "НавыкО Ме ЎПбавлеМы" }), skills.map((skill)=>{ const isEditingThis = (skillForm === null || skillForm === void 0 ? void 0 : skillForm.id) === skill.id; const skillName = locale === 'en' ? skill.nameEn : locale === 'ru' ? skill.nameRu : locale === 'uk' ? skill.nameUk || skill.nameEn : skill.nameEl; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-2 rounded-lg px-3 py-2 group transition ".concat(isEditingThis ? 'bg-amber-50 border border-amber-200' : 'bg-white border border-gray-100 hover:border-amber-200 hover:bg-amber-50/30'), children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-sm font-medium text-gray-800", children: skillName }), locale !== 'en' && skill.nameEn && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "ml-2 text-xs text-gray-400", children: skill.nameEn }), locale !== 'ru' && skill.nameRu && skill.nameRu !== skill.nameEl && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "ml-1.5 text-xs text-gray-300", children: skill.nameRu }) ] }), skill.order > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "text-[10px] text-gray-300 font-mono", children: [ "#", skill.order ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-1 transition-opacity ".concat(isEditingThis ? 'opacity-100' : 'opacity-0 group-hover:opacity-100'), children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>isEditingThis ? onCancelSkillForm() : (onCancelSkillForm(), onOpenEditSkill(skill, cat.slug)), className: "text-xs px-2 py-0.5 rounded-md font-medium transition ".concat(isEditingThis ? 'bg-amber-100 text-amber-700' : 'bg-gray-100 text-gray-600 hover:bg-amber-100 hover:text-amber-700'), children: isEditingThis ? '✕' : t('common.edit') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>onDeleteSkill(skill, cat.slug), className: "text-xs px-2 py-0.5 rounded-md bg-red-50 text-red-600 hover:bg-red-100 transition", children: t('common.delete') }) ] }) ] }), isEditingThis && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "mt-1 mb-1 ml-0", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(SkillForm, { form: skillForm, saving: skillSaving, onSave: onSaveSkill, onCancel: onCancelSkillForm, onChange: onSkillFormChange }) }) ] }, skill.id); }), showAddForm && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "mt-2", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(SkillForm, { form: skillForm, saving: skillSaving, onSave: onSaveSkill, onCancel: onCancelSkillForm, onChange: onSkillFormChange }) }) ] }) ] }); } function Pagination(param) { let { page, total, limit, onChange, totalLabel } = param; const pages = Math.ceil(total / limit); if (pages <= 1) return null; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-between px-4 py-3 border-t border-gray-100 text-sm text-gray-500", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { children: [ totalLabel, ": ", total ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-1", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>onChange(page - 1), disabled: page === 1, className: "px-3 py-1 rounded-lg border border-gray-200 disabled:opacity-40 hover:bg-gray-50", children: "←" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "px-3 py-1", children: [ page, " / ", pages ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>onChange(page + 1), disabled: page >= pages, className: "px-3 py-1 rounded-lg border border-gray-200 disabled:opacity-40 hover:bg-gray-50", children: "→" }) ] }) ] }); } // ── Activity log helpers ────────────────────────────────────────────────── function parseLogDetails(details) { try { return details ? JSON.parse(details) : null; } catch (e) { return null; } } const EVENT_META = { 'user.login': { icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("circle", { cx: "12", cy: "12", r: "10" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("circle", { cx: "12", cy: "12", r: "10" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: "15", y1: "9", x2: "9", y2: "15" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("polyline", { points: "3 6 5 6 21 6" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: "18", y1: "6", x2: "6", y2: "18" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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 ActivityLogRow(param) { let { entry, dateLocale, onFilterUser, t } = param; var _EVENT_META_entry_event; const meta = (_EVENT_META_entry_event = EVENT_META[entry.event]) !== null && _EVENT_META_entry_event !== void 0 ? _EVENT_META_entry_event : { icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: entry.event, color: 'bg-gray-50 text-gray-700 border-gray-200' }; const details = parseLogDetails(entry.details); return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 px-4 py-3 flex items-start gap-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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 ".concat(meta.color), children: [ meta.icon, " ", t(meta.labelKey, meta.labelKey) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-2 flex-wrap", children: [ entry.userName && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>entry.userId && onFilterUser(entry.userId), className: "text-sm font-medium text-gray-800 hover:text-green-600", children: entry.userName }), entry.userEmail && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-xs text-gray-400", children: entry.userEmail }) ] }), details && Object.keys(details).length > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "mt-1 flex flex-wrap gap-2", children: Object.entries(details).map((param)=>{ let [k, v] = param; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "text-xs bg-gray-100 text-gray-600 px-2 py-0.5 rounded", children: [ k, ": ", /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "font-medium", children: String(v) }) ] }, k); }) }), entry.ipAddress && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400 mt-0.5", children: entry.ipAddress }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("time", { className: "shrink-0 text-xs text-gray-400 whitespace-nowrap", children: new Date(entry.createdAt).toLocaleString(dateLocale) }) ] }); } const MONTH_NAMES = (/* unused pure expression or super */ null && ([ 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec' ])); function AdminMonthChart(param) { let { series, dateLocale = 'en-US' } = param; // Collect all unique months from all series, sorted const monthSet = new Set(); series.forEach((s)=>s.data.forEach((r)=>monthSet.add(r.month))); const months = Array.from(monthSet).sort(); if (months.length === 0) return null; // Build lookup maps const seriesVals = series.map((s)=>{ const map = {}; s.data.forEach((r)=>{ map[r.month] = Number(r.count); }); return months.map((m)=>{ var _map_m; return (_map_m = map[m]) !== null && _map_m !== void 0 ? _map_m : 0; }); }); const allVals = seriesVals.flat(); const maxVal = Math.max(...allVals, 1); const W = 700; const H = 160; const padL = maxVal >= 1000000 ? 50 : maxVal >= 10000 ? 44 : maxVal >= 1000 ? 40 : 36; const padB = 24; const chartH = H - padB; const totalBars = months.length * series.length; const groupW = (W - padL - 8) / months.length; const barW = Math.max(4, Math.min(20, groupW / series.length - 2)); const yTicks = [ 0, Math.round(maxVal / 3), Math.round(maxVal * 2 / 3), maxVal ]; function barX(mi, si) { const groupStart = padL + mi * groupW + (groupW - series.length * (barW + 1)) / 2; return groupStart + si * (barW + 1); } function barHeight(v) { return v / maxVal * chartH; } return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "overflow-x-auto", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { viewBox: "0 0 ".concat(W, " ").concat(H + 14), className: "w-full", style: { minWidth: Math.max(360, months.length * 40) }, children: [ yTicks.map((v, i)=>{ const y = chartH - v / maxVal * chartH; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("g", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: padL, y1: y, x2: W - 4, y2: y, stroke: "#f3f4f6", strokeWidth: 1 }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("text", { x: padL - 5, y: y + 3.5, textAnchor: "end", fontSize: 9, fill: "#9ca3af", children: fmtYLabel(v) }) ] }, i); }), months.map((m, mi)=>series.map((s, si)=>{ const v = seriesVals[si][mi]; const bh = barHeight(v); const x = barX(mi, si); return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("rect", { x: x, y: chartH - bh, width: barW, height: bh, fill: s.color, opacity: 0.8, rx: 2 }, "bar-".concat(mi, "-").concat(si)); })), months.map((m, mi)=>{ const [yr, mo] = m.slice(0, 7).split('-').map(Number); const d = new Date(Date.UTC(yr, mo - 1, 2)); const label = new Intl.DateTimeFormat(dateLocale, { month: 'short' }).format(d) + (mi === 0 || mo === 1 ? " ".concat(yr) : ''); const cx = padL + mi * groupW + groupW / 2; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("text", { x: cx, y: H + 12, textAnchor: "middle", fontSize: 9, fill: "#9ca3af", children: label }, "xl-".concat(mi)); }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: padL, y1: chartH, x2: W - 4, y2: chartH, stroke: "#e5e7eb", strokeWidth: 1 }) ] }) }); } function getLast30Days() { const days = []; for(let i = 29; i >= 0; i--){ const d = new Date(Date.now() - i * 86400000); days.push(d.toISOString().slice(0, 10)); } return days; } function smoothPath(pts) { if (pts.length < 2) return ''; let d = "M ".concat(pts[0][0].toFixed(1), " ").concat(pts[0][1].toFixed(1)); for(let i = 1; i < pts.length; i++){ const cpx = ((pts[i - 1][0] + pts[i][0]) / 2).toFixed(1); d += " C ".concat(cpx, " ").concat(pts[i - 1][1].toFixed(1), " ").concat(cpx, " ").concat(pts[i][1].toFixed(1), " ").concat(pts[i][0].toFixed(1), " ").concat(pts[i][1].toFixed(1)); } return d; } function fmtYLabel(v) { if (v >= 1000000) return "".concat(+(v / 1000000).toFixed(1), "M"); if (v >= 1000) return "".concat(Math.round(v / 1000), "K"); return String(v); } function AdminAreaChart(param) { let { series, days: daysProp } = param; const days = daysProp !== null && daysProp !== void 0 ? daysProp : getLast30Days(); const seriesVals = series.map((s)=>{ const map = {}; s.data.forEach((r)=>{ map[r.day] = Number(r.count); }); return days.map((d)=>{ var _map_d; return (_map_d = map[d]) !== null && _map_d !== void 0 ? _map_d : 0; }); }); const allVals = seriesVals.flat(); const maxVal = Math.max(...allVals, 1); const W = 700; const H = 160; const padL = maxVal >= 10000 ? 44 : maxVal >= 1000 ? 40 : 36; const padB = 22; const chartW = W - padL - 4; const chartH = H - padB; const stepX = chartW / (days.length - 1); function pts(vals) { return vals.map((v, i)=>[ padL + i * stepX, chartH - v / maxVal * chartH ]); } function areaPath(vals) { const points = pts(vals); const line = smoothPath(points); if (!line) return ''; const lastX = points[points.length - 1][0].toFixed(1); return "".concat(line, " L ").concat(lastX, " ").concat(chartH.toFixed(1), " L ").concat(padL.toFixed(1), " ").concat(chartH.toFixed(1), " Z"); } // Y-axis: 4 labels (0, 1/3, 2/3, max) const yTicks = [ 0, Math.round(maxVal / 3), Math.round(maxVal * 2 / 3), maxVal ]; // X-axis: every 7 days + last const xTicks = days.map((d, i)=>({ i, label: d.slice(8) })).filter((_, i)=>i % 7 === 0 || i === days.length - 1); return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "overflow-x-auto", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { viewBox: "0 0 ".concat(W, " ").concat(H + 12), className: "w-full", style: { minWidth: 360 }, children: [ yTicks.map((v, i)=>{ const y = chartH - v / maxVal * chartH; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("g", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: padL, y1: y, x2: W - 4, y2: y, stroke: "#f3f4f6", strokeWidth: 1 }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("text", { x: padL - 5, y: y + 3.5, textAnchor: "end", fontSize: 9, fill: "#9ca3af", children: fmtYLabel(v) }) ] }, i); }), xTicks.map((param)=>{ let { i } = param; const x = padL + i * stepX; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: x, y1: 0, x2: x, y2: chartH, stroke: "#f9fafb", strokeWidth: 1 }, "vg-".concat(i)); }), xTicks.map((param)=>{ let { i, label } = param; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("text", { x: padL + i * stepX, y: H + 10, textAnchor: "middle", fontSize: 9, fill: "#9ca3af", children: label }, i); }), series.map((s, si)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: areaPath(seriesVals[si]), fill: s.fill }, "fill-".concat(si))), series.map((s, si)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: smoothPath(pts(seriesVals[si])), fill: "none", stroke: s.color, strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round" }, "line-".concat(si))), series.map((s, si)=>{ const points = pts(seriesVals[si]); const last = points[points.length - 1]; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("g", { children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("circle", { cx: last[0], cy: last[1], r: 4, fill: "white", stroke: s.color, strokeWidth: 2 }) }, "dot-".concat(si)); }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: padL, y1: chartH, x2: W - 4, y2: chartH, stroke: "#e5e7eb", strokeWidth: 1 }) ] }) }); } €”{"finalSource":true}ƒmap‹bufferedMap ConcatSourceRawSource+__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ AdminPage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7541); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(9664); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(next_link__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(1592); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(9906); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(2982); /* harmony import */ var _lib_formatName__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(1258); /* harmony import */ var _lib_taskLocale__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(4017); /* harmony import */ var _components_CategoryIcon__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(5940); ReplaceSourceRawSourceÞ;/* __next_internal_client_entry_do_not_use__ default auto */ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime"; import { useState, useEffect, useRef } from 'react'; import { useRouter } from 'next/navigation'; import Link from 'next/link'; import { useSession } from '@/lib/auth'; import { useLocale } from '@/context/locale'; import * as api from '@/lib/api'; import { request } from '@/lib/api'; import { formatShortName } from '@/lib/formatName'; import { formatPrice } from '@/lib/taskLocale'; import { CategoryIcon } from '@/components/CategoryIcon'; const TEMPLATE_VARS = { 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' ] }; const TEMPLATE_HINT_VARS = Array.from(new Set(Object.values(TEMPLATE_VARS).flat())); const DEFAULT_CATEGORY_ICON_PRESETS = [ { 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 getCatLabel(row, locale) { if (!row) return ''; if (locale === 'en') return row.namesEn || row.namesEl || row.slug || ''; if (locale === 'ru') return row.namesRu || row.namesEl || row.slug || ''; if (locale === 'uk') return row.namesUk || row.namesEl || row.slug || ''; return row.namesEl || row.namesEn || row.slug || ''; } function getLocLabel(row, locale) { if (!row) return ''; if (locale === 'en') return row.nameEn || row.nameEl || row.slug || ''; if (locale === 'ru') return row.nameRu || row.nameEl || row.slug || ''; if (locale === 'uk') return row.nameUk || row.nameEl || row.slug || ''; return row.nameEl || row.nameEn || row.slug || ''; } function CategoryIconPicker(param) { let { value, onChange, onUpload, uploading, error, presets } = param; return /*#__PURE__*/ _jsxs("div", { className: "space-y-2", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 rounded-xl border border-gray-200 bg-white px-3 py-2", children: [ /*#__PURE__*/ _jsx("div", { className: "flex h-12 w-12 items-center justify-center rounded-lg bg-green-50", children: /*#__PURE__*/ _jsx(CategoryIcon, { icon: value, alt: "category icon", className: "h-9 w-9 object-contain text-3xl leading-none", fallback: "\uD83D\uDCE6" }) }), /*#__PURE__*/ _jsx("input", { value: value, onChange: (e)=>onChange(e.target.value), className: "flex-1 border-0 bg-transparent p-0 text-sm outline-none ring-0", placeholder: "/category-icons/package.svg" }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2", children: [ /*#__PURE__*/ _jsxs("label", { className: "inline-flex cursor-pointer items-center rounded-lg border px-3 py-1.5 text-xs font-medium transition ".concat(uploading ? 'border-gray-200 bg-gray-100 text-gray-400' : 'border-green-300 bg-green-50 text-green-700 hover:bg-green-100'), children: [ uploading ? 'Uploading...' : 'Upload SVG', /*#__PURE__*/ _jsx("input", { type: "file", accept: ".svg,image/svg+xml", className: "hidden", disabled: uploading, onChange: async (e)=>{ var _e_target_files; const file = (_e_target_files = e.target.files) === null || _e_target_files === void 0 ? void 0 : _e_target_files[0]; if (!file) return; await onUpload(file); e.target.value = ''; } }) ] }), /*#__PURE__*/ _jsx("span", { className: "text-xs text-gray-500", children: "or choose from presets" }) ] }), /*#__PURE__*/ _jsx("p", { className: "text-[11px] text-gray-500", children: "Preset source: /public/category-icons/presets.json" }), error ? /*#__PURE__*/ _jsx("p", { className: "text-xs text-red-600", children: error }) : null, /*#__PURE__*/ _jsx("div", { className: "grid grid-cols-2 gap-2 sm:grid-cols-3 lg:grid-cols-4", children: presets.map((preset)=>{ const active = value === preset.value; return /*#__PURE__*/ _jsxs("button", { type: "button", onClick: ()=>onChange(preset.value), className: "flex h-20 flex-col items-center justify-center gap-1 rounded-lg border px-2 transition ".concat(active ? 'border-green-500 bg-green-50 shadow-sm' : 'border-gray-200 bg-white hover:border-green-300 hover:bg-green-50'), "aria-label": preset.label, title: preset.label, children: [ /*#__PURE__*/ _jsx(CategoryIcon, { icon: preset.value, alt: preset.label, className: "h-8 w-8 object-contain text-3xl leading-none", fallback: "\uD83D\uDCE6" }), /*#__PURE__*/ _jsx("span", { className: "max-w-full truncate text-[11px] font-medium text-gray-600 leading-tight", children: preset.label }) ] }, preset.value); }) }) ] }); } function AdminCatPicker(param) { let { catRows, locale, selected, onAdd, addLabel } = param; const [open, setOpen] = useState(false); const [search, setSearch] = useState(''); const [expandedParent, setExpandedParent] = useState(null); const ref = useRef(null); useEffect(()=>{ function h(e) { if (ref.current && !ref.current.contains(e.target)) { setOpen(false); setSearch(''); } } document.addEventListener('mousedown', h); return ()=>document.removeEventListener('mousedown', h); }, []); const parents = catRows.filter((r)=>!r.parentId); const lowerSearch = search.toLowerCase(); const matchesSearch = (r)=>{ var _r_slug; return !search || getCatLabel(r, locale).toLowerCase().includes(lowerSearch) || ((_r_slug = r.slug) !== null && _r_slug !== void 0 ? _r_slug : '').toLowerCase().includes(lowerSearch); }; return /*#__PURE__*/ _jsxs("div", { className: "relative", ref: ref, children: [ /*#__PURE__*/ _jsxs("button", { type: "button", onClick: ()=>setOpen((v)=>!v), className: "w-full flex items-center gap-1.5 px-3 py-1.5 text-xs transition-colors ".concat(open ? '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: [ /*#__PURE__*/ _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: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4 6h16M4 10h16M4 14h16M4 18h16" }) }), /*#__PURE__*/ _jsx("span", { className: "flex-1 text-left truncate", children: addLabel }), /*#__PURE__*/ _jsx("svg", { className: "w-3 h-3 text-gray-400 shrink-0 transition-transform ".concat(open ? 'rotate-180' : ''), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19 9l-7 7-7-7" }) }) ] }), open && /*#__PURE__*/ _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: [ /*#__PURE__*/ _jsx("div", { className: "sticky top-0 bg-white px-3 py-2 border-b border-gray-100", children: /*#__PURE__*/ _jsx("input", { autoFocus: true, value: search, onChange: (e)=>setSearch(e.target.value), placeholder: "ППОск...", className: "w-full text-xs border border-gray-200 rounded-lg px-2.5 py-1.5 focus:outline-none focus:ring-2 focus:ring-blue-300" }) }), parents.map((parent)=>{ const children = catRows.filter((r)=>r.parentId === parent.id); const parentLabel = getCatLabel(parent, locale); const isExpanded = expandedParent === parent.id; const matchingChildren = children.filter((c)=>!selected.includes(c.slug) && matchesSearch(c)); const parentAvail = !selected.includes(parent.slug) && matchesSearch(parent); const hasChildren = children.length > 0; if (!parentAvail && matchingChildren.length === 0 && search) return null; return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _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: ()=>{ if (hasChildren && !search) { setExpandedParent(isExpanded ? null : parent.id); } else if (parentAvail) { onAdd(parent.slug); setOpen(false); setSearch(''); } }, children: [ parent.icon ? /*#__PURE__*/ _jsx(CategoryIcon, { icon: parent.icon, alt: parentLabel, className: "h-5 w-5 shrink-0 object-contain text-sm leading-none", fallback: "\uD83D\uDCE6" }) : null, /*#__PURE__*/ _jsx("span", { className: "flex-1 font-medium", children: parentLabel }), hasChildren && !search ? /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5 text-gray-400 shrink-0 transition-transform ".concat(isExpanded ? 'rotate-90' : ''), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 5l7 7-7 7" }) }) : null ] }), (isExpanded || !!search) && matchingChildren.map((child)=>/*#__PURE__*/ _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: ()=>{ onAdd(child.slug); setOpen(false); setSearch(''); }, children: [ /*#__PURE__*/ _jsx("span", { className: "w-1.5 h-1.5 rounded-full bg-gray-300 shrink-0" }), /*#__PURE__*/ _jsx("span", { className: "flex-1", children: getCatLabel(child, locale) }) ] }, child.id)) ] }, parent.id); }) ] }) ] }); } function AdminLocPicker(param) { let { locRows, locale, selected, onAdd, addLabel } = param; const [open, setOpen] = useState(false); const [search, setSearch] = useState(''); const [expandedCity, setExpandedCity] = useState(null); const ref = useRef(null); useEffect(()=>{ function h(e) { if (ref.current && !ref.current.contains(e.target)) { setOpen(false); setSearch(''); } } document.addEventListener('mousedown', h); return ()=>document.removeEventListener('mousedown', h); }, []); const cities = locRows.filter((r)=>!r.parentId); const lowerSearch = search.toLowerCase(); const matchesSearch = (r)=>{ var _r_slug; return !search || getLocLabel(r, locale).toLowerCase().includes(lowerSearch) || ((_r_slug = r.slug) !== null && _r_slug !== void 0 ? _r_slug : '').toLowerCase().includes(lowerSearch); }; return /*#__PURE__*/ _jsxs("div", { className: "relative", ref: ref, children: [ /*#__PURE__*/ _jsxs("button", { type: "button", onClick: ()=>setOpen((v)=>!v), className: "w-full flex items-center gap-1.5 px-3 py-1.5 text-xs transition-colors ".concat(open ? '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: [ /*#__PURE__*/ _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: [ /*#__PURE__*/ _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" }), /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 11a3 3 0 11-6 0 3 3 0 016 0z" }) ] }), /*#__PURE__*/ _jsx("span", { className: "flex-1 text-left truncate", children: addLabel }), /*#__PURE__*/ _jsx("svg", { className: "w-3 h-3 text-gray-400 shrink-0 transition-transform ".concat(open ? 'rotate-180' : ''), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19 9l-7 7-7-7" }) }) ] }), open && /*#__PURE__*/ _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: [ /*#__PURE__*/ _jsx("div", { className: "sticky top-0 bg-white px-3 py-2 border-b border-gray-100", children: /*#__PURE__*/ _jsx("input", { autoFocus: true, value: search, onChange: (e)=>setSearch(e.target.value), placeholder: "ППОск...", className: "w-full text-xs border border-gray-200 rounded-lg px-2.5 py-1.5 focus:outline-none focus:ring-2 focus:ring-blue-300" }) }), cities.map((city)=>{ const districts = locRows.filter((r)=>r.parentId === city.id); const cityLabel = getLocLabel(city, locale); const isExpanded = expandedCity === city.id; const hasDistricts = districts.length > 0; const matchingDistricts = districts.filter((d)=>!selected.includes(d.slug) && matchesSearch(d)); const cityAvail = !selected.includes(city.slug) && matchesSearch(city); if (!cityAvail && matchingDistricts.length === 0 && search) return null; return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _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: ()=>{ if (hasDistricts && !search) { setExpandedCity(isExpanded ? null : city.id); } else if (cityAvail) { onAdd(city.slug); setOpen(false); setSearch(''); } }, children: [ /*#__PURE__*/ _jsx("svg", { className: "w-3 h-3 text-gray-300 shrink-0", fill: "currentColor", viewBox: "0 0 24 24", children: /*#__PURE__*/ _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" }) }), /*#__PURE__*/ _jsx("span", { className: "flex-1 font-medium", children: cityLabel }), hasDistricts && !search ? /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5 text-gray-400 shrink-0 transition-transform ".concat(isExpanded ? 'rotate-90' : ''), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 5l7 7-7 7" }) }) : null ] }), (isExpanded || !!search) && matchingDistricts.map((d)=>/*#__PURE__*/ _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: ()=>{ onAdd(d.slug); setOpen(false); setSearch(''); }, children: [ /*#__PURE__*/ _jsx("span", { className: "w-1.5 h-1.5 rounded-full bg-gray-300 shrink-0" }), /*#__PURE__*/ _jsx("span", { className: "flex-1", children: getLocLabel(d, locale) }) ] }, d.id)) ] }, city.id); }) ] }) ] }); } export default function AdminPage() { var _session_user, _stats_tokensByMonth; const router = useRouter(); const { data: session, isPending } = useSession(); const { t, locale } = useLocale(); const [tab, setTab] = useState('stats'); const [sidebarCollapsed, setSidebarCollapsed] = useState(false); useEffect(()=>{ setSidebarCollapsed(window.innerWidth < 1024); }, []); // Stats const [stats, setStats] = useState(null); // Users const [users, setUsers] = useState([]); const [usersPage, setUsersPage] = useState(1); const [usersTotal, setUsersTotal] = useState(0); const [usersQ, setUsersQ] = useState(''); const [usersQInput, setUsersQInput] = useState(''); const [usersRole, setUsersRole] = useState(''); // Tasks const [tasks, setTasks] = useState([]); const [tasksPage, setTasksPage] = useState(1); const [tasksTotal, setTasksTotal] = useState(0); const [tasksQ, setTasksQ] = useState(''); const [tasksQInput, setTasksQInput] = useState(''); const [tasksStatus, setTasksStatus] = useState(''); // Reports const [reports, setReports] = useState([]); const [reportsPage, setReportsPage] = useState(1); const [reportsTotal, setReportsTotal] = useState(0); const [pendingReportsCount, setPendingReportsCount] = useState(0); // Specialist card moderation const [moderationCards, setModerationCards] = useState([]); const [moderationCardsPage, setModerationCardsPage] = useState(1); const [moderationCardsTotal, setModerationCardsTotal] = useState(0); const [moderationCardsLoading, setModerationCardsLoading] = useState(false); const [pendingCardsCount, setPendingCardsCount] = useState(0); // Support tickets const [supportTickets, setSupportTickets] = useState([]); const [supportPage, setSupportPage] = useState(1); const [supportTotal, setSupportTotal] = useState(0); const [supportStatus, setSupportStatus] = useState(''); const [supportType, setSupportType] = useState(''); const [supportQ, setSupportQ] = useState(''); const [supportQInput, setSupportQInput] = useState(''); const [supportReplyId, setSupportReplyId] = useState(null); const [supportReplyText, setSupportReplyText] = useState(''); const [supportReplySaving, setSupportReplySaving] = useState(false); // AI Logs const [logs, setLogs] = useState([]); const [logsPage, setLogsPage] = useState(1); const [logsTotal, setLogsTotal] = useState(0); // Activity Logs const [activityLog, setActivityLog] = useState([]); const [activityTotal, setActivityTotal] = useState(0); const [activityPage, setActivityPage] = useState(1); const [activityEvent, setActivityEvent] = useState(''); const [activityUserId, setActivityUserId] = useState(''); const [activityDateFrom, setActivityDateFrom] = useState(''); const [activityDateTo, setActivityDateTo] = useState(''); const [activityEventTypes, setActivityEventTypes] = useState([]); // Mail Logs const [mailLog, setMailLog] = useState([]); const [mailTotal, setMailTotal] = useState(0); const [mailPage, setMailPage] = useState(1); const [mailEvent, setMailEvent] = useState(''); const [mailDateFrom, setMailDateFrom] = useState(''); const [mailDateTo, setMailDateTo] = useState(''); const [mailEventTypes, setMailEventTypes] = useState([]); // Logs sub-tab const [logsSubTab, setLogsSubTab] = useState('ai'); // Notification Logs const [notifLogs, setNotifLogs] = useState([]); const [notifLogsPage, setNotifLogsPage] = useState(1); const [notifLogsTotal, setNotifLogsTotal] = useState(0); const [notifLogsType, setNotifLogsType] = useState(''); const [notifLogsTypes, setNotifLogsTypes] = useState([]); const [notifLogsDateFrom, setNotifLogsDateFrom] = useState(''); const [notifLogsDateTo, setNotifLogsDateTo] = useState(''); // Notification stats chart const [notifsByDay, setNotifsByDay] = useState([]); const [mailByDay, setMailByDay] = useState([]); // Balance archive const [balanceRows, setBalanceRows] = useState([]); const [balanceTotal, setBalanceTotal] = useState(0); const [balancePage, setBalancePage] = useState(1); const [balanceUserId, setBalanceUserId] = useState(''); const [balanceKind, setBalanceKind] = useState(''); const [topUpSaving, setTopUpSaving] = useState(false); const [withdrawSaving, setWithdrawSaving] = useState(false); // User edit modal const [editUser, setEditUser] = useState(null); const [editUserSaving, setEditUserSaving] = useState(false); const [verifyingEmail, setVerifyingEmail] = useState(false); const [editUserTab, setEditUserTab] = useState('profile'); const [balanceModal, setBalanceModal] = useState(null); const [skillInput, setSkillInput] = useState(''); const [editUserCards, setEditUserCards] = useState([]); const [editUserCardsLoading, setEditUserCardsLoading] = useState(false); const [cardSkillInputs, setCardSkillInputs] = useState({}); const [cardSaving, setCardSaving] = useState({}); const [cardCatSelects, setCardCatSelects] = useState({}); const [cardLocSelects, setCardLocSelects] = useState({}); // Plans const [planRows, setPlanRows] = useState([]); const [planForm, setPlanForm] = useState(null); const [planSaving, setPlanSaving] = useState(false); // Locations const [locRows, setLocRows] = useState([]); const [locForm, setLocForm] = useState(null); const [locSaving, setLocSaving] = useState(false); const [locExpanded, setLocExpanded] = useState(new Set()); // Categories const [catRows, setCatRows] = useState([]); const [catForm, setCatForm] = useState(null); const [catSaving, setCatSaving] = useState(false); const [catExpanded, setCatExpanded] = useState(new Set()); const [catIconUploading, setCatIconUploading] = useState(false); const [catIconError, setCatIconError] = useState(null); const [categoryIconPresets, setCategoryIconPresets] = useState(DEFAULT_CATEGORY_ICON_PRESETS); // Category Skills const [catSkillsExpanded, setCatSkillsExpanded] = useState(new Set()); const [catSkillsCache, setCatSkillsCache] = useState({}); const [catSkillsLoading, setCatSkillsLoading] = useState(new Set()); const [skillForm, setSkillForm] = useState(null); const [skillSaving, setSkillSaving] = useState(false); // Settings const [settingsTab, setSettingsTab] = useState('general'); const [generalForm, setGeneralForm] = useState({ siteName: 'CanHelp', siteUrl: '', contactEmail: '', supportPhone: '' }); const [generalSaving, setGeneralSaving] = useState(false); const [generalSaved, setGeneralSaved] = useState(false); const [smtpForm, setSmtpForm] = useState({ host: '', port: '587', username: '', password: '', fromName: 'CanHelp', fromEmail: '', encryption: 'tls' }); const [smtpSaving, setSmtpSaving] = useState(false); const [smtpSaved, setSmtpSaved] = useState(false); const [testEmailSending, setTestEmailSending] = useState(false); const [testEmailResult, setTestEmailResult] = useState(null); const [notifTemplates, setNotifTemplates] = useState({ email_verification: { subject: 'ППЎтверЎОте ваш email — {{siteName}}', body: '' }, registration_success: { subject: 'ДПбрП пПжалПвать в {{siteName}}!', body: '' }, password_reset: { subject: 'ВПсстаМПвлеМОе парПля — {{siteName}}', body: '' }, new_offer: { subject: 'НПвПе преЎлПжеМОе пП вашей заЎаче «{{taskTitle}}»', body: '' }, new_task: { subject: 'НПвая заЎача: {{taskTitle}}', body: '' }, offer_accepted: { subject: 'Ваше преЎлПжеМОе прОМятП: {{taskTitle}}', body: '

Ваше преЎлПжеМОе прОМятП! 🎉

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

ЗаказчОк прОМял ваше преЎлПжеМОе Ма выпПлМеМОе заЎачО:

{{taskTitle}}

СуЌЌа: {{price}}€

Открыть чат →' }, new_message: { subject: 'НПвПе сППбщеМОе Пт {{senderName}}', body: '

НПвПе сППбщеМОе

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

ВаЌ МапОсал(а) {{senderName}}:

"{{preview}}"

ОтветОть →' }, offer_declined: { subject: 'Ваше преЎлПжеМОе ПтклПМеМП: {{taskTitle}}', body: '

Ваше преЎлПжеМОе ПтклПМеМП

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

К сПжалеМОю, заказчОк ПтклПМОл ваше преЎлПжеМОе Ма:

{{taskTitle}}

НайтО ЎругОе заказы →' }, offer_other_accepted: { subject: 'ВыбраМ ЎругПй ОспПлМОтель: {{taskTitle}}', body: '

ВыбраМ ЎругПй ОспПлМОтель

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

ЗаказчОк выбрал ЎругПгП ОспПлМОтеля Ўля заЎаМОя:

{{taskTitle}}

НайтО ЎругОе заказы →' }, task_updated: { subject: 'ЗаЎаМОе ПбМПвлеМП: {{taskTitle}}', body: '

ЗаЎаМОе ПбМПвлеМП

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

ЗаказчОк ПбМПвОл ЎеталО заЎаМОя:

{{taskTitle}}

СЌПтреть заказ →' }, deadline_reminder: { subject: 'ЗаЎаМОе Остекает завтра: {{taskTitle}}', body: '

НапПЌОМаМОе П ЎеЎлайМе

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

Ваше заЎаМОе Остекает через 24 часа. ОбМПвОте ЎеЎлайМ, ОМаче заЎаМОе буЎет автПЌатОческО сМятП с публОкацОО.

{{taskTitle}}

РеЎактОрПвать заЎаМОе →' }, task_archived: { subject: 'ЗаЎаМОе сМятП с публОкацОО: {{taskTitle}}', body: '

ЗаЎаМОе перевеЎеМП в черМПвОк

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

Ваше заЎаМОе ОстеклП О былП автПЌатОческО перевеЎеМП в черМПвОк. ОбМПвОте ЎеЎлайМ, чтПбы ПпублОкПвать егП сМПва.

{{taskTitle}}

РеЎактОрПвать заЎаМОе →' }, referral_reward: { subject: 'Вы пПлучОлО реферальМую МаграЎу — {{siteName}}', body: '

Вы пПлучОлО реферальМую МаграЎу! 🎁

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

Друг зарегОстрОрПвался пП вашей реферальМПй ссылке. На ваш аккауМт ЎПбавлеМП {{days}} ЎМей ЎПступа к плаМу {{planName}}!

+{{days}} ЎМей — {{planName}}

ПерейтО к аккауМту →' }, referral_reward_el: { subject: 'Λάβατε αΜταΌοιβή παραποΌπής — {{siteName}}', body: '

Λάβατε αΜταΌοιβή παραποΌπής! 🎁

Γεια {{userName}},

ΈΜας φίλος εγγράφηκε χρησιΌοποιώΜτας τοΜ σύΜΎεσΌο παραποΌπής σας. ΣτοΜ λογαριασΌό σας προστέΞηκαΜ {{days}} ηΌέρες πρόσβασης στο πλάΜο {{planName}}!

+{{days}} ηΌέρες — {{planName}}

Δες τοΜ λογαριασΌό σου →' }, referral_reward_en: { subject: 'You received a referral reward — {{siteName}}', body: '

You received a referral reward! 🎁

Hi {{userName}},

A friend registered using your referral link. {{days}} days of {{planName}} access have been added to your account!

+{{days}} days — {{planName}}

View your account →' }, referral_reward_ru: { subject: 'Вы пПлучОлО реферальМую МаграЎу — {{siteName}}', body: '

Вы пПлучОлО реферальМую МаграЎу! 🎁

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

Друг зарегОстрОрПвался пП вашей реферальМПй ссылке. На ваш аккауМт ЎПбавлеМП {{days}} ЎМей ЎПступа к плаМу {{planName}}!

+{{days}} ЎМей — {{planName}}

ПерейтО к аккауМту →' } }); const [editingTemplate, setEditingTemplate] = useState(null); const [templateLocale, setTemplateLocale] = useState('el'); const [templateSaving, setTemplateSaving] = useState(false); const [templateTranslating, setTemplateTranslating] = useState(false); const [ePayForm, setEPayForm] = useState({ merchantId: '', apiUser: '', apiPassword: '', environment: 'test', confirmationUrl: '', cancelUrl: '', enabled: false }); const [ePaySaving, setEPaySaving] = useState(false); const [ePaySaved, setEPaySaved] = useState(false); const [referralForm, setReferralForm] = useState({ enabled: false, planId: '', days: '30' }); const [referralSaving, setReferralSaving] = useState(false); const [referralSaved, setReferralSaved] = useState(false); const [seoForm, setSeoForm] = useState({ maintenanceMode: false, indexingEnabled: true, headScripts: '', siteTitleEl: '', siteTitleEn: '', siteTitleRu: '', siteTitleUk: '', siteDescriptionEl: '', siteDescriptionEn: '', siteDescriptionRu: '', siteDescriptionUk: '' }); const [seoSaving, setSeoSaving] = useState(false); const [seoSaved, setSeoSaved] = useState(false); const [seoLangTab, setSeoLangTab] = useState('el'); const [socialForm, setSocialForm] = useState({ telegram: '', instagram: '', facebook: '', twitter: '', youtube: '', tiktok: '', whatsapp: '', viber: '' }); const [socialSaving, setSocialSaving] = useState(false); const [socialSaved, setSocialSaved] = useState(false); const [telegramForm, setTelegramForm] = useState({ botToken: '', adminChatId: '', channelIdEl: '', channelIdEn: '', channelIdRu: '', channelIdUk: '', notifyRegistrations: false, postNewTasks: false }); const [telegramSaving, setTelegramSaving] = useState(false); const [telegramSaved, setTelegramSaved] = useState(false); const [testingTelegramAdmin, setTestingTelegramAdmin] = useState(false); const [testingTelegramChannel, setTestingTelegramChannel] = useState(false); const [testResultTelegramAdmin, setTestResultTelegramAdmin] = useState(null); const [testResultTelegramChannel, setTestResultTelegramChannel] = useState(null); const [testingLocale, setTestingLocale] = useState(null); const [testResultChannels, setTestResultChannels] = useState({}); const [verifyingTelegramToken, setVerifyingTelegramToken] = useState(false); const [verifyResultTelegramToken, setVerifyResultTelegramToken] = useState(null); // Backup const [backupAutoEnabled, setBackupAutoEnabled] = useState(false); const [backupAutoSaving, setBackupAutoSaving] = useState(false); const [backupTables, setBackupTables] = useState([]); const [backupTablesLoading, setBackupTablesLoading] = useState(false); const [backupStoredFiles, setBackupStoredFiles] = useState([]); const [backupExporting, setBackupExporting] = useState(false); const [backupImporting, setBackupImporting] = useState(null); const [backupRestoring, setBackupRestoring] = useState(null); const [backupMsg, setBackupMsg] = useState(null); const [backupMsgError, setBackupMsgError] = useState(false); const setBackupSuccess = (msg)=>{ setBackupMsg(msg); setBackupMsgError(false); }; const setBackupError = (msg)=>{ setBackupMsg(msg); setBackupMsgError(true); }; // ─── Translations state ─────────────────────────────────────────────────── const [transStats, setTransStats] = useState(null); const [transStatsLoading, setTransStatsLoading] = useState(false); const [transLang, setTransLang] = useState('uk'); const [transFromLang, setTransFromLang] = useState('el'); const [transTableTranslating, setTransTableTranslating] = useState({}); const [transMsg, setTransMsg] = useState(null); const [transPreview, setTransPreview] = useState(null); // ─── Referrals state ───────────────────────────────────────────────────── const [referralsData, setReferralsData] = useState(null); const [referralsLoading, setReferralsLoading] = useState(false); const [referralsExpanded, setReferralsExpanded] = useState(new Set()); // ─── Push state ────────────────────────────────────────────────────────── const [pushMode, setPushMode] = useState('broadcast'); const [pushTargetUserId, setPushTargetUserId] = useState(''); const [pushTitle, setPushTitle] = useState(''); const [pushBody, setPushBody] = useState(''); const [pushType, setPushType] = useState('general'); const [pushReferenceId, setPushReferenceId] = useState(''); const [pushOnlyActive, setPushOnlyActive] = useState(true); const [pushSending, setPushSending] = useState(false); const [pushResult, setPushResult] = useState(null); const [pushError, setPushError] = useState(null); const [loading, setLoading] = useState(false); const isAdmin = !isPending && session && ((_session_user = session.user) === null || _session_user === void 0 ? void 0 : _session_user.role) === 'admin'; useEffect(()=>{ var _session_user; if (!isPending && !session) router.push('/login'); if (!isPending && session && ((_session_user = session.user) === null || _session_user === void 0 ? void 0 : _session_user.role) !== 'admin') router.push('/'); }, [ session, isPending ]); useEffect(()=>{ if (!isAdmin) return; api.getAdminStats().then(setStats).catch(()=>{}); api.getAdminNotifStats().then(setNotifsByDay).catch(()=>{}); api.getAdminMailStats().then(setMailByDay).catch(()=>{}); api.getAdminReports(1, 'pending').then((d)=>setPendingReportsCount(d.total)).catch(()=>{}); api.getAdminSpecialistCards(1, 'pending').then((d)=>setPendingCardsCount(d.total)).catch(()=>{}); }, [ isAdmin ]); useEffect(()=>{ if (!isAdmin || tab !== 'users') return; setLoading(true); api.getAdminUsers(usersPage, usersQ || undefined, usersRole || undefined).then((d)=>{ setUsers(d.data); setUsersTotal(d.total); }).catch(()=>{}).finally(()=>setLoading(false)); }, [ isAdmin, tab, usersPage, usersQ, usersRole ]); useEffect(()=>{ if (!isAdmin || tab !== 'tasks') return; setLoading(true); api.getAdminTasks(tasksPage, tasksQ || undefined, tasksStatus || undefined).then((d)=>{ setTasks(d.data); setTasksTotal(d.total); }).catch(()=>{}).finally(()=>setLoading(false)); }, [ isAdmin, tab, tasksPage, tasksQ, tasksStatus ]); useEffect(()=>{ if (!isAdmin || tab !== 'reports') return; setLoading(true); api.getAdminReports(reportsPage).then((d)=>{ setReports(d.data); setReportsTotal(d.total); }).catch(()=>{}).finally(()=>setLoading(false)); }, [ isAdmin, tab, reportsPage ]); useEffect(()=>{ if (!isAdmin || tab !== 'moderation') return; setModerationCardsLoading(true); api.getAdminSpecialistCards(moderationCardsPage, 'review').then((d)=>{ setModerationCards(d.data); setModerationCardsTotal(d.total); }).catch(()=>{}).finally(()=>setModerationCardsLoading(false)); }, [ isAdmin, tab, moderationCardsPage ]); useEffect(()=>{ if (!isAdmin || tab !== 'support') return; setLoading(true); const params = { page: String(supportPage), limit: '30' }; if (supportStatus) params.status = supportStatus; if (supportType) params.type = supportType; if (supportQ) params.q = supportQ; api.getAdminSupportTickets(params).then((d)=>{ setSupportTickets(d.data); setSupportTotal(d.total); }).catch(()=>{}).finally(()=>setLoading(false)); }, [ isAdmin, tab, supportPage, supportStatus, supportType, supportQ ]); useEffect(()=>{ if (!isAdmin || tab !== 'balances') return; setLoading(true); api.getAdminBalanceHistory({ page: balancePage, userId: balanceUserId || undefined, kind: balanceKind || undefined }).then((d)=>{ setBalanceRows(d.data); setBalanceTotal(d.total); }).catch(()=>{}).finally(()=>setLoading(false)); }, [ isAdmin, tab, balancePage, balanceUserId, balanceKind ]); useEffect(()=>{ if (!isAdmin || tab !== 'logs') return; if (logsSubTab === 'ai') { setLoading(true); api.getAdminAiLogs(logsPage).then((d)=>{ setLogs(d.data); setLogsTotal(d.total); }).catch(()=>{}).finally(()=>setLoading(false)); } else if (logsSubTab === 'activity') { api.getAdminActivityLogs({ page: activityPage, event: activityEvent || undefined, userId: activityUserId || undefined, dateFrom: activityDateFrom || undefined, dateTo: activityDateTo || undefined }).then((d)=>{ var _d_eventTypes; setActivityLog(d.data); setActivityTotal(d.total); if ((_d_eventTypes = d.eventTypes) === null || _d_eventTypes === void 0 ? void 0 : _d_eventTypes.length) setActivityEventTypes(d.eventTypes); }).catch(()=>{}); } else if (logsSubTab === 'mail') { api.getAdminMailLogs({ page: mailPage, event: mailEvent || undefined, dateFrom: mailDateFrom || undefined, dateTo: mailDateTo || undefined }).then((d)=>{ var _d_eventTypes; setMailLog(d.data); setMailTotal(d.total); if ((_d_eventTypes = d.eventTypes) === null || _d_eventTypes === void 0 ? void 0 : _d_eventTypes.length) setMailEventTypes(d.eventTypes); }).catch(()=>{}); } else if (logsSubTab === 'notifications') { api.getAdminNotifLogs({ page: notifLogsPage, type: notifLogsType || undefined, dateFrom: notifLogsDateFrom || undefined, dateTo: notifLogsDateTo || undefined }).then((d)=>{ var _d_notifTypes; setNotifLogs(d.data); setNotifLogsTotal(d.total); if ((_d_notifTypes = d.notifTypes) === null || _d_notifTypes === void 0 ? void 0 : _d_notifTypes.length) setNotifLogsTypes(d.notifTypes); }).catch(()=>{}); } }, [ isAdmin, tab, logsSubTab, logsPage, activityPage, activityEvent, activityUserId, activityDateFrom, activityDateTo, mailPage, mailEvent, mailDateFrom, mailDateTo, notifLogsPage, notifLogsType, notifLogsDateFrom, notifLogsDateTo ]); useEffect(()=>{ setActivityPage(1); }, [ activityEvent, activityUserId, activityDateFrom, activityDateTo ]); useEffect(()=>{ setMailPage(1); }, [ mailEvent, mailDateFrom, mailDateTo ]); useEffect(()=>{ setNotifLogsPage(1); }, [ notifLogsType, notifLogsDateFrom, notifLogsDateTo ]); useEffect(()=>{ if (!isAdmin || tab !== 'plans') return; api.getAdminPlans().then(setPlanRows).catch(()=>{}); }, [ isAdmin, tab ]); useEffect(()=>{ if (!isAdmin || tab !== 'translations') return; setTransStatsLoading(true); api.getTranslationsStats().then((d)=>setTransStats(d.tables)).catch(()=>{}).finally(()=>setTransStatsLoading(false)); }, [ isAdmin, tab ]); useEffect(()=>{ if (!isAdmin || tab !== 'backup') return; request('/admin/backup/settings').then((d)=>setBackupAutoEnabled(!!d.autoEnabled)).catch(()=>{}); setBackupTablesLoading(true); request('/admin/backup/tables').then((d)=>setBackupTables(d.tables || [])).catch(()=>{}).finally(()=>setBackupTablesLoading(false)); request('/admin/backup/list').then((d)=>setBackupStoredFiles(d.files || [])).catch(()=>{}); }, [ isAdmin, tab ]); useEffect(()=>{ if (!isAdmin || tab !== 'referrals') return; setReferralsLoading(true); api.getAdminReferrals().then((d)=>setReferralsData(d)).catch(()=>{}).finally(()=>setReferralsLoading(false)); }, [ isAdmin, tab ]); // Load plans when users tab opens (for plan selector in edit modal) useEffect(()=>{ if (!isAdmin || tab !== 'users') return; if (planRows.length === 0) api.getAdminPlans().then(setPlanRows).catch(()=>{}); }, [ isAdmin, tab ]); // Reset page when filters change useEffect(()=>{ setUsersPage(1); }, [ usersQ, usersRole ]); useEffect(()=>{ setTasksPage(1); }, [ tasksQ, tasksStatus ]); useEffect(()=>{ setBalancePage(1); }, [ balanceUserId, balanceKind ]); async function sendAdminPush() { if (!pushTitle.trim()) return; if (pushMode === 'user' && !pushTargetUserId.trim()) { setPushError('УкажОте ID пПльзПвателя'); return; } setPushSending(true); setPushError(null); setPushResult(null); try { const payload = { title: pushTitle.trim(), body: pushBody.trim() || undefined, type: pushType.trim() || undefined, referenceId: pushReferenceId.trim() || undefined }; if (pushMode === 'broadcast') { const res = await api.adminBroadcastPush({ ...payload, onlyActive: pushOnlyActive }); setPushResult(res); } else { const res = await api.adminSendPushToUser(pushTargetUserId.trim(), payload); setPushResult(res); } } catch (err) { setPushError((err === null || err === void 0 ? void 0 : err.message) || 'Не уЎалПсь ПтправОть push'); } finally{ setPushSending(false); } } async function toggleUser(id, isActive) { const fn = isActive ? api.deactivateUser : api.activateUser; const updated = await fn(id).catch(()=>null); if (updated) setUsers((prev)=>prev.map((u)=>u.id === id ? updated : u)); } async function changeRole(id, role) { const updated = await api.changeUserRole(id, role).catch(()=>null); if (updated) setUsers((prev)=>prev.map((u)=>u.id === id ? updated : u)); } function openEditUser(u) { setEditUserTab('profile'); setSkillInput(''); setBalanceModal(null); setEditUserCards([]); setCardSkillInputs({}); setCardSaving({}); setCardCatSelects({}); setCardLocSelects({}); setEditUser({ ...u, topUpAmount: '', topUpDescription: '', withdrawAmount: '', withdrawDescription: '' }); api.getAdminUser(u.id).then((fresh)=>setEditUser((prev)=>prev && prev.id === fresh.id ? { ...fresh, topUpAmount: '', topUpDescription: '', withdrawAmount: '', withdrawDescription: '' } : prev)).catch(()=>{}); } function describeFcmFailure(key, message) { if (!key) return message || 'FCM прОМял 0 сППбщеМОй'; if (key === 'THIRD_PARTY_AUTH_ERROR') { return 'ОшОбка APNs/Firebase iOS: прПверьте Apple APNs Auth Key (.p8) О связку Firebase прПекта Ўля iOS-прОлПжеМОя'; } if (key === 'UNREGISTERED') { return 'ТПкеМ устрПйства бПльше Ме валОЎеМ'; } if (key === 'INVALID_ARGUMENT') { return 'НекПрректМый тПкеМ ОлО payload'; } if (key === 'REQUEST_FAILED') { return message || 'FCM request failed before response'; } return message ? "".concat(key, ": ").concat(message) : key; } async function saveEditUser() { if (!editUser) return; setEditUserSaving(true); try { var _editUser_languages, _editUser_showContactInfo, _editUser_notifyNewTasks, _editUser_notifMessages, _editUser_skills, _editUser_siteSettings; const updated = await api.updateAdminUser(editUser.id, { firstName: editUser.firstName, lastName: editUser.lastName, phone: editUser.phone || null, bio: editUser.bio || null, role: editUser.role, planId: editUser.planId || null, isActive: editUser.isActive, locale: editUser.locale, languages: (_editUser_languages = editUser.languages) !== null && _editUser_languages !== void 0 ? _editUser_languages : [], personalSiteSlug: editUser.personalSiteSlug || null, showContactInfo: (_editUser_showContactInfo = editUser.showContactInfo) !== null && _editUser_showContactInfo !== void 0 ? _editUser_showContactInfo : false, notifyNewTasks: (_editUser_notifyNewTasks = editUser.notifyNewTasks) !== null && _editUser_notifyNewTasks !== void 0 ? _editUser_notifyNewTasks : false, notifMessages: (_editUser_notifMessages = editUser.notifMessages) !== null && _editUser_notifMessages !== void 0 ? _editUser_notifMessages : true, skills: (_editUser_skills = editUser.skills) !== null && _editUser_skills !== void 0 ? _editUser_skills : [], siteSettings: (_editUser_siteSettings = editUser.siteSettings) !== null && _editUser_siteSettings !== void 0 ? _editUser_siteSettings : {} }); await Promise.all(editUserCards.map((card)=>{ var _card_skills, _card_categories, _card_locations; return api.adminUpdateSpecialistCard(card.id, { title: card.title, description: card.description || null, skills: (_card_skills = card.skills) !== null && _card_skills !== void 0 ? _card_skills : [], categories: (_card_categories = card.categories) !== null && _card_categories !== void 0 ? _card_categories : [], locations: (_card_locations = card.locations) !== null && _card_locations !== void 0 ? _card_locations : [], publicationStatus: card.publicationStatus, isActive: card.isActive }).catch(()=>null); })); setUsers((prev)=>prev.map((u)=>u.id === editUser.id ? updated : u)); setEditUser(null); } catch (e) {} finally{ setEditUserSaving(false); } } async function verifyEmail() { if (!editUser) return; setVerifyingEmail(true); try { const updated = await api.verifyAdminUserEmail(editUser.id); setEditUser((u)=>u ? { ...u, emailVerified: updated.emailVerified } : u); setUsers((prev)=>prev.map((u)=>u.id === editUser.id ? { ...u, emailVerified: updated.emailVerified } : u)); } catch (e) {} finally{ setVerifyingEmail(false); } } async function handleAdminTopUp() { if (!editUser) return; const amount = Number(editUser.topUpAmount); if (!amount || amount <= 0) return; setTopUpSaving(true); try { const result = await api.adminTopUpUserBalance(editUser.id, { amount, description: editUser.topUpDescription || undefined }); setUsers((prev)=>prev.map((u)=>u.id === editUser.id ? result.user : u)); setEditUser((prev)=>prev ? { ...prev, ...result.user, topUpAmount: '', topUpDescription: '' } : prev); if (tab === 'balances') { api.getAdminBalanceHistory({ page: balancePage, userId: balanceUserId || undefined, kind: balanceKind || undefined }).then((d)=>{ setBalanceRows(d.data); setBalanceTotal(d.total); }).catch(()=>{}); } } catch (e) { // ignore } finally{ setTopUpSaving(false); } } async function handleAdminWithdraw() { if (!editUser) return; const amount = Number(editUser.withdrawAmount); if (!amount || amount <= 0) return; setWithdrawSaving(true); try { const result = await api.adminWithdrawUserBalance(editUser.id, { amount, description: editUser.withdrawDescription || undefined }); setUsers((prev)=>prev.map((u)=>u.id === editUser.id ? result.user : u)); setEditUser((prev)=>prev ? { ...prev, ...result.user, withdrawAmount: '', withdrawDescription: '' } : prev); if (tab === 'balances') { api.getAdminBalanceHistory({ page: balancePage, userId: balanceUserId || undefined, kind: balanceKind || undefined }).then((d)=>{ setBalanceRows(d.data); setBalanceTotal(d.total); }).catch(()=>{}); } } catch (e) { // ignore } finally{ setWithdrawSaving(false); } } async function saveCard(cardId) { const card = editUserCards.find((c)=>c.id === cardId); if (!card) return; setCardSaving((prev)=>({ ...prev, [cardId]: true })); try { var _card_skills, _card_categories, _card_locations; const updated = await api.adminUpdateSpecialistCard(cardId, { title: card.title, description: card.description || null, skills: (_card_skills = card.skills) !== null && _card_skills !== void 0 ? _card_skills : [], categories: (_card_categories = card.categories) !== null && _card_categories !== void 0 ? _card_categories : [], locations: (_card_locations = card.locations) !== null && _card_locations !== void 0 ? _card_locations : [], publicationStatus: card.publicationStatus, isActive: card.isActive }); setEditUserCards((prev)=>prev.map((c)=>c.id === cardId ? updated : c)); } catch (e) {} finally{ setCardSaving((prev)=>({ ...prev, [cardId]: false })); } } async function updateModerationCard(cardId, publicationStatus) { const updated = await api.adminUpdateSpecialistCard(cardId, { publicationStatus, isActive: publicationStatus === 'active' }).catch(()=>null); if (!updated) return; setModerationCards((prev)=>prev.map((card)=>card.id === cardId ? updated : card)); if ((editUser === null || editUser === void 0 ? void 0 : editUser.id) === updated.specialistId) { setEditUserCards((prev)=>prev.map((card)=>card.id === cardId ? updated : card)); } api.getAdminReports(1, 'pending').then((d)=>setPendingReportsCount(d.total)).catch(()=>{}); api.getAdminSpecialistCards(1, 'pending').then((d)=>setPendingCardsCount(d.total)).catch(()=>{}); } async function cancelTask(id) { const updated = await api.cancelTaskAdmin(id).catch(()=>null); if (updated) { const task = updated.task || updated; setTasks((prev)=>prev.map((row)=>{ const t = row.task || row; return t.id === id ? { ...row, task: task } : row; })); } } async function deleteTask(id, title) { if (!window.confirm("".concat(t('admin.tasks.delete.confirm'), '\n"').concat(title, '"'))) return; const ok = await api.deleteTaskAdmin(id).catch(()=>null); if (ok) setTasks((prev)=>prev.filter((row)=>{ var _row_task; return (((_row_task = row.task) === null || _row_task === void 0 ? void 0 : _row_task.id) || row.id) !== id; })); } async function handleReport(id, status) { const updated = await api.updateReportStatus(id, status).catch(()=>null); if (updated) setReports((prev)=>prev.map((r)=>r.id === id ? { ...r, ...updated } : r)); } // Locations useEffect(()=>{ if (!isAdmin || tab !== 'locations') return; api.getAdminLocations().then(setLocRows).catch(()=>{}); }, [ isAdmin, tab ]); function openAddLoc(parentId) { setLocForm({ parentId: parentId !== null && parentId !== void 0 ? parentId : null, slug: '', nameEl: '', nameEn: '', nameRu: '', nameUk: '', order: 0, isActive: true }); } function openEditLoc(loc) { var _loc_names, _loc_names1, _loc_names2, _loc_names3; var _loc_parentId, _loc_nameEl, _ref, _loc_nameEn, _ref1, _loc_nameRu, _ref2, _loc_nameUk, _ref3, _loc_order, _loc_isActive; setLocForm({ id: loc.id, parentId: (_loc_parentId = loc.parentId) !== null && _loc_parentId !== void 0 ? _loc_parentId : null, slug: loc.slug, nameEl: (_ref = (_loc_nameEl = loc.nameEl) !== null && _loc_nameEl !== void 0 ? _loc_nameEl : (_loc_names = loc.names) === null || _loc_names === void 0 ? void 0 : _loc_names.el) !== null && _ref !== void 0 ? _ref : '', nameEn: (_ref1 = (_loc_nameEn = loc.nameEn) !== null && _loc_nameEn !== void 0 ? _loc_nameEn : (_loc_names1 = loc.names) === null || _loc_names1 === void 0 ? void 0 : _loc_names1.en) !== null && _ref1 !== void 0 ? _ref1 : '', nameRu: (_ref2 = (_loc_nameRu = loc.nameRu) !== null && _loc_nameRu !== void 0 ? _loc_nameRu : (_loc_names2 = loc.names) === null || _loc_names2 === void 0 ? void 0 : _loc_names2.ru) !== null && _ref2 !== void 0 ? _ref2 : '', nameUk: (_ref3 = (_loc_nameUk = loc.nameUk) !== null && _loc_nameUk !== void 0 ? _loc_nameUk : (_loc_names3 = loc.names) === null || _loc_names3 === void 0 ? void 0 : _loc_names3.uk) !== null && _ref3 !== void 0 ? _ref3 : '', order: (_loc_order = loc.order) !== null && _loc_order !== void 0 ? _loc_order : 0, isActive: (_loc_isActive = loc.isActive) !== null && _loc_isActive !== void 0 ? _loc_isActive : true }); } async function saveLoc() { if (!locForm) return; setLocSaving(true); try { if (locForm.id) { const updated = await api.updateLocation(locForm.id, locForm); setLocRows((prev)=>prev.map((r)=>r.id === locForm.id ? updated : r)); } else { const created = await api.createLocation({ slug: locForm.slug, nameEl: locForm.nameEl, nameEn: locForm.nameEn, nameRu: locForm.nameRu, nameUk: locForm.nameUk, parentId: locForm.parentId, order: locForm.order }); setLocRows((prev)=>[ ...prev, created ]); } setLocForm(null); } catch (e) { // ignore } finally{ setLocSaving(false); } } async function deleteLoc(id, name) { if (!window.confirm("".concat(t('admin.loc.delete.confirm'), '\n"').concat(name, '"'))) return; const ok = await api.deleteLocation(id).catch(()=>null); if (ok) setLocRows((prev)=>prev.filter((r)=>r.id !== id)); } function toggleLocExpand(id) { setLocExpanded((prev)=>{ const next = new Set(prev); next.has(id) ? next.delete(id) : next.add(id); return next; }); } // Categories useEffect(()=>{ if (!isAdmin || tab !== 'categories') return; api.getAdminCategories().then(setCatRows).catch(()=>{}); }, [ isAdmin, tab ]); useEffect(()=>{ if (!isAdmin) return; fetch('/category-icons/presets.json').then((res)=>res.ok ? res.json() : Promise.reject(new Error('Failed to load presets'))).then((data)=>{ if (!Array.isArray(data)) return; const cleaned = data.filter((x)=>!!x && typeof x === 'object' && typeof x.value === 'string' && typeof x.label === 'string').filter((x)=>x.value.startsWith('/category-icons/')); if (cleaned.length > 0) setCategoryIconPresets(cleaned); }).catch(()=>{}); }, [ isAdmin ]); function openAddCat(parentId) { setCatIconError(null); setCatForm({ parentId: parentId !== null && parentId !== void 0 ? parentId : null, slug: '', icon: '/category-icons/package.svg', namesEl: '', namesEn: '', namesRu: '', namesUk: '', order: 0, isActive: true }); } function openEditCat(cat) { var _cat_names, _cat_names1, _cat_names2, _cat_names3; const selectedIcon = typeof cat.icon === 'string' ? cat.icon : ''; const knownPreset = new Set(categoryIconPresets.map((p)=>p.value)); const normalizedIcon = selectedIcon.startsWith('/category-icons/') && !knownPreset.has(selectedIcon) ? '/category-icons/package.svg' : selectedIcon || '/category-icons/package.svg'; setCatIconError(null); var _cat_parentId, _cat_namesEl, _ref, _cat_namesEn, _ref1, _cat_namesRu, _ref2, _cat_namesUk, _ref3, _cat_order, _cat_isActive; setCatForm({ id: cat.id, parentId: (_cat_parentId = cat.parentId) !== null && _cat_parentId !== void 0 ? _cat_parentId : null, slug: cat.slug, icon: normalizedIcon, namesEl: (_ref = (_cat_namesEl = cat.namesEl) !== null && _cat_namesEl !== void 0 ? _cat_namesEl : (_cat_names = cat.names) === null || _cat_names === void 0 ? void 0 : _cat_names.el) !== null && _ref !== void 0 ? _ref : '', namesEn: (_ref1 = (_cat_namesEn = cat.namesEn) !== null && _cat_namesEn !== void 0 ? _cat_namesEn : (_cat_names1 = cat.names) === null || _cat_names1 === void 0 ? void 0 : _cat_names1.en) !== null && _ref1 !== void 0 ? _ref1 : '', namesRu: (_ref2 = (_cat_namesRu = cat.namesRu) !== null && _cat_namesRu !== void 0 ? _cat_namesRu : (_cat_names2 = cat.names) === null || _cat_names2 === void 0 ? void 0 : _cat_names2.ru) !== null && _ref2 !== void 0 ? _ref2 : '', namesUk: (_ref3 = (_cat_namesUk = cat.namesUk) !== null && _cat_namesUk !== void 0 ? _cat_namesUk : (_cat_names3 = cat.names) === null || _cat_names3 === void 0 ? void 0 : _cat_names3.uk) !== null && _ref3 !== void 0 ? _ref3 : '', order: (_cat_order = cat.order) !== null && _cat_order !== void 0 ? _cat_order : 0, isActive: (_cat_isActive = cat.isActive) !== null && _cat_isActive !== void 0 ? _cat_isActive : true }); } async function uploadCategoryIcon(file) { if (file.type !== 'image/svg+xml') { setCatIconError('Only SVG files are allowed'); return; } setCatIconUploading(true); setCatIconError(null); try { const fd = new FormData(); fd.append('file', file); const base = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; const res = await fetch("".concat(base, "/api/uploads"), { method: 'POST', credentials: 'include', body: fd }); if (!res.ok) { const err = await res.json().catch(()=>({ error: 'Upload failed' })); throw new Error(err.error || 'Upload failed'); } const data = await res.json(); setCatForm((f)=>f ? { ...f, icon: data.url } : f); } catch (err) { setCatIconError((err === null || err === void 0 ? void 0 : err.message) || 'Upload failed'); } finally{ setCatIconUploading(false); } } async function saveCat() { if (!catForm) return; setCatSaving(true); try { if (catForm.id) { const updated = await api.updateCategory(catForm.id, catForm); setCatRows((prev)=>prev.map((r)=>r.id === catForm.id ? updated : r)); } else { const created = await api.createCategory({ slug: catForm.slug, icon: catForm.icon, namesEl: catForm.namesEl, namesEn: catForm.namesEn, namesRu: catForm.namesRu, namesUk: catForm.namesUk, parentId: catForm.parentId, order: catForm.order }); setCatRows((prev)=>[ ...prev, created ]); } setCatForm(null); } catch (e) { // ignore } finally{ setCatSaving(false); } } async function deleteCat(id, name) { if (!window.confirm("".concat(t('admin.cat.delete.confirm'), '\n"').concat(name, '"'))) return; const ok = await api.deleteCategory(id).catch(()=>null); if (ok) setCatRows((prev)=>prev.filter((r)=>r.id !== id)); } function toggleCatExpand(id) { setCatExpanded((prev)=>{ const next = new Set(prev); next.has(id) ? next.delete(id) : next.add(id); return next; }); } async function toggleCatSkills(cat) { const id = cat.id; const slug = cat.slug; setCatSkillsExpanded((prev)=>{ const next = new Set(prev); if (next.has(id)) { next.delete(id); return next; } next.add(id); return next; }); if (!catSkillsCache[slug]) { setCatSkillsLoading((prev)=>new Set(prev).add(id)); try { const skills = await api.getAdminSkills(slug); setCatSkillsCache((prev)=>({ ...prev, [slug]: skills })); } catch (e) {} finally{ setCatSkillsLoading((prev)=>{ const n = new Set(prev); n.delete(id); return n; }); } } } function openAddSkill(catSlug) { setSkillForm({ catSlug, nameEl: '', nameEn: '', nameRu: '', nameUk: '', order: 0 }); } function openEditSkill(skill, catSlug) { var _skill_nameEl, _skill_nameEn, _skill_nameRu, _skill_nameUk, _skill_order; setSkillForm({ id: skill.id, catSlug, nameEl: (_skill_nameEl = skill.nameEl) !== null && _skill_nameEl !== void 0 ? _skill_nameEl : '', nameEn: (_skill_nameEn = skill.nameEn) !== null && _skill_nameEn !== void 0 ? _skill_nameEn : '', nameRu: (_skill_nameRu = skill.nameRu) !== null && _skill_nameRu !== void 0 ? _skill_nameRu : '', nameUk: (_skill_nameUk = skill.nameUk) !== null && _skill_nameUk !== void 0 ? _skill_nameUk : '', order: (_skill_order = skill.order) !== null && _skill_order !== void 0 ? _skill_order : 0 }); } async function saveSkill() { if (!skillForm) return; setSkillSaving(true); try { if (skillForm.id) { const updated = await api.updateSkill(skillForm.id, { nameEl: skillForm.nameEl, nameEn: skillForm.nameEn, nameRu: skillForm.nameRu, nameUk: skillForm.nameUk, order: skillForm.order }); setCatSkillsCache((prev)=>{ var _prev_skillForm_catSlug; return { ...prev, [skillForm.catSlug]: ((_prev_skillForm_catSlug = prev[skillForm.catSlug]) !== null && _prev_skillForm_catSlug !== void 0 ? _prev_skillForm_catSlug : []).map((s)=>s.id === skillForm.id ? updated : s) }; }); } else { const created = await api.createSkill({ categorySlug: skillForm.catSlug, nameEl: skillForm.nameEl, nameEn: skillForm.nameEn, nameRu: skillForm.nameRu, nameUk: skillForm.nameUk, order: skillForm.order }); setCatSkillsCache((prev)=>{ var _prev_skillForm_catSlug; return { ...prev, [skillForm.catSlug]: [ ...(_prev_skillForm_catSlug = prev[skillForm.catSlug]) !== null && _prev_skillForm_catSlug !== void 0 ? _prev_skillForm_catSlug : [], created ] }; }); } setSkillForm(null); } catch (e) {} finally{ setSkillSaving(false); } } async function deleteSkill(skill, catSlug) { if (!skill._skipConfirm && !window.confirm('УЎалОть Мавык "'.concat(skill.nameEl, '"?'))) return; const ok = skill._skipConfirm ? true : await api.deleteSkill(skill.id).catch(()=>null); if (ok) { setCatSkillsCache((prev)=>{ var _prev_catSlug; return { ...prev, [catSlug]: ((_prev_catSlug = prev[catSlug]) !== null && _prev_catSlug !== void 0 ? _prev_catSlug : []).filter((s)=>s.id !== skill.id) }; }); } } function openAddPlan() { setPlanForm({ 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: false, isActive: true, order: 0, notifyNewTasks: false, canContactFreePlan: false, canContactProPlan: true, canContactAll: false, canShowContactInfo: false, canViewPhone: false, canUploadVideo: false, hasFavorites: false, hasGoogleCalendar: false, hasVerifiedBadge: false, highlightedReviews: false, hasPersonalSite: false, hasCanHelpNowStatus: false, hasNeedHelpStatus: false, hasAutoResponse: false, hasAutoMatch: false, hasPriceList: false, receiveInstantDispatchFree: false, receiveInstantDispatchPro: false }); } function openEditPlan(plan) { var _plan_description, _plan_role, _plan_tier, _plan_price, _plan_oldPrice, _plan_currency, _plan_searchBoost, _plan_offersMultiplier, _plan_features, _plan_isDefault, _plan_isActive, _plan_order, _plan_notifyNewTasks, _plan_canContactFreePlan, _plan_canContactProPlan, _plan_canContactAll, _plan_canShowContactInfo, _plan_canViewPhone, _plan_canUploadVideo, _plan_hasFavorites, _plan_hasGoogleCalendar, _plan_hasVerifiedBadge, _plan_highlightedReviews, _plan_hasPersonalSite, _plan_hasCanHelpNowStatus, _plan_hasNeedHelpStatus, _plan_hasAutoResponse, _plan_hasAutoMatch, _plan_hasPriceList, _plan_receiveInstantDispatchFree, _plan_receiveInstantDispatchPro; setPlanForm({ id: plan.id, name: plan.name, description: (_plan_description = plan.description) !== null && _plan_description !== void 0 ? _plan_description : '', role: (_plan_role = plan.role) !== null && _plan_role !== void 0 ? _plan_role : 'customer', tier: (_plan_tier = plan.tier) !== null && _plan_tier !== void 0 ? _plan_tier : 'free', price: (_plan_price = plan.price) !== null && _plan_price !== void 0 ? _plan_price : '0', oldPrice: (_plan_oldPrice = plan.oldPrice) !== null && _plan_oldPrice !== void 0 ? _plan_oldPrice : '', currency: (_plan_currency = plan.currency) !== null && _plan_currency !== void 0 ? _plan_currency : 'EUR', maxTasks: plan.maxTasks != null ? String(plan.maxTasks) : '', maxOffers: plan.maxOffers != null ? String(plan.maxOffers) : '', maxCards: plan.maxCards != null ? String(plan.maxCards) : '', maxMessagesPerDay: plan.maxMessagesPerDay != null ? String(plan.maxMessagesPerDay) : '', maxOrdersPerDay: plan.maxOrdersPerDay != null ? String(plan.maxOrdersPerDay) : '', maxSkills: plan.maxSkills != null ? String(plan.maxSkills) : '', durationDays: plan.durationDays != null ? String(plan.durationDays) : '', searchBoost: (_plan_searchBoost = plan.searchBoost) !== null && _plan_searchBoost !== void 0 ? _plan_searchBoost : 0, offersMultiplier: (_plan_offersMultiplier = plan.offersMultiplier) !== null && _plan_offersMultiplier !== void 0 ? _plan_offersMultiplier : '1.00', features: ((_plan_features = plan.features) !== null && _plan_features !== void 0 ? _plan_features : []).join('\n'), isDefault: (_plan_isDefault = plan.isDefault) !== null && _plan_isDefault !== void 0 ? _plan_isDefault : false, isActive: (_plan_isActive = plan.isActive) !== null && _plan_isActive !== void 0 ? _plan_isActive : true, order: (_plan_order = plan.order) !== null && _plan_order !== void 0 ? _plan_order : 0, notifyNewTasks: (_plan_notifyNewTasks = plan.notifyNewTasks) !== null && _plan_notifyNewTasks !== void 0 ? _plan_notifyNewTasks : false, canContactFreePlan: (_plan_canContactFreePlan = plan.canContactFreePlan) !== null && _plan_canContactFreePlan !== void 0 ? _plan_canContactFreePlan : false, canContactProPlan: (_plan_canContactProPlan = plan.canContactProPlan) !== null && _plan_canContactProPlan !== void 0 ? _plan_canContactProPlan : true, canContactAll: (_plan_canContactAll = plan.canContactAll) !== null && _plan_canContactAll !== void 0 ? _plan_canContactAll : false, canShowContactInfo: (_plan_canShowContactInfo = plan.canShowContactInfo) !== null && _plan_canShowContactInfo !== void 0 ? _plan_canShowContactInfo : false, canViewPhone: (_plan_canViewPhone = plan.canViewPhone) !== null && _plan_canViewPhone !== void 0 ? _plan_canViewPhone : false, canUploadVideo: (_plan_canUploadVideo = plan.canUploadVideo) !== null && _plan_canUploadVideo !== void 0 ? _plan_canUploadVideo : false, hasFavorites: (_plan_hasFavorites = plan.hasFavorites) !== null && _plan_hasFavorites !== void 0 ? _plan_hasFavorites : false, hasGoogleCalendar: (_plan_hasGoogleCalendar = plan.hasGoogleCalendar) !== null && _plan_hasGoogleCalendar !== void 0 ? _plan_hasGoogleCalendar : false, hasVerifiedBadge: (_plan_hasVerifiedBadge = plan.hasVerifiedBadge) !== null && _plan_hasVerifiedBadge !== void 0 ? _plan_hasVerifiedBadge : false, highlightedReviews: (_plan_highlightedReviews = plan.highlightedReviews) !== null && _plan_highlightedReviews !== void 0 ? _plan_highlightedReviews : false, hasPersonalSite: (_plan_hasPersonalSite = plan.hasPersonalSite) !== null && _plan_hasPersonalSite !== void 0 ? _plan_hasPersonalSite : false, hasCanHelpNowStatus: (_plan_hasCanHelpNowStatus = plan.hasCanHelpNowStatus) !== null && _plan_hasCanHelpNowStatus !== void 0 ? _plan_hasCanHelpNowStatus : false, hasNeedHelpStatus: (_plan_hasNeedHelpStatus = plan.hasNeedHelpStatus) !== null && _plan_hasNeedHelpStatus !== void 0 ? _plan_hasNeedHelpStatus : false, hasAutoResponse: (_plan_hasAutoResponse = plan.hasAutoResponse) !== null && _plan_hasAutoResponse !== void 0 ? _plan_hasAutoResponse : false, hasAutoMatch: (_plan_hasAutoMatch = plan.hasAutoMatch) !== null && _plan_hasAutoMatch !== void 0 ? _plan_hasAutoMatch : false, hasPriceList: (_plan_hasPriceList = plan.hasPriceList) !== null && _plan_hasPriceList !== void 0 ? _plan_hasPriceList : false, receiveInstantDispatchFree: (_plan_receiveInstantDispatchFree = plan.receiveInstantDispatchFree) !== null && _plan_receiveInstantDispatchFree !== void 0 ? _plan_receiveInstantDispatchFree : false, receiveInstantDispatchPro: (_plan_receiveInstantDispatchPro = plan.receiveInstantDispatchPro) !== null && _plan_receiveInstantDispatchPro !== void 0 ? _plan_receiveInstantDispatchPro : false }); } async function savePlan() { if (!planForm) return; setPlanSaving(true); try { const payload = { name: planForm.name, description: planForm.description || undefined, role: planForm.role, tier: planForm.tier, price: planForm.price, oldPrice: planForm.oldPrice || null, currency: planForm.currency, maxTasks: planForm.maxTasks ? Number(planForm.maxTasks) : null, maxOffers: planForm.maxOffers ? Number(planForm.maxOffers) : null, maxCards: planForm.maxCards ? Number(planForm.maxCards) : null, maxMessagesPerDay: planForm.maxMessagesPerDay ? Number(planForm.maxMessagesPerDay) : null, maxOrdersPerDay: planForm.maxOrdersPerDay ? Number(planForm.maxOrdersPerDay) : null, maxSkills: planForm.maxSkills ? Number(planForm.maxSkills) : null, durationDays: planForm.durationDays ? Number(planForm.durationDays) : null, notifyNewTasks: planForm.notifyNewTasks, searchBoost: planForm.searchBoost, offersMultiplier: planForm.offersMultiplier, canContactFreePlan: planForm.canContactFreePlan, canContactProPlan: planForm.canContactProPlan, canContactAll: planForm.canContactAll, canShowContactInfo: planForm.canShowContactInfo, canViewPhone: planForm.canViewPhone, canUploadVideo: planForm.canUploadVideo, hasFavorites: planForm.hasFavorites, hasGoogleCalendar: planForm.hasGoogleCalendar, hasVerifiedBadge: planForm.hasVerifiedBadge, highlightedReviews: planForm.highlightedReviews, hasPersonalSite: planForm.hasPersonalSite, hasCanHelpNowStatus: planForm.hasCanHelpNowStatus, hasNeedHelpStatus: planForm.hasNeedHelpStatus, hasAutoResponse: planForm.hasAutoResponse, hasAutoMatch: planForm.hasAutoMatch, hasPriceList: planForm.hasPriceList, receiveInstantDispatchFree: planForm.receiveInstantDispatchFree, receiveInstantDispatchPro: planForm.receiveInstantDispatchPro, features: planForm.features ? planForm.features.split('\n').map((s)=>s.trim()).filter(Boolean) : [], isDefault: planForm.isDefault, isActive: planForm.isActive, order: planForm.order }; if (planForm.id) { const updated = await api.updatePlan(planForm.id, payload); setPlanRows((prev)=>prev.map((r)=>r.id === planForm.id ? updated : r)); } else { const created = await api.createPlan(payload); setPlanRows((prev)=>[ ...prev, created ]); } // If set as default — refresh all to sync isDefault flags if (planForm.isDefault) { api.getAdminPlans().then(setPlanRows).catch(()=>{}); } setPlanForm(null); } catch (e) { // ignore } finally{ setPlanSaving(false); } } async function deletePlan(id, name) { if (!window.confirm('Delete plan "'.concat(name, '"?'))) return; const ok = await api.deletePlan(id).catch(()=>null); if (ok) setPlanRows((prev)=>prev.filter((r)=>r.id !== id)); } // Settings useEffect(()=>{ if (!isAdmin || tab !== 'settings') return; if (planRows.length === 0) api.getAdminPlans().then(setPlanRows).catch(()=>{}); api.getAdminSettings().then((kv)=>{ var _kv_generalsiteName, _kv_generalsiteUrl, _kv_generalcontactEmail, _kv_generalsupportPhone; setGeneralForm({ siteName: (_kv_generalsiteName = kv['general.siteName']) !== null && _kv_generalsiteName !== void 0 ? _kv_generalsiteName : 'CanHelp', siteUrl: (_kv_generalsiteUrl = kv['general.siteUrl']) !== null && _kv_generalsiteUrl !== void 0 ? _kv_generalsiteUrl : '', contactEmail: (_kv_generalcontactEmail = kv['general.contactEmail']) !== null && _kv_generalcontactEmail !== void 0 ? _kv_generalcontactEmail : '', supportPhone: (_kv_generalsupportPhone = kv['general.supportPhone']) !== null && _kv_generalsupportPhone !== void 0 ? _kv_generalsupportPhone : '' }); var _kv_smtphost, _kv_smtpport, _kv_smtpusername, _kv_smtppassword, _kv_smtpfromName, _kv_smtpfromEmail, _kv_smtpencryption; setSmtpForm({ host: (_kv_smtphost = kv['smtp.host']) !== null && _kv_smtphost !== void 0 ? _kv_smtphost : '', port: (_kv_smtpport = kv['smtp.port']) !== null && _kv_smtpport !== void 0 ? _kv_smtpport : '587', username: (_kv_smtpusername = kv['smtp.username']) !== null && _kv_smtpusername !== void 0 ? _kv_smtpusername : '', password: (_kv_smtppassword = kv['smtp.password']) !== null && _kv_smtppassword !== void 0 ? _kv_smtppassword : '', fromName: (_kv_smtpfromName = kv['smtp.fromName']) !== null && _kv_smtpfromName !== void 0 ? _kv_smtpfromName : 'CanHelp', fromEmail: (_kv_smtpfromEmail = kv['smtp.fromEmail']) !== null && _kv_smtpfromEmail !== void 0 ? _kv_smtpfromEmail : '', encryption: (_kv_smtpencryption = kv['smtp.encryption']) !== null && _kv_smtpencryption !== void 0 ? _kv_smtpencryption : 'tls' }); var _kv_paymentepaymerchantId, _kv_paymentepayapiUser, _kv_paymentepayapiPassword, _kv_paymentepayenvironment, _kv_paymentepayconfirmationUrl, _kv_paymentepaycancelUrl; setEPayForm({ merchantId: (_kv_paymentepaymerchantId = kv['payment.epay.merchantId']) !== null && _kv_paymentepaymerchantId !== void 0 ? _kv_paymentepaymerchantId : '', apiUser: (_kv_paymentepayapiUser = kv['payment.epay.apiUser']) !== null && _kv_paymentepayapiUser !== void 0 ? _kv_paymentepayapiUser : '', apiPassword: (_kv_paymentepayapiPassword = kv['payment.epay.apiPassword']) !== null && _kv_paymentepayapiPassword !== void 0 ? _kv_paymentepayapiPassword : '', environment: (_kv_paymentepayenvironment = kv['payment.epay.environment']) !== null && _kv_paymentepayenvironment !== void 0 ? _kv_paymentepayenvironment : 'test', confirmationUrl: (_kv_paymentepayconfirmationUrl = kv['payment.epay.confirmationUrl']) !== null && _kv_paymentepayconfirmationUrl !== void 0 ? _kv_paymentepayconfirmationUrl : '', cancelUrl: (_kv_paymentepaycancelUrl = kv['payment.epay.cancelUrl']) !== null && _kv_paymentepaycancelUrl !== void 0 ? _kv_paymentepaycancelUrl : '', enabled: kv['payment.epay.enabled'] === 'true' }); var _kv_referral_plan_id, _ref, _ref1, _kv_referral_days, _ref2, _ref3; setReferralForm({ enabled: kv['referral_enabled'] === 'true', planId: (_ref1 = (_ref = (_kv_referral_plan_id = kv['referral_plan_id']) !== null && _kv_referral_plan_id !== void 0 ? _kv_referral_plan_id : kv['referral_customer_plan_id']) !== null && _ref !== void 0 ? _ref : kv['referral_specialist_plan_id']) !== null && _ref1 !== void 0 ? _ref1 : '', days: (_ref3 = (_ref2 = (_kv_referral_days = kv['referral_days']) !== null && _kv_referral_days !== void 0 ? _kv_referral_days : kv['referral_customer_days']) !== null && _ref2 !== void 0 ? _ref2 : kv['referral_specialist_days']) !== null && _ref3 !== void 0 ? _ref3 : '30' }); var _kv_seoheadScripts, _kv_seositeTitleel, _ref4, _kv_seositeTitleen, _kv_seositeTitleru, _kv_seositeTitleuk, _kv_seositeDescriptionel, _ref5, _kv_seositeDescriptionen, _kv_seositeDescriptionru, _kv_seositeDescriptionuk; setSeoForm({ maintenanceMode: kv['seo.maintenanceMode'] === 'true', indexingEnabled: kv['seo.indexingEnabled'] !== 'false', headScripts: (_kv_seoheadScripts = kv['seo.headScripts']) !== null && _kv_seoheadScripts !== void 0 ? _kv_seoheadScripts : '', siteTitleEl: (_ref4 = (_kv_seositeTitleel = kv['seo.siteTitle.el']) !== null && _kv_seositeTitleel !== void 0 ? _kv_seositeTitleel : kv['seo.siteTitle']) !== null && _ref4 !== void 0 ? _ref4 : '', siteTitleEn: (_kv_seositeTitleen = kv['seo.siteTitle.en']) !== null && _kv_seositeTitleen !== void 0 ? _kv_seositeTitleen : '', siteTitleRu: (_kv_seositeTitleru = kv['seo.siteTitle.ru']) !== null && _kv_seositeTitleru !== void 0 ? _kv_seositeTitleru : '', siteTitleUk: (_kv_seositeTitleuk = kv['seo.siteTitle.uk']) !== null && _kv_seositeTitleuk !== void 0 ? _kv_seositeTitleuk : '', siteDescriptionEl: (_ref5 = (_kv_seositeDescriptionel = kv['seo.siteDescription.el']) !== null && _kv_seositeDescriptionel !== void 0 ? _kv_seositeDescriptionel : kv['seo.siteDescription']) !== null && _ref5 !== void 0 ? _ref5 : '', siteDescriptionEn: (_kv_seositeDescriptionen = kv['seo.siteDescription.en']) !== null && _kv_seositeDescriptionen !== void 0 ? _kv_seositeDescriptionen : '', siteDescriptionRu: (_kv_seositeDescriptionru = kv['seo.siteDescription.ru']) !== null && _kv_seositeDescriptionru !== void 0 ? _kv_seositeDescriptionru : '', siteDescriptionUk: (_kv_seositeDescriptionuk = kv['seo.siteDescription.uk']) !== null && _kv_seositeDescriptionuk !== void 0 ? _kv_seositeDescriptionuk : '' }); var _kv_socialtelegram, _kv_socialinstagram, _kv_socialfacebook, _kv_socialtwitter, _kv_socialyoutube, _kv_socialtiktok, _kv_socialwhatsapp, _kv_socialviber; setSocialForm({ telegram: (_kv_socialtelegram = kv['social.telegram']) !== null && _kv_socialtelegram !== void 0 ? _kv_socialtelegram : '', instagram: (_kv_socialinstagram = kv['social.instagram']) !== null && _kv_socialinstagram !== void 0 ? _kv_socialinstagram : '', facebook: (_kv_socialfacebook = kv['social.facebook']) !== null && _kv_socialfacebook !== void 0 ? _kv_socialfacebook : '', twitter: (_kv_socialtwitter = kv['social.twitter']) !== null && _kv_socialtwitter !== void 0 ? _kv_socialtwitter : '', youtube: (_kv_socialyoutube = kv['social.youtube']) !== null && _kv_socialyoutube !== void 0 ? _kv_socialyoutube : '', tiktok: (_kv_socialtiktok = kv['social.tiktok']) !== null && _kv_socialtiktok !== void 0 ? _kv_socialtiktok : '', whatsapp: (_kv_socialwhatsapp = kv['social.whatsapp']) !== null && _kv_socialwhatsapp !== void 0 ? _kv_socialwhatsapp : '', viber: (_kv_socialviber = kv['social.viber']) !== null && _kv_socialviber !== void 0 ? _kv_socialviber : '' }); var _kv_telegrambotToken, _kv_telegramadminChatId, _kv_telegramchannelIdel, _kv_telegramchannelIden, _kv_telegramchannelIdru, _kv_telegramchannelIduk; setTelegramForm({ botToken: (_kv_telegrambotToken = kv['telegram.botToken']) !== null && _kv_telegrambotToken !== void 0 ? _kv_telegrambotToken : '', adminChatId: (_kv_telegramadminChatId = kv['telegram.adminChatId']) !== null && _kv_telegramadminChatId !== void 0 ? _kv_telegramadminChatId : '', channelIdEl: (_kv_telegramchannelIdel = kv['telegram.channelId.el']) !== null && _kv_telegramchannelIdel !== void 0 ? _kv_telegramchannelIdel : '', channelIdEn: (_kv_telegramchannelIden = kv['telegram.channelId.en']) !== null && _kv_telegramchannelIden !== void 0 ? _kv_telegramchannelIden : '', channelIdRu: (_kv_telegramchannelIdru = kv['telegram.channelId.ru']) !== null && _kv_telegramchannelIdru !== void 0 ? _kv_telegramchannelIdru : '', channelIdUk: (_kv_telegramchannelIduk = kv['telegram.channelId.uk']) !== null && _kv_telegramchannelIduk !== void 0 ? _kv_telegramchannelIduk : '', notifyRegistrations: kv['telegram.notifyRegistrations'] === 'true', postNewTasks: kv['telegram.postNewTasks'] === 'true' }); }).catch(()=>{}); api.getAdminEmailTemplates().then((rows)=>{ const map = {}; for (const r of rows)map[r.key] = { subject: r.subject, body: r.body }; setNotifTemplates((prev)=>({ ...prev, ...map })); }).catch(()=>{}); }, [ isAdmin, tab ]); async function saveGeneralSettings() { setGeneralSaving(true); try { await api.updateAdminSettings({ 'general.siteName': generalForm.siteName, 'general.siteUrl': generalForm.siteUrl, 'general.contactEmail': generalForm.contactEmail, 'general.supportPhone': generalForm.supportPhone }); setGeneralSaved(true); setTimeout(()=>setGeneralSaved(false), 2500); } catch (e) {} finally{ setGeneralSaving(false); } } async function saveSmtpSettings() { setSmtpSaving(true); try { await api.updateAdminSettings({ 'smtp.host': smtpForm.host, 'smtp.port': smtpForm.port, 'smtp.username': smtpForm.username, 'smtp.password': smtpForm.password, 'smtp.fromName': smtpForm.fromName, 'smtp.fromEmail': smtpForm.fromEmail, 'smtp.encryption': smtpForm.encryption }); setSmtpSaved(true); setTimeout(()=>setSmtpSaved(false), 2500); } catch (e) {} finally{ setSmtpSaving(false); } } async function autoTranslateTemplate(key) { const localeKey = "".concat(key, "_").concat(templateLocale); var _notifTemplates_localeKey, _ref; const current = (_ref = (_notifTemplates_localeKey = notifTemplates[localeKey]) !== null && _notifTemplates_localeKey !== void 0 ? _notifTemplates_localeKey : notifTemplates[key]) !== null && _ref !== void 0 ? _ref : { subject: '', body: '' }; if (!current.subject && !current.body) return; setTemplateTranslating(true); try { // СПхраМяеЌ ОсхПЎМый язык в БД (еслО ещё Ме сПхраМёМ) await api.updateAdminEmailTemplate(localeKey, current); // ПеревПЎОЌ Ма ПстальМые языкО const results = await api.translateAdminEmailTemplate({ subject: current.subject, body: current.body, fromLocale: templateLocale }); // ОбМПвляеЌ state setNotifTemplates((prev)=>{ const next = { ...prev, [localeKey]: current }; for (const [loc, tpl] of Object.entries(results)){ next["".concat(key, "_").concat(loc)] = tpl; } return next; }); // СПхраМяеЌ кажЎый перевПЎ в БД await Promise.all(Object.entries(results).map((param)=>{ let [loc, tpl] = param; return api.updateAdminEmailTemplate("".concat(key, "_").concat(loc), tpl); })); } catch (e) {} finally{ setTemplateTranslating(false); } } async function saveTemplate(key) { const localeKey = "".concat(key, "_").concat(templateLocale); setTemplateSaving(true); try { var _notifTemplates_localeKey; await api.updateAdminEmailTemplate(localeKey, (_notifTemplates_localeKey = notifTemplates[localeKey]) !== null && _notifTemplates_localeKey !== void 0 ? _notifTemplates_localeKey : { subject: '', body: '' }); setEditingTemplate(null); } catch (e) {} finally{ setTemplateSaving(false); } } async function saveEPaySettings() { setEPaySaving(true); try { await api.updateAdminSettings({ 'payment.epay.merchantId': ePayForm.merchantId, 'payment.epay.apiUser': ePayForm.apiUser, 'payment.epay.apiPassword': ePayForm.apiPassword, 'payment.epay.environment': ePayForm.environment, 'payment.epay.confirmationUrl': ePayForm.confirmationUrl, 'payment.epay.cancelUrl': ePayForm.cancelUrl, 'payment.epay.enabled': String(ePayForm.enabled) }); setEPaySaved(true); setTimeout(()=>setEPaySaved(false), 2500); } catch (e) {} finally{ setEPaySaving(false); } } async function saveReferralSettings() { setReferralSaving(true); try { await api.updateAdminSettings({ 'referral_enabled': String(referralForm.enabled), 'referral_plan_id': referralForm.planId, 'referral_days': referralForm.days }); setReferralSaved(true); setTimeout(()=>setReferralSaved(false), 2500); } catch (e) {} finally{ setReferralSaving(false); } } async function saveSeoSettings() { setSeoSaving(true); try { await api.updateAdminSettings({ 'seo.maintenanceMode': String(seoForm.maintenanceMode), 'seo.indexingEnabled': String(seoForm.indexingEnabled), 'seo.headScripts': seoForm.headScripts, 'seo.siteTitle.el': seoForm.siteTitleEl, 'seo.siteTitle.en': seoForm.siteTitleEn, 'seo.siteTitle.ru': seoForm.siteTitleRu, 'seo.siteTitle.uk': seoForm.siteTitleUk, 'seo.siteDescription.el': seoForm.siteDescriptionEl, 'seo.siteDescription.en': seoForm.siteDescriptionEn, 'seo.siteDescription.ru': seoForm.siteDescriptionRu, 'seo.siteDescription.uk': seoForm.siteDescriptionUk }); setSeoSaved(true); setTimeout(()=>setSeoSaved(false), 2500); } catch (e) {} finally{ setSeoSaving(false); } } async function saveSocialSettings() { setSocialSaving(true); try { await api.updateAdminSettings({ 'social.telegram': socialForm.telegram, 'social.instagram': socialForm.instagram, 'social.facebook': socialForm.facebook, 'social.twitter': socialForm.twitter, 'social.youtube': socialForm.youtube, 'social.tiktok': socialForm.tiktok, 'social.whatsapp': socialForm.whatsapp, 'social.viber': socialForm.viber }); setSocialSaved(true); setTimeout(()=>setSocialSaved(false), 2500); } catch (e) {} finally{ setSocialSaving(false); } } async function saveTelegramSettings() { setTelegramSaving(true); try { await api.updateAdminSettings({ 'telegram.botToken': telegramForm.botToken, 'telegram.adminChatId': telegramForm.adminChatId, 'telegram.channelId.el': telegramForm.channelIdEl, 'telegram.channelId.en': telegramForm.channelIdEn, 'telegram.channelId.ru': telegramForm.channelIdRu, 'telegram.channelId.uk': telegramForm.channelIdUk, 'telegram.notifyRegistrations': String(telegramForm.notifyRegistrations), 'telegram.postNewTasks': String(telegramForm.postNewTasks) }); setTelegramSaved(true); setTimeout(()=>setTelegramSaved(false), 2500); } catch (e) {} finally{ setTelegramSaving(false); } } async function testTelegram(type) { const chatIdMap = { admin: telegramForm.adminChatId, el: telegramForm.channelIdEl, en: telegramForm.channelIdEn, ru: telegramForm.channelIdRu, uk: telegramForm.channelIdUk }; var _chatIdMap_type; const chatId = (_chatIdMap_type = chatIdMap[type]) !== null && _chatIdMap_type !== void 0 ? _chatIdMap_type : ''; if (type === 'admin') { setTestingTelegramAdmin(true); setTestResultTelegramAdmin(null); } else { setTestingLocale(type); setTestResultChannels((p)=>{ const n = { ...p }; delete n[type]; return n; }); } try { const res = await api.testTelegramConnection(telegramForm.botToken, chatId); var _res_error; const result = { ok: res.ok, msg: res.ok ? res.botName ? "@".concat(res.botName) : t('admin.settings.telegram.test_ok') : (_res_error = res.error) !== null && _res_error !== void 0 ? _res_error : t('admin.settings.telegram.test_fail') }; if (type === 'admin') setTestResultTelegramAdmin(result); else setTestResultChannels((p)=>({ ...p, [type]: result })); } catch (e) { const result = { ok: false, msg: t('admin.settings.telegram.test_fail') }; if (type === 'admin') setTestResultTelegramAdmin(result); else setTestResultChannels((p)=>({ ...p, [type]: result })); } finally{ if (type === 'admin') setTestingTelegramAdmin(false); else setTestingLocale(null); } } async function verifyTelegramToken() { setVerifyingTelegramToken(true); setVerifyResultTelegramToken(null); try { const res = await api.verifyTelegramToken(telegramForm.botToken); var _res_error; setVerifyResultTelegramToken({ ok: res.ok, msg: res.ok ? "@".concat(res.botName) : (_res_error = res.error) !== null && _res_error !== void 0 ? _res_error : t('admin.settings.telegram.test_fail') }); } catch (e) { setVerifyResultTelegramToken({ ok: false, msg: t('admin.settings.telegram.test_fail') }); } finally{ setVerifyingTelegramToken(false); } } if (isPending) return /*#__PURE__*/ _jsx("div", { className: "text-center py-20 text-gray-500", children: t('common.loading') }); const dateLocale = locale === 'ru' ? 'ru-RU' : locale === 'en' ? 'en-US' : 'el-GR'; const catName = (id)=>{ const cat = catRows.find((c)=>c.id === id); if (!cat) return id; if (locale === 'en') return cat.namesEn || cat.namesEl; if (locale === 'ru') return cat.namesRu || cat.namesEl; if (locale === 'uk') return cat.namesUk || cat.namesEl; return cat.namesEl || cat.namesEn || id; }; const locName = (id)=>{ const loc = locRows.find((l)=>l.id === id); if (!loc) return id; if (locale === 'en') return loc.nameEn || loc.nameEl; if (locale === 'ru') return loc.nameRu || loc.nameEl; if (locale === 'uk') return loc.nameUk || loc.nameEl; return loc.nameEl || loc.nameEn || id; }; const TABS = [ { key: 'stats', label: t('admin.tab.stats'), icon: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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: t('admin.tab.users'), icon: /*#__PURE__*/ _jsxs("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M17 21v-2a4 4 0 00-4-4H5a4 4 0 00-4 4v2" }), /*#__PURE__*/ _jsx("circle", { cx: "9", cy: "7", r: "4" }), /*#__PURE__*/ _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: t('admin.tab.tasks'), icon: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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: t('admin.tab.reports'), badge: pendingReportsCount || undefined, icon: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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: t('admin.tab.moderation'), badge: pendingCardsCount || undefined, icon: /*#__PURE__*/ _jsxs("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ _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" }), /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 20h12" }) ] }) }, { key: 'categories', label: t('admin.tab.categories'), icon: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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: t('admin.tab.locations'), icon: /*#__PURE__*/ _jsxs("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ _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" }), /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 11a3 3 0 11-6 0 3 3 0 016 0z" }) ] }) }, { key: 'balances', label: t('admin.tab.balances', 'Balance'), icon: /*#__PURE__*/ _jsxs("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ _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" }), /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M20 12h-6m0 0a2 2 0 100 4h6v-8h-6a2 2 0 100 4z" }) ] }) }, { key: 'plans', label: t('admin.tab.plans'), icon: /*#__PURE__*/ _jsxs("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ _jsx("rect", { x: "1", y: "4", width: "22", height: "16", rx: "2", ry: "2" }), /*#__PURE__*/ _jsx("line", { x1: "1", y1: "10", x2: "23", y2: "10" }) ] }) }, { key: 'logs', label: t('admin.tab.logs'), icon: /*#__PURE__*/ _jsxs("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ _jsx("polyline", { points: "4 17 10 11 4 5" }), /*#__PURE__*/ _jsx("line", { x1: "12", y1: "19", x2: "20", y2: "19" }) ] }) }, { key: 'settings', label: t('admin.tab.settings'), icon: /*#__PURE__*/ _jsxs("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ _jsx("circle", { cx: "12", cy: "12", r: "3" }), /*#__PURE__*/ _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: t('admin.tab.support', 'Support'), icon: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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: t('admin.tab.push', 'Push'), icon: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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: t('admin.tab.backup', 'Backup'), icon: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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: t('admin.tab.translations', 'Translations'), icon: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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: t('admin.tab.dbcheck', 'DB check'), icon: /*#__PURE__*/ _jsxs("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ _jsx("ellipse", { cx: "12", cy: "5", rx: "9", ry: "3" }), /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M21 12c0 1.66-4.03 3-9 3S3 13.66 3 12" }), /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M3 5v14c0 1.66 4.03 3 9 3s9-1.34 9-3V5" }), /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 12l2 2 4-4" }) ] }) }, { key: 'referrals', label: t('admin.tab.referrals', 'Referrals'), icon: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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" }) }) } ]; const statusColors = { 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' }; const reportStatusColors = { pending: 'bg-yellow-100 text-yellow-700', reviewed: 'bg-green-100 text-green-700', dismissed: 'bg-gray-100 text-gray-500' }; const reasonColors = { 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' }; const cardStatus = (card)=>{ var _card_publicationStatus; return (_card_publicationStatus = card.publicationStatus) !== null && _card_publicationStatus !== void 0 ? _card_publicationStatus : card.isActive ? 'active' : 'inactive'; }; const pendingModerationCards = moderationCards.filter((card)=>cardStatus(card) === 'pending'); const activeModerationCards = moderationCards.filter((card)=>cardStatus(card) === 'active'); var _stats_totalCostUsd, _planForm_oldPrice, _pushResult_tokensFound, _pushResult_usersWithoutTokens, _pushResult_usersConfigBlocked, _pushResult_usersAuthFailed, _pushResult_usersAllFailed, _pushResult_usersWithoutTokens1, _pushResult_usersConfigBlocked1, _pushResult_usersAuthFailed1, _pushResult_usersAllFailed1, _referralsData_totalReferrers, _referralsData_totalReferrals, _referralsData_activeRewards, _editUser_firstName, _editUser_lastName, _editUser_phone, _editUser_bio, _editUser_planId, _editUser_locale, _editUser_balance, _editUser_showContactInfo, _editUser_notifyNewTasks, _editUser_notifMessages, _editUser_personalSiteSlug, _editUser_siteSettings, _siteTheme, _editUser_skills, _editUser_balance1, _editUser_topUpAmount, _editUser_withdrawAmount, _editUser_topUpDescription, _editUser_withdrawDescription; return /*#__PURE__*/ _jsx("div", { className: "min-h-screen bg-gray-50", children: /*#__PURE__*/ _jsxs("div", { className: "max-w-7xl mx-auto px-4 py-8", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between mb-6", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-7 h-7 text-yellow-500", fill: "currentColor", viewBox: "0 0 24 24", children: /*#__PURE__*/ _jsx("path", { d: "M5 16L3 5l5.5 5L12 4l3.5 6L21 5l-2 11H5zm0 3a1 1 0 000 2h14a1 1 0 000-2H5z" }) }), /*#__PURE__*/ _jsx("h1", { className: "text-2xl font-bold text-gray-900", children: t('admin.title') }) ] }), /*#__PURE__*/ _jsxs(Link, { href: "/", className: "flex items-center gap-1.5 text-sm text-gray-500 hover:text-green-600 transition", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 19l-7-7 7-7" }) }), t('admin.back_home') ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-6", children: [ /*#__PURE__*/ _jsx("aside", { className: "shrink-0 transition-all duration-200 ".concat(sidebarCollapsed ? 'w-12' : 'w-52'), children: /*#__PURE__*/ _jsxs("nav", { className: "bg-white rounded-xl border border-gray-200 overflow-hidden", children: [ /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setSidebarCollapsed((v)=>!v), title: sidebarCollapsed ? 'РазверМуть ЌеМю' : 'СверМуть ЌеМю', 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: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 transition-transform duration-200 ".concat(sidebarCollapsed ? 'rotate-180' : ''), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 19l-7-7 7-7" }) }) }), TABS.map((param)=>{ let { key, label, icon, badge } = param; return /*#__PURE__*/ _jsxs("button", { onClick: ()=>setTab(key), title: sidebarCollapsed ? label : undefined, className: "w-full flex items-center py-3 text-sm font-medium text-left transition ".concat(tab === key ? 'bg-green-50 text-green-700 border-r-2 border-green-600' : 'text-gray-600 hover:bg-gray-50 hover:text-gray-900', " ").concat(sidebarCollapsed ? 'justify-center px-3' : 'gap-3 px-4'), children: [ /*#__PURE__*/ _jsx("span", { className: "w-4 h-4 flex-shrink-0 flex items-center justify-center", children: icon }), !sidebarCollapsed && /*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-2 min-w-0", children: [ /*#__PURE__*/ _jsx("span", { children: label }), badge ? /*#__PURE__*/ _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: badge }) : null ] }) ] }, key); }) ] }) }), /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-0", children: [ tab === 'stats' && /*#__PURE__*/ _jsxs("div", { className: "space-y-6", children: [ /*#__PURE__*/ _jsx("div", { className: "grid grid-cols-2 md:grid-cols-5 gap-4", children: [ { label: t('admin.stats.users'), value: stats === null || stats === void 0 ? void 0 : stats.userCount, icon: /*#__PURE__*/ _jsx("svg", { className: "w-8 h-8", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ _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: t('admin.stats.specialists'), value: stats === null || stats === void 0 ? void 0 : stats.specialistCount, icon: /*#__PURE__*/ _jsxs("svg", { className: "w-8 h-8", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: [ /*#__PURE__*/ _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" }), /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 12a3 3 0 11-6 0 3 3 0 016 0z" }) ] }), color: 'text-purple-600' }, { label: t('admin.stats.tasks'), value: stats === null || stats === void 0 ? void 0 : stats.taskCount, icon: /*#__PURE__*/ _jsx("svg", { className: "w-8 h-8", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ _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: t('admin.stats.offers'), value: stats === null || stats === void 0 ? void 0 : stats.offerCount, icon: /*#__PURE__*/ _jsx("svg", { className: "w-8 h-8", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ _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: t('admin.stats.reviews'), value: stats === null || stats === void 0 ? void 0 : stats.reviewCount, icon: /*#__PURE__*/ _jsx("svg", { className: "w-8 h-8", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ _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((param)=>{ let { label, value, icon, color } = param; return /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-5", children: [ /*#__PURE__*/ _jsx("div", { className: "mb-2 ".concat(color), children: icon }), /*#__PURE__*/ _jsx("div", { className: "text-3xl font-bold ".concat(color), children: value !== null && value !== void 0 ? value : '—' }), /*#__PURE__*/ _jsx("div", { className: "text-sm text-gray-500 mt-1", children: label }) ] }, label); }) }), (stats === null || stats === void 0 ? void 0 : stats.tasksByDay) && /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between mb-4", children: [ /*#__PURE__*/ _jsx("h2", { className: "font-semibold text-gray-800", children: t('admin.stats.activity_30d') }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-4 text-xs text-gray-500", children: [ /*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-1.5", children: [ /*#__PURE__*/ _jsx("span", { className: "w-3 h-0.5 bg-green-500 inline-block rounded" }), t('admin.stats.users_label') ] }), /*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-1.5", children: [ /*#__PURE__*/ _jsx("span", { className: "w-3 h-0.5 bg-purple-400 inline-block rounded" }), t('admin.stats.specialists_label') ] }), /*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-1.5", children: [ /*#__PURE__*/ _jsx("span", { className: "w-3 h-0.5 bg-green-500 inline-block rounded" }), t('admin.stats.tasks_label') ] }) ] }) ] }), /*#__PURE__*/ _jsx(AdminAreaChart, { series: [ { data: stats.usersByDay, color: '#3b82f6', fill: '#3b82f615', label: t('admin.stats.users_label') }, { data: stats.specialistsByDay, color: '#a855f7', fill: '#a855f710', label: t('admin.stats.specialists_label') }, { data: stats.tasksByDay, color: '#22c55e', fill: '#22c55e10', label: t('admin.stats.tasks_label') } ] }) ] }), (stats === null || stats === void 0 ? void 0 : stats.tasksByStatus) && /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ _jsx("h2", { className: "font-semibold text-gray-800 mb-5", children: t('admin.stats.tasks_by_status') }), /*#__PURE__*/ _jsx("div", { className: "space-y-3", children: (()=>{ const total = stats.tasksByStatus.reduce((s, r)=>s + Number(r.count), 0) || 1; const statusMeta = { open: { label: t('admin.task_status.open'), bg: 'bg-green-50', bar: 'bg-green-500' }, in_progress: { label: t('admin.task_status.in_progress'), bg: 'bg-green-50', bar: 'bg-green-500' }, completed: { label: t('admin.task_status.completed'), bg: 'bg-gray-50', bar: 'bg-gray-400' }, cancelled: { label: t('admin.task_status.cancelled'), bg: 'bg-red-50', bar: 'bg-red-400' }, draft: { label: t('admin.task_status.draft'), bg: 'bg-yellow-50', bar: 'bg-yellow-400' } }; const order = [ 'open', 'in_progress', 'completed', 'draft', 'cancelled' ]; const sorted = [ ...stats.tasksByStatus ].sort((a, b)=>order.indexOf(a.status) - order.indexOf(b.status)); return sorted.map((param)=>{ let { status, count: c } = param; var _statusMeta_status; const meta = (_statusMeta_status = statusMeta[status]) !== null && _statusMeta_status !== void 0 ? _statusMeta_status : { label: status, bg: 'bg-gray-50', bar: 'bg-gray-300' }; const pct = Math.round(Number(c) / total * 100); return /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 px-3 py-2 rounded-lg ".concat(meta.bg), children: [ /*#__PURE__*/ _jsx("span", { className: "text-sm text-gray-600 w-28 shrink-0", children: meta.label }), /*#__PURE__*/ _jsx("div", { className: "flex-1 bg-gray-200 rounded-full h-2 overflow-hidden", children: /*#__PURE__*/ _jsx("div", { className: "h-full rounded-full ".concat(meta.bar, " transition-all"), style: { width: "".concat(pct, "%") } }) }), /*#__PURE__*/ _jsx("span", { className: "text-sm font-semibold text-gray-700 w-8 text-right", children: c }), /*#__PURE__*/ _jsxs("span", { className: "text-xs text-gray-400 w-8", children: [ pct, "%" ] }) ] }, status); }); })() }) ] }), notifsByDay.length > 0 && /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between mb-4", children: [ /*#__PURE__*/ _jsx("h2", { className: "font-semibold text-gray-800", children: t('admin.stats.notif_chart_title') }), /*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-1.5 text-xs text-gray-500", children: [ /*#__PURE__*/ _jsx("span", { className: "w-3 h-0.5 bg-orange-500 inline-block rounded" }), t('admin.stats.notif_label') ] }) ] }), /*#__PURE__*/ _jsx(AdminAreaChart, { series: [ { data: notifsByDay, color: '#f97316', fill: '#f9731615', label: t('admin.stats.notif_label') } ] }) ] }), mailByDay.length > 0 && /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between mb-4", children: [ /*#__PURE__*/ _jsx("h2", { className: "font-semibold text-gray-800", children: t('admin.stats.mail_chart_title') }), /*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-1.5 text-xs text-gray-500", children: [ /*#__PURE__*/ _jsx("span", { className: "w-3 h-0.5 bg-sky-500 inline-block rounded" }), t('admin.stats.mail_label') ] }) ] }), /*#__PURE__*/ _jsx(AdminAreaChart, { series: [ { data: mailByDay, color: '#0ea5e9', fill: '#0ea5e915', label: t('admin.stats.mail_label') } ] }) ] }), stats && /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6 space-y-5", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between", children: [ /*#__PURE__*/ _jsx("h2", { className: "font-semibold text-gray-800", children: t('admin.stats.tokens_title') }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-4 text-xs text-gray-500", children: [ /*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-1.5", children: [ /*#__PURE__*/ _jsx("span", { className: "w-3 h-0.5 bg-violet-500 inline-block rounded" }), t('admin.stats.tokens_out') ] }), /*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-1.5", children: [ /*#__PURE__*/ _jsx("span", { className: "w-3 h-0.5 bg-sky-500 inline-block rounded" }), t('admin.stats.tokens_in') ] }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "grid grid-cols-3 gap-4", children: [ /*#__PURE__*/ _jsxs("div", { className: "rounded-lg bg-violet-50 border border-violet-100 px-4 py-3", children: [ /*#__PURE__*/ _jsx("div", { className: "text-xs text-violet-600 mb-1", children: t('admin.stats.tokens_out_label') }), /*#__PURE__*/ _jsx("div", { className: "text-2xl font-bold text-violet-700", children: Number(stats.totalOutputTokens).toLocaleString() }) ] }), /*#__PURE__*/ _jsxs("div", { className: "rounded-lg bg-sky-50 border border-sky-100 px-4 py-3", children: [ /*#__PURE__*/ _jsx("div", { className: "text-xs text-sky-600 mb-1", children: t('admin.stats.tokens_in_label') }), /*#__PURE__*/ _jsx("div", { className: "text-2xl font-bold text-sky-700", children: Number(stats.totalInputTokens).toLocaleString() }) ] }), /*#__PURE__*/ _jsxs("div", { className: "rounded-lg bg-emerald-50 border border-emerald-100 px-4 py-3", children: [ /*#__PURE__*/ _jsx("div", { className: "text-xs text-emerald-600 mb-1", children: t('admin.stats.cost_label') }), /*#__PURE__*/ _jsxs("div", { className: "text-2xl font-bold text-emerald-700", children: [ "$", Number((_stats_totalCostUsd = stats.totalCostUsd) !== null && _stats_totalCostUsd !== void 0 ? _stats_totalCostUsd : 0).toFixed(4) ] }) ] }) ] }), ((_stats_tokensByMonth = stats.tokensByMonth) === null || _stats_tokensByMonth === void 0 ? void 0 : _stats_tokensByMonth.length) > 0 && /*#__PURE__*/ _jsx(AdminMonthChart, { dateLocale: dateLocale, series: [ { data: stats.tokensByMonth.map((r)=>({ month: r.month, count: Number(r.output) })), color: '#8b5cf6', fill: '#8b5cf610', label: t('admin.stats.tokens_out_label') }, { data: stats.tokensByMonth.map((r)=>({ month: r.month, count: Number(r.input) })), color: '#0ea5e9', fill: '#0ea5e915', label: t('admin.stats.tokens_in_label') } ] }) ] }) ] }), tab === 'users' && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("div", { className: "flex gap-3 mb-4", children: [ /*#__PURE__*/ _jsxs("form", { className: "flex gap-2 flex-1", onSubmit: (e)=>{ e.preventDefault(); setUsersQ(usersQInput); }, children: [ /*#__PURE__*/ _jsx("input", { value: usersQInput, onChange: (e)=>setUsersQInput(e.target.value), placeholder: t('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" }), /*#__PURE__*/ _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: t('tasks.search.btn') }) ] }), /*#__PURE__*/ _jsxs("select", { value: usersRole, onChange: (e)=>setUsersRole(e.target.value), className: "border border-gray-300 rounded-lg px-3 py-2 text-sm", children: [ /*#__PURE__*/ _jsx("option", { value: "", children: t('admin.filter.all_roles') }), /*#__PURE__*/ _jsx("option", { value: "user", children: t('admin.user_edit.role.user') }), /*#__PURE__*/ _jsx("option", { value: "admin", children: t('profile.role.admin') }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 overflow-hidden", children: [ /*#__PURE__*/ _jsxs("table", { className: "w-full text-sm", children: [ /*#__PURE__*/ _jsx("thead", { className: "bg-gray-50 text-left", children: /*#__PURE__*/ _jsxs("tr", { children: [ /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.col.user') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.col.email') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.col.role') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.col.plan', 'Plan') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.col.registered') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.col.status') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3" }) ] }) }), /*#__PURE__*/ _jsx("tbody", { className: "divide-y divide-gray-100", children: loading ? /*#__PURE__*/ _jsx("tr", { children: /*#__PURE__*/ _jsx("td", { colSpan: 6, className: "px-4 py-8 text-center text-gray-400", children: t('common.loading') }) }) : users.length === 0 ? /*#__PURE__*/ _jsx("tr", { children: /*#__PURE__*/ _jsx("td", { colSpan: 6, className: "px-4 py-8 text-center text-gray-400", children: "—" }) }) : users.map((u)=>{ var _planRows_find; var _planRows_find_name; return /*#__PURE__*/ _jsxs("tr", { className: "hover:bg-gray-50", children: [ /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 font-medium text-gray-800", children: formatShortName(u.firstName, u.lastName, u.name) }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-gray-500", children: u.email }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3", children: /*#__PURE__*/ _jsx("span", { className: "px-2 py-0.5 rounded-full text-xs font-medium ".concat(u.role === 'admin' ? 'bg-red-100 text-red-700' : u.role === 'specialist' ? 'bg-green-100 text-green-700' : 'bg-gray-100 text-gray-600'), children: t("profile.role.".concat(u.role)) || u.role }) }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-gray-400 text-xs", children: u.planId ? (_planRows_find_name = (_planRows_find = planRows.find((p)=>p.id === u.planId)) === null || _planRows_find === void 0 ? void 0 : _planRows_find.name) !== null && _planRows_find_name !== void 0 ? _planRows_find_name : /*#__PURE__*/ _jsxs("span", { className: "font-mono", children: [ u.planId.slice(0, 8), "
" ] }) : /*#__PURE__*/ _jsx("span", { className: "text-gray-300", children: "—" }) }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-gray-400", children: new Date(u.createdAt).toLocaleDateString(dateLocale) }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3", children: /*#__PURE__*/ _jsx("span", { className: "px-2 py-0.5 rounded-full text-xs font-medium ".concat(u.isActive !== false ? 'bg-green-100 text-green-700' : 'bg-red-100 text-red-600'), children: u.isActive !== false ? t('admin.users.active') : t('admin.users.inactive') }) }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-right", children: /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-end gap-1.5", children: [ /*#__PURE__*/ _jsx("button", { onClick: ()=>openEditUser(u), 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: /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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" }) }) }), u.role !== 'admin' && /*#__PURE__*/ _jsx("button", { onClick: ()=>toggleUser(u.id, u.isActive !== false), className: "text-xs px-3 py-1 rounded-lg font-medium ".concat(u.isActive !== false ? 'bg-red-50 text-red-600 hover:bg-red-100' : 'bg-green-50 text-green-600 hover:bg-green-100'), children: u.isActive !== false ? t('admin.users.deactivate') : t('admin.users.activate') }) ] }) }) ] }, u.id); }) }) ] }), /*#__PURE__*/ _jsx(Pagination, { page: usersPage, total: usersTotal, limit: 20, onChange: setUsersPage, totalLabel: t('admin.pagination.total') }) ] }) ] }), tab === 'balances' && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("div", { className: "flex flex-wrap gap-3 mb-4", children: [ /*#__PURE__*/ _jsx("input", { value: balanceUserId, onChange: (e)=>setBalanceUserId(e.target.value), placeholder: t('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" }), /*#__PURE__*/ _jsxs("select", { value: balanceKind, onChange: (e)=>setBalanceKind(e.target.value), className: "border border-gray-300 rounded-lg px-3 py-2 text-sm", children: [ /*#__PURE__*/ _jsx("option", { value: "", children: t('admin.balance.filter.all', 'All operations') }), /*#__PURE__*/ _jsx("option", { value: "topup", children: t('admin.balance.kind.topup', 'Top-up') }), /*#__PURE__*/ _jsx("option", { value: "plan_purchase", children: t('admin.balance.kind.plan_purchase', 'Plan charge') }), /*#__PURE__*/ _jsx("option", { value: "admin_topup", children: t('admin.balance.kind.admin_topup', 'Admin top-up') }), /*#__PURE__*/ _jsx("option", { value: "admin_adjustment", children: t('admin.balance.kind.admin_adjustment', 'Adjustment') }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 overflow-hidden", children: [ /*#__PURE__*/ _jsxs("table", { className: "w-full text-sm", children: [ /*#__PURE__*/ _jsx("thead", { className: "bg-gray-50 text-left", children: /*#__PURE__*/ _jsxs("tr", { children: [ /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.col.user') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.balance.col.operation', 'Operation') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.balance.col.amount', 'Amount') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.balance.col.result', 'Balance') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.balance.col.description', 'Description') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.balance.col.date', 'Date') }) ] }) }), /*#__PURE__*/ _jsx("tbody", { className: "divide-y divide-gray-100", children: loading ? /*#__PURE__*/ _jsx("tr", { children: /*#__PURE__*/ _jsx("td", { colSpan: 6, className: "px-4 py-8 text-center text-gray-400", children: t('common.loading') }) }) : balanceRows.length === 0 ? /*#__PURE__*/ _jsx("tr", { children: /*#__PURE__*/ _jsx("td", { colSpan: 6, className: "px-4 py-8 text-center text-gray-400", children: t('admin.balance.empty', 'No records yet') }) }) : balanceRows.map((row)=>{ const isCredit = row.direction === 'credit'; const kindLabel = row.kind === 'topup' ? t('admin.balance.kind.topup', 'Top-up') : row.kind === 'plan_purchase' ? t('admin.balance.kind.plan_purchase', 'Plan charge') : row.kind === 'admin_topup' ? t('admin.balance.kind.admin_topup', 'Admin top-up') : t('admin.balance.kind.admin_adjustment', 'Adjustment'); return /*#__PURE__*/ _jsxs("tr", { className: "hover:bg-gray-50 align-top", children: [ /*#__PURE__*/ _jsxs("td", { className: "px-4 py-3", children: [ /*#__PURE__*/ _jsx("div", { className: "font-medium text-gray-800", children: row.userName || '—' }), /*#__PURE__*/ _jsx("div", { className: "text-xs text-gray-500 mt-0.5", children: row.userEmail || row.userId }) ] }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3", children: /*#__PURE__*/ _jsx("span", { className: "inline-flex rounded-full px-2 py-0.5 text-xs font-medium ".concat(isCredit ? 'bg-emerald-50 text-emerald-700' : 'bg-rose-50 text-rose-700'), children: kindLabel }) }), /*#__PURE__*/ _jsxs("td", { className: "px-4 py-3 font-semibold ".concat(isCredit ? 'text-emerald-700' : 'text-rose-700'), children: [ isCredit ? '+' : '-', Number(row.amount).toFixed(2), " ", row.currency ] }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-gray-600", children: /*#__PURE__*/ _jsxs("div", { children: [ Number(row.balanceBefore).toFixed(2), " → ", Number(row.balanceAfter).toFixed(2), " ", row.currency ] }) }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-gray-500 max-w-sm", children: row.description || '—' }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-gray-500 whitespace-nowrap", children: new Date(row.createdAt).toLocaleString(dateLocale) }) ] }, row.id); }) }) ] }), /*#__PURE__*/ _jsx(Pagination, { page: balancePage, total: balanceTotal, limit: 50, onChange: setBalancePage, totalLabel: t('admin.pagination.total') }) ] }) ] }), tab === 'tasks' && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("div", { className: "flex gap-3 mb-4", children: [ /*#__PURE__*/ _jsxs("form", { className: "flex gap-2 flex-1", onSubmit: (e)=>{ e.preventDefault(); setTasksQ(tasksQInput); }, children: [ /*#__PURE__*/ _jsx("input", { value: tasksQInput, onChange: (e)=>setTasksQInput(e.target.value), placeholder: t('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" }), /*#__PURE__*/ _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: t('tasks.search.btn') }) ] }), /*#__PURE__*/ _jsxs("select", { value: tasksStatus, onChange: (e)=>setTasksStatus(e.target.value), className: "border border-gray-300 rounded-lg px-3 py-2 text-sm", children: [ /*#__PURE__*/ _jsx("option", { value: "", children: t('admin.filter.all_statuses') }), [ 'open', 'in_progress', 'completed', 'cancelled', 'draft' ].map((s)=>/*#__PURE__*/ _jsx("option", { value: s, children: t("task.status.".concat(s), s) }, s)) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 overflow-hidden", children: [ /*#__PURE__*/ _jsxs("table", { className: "w-full text-sm", children: [ /*#__PURE__*/ _jsx("thead", { className: "bg-gray-50 text-left", children: /*#__PURE__*/ _jsxs("tr", { children: [ /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.col.title') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.col.customer') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.col.status') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.col.budget') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.col.created') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3" }) ] }) }), /*#__PURE__*/ _jsx("tbody", { className: "divide-y divide-gray-100", children: loading ? /*#__PURE__*/ _jsx("tr", { children: /*#__PURE__*/ _jsx("td", { colSpan: 6, className: "px-4 py-8 text-center text-gray-400", children: t('common.loading') }) }) : tasks.length === 0 ? /*#__PURE__*/ _jsx("tr", { children: /*#__PURE__*/ _jsx("td", { colSpan: 6, className: "px-4 py-8 text-center text-gray-400", children: "—" }) }) : tasks.map((row)=>{ const task = row.task || row; const customer = row.customer; var _customer_name, _statusColors_task_status; return /*#__PURE__*/ _jsxs("tr", { className: "hover:bg-gray-50", children: [ /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 font-medium text-gray-800 max-w-xs", children: /*#__PURE__*/ _jsx(Link, { href: "/tasks/".concat(task.id), className: "hover:text-green-600 truncate block", target: "_blank", children: locale === 'en' && task.titleEn || locale === 'ru' && task.titleRu || locale === 'uk' && task.titleUk || task.titleEl || task.title }) }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-gray-500 text-xs", children: (_customer_name = customer === null || customer === void 0 ? void 0 : customer.name) !== null && _customer_name !== void 0 ? _customer_name : '—' }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3", children: /*#__PURE__*/ _jsx("span", { className: "px-2 py-0.5 rounded-full text-xs font-medium ".concat((_statusColors_task_status = statusColors[task.status]) !== null && _statusColors_task_status !== void 0 ? _statusColors_task_status : 'bg-gray-100 text-gray-600'), children: t("task.status.".concat(task.status), task.status) }) }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-gray-500", children: task.budget ? "".concat(formatPrice(task.budget), "€") : '—' }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-gray-400", children: new Date(task.createdAt).toLocaleDateString(dateLocale) }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-right", children: /*#__PURE__*/ _jsxs("div", { className: "flex gap-1.5 justify-end", children: [ task.status !== 'cancelled' && task.status !== 'completed' && /*#__PURE__*/ _jsx("button", { onClick: ()=>cancelTask(task.id), className: "text-xs px-2.5 py-1 rounded-lg font-medium bg-yellow-50 text-yellow-700 hover:bg-yellow-100", children: t('admin.tasks.cancel') }), /*#__PURE__*/ _jsx("button", { onClick: ()=>deleteTask(task.id, locale === 'en' && task.titleEn || locale === 'ru' && task.titleRu || locale === 'uk' && task.titleUk || task.titleEl || task.title), className: "text-xs px-2.5 py-1 rounded-lg font-medium bg-red-50 text-red-600 hover:bg-red-100", children: t('admin.tasks.delete') }) ] }) }) ] }, task.id); }) }) ] }), /*#__PURE__*/ _jsx(Pagination, { page: tasksPage, total: tasksTotal, limit: 20, onChange: setTasksPage, totalLabel: t('admin.pagination.total') }) ] }) ] }), tab === 'categories' && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("div", { className: "flex justify-between items-center mb-4", children: [ /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-500", children: t('admin.cat.hint') }), /*#__PURE__*/ _jsxs("button", { onClick: ()=>openAddCat(null), className: "px-4 py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700", children: [ "+ ", t('admin.cat.add_root') ] }) ] }), catForm && /*#__PURE__*/ _jsxs("div", { className: "bg-green-50 border border-green-200 rounded-xl p-5 mb-4", children: [ /*#__PURE__*/ _jsxs("h3", { className: "font-semibold text-gray-800 mb-4", children: [ catForm.id ? t('admin.cat.edit') : t('admin.cat.new'), catForm.parentId && /*#__PURE__*/ _jsxs("span", { className: "text-xs text-gray-400 ml-2", children: [ "(", t('admin.cat.subcategory'), ")" ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "grid grid-cols-2 md:grid-cols-3 gap-3 mb-3", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.cat.slug') }), /*#__PURE__*/ _jsx("input", { value: catForm.slug, onChange: (e)=>setCatForm((f)=>f && { ...f, slug: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm", placeholder: "e.g. repairs" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.cat.icon') }), /*#__PURE__*/ _jsx(CategoryIconPicker, { value: catForm.icon, onChange: (icon)=>setCatForm((f)=>f && { ...f, icon }), onUpload: uploadCategoryIcon, uploading: catIconUploading, error: catIconError, presets: categoryIconPresets }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.cat.order') }), /*#__PURE__*/ _jsx("input", { type: "number", value: catForm.order, onChange: (e)=>setCatForm((f)=>f && { ...f, order: Number(e.target.value) }), className: "w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: [ t('admin.cat.name_el'), " \uD83C\uDDEC\uD83C\uDDF7" ] }), /*#__PURE__*/ _jsx("input", { value: catForm.namesEl, onChange: (e)=>setCatForm((f)=>f && { ...f, namesEl: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: [ t('admin.cat.name_en'), " \uD83C\uDDEC\uD83C\uDDE7" ] }), /*#__PURE__*/ _jsx("input", { value: catForm.namesEn, onChange: (e)=>setCatForm((f)=>f && { ...f, namesEn: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: [ t('admin.cat.name_ru'), " \uD83C\uDDF7\uD83C\uDDFA" ] }), /*#__PURE__*/ _jsx("input", { value: catForm.namesRu, onChange: (e)=>setCatForm((f)=>f && { ...f, namesRu: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: [ t('admin.cat.name_uk'), " \uD83C\uDDFA\uD83C\uDDE6" ] }), /*#__PURE__*/ _jsx("input", { value: catForm.namesUk, onChange: (e)=>setCatForm((f)=>f && { ...f, namesUk: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }) ] }), catForm.id && /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-2 text-sm text-gray-700 mb-3", children: [ /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: catForm.isActive, onChange: (e)=>setCatForm((f)=>f && { ...f, isActive: e.target.checked }) }), t('admin.cat.active') ] }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-2", children: [ /*#__PURE__*/ _jsx("button", { onClick: saveCat, disabled: catSaving, className: "px-4 py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700 disabled:opacity-50", children: catSaving ? t('common.saving') : t('common.save') }), /*#__PURE__*/ _jsx("button", { onClick: ()=>setCatForm(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: t('common.cancel') }) ] }) ] }), /*#__PURE__*/ _jsx("div", { className: "bg-white rounded-xl border border-gray-200 divide-y divide-gray-100", children: catRows.length === 0 ? /*#__PURE__*/ _jsx("div", { className: "px-4 py-8 text-center text-gray-400", children: t('admin.cat.empty') }) : /*#__PURE__*/ _jsx(CatTree, { rows: catRows, parentId: null, depth: 0, locale: locale, expanded: catExpanded, onToggle: toggleCatExpand, onEdit: openEditCat, onDelete: deleteCat, onAddChild: openAddCat, skillsExpanded: catSkillsExpanded, skillsCache: catSkillsCache, skillsLoading: catSkillsLoading, onToggleSkills: toggleCatSkills, skillForm: skillForm, skillSaving: skillSaving, onOpenAddSkill: openAddSkill, onOpenEditSkill: openEditSkill, onSaveSkill: saveSkill, onDeleteSkill: deleteSkill, onCancelSkillForm: ()=>setSkillForm(null), onSkillFormChange: setSkillForm, t: t }) }) ] }), tab === 'locations' && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("div", { className: "flex justify-between items-center mb-4", children: [ /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-500", children: t('admin.loc.hint') }), /*#__PURE__*/ _jsxs("button", { onClick: ()=>openAddLoc(null), className: "px-4 py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700", children: [ "+ ", t('admin.loc.add_city') ] }) ] }), locForm && /*#__PURE__*/ _jsxs("div", { className: "bg-green-50 border border-green-200 rounded-xl p-5 mb-4", children: [ /*#__PURE__*/ _jsxs("h3", { className: "font-semibold text-gray-800 mb-4", children: [ locForm.id ? t('admin.loc.edit') : t('admin.loc.new'), locForm.parentId && /*#__PURE__*/ _jsxs("span", { className: "text-xs text-gray-400 ml-2", children: [ "(", t('admin.loc.district'), ")" ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "grid grid-cols-2 md:grid-cols-4 gap-3 mb-3", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.cat.slug') }), /*#__PURE__*/ _jsx("input", { value: locForm.slug, onChange: (e)=>setLocForm((f)=>f && { ...f, slug: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm", placeholder: "e.g. athens-center" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: [ t('admin.cat.name_el'), " \uD83C\uDDEC\uD83C\uDDF7" ] }), /*#__PURE__*/ _jsx("input", { value: locForm.nameEl, onChange: (e)=>setLocForm((f)=>f && { ...f, nameEl: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: [ t('admin.cat.name_en'), " \uD83C\uDDEC\uD83C\uDDE7" ] }), /*#__PURE__*/ _jsx("input", { value: locForm.nameEn, onChange: (e)=>setLocForm((f)=>f && { ...f, nameEn: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: [ t('admin.cat.name_ru'), " \uD83C\uDDF7\uD83C\uDDFA" ] }), /*#__PURE__*/ _jsx("input", { value: locForm.nameRu, onChange: (e)=>setLocForm((f)=>f && { ...f, nameRu: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: [ t('admin.cat.name_uk'), " \uD83C\uDDFA\uD83C\uDDE6" ] }), /*#__PURE__*/ _jsx("input", { value: locForm.nameUk, onChange: (e)=>setLocForm((f)=>f && { ...f, nameUk: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-4 mb-3", children: [ /*#__PURE__*/ _jsxs("div", { className: "w-24", children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.cat.order') }), /*#__PURE__*/ _jsx("input", { type: "number", value: locForm.order, onChange: (e)=>setLocForm((f)=>f && { ...f, order: Number(e.target.value) }), className: "w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), locForm.id && /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-2 text-sm text-gray-700 mt-4", children: [ /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: locForm.isActive, onChange: (e)=>setLocForm((f)=>f && { ...f, isActive: e.target.checked }) }), t('admin.cat.active') ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-2", children: [ /*#__PURE__*/ _jsx("button", { onClick: saveLoc, disabled: locSaving, className: "px-4 py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700 disabled:opacity-50", children: locSaving ? t('common.saving') : t('common.save') }), /*#__PURE__*/ _jsx("button", { onClick: ()=>setLocForm(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: t('common.cancel') }) ] }) ] }), /*#__PURE__*/ _jsx("div", { className: "bg-white rounded-xl border border-gray-200 divide-y divide-gray-100", children: locRows.length === 0 ? /*#__PURE__*/ _jsx("div", { className: "px-4 py-8 text-center text-gray-400", children: t('admin.loc.empty') }) : /*#__PURE__*/ _jsx(LocTree, { rows: locRows, parentId: null, depth: 0, locale: locale, expanded: locExpanded, onToggle: toggleLocExpand, onEdit: openEditLoc, onDelete: deleteLoc, onAddChild: openAddLoc, t: t }) }) ] }), tab === 'reports' && /*#__PURE__*/ _jsxs("div", { className: "space-y-3", children: [ loading ? /*#__PURE__*/ _jsx("div", { className: "text-center py-10 text-gray-400", children: t('common.loading') }) : reports.length === 0 ? /*#__PURE__*/ _jsx("div", { className: "text-center py-10 text-gray-400", children: t('admin.reports.none') }) : reports.map((r)=>{ var _r_targetId; var _reportStatusColors_r_status, _reasonColors_r_reason; return /*#__PURE__*/ _jsx("div", { className: "bg-white rounded-xl border border-gray-200 p-5", children: /*#__PURE__*/ _jsxs("div", { className: "flex items-start justify-between gap-4", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 flex-wrap mb-2", children: [ /*#__PURE__*/ _jsx("span", { className: "px-2 py-0.5 rounded-full text-xs font-medium ".concat((_reportStatusColors_r_status = reportStatusColors[r.status]) !== null && _reportStatusColors_r_status !== void 0 ? _reportStatusColors_r_status : 'bg-gray-100 text-gray-500'), children: r.status }), /*#__PURE__*/ _jsx("span", { className: "px-2 py-0.5 rounded-full text-xs font-medium ".concat((_reasonColors_r_reason = reasonColors[r.reason]) !== null && _reasonColors_r_reason !== void 0 ? _reasonColors_r_reason : 'bg-gray-100 text-gray-600'), children: r.reason }), /*#__PURE__*/ _jsxs("span", { className: "text-xs text-gray-400", children: [ r.targetType === 'task' ? t('admin.reports.target.task') : t('admin.reports.target.user'), ":", ' ', r.targetTitle ? /*#__PURE__*/ _jsx(Link, { href: r.targetType === 'task' ? "/tasks/".concat(r.targetId) : "/users/".concat(r.targetId), className: "text-green-600 hover:underline font-medium", target: "_blank", children: r.targetTitle }) : /*#__PURE__*/ _jsxs("span", { className: "font-mono", children: [ "#", (_r_targetId = r.targetId) === null || _r_targetId === void 0 ? void 0 : _r_targetId.slice(0, 8) ] }) ] }) ] }), r.reporterName && /*#__PURE__*/ _jsxs("p", { className: "text-xs text-gray-400 mb-1", children: [ t('admin.col.reporter'), ": ", /*#__PURE__*/ _jsx("span", { className: "font-medium text-gray-600", children: r.reporterName }) ] }), r.description && /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-700", children: r.description }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-1.5", children: new Date(r.createdAt).toLocaleString(dateLocale) }) ] }), r.status === 'pending' && /*#__PURE__*/ _jsxs("div", { className: "flex gap-2 flex-shrink-0", children: [ /*#__PURE__*/ _jsx("button", { onClick: ()=>handleReport(r.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: t('admin.reports.reviewed') }), /*#__PURE__*/ _jsx("button", { onClick: ()=>handleReport(r.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: t('admin.reports.dismiss') }) ] }) ] }) }, r.id); }), /*#__PURE__*/ _jsx(Pagination, { page: reportsPage, total: reportsTotal, limit: 20, onChange: setReportsPage, totalLabel: t('admin.pagination.total') }) ] }), tab === 'moderation' && /*#__PURE__*/ _jsxs("div", { className: "space-y-6", children: [ /*#__PURE__*/ _jsxs("div", { className: "grid md:grid-cols-2 gap-4", children: [ /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-5", children: [ /*#__PURE__*/ _jsx("div", { className: "text-sm text-gray-500", children: t('admin.moderation.pending_count', 'Pending') }), /*#__PURE__*/ _jsx("div", { className: "text-3xl font-bold text-gray-900 mt-1", children: pendingModerationCards.length }), /*#__PURE__*/ _jsx("div", { className: "text-xs text-gray-400 mt-1", children: t('admin.moderation.pending_hint', 'New proposals waiting for approval') }) ] }), /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-5", children: [ /*#__PURE__*/ _jsx("div", { className: "text-sm text-gray-500", children: t('admin.moderation.active_count', 'Active') }), /*#__PURE__*/ _jsx("div", { className: "text-3xl font-bold text-gray-900 mt-1", children: activeModerationCards.length }), /*#__PURE__*/ _jsx("div", { className: "text-xs text-gray-400 mt-1", children: t('admin.moderation.active_hint', 'Visible cards that can be blocked') }) ] }) ] }), moderationCardsLoading ? /*#__PURE__*/ _jsx("div", { className: "text-center py-10 text-gray-400", children: t('common.loading') }) : moderationCards.length === 0 ? /*#__PURE__*/ _jsx("div", { className: "text-center py-10 text-gray-400", children: t('admin.moderation.none', 'No specialist cards found') }) : /*#__PURE__*/ _jsxs("div", { className: "space-y-6", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-gray-800 mb-3", children: t('admin.moderation.pending_title', 'Pending approval') }), /*#__PURE__*/ _jsx("div", { className: "space-y-3", children: pendingModerationCards.length === 0 ? /*#__PURE__*/ _jsx("div", { className: "text-sm text-gray-400 bg-white border border-dashed border-gray-200 rounded-xl p-4", children: t('admin.moderation.pending_empty', 'No pending proposals right now') }) : pendingModerationCards.map((card)=>{ var _card_specialistName, _ref; return /*#__PURE__*/ _jsx("div", { className: "bg-white rounded-xl border border-gray-200 p-4", children: /*#__PURE__*/ _jsxs("div", { className: "flex flex-wrap items-start justify-between gap-3", children: [ /*#__PURE__*/ _jsxs("div", { className: "min-w-0 flex-1", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 flex-wrap mb-1", children: [ /*#__PURE__*/ _jsx("span", { className: "px-2 py-0.5 rounded-full text-xs font-medium bg-yellow-100 text-yellow-700", children: t('admin.moderation.pending', 'Pending') }), /*#__PURE__*/ _jsx("span", { className: "text-sm font-semibold text-gray-800 truncate", children: card.title }) ] }), /*#__PURE__*/ _jsx("div", { className: "text-xs text-gray-500 mb-2", children: /*#__PURE__*/ _jsx(Link, { href: "/users/".concat(card.specialistId), className: "hover:text-green-600 hover:underline font-medium", children: (_ref = (_card_specialistName = card.specialistName) !== null && _card_specialistName !== void 0 ? _card_specialistName : card.specialistEmail) !== null && _ref !== void 0 ? _ref : card.specialistId }) }), card.description && /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-700 line-clamp-3", children: card.description }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-2 flex-shrink-0", children: [ /*#__PURE__*/ _jsx("button", { onClick: ()=>updateModerationCard(card.id, 'active'), className: "px-3 py-1.5 rounded-lg text-xs font-medium bg-green-600 text-white hover:bg-green-700", children: t('admin.moderation.approve', 'Approve') }), /*#__PURE__*/ _jsx("button", { onClick: ()=>updateModerationCard(card.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: t('admin.moderation.block', 'Block') }) ] }) ] }) }, card.id); }) }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-gray-800 mb-3", children: t('admin.moderation.active_title', 'Active cards') }), /*#__PURE__*/ _jsx("div", { className: "space-y-3", children: activeModerationCards.length === 0 ? /*#__PURE__*/ _jsx("div", { className: "text-sm text-gray-400 bg-white border border-dashed border-gray-200 rounded-xl p-4", children: t('admin.moderation.active_empty', 'No active cards found') }) : activeModerationCards.map((card)=>{ var _card_specialistName, _ref; return /*#__PURE__*/ _jsx("div", { className: "bg-white rounded-xl border border-gray-200 p-4", children: /*#__PURE__*/ _jsxs("div", { className: "flex flex-wrap items-start justify-between gap-3", children: [ /*#__PURE__*/ _jsxs("div", { className: "min-w-0 flex-1", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 flex-wrap mb-1", children: [ /*#__PURE__*/ _jsx("span", { className: "px-2 py-0.5 rounded-full text-xs font-medium bg-green-100 text-green-700", children: t('admin.moderation.active', 'Active') }), /*#__PURE__*/ _jsx("span", { className: "text-sm font-semibold text-gray-800 truncate", children: card.title }) ] }), /*#__PURE__*/ _jsx("div", { className: "text-xs text-gray-500 mb-2", children: /*#__PURE__*/ _jsx(Link, { href: "/users/".concat(card.specialistId), className: "hover:text-green-600 hover:underline font-medium", children: (_ref = (_card_specialistName = card.specialistName) !== null && _card_specialistName !== void 0 ? _card_specialistName : card.specialistEmail) !== null && _ref !== void 0 ? _ref : card.specialistId }) }), card.description && /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-700 line-clamp-3", children: card.description }) ] }), /*#__PURE__*/ _jsx("button", { onClick: ()=>updateModerationCard(card.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: t('admin.moderation.block', 'Block') }) ] }) }, card.id); }) }) ] }), /*#__PURE__*/ _jsx(Pagination, { page: moderationCardsPage, total: moderationCardsTotal, limit: 20, onChange: setModerationCardsPage, totalLabel: t('admin.pagination.total') }) ] }) ] }), tab === 'logs' && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("div", { className: "flex gap-1 bg-gray-100 rounded-xl p-1 mb-5 w-fit", children: [ { key: 'ai', label: t('admin.logs.subtab.ai') }, { key: 'activity', label: t('admin.logs.subtab.activity') }, { key: 'mail', label: t('admin.logs.subtab.mail') }, { key: 'notifications', label: t('admin.logs.subtab.notifications') } ].map((param)=>{ let { key, label } = param; return /*#__PURE__*/ _jsx("button", { onClick: ()=>setLogsSubTab(key), className: "px-4 py-1.5 rounded-lg text-sm font-medium transition-colors ".concat(logsSubTab === key ? 'bg-white text-gray-900 shadow-sm' : 'text-gray-500 hover:text-gray-700'), children: label }, key); }) }), logsSubTab === 'ai' && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("div", { className: "flex justify-between items-center mb-4", children: [ /*#__PURE__*/ _jsxs("p", { className: "text-sm text-gray-500", children: [ t('admin.pagination.total'), ": ", logsTotal ] }), /*#__PURE__*/ _jsxs("button", { onClick: ()=>{ setLogsPage(1); api.getAdminAiLogs(1).then((d)=>{ setLogs(d.data); setLogsTotal(d.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: [ /*#__PURE__*/ _jsxs("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ _jsx("polyline", { points: "23 4 23 10 17 10" }), /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M20.49 15a9 9 0 11-2.12-9.36L23 10" }) ] }), t('common.refresh') ] }) ] }), loading ? /*#__PURE__*/ _jsx("div", { className: "text-center py-10 text-gray-400", children: t('common.loading') }) : logs.length === 0 ? /*#__PURE__*/ _jsx("div", { className: "text-center py-10 text-gray-400", children: t('admin.logs.empty') }) : /*#__PURE__*/ _jsx("div", { className: "overflow-x-auto rounded-xl border border-gray-200", children: /*#__PURE__*/ _jsxs("table", { className: "w-full text-sm", children: [ /*#__PURE__*/ _jsx("thead", { className: "bg-gray-50 text-gray-500 text-xs uppercase", children: /*#__PURE__*/ _jsxs("tr", { children: [ /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 text-left", children: t('admin.logs.date') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 text-left", children: t('admin.logs.provider') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 text-left", children: t('admin.logs.model') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 text-left", children: t('admin.logs.action') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 text-left", children: t('admin.logs.langs') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 text-right", children: t('admin.logs.in') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 text-right", children: t('admin.logs.out') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 text-right", children: t('admin.logs.total') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 text-right", children: t('admin.logs.ms') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 text-center", children: t('admin.logs.status') }) ] }) }), /*#__PURE__*/ _jsx("tbody", { className: "divide-y divide-gray-100", children: logs.map((log)=>{ var _log_inputTokens, _log_outputTokens, _log_totalTokens, _log_durationMs, _log_error; return /*#__PURE__*/ _jsxs("tr", { className: "bg-white hover:bg-gray-50", children: [ /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-gray-500 whitespace-nowrap", children: new Date(log.createdAt).toLocaleString(dateLocale) }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3", children: /*#__PURE__*/ _jsx("span", { className: "px-2 py-0.5 rounded-full text-xs font-medium ".concat(log.provider === 'anthropic' ? 'bg-purple-100 text-purple-700' : 'bg-green-100 text-green-700'), children: log.provider }) }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-gray-600 font-mono text-xs", children: log.model }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-gray-600", children: log.action }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-gray-500", children: log.fromLocale && log.toLocale ? "".concat(log.fromLocale, " → ").concat(log.toLocale) : '—' }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-right text-gray-600", children: (_log_inputTokens = log.inputTokens) !== null && _log_inputTokens !== void 0 ? _log_inputTokens : '—' }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-right text-gray-600", children: (_log_outputTokens = log.outputTokens) !== null && _log_outputTokens !== void 0 ? _log_outputTokens : '—' }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-right font-medium", children: (_log_totalTokens = log.totalTokens) !== null && _log_totalTokens !== void 0 ? _log_totalTokens : '—' }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-right text-gray-500", children: (_log_durationMs = log.durationMs) !== null && _log_durationMs !== void 0 ? _log_durationMs : '—' }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-center", children: log.success ? /*#__PURE__*/ _jsx("span", { className: "text-green-600 flex justify-center", children: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("polyline", { points: "20 6 9 17 4 12" }) }) }) : /*#__PURE__*/ _jsx("span", { className: "text-red-500 flex justify-center", title: (_log_error = log.error) !== null && _log_error !== void 0 ? _log_error : '', children: /*#__PURE__*/ _jsxs("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: [ /*#__PURE__*/ _jsx("line", { x1: "18", y1: "6", x2: "6", y2: "18" }), /*#__PURE__*/ _jsx("line", { x1: "6", y1: "6", x2: "18", y2: "18" }) ] }) }) }) ] }, log.id); }) }) ] }) }), /*#__PURE__*/ _jsx(Pagination, { page: logsPage, total: logsTotal, limit: 50, onChange: setLogsPage, totalLabel: t('admin.pagination.total') }) ] }), logsSubTab === 'activity' && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-4 mb-4 flex flex-wrap gap-3 items-end", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-500 mb-1", children: t('admin.activity.event') }), /*#__PURE__*/ _jsxs("select", { value: activityEvent, onChange: (e)=>setActivityEvent(e.target.value), className: "border border-gray-300 rounded-lg px-3 py-1.5 text-sm min-w-[180px]", children: [ /*#__PURE__*/ _jsx("option", { value: "", children: t('admin.activity.all_events') }), activityEventTypes.map((ev)=>/*#__PURE__*/ _jsx("option", { value: ev, children: ev }, ev)) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-500 mb-1", children: t('admin.activity.from') }), /*#__PURE__*/ _jsx("input", { type: "date", value: activityDateFrom, onChange: (e)=>setActivityDateFrom(e.target.value), className: "border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-500 mb-1", children: t('admin.activity.to') }), /*#__PURE__*/ _jsx("input", { type: "date", value: activityDateTo, onChange: (e)=>setActivityDateTo(e.target.value), className: "border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), (activityEvent || activityDateFrom || activityDateTo || activityUserId) && /*#__PURE__*/ _jsxs("button", { onClick: ()=>{ setActivityEvent(''); setActivityDateFrom(''); setActivityDateTo(''); setActivityUserId(''); }, 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: [ /*#__PURE__*/ _jsxs("svg", { className: "w-3 h-3", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: [ /*#__PURE__*/ _jsx("line", { x1: "18", y1: "6", x2: "6", y2: "18" }), /*#__PURE__*/ _jsx("line", { x1: "6", y1: "6", x2: "18", y2: "18" }) ] }), t('admin.activity.reset') ] }), /*#__PURE__*/ _jsxs("p", { className: "text-xs text-gray-400 self-end ml-auto", children: [ t('admin.activity.total'), ": ", activityTotal ] }) ] }), activityLog.length === 0 ? /*#__PURE__*/ _jsx("div", { className: "text-center py-10 text-gray-400", children: t('admin.activity.empty') }) : /*#__PURE__*/ _jsx("div", { className: "space-y-2", children: activityLog.map((entry)=>/*#__PURE__*/ _jsx(ActivityLogRow, { entry: entry, dateLocale: dateLocale, onFilterUser: (id)=>{ setActivityUserId(id); setActivityEvent(''); }, t: t }, entry.id)) }), /*#__PURE__*/ _jsx(Pagination, { page: activityPage, total: activityTotal, limit: 50, onChange: setActivityPage, totalLabel: t('admin.pagination.total') }) ] }), logsSubTab === 'mail' && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-4 mb-4 flex flex-wrap gap-3 items-end", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-500 mb-1", children: t('admin.mail.event') }), /*#__PURE__*/ _jsxs("select", { value: mailEvent, onChange: (e)=>setMailEvent(e.target.value), className: "border border-gray-300 rounded-lg px-3 py-1.5 text-sm min-w-[200px]", children: [ /*#__PURE__*/ _jsx("option", { value: "", children: t('admin.mail.all_events') }), mailEventTypes.map((ev)=>/*#__PURE__*/ _jsx("option", { value: ev, children: t("admin.event.".concat(ev.replace(/\./g, '_')), ev) }, ev)) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-500 mb-1", children: t('admin.mail.from') }), /*#__PURE__*/ _jsx("input", { type: "date", value: mailDateFrom, onChange: (e)=>setMailDateFrom(e.target.value), className: "border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-500 mb-1", children: t('admin.mail.to') }), /*#__PURE__*/ _jsx("input", { type: "date", value: mailDateTo, onChange: (e)=>setMailDateTo(e.target.value), className: "border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), (mailEvent || mailDateFrom || mailDateTo) && /*#__PURE__*/ _jsxs("button", { onClick: ()=>{ setMailEvent(''); setMailDateFrom(''); setMailDateTo(''); }, 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: [ /*#__PURE__*/ _jsxs("svg", { className: "w-3 h-3", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: [ /*#__PURE__*/ _jsx("line", { x1: "18", y1: "6", x2: "6", y2: "18" }), /*#__PURE__*/ _jsx("line", { x1: "6", y1: "6", x2: "18", y2: "18" }) ] }), t('admin.mail.reset') ] }), /*#__PURE__*/ _jsxs("p", { className: "text-xs text-gray-400 self-end ml-auto", children: [ t('admin.mail.total'), ": ", mailTotal ] }) ] }), mailLog.length === 0 ? /*#__PURE__*/ _jsx("div", { className: "text-center py-10 text-gray-400", children: t('admin.mail.empty') }) : /*#__PURE__*/ _jsx("div", { className: "overflow-x-auto rounded-xl border border-gray-200", children: /*#__PURE__*/ _jsxs("table", { className: "w-full text-sm", children: [ /*#__PURE__*/ _jsx("thead", { className: "bg-gray-50 text-gray-500 text-xs uppercase", children: /*#__PURE__*/ _jsxs("tr", { children: [ /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 text-left", children: t('admin.logs.date') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 text-left", children: t('admin.mail.recipient') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 text-left", children: t('admin.mail.event') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 text-left", children: t('admin.mail.provider') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 text-left", children: t('admin.mail.details') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 text-center", children: t('admin.mail.status') }) ] }) }), /*#__PURE__*/ _jsx("tbody", { className: "divide-y divide-gray-100", children: mailLog.map((entry)=>{ const details = parseLogDetails(entry.details); const provider = typeof (details === null || details === void 0 ? void 0 : details.provider) === 'string' ? details.provider : '—'; const recipient = typeof (details === null || details === void 0 ? void 0 : details.to) === 'string' ? details.to : entry.userEmail || '—'; const subject = typeof (details === null || details === void 0 ? void 0 : details.subject) === 'string' ? details.subject : ''; const error = typeof (details === null || details === void 0 ? void 0 : details.error) === 'string' ? details.error : ''; const success = entry.event === 'email.sent' || entry.event === 'admin.email.test.sent'; return /*#__PURE__*/ _jsxs("tr", { className: "bg-white hover:bg-gray-50 align-top", children: [ /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-gray-500 whitespace-nowrap", children: new Date(entry.createdAt).toLocaleString(dateLocale) }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-gray-700", children: recipient }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3", children: /*#__PURE__*/ _jsx("span", { className: "px-2 py-0.5 rounded-full text-xs font-medium bg-sky-50 text-sky-700", children: t("admin.event.".concat(entry.event.replace(/\./g, '_')), entry.event) }) }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-gray-600", children: provider }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-gray-600 max-w-md", children: /*#__PURE__*/ _jsx("div", { className: "truncate", title: subject || error || undefined, children: subject || error || '—' }) }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-center", children: success ? /*#__PURE__*/ _jsx("span", { className: "text-green-600 inline-flex justify-center", title: t('admin.mail.success'), children: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("polyline", { points: "20 6 9 17 4 12" }) }) }) : /*#__PURE__*/ _jsx("span", { className: "text-red-500 inline-flex justify-center", title: error || t('admin.mail.failed'), children: /*#__PURE__*/ _jsxs("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: [ /*#__PURE__*/ _jsx("line", { x1: "18", y1: "6", x2: "6", y2: "18" }), /*#__PURE__*/ _jsx("line", { x1: "6", y1: "6", x2: "18", y2: "18" }) ] }) }) }) ] }, entry.id); }) }) ] }) }), /*#__PURE__*/ _jsx(Pagination, { page: mailPage, total: mailTotal, limit: 50, onChange: setMailPage, totalLabel: t('admin.pagination.total') }) ] }), logsSubTab === 'notifications' && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-4 mb-4 flex flex-wrap gap-3 items-end", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-500 mb-1", children: t('admin.notif_logs.type') }), /*#__PURE__*/ _jsxs("select", { value: notifLogsType, onChange: (e)=>setNotifLogsType(e.target.value), className: "border border-gray-300 rounded-lg px-3 py-1.5 text-sm min-w-[200px]", children: [ /*#__PURE__*/ _jsx("option", { value: "", children: t('admin.filter.all') }), notifLogsTypes.map((tp)=>/*#__PURE__*/ _jsx("option", { value: tp, children: tp }, tp)) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-500 mb-1", children: t('admin.activity.from') }), /*#__PURE__*/ _jsx("input", { type: "date", value: notifLogsDateFrom, onChange: (e)=>setNotifLogsDateFrom(e.target.value), className: "border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-500 mb-1", children: t('admin.activity.to') }), /*#__PURE__*/ _jsx("input", { type: "date", value: notifLogsDateTo, onChange: (e)=>setNotifLogsDateTo(e.target.value), className: "border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), (notifLogsType || notifLogsDateFrom || notifLogsDateTo) && /*#__PURE__*/ _jsxs("button", { onClick: ()=>{ setNotifLogsType(''); setNotifLogsDateFrom(''); setNotifLogsDateTo(''); }, 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: [ /*#__PURE__*/ _jsxs("svg", { className: "w-3 h-3", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: [ /*#__PURE__*/ _jsx("line", { x1: "18", y1: "6", x2: "6", y2: "18" }), /*#__PURE__*/ _jsx("line", { x1: "6", y1: "6", x2: "18", y2: "18" }) ] }), t('admin.activity.reset') ] }), /*#__PURE__*/ _jsxs("p", { className: "text-xs text-gray-400 self-end ml-auto", children: [ t('admin.pagination.total'), ": ", notifLogsTotal ] }) ] }), notifLogs.length === 0 ? /*#__PURE__*/ _jsx("div", { className: "text-center py-10 text-gray-400", children: t('admin.notif_logs.empty') }) : /*#__PURE__*/ _jsx("div", { className: "overflow-x-auto rounded-xl border border-gray-200", children: /*#__PURE__*/ _jsxs("table", { className: "w-full text-sm", children: [ /*#__PURE__*/ _jsx("thead", { className: "bg-gray-50 text-gray-500 text-xs uppercase", children: /*#__PURE__*/ _jsxs("tr", { children: [ /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 text-left", children: t('admin.logs.date') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 text-left", children: t('admin.col.user') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 text-left", children: t('admin.notif_logs.type') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 text-left", children: t('admin.notif_logs.title') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 text-center", children: t('admin.notif_logs.read') }) ] }) }), /*#__PURE__*/ _jsx("tbody", { className: "divide-y divide-gray-100", children: notifLogs.map((n)=>{ var _n_recipientName, _ref; return /*#__PURE__*/ _jsxs("tr", { className: "bg-white hover:bg-gray-50", children: [ /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-gray-500 whitespace-nowrap", children: new Date(n.createdAt).toLocaleString(dateLocale) }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-gray-700", children: (_ref = (_n_recipientName = n.recipientName) !== null && _n_recipientName !== void 0 ? _n_recipientName : n.recipientEmail) !== null && _ref !== void 0 ? _ref : n.recipientId }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3", children: /*#__PURE__*/ _jsx("span", { className: "px-2 py-0.5 rounded-full text-xs font-medium bg-green-50 text-green-700", children: n.type }) }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-gray-600 max-w-xs truncate", children: n.title }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-center", children: n.isRead ? /*#__PURE__*/ _jsx("span", { className: "text-green-600 flex justify-center", children: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("polyline", { points: "20 6 9 17 4 12" }) }) }) : /*#__PURE__*/ _jsx("span", { className: "text-gray-400 flex justify-center", children: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("circle", { cx: "12", cy: "12", r: "10" }) }) }) }) ] }, n.id); }) }) ] }) }), /*#__PURE__*/ _jsx(Pagination, { page: notifLogsPage, total: notifLogsTotal, limit: 50, onChange: setNotifLogsPage, totalLabel: t('admin.pagination.total') }) ] }) ] }), tab === 'plans' && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between mb-4", children: [ /*#__PURE__*/ _jsxs("h2", { className: "text-lg font-semibold text-gray-800 flex items-center gap-2", children: [ /*#__PURE__*/ _jsxs("svg", { className: "w-5 h-5 text-green-600", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: [ /*#__PURE__*/ _jsx("rect", { x: "1", y: "4", width: "22", height: "16", rx: "2", ry: "2" }), /*#__PURE__*/ _jsx("line", { x1: "1", y1: "10", x2: "23", y2: "10" }) ] }), t('admin.plans.title') ] }), /*#__PURE__*/ _jsx("button", { onClick: openAddPlan, className: "bg-green-600 text-white text-sm px-4 py-2 rounded-lg hover:bg-green-700 font-medium", children: t('admin.plans.add') }) ] }), planForm && /*#__PURE__*/ _jsxs("div", { className: "bg-white border border-gray-200 rounded-xl p-5 mb-4 space-y-3", children: [ /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-gray-800", children: planForm.id ? t('admin.plans.form.edit') : t('admin.plans.form.new') }), /*#__PURE__*/ _jsxs("div", { className: "grid grid-cols-2 gap-3", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.name') }), /*#__PURE__*/ _jsx("input", { value: planForm.name, onChange: (e)=>setPlanForm({ ...planForm, name: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.price') }), /*#__PURE__*/ _jsx("input", { type: "number", min: "0", step: "0.01", value: planForm.price, onChange: (e)=>setPlanForm({ ...planForm, price: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.old_price') }), /*#__PURE__*/ _jsx("input", { type: "number", min: "0", step: "0.01", value: (_planForm_oldPrice = planForm.oldPrice) !== null && _planForm_oldPrice !== void 0 ? _planForm_oldPrice : '', onChange: (e)=>setPlanForm({ ...planForm, oldPrice: e.target.value }), placeholder: "—", className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.tier') }), /*#__PURE__*/ _jsxs("select", { value: planForm.tier, onChange: (e)=>setPlanForm({ ...planForm, tier: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400", children: [ /*#__PURE__*/ _jsx("option", { value: "free", children: t('admin.plans.form.tier.free') }), /*#__PURE__*/ _jsx("option", { value: "pro", children: t('admin.plans.form.tier.pro') }), /*#__PURE__*/ _jsx("option", { value: "ultimate", children: t('admin.plans.form.tier.ultimate') }) ] }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.description') }), /*#__PURE__*/ _jsx("input", { value: planForm.description, onChange: (e)=>setPlanForm({ ...planForm, description: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ _jsx("p", { className: "text-xs font-semibold text-gray-500 uppercase tracking-wide pt-1", children: t('admin.plans.form.section.limits') }), /*#__PURE__*/ _jsxs("div", { className: "grid grid-cols-3 gap-3", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.max_tasks') }), /*#__PURE__*/ _jsx("input", { type: "number", min: "0", placeholder: "∞", value: planForm.maxTasks, onChange: (e)=>setPlanForm({ ...planForm, maxTasks: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.max_offers') }), /*#__PURE__*/ _jsx("input", { type: "number", min: "0", placeholder: "∞", value: planForm.maxOffers, onChange: (e)=>setPlanForm({ ...planForm, maxOffers: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.max_cards') }), /*#__PURE__*/ _jsx("input", { type: "number", min: "0", placeholder: "∞", value: planForm.maxCards, onChange: (e)=>setPlanForm({ ...planForm, maxCards: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.max_messages_day') }), /*#__PURE__*/ _jsx("input", { type: "number", min: "0", placeholder: "∞", value: planForm.maxMessagesPerDay, onChange: (e)=>setPlanForm({ ...planForm, maxMessagesPerDay: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.max_orders_day') }), /*#__PURE__*/ _jsx("input", { type: "number", min: "0", placeholder: "∞", value: planForm.maxOrdersPerDay, onChange: (e)=>setPlanForm({ ...planForm, maxOrdersPerDay: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.max_skills') }), /*#__PURE__*/ _jsx("input", { type: "number", min: "0", placeholder: "∞", value: planForm.maxSkills, onChange: (e)=>setPlanForm({ ...planForm, maxSkills: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.duration_days') }), /*#__PURE__*/ _jsx("input", { type: "number", min: "0", placeholder: "∞", value: planForm.durationDays, onChange: (e)=>setPlanForm({ ...planForm, durationDays: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }) ] }), /*#__PURE__*/ _jsx("p", { className: "text-xs font-semibold text-gray-500 uppercase tracking-wide pt-1", children: t('admin.plans.form.section.boost') }), /*#__PURE__*/ _jsxs("div", { className: "grid grid-cols-2 gap-3", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.search_boost') }), /*#__PURE__*/ _jsx("input", { type: "number", min: "0", value: planForm.searchBoost, onChange: (e)=>setPlanForm({ ...planForm, searchBoost: Number(e.target.value) }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.offers_multiplier') }), /*#__PURE__*/ _jsx("input", { type: "number", min: "0", step: "0.01", value: planForm.offersMultiplier, onChange: (e)=>setPlanForm({ ...planForm, offersMultiplier: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.features') }), /*#__PURE__*/ _jsx("textarea", { rows: 3, value: planForm.features, onChange: (e)=>setPlanForm({ ...planForm, features: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 resize-none" }) ] }), /*#__PURE__*/ _jsx("p", { className: "text-xs font-semibold text-gray-500 uppercase tracking-wide pt-1", children: t('admin.plans.form.section.contact') }), /*#__PURE__*/ _jsx("div", { className: "grid grid-cols-2 gap-2", children: [ [ 'canContactFreePlan', t('admin.plans.form.can_contact_free') ], [ 'canContactProPlan', t('admin.plans.form.can_contact_pro') ], [ 'canContactAll', t('admin.plans.form.can_contact_all') ], [ 'canShowContactInfo', t('admin.plans.form.can_show_contact') ], [ 'canViewPhone', t('admin.plans.form.can_view_phone') ] ].map((param)=>{ let [key, label] = param; return /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-2 cursor-pointer text-sm text-gray-700", children: [ /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: planForm[key], onChange: (e)=>setPlanForm({ ...planForm, [key]: e.target.checked }), className: "w-4 h-4 rounded text-green-600" }), label ] }, key); }) }), /*#__PURE__*/ _jsx("p", { className: "text-xs font-semibold text-gray-500 uppercase tracking-wide pt-1", children: t('admin.plans.form.section.features') }), /*#__PURE__*/ _jsx("div", { className: "grid grid-cols-2 gap-2", children: [ [ 'notifyNewTasks', t('admin.plans.form.notify') ], [ 'canUploadVideo', t('admin.plans.form.upload_video') ], [ 'hasFavorites', t('admin.plans.form.favorites') ], [ 'hasGoogleCalendar', t('admin.plans.form.google_calendar') ], [ 'hasVerifiedBadge', t('admin.plans.form.verified_badge') ], [ 'highlightedReviews', t('admin.plans.form.highlighted_reviews') ], [ 'hasPersonalSite', t('admin.plans.form.personal_site') ], [ 'hasCanHelpNowStatus', t('admin.plans.form.can_help_now') ], [ 'hasNeedHelpStatus', t('admin.plans.form.need_help') ], [ 'hasAutoResponse', t('admin.plans.form.auto_response') ], [ 'hasAutoMatch', t('admin.plans.form.auto_match') ], [ 'hasPriceList', t('admin.plans.form.price_list') ], [ 'receiveInstantDispatchFree', t('admin.plans.form.instant_dispatch_free') ], [ 'receiveInstantDispatchPro', t('admin.plans.form.instant_dispatch_pro') ] ].map((param)=>{ let [key, label] = param; return /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-2 cursor-pointer text-sm text-gray-700", children: [ /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: planForm[key], onChange: (e)=>setPlanForm({ ...planForm, [key]: e.target.checked }), className: "w-4 h-4 rounded text-green-600" }), label ] }, key); }) }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-6 pt-1", children: [ /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-2 cursor-pointer text-sm text-gray-700", children: [ /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: planForm.isDefault, onChange: (e)=>setPlanForm({ ...planForm, isDefault: e.target.checked }), className: "w-4 h-4 rounded text-green-600" }), t('admin.plans.form.default') ] }), /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-2 cursor-pointer text-sm text-gray-700", children: [ /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: planForm.isActive, onChange: (e)=>setPlanForm({ ...planForm, isActive: e.target.checked }), className: "w-4 h-4 rounded text-green-600" }), t('admin.plans.form.active') ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2", children: [ /*#__PURE__*/ _jsx("label", { className: "text-xs text-gray-600", children: t('admin.plans.form.order') }), /*#__PURE__*/ _jsx("input", { type: "number", value: planForm.order, onChange: (e)=>setPlanForm({ ...planForm, order: Number(e.target.value) }), className: "w-16 border border-gray-300 rounded-lg px-2 py-1 text-sm focus:outline-none" }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-2 pt-1", children: [ /*#__PURE__*/ _jsx("button", { onClick: savePlan, disabled: planSaving || !planForm.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: planSaving ? '...' : t('common.save') }), /*#__PURE__*/ _jsx("button", { onClick: ()=>setPlanForm(null), className: "px-4 py-2 rounded-lg text-sm font-medium text-gray-600 hover:bg-gray-100", children: t('common.cancel') }) ] }) ] }), /*#__PURE__*/ _jsx("div", { className: "bg-white rounded-xl border border-gray-200 overflow-hidden", children: planRows.length === 0 ? /*#__PURE__*/ _jsx("div", { className: "px-4 py-8 text-center text-gray-400 text-sm", children: t('admin.plans.empty') }) : /*#__PURE__*/ _jsx("div", { className: "divide-y divide-gray-100", children: planRows.sort((a, b)=>{ var _a_order, _b_order; return ((_a_order = a.order) !== null && _a_order !== void 0 ? _a_order : 0) - ((_b_order = b.order) !== null && _b_order !== void 0 ? _b_order : 0); }).map((plan)=>{ var _plan_features; return /*#__PURE__*/ _jsxs("div", { className: "flex items-start gap-4 px-4 py-4 ".concat(!plan.isActive ? 'opacity-50' : ''), children: [ /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 flex-wrap", children: [ /*#__PURE__*/ _jsx("span", { className: "font-semibold text-gray-900", children: plan.name }), plan.isDefault && /*#__PURE__*/ _jsx("span", { className: "bg-green-100 text-green-700 text-xs px-2 py-0.5 rounded-full font-medium", children: t('admin.plans.badge.default') }), !plan.isActive && /*#__PURE__*/ _jsx("span", { className: "bg-gray-100 text-gray-500 text-xs px-2 py-0.5 rounded-full", children: t('admin.plans.badge.inactive') }) ] }), plan.description && /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-500 mt-0.5", children: plan.description }), /*#__PURE__*/ _jsxs("div", { className: "flex flex-wrap gap-3 mt-1 text-xs text-gray-500", children: [ /*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-1.5 font-semibold text-gray-800", children: [ plan.oldPrice && /*#__PURE__*/ _jsxs("span", { className: "font-normal text-gray-400 line-through", children: [ plan.oldPrice, " ", plan.currency ] }), /*#__PURE__*/ _jsxs("span", { children: [ plan.price, " ", plan.currency ] }) ] }), plan.maxTasks != null && /*#__PURE__*/ _jsxs("span", { children: [ t('admin.plans.tasks'), ": ", plan.maxTasks ] }), plan.maxOffers != null && /*#__PURE__*/ _jsxs("span", { children: [ t('admin.plans.offers'), ": ", plan.maxOffers ] }), plan.maxCards != null && /*#__PURE__*/ _jsxs("span", { children: [ t('admin.plans.cards'), ": ", plan.maxCards ] }), plan.notifyNewTasks && /*#__PURE__*/ _jsxs("span", { className: "text-green-700 flex items-center gap-1", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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" }) }), t('admin.plans.notify_tasks') ] }) ] }), ((_plan_features = plan.features) !== null && _plan_features !== void 0 ? _plan_features : []).length > 0 && /*#__PURE__*/ _jsx("ul", { className: "mt-1.5 space-y-0.5", children: plan.features.map((f, i)=>/*#__PURE__*/ _jsxs("li", { className: "text-xs text-gray-600 flex items-center gap-1.5", children: [ /*#__PURE__*/ _jsx("span", { className: "text-green-500", children: /*#__PURE__*/ _jsx("svg", { className: "w-3 h-3", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("polyline", { points: "20 6 9 17 4 12" }) }) }), " ", f ] }, i)) }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-1 shrink-0", children: [ !plan.isDefault && /*#__PURE__*/ _jsx("button", { onClick: ()=>api.updatePlan(plan.id, { isDefault: true }).then(()=>api.getAdminPlans().then(setPlanRows)).catch(()=>{}), className: "text-xs px-2 py-1 rounded-lg bg-green-50 text-green-600 hover:bg-green-100 font-medium", title: t('admin.plans.make_default'), children: /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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" }) }) }), /*#__PURE__*/ _jsx("button", { onClick: ()=>openEditPlan(plan), className: "text-xs px-2 py-1 rounded-lg bg-gray-100 text-gray-600 hover:bg-gray-200 font-medium", children: t('common.edit') }), /*#__PURE__*/ _jsx("button", { onClick: ()=>deletePlan(plan.id, plan.name), className: "text-xs px-2 py-1 rounded-lg bg-red-50 text-red-600 hover:bg-red-100 font-medium", children: t('common.delete') }) ] }) ] }, plan.id); }) }) }) ] }), tab === 'settings' && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _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((st)=>{ const labels = { general: t('admin.settings.tab.general'), smtp: t('admin.settings.tab.smtp'), notifications: t('admin.settings.tab.notifications'), payment: t('admin.settings.tab.payment'), referral: t('admin.settings.tab.referral'), seo: t('admin.settings.tab.seo'), socials: t('admin.settings.tab.socials'), telegram: t('admin.settings.tab.telegram') }; return /*#__PURE__*/ _jsx("button", { onClick: ()=>setSettingsTab(st), className: "px-4 py-2 rounded-lg text-sm font-medium transition ".concat(settingsTab === st ? 'bg-green-600 text-white shadow-sm' : 'text-gray-600 hover:bg-gray-100'), children: labels[st] }, st); }) }), settingsTab === 'general' && /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6 max-w-lg", children: [ /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-gray-800 mb-5", children: t('admin.settings.general.title') }), /*#__PURE__*/ _jsxs("div", { className: "space-y-4", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.general.site_name') }), /*#__PURE__*/ _jsx("input", { value: generalForm.siteName, onChange: (e)=>setGeneralForm((f)=>({ ...f, siteName: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400", placeholder: "CanHelp" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.general.site_url') }), /*#__PURE__*/ _jsx("input", { value: generalForm.siteUrl, onChange: (e)=>setGeneralForm((f)=>({ ...f, siteUrl: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400", placeholder: "https://canhelp.com" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.general.contact_email') }), /*#__PURE__*/ _jsx("input", { type: "email", value: generalForm.contactEmail, onChange: (e)=>setGeneralForm((f)=>({ ...f, contactEmail: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400", placeholder: "contact@canhelp.com" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.general.support_phone') }), /*#__PURE__*/ _jsx("input", { value: generalForm.supportPhone, onChange: (e)=>setGeneralForm((f)=>({ ...f, supportPhone: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400", placeholder: "+30 21 000 0000" }) ] }), /*#__PURE__*/ _jsx("button", { onClick: saveGeneralSettings, disabled: generalSaving, 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: generalSaving ? t('admin.settings.saving') : generalSaved ? t('admin.settings.saved') : t('common.save') }) ] }) ] }), settingsTab === 'smtp' && /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6 max-w-lg", children: [ /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-gray-800 mb-1", children: t('admin.settings.smtp.title') }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-400 mb-5", children: t('admin.settings.smtp.hint') }), /*#__PURE__*/ _jsxs("div", { className: "space-y-4", children: [ /*#__PURE__*/ _jsxs("div", { className: "grid grid-cols-3 gap-3", children: [ /*#__PURE__*/ _jsxs("div", { className: "col-span-2", children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.smtp.host') }), /*#__PURE__*/ _jsx("input", { value: smtpForm.host, onChange: (e)=>setSmtpForm((f)=>({ ...f, host: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400", placeholder: "smtp.gmail.com" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.smtp.port') }), /*#__PURE__*/ _jsx("input", { value: smtpForm.port, onChange: (e)=>setSmtpForm((f)=>({ ...f, port: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400", placeholder: "587" }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.smtp.encryption') }), /*#__PURE__*/ _jsxs("select", { value: smtpForm.encryption, onChange: (e)=>setSmtpForm((f)=>({ ...f, encryption: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400", children: [ /*#__PURE__*/ _jsx("option", { value: "none", children: t('admin.settings.smtp.enc.none') }), /*#__PURE__*/ _jsx("option", { value: "tls", children: "STARTTLS (587)" }), /*#__PURE__*/ _jsx("option", { value: "ssl", children: "SSL/TLS (465)" }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.smtp.username') }), /*#__PURE__*/ _jsx("input", { value: smtpForm.username, onChange: (e)=>setSmtpForm((f)=>({ ...f, username: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400", placeholder: "user@gmail.com", autoComplete: "off" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.smtp.password') }), /*#__PURE__*/ _jsx("input", { type: "password", value: smtpForm.password, onChange: (e)=>setSmtpForm((f)=>({ ...f, password: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400", autoComplete: "new-password", placeholder: "••••••••••••" }) ] }), /*#__PURE__*/ _jsxs("div", { className: "grid grid-cols-2 gap-3", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.smtp.from_name') }), /*#__PURE__*/ _jsx("input", { value: smtpForm.fromName, onChange: (e)=>setSmtpForm((f)=>({ ...f, fromName: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400", placeholder: "CanHelp" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.smtp.from_email') }), /*#__PURE__*/ _jsx("input", { type: "email", value: smtpForm.fromEmail, onChange: (e)=>setSmtpForm((f)=>({ ...f, fromEmail: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400", placeholder: "noreply@canhelp.com" }) ] }) ] }), /*#__PURE__*/ _jsx("button", { onClick: saveSmtpSettings, disabled: smtpSaving, 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: smtpSaving ? t('admin.settings.saving') : smtpSaved ? t('admin.settings.saved') : t('common.save') }), /*#__PURE__*/ _jsx("button", { onClick: async ()=>{ setTestEmailSending(true); setTestEmailResult(null); try { const res = await api.sendTestEmail(); setTestEmailResult("✓ Sent to ".concat(res.to)); } catch (e) { setTestEmailResult("✗ Error: ".concat(e.message)); } finally{ setTestEmailSending(false); setTimeout(()=>setTestEmailResult(null), 5000); } }, disabled: testEmailSending, 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: testEmailSending ? t('admin.settings.smtp.sending') : /*#__PURE__*/ _jsxs("span", { className: "flex items-center justify-center gap-2", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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" }) }), t('admin.settings.smtp.test') ] }) }), testEmailResult && /*#__PURE__*/ _jsx("p", { className: "text-sm text-center font-medium ".concat(testEmailResult.startsWith('✓') ? 'text-green-600' : 'text-red-500'), children: testEmailResult }) ] }) ] }), settingsTab === 'payment' && /*#__PURE__*/ _jsxs("div", { className: "space-y-6 max-w-lg", children: [ /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between mb-5", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3", children: [ /*#__PURE__*/ _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" }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-gray-800", children: "ePay — Piraeus Bank" }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400", children: "ГреческОй платёжМый шлюз" }) ] }) ] }), /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-2 cursor-pointer", children: [ /*#__PURE__*/ _jsx("span", { className: "text-sm text-gray-500", children: t('admin.settings.active') }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setEPayForm((f)=>({ ...f, enabled: !f.enabled })), className: "relative w-10 h-6 rounded-full p-0 transition-colors cursor-pointer ".concat(ePayForm.enabled ? 'bg-green-600' : 'bg-gray-300'), children: /*#__PURE__*/ _jsx("span", { className: "absolute left-0 top-1 w-4 h-4 bg-white rounded-full shadow transition-transform ".concat(ePayForm.enabled ? 'translate-x-5' : 'translate-x-1') }) }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "space-y-4", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.env.label') }), /*#__PURE__*/ _jsxs("select", { value: ePayForm.environment, onChange: (e)=>setEPayForm((f)=>({ ...f, environment: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm", children: [ /*#__PURE__*/ _jsx("option", { value: "test", children: t('admin.settings.env.test') }), /*#__PURE__*/ _jsx("option", { value: "production", children: t('admin.settings.env.prod') }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.merchant_id') }), /*#__PURE__*/ _jsx("input", { value: ePayForm.merchantId, onChange: (e)=>setEPayForm((f)=>({ ...f, merchantId: e.target.value })), placeholder: t('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" }) ] }), /*#__PURE__*/ _jsxs("div", { className: "grid grid-cols-2 gap-3", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: "API User" }), /*#__PURE__*/ _jsx("input", { value: ePayForm.apiUser, onChange: (e)=>setEPayForm((f)=>({ ...f, apiUser: e.target.value })), autoComplete: "off", className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: "API Password" }), /*#__PURE__*/ _jsx("input", { type: "password", value: ePayForm.apiPassword, onChange: (e)=>setEPayForm((f)=>({ ...f, apiPassword: e.target.value })), autoComplete: "new-password", className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: "Confirmation URL (webhook)" }), /*#__PURE__*/ _jsx("input", { value: ePayForm.confirmationUrl, onChange: (e)=>setEPayForm((f)=>({ ...f, confirmationUrl: e.target.value })), placeholder: "https://yoursite.com/api/payments/epay/confirm", className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: "Cancel URL" }), /*#__PURE__*/ _jsx("input", { value: ePayForm.cancelUrl, onChange: (e)=>setEPayForm((f)=>({ ...f, cancelUrl: e.target.value })), placeholder: "https://yoursite.com/payment/cancelled", className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 mt-5", children: [ /*#__PURE__*/ _jsx("button", { onClick: saveEPaySettings, disabled: ePaySaving, className: "px-5 py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700 disabled:opacity-50", children: ePaySaving ? t('admin.settings.saving') : t('common.save') }), ePaySaved && /*#__PURE__*/ _jsx("span", { className: "text-sm text-green-600", children: t('admin.settings.saved') }) ] }) ] }), /*#__PURE__*/ _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: [ /*#__PURE__*/ _jsxs("svg", { className: "w-4 h-4 shrink-0 mt-0.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ _jsx("circle", { cx: "12", cy: "12", r: "10" }), /*#__PURE__*/ _jsx("line", { x1: "12", y1: "8", x2: "12", y2: "12" }), /*#__PURE__*/ _jsx("line", { x1: "12", y1: "16", x2: "12.01", y2: "16" }) ] }), /*#__PURE__*/ _jsx("span", { children: t('admin.settings.payment.hint') }) ] }) ] }), settingsTab === 'notifications' && /*#__PURE__*/ _jsxs("div", { className: "space-y-3 max-w-2xl", children: [ /*#__PURE__*/ _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: [ /*#__PURE__*/ _jsxs("svg", { className: "w-4 h-4 shrink-0 mt-0.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ _jsx("circle", { cx: "12", cy: "12", r: "10" }), /*#__PURE__*/ _jsx("line", { x1: "12", y1: "8", x2: "12", y2: "12" }), /*#__PURE__*/ _jsx("line", { x1: "12", y1: "16", x2: "12.01", y2: "16" }) ] }), /*#__PURE__*/ _jsxs("p", { children: [ t('admin.notif.vars_hint'), ' ', TEMPLATE_HINT_VARS.map((name)=>{ const v = "{{".concat(name, "}}"); return /*#__PURE__*/ _jsx("code", { className: "mx-0.5 bg-green-100 text-gray-800 px-1.5 py-0.5 rounded text-xs font-mono", children: v }, v); }) ] }) ] }), [ { key: 'email_verification', label: t('admin.notif.email_verification'), icon: /*#__PURE__*/ _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: /*#__PURE__*/ _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: t('admin.notif.registration_success'), icon: /*#__PURE__*/ _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: /*#__PURE__*/ _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: t('admin.notif.password_reset'), icon: /*#__PURE__*/ _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: /*#__PURE__*/ _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: t('admin.notif.new_offer'), icon: /*#__PURE__*/ _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: /*#__PURE__*/ _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: t('admin.notif.new_task'), icon: /*#__PURE__*/ _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: /*#__PURE__*/ _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: t('admin.notif.offer_accepted'), icon: /*#__PURE__*/ _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: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" }) }) }, { key: 'new_message', label: t('admin.notif.new_message'), icon: /*#__PURE__*/ _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: /*#__PURE__*/ _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: t('admin.notif.offer_declined'), icon: /*#__PURE__*/ _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: /*#__PURE__*/ _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: t('admin.notif.offer_other_accepted'), icon: /*#__PURE__*/ _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: /*#__PURE__*/ _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: t('admin.notif.task_updated'), icon: /*#__PURE__*/ _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: /*#__PURE__*/ _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: t('admin.notif.deadline_reminder'), icon: /*#__PURE__*/ _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: /*#__PURE__*/ _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: t('admin.notif.task_archived'), icon: /*#__PURE__*/ _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: /*#__PURE__*/ _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: t('admin.notif.referral_reward'), icon: /*#__PURE__*/ _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: /*#__PURE__*/ _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" }) }) }, // ── Plan / subscription emails ───────────────────────────── { key: 'plan_activated', label: t('admin.email_template.plan_activated'), icon: /*#__PURE__*/ _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: /*#__PURE__*/ _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: t('admin.email_template.plan_upgraded'), icon: /*#__PURE__*/ _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: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 10l7-7m0 0l7 7m-7-7v18" }) }) }, { key: 'plan_downgrade_scheduled', label: t('admin.email_template.plan_downgrade_scheduled'), icon: /*#__PURE__*/ _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: /*#__PURE__*/ _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: t('admin.email_template.plan_downgrade_applied'), icon: /*#__PURE__*/ _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: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19 14l-7 7m0 0l-7-7m7 7V3" }) }) }, { key: 'plan_renewal_reminder', label: t('admin.email_template.plan_renewal_reminder'), icon: /*#__PURE__*/ _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: /*#__PURE__*/ _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: t('admin.email_template.plan_insufficient_funds'), icon: /*#__PURE__*/ _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: /*#__PURE__*/ _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((param)=>{ let { key, label, icon } = param; const localeKey = "".concat(key, "_").concat(templateLocale); var _notifTemplates_localeKey, _ref; const tmpl = (_ref = (_notifTemplates_localeKey = notifTemplates[localeKey]) !== null && _notifTemplates_localeKey !== void 0 ? _notifTemplates_localeKey : notifTemplates[key]) !== null && _ref !== void 0 ? _ref : { subject: '', body: '' }; const isEditing = editingTemplate === key; var _TEMPLATE_VARS_key; const templateVars = (_TEMPLATE_VARS_key = TEMPLATE_VARS[key]) !== null && _TEMPLATE_VARS_key !== void 0 ? _TEMPLATE_VARS_key : []; return /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 overflow-hidden", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 px-5 py-4 cursor-pointer hover:bg-gray-50 select-none", onClick: ()=>setEditingTemplate(isEditing ? null : key), children: [ /*#__PURE__*/ _jsx("span", { className: "text-xl shrink-0", children: icon }), /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ _jsx("div", { className: "font-medium text-gray-800 text-sm", children: label }), tmpl.subject ? /*#__PURE__*/ _jsxs("div", { className: "text-xs text-gray-400 mt-0.5 truncate", children: [ t('admin.notif.tmpl.subject_label'), ": ", tmpl.subject ] }) : /*#__PURE__*/ _jsx("div", { className: "text-xs text-gray-300 mt-0.5 italic", children: t('admin.notif.tmpl.not_set') }) ] }), /*#__PURE__*/ _jsx("span", { className: "text-gray-400 transition-transform ".concat(isEditing ? 'rotate-90' : ''), children: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("polyline", { points: "9 18 15 12 9 6" }) }) }) ] }), isEditing && /*#__PURE__*/ _jsxs("div", { className: "px-5 pb-5 border-t border-gray-100 pt-4 space-y-3", children: [ /*#__PURE__*/ _jsx("div", { className: "flex gap-1 pb-2", children: [ 'el', 'en', 'uk', 'ru' ].map((loc)=>/*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setTemplateLocale(loc), className: "px-3 py-1 text-xs font-medium rounded-md transition-colors ".concat(templateLocale === loc ? 'bg-green-600 text-white' : 'bg-gray-100 text-gray-600 hover:bg-gray-200'), children: loc === 'el' ? 'ΕλληΜικά' : loc === 'en' ? 'English' : loc === 'uk' ? 'УкраїМська' : 'РусскОй' }, loc)) }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.notif.tmpl.subject_label') }), /*#__PURE__*/ _jsx("input", { value: tmpl.subject, onChange: (e)=>setNotifTemplates((prev)=>{ var _prev_localeKey; return { ...prev, [localeKey]: { ...(_prev_localeKey = prev[localeKey]) !== null && _prev_localeKey !== void 0 ? _prev_localeKey : { subject: '', body: '' }, subject: e.target.value } }; }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.notif.tmpl.body_label') }), /*#__PURE__*/ _jsx("textarea", { rows: 7, value: tmpl.body, onChange: (e)=>setNotifTemplates((prev)=>{ var _prev_localeKey; return { ...prev, [localeKey]: { ...(_prev_localeKey = prev[localeKey]) !== null && _prev_localeKey !== void 0 ? _prev_localeKey : { subject: '', body: '' }, body: e.target.value } }; }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 font-mono resize-y", placeholder: "

УважаеЌый {{userName}},

..." }) ] }), templateVars.length > 0 && /*#__PURE__*/ _jsxs("div", { className: "rounded-lg border border-amber-200 bg-amber-50 px-3 py-2", children: [ /*#__PURE__*/ _jsx("div", { className: "text-xs font-medium text-amber-800 mb-1", children: t('admin.notif.vars_hint') }), /*#__PURE__*/ _jsx("div", { className: "flex flex-wrap gap-1.5", children: templateVars.map((name)=>{ const variable = "{{".concat(name, "}}"); return /*#__PURE__*/ _jsx("code", { className: "bg-amber-100 text-amber-900 px-1.5 py-0.5 rounded text-xs font-mono", children: variable }, variable); }) }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-2 flex-wrap", children: [ /*#__PURE__*/ _jsx("button", { onClick: ()=>saveTemplate(key), disabled: templateSaving || templateTranslating, className: "px-4 py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700 disabled:opacity-50", children: templateSaving ? t('admin.notif.tmpl.saving') : t('admin.notif.tmpl.save') }), /*#__PURE__*/ _jsxs("button", { onClick: ()=>autoTranslateTemplate(key), disabled: templateSaving || templateTranslating, 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: [ /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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" }) }), templateTranslating ? t('admin.notif.tmpl.translating') : t('admin.notif.tmpl.translate') ] }), /*#__PURE__*/ _jsx("button", { onClick: ()=>setEditingTemplate(null), className: "px-4 py-2 bg-gray-100 text-gray-700 rounded-lg text-sm font-medium hover:bg-gray-200", children: t('admin.notif.tmpl.close') }) ] }) ] }) ] }, key); }) ] }), settingsTab === 'referral' && /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6 max-w-lg space-y-5", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-gray-800", children: t('admin.settings.referral.title') }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-400 mt-1", children: t('admin.settings.referral.hint') }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "text-sm font-medium text-gray-700", children: t('admin.settings.referral.enabled_label') }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400", children: t('admin.settings.referral.enabled_hint') }) ] }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setReferralForm((f)=>({ ...f, enabled: !f.enabled })), className: "relative w-10 h-6 rounded-full p-0 transition-colors cursor-pointer ".concat(referralForm.enabled ? 'bg-green-600' : 'bg-gray-300'), children: /*#__PURE__*/ _jsx("span", { className: "absolute left-0 top-1 w-4 h-4 bg-white rounded-full shadow transition-transform ".concat(referralForm.enabled ? 'translate-x-5' : 'translate-x-1') }) }) ] }), /*#__PURE__*/ _jsxs("div", { className: "border border-gray-100 rounded-lg p-4 space-y-4", children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs font-semibold text-gray-500 uppercase tracking-wide", children: t('admin.settings.referral.shared_section') }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.referral.plan_label') }), /*#__PURE__*/ _jsxs("select", { value: referralForm.planId, onChange: (e)=>setReferralForm((f)=>({ ...f, planId: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400", children: [ /*#__PURE__*/ _jsx("option", { value: "", children: t('admin.settings.referral.no_plan') }), planRows.map((p)=>/*#__PURE__*/ _jsx("option", { value: p.id, children: p.name }, p.id)) ] }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-1", children: t('admin.settings.referral.plan_hint') }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.referral.days_label') }), /*#__PURE__*/ _jsx("input", { type: "number", min: "1", max: "365", value: referralForm.days, onChange: (e)=>setReferralForm((f)=>({ ...f, days: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-1", children: t('admin.settings.referral.days_hint') }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3", children: [ /*#__PURE__*/ _jsx("button", { onClick: saveReferralSettings, disabled: referralSaving, className: "px-5 py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700 disabled:opacity-50", children: referralSaving ? t('admin.settings.saving') : t('common.save') }), referralSaved && /*#__PURE__*/ _jsx("span", { className: "text-sm text-green-600", children: t('admin.settings.saved') }) ] }) ] }), settingsTab === 'socials' && /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6 max-w-lg space-y-5", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-gray-800 mb-1", children: t('admin.settings.socials.title') }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400", children: t('admin.settings.socials.hint') }) ] }), [ { key: 'telegram', label: 'Telegram', placeholder: 'https://t.me/yourname', icon: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", viewBox: "0 0 24 24", fill: "currentColor", children: /*#__PURE__*/ _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: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", viewBox: "0 0 24 24", fill: "currentColor", children: /*#__PURE__*/ _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: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", viewBox: "0 0 24 24", fill: "currentColor", children: /*#__PURE__*/ _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: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", viewBox: "0 0 24 24", fill: "currentColor", children: /*#__PURE__*/ _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: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", viewBox: "0 0 24 24", fill: "currentColor", children: /*#__PURE__*/ _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: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", viewBox: "0 0 24 24", fill: "currentColor", children: /*#__PURE__*/ _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: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", viewBox: "0 0 24 24", fill: "currentColor", children: /*#__PURE__*/ _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: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", viewBox: "0 0 24 24", fill: "currentColor", children: /*#__PURE__*/ _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((param)=>{ let { key, label, placeholder, icon } = param; return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("label", { className: "block text-sm font-medium text-gray-700 mb-1 flex items-center gap-2", children: [ /*#__PURE__*/ _jsx("span", { className: "".concat(socialForm[key] ? 'text-green-600' : 'text-gray-300'), children: icon }), label, !socialForm[key] && /*#__PURE__*/ _jsx("span", { className: "text-xs font-normal text-gray-400 ml-auto", children: "Ме запПлМеМП" }) ] }), /*#__PURE__*/ _jsx("input", { type: "url", value: socialForm[key], onChange: (e)=>setSocialForm((f)=>({ ...f, [key]: e.target.value })), placeholder: placeholder, className: "w-full border rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 ".concat(socialForm[key] ? 'border-green-300 bg-green-50/30' : 'border-gray-300') }) ] }, key); }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 pt-2", children: [ /*#__PURE__*/ _jsx("button", { onClick: saveSocialSettings, disabled: socialSaving, className: "px-5 py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700 disabled:opacity-50", children: socialSaving ? t('admin.settings.saving') : t('common.save') }), socialSaved && /*#__PURE__*/ _jsx("span", { className: "text-sm text-green-600", children: t('admin.settings.saved') }) ] }) ] }), settingsTab === 'seo' && /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6 max-w-lg space-y-6", children: [ /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-gray-800", children: t('admin.settings.seo.title') }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "text-sm font-medium text-gray-700", children: t('admin.settings.seo.maintenance_label') }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-0.5", children: t('admin.settings.seo.maintenance_hint') }) ] }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setSeoForm((f)=>({ ...f, maintenanceMode: !f.maintenanceMode })), className: "relative w-10 h-6 rounded-full p-0 transition-colors cursor-pointer flex-shrink-0 ".concat(seoForm.maintenanceMode ? 'bg-red-500' : 'bg-gray-300'), children: /*#__PURE__*/ _jsx("span", { className: "absolute left-0 top-1 w-4 h-4 bg-white rounded-full shadow transition-transform ".concat(seoForm.maintenanceMode ? 'translate-x-5' : 'translate-x-1') }) }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "text-sm font-medium text-gray-700", children: t('admin.settings.seo.indexing_label') }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-0.5", children: t('admin.settings.seo.indexing_hint') }) ] }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setSeoForm((f)=>({ ...f, indexingEnabled: !f.indexingEnabled })), className: "relative w-10 h-6 rounded-full p-0 transition-colors cursor-pointer flex-shrink-0 ".concat(seoForm.indexingEnabled ? 'bg-green-600' : 'bg-gray-300'), children: /*#__PURE__*/ _jsx("span", { className: "absolute left-0 top-1 w-4 h-4 bg-white rounded-full shadow transition-transform ".concat(seoForm.indexingEnabled ? 'translate-x-5' : 'translate-x-1') }) }) ] }), /*#__PURE__*/ _jsx("div", { className: "space-y-4", children: /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("p", { className: "text-sm font-medium text-gray-700 mb-2", children: [ t('admin.settings.seo.site_title_label'), " / ", t('admin.settings.seo.site_description_label') ] }), /*#__PURE__*/ _jsx("div", { className: "flex gap-1 mb-3", children: [ { code: 'el', flag: '🇬🇷', label: 'EL' }, { code: 'en', flag: '🇬🇧', label: 'EN' }, { code: 'ru', flag: '🇷🇺', label: 'RU' }, { code: 'uk', flag: '🇺🇊', label: 'UK' } ].map((param)=>{ let { code, flag, label } = param; return /*#__PURE__*/ _jsxs("button", { type: "button", onClick: ()=>setSeoLangTab(code), className: "flex items-center gap-1 px-3 py-1.5 rounded-lg text-sm font-medium transition-colors ".concat(seoLangTab === code ? 'bg-green-600 text-white' : 'bg-gray-100 text-gray-600 hover:bg-gray-200'), children: [ flag, " ", label ] }, code); }) }), /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-500 mb-1", children: t('admin.settings.seo.site_title_label') }), /*#__PURE__*/ _jsx("input", { value: seoForm["siteTitle".concat(seoLangTab.charAt(0).toUpperCase() + seoLangTab.slice(1))], onChange: (e)=>setSeoForm((f)=>({ ...f, ["siteTitle".concat(seoLangTab.charAt(0).toUpperCase() + seoLangTab.slice(1))]: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 mb-3", placeholder: seoLangTab === 'el' ? 'CanHelp — ΚάΞε άΜΞρωπος έχει κάτι Μα προσφέρει' : seoLangTab === 'en' ? 'CanHelp — Everyone has something valuable to offer' : seoLangTab === 'ru' ? 'CanHelp — КажЎый челПвек ЌПжет чеЌ-тП пПЌПчь' : 'CanHelp — КПжеМ Ќає МавОчку, яка ЌПже ЎПпПЌПгтО іМшПЌу' }), /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-500 mb-1", children: t('admin.settings.seo.site_description_label') }), /*#__PURE__*/ _jsx("textarea", { rows: 3, value: seoForm["siteDescription".concat(seoLangTab.charAt(0).toUpperCase() + seoLangTab.slice(1))], onChange: (e)=>setSeoForm((f)=>({ ...f, ["siteDescription".concat(seoLangTab.charAt(0).toUpperCase() + seoLangTab.slice(1))]: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 resize-none", placeholder: seoLangTab === 'el' ? 'Η ελληΜική πλατφόρΌα για online αΜάΞεση εργασιώΜ...' : seoLangTab === 'en' ? 'The Greek platform for online task delegation...' : seoLangTab === 'ru' ? 'Греческая платфПрЌа Ўля ПМлайМ-пПОска спецОалОстПв...' : 'Грецька платфПрЌа Ўля пПшуку фахівців ПМлайМ...' }) ] }) }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.seo.head_scripts_label') }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mb-2", children: t('admin.settings.seo.head_scripts_hint') }), /*#__PURE__*/ _jsx("textarea", { rows: 6, value: seoForm.headScripts, onChange: (e)=>setSeoForm((f)=>({ ...f, headScripts: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm font-mono focus:outline-none focus:ring-2 focus:ring-blue-400 resize-y", placeholder: '\n', spellCheck: false }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3", children: [ /*#__PURE__*/ _jsx("button", { onClick: saveSeoSettings, disabled: seoSaving, className: "px-5 py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700 disabled:opacity-50", children: seoSaving ? t('admin.settings.saving') : t('common.save') }), seoSaved && /*#__PURE__*/ _jsx("span", { className: "text-sm text-green-600", children: t('admin.settings.saved') }) ] }) ] }), settingsTab === 'telegram' && /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6 max-w-lg space-y-6", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-gray-800 mb-1", children: t('admin.settings.telegram.title') }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400", children: t('admin.settings.telegram.help') }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.telegram.bot_token') }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-2", children: [ /*#__PURE__*/ _jsx("input", { type: "text", value: telegramForm.botToken, onChange: (e)=>{ setTelegramForm((f)=>({ ...f, botToken: e.target.value })); setVerifyResultTelegramToken(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" }), /*#__PURE__*/ _jsx("button", { onClick: verifyTelegramToken, disabled: verifyingTelegramToken || !telegramForm.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: verifyingTelegramToken ? '...' : t('admin.settings.telegram.verify') }) ] }), verifyResultTelegramToken && /*#__PURE__*/ _jsx("p", { className: "text-xs mt-1 font-medium ".concat(verifyResultTelegramToken.ok ? 'text-green-600' : 'text-red-500'), children: verifyResultTelegramToken.ok ? "✓ ".concat(verifyResultTelegramToken.msg) : "✗ ".concat(verifyResultTelegramToken.msg) }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.telegram.admin_chat_id') }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-2", children: [ /*#__PURE__*/ _jsx("input", { type: "text", value: telegramForm.adminChatId, onChange: (e)=>setTelegramForm((f)=>({ ...f, adminChatId: e.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" }), /*#__PURE__*/ _jsx("button", { onClick: ()=>testTelegram('admin'), disabled: testingTelegramAdmin || !telegramForm.botToken || !telegramForm.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: testingTelegramAdmin ? '...' : t('admin.settings.telegram.test') }) ] }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-1", children: t('admin.settings.telegram.admin_chat_hint') }), testResultTelegramAdmin && /*#__PURE__*/ _jsx("p", { className: "text-xs mt-1 font-medium ".concat(testResultTelegramAdmin.ok ? 'text-green-600' : 'text-red-500'), children: testResultTelegramAdmin.ok ? "✓ ".concat(testResultTelegramAdmin.msg) : "✗ ".concat(testResultTelegramAdmin.msg) }) ] }), /*#__PURE__*/ _jsxs("div", { className: "space-y-3", children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700", children: t('admin.settings.telegram.channels_title') }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 -mt-2", children: t('admin.settings.telegram.channel_hint') }), [ { locale: 'el', flag: '🇬🇷', label: 'ΕλληΜικά', field: 'channelIdEl' }, { locale: 'en', flag: '🇬🇧', label: 'English', field: 'channelIdEn' }, { locale: 'ru', flag: '🇷🇺', label: 'РусскОй', field: 'channelIdRu' }, { locale: 'uk', flag: '🇺🇊', label: 'УкраїМська', field: 'channelIdUk' } ].map((param)=>{ let { locale: loc, flag, label, field } = param; return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-1.5 mb-1", children: [ /*#__PURE__*/ _jsx("span", { className: "text-base leading-none", children: flag }), /*#__PURE__*/ _jsx("span", { className: "text-xs font-medium text-gray-600", children: label }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-2", children: [ /*#__PURE__*/ _jsx("input", { type: "text", value: telegramForm[field], onChange: (e)=>setTelegramForm((f)=>({ ...f, [field]: e.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" }), /*#__PURE__*/ _jsx("button", { onClick: ()=>testTelegram(loc), disabled: testingLocale === loc || !telegramForm.botToken || !telegramForm[field], className: "px-3 py-2 border border-gray-300 rounded-lg text-sm hover:bg-gray-50 disabled:opacity-40 flex-shrink-0", children: testingLocale === loc ? '...' : t('admin.settings.telegram.test') }) ] }), testResultChannels[loc] && /*#__PURE__*/ _jsx("p", { className: "text-xs mt-1 font-medium ".concat(testResultChannels[loc].ok ? 'text-green-600' : 'text-red-500'), children: testResultChannels[loc].ok ? "✓ ".concat(testResultChannels[loc].msg) : "✗ ".concat(testResultChannels[loc].msg) }) ] }, loc); }) ] }), /*#__PURE__*/ _jsxs("div", { className: "space-y-4", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "text-sm font-medium text-gray-700", children: t('admin.settings.telegram.notify_registrations') }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-0.5", children: t('admin.settings.telegram.notify_registrations_hint') }) ] }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setTelegramForm((f)=>({ ...f, notifyRegistrations: !f.notifyRegistrations })), className: "relative w-10 h-6 rounded-full transition-colors cursor-pointer flex-shrink-0 p-0 border-0 outline-none ".concat(telegramForm.notifyRegistrations ? 'bg-green-600' : 'bg-gray-300'), children: /*#__PURE__*/ _jsx("span", { className: "absolute top-1 left-0 w-4 h-4 bg-white rounded-full shadow transition-transform ".concat(telegramForm.notifyRegistrations ? 'translate-x-5' : 'translate-x-1') }) }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "text-sm font-medium text-gray-700", children: t('admin.settings.telegram.post_new_tasks') }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-0.5", children: t('admin.settings.telegram.post_new_tasks_hint') }) ] }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setTelegramForm((f)=>({ ...f, postNewTasks: !f.postNewTasks })), className: "relative w-10 h-6 rounded-full transition-colors cursor-pointer flex-shrink-0 p-0 border-0 outline-none ".concat(telegramForm.postNewTasks ? 'bg-green-600' : 'bg-gray-300'), children: /*#__PURE__*/ _jsx("span", { className: "absolute top-1 left-0 w-4 h-4 bg-white rounded-full shadow transition-transform ".concat(telegramForm.postNewTasks ? 'translate-x-5' : 'translate-x-1') }) }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 pt-2", children: [ /*#__PURE__*/ _jsx("button", { onClick: saveTelegramSettings, disabled: telegramSaving, className: "px-5 py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700 disabled:opacity-50", children: telegramSaving ? t('admin.settings.saving') : t('common.save') }), telegramSaved && /*#__PURE__*/ _jsx("span", { className: "text-sm text-green-600", children: t('admin.settings.saved') }) ] }) ] }) ] }), tab === 'support' && /*#__PURE__*/ _jsxs("div", { className: "space-y-4", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex flex-wrap gap-3 mb-2", children: [ /*#__PURE__*/ _jsxs("form", { className: "flex gap-2", onSubmit: (e)=>{ e.preventDefault(); setSupportQ(supportQInput); setSupportPage(1); }, children: [ /*#__PURE__*/ _jsx("input", { value: supportQInput, onChange: (e)=>setSupportQInput(e.target.value), placeholder: t('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" }), /*#__PURE__*/ _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: t('admin.search', 'Search') }), supportQ && /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>{ setSupportQInput(''); setSupportQ(''); setSupportPage(1); }, className: "text-sm text-gray-500 hover:text-gray-700 px-2", children: "✕" }) ] }), /*#__PURE__*/ _jsxs("select", { value: supportStatus, onChange: (e)=>{ setSupportStatus(e.target.value); setSupportPage(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: [ /*#__PURE__*/ _jsx("option", { value: "", children: t('admin.support.all_statuses', 'All statuses') }), /*#__PURE__*/ _jsx("option", { value: "open", children: t('admin.support.status.open', 'Open') }), /*#__PURE__*/ _jsx("option", { value: "in_progress", children: t('admin.support.status.in_progress', 'In progress') }), /*#__PURE__*/ _jsx("option", { value: "resolved", children: t('admin.support.status.resolved', 'Resolved') }), /*#__PURE__*/ _jsx("option", { value: "closed", children: t('admin.support.status.closed', 'Closed') }) ] }), /*#__PURE__*/ _jsxs("select", { value: supportType, onChange: (e)=>{ setSupportType(e.target.value); setSupportPage(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: [ /*#__PURE__*/ _jsx("option", { value: "", children: t('admin.support.all_types', 'All types') }), /*#__PURE__*/ _jsxs("option", { value: "bug", children: [ "\uD83D\uDC1B ", t('support.type.bug', 'Bug') ] }), /*#__PURE__*/ _jsxs("option", { value: "suggestion", children: [ "\uD83D\uDCA1 ", t('support.type.suggestion', 'Suggestion') ] }), /*#__PURE__*/ _jsxs("option", { value: "other", children: [ "\uD83D\uDCAC ", t('support.type.other', 'Other') ] }) ] }), /*#__PURE__*/ _jsxs("span", { className: "ml-auto text-sm text-gray-400 self-center", children: [ supportTotal, " ", t('admin.pagination.total', 'total') ] }) ] }), loading ? /*#__PURE__*/ _jsx("div", { className: "text-center py-10 text-gray-400", children: t('common.loading') }) : supportTickets.length === 0 ? /*#__PURE__*/ _jsx("div", { className: "text-center py-10 text-gray-400", children: t('admin.support.none', 'No tickets') }) : supportTickets.map((ticket)=>{ const typeColors = { bug: 'bg-red-100 text-red-700', suggestion: 'bg-green-100 text-green-700', other: 'bg-gray-100 text-gray-600' }; const statusColors2 = { 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' }; const typeIcons = { bug: '🐛', suggestion: '💡', other: '💬' }; const isReplying = supportReplyId === ticket.id; var _typeColors_ticket_type, _statusColors2_ticket_status; return /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-5", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-start justify-between gap-4 mb-3", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 flex-wrap mb-1", children: [ /*#__PURE__*/ _jsxs("span", { className: "px-2 py-0.5 rounded-full text-xs font-medium ".concat((_typeColors_ticket_type = typeColors[ticket.type]) !== null && _typeColors_ticket_type !== void 0 ? _typeColors_ticket_type : 'bg-gray-100 text-gray-600'), children: [ typeIcons[ticket.type], " ", ticket.type ] }), /*#__PURE__*/ _jsx("span", { className: "px-2 py-0.5 rounded-full text-xs font-medium ".concat((_statusColors2_ticket_status = statusColors2[ticket.status]) !== null && _statusColors2_ticket_status !== void 0 ? _statusColors2_ticket_status : 'bg-gray-100 text-gray-500'), children: ticket.status }), /*#__PURE__*/ _jsxs("span", { className: "text-xs text-gray-400", children: [ "#", ticket.id.slice(0, 8) ] }) ] }), /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-gray-900 text-sm", children: ticket.subject }), ticket.userName && /*#__PURE__*/ _jsxs("p", { className: "text-xs text-gray-400 mt-0.5", children: [ ticket.userName, " \xb7 ", ticket.userEmail ] }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-0.5", children: new Date(ticket.createdAt).toLocaleString(dateLocale) }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-2 flex-shrink-0", children: [ ticket.status !== 'closed' && /*#__PURE__*/ _jsx("button", { onClick: ()=>{ setSupportReplyId(isReplying ? null : ticket.id); setSupportReplyText(ticket.adminReply || ''); }, className: "text-xs px-3 py-1.5 rounded-lg font-medium bg-green-50 text-green-700 hover:bg-green-100", children: isReplying ? t('admin.support.cancel', 'Cancel') : t('admin.support.reply', 'Reply') }), ticket.status === 'open' && /*#__PURE__*/ _jsx("button", { onClick: ()=>api.setSupportTicketStatus(ticket.id, 'closed').then(()=>setSupportTickets((prev)=>prev.map((t)=>t.id === ticket.id ? { ...t, status: 'closed' } : t))), className: "text-xs px-3 py-1.5 rounded-lg font-medium bg-gray-100 text-gray-600 hover:bg-gray-200", children: t('admin.support.close', 'Close') }) ] }) ] }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-700 whitespace-pre-wrap bg-gray-50 rounded-lg p-3 mb-3", children: ticket.body }), ticket.adminReply && !isReplying && /*#__PURE__*/ _jsxs("div", { className: "bg-green-50 border border-green-100 rounded-lg p-3 mb-2", children: [ /*#__PURE__*/ _jsxs("p", { className: "text-xs font-medium text-green-600 mb-1", children: [ t('admin.support.your_reply', 'Your reply'), ":" ] }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-800 whitespace-pre-wrap", children: ticket.adminReply }) ] }), isReplying && /*#__PURE__*/ _jsxs("div", { className: "space-y-2 mt-2", children: [ /*#__PURE__*/ _jsx("textarea", { rows: 3, value: supportReplyText, onChange: (e)=>setSupportReplyText(e.target.value), placeholder: t('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" }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-2 items-center", children: [ /*#__PURE__*/ _jsxs("select", { id: "status-".concat(ticket.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: [ /*#__PURE__*/ _jsx("option", { value: "open", children: t('admin.support.status.open', 'Open') }), /*#__PURE__*/ _jsx("option", { value: "in_progress", children: t('admin.support.status.in_progress', 'In progress') }), /*#__PURE__*/ _jsx("option", { value: "resolved", children: t('admin.support.status.resolved', 'Resolved') }), /*#__PURE__*/ _jsx("option", { value: "closed", children: t('admin.support.status.closed', 'Closed') }) ] }), /*#__PURE__*/ _jsx("button", { disabled: supportReplySaving || !supportReplyText.trim(), onClick: async ()=>{ const statusEl = document.getElementById("status-".concat(ticket.id)); setSupportReplySaving(true); try { const updated = await api.replyToSupportTicket(ticket.id, { adminReply: supportReplyText, status: statusEl === null || statusEl === void 0 ? void 0 : statusEl.value }); setSupportTickets((prev)=>prev.map((t)=>t.id === ticket.id ? { ...t, ...updated } : t)); setSupportReplyId(null); } catch (e) {} finally{ setSupportReplySaving(false); } }, 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: supportReplySaving ? '...' : t('admin.support.send_reply', 'Send') }) ] }) ] }) ] }, ticket.id); }), /*#__PURE__*/ _jsx(Pagination, { page: supportPage, total: supportTotal, limit: 30, onChange: setSupportPage, totalLabel: t('admin.pagination.total') }) ] }), tab === 'push' && /*#__PURE__*/ _jsxs("div", { className: "space-y-4", children: [ /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-5 space-y-4", children: [ /*#__PURE__*/ _jsx("h2", { className: "text-lg font-semibold text-gray-800", children: "Push-рассылка" }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-2", children: [ /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setPushMode('broadcast'), className: "px-3 py-1.5 text-sm rounded-lg border ".concat(pushMode === 'broadcast' ? 'bg-green-600 text-white border-green-600' : 'bg-white text-gray-700 border-gray-300'), children: "ВсеЌ пПльзПвателяЌ" }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setPushMode('user'), className: "px-3 py-1.5 text-sm rounded-lg border ".concat(pushMode === 'user' ? 'bg-green-600 text-white border-green-600' : 'bg-white text-gray-700 border-gray-300'), children: "КПМкретМПЌу пПльзПвателю" }) ] }), pushMode === 'user' && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "text-sm text-gray-600 block mb-1", children: "User ID" }), /*#__PURE__*/ _jsx("input", { value: pushTargetUserId, onChange: (e)=>setPushTargetUserId(e.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" }) ] }), pushMode === 'broadcast' && /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-2 text-sm text-gray-700", children: [ /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: pushOnlyActive, onChange: (e)=>setPushOnlyActive(e.target.checked) }), "ТПлькП актОвМыЌ пПльзПвателяЌ" ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "text-sm text-gray-600 block mb-1", children: "ЗагПлПвПк" }), /*#__PURE__*/ _jsx("input", { value: pushTitle, onChange: (e)=>setPushTitle(e.target.value), placeholder: "НапрОЌер: НПвые заЎачО ряЎПЌ с ваЌО", className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "text-sm text-gray-600 block mb-1", children: "Текст" }), /*#__PURE__*/ _jsx("textarea", { rows: 3, value: pushBody, onChange: (e)=>setPushBody(e.target.value), placeholder: "КПрПткОй текст увеЎПЌлеМОя", className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 resize-none" }) ] }), /*#__PURE__*/ _jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-3", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "text-sm text-gray-600 block mb-1", children: "ТОп" }), /*#__PURE__*/ _jsx("input", { value: pushType, onChange: (e)=>setPushType(e.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" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "text-sm text-gray-600 block mb-1", children: "Reference ID (ПпцОПМальМП)" }), /*#__PURE__*/ _jsx("input", { value: pushReferenceId, onChange: (e)=>setPushReferenceId(e.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" }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3", children: [ /*#__PURE__*/ _jsx("button", { type: "button", onClick: sendAdminPush, disabled: pushSending || !pushTitle.trim() || pushMode === 'user' && !pushTargetUserId.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: pushSending ? 'Отправка...' : 'ОтправОть Push' }), pushError && /*#__PURE__*/ _jsx("span", { className: "text-sm text-red-600", children: pushError }) ] }) ] }), pushResult && /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-5", children: [ /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-gray-800 mb-3", children: "Результат" }), 'usersTotal' in pushResult ? /*#__PURE__*/ _jsxs("div", { className: "grid grid-cols-2 md:grid-cols-5 gap-3 text-sm", children: [ /*#__PURE__*/ _jsxs("div", { className: "rounded-lg bg-gray-50 border border-gray-200 px-3 py-2", children: [ /*#__PURE__*/ _jsx("div", { className: "text-gray-500", children: "ППльзПвателей" }), /*#__PURE__*/ _jsx("div", { className: "text-gray-900 font-semibold", children: pushResult.usersTotal }) ] }), /*#__PURE__*/ _jsxs("div", { className: "rounded-lg bg-gray-50 border border-gray-200 px-3 py-2", children: [ /*#__PURE__*/ _jsx("div", { className: "text-gray-500", children: "ППлучОлО" }), /*#__PURE__*/ _jsx("div", { className: "text-gray-900 font-semibold", children: pushResult.usersWithSent }) ] }), /*#__PURE__*/ _jsxs("div", { className: "rounded-lg bg-gray-50 border border-gray-200 px-3 py-2", children: [ /*#__PURE__*/ _jsx("div", { className: "text-gray-500", children: "ОтправлеМП push" }), /*#__PURE__*/ _jsx("div", { className: "text-gray-900 font-semibold", children: pushResult.pushesSent }) ] }), /*#__PURE__*/ _jsxs("div", { className: "rounded-lg bg-gray-50 border border-gray-200 px-3 py-2", children: [ /*#__PURE__*/ _jsx("div", { className: "text-gray-500", children: "НевалОЎМые тПкеМы" }), /*#__PURE__*/ _jsx("div", { className: "text-gray-900 font-semibold", children: pushResult.invalidTokens }) ] }), /*#__PURE__*/ _jsxs("div", { className: "rounded-lg bg-gray-50 border border-gray-200 px-3 py-2", children: [ /*#__PURE__*/ _jsx("div", { className: "text-gray-500", children: "ОшОбкО пП userId" }), /*#__PURE__*/ _jsx("div", { className: "text-gray-900 font-semibold", children: pushResult.failedUsers.length }) ] }) ] }) : /*#__PURE__*/ _jsxs("div", { className: "grid grid-cols-2 md:grid-cols-4 gap-3 text-sm", children: [ /*#__PURE__*/ _jsxs("div", { className: "rounded-lg bg-gray-50 border border-gray-200 px-3 py-2", children: [ /*#__PURE__*/ _jsx("div", { className: "text-gray-500", children: "User ID" }), /*#__PURE__*/ _jsx("div", { className: "text-gray-900 font-mono text-xs break-all", children: pushResult.targetUserId }) ] }), /*#__PURE__*/ _jsxs("div", { className: "rounded-lg bg-gray-50 border border-gray-200 px-3 py-2", children: [ /*#__PURE__*/ _jsx("div", { className: "text-gray-500", children: "ТПкеМПв МайЎеМП" }), /*#__PURE__*/ _jsx("div", { className: "text-gray-900 font-semibold", children: (_pushResult_tokensFound = pushResult.tokensFound) !== null && _pushResult_tokensFound !== void 0 ? _pushResult_tokensFound : 0 }) ] }), /*#__PURE__*/ _jsxs("div", { className: "rounded-lg bg-gray-50 border border-gray-200 px-3 py-2", children: [ /*#__PURE__*/ _jsx("div", { className: "text-gray-500", children: "ОтправлеМП push" }), /*#__PURE__*/ _jsx("div", { className: "text-gray-900 font-semibold", children: pushResult.sent }) ] }), /*#__PURE__*/ _jsxs("div", { className: "rounded-lg bg-gray-50 border border-gray-200 px-3 py-2", children: [ /*#__PURE__*/ _jsx("div", { className: "text-gray-500", children: "НевалОЎМые тПкеМы" }), /*#__PURE__*/ _jsx("div", { className: "text-gray-900 font-semibold", children: pushResult.invalidTokens }) ] }) ] }), 'usersTotal' in pushResult ? /*#__PURE__*/ _jsx(_Fragment, { children: ((_pushResult_usersWithoutTokens = pushResult.usersWithoutTokens) !== null && _pushResult_usersWithoutTokens !== void 0 ? _pushResult_usersWithoutTokens : 0) > 0 || ((_pushResult_usersConfigBlocked = pushResult.usersConfigBlocked) !== null && _pushResult_usersConfigBlocked !== void 0 ? _pushResult_usersConfigBlocked : 0) > 0 || ((_pushResult_usersAuthFailed = pushResult.usersAuthFailed) !== null && _pushResult_usersAuthFailed !== void 0 ? _pushResult_usersAuthFailed : 0) > 0 || ((_pushResult_usersAllFailed = pushResult.usersAllFailed) !== null && _pushResult_usersAllFailed !== void 0 ? _pushResult_usersAllFailed : 0) > 0 ? /*#__PURE__*/ _jsxs("div", { className: "mt-3 rounded-lg border border-amber-200 bg-amber-50 px-3 py-2 text-xs text-amber-900", children: [ /*#__PURE__*/ _jsxs("div", { children: [ "ДОагМПстОка: без тПкеМПв — ", (_pushResult_usersWithoutTokens1 = pushResult.usersWithoutTokens) !== null && _pushResult_usersWithoutTokens1 !== void 0 ? _pushResult_usersWithoutTokens1 : 0, ", FCM Ме МастрПеМ — ", (_pushResult_usersConfigBlocked1 = pushResult.usersConfigBlocked) !== null && _pushResult_usersConfigBlocked1 !== void 0 ? _pushResult_usersConfigBlocked1 : 0, ", ПшОбка auth FCM — ", (_pushResult_usersAuthFailed1 = pushResult.usersAuthFailed) !== null && _pushResult_usersAuthFailed1 !== void 0 ? _pushResult_usersAuthFailed1 : 0, ", FCM send failed — ", (_pushResult_usersAllFailed1 = pushResult.usersAllFailed) !== null && _pushResult_usersAllFailed1 !== void 0 ? _pushResult_usersAllFailed1 : 0 ] }), pushResult.failedReasonStats && Object.keys(pushResult.failedReasonStats).length > 0 ? /*#__PURE__*/ _jsxs("div", { className: "mt-1", children: [ "КПЎы ПшОбПк FCM: ", Object.entries(pushResult.failedReasonStats).map((param)=>{ let [key, count] = param; return "".concat(key, ": ").concat(count); }).join(', ') ] }) : null, pushResult.failedReasonSample ? /*#__PURE__*/ _jsxs("div", { className: "mt-1", children: [ "ПрОЌер ПшОбкО: ", describeFcmFailure(pushResult.failedReasonStats ? Object.keys(pushResult.failedReasonStats)[0] : null, pushResult.failedReasonSample) ] }) : null ] }) : null }) : /*#__PURE__*/ _jsx(_Fragment, { children: pushResult.reason ? /*#__PURE__*/ _jsxs("div", { className: "mt-3 rounded-lg border border-amber-200 bg-amber-50 px-3 py-2 text-xs text-amber-900", children: [ /*#__PURE__*/ _jsxs("div", { children: [ "ДОагМПстОка: ", pushResult.reason === 'no_tokens' ? 'у пПльзПвателя Мет push-тПкеМПв' : pushResult.reason === 'fcm_not_configured' ? 'FCM Ме МастрПеМ Ма API (переЌеММые FCM_*)' : pushResult.reason === 'fcm_auth_failed' ? 'ПшОбка автПрОзацОО FCM (service account)' : describeFcmFailure(pushResult.failureKey, pushResult.failureMessage) ] }), pushResult.failureKey ? /*#__PURE__*/ _jsxs("div", { className: "mt-1", children: [ "КПЎ FCM: ", pushResult.failureKey ] }) : null, pushResult.failureMessage ? /*#__PURE__*/ _jsxs("div", { className: "mt-1", children: [ "СППбщеМОе FCM: ", pushResult.failureMessage ] }) : null ] }) : null }) ] }) ] }), tab === 'backup' && /*#__PURE__*/ _jsxs("div", { className: "space-y-6", children: [ /*#__PURE__*/ _jsxs("h2", { className: "text-lg font-semibold text-gray-800 flex items-center gap-2", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5 text-green-600", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ _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" }) }), t('admin.backup.title', 'Backup') ] }), backupMsg && /*#__PURE__*/ _jsxs("div", { className: "".concat(backupMsgError ? '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: [ /*#__PURE__*/ _jsx("span", { children: backupMsg }), /*#__PURE__*/ _jsx("button", { onClick: ()=>setBackupMsg(null), className: "".concat(backupMsgError ? 'text-red-500 hover:text-red-700' : 'text-green-500 hover:text-green-700', " ml-4"), children: "\xd7" }) ] }), /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-5 flex items-center justify-between", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "font-medium text-gray-800 text-sm", children: t('admin.backup.autoBackup', 'Auto Backup') }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-500 mt-0.5", children: t('admin.backup.autoBackupDesc', 'Create a backup every day automatically') }) ] }), /*#__PURE__*/ _jsx("button", { disabled: backupAutoSaving, onClick: async ()=>{ setBackupAutoSaving(true); try { await request('/admin/backup/settings', { method: 'PUT', body: JSON.stringify({ autoEnabled: !backupAutoEnabled }) }); setBackupAutoEnabled((v)=>!v); } catch (e) {} setBackupAutoSaving(false); }, className: "relative w-11 h-6 rounded-full transition-colors ".concat(backupAutoEnabled ? 'bg-green-600' : 'bg-gray-300', " ").concat(backupAutoSaving ? 'opacity-50' : ''), children: /*#__PURE__*/ _jsx("span", { className: "absolute top-0.5 left-0.5 w-5 h-5 rounded-full bg-white shadow transition-transform ".concat(backupAutoEnabled ? 'translate-x-5' : 'translate-x-0') }) }) ] }), /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-5", children: [ /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-gray-800 text-sm mb-4", children: t('admin.backup.title', 'Database Backup') }), /*#__PURE__*/ _jsxs("div", { className: "flex flex-wrap gap-3", children: [ /*#__PURE__*/ _jsxs("button", { disabled: backupExporting, onClick: async ()=>{ setBackupExporting(true); try { const BASE = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; const res = await fetch("".concat(BASE, "/api/admin/backup/export"), { credentials: 'include' }); if (!res.ok) throw new Error('Export failed'); const blob = await res.blob(); const url = URL.createObjectURL(blob); const a = document.createElement('a'); a.href = url; a.download = "backup_".concat(new Date().toISOString().slice(0, 10), ".sql.gz"); a.click(); URL.revokeObjectURL(url); setBackupSuccess(t('admin.backup.exportSuccess', 'Export successful')); } catch (e) { setBackupError(e.message || 'Error'); } setBackupExporting(false); }, 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: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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" }) }), backupExporting ? t('admin.backup.exporting', 'Exporting...') : t('admin.backup.exportAll', 'Export Full DB') ] }), /*#__PURE__*/ _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 ".concat(backupImporting === 'full' ? 'opacity-50 pointer-events-none' : ''), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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" }) }), backupImporting === 'full' ? t('admin.backup.importing', 'Importing...') : t('admin.backup.importAll', 'Import Full DB'), /*#__PURE__*/ _jsx("input", { type: "file", accept: ".sql.gz,.gz", className: "hidden", onChange: async (e)=>{ var _e_target_files; const file = (_e_target_files = e.target.files) === null || _e_target_files === void 0 ? void 0 : _e_target_files[0]; if (!file) return; if (!window.confirm(t('admin.backup.restoreConfirm', 'Restore from this backup?'))) return; setBackupImporting('full'); try { const fd = new FormData(); fd.append('file', file); const BASE = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; const res = await fetch("".concat(BASE, "/api/admin/backup/import"), { method: 'POST', credentials: 'include', body: fd }); if (!res.ok) throw new Error('Import failed'); setBackupSuccess(t('admin.backup.importSuccess', 'Import successful')); } catch (err) { setBackupError(err.message || 'Error'); } setBackupImporting(null); e.target.value = ''; } }) ] }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-5", children: [ /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-gray-800 text-sm mb-4", children: t('admin.backup.storedBackups', 'Stored Backups') }), backupStoredFiles.length === 0 ? /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-400", children: t('admin.backup.noStoredBackups', 'No stored backups') }) : /*#__PURE__*/ _jsx("div", { className: "space-y-2", children: backupStoredFiles.map((f)=>/*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between py-2 px-3 bg-gray-50 rounded-lg border border-gray-100", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "text-sm font-medium text-gray-800", children: f.name === 'backup_today' ? t('admin.backup.today', 'Today') : t('admin.backup.yesterday', 'Yesterday') }), /*#__PURE__*/ _jsxs("p", { className: "text-xs text-gray-400", children: [ t('admin.backup.size', 'Size'), ": ", (f.size / 1024).toFixed(1), " KB \xb7 ", t('admin.backup.date', 'Date'), ": ", new Date(f.date).toLocaleString() ] }) ] }), /*#__PURE__*/ _jsx("button", { disabled: backupRestoring === f.name, onClick: async ()=>{ if (!window.confirm(t('admin.backup.restoreConfirm', 'Restore from this backup?'))) return; setBackupRestoring(f.name); try { await request('/admin/backup/restore', { method: 'POST', body: JSON.stringify({ name: f.name }) }); setBackupSuccess(t('admin.backup.restoreSuccess', 'Restore successful')); } catch (err) { setBackupError(err.message || 'Error'); } setBackupRestoring(null); }, className: "text-sm text-green-600 hover:text-gray-800 font-medium disabled:opacity-50", children: backupRestoring === f.name ? t('admin.backup.restoring', 'Restoring...') : t('admin.backup.restore', 'Restore') }) ] }, f.name)) }) ] }), /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-5", children: [ /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-gray-800 text-sm mb-4", children: t('admin.backup.tables', 'Tables') }), backupTablesLoading ? /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 text-sm text-gray-400", children: [ /*#__PURE__*/ _jsxs("svg", { className: "w-4 h-4 animate-spin", fill: "none", viewBox: "0 0 24 24", children: [ /*#__PURE__*/ _jsx("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }), /*#__PURE__*/ _jsx("path", { className: "opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8v8z" }) ] }), t('common.loading', 'Loading...') ] }) : backupTables.length === 0 ? /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-400", children: t('admin.noData', 'No data') }) : /*#__PURE__*/ _jsx("div", { className: "overflow-x-auto", children: /*#__PURE__*/ _jsx("table", { className: "w-full text-sm", children: /*#__PURE__*/ _jsx("tbody", { className: "divide-y divide-gray-100", children: backupTables.map((tbl)=>/*#__PURE__*/ _jsxs("tr", { className: "hover:bg-gray-50", children: [ /*#__PURE__*/ _jsx("td", { className: "py-2 pr-4 font-mono text-gray-700", children: tbl }), /*#__PURE__*/ _jsx("td", { className: "py-2 text-right", children: /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-end gap-2", children: [ /*#__PURE__*/ _jsx("button", { onClick: async ()=>{ try { const BASE = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; const res = await fetch("".concat(BASE, "/api/admin/backup/export/").concat(tbl), { credentials: 'include' }); if (!res.ok) throw new Error('Export failed'); const blob = await res.blob(); const url = URL.createObjectURL(blob); const a = document.createElement('a'); a.href = url; a.download = "".concat(tbl, "_").concat(new Date().toISOString().slice(0, 10), ".sql.gz"); a.click(); URL.revokeObjectURL(url); } catch (err) { setBackupError(err.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: t('admin.backup.exportTable', 'Export') }), /*#__PURE__*/ _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: [ backupImporting === tbl ? t('admin.backup.importing', 'Importing...') : t('admin.backup.importTable', 'Import'), /*#__PURE__*/ _jsx("input", { type: "file", accept: ".sql.gz,.gz", className: "hidden", onChange: async (e)=>{ var _e_target_files; const file = (_e_target_files = e.target.files) === null || _e_target_files === void 0 ? void 0 : _e_target_files[0]; if (!file) return; if (!window.confirm(t('admin.backup.restoreConfirm', 'Restore from this backup?'))) return; setBackupImporting(tbl); try { const fd = new FormData(); fd.append('file', file); const BASE = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; const res = await fetch("".concat(BASE, "/api/admin/backup/import/").concat(tbl), { method: 'POST', credentials: 'include', body: fd }); if (!res.ok) { const errData = await res.json().catch(()=>({ error: 'Import failed' })); throw new Error(errData.error || 'Import failed'); } setBackupSuccess(t('admin.backup.importSuccess', 'Import successful')); } catch (err) { setBackupError(err.message || 'Error'); } setBackupImporting(null); e.target.value = ''; } }) ] }) ] }) }) ] }, tbl)) }) }) }) ] }) ] }), tab === 'translations' && /*#__PURE__*/ _jsxs("div", { className: "space-y-6", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("h2", { className: "text-base font-semibold text-gray-900", children: "ПеревПЎы" }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-500 mt-0.5", children: "АвтПЌатОческОй перевПЎ прПпущеММых зМачеМОй пП таблОцаЌ" }) ] }), /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-4 flex flex-wrap gap-4 items-end", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: "ИстПчМОк" }), /*#__PURE__*/ _jsxs("select", { value: transFromLang, onChange: (e)=>setTransFromLang(e.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: [ /*#__PURE__*/ _jsx("option", { value: "el", children: "\uD83C\uDDEC\uD83C\uDDF7 Greek" }), /*#__PURE__*/ _jsx("option", { value: "en", children: "\uD83C\uDDEC\uD83C\uDDE7 English" }), /*#__PURE__*/ _jsx("option", { value: "ru", children: "\uD83C\uDDF7\uD83C\uDDFA Russian" }), /*#__PURE__*/ _jsx("option", { value: "uk", children: "\uD83C\uDDFA\uD83C\uDDE6 Ukrainian" }) ] }) ] }), /*#__PURE__*/ _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: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M13 7l5 5-5 5M6 12h12" }) }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: "ПеревестО Ма" }), /*#__PURE__*/ _jsxs("select", { value: transLang, onChange: (e)=>setTransLang(e.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: [ /*#__PURE__*/ _jsx("option", { value: "el", children: "\uD83C\uDDEC\uD83C\uDDF7 Greek" }), /*#__PURE__*/ _jsx("option", { value: "en", children: "\uD83C\uDDEC\uD83C\uDDE7 English" }), /*#__PURE__*/ _jsx("option", { value: "ru", children: "\uD83C\uDDF7\uD83C\uDDFA Russian" }), /*#__PURE__*/ _jsx("option", { value: "uk", children: "\uD83C\uDDFA\uD83C\uDDE6 Ukrainian" }) ] }) ] }), /*#__PURE__*/ _jsx("div", { className: "ml-auto self-end", children: /*#__PURE__*/ _jsxs("span", { className: "text-sm font-semibold text-gray-700 flex items-center gap-2", children: [ { el: '🇬🇷', en: '🇬🇧', ru: '🇷🇺', uk: '🇺🇊' }[transFromLang], " ", transFromLang.toUpperCase(), /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-gray-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M13 7l5 5-5 5M6 12h12" }) }), { el: '🇬🇷', en: '🇬🇧', ru: '🇷🇺', uk: '🇺🇊' }[transLang], " ", transLang.toUpperCase() ] }) }) ] }), transMsg && /*#__PURE__*/ _jsx("div", { className: "text-sm px-4 py-2 rounded-lg ".concat(transMsg.error ? 'bg-red-50 text-red-700' : 'bg-green-50 text-green-700'), children: transMsg.text }), transStatsLoading ? /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 text-sm text-gray-400 py-6", children: [ /*#__PURE__*/ _jsxs("svg", { className: "w-4 h-4 animate-spin", fill: "none", viewBox: "0 0 24 24", children: [ /*#__PURE__*/ _jsx("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }), /*#__PURE__*/ _jsx("path", { className: "opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8v8z" }) ] }), "Загрузка " ] }) : /*#__PURE__*/ _jsx("div", { className: "grid gap-4 sm:grid-cols-2 lg:grid-cols-3", children: (transStats !== null && transStats !== void 0 ? transStats : []).map((tbl)=>{ const isTasks = tbl.name === 'tasks'; // For tasks: total missing across all langs (tasks may miss multiple langs each) const totalMissingAllLangs = Object.values(tbl.missing).reduce((a, b)=>a + b, 0); var _tbl_missing_transLang; const missingCount = isTasks ? totalMissingAllLangs : (_tbl_missing_transLang = tbl.missing[transLang]) !== null && _tbl_missing_transLang !== void 0 ? _tbl_missing_transLang : 0; const isTranslating = !!transTableTranslating[tbl.name]; const anyTranslating = Object.values(transTableTranslating).some(Boolean); return /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-5 flex flex-col", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-start justify-between", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "font-semibold text-gray-900 text-sm", children: tbl.label }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-0.5", children: tbl.name }) ] }), /*#__PURE__*/ _jsx("span", { className: "text-xs font-semibold px-2 py-0.5 rounded-full ".concat(missingCount > 0 ? 'bg-red-100 text-red-700' : 'bg-green-100 text-green-700'), children: missingCount > 0 ? "".concat(missingCount, " missing") : 'Complete' }) ] }), /*#__PURE__*/ _jsxs("p", { className: "text-xs text-gray-500 mt-3", children: [ "ВсегП: ", tbl.total, isTasks && ' · с языка ПрОгОМала Ма все ПстальМые' ] }), /*#__PURE__*/ _jsx("div", { className: "mt-2 flex flex-wrap gap-1", children: [ 'el', 'en', 'ru', 'uk' ].map((lang)=>{ var _tbl_missing_lang; const cnt = (_tbl_missing_lang = tbl.missing[lang]) !== null && _tbl_missing_lang !== void 0 ? _tbl_missing_lang : 0; const isClickable = isTasks && cnt > 0; return /*#__PURE__*/ _jsxs("button", { type: "button", disabled: !isClickable, onClick: isClickable ? async ()=>{ setTransPreview({ lang, loading: true, rows: [] }); try { const d = await api.getTasksTranslationPreview(lang, 50); setTransPreview({ lang, loading: false, rows: d.rows }); } catch (e) { setTransPreview({ lang, loading: false, rows: [] }); } } : undefined, className: "text-xs px-2 py-0.5 rounded-full border transition ".concat(cnt > 0 ? 'border-red-200 bg-red-50 text-red-600' + (isClickable ? ' cursor-pointer hover:bg-red-100' : '') : 'border-green-200 bg-green-50 text-green-600 cursor-default'), children: [ lang, ": ", cnt > 0 ? "-".concat(cnt) : '✓' ] }, lang); }) }), /*#__PURE__*/ _jsx("div", { className: "mt-4 mt-auto pt-4", children: missingCount === 0 ? /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-1.5 text-xs text-emerald-600", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" }) }), "Все перевПЎы запПлМеМы" ] }) : /*#__PURE__*/ _jsx("button", { disabled: anyTranslating, onClick: async ()=>{ if (!isTasks && transFromLang === transLang) { setTransMsg({ text: 'ИсхПЎМый О целевПй язык сПвпаЎают', error: true }); return; } setTransTableTranslating((prev)=>({ ...prev, [tbl.name]: true })); setTransMsg(null); try { const res = isTasks ? await api.autoTranslateTasks(500) : tbl.name === 'email_templates' ? await api.autoTranslateEmailTemplates(transLang, transFromLang) : await api.autoTranslate(tbl.name, transLang, transFromLang, 500); setTransMsg({ text: "".concat(tbl.label, ": translated ").concat(res.translated, " of ").concat(res.total) + (res.failed > 0 ? " \xb7 errors: ".concat(res.failed) : ''), error: res.failed > 0 && res.translated === 0 }); api.getTranslationsStats().then((d)=>setTransStats(d.tables)).catch(()=>{}); } catch (err) { const msg = (err === null || err === void 0 ? void 0 : err.response) ? await err.response.text().catch(()=>err.message) : err.message || 'Error'; setTransMsg({ text: "Error: ".concat(msg), error: true }); } finally{ setTransTableTranslating((prev)=>{ const n = { ...prev }; delete n[tbl.name]; return n; }); } }, 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: isTranslating ? /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs("svg", { className: "w-3.5 h-3.5 animate-spin flex-shrink-0", fill: "none", viewBox: "0 0 24 24", children: [ /*#__PURE__*/ _jsx("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }), /*#__PURE__*/ _jsx("path", { className: "opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8v8z" }) ] }), "Translating..." ] }) : isTasks ? /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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 ", missingCount ] }) : /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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 ", missingCount, " \xb7 ", { el: '🇬🇷', en: '🇬🇧', ru: '🇷🇺', uk: '🇺🇊' }[transFromLang], " ", transFromLang.toUpperCase(), /*#__PURE__*/ _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: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M13 7l5 5-5 5M6 12h12" }) }), { el: '🇬🇷', en: '🇬🇧', ru: '🇷🇺', uk: '🇺🇊' }[transLang], " ", transLang.toUpperCase() ] }) }) }) ] }, tbl.name); }) }) ] }), tab === 'dbcheck' && /*#__PURE__*/ _jsx(DbCheckTab, {}), tab === 'referrals' && /*#__PURE__*/ _jsxs("div", { className: "space-y-6", children: [ /*#__PURE__*/ _jsx("div", { className: "grid grid-cols-3 gap-4", children: [ { label: 'РеферерПв', value: (_referralsData_totalReferrers = referralsData === null || referralsData === void 0 ? void 0 : referralsData.totalReferrers) !== null && _referralsData_totalReferrers !== void 0 ? _referralsData_totalReferrers : '—', color: 'text-green-600' }, { label: 'ПрОглашеМОй', value: (_referralsData_totalReferrals = referralsData === null || referralsData === void 0 ? void 0 : referralsData.totalReferrals) !== null && _referralsData_totalReferrals !== void 0 ? _referralsData_totalReferrals : '—', color: 'text-purple-600' }, { label: 'АктОвМых МаграЎ', value: (_referralsData_activeRewards = referralsData === null || referralsData === void 0 ? void 0 : referralsData.activeRewards) !== null && _referralsData_activeRewards !== void 0 ? _referralsData_activeRewards : '—', color: 'text-green-600' } ].map((param)=>{ let { label, value, color } = param; return /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-2xl border border-gray-200 p-5 text-center", children: [ /*#__PURE__*/ _jsx("div", { className: "text-3xl font-bold ".concat(color), children: value }), /*#__PURE__*/ _jsx("div", { className: "text-xs text-gray-500 mt-1", children: label }) ] }, label); }) }), /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-2xl border border-gray-200 overflow-hidden", children: [ /*#__PURE__*/ _jsxs("div", { className: "px-5 py-4 border-b border-gray-100 flex items-center justify-between", children: [ /*#__PURE__*/ _jsx("h2", { className: "font-semibold text-gray-800", children: "ДеревП рефералПв" }), /*#__PURE__*/ _jsxs("button", { onClick: ()=>{ setReferralsLoading(true); api.getAdminReferrals().then(setReferralsData).catch(()=>{}).finally(()=>setReferralsLoading(false)); }, className: "text-xs text-green-600 hover:underline flex items-center gap-1", children: [ referralsLoading && /*#__PURE__*/ _jsxs("svg", { className: "w-3 h-3 animate-spin", fill: "none", viewBox: "0 0 24 24", children: [ /*#__PURE__*/ _jsx("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }), /*#__PURE__*/ _jsx("path", { className: "opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8v8z" }) ] }), "ОбМПвОть" ] }) ] }), referralsLoading && !referralsData ? /*#__PURE__*/ _jsx("div", { className: "flex justify-center py-16", children: /*#__PURE__*/ _jsxs("svg", { className: "w-6 h-6 animate-spin text-purple-600", fill: "none", viewBox: "0 0 24 24", children: [ /*#__PURE__*/ _jsx("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }), /*#__PURE__*/ _jsx("path", { className: "opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8v8z" }) ] }) }) : !referralsData || referralsData.tree.length === 0 ? /*#__PURE__*/ _jsx("div", { className: "py-16 text-center text-sm text-gray-400", children: "Нет ЎаММых П рефералах" }) : /*#__PURE__*/ _jsx("div", { className: "divide-y divide-gray-100", children: referralsData.tree.map((node)=>{ var _node_referrer, _node_referrer1; var _node_referrer_id; const rid = (_node_referrer_id = (_node_referrer = node.referrer) === null || _node_referrer === void 0 ? void 0 : _node_referrer.id) !== null && _node_referrer_id !== void 0 ? _node_referrer_id : 'unknown'; const isExpanded = referralsExpanded.has(rid); var _node_referrer_firstName, _node_referrer_lastName; const referrerName = node.referrer ? "".concat((_node_referrer_firstName = node.referrer.firstName) !== null && _node_referrer_firstName !== void 0 ? _node_referrer_firstName : '', " ").concat((_node_referrer_lastName = node.referrer.lastName) !== null && _node_referrer_lastName !== void 0 ? _node_referrer_lastName : '').trim() || node.referrer.email : '(уЎалёМ)'; return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("button", { className: "w-full flex items-center gap-3 px-5 py-3.5 hover:bg-gray-50 text-left transition-colors", onClick: ()=>setReferralsExpanded((prev)=>{ const next = new Set(prev); next.has(rid) ? next.delete(rid) : next.add(rid); return next; }), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-gray-400 flex-shrink-0 transition-transform ".concat(isExpanded ? 'rotate-90' : ''), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 5l7 7-7 7" }) }), /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ _jsx("span", { className: "font-medium text-sm text-gray-900", children: referrerName }), node.referrer && /*#__PURE__*/ _jsx("span", { className: "ml-2 text-xs text-gray-400", children: node.referrer.email }) ] }), ((_node_referrer1 = node.referrer) === null || _node_referrer1 === void 0 ? void 0 : _node_referrer1.referralCode) && /*#__PURE__*/ _jsx("code", { className: "text-xs bg-gray-100 text-gray-600 px-2 py-0.5 rounded font-mono", children: node.referrer.referralCode }), /*#__PURE__*/ _jsxs("span", { className: "ml-3 text-xs font-semibold text-purple-700 bg-purple-50 px-2 py-0.5 rounded-full", children: [ node.referees.length, " реф." ] }) ] }), isExpanded && /*#__PURE__*/ _jsx("div", { className: "bg-gray-50 border-t border-gray-100", children: /*#__PURE__*/ _jsxs("table", { className: "w-full text-xs", children: [ /*#__PURE__*/ _jsx("thead", { children: /*#__PURE__*/ _jsxs("tr", { className: "border-b border-gray-200", children: [ /*#__PURE__*/ _jsx("th", { className: "text-left px-10 py-2 font-semibold text-gray-500", children: "ПрОглашёММый" }), /*#__PURE__*/ _jsx("th", { className: "text-left px-3 py-2 font-semibold text-gray-500", children: "Email" }), /*#__PURE__*/ _jsx("th", { className: "text-center px-3 py-2 font-semibold text-gray-500", children: "+ЎМей" }), /*#__PURE__*/ _jsx("th", { className: "text-center px-3 py-2 font-semibold text-gray-500", children: "Истекает" }), /*#__PURE__*/ _jsx("th", { className: "text-center px-3 py-2 font-semibold text-gray-500", children: "Дата" }) ] }) }), /*#__PURE__*/ _jsx("tbody", { children: node.referees.map((referee)=>{ var _referee_firstName, _referee_lastName; const refName = "".concat((_referee_firstName = referee.firstName) !== null && _referee_firstName !== void 0 ? _referee_firstName : '', " ").concat((_referee_lastName = referee.lastName) !== null && _referee_lastName !== void 0 ? _referee_lastName : '').trim() || referee.email; const expiresAt = new Date(referee.expiresAt); const createdAt = new Date(referee.createdAt); const isActive = expiresAt > new Date(); return /*#__PURE__*/ _jsxs("tr", { className: "border-b border-gray-100 last:border-0 hover:bg-white transition-colors", children: [ /*#__PURE__*/ _jsx("td", { className: "px-10 py-2.5 font-medium text-gray-800", children: refName }), /*#__PURE__*/ _jsx("td", { className: "px-3 py-2.5 text-gray-500", children: referee.email }), /*#__PURE__*/ _jsx("td", { className: "px-3 py-2.5 text-center", children: /*#__PURE__*/ _jsxs("span", { className: "font-semibold text-green-700", children: [ "+", referee.daysAdded ] }) }), /*#__PURE__*/ _jsx("td", { className: "px-3 py-2.5 text-center", children: /*#__PURE__*/ _jsx("span", { className: "px-1.5 py-0.5 rounded text-xs font-medium ".concat(isActive ? 'bg-green-100 text-green-700' : 'bg-gray-100 text-gray-500'), children: expiresAt.toLocaleDateString('ru-RU', { day: '2-digit', month: '2-digit', year: '2-digit' }) }) }), /*#__PURE__*/ _jsx("td", { className: "px-3 py-2.5 text-center text-gray-400", children: createdAt.toLocaleDateString('ru-RU', { day: '2-digit', month: '2-digit', year: '2-digit' }) }) ] }, referee.id); }) }) ] }) }) ] }, rid); }) }) ] }) ] }), transPreview && /*#__PURE__*/ _jsx("div", { className: "fixed inset-0 z-50 flex items-center justify-center bg-black/50 px-4", onClick: ()=>setTransPreview(null), children: /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-2xl shadow-xl w-full max-w-3xl max-h-[80vh] flex flex-col", onClick: (e)=>e.stopPropagation(), children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between px-6 py-4 border-b border-gray-100 flex-shrink-0", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("h3", { className: "font-semibold text-gray-900", children: [ "ЗаЎачО без перевПЎа: ", /*#__PURE__*/ _jsx("span", { className: "uppercase font-bold text-red-600", children: transPreview.lang }) ] }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-0.5", children: "ППказаМы первые 50 запОсей" }) ] }), /*#__PURE__*/ _jsx("button", { onClick: ()=>setTransPreview(null), className: "text-gray-400 hover:text-gray-600 p-1", children: /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" }) }) }) ] }), /*#__PURE__*/ _jsx("div", { className: "overflow-y-auto flex-1 px-6 py-4", children: transPreview.loading ? /*#__PURE__*/ _jsx("div", { className: "flex justify-center py-12", children: /*#__PURE__*/ _jsxs("svg", { className: "w-6 h-6 animate-spin text-purple-600", fill: "none", viewBox: "0 0 24 24", children: [ /*#__PURE__*/ _jsx("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }), /*#__PURE__*/ _jsx("path", { className: "opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8v8z" }) ] }) }) : transPreview.rows.length === 0 ? /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-500 text-center py-12", children: "Нет заЎач без перевПЎа" }) : /*#__PURE__*/ _jsxs("table", { className: "w-full text-xs border-collapse", children: [ /*#__PURE__*/ _jsx("thead", { children: /*#__PURE__*/ _jsxs("tr", { className: "border-b border-gray-200", children: [ /*#__PURE__*/ _jsx("th", { className: "text-left py-2 pr-3 font-semibold text-gray-600 w-[35%]", children: "ОрОгОМал (title)" }), /*#__PURE__*/ _jsx("th", { className: "text-center py-2 px-2 font-semibold text-gray-600", children: "orig" }), [ 'el', 'en', 'ru', 'uk' ].map((l)=>/*#__PURE__*/ _jsx("th", { className: "text-center py-2 px-2 font-semibold text-gray-600 w-[14%]", children: l }, l)) ] }) }), /*#__PURE__*/ _jsx("tbody", { children: transPreview.rows.map((row)=>/*#__PURE__*/ _jsxs("tr", { className: "border-b border-gray-100 hover:bg-gray-50", children: [ /*#__PURE__*/ _jsx("td", { className: "py-2 pr-3 text-gray-800 truncate max-w-[200px]", title: row.title, children: row.title }), /*#__PURE__*/ _jsx("td", { className: "py-2 px-2 text-center", children: /*#__PURE__*/ _jsx("span", { className: "uppercase font-semibold text-purple-700 bg-purple-50 px-1.5 py-0.5 rounded", children: row.originalLocale }) }), [ [ 'el', row.titleEl ], [ 'en', row.titleEn ], [ 'ru', row.titleRu ], [ 'uk', row.titleUk ] ].map((param)=>{ let [l, val] = param; return /*#__PURE__*/ _jsx("td", { className: "py-2 px-2 text-center", title: val !== null && val !== void 0 ? val : '', children: val ? /*#__PURE__*/ _jsx("span", { className: "text-emerald-600 font-semibold", children: "✓" }) : /*#__PURE__*/ _jsx("span", { className: "text-red-500 font-semibold", children: "✗" }) }, l); }) ] }, row.id)) }) ] }) }) ] }) }), editUser && /*#__PURE__*/ _jsx("div", { className: "fixed inset-0 z-50 flex items-center justify-center bg-black/50 px-4", children: /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-2xl shadow-xl w-full max-w-4xl max-h-[90vh] flex flex-col", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between px-6 py-4 border-b border-gray-100 flex-shrink-0", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("h2", { className: "text-base font-semibold text-gray-900", children: t('admin.user_edit.title') }), /*#__PURE__*/ _jsxs("p", { className: "text-xs text-gray-400 mt-0.5", children: [ editUser.email, " \xb7 ID: ", editUser.id ] }) ] }), /*#__PURE__*/ _jsx("button", { onClick: ()=>setEditUser(null), className: "text-gray-400 hover:text-gray-600 text-2xl leading-none", children: "\xd7" }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex flex-1 min-h-0", children: [ /*#__PURE__*/ _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: t('admin.user_edit.tab.profile') }, { id: 'account', label: t('admin.user_edit.tab.account') }, { id: 'balance', label: t('admin.user_edit.tab.balance') }, { id: 'settings', label: t('admin.user_edit.tab.settings') }, { id: 'site', label: t('admin.user_edit.tab.site') }, { id: 'specialist', label: t('admin.user_edit.tab.specialist') } ].map((item)=>/*#__PURE__*/ _jsx("button", { onClick: ()=>{ setEditUserTab(item.id); if (item.id === 'specialist' && editUser) { setEditUserCardsLoading(true); const loadCards = api.getAdminUserSpecialistCards(editUser.id).then(setEditUserCards).catch(()=>{}); const loadCats = catRows.length === 0 ? api.getAdminCategories().then(setCatRows).catch(()=>{}) : Promise.resolve(); const loadLocs = locRows.length === 0 ? api.getAdminLocations().then(setLocRows).catch(()=>{}) : Promise.resolve(); Promise.all([ loadCards, loadCats, loadLocs ]).finally(()=>setEditUserCardsLoading(false)); } }, className: "w-full text-left px-3 py-2.5 text-sm rounded-lg transition-colors ".concat(editUserTab === item.id ? 'bg-green-50 text-green-700 font-medium' : 'text-gray-600 hover:bg-gray-50'), children: item.label }, item.id)) }), /*#__PURE__*/ _jsxs("div", { className: "flex-1 overflow-y-auto p-6", children: [ editUserTab === 'profile' && /*#__PURE__*/ _jsxs("div", { className: "space-y-4", children: [ /*#__PURE__*/ _jsxs("div", { className: "p-3 bg-gray-50 rounded-lg text-xs text-gray-500 space-y-0.5", children: [ /*#__PURE__*/ _jsxs("p", { children: [ /*#__PURE__*/ _jsxs("span", { className: "font-medium", children: [ t('admin.user_edit.registered'), ":" ] }), " ", new Date(editUser.createdAt).toLocaleDateString(dateLocale) ] }), editUser.lastSeenAt && /*#__PURE__*/ _jsxs("p", { children: [ /*#__PURE__*/ _jsxs("span", { className: "font-medium", children: [ t('admin.user_edit.last_seen'), ":" ] }), " ", new Date(editUser.lastSeenAt).toLocaleDateString(dateLocale) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "grid grid-cols-2 gap-3", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.user_edit.first_name') }), /*#__PURE__*/ _jsx("input", { value: (_editUser_firstName = editUser.firstName) !== null && _editUser_firstName !== void 0 ? _editUser_firstName : '', onChange: (e)=>setEditUser((u)=>({ ...u, firstName: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.user_edit.last_name') }), /*#__PURE__*/ _jsx("input", { value: (_editUser_lastName = editUser.lastName) !== null && _editUser_lastName !== void 0 ? _editUser_lastName : '', onChange: (e)=>setEditUser((u)=>({ ...u, lastName: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.user_edit.phone') }), /*#__PURE__*/ _jsx("input", { value: (_editUser_phone = editUser.phone) !== null && _editUser_phone !== void 0 ? _editUser_phone : '', onChange: (e)=>setEditUser((u)=>({ ...u, phone: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.user_edit.bio') }), /*#__PURE__*/ _jsx("textarea", { value: (_editUser_bio = editUser.bio) !== null && _editUser_bio !== void 0 ? _editUser_bio : '', onChange: (e)=>setEditUser((u)=>({ ...u, bio: e.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" }) ] }) ] }), editUserTab === 'account' && /*#__PURE__*/ _jsxs("div", { className: "space-y-4", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.user_edit.email') }), /*#__PURE__*/ _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: editUser.email }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between rounded-lg border px-3 py-2 bg-gray-50", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2", children: [ editUser.emailVerified ? /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-green-500 shrink-0", viewBox: "0 0 20 20", fill: "currentColor", children: /*#__PURE__*/ _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" }) }) : /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-red-400 shrink-0", viewBox: "0 0 20 20", fill: "currentColor", children: /*#__PURE__*/ _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" }) }), /*#__PURE__*/ _jsx("span", { className: "text-sm font-medium ".concat(editUser.emailVerified ? 'text-green-700' : 'text-red-600'), children: editUser.emailVerified ? t('admin.user_edit.email_verified') : t('admin.user_edit.email_not_verified') }) ] }), !editUser.emailVerified && /*#__PURE__*/ _jsx("button", { onClick: verifyEmail, disabled: verifyingEmail, className: "text-xs px-3 py-1 rounded-md bg-green-600 text-white hover:bg-green-700 disabled:opacity-50 transition-colors", children: verifyingEmail ? '...' : t('admin.user_edit.verify_email_btn') }) ] }), /*#__PURE__*/ _jsxs("div", { className: "grid grid-cols-2 gap-3", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.user_edit.role') }), /*#__PURE__*/ _jsxs("select", { value: editUser.role, onChange: (e)=>setEditUser((u)=>({ ...u, role: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm", children: [ /*#__PURE__*/ _jsx("option", { value: "user", children: t('admin.user_edit.role.user') }), /*#__PURE__*/ _jsx("option", { value: "admin", children: t('admin.user_edit.role.admin') }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.user_edit.plan') }), /*#__PURE__*/ _jsxs("select", { value: (_editUser_planId = editUser.planId) !== null && _editUser_planId !== void 0 ? _editUser_planId : '', onChange: (e)=>setEditUser((u)=>({ ...u, planId: e.target.value || null })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm", children: [ /*#__PURE__*/ _jsx("option", { value: "", children: t('admin.user_edit.no_plan') }), planRows.map((p)=>/*#__PURE__*/ _jsx("option", { value: p.id, children: p.name }, p.id)) ] }) ] }) ] }), editUser.planExpiresAt && /*#__PURE__*/ _jsxs("p", { className: "text-xs text-gray-500", children: [ t('admin.user_edit.plan_expires'), ": ", new Date(editUser.planExpiresAt).toLocaleDateString(dateLocale) ] }), /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-2 cursor-pointer", children: [ /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: editUser.isActive !== false, onChange: (e)=>setEditUser((u)=>({ ...u, isActive: e.target.checked })), className: "w-4 h-4 rounded border-gray-300 text-green-600" }), /*#__PURE__*/ _jsx("span", { className: "text-sm text-gray-700", children: t('admin.user_edit.active') }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.user_edit.interface_lang') }), /*#__PURE__*/ _jsxs("select", { value: (_editUser_locale = editUser.locale) !== null && _editUser_locale !== void 0 ? _editUser_locale : 'el', onChange: (e)=>setEditUser((u)=>({ ...u, locale: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm", children: [ /*#__PURE__*/ _jsx("option", { value: "el", children: "ΕλληΜικά" }), /*#__PURE__*/ _jsx("option", { value: "en", children: "English" }), /*#__PURE__*/ _jsx("option", { value: "ru", children: "РусскОй" }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: t('admin.user_edit.comm_languages') }), /*#__PURE__*/ _jsx("div", { className: "flex gap-5", children: [ 'el', 'en', 'uk', 'ru' ].map((lang)=>{ var _editUser_languages; return /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-1.5 cursor-pointer", children: [ /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: ((_editUser_languages = editUser.languages) !== null && _editUser_languages !== void 0 ? _editUser_languages : []).includes(lang), onChange: (e)=>{ var _editUser_languages; const langs = (_editUser_languages = editUser.languages) !== null && _editUser_languages !== void 0 ? _editUser_languages : []; setEditUser((u)=>({ ...u, languages: e.target.checked ? [ ...langs.filter((l)=>l !== lang), lang ] : langs.filter((l)=>l !== lang) })); }, className: "w-4 h-4 rounded border-gray-300 text-green-600" }), /*#__PURE__*/ _jsx("span", { className: "text-sm text-gray-700", children: lang === 'el' ? 'ΕλληΜικά' : lang === 'en' ? 'English' : lang === 'uk' ? 'УкраїМська' : 'РусскОй' }) ] }, lang); }) }) ] }) ] }), editUserTab === 'balance' && /*#__PURE__*/ _jsxs("div", { className: "space-y-6", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between p-5 bg-gray-50 rounded-xl border border-gray-200", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("div", { className: "text-xs text-gray-500 mb-1", children: t('admin.user_edit.balance') }), /*#__PURE__*/ _jsxs("div", { className: "text-2xl font-bold text-gray-900", children: [ Number((_editUser_balance = editUser.balance) !== null && _editUser_balance !== void 0 ? _editUser_balance : 0).toFixed(2), " EUR" ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-2", children: [ /*#__PURE__*/ _jsxs("button", { onClick: ()=>setBalanceModal('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: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M12 4v16m8-8H4" }) }), t('admin.balance.topup.btn') ] }), /*#__PURE__*/ _jsxs("button", { onClick: ()=>setBalanceModal('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: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M20 12H4" }) }), t('admin.balance.withdraw.btn') ] }) ] }) ] }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-center text-gray-400", children: t('admin.balance.modal_hint') }) ] }), editUserTab === 'settings' && /*#__PURE__*/ _jsx("div", { className: "space-y-4", children: /*#__PURE__*/ _jsxs("div", { className: "space-y-3 pt-1 divide-y divide-gray-100", children: [ /*#__PURE__*/ _jsxs("label", { className: "flex items-center justify-between cursor-pointer py-2", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("div", { className: "text-sm font-medium text-gray-700", children: t('admin.user_edit.show_contact_info') }), /*#__PURE__*/ _jsx("div", { className: "text-xs text-gray-400", children: t('admin.user_edit.show_contact_info.hint') }) ] }), /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: (_editUser_showContactInfo = editUser.showContactInfo) !== null && _editUser_showContactInfo !== void 0 ? _editUser_showContactInfo : false, onChange: (e)=>setEditUser((u)=>({ ...u, showContactInfo: e.target.checked })), className: "w-4 h-4 rounded border-gray-300 text-green-600" }) ] }), /*#__PURE__*/ _jsxs("label", { className: "flex items-center justify-between cursor-pointer py-2", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("div", { className: "text-sm font-medium text-gray-700", children: t('admin.user_edit.notify_new_tasks') }), /*#__PURE__*/ _jsx("div", { className: "text-xs text-gray-400", children: t('admin.user_edit.notify_new_tasks.hint') }) ] }), /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: (_editUser_notifyNewTasks = editUser.notifyNewTasks) !== null && _editUser_notifyNewTasks !== void 0 ? _editUser_notifyNewTasks : false, onChange: (e)=>setEditUser((u)=>({ ...u, notifyNewTasks: e.target.checked })), className: "w-4 h-4 rounded border-gray-300 text-green-600" }) ] }), /*#__PURE__*/ _jsxs("label", { className: "flex items-center justify-between cursor-pointer py-2", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("div", { className: "text-sm font-medium text-gray-700", children: t('admin.user_edit.notif_messages') }), /*#__PURE__*/ _jsx("div", { className: "text-xs text-gray-400", children: t('admin.user_edit.notif_messages.hint') }) ] }), /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: (_editUser_notifMessages = editUser.notifMessages) !== null && _editUser_notifMessages !== void 0 ? _editUser_notifMessages : true, onChange: (e)=>setEditUser((u)=>({ ...u, notifMessages: e.target.checked })), className: "w-4 h-4 rounded border-gray-300 text-green-600" }) ] }) ] }) }), editUserTab === 'site' && /*#__PURE__*/ _jsxs("div", { className: "space-y-4", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.user_edit.personal_site_slug') }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2", children: [ /*#__PURE__*/ _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: [ /*#__PURE__*/ _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/" }), /*#__PURE__*/ _jsx("input", { value: (_editUser_personalSiteSlug = editUser.personalSiteSlug) !== null && _editUser_personalSiteSlug !== void 0 ? _editUser_personalSiteSlug : '', onChange: (e)=>setEditUser((u)=>({ ...u, personalSiteSlug: e.target.value || null })), placeholder: "my-username", className: "flex-1 px-3 py-2 text-sm focus:outline-none" }) ] }), editUser.personalSiteSlug && /*#__PURE__*/ _jsx("a", { href: "/site/".concat(editUser.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: /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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" }) }) }) ] }) ] }), editUser.personalSiteSlug && /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx("h4", { className: "text-sm font-semibold text-gray-800 pt-3 border-t border-gray-100", children: t('profile.site.visible_title') }), /*#__PURE__*/ _jsx("div", { className: "space-y-1", children: [ { key: 'showBio', label: t('profile.site.visible.bio') }, { key: 'showRating', label: t('profile.site.visible.rating') }, { key: 'showServices', label: t('profile.site.visible.services') }, { key: 'showPortfolio', label: t('profile.site.visible.portfolio') }, { key: 'showReviews', label: t('profile.site.visible.reviews') }, { key: 'showPhone', label: t('profile.site.visible.contacts') }, { key: 'showFullLastName', label: t('profile.site.visible.full_last_name') }, { key: 'showStatus', label: t('profile.site.visible.status') } ].map((item)=>{ var _editUser_siteSettings; return /*#__PURE__*/ _jsxs("label", { className: "flex items-center justify-between cursor-pointer py-1.5", children: [ /*#__PURE__*/ _jsx("span", { className: "text-sm text-gray-700", children: item.label }), /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: ((_editUser_siteSettings = editUser.siteSettings) !== null && _editUser_siteSettings !== void 0 ? _editUser_siteSettings : {})[item.key] !== false, onChange: (e)=>setEditUser((u)=>{ var _u_siteSettings; return { ...u, siteSettings: { ...(_u_siteSettings = u.siteSettings) !== null && _u_siteSettings !== void 0 ? _u_siteSettings : {}, [item.key]: e.target.checked } }; }), className: "w-4 h-4 rounded border-gray-300 text-green-600" }) ] }, item.key); }) }), /*#__PURE__*/ _jsxs("div", { className: "pt-2", children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1.5", children: t('profile.site.theme') }), /*#__PURE__*/ _jsxs("select", { value: (_siteTheme = ((_editUser_siteSettings = editUser.siteSettings) !== null && _editUser_siteSettings !== void 0 ? _editUser_siteSettings : {}).siteTheme) !== null && _siteTheme !== void 0 ? _siteTheme : 'dark', onChange: (e)=>setEditUser((u)=>{ var _u_siteSettings; return { ...u, siteSettings: { ...(_u_siteSettings = u.siteSettings) !== null && _u_siteSettings !== void 0 ? _u_siteSettings : {}, siteTheme: e.target.value } }; }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm", children: [ /*#__PURE__*/ _jsx("option", { value: "dark", children: t('profile.site.theme.dark') }), /*#__PURE__*/ _jsx("option", { value: "light", children: t('profile.site.theme.light') }) ] }) ] }) ] }) ] }), editUserTab === 'specialist' && /*#__PURE__*/ _jsxs("div", { className: "space-y-6", children: [ (()=>{ if ((editUser === null || editUser === void 0 ? void 0 : editUser.role) === 'specialist') return null; var _editUser_bio; const bio = String((_editUser_bio = editUser === null || editUser === void 0 ? void 0 : editUser.bio) !== null && _editUser_bio !== void 0 ? _editUser_bio : '').trim(); const publishedCards = (editUserCards !== null && editUserCards !== void 0 ? editUserCards : []).filter((c)=>{ var _c_publicationStatus; return ((_c_publicationStatus = c.publicationStatus) !== null && _c_publicationStatus !== void 0 ? _c_publicationStatus : c.isActive ? 'active' : 'inactive') === 'active'; }); const hasPublishedCard = publishedCards.length > 0; const hasCategories = publishedCards.some((c)=>{ var _c_categories; var _c_categories_length; return ((_c_categories_length = (_c_categories = c.categories) === null || _c_categories === void 0 ? void 0 : _c_categories.length) !== null && _c_categories_length !== void 0 ? _c_categories_length : 0) > 0; }); const hasLocations = publishedCards.some((c)=>{ var _c_locations; var _c_locations_length; return ((_c_locations_length = (_c_locations = c.locations) === null || _c_locations === void 0 ? void 0 : _c_locations.length) !== null && _c_locations_length !== void 0 ? _c_locations_length : 0) > 0; }); const missing = []; if (!bio) missing.push(t('admin.user_edit.visibility_requirements.bio', 'Fill in bio')); if (!hasPublishedCard) missing.push(t('admin.user_edit.visibility_requirements.published_card', 'Publish at least one card')); if (!hasCategories) missing.push(t('admin.user_edit.visibility_requirements.categories', 'Add a category in a published card')); if (!hasLocations) missing.push(t('admin.user_edit.visibility_requirements.locations', 'Add a location in a published card')); if (missing.length === 0) return null; return /*#__PURE__*/ _jsxs("div", { className: "rounded-xl border border-amber-300 bg-amber-50 p-3", children: [ /*#__PURE__*/ _jsx("p", { className: "text-sm font-semibold text-amber-900", children: t('admin.user_edit.visibility_requirements.title', 'Profile is not yet visible in Offers') }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-amber-800 mt-1", children: t('admin.user_edit.visibility_requirements.hint', 'Visibility requirements to complete:') }), /*#__PURE__*/ _jsx("ul", { className: "mt-2 text-xs text-amber-900 list-disc pl-5 space-y-0.5", children: missing.map((m)=>/*#__PURE__*/ _jsx("li", { children: m }, m)) }) ] }); })(), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: t('admin.user_edit.skills') }), /*#__PURE__*/ _jsx("div", { className: "flex flex-wrap gap-1.5 mb-2 min-h-[28px]", children: ((_editUser_skills = editUser.skills) !== null && _editUser_skills !== void 0 ? _editUser_skills : []).map((s)=>/*#__PURE__*/ _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, /*#__PURE__*/ _jsx("button", { onClick: ()=>setEditUser((u)=>{ var _u_skills; return { ...u, skills: ((_u_skills = u.skills) !== null && _u_skills !== void 0 ? _u_skills : []).filter((x)=>x !== s) }; }), className: "text-gray-400 hover:text-green-700 leading-none", children: "\xd7" }) ] }, s)) }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-2", children: [ /*#__PURE__*/ _jsx("input", { value: skillInput, onChange: (e)=>setSkillInput(e.target.value), onKeyDown: (e)=>{ if ((e.key === 'Enter' || e.key === ',') && skillInput.trim()) { e.preventDefault(); const val = skillInput.trim().replace(/,$/, ''); var _editUser_skills; if (val && !((_editUser_skills = editUser.skills) !== null && _editUser_skills !== void 0 ? _editUser_skills : []).includes(val)) { setEditUser((u)=>{ var _u_skills; return { ...u, skills: [ ...(_u_skills = u.skills) !== null && _u_skills !== void 0 ? _u_skills : [], val ] }; }); } setSkillInput(''); } }, placeholder: t('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" }), /*#__PURE__*/ _jsx("button", { onClick: ()=>{ const val = skillInput.trim(); var _editUser_skills; if (val && !((_editUser_skills = editUser.skills) !== null && _editUser_skills !== void 0 ? _editUser_skills : []).includes(val)) { setEditUser((u)=>{ var _u_skills; return { ...u, skills: [ ...(_u_skills = u.skills) !== null && _u_skills !== void 0 ? _u_skills : [], val ] }; }); } setSkillInput(''); }, className: "px-3 py-2 bg-green-600 text-white rounded-lg text-sm hover:bg-green-700", children: t('common.add') }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "border-t border-gray-100 pt-4", children: [ /*#__PURE__*/ _jsx("div", { className: "text-sm font-medium text-gray-700 mb-3", children: t('admin.user_edit.specialist_cards') }), editUserCardsLoading ? /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 py-2", children: t('common.loading') }) : editUserCards.length === 0 ? /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 py-4 text-center", children: t('admin.user_edit.no_cards') }) : /*#__PURE__*/ _jsx("div", { className: "space-y-4", children: editUserCards.map((card)=>{ var _card_title, _card_description, _card_skills, _cardSkillInputs_card_id, _card_categories, _card_categories1, _card_locations, _card_locations1; return /*#__PURE__*/ _jsxs("div", { className: "border border-gray-200 bg-gray-50 rounded-xl p-4 space-y-3", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3", children: [ /*#__PURE__*/ _jsx("input", { value: (_card_title = card.title) !== null && _card_title !== void 0 ? _card_title : '', onChange: (e)=>setEditUserCards((prev)=>prev.map((c)=>c.id === card.id ? { ...c, title: e.target.value } : c)), placeholder: t('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" }), /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-1.5 cursor-pointer flex-shrink-0", children: [ /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: card.isActive !== false, onChange: (e)=>setEditUserCards((prev)=>prev.map((c)=>c.id === card.id ? { ...c, isActive: e.target.checked } : c)), className: "w-4 h-4 rounded border-gray-300 text-green-600" }), /*#__PURE__*/ _jsx("span", { className: "text-xs text-gray-600", children: t('admin.user_edit.published') }) ] }) ] }), /*#__PURE__*/ _jsx("textarea", { value: (_card_description = card.description) !== null && _card_description !== void 0 ? _card_description : '', onChange: (e)=>setEditUserCards((prev)=>prev.map((c)=>c.id === card.id ? { ...c, description: e.target.value } : c)), rows: 3, placeholder: t('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" }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("div", { className: "text-xs font-medium text-gray-500 mb-1.5", children: t('admin.user_edit.skills') }), /*#__PURE__*/ _jsx("div", { className: "flex flex-wrap gap-1.5 mb-1.5 min-h-[24px]", children: ((_card_skills = card.skills) !== null && _card_skills !== void 0 ? _card_skills : []).map((s)=>/*#__PURE__*/ _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, /*#__PURE__*/ _jsx("button", { onClick: ()=>setEditUserCards((prev)=>prev.map((c)=>{ var _c_skills; return c.id === card.id ? { ...c, skills: ((_c_skills = c.skills) !== null && _c_skills !== void 0 ? _c_skills : []).filter((x)=>x !== s) } : c; })), className: "text-gray-400 hover:text-green-700 leading-none", children: "\xd7" }) ] }, s)) }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-2", children: [ /*#__PURE__*/ _jsx("input", { value: (_cardSkillInputs_card_id = cardSkillInputs[card.id]) !== null && _cardSkillInputs_card_id !== void 0 ? _cardSkillInputs_card_id : '', onChange: (e)=>setCardSkillInputs((prev)=>({ ...prev, [card.id]: e.target.value })), onKeyDown: (e)=>{ var _cardSkillInputs_card_id; if ((e.key === 'Enter' || e.key === ',') && ((_cardSkillInputs_card_id = cardSkillInputs[card.id]) !== null && _cardSkillInputs_card_id !== void 0 ? _cardSkillInputs_card_id : '').trim()) { e.preventDefault(); var _cardSkillInputs_card_id1; const val = ((_cardSkillInputs_card_id1 = cardSkillInputs[card.id]) !== null && _cardSkillInputs_card_id1 !== void 0 ? _cardSkillInputs_card_id1 : '').trim().replace(/,$/, ''); var _card_skills; if (val && !((_card_skills = card.skills) !== null && _card_skills !== void 0 ? _card_skills : []).includes(val)) { setEditUserCards((prev)=>prev.map((c)=>{ var _c_skills; return c.id === card.id ? { ...c, skills: [ ...(_c_skills = c.skills) !== null && _c_skills !== void 0 ? _c_skills : [], val ] } : c; })); } setCardSkillInputs((prev)=>({ ...prev, [card.id]: '' })); } }, placeholder: t('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" }), /*#__PURE__*/ _jsx("button", { onClick: ()=>{ var _cardSkillInputs_card_id; const val = ((_cardSkillInputs_card_id = cardSkillInputs[card.id]) !== null && _cardSkillInputs_card_id !== void 0 ? _cardSkillInputs_card_id : '').trim(); var _card_skills; if (val && !((_card_skills = card.skills) !== null && _card_skills !== void 0 ? _card_skills : []).includes(val)) { setEditUserCards((prev)=>prev.map((c)=>{ var _c_skills; return c.id === card.id ? { ...c, skills: [ ...(_c_skills = c.skills) !== null && _c_skills !== void 0 ? _c_skills : [], val ] } : c; })); } setCardSkillInputs((prev)=>({ ...prev, [card.id]: '' })); }, className: "px-2.5 py-1.5 bg-green-600 text-white rounded-lg text-xs hover:bg-green-700", children: "+" }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("div", { className: "text-xs font-medium text-gray-500 mb-1.5", children: t('admin.user_edit.categories') }), /*#__PURE__*/ _jsx("div", { className: "flex flex-wrap gap-1.5 mb-1.5 min-h-[24px]", children: ((_card_categories = card.categories) !== null && _card_categories !== void 0 ? _card_categories : []).map((slug)=>{ var _catRows_find; return /*#__PURE__*/ _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: [ getCatLabel((_catRows_find = catRows.find((c)=>c.slug === slug)) !== null && _catRows_find !== void 0 ? _catRows_find : { slug }, locale), /*#__PURE__*/ _jsx("button", { onClick: ()=>setEditUserCards((prev)=>prev.map((c)=>{ var _c_categories; return c.id === card.id ? { ...c, categories: ((_c_categories = c.categories) !== null && _c_categories !== void 0 ? _c_categories : []).filter((x)=>x !== slug) } : c; })), className: "text-purple-400 hover:text-purple-700 leading-none", children: "\xd7" }) ] }, slug); }) }), /*#__PURE__*/ _jsx(AdminCatPicker, { catRows: catRows, locale: locale, selected: (_card_categories1 = card.categories) !== null && _card_categories1 !== void 0 ? _card_categories1 : [], onAdd: (id)=>setEditUserCards((prev)=>prev.map((c)=>{ var _c_categories; return c.id === card.id ? { ...c, categories: [ ...(_c_categories = c.categories) !== null && _c_categories !== void 0 ? _c_categories : [], id ] } : c; })), addLabel: t('admin.user_edit.add_category') }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("div", { className: "text-xs font-medium text-gray-500 mb-1.5", children: t('admin.user_edit.locations') }), /*#__PURE__*/ _jsx("div", { className: "flex flex-wrap gap-1.5 mb-1.5 min-h-[24px]", children: ((_card_locations = card.locations) !== null && _card_locations !== void 0 ? _card_locations : []).map((slug)=>{ var _locRows_find; return /*#__PURE__*/ _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: [ getLocLabel((_locRows_find = locRows.find((l)=>l.slug === slug)) !== null && _locRows_find !== void 0 ? _locRows_find : { slug }, locale), /*#__PURE__*/ _jsx("button", { onClick: ()=>setEditUserCards((prev)=>prev.map((c)=>{ var _c_locations; return c.id === card.id ? { ...c, locations: ((_c_locations = c.locations) !== null && _c_locations !== void 0 ? _c_locations : []).filter((x)=>x !== slug) } : c; })), className: "text-green-400 hover:text-green-700 leading-none", children: "\xd7" }) ] }, slug); }) }), /*#__PURE__*/ _jsx(AdminLocPicker, { locRows: locRows, locale: locale, selected: (_card_locations1 = card.locations) !== null && _card_locations1 !== void 0 ? _card_locations1 : [], onAdd: (id)=>setEditUserCards((prev)=>prev.map((c)=>{ var _c_locations; return c.id === card.id ? { ...c, locations: [ ...(_c_locations = c.locations) !== null && _c_locations !== void 0 ? _c_locations : [], id ] } : c; })), addLabel: t('admin.user_edit.add_location') }) ] }), /*#__PURE__*/ _jsx("div", { className: "flex justify-end pt-1", children: /*#__PURE__*/ _jsx("button", { onClick: ()=>saveCard(card.id), disabled: cardSaving[card.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: cardSaving[card.id] ? '...' : t('common.save') }) }) ] }, card.id); }) }) ] }) ] }) ] }) ] }), editUserTab !== 'balance' ? /*#__PURE__*/ _jsxs("div", { className: "border-t border-gray-100 px-6 py-4 flex gap-3 flex-shrink-0", children: [ /*#__PURE__*/ _jsx("button", { onClick: saveEditUser, disabled: editUserSaving, className: "flex-1 bg-green-600 hover:bg-green-700 text-white py-2 rounded-lg text-sm font-semibold disabled:opacity-50", children: editUserSaving ? '...' : t('common.save') }), /*#__PURE__*/ _jsx("button", { onClick: ()=>setEditUser(null), className: "flex-1 bg-gray-100 hover:bg-gray-200 text-gray-700 py-2 rounded-lg text-sm font-medium", children: t('common.cancel') }) ] }) : /*#__PURE__*/ _jsx("div", { className: "border-t border-gray-100 px-6 py-4 flex-shrink-0", children: /*#__PURE__*/ _jsx("button", { onClick: ()=>setEditUser(null), className: "w-full bg-gray-100 hover:bg-gray-200 text-gray-700 py-2 rounded-lg text-sm font-medium", children: t('common.close') }) }) ] }) }), editUser && balanceModal && /*#__PURE__*/ _jsx("div", { className: "fixed inset-0 z-[60] flex items-center justify-center bg-black/40 px-4", children: /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-2xl shadow-2xl p-6 w-full max-w-sm border-t-4 ".concat(balanceModal === 'topup' ? 'border-emerald-500' : 'border-rose-500'), children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between mb-4", children: [ /*#__PURE__*/ _jsx("h3", { className: "text-base font-semibold ".concat(balanceModal === 'topup' ? 'text-emerald-900' : 'text-rose-900'), children: balanceModal === 'topup' ? t('admin.balance.topup.title') : t('admin.balance.withdraw.title') }), /*#__PURE__*/ _jsx("button", { onClick: ()=>setBalanceModal(null), className: "text-gray-400 hover:text-gray-600 text-2xl leading-none", children: "\xd7" }) ] }), /*#__PURE__*/ _jsxs("p", { className: "text-xs text-gray-500 mb-4", children: [ t('admin.user_edit.balance'), ": ", /*#__PURE__*/ _jsxs("span", { className: "font-semibold text-gray-700", children: [ Number((_editUser_balance1 = editUser.balance) !== null && _editUser_balance1 !== void 0 ? _editUser_balance1 : 0).toFixed(2), " EUR" ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "space-y-3", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium mb-1 ".concat(balanceModal === 'topup' ? 'text-emerald-800' : 'text-rose-800'), children: balanceModal === 'topup' ? t('admin.balance.topup.amount') : t('admin.balance.withdraw.amount') }), /*#__PURE__*/ _jsx("input", { type: "number", min: "0.01", step: "0.01", value: balanceModal === 'topup' ? (_editUser_topUpAmount = editUser.topUpAmount) !== null && _editUser_topUpAmount !== void 0 ? _editUser_topUpAmount : '' : (_editUser_withdrawAmount = editUser.withdrawAmount) !== null && _editUser_withdrawAmount !== void 0 ? _editUser_withdrawAmount : '', onChange: (e)=>setEditUser((u)=>balanceModal === 'topup' ? { ...u, topUpAmount: e.target.value } : { ...u, withdrawAmount: e.target.value }), className: "w-full border rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 ".concat(balanceModal === 'topup' ? 'border-emerald-300 focus:ring-emerald-400' : 'border-rose-300 focus:ring-rose-400') }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium mb-1 ".concat(balanceModal === 'topup' ? 'text-emerald-800' : 'text-rose-800'), children: balanceModal === 'topup' ? t('admin.balance.topup.description') : t('admin.balance.withdraw.description') }), /*#__PURE__*/ _jsx("input", { value: balanceModal === 'topup' ? (_editUser_topUpDescription = editUser.topUpDescription) !== null && _editUser_topUpDescription !== void 0 ? _editUser_topUpDescription : '' : (_editUser_withdrawDescription = editUser.withdrawDescription) !== null && _editUser_withdrawDescription !== void 0 ? _editUser_withdrawDescription : '', onChange: (e)=>setEditUser((u)=>balanceModal === 'topup' ? { ...u, topUpDescription: e.target.value } : { ...u, withdrawDescription: e.target.value }), placeholder: balanceModal === 'topup' ? t('admin.balance.topup.description.placeholder') : t('admin.balance.withdraw.description.placeholder'), className: "w-full border rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 ".concat(balanceModal === 'topup' ? 'border-emerald-300 focus:ring-emerald-400' : 'border-rose-300 focus:ring-rose-400') }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-2 mt-5", children: [ /*#__PURE__*/ _jsx("button", { onClick: async ()=>{ if (balanceModal === 'topup') { await handleAdminTopUp(); } else { await handleAdminWithdraw(); } setBalanceModal(null); }, disabled: balanceModal === 'topup' ? topUpSaving || !Number(editUser.topUpAmount) : withdrawSaving || !Number(editUser.withdrawAmount), className: "flex-1 text-white py-2 rounded-lg text-sm font-semibold disabled:opacity-50 ".concat(balanceModal === 'topup' ? 'bg-emerald-600 hover:bg-emerald-700' : 'bg-rose-600 hover:bg-rose-700'), children: (balanceModal === 'topup' ? topUpSaving : withdrawSaving) ? t('common.loading') : balanceModal === 'topup' ? t('admin.balance.topup.submit') : t('admin.balance.withdraw.submit') }), /*#__PURE__*/ _jsx("button", { onClick: ()=>setBalanceModal(null), className: "flex-1 bg-gray-100 hover:bg-gray-200 text-gray-700 py-2 rounded-lg text-sm font-medium", children: t('common.cancel') }) ] }) ] }) }) ] }) ] }) ] }) }); } // ─── DbCheckTab ───────────────────────────────────────────────────────────── function DbCheckTab() { // ── Skill duplicates ────────────────────────────────────────────────────── const [dedupLoading, setDedupLoading] = useState(false); const [dedupGroups, setDedupGroups] = useState(null); const [keepIds, setKeepIds] = useState({}); const [merging, setMerging] = useState(null); function gk(group) { var _group__nameEl, _group_, _group_1; var _group__nameEl_toLowerCase_trim; return (_group__nameEl_toLowerCase_trim = (_group_ = group[0]) === null || _group_ === void 0 ? void 0 : (_group__nameEl = _group_.nameEl) === null || _group__nameEl === void 0 ? void 0 : _group__nameEl.toLowerCase().trim()) !== null && _group__nameEl_toLowerCase_trim !== void 0 ? _group__nameEl_toLowerCase_trim : (_group_1 = group[0]) === null || _group_1 === void 0 ? void 0 : _group_1.id; } async function findDuplicates() { setDedupLoading(true); setDedupGroups(null); setKeepIds({}); try { const groups = await api.getSkillDedup() // all categories ; setDedupGroups(groups); const auto = {}; groups.forEach((group)=>{ const best = [ ...group ].sort((a, b)=>{ var _b_usageCount, _a_usageCount; return ((_b_usageCount = b.usageCount) !== null && _b_usageCount !== void 0 ? _b_usageCount : 0) - ((_a_usageCount = a.usageCount) !== null && _a_usageCount !== void 0 ? _a_usageCount : 0); })[0]; auto[gk(group)] = best.id; }); setKeepIds(auto); } catch (e) { setDedupGroups([]); } finally{ setDedupLoading(false); } } async function mergeGroup(key, group) { const keepId = keepIds[key]; if (!keepId) return; const deleteIds = group.filter((s)=>s.id !== keepId).map((s)=>s.id); if (!deleteIds.length) return; setMerging(key); try { await api.mergeSkillDuplicates(keepId, deleteIds); setDedupGroups((prev)=>prev ? prev.filter((g)=>gk(g) !== key) : prev); } catch (e) {} finally{ setMerging(null); } } async function mergeAll() { if (!(dedupGroups === null || dedupGroups === void 0 ? void 0 : dedupGroups.length)) return; setMerging('__all__'); for (const group of [ ...dedupGroups ]){ const key = gk(group); const keepId = keepIds[key]; if (!keepId) continue; const deleteIds = group.filter((s)=>s.id !== keepId).map((s)=>s.id); if (!deleteIds.length) continue; try { await api.mergeSkillDuplicates(keepId, deleteIds); setDedupGroups((prev)=>prev ? prev.filter((g)=>gk(g) !== key) : prev); } catch (e) {} } setMerging(null); } var _dedupGroups_reduce; const totalDuplicates = (_dedupGroups_reduce = dedupGroups === null || dedupGroups === void 0 ? void 0 : dedupGroups.reduce((acc, g)=>acc + g.length - 1, 0)) !== null && _dedupGroups_reduce !== void 0 ? _dedupGroups_reduce : 0; return /*#__PURE__*/ _jsxs("div", { className: "space-y-6", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("h2", { className: "text-base font-semibold text-gray-900", children: "ПрПверка базы ЎаММых" }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-500 mt-0.5", children: "ДОагМПстОка О ОсправлеМОе прПблеЌ в базе ЎаММых" }) ] }), /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 overflow-hidden", children: [ /*#__PURE__*/ _jsxs("div", { className: "px-5 py-4 border-b border-gray-100 flex items-center justify-between", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("h3", { className: "text-sm font-semibold text-gray-800", children: "ДублОкаты МавыкПв" }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-0.5", children: "ППОск МавыкПв с ПЎОМакПвыЌ ОЌеМеЌ в ПЎМПй категПрОО. ПрО ПбъеЎОМеМОО — ссылкО в картПчках спецОалОстПв ПбМПвляются автПЌатОческО." }) ] }), /*#__PURE__*/ _jsxs("button", { onClick: findDuplicates, disabled: dedupLoading, 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: [ /*#__PURE__*/ _jsxs("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ _jsx("circle", { cx: "11", cy: "11", r: "8" }), /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M21 21l-4.35-4.35" }) ] }), dedupLoading ? 'Ищу ' : 'НайтО ЎублОкаты' ] }) ] }), dedupGroups !== null && /*#__PURE__*/ _jsx("div", { className: "p-5", children: dedupGroups.length === 0 ? /*#__PURE__*/ _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: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" }) }), "ДублОкатПв Ме МайЎеМП — база в пПряЎке" ] }) : /*#__PURE__*/ _jsxs("div", { className: "space-y-3", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between", children: [ /*#__PURE__*/ _jsxs("p", { className: "text-sm text-green-700 font-semibold", children: [ "НайЎеМП ", dedupGroups.length, " групп \xb7 ", totalDuplicates, " лОшМОх запОсей" ] }), /*#__PURE__*/ _jsx("button", { onClick: mergeAll, disabled: merging === '__all__', 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: merging === '__all__' ? 'ОбъеЎОМяю ' : "ОбъеЎОМОть все (".concat(dedupGroups.length, ")") }) ] }), dedupGroups.map((group)=>{ var _group_, _group_1; const key = gk(group); return /*#__PURE__*/ _jsxs("div", { className: "bg-white border border-orange-200 rounded-xl overflow-hidden shadow-sm", children: [ /*#__PURE__*/ _jsxs("div", { className: "px-4 py-2.5 bg-orange-50 border-b border-orange-100 flex items-center justify-between gap-3", children: [ /*#__PURE__*/ _jsxs("div", { className: "min-w-0", children: [ /*#__PURE__*/ _jsxs("span", { className: "text-sm font-semibold text-orange-800", children: [ "\xab", (_group_ = group[0]) === null || _group_ === void 0 ? void 0 : _group_.nameEl, "\xbb" ] }), /*#__PURE__*/ _jsx("span", { className: "ml-2 text-xs text-green-600 font-mono", children: (_group_1 = group[0]) === null || _group_1 === void 0 ? void 0 : _group_1.categorySlug }), /*#__PURE__*/ _jsxs("span", { className: "ml-2 text-xs text-orange-400", children: [ group.length, " варОаМта" ] }) ] }), /*#__PURE__*/ _jsx("button", { onClick: ()=>mergeGroup(key, group), disabled: !!merging, 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: merging === key ? 'ОбъеЎОМяю ' : 'ОбъеЎОМОть' }) ] }), /*#__PURE__*/ _jsx("div", { className: "divide-y divide-gray-50", children: group.map((skill)=>/*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-3 px-4 py-2.5 cursor-pointer hover:bg-gray-50 transition", children: [ /*#__PURE__*/ _jsx("input", { type: "radio", name: "dedup-global-".concat(key), checked: keepIds[key] === skill.id, onChange: ()=>setKeepIds((prev)=>({ ...prev, [key]: skill.id })), className: "accent-amber-600 shrink-0" }), /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 flex-wrap", children: [ /*#__PURE__*/ _jsx("span", { className: "text-sm font-medium text-gray-800", children: skill.nameEl }), skill.nameEn && skill.nameEn !== skill.nameEl && /*#__PURE__*/ _jsxs("span", { className: "text-xs text-gray-400", children: [ "EN: ", skill.nameEn ] }), skill.nameRu && skill.nameRu !== skill.nameEl && /*#__PURE__*/ _jsxs("span", { className: "text-xs text-gray-400", children: [ "RU: ", skill.nameRu ] }), skill.nameUk && /*#__PURE__*/ _jsxs("span", { className: "text-xs text-gray-400", children: [ "UK: ", skill.nameUk ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 mt-0.5", children: [ /*#__PURE__*/ _jsx("span", { className: "text-[11px] font-semibold ".concat(skill.usageCount > 0 ? 'text-green-600' : 'text-gray-400'), children: skill.usageCount > 0 ? "".concat(skill.usageCount, " ОспПльзПваМОй") : 'Ме ОспПльзПвался' }), /*#__PURE__*/ _jsxs("span", { className: "text-[11px] text-gray-300", children: [ "order: ", skill.order ] }), keepIds[key] === skill.id && /*#__PURE__*/ _jsx("span", { className: "text-[11px] font-bold text-amber-600 uppercase", children: "← ПставОть" }) ] }) ] }) ] }, skill.id)) }) ] }, key); }) ] }) }) ] }) ] }); } function LocTree(param) { let { rows, parentId, depth, locale, expanded, onToggle, onEdit, onDelete, onAddChild, t } = param; const children = rows.filter((r)=>{ var _r_parentId; return ((_r_parentId = r.parentId) !== null && _r_parentId !== void 0 ? _r_parentId : null) === parentId; }); if (children.length === 0) return null; return /*#__PURE__*/ _jsx(_Fragment, { children: children.sort((a, b)=>{ var _a_order, _b_order; return ((_a_order = a.order) !== null && _a_order !== void 0 ? _a_order : 0) - ((_b_order = b.order) !== null && _b_order !== void 0 ? _b_order : 0); }).map((loc)=>{ const hasChildren = rows.some((r)=>r.parentId === loc.id); const isOpen = expanded.has(loc.id); const name = (locale === 'en' ? loc.nameEn : locale === 'ru' ? loc.nameRu : locale === 'uk' ? loc.nameUk : loc.nameEl) || loc.nameEl || loc.slug; return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 px-4 py-3 hover:bg-gray-50 ".concat(!loc.isActive ? 'opacity-50' : ''), style: { paddingLeft: "".concat(16 + depth * 24, "px") }, children: [ /*#__PURE__*/ _jsx("button", { onClick: ()=>hasChildren && onToggle(loc.id), className: "w-5 h-5 flex items-center justify-center text-gray-400 rounded ".concat(hasChildren ? 'hover:bg-gray-200 cursor-pointer' : 'cursor-default'), children: hasChildren ? isOpen ? /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("polyline", { points: "6 9 12 15 18 9" }) }) : /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("polyline", { points: "9 18 15 12 9 6" }) }) : /*#__PURE__*/ _jsx("span", { className: "w-3.5 h-3.5 block" }) }), depth === 0 ? /*#__PURE__*/ _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: /*#__PURE__*/ _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" }) }) : /*#__PURE__*/ _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: [ /*#__PURE__*/ _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" }), /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 11a3 3 0 11-6 0 3 3 0 016 0z" }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ _jsx("span", { className: "font-medium text-gray-800 text-sm", children: name }), /*#__PURE__*/ _jsx("span", { className: "ml-2 text-xs text-gray-400", children: loc.nameEn }), /*#__PURE__*/ _jsxs("span", { className: "ml-1.5 font-mono text-xs text-gray-300", children: [ "/", loc.slug ] }) ] }), /*#__PURE__*/ _jsx("span", { className: "px-2 py-0.5 rounded-full text-xs font-medium ".concat(loc.isActive ? 'bg-green-100 text-green-700' : 'bg-gray-100 text-gray-500'), children: loc.isActive ? t('admin.cat.active') : t('admin.cat.inactive') }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-1 flex-shrink-0", children: [ depth === 0 && /*#__PURE__*/ _jsx("button", { onClick: ()=>onAddChild(loc.id), className: "text-xs px-2 py-1 rounded-lg bg-green-50 text-green-600 hover:bg-green-100 font-medium", title: t('admin.loc.add_district'), children: "+" }), /*#__PURE__*/ _jsx("button", { onClick: ()=>onEdit(loc), className: "text-xs px-2 py-1 rounded-lg bg-gray-100 text-gray-600 hover:bg-gray-200 font-medium", children: t('common.edit') }), /*#__PURE__*/ _jsx("button", { onClick: ()=>onDelete(loc.id, name), className: "text-xs px-2 py-1 rounded-lg bg-red-50 text-red-600 hover:bg-red-100 font-medium", children: t('common.delete') }) ] }) ] }), hasChildren && isOpen && /*#__PURE__*/ _jsx(LocTree, { rows: rows, parentId: loc.id, depth: depth + 1, locale: locale, expanded: expanded, onToggle: onToggle, onEdit: onEdit, onDelete: onDelete, onAddChild: onAddChild, t: t }) ] }, loc.id); }) }); } function CatTree(param) { let { rows, parentId, depth, locale, expanded, onToggle, onEdit, onDelete, onAddChild, skillsExpanded, skillsCache, skillsLoading, onToggleSkills, skillForm, skillSaving, onOpenAddSkill, onOpenEditSkill, onSaveSkill, onDeleteSkill, onCancelSkillForm, onSkillFormChange, t } = param; const children = rows.filter((r)=>{ var _r_parentId; return ((_r_parentId = r.parentId) !== null && _r_parentId !== void 0 ? _r_parentId : null) === parentId; }); if (children.length === 0) return null; return /*#__PURE__*/ _jsx(_Fragment, { children: children.sort((a, b)=>{ var _a_order, _b_order; return ((_a_order = a.order) !== null && _a_order !== void 0 ? _a_order : 0) - ((_b_order = b.order) !== null && _b_order !== void 0 ? _b_order : 0); }).map((cat)=>{ var _cat_names; const hasChildren = rows.some((r)=>r.parentId === cat.id); const isOpen = expanded.has(cat.id); const skillsOpen = skillsExpanded.has(cat.id); const isLoadingSkills = skillsLoading.has(cat.id); var _skillsCache_cat_slug; const skills = (_skillsCache_cat_slug = skillsCache[cat.slug]) !== null && _skillsCache_cat_slug !== void 0 ? _skillsCache_cat_slug : []; const name = (locale === 'en' ? cat.namesEn : locale === 'ru' ? cat.namesRu : locale === 'uk' ? cat.namesUk : cat.namesEl) || cat.namesEl || cat.slug; return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 px-4 py-3 hover:bg-gray-50 ".concat(!cat.isActive ? 'opacity-50' : ''), style: { paddingLeft: "".concat(16 + depth * 24, "px") }, children: [ /*#__PURE__*/ _jsx("button", { onClick: ()=>hasChildren && onToggle(cat.id), className: "w-5 h-5 flex items-center justify-center text-gray-400 rounded ".concat(hasChildren ? 'hover:bg-gray-200 cursor-pointer' : 'cursor-default'), children: hasChildren ? isOpen ? /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("polyline", { points: "6 9 12 15 18 9" }) }) : /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("polyline", { points: "9 18 15 12 9 6" }) }) : /*#__PURE__*/ _jsx("span", { className: "w-3.5 h-3.5 block" }) }), /*#__PURE__*/ _jsx("span", { className: "w-10 h-10 flex items-center justify-center rounded-xl bg-green-50", children: /*#__PURE__*/ _jsx(CategoryIcon, { icon: cat.icon, alt: name, className: "h-7 w-7 object-contain text-2xl leading-none", fallback: "\uD83D\uDCE6" }) }), /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ _jsx("span", { className: "font-medium text-gray-800 text-sm", children: name }), /*#__PURE__*/ _jsx("span", { className: "ml-2 text-xs text-gray-400", children: cat.namesEn || ((_cat_names = cat.names) === null || _cat_names === void 0 ? void 0 : _cat_names.en) }), /*#__PURE__*/ _jsxs("span", { className: "ml-1.5 font-mono text-xs text-gray-300", children: [ "/", cat.slug ] }) ] }), /*#__PURE__*/ _jsx("span", { className: "px-2 py-0.5 rounded-full text-xs font-medium ".concat(cat.isActive ? 'bg-green-100 text-green-700' : 'bg-gray-100 text-gray-500'), children: cat.isActive ? t('admin.cat.active') : t('admin.cat.inactive') }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-1 flex-shrink-0", children: [ /*#__PURE__*/ _jsxs("button", { onClick: ()=>onToggleSkills(cat), className: "text-xs px-2 py-1 rounded-lg font-medium flex items-center gap-1 ".concat(skillsOpen ? 'bg-amber-100 text-amber-700' : 'bg-amber-50 text-amber-600 hover:bg-amber-100'), title: "НавыкО", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-3 h-3", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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" }) }), skillsCache[cat.slug] ? skillsCache[cat.slug].length : t('admin.cat.skills', 'Skills') ] }), /*#__PURE__*/ _jsx("button", { onClick: ()=>onAddChild(cat.id), className: "text-xs px-2 py-1 rounded-lg bg-green-50 text-green-600 hover:bg-green-100 font-medium", title: t('admin.cat.add_child'), children: "+" }), /*#__PURE__*/ _jsx("button", { onClick: ()=>onEdit(cat), className: "text-xs px-2 py-1 rounded-lg bg-gray-100 text-gray-600 hover:bg-gray-200 font-medium", children: t('common.edit') }), /*#__PURE__*/ _jsx("button", { onClick: ()=>onDelete(cat.id, name), className: "text-xs px-2 py-1 rounded-lg bg-red-50 text-red-600 hover:bg-red-100 font-medium", children: t('common.delete') }) ] }) ] }), skillsOpen && /*#__PURE__*/ _jsx(SkillsPanel, { cat: cat, locale: locale, depth: depth, t: t, skills: skills, isLoading: isLoadingSkills, skillForm: skillForm, skillSaving: skillSaving, onOpenAddSkill: onOpenAddSkill, onOpenEditSkill: onOpenEditSkill, onSaveSkill: onSaveSkill, onDeleteSkill: onDeleteSkill, onCancelSkillForm: onCancelSkillForm, onSkillFormChange: onSkillFormChange }), hasChildren && isOpen && /*#__PURE__*/ _jsx(CatTree, { rows: rows, parentId: cat.id, depth: depth + 1, locale: locale, expanded: expanded, onToggle: onToggle, onEdit: onEdit, onDelete: onDelete, onAddChild: onAddChild, skillsExpanded: skillsExpanded, skillsCache: skillsCache, skillsLoading: skillsLoading, onToggleSkills: onToggleSkills, skillForm: skillForm, skillSaving: skillSaving, onOpenAddSkill: onOpenAddSkill, onOpenEditSkill: onOpenEditSkill, onSaveSkill: onSaveSkill, onDeleteSkill: onDeleteSkill, onCancelSkillForm: onCancelSkillForm, onSkillFormChange: onSkillFormChange, t: t }) ] }, cat.id); }) }); } // ─── SkillsPanel ──────────────────────────────────────────────────────────── // Self-contained component for the skill list + edit form + dedup panel per category const SKILL_LANG_LABELS = { nameEl: '🇬🇷 EL', nameEn: '🇬🇧 EN', nameRu: '🇷🇺 RU', nameUk: '🇺🇊 UK' }; function SkillForm(param) { let { form, saving, onSave, onCancel, onChange } = param; var _form_nameEl; var _form_order; return /*#__PURE__*/ _jsxs("div", { className: "bg-white border border-amber-200 rounded-xl p-4 shadow-sm", children: [ /*#__PURE__*/ _jsx("div", { className: "grid grid-cols-2 gap-3 mb-3", children: [ 'nameEl', 'nameEn', 'nameRu', 'nameUk' ].map((field, i)=>{ var _form_field; return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-[11px] font-semibold text-gray-500 mb-1 uppercase tracking-wide", children: SKILL_LANG_LABELS[field] }), /*#__PURE__*/ _jsx("input", { value: (_form_field = form[field]) !== null && _form_field !== void 0 ? _form_field : '', onChange: (e)=>onChange({ ...form, [field]: e.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: i === 0, placeholder: field === 'nameUk' ? 'МеПбПвʌязкПвП' : '' }) ] }, field); }) }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 pt-1 border-t border-gray-100", children: [ /*#__PURE__*/ _jsx("label", { className: "text-xs text-gray-400 font-medium", children: "ППряЎПк" }), /*#__PURE__*/ _jsx("input", { type: "number", value: (_form_order = form.order) !== null && _form_order !== void 0 ? _form_order : 0, onChange: (e)=>onChange({ ...form, order: Number(e.target.value) }), className: "w-16 border border-gray-200 rounded-lg px-2 py-1 text-xs text-center" }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-2 ml-auto", children: [ /*#__PURE__*/ _jsx("button", { onClick: onCancel, className: "px-3 py-1.5 bg-gray-100 text-gray-600 rounded-lg text-xs font-medium hover:bg-gray-200 transition", children: "ОтЌеМа" }), /*#__PURE__*/ _jsx("button", { onClick: onSave, disabled: saving || !((_form_nameEl = form.nameEl) === null || _form_nameEl === void 0 ? void 0 : _form_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: saving ? 'СПхраМяю ' : 'СПхраМОть' }) ] }) ] }) ] }); } function SkillsPanel(param) { let { cat, locale, depth, t, skills, isLoading, skillForm, skillSaving, onOpenAddSkill, onOpenEditSkill, onSaveSkill, onDeleteSkill, onCancelSkillForm, onSkillFormChange } = param; const showAddForm = (skillForm === null || skillForm === void 0 ? void 0 : skillForm.catSlug) === cat.slug && !(skillForm === null || skillForm === void 0 ? void 0 : skillForm.id); return /*#__PURE__*/ _jsxs("div", { className: "border-t border-amber-100 bg-gradient-to-b from-amber-50/60 to-white", style: { paddingLeft: "".concat(16 + depth * 24 + 36, "px"), paddingRight: '16px', paddingTop: '14px', paddingBottom: '14px' }, children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 mb-3", children: [ /*#__PURE__*/ _jsx("span", { className: "text-xs font-bold text-amber-700 uppercase tracking-wider", children: "НавыкО" }), /*#__PURE__*/ _jsxs("span", { className: "text-xs text-amber-500 font-mono", children: [ "/", cat.slug ] }), /*#__PURE__*/ _jsxs("span", { className: "ml-1 text-xs text-amber-400", children: [ "(", skills.length, ")" ] }), /*#__PURE__*/ _jsx("div", { className: "ml-auto", children: /*#__PURE__*/ _jsxs("button", { onClick: ()=>{ onCancelSkillForm(); onOpenAddSkill(cat.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: [ /*#__PURE__*/ _jsxs("svg", { className: "w-3 h-3", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: [ /*#__PURE__*/ _jsx("line", { x1: "12", y1: "5", x2: "12", y2: "19" }), /*#__PURE__*/ _jsx("line", { x1: "5", y1: "12", x2: "19", y2: "12" }) ] }), "ДПбавОть" ] }) }) ] }), isLoading ? /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 py-3 text-xs text-gray-400", children: [ /*#__PURE__*/ _jsxs("svg", { className: "w-3.5 h-3.5 animate-spin", fill: "none", viewBox: "0 0 24 24", children: [ /*#__PURE__*/ _jsx("circle", { cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4", className: "opacity-25" }), /*#__PURE__*/ _jsx("path", { fill: "currentColor", d: "M4 12a8 8 0 018-8v8z", className: "opacity-75" }) ] }), "Загрузка " ] }) : /*#__PURE__*/ _jsxs("div", { className: "space-y-1", children: [ skills.length === 0 && !showAddForm && /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 italic py-2", children: "НавыкО Ме ЎПбавлеМы" }), skills.map((skill)=>{ const isEditingThis = (skillForm === null || skillForm === void 0 ? void 0 : skillForm.id) === skill.id; const skillName = locale === 'en' ? skill.nameEn : locale === 'ru' ? skill.nameRu : locale === 'uk' ? skill.nameUk || skill.nameEn : skill.nameEl; return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 rounded-lg px-3 py-2 group transition ".concat(isEditingThis ? 'bg-amber-50 border border-amber-200' : 'bg-white border border-gray-100 hover:border-amber-200 hover:bg-amber-50/30'), children: [ /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ _jsx("span", { className: "text-sm font-medium text-gray-800", children: skillName }), locale !== 'en' && skill.nameEn && /*#__PURE__*/ _jsx("span", { className: "ml-2 text-xs text-gray-400", children: skill.nameEn }), locale !== 'ru' && skill.nameRu && skill.nameRu !== skill.nameEl && /*#__PURE__*/ _jsx("span", { className: "ml-1.5 text-xs text-gray-300", children: skill.nameRu }) ] }), skill.order > 0 && /*#__PURE__*/ _jsxs("span", { className: "text-[10px] text-gray-300 font-mono", children: [ "#", skill.order ] }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-1 transition-opacity ".concat(isEditingThis ? 'opacity-100' : 'opacity-0 group-hover:opacity-100'), children: [ /*#__PURE__*/ _jsx("button", { onClick: ()=>isEditingThis ? onCancelSkillForm() : (onCancelSkillForm(), onOpenEditSkill(skill, cat.slug)), className: "text-xs px-2 py-0.5 rounded-md font-medium transition ".concat(isEditingThis ? 'bg-amber-100 text-amber-700' : 'bg-gray-100 text-gray-600 hover:bg-amber-100 hover:text-amber-700'), children: isEditingThis ? '✕' : t('common.edit') }), /*#__PURE__*/ _jsx("button", { onClick: ()=>onDeleteSkill(skill, cat.slug), className: "text-xs px-2 py-0.5 rounded-md bg-red-50 text-red-600 hover:bg-red-100 transition", children: t('common.delete') }) ] }) ] }), isEditingThis && /*#__PURE__*/ _jsx("div", { className: "mt-1 mb-1 ml-0", children: /*#__PURE__*/ _jsx(SkillForm, { form: skillForm, saving: skillSaving, onSave: onSaveSkill, onCancel: onCancelSkillForm, onChange: onSkillFormChange }) }) ] }, skill.id); }), showAddForm && /*#__PURE__*/ _jsx("div", { className: "mt-2", children: /*#__PURE__*/ _jsx(SkillForm, { form: skillForm, saving: skillSaving, onSave: onSaveSkill, onCancel: onCancelSkillForm, onChange: onSkillFormChange }) }) ] }) ] }); } function Pagination(param) { let { page, total, limit, onChange, totalLabel } = param; const pages = Math.ceil(total / limit); if (pages <= 1) return null; return /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between px-4 py-3 border-t border-gray-100 text-sm text-gray-500", children: [ /*#__PURE__*/ _jsxs("span", { children: [ totalLabel, ": ", total ] }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-1", children: [ /*#__PURE__*/ _jsx("button", { onClick: ()=>onChange(page - 1), disabled: page === 1, className: "px-3 py-1 rounded-lg border border-gray-200 disabled:opacity-40 hover:bg-gray-50", children: "←" }), /*#__PURE__*/ _jsxs("span", { className: "px-3 py-1", children: [ page, " / ", pages ] }), /*#__PURE__*/ _jsx("button", { onClick: ()=>onChange(page + 1), disabled: page >= pages, className: "px-3 py-1 rounded-lg border border-gray-200 disabled:opacity-40 hover:bg-gray-50", children: "→" }) ] }) ] }); } // ── Activity log helpers ────────────────────────────────────────────────── function parseLogDetails(details) { try { return details ? JSON.parse(details) : null; } catch (e) { return null; } } const EVENT_META = { 'user.login': { icon: /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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: /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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: /*#__PURE__*/ _jsxs("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ _jsx("circle", { cx: "12", cy: "12", r: "10" }), /*#__PURE__*/ _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: /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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: /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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: /*#__PURE__*/ _jsxs("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ _jsx("circle", { cx: "12", cy: "12", r: "10" }), /*#__PURE__*/ _jsx("line", { x1: "15", y1: "9", x2: "9", y2: "15" }), /*#__PURE__*/ _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: /*#__PURE__*/ _jsxs("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ _jsx("polyline", { points: "3 6 5 6 21 6" }), /*#__PURE__*/ _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: /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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: /*#__PURE__*/ _jsxs("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ _jsx("line", { x1: "18", y1: "6", x2: "6", y2: "18" }), /*#__PURE__*/ _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: /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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 ActivityLogRow(param) { let { entry, dateLocale, onFilterUser, t } = param; var _EVENT_META_entry_event; const meta = (_EVENT_META_entry_event = EVENT_META[entry.event]) !== null && _EVENT_META_entry_event !== void 0 ? _EVENT_META_entry_event : { icon: /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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: entry.event, color: 'bg-gray-50 text-gray-700 border-gray-200' }; const details = parseLogDetails(entry.details); return /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 px-4 py-3 flex items-start gap-3", children: [ /*#__PURE__*/ _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 ".concat(meta.color), children: [ meta.icon, " ", t(meta.labelKey, meta.labelKey) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 flex-wrap", children: [ entry.userName && /*#__PURE__*/ _jsx("button", { onClick: ()=>entry.userId && onFilterUser(entry.userId), className: "text-sm font-medium text-gray-800 hover:text-green-600", children: entry.userName }), entry.userEmail && /*#__PURE__*/ _jsx("span", { className: "text-xs text-gray-400", children: entry.userEmail }) ] }), details && Object.keys(details).length > 0 && /*#__PURE__*/ _jsx("div", { className: "mt-1 flex flex-wrap gap-2", children: Object.entries(details).map((param)=>{ let [k, v] = param; return /*#__PURE__*/ _jsxs("span", { className: "text-xs bg-gray-100 text-gray-600 px-2 py-0.5 rounded", children: [ k, ": ", /*#__PURE__*/ _jsx("span", { className: "font-medium", children: String(v) }) ] }, k); }) }), entry.ipAddress && /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-0.5", children: entry.ipAddress }) ] }), /*#__PURE__*/ _jsx("time", { className: "shrink-0 text-xs text-gray-400 whitespace-nowrap", children: new Date(entry.createdAt).toLocaleString(dateLocale) }) ] }); } const MONTH_NAMES = [ 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec' ]; function AdminMonthChart(param) { let { series, dateLocale = 'en-US' } = param; // Collect all unique months from all series, sorted const monthSet = new Set(); series.forEach((s)=>s.data.forEach((r)=>monthSet.add(r.month))); const months = Array.from(monthSet).sort(); if (months.length === 0) return null; // Build lookup maps const seriesVals = series.map((s)=>{ const map = {}; s.data.forEach((r)=>{ map[r.month] = Number(r.count); }); return months.map((m)=>{ var _map_m; return (_map_m = map[m]) !== null && _map_m !== void 0 ? _map_m : 0; }); }); const allVals = seriesVals.flat(); const maxVal = Math.max(...allVals, 1); const W = 700; const H = 160; const padL = maxVal >= 1000000 ? 50 : maxVal >= 10000 ? 44 : maxVal >= 1000 ? 40 : 36; const padB = 24; const chartH = H - padB; const totalBars = months.length * series.length; const groupW = (W - padL - 8) / months.length; const barW = Math.max(4, Math.min(20, groupW / series.length - 2)); const yTicks = [ 0, Math.round(maxVal / 3), Math.round(maxVal * 2 / 3), maxVal ]; function barX(mi, si) { const groupStart = padL + mi * groupW + (groupW - series.length * (barW + 1)) / 2; return groupStart + si * (barW + 1); } function barHeight(v) { return v / maxVal * chartH; } return /*#__PURE__*/ _jsx("div", { className: "overflow-x-auto", children: /*#__PURE__*/ _jsxs("svg", { viewBox: "0 0 ".concat(W, " ").concat(H + 14), className: "w-full", style: { minWidth: Math.max(360, months.length * 40) }, children: [ yTicks.map((v, i)=>{ const y = chartH - v / maxVal * chartH; return /*#__PURE__*/ _jsxs("g", { children: [ /*#__PURE__*/ _jsx("line", { x1: padL, y1: y, x2: W - 4, y2: y, stroke: "#f3f4f6", strokeWidth: 1 }), /*#__PURE__*/ _jsx("text", { x: padL - 5, y: y + 3.5, textAnchor: "end", fontSize: 9, fill: "#9ca3af", children: fmtYLabel(v) }) ] }, i); }), months.map((m, mi)=>series.map((s, si)=>{ const v = seriesVals[si][mi]; const bh = barHeight(v); const x = barX(mi, si); return /*#__PURE__*/ _jsx("rect", { x: x, y: chartH - bh, width: barW, height: bh, fill: s.color, opacity: 0.8, rx: 2 }, "bar-".concat(mi, "-").concat(si)); })), months.map((m, mi)=>{ const [yr, mo] = m.slice(0, 7).split('-').map(Number); const d = new Date(Date.UTC(yr, mo - 1, 2)); const label = new Intl.DateTimeFormat(dateLocale, { month: 'short' }).format(d) + (mi === 0 || mo === 1 ? " ".concat(yr) : ''); const cx = padL + mi * groupW + groupW / 2; return /*#__PURE__*/ _jsx("text", { x: cx, y: H + 12, textAnchor: "middle", fontSize: 9, fill: "#9ca3af", children: label }, "xl-".concat(mi)); }), /*#__PURE__*/ _jsx("line", { x1: padL, y1: chartH, x2: W - 4, y2: chartH, stroke: "#e5e7eb", strokeWidth: 1 }) ] }) }); } function getLast30Days() { const days = []; for(let i = 29; i >= 0; i--){ const d = new Date(Date.now() - i * 86400000); days.push(d.toISOString().slice(0, 10)); } return days; } function smoothPath(pts) { if (pts.length < 2) return ''; let d = "M ".concat(pts[0][0].toFixed(1), " ").concat(pts[0][1].toFixed(1)); for(let i = 1; i < pts.length; i++){ const cpx = ((pts[i - 1][0] + pts[i][0]) / 2).toFixed(1); d += " C ".concat(cpx, " ").concat(pts[i - 1][1].toFixed(1), " ").concat(cpx, " ").concat(pts[i][1].toFixed(1), " ").concat(pts[i][0].toFixed(1), " ").concat(pts[i][1].toFixed(1)); } return d; } function fmtYLabel(v) { if (v >= 1000000) return "".concat(+(v / 1000000).toFixed(1), "M"); if (v >= 1000) return "".concat(Math.round(v / 1000), "K"); return String(v); } function AdminAreaChart(param) { let { series, days: daysProp } = param; const days = daysProp !== null && daysProp !== void 0 ? daysProp : getLast30Days(); const seriesVals = series.map((s)=>{ const map = {}; s.data.forEach((r)=>{ map[r.day] = Number(r.count); }); return days.map((d)=>{ var _map_d; return (_map_d = map[d]) !== null && _map_d !== void 0 ? _map_d : 0; }); }); const allVals = seriesVals.flat(); const maxVal = Math.max(...allVals, 1); const W = 700; const H = 160; const padL = maxVal >= 10000 ? 44 : maxVal >= 1000 ? 40 : 36; const padB = 22; const chartW = W - padL - 4; const chartH = H - padB; const stepX = chartW / (days.length - 1); function pts(vals) { return vals.map((v, i)=>[ padL + i * stepX, chartH - v / maxVal * chartH ]); } function areaPath(vals) { const points = pts(vals); const line = smoothPath(points); if (!line) return ''; const lastX = points[points.length - 1][0].toFixed(1); return "".concat(line, " L ").concat(lastX, " ").concat(chartH.toFixed(1), " L ").concat(padL.toFixed(1), " ").concat(chartH.toFixed(1), " Z"); } // Y-axis: 4 labels (0, 1/3, 2/3, max) const yTicks = [ 0, Math.round(maxVal / 3), Math.round(maxVal * 2 / 3), maxVal ]; // X-axis: every 7 days + last const xTicks = days.map((d, i)=>({ i, label: d.slice(8) })).filter((_, i)=>i % 7 === 0 || i === days.length - 1); return /*#__PURE__*/ _jsx("div", { className: "overflow-x-auto", children: /*#__PURE__*/ _jsxs("svg", { viewBox: "0 0 ".concat(W, " ").concat(H + 12), className: "w-full", style: { minWidth: 360 }, children: [ yTicks.map((v, i)=>{ const y = chartH - v / maxVal * chartH; return /*#__PURE__*/ _jsxs("g", { children: [ /*#__PURE__*/ _jsx("line", { x1: padL, y1: y, x2: W - 4, y2: y, stroke: "#f3f4f6", strokeWidth: 1 }), /*#__PURE__*/ _jsx("text", { x: padL - 5, y: y + 3.5, textAnchor: "end", fontSize: 9, fill: "#9ca3af", children: fmtYLabel(v) }) ] }, i); }), xTicks.map((param)=>{ let { i } = param; const x = padL + i * stepX; return /*#__PURE__*/ _jsx("line", { x1: x, y1: 0, x2: x, y2: chartH, stroke: "#f9fafb", strokeWidth: 1 }, "vg-".concat(i)); }), xTicks.map((param)=>{ let { i, label } = param; return /*#__PURE__*/ _jsx("text", { x: padL + i * stepX, y: H + 10, textAnchor: "middle", fontSize: 9, fill: "#9ca3af", children: label }, i); }), series.map((s, si)=>/*#__PURE__*/ _jsx("path", { d: areaPath(seriesVals[si]), fill: s.fill }, "fill-".concat(si))), series.map((s, si)=>/*#__PURE__*/ _jsx("path", { d: smoothPath(pts(seriesVals[si])), fill: "none", stroke: s.color, strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round" }, "line-".concat(si))), series.map((s, si)=>{ const points = pts(seriesVals[si]); const last = points[points.length - 1]; return /*#__PURE__*/ _jsx("g", { children: /*#__PURE__*/ _jsx("circle", { cx: last[0], cy: last[1], r: 4, fill: "white", stroke: s.color, strokeWidth: 2 }) }, "dot-".concat(si)); }), /*#__PURE__*/ _jsx("line", { x1: padL, y1: chartH, x2: W - 4, y2: chartH, stroke: "#e5e7eb", strokeWidth: 1 }) ] }) }); } 61146undefined148199undefined201244undefined246274undefined276315undefined317361undefined363395undefined397432undefined434484undefined486532undefined534590undefined83738377(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined84668470(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined86508653(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined88168819(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined88218832_components_CategoryIcon__WEBPACK_IMPORTED_MODULE_7__/* .CategoryIcon */ .Ezundefined91539156(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined95239527(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined96549658(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1009110094(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1090610909(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1112311126(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1132011323(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1146411467(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1171111715(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1225912262(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1226412275_components_CategoryIcon__WEBPACK_IMPORTED_MODULE_7__/* .CategoryIcon */ .Ezundefined1260512608(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1306713074(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined1311613123(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined1317813185(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined1321013215(0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)undefined1322813236(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined1392713931(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1403714041(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1447314476(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1478014783(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1505015053(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1523015233(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1559015593(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1587615880(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1612616129(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1628316286(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1742417428(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1752517529(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1839618399(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1840118412_components_CategoryIcon__WEBPACK_IMPORTED_MODULE_7__/* .CategoryIcon */ .Ezundefined1882718830(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1910819111(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1959719600(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2009820102(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2072520728(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2095320956(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2153121538(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined2158021587(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined2163821645(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined2167021675(0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)undefined2168821696(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined2238622390(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2249622500(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2293222936(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2327023273(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2359223595(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2390523908(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2408524088(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2444524448(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2473124735(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2498124984(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2513825141(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2626426268(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2636526369(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2721527218(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2751827521(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2788627889(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2816628169(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2865528658(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2915329157(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2977629779(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3000430007(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3044730461undefined3054930557(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)undefined3060330612(0,_lib_auth__WEBPACK_IMPORTED_MODULE_4__/* .useSession */ .wV)undefined3064330651(0,_context_locale__WEBPACK_IMPORTED_MODULE_5__/* .useLocale */ .Y)undefined3068230689(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3075330760(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3077430782(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined3090030907(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3095930966(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3101131018(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3106431071(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3110931116(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3116531172(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3121731224(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3127431281(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3132631333(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3137931386(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3142431431(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3148031487(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3153631543(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3159931606(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3165531662(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3171231719(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3178331790(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3188031887(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3195231959(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3202532032(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3210232109(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3217332180(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3225732264(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3231332320(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3237032377(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3242932436(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3248532492(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3253532542(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3259532602(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3265732664(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3272532732(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3279532802(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3285532862(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3290532912(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3295632963(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3303233039(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3309233099(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3314933156(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3320833215(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3327033277(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3333633343(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3339833405(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3346833475(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3353333540(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3358533592(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3363433641(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3368533692(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3374333750(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3379733804(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3385933866(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3393333940(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3401234019(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3407234079(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3413334140(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3419234199(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3425434261(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3432234329(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3438634393(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3447434481(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3452634533(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3460534612(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3466334670(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3471834725(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3477734784(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3483334840(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3488934896(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3495434961(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3503035037(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3509435101(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3515935166(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3521835225(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3528335290(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3533935346(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3539935406(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3547335480(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3554035547(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3559435601(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3565635663(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3571835725(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3578135788(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3583135838(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3588735894(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3595535962(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3600336010(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3605736064(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3611636123(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3618936196(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3623736244(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3629136298(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3635036357(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3642336430(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3648436491(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3655836565(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3667636683(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3674536752(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3681136818(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3687036877(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3692836935(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3700337010(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3706637073(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3723237239(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3729337300(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3734637353(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3756637573(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3762137628(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3769037697(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3775737764(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3782137828(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined4708847095(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined4715247159(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined4721647223(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined4729147298(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined4734447351(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined4757747584(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined4763247639(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined4769347700(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined4782347830(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined4788647893(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined4793747944(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined4830548312(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined4835848365(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined4841548422(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined4847148478(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined4870348710(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined4876248769(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined4882348830(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined4910149108(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined4916449171(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined4924149248(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined4932249329(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined4940549412(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined4949149498(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined4955349560(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined4962549632(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined4970349710(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined4979049797(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined4987449881(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined4994349950(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined5000450011(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined5007650083(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined5014750154(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined5021150218(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined5027850285(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined5034450351(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined5039850405(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined5046250469(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined5081050817(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined5088050887(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined5093550942(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined5099751004(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined5107551082(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined5112551132(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined5118551192(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined5132851335(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined5139651403(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined5146751474(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined5160551612(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined5168051687(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined5173251739(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined5178251789(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined5183251839(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined5190351910(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined5196551972(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined5202352030(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined5208052087(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined5213452141(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined5218452191(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined5236352371(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined5268952697(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined5274352759_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminStats */ .dEundefined5280152822_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminNotifStats */ .biundefined5287052890_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminMailStats */ .u4undefined5293652954_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminReports */ .z5undefined5303653062_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminSpecialistCards */ .s_undefined5317153179(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined5327053286_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminUsers */ .cSundefined5358353591(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined5368253698_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminTasks */ .Yjundefined5399954007(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined5410054118_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminReports */ .z5undefined5434354351(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined5446254488_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminSpecialistCards */ .s_undefined5477054778(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined5512355148_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminSupportTickets */ .KZundefined5543755445(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined5553955564_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminBalanceHistory */ .g0undefined5595955967(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined5610056117_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminAiLogs */ .j_undefined5633456357_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminActivityLogs */ .yOundefined5699957018_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminMailLogs */ .qtundefined5758857608_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminNotifLogs */ .Brundefined5853258540(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined5869358701(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined5881458822(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined5895458962(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined5902759043_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminPlans */ .OXundefined5913059138(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined5924659269_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getTranslationsStats */ .YQundefined5941459422(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined5948859494(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .request */ .Em)undefined5963259638(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .request */ .Em)undefined5977359779(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .request */ .Em)undefined5991559923(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined6002760047_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminReferrals */ .cJundefined6026060268(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined6036060376_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminPlans */ .OXundefined6050160509(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined6059760605(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined6069560703(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined6145461475_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .adminBroadcastPush */ .V7undefined6166961691_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .adminSendPushToUser */ .g1undefined6206262079_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .deactivateUser */ .Wiundefined6208362098_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .activateUser */ .Heundefined6231462331_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .changeUserRole */ .Mmundefined6291362928_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminUser */ .jdundefined6424964267_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updateAdminUser */ .wlundefined6580165829_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .adminUpdateSpecialistCard */ .oqundefined6682266845_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .verifyAdminUserEmail */ .uQundefined6752267546_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .adminTopUpUserBalance */ .P0undefined6802168046_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminBalanceHistory */ .g0undefined6872968756_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .adminWithdrawUserBalance */ .hDundefined6924069265_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminBalanceHistory */ .g0undefined7004470072_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .adminUpdateSpecialistCard */ .oqundefined7100871036_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .adminUpdateSpecialistCard */ .oqundefined7149871516_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminReports */ .z5undefined7159871624_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminSpecialistCards */ .s_undefined7176871786_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .cancelTaskAdmin */ .nfundefined7232772345_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .deleteTaskAdmin */ .GBundefined7267772698_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updateReportStatus */ .eUundefined7290872916(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined7298573005_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminLocations */ .k_undefined7517075187_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updateLocation */ .Ntundefined7535675373_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .createLocation */ .yJundefined7615076167_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .deleteLocation */ .zRundefined7649576503(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined7657376594_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminCategories */ .KDundefined7668076688(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined8002580055"https://api.canhelp.gr"undefined80060800820undefined8104081057_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updateCategory */ .$7undefined8122681243_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .createCategory */ .zZundefined8206882085_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .deleteCategory */ .K7undefined8289782914_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminSkills */ .i_undefined8446384477_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updateSkill */ .fPundefined8522285236_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .createSkill */ .S9undefined8634686360_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .deleteSkill */ .hpundefined9662896641_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updatePlan */ .tdundefined9681396826_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .createPlan */ .qTundefined9710497120_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminPlans */ .OXundefined9745197464_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .deletePlan */ .bRundefined9758197589(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined9768497700_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminPlans */ .OXundefined9774597764_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminSettings */ .rCundefined106399106424_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminEmailTemplates */ .Lpundefined106896106918_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updateAdminSettings */ .CXundefined107462107484_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updateAdminSettings */ .CXundefined108665108692_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updateAdminEmailTemplate */ .jgundefined108793108823_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .translateAdminEmailTemplate */ .wcundefined109527109554_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updateAdminEmailTemplate */ .jgundefined109920109947_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updateAdminEmailTemplate */ .jgundefined110392110414_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updateAdminSettings */ .CXundefined111167111189_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updateAdminSettings */ .CXundefined111663111685_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updateAdminSettings */ .CXundefined112679112701_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updateAdminSettings */ .CXundefined113440113462_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updateAdminSettings */ .CXundefined115079115104_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .testTelegramConnection */ .qXundefined116325116347_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .verifyTelegramToken */ .clundefined116946116949(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined117982117985(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined118228118231(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined118708118712(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined118977118980(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined119216119219(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined119388119391(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined119754119757(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined120000120003(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined120500120503(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined120746120749(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined121223121227(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined121492121495(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined121810121813(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined122146122149(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined122392122395(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined122943122947(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined123212123215(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined123494123497(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined123861123865(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined124130124133(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined124398124401(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined124762124766(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined125031125034(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined125308125311(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined125631125635(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined125900125903(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined126026126029(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined126358126362(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined126627126630(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined126801126804(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined127721127724(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined127967127970(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined128417128420(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined128663128666(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined129067129070(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined129313129316(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined129689129692(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined129935129938(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined130352130356(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined130621130624(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined130829130832(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined131066131069(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined131304131307(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined131656131659(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined131902131905(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined134379134382(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined134471134475(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined134594134598(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined134752134756(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined134919134922(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined135183135186(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined135439135442(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined135729135733(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined135735135738(next_link__WEBPACK_IMPORTED_MODULE_3___default())undefined135990135993(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined136342136345(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined136804136808(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined136934136937(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined137125137129(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined137339137342(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined137850137853(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined138330138333(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined138887138891(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined139515139518(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined139853139857(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined140101140104(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined140330140333(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined141061141065(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined141238141242(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined141415141418(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined141908141911(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined142382142385(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined143280143284(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined143817143820(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined144700144703(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined145626145629(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined146100146103(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined147048147051(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined147522147525(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined148502148505(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined148976148979(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined150048150052(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined150310150313(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined150623150626(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined150994150997(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined151570151574(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined151808151812(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined152062152065(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined152407152411(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined152679152683(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined152969152972(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined153510153514(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined153800153803(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined154348154352(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined154638154641(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined155389155392(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined157167157171(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined157405157408(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined157726157729(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined161886161890(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined162199162202(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined162583162586(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined162831162834(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined163491163494(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined163881163885(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined164875164879(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined165113165117(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined165367165370(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined165717165721(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined166005166008(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined166596166599(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined167402167406(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined167640167644(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined167894167897(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined168243168247(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined168531168534(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined169118169121(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined169906169910(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined170154170158(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined170403170406(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined170748170752(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined171020171024(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined171310171313(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined171851171855(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined172141172144(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined172888172892(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined173126173130(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined173424173427(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined173807173810(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined174324174328(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined174616174619(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined174995174998(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined175508175512(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined175808175811(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined176186176190(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined177242177245(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined179170179174(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined179287179291(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined179494179498(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined180008180011(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined180635180638(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined181205181209(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined181642181645(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined181958181961(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined182281182284(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined182776182780(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined183026183030(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined183258183261(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined183453183457(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined183625183628(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined184016184019(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined184408184411(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined184799184802(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined185198185201(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined185595185598(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined185988185991(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined186426186429(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined186635186638(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined186736186739(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined187212187215(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined187313187316(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined188013188017(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined188292188295(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined188517188531(0,_lib_formatName__WEBPACK_IMPORTED_MODULE_8__/* .formatShortName */ .H)undefined188728188731(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined189111189114(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined189324189327(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined189997190000(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined190460190464(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined191043191046(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined191501191504(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined191929191932(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined192142192145(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined192792192795(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined193016193020(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined193353193356(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined193811193814(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined194503194506(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined195373195376(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined196732196735(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined197404197408(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined197521197525(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined197738197741(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined198348198352(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined198789198792(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined199125199128(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined199458199461(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined199812199815(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined200163200166(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined200700200704(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined200950200954(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined201182201185(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined201377201381(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined201549201552(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined201940201943(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined202357202360(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined202768202771(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined203180203183(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined203601203604(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined204184204187(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined204393204396(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined204494204497(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined204976204979(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined205077205080(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined206132206136(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined206421206425(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined206717206720(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined207147207150(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined207733207736(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined207946207949(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined208535208539(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined209439209442(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined209666209670(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined210616210619(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined211023211026(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined211816211819(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined212491212495(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined212608212612(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined212815212819(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined213329213332(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined213956213959(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined214526214530(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined214967214970(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined215712215715(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined216224216228(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined216474216478(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined216706216709(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined216901216905(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined217073217076(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined217465217468(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined217860217863(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined218253218256(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined218646218649(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined219040219043(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined219478219481(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined219687219690(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined219788219791(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined220264220267(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined220365220368(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined221194221198(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined221473221476(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined221721221724(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined221726221729(next_link__WEBPACK_IMPORTED_MODULE_3___default())undefined222538222541(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined223067223070(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined223280223283(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined223988223991(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined224225224235(0,_lib_taskLocale__WEBPACK_IMPORTED_MODULE_9__/* .formatPrice */ .$g)undefined224424224427(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined224855224858(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined225079225083(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined225465225468(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined226106226109(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined227445227448(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined228119228123(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined228236228240(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined228466228469(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined228762228766(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined229479229483(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined229726229730(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined230104230108(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined230811230815(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined231069231073(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined231234231237(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined231621231624(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined232597232601(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined232762232765(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined233149233152(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined234265234269(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined234430234433(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined234818234821(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined235791235795(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined235956235960(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined236592236595(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined237477237481(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined237642237646(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined238278238281(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined239163239167(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined239328239332(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined239964239967(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined240849240853(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined241014241018(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined241650241653(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined242646242650(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined242914242917(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined243747243751(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined243973243976(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined244577244580(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined245260245263(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined245491245494(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined245745245748(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined247596247600(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined247713247717(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined247943247946(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined248239248243(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined248956248960(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined249203249207(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined249581249585(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined250285250289(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined250543250547(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined250708250711(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined251095251098(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined252077252081(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined252242252246(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined252878252881(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined253761253765(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined253926253930(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined254562254565(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined255445255449(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined255610255614(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined256246256249(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined257129257133(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined257294257298(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined257930257933(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined258910258914(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined259154259158(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined259398259401(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined259786259789(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined260773260777(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined261065261068(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined262083262087(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined262309262312(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined262913262916(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined263596263599(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined263827263830(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined264081264084(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined264986264990(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined265173265176(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined265433265436(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined265907265910(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined266102266106(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined266356266360(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined266610266614(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined266912266915(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined267503267506(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined268070268074(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined268737268740(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined268742268745(next_link__WEBPACK_IMPORTED_MODULE_3___default())undefined269377269381(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined270431270435(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined270894270897(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined271434271437(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined271788271791(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined272323272327(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined272587272590(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined273140273143(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined273990273993(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined274533274537(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined274710274714(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined274927274931(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined275189275192(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined275546275549(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined275902275905(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined276387276391(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined276649276652(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined277004277007(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined277359277362(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined277948277951(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined278216278219(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined278489278493(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined278690278694(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined278839278842(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined279215279218(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined279435279438(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined280037280040(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined280272280276(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined280596280600(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined280910280914(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined281272281275(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined281821281824(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined282479282482(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined282734282737(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined282739282742(next_link__WEBPACK_IMPORTED_MODULE_3___default())undefined283635283638(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined284238284242(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined284562284565(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined285234285237(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined286479286483(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined286628286631(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined286999287002(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined287218287221(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined287809287812(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined288044288048(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined288368288372(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined288682288686(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined289044289047(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined289589289592(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined290247290250(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined290502290505(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined290507290510(next_link__WEBPACK_IMPORTED_MODULE_3___default())undefined291403291406(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined292006292009(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined293054293057(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined293752293756(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined293869293872(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined295285295288(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined295910295914(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined296043296047(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined296297296301(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined296907296911(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined297144297161_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminAiLogs */ .j_undefined297824297828(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined298447298450(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined298731298734(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined299659299662(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined299940299943(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined300203300206(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined300409300413(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined300653300656(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined300878300882(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined301058301061(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined301450301453(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined301846301849(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined302239302242(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined302633302636(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined303026303029(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined303417303420(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined303809303812(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined304203304206(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined304594304597(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined305178305181(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined305634305638(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined305934305937(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined306394306397(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined306615306618(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined307237307240(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined307656307659(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined308058308061(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined308542308545(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined309046309049(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined309554309557(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined310056310059(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined310556310559(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined310803310806(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined311059311062(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined311725311728(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined312138312141(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined312561312565(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined313322313325(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined313960313963(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined315341315344(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined315952315956(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined316085316089(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined316383316387(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined316548316551(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined316941316945(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined317482317485(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined317894317897(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined318508318512(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined318673318676(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined319065319068(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined319770319774(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined319935319938(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined320325320328(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined321101321105(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined321940321944(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined322561322564(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined323079323082(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined323930323934(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined324683324686(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined324950324953(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined325141325144(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined325889325892(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined326508326512(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined326641326645(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined326939326943(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined327104327107(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined327493327497(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined328026328029(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined328430328433(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined329094329098(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined329259329262(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined329647329650(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined330344330348(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined330509330512(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined330895330898(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined331633331637(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined332373332377(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined332994332997(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined333512333515(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined334359334363(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined335100335103(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined335363335366(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined335569335573(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined335813335816(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined336038336042(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined336218336221(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined336610336613(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined337007337010(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined337400337403(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined337796337799(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined338191338194(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined338775338778(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined340147340151(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined340457340460(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined340919340922(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined341320341323(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined341541341544(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined342140342143(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined342540342543(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined342784342787(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined343398343401(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined343641343644(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined344020344023(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined344686344689(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined345099345102(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined345484345488(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined346245346248(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined346883346886(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined348266348269(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined348882348886(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined349015349019(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined349313349317(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined349478349481(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined349872349876(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined350413350416(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined350812350815(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined351426351430(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined351591351594(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined351983351986(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined352690352694(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined352855352858(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined353245353248(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined354007354011(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined354761354765(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined355382355385(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined355900355903(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined356751356755(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined357505357508(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined357774357777(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined357980357984(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined358224358227(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined358449358453(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined358629358632(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined359021359024(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined359412359415(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined359810359813(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined360209360212(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined360797360800(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined361196361200(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined361496361499(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined361954361957(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined362520362523(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined362741362744(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined363280363283(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined363697363700(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined363941363944(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined364197364200(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined364863364866(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined365276365279(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined365531365534(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined366195366198(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined367365367368(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined368046368050(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined368163368167(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined368393368397(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined368667368671(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined369247369250(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined369876369879(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined370637370640(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined371168371172(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined371421371424(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined371773371777(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined372011372015(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined372176372179(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined372570372573(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined373486373490(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined373651373654(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined374046374049(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined375208375212(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined375373375376(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined375772375775(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined377117377121(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined377282377285(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined377676377680(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined378502378505(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined378890378893(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined379276379279(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined380011380015(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined380160380163(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined380529380532(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined381379381382(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined381735381739(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined381973381977(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined382138382141(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined382537382540(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined383709383713(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined383874383877(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined384274384277(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined385448385452(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined385613385616(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined386012386015(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined387184387188(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined387349387352(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined387755387758(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined388945388949(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined389110389113(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined389514389517(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined390700390704(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined390865390868(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined391265391268(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined392439392443(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined392604392607(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined393007393010(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined394284394287(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined394639394643(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined394877394881(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined395042395045(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined395444395447(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined396544396548(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined396709396712(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined397116397119(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined398397398401(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined398546398549(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined398912398915(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined399840399843(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined400197400200(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined402065402069(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined402367402370(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined403469403472(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined403827403830(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined408332408336(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined408634408637(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined409736409740(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined409980409984(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined410282410285(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined411313411317(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined411615411618(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined412643412647(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined412906412909(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined413278413281(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined414350414354(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined414581414584(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined415193415196(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined415846415849(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined416069416072(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined416333416336(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined417004417008(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined417308417312(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined417574417578(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined417883417886(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined418308418311(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined418799418802(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined419416419419(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined419796419800(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined420119420123(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined420490420494(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined421333421337(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined422210422214(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined422892422896(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined423575423579(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined424254424258(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined424593424596(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined425261425264(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined426498426501(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined426738426742(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined427084427087(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined427328427331(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined428018428021(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined429047429051(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined429337429340(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined429439429452_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updatePlan */ .tdundefined429649429665_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminPlans */ .OXundefined430082430085(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined430678430681(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined431189431192(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined431735431738(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined432743432747(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined432860432863(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined434525434528(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined435150435154(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined435397435400(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined435719435723(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined435944435948(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined436109436112(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined436514436517(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined437548437552(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined437713437716(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined438117438120(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined439161439165(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined439326439329(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined439735439738(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined440872440876(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined441037441040(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined441446441449(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined442496442499(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined443388443392(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined443635443638(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined443954443957(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined444265444269(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined444490444494(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined444752444756(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined445026445029(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined445455445458(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined446570446574(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined446751446754(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined447180447183(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined448397448401(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined448562448565(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined448965448969(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined449815449818(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined450205450208(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined450577450580(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined451190451194(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined451355451358(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined451756451759(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined452880452884(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined453045453048(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined453446453449(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined454663454667(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined454925454929(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined455106455109(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined455540455543(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined456656456660(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined456837456840(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined457272457275(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined458606458609(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined459282459285(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined459717459733_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .sendTestEmail */ .FIundefined460886460890(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined461177461180(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined461745461748(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined462666462669(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined463284463288(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined463494463498(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined463756463760(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined464034464038(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined464321464324(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined464783464787(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined464980464983(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined465413465416(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined466118466122(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined466422466425(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined466824466827(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined467650467653(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined468383468387(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined468632468636(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined468813468816(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined469242469246(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined470106470109(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined470523470526(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined471220471224(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined471401471404(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined471832471835(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined472974472978(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined473260473264(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined473457473460(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined473899473902(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined475098475102(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined475295475298(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined475741475744(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined477188477192(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined477369477372(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined477797477800(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined478966478970(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined479147479150(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined479559479562(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined480821480825(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined481089481092(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined481773481776(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined482353482357(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined482665482669(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined483244483247(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined483639483642(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined484110484113(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined484698484701(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined485159485163(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined485370485374(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined485687485691(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined486266486269(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined486661486664(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined487132487135(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined487720487724(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined488255488258(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined489246489249(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined489767489770(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined490623490626(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined491145491148(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined491934491937(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined492456492459(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined493312493315(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined493835493838(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined494672494675(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined495195495198(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined496066496069(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined496588496591(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined497340497343(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined497861497864(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined498705498708(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined499225499228(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined500049500052(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined500571500574(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined501512501515(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined502033502036(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined502901502904(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined503424503427(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined504209504212(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined504729504732(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined505567505570(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined506091506094(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined507151507154(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined507672507675(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined508468508471(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined508990508993(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined509788509791(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined510311510314(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined511166511169(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined511688511691(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined512481512484(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined513004513007(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined513964513967(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined514484514487(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined516293516297(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined516579516583(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined517029517032(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined517388517392(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined517678517681(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined518101518105(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined518825518828(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined519396519399(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined519666519669(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined520260520263(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined520826520830(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined521127521130(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined521753521756(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined522668522672(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined522857522860(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined523308523311(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined525383525387(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined525572525575(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined526020526023(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined528357528361(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined528689528692(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined529124529127(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined529603529606(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined530383530387(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined530679530682(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined531470531474(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined532154532157(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined532822532825(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined533890533893(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined535020535024(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined535277535281(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined535426535429(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined535776535779(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined536220536224(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined536469536473(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined536634536637(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined537029537032(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined537524537527(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined538246538249(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined538774538778(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined539037539040(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined539427539431(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined539592539595(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined539999540003(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined540849540852(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined541256541259(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined541765541768(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined542262542266(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined542427542430(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined542834542837(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined543899543902(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined544493544497(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined544732544735(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined545384545387(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined545929545933(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined546186546190(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined546335546338(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined546689546692(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined547487547490(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined547831547834(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined549106549109(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined549450549453(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined551004551007(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined551348551351(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined552271552274(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined552615552618(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined553413553416(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined553757553760(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined554742554745(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined555086555089(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined556036556039(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined556380556383(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined558132558135(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined558476558479(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined560444560448(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined560601560605(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined560923560926(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined561422561425(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined561937561940(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined563115563119(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined563359563362(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined564003564006(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined564544564548(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined564801564804(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined565114565118(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined565363565367(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined565528565531(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined565922565925(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined566423566426(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined567171567174(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined567702567706(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined567951567955(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined568116568119(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined568507568510(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined569005569008(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined569755569758(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined570286570289(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined570452570456(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined570609570613(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined571319571322(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined573355573359(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined574529574532(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined574921574924(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined576210576213(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined576608576611(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined578149578153(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined578298578301(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined578676578679(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined579031579034(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined580187580191(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined580426580429(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined581058581061(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined581604581608(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined581861581865(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined582010582013(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined582365582368(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined582804582808(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined582953582956(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined583327583331(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined583577583580(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined584860584863(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined585723585726(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined586324586328(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined586473586476(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined586851586855(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined587101587104(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined588128588131(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined588991588994(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined589376589379(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined589969589973(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined590194590197(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined590568590571(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined592970592974(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined593143593147(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined593449593452(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined593846593849(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined594392594396(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined594678594681(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined595823595826(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined596802596805(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined597625597629(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined597850597854(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined598123598127(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined598304598307(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined598738598741(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined599301599304(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined600151600154(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined600739600743(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined601012601016(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined601193601196(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined601621601624(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined602178602181(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined603007603010(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined603685603689(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined603929603932(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined604581604584(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined605183605187(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined605360605364(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined605577605581(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined606163606166(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined606795606798(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined607286607289(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined608189608193(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined608874608877(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined609210609213(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined609541609544(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined609893609896(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined610236610239(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined610670610674(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined611351611354(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined611681611685(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined612211612215(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined612762612766(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined613395613399(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined614066614069(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined614333614336(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined615991615995(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined616241616245(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined616512616516(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined616778616782(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined617092617096(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined618048618051(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined618660618664(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined619468619471(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined619873619877(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined620585620588(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined621123621127(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined621429621432(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined622380622383(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined622482622507_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .setSupportTicketStatus */ .u0undefined623576623579(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined623967623971(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined624250624254(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined624846624849(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined625327625331(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined625569625572(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined626339626343(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined626614626618(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined627201627204(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined627612627615(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined628044628047(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined628467628470(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined629021629024(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined629697629720_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .replyToSupportTicket */ .nTundefined631862631865(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined632399632403(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined632576632580(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined632824632827(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined633131633135(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined633357633360(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined634004634007(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined634767634771(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined634916634919(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined635249635252(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined635995635999(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined636258636261(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined636864636868(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined637013637016(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined637348637351(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined638070638074(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefinedÀ638219638222(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined638550638553(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined639345639349(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined639598639602(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined639763639766(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined640124640127(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined640917640921(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined641082641085(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined641466641469(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined642347642351(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined642586642589(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined643356643359(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined643868643872(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined644106644109(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined644435644439(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined644696644700(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined644990644993(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined645340645343(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined645823645827(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined646117646120(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined646462646465(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined646948646952(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined647242647245(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined647594647597(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined648077648081(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined648371648374(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined648725648728(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined649211649215(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined649505649508(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined649858649861(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined650399650403(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined650660650664(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined650954650957(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined651298651301(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined651797651801(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined652091652094(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined652443652446(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined653032653036(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined653326653329(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined653678653681(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined654155654159(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined654449654452(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined654803654806(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined655415655418(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined655420655428react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragmentundefined656140656144(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined656452656456(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined658092658096(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined659021659025(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined659807659810(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined659812659820react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragmentundefined659921659925(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined660233660237(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined661024661028(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined661608661612(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined662499662503(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined662676662680(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined662926662929(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined663391663394(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined664037664041(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined664416664419(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined664617664620(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined665158665162(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined665430665434(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined665579665582(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined665943665946(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined666431666434(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined666812666818(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .request */ .Em)undefined667847667850(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined668328668332(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined668566668569(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined668905668909(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined669141669145(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined669568669598"https://api.canhelp.gr"undefined6696036696250undefined671662671665(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined672206672209(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined673059673063(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined673500673503(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined674044674047(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined674795674798(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined676173676203"https://api.canhelp.gr"undefined6762086762300undefined677996678000(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined678234678237(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined678613678616(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined678897678900(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined679090679094(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined679418679422(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined679599679602(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined680087680091(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined681380681383(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined682016682022(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .request */ .Em)undefined683846683850(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined684084684087(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined684437684441(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined684698684702(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined685114685117(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined685780685783(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined686500686503(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined686758686761(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined686930686933(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined687111687114(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined687334687338(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined687613687616(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined688002688005(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined688221688225(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined688556688559(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined688889688919"https://api.canhelp.gr"undefined6889246889460undefined691388691392(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined692046692049(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined693785693815"https://api.canhelp.gr"undefined6938206938420undefined697242697246(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined697419697423(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined697552697555(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined697856697859(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined698278698282(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined698547698551(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined698696698699(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined699042699046(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined699582699585(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined699937699940(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined700294700297(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined700651700654(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined701220701223(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined701701701704(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined702129702133(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined702278702281(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined702628702632(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined703160703163(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined703515703518(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined703872703875(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined704229704232(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined704798704801(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined704971704975(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined705856705859(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined706392706395(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined707726707729(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined708095708099(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined708337708341(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined708713708716(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined709315709318(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined709913709916(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined711105711109(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined711381711385(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined711653711657(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined711834711837(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined712230712233(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined712747712750(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined713382713386(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined714025714028(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined715024715028(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined715915715944_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getTasksTranslationPreview */ .QYundefined718084718087(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined718295718299(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined718597718600(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined719183719186(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined719880719883(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined721326721347_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .autoTranslateTasks */ .Iundefined721395721425_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .autoTranslateEmailTemplates */ .fuundefined721461721477_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .autoTranslate */ .cpundefined722109722132_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getTranslationsStats */ .YQundefined724024724028(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined724030724038react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragmentundefined724209724213(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined724723724726(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined725517725520(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined726346726350(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined726352726360react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragmentundefined726531726534(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined727141727144(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined728059728063(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined728065728073react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragmentundefined728244728247(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined728854728857(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined730469730472(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined731088731091(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined732864732867(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined732955732959(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined733132733135(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined735077735081(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined735352735355(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined735680735683(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined736188736192(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined736439736443(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined736723736726(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined737057737061(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined737305737325_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminReferrals */ .cJundefined737777737781(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined738233738236(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined738963738966(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined739893739896(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined740075740079(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined740487740490(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined741121741124(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined741696741699(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined741970741973(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined743320743324(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined743485743489(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined744346744349(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined745026745029(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined745589745593(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined745891745894(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined746340746343(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined747035747038(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined747479747483(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined748327748330(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined748551748555(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined748843748846(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined748963748967(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined749298749301(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined749777749780(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined750248750251(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined750721750724(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined751197751200(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined751905751908(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined753024753028(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined753418753421(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined753896753899(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined754367754370(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined754634754638(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined755539755542(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined755806755809(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined756973756976(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined758846758849(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined759111759115(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined759440759444(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined759726759730(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined759883759887(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined760254760257(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined760763760766(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined761228761231(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined761525761528(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined762021762024(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined762636762639(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined762840762843(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined763022763026(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined763434763437(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined764068764071(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined764624764627(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined764896764900(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined765144765147(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined765244765248(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined765519765522(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined765929765932(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined766713766716(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined767300767303(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined767429767433(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined767733767736(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined768235768238(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined768460768463(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined770605770608(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined770974770977(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined771315771318(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined772326772329(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined772519772523(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined772773772777(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined773059773063(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined773216773219(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined773584773588(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined774335774338(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined774850774854(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined775073775076(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined777224777227(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined777718777748_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminUserSpecialistCards */ .vyundefined777913777934_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminCategories */ .KDundefined778102778122_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminLocations */ .k_undefined779314779318(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined779597779601(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined779858779862(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined780193780197(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined780396780400(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined781533781537(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined781736781740(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined782987782991(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined783285783289(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined783490783493(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined783969783972(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined785201785205(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined785406785409(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined785884785887(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined787248787252(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined787437787440(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined787879787882(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined789011789015(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined789200789203(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined789640789643(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined791016791020(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined791277791281(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined791466791469(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined791908791911(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined792523792527(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined792871792875(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined793219793222(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined793699793702(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined794346794349(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined794824794827(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined795655795658(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined796427796430(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined797316797320(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined797614797618(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined797819797822(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined798292798296(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined799238799241(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined799705799708(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined800496800500(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined800701800704(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined801174801178(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined802217802220(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined802696802699(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined803641803645(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined804407804411(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined804723804726(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined805690805693(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined806246806250(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined806435806438(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined806886806890(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined807859807862(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined808272808275(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined808684808687(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined809386809390(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined809575809578(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined810026810029(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined810906810910(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined811272811275(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined813449813452(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined814619814623(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined814880814884(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined815238815242(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined815443815446(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined815899815903(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined816893816897(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined817203817207(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined817770817773(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined818370818373(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined819462819466(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined820026820029(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined820626820629(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined822005822008(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined822554822557(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined822744822748(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined823047823051(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined823390823394(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined823603823606(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined824092824095(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined824735824738(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined826002826006(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined826345826349(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined826558826561(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined827046827049(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined827688827691(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined828950828954(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined829293829297(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined829506829509(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined829992829995(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined830632830635(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined832102832106(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined832363832367(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined832552832555(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined833007833011(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined833330833334(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined833775833778(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined834309834312(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined835750835753(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined836454836457(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined837146837149(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined838271838275(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined838277838285react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragmentundefined838464838467(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined838929838932(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined842736842740(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined843117843120(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined843583843586(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined845939845943(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined846243846246(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined846716846720(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined848603848606(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined849068849071(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined850147850151(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined854047854051(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined854385854388(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined854895854898(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined855395855398(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined855686855689(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined856291856295(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined856480856483(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined856923856926(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined857288857292(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined857798857801(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined859429859433(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined859739859742(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined863012863015(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined865822865826(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined866127866130(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined866595866598(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined866962866965(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined867322867325(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined867895867899(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined868277868281(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined868648868651(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined870025870029(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined870453870456(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined871760871763(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined872696872699(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined874157874161(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined874394874397(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined874927874930(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined875326875330(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined875932875935(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined877969877973(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined878351878354(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined883811883814(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined887953887957(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined888190888193(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined888727888730(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined889389889393(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined890369890372(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined892546892549(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined894984894988(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined895221895224(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined895757895760(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined896415896419(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined897393897396(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined899562899565(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined901990901993(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined902256902259(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined904027904031(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined904290904293(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined904876904879(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined905391905394(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined905588905591(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined906211906214(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined906406906410(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined906725906729(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined906967906970(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined907429907432(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined907948907952(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined908316908320(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined909021909025(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined909234909238(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined909391909394(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined909897909900(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined911672911676(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined911829911832(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined912345912348(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined914232914236(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined914451914454(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined915905915908(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined916887916894(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined916946916953(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined916996917003(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined917044917051(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined917755917771_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getSkillDedup */ .GEundefined918787918810_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .mergeSkillDuplicates */ .Uqundefined919503919526_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .mergeSkillDuplicates */ .Uqundefined919990919994(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined920083920087(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined920160920163(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined920364920367(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined920610920614(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined920776920780(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined920976920980(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined921085921088(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined921348921351(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined921772921776(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined922211922215(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined922634922637(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined922928922931(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined923539923542(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined923670923674(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined923923923926(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined924289924292(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined924714924718(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined924867924871(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined925068925072(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined925699925702(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined926524926528(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined926774926778(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined927069927073(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined927304927308(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined928014928017(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined928444928448(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined929114929117(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined929822929825(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined930013930017(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined930321930324(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined931210931214(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined931476931480(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined931785931788(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined932250932254(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined932964932968(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined933645933649(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined934447934451(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined934753934756(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined935305935309(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined936005936008(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined937429937432(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined937434937442react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragmentundefined938022938026(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined938099938103(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined938458938461(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined938818938821(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined939176939179(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined939350939353(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined939708939711(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined939882939885(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined940087940090(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined940440940443(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined940837940841(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined941229941232(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined941591941594(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined941960941964(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined942130942133(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined942378942381(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined942625942629(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined943077943080(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined943446943450(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined943641943644(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined944092944095(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined944471944474(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined944982944985(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined946062946065(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined946067946075react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragmentundefined946999947003(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined947076947080(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined947435947438(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined947795947798(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined948153948156(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined948327948330(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined948685948688(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined948859948862(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined949050949053(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined949233949236(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined949238949249_components_CategoryIcon__WEBPACK_IMPORTED_MODULE_7__/* .CategoryIcon */ .Ezundefined949618949622(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined949788949791(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined950036950039(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined950373950377(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined950825950828(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined951194951198(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined951374951378(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined951854951857(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined952278952281(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined953025953028(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined953473953476(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined953852953855(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined954352954355(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined955126955129(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined956737956741(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined956878956881(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined957211957215(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined957304957307(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined957582957585(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined958417958421(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined958578958581(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined958768958771(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined959285959289(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined959435959438(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined959772959775(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined960790960794(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined961134961138(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined961270961273(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined961482961486(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined961759961763(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined962069962072(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined962177962181(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined962631962635(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined963028963031(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined963355963358(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined963896963900(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined964054964058(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined964294964297(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined964672964675(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined965018965022(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined965174965177(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined965725965729(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined965826965830(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined966198966202(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined966404966407(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined966740966743(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined967105967108(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined967504967508(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined967927967931(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined968225968228(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined968862968865(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined969482969485(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined969621969624(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined970170970173(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined970275970278(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined970845970849(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined971019971023(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined971207971211(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined971325971328(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined971660971664(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined971947971950(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined972596972599(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined972808972811(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined973238973241(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined973450973453(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined973853973857(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined974084974087(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined974239974242(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined974602974605(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined974814974817(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined975192975195(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined975404975407(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined975783975787(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined976014976017(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined976169976172(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined976351976354(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined976708976712(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined976939976942(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined977051977054(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined977476977479(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined977688977691(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined977955977959(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined978186978189(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined978368978371(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined978716978719(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined978928978931(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined979615979618(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined979827979830(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined980272980276(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined980431980435(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined980787980791(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined980909980913(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined981092981095(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined981449981452(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined981751981754(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined981999982003(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined982290982293(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined982643982646(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined982855982858(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined983083983082(/* unused pure expression or super */ null && (undefined983217983216))undefined984710984713(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined984794984798(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined985159985163(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined985250985253(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined985600985603(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined986262986265(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined987118987121(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined987455987458(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined990256990259(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined990340990344(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined990675990679(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined990766990769(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined991116991119(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined991690991693(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined992102992105(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined992458992461(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined992658992661(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined993188993191(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined993248993251(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined993632993635(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined /***/ }) ÊtŸ/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ AdminPage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7541); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(9664); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(next_link__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(1592); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(9906); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(2982); /* harmony import */ var _lib_formatName__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(1258); /* harmony import */ var _lib_taskLocale__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(4017); /* harmony import */ var _components_CategoryIcon__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(5940); /* __next_internal_client_entry_do_not_use__ default auto */ const TEMPLATE_VARS = { 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' ] }; const TEMPLATE_HINT_VARS = Array.from(new Set(Object.values(TEMPLATE_VARS).flat())); const DEFAULT_CATEGORY_ICON_PRESETS = [ { 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 getCatLabel(row, locale) { if (!row) return ''; if (locale === 'en') return row.namesEn || row.namesEl || row.slug || ''; if (locale === 'ru') return row.namesRu || row.namesEl || row.slug || ''; if (locale === 'uk') return row.namesUk || row.namesEl || row.slug || ''; return row.namesEl || row.namesEn || row.slug || ''; } function getLocLabel(row, locale) { if (!row) return ''; if (locale === 'en') return row.nameEn || row.nameEl || row.slug || ''; if (locale === 'ru') return row.nameRu || row.nameEl || row.slug || ''; if (locale === 'uk') return row.nameUk || row.nameEl || row.slug || ''; return row.nameEl || row.nameEn || row.slug || ''; } function CategoryIconPicker(param) { let { value, onChange, onUpload, uploading, error, presets } = param; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-3 rounded-xl border border-gray-200 bg-white px-3 py-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex h-12 w-12 items-center justify-center rounded-lg bg-green-50", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components_CategoryIcon__WEBPACK_IMPORTED_MODULE_7__/* .CategoryIcon */ .Ez, { icon: value, alt: "category icon", className: "h-9 w-9 object-contain text-3xl leading-none", fallback: "\uD83D\uDCE6" }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: value, onChange: (e)=>onChange(e.target.value), className: "flex-1 border-0 bg-transparent p-0 text-sm outline-none ring-0", placeholder: "/category-icons/package.svg" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "inline-flex cursor-pointer items-center rounded-lg border px-3 py-1.5 text-xs font-medium transition ".concat(uploading ? 'border-gray-200 bg-gray-100 text-gray-400' : 'border-green-300 bg-green-50 text-green-700 hover:bg-green-100'), children: [ uploading ? 'Uploading...' : 'Upload SVG', /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "file", accept: ".svg,image/svg+xml", className: "hidden", disabled: uploading, onChange: async (e)=>{ var _e_target_files; const file = (_e_target_files = e.target.files) === null || _e_target_files === void 0 ? void 0 : _e_target_files[0]; if (!file) return; await onUpload(file); e.target.value = ''; } }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-xs text-gray-500", children: "or choose from presets" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-[11px] text-gray-500", children: "Preset source: /public/category-icons/presets.json" }), error ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-red-600", children: error }) : null, /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "grid grid-cols-2 gap-2 sm:grid-cols-3 lg:grid-cols-4", children: presets.map((preset)=>{ const active = value === preset.value; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { type: "button", onClick: ()=>onChange(preset.value), className: "flex h-20 flex-col items-center justify-center gap-1 rounded-lg border px-2 transition ".concat(active ? 'border-green-500 bg-green-50 shadow-sm' : 'border-gray-200 bg-white hover:border-green-300 hover:bg-green-50'), "aria-label": preset.label, title: preset.label, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components_CategoryIcon__WEBPACK_IMPORTED_MODULE_7__/* .CategoryIcon */ .Ez, { icon: preset.value, alt: preset.label, className: "h-8 w-8 object-contain text-3xl leading-none", fallback: "\uD83D\uDCE6" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "max-w-full truncate text-[11px] font-medium text-gray-600 leading-tight", children: preset.label }) ] }, preset.value); }) }) ] }); } function AdminCatPicker(param) { let { catRows, locale, selected, onAdd, addLabel } = param; const [open, setOpen] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [search, setSearch] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [expandedParent, setExpandedParent] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const ref = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ function h(e) { if (ref.current && !ref.current.contains(e.target)) { setOpen(false); setSearch(''); } } document.addEventListener('mousedown', h); return ()=>document.removeEventListener('mousedown', h); }, []); const parents = catRows.filter((r)=>!r.parentId); const lowerSearch = search.toLowerCase(); const matchesSearch = (r)=>{ var _r_slug; return !search || getCatLabel(r, locale).toLowerCase().includes(lowerSearch) || ((_r_slug = r.slug) !== null && _r_slug !== void 0 ? _r_slug : '').toLowerCase().includes(lowerSearch); }; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "relative", ref: ref, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { type: "button", onClick: ()=>setOpen((v)=>!v), className: "w-full flex items-center gap-1.5 px-3 py-1.5 text-xs transition-colors ".concat(open ? '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: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4 6h16M4 10h16M4 14h16M4 18h16" }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "flex-1 text-left truncate", children: addLabel }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3 h-3 text-gray-400 shrink-0 transition-transform ".concat(open ? 'rotate-180' : ''), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19 9l-7 7-7-7" }) }) ] }), open && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "sticky top-0 bg-white px-3 py-2 border-b border-gray-100", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { autoFocus: true, value: search, onChange: (e)=>setSearch(e.target.value), placeholder: "ППОск...", className: "w-full text-xs border border-gray-200 rounded-lg px-2.5 py-1.5 focus:outline-none focus:ring-2 focus:ring-blue-300" }) }), parents.map((parent)=>{ const children = catRows.filter((r)=>r.parentId === parent.id); const parentLabel = getCatLabel(parent, locale); const isExpanded = expandedParent === parent.id; const matchingChildren = children.filter((c)=>!selected.includes(c.slug) && matchesSearch(c)); const parentAvail = !selected.includes(parent.slug) && matchesSearch(parent); const hasChildren = children.length > 0; if (!parentAvail && matchingChildren.length === 0 && search) return null; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: ()=>{ if (hasChildren && !search) { setExpandedParent(isExpanded ? null : parent.id); } else if (parentAvail) { onAdd(parent.slug); setOpen(false); setSearch(''); } }, children: [ parent.icon ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components_CategoryIcon__WEBPACK_IMPORTED_MODULE_7__/* .CategoryIcon */ .Ez, { icon: parent.icon, alt: parentLabel, className: "h-5 w-5 shrink-0 object-contain text-sm leading-none", fallback: "\uD83D\uDCE6" }) : null, /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "flex-1 font-medium", children: parentLabel }), hasChildren && !search ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3.5 h-3.5 text-gray-400 shrink-0 transition-transform ".concat(isExpanded ? 'rotate-90' : ''), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 5l7 7-7 7" }) }) : null ] }), (isExpanded || !!search) && matchingChildren.map((child)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: ()=>{ onAdd(child.slug); setOpen(false); setSearch(''); }, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "w-1.5 h-1.5 rounded-full bg-gray-300 shrink-0" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "flex-1", children: getCatLabel(child, locale) }) ] }, child.id)) ] }, parent.id); }) ] }) ] }); } function AdminLocPicker(param) { let { locRows, locale, selected, onAdd, addLabel } = param; const [open, setOpen] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [search, setSearch] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [expandedCity, setExpandedCity] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const ref = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ function h(e) { if (ref.current && !ref.current.contains(e.target)) { setOpen(false); setSearch(''); } } document.addEventListener('mousedown', h); return ()=>document.removeEventListener('mousedown', h); }, []); const cities = locRows.filter((r)=>!r.parentId); const lowerSearch = search.toLowerCase(); const matchesSearch = (r)=>{ var _r_slug; return !search || getLocLabel(r, locale).toLowerCase().includes(lowerSearch) || ((_r_slug = r.slug) !== null && _r_slug !== void 0 ? _r_slug : '').toLowerCase().includes(lowerSearch); }; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "relative", ref: ref, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { type: "button", onClick: ()=>setOpen((v)=>!v), className: "w-full flex items-center gap-1.5 px-3 py-1.5 text-xs transition-colors ".concat(open ? '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: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 11a3 3 0 11-6 0 3 3 0 016 0z" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "flex-1 text-left truncate", children: addLabel }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3 h-3 text-gray-400 shrink-0 transition-transform ".concat(open ? 'rotate-180' : ''), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19 9l-7 7-7-7" }) }) ] }), open && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "sticky top-0 bg-white px-3 py-2 border-b border-gray-100", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { autoFocus: true, value: search, onChange: (e)=>setSearch(e.target.value), placeholder: "ППОск...", className: "w-full text-xs border border-gray-200 rounded-lg px-2.5 py-1.5 focus:outline-none focus:ring-2 focus:ring-blue-300" }) }), cities.map((city)=>{ const districts = locRows.filter((r)=>r.parentId === city.id); const cityLabel = getLocLabel(city, locale); const isExpanded = expandedCity === city.id; const hasDistricts = districts.length > 0; const matchingDistricts = districts.filter((d)=>!selected.includes(d.slug) && matchesSearch(d)); const cityAvail = !selected.includes(city.slug) && matchesSearch(city); if (!cityAvail && matchingDistricts.length === 0 && search) return null; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: ()=>{ if (hasDistricts && !search) { setExpandedCity(isExpanded ? null : city.id); } else if (cityAvail) { onAdd(city.slug); setOpen(false); setSearch(''); } }, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3 h-3 text-gray-300 shrink-0", fill: "currentColor", viewBox: "0 0 24 24", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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" }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "flex-1 font-medium", children: cityLabel }), hasDistricts && !search ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3.5 h-3.5 text-gray-400 shrink-0 transition-transform ".concat(isExpanded ? 'rotate-90' : ''), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 5l7 7-7 7" }) }) : null ] }), (isExpanded || !!search) && matchingDistricts.map((d)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: ()=>{ onAdd(d.slug); setOpen(false); setSearch(''); }, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "w-1.5 h-1.5 rounded-full bg-gray-300 shrink-0" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "flex-1", children: getLocLabel(d, locale) }) ] }, d.id)) ] }, city.id); }) ] }) ] }); } function AdminPage() { var _session_user, _stats_tokensByMonth; const router = (0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)(); const { data: session, isPending } = (0,_lib_auth__WEBPACK_IMPORTED_MODULE_4__/* .useSession */ .wV)(); const { t, locale } = (0,_context_locale__WEBPACK_IMPORTED_MODULE_5__/* .useLocale */ .Y)(); const [tab, setTab] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)('stats'); const [sidebarCollapsed, setSidebarCollapsed] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ setSidebarCollapsed(window.innerWidth < 1024); }, []); // Stats const [stats, setStats] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); // Users const [users, setUsers] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [usersPage, setUsersPage] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(1); const [usersTotal, setUsersTotal] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(0); const [usersQ, setUsersQ] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [usersQInput, setUsersQInput] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [usersRole, setUsersRole] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); // Tasks const [tasks, setTasks] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [tasksPage, setTasksPage] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(1); const [tasksTotal, setTasksTotal] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(0); const [tasksQ, setTasksQ] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [tasksQInput, setTasksQInput] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [tasksStatus, setTasksStatus] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); // Reports const [reports, setReports] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [reportsPage, setReportsPage] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(1); const [reportsTotal, setReportsTotal] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(0); const [pendingReportsCount, setPendingReportsCount] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(0); // Specialist card moderation const [moderationCards, setModerationCards] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [moderationCardsPage, setModerationCardsPage] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(1); const [moderationCardsTotal, setModerationCardsTotal] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(0); const [moderationCardsLoading, setModerationCardsLoading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [pendingCardsCount, setPendingCardsCount] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(0); // Support tickets const [supportTickets, setSupportTickets] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [supportPage, setSupportPage] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(1); const [supportTotal, setSupportTotal] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(0); const [supportStatus, setSupportStatus] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [supportType, setSupportType] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [supportQ, setSupportQ] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [supportQInput, setSupportQInput] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [supportReplyId, setSupportReplyId] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [supportReplyText, setSupportReplyText] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [supportReplySaving, setSupportReplySaving] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); // AI Logs const [logs, setLogs] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [logsPage, setLogsPage] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(1); const [logsTotal, setLogsTotal] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(0); // Activity Logs const [activityLog, setActivityLog] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [activityTotal, setActivityTotal] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(0); const [activityPage, setActivityPage] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(1); const [activityEvent, setActivityEvent] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [activityUserId, setActivityUserId] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [activityDateFrom, setActivityDateFrom] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [activityDateTo, setActivityDateTo] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [activityEventTypes, setActivityEventTypes] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); // Mail Logs const [mailLog, setMailLog] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [mailTotal, setMailTotal] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(0); const [mailPage, setMailPage] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(1); const [mailEvent, setMailEvent] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [mailDateFrom, setMailDateFrom] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [mailDateTo, setMailDateTo] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [mailEventTypes, setMailEventTypes] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); // Logs sub-tab const [logsSubTab, setLogsSubTab] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)('ai'); // Notification Logs const [notifLogs, setNotifLogs] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [notifLogsPage, setNotifLogsPage] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(1); const [notifLogsTotal, setNotifLogsTotal] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(0); const [notifLogsType, setNotifLogsType] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [notifLogsTypes, setNotifLogsTypes] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [notifLogsDateFrom, setNotifLogsDateFrom] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [notifLogsDateTo, setNotifLogsDateTo] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); // Notification stats chart const [notifsByDay, setNotifsByDay] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [mailByDay, setMailByDay] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); // Balance archive const [balanceRows, setBalanceRows] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [balanceTotal, setBalanceTotal] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(0); const [balancePage, setBalancePage] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(1); const [balanceUserId, setBalanceUserId] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [balanceKind, setBalanceKind] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [topUpSaving, setTopUpSaving] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [withdrawSaving, setWithdrawSaving] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); // User edit modal const [editUser, setEditUser] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [editUserSaving, setEditUserSaving] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [verifyingEmail, setVerifyingEmail] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [editUserTab, setEditUserTab] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)('profile'); const [balanceModal, setBalanceModal] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [skillInput, setSkillInput] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [editUserCards, setEditUserCards] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [editUserCardsLoading, setEditUserCardsLoading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [cardSkillInputs, setCardSkillInputs] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)({}); const [cardSaving, setCardSaving] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)({}); const [cardCatSelects, setCardCatSelects] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)({}); const [cardLocSelects, setCardLocSelects] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)({}); // Plans const [planRows, setPlanRows] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [planForm, setPlanForm] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [planSaving, setPlanSaving] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); // Locations const [locRows, setLocRows] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [locForm, setLocForm] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [locSaving, setLocSaving] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [locExpanded, setLocExpanded] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(new Set()); // Categories const [catRows, setCatRows] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [catForm, setCatForm] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [catSaving, setCatSaving] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [catExpanded, setCatExpanded] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(new Set()); const [catIconUploading, setCatIconUploading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [catIconError, setCatIconError] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [categoryIconPresets, setCategoryIconPresets] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(DEFAULT_CATEGORY_ICON_PRESETS); // Category Skills const [catSkillsExpanded, setCatSkillsExpanded] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(new Set()); const [catSkillsCache, setCatSkillsCache] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)({}); const [catSkillsLoading, setCatSkillsLoading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(new Set()); const [skillForm, setSkillForm] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [skillSaving, setSkillSaving] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); // Settings const [settingsTab, setSettingsTab] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)('general'); const [generalForm, setGeneralForm] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)({ siteName: 'CanHelp', siteUrl: '', contactEmail: '', supportPhone: '' }); const [generalSaving, setGeneralSaving] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [generalSaved, setGeneralSaved] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [smtpForm, setSmtpForm] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)({ host: '', port: '587', username: '', password: '', fromName: 'CanHelp', fromEmail: '', encryption: 'tls' }); const [smtpSaving, setSmtpSaving] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [smtpSaved, setSmtpSaved] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [testEmailSending, setTestEmailSending] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [testEmailResult, setTestEmailResult] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [notifTemplates, setNotifTemplates] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)({ email_verification: { subject: 'ППЎтверЎОте ваш email — {{siteName}}', body: '' }, registration_success: { subject: 'ДПбрП пПжалПвать в {{siteName}}!', body: '' }, password_reset: { subject: 'ВПсстаМПвлеМОе парПля — {{siteName}}', body: '' }, new_offer: { subject: 'НПвПе преЎлПжеМОе пП вашей заЎаче «{{taskTitle}}»', body: '' }, new_task: { subject: 'НПвая заЎача: {{taskTitle}}', body: '' }, offer_accepted: { subject: 'Ваше преЎлПжеМОе прОМятП: {{taskTitle}}', body: '

Ваше преЎлПжеМОе прОМятП! 🎉

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

ЗаказчОк прОМял ваше преЎлПжеМОе Ма выпПлМеМОе заЎачО:

{{taskTitle}}

СуЌЌа: {{price}}€

Открыть чат →' }, new_message: { subject: 'НПвПе сППбщеМОе Пт {{senderName}}', body: '

НПвПе сППбщеМОе

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

ВаЌ МапОсал(а) {{senderName}}:

"{{preview}}"

ОтветОть →' }, offer_declined: { subject: 'Ваше преЎлПжеМОе ПтклПМеМП: {{taskTitle}}', body: '

Ваше преЎлПжеМОе ПтклПМеМП

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

К сПжалеМОю, заказчОк ПтклПМОл ваше преЎлПжеМОе Ма:

{{taskTitle}}

НайтО ЎругОе заказы →' }, offer_other_accepted: { subject: 'ВыбраМ ЎругПй ОспПлМОтель: {{taskTitle}}', body: '

ВыбраМ ЎругПй ОспПлМОтель

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

ЗаказчОк выбрал ЎругПгП ОспПлМОтеля Ўля заЎаМОя:

{{taskTitle}}

НайтО ЎругОе заказы →' }, task_updated: { subject: 'ЗаЎаМОе ПбМПвлеМП: {{taskTitle}}', body: '

ЗаЎаМОе ПбМПвлеМП

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

ЗаказчОк ПбМПвОл ЎеталО заЎаМОя:

{{taskTitle}}

СЌПтреть заказ →' }, deadline_reminder: { subject: 'ЗаЎаМОе Остекает завтра: {{taskTitle}}', body: '

НапПЌОМаМОе П ЎеЎлайМе

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

Ваше заЎаМОе Остекает через 24 часа. ОбМПвОте ЎеЎлайМ, ОМаче заЎаМОе буЎет автПЌатОческО сМятП с публОкацОО.

{{taskTitle}}

РеЎактОрПвать заЎаМОе →' }, task_archived: { subject: 'ЗаЎаМОе сМятП с публОкацОО: {{taskTitle}}', body: '

ЗаЎаМОе перевеЎеМП в черМПвОк

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

Ваше заЎаМОе ОстеклП О былП автПЌатОческО перевеЎеМП в черМПвОк. ОбМПвОте ЎеЎлайМ, чтПбы ПпублОкПвать егП сМПва.

{{taskTitle}}

РеЎактОрПвать заЎаМОе →' }, referral_reward: { subject: 'Вы пПлучОлО реферальМую МаграЎу — {{siteName}}', body: '

Вы пПлучОлО реферальМую МаграЎу! 🎁

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

Друг зарегОстрОрПвался пП вашей реферальМПй ссылке. На ваш аккауМт ЎПбавлеМП {{days}} ЎМей ЎПступа к плаМу {{planName}}!

+{{days}} ЎМей — {{planName}}

ПерейтО к аккауМту →' }, referral_reward_el: { subject: 'Λάβατε αΜταΌοιβή παραποΌπής — {{siteName}}', body: '

Λάβατε αΜταΌοιβή παραποΌπής! 🎁

Γεια {{userName}},

ΈΜας φίλος εγγράφηκε χρησιΌοποιώΜτας τοΜ σύΜΎεσΌο παραποΌπής σας. ΣτοΜ λογαριασΌό σας προστέΞηκαΜ {{days}} ηΌέρες πρόσβασης στο πλάΜο {{planName}}!

+{{days}} ηΌέρες — {{planName}}

Δες τοΜ λογαριασΌό σου →' }, referral_reward_en: { subject: 'You received a referral reward — {{siteName}}', body: '

You received a referral reward! 🎁

Hi {{userName}},

A friend registered using your referral link. {{days}} days of {{planName}} access have been added to your account!

+{{days}} days — {{planName}}

View your account →' }, referral_reward_ru: { subject: 'Вы пПлучОлО реферальМую МаграЎу — {{siteName}}', body: '

Вы пПлучОлО реферальМую МаграЎу! 🎁

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

Друг зарегОстрОрПвался пП вашей реферальМПй ссылке. На ваш аккауМт ЎПбавлеМП {{days}} ЎМей ЎПступа к плаМу {{planName}}!

+{{days}} ЎМей — {{planName}}

ПерейтО к аккауМту →' } }); const [editingTemplate, setEditingTemplate] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [templateLocale, setTemplateLocale] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)('el'); const [templateSaving, setTemplateSaving] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [templateTranslating, setTemplateTranslating] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [ePayForm, setEPayForm] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)({ merchantId: '', apiUser: '', apiPassword: '', environment: 'test', confirmationUrl: '', cancelUrl: '', enabled: false }); const [ePaySaving, setEPaySaving] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [ePaySaved, setEPaySaved] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [referralForm, setReferralForm] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)({ enabled: false, planId: '', days: '30' }); const [referralSaving, setReferralSaving] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [referralSaved, setReferralSaved] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [seoForm, setSeoForm] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)({ maintenanceMode: false, indexingEnabled: true, headScripts: '', siteTitleEl: '', siteTitleEn: '', siteTitleRu: '', siteTitleUk: '', siteDescriptionEl: '', siteDescriptionEn: '', siteDescriptionRu: '', siteDescriptionUk: '' }); const [seoSaving, setSeoSaving] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [seoSaved, setSeoSaved] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [seoLangTab, setSeoLangTab] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)('el'); const [socialForm, setSocialForm] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)({ telegram: '', instagram: '', facebook: '', twitter: '', youtube: '', tiktok: '', whatsapp: '', viber: '' }); const [socialSaving, setSocialSaving] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [socialSaved, setSocialSaved] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [telegramForm, setTelegramForm] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)({ botToken: '', adminChatId: '', channelIdEl: '', channelIdEn: '', channelIdRu: '', channelIdUk: '', notifyRegistrations: false, postNewTasks: false }); const [telegramSaving, setTelegramSaving] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [telegramSaved, setTelegramSaved] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [testingTelegramAdmin, setTestingTelegramAdmin] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [testingTelegramChannel, setTestingTelegramChannel] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [testResultTelegramAdmin, setTestResultTelegramAdmin] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [testResultTelegramChannel, setTestResultTelegramChannel] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [testingLocale, setTestingLocale] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [testResultChannels, setTestResultChannels] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)({}); const [verifyingTelegramToken, setVerifyingTelegramToken] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [verifyResultTelegramToken, setVerifyResultTelegramToken] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); // Backup const [backupAutoEnabled, setBackupAutoEnabled] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [backupAutoSaving, setBackupAutoSaving] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [backupTables, setBackupTables] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [backupTablesLoading, setBackupTablesLoading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [backupStoredFiles, setBackupStoredFiles] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [backupExporting, setBackupExporting] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [backupImporting, setBackupImporting] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [backupRestoring, setBackupRestoring] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [backupMsg, setBackupMsg] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [backupMsgError, setBackupMsgError] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const setBackupSuccess = (msg)=>{ setBackupMsg(msg); setBackupMsgError(false); }; const setBackupError = (msg)=>{ setBackupMsg(msg); setBackupMsgError(true); }; // ─── Translations state ─────────────────────────────────────────────────── const [transStats, setTransStats] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [transStatsLoading, setTransStatsLoading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [transLang, setTransLang] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)('uk'); const [transFromLang, setTransFromLang] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)('el'); const [transTableTranslating, setTransTableTranslating] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)({}); const [transMsg, setTransMsg] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [transPreview, setTransPreview] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); // ─── Referrals state ───────────────────────────────────────────────────── const [referralsData, setReferralsData] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [referralsLoading, setReferralsLoading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [referralsExpanded, setReferralsExpanded] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(new Set()); // ─── Push state ────────────────────────────────────────────────────────── const [pushMode, setPushMode] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)('broadcast'); const [pushTargetUserId, setPushTargetUserId] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [pushTitle, setPushTitle] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [pushBody, setPushBody] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [pushType, setPushType] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)('general'); const [pushReferenceId, setPushReferenceId] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [pushOnlyActive, setPushOnlyActive] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(true); const [pushSending, setPushSending] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [pushResult, setPushResult] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [pushError, setPushError] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [loading, setLoading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const isAdmin = !isPending && session && ((_session_user = session.user) === null || _session_user === void 0 ? void 0 : _session_user.role) === 'admin'; (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ var _session_user; if (!isPending && !session) router.push('/login'); if (!isPending && session && ((_session_user = session.user) === null || _session_user === void 0 ? void 0 : _session_user.role) !== 'admin') router.push('/'); }, [ session, isPending ]); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!isAdmin) return; _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminStats */ .dE().then(setStats).catch(()=>{}); _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminNotifStats */ .bi().then(setNotifsByDay).catch(()=>{}); _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminMailStats */ .u4().then(setMailByDay).catch(()=>{}); _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminReports */ .z5(1, 'pending').then((d)=>setPendingReportsCount(d.total)).catch(()=>{}); _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminSpecialistCards */ .s_(1, 'pending').then((d)=>setPendingCardsCount(d.total)).catch(()=>{}); }, [ isAdmin ]); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!isAdmin || tab !== 'users') return; setLoading(true); _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminUsers */ .cS(usersPage, usersQ || undefined, usersRole || undefined).then((d)=>{ setUsers(d.data); setUsersTotal(d.total); }).catch(()=>{}).finally(()=>setLoading(false)); }, [ isAdmin, tab, usersPage, usersQ, usersRole ]); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!isAdmin || tab !== 'tasks') return; setLoading(true); _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminTasks */ .Yj(tasksPage, tasksQ || undefined, tasksStatus || undefined).then((d)=>{ setTasks(d.data); setTasksTotal(d.total); }).catch(()=>{}).finally(()=>setLoading(false)); }, [ isAdmin, tab, tasksPage, tasksQ, tasksStatus ]); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!isAdmin || tab !== 'reports') return; setLoading(true); _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminReports */ .z5(reportsPage).then((d)=>{ setReports(d.data); setReportsTotal(d.total); }).catch(()=>{}).finally(()=>setLoading(false)); }, [ isAdmin, tab, reportsPage ]); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!isAdmin || tab !== 'moderation') return; setModerationCardsLoading(true); _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminSpecialistCards */ .s_(moderationCardsPage, 'review').then((d)=>{ setModerationCards(d.data); setModerationCardsTotal(d.total); }).catch(()=>{}).finally(()=>setModerationCardsLoading(false)); }, [ isAdmin, tab, moderationCardsPage ]); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!isAdmin || tab !== 'support') return; setLoading(true); const params = { page: String(supportPage), limit: '30' }; if (supportStatus) params.status = supportStatus; if (supportType) params.type = supportType; if (supportQ) params.q = supportQ; _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminSupportTickets */ .KZ(params).then((d)=>{ setSupportTickets(d.data); setSupportTotal(d.total); }).catch(()=>{}).finally(()=>setLoading(false)); }, [ isAdmin, tab, supportPage, supportStatus, supportType, supportQ ]); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!isAdmin || tab !== 'balances') return; setLoading(true); _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminBalanceHistory */ .g0({ page: balancePage, userId: balanceUserId || undefined, kind: balanceKind || undefined }).then((d)=>{ setBalanceRows(d.data); setBalanceTotal(d.total); }).catch(()=>{}).finally(()=>setLoading(false)); }, [ isAdmin, tab, balancePage, balanceUserId, balanceKind ]); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!isAdmin || tab !== 'logs') return; if (logsSubTab === 'ai') { setLoading(true); _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminAiLogs */ .j_(logsPage).then((d)=>{ setLogs(d.data); setLogsTotal(d.total); }).catch(()=>{}).finally(()=>setLoading(false)); } else if (logsSubTab === 'activity') { _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminActivityLogs */ .yO({ page: activityPage, event: activityEvent || undefined, userId: activityUserId || undefined, dateFrom: activityDateFrom || undefined, dateTo: activityDateTo || undefined }).then((d)=>{ var _d_eventTypes; setActivityLog(d.data); setActivityTotal(d.total); if ((_d_eventTypes = d.eventTypes) === null || _d_eventTypes === void 0 ? void 0 : _d_eventTypes.length) setActivityEventTypes(d.eventTypes); }).catch(()=>{}); } else if (logsSubTab === 'mail') { _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminMailLogs */ .qt({ page: mailPage, event: mailEvent || undefined, dateFrom: mailDateFrom || undefined, dateTo: mailDateTo || undefined }).then((d)=>{ var _d_eventTypes; setMailLog(d.data); setMailTotal(d.total); if ((_d_eventTypes = d.eventTypes) === null || _d_eventTypes === void 0 ? void 0 : _d_eventTypes.length) setMailEventTypes(d.eventTypes); }).catch(()=>{}); } else if (logsSubTab === 'notifications') { _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminNotifLogs */ .Br({ page: notifLogsPage, type: notifLogsType || undefined, dateFrom: notifLogsDateFrom || undefined, dateTo: notifLogsDateTo || undefined }).then((d)=>{ var _d_notifTypes; setNotifLogs(d.data); setNotifLogsTotal(d.total); if ((_d_notifTypes = d.notifTypes) === null || _d_notifTypes === void 0 ? void 0 : _d_notifTypes.length) setNotifLogsTypes(d.notifTypes); }).catch(()=>{}); } }, [ isAdmin, tab, logsSubTab, logsPage, activityPage, activityEvent, activityUserId, activityDateFrom, activityDateTo, mailPage, mailEvent, mailDateFrom, mailDateTo, notifLogsPage, notifLogsType, notifLogsDateFrom, notifLogsDateTo ]); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ setActivityPage(1); }, [ activityEvent, activityUserId, activityDateFrom, activityDateTo ]); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ setMailPage(1); }, [ mailEvent, mailDateFrom, mailDateTo ]); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ setNotifLogsPage(1); }, [ notifLogsType, notifLogsDateFrom, notifLogsDateTo ]); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!isAdmin || tab !== 'plans') return; _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminPlans */ .OX().then(setPlanRows).catch(()=>{}); }, [ isAdmin, tab ]); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!isAdmin || tab !== 'translations') return; setTransStatsLoading(true); _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getTranslationsStats */ .YQ().then((d)=>setTransStats(d.tables)).catch(()=>{}).finally(()=>setTransStatsLoading(false)); }, [ isAdmin, tab ]); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!isAdmin || tab !== 'backup') return; (0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .request */ .Em)('/admin/backup/settings').then((d)=>setBackupAutoEnabled(!!d.autoEnabled)).catch(()=>{}); setBackupTablesLoading(true); (0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .request */ .Em)('/admin/backup/tables').then((d)=>setBackupTables(d.tables || [])).catch(()=>{}).finally(()=>setBackupTablesLoading(false)); (0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .request */ .Em)('/admin/backup/list').then((d)=>setBackupStoredFiles(d.files || [])).catch(()=>{}); }, [ isAdmin, tab ]); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!isAdmin || tab !== 'referrals') return; setReferralsLoading(true); _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminReferrals */ .cJ().then((d)=>setReferralsData(d)).catch(()=>{}).finally(()=>setReferralsLoading(false)); }, [ isAdmin, tab ]); // Load plans when users tab opens (for plan selector in edit modal) (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!isAdmin || tab !== 'users') return; if (planRows.length === 0) _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminPlans */ .OX().then(setPlanRows).catch(()=>{}); }, [ isAdmin, tab ]); // Reset page when filters change (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ setUsersPage(1); }, [ usersQ, usersRole ]); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ setTasksPage(1); }, [ tasksQ, tasksStatus ]); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ setBalancePage(1); }, [ balanceUserId, balanceKind ]); async function sendAdminPush() { if (!pushTitle.trim()) return; if (pushMode === 'user' && !pushTargetUserId.trim()) { setPushError('УкажОте ID пПльзПвателя'); return; } setPushSending(true); setPushError(null); setPushResult(null); try { const payload = { title: pushTitle.trim(), body: pushBody.trim() || undefined, type: pushType.trim() || undefined, referenceId: pushReferenceId.trim() || undefined }; if (pushMode === 'broadcast') { const res = await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .adminBroadcastPush */ .V7({ ...payload, onlyActive: pushOnlyActive }); setPushResult(res); } else { const res = await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .adminSendPushToUser */ .g1(pushTargetUserId.trim(), payload); setPushResult(res); } } catch (err) { setPushError((err === null || err === void 0 ? void 0 : err.message) || 'Не уЎалПсь ПтправОть push'); } finally{ setPushSending(false); } } async function toggleUser(id, isActive) { const fn = isActive ? _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .deactivateUser */ .Wi : _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .activateUser */ .He; const updated = await fn(id).catch(()=>null); if (updated) setUsers((prev)=>prev.map((u)=>u.id === id ? updated : u)); } async function changeRole(id, role) { const updated = await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .changeUserRole */ .Mm(id, role).catch(()=>null); if (updated) setUsers((prev)=>prev.map((u)=>u.id === id ? updated : u)); } function openEditUser(u) { setEditUserTab('profile'); setSkillInput(''); setBalanceModal(null); setEditUserCards([]); setCardSkillInputs({}); setCardSaving({}); setCardCatSelects({}); setCardLocSelects({}); setEditUser({ ...u, topUpAmount: '', topUpDescription: '', withdrawAmount: '', withdrawDescription: '' }); _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminUser */ .jd(u.id).then((fresh)=>setEditUser((prev)=>prev && prev.id === fresh.id ? { ...fresh, topUpAmount: '', topUpDescription: '', withdrawAmount: '', withdrawDescription: '' } : prev)).catch(()=>{}); } function describeFcmFailure(key, message) { if (!key) return message || 'FCM прОМял 0 сППбщеМОй'; if (key === 'THIRD_PARTY_AUTH_ERROR') { return 'ОшОбка APNs/Firebase iOS: прПверьте Apple APNs Auth Key (.p8) О связку Firebase прПекта Ўля iOS-прОлПжеМОя'; } if (key === 'UNREGISTERED') { return 'ТПкеМ устрПйства бПльше Ме валОЎеМ'; } if (key === 'INVALID_ARGUMENT') { return 'НекПрректМый тПкеМ ОлО payload'; } if (key === 'REQUEST_FAILED') { return message || 'FCM request failed before response'; } return message ? "".concat(key, ": ").concat(message) : key; } async function saveEditUser() { if (!editUser) return; setEditUserSaving(true); try { var _editUser_languages, _editUser_showContactInfo, _editUser_notifyNewTasks, _editUser_notifMessages, _editUser_skills, _editUser_siteSettings; const updated = await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updateAdminUser */ .wl(editUser.id, { firstName: editUser.firstName, lastName: editUser.lastName, phone: editUser.phone || null, bio: editUser.bio || null, role: editUser.role, planId: editUser.planId || null, isActive: editUser.isActive, locale: editUser.locale, languages: (_editUser_languages = editUser.languages) !== null && _editUser_languages !== void 0 ? _editUser_languages : [], personalSiteSlug: editUser.personalSiteSlug || null, showContactInfo: (_editUser_showContactInfo = editUser.showContactInfo) !== null && _editUser_showContactInfo !== void 0 ? _editUser_showContactInfo : false, notifyNewTasks: (_editUser_notifyNewTasks = editUser.notifyNewTasks) !== null && _editUser_notifyNewTasks !== void 0 ? _editUser_notifyNewTasks : false, notifMessages: (_editUser_notifMessages = editUser.notifMessages) !== null && _editUser_notifMessages !== void 0 ? _editUser_notifMessages : true, skills: (_editUser_skills = editUser.skills) !== null && _editUser_skills !== void 0 ? _editUser_skills : [], siteSettings: (_editUser_siteSettings = editUser.siteSettings) !== null && _editUser_siteSettings !== void 0 ? _editUser_siteSettings : {} }); await Promise.all(editUserCards.map((card)=>{ var _card_skills, _card_categories, _card_locations; return _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .adminUpdateSpecialistCard */ .oq(card.id, { title: card.title, description: card.description || null, skills: (_card_skills = card.skills) !== null && _card_skills !== void 0 ? _card_skills : [], categories: (_card_categories = card.categories) !== null && _card_categories !== void 0 ? _card_categories : [], locations: (_card_locations = card.locations) !== null && _card_locations !== void 0 ? _card_locations : [], publicationStatus: card.publicationStatus, isActive: card.isActive }).catch(()=>null); })); setUsers((prev)=>prev.map((u)=>u.id === editUser.id ? updated : u)); setEditUser(null); } catch (e) {} finally{ setEditUserSaving(false); } } async function verifyEmail() { if (!editUser) return; setVerifyingEmail(true); try { const updated = await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .verifyAdminUserEmail */ .uQ(editUser.id); setEditUser((u)=>u ? { ...u, emailVerified: updated.emailVerified } : u); setUsers((prev)=>prev.map((u)=>u.id === editUser.id ? { ...u, emailVerified: updated.emailVerified } : u)); } catch (e) {} finally{ setVerifyingEmail(false); } } async function handleAdminTopUp() { if (!editUser) return; const amount = Number(editUser.topUpAmount); if (!amount || amount <= 0) return; setTopUpSaving(true); try { const result = await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .adminTopUpUserBalance */ .P0(editUser.id, { amount, description: editUser.topUpDescription || undefined }); setUsers((prev)=>prev.map((u)=>u.id === editUser.id ? result.user : u)); setEditUser((prev)=>prev ? { ...prev, ...result.user, topUpAmount: '', topUpDescription: '' } : prev); if (tab === 'balances') { _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminBalanceHistory */ .g0({ page: balancePage, userId: balanceUserId || undefined, kind: balanceKind || undefined }).then((d)=>{ setBalanceRows(d.data); setBalanceTotal(d.total); }).catch(()=>{}); } } catch (e) { // ignore } finally{ setTopUpSaving(false); } } async function handleAdminWithdraw() { if (!editUser) return; const amount = Number(editUser.withdrawAmount); if (!amount || amount <= 0) return; setWithdrawSaving(true); try { const result = await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .adminWithdrawUserBalance */ .hD(editUser.id, { amount, description: editUser.withdrawDescription || undefined }); setUsers((prev)=>prev.map((u)=>u.id === editUser.id ? result.user : u)); setEditUser((prev)=>prev ? { ...prev, ...result.user, withdrawAmount: '', withdrawDescription: '' } : prev); if (tab === 'balances') { _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminBalanceHistory */ .g0({ page: balancePage, userId: balanceUserId || undefined, kind: balanceKind || undefined }).then((d)=>{ setBalanceRows(d.data); setBalanceTotal(d.total); }).catch(()=>{}); } } catch (e) { // ignore } finally{ setWithdrawSaving(false); } } async function saveCard(cardId) { const card = editUserCards.find((c)=>c.id === cardId); if (!card) return; setCardSaving((prev)=>({ ...prev, [cardId]: true })); try { var _card_skills, _card_categories, _card_locations; const updated = await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .adminUpdateSpecialistCard */ .oq(cardId, { title: card.title, description: card.description || null, skills: (_card_skills = card.skills) !== null && _card_skills !== void 0 ? _card_skills : [], categories: (_card_categories = card.categories) !== null && _card_categories !== void 0 ? _card_categories : [], locations: (_card_locations = card.locations) !== null && _card_locations !== void 0 ? _card_locations : [], publicationStatus: card.publicationStatus, isActive: card.isActive }); setEditUserCards((prev)=>prev.map((c)=>c.id === cardId ? updated : c)); } catch (e) {} finally{ setCardSaving((prev)=>({ ...prev, [cardId]: false })); } } async function updateModerationCard(cardId, publicationStatus) { const updated = await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .adminUpdateSpecialistCard */ .oq(cardId, { publicationStatus, isActive: publicationStatus === 'active' }).catch(()=>null); if (!updated) return; setModerationCards((prev)=>prev.map((card)=>card.id === cardId ? updated : card)); if ((editUser === null || editUser === void 0 ? void 0 : editUser.id) === updated.specialistId) { setEditUserCards((prev)=>prev.map((card)=>card.id === cardId ? updated : card)); } _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminReports */ .z5(1, 'pending').then((d)=>setPendingReportsCount(d.total)).catch(()=>{}); _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminSpecialistCards */ .s_(1, 'pending').then((d)=>setPendingCardsCount(d.total)).catch(()=>{}); } async function cancelTask(id) { const updated = await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .cancelTaskAdmin */ .nf(id).catch(()=>null); if (updated) { const task = updated.task || updated; setTasks((prev)=>prev.map((row)=>{ const t = row.task || row; return t.id === id ? { ...row, task: task } : row; })); } } async function deleteTask(id, title) { if (!window.confirm("".concat(t('admin.tasks.delete.confirm'), '\n"').concat(title, '"'))) return; const ok = await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .deleteTaskAdmin */ .GB(id).catch(()=>null); if (ok) setTasks((prev)=>prev.filter((row)=>{ var _row_task; return (((_row_task = row.task) === null || _row_task === void 0 ? void 0 : _row_task.id) || row.id) !== id; })); } async function handleReport(id, status) { const updated = await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updateReportStatus */ .eU(id, status).catch(()=>null); if (updated) setReports((prev)=>prev.map((r)=>r.id === id ? { ...r, ...updated } : r)); } // Locations (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!isAdmin || tab !== 'locations') return; _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminLocations */ .k_().then(setLocRows).catch(()=>{}); }, [ isAdmin, tab ]); function openAddLoc(parentId) { setLocForm({ parentId: parentId !== null && parentId !== void 0 ? parentId : null, slug: '', nameEl: '', nameEn: '', nameRu: '', nameUk: '', order: 0, isActive: true }); } function openEditLoc(loc) { var _loc_names, _loc_names1, _loc_names2, _loc_names3; var _loc_parentId, _loc_nameEl, _ref, _loc_nameEn, _ref1, _loc_nameRu, _ref2, _loc_nameUk, _ref3, _loc_order, _loc_isActive; setLocForm({ id: loc.id, parentId: (_loc_parentId = loc.parentId) !== null && _loc_parentId !== void 0 ? _loc_parentId : null, slug: loc.slug, nameEl: (_ref = (_loc_nameEl = loc.nameEl) !== null && _loc_nameEl !== void 0 ? _loc_nameEl : (_loc_names = loc.names) === null || _loc_names === void 0 ? void 0 : _loc_names.el) !== null && _ref !== void 0 ? _ref : '', nameEn: (_ref1 = (_loc_nameEn = loc.nameEn) !== null && _loc_nameEn !== void 0 ? _loc_nameEn : (_loc_names1 = loc.names) === null || _loc_names1 === void 0 ? void 0 : _loc_names1.en) !== null && _ref1 !== void 0 ? _ref1 : '', nameRu: (_ref2 = (_loc_nameRu = loc.nameRu) !== null && _loc_nameRu !== void 0 ? _loc_nameRu : (_loc_names2 = loc.names) === null || _loc_names2 === void 0 ? void 0 : _loc_names2.ru) !== null && _ref2 !== void 0 ? _ref2 : '', nameUk: (_ref3 = (_loc_nameUk = loc.nameUk) !== null && _loc_nameUk !== void 0 ? _loc_nameUk : (_loc_names3 = loc.names) === null || _loc_names3 === void 0 ? void 0 : _loc_names3.uk) !== null && _ref3 !== void 0 ? _ref3 : '', order: (_loc_order = loc.order) !== null && _loc_order !== void 0 ? _loc_order : 0, isActive: (_loc_isActive = loc.isActive) !== null && _loc_isActive !== void 0 ? _loc_isActive : true }); } async function saveLoc() { if (!locForm) return; setLocSaving(true); try { if (locForm.id) { const updated = await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updateLocation */ .Nt(locForm.id, locForm); setLocRows((prev)=>prev.map((r)=>r.id === locForm.id ? updated : r)); } else { const created = await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .createLocation */ .yJ({ slug: locForm.slug, nameEl: locForm.nameEl, nameEn: locForm.nameEn, nameRu: locForm.nameRu, nameUk: locForm.nameUk, parentId: locForm.parentId, order: locForm.order }); setLocRows((prev)=>[ ...prev, created ]); } setLocForm(null); } catch (e) { // ignore } finally{ setLocSaving(false); } } async function deleteLoc(id, name) { if (!window.confirm("".concat(t('admin.loc.delete.confirm'), '\n"').concat(name, '"'))) return; const ok = await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .deleteLocation */ .zR(id).catch(()=>null); if (ok) setLocRows((prev)=>prev.filter((r)=>r.id !== id)); } function toggleLocExpand(id) { setLocExpanded((prev)=>{ const next = new Set(prev); next.has(id) ? next.delete(id) : next.add(id); return next; }); } // Categories (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!isAdmin || tab !== 'categories') return; _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminCategories */ .KD().then(setCatRows).catch(()=>{}); }, [ isAdmin, tab ]); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!isAdmin) return; fetch('/category-icons/presets.json').then((res)=>res.ok ? res.json() : Promise.reject(new Error('Failed to load presets'))).then((data)=>{ if (!Array.isArray(data)) return; const cleaned = data.filter((x)=>!!x && typeof x === 'object' && typeof x.value === 'string' && typeof x.label === 'string').filter((x)=>x.value.startsWith('/category-icons/')); if (cleaned.length > 0) setCategoryIconPresets(cleaned); }).catch(()=>{}); }, [ isAdmin ]); function openAddCat(parentId) { setCatIconError(null); setCatForm({ parentId: parentId !== null && parentId !== void 0 ? parentId : null, slug: '', icon: '/category-icons/package.svg', namesEl: '', namesEn: '', namesRu: '', namesUk: '', order: 0, isActive: true }); } function openEditCat(cat) { var _cat_names, _cat_names1, _cat_names2, _cat_names3; const selectedIcon = typeof cat.icon === 'string' ? cat.icon : ''; const knownPreset = new Set(categoryIconPresets.map((p)=>p.value)); const normalizedIcon = selectedIcon.startsWith('/category-icons/') && !knownPreset.has(selectedIcon) ? '/category-icons/package.svg' : selectedIcon || '/category-icons/package.svg'; setCatIconError(null); var _cat_parentId, _cat_namesEl, _ref, _cat_namesEn, _ref1, _cat_namesRu, _ref2, _cat_namesUk, _ref3, _cat_order, _cat_isActive; setCatForm({ id: cat.id, parentId: (_cat_parentId = cat.parentId) !== null && _cat_parentId !== void 0 ? _cat_parentId : null, slug: cat.slug, icon: normalizedIcon, namesEl: (_ref = (_cat_namesEl = cat.namesEl) !== null && _cat_namesEl !== void 0 ? _cat_namesEl : (_cat_names = cat.names) === null || _cat_names === void 0 ? void 0 : _cat_names.el) !== null && _ref !== void 0 ? _ref : '', namesEn: (_ref1 = (_cat_namesEn = cat.namesEn) !== null && _cat_namesEn !== void 0 ? _cat_namesEn : (_cat_names1 = cat.names) === null || _cat_names1 === void 0 ? void 0 : _cat_names1.en) !== null && _ref1 !== void 0 ? _ref1 : '', namesRu: (_ref2 = (_cat_namesRu = cat.namesRu) !== null && _cat_namesRu !== void 0 ? _cat_namesRu : (_cat_names2 = cat.names) === null || _cat_names2 === void 0 ? void 0 : _cat_names2.ru) !== null && _ref2 !== void 0 ? _ref2 : '', namesUk: (_ref3 = (_cat_namesUk = cat.namesUk) !== null && _cat_namesUk !== void 0 ? _cat_namesUk : (_cat_names3 = cat.names) === null || _cat_names3 === void 0 ? void 0 : _cat_names3.uk) !== null && _ref3 !== void 0 ? _ref3 : '', order: (_cat_order = cat.order) !== null && _cat_order !== void 0 ? _cat_order : 0, isActive: (_cat_isActive = cat.isActive) !== null && _cat_isActive !== void 0 ? _cat_isActive : true }); } async function uploadCategoryIcon(file) { if (file.type !== 'image/svg+xml') { setCatIconError('Only SVG files are allowed'); return; } setCatIconUploading(true); setCatIconError(null); try { const fd = new FormData(); fd.append('file', file); const base = "https://api.canhelp.gr" || 0; const res = await fetch("".concat(base, "/api/uploads"), { method: 'POST', credentials: 'include', body: fd }); if (!res.ok) { const err = await res.json().catch(()=>({ error: 'Upload failed' })); throw new Error(err.error || 'Upload failed'); } const data = await res.json(); setCatForm((f)=>f ? { ...f, icon: data.url } : f); } catch (err) { setCatIconError((err === null || err === void 0 ? void 0 : err.message) || 'Upload failed'); } finally{ setCatIconUploading(false); } } async function saveCat() { if (!catForm) return; setCatSaving(true); try { if (catForm.id) { const updated = await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updateCategory */ .$7(catForm.id, catForm); setCatRows((prev)=>prev.map((r)=>r.id === catForm.id ? updated : r)); } else { const created = await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .createCategory */ .zZ({ slug: catForm.slug, icon: catForm.icon, namesEl: catForm.namesEl, namesEn: catForm.namesEn, namesRu: catForm.namesRu, namesUk: catForm.namesUk, parentId: catForm.parentId, order: catForm.order }); setCatRows((prev)=>[ ...prev, created ]); } setCatForm(null); } catch (e) { // ignore } finally{ setCatSaving(false); } } async function deleteCat(id, name) { if (!window.confirm("".concat(t('admin.cat.delete.confirm'), '\n"').concat(name, '"'))) return; const ok = await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .deleteCategory */ .K7(id).catch(()=>null); if (ok) setCatRows((prev)=>prev.filter((r)=>r.id !== id)); } function toggleCatExpand(id) { setCatExpanded((prev)=>{ const next = new Set(prev); next.has(id) ? next.delete(id) : next.add(id); return next; }); } async function toggleCatSkills(cat) { const id = cat.id; const slug = cat.slug; setCatSkillsExpanded((prev)=>{ const next = new Set(prev); if (next.has(id)) { next.delete(id); return next; } next.add(id); return next; }); if (!catSkillsCache[slug]) { setCatSkillsLoading((prev)=>new Set(prev).add(id)); try { const skills = await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminSkills */ .i_(slug); setCatSkillsCache((prev)=>({ ...prev, [slug]: skills })); } catch (e) {} finally{ setCatSkillsLoading((prev)=>{ const n = new Set(prev); n.delete(id); return n; }); } } } function openAddSkill(catSlug) { setSkillForm({ catSlug, nameEl: '', nameEn: '', nameRu: '', nameUk: '', order: 0 }); } function openEditSkill(skill, catSlug) { var _skill_nameEl, _skill_nameEn, _skill_nameRu, _skill_nameUk, _skill_order; setSkillForm({ id: skill.id, catSlug, nameEl: (_skill_nameEl = skill.nameEl) !== null && _skill_nameEl !== void 0 ? _skill_nameEl : '', nameEn: (_skill_nameEn = skill.nameEn) !== null && _skill_nameEn !== void 0 ? _skill_nameEn : '', nameRu: (_skill_nameRu = skill.nameRu) !== null && _skill_nameRu !== void 0 ? _skill_nameRu : '', nameUk: (_skill_nameUk = skill.nameUk) !== null && _skill_nameUk !== void 0 ? _skill_nameUk : '', order: (_skill_order = skill.order) !== null && _skill_order !== void 0 ? _skill_order : 0 }); } async function saveSkill() { if (!skillForm) return; setSkillSaving(true); try { if (skillForm.id) { const updated = await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updateSkill */ .fP(skillForm.id, { nameEl: skillForm.nameEl, nameEn: skillForm.nameEn, nameRu: skillForm.nameRu, nameUk: skillForm.nameUk, order: skillForm.order }); setCatSkillsCache((prev)=>{ var _prev_skillForm_catSlug; return { ...prev, [skillForm.catSlug]: ((_prev_skillForm_catSlug = prev[skillForm.catSlug]) !== null && _prev_skillForm_catSlug !== void 0 ? _prev_skillForm_catSlug : []).map((s)=>s.id === skillForm.id ? updated : s) }; }); } else { const created = await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .createSkill */ .S9({ categorySlug: skillForm.catSlug, nameEl: skillForm.nameEl, nameEn: skillForm.nameEn, nameRu: skillForm.nameRu, nameUk: skillForm.nameUk, order: skillForm.order }); setCatSkillsCache((prev)=>{ var _prev_skillForm_catSlug; return { ...prev, [skillForm.catSlug]: [ ...(_prev_skillForm_catSlug = prev[skillForm.catSlug]) !== null && _prev_skillForm_catSlug !== void 0 ? _prev_skillForm_catSlug : [], created ] }; }); } setSkillForm(null); } catch (e) {} finally{ setSkillSaving(false); } } async function deleteSkill(skill, catSlug) { if (!skill._skipConfirm && !window.confirm('УЎалОть Мавык "'.concat(skill.nameEl, '"?'))) return; const ok = skill._skipConfirm ? true : await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .deleteSkill */ .hp(skill.id).catch(()=>null); if (ok) { setCatSkillsCache((prev)=>{ var _prev_catSlug; return { ...prev, [catSlug]: ((_prev_catSlug = prev[catSlug]) !== null && _prev_catSlug !== void 0 ? _prev_catSlug : []).filter((s)=>s.id !== skill.id) }; }); } } function openAddPlan() { setPlanForm({ 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: false, isActive: true, order: 0, notifyNewTasks: false, canContactFreePlan: false, canContactProPlan: true, canContactAll: false, canShowContactInfo: false, canViewPhone: false, canUploadVideo: false, hasFavorites: false, hasGoogleCalendar: false, hasVerifiedBadge: false, highlightedReviews: false, hasPersonalSite: false, hasCanHelpNowStatus: false, hasNeedHelpStatus: false, hasAutoResponse: false, hasAutoMatch: false, hasPriceList: false, receiveInstantDispatchFree: false, receiveInstantDispatchPro: false }); } function openEditPlan(plan) { var _plan_description, _plan_role, _plan_tier, _plan_price, _plan_oldPrice, _plan_currency, _plan_searchBoost, _plan_offersMultiplier, _plan_features, _plan_isDefault, _plan_isActive, _plan_order, _plan_notifyNewTasks, _plan_canContactFreePlan, _plan_canContactProPlan, _plan_canContactAll, _plan_canShowContactInfo, _plan_canViewPhone, _plan_canUploadVideo, _plan_hasFavorites, _plan_hasGoogleCalendar, _plan_hasVerifiedBadge, _plan_highlightedReviews, _plan_hasPersonalSite, _plan_hasCanHelpNowStatus, _plan_hasNeedHelpStatus, _plan_hasAutoResponse, _plan_hasAutoMatch, _plan_hasPriceList, _plan_receiveInstantDispatchFree, _plan_receiveInstantDispatchPro; setPlanForm({ id: plan.id, name: plan.name, description: (_plan_description = plan.description) !== null && _plan_description !== void 0 ? _plan_description : '', role: (_plan_role = plan.role) !== null && _plan_role !== void 0 ? _plan_role : 'customer', tier: (_plan_tier = plan.tier) !== null && _plan_tier !== void 0 ? _plan_tier : 'free', price: (_plan_price = plan.price) !== null && _plan_price !== void 0 ? _plan_price : '0', oldPrice: (_plan_oldPrice = plan.oldPrice) !== null && _plan_oldPrice !== void 0 ? _plan_oldPrice : '', currency: (_plan_currency = plan.currency) !== null && _plan_currency !== void 0 ? _plan_currency : 'EUR', maxTasks: plan.maxTasks != null ? String(plan.maxTasks) : '', maxOffers: plan.maxOffers != null ? String(plan.maxOffers) : '', maxCards: plan.maxCards != null ? String(plan.maxCards) : '', maxMessagesPerDay: plan.maxMessagesPerDay != null ? String(plan.maxMessagesPerDay) : '', maxOrdersPerDay: plan.maxOrdersPerDay != null ? String(plan.maxOrdersPerDay) : '', maxSkills: plan.maxSkills != null ? String(plan.maxSkills) : '', durationDays: plan.durationDays != null ? String(plan.durationDays) : '', searchBoost: (_plan_searchBoost = plan.searchBoost) !== null && _plan_searchBoost !== void 0 ? _plan_searchBoost : 0, offersMultiplier: (_plan_offersMultiplier = plan.offersMultiplier) !== null && _plan_offersMultiplier !== void 0 ? _plan_offersMultiplier : '1.00', features: ((_plan_features = plan.features) !== null && _plan_features !== void 0 ? _plan_features : []).join('\n'), isDefault: (_plan_isDefault = plan.isDefault) !== null && _plan_isDefault !== void 0 ? _plan_isDefault : false, isActive: (_plan_isActive = plan.isActive) !== null && _plan_isActive !== void 0 ? _plan_isActive : true, order: (_plan_order = plan.order) !== null && _plan_order !== void 0 ? _plan_order : 0, notifyNewTasks: (_plan_notifyNewTasks = plan.notifyNewTasks) !== null && _plan_notifyNewTasks !== void 0 ? _plan_notifyNewTasks : false, canContactFreePlan: (_plan_canContactFreePlan = plan.canContactFreePlan) !== null && _plan_canContactFreePlan !== void 0 ? _plan_canContactFreePlan : false, canContactProPlan: (_plan_canContactProPlan = plan.canContactProPlan) !== null && _plan_canContactProPlan !== void 0 ? _plan_canContactProPlan : true, canContactAll: (_plan_canContactAll = plan.canContactAll) !== null && _plan_canContactAll !== void 0 ? _plan_canContactAll : false, canShowContactInfo: (_plan_canShowContactInfo = plan.canShowContactInfo) !== null && _plan_canShowContactInfo !== void 0 ? _plan_canShowContactInfo : false, canViewPhone: (_plan_canViewPhone = plan.canViewPhone) !== null && _plan_canViewPhone !== void 0 ? _plan_canViewPhone : false, canUploadVideo: (_plan_canUploadVideo = plan.canUploadVideo) !== null && _plan_canUploadVideo !== void 0 ? _plan_canUploadVideo : false, hasFavorites: (_plan_hasFavorites = plan.hasFavorites) !== null && _plan_hasFavorites !== void 0 ? _plan_hasFavorites : false, hasGoogleCalendar: (_plan_hasGoogleCalendar = plan.hasGoogleCalendar) !== null && _plan_hasGoogleCalendar !== void 0 ? _plan_hasGoogleCalendar : false, hasVerifiedBadge: (_plan_hasVerifiedBadge = plan.hasVerifiedBadge) !== null && _plan_hasVerifiedBadge !== void 0 ? _plan_hasVerifiedBadge : false, highlightedReviews: (_plan_highlightedReviews = plan.highlightedReviews) !== null && _plan_highlightedReviews !== void 0 ? _plan_highlightedReviews : false, hasPersonalSite: (_plan_hasPersonalSite = plan.hasPersonalSite) !== null && _plan_hasPersonalSite !== void 0 ? _plan_hasPersonalSite : false, hasCanHelpNowStatus: (_plan_hasCanHelpNowStatus = plan.hasCanHelpNowStatus) !== null && _plan_hasCanHelpNowStatus !== void 0 ? _plan_hasCanHelpNowStatus : false, hasNeedHelpStatus: (_plan_hasNeedHelpStatus = plan.hasNeedHelpStatus) !== null && _plan_hasNeedHelpStatus !== void 0 ? _plan_hasNeedHelpStatus : false, hasAutoResponse: (_plan_hasAutoResponse = plan.hasAutoResponse) !== null && _plan_hasAutoResponse !== void 0 ? _plan_hasAutoResponse : false, hasAutoMatch: (_plan_hasAutoMatch = plan.hasAutoMatch) !== null && _plan_hasAutoMatch !== void 0 ? _plan_hasAutoMatch : false, hasPriceList: (_plan_hasPriceList = plan.hasPriceList) !== null && _plan_hasPriceList !== void 0 ? _plan_hasPriceList : false, receiveInstantDispatchFree: (_plan_receiveInstantDispatchFree = plan.receiveInstantDispatchFree) !== null && _plan_receiveInstantDispatchFree !== void 0 ? _plan_receiveInstantDispatchFree : false, receiveInstantDispatchPro: (_plan_receiveInstantDispatchPro = plan.receiveInstantDispatchPro) !== null && _plan_receiveInstantDispatchPro !== void 0 ? _plan_receiveInstantDispatchPro : false }); } async function savePlan() { if (!planForm) return; setPlanSaving(true); try { const payload = { name: planForm.name, description: planForm.description || undefined, role: planForm.role, tier: planForm.tier, price: planForm.price, oldPrice: planForm.oldPrice || null, currency: planForm.currency, maxTasks: planForm.maxTasks ? Number(planForm.maxTasks) : null, maxOffers: planForm.maxOffers ? Number(planForm.maxOffers) : null, maxCards: planForm.maxCards ? Number(planForm.maxCards) : null, maxMessagesPerDay: planForm.maxMessagesPerDay ? Number(planForm.maxMessagesPerDay) : null, maxOrdersPerDay: planForm.maxOrdersPerDay ? Number(planForm.maxOrdersPerDay) : null, maxSkills: planForm.maxSkills ? Number(planForm.maxSkills) : null, durationDays: planForm.durationDays ? Number(planForm.durationDays) : null, notifyNewTasks: planForm.notifyNewTasks, searchBoost: planForm.searchBoost, offersMultiplier: planForm.offersMultiplier, canContactFreePlan: planForm.canContactFreePlan, canContactProPlan: planForm.canContactProPlan, canContactAll: planForm.canContactAll, canShowContactInfo: planForm.canShowContactInfo, canViewPhone: planForm.canViewPhone, canUploadVideo: planForm.canUploadVideo, hasFavorites: planForm.hasFavorites, hasGoogleCalendar: planForm.hasGoogleCalendar, hasVerifiedBadge: planForm.hasVerifiedBadge, highlightedReviews: planForm.highlightedReviews, hasPersonalSite: planForm.hasPersonalSite, hasCanHelpNowStatus: planForm.hasCanHelpNowStatus, hasNeedHelpStatus: planForm.hasNeedHelpStatus, hasAutoResponse: planForm.hasAutoResponse, hasAutoMatch: planForm.hasAutoMatch, hasPriceList: planForm.hasPriceList, receiveInstantDispatchFree: planForm.receiveInstantDispatchFree, receiveInstantDispatchPro: planForm.receiveInstantDispatchPro, features: planForm.features ? planForm.features.split('\n').map((s)=>s.trim()).filter(Boolean) : [], isDefault: planForm.isDefault, isActive: planForm.isActive, order: planForm.order }; if (planForm.id) { const updated = await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updatePlan */ .td(planForm.id, payload); setPlanRows((prev)=>prev.map((r)=>r.id === planForm.id ? updated : r)); } else { const created = await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .createPlan */ .qT(payload); setPlanRows((prev)=>[ ...prev, created ]); } // If set as default — refresh all to sync isDefault flags if (planForm.isDefault) { _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminPlans */ .OX().then(setPlanRows).catch(()=>{}); } setPlanForm(null); } catch (e) { // ignore } finally{ setPlanSaving(false); } } async function deletePlan(id, name) { if (!window.confirm('Delete plan "'.concat(name, '"?'))) return; const ok = await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .deletePlan */ .bR(id).catch(()=>null); if (ok) setPlanRows((prev)=>prev.filter((r)=>r.id !== id)); } // Settings (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!isAdmin || tab !== 'settings') return; if (planRows.length === 0) _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminPlans */ .OX().then(setPlanRows).catch(()=>{}); _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminSettings */ .rC().then((kv)=>{ var _kv_generalsiteName, _kv_generalsiteUrl, _kv_generalcontactEmail, _kv_generalsupportPhone; setGeneralForm({ siteName: (_kv_generalsiteName = kv['general.siteName']) !== null && _kv_generalsiteName !== void 0 ? _kv_generalsiteName : 'CanHelp', siteUrl: (_kv_generalsiteUrl = kv['general.siteUrl']) !== null && _kv_generalsiteUrl !== void 0 ? _kv_generalsiteUrl : '', contactEmail: (_kv_generalcontactEmail = kv['general.contactEmail']) !== null && _kv_generalcontactEmail !== void 0 ? _kv_generalcontactEmail : '', supportPhone: (_kv_generalsupportPhone = kv['general.supportPhone']) !== null && _kv_generalsupportPhone !== void 0 ? _kv_generalsupportPhone : '' }); var _kv_smtphost, _kv_smtpport, _kv_smtpusername, _kv_smtppassword, _kv_smtpfromName, _kv_smtpfromEmail, _kv_smtpencryption; setSmtpForm({ host: (_kv_smtphost = kv['smtp.host']) !== null && _kv_smtphost !== void 0 ? _kv_smtphost : '', port: (_kv_smtpport = kv['smtp.port']) !== null && _kv_smtpport !== void 0 ? _kv_smtpport : '587', username: (_kv_smtpusername = kv['smtp.username']) !== null && _kv_smtpusername !== void 0 ? _kv_smtpusername : '', password: (_kv_smtppassword = kv['smtp.password']) !== null && _kv_smtppassword !== void 0 ? _kv_smtppassword : '', fromName: (_kv_smtpfromName = kv['smtp.fromName']) !== null && _kv_smtpfromName !== void 0 ? _kv_smtpfromName : 'CanHelp', fromEmail: (_kv_smtpfromEmail = kv['smtp.fromEmail']) !== null && _kv_smtpfromEmail !== void 0 ? _kv_smtpfromEmail : '', encryption: (_kv_smtpencryption = kv['smtp.encryption']) !== null && _kv_smtpencryption !== void 0 ? _kv_smtpencryption : 'tls' }); var _kv_paymentepaymerchantId, _kv_paymentepayapiUser, _kv_paymentepayapiPassword, _kv_paymentepayenvironment, _kv_paymentepayconfirmationUrl, _kv_paymentepaycancelUrl; setEPayForm({ merchantId: (_kv_paymentepaymerchantId = kv['payment.epay.merchantId']) !== null && _kv_paymentepaymerchantId !== void 0 ? _kv_paymentepaymerchantId : '', apiUser: (_kv_paymentepayapiUser = kv['payment.epay.apiUser']) !== null && _kv_paymentepayapiUser !== void 0 ? _kv_paymentepayapiUser : '', apiPassword: (_kv_paymentepayapiPassword = kv['payment.epay.apiPassword']) !== null && _kv_paymentepayapiPassword !== void 0 ? _kv_paymentepayapiPassword : '', environment: (_kv_paymentepayenvironment = kv['payment.epay.environment']) !== null && _kv_paymentepayenvironment !== void 0 ? _kv_paymentepayenvironment : 'test', confirmationUrl: (_kv_paymentepayconfirmationUrl = kv['payment.epay.confirmationUrl']) !== null && _kv_paymentepayconfirmationUrl !== void 0 ? _kv_paymentepayconfirmationUrl : '', cancelUrl: (_kv_paymentepaycancelUrl = kv['payment.epay.cancelUrl']) !== null && _kv_paymentepaycancelUrl !== void 0 ? _kv_paymentepaycancelUrl : '', enabled: kv['payment.epay.enabled'] === 'true' }); var _kv_referral_plan_id, _ref, _ref1, _kv_referral_days, _ref2, _ref3; setReferralForm({ enabled: kv['referral_enabled'] === 'true', planId: (_ref1 = (_ref = (_kv_referral_plan_id = kv['referral_plan_id']) !== null && _kv_referral_plan_id !== void 0 ? _kv_referral_plan_id : kv['referral_customer_plan_id']) !== null && _ref !== void 0 ? _ref : kv['referral_specialist_plan_id']) !== null && _ref1 !== void 0 ? _ref1 : '', days: (_ref3 = (_ref2 = (_kv_referral_days = kv['referral_days']) !== null && _kv_referral_days !== void 0 ? _kv_referral_days : kv['referral_customer_days']) !== null && _ref2 !== void 0 ? _ref2 : kv['referral_specialist_days']) !== null && _ref3 !== void 0 ? _ref3 : '30' }); var _kv_seoheadScripts, _kv_seositeTitleel, _ref4, _kv_seositeTitleen, _kv_seositeTitleru, _kv_seositeTitleuk, _kv_seositeDescriptionel, _ref5, _kv_seositeDescriptionen, _kv_seositeDescriptionru, _kv_seositeDescriptionuk; setSeoForm({ maintenanceMode: kv['seo.maintenanceMode'] === 'true', indexingEnabled: kv['seo.indexingEnabled'] !== 'false', headScripts: (_kv_seoheadScripts = kv['seo.headScripts']) !== null && _kv_seoheadScripts !== void 0 ? _kv_seoheadScripts : '', siteTitleEl: (_ref4 = (_kv_seositeTitleel = kv['seo.siteTitle.el']) !== null && _kv_seositeTitleel !== void 0 ? _kv_seositeTitleel : kv['seo.siteTitle']) !== null && _ref4 !== void 0 ? _ref4 : '', siteTitleEn: (_kv_seositeTitleen = kv['seo.siteTitle.en']) !== null && _kv_seositeTitleen !== void 0 ? _kv_seositeTitleen : '', siteTitleRu: (_kv_seositeTitleru = kv['seo.siteTitle.ru']) !== null && _kv_seositeTitleru !== void 0 ? _kv_seositeTitleru : '', siteTitleUk: (_kv_seositeTitleuk = kv['seo.siteTitle.uk']) !== null && _kv_seositeTitleuk !== void 0 ? _kv_seositeTitleuk : '', siteDescriptionEl: (_ref5 = (_kv_seositeDescriptionel = kv['seo.siteDescription.el']) !== null && _kv_seositeDescriptionel !== void 0 ? _kv_seositeDescriptionel : kv['seo.siteDescription']) !== null && _ref5 !== void 0 ? _ref5 : '', siteDescriptionEn: (_kv_seositeDescriptionen = kv['seo.siteDescription.en']) !== null && _kv_seositeDescriptionen !== void 0 ? _kv_seositeDescriptionen : '', siteDescriptionRu: (_kv_seositeDescriptionru = kv['seo.siteDescription.ru']) !== null && _kv_seositeDescriptionru !== void 0 ? _kv_seositeDescriptionru : '', siteDescriptionUk: (_kv_seositeDescriptionuk = kv['seo.siteDescription.uk']) !== null && _kv_seositeDescriptionuk !== void 0 ? _kv_seositeDescriptionuk : '' }); var _kv_socialtelegram, _kv_socialinstagram, _kv_socialfacebook, _kv_socialtwitter, _kv_socialyoutube, _kv_socialtiktok, _kv_socialwhatsapp, _kv_socialviber; setSocialForm({ telegram: (_kv_socialtelegram = kv['social.telegram']) !== null && _kv_socialtelegram !== void 0 ? _kv_socialtelegram : '', instagram: (_kv_socialinstagram = kv['social.instagram']) !== null && _kv_socialinstagram !== void 0 ? _kv_socialinstagram : '', facebook: (_kv_socialfacebook = kv['social.facebook']) !== null && _kv_socialfacebook !== void 0 ? _kv_socialfacebook : '', twitter: (_kv_socialtwitter = kv['social.twitter']) !== null && _kv_socialtwitter !== void 0 ? _kv_socialtwitter : '', youtube: (_kv_socialyoutube = kv['social.youtube']) !== null && _kv_socialyoutube !== void 0 ? _kv_socialyoutube : '', tiktok: (_kv_socialtiktok = kv['social.tiktok']) !== null && _kv_socialtiktok !== void 0 ? _kv_socialtiktok : '', whatsapp: (_kv_socialwhatsapp = kv['social.whatsapp']) !== null && _kv_socialwhatsapp !== void 0 ? _kv_socialwhatsapp : '', viber: (_kv_socialviber = kv['social.viber']) !== null && _kv_socialviber !== void 0 ? _kv_socialviber : '' }); var _kv_telegrambotToken, _kv_telegramadminChatId, _kv_telegramchannelIdel, _kv_telegramchannelIden, _kv_telegramchannelIdru, _kv_telegramchannelIduk; setTelegramForm({ botToken: (_kv_telegrambotToken = kv['telegram.botToken']) !== null && _kv_telegrambotToken !== void 0 ? _kv_telegrambotToken : '', adminChatId: (_kv_telegramadminChatId = kv['telegram.adminChatId']) !== null && _kv_telegramadminChatId !== void 0 ? _kv_telegramadminChatId : '', channelIdEl: (_kv_telegramchannelIdel = kv['telegram.channelId.el']) !== null && _kv_telegramchannelIdel !== void 0 ? _kv_telegramchannelIdel : '', channelIdEn: (_kv_telegramchannelIden = kv['telegram.channelId.en']) !== null && _kv_telegramchannelIden !== void 0 ? _kv_telegramchannelIden : '', channelIdRu: (_kv_telegramchannelIdru = kv['telegram.channelId.ru']) !== null && _kv_telegramchannelIdru !== void 0 ? _kv_telegramchannelIdru : '', channelIdUk: (_kv_telegramchannelIduk = kv['telegram.channelId.uk']) !== null && _kv_telegramchannelIduk !== void 0 ? _kv_telegramchannelIduk : '', notifyRegistrations: kv['telegram.notifyRegistrations'] === 'true', postNewTasks: kv['telegram.postNewTasks'] === 'true' }); }).catch(()=>{}); _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminEmailTemplates */ .Lp().then((rows)=>{ const map = {}; for (const r of rows)map[r.key] = { subject: r.subject, body: r.body }; setNotifTemplates((prev)=>({ ...prev, ...map })); }).catch(()=>{}); }, [ isAdmin, tab ]); async function saveGeneralSettings() { setGeneralSaving(true); try { await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updateAdminSettings */ .CX({ 'general.siteName': generalForm.siteName, 'general.siteUrl': generalForm.siteUrl, 'general.contactEmail': generalForm.contactEmail, 'general.supportPhone': generalForm.supportPhone }); setGeneralSaved(true); setTimeout(()=>setGeneralSaved(false), 2500); } catch (e) {} finally{ setGeneralSaving(false); } } async function saveSmtpSettings() { setSmtpSaving(true); try { await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updateAdminSettings */ .CX({ 'smtp.host': smtpForm.host, 'smtp.port': smtpForm.port, 'smtp.username': smtpForm.username, 'smtp.password': smtpForm.password, 'smtp.fromName': smtpForm.fromName, 'smtp.fromEmail': smtpForm.fromEmail, 'smtp.encryption': smtpForm.encryption }); setSmtpSaved(true); setTimeout(()=>setSmtpSaved(false), 2500); } catch (e) {} finally{ setSmtpSaving(false); } } async function autoTranslateTemplate(key) { const localeKey = "".concat(key, "_").concat(templateLocale); var _notifTemplates_localeKey, _ref; const current = (_ref = (_notifTemplates_localeKey = notifTemplates[localeKey]) !== null && _notifTemplates_localeKey !== void 0 ? _notifTemplates_localeKey : notifTemplates[key]) !== null && _ref !== void 0 ? _ref : { subject: '', body: '' }; if (!current.subject && !current.body) return; setTemplateTranslating(true); try { // СПхраМяеЌ ОсхПЎМый язык в БД (еслО ещё Ме сПхраМёМ) await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updateAdminEmailTemplate */ .jg(localeKey, current); // ПеревПЎОЌ Ма ПстальМые языкО const results = await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .translateAdminEmailTemplate */ .wc({ subject: current.subject, body: current.body, fromLocale: templateLocale }); // ОбМПвляеЌ state setNotifTemplates((prev)=>{ const next = { ...prev, [localeKey]: current }; for (const [loc, tpl] of Object.entries(results)){ next["".concat(key, "_").concat(loc)] = tpl; } return next; }); // СПхраМяеЌ кажЎый перевПЎ в БД await Promise.all(Object.entries(results).map((param)=>{ let [loc, tpl] = param; return _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updateAdminEmailTemplate */ .jg("".concat(key, "_").concat(loc), tpl); })); } catch (e) {} finally{ setTemplateTranslating(false); } } async function saveTemplate(key) { const localeKey = "".concat(key, "_").concat(templateLocale); setTemplateSaving(true); try { var _notifTemplates_localeKey; await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updateAdminEmailTemplate */ .jg(localeKey, (_notifTemplates_localeKey = notifTemplates[localeKey]) !== null && _notifTemplates_localeKey !== void 0 ? _notifTemplates_localeKey : { subject: '', body: '' }); setEditingTemplate(null); } catch (e) {} finally{ setTemplateSaving(false); } } async function saveEPaySettings() { setEPaySaving(true); try { await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updateAdminSettings */ .CX({ 'payment.epay.merchantId': ePayForm.merchantId, 'payment.epay.apiUser': ePayForm.apiUser, 'payment.epay.apiPassword': ePayForm.apiPassword, 'payment.epay.environment': ePayForm.environment, 'payment.epay.confirmationUrl': ePayForm.confirmationUrl, 'payment.epay.cancelUrl': ePayForm.cancelUrl, 'payment.epay.enabled': String(ePayForm.enabled) }); setEPaySaved(true); setTimeout(()=>setEPaySaved(false), 2500); } catch (e) {} finally{ setEPaySaving(false); } } async function saveReferralSettings() { setReferralSaving(true); try { await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updateAdminSettings */ .CX({ 'referral_enabled': String(referralForm.enabled), 'referral_plan_id': referralForm.planId, 'referral_days': referralForm.days }); setReferralSaved(true); setTimeout(()=>setReferralSaved(false), 2500); } catch (e) {} finally{ setReferralSaving(false); } } async function saveSeoSettings() { setSeoSaving(true); try { await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updateAdminSettings */ .CX({ 'seo.maintenanceMode': String(seoForm.maintenanceMode), 'seo.indexingEnabled': String(seoForm.indexingEnabled), 'seo.headScripts': seoForm.headScripts, 'seo.siteTitle.el': seoForm.siteTitleEl, 'seo.siteTitle.en': seoForm.siteTitleEn, 'seo.siteTitle.ru': seoForm.siteTitleRu, 'seo.siteTitle.uk': seoForm.siteTitleUk, 'seo.siteDescription.el': seoForm.siteDescriptionEl, 'seo.siteDescription.en': seoForm.siteDescriptionEn, 'seo.siteDescription.ru': seoForm.siteDescriptionRu, 'seo.siteDescription.uk': seoForm.siteDescriptionUk }); setSeoSaved(true); setTimeout(()=>setSeoSaved(false), 2500); } catch (e) {} finally{ setSeoSaving(false); } } async function saveSocialSettings() { setSocialSaving(true); try { await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updateAdminSettings */ .CX({ 'social.telegram': socialForm.telegram, 'social.instagram': socialForm.instagram, 'social.facebook': socialForm.facebook, 'social.twitter': socialForm.twitter, 'social.youtube': socialForm.youtube, 'social.tiktok': socialForm.tiktok, 'social.whatsapp': socialForm.whatsapp, 'social.viber': socialForm.viber }); setSocialSaved(true); setTimeout(()=>setSocialSaved(false), 2500); } catch (e) {} finally{ setSocialSaving(false); } } async function saveTelegramSettings() { setTelegramSaving(true); try { await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updateAdminSettings */ .CX({ 'telegram.botToken': telegramForm.botToken, 'telegram.adminChatId': telegramForm.adminChatId, 'telegram.channelId.el': telegramForm.channelIdEl, 'telegram.channelId.en': telegramForm.channelIdEn, 'telegram.channelId.ru': telegramForm.channelIdRu, 'telegram.channelId.uk': telegramForm.channelIdUk, 'telegram.notifyRegistrations': String(telegramForm.notifyRegistrations), 'telegram.postNewTasks': String(telegramForm.postNewTasks) }); setTelegramSaved(true); setTimeout(()=>setTelegramSaved(false), 2500); } catch (e) {} finally{ setTelegramSaving(false); } } async function testTelegram(type) { const chatIdMap = { admin: telegramForm.adminChatId, el: telegramForm.channelIdEl, en: telegramForm.channelIdEn, ru: telegramForm.channelIdRu, uk: telegramForm.channelIdUk }; var _chatIdMap_type; const chatId = (_chatIdMap_type = chatIdMap[type]) !== null && _chatIdMap_type !== void 0 ? _chatIdMap_type : ''; if (type === 'admin') { setTestingTelegramAdmin(true); setTestResultTelegramAdmin(null); } else { setTestingLocale(type); setTestResultChannels((p)=>{ const n = { ...p }; delete n[type]; return n; }); } try { const res = await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .testTelegramConnection */ .qX(telegramForm.botToken, chatId); var _res_error; const result = { ok: res.ok, msg: res.ok ? res.botName ? "@".concat(res.botName) : t('admin.settings.telegram.test_ok') : (_res_error = res.error) !== null && _res_error !== void 0 ? _res_error : t('admin.settings.telegram.test_fail') }; if (type === 'admin') setTestResultTelegramAdmin(result); else setTestResultChannels((p)=>({ ...p, [type]: result })); } catch (e) { const result = { ok: false, msg: t('admin.settings.telegram.test_fail') }; if (type === 'admin') setTestResultTelegramAdmin(result); else setTestResultChannels((p)=>({ ...p, [type]: result })); } finally{ if (type === 'admin') setTestingTelegramAdmin(false); else setTestingLocale(null); } } async function verifyTelegramToken() { setVerifyingTelegramToken(true); setVerifyResultTelegramToken(null); try { const res = await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .verifyTelegramToken */ .cl(telegramForm.botToken); var _res_error; setVerifyResultTelegramToken({ ok: res.ok, msg: res.ok ? "@".concat(res.botName) : (_res_error = res.error) !== null && _res_error !== void 0 ? _res_error : t('admin.settings.telegram.test_fail') }); } catch (e) { setVerifyResultTelegramToken({ ok: false, msg: t('admin.settings.telegram.test_fail') }); } finally{ setVerifyingTelegramToken(false); } } if (isPending) return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-center py-20 text-gray-500", children: t('common.loading') }); const dateLocale = locale === 'ru' ? 'ru-RU' : locale === 'en' ? 'en-US' : 'el-GR'; const catName = (id)=>{ const cat = catRows.find((c)=>c.id === id); if (!cat) return id; if (locale === 'en') return cat.namesEn || cat.namesEl; if (locale === 'ru') return cat.namesRu || cat.namesEl; if (locale === 'uk') return cat.namesUk || cat.namesEl; return cat.namesEl || cat.namesEn || id; }; const locName = (id)=>{ const loc = locRows.find((l)=>l.id === id); if (!loc) return id; if (locale === 'en') return loc.nameEn || loc.nameEl; if (locale === 'ru') return loc.nameRu || loc.nameEl; if (locale === 'uk') return loc.nameUk || loc.nameEl; return loc.nameEl || loc.nameEn || id; }; const TABS = [ { key: 'stats', label: t('admin.tab.stats'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: t('admin.tab.users'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M17 21v-2a4 4 0 00-4-4H5a4 4 0 00-4 4v2" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("circle", { cx: "9", cy: "7", r: "4" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: t('admin.tab.tasks'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: t('admin.tab.reports'), badge: pendingReportsCount || undefined, icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: t('admin.tab.moderation'), badge: pendingCardsCount || undefined, icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 20h12" }) ] }) }, { key: 'categories', label: t('admin.tab.categories'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: t('admin.tab.locations'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 11a3 3 0 11-6 0 3 3 0 016 0z" }) ] }) }, { key: 'balances', label: t('admin.tab.balances', 'Balance'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M20 12h-6m0 0a2 2 0 100 4h6v-8h-6a2 2 0 100 4z" }) ] }) }, { key: 'plans', label: t('admin.tab.plans'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("rect", { x: "1", y: "4", width: "22", height: "16", rx: "2", ry: "2" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: "1", y1: "10", x2: "23", y2: "10" }) ] }) }, { key: 'logs', label: t('admin.tab.logs'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("polyline", { points: "4 17 10 11 4 5" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: "12", y1: "19", x2: "20", y2: "19" }) ] }) }, { key: 'settings', label: t('admin.tab.settings'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("circle", { cx: "12", cy: "12", r: "3" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: t('admin.tab.support', 'Support'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: t('admin.tab.push', 'Push'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: t('admin.tab.backup', 'Backup'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: t('admin.tab.translations', 'Translations'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: t('admin.tab.dbcheck', 'DB check'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("ellipse", { cx: "12", cy: "5", rx: "9", ry: "3" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M21 12c0 1.66-4.03 3-9 3S3 13.66 3 12" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M3 5v14c0 1.66 4.03 3 9 3s9-1.34 9-3V5" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 12l2 2 4-4" }) ] }) }, { key: 'referrals', label: t('admin.tab.referrals', 'Referrals'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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" }) }) } ]; const statusColors = { 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' }; const reportStatusColors = { pending: 'bg-yellow-100 text-yellow-700', reviewed: 'bg-green-100 text-green-700', dismissed: 'bg-gray-100 text-gray-500' }; const reasonColors = { 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' }; const cardStatus = (card)=>{ var _card_publicationStatus; return (_card_publicationStatus = card.publicationStatus) !== null && _card_publicationStatus !== void 0 ? _card_publicationStatus : card.isActive ? 'active' : 'inactive'; }; const pendingModerationCards = moderationCards.filter((card)=>cardStatus(card) === 'pending'); const activeModerationCards = moderationCards.filter((card)=>cardStatus(card) === 'active'); var _stats_totalCostUsd, _planForm_oldPrice, _pushResult_tokensFound, _pushResult_usersWithoutTokens, _pushResult_usersConfigBlocked, _pushResult_usersAuthFailed, _pushResult_usersAllFailed, _pushResult_usersWithoutTokens1, _pushResult_usersConfigBlocked1, _pushResult_usersAuthFailed1, _pushResult_usersAllFailed1, _referralsData_totalReferrers, _referralsData_totalReferrals, _referralsData_activeRewards, _editUser_firstName, _editUser_lastName, _editUser_phone, _editUser_bio, _editUser_planId, _editUser_locale, _editUser_balance, _editUser_showContactInfo, _editUser_notifyNewTasks, _editUser_notifMessages, _editUser_personalSiteSlug, _editUser_siteSettings, _siteTheme, _editUser_skills, _editUser_balance1, _editUser_topUpAmount, _editUser_withdrawAmount, _editUser_topUpDescription, _editUser_withdrawDescription; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "min-h-screen bg-gray-50", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "max-w-7xl mx-auto px-4 py-8", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-between mb-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-7 h-7 text-yellow-500", fill: "currentColor", viewBox: "0 0 24 24", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M5 16L3 5l5.5 5L12 4l3.5 6L21 5l-2 11H5zm0 3a1 1 0 000 2h14a1 1 0 000-2H5z" }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h1", { className: "text-2xl font-bold text-gray-900", children: t('admin.title') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)((next_link__WEBPACK_IMPORTED_MODULE_3___default()), { href: "/", className: "flex items-center gap-1.5 text-sm text-gray-500 hover:text-green-600 transition", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 19l-7-7 7-7" }) }), t('admin.back_home') ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("aside", { className: "shrink-0 transition-all duration-200 ".concat(sidebarCollapsed ? 'w-12' : 'w-52'), children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("nav", { className: "bg-white rounded-xl border border-gray-200 overflow-hidden", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>setSidebarCollapsed((v)=>!v), title: sidebarCollapsed ? 'РазверМуть ЌеМю' : 'СверМуть ЌеМю', 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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 transition-transform duration-200 ".concat(sidebarCollapsed ? 'rotate-180' : ''), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 19l-7-7 7-7" }) }) }), TABS.map((param)=>{ let { key, label, icon, badge } = param; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { onClick: ()=>setTab(key), title: sidebarCollapsed ? label : undefined, className: "w-full flex items-center py-3 text-sm font-medium text-left transition ".concat(tab === key ? 'bg-green-50 text-green-700 border-r-2 border-green-600' : 'text-gray-600 hover:bg-gray-50 hover:text-gray-900', " ").concat(sidebarCollapsed ? 'justify-center px-3' : 'gap-3 px-4'), children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "w-4 h-4 flex-shrink-0 flex items-center justify-center", children: icon }), !sidebarCollapsed && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "flex items-center gap-2 min-w-0", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { children: label }), badge ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: badge }) : null ] }) ] }, key); }) ] }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex-1 min-w-0", children: [ tab === 'stats' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "grid grid-cols-2 md:grid-cols-5 gap-4", children: [ { label: t('admin.stats.users'), value: stats === null || stats === void 0 ? void 0 : stats.userCount, icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-8 h-8", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: t('admin.stats.specialists'), value: stats === null || stats === void 0 ? void 0 : stats.specialistCount, icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-8 h-8", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 12a3 3 0 11-6 0 3 3 0 016 0z" }) ] }), color: 'text-purple-600' }, { label: t('admin.stats.tasks'), value: stats === null || stats === void 0 ? void 0 : stats.taskCount, icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-8 h-8", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: t('admin.stats.offers'), value: stats === null || stats === void 0 ? void 0 : stats.offerCount, icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-8 h-8", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: t('admin.stats.reviews'), value: stats === null || stats === void 0 ? void 0 : stats.reviewCount, icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-8 h-8", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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((param)=>{ let { label, value, icon, color } = param; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "mb-2 ".concat(color), children: icon }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-3xl font-bold ".concat(color), children: value !== null && value !== void 0 ? value : '—' }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-sm text-gray-500 mt-1", children: label }) ] }, label); }) }), (stats === null || stats === void 0 ? void 0 : stats.tasksByDay) && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-between mb-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "font-semibold text-gray-800", children: t('admin.stats.activity_30d') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-4 text-xs text-gray-500", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "flex items-center gap-1.5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "w-3 h-0.5 bg-green-500 inline-block rounded" }), t('admin.stats.users_label') ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "flex items-center gap-1.5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "w-3 h-0.5 bg-purple-400 inline-block rounded" }), t('admin.stats.specialists_label') ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "flex items-center gap-1.5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "w-3 h-0.5 bg-green-500 inline-block rounded" }), t('admin.stats.tasks_label') ] }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(AdminAreaChart, { series: [ { data: stats.usersByDay, color: '#3b82f6', fill: '#3b82f615', label: t('admin.stats.users_label') }, { data: stats.specialistsByDay, color: '#a855f7', fill: '#a855f710', label: t('admin.stats.specialists_label') }, { data: stats.tasksByDay, color: '#22c55e', fill: '#22c55e10', label: t('admin.stats.tasks_label') } ] }) ] }), (stats === null || stats === void 0 ? void 0 : stats.tasksByStatus) && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "font-semibold text-gray-800 mb-5", children: t('admin.stats.tasks_by_status') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "space-y-3", children: (()=>{ const total = stats.tasksByStatus.reduce((s, r)=>s + Number(r.count), 0) || 1; const statusMeta = { open: { label: t('admin.task_status.open'), bg: 'bg-green-50', bar: 'bg-green-500' }, in_progress: { label: t('admin.task_status.in_progress'), bg: 'bg-green-50', bar: 'bg-green-500' }, completed: { label: t('admin.task_status.completed'), bg: 'bg-gray-50', bar: 'bg-gray-400' }, cancelled: { label: t('admin.task_status.cancelled'), bg: 'bg-red-50', bar: 'bg-red-400' }, draft: { label: t('admin.task_status.draft'), bg: 'bg-yellow-50', bar: 'bg-yellow-400' } }; const order = [ 'open', 'in_progress', 'completed', 'draft', 'cancelled' ]; const sorted = [ ...stats.tasksByStatus ].sort((a, b)=>order.indexOf(a.status) - order.indexOf(b.status)); return sorted.map((param)=>{ let { status, count: c } = param; var _statusMeta_status; const meta = (_statusMeta_status = statusMeta[status]) !== null && _statusMeta_status !== void 0 ? _statusMeta_status : { label: status, bg: 'bg-gray-50', bar: 'bg-gray-300' }; const pct = Math.round(Number(c) / total * 100); return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-3 px-3 py-2 rounded-lg ".concat(meta.bg), children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-sm text-gray-600 w-28 shrink-0", children: meta.label }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex-1 bg-gray-200 rounded-full h-2 overflow-hidden", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "h-full rounded-full ".concat(meta.bar, " transition-all"), style: { width: "".concat(pct, "%") } }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-sm font-semibold text-gray-700 w-8 text-right", children: c }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "text-xs text-gray-400 w-8", children: [ pct, "%" ] }) ] }, status); }); })() }) ] }), notifsByDay.length > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-between mb-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "font-semibold text-gray-800", children: t('admin.stats.notif_chart_title') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "flex items-center gap-1.5 text-xs text-gray-500", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "w-3 h-0.5 bg-orange-500 inline-block rounded" }), t('admin.stats.notif_label') ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(AdminAreaChart, { series: [ { data: notifsByDay, color: '#f97316', fill: '#f9731615', label: t('admin.stats.notif_label') } ] }) ] }), mailByDay.length > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-between mb-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "font-semibold text-gray-800", children: t('admin.stats.mail_chart_title') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "flex items-center gap-1.5 text-xs text-gray-500", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "w-3 h-0.5 bg-sky-500 inline-block rounded" }), t('admin.stats.mail_label') ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(AdminAreaChart, { series: [ { data: mailByDay, color: '#0ea5e9', fill: '#0ea5e915', label: t('admin.stats.mail_label') } ] }) ] }), stats && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-6 space-y-5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-between", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "font-semibold text-gray-800", children: t('admin.stats.tokens_title') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-4 text-xs text-gray-500", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "flex items-center gap-1.5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "w-3 h-0.5 bg-violet-500 inline-block rounded" }), t('admin.stats.tokens_out') ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "flex items-center gap-1.5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "w-3 h-0.5 bg-sky-500 inline-block rounded" }), t('admin.stats.tokens_in') ] }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "grid grid-cols-3 gap-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "rounded-lg bg-violet-50 border border-violet-100 px-4 py-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-xs text-violet-600 mb-1", children: t('admin.stats.tokens_out_label') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-2xl font-bold text-violet-700", children: Number(stats.totalOutputTokens).toLocaleString() }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "rounded-lg bg-sky-50 border border-sky-100 px-4 py-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-xs text-sky-600 mb-1", children: t('admin.stats.tokens_in_label') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-2xl font-bold text-sky-700", children: Number(stats.totalInputTokens).toLocaleString() }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "rounded-lg bg-emerald-50 border border-emerald-100 px-4 py-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-xs text-emerald-600 mb-1", children: t('admin.stats.cost_label') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "text-2xl font-bold text-emerald-700", children: [ "$", Number((_stats_totalCostUsd = stats.totalCostUsd) !== null && _stats_totalCostUsd !== void 0 ? _stats_totalCostUsd : 0).toFixed(4) ] }) ] }) ] }), ((_stats_tokensByMonth = stats.tokensByMonth) === null || _stats_tokensByMonth === void 0 ? void 0 : _stats_tokensByMonth.length) > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(AdminMonthChart, { dateLocale: dateLocale, series: [ { data: stats.tokensByMonth.map((r)=>({ month: r.month, count: Number(r.output) })), color: '#8b5cf6', fill: '#8b5cf610', label: t('admin.stats.tokens_out_label') }, { data: stats.tokensByMonth.map((r)=>({ month: r.month, count: Number(r.input) })), color: '#0ea5e9', fill: '#0ea5e915', label: t('admin.stats.tokens_in_label') } ] }) ] }) ] }), tab === 'users' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-3 mb-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("form", { className: "flex gap-2 flex-1", onSubmit: (e)=>{ e.preventDefault(); setUsersQ(usersQInput); }, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: usersQInput, onChange: (e)=>setUsersQInput(e.target.value), placeholder: t('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" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: t('tasks.search.btn') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("select", { value: usersRole, onChange: (e)=>setUsersRole(e.target.value), className: "border border-gray-300 rounded-lg px-3 py-2 text-sm", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "", children: t('admin.filter.all_roles') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "user", children: t('admin.user_edit.role.user') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "admin", children: t('profile.role.admin') }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 overflow-hidden", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("table", { className: "w-full text-sm", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("thead", { className: "bg-gray-50 text-left", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("tr", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.col.user') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.col.email') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.col.role') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.col.plan', 'Plan') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.col.registered') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.col.status') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3" }) ] }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("tbody", { className: "divide-y divide-gray-100", children: loading ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("tr", { children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { colSpan: 6, className: "px-4 py-8 text-center text-gray-400", children: t('common.loading') }) }) : users.length === 0 ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("tr", { children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { colSpan: 6, className: "px-4 py-8 text-center text-gray-400", children: "—" }) }) : users.map((u)=>{ var _planRows_find; var _planRows_find_name; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("tr", { className: "hover:bg-gray-50", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3 font-medium text-gray-800", children: (0,_lib_formatName__WEBPACK_IMPORTED_MODULE_8__/* .formatShortName */ .H)(u.firstName, u.lastName, u.name) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3 text-gray-500", children: u.email }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "px-2 py-0.5 rounded-full text-xs font-medium ".concat(u.role === 'admin' ? 'bg-red-100 text-red-700' : u.role === 'specialist' ? 'bg-green-100 text-green-700' : 'bg-gray-100 text-gray-600'), children: t("profile.role.".concat(u.role)) || u.role }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3 text-gray-400 text-xs", children: u.planId ? (_planRows_find_name = (_planRows_find = planRows.find((p)=>p.id === u.planId)) === null || _planRows_find === void 0 ? void 0 : _planRows_find.name) !== null && _planRows_find_name !== void 0 ? _planRows_find_name : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "font-mono", children: [ u.planId.slice(0, 8), "
" ] }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-gray-300", children: "—" }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3 text-gray-400", children: new Date(u.createdAt).toLocaleDateString(dateLocale) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "px-2 py-0.5 rounded-full text-xs font-medium ".concat(u.isActive !== false ? 'bg-green-100 text-green-700' : 'bg-red-100 text-red-600'), children: u.isActive !== false ? t('admin.users.active') : t('admin.users.inactive') }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3 text-right", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-end gap-1.5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>openEditUser(u), 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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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" }) }) }), u.role !== 'admin' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>toggleUser(u.id, u.isActive !== false), className: "text-xs px-3 py-1 rounded-lg font-medium ".concat(u.isActive !== false ? 'bg-red-50 text-red-600 hover:bg-red-100' : 'bg-green-50 text-green-600 hover:bg-green-100'), children: u.isActive !== false ? t('admin.users.deactivate') : t('admin.users.activate') }) ] }) }) ] }, u.id); }) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Pagination, { page: usersPage, total: usersTotal, limit: 20, onChange: setUsersPage, totalLabel: t('admin.pagination.total') }) ] }) ] }), tab === 'balances' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex flex-wrap gap-3 mb-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: balanceUserId, onChange: (e)=>setBalanceUserId(e.target.value), placeholder: t('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" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("select", { value: balanceKind, onChange: (e)=>setBalanceKind(e.target.value), className: "border border-gray-300 rounded-lg px-3 py-2 text-sm", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "", children: t('admin.balance.filter.all', 'All operations') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "topup", children: t('admin.balance.kind.topup', 'Top-up') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "plan_purchase", children: t('admin.balance.kind.plan_purchase', 'Plan charge') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "admin_topup", children: t('admin.balance.kind.admin_topup', 'Admin top-up') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "admin_adjustment", children: t('admin.balance.kind.admin_adjustment', 'Adjustment') }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 overflow-hidden", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("table", { className: "w-full text-sm", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("thead", { className: "bg-gray-50 text-left", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("tr", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.col.user') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.balance.col.operation', 'Operation') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.balance.col.amount', 'Amount') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.balance.col.result', 'Balance') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.balance.col.description', 'Description') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.balance.col.date', 'Date') }) ] }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("tbody", { className: "divide-y divide-gray-100", children: loading ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("tr", { children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { colSpan: 6, className: "px-4 py-8 text-center text-gray-400", children: t('common.loading') }) }) : balanceRows.length === 0 ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("tr", { children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { colSpan: 6, className: "px-4 py-8 text-center text-gray-400", children: t('admin.balance.empty', 'No records yet') }) }) : balanceRows.map((row)=>{ const isCredit = row.direction === 'credit'; const kindLabel = row.kind === 'topup' ? t('admin.balance.kind.topup', 'Top-up') : row.kind === 'plan_purchase' ? t('admin.balance.kind.plan_purchase', 'Plan charge') : row.kind === 'admin_topup' ? t('admin.balance.kind.admin_topup', 'Admin top-up') : t('admin.balance.kind.admin_adjustment', 'Adjustment'); return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("tr", { className: "hover:bg-gray-50 align-top", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("td", { className: "px-4 py-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "font-medium text-gray-800", children: row.userName || '—' }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-xs text-gray-500 mt-0.5", children: row.userEmail || row.userId }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "inline-flex rounded-full px-2 py-0.5 text-xs font-medium ".concat(isCredit ? 'bg-emerald-50 text-emerald-700' : 'bg-rose-50 text-rose-700'), children: kindLabel }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("td", { className: "px-4 py-3 font-semibold ".concat(isCredit ? 'text-emerald-700' : 'text-rose-700'), children: [ isCredit ? '+' : '-', Number(row.amount).toFixed(2), " ", row.currency ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3 text-gray-600", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ Number(row.balanceBefore).toFixed(2), " → ", Number(row.balanceAfter).toFixed(2), " ", row.currency ] }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3 text-gray-500 max-w-sm", children: row.description || '—' }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3 text-gray-500 whitespace-nowrap", children: new Date(row.createdAt).toLocaleString(dateLocale) }) ] }, row.id); }) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Pagination, { page: balancePage, total: balanceTotal, limit: 50, onChange: setBalancePage, totalLabel: t('admin.pagination.total') }) ] }) ] }), tab === 'tasks' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-3 mb-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("form", { className: "flex gap-2 flex-1", onSubmit: (e)=>{ e.preventDefault(); setTasksQ(tasksQInput); }, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: tasksQInput, onChange: (e)=>setTasksQInput(e.target.value), placeholder: t('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" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: t('tasks.search.btn') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("select", { value: tasksStatus, onChange: (e)=>setTasksStatus(e.target.value), className: "border border-gray-300 rounded-lg px-3 py-2 text-sm", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "", children: t('admin.filter.all_statuses') }), [ 'open', 'in_progress', 'completed', 'cancelled', 'draft' ].map((s)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: s, children: t("task.status.".concat(s), s) }, s)) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 overflow-hidden", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("table", { className: "w-full text-sm", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("thead", { className: "bg-gray-50 text-left", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("tr", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.col.title') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.col.customer') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.col.status') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.col.budget') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.col.created') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3" }) ] }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("tbody", { className: "divide-y divide-gray-100", children: loading ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("tr", { children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { colSpan: 6, className: "px-4 py-8 text-center text-gray-400", children: t('common.loading') }) }) : tasks.length === 0 ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("tr", { children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { colSpan: 6, className: "px-4 py-8 text-center text-gray-400", children: "—" }) }) : tasks.map((row)=>{ const task = row.task || row; const customer = row.customer; var _customer_name, _statusColors_task_status; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("tr", { className: "hover:bg-gray-50", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3 font-medium text-gray-800 max-w-xs", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)((next_link__WEBPACK_IMPORTED_MODULE_3___default()), { href: "/tasks/".concat(task.id), className: "hover:text-green-600 truncate block", target: "_blank", children: locale === 'en' && task.titleEn || locale === 'ru' && task.titleRu || locale === 'uk' && task.titleUk || task.titleEl || task.title }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3 text-gray-500 text-xs", children: (_customer_name = customer === null || customer === void 0 ? void 0 : customer.name) !== null && _customer_name !== void 0 ? _customer_name : '—' }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "px-2 py-0.5 rounded-full text-xs font-medium ".concat((_statusColors_task_status = statusColors[task.status]) !== null && _statusColors_task_status !== void 0 ? _statusColors_task_status : 'bg-gray-100 text-gray-600'), children: t("task.status.".concat(task.status), task.status) }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3 text-gray-500", children: task.budget ? "".concat((0,_lib_taskLocale__WEBPACK_IMPORTED_MODULE_9__/* .formatPrice */ .$g)(task.budget), "€") : '—' }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3 text-gray-400", children: new Date(task.createdAt).toLocaleDateString(dateLocale) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3 text-right", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-1.5 justify-end", children: [ task.status !== 'cancelled' && task.status !== 'completed' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>cancelTask(task.id), className: "text-xs px-2.5 py-1 rounded-lg font-medium bg-yellow-50 text-yellow-700 hover:bg-yellow-100", children: t('admin.tasks.cancel') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>deleteTask(task.id, locale === 'en' && task.titleEn || locale === 'ru' && task.titleRu || locale === 'uk' && task.titleUk || task.titleEl || task.title), className: "text-xs px-2.5 py-1 rounded-lg font-medium bg-red-50 text-red-600 hover:bg-red-100", children: t('admin.tasks.delete') }) ] }) }) ] }, task.id); }) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Pagination, { page: tasksPage, total: tasksTotal, limit: 20, onChange: setTasksPage, totalLabel: t('admin.pagination.total') }) ] }) ] }), tab === 'categories' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex justify-between items-center mb-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-gray-500", children: t('admin.cat.hint') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { onClick: ()=>openAddCat(null), className: "px-4 py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700", children: [ "+ ", t('admin.cat.add_root') ] }) ] }), catForm && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-green-50 border border-green-200 rounded-xl p-5 mb-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("h3", { className: "font-semibold text-gray-800 mb-4", children: [ catForm.id ? t('admin.cat.edit') : t('admin.cat.new'), catForm.parentId && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "text-xs text-gray-400 ml-2", children: [ "(", t('admin.cat.subcategory'), ")" ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "grid grid-cols-2 md:grid-cols-3 gap-3 mb-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.cat.slug') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: catForm.slug, onChange: (e)=>setCatForm((f)=>f && { ...f, slug: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm", placeholder: "e.g. repairs" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.cat.icon') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(CategoryIconPicker, { value: catForm.icon, onChange: (icon)=>setCatForm((f)=>f && { ...f, icon }), onUpload: uploadCategoryIcon, uploading: catIconUploading, error: catIconError, presets: categoryIconPresets }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.cat.order') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "number", value: catForm.order, onChange: (e)=>setCatForm((f)=>f && { ...f, order: Number(e.target.value) }), className: "w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: [ t('admin.cat.name_el'), " \uD83C\uDDEC\uD83C\uDDF7" ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: catForm.namesEl, onChange: (e)=>setCatForm((f)=>f && { ...f, namesEl: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: [ t('admin.cat.name_en'), " \uD83C\uDDEC\uD83C\uDDE7" ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: catForm.namesEn, onChange: (e)=>setCatForm((f)=>f && { ...f, namesEn: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: [ t('admin.cat.name_ru'), " \uD83C\uDDF7\uD83C\uDDFA" ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: catForm.namesRu, onChange: (e)=>setCatForm((f)=>f && { ...f, namesRu: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: [ t('admin.cat.name_uk'), " \uD83C\uDDFA\uD83C\uDDE6" ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: catForm.namesUk, onChange: (e)=>setCatForm((f)=>f && { ...f, namesUk: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }) ] }), catForm.id && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "flex items-center gap-2 text-sm text-gray-700 mb-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "checkbox", checked: catForm.isActive, onChange: (e)=>setCatForm((f)=>f && { ...f, isActive: e.target.checked }) }), t('admin.cat.active') ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: saveCat, disabled: catSaving, className: "px-4 py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700 disabled:opacity-50", children: catSaving ? t('common.saving') : t('common.save') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>setCatForm(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: t('common.cancel') }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "bg-white rounded-xl border border-gray-200 divide-y divide-gray-100", children: catRows.length === 0 ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "px-4 py-8 text-center text-gray-400", children: t('admin.cat.empty') }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(CatTree, { rows: catRows, parentId: null, depth: 0, locale: locale, expanded: catExpanded, onToggle: toggleCatExpand, onEdit: openEditCat, onDelete: deleteCat, onAddChild: openAddCat, skillsExpanded: catSkillsExpanded, skillsCache: catSkillsCache, skillsLoading: catSkillsLoading, onToggleSkills: toggleCatSkills, skillForm: skillForm, skillSaving: skillSaving, onOpenAddSkill: openAddSkill, onOpenEditSkill: openEditSkill, onSaveSkill: saveSkill, onDeleteSkill: deleteSkill, onCancelSkillForm: ()=>setSkillForm(null), onSkillFormChange: setSkillForm, t: t }) }) ] }), tab === 'locations' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex justify-between items-center mb-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-gray-500", children: t('admin.loc.hint') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { onClick: ()=>openAddLoc(null), className: "px-4 py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700", children: [ "+ ", t('admin.loc.add_city') ] }) ] }), locForm && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-green-50 border border-green-200 rounded-xl p-5 mb-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("h3", { className: "font-semibold text-gray-800 mb-4", children: [ locForm.id ? t('admin.loc.edit') : t('admin.loc.new'), locForm.parentId && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "text-xs text-gray-400 ml-2", children: [ "(", t('admin.loc.district'), ")" ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "grid grid-cols-2 md:grid-cols-4 gap-3 mb-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.cat.slug') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: locForm.slug, onChange: (e)=>setLocForm((f)=>f && { ...f, slug: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm", placeholder: "e.g. athens-center" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: [ t('admin.cat.name_el'), " \uD83C\uDDEC\uD83C\uDDF7" ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: locForm.nameEl, onChange: (e)=>setLocForm((f)=>f && { ...f, nameEl: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: [ t('admin.cat.name_en'), " \uD83C\uDDEC\uD83C\uDDE7" ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: locForm.nameEn, onChange: (e)=>setLocForm((f)=>f && { ...f, nameEn: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: [ t('admin.cat.name_ru'), " \uD83C\uDDF7\uD83C\uDDFA" ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: locForm.nameRu, onChange: (e)=>setLocForm((f)=>f && { ...f, nameRu: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: [ t('admin.cat.name_uk'), " \uD83C\uDDFA\uD83C\uDDE6" ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: locForm.nameUk, onChange: (e)=>setLocForm((f)=>f && { ...f, nameUk: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-4 mb-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "w-24", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.cat.order') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "number", value: locForm.order, onChange: (e)=>setLocForm((f)=>f && { ...f, order: Number(e.target.value) }), className: "w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), locForm.id && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "flex items-center gap-2 text-sm text-gray-700 mt-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "checkbox", checked: locForm.isActive, onChange: (e)=>setLocForm((f)=>f && { ...f, isActive: e.target.checked }) }), t('admin.cat.active') ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: saveLoc, disabled: locSaving, className: "px-4 py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700 disabled:opacity-50", children: locSaving ? t('common.saving') : t('common.save') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>setLocForm(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: t('common.cancel') }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "bg-white rounded-xl border border-gray-200 divide-y divide-gray-100", children: locRows.length === 0 ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "px-4 py-8 text-center text-gray-400", children: t('admin.loc.empty') }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(LocTree, { rows: locRows, parentId: null, depth: 0, locale: locale, expanded: locExpanded, onToggle: toggleLocExpand, onEdit: openEditLoc, onDelete: deleteLoc, onAddChild: openAddLoc, t: t }) }) ] }), tab === 'reports' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-3", children: [ loading ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-center py-10 text-gray-400", children: t('common.loading') }) : reports.length === 0 ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-center py-10 text-gray-400", children: t('admin.reports.none') }) : reports.map((r)=>{ var _r_targetId; var _reportStatusColors_r_status, _reasonColors_r_reason; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "bg-white rounded-xl border border-gray-200 p-5", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-start justify-between gap-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-2 flex-wrap mb-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "px-2 py-0.5 rounded-full text-xs font-medium ".concat((_reportStatusColors_r_status = reportStatusColors[r.status]) !== null && _reportStatusColors_r_status !== void 0 ? _reportStatusColors_r_status : 'bg-gray-100 text-gray-500'), children: r.status }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "px-2 py-0.5 rounded-full text-xs font-medium ".concat((_reasonColors_r_reason = reasonColors[r.reason]) !== null && _reasonColors_r_reason !== void 0 ? _reasonColors_r_reason : 'bg-gray-100 text-gray-600'), children: r.reason }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "text-xs text-gray-400", children: [ r.targetType === 'task' ? t('admin.reports.target.task') : t('admin.reports.target.user'), ":", ' ', r.targetTitle ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)((next_link__WEBPACK_IMPORTED_MODULE_3___default()), { href: r.targetType === 'task' ? "/tasks/".concat(r.targetId) : "/users/".concat(r.targetId), className: "text-green-600 hover:underline font-medium", target: "_blank", children: r.targetTitle }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "font-mono", children: [ "#", (_r_targetId = r.targetId) === null || _r_targetId === void 0 ? void 0 : _r_targetId.slice(0, 8) ] }) ] }) ] }), r.reporterName && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { className: "text-xs text-gray-400 mb-1", children: [ t('admin.col.reporter'), ": ", /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "font-medium text-gray-600", children: r.reporterName }) ] }), r.description && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-gray-700", children: r.description }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400 mt-1.5", children: new Date(r.createdAt).toLocaleString(dateLocale) }) ] }), r.status === 'pending' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-2 flex-shrink-0", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>handleReport(r.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: t('admin.reports.reviewed') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>handleReport(r.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: t('admin.reports.dismiss') }) ] }) ] }) }, r.id); }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Pagination, { page: reportsPage, total: reportsTotal, limit: 20, onChange: setReportsPage, totalLabel: t('admin.pagination.total') }) ] }), tab === 'moderation' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "grid md:grid-cols-2 gap-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-sm text-gray-500", children: t('admin.moderation.pending_count', 'Pending') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-3xl font-bold text-gray-900 mt-1", children: pendingModerationCards.length }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-xs text-gray-400 mt-1", children: t('admin.moderation.pending_hint', 'New proposals waiting for approval') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-sm text-gray-500", children: t('admin.moderation.active_count', 'Active') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-3xl font-bold text-gray-900 mt-1", children: activeModerationCards.length }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-xs text-gray-400 mt-1", children: t('admin.moderation.active_hint', 'Visible cards that can be blocked') }) ] }) ] }), moderationCardsLoading ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-center py-10 text-gray-400", children: t('common.loading') }) : moderationCards.length === 0 ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-center py-10 text-gray-400", children: t('admin.moderation.none', 'No specialist cards found') }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h3", { className: "font-semibold text-gray-800 mb-3", children: t('admin.moderation.pending_title', 'Pending approval') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "space-y-3", children: pendingModerationCards.length === 0 ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-sm text-gray-400 bg-white border border-dashed border-gray-200 rounded-xl p-4", children: t('admin.moderation.pending_empty', 'No pending proposals right now') }) : pendingModerationCards.map((card)=>{ var _card_specialistName, _ref; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "bg-white rounded-xl border border-gray-200 p-4", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex flex-wrap items-start justify-between gap-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "min-w-0 flex-1", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-2 flex-wrap mb-1", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "px-2 py-0.5 rounded-full text-xs font-medium bg-yellow-100 text-yellow-700", children: t('admin.moderation.pending', 'Pending') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-sm font-semibold text-gray-800 truncate", children: card.title }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-xs text-gray-500 mb-2", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)((next_link__WEBPACK_IMPORTED_MODULE_3___default()), { href: "/users/".concat(card.specialistId), className: "hover:text-green-600 hover:underline font-medium", children: (_ref = (_card_specialistName = card.specialistName) !== null && _card_specialistName !== void 0 ? _card_specialistName : card.specialistEmail) !== null && _ref !== void 0 ? _ref : card.specialistId }) }), card.description && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-gray-700 line-clamp-3", children: card.description }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-2 flex-shrink-0", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>updateModerationCard(card.id, 'active'), className: "px-3 py-1.5 rounded-lg text-xs font-medium bg-green-600 text-white hover:bg-green-700", children: t('admin.moderation.approve', 'Approve') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>updateModerationCard(card.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: t('admin.moderation.block', 'Block') }) ] }) ] }) }, card.id); }) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h3", { className: "font-semibold text-gray-800 mb-3", children: t('admin.moderation.active_title', 'Active cards') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "space-y-3", children: activeModerationCards.length === 0 ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-sm text-gray-400 bg-white border border-dashed border-gray-200 rounded-xl p-4", children: t('admin.moderation.active_empty', 'No active cards found') }) : activeModerationCards.map((card)=>{ var _card_specialistName, _ref; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "bg-white rounded-xl border border-gray-200 p-4", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex flex-wrap items-start justify-between gap-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "min-w-0 flex-1", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-2 flex-wrap mb-1", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "px-2 py-0.5 rounded-full text-xs font-medium bg-green-100 text-green-700", children: t('admin.moderation.active', 'Active') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-sm font-semibold text-gray-800 truncate", children: card.title }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-xs text-gray-500 mb-2", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)((next_link__WEBPACK_IMPORTED_MODULE_3___default()), { href: "/users/".concat(card.specialistId), className: "hover:text-green-600 hover:underline font-medium", children: (_ref = (_card_specialistName = card.specialistName) !== null && _card_specialistName !== void 0 ? _card_specialistName : card.specialistEmail) !== null && _ref !== void 0 ? _ref : card.specialistId }) }), card.description && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-gray-700 line-clamp-3", children: card.description }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>updateModerationCard(card.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: t('admin.moderation.block', 'Block') }) ] }) }, card.id); }) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Pagination, { page: moderationCardsPage, total: moderationCardsTotal, limit: 20, onChange: setModerationCardsPage, totalLabel: t('admin.pagination.total') }) ] }) ] }), tab === 'logs' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex gap-1 bg-gray-100 rounded-xl p-1 mb-5 w-fit", children: [ { key: 'ai', label: t('admin.logs.subtab.ai') }, { key: 'activity', label: t('admin.logs.subtab.activity') }, { key: 'mail', label: t('admin.logs.subtab.mail') }, { key: 'notifications', label: t('admin.logs.subtab.notifications') } ].map((param)=>{ let { key, label } = param; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>setLogsSubTab(key), className: "px-4 py-1.5 rounded-lg text-sm font-medium transition-colors ".concat(logsSubTab === key ? 'bg-white text-gray-900 shadow-sm' : 'text-gray-500 hover:text-gray-700'), children: label }, key); }) }), logsSubTab === 'ai' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex justify-between items-center mb-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { className: "text-sm text-gray-500", children: [ t('admin.pagination.total'), ": ", logsTotal ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { onClick: ()=>{ setLogsPage(1); _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminAiLogs */ .j_(1).then((d)=>{ setLogs(d.data); setLogsTotal(d.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: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("polyline", { points: "23 4 23 10 17 10" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M20.49 15a9 9 0 11-2.12-9.36L23 10" }) ] }), t('common.refresh') ] }) ] }), loading ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-center py-10 text-gray-400", children: t('common.loading') }) : logs.length === 0 ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-center py-10 text-gray-400", children: t('admin.logs.empty') }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "overflow-x-auto rounded-xl border border-gray-200", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("table", { className: "w-full text-sm", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("thead", { className: "bg-gray-50 text-gray-500 text-xs uppercase", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("tr", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 text-left", children: t('admin.logs.date') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 text-left", children: t('admin.logs.provider') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 text-left", children: t('admin.logs.model') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 text-left", children: t('admin.logs.action') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 text-left", children: t('admin.logs.langs') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 text-right", children: t('admin.logs.in') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 text-right", children: t('admin.logs.out') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 text-right", children: t('admin.logs.total') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 text-right", children: t('admin.logs.ms') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 text-center", children: t('admin.logs.status') }) ] }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("tbody", { className: "divide-y divide-gray-100", children: logs.map((log)=>{ var _log_inputTokens, _log_outputTokens, _log_totalTokens, _log_durationMs, _log_error; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("tr", { className: "bg-white hover:bg-gray-50", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3 text-gray-500 whitespace-nowrap", children: new Date(log.createdAt).toLocaleString(dateLocale) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "px-2 py-0.5 rounded-full text-xs font-medium ".concat(log.provider === 'anthropic' ? 'bg-purple-100 text-purple-700' : 'bg-green-100 text-green-700'), children: log.provider }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3 text-gray-600 font-mono text-xs", children: log.model }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3 text-gray-600", children: log.action }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3 text-gray-500", children: log.fromLocale && log.toLocale ? "".concat(log.fromLocale, " → ").concat(log.toLocale) : '—' }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3 text-right text-gray-600", children: (_log_inputTokens = log.inputTokens) !== null && _log_inputTokens !== void 0 ? _log_inputTokens : '—' }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3 text-right text-gray-600", children: (_log_outputTokens = log.outputTokens) !== null && _log_outputTokens !== void 0 ? _log_outputTokens : '—' }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3 text-right font-medium", children: (_log_totalTokens = log.totalTokens) !== null && _log_totalTokens !== void 0 ? _log_totalTokens : '—' }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3 text-right text-gray-500", children: (_log_durationMs = log.durationMs) !== null && _log_durationMs !== void 0 ? _log_durationMs : '—' }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3 text-center", children: log.success ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-green-600 flex justify-center", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("polyline", { points: "20 6 9 17 4 12" }) }) }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-red-500 flex justify-center", title: (_log_error = log.error) !== null && _log_error !== void 0 ? _log_error : '', children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: "18", y1: "6", x2: "6", y2: "18" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: "6", y1: "6", x2: "18", y2: "18" }) ] }) }) }) ] }, log.id); }) }) ] }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Pagination, { page: logsPage, total: logsTotal, limit: 50, onChange: setLogsPage, totalLabel: t('admin.pagination.total') }) ] }), logsSubTab === 'activity' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-4 mb-4 flex flex-wrap gap-3 items-end", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs font-medium text-gray-500 mb-1", children: t('admin.activity.event') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("select", { value: activityEvent, onChange: (e)=>setActivityEvent(e.target.value), className: "border border-gray-300 rounded-lg px-3 py-1.5 text-sm min-w-[180px]", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "", children: t('admin.activity.all_events') }), activityEventTypes.map((ev)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: ev, children: ev }, ev)) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs font-medium text-gray-500 mb-1", children: t('admin.activity.from') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "date", value: activityDateFrom, onChange: (e)=>setActivityDateFrom(e.target.value), className: "border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs font-medium text-gray-500 mb-1", children: t('admin.activity.to') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "date", value: activityDateTo, onChange: (e)=>setActivityDateTo(e.target.value), className: "border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), (activityEvent || activityDateFrom || activityDateTo || activityUserId) && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { onClick: ()=>{ setActivityEvent(''); setActivityDateFrom(''); setActivityDateTo(''); setActivityUserId(''); }, 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: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-3 h-3", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: "18", y1: "6", x2: "6", y2: "18" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: "6", y1: "6", x2: "18", y2: "18" }) ] }), t('admin.activity.reset') ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { className: "text-xs text-gray-400 self-end ml-auto", children: [ t('admin.activity.total'), ": ", activityTotal ] }) ] }), activityLog.length === 0 ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-center py-10 text-gray-400", children: t('admin.activity.empty') }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "space-y-2", children: activityLog.map((entry)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(ActivityLogRow, { entry: entry, dateLocale: dateLocale, onFilterUser: (id)=>{ setActivityUserId(id); setActivityEvent(''); }, t: t }, entry.id)) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Pagination, { page: activityPage, total: activityTotal, limit: 50, onChange: setActivityPage, totalLabel: t('admin.pagination.total') }) ] }), logsSubTab === 'mail' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-4 mb-4 flex flex-wrap gap-3 items-end", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs font-medium text-gray-500 mb-1", children: t('admin.mail.event') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("select", { value: mailEvent, onChange: (e)=>setMailEvent(e.target.value), className: "border border-gray-300 rounded-lg px-3 py-1.5 text-sm min-w-[200px]", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "", children: t('admin.mail.all_events') }), mailEventTypes.map((ev)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: ev, children: t("admin.event.".concat(ev.replace(/\./g, '_')), ev) }, ev)) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs font-medium text-gray-500 mb-1", children: t('admin.mail.from') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "date", value: mailDateFrom, onChange: (e)=>setMailDateFrom(e.target.value), className: "border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs font-medium text-gray-500 mb-1", children: t('admin.mail.to') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "date", value: mailDateTo, onChange: (e)=>setMailDateTo(e.target.value), className: "border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), (mailEvent || mailDateFrom || mailDateTo) && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { onClick: ()=>{ setMailEvent(''); setMailDateFrom(''); setMailDateTo(''); }, 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: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-3 h-3", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: "18", y1: "6", x2: "6", y2: "18" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: "6", y1: "6", x2: "18", y2: "18" }) ] }), t('admin.mail.reset') ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { className: "text-xs text-gray-400 self-end ml-auto", children: [ t('admin.mail.total'), ": ", mailTotal ] }) ] }), mailLog.length === 0 ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-center py-10 text-gray-400", children: t('admin.mail.empty') }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "overflow-x-auto rounded-xl border border-gray-200", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("table", { className: "w-full text-sm", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("thead", { className: "bg-gray-50 text-gray-500 text-xs uppercase", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("tr", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 text-left", children: t('admin.logs.date') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 text-left", children: t('admin.mail.recipient') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 text-left", children: t('admin.mail.event') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 text-left", children: t('admin.mail.provider') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 text-left", children: t('admin.mail.details') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 text-center", children: t('admin.mail.status') }) ] }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("tbody", { className: "divide-y divide-gray-100", children: mailLog.map((entry)=>{ const details = parseLogDetails(entry.details); const provider = typeof (details === null || details === void 0 ? void 0 : details.provider) === 'string' ? details.provider : '—'; const recipient = typeof (details === null || details === void 0 ? void 0 : details.to) === 'string' ? details.to : entry.userEmail || '—'; const subject = typeof (details === null || details === void 0 ? void 0 : details.subject) === 'string' ? details.subject : ''; const error = typeof (details === null || details === void 0 ? void 0 : details.error) === 'string' ? details.error : ''; const success = entry.event === 'email.sent' || entry.event === 'admin.email.test.sent'; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("tr", { className: "bg-white hover:bg-gray-50 align-top", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3 text-gray-500 whitespace-nowrap", children: new Date(entry.createdAt).toLocaleString(dateLocale) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3 text-gray-700", children: recipient }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "px-2 py-0.5 rounded-full text-xs font-medium bg-sky-50 text-sky-700", children: t("admin.event.".concat(entry.event.replace(/\./g, '_')), entry.event) }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3 text-gray-600", children: provider }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3 text-gray-600 max-w-md", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "truncate", title: subject || error || undefined, children: subject || error || '—' }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3 text-center", children: success ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-green-600 inline-flex justify-center", title: t('admin.mail.success'), children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("polyline", { points: "20 6 9 17 4 12" }) }) }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-red-500 inline-flex justify-center", title: error || t('admin.mail.failed'), children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: "18", y1: "6", x2: "6", y2: "18" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: "6", y1: "6", x2: "18", y2: "18" }) ] }) }) }) ] }, entry.id); }) }) ] }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Pagination, { page: mailPage, total: mailTotal, limit: 50, onChange: setMailPage, totalLabel: t('admin.pagination.total') }) ] }), logsSubTab === 'notifications' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-4 mb-4 flex flex-wrap gap-3 items-end", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs font-medium text-gray-500 mb-1", children: t('admin.notif_logs.type') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("select", { value: notifLogsType, onChange: (e)=>setNotifLogsType(e.target.value), className: "border border-gray-300 rounded-lg px-3 py-1.5 text-sm min-w-[200px]", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "", children: t('admin.filter.all') }), notifLogsTypes.map((tp)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: tp, children: tp }, tp)) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs font-medium text-gray-500 mb-1", children: t('admin.activity.from') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "date", value: notifLogsDateFrom, onChange: (e)=>setNotifLogsDateFrom(e.target.value), className: "border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs font-medium text-gray-500 mb-1", children: t('admin.activity.to') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "date", value: notifLogsDateTo, onChange: (e)=>setNotifLogsDateTo(e.target.value), className: "border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), (notifLogsType || notifLogsDateFrom || notifLogsDateTo) && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { onClick: ()=>{ setNotifLogsType(''); setNotifLogsDateFrom(''); setNotifLogsDateTo(''); }, 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: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-3 h-3", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: "18", y1: "6", x2: "6", y2: "18" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: "6", y1: "6", x2: "18", y2: "18" }) ] }), t('admin.activity.reset') ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { className: "text-xs text-gray-400 self-end ml-auto", children: [ t('admin.pagination.total'), ": ", notifLogsTotal ] }) ] }), notifLogs.length === 0 ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-center py-10 text-gray-400", children: t('admin.notif_logs.empty') }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "overflow-x-auto rounded-xl border border-gray-200", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("table", { className: "w-full text-sm", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("thead", { className: "bg-gray-50 text-gray-500 text-xs uppercase", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("tr", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 text-left", children: t('admin.logs.date') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 text-left", children: t('admin.col.user') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 text-left", children: t('admin.notif_logs.type') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 text-left", children: t('admin.notif_logs.title') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 text-center", children: t('admin.notif_logs.read') }) ] }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("tbody", { className: "divide-y divide-gray-100", children: notifLogs.map((n)=>{ var _n_recipientName, _ref; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("tr", { className: "bg-white hover:bg-gray-50", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3 text-gray-500 whitespace-nowrap", children: new Date(n.createdAt).toLocaleString(dateLocale) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3 text-gray-700", children: (_ref = (_n_recipientName = n.recipientName) !== null && _n_recipientName !== void 0 ? _n_recipientName : n.recipientEmail) !== null && _ref !== void 0 ? _ref : n.recipientId }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "px-2 py-0.5 rounded-full text-xs font-medium bg-green-50 text-green-700", children: n.type }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3 text-gray-600 max-w-xs truncate", children: n.title }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3 text-center", children: n.isRead ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-green-600 flex justify-center", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("polyline", { points: "20 6 9 17 4 12" }) }) }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-gray-400 flex justify-center", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("circle", { cx: "12", cy: "12", r: "10" }) }) }) }) ] }, n.id); }) }) ] }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Pagination, { page: notifLogsPage, total: notifLogsTotal, limit: 50, onChange: setNotifLogsPage, totalLabel: t('admin.pagination.total') }) ] }) ] }), tab === 'plans' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-between mb-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("h2", { className: "text-lg font-semibold text-gray-800 flex items-center gap-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-5 h-5 text-green-600", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("rect", { x: "1", y: "4", width: "22", height: "16", rx: "2", ry: "2" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: "1", y1: "10", x2: "23", y2: "10" }) ] }), t('admin.plans.title') ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: openAddPlan, className: "bg-green-600 text-white text-sm px-4 py-2 rounded-lg hover:bg-green-700 font-medium", children: t('admin.plans.add') }) ] }), planForm && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white border border-gray-200 rounded-xl p-5 mb-4 space-y-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h3", { className: "font-semibold text-gray-800", children: planForm.id ? t('admin.plans.form.edit') : t('admin.plans.form.new') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "grid grid-cols-2 gap-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.name') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: planForm.name, onChange: (e)=>setPlanForm({ ...planForm, name: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.price') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "number", min: "0", step: "0.01", value: planForm.price, onChange: (e)=>setPlanForm({ ...planForm, price: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.old_price') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "number", min: "0", step: "0.01", value: (_planForm_oldPrice = planForm.oldPrice) !== null && _planForm_oldPrice !== void 0 ? _planForm_oldPrice : '', onChange: (e)=>setPlanForm({ ...planForm, oldPrice: e.target.value }), placeholder: "—", className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.tier') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("select", { value: planForm.tier, onChange: (e)=>setPlanForm({ ...planForm, tier: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "free", children: t('admin.plans.form.tier.free') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "pro", children: t('admin.plans.form.tier.pro') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "ultimate", children: t('admin.plans.form.tier.ultimate') }) ] }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.description') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: planForm.description, onChange: (e)=>setPlanForm({ ...planForm, description: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs font-semibold text-gray-500 uppercase tracking-wide pt-1", children: t('admin.plans.form.section.limits') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "grid grid-cols-3 gap-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.max_tasks') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "number", min: "0", placeholder: "∞", value: planForm.maxTasks, onChange: (e)=>setPlanForm({ ...planForm, maxTasks: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.max_offers') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "number", min: "0", placeholder: "∞", value: planForm.maxOffers, onChange: (e)=>setPlanForm({ ...planForm, maxOffers: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.max_cards') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "number", min: "0", placeholder: "∞", value: planForm.maxCards, onChange: (e)=>setPlanForm({ ...planForm, maxCards: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.max_messages_day') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "number", min: "0", placeholder: "∞", value: planForm.maxMessagesPerDay, onChange: (e)=>setPlanForm({ ...planForm, maxMessagesPerDay: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.max_orders_day') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "number", min: "0", placeholder: "∞", value: planForm.maxOrdersPerDay, onChange: (e)=>setPlanForm({ ...planForm, maxOrdersPerDay: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.max_skills') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "number", min: "0", placeholder: "∞", value: planForm.maxSkills, onChange: (e)=>setPlanForm({ ...planForm, maxSkills: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.duration_days') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "number", min: "0", placeholder: "∞", value: planForm.durationDays, onChange: (e)=>setPlanForm({ ...planForm, durationDays: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs font-semibold text-gray-500 uppercase tracking-wide pt-1", children: t('admin.plans.form.section.boost') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "grid grid-cols-2 gap-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.search_boost') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "number", min: "0", value: planForm.searchBoost, onChange: (e)=>setPlanForm({ ...planForm, searchBoost: Number(e.target.value) }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.offers_multiplier') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "number", min: "0", step: "0.01", value: planForm.offersMultiplier, onChange: (e)=>setPlanForm({ ...planForm, offersMultiplier: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.features') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("textarea", { rows: 3, value: planForm.features, onChange: (e)=>setPlanForm({ ...planForm, features: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 resize-none" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs font-semibold text-gray-500 uppercase tracking-wide pt-1", children: t('admin.plans.form.section.contact') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "grid grid-cols-2 gap-2", children: [ [ 'canContactFreePlan', t('admin.plans.form.can_contact_free') ], [ 'canContactProPlan', t('admin.plans.form.can_contact_pro') ], [ 'canContactAll', t('admin.plans.form.can_contact_all') ], [ 'canShowContactInfo', t('admin.plans.form.can_show_contact') ], [ 'canViewPhone', t('admin.plans.form.can_view_phone') ] ].map((param)=>{ let [key, label] = param; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "flex items-center gap-2 cursor-pointer text-sm text-gray-700", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "checkbox", checked: planForm[key], onChange: (e)=>setPlanForm({ ...planForm, [key]: e.target.checked }), className: "w-4 h-4 rounded text-green-600" }), label ] }, key); }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs font-semibold text-gray-500 uppercase tracking-wide pt-1", children: t('admin.plans.form.section.features') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "grid grid-cols-2 gap-2", children: [ [ 'notifyNewTasks', t('admin.plans.form.notify') ], [ 'canUploadVideo', t('admin.plans.form.upload_video') ], [ 'hasFavorites', t('admin.plans.form.favorites') ], [ 'hasGoogleCalendar', t('admin.plans.form.google_calendar') ], [ 'hasVerifiedBadge', t('admin.plans.form.verified_badge') ], [ 'highlightedReviews', t('admin.plans.form.highlighted_reviews') ], [ 'hasPersonalSite', t('admin.plans.form.personal_site') ], [ 'hasCanHelpNowStatus', t('admin.plans.form.can_help_now') ], [ 'hasNeedHelpStatus', t('admin.plans.form.need_help') ], [ 'hasAutoResponse', t('admin.plans.form.auto_response') ], [ 'hasAutoMatch', t('admin.plans.form.auto_match') ], [ 'hasPriceList', t('admin.plans.form.price_list') ], [ 'receiveInstantDispatchFree', t('admin.plans.form.instant_dispatch_free') ], [ 'receiveInstantDispatchPro', t('admin.plans.form.instant_dispatch_pro') ] ].map((param)=>{ let [key, label] = param; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "flex items-center gap-2 cursor-pointer text-sm text-gray-700", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "checkbox", checked: planForm[key], onChange: (e)=>setPlanForm({ ...planForm, [key]: e.target.checked }), className: "w-4 h-4 rounded text-green-600" }), label ] }, key); }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-6 pt-1", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "flex items-center gap-2 cursor-pointer text-sm text-gray-700", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "checkbox", checked: planForm.isDefault, onChange: (e)=>setPlanForm({ ...planForm, isDefault: e.target.checked }), className: "w-4 h-4 rounded text-green-600" }), t('admin.plans.form.default') ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "flex items-center gap-2 cursor-pointer text-sm text-gray-700", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "checkbox", checked: planForm.isActive, onChange: (e)=>setPlanForm({ ...planForm, isActive: e.target.checked }), className: "w-4 h-4 rounded text-green-600" }), t('admin.plans.form.active') ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "text-xs text-gray-600", children: t('admin.plans.form.order') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "number", value: planForm.order, onChange: (e)=>setPlanForm({ ...planForm, order: Number(e.target.value) }), className: "w-16 border border-gray-300 rounded-lg px-2 py-1 text-sm focus:outline-none" }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-2 pt-1", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: savePlan, disabled: planSaving || !planForm.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: planSaving ? '...' : t('common.save') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>setPlanForm(null), className: "px-4 py-2 rounded-lg text-sm font-medium text-gray-600 hover:bg-gray-100", children: t('common.cancel') }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "bg-white rounded-xl border border-gray-200 overflow-hidden", children: planRows.length === 0 ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "px-4 py-8 text-center text-gray-400 text-sm", children: t('admin.plans.empty') }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "divide-y divide-gray-100", children: planRows.sort((a, b)=>{ var _a_order, _b_order; return ((_a_order = a.order) !== null && _a_order !== void 0 ? _a_order : 0) - ((_b_order = b.order) !== null && _b_order !== void 0 ? _b_order : 0); }).map((plan)=>{ var _plan_features; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-start gap-4 px-4 py-4 ".concat(!plan.isActive ? 'opacity-50' : ''), children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-2 flex-wrap", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "font-semibold text-gray-900", children: plan.name }), plan.isDefault && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "bg-green-100 text-green-700 text-xs px-2 py-0.5 rounded-full font-medium", children: t('admin.plans.badge.default') }), !plan.isActive && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "bg-gray-100 text-gray-500 text-xs px-2 py-0.5 rounded-full", children: t('admin.plans.badge.inactive') }) ] }), plan.description && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-gray-500 mt-0.5", children: plan.description }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex flex-wrap gap-3 mt-1 text-xs text-gray-500", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "flex items-center gap-1.5 font-semibold text-gray-800", children: [ plan.oldPrice && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "font-normal text-gray-400 line-through", children: [ plan.oldPrice, " ", plan.currency ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { children: [ plan.price, " ", plan.currency ] }) ] }), plan.maxTasks != null && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { children: [ t('admin.plans.tasks'), ": ", plan.maxTasks ] }), plan.maxOffers != null && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { children: [ t('admin.plans.offers'), ": ", plan.maxOffers ] }), plan.maxCards != null && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { children: [ t('admin.plans.cards'), ": ", plan.maxCards ] }), plan.notifyNewTasks && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "text-green-700 flex items-center gap-1", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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" }) }), t('admin.plans.notify_tasks') ] }) ] }), ((_plan_features = plan.features) !== null && _plan_features !== void 0 ? _plan_features : []).length > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("ul", { className: "mt-1.5 space-y-0.5", children: plan.features.map((f, i)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("li", { className: "text-xs text-gray-600 flex items-center gap-1.5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-green-500", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3 h-3", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("polyline", { points: "20 6 9 17 4 12" }) }) }), " ", f ] }, i)) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-1 shrink-0", children: [ !plan.isDefault && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updatePlan */ .td(plan.id, { isDefault: true }).then(()=>_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminPlans */ .OX().then(setPlanRows)).catch(()=>{}), className: "text-xs px-2 py-1 rounded-lg bg-green-50 text-green-600 hover:bg-green-100 font-medium", title: t('admin.plans.make_default'), children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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" }) }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>openEditPlan(plan), className: "text-xs px-2 py-1 rounded-lg bg-gray-100 text-gray-600 hover:bg-gray-200 font-medium", children: t('common.edit') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>deletePlan(plan.id, plan.name), className: "text-xs px-2 py-1 rounded-lg bg-red-50 text-red-600 hover:bg-red-100 font-medium", children: t('common.delete') }) ] }) ] }, plan.id); }) }) }) ] }), tab === 'settings' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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((st)=>{ const labels = { general: t('admin.settings.tab.general'), smtp: t('admin.settings.tab.smtp'), notifications: t('admin.settings.tab.notifications'), payment: t('admin.settings.tab.payment'), referral: t('admin.settings.tab.referral'), seo: t('admin.settings.tab.seo'), socials: t('admin.settings.tab.socials'), telegram: t('admin.settings.tab.telegram') }; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>setSettingsTab(st), className: "px-4 py-2 rounded-lg text-sm font-medium transition ".concat(settingsTab === st ? 'bg-green-600 text-white shadow-sm' : 'text-gray-600 hover:bg-gray-100'), children: labels[st] }, st); }) }), settingsTab === 'general' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-6 max-w-lg", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h3", { className: "font-semibold text-gray-800 mb-5", children: t('admin.settings.general.title') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.general.site_name') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: generalForm.siteName, onChange: (e)=>setGeneralForm((f)=>({ ...f, siteName: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400", placeholder: "CanHelp" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.general.site_url') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: generalForm.siteUrl, onChange: (e)=>setGeneralForm((f)=>({ ...f, siteUrl: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400", placeholder: "https://canhelp.com" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.general.contact_email') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "email", value: generalForm.contactEmail, onChange: (e)=>setGeneralForm((f)=>({ ...f, contactEmail: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400", placeholder: "contact@canhelp.com" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.general.support_phone') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: generalForm.supportPhone, onChange: (e)=>setGeneralForm((f)=>({ ...f, supportPhone: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400", placeholder: "+30 21 000 0000" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: saveGeneralSettings, disabled: generalSaving, 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: generalSaving ? t('admin.settings.saving') : generalSaved ? t('admin.settings.saved') : t('common.save') }) ] }) ] }), settingsTab === 'smtp' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-6 max-w-lg", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h3", { className: "font-semibold text-gray-800 mb-1", children: t('admin.settings.smtp.title') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-gray-400 mb-5", children: t('admin.settings.smtp.hint') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "grid grid-cols-3 gap-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "col-span-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.smtp.host') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: smtpForm.host, onChange: (e)=>setSmtpForm((f)=>({ ...f, host: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400", placeholder: "smtp.gmail.com" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.smtp.port') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: smtpForm.port, onChange: (e)=>setSmtpForm((f)=>({ ...f, port: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400", placeholder: "587" }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.smtp.encryption') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("select", { value: smtpForm.encryption, onChange: (e)=>setSmtpForm((f)=>({ ...f, encryption: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "none", children: t('admin.settings.smtp.enc.none') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "tls", children: "STARTTLS (587)" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "ssl", children: "SSL/TLS (465)" }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.smtp.username') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: smtpForm.username, onChange: (e)=>setSmtpForm((f)=>({ ...f, username: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400", placeholder: "user@gmail.com", autoComplete: "off" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.smtp.password') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "password", value: smtpForm.password, onChange: (e)=>setSmtpForm((f)=>({ ...f, password: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400", autoComplete: "new-password", placeholder: "••••••••••••" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "grid grid-cols-2 gap-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.smtp.from_name') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: smtpForm.fromName, onChange: (e)=>setSmtpForm((f)=>({ ...f, fromName: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400", placeholder: "CanHelp" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.smtp.from_email') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "email", value: smtpForm.fromEmail, onChange: (e)=>setSmtpForm((f)=>({ ...f, fromEmail: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400", placeholder: "noreply@canhelp.com" }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: saveSmtpSettings, disabled: smtpSaving, 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: smtpSaving ? t('admin.settings.saving') : smtpSaved ? t('admin.settings.saved') : t('common.save') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: async ()=>{ setTestEmailSending(true); setTestEmailResult(null); try { const res = await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .sendTestEmail */ .FI(); setTestEmailResult("✓ Sent to ".concat(res.to)); } catch (e) { setTestEmailResult("✗ Error: ".concat(e.message)); } finally{ setTestEmailSending(false); setTimeout(()=>setTestEmailResult(null), 5000); } }, disabled: testEmailSending, 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: testEmailSending ? t('admin.settings.smtp.sending') : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "flex items-center justify-center gap-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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" }) }), t('admin.settings.smtp.test') ] }) }), testEmailResult && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-center font-medium ".concat(testEmailResult.startsWith('✓') ? 'text-green-600' : 'text-red-500'), children: testEmailResult }) ] }) ] }), settingsTab === 'payment' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-6 max-w-lg", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-between mb-5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h3", { className: "font-semibold text-gray-800", children: "ePay — Piraeus Bank" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400", children: "ГреческОй платёжМый шлюз" }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "flex items-center gap-2 cursor-pointer", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-sm text-gray-500", children: t('admin.settings.active') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>setEPayForm((f)=>({ ...f, enabled: !f.enabled })), className: "relative w-10 h-6 rounded-full p-0 transition-colors cursor-pointer ".concat(ePayForm.enabled ? 'bg-green-600' : 'bg-gray-300'), children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "absolute left-0 top-1 w-4 h-4 bg-white rounded-full shadow transition-transform ".concat(ePayForm.enabled ? 'translate-x-5' : 'translate-x-1') }) }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.env.label') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("select", { value: ePayForm.environment, onChange: (e)=>setEPayForm((f)=>({ ...f, environment: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "test", children: t('admin.settings.env.test') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "production", children: t('admin.settings.env.prod') }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.merchant_id') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: ePayForm.merchantId, onChange: (e)=>setEPayForm((f)=>({ ...f, merchantId: e.target.value })), placeholder: t('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" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "grid grid-cols-2 gap-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: "API User" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: ePayForm.apiUser, onChange: (e)=>setEPayForm((f)=>({ ...f, apiUser: e.target.value })), autoComplete: "off", className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: "API Password" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "password", value: ePayForm.apiPassword, onChange: (e)=>setEPayForm((f)=>({ ...f, apiPassword: e.target.value })), autoComplete: "new-password", className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: "Confirmation URL (webhook)" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: ePayForm.confirmationUrl, onChange: (e)=>setEPayForm((f)=>({ ...f, confirmationUrl: e.target.value })), placeholder: "https://yoursite.com/api/payments/epay/confirm", className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: "Cancel URL" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: ePayForm.cancelUrl, onChange: (e)=>setEPayForm((f)=>({ ...f, cancelUrl: e.target.value })), placeholder: "https://yoursite.com/payment/cancelled", className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-3 mt-5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: saveEPaySettings, disabled: ePaySaving, className: "px-5 py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700 disabled:opacity-50", children: ePaySaving ? t('admin.settings.saving') : t('common.save') }), ePaySaved && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-sm text-green-600", children: t('admin.settings.saved') }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-4 h-4 shrink-0 mt-0.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("circle", { cx: "12", cy: "12", r: "10" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: "12", y1: "8", x2: "12", y2: "12" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: "12", y1: "16", x2: "12.01", y2: "16" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { children: t('admin.settings.payment.hint') }) ] }) ] }), settingsTab === 'notifications' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-3 max-w-2xl", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-4 h-4 shrink-0 mt-0.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("circle", { cx: "12", cy: "12", r: "10" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: "12", y1: "8", x2: "12", y2: "12" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: "12", y1: "16", x2: "12.01", y2: "16" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { children: [ t('admin.notif.vars_hint'), ' ', TEMPLATE_HINT_VARS.map((name)=>{ const v = "{{".concat(name, "}}"); return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("code", { className: "mx-0.5 bg-green-100 text-gray-800 px-1.5 py-0.5 rounded text-xs font-mono", children: v }, v); }) ] }) ] }), [ { key: 'email_verification', label: t('admin.notif.email_verification'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: t('admin.notif.registration_success'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: t('admin.notif.password_reset'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: t('admin.notif.new_offer'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: t('admin.notif.new_task'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: t('admin.notif.offer_accepted'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" }) }) }, { key: 'new_message', label: t('admin.notif.new_message'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: t('admin.notif.offer_declined'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: t('admin.notif.offer_other_accepted'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: t('admin.notif.task_updated'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: t('admin.notif.deadline_reminder'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: t('admin.notif.task_archived'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: t('admin.notif.referral_reward'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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" }) }) }, // ── Plan / subscription emails ───────────────────────────── { key: 'plan_activated', label: t('admin.email_template.plan_activated'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: t('admin.email_template.plan_upgraded'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 10l7-7m0 0l7 7m-7-7v18" }) }) }, { key: 'plan_downgrade_scheduled', label: t('admin.email_template.plan_downgrade_scheduled'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: t('admin.email_template.plan_downgrade_applied'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19 14l-7 7m0 0l-7-7m7 7V3" }) }) }, { key: 'plan_renewal_reminder', label: t('admin.email_template.plan_renewal_reminder'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: t('admin.email_template.plan_insufficient_funds'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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((param)=>{ let { key, label, icon } = param; const localeKey = "".concat(key, "_").concat(templateLocale); var _notifTemplates_localeKey, _ref; const tmpl = (_ref = (_notifTemplates_localeKey = notifTemplates[localeKey]) !== null && _notifTemplates_localeKey !== void 0 ? _notifTemplates_localeKey : notifTemplates[key]) !== null && _ref !== void 0 ? _ref : { subject: '', body: '' }; const isEditing = editingTemplate === key; var _TEMPLATE_VARS_key; const templateVars = (_TEMPLATE_VARS_key = TEMPLATE_VARS[key]) !== null && _TEMPLATE_VARS_key !== void 0 ? _TEMPLATE_VARS_key : []; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 overflow-hidden", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-3 px-5 py-4 cursor-pointer hover:bg-gray-50 select-none", onClick: ()=>setEditingTemplate(isEditing ? null : key), children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-xl shrink-0", children: icon }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "font-medium text-gray-800 text-sm", children: label }), tmpl.subject ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "text-xs text-gray-400 mt-0.5 truncate", children: [ t('admin.notif.tmpl.subject_label'), ": ", tmpl.subject ] }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-xs text-gray-300 mt-0.5 italic", children: t('admin.notif.tmpl.not_set') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-gray-400 transition-transform ".concat(isEditing ? 'rotate-90' : ''), children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("polyline", { points: "9 18 15 12 9 6" }) }) }) ] }), isEditing && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "px-5 pb-5 border-t border-gray-100 pt-4 space-y-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex gap-1 pb-2", children: [ 'el', 'en', 'uk', 'ru' ].map((loc)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>setTemplateLocale(loc), className: "px-3 py-1 text-xs font-medium rounded-md transition-colors ".concat(templateLocale === loc ? 'bg-green-600 text-white' : 'bg-gray-100 text-gray-600 hover:bg-gray-200'), children: loc === 'el' ? 'ΕλληΜικά' : loc === 'en' ? 'English' : loc === 'uk' ? 'УкраїМська' : 'РусскОй' }, loc)) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.notif.tmpl.subject_label') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: tmpl.subject, onChange: (e)=>setNotifTemplates((prev)=>{ var _prev_localeKey; return { ...prev, [localeKey]: { ...(_prev_localeKey = prev[localeKey]) !== null && _prev_localeKey !== void 0 ? _prev_localeKey : { subject: '', body: '' }, subject: e.target.value } }; }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.notif.tmpl.body_label') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("textarea", { rows: 7, value: tmpl.body, onChange: (e)=>setNotifTemplates((prev)=>{ var _prev_localeKey; return { ...prev, [localeKey]: { ...(_prev_localeKey = prev[localeKey]) !== null && _prev_localeKey !== void 0 ? _prev_localeKey : { subject: '', body: '' }, body: e.target.value } }; }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 font-mono resize-y", placeholder: "

УважаеЌый {{userName}},

..." }) ] }), templateVars.length > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "rounded-lg border border-amber-200 bg-amber-50 px-3 py-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-xs font-medium text-amber-800 mb-1", children: t('admin.notif.vars_hint') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex flex-wrap gap-1.5", children: templateVars.map((name)=>{ const variable = "{{".concat(name, "}}"); return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("code", { className: "bg-amber-100 text-amber-900 px-1.5 py-0.5 rounded text-xs font-mono", children: variable }, variable); }) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-2 flex-wrap", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>saveTemplate(key), disabled: templateSaving || templateTranslating, className: "px-4 py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700 disabled:opacity-50", children: templateSaving ? t('admin.notif.tmpl.saving') : t('admin.notif.tmpl.save') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { onClick: ()=>autoTranslateTemplate(key), disabled: templateSaving || templateTranslating, 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: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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" }) }), templateTranslating ? t('admin.notif.tmpl.translating') : t('admin.notif.tmpl.translate') ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>setEditingTemplate(null), className: "px-4 py-2 bg-gray-100 text-gray-700 rounded-lg text-sm font-medium hover:bg-gray-200", children: t('admin.notif.tmpl.close') }) ] }) ] }) ] }, key); }) ] }), settingsTab === 'referral' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-6 max-w-lg space-y-5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h3", { className: "font-semibold text-gray-800", children: t('admin.settings.referral.title') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-gray-400 mt-1", children: t('admin.settings.referral.hint') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-between", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm font-medium text-gray-700", children: t('admin.settings.referral.enabled_label') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400", children: t('admin.settings.referral.enabled_hint') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>setReferralForm((f)=>({ ...f, enabled: !f.enabled })), className: "relative w-10 h-6 rounded-full p-0 transition-colors cursor-pointer ".concat(referralForm.enabled ? 'bg-green-600' : 'bg-gray-300'), children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "absolute left-0 top-1 w-4 h-4 bg-white rounded-full shadow transition-transform ".concat(referralForm.enabled ? 'translate-x-5' : 'translate-x-1') }) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "border border-gray-100 rounded-lg p-4 space-y-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs font-semibold text-gray-500 uppercase tracking-wide", children: t('admin.settings.referral.shared_section') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.referral.plan_label') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("select", { value: referralForm.planId, onChange: (e)=>setReferralForm((f)=>({ ...f, planId: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "", children: t('admin.settings.referral.no_plan') }), planRows.map((p)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: p.id, children: p.name }, p.id)) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400 mt-1", children: t('admin.settings.referral.plan_hint') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.referral.days_label') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "number", min: "1", max: "365", value: referralForm.days, onChange: (e)=>setReferralForm((f)=>({ ...f, days: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400 mt-1", children: t('admin.settings.referral.days_hint') }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: saveReferralSettings, disabled: referralSaving, className: "px-5 py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700 disabled:opacity-50", children: referralSaving ? t('admin.settings.saving') : t('common.save') }), referralSaved && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-sm text-green-600", children: t('admin.settings.saved') }) ] }) ] }), settingsTab === 'socials' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-6 max-w-lg space-y-5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h3", { className: "font-semibold text-gray-800 mb-1", children: t('admin.settings.socials.title') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400", children: t('admin.settings.socials.hint') }) ] }), [ { key: 'telegram', label: 'Telegram', placeholder: 'https://t.me/yourname', icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4", viewBox: "0 0 24 24", fill: "currentColor", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4", viewBox: "0 0 24 24", fill: "currentColor", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4", viewBox: "0 0 24 24", fill: "currentColor", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4", viewBox: "0 0 24 24", fill: "currentColor", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4", viewBox: "0 0 24 24", fill: "currentColor", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4", viewBox: "0 0 24 24", fill: "currentColor", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4", viewBox: "0 0 24 24", fill: "currentColor", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4", viewBox: "0 0 24 24", fill: "currentColor", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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((param)=>{ let { key, label, placeholder, icon } = param; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "block text-sm font-medium text-gray-700 mb-1 flex items-center gap-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "".concat(socialForm[key] ? 'text-green-600' : 'text-gray-300'), children: icon }), label, !socialForm[key] && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-xs font-normal text-gray-400 ml-auto", children: "Ме запПлМеМП" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "url", value: socialForm[key], onChange: (e)=>setSocialForm((f)=>({ ...f, [key]: e.target.value })), placeholder: placeholder, className: "w-full border rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 ".concat(socialForm[key] ? 'border-green-300 bg-green-50/30' : 'border-gray-300') }) ] }, key); }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-3 pt-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: saveSocialSettings, disabled: socialSaving, className: "px-5 py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700 disabled:opacity-50", children: socialSaving ? t('admin.settings.saving') : t('common.save') }), socialSaved && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-sm text-green-600", children: t('admin.settings.saved') }) ] }) ] }), settingsTab === 'seo' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-6 max-w-lg space-y-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h3", { className: "font-semibold text-gray-800", children: t('admin.settings.seo.title') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-between", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm font-medium text-gray-700", children: t('admin.settings.seo.maintenance_label') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400 mt-0.5", children: t('admin.settings.seo.maintenance_hint') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>setSeoForm((f)=>({ ...f, maintenanceMode: !f.maintenanceMode })), className: "relative w-10 h-6 rounded-full p-0 transition-colors cursor-pointer flex-shrink-0 ".concat(seoForm.maintenanceMode ? 'bg-red-500' : 'bg-gray-300'), children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "absolute left-0 top-1 w-4 h-4 bg-white rounded-full shadow transition-transform ".concat(seoForm.maintenanceMode ? 'translate-x-5' : 'translate-x-1') }) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-between", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm font-medium text-gray-700", children: t('admin.settings.seo.indexing_label') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400 mt-0.5", children: t('admin.settings.seo.indexing_hint') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>setSeoForm((f)=>({ ...f, indexingEnabled: !f.indexingEnabled })), className: "relative w-10 h-6 rounded-full p-0 transition-colors cursor-pointer flex-shrink-0 ".concat(seoForm.indexingEnabled ? 'bg-green-600' : 'bg-gray-300'), children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "absolute left-0 top-1 w-4 h-4 bg-white rounded-full shadow transition-transform ".concat(seoForm.indexingEnabled ? 'translate-x-5' : 'translate-x-1') }) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "space-y-4", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { className: "text-sm font-medium text-gray-700 mb-2", children: [ t('admin.settings.seo.site_title_label'), " / ", t('admin.settings.seo.site_description_label') ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex gap-1 mb-3", children: [ { code: 'el', flag: '🇬🇷', label: 'EL' }, { code: 'en', flag: '🇬🇧', label: 'EN' }, { code: 'ru', flag: '🇷🇺', label: 'RU' }, { code: 'uk', flag: '🇺🇊', label: 'UK' } ].map((param)=>{ let { code, flag, label } = param; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { type: "button", onClick: ()=>setSeoLangTab(code), className: "flex items-center gap-1 px-3 py-1.5 rounded-lg text-sm font-medium transition-colors ".concat(seoLangTab === code ? 'bg-green-600 text-white' : 'bg-gray-100 text-gray-600 hover:bg-gray-200'), children: [ flag, " ", label ] }, code); }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs font-medium text-gray-500 mb-1", children: t('admin.settings.seo.site_title_label') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: seoForm["siteTitle".concat(seoLangTab.charAt(0).toUpperCase() + seoLangTab.slice(1))], onChange: (e)=>setSeoForm((f)=>({ ...f, ["siteTitle".concat(seoLangTab.charAt(0).toUpperCase() + seoLangTab.slice(1))]: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 mb-3", placeholder: seoLangTab === 'el' ? 'CanHelp — ΚάΞε άΜΞρωπος έχει κάτι Μα προσφέρει' : seoLangTab === 'en' ? 'CanHelp — Everyone has something valuable to offer' : seoLangTab === 'ru' ? 'CanHelp — КажЎый челПвек ЌПжет чеЌ-тП пПЌПчь' : 'CanHelp — КПжеМ Ќає МавОчку, яка ЌПже ЎПпПЌПгтО іМшПЌу' }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs font-medium text-gray-500 mb-1", children: t('admin.settings.seo.site_description_label') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("textarea", { rows: 3, value: seoForm["siteDescription".concat(seoLangTab.charAt(0).toUpperCase() + seoLangTab.slice(1))], onChange: (e)=>setSeoForm((f)=>({ ...f, ["siteDescription".concat(seoLangTab.charAt(0).toUpperCase() + seoLangTab.slice(1))]: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 resize-none", placeholder: seoLangTab === 'el' ? 'Η ελληΜική πλατφόρΌα για online αΜάΞεση εργασιώΜ...' : seoLangTab === 'en' ? 'The Greek platform for online task delegation...' : seoLangTab === 'ru' ? 'Греческая платфПрЌа Ўля ПМлайМ-пПОска спецОалОстПв...' : 'Грецька платфПрЌа Ўля пПшуку фахівців ПМлайМ...' }) ] }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.seo.head_scripts_label') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400 mb-2", children: t('admin.settings.seo.head_scripts_hint') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("textarea", { rows: 6, value: seoForm.headScripts, onChange: (e)=>setSeoForm((f)=>({ ...f, headScripts: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm font-mono focus:outline-none focus:ring-2 focus:ring-blue-400 resize-y", placeholder: '\n', spellCheck: false }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: saveSeoSettings, disabled: seoSaving, className: "px-5 py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700 disabled:opacity-50", children: seoSaving ? t('admin.settings.saving') : t('common.save') }), seoSaved && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-sm text-green-600", children: t('admin.settings.saved') }) ] }) ] }), settingsTab === 'telegram' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-6 max-w-lg space-y-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h3", { className: "font-semibold text-gray-800 mb-1", children: t('admin.settings.telegram.title') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400", children: t('admin.settings.telegram.help') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.telegram.bot_token') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "text", value: telegramForm.botToken, onChange: (e)=>{ setTelegramForm((f)=>({ ...f, botToken: e.target.value })); setVerifyResultTelegramToken(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" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: verifyTelegramToken, disabled: verifyingTelegramToken || !telegramForm.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: verifyingTelegramToken ? '...' : t('admin.settings.telegram.verify') }) ] }), verifyResultTelegramToken && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs mt-1 font-medium ".concat(verifyResultTelegramToken.ok ? 'text-green-600' : 'text-red-500'), children: verifyResultTelegramToken.ok ? "✓ ".concat(verifyResultTelegramToken.msg) : "✗ ".concat(verifyResultTelegramToken.msg) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.telegram.admin_chat_id') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "text", value: telegramForm.adminChatId, onChange: (e)=>setTelegramForm((f)=>({ ...f, adminChatId: e.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" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>testTelegram('admin'), disabled: testingTelegramAdmin || !telegramForm.botToken || !telegramForm.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: testingTelegramAdmin ? '...' : t('admin.settings.telegram.test') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400 mt-1", children: t('admin.settings.telegram.admin_chat_hint') }), testResultTelegramAdmin && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs mt-1 font-medium ".concat(testResultTelegramAdmin.ok ? 'text-green-600' : 'text-red-500'), children: testResultTelegramAdmin.ok ? "✓ ".concat(testResultTelegramAdmin.msg) : "✗ ".concat(testResultTelegramAdmin.msg) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700", children: t('admin.settings.telegram.channels_title') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400 -mt-2", children: t('admin.settings.telegram.channel_hint') }), [ { locale: 'el', flag: '🇬🇷', label: 'ΕλληΜικά', field: 'channelIdEl' }, { locale: 'en', flag: '🇬🇧', label: 'English', field: 'channelIdEn' }, { locale: 'ru', flag: '🇷🇺', label: 'РусскОй', field: 'channelIdRu' }, { locale: 'uk', flag: '🇺🇊', label: 'УкраїМська', field: 'channelIdUk' } ].map((param)=>{ let { locale: loc, flag, label, field } = param; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-1.5 mb-1", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-base leading-none", children: flag }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-xs font-medium text-gray-600", children: label }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "text", value: telegramForm[field], onChange: (e)=>setTelegramForm((f)=>({ ...f, [field]: e.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" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>testTelegram(loc), disabled: testingLocale === loc || !telegramForm.botToken || !telegramForm[field], className: "px-3 py-2 border border-gray-300 rounded-lg text-sm hover:bg-gray-50 disabled:opacity-40 flex-shrink-0", children: testingLocale === loc ? '...' : t('admin.settings.telegram.test') }) ] }), testResultChannels[loc] && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs mt-1 font-medium ".concat(testResultChannels[loc].ok ? 'text-green-600' : 'text-red-500'), children: testResultChannels[loc].ok ? "✓ ".concat(testResultChannels[loc].msg) : "✗ ".concat(testResultChannels[loc].msg) }) ] }, loc); }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-between", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm font-medium text-gray-700", children: t('admin.settings.telegram.notify_registrations') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400 mt-0.5", children: t('admin.settings.telegram.notify_registrations_hint') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>setTelegramForm((f)=>({ ...f, notifyRegistrations: !f.notifyRegistrations })), className: "relative w-10 h-6 rounded-full transition-colors cursor-pointer flex-shrink-0 p-0 border-0 outline-none ".concat(telegramForm.notifyRegistrations ? 'bg-green-600' : 'bg-gray-300'), children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "absolute top-1 left-0 w-4 h-4 bg-white rounded-full shadow transition-transform ".concat(telegramForm.notifyRegistrations ? 'translate-x-5' : 'translate-x-1') }) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-between", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm font-medium text-gray-700", children: t('admin.settings.telegram.post_new_tasks') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400 mt-0.5", children: t('admin.settings.telegram.post_new_tasks_hint') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>setTelegramForm((f)=>({ ...f, postNewTasks: !f.postNewTasks })), className: "relative w-10 h-6 rounded-full transition-colors cursor-pointer flex-shrink-0 p-0 border-0 outline-none ".concat(telegramForm.postNewTasks ? 'bg-green-600' : 'bg-gray-300'), children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "absolute top-1 left-0 w-4 h-4 bg-white rounded-full shadow transition-transform ".concat(telegramForm.postNewTasks ? 'translate-x-5' : 'translate-x-1') }) }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-3 pt-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: saveTelegramSettings, disabled: telegramSaving, className: "px-5 py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700 disabled:opacity-50", children: telegramSaving ? t('admin.settings.saving') : t('common.save') }), telegramSaved && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-sm text-green-600", children: t('admin.settings.saved') }) ] }) ] }) ] }), tab === 'support' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex flex-wrap gap-3 mb-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("form", { className: "flex gap-2", onSubmit: (e)=>{ e.preventDefault(); setSupportQ(supportQInput); setSupportPage(1); }, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: supportQInput, onChange: (e)=>setSupportQInput(e.target.value), placeholder: t('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" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: t('admin.search', 'Search') }), supportQ && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>{ setSupportQInput(''); setSupportQ(''); setSupportPage(1); }, className: "text-sm text-gray-500 hover:text-gray-700 px-2", children: "✕" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("select", { value: supportStatus, onChange: (e)=>{ setSupportStatus(e.target.value); setSupportPage(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: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "", children: t('admin.support.all_statuses', 'All statuses') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "open", children: t('admin.support.status.open', 'Open') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "in_progress", children: t('admin.support.status.in_progress', 'In progress') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "resolved", children: t('admin.support.status.resolved', 'Resolved') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "closed", children: t('admin.support.status.closed', 'Closed') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("select", { value: supportType, onChange: (e)=>{ setSupportType(e.target.value); setSupportPage(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: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "", children: t('admin.support.all_types', 'All types') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("option", { value: "bug", children: [ "\uD83D\uDC1B ", t('support.type.bug', 'Bug') ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("option", { value: "suggestion", children: [ "\uD83D\uDCA1 ", t('support.type.suggestion', 'Suggestion') ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("option", { value: "other", children: [ "\uD83D\uDCAC ", t('support.type.other', 'Other') ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "ml-auto text-sm text-gray-400 self-center", children: [ supportTotal, " ", t('admin.pagination.total', 'total') ] }) ] }), loading ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-center py-10 text-gray-400", children: t('common.loading') }) : supportTickets.length === 0 ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-center py-10 text-gray-400", children: t('admin.support.none', 'No tickets') }) : supportTickets.map((ticket)=>{ const typeColors = { bug: 'bg-red-100 text-red-700', suggestion: 'bg-green-100 text-green-700', other: 'bg-gray-100 text-gray-600' }; const statusColors2 = { 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' }; const typeIcons = { bug: '🐛', suggestion: '💡', other: '💬' }; const isReplying = supportReplyId === ticket.id; var _typeColors_ticket_type, _statusColors2_ticket_status; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-start justify-between gap-4 mb-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-2 flex-wrap mb-1", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "px-2 py-0.5 rounded-full text-xs font-medium ".concat((_typeColors_ticket_type = typeColors[ticket.type]) !== null && _typeColors_ticket_type !== void 0 ? _typeColors_ticket_type : 'bg-gray-100 text-gray-600'), children: [ typeIcons[ticket.type], " ", ticket.type ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "px-2 py-0.5 rounded-full text-xs font-medium ".concat((_statusColors2_ticket_status = statusColors2[ticket.status]) !== null && _statusColors2_ticket_status !== void 0 ? _statusColors2_ticket_status : 'bg-gray-100 text-gray-500'), children: ticket.status }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "text-xs text-gray-400", children: [ "#", ticket.id.slice(0, 8) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h3", { className: "font-semibold text-gray-900 text-sm", children: ticket.subject }), ticket.userName && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { className: "text-xs text-gray-400 mt-0.5", children: [ ticket.userName, " \xb7 ", ticket.userEmail ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400 mt-0.5", children: new Date(ticket.createdAt).toLocaleString(dateLocale) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-2 flex-shrink-0", children: [ ticket.status !== 'closed' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>{ setSupportReplyId(isReplying ? null : ticket.id); setSupportReplyText(ticket.adminReply || ''); }, className: "text-xs px-3 py-1.5 rounded-lg font-medium bg-green-50 text-green-700 hover:bg-green-100", children: isReplying ? t('admin.support.cancel', 'Cancel') : t('admin.support.reply', 'Reply') }), ticket.status === 'open' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .setSupportTicketStatus */ .u0(ticket.id, 'closed').then(()=>setSupportTickets((prev)=>prev.map((t)=>t.id === ticket.id ? { ...t, status: 'closed' } : t))), className: "text-xs px-3 py-1.5 rounded-lg font-medium bg-gray-100 text-gray-600 hover:bg-gray-200", children: t('admin.support.close', 'Close') }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-gray-700 whitespace-pre-wrap bg-gray-50 rounded-lg p-3 mb-3", children: ticket.body }), ticket.adminReply && !isReplying && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-green-50 border border-green-100 rounded-lg p-3 mb-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { className: "text-xs font-medium text-green-600 mb-1", children: [ t('admin.support.your_reply', 'Your reply'), ":" ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-gray-800 whitespace-pre-wrap", children: ticket.adminReply }) ] }), isReplying && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-2 mt-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("textarea", { rows: 3, value: supportReplyText, onChange: (e)=>setSupportReplyText(e.target.value), placeholder: t('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" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-2 items-center", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("select", { id: "status-".concat(ticket.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: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "open", children: t('admin.support.status.open', 'Open') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "in_progress", children: t('admin.support.status.in_progress', 'In progress') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "resolved", children: t('admin.support.status.resolved', 'Resolved') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "closed", children: t('admin.support.status.closed', 'Closed') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { disabled: supportReplySaving || !supportReplyText.trim(), onClick: async ()=>{ const statusEl = document.getElementById("status-".concat(ticket.id)); setSupportReplySaving(true); try { const updated = await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .replyToSupportTicket */ .nT(ticket.id, { adminReply: supportReplyText, status: statusEl === null || statusEl === void 0 ? void 0 : statusEl.value }); setSupportTickets((prev)=>prev.map((t)=>t.id === ticket.id ? { ...t, ...updated } : t)); setSupportReplyId(null); } catch (e) {} finally{ setSupportReplySaving(false); } }, 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: supportReplySaving ? '...' : t('admin.support.send_reply', 'Send') }) ] }) ] }) ] }, ticket.id); }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Pagination, { page: supportPage, total: supportTotal, limit: 30, onChange: setSupportPage, totalLabel: t('admin.pagination.total') }) ] }), tab === 'push' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-5 space-y-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "text-lg font-semibold text-gray-800", children: "Push-рассылка" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>setPushMode('broadcast'), className: "px-3 py-1.5 text-sm rounded-lg border ".concat(pushMode === 'broadcast' ? 'bg-green-600 text-white border-green-600' : 'bg-white text-gray-700 border-gray-300'), children: "ВсеЌ пПльзПвателяЌ" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>setPushMode('user'), className: "px-3 py-1.5 text-sm rounded-lg border ".concat(pushMode === 'user' ? 'bg-green-600 text-white border-green-600' : 'bg-white text-gray-700 border-gray-300'), children: "КПМкретМПЌу пПльзПвателю" }) ] }), pushMode === 'user' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "text-sm text-gray-600 block mb-1", children: "User ID" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: pushTargetUserId, onChange: (e)=>setPushTargetUserId(e.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" }) ] }), pushMode === 'broadcast' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "flex items-center gap-2 text-sm text-gray-700", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "checkbox", checked: pushOnlyActive, onChange: (e)=>setPushOnlyActive(e.target.checked) }), "ТПлькП актОвМыЌ пПльзПвателяЌ" ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "text-sm text-gray-600 block mb-1", children: "ЗагПлПвПк" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: pushTitle, onChange: (e)=>setPushTitle(e.target.value), placeholder: "НапрОЌер: НПвые заЎачО ряЎПЌ с ваЌО", className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "text-sm text-gray-600 block mb-1", children: "Текст" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("textarea", { rows: 3, value: pushBody, onChange: (e)=>setPushBody(e.target.value), placeholder: "КПрПткОй текст увеЎПЌлеМОя", className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 resize-none" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "text-sm text-gray-600 block mb-1", children: "ТОп" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: pushType, onChange: (e)=>setPushType(e.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" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "text-sm text-gray-600 block mb-1", children: "Reference ID (ПпцОПМальМП)" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: pushReferenceId, onChange: (e)=>setPushReferenceId(e.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" }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: sendAdminPush, disabled: pushSending || !pushTitle.trim() || pushMode === 'user' && !pushTargetUserId.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: pushSending ? 'Отправка...' : 'ОтправОть Push' }), pushError && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-sm text-red-600", children: pushError }) ] }) ] }), pushResult && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h3", { className: "font-semibold text-gray-800 mb-3", children: "Результат" }), 'usersTotal' in pushResult ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "grid grid-cols-2 md:grid-cols-5 gap-3 text-sm", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "rounded-lg bg-gray-50 border border-gray-200 px-3 py-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-gray-500", children: "ППльзПвателей" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-gray-900 font-semibold", children: pushResult.usersTotal }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "rounded-lg bg-gray-50 border border-gray-200 px-3 py-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-gray-500", children: "ППлучОлО" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-gray-900 font-semibold", children: pushResult.usersWithSent }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "rounded-lg bg-gray-50 border border-gray-200 px-3 py-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-gray-500", children: "ОтправлеМП push" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-gray-900 font-semibold", children: pushResult.pushesSent }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "rounded-lg bg-gray-50 border border-gray-200 px-3 py-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-gray-500", children: "НевалОЎМые тПкеМы" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-gray-900 font-semibold", children: pushResult.invalidTokens }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "rounded-lg bg-gray-50 border border-gray-200 px-3 py-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-gray-500", children: "ОшОбкО пП userId" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-gray-900 font-semibold", children: pushResult.failedUsers.length }) ] }) ] }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "grid grid-cols-2 md:grid-cols-4 gap-3 text-sm", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "rounded-lg bg-gray-50 border border-gray-200 px-3 py-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-gray-500", children: "User ID" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-gray-900 font-mono text-xs break-all", children: pushResult.targetUserId }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "rounded-lg bg-gray-50 border border-gray-200 px-3 py-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-gray-500", children: "ТПкеМПв МайЎеМП" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-gray-900 font-semibold", children: (_pushResult_tokensFound = pushResult.tokensFound) !== null && _pushResult_tokensFound !== void 0 ? _pushResult_tokensFound : 0 }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "rounded-lg bg-gray-50 border border-gray-200 px-3 py-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-gray-500", children: "ОтправлеМП push" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-gray-900 font-semibold", children: pushResult.sent }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "rounded-lg bg-gray-50 border border-gray-200 px-3 py-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-gray-500", children: "НевалОЎМые тПкеМы" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-gray-900 font-semibold", children: pushResult.invalidTokens }) ] }) ] }), 'usersTotal' in pushResult ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: ((_pushResult_usersWithoutTokens = pushResult.usersWithoutTokens) !== null && _pushResult_usersWithoutTokens !== void 0 ? _pushResult_usersWithoutTokens : 0) > 0 || ((_pushResult_usersConfigBlocked = pushResult.usersConfigBlocked) !== null && _pushResult_usersConfigBlocked !== void 0 ? _pushResult_usersConfigBlocked : 0) > 0 || ((_pushResult_usersAuthFailed = pushResult.usersAuthFailed) !== null && _pushResult_usersAuthFailed !== void 0 ? _pushResult_usersAuthFailed : 0) > 0 || ((_pushResult_usersAllFailed = pushResult.usersAllFailed) !== null && _pushResult_usersAllFailed !== void 0 ? _pushResult_usersAllFailed : 0) > 0 ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "mt-3 rounded-lg border border-amber-200 bg-amber-50 px-3 py-2 text-xs text-amber-900", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ "ДОагМПстОка: без тПкеМПв — ", (_pushResult_usersWithoutTokens1 = pushResult.usersWithoutTokens) !== null && _pushResult_usersWithoutTokens1 !== void 0 ? _pushResult_usersWithoutTokens1 : 0, ", FCM Ме МастрПеМ — ", (_pushResult_usersConfigBlocked1 = pushResult.usersConfigBlocked) !== null && _pushResult_usersConfigBlocked1 !== void 0 ? _pushResult_usersConfigBlocked1 : 0, ", ПшОбка auth FCM — ", (_pushResult_usersAuthFailed1 = pushResult.usersAuthFailed) !== null && _pushResult_usersAuthFailed1 !== void 0 ? _pushResult_usersAuthFailed1 : 0, ", FCM send failed — ", (_pushResult_usersAllFailed1 = pushResult.usersAllFailed) !== null && _pushResult_usersAllFailed1 !== void 0 ? _pushResult_usersAllFailed1 : 0 ] }), pushResult.failedReasonStats && Object.keys(pushResult.failedReasonStats).length > 0 ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "mt-1", children: [ "КПЎы ПшОбПк FCM: ", Object.entries(pushResult.failedReasonStats).map((param)=>{ let [key, count] = param; return "".concat(key, ": ").concat(count); }).join(', ') ] }) : null, pushResult.failedReasonSample ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "mt-1", children: [ "ПрОЌер ПшОбкО: ", describeFcmFailure(pushResult.failedReasonStats ? Object.keys(pushResult.failedReasonStats)[0] : null, pushResult.failedReasonSample) ] }) : null ] }) : null }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: pushResult.reason ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "mt-3 rounded-lg border border-amber-200 bg-amber-50 px-3 py-2 text-xs text-amber-900", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ "ДОагМПстОка: ", pushResult.reason === 'no_tokens' ? 'у пПльзПвателя Мет push-тПкеМПв' : pushResult.reason === 'fcm_not_configured' ? 'FCM Ме МастрПеМ Ма API (переЌеММые FCM_*)' : pushResult.reason === 'fcm_auth_failed' ? 'ПшОбка автПрОзацОО FCM (service account)' : describeFcmFailure(pushResult.failureKey, pushResult.failureMessage) ] }), pushResult.failureKey ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "mt-1", children: [ "КПЎ FCM: ", pushResult.failureKey ] }) : null, pushResult.failureMessage ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "mt-1", children: [ "СППбщеМОе FCM: ", pushResult.failureMessage ] }) : null ] }) : null }) ] }) ] }), tab === 'backup' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("h2", { className: "text-lg font-semibold text-gray-800 flex items-center gap-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-5 h-5 text-green-600", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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" }) }), t('admin.backup.title', 'Backup') ] }), backupMsg && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "".concat(backupMsgError ? '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: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { children: backupMsg }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>setBackupMsg(null), className: "".concat(backupMsgError ? 'text-red-500 hover:text-red-700' : 'text-green-500 hover:text-green-700', " ml-4"), children: "\xd7" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-5 flex items-center justify-between", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "font-medium text-gray-800 text-sm", children: t('admin.backup.autoBackup', 'Auto Backup') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-500 mt-0.5", children: t('admin.backup.autoBackupDesc', 'Create a backup every day automatically') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { disabled: backupAutoSaving, onClick: async ()=>{ setBackupAutoSaving(true); try { await (0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .request */ .Em)('/admin/backup/settings', { method: 'PUT', body: JSON.stringify({ autoEnabled: !backupAutoEnabled }) }); setBackupAutoEnabled((v)=>!v); } catch (e) {} setBackupAutoSaving(false); }, className: "relative w-11 h-6 rounded-full transition-colors ".concat(backupAutoEnabled ? 'bg-green-600' : 'bg-gray-300', " ").concat(backupAutoSaving ? 'opacity-50' : ''), children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "absolute top-0.5 left-0.5 w-5 h-5 rounded-full bg-white shadow transition-transform ".concat(backupAutoEnabled ? 'translate-x-5' : 'translate-x-0') }) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h3", { className: "font-semibold text-gray-800 text-sm mb-4", children: t('admin.backup.title', 'Database Backup') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex flex-wrap gap-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { disabled: backupExporting, onClick: async ()=>{ setBackupExporting(true); try { const BASE = "https://api.canhelp.gr" || 0; const res = await fetch("".concat(BASE, "/api/admin/backup/export"), { credentials: 'include' }); if (!res.ok) throw new Error('Export failed'); const blob = await res.blob(); const url = URL.createObjectURL(blob); const a = document.createElement('a'); a.href = url; a.download = "backup_".concat(new Date().toISOString().slice(0, 10), ".sql.gz"); a.click(); URL.revokeObjectURL(url); setBackupSuccess(t('admin.backup.exportSuccess', 'Export successful')); } catch (e) { setBackupError(e.message || 'Error'); } setBackupExporting(false); }, 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: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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" }) }), backupExporting ? t('admin.backup.exporting', 'Exporting...') : t('admin.backup.exportAll', 'Export Full DB') ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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 ".concat(backupImporting === 'full' ? 'opacity-50 pointer-events-none' : ''), children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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" }) }), backupImporting === 'full' ? t('admin.backup.importing', 'Importing...') : t('admin.backup.importAll', 'Import Full DB'), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "file", accept: ".sql.gz,.gz", className: "hidden", onChange: async (e)=>{ var _e_target_files; const file = (_e_target_files = e.target.files) === null || _e_target_files === void 0 ? void 0 : _e_target_files[0]; if (!file) return; if (!window.confirm(t('admin.backup.restoreConfirm', 'Restore from this backup?'))) return; setBackupImporting('full'); try { const fd = new FormData(); fd.append('file', file); const BASE = "https://api.canhelp.gr" || 0; const res = await fetch("".concat(BASE, "/api/admin/backup/import"), { method: 'POST', credentials: 'include', body: fd }); if (!res.ok) throw new Error('Import failed'); setBackupSuccess(t('admin.backup.importSuccess', 'Import successful')); } catch (err) { setBackupError(err.message || 'Error'); } setBackupImporting(null); e.target.value = ''; } }) ] }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h3", { className: "font-semibold text-gray-800 text-sm mb-4", children: t('admin.backup.storedBackups', 'Stored Backups') }), backupStoredFiles.length === 0 ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-gray-400", children: t('admin.backup.noStoredBackups', 'No stored backups') }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "space-y-2", children: backupStoredFiles.map((f)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-between py-2 px-3 bg-gray-50 rounded-lg border border-gray-100", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm font-medium text-gray-800", children: f.name === 'backup_today' ? t('admin.backup.today', 'Today') : t('admin.backup.yesterday', 'Yesterday') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { className: "text-xs text-gray-400", children: [ t('admin.backup.size', 'Size'), ": ", (f.size / 1024).toFixed(1), " KB \xb7 ", t('admin.backup.date', 'Date'), ": ", new Date(f.date).toLocaleString() ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { disabled: backupRestoring === f.name, onClick: async ()=>{ if (!window.confirm(t('admin.backup.restoreConfirm', 'Restore from this backup?'))) return; setBackupRestoring(f.name); try { await (0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .request */ .Em)('/admin/backup/restore', { method: 'POST', body: JSON.stringify({ name: f.name }) }); setBackupSuccess(t('admin.backup.restoreSuccess', 'Restore successful')); } catch (err) { setBackupError(err.message || 'Error'); } setBackupRestoring(null); }, className: "text-sm text-green-600 hover:text-gray-800 font-medium disabled:opacity-50", children: backupRestoring === f.name ? t('admin.backup.restoring', 'Restoring...') : t('admin.backup.restore', 'Restore') }) ] }, f.name)) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h3", { className: "font-semibold text-gray-800 text-sm mb-4", children: t('admin.backup.tables', 'Tables') }), backupTablesLoading ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-2 text-sm text-gray-400", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-4 h-4 animate-spin", fill: "none", viewBox: "0 0 24 24", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { className: "opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8v8z" }) ] }), t('common.loading', 'Loading...') ] }) : backupTables.length === 0 ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-gray-400", children: t('admin.noData', 'No data') }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "overflow-x-auto", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("table", { className: "w-full text-sm", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("tbody", { className: "divide-y divide-gray-100", children: backupTables.map((tbl)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("tr", { className: "hover:bg-gray-50", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "py-2 pr-4 font-mono text-gray-700", children: tbl }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "py-2 text-right", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-end gap-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: async ()=>{ try { const BASE = "https://api.canhelp.gr" || 0; const res = await fetch("".concat(BASE, "/api/admin/backup/export/").concat(tbl), { credentials: 'include' }); if (!res.ok) throw new Error('Export failed'); const blob = await res.blob(); const url = URL.createObjectURL(blob); const a = document.createElement('a'); a.href = url; a.download = "".concat(tbl, "_").concat(new Date().toISOString().slice(0, 10), ".sql.gz"); a.click(); URL.revokeObjectURL(url); } catch (err) { setBackupError(err.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: t('admin.backup.exportTable', 'Export') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: [ backupImporting === tbl ? t('admin.backup.importing', 'Importing...') : t('admin.backup.importTable', 'Import'), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "file", accept: ".sql.gz,.gz", className: "hidden", onChange: async (e)=>{ var _e_target_files; const file = (_e_target_files = e.target.files) === null || _e_target_files === void 0 ? void 0 : _e_target_files[0]; if (!file) return; if (!window.confirm(t('admin.backup.restoreConfirm', 'Restore from this backup?'))) return; setBackupImporting(tbl); try { const fd = new FormData(); fd.append('file', file); const BASE = "https://api.canhelp.gr" || 0; const res = await fetch("".concat(BASE, "/api/admin/backup/import/").concat(tbl), { method: 'POST', credentials: 'include', body: fd }); if (!res.ok) { const errData = await res.json().catch(()=>({ error: 'Import failed' })); throw new Error(errData.error || 'Import failed'); } setBackupSuccess(t('admin.backup.importSuccess', 'Import successful')); } catch (err) { setBackupError(err.message || 'Error'); } setBackupImporting(null); e.target.value = ''; } }) ] }) ] }) }) ] }, tbl)) }) }) }) ] }) ] }), tab === 'translations' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "text-base font-semibold text-gray-900", children: "ПеревПЎы" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-gray-500 mt-0.5", children: "АвтПЌатОческОй перевПЎ прПпущеММых зМачеМОй пП таблОцаЌ" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-4 flex flex-wrap gap-4 items-end", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: "ИстПчМОк" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("select", { value: transFromLang, onChange: (e)=>setTransFromLang(e.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: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "el", children: "\uD83C\uDDEC\uD83C\uDDF7 Greek" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "en", children: "\uD83C\uDDEC\uD83C\uDDE7 English" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "ru", children: "\uD83C\uDDF7\uD83C\uDDFA Russian" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "uk", children: "\uD83C\uDDFA\uD83C\uDDE6 Ukrainian" }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M13 7l5 5-5 5M6 12h12" }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: "ПеревестО Ма" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("select", { value: transLang, onChange: (e)=>setTransLang(e.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: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "el", children: "\uD83C\uDDEC\uD83C\uDDF7 Greek" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "en", children: "\uD83C\uDDEC\uD83C\uDDE7 English" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "ru", children: "\uD83C\uDDF7\uD83C\uDDFA Russian" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "uk", children: "\uD83C\uDDFA\uD83C\uDDE6 Ukrainian" }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "ml-auto self-end", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "text-sm font-semibold text-gray-700 flex items-center gap-2", children: [ { el: '🇬🇷', en: '🇬🇧', ru: '🇷🇺', uk: '🇺🇊' }[transFromLang], " ", transFromLang.toUpperCase(), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 text-gray-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M13 7l5 5-5 5M6 12h12" }) }), { el: '🇬🇷', en: '🇬🇧', ru: '🇷🇺', uk: '🇺🇊' }[transLang], " ", transLang.toUpperCase() ] }) }) ] }), transMsg && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-sm px-4 py-2 rounded-lg ".concat(transMsg.error ? 'bg-red-50 text-red-700' : 'bg-green-50 text-green-700'), children: transMsg.text }), transStatsLoading ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-2 text-sm text-gray-400 py-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-4 h-4 animate-spin", fill: "none", viewBox: "0 0 24 24", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { className: "opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8v8z" }) ] }), "Загрузка " ] }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "grid gap-4 sm:grid-cols-2 lg:grid-cols-3", children: (transStats !== null && transStats !== void 0 ? transStats : []).map((tbl)=>{ const isTasks = tbl.name === 'tasks'; // For tasks: total missing across all langs (tasks may miss multiple langs each) const totalMissingAllLangs = Object.values(tbl.missing).reduce((a, b)=>a + b, 0); var _tbl_missing_transLang; const missingCount = isTasks ? totalMissingAllLangs : (_tbl_missing_transLang = tbl.missing[transLang]) !== null && _tbl_missing_transLang !== void 0 ? _tbl_missing_transLang : 0; const isTranslating = !!transTableTranslating[tbl.name]; const anyTranslating = Object.values(transTableTranslating).some(Boolean); return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-5 flex flex-col", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-start justify-between", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "font-semibold text-gray-900 text-sm", children: tbl.label }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400 mt-0.5", children: tbl.name }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-xs font-semibold px-2 py-0.5 rounded-full ".concat(missingCount > 0 ? 'bg-red-100 text-red-700' : 'bg-green-100 text-green-700'), children: missingCount > 0 ? "".concat(missingCount, " missing") : 'Complete' }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { className: "text-xs text-gray-500 mt-3", children: [ "ВсегП: ", tbl.total, isTasks && ' · с языка ПрОгОМала Ма все ПстальМые' ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "mt-2 flex flex-wrap gap-1", children: [ 'el', 'en', 'ru', 'uk' ].map((lang)=>{ var _tbl_missing_lang; const cnt = (_tbl_missing_lang = tbl.missing[lang]) !== null && _tbl_missing_lang !== void 0 ? _tbl_missing_lang : 0; const isClickable = isTasks && cnt > 0; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { type: "button", disabled: !isClickable, onClick: isClickable ? async ()=>{ setTransPreview({ lang, loading: true, rows: [] }); try { const d = await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getTasksTranslationPreview */ .QY(lang, 50); setTransPreview({ lang, loading: false, rows: d.rows }); } catch (e) { setTransPreview({ lang, loading: false, rows: [] }); } } : undefined, className: "text-xs px-2 py-0.5 rounded-full border transition ".concat(cnt > 0 ? 'border-red-200 bg-red-50 text-red-600' + (isClickable ? ' cursor-pointer hover:bg-red-100' : '') : 'border-green-200 bg-green-50 text-green-600 cursor-default'), children: [ lang, ": ", cnt > 0 ? "-".concat(cnt) : '✓' ] }, lang); }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "mt-4 mt-auto pt-4", children: missingCount === 0 ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-1.5 text-xs text-emerald-600", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3.5 h-3.5 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" }) }), "Все перевПЎы запПлМеМы" ] }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { disabled: anyTranslating, onClick: async ()=>{ if (!isTasks && transFromLang === transLang) { setTransMsg({ text: 'ИсхПЎМый О целевПй язык сПвпаЎают', error: true }); return; } setTransTableTranslating((prev)=>({ ...prev, [tbl.name]: true })); setTransMsg(null); try { const res = isTasks ? await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .autoTranslateTasks */ .I(500) : tbl.name === 'email_templates' ? await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .autoTranslateEmailTemplates */ .fu(transLang, transFromLang) : await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .autoTranslate */ .cp(tbl.name, transLang, transFromLang, 500); setTransMsg({ text: "".concat(tbl.label, ": translated ").concat(res.translated, " of ").concat(res.total) + (res.failed > 0 ? " \xb7 errors: ".concat(res.failed) : ''), error: res.failed > 0 && res.translated === 0 }); _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getTranslationsStats */ .YQ().then((d)=>setTransStats(d.tables)).catch(()=>{}); } catch (err) { const msg = (err === null || err === void 0 ? void 0 : err.response) ? await err.response.text().catch(()=>err.message) : err.message || 'Error'; setTransMsg({ text: "Error: ".concat(msg), error: true }); } finally{ setTransTableTranslating((prev)=>{ const n = { ...prev }; delete n[tbl.name]; return n; }); } }, 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: isTranslating ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-3.5 h-3.5 animate-spin flex-shrink-0", fill: "none", viewBox: "0 0 24 24", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { className: "opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8v8z" }) ] }), "Translating..." ] }) : isTasks ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3.5 h-3.5 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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 ", missingCount ] }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3.5 h-3.5 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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 ", missingCount, " \xb7 ", { el: '🇬🇷', en: '🇬🇧', ru: '🇷🇺', uk: '🇺🇊' }[transFromLang], " ", transFromLang.toUpperCase(), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M13 7l5 5-5 5M6 12h12" }) }), { el: '🇬🇷', en: '🇬🇧', ru: '🇷🇺', uk: '🇺🇊' }[transLang], " ", transLang.toUpperCase() ] }) }) }) ] }, tbl.name); }) }) ] }), tab === 'dbcheck' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(DbCheckTab, {}), tab === 'referrals' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "grid grid-cols-3 gap-4", children: [ { label: 'РеферерПв', value: (_referralsData_totalReferrers = referralsData === null || referralsData === void 0 ? void 0 : referralsData.totalReferrers) !== null && _referralsData_totalReferrers !== void 0 ? _referralsData_totalReferrers : '—', color: 'text-green-600' }, { label: 'ПрОглашеМОй', value: (_referralsData_totalReferrals = referralsData === null || referralsData === void 0 ? void 0 : referralsData.totalReferrals) !== null && _referralsData_totalReferrals !== void 0 ? _referralsData_totalReferrals : '—', color: 'text-purple-600' }, { label: 'АктОвМых МаграЎ', value: (_referralsData_activeRewards = referralsData === null || referralsData === void 0 ? void 0 : referralsData.activeRewards) !== null && _referralsData_activeRewards !== void 0 ? _referralsData_activeRewards : '—', color: 'text-green-600' } ].map((param)=>{ let { label, value, color } = param; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-2xl border border-gray-200 p-5 text-center", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-3xl font-bold ".concat(color), children: value }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-xs text-gray-500 mt-1", children: label }) ] }, label); }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-2xl border border-gray-200 overflow-hidden", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "px-5 py-4 border-b border-gray-100 flex items-center justify-between", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "font-semibold text-gray-800", children: "ДеревП рефералПв" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { onClick: ()=>{ setReferralsLoading(true); _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminReferrals */ .cJ().then(setReferralsData).catch(()=>{}).finally(()=>setReferralsLoading(false)); }, className: "text-xs text-green-600 hover:underline flex items-center gap-1", children: [ referralsLoading && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-3 h-3 animate-spin", fill: "none", viewBox: "0 0 24 24", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { className: "opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8v8z" }) ] }), "ОбМПвОть" ] }) ] }), referralsLoading && !referralsData ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex justify-center py-16", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-6 h-6 animate-spin text-purple-600", fill: "none", viewBox: "0 0 24 24", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { className: "opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8v8z" }) ] }) }) : !referralsData || referralsData.tree.length === 0 ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "py-16 text-center text-sm text-gray-400", children: "Нет ЎаММых П рефералах" }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "divide-y divide-gray-100", children: referralsData.tree.map((node)=>{ var _node_referrer, _node_referrer1; var _node_referrer_id; const rid = (_node_referrer_id = (_node_referrer = node.referrer) === null || _node_referrer === void 0 ? void 0 : _node_referrer.id) !== null && _node_referrer_id !== void 0 ? _node_referrer_id : 'unknown'; const isExpanded = referralsExpanded.has(rid); var _node_referrer_firstName, _node_referrer_lastName; const referrerName = node.referrer ? "".concat((_node_referrer_firstName = node.referrer.firstName) !== null && _node_referrer_firstName !== void 0 ? _node_referrer_firstName : '', " ").concat((_node_referrer_lastName = node.referrer.lastName) !== null && _node_referrer_lastName !== void 0 ? _node_referrer_lastName : '').trim() || node.referrer.email : '(уЎалёМ)'; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { className: "w-full flex items-center gap-3 px-5 py-3.5 hover:bg-gray-50 text-left transition-colors", onClick: ()=>setReferralsExpanded((prev)=>{ const next = new Set(prev); next.has(rid) ? next.delete(rid) : next.add(rid); return next; }), children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 text-gray-400 flex-shrink-0 transition-transform ".concat(isExpanded ? 'rotate-90' : ''), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 5l7 7-7 7" }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "font-medium text-sm text-gray-900", children: referrerName }), node.referrer && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "ml-2 text-xs text-gray-400", children: node.referrer.email }) ] }), ((_node_referrer1 = node.referrer) === null || _node_referrer1 === void 0 ? void 0 : _node_referrer1.referralCode) && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("code", { className: "text-xs bg-gray-100 text-gray-600 px-2 py-0.5 rounded font-mono", children: node.referrer.referralCode }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "ml-3 text-xs font-semibold text-purple-700 bg-purple-50 px-2 py-0.5 rounded-full", children: [ node.referees.length, " реф." ] }) ] }), isExpanded && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "bg-gray-50 border-t border-gray-100", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("table", { className: "w-full text-xs", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("thead", { children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("tr", { className: "border-b border-gray-200", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "text-left px-10 py-2 font-semibold text-gray-500", children: "ПрОглашёММый" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "text-left px-3 py-2 font-semibold text-gray-500", children: "Email" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "text-center px-3 py-2 font-semibold text-gray-500", children: "+ЎМей" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "text-center px-3 py-2 font-semibold text-gray-500", children: "Истекает" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "text-center px-3 py-2 font-semibold text-gray-500", children: "Дата" }) ] }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("tbody", { children: node.referees.map((referee)=>{ var _referee_firstName, _referee_lastName; const refName = "".concat((_referee_firstName = referee.firstName) !== null && _referee_firstName !== void 0 ? _referee_firstName : '', " ").concat((_referee_lastName = referee.lastName) !== null && _referee_lastName !== void 0 ? _referee_lastName : '').trim() || referee.email; const expiresAt = new Date(referee.expiresAt); const createdAt = new Date(referee.createdAt); const isActive = expiresAt > new Date(); return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("tr", { className: "border-b border-gray-100 last:border-0 hover:bg-white transition-colors", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-10 py-2.5 font-medium text-gray-800", children: refName }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-3 py-2.5 text-gray-500", children: referee.email }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-3 py-2.5 text-center", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "font-semibold text-green-700", children: [ "+", referee.daysAdded ] }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-3 py-2.5 text-center", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "px-1.5 py-0.5 rounded text-xs font-medium ".concat(isActive ? 'bg-green-100 text-green-700' : 'bg-gray-100 text-gray-500'), children: expiresAt.toLocaleDateString('ru-RU', { day: '2-digit', month: '2-digit', year: '2-digit' }) }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-3 py-2.5 text-center text-gray-400", children: createdAt.toLocaleDateString('ru-RU', { day: '2-digit', month: '2-digit', year: '2-digit' }) }) ] }, referee.id); }) }) ] }) }) ] }, rid); }) }) ] }) ] }), transPreview && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "fixed inset-0 z-50 flex items-center justify-center bg-black/50 px-4", onClick: ()=>setTransPreview(null), children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-2xl shadow-xl w-full max-w-3xl max-h-[80vh] flex flex-col", onClick: (e)=>e.stopPropagation(), children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-between px-6 py-4 border-b border-gray-100 flex-shrink-0", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("h3", { className: "font-semibold text-gray-900", children: [ "ЗаЎачО без перевПЎа: ", /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "uppercase font-bold text-red-600", children: transPreview.lang }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400 mt-0.5", children: "ППказаМы первые 50 запОсей" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>setTransPreview(null), className: "text-gray-400 hover:text-gray-600 p-1", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-5 h-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" }) }) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "overflow-y-auto flex-1 px-6 py-4", children: transPreview.loading ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex justify-center py-12", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-6 h-6 animate-spin text-purple-600", fill: "none", viewBox: "0 0 24 24", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { className: "opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8v8z" }) ] }) }) : transPreview.rows.length === 0 ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-gray-500 text-center py-12", children: "Нет заЎач без перевПЎа" }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("table", { className: "w-full text-xs border-collapse", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("thead", { children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("tr", { className: "border-b border-gray-200", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "text-left py-2 pr-3 font-semibold text-gray-600 w-[35%]", children: "ОрОгОМал (title)" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "text-center py-2 px-2 font-semibold text-gray-600", children: "orig" }), [ 'el', 'en', 'ru', 'uk' ].map((l)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "text-center py-2 px-2 font-semibold text-gray-600 w-[14%]", children: l }, l)) ] }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("tbody", { children: transPreview.rows.map((row)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("tr", { className: "border-b border-gray-100 hover:bg-gray-50", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "py-2 pr-3 text-gray-800 truncate max-w-[200px]", title: row.title, children: row.title }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "py-2 px-2 text-center", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "uppercase font-semibold text-purple-700 bg-purple-50 px-1.5 py-0.5 rounded", children: row.originalLocale }) }), [ [ 'el', row.titleEl ], [ 'en', row.titleEn ], [ 'ru', row.titleRu ], [ 'uk', row.titleUk ] ].map((param)=>{ let [l, val] = param; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "py-2 px-2 text-center", title: val !== null && val !== void 0 ? val : '', children: val ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-emerald-600 font-semibold", children: "✓" }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-red-500 font-semibold", children: "✗" }) }, l); }) ] }, row.id)) }) ] }) }) ] }) }), editUser && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "fixed inset-0 z-50 flex items-center justify-center bg-black/50 px-4", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-2xl shadow-xl w-full max-w-4xl max-h-[90vh] flex flex-col", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-between px-6 py-4 border-b border-gray-100 flex-shrink-0", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "text-base font-semibold text-gray-900", children: t('admin.user_edit.title') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { className: "text-xs text-gray-400 mt-0.5", children: [ editUser.email, " \xb7 ID: ", editUser.id ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>setEditUser(null), className: "text-gray-400 hover:text-gray-600 text-2xl leading-none", children: "\xd7" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex flex-1 min-h-0", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: t('admin.user_edit.tab.profile') }, { id: 'account', label: t('admin.user_edit.tab.account') }, { id: 'balance', label: t('admin.user_edit.tab.balance') }, { id: 'settings', label: t('admin.user_edit.tab.settings') }, { id: 'site', label: t('admin.user_edit.tab.site') }, { id: 'specialist', label: t('admin.user_edit.tab.specialist') } ].map((item)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>{ setEditUserTab(item.id); if (item.id === 'specialist' && editUser) { setEditUserCardsLoading(true); const loadCards = _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminUserSpecialistCards */ .vy(editUser.id).then(setEditUserCards).catch(()=>{}); const loadCats = catRows.length === 0 ? _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminCategories */ .KD().then(setCatRows).catch(()=>{}) : Promise.resolve(); const loadLocs = locRows.length === 0 ? _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminLocations */ .k_().then(setLocRows).catch(()=>{}) : Promise.resolve(); Promise.all([ loadCards, loadCats, loadLocs ]).finally(()=>setEditUserCardsLoading(false)); } }, className: "w-full text-left px-3 py-2.5 text-sm rounded-lg transition-colors ".concat(editUserTab === item.id ? 'bg-green-50 text-green-700 font-medium' : 'text-gray-600 hover:bg-gray-50'), children: item.label }, item.id)) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex-1 overflow-y-auto p-6", children: [ editUserTab === 'profile' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "p-3 bg-gray-50 rounded-lg text-xs text-gray-500 space-y-0.5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "font-medium", children: [ t('admin.user_edit.registered'), ":" ] }), " ", new Date(editUser.createdAt).toLocaleDateString(dateLocale) ] }), editUser.lastSeenAt && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "font-medium", children: [ t('admin.user_edit.last_seen'), ":" ] }), " ", new Date(editUser.lastSeenAt).toLocaleDateString(dateLocale) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "grid grid-cols-2 gap-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.user_edit.first_name') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: (_editUser_firstName = editUser.firstName) !== null && _editUser_firstName !== void 0 ? _editUser_firstName : '', onChange: (e)=>setEditUser((u)=>({ ...u, firstName: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.user_edit.last_name') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: (_editUser_lastName = editUser.lastName) !== null && _editUser_lastName !== void 0 ? _editUser_lastName : '', onChange: (e)=>setEditUser((u)=>({ ...u, lastName: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.user_edit.phone') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: (_editUser_phone = editUser.phone) !== null && _editUser_phone !== void 0 ? _editUser_phone : '', onChange: (e)=>setEditUser((u)=>({ ...u, phone: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.user_edit.bio') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("textarea", { value: (_editUser_bio = editUser.bio) !== null && _editUser_bio !== void 0 ? _editUser_bio : '', onChange: (e)=>setEditUser((u)=>({ ...u, bio: e.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" }) ] }) ] }), editUserTab === 'account' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.user_edit.email') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: editUser.email }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-between rounded-lg border px-3 py-2 bg-gray-50", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-2", children: [ editUser.emailVerified ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 text-green-500 shrink-0", viewBox: "0 0 20 20", fill: "currentColor", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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" }) }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 text-red-400 shrink-0", viewBox: "0 0 20 20", fill: "currentColor", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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" }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-sm font-medium ".concat(editUser.emailVerified ? 'text-green-700' : 'text-red-600'), children: editUser.emailVerified ? t('admin.user_edit.email_verified') : t('admin.user_edit.email_not_verified') }) ] }), !editUser.emailVerified && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: verifyEmail, disabled: verifyingEmail, className: "text-xs px-3 py-1 rounded-md bg-green-600 text-white hover:bg-green-700 disabled:opacity-50 transition-colors", children: verifyingEmail ? '...' : t('admin.user_edit.verify_email_btn') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "grid grid-cols-2 gap-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.user_edit.role') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("select", { value: editUser.role, onChange: (e)=>setEditUser((u)=>({ ...u, role: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "user", children: t('admin.user_edit.role.user') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "admin", children: t('admin.user_edit.role.admin') }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.user_edit.plan') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("select", { value: (_editUser_planId = editUser.planId) !== null && _editUser_planId !== void 0 ? _editUser_planId : '', onChange: (e)=>setEditUser((u)=>({ ...u, planId: e.target.value || null })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "", children: t('admin.user_edit.no_plan') }), planRows.map((p)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: p.id, children: p.name }, p.id)) ] }) ] }) ] }), editUser.planExpiresAt && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { className: "text-xs text-gray-500", children: [ t('admin.user_edit.plan_expires'), ": ", new Date(editUser.planExpiresAt).toLocaleDateString(dateLocale) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "flex items-center gap-2 cursor-pointer", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "checkbox", checked: editUser.isActive !== false, onChange: (e)=>setEditUser((u)=>({ ...u, isActive: e.target.checked })), className: "w-4 h-4 rounded border-gray-300 text-green-600" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-sm text-gray-700", children: t('admin.user_edit.active') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.user_edit.interface_lang') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("select", { value: (_editUser_locale = editUser.locale) !== null && _editUser_locale !== void 0 ? _editUser_locale : 'el', onChange: (e)=>setEditUser((u)=>({ ...u, locale: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "el", children: "ΕλληΜικά" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "en", children: "English" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "ru", children: "РусскОй" }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: t('admin.user_edit.comm_languages') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex gap-5", children: [ 'el', 'en', 'uk', 'ru' ].map((lang)=>{ var _editUser_languages; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "flex items-center gap-1.5 cursor-pointer", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "checkbox", checked: ((_editUser_languages = editUser.languages) !== null && _editUser_languages !== void 0 ? _editUser_languages : []).includes(lang), onChange: (e)=>{ var _editUser_languages; const langs = (_editUser_languages = editUser.languages) !== null && _editUser_languages !== void 0 ? _editUser_languages : []; setEditUser((u)=>({ ...u, languages: e.target.checked ? [ ...langs.filter((l)=>l !== lang), lang ] : langs.filter((l)=>l !== lang) })); }, className: "w-4 h-4 rounded border-gray-300 text-green-600" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-sm text-gray-700", children: lang === 'el' ? 'ΕλληΜικά' : lang === 'en' ? 'English' : lang === 'uk' ? 'УкраїМська' : 'РусскОй' }) ] }, lang); }) }) ] }) ] }), editUserTab === 'balance' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-between p-5 bg-gray-50 rounded-xl border border-gray-200", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-xs text-gray-500 mb-1", children: t('admin.user_edit.balance') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "text-2xl font-bold text-gray-900", children: [ Number((_editUser_balance = editUser.balance) !== null && _editUser_balance !== void 0 ? _editUser_balance : 0).toFixed(2), " EUR" ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { onClick: ()=>setBalanceModal('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: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M12 4v16m8-8H4" }) }), t('admin.balance.topup.btn') ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { onClick: ()=>setBalanceModal('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: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M20 12H4" }) }), t('admin.balance.withdraw.btn') ] }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-center text-gray-400", children: t('admin.balance.modal_hint') }) ] }), editUserTab === 'settings' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "space-y-4", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-3 pt-1 divide-y divide-gray-100", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "flex items-center justify-between cursor-pointer py-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-sm font-medium text-gray-700", children: t('admin.user_edit.show_contact_info') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-xs text-gray-400", children: t('admin.user_edit.show_contact_info.hint') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "checkbox", checked: (_editUser_showContactInfo = editUser.showContactInfo) !== null && _editUser_showContactInfo !== void 0 ? _editUser_showContactInfo : false, onChange: (e)=>setEditUser((u)=>({ ...u, showContactInfo: e.target.checked })), className: "w-4 h-4 rounded border-gray-300 text-green-600" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "flex items-center justify-between cursor-pointer py-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-sm font-medium text-gray-700", children: t('admin.user_edit.notify_new_tasks') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-xs text-gray-400", children: t('admin.user_edit.notify_new_tasks.hint') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "checkbox", checked: (_editUser_notifyNewTasks = editUser.notifyNewTasks) !== null && _editUser_notifyNewTasks !== void 0 ? _editUser_notifyNewTasks : false, onChange: (e)=>setEditUser((u)=>({ ...u, notifyNewTasks: e.target.checked })), className: "w-4 h-4 rounded border-gray-300 text-green-600" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "flex items-center justify-between cursor-pointer py-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-sm font-medium text-gray-700", children: t('admin.user_edit.notif_messages') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-xs text-gray-400", children: t('admin.user_edit.notif_messages.hint') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "checkbox", checked: (_editUser_notifMessages = editUser.notifMessages) !== null && _editUser_notifMessages !== void 0 ? _editUser_notifMessages : true, onChange: (e)=>setEditUser((u)=>({ ...u, notifMessages: e.target.checked })), className: "w-4 h-4 rounded border-gray-300 text-green-600" }) ] }) ] }) }), editUserTab === 'site' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.user_edit.personal_site_slug') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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/" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: (_editUser_personalSiteSlug = editUser.personalSiteSlug) !== null && _editUser_personalSiteSlug !== void 0 ? _editUser_personalSiteSlug : '', onChange: (e)=>setEditUser((u)=>({ ...u, personalSiteSlug: e.target.value || null })), placeholder: "my-username", className: "flex-1 px-3 py-2 text-sm focus:outline-none" }) ] }), editUser.personalSiteSlug && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("a", { href: "/site/".concat(editUser.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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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" }) }) }) ] }) ] }), editUser.personalSiteSlug && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h4", { className: "text-sm font-semibold text-gray-800 pt-3 border-t border-gray-100", children: t('profile.site.visible_title') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "space-y-1", children: [ { key: 'showBio', label: t('profile.site.visible.bio') }, { key: 'showRating', label: t('profile.site.visible.rating') }, { key: 'showServices', label: t('profile.site.visible.services') }, { key: 'showPortfolio', label: t('profile.site.visible.portfolio') }, { key: 'showReviews', label: t('profile.site.visible.reviews') }, { key: 'showPhone', label: t('profile.site.visible.contacts') }, { key: 'showFullLastName', label: t('profile.site.visible.full_last_name') }, { key: 'showStatus', label: t('profile.site.visible.status') } ].map((item)=>{ var _editUser_siteSettings; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "flex items-center justify-between cursor-pointer py-1.5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-sm text-gray-700", children: item.label }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "checkbox", checked: ((_editUser_siteSettings = editUser.siteSettings) !== null && _editUser_siteSettings !== void 0 ? _editUser_siteSettings : {})[item.key] !== false, onChange: (e)=>setEditUser((u)=>{ var _u_siteSettings; return { ...u, siteSettings: { ...(_u_siteSettings = u.siteSettings) !== null && _u_siteSettings !== void 0 ? _u_siteSettings : {}, [item.key]: e.target.checked } }; }), className: "w-4 h-4 rounded border-gray-300 text-green-600" }) ] }, item.key); }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "pt-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1.5", children: t('profile.site.theme') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("select", { value: (_siteTheme = ((_editUser_siteSettings = editUser.siteSettings) !== null && _editUser_siteSettings !== void 0 ? _editUser_siteSettings : {}).siteTheme) !== null && _siteTheme !== void 0 ? _siteTheme : 'dark', onChange: (e)=>setEditUser((u)=>{ var _u_siteSettings; return { ...u, siteSettings: { ...(_u_siteSettings = u.siteSettings) !== null && _u_siteSettings !== void 0 ? _u_siteSettings : {}, siteTheme: e.target.value } }; }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "dark", children: t('profile.site.theme.dark') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "light", children: t('profile.site.theme.light') }) ] }) ] }) ] }) ] }), editUserTab === 'specialist' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-6", children: [ (()=>{ if ((editUser === null || editUser === void 0 ? void 0 : editUser.role) === 'specialist') return null; var _editUser_bio; const bio = String((_editUser_bio = editUser === null || editUser === void 0 ? void 0 : editUser.bio) !== null && _editUser_bio !== void 0 ? _editUser_bio : '').trim(); const publishedCards = (editUserCards !== null && editUserCards !== void 0 ? editUserCards : []).filter((c)=>{ var _c_publicationStatus; return ((_c_publicationStatus = c.publicationStatus) !== null && _c_publicationStatus !== void 0 ? _c_publicationStatus : c.isActive ? 'active' : 'inactive') === 'active'; }); const hasPublishedCard = publishedCards.length > 0; const hasCategories = publishedCards.some((c)=>{ var _c_categories; var _c_categories_length; return ((_c_categories_length = (_c_categories = c.categories) === null || _c_categories === void 0 ? void 0 : _c_categories.length) !== null && _c_categories_length !== void 0 ? _c_categories_length : 0) > 0; }); const hasLocations = publishedCards.some((c)=>{ var _c_locations; var _c_locations_length; return ((_c_locations_length = (_c_locations = c.locations) === null || _c_locations === void 0 ? void 0 : _c_locations.length) !== null && _c_locations_length !== void 0 ? _c_locations_length : 0) > 0; }); const missing = []; if (!bio) missing.push(t('admin.user_edit.visibility_requirements.bio', 'Fill in bio')); if (!hasPublishedCard) missing.push(t('admin.user_edit.visibility_requirements.published_card', 'Publish at least one card')); if (!hasCategories) missing.push(t('admin.user_edit.visibility_requirements.categories', 'Add a category in a published card')); if (!hasLocations) missing.push(t('admin.user_edit.visibility_requirements.locations', 'Add a location in a published card')); if (missing.length === 0) return null; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "rounded-xl border border-amber-300 bg-amber-50 p-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm font-semibold text-amber-900", children: t('admin.user_edit.visibility_requirements.title', 'Profile is not yet visible in Offers') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-amber-800 mt-1", children: t('admin.user_edit.visibility_requirements.hint', 'Visibility requirements to complete:') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("ul", { className: "mt-2 text-xs text-amber-900 list-disc pl-5 space-y-0.5", children: missing.map((m)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("li", { children: m }, m)) }) ] }); })(), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: t('admin.user_edit.skills') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex flex-wrap gap-1.5 mb-2 min-h-[28px]", children: ((_editUser_skills = editUser.skills) !== null && _editUser_skills !== void 0 ? _editUser_skills : []).map((s)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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, /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>setEditUser((u)=>{ var _u_skills; return { ...u, skills: ((_u_skills = u.skills) !== null && _u_skills !== void 0 ? _u_skills : []).filter((x)=>x !== s) }; }), className: "text-gray-400 hover:text-green-700 leading-none", children: "\xd7" }) ] }, s)) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: skillInput, onChange: (e)=>setSkillInput(e.target.value), onKeyDown: (e)=>{ if ((e.key === 'Enter' || e.key === ',') && skillInput.trim()) { e.preventDefault(); const val = skillInput.trim().replace(/,$/, ''); var _editUser_skills; if (val && !((_editUser_skills = editUser.skills) !== null && _editUser_skills !== void 0 ? _editUser_skills : []).includes(val)) { setEditUser((u)=>{ var _u_skills; return { ...u, skills: [ ...(_u_skills = u.skills) !== null && _u_skills !== void 0 ? _u_skills : [], val ] }; }); } setSkillInput(''); } }, placeholder: t('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" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>{ const val = skillInput.trim(); var _editUser_skills; if (val && !((_editUser_skills = editUser.skills) !== null && _editUser_skills !== void 0 ? _editUser_skills : []).includes(val)) { setEditUser((u)=>{ var _u_skills; return { ...u, skills: [ ...(_u_skills = u.skills) !== null && _u_skills !== void 0 ? _u_skills : [], val ] }; }); } setSkillInput(''); }, className: "px-3 py-2 bg-green-600 text-white rounded-lg text-sm hover:bg-green-700", children: t('common.add') }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "border-t border-gray-100 pt-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-sm font-medium text-gray-700 mb-3", children: t('admin.user_edit.specialist_cards') }), editUserCardsLoading ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400 py-2", children: t('common.loading') }) : editUserCards.length === 0 ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400 py-4 text-center", children: t('admin.user_edit.no_cards') }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "space-y-4", children: editUserCards.map((card)=>{ var _card_title, _card_description, _card_skills, _cardSkillInputs_card_id, _card_categories, _card_categories1, _card_locations, _card_locations1; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "border border-gray-200 bg-gray-50 rounded-xl p-4 space-y-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: (_card_title = card.title) !== null && _card_title !== void 0 ? _card_title : '', onChange: (e)=>setEditUserCards((prev)=>prev.map((c)=>c.id === card.id ? { ...c, title: e.target.value } : c)), placeholder: t('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" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "flex items-center gap-1.5 cursor-pointer flex-shrink-0", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "checkbox", checked: card.isActive !== false, onChange: (e)=>setEditUserCards((prev)=>prev.map((c)=>c.id === card.id ? { ...c, isActive: e.target.checked } : c)), className: "w-4 h-4 rounded border-gray-300 text-green-600" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-xs text-gray-600", children: t('admin.user_edit.published') }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("textarea", { value: (_card_description = card.description) !== null && _card_description !== void 0 ? _card_description : '', onChange: (e)=>setEditUserCards((prev)=>prev.map((c)=>c.id === card.id ? { ...c, description: e.target.value } : c)), rows: 3, placeholder: t('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" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-xs font-medium text-gray-500 mb-1.5", children: t('admin.user_edit.skills') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex flex-wrap gap-1.5 mb-1.5 min-h-[24px]", children: ((_card_skills = card.skills) !== null && _card_skills !== void 0 ? _card_skills : []).map((s)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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, /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>setEditUserCards((prev)=>prev.map((c)=>{ var _c_skills; return c.id === card.id ? { ...c, skills: ((_c_skills = c.skills) !== null && _c_skills !== void 0 ? _c_skills : []).filter((x)=>x !== s) } : c; })), className: "text-gray-400 hover:text-green-700 leading-none", children: "\xd7" }) ] }, s)) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: (_cardSkillInputs_card_id = cardSkillInputs[card.id]) !== null && _cardSkillInputs_card_id !== void 0 ? _cardSkillInputs_card_id : '', onChange: (e)=>setCardSkillInputs((prev)=>({ ...prev, [card.id]: e.target.value })), onKeyDown: (e)=>{ var _cardSkillInputs_card_id; if ((e.key === 'Enter' || e.key === ',') && ((_cardSkillInputs_card_id = cardSkillInputs[card.id]) !== null && _cardSkillInputs_card_id !== void 0 ? _cardSkillInputs_card_id : '').trim()) { e.preventDefault(); var _cardSkillInputs_card_id1; const val = ((_cardSkillInputs_card_id1 = cardSkillInputs[card.id]) !== null && _cardSkillInputs_card_id1 !== void 0 ? _cardSkillInputs_card_id1 : '').trim().replace(/,$/, ''); var _card_skills; if (val && !((_card_skills = card.skills) !== null && _card_skills !== void 0 ? _card_skills : []).includes(val)) { setEditUserCards((prev)=>prev.map((c)=>{ var _c_skills; return c.id === card.id ? { ...c, skills: [ ...(_c_skills = c.skills) !== null && _c_skills !== void 0 ? _c_skills : [], val ] } : c; })); } setCardSkillInputs((prev)=>({ ...prev, [card.id]: '' })); } }, placeholder: t('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" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>{ var _cardSkillInputs_card_id; const val = ((_cardSkillInputs_card_id = cardSkillInputs[card.id]) !== null && _cardSkillInputs_card_id !== void 0 ? _cardSkillInputs_card_id : '').trim(); var _card_skills; if (val && !((_card_skills = card.skills) !== null && _card_skills !== void 0 ? _card_skills : []).includes(val)) { setEditUserCards((prev)=>prev.map((c)=>{ var _c_skills; return c.id === card.id ? { ...c, skills: [ ...(_c_skills = c.skills) !== null && _c_skills !== void 0 ? _c_skills : [], val ] } : c; })); } setCardSkillInputs((prev)=>({ ...prev, [card.id]: '' })); }, className: "px-2.5 py-1.5 bg-green-600 text-white rounded-lg text-xs hover:bg-green-700", children: "+" }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-xs font-medium text-gray-500 mb-1.5", children: t('admin.user_edit.categories') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex flex-wrap gap-1.5 mb-1.5 min-h-[24px]", children: ((_card_categories = card.categories) !== null && _card_categories !== void 0 ? _card_categories : []).map((slug)=>{ var _catRows_find; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: [ getCatLabel((_catRows_find = catRows.find((c)=>c.slug === slug)) !== null && _catRows_find !== void 0 ? _catRows_find : { slug }, locale), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>setEditUserCards((prev)=>prev.map((c)=>{ var _c_categories; return c.id === card.id ? { ...c, categories: ((_c_categories = c.categories) !== null && _c_categories !== void 0 ? _c_categories : []).filter((x)=>x !== slug) } : c; })), className: "text-purple-400 hover:text-purple-700 leading-none", children: "\xd7" }) ] }, slug); }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(AdminCatPicker, { catRows: catRows, locale: locale, selected: (_card_categories1 = card.categories) !== null && _card_categories1 !== void 0 ? _card_categories1 : [], onAdd: (id)=>setEditUserCards((prev)=>prev.map((c)=>{ var _c_categories; return c.id === card.id ? { ...c, categories: [ ...(_c_categories = c.categories) !== null && _c_categories !== void 0 ? _c_categories : [], id ] } : c; })), addLabel: t('admin.user_edit.add_category') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-xs font-medium text-gray-500 mb-1.5", children: t('admin.user_edit.locations') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex flex-wrap gap-1.5 mb-1.5 min-h-[24px]", children: ((_card_locations = card.locations) !== null && _card_locations !== void 0 ? _card_locations : []).map((slug)=>{ var _locRows_find; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: [ getLocLabel((_locRows_find = locRows.find((l)=>l.slug === slug)) !== null && _locRows_find !== void 0 ? _locRows_find : { slug }, locale), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>setEditUserCards((prev)=>prev.map((c)=>{ var _c_locations; return c.id === card.id ? { ...c, locations: ((_c_locations = c.locations) !== null && _c_locations !== void 0 ? _c_locations : []).filter((x)=>x !== slug) } : c; })), className: "text-green-400 hover:text-green-700 leading-none", children: "\xd7" }) ] }, slug); }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(AdminLocPicker, { locRows: locRows, locale: locale, selected: (_card_locations1 = card.locations) !== null && _card_locations1 !== void 0 ? _card_locations1 : [], onAdd: (id)=>setEditUserCards((prev)=>prev.map((c)=>{ var _c_locations; return c.id === card.id ? { ...c, locations: [ ...(_c_locations = c.locations) !== null && _c_locations !== void 0 ? _c_locations : [], id ] } : c; })), addLabel: t('admin.user_edit.add_location') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex justify-end pt-1", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>saveCard(card.id), disabled: cardSaving[card.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: cardSaving[card.id] ? '...' : t('common.save') }) }) ] }, card.id); }) }) ] }) ] }) ] }) ] }), editUserTab !== 'balance' ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "border-t border-gray-100 px-6 py-4 flex gap-3 flex-shrink-0", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: saveEditUser, disabled: editUserSaving, className: "flex-1 bg-green-600 hover:bg-green-700 text-white py-2 rounded-lg text-sm font-semibold disabled:opacity-50", children: editUserSaving ? '...' : t('common.save') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>setEditUser(null), className: "flex-1 bg-gray-100 hover:bg-gray-200 text-gray-700 py-2 rounded-lg text-sm font-medium", children: t('common.cancel') }) ] }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "border-t border-gray-100 px-6 py-4 flex-shrink-0", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>setEditUser(null), className: "w-full bg-gray-100 hover:bg-gray-200 text-gray-700 py-2 rounded-lg text-sm font-medium", children: t('common.close') }) }) ] }) }), editUser && balanceModal && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "fixed inset-0 z-[60] flex items-center justify-center bg-black/40 px-4", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-2xl shadow-2xl p-6 w-full max-w-sm border-t-4 ".concat(balanceModal === 'topup' ? 'border-emerald-500' : 'border-rose-500'), children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-between mb-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h3", { className: "text-base font-semibold ".concat(balanceModal === 'topup' ? 'text-emerald-900' : 'text-rose-900'), children: balanceModal === 'topup' ? t('admin.balance.topup.title') : t('admin.balance.withdraw.title') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>setBalanceModal(null), className: "text-gray-400 hover:text-gray-600 text-2xl leading-none", children: "\xd7" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { className: "text-xs text-gray-500 mb-4", children: [ t('admin.user_edit.balance'), ": ", /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "font-semibold text-gray-700", children: [ Number((_editUser_balance1 = editUser.balance) !== null && _editUser_balance1 !== void 0 ? _editUser_balance1 : 0).toFixed(2), " EUR" ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium mb-1 ".concat(balanceModal === 'topup' ? 'text-emerald-800' : 'text-rose-800'), children: balanceModal === 'topup' ? t('admin.balance.topup.amount') : t('admin.balance.withdraw.amount') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "number", min: "0.01", step: "0.01", value: balanceModal === 'topup' ? (_editUser_topUpAmount = editUser.topUpAmount) !== null && _editUser_topUpAmount !== void 0 ? _editUser_topUpAmount : '' : (_editUser_withdrawAmount = editUser.withdrawAmount) !== null && _editUser_withdrawAmount !== void 0 ? _editUser_withdrawAmount : '', onChange: (e)=>setEditUser((u)=>balanceModal === 'topup' ? { ...u, topUpAmount: e.target.value } : { ...u, withdrawAmount: e.target.value }), className: "w-full border rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 ".concat(balanceModal === 'topup' ? 'border-emerald-300 focus:ring-emerald-400' : 'border-rose-300 focus:ring-rose-400') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium mb-1 ".concat(balanceModal === 'topup' ? 'text-emerald-800' : 'text-rose-800'), children: balanceModal === 'topup' ? t('admin.balance.topup.description') : t('admin.balance.withdraw.description') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: balanceModal === 'topup' ? (_editUser_topUpDescription = editUser.topUpDescription) !== null && _editUser_topUpDescription !== void 0 ? _editUser_topUpDescription : '' : (_editUser_withdrawDescription = editUser.withdrawDescription) !== null && _editUser_withdrawDescription !== void 0 ? _editUser_withdrawDescription : '', onChange: (e)=>setEditUser((u)=>balanceModal === 'topup' ? { ...u, topUpDescription: e.target.value } : { ...u, withdrawDescription: e.target.value }), placeholder: balanceModal === 'topup' ? t('admin.balance.topup.description.placeholder') : t('admin.balance.withdraw.description.placeholder'), className: "w-full border rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 ".concat(balanceModal === 'topup' ? 'border-emerald-300 focus:ring-emerald-400' : 'border-rose-300 focus:ring-rose-400') }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-2 mt-5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: async ()=>{ if (balanceModal === 'topup') { await handleAdminTopUp(); } else { await handleAdminWithdraw(); } setBalanceModal(null); }, disabled: balanceModal === 'topup' ? topUpSaving || !Number(editUser.topUpAmount) : withdrawSaving || !Number(editUser.withdrawAmount), className: "flex-1 text-white py-2 rounded-lg text-sm font-semibold disabled:opacity-50 ".concat(balanceModal === 'topup' ? 'bg-emerald-600 hover:bg-emerald-700' : 'bg-rose-600 hover:bg-rose-700'), children: (balanceModal === 'topup' ? topUpSaving : withdrawSaving) ? t('common.loading') : balanceModal === 'topup' ? t('admin.balance.topup.submit') : t('admin.balance.withdraw.submit') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>setBalanceModal(null), className: "flex-1 bg-gray-100 hover:bg-gray-200 text-gray-700 py-2 rounded-lg text-sm font-medium", children: t('common.cancel') }) ] }) ] }) }) ] }) ] }) ] }) }); } // ─── DbCheckTab ───────────────────────────────────────────────────────────── function DbCheckTab() { // ── Skill duplicates ────────────────────────────────────────────────────── const [dedupLoading, setDedupLoading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [dedupGroups, setDedupGroups] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [keepIds, setKeepIds] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)({}); const [merging, setMerging] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); function gk(group) { var _group__nameEl, _group_, _group_1; var _group__nameEl_toLowerCase_trim; return (_group__nameEl_toLowerCase_trim = (_group_ = group[0]) === null || _group_ === void 0 ? void 0 : (_group__nameEl = _group_.nameEl) === null || _group__nameEl === void 0 ? void 0 : _group__nameEl.toLowerCase().trim()) !== null && _group__nameEl_toLowerCase_trim !== void 0 ? _group__nameEl_toLowerCase_trim : (_group_1 = group[0]) === null || _group_1 === void 0 ? void 0 : _group_1.id; } async function findDuplicates() { setDedupLoading(true); setDedupGroups(null); setKeepIds({}); try { const groups = await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getSkillDedup */ .GE() // all categories ; setDedupGroups(groups); const auto = {}; groups.forEach((group)=>{ const best = [ ...group ].sort((a, b)=>{ var _b_usageCount, _a_usageCount; return ((_b_usageCount = b.usageCount) !== null && _b_usageCount !== void 0 ? _b_usageCount : 0) - ((_a_usageCount = a.usageCount) !== null && _a_usageCount !== void 0 ? _a_usageCount : 0); })[0]; auto[gk(group)] = best.id; }); setKeepIds(auto); } catch (e) { setDedupGroups([]); } finally{ setDedupLoading(false); } } async function mergeGroup(key, group) { const keepId = keepIds[key]; if (!keepId) return; const deleteIds = group.filter((s)=>s.id !== keepId).map((s)=>s.id); if (!deleteIds.length) return; setMerging(key); try { await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .mergeSkillDuplicates */ .Uq(keepId, deleteIds); setDedupGroups((prev)=>prev ? prev.filter((g)=>gk(g) !== key) : prev); } catch (e) {} finally{ setMerging(null); } } async function mergeAll() { if (!(dedupGroups === null || dedupGroups === void 0 ? void 0 : dedupGroups.length)) return; setMerging('__all__'); for (const group of [ ...dedupGroups ]){ const key = gk(group); const keepId = keepIds[key]; if (!keepId) continue; const deleteIds = group.filter((s)=>s.id !== keepId).map((s)=>s.id); if (!deleteIds.length) continue; try { await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .mergeSkillDuplicates */ .Uq(keepId, deleteIds); setDedupGroups((prev)=>prev ? prev.filter((g)=>gk(g) !== key) : prev); } catch (e) {} } setMerging(null); } var _dedupGroups_reduce; const totalDuplicates = (_dedupGroups_reduce = dedupGroups === null || dedupGroups === void 0 ? void 0 : dedupGroups.reduce((acc, g)=>acc + g.length - 1, 0)) !== null && _dedupGroups_reduce !== void 0 ? _dedupGroups_reduce : 0; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "text-base font-semibold text-gray-900", children: "ПрПверка базы ЎаММых" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-gray-500 mt-0.5", children: "ДОагМПстОка О ОсправлеМОе прПблеЌ в базе ЎаММых" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 overflow-hidden", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "px-5 py-4 border-b border-gray-100 flex items-center justify-between", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h3", { className: "text-sm font-semibold text-gray-800", children: "ДублОкаты МавыкПв" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400 mt-0.5", children: "ППОск МавыкПв с ПЎОМакПвыЌ ОЌеМеЌ в ПЎМПй категПрОО. ПрО ПбъеЎОМеМОО — ссылкО в картПчках спецОалОстПв ПбМПвляются автПЌатОческО." }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { onClick: findDuplicates, disabled: dedupLoading, 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: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("circle", { cx: "11", cy: "11", r: "8" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M21 21l-4.35-4.35" }) ] }), dedupLoading ? 'Ищу ' : 'НайтО ЎублОкаты' ] }) ] }), dedupGroups !== null && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "p-5", children: dedupGroups.length === 0 ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" }) }), "ДублОкатПв Ме МайЎеМП — база в пПряЎке" ] }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-between", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { className: "text-sm text-green-700 font-semibold", children: [ "НайЎеМП ", dedupGroups.length, " групп \xb7 ", totalDuplicates, " лОшМОх запОсей" ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: mergeAll, disabled: merging === '__all__', 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: merging === '__all__' ? 'ОбъеЎОМяю ' : "ОбъеЎОМОть все (".concat(dedupGroups.length, ")") }) ] }), dedupGroups.map((group)=>{ var _group_, _group_1; const key = gk(group); return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white border border-orange-200 rounded-xl overflow-hidden shadow-sm", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "px-4 py-2.5 bg-orange-50 border-b border-orange-100 flex items-center justify-between gap-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "min-w-0", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "text-sm font-semibold text-orange-800", children: [ "\xab", (_group_ = group[0]) === null || _group_ === void 0 ? void 0 : _group_.nameEl, "\xbb" ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "ml-2 text-xs text-green-600 font-mono", children: (_group_1 = group[0]) === null || _group_1 === void 0 ? void 0 : _group_1.categorySlug }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "ml-2 text-xs text-orange-400", children: [ group.length, " варОаМта" ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>mergeGroup(key, group), disabled: !!merging, 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: merging === key ? 'ОбъеЎОМяю ' : 'ОбъеЎОМОть' }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "divide-y divide-gray-50", children: group.map((skill)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "flex items-center gap-3 px-4 py-2.5 cursor-pointer hover:bg-gray-50 transition", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "radio", name: "dedup-global-".concat(key), checked: keepIds[key] === skill.id, onChange: ()=>setKeepIds((prev)=>({ ...prev, [key]: skill.id })), className: "accent-amber-600 shrink-0" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-3 flex-wrap", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-sm font-medium text-gray-800", children: skill.nameEl }), skill.nameEn && skill.nameEn !== skill.nameEl && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "text-xs text-gray-400", children: [ "EN: ", skill.nameEn ] }), skill.nameRu && skill.nameRu !== skill.nameEl && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "text-xs text-gray-400", children: [ "RU: ", skill.nameRu ] }), skill.nameUk && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "text-xs text-gray-400", children: [ "UK: ", skill.nameUk ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-3 mt-0.5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-[11px] font-semibold ".concat(skill.usageCount > 0 ? 'text-green-600' : 'text-gray-400'), children: skill.usageCount > 0 ? "".concat(skill.usageCount, " ОспПльзПваМОй") : 'Ме ОспПльзПвался' }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "text-[11px] text-gray-300", children: [ "order: ", skill.order ] }), keepIds[key] === skill.id && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-[11px] font-bold text-amber-600 uppercase", children: "← ПставОть" }) ] }) ] }) ] }, skill.id)) }) ] }, key); }) ] }) }) ] }) ] }); } function LocTree(param) { let { rows, parentId, depth, locale, expanded, onToggle, onEdit, onDelete, onAddChild, t } = param; const children = rows.filter((r)=>{ var _r_parentId; return ((_r_parentId = r.parentId) !== null && _r_parentId !== void 0 ? _r_parentId : null) === parentId; }); if (children.length === 0) return null; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: children.sort((a, b)=>{ var _a_order, _b_order; return ((_a_order = a.order) !== null && _a_order !== void 0 ? _a_order : 0) - ((_b_order = b.order) !== null && _b_order !== void 0 ? _b_order : 0); }).map((loc)=>{ const hasChildren = rows.some((r)=>r.parentId === loc.id); const isOpen = expanded.has(loc.id); const name = (locale === 'en' ? loc.nameEn : locale === 'ru' ? loc.nameRu : locale === 'uk' ? loc.nameUk : loc.nameEl) || loc.nameEl || loc.slug; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-2 px-4 py-3 hover:bg-gray-50 ".concat(!loc.isActive ? 'opacity-50' : ''), style: { paddingLeft: "".concat(16 + depth * 24, "px") }, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>hasChildren && onToggle(loc.id), className: "w-5 h-5 flex items-center justify-center text-gray-400 rounded ".concat(hasChildren ? 'hover:bg-gray-200 cursor-pointer' : 'cursor-default'), children: hasChildren ? isOpen ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("polyline", { points: "6 9 12 15 18 9" }) }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("polyline", { points: "9 18 15 12 9 6" }) }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "w-3.5 h-3.5 block" }) }), depth === 0 ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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" }) }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 11a3 3 0 11-6 0 3 3 0 016 0z" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "font-medium text-gray-800 text-sm", children: name }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "ml-2 text-xs text-gray-400", children: loc.nameEn }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "ml-1.5 font-mono text-xs text-gray-300", children: [ "/", loc.slug ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "px-2 py-0.5 rounded-full text-xs font-medium ".concat(loc.isActive ? 'bg-green-100 text-green-700' : 'bg-gray-100 text-gray-500'), children: loc.isActive ? t('admin.cat.active') : t('admin.cat.inactive') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-1 flex-shrink-0", children: [ depth === 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>onAddChild(loc.id), className: "text-xs px-2 py-1 rounded-lg bg-green-50 text-green-600 hover:bg-green-100 font-medium", title: t('admin.loc.add_district'), children: "+" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>onEdit(loc), className: "text-xs px-2 py-1 rounded-lg bg-gray-100 text-gray-600 hover:bg-gray-200 font-medium", children: t('common.edit') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>onDelete(loc.id, name), className: "text-xs px-2 py-1 rounded-lg bg-red-50 text-red-600 hover:bg-red-100 font-medium", children: t('common.delete') }) ] }) ] }), hasChildren && isOpen && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(LocTree, { rows: rows, parentId: loc.id, depth: depth + 1, locale: locale, expanded: expanded, onToggle: onToggle, onEdit: onEdit, onDelete: onDelete, onAddChild: onAddChild, t: t }) ] }, loc.id); }) }); } function CatTree(param) { let { rows, parentId, depth, locale, expanded, onToggle, onEdit, onDelete, onAddChild, skillsExpanded, skillsCache, skillsLoading, onToggleSkills, skillForm, skillSaving, onOpenAddSkill, onOpenEditSkill, onSaveSkill, onDeleteSkill, onCancelSkillForm, onSkillFormChange, t } = param; const children = rows.filter((r)=>{ var _r_parentId; return ((_r_parentId = r.parentId) !== null && _r_parentId !== void 0 ? _r_parentId : null) === parentId; }); if (children.length === 0) return null; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: children.sort((a, b)=>{ var _a_order, _b_order; return ((_a_order = a.order) !== null && _a_order !== void 0 ? _a_order : 0) - ((_b_order = b.order) !== null && _b_order !== void 0 ? _b_order : 0); }).map((cat)=>{ var _cat_names; const hasChildren = rows.some((r)=>r.parentId === cat.id); const isOpen = expanded.has(cat.id); const skillsOpen = skillsExpanded.has(cat.id); const isLoadingSkills = skillsLoading.has(cat.id); var _skillsCache_cat_slug; const skills = (_skillsCache_cat_slug = skillsCache[cat.slug]) !== null && _skillsCache_cat_slug !== void 0 ? _skillsCache_cat_slug : []; const name = (locale === 'en' ? cat.namesEn : locale === 'ru' ? cat.namesRu : locale === 'uk' ? cat.namesUk : cat.namesEl) || cat.namesEl || cat.slug; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-2 px-4 py-3 hover:bg-gray-50 ".concat(!cat.isActive ? 'opacity-50' : ''), style: { paddingLeft: "".concat(16 + depth * 24, "px") }, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>hasChildren && onToggle(cat.id), className: "w-5 h-5 flex items-center justify-center text-gray-400 rounded ".concat(hasChildren ? 'hover:bg-gray-200 cursor-pointer' : 'cursor-default'), children: hasChildren ? isOpen ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("polyline", { points: "6 9 12 15 18 9" }) }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("polyline", { points: "9 18 15 12 9 6" }) }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "w-3.5 h-3.5 block" }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "w-10 h-10 flex items-center justify-center rounded-xl bg-green-50", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components_CategoryIcon__WEBPACK_IMPORTED_MODULE_7__/* .CategoryIcon */ .Ez, { icon: cat.icon, alt: name, className: "h-7 w-7 object-contain text-2xl leading-none", fallback: "\uD83D\uDCE6" }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "font-medium text-gray-800 text-sm", children: name }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "ml-2 text-xs text-gray-400", children: cat.namesEn || ((_cat_names = cat.names) === null || _cat_names === void 0 ? void 0 : _cat_names.en) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "ml-1.5 font-mono text-xs text-gray-300", children: [ "/", cat.slug ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "px-2 py-0.5 rounded-full text-xs font-medium ".concat(cat.isActive ? 'bg-green-100 text-green-700' : 'bg-gray-100 text-gray-500'), children: cat.isActive ? t('admin.cat.active') : t('admin.cat.inactive') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-1 flex-shrink-0", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { onClick: ()=>onToggleSkills(cat), className: "text-xs px-2 py-1 rounded-lg font-medium flex items-center gap-1 ".concat(skillsOpen ? 'bg-amber-100 text-amber-700' : 'bg-amber-50 text-amber-600 hover:bg-amber-100'), title: "НавыкО", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3 h-3", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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" }) }), skillsCache[cat.slug] ? skillsCache[cat.slug].length : t('admin.cat.skills', 'Skills') ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>onAddChild(cat.id), className: "text-xs px-2 py-1 rounded-lg bg-green-50 text-green-600 hover:bg-green-100 font-medium", title: t('admin.cat.add_child'), children: "+" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>onEdit(cat), className: "text-xs px-2 py-1 rounded-lg bg-gray-100 text-gray-600 hover:bg-gray-200 font-medium", children: t('common.edit') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>onDelete(cat.id, name), className: "text-xs px-2 py-1 rounded-lg bg-red-50 text-red-600 hover:bg-red-100 font-medium", children: t('common.delete') }) ] }) ] }), skillsOpen && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(SkillsPanel, { cat: cat, locale: locale, depth: depth, t: t, skills: skills, isLoading: isLoadingSkills, skillForm: skillForm, skillSaving: skillSaving, onOpenAddSkill: onOpenAddSkill, onOpenEditSkill: onOpenEditSkill, onSaveSkill: onSaveSkill, onDeleteSkill: onDeleteSkill, onCancelSkillForm: onCancelSkillForm, onSkillFormChange: onSkillFormChange }), hasChildren && isOpen && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(CatTree, { rows: rows, parentId: cat.id, depth: depth + 1, locale: locale, expanded: expanded, onToggle: onToggle, onEdit: onEdit, onDelete: onDelete, onAddChild: onAddChild, skillsExpanded: skillsExpanded, skillsCache: skillsCache, skillsLoading: skillsLoading, onToggleSkills: onToggleSkills, skillForm: skillForm, skillSaving: skillSaving, onOpenAddSkill: onOpenAddSkill, onOpenEditSkill: onOpenEditSkill, onSaveSkill: onSaveSkill, onDeleteSkill: onDeleteSkill, onCancelSkillForm: onCancelSkillForm, onSkillFormChange: onSkillFormChange, t: t }) ] }, cat.id); }) }); } // ─── SkillsPanel ──────────────────────────────────────────────────────────── // Self-contained component for the skill list + edit form + dedup panel per category const SKILL_LANG_LABELS = { nameEl: '🇬🇷 EL', nameEn: '🇬🇧 EN', nameRu: '🇷🇺 RU', nameUk: '🇺🇊 UK' }; function SkillForm(param) { let { form, saving, onSave, onCancel, onChange } = param; var _form_nameEl; var _form_order; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white border border-amber-200 rounded-xl p-4 shadow-sm", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "grid grid-cols-2 gap-3 mb-3", children: [ 'nameEl', 'nameEn', 'nameRu', 'nameUk' ].map((field, i)=>{ var _form_field; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-[11px] font-semibold text-gray-500 mb-1 uppercase tracking-wide", children: SKILL_LANG_LABELS[field] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: (_form_field = form[field]) !== null && _form_field !== void 0 ? _form_field : '', onChange: (e)=>onChange({ ...form, [field]: e.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: i === 0, placeholder: field === 'nameUk' ? 'МеПбПвʌязкПвП' : '' }) ] }, field); }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-3 pt-1 border-t border-gray-100", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "text-xs text-gray-400 font-medium", children: "ППряЎПк" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "number", value: (_form_order = form.order) !== null && _form_order !== void 0 ? _form_order : 0, onChange: (e)=>onChange({ ...form, order: Number(e.target.value) }), className: "w-16 border border-gray-200 rounded-lg px-2 py-1 text-xs text-center" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-2 ml-auto", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: onCancel, className: "px-3 py-1.5 bg-gray-100 text-gray-600 rounded-lg text-xs font-medium hover:bg-gray-200 transition", children: "ОтЌеМа" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: onSave, disabled: saving || !((_form_nameEl = form.nameEl) === null || _form_nameEl === void 0 ? void 0 : _form_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: saving ? 'СПхраМяю ' : 'СПхраМОть' }) ] }) ] }) ] }); } function SkillsPanel(param) { let { cat, locale, depth, t, skills, isLoading, skillForm, skillSaving, onOpenAddSkill, onOpenEditSkill, onSaveSkill, onDeleteSkill, onCancelSkillForm, onSkillFormChange } = param; const showAddForm = (skillForm === null || skillForm === void 0 ? void 0 : skillForm.catSlug) === cat.slug && !(skillForm === null || skillForm === void 0 ? void 0 : skillForm.id); return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "border-t border-amber-100 bg-gradient-to-b from-amber-50/60 to-white", style: { paddingLeft: "".concat(16 + depth * 24 + 36, "px"), paddingRight: '16px', paddingTop: '14px', paddingBottom: '14px' }, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-2 mb-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-xs font-bold text-amber-700 uppercase tracking-wider", children: "НавыкО" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "text-xs text-amber-500 font-mono", children: [ "/", cat.slug ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "ml-1 text-xs text-amber-400", children: [ "(", skills.length, ")" ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "ml-auto", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { onClick: ()=>{ onCancelSkillForm(); onOpenAddSkill(cat.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: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-3 h-3", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: "12", y1: "5", x2: "12", y2: "19" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: "5", y1: "12", x2: "19", y2: "12" }) ] }), "ДПбавОть" ] }) }) ] }), isLoading ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-2 py-3 text-xs text-gray-400", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-3.5 h-3.5 animate-spin", fill: "none", viewBox: "0 0 24 24", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("circle", { cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4", className: "opacity-25" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { fill: "currentColor", d: "M4 12a8 8 0 018-8v8z", className: "opacity-75" }) ] }), "Загрузка " ] }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-1", children: [ skills.length === 0 && !showAddForm && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400 italic py-2", children: "НавыкО Ме ЎПбавлеМы" }), skills.map((skill)=>{ const isEditingThis = (skillForm === null || skillForm === void 0 ? void 0 : skillForm.id) === skill.id; const skillName = locale === 'en' ? skill.nameEn : locale === 'ru' ? skill.nameRu : locale === 'uk' ? skill.nameUk || skill.nameEn : skill.nameEl; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-2 rounded-lg px-3 py-2 group transition ".concat(isEditingThis ? 'bg-amber-50 border border-amber-200' : 'bg-white border border-gray-100 hover:border-amber-200 hover:bg-amber-50/30'), children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-sm font-medium text-gray-800", children: skillName }), locale !== 'en' && skill.nameEn && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "ml-2 text-xs text-gray-400", children: skill.nameEn }), locale !== 'ru' && skill.nameRu && skill.nameRu !== skill.nameEl && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "ml-1.5 text-xs text-gray-300", children: skill.nameRu }) ] }), skill.order > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "text-[10px] text-gray-300 font-mono", children: [ "#", skill.order ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-1 transition-opacity ".concat(isEditingThis ? 'opacity-100' : 'opacity-0 group-hover:opacity-100'), children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>isEditingThis ? onCancelSkillForm() : (onCancelSkillForm(), onOpenEditSkill(skill, cat.slug)), className: "text-xs px-2 py-0.5 rounded-md font-medium transition ".concat(isEditingThis ? 'bg-amber-100 text-amber-700' : 'bg-gray-100 text-gray-600 hover:bg-amber-100 hover:text-amber-700'), children: isEditingThis ? '✕' : t('common.edit') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>onDeleteSkill(skill, cat.slug), className: "text-xs px-2 py-0.5 rounded-md bg-red-50 text-red-600 hover:bg-red-100 transition", children: t('common.delete') }) ] }) ] }), isEditingThis && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "mt-1 mb-1 ml-0", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(SkillForm, { form: skillForm, saving: skillSaving, onSave: onSaveSkill, onCancel: onCancelSkillForm, onChange: onSkillFormChange }) }) ] }, skill.id); }), showAddForm && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "mt-2", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(SkillForm, { form: skillForm, saving: skillSaving, onSave: onSaveSkill, onCancel: onCancelSkillForm, onChange: onSkillFormChange }) }) ] }) ] }); } function Pagination(param) { let { page, total, limit, onChange, totalLabel } = param; const pages = Math.ceil(total / limit); if (pages <= 1) return null; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-between px-4 py-3 border-t border-gray-100 text-sm text-gray-500", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { children: [ totalLabel, ": ", total ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-1", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>onChange(page - 1), disabled: page === 1, className: "px-3 py-1 rounded-lg border border-gray-200 disabled:opacity-40 hover:bg-gray-50", children: "←" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "px-3 py-1", children: [ page, " / ", pages ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>onChange(page + 1), disabled: page >= pages, className: "px-3 py-1 rounded-lg border border-gray-200 disabled:opacity-40 hover:bg-gray-50", children: "→" }) ] }) ] }); } // ── Activity log helpers ────────────────────────────────────────────────── function parseLogDetails(details) { try { return details ? JSON.parse(details) : null; } catch (e) { return null; } } const EVENT_META = { 'user.login': { icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("circle", { cx: "12", cy: "12", r: "10" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("circle", { cx: "12", cy: "12", r: "10" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: "15", y1: "9", x2: "9", y2: "15" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("polyline", { points: "3 6 5 6 21 6" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: "18", y1: "6", x2: "6", y2: "18" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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 ActivityLogRow(param) { let { entry, dateLocale, onFilterUser, t } = param; var _EVENT_META_entry_event; const meta = (_EVENT_META_entry_event = EVENT_META[entry.event]) !== null && _EVENT_META_entry_event !== void 0 ? _EVENT_META_entry_event : { icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: entry.event, color: 'bg-gray-50 text-gray-700 border-gray-200' }; const details = parseLogDetails(entry.details); return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 px-4 py-3 flex items-start gap-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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 ".concat(meta.color), children: [ meta.icon, " ", t(meta.labelKey, meta.labelKey) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-2 flex-wrap", children: [ entry.userName && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>entry.userId && onFilterUser(entry.userId), className: "text-sm font-medium text-gray-800 hover:text-green-600", children: entry.userName }), entry.userEmail && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-xs text-gray-400", children: entry.userEmail }) ] }), details && Object.keys(details).length > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "mt-1 flex flex-wrap gap-2", children: Object.entries(details).map((param)=>{ let [k, v] = param; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "text-xs bg-gray-100 text-gray-600 px-2 py-0.5 rounded", children: [ k, ": ", /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "font-medium", children: String(v) }) ] }, k); }) }), entry.ipAddress && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400 mt-0.5", children: entry.ipAddress }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("time", { className: "shrink-0 text-xs text-gray-400 whitespace-nowrap", children: new Date(entry.createdAt).toLocaleString(dateLocale) }) ] }); } const MONTH_NAMES = (/* unused pure expression or super */ null && ([ 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec' ])); function AdminMonthChart(param) { let { series, dateLocale = 'en-US' } = param; // Collect all unique months from all series, sorted const monthSet = new Set(); series.forEach((s)=>s.data.forEach((r)=>monthSet.add(r.month))); const months = Array.from(monthSet).sort(); if (months.length === 0) return null; // Build lookup maps const seriesVals = series.map((s)=>{ const map = {}; s.data.forEach((r)=>{ map[r.month] = Number(r.count); }); return months.map((m)=>{ var _map_m; return (_map_m = map[m]) !== null && _map_m !== void 0 ? _map_m : 0; }); }); const allVals = seriesVals.flat(); const maxVal = Math.max(...allVals, 1); const W = 700; const H = 160; const padL = maxVal >= 1000000 ? 50 : maxVal >= 10000 ? 44 : maxVal >= 1000 ? 40 : 36; const padB = 24; const chartH = H - padB; const totalBars = months.length * series.length; const groupW = (W - padL - 8) / months.length; const barW = Math.max(4, Math.min(20, groupW / series.length - 2)); const yTicks = [ 0, Math.round(maxVal / 3), Math.round(maxVal * 2 / 3), maxVal ]; function barX(mi, si) { const groupStart = padL + mi * groupW + (groupW - series.length * (barW + 1)) / 2; return groupStart + si * (barW + 1); } function barHeight(v) { return v / maxVal * chartH; } return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "overflow-x-auto", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { viewBox: "0 0 ".concat(W, " ").concat(H + 14), className: "w-full", style: { minWidth: Math.max(360, months.length * 40) }, children: [ yTicks.map((v, i)=>{ const y = chartH - v / maxVal * chartH; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("g", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: padL, y1: y, x2: W - 4, y2: y, stroke: "#f3f4f6", strokeWidth: 1 }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("text", { x: padL - 5, y: y + 3.5, textAnchor: "end", fontSize: 9, fill: "#9ca3af", children: fmtYLabel(v) }) ] }, i); }), months.map((m, mi)=>series.map((s, si)=>{ const v = seriesVals[si][mi]; const bh = barHeight(v); const x = barX(mi, si); return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("rect", { x: x, y: chartH - bh, width: barW, height: bh, fill: s.color, opacity: 0.8, rx: 2 }, "bar-".concat(mi, "-").concat(si)); })), months.map((m, mi)=>{ const [yr, mo] = m.slice(0, 7).split('-').map(Number); const d = new Date(Date.UTC(yr, mo - 1, 2)); const label = new Intl.DateTimeFormat(dateLocale, { month: 'short' }).format(d) + (mi === 0 || mo === 1 ? " ".concat(yr) : ''); const cx = padL + mi * groupW + groupW / 2; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("text", { x: cx, y: H + 12, textAnchor: "middle", fontSize: 9, fill: "#9ca3af", children: label }, "xl-".concat(mi)); }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: padL, y1: chartH, x2: W - 4, y2: chartH, stroke: "#e5e7eb", strokeWidth: 1 }) ] }) }); } function getLast30Days() { const days = []; for(let i = 29; i >= 0; i--){ const d = new Date(Date.now() - i * 86400000); days.push(d.toISOString().slice(0, 10)); } return days; } function smoothPath(pts) { if (pts.length < 2) return ''; let d = "M ".concat(pts[0][0].toFixed(1), " ").concat(pts[0][1].toFixed(1)); for(let i = 1; i < pts.length; i++){ const cpx = ((pts[i - 1][0] + pts[i][0]) / 2).toFixed(1); d += " C ".concat(cpx, " ").concat(pts[i - 1][1].toFixed(1), " ").concat(cpx, " ").concat(pts[i][1].toFixed(1), " ").concat(pts[i][0].toFixed(1), " ").concat(pts[i][1].toFixed(1)); } return d; } function fmtYLabel(v) { if (v >= 1000000) return "".concat(+(v / 1000000).toFixed(1), "M"); if (v >= 1000) return "".concat(Math.round(v / 1000), "K"); return String(v); } function AdminAreaChart(param) { let { series, days: daysProp } = param; const days = daysProp !== null && daysProp !== void 0 ? daysProp : getLast30Days(); const seriesVals = series.map((s)=>{ const map = {}; s.data.forEach((r)=>{ map[r.day] = Number(r.count); }); return days.map((d)=>{ var _map_d; return (_map_d = map[d]) !== null && _map_d !== void 0 ? _map_d : 0; }); }); const allVals = seriesVals.flat(); const maxVal = Math.max(...allVals, 1); const W = 700; const H = 160; const padL = maxVal >= 10000 ? 44 : maxVal >= 1000 ? 40 : 36; const padB = 22; const chartW = W - padL - 4; const chartH = H - padB; const stepX = chartW / (days.length - 1); function pts(vals) { return vals.map((v, i)=>[ padL + i * stepX, chartH - v / maxVal * chartH ]); } function areaPath(vals) { const points = pts(vals); const line = smoothPath(points); if (!line) return ''; const lastX = points[points.length - 1][0].toFixed(1); return "".concat(line, " L ").concat(lastX, " ").concat(chartH.toFixed(1), " L ").concat(padL.toFixed(1), " ").concat(chartH.toFixed(1), " Z"); } // Y-axis: 4 labels (0, 1/3, 2/3, max) const yTicks = [ 0, Math.round(maxVal / 3), Math.round(maxVal * 2 / 3), maxVal ]; // X-axis: every 7 days + last const xTicks = days.map((d, i)=>({ i, label: d.slice(8) })).filter((_, i)=>i % 7 === 0 || i === days.length - 1); return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "overflow-x-auto", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { viewBox: "0 0 ".concat(W, " ").concat(H + 12), className: "w-full", style: { minWidth: 360 }, children: [ yTicks.map((v, i)=>{ const y = chartH - v / maxVal * chartH; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("g", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: padL, y1: y, x2: W - 4, y2: y, stroke: "#f3f4f6", strokeWidth: 1 }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("text", { x: padL - 5, y: y + 3.5, textAnchor: "end", fontSize: 9, fill: "#9ca3af", children: fmtYLabel(v) }) ] }, i); }), xTicks.map((param)=>{ let { i } = param; const x = padL + i * stepX; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: x, y1: 0, x2: x, y2: chartH, stroke: "#f9fafb", strokeWidth: 1 }, "vg-".concat(i)); }), xTicks.map((param)=>{ let { i, label } = param; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("text", { x: padL + i * stepX, y: H + 10, textAnchor: "middle", fontSize: 9, fill: "#9ca3af", children: label }, i); }), series.map((s, si)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: areaPath(seriesVals[si]), fill: s.fill }, "fill-".concat(si))), series.map((s, si)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: smoothPath(pts(seriesVals[si])), fill: "none", stroke: s.color, strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round" }, "line-".concat(si))), series.map((s, si)=>{ const points = pts(seriesVals[si]); const last = points[points.length - 1]; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("g", { children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("circle", { cx: last[0], cy: last[1], r: 4, fill: "white", stroke: s.color, strokeWidth: 2 }) }, "dot-".concat(si)); }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: padL, y1: chartH, x2: W - 4, y2: chartH, stroke: "#e5e7eb", strokeWidth: 1 }) ] }) }); } /***/ }) ËÎ  ÏÐÏ+__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ AdminPage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7541); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(9664); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(next_link__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(1592); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(9906); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(2982); /* harmony import */ var _lib_formatName__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(1258); /* harmony import */ var _lib_taskLocale__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(4017); /* harmony import */ var _components_CategoryIcon__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(5940); ÑÞ;/* __next_internal_client_entry_do_not_use__ default auto */ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime"; import { useState, useEffect, useRef } from 'react'; import { useRouter } from 'next/navigation'; import Link from 'next/link'; import { useSession } from '@/lib/auth'; import { useLocale } from '@/context/locale'; import * as api from '@/lib/api'; import { request } from '@/lib/api'; import { formatShortName } from '@/lib/formatName'; import { formatPrice } from '@/lib/taskLocale'; import { CategoryIcon } from '@/components/CategoryIcon'; const TEMPLATE_VARS = { 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' ] }; const TEMPLATE_HINT_VARS = Array.from(new Set(Object.values(TEMPLATE_VARS).flat())); const DEFAULT_CATEGORY_ICON_PRESETS = [ { 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 getCatLabel(row, locale) { if (!row) return ''; if (locale === 'en') return row.namesEn || row.namesEl || row.slug || ''; if (locale === 'ru') return row.namesRu || row.namesEl || row.slug || ''; if (locale === 'uk') return row.namesUk || row.namesEl || row.slug || ''; return row.namesEl || row.namesEn || row.slug || ''; } function getLocLabel(row, locale) { if (!row) return ''; if (locale === 'en') return row.nameEn || row.nameEl || row.slug || ''; if (locale === 'ru') return row.nameRu || row.nameEl || row.slug || ''; if (locale === 'uk') return row.nameUk || row.nameEl || row.slug || ''; return row.nameEl || row.nameEn || row.slug || ''; } function CategoryIconPicker(param) { let { value, onChange, onUpload, uploading, error, presets } = param; return /*#__PURE__*/ _jsxs("div", { className: "space-y-2", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 rounded-xl border border-gray-200 bg-white px-3 py-2", children: [ /*#__PURE__*/ _jsx("div", { className: "flex h-12 w-12 items-center justify-center rounded-lg bg-green-50", children: /*#__PURE__*/ _jsx(CategoryIcon, { icon: value, alt: "category icon", className: "h-9 w-9 object-contain text-3xl leading-none", fallback: "\uD83D\uDCE6" }) }), /*#__PURE__*/ _jsx("input", { value: value, onChange: (e)=>onChange(e.target.value), className: "flex-1 border-0 bg-transparent p-0 text-sm outline-none ring-0", placeholder: "/category-icons/package.svg" }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2", children: [ /*#__PURE__*/ _jsxs("label", { className: "inline-flex cursor-pointer items-center rounded-lg border px-3 py-1.5 text-xs font-medium transition ".concat(uploading ? 'border-gray-200 bg-gray-100 text-gray-400' : 'border-green-300 bg-green-50 text-green-700 hover:bg-green-100'), children: [ uploading ? 'Uploading...' : 'Upload SVG', /*#__PURE__*/ _jsx("input", { type: "file", accept: ".svg,image/svg+xml", className: "hidden", disabled: uploading, onChange: async (e)=>{ var _e_target_files; const file = (_e_target_files = e.target.files) === null || _e_target_files === void 0 ? void 0 : _e_target_files[0]; if (!file) return; await onUpload(file); e.target.value = ''; } }) ] }), /*#__PURE__*/ _jsx("span", { className: "text-xs text-gray-500", children: "or choose from presets" }) ] }), /*#__PURE__*/ _jsx("p", { className: "text-[11px] text-gray-500", children: "Preset source: /public/category-icons/presets.json" }), error ? /*#__PURE__*/ _jsx("p", { className: "text-xs text-red-600", children: error }) : null, /*#__PURE__*/ _jsx("div", { className: "grid grid-cols-2 gap-2 sm:grid-cols-3 lg:grid-cols-4", children: presets.map((preset)=>{ const active = value === preset.value; return /*#__PURE__*/ _jsxs("button", { type: "button", onClick: ()=>onChange(preset.value), className: "flex h-20 flex-col items-center justify-center gap-1 rounded-lg border px-2 transition ".concat(active ? 'border-green-500 bg-green-50 shadow-sm' : 'border-gray-200 bg-white hover:border-green-300 hover:bg-green-50'), "aria-label": preset.label, title: preset.label, children: [ /*#__PURE__*/ _jsx(CategoryIcon, { icon: preset.value, alt: preset.label, className: "h-8 w-8 object-contain text-3xl leading-none", fallback: "\uD83D\uDCE6" }), /*#__PURE__*/ _jsx("span", { className: "max-w-full truncate text-[11px] font-medium text-gray-600 leading-tight", children: preset.label }) ] }, preset.value); }) }) ] }); } function AdminCatPicker(param) { let { catRows, locale, selected, onAdd, addLabel } = param; const [open, setOpen] = useState(false); const [search, setSearch] = useState(''); const [expandedParent, setExpandedParent] = useState(null); const ref = useRef(null); useEffect(()=>{ function h(e) { if (ref.current && !ref.current.contains(e.target)) { setOpen(false); setSearch(''); } } document.addEventListener('mousedown', h); return ()=>document.removeEventListener('mousedown', h); }, []); const parents = catRows.filter((r)=>!r.parentId); const lowerSearch = search.toLowerCase(); const matchesSearch = (r)=>{ var _r_slug; return !search || getCatLabel(r, locale).toLowerCase().includes(lowerSearch) || ((_r_slug = r.slug) !== null && _r_slug !== void 0 ? _r_slug : '').toLowerCase().includes(lowerSearch); }; return /*#__PURE__*/ _jsxs("div", { className: "relative", ref: ref, children: [ /*#__PURE__*/ _jsxs("button", { type: "button", onClick: ()=>setOpen((v)=>!v), className: "w-full flex items-center gap-1.5 px-3 py-1.5 text-xs transition-colors ".concat(open ? '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: [ /*#__PURE__*/ _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: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4 6h16M4 10h16M4 14h16M4 18h16" }) }), /*#__PURE__*/ _jsx("span", { className: "flex-1 text-left truncate", children: addLabel }), /*#__PURE__*/ _jsx("svg", { className: "w-3 h-3 text-gray-400 shrink-0 transition-transform ".concat(open ? 'rotate-180' : ''), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19 9l-7 7-7-7" }) }) ] }), open && /*#__PURE__*/ _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: [ /*#__PURE__*/ _jsx("div", { className: "sticky top-0 bg-white px-3 py-2 border-b border-gray-100", children: /*#__PURE__*/ _jsx("input", { autoFocus: true, value: search, onChange: (e)=>setSearch(e.target.value), placeholder: "ППОск...", className: "w-full text-xs border border-gray-200 rounded-lg px-2.5 py-1.5 focus:outline-none focus:ring-2 focus:ring-blue-300" }) }), parents.map((parent)=>{ const children = catRows.filter((r)=>r.parentId === parent.id); const parentLabel = getCatLabel(parent, locale); const isExpanded = expandedParent === parent.id; const matchingChildren = children.filter((c)=>!selected.includes(c.slug) && matchesSearch(c)); const parentAvail = !selected.includes(parent.slug) && matchesSearch(parent); const hasChildren = children.length > 0; if (!parentAvail && matchingChildren.length === 0 && search) return null; return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _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: ()=>{ if (hasChildren && !search) { setExpandedParent(isExpanded ? null : parent.id); } else if (parentAvail) { onAdd(parent.slug); setOpen(false); setSearch(''); } }, children: [ parent.icon ? /*#__PURE__*/ _jsx(CategoryIcon, { icon: parent.icon, alt: parentLabel, className: "h-5 w-5 shrink-0 object-contain text-sm leading-none", fallback: "\uD83D\uDCE6" }) : null, /*#__PURE__*/ _jsx("span", { className: "flex-1 font-medium", children: parentLabel }), hasChildren && !search ? /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5 text-gray-400 shrink-0 transition-transform ".concat(isExpanded ? 'rotate-90' : ''), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 5l7 7-7 7" }) }) : null ] }), (isExpanded || !!search) && matchingChildren.map((child)=>/*#__PURE__*/ _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: ()=>{ onAdd(child.slug); setOpen(false); setSearch(''); }, children: [ /*#__PURE__*/ _jsx("span", { className: "w-1.5 h-1.5 rounded-full bg-gray-300 shrink-0" }), /*#__PURE__*/ _jsx("span", { className: "flex-1", children: getCatLabel(child, locale) }) ] }, child.id)) ] }, parent.id); }) ] }) ] }); } function AdminLocPicker(param) { let { locRows, locale, selected, onAdd, addLabel } = param; const [open, setOpen] = useState(false); const [search, setSearch] = useState(''); const [expandedCity, setExpandedCity] = useState(null); const ref = useRef(null); useEffect(()=>{ function h(e) { if (ref.current && !ref.current.contains(e.target)) { setOpen(false); setSearch(''); } } document.addEventListener('mousedown', h); return ()=>document.removeEventListener('mousedown', h); }, []); const cities = locRows.filter((r)=>!r.parentId); const lowerSearch = search.toLowerCase(); const matchesSearch = (r)=>{ var _r_slug; return !search || getLocLabel(r, locale).toLowerCase().includes(lowerSearch) || ((_r_slug = r.slug) !== null && _r_slug !== void 0 ? _r_slug : '').toLowerCase().includes(lowerSearch); }; return /*#__PURE__*/ _jsxs("div", { className: "relative", ref: ref, children: [ /*#__PURE__*/ _jsxs("button", { type: "button", onClick: ()=>setOpen((v)=>!v), className: "w-full flex items-center gap-1.5 px-3 py-1.5 text-xs transition-colors ".concat(open ? '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: [ /*#__PURE__*/ _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: [ /*#__PURE__*/ _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" }), /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 11a3 3 0 11-6 0 3 3 0 016 0z" }) ] }), /*#__PURE__*/ _jsx("span", { className: "flex-1 text-left truncate", children: addLabel }), /*#__PURE__*/ _jsx("svg", { className: "w-3 h-3 text-gray-400 shrink-0 transition-transform ".concat(open ? 'rotate-180' : ''), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19 9l-7 7-7-7" }) }) ] }), open && /*#__PURE__*/ _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: [ /*#__PURE__*/ _jsx("div", { className: "sticky top-0 bg-white px-3 py-2 border-b border-gray-100", children: /*#__PURE__*/ _jsx("input", { autoFocus: true, value: search, onChange: (e)=>setSearch(e.target.value), placeholder: "ППОск...", className: "w-full text-xs border border-gray-200 rounded-lg px-2.5 py-1.5 focus:outline-none focus:ring-2 focus:ring-blue-300" }) }), cities.map((city)=>{ const districts = locRows.filter((r)=>r.parentId === city.id); const cityLabel = getLocLabel(city, locale); const isExpanded = expandedCity === city.id; const hasDistricts = districts.length > 0; const matchingDistricts = districts.filter((d)=>!selected.includes(d.slug) && matchesSearch(d)); const cityAvail = !selected.includes(city.slug) && matchesSearch(city); if (!cityAvail && matchingDistricts.length === 0 && search) return null; return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _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: ()=>{ if (hasDistricts && !search) { setExpandedCity(isExpanded ? null : city.id); } else if (cityAvail) { onAdd(city.slug); setOpen(false); setSearch(''); } }, children: [ /*#__PURE__*/ _jsx("svg", { className: "w-3 h-3 text-gray-300 shrink-0", fill: "currentColor", viewBox: "0 0 24 24", children: /*#__PURE__*/ _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" }) }), /*#__PURE__*/ _jsx("span", { className: "flex-1 font-medium", children: cityLabel }), hasDistricts && !search ? /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5 text-gray-400 shrink-0 transition-transform ".concat(isExpanded ? 'rotate-90' : ''), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 5l7 7-7 7" }) }) : null ] }), (isExpanded || !!search) && matchingDistricts.map((d)=>/*#__PURE__*/ _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: ()=>{ onAdd(d.slug); setOpen(false); setSearch(''); }, children: [ /*#__PURE__*/ _jsx("span", { className: "w-1.5 h-1.5 rounded-full bg-gray-300 shrink-0" }), /*#__PURE__*/ _jsx("span", { className: "flex-1", children: getLocLabel(d, locale) }) ] }, d.id)) ] }, city.id); }) ] }) ] }); } export default function AdminPage() { var _session_user, _stats_tokensByMonth; const router = useRouter(); const { data: session, isPending } = useSession(); const { t, locale } = useLocale(); const [tab, setTab] = useState('stats'); const [sidebarCollapsed, setSidebarCollapsed] = useState(false); useEffect(()=>{ setSidebarCollapsed(window.innerWidth < 1024); }, []); // Stats const [stats, setStats] = useState(null); // Users const [users, setUsers] = useState([]); const [usersPage, setUsersPage] = useState(1); const [usersTotal, setUsersTotal] = useState(0); const [usersQ, setUsersQ] = useState(''); const [usersQInput, setUsersQInput] = useState(''); const [usersRole, setUsersRole] = useState(''); // Tasks const [tasks, setTasks] = useState([]); const [tasksPage, setTasksPage] = useState(1); const [tasksTotal, setTasksTotal] = useState(0); const [tasksQ, setTasksQ] = useState(''); const [tasksQInput, setTasksQInput] = useState(''); const [tasksStatus, setTasksStatus] = useState(''); // Reports const [reports, setReports] = useState([]); const [reportsPage, setReportsPage] = useState(1); const [reportsTotal, setReportsTotal] = useState(0); const [pendingReportsCount, setPendingReportsCount] = useState(0); // Specialist card moderation const [moderationCards, setModerationCards] = useState([]); const [moderationCardsPage, setModerationCardsPage] = useState(1); const [moderationCardsTotal, setModerationCardsTotal] = useState(0); const [moderationCardsLoading, setModerationCardsLoading] = useState(false); const [pendingCardsCount, setPendingCardsCount] = useState(0); // Support tickets const [supportTickets, setSupportTickets] = useState([]); const [supportPage, setSupportPage] = useState(1); const [supportTotal, setSupportTotal] = useState(0); const [supportStatus, setSupportStatus] = useState(''); const [supportType, setSupportType] = useState(''); const [supportQ, setSupportQ] = useState(''); const [supportQInput, setSupportQInput] = useState(''); const [supportReplyId, setSupportReplyId] = useState(null); const [supportReplyText, setSupportReplyText] = useState(''); const [supportReplySaving, setSupportReplySaving] = useState(false); // AI Logs const [logs, setLogs] = useState([]); const [logsPage, setLogsPage] = useState(1); const [logsTotal, setLogsTotal] = useState(0); // Activity Logs const [activityLog, setActivityLog] = useState([]); const [activityTotal, setActivityTotal] = useState(0); const [activityPage, setActivityPage] = useState(1); const [activityEvent, setActivityEvent] = useState(''); const [activityUserId, setActivityUserId] = useState(''); const [activityDateFrom, setActivityDateFrom] = useState(''); const [activityDateTo, setActivityDateTo] = useState(''); const [activityEventTypes, setActivityEventTypes] = useState([]); // Mail Logs const [mailLog, setMailLog] = useState([]); const [mailTotal, setMailTotal] = useState(0); const [mailPage, setMailPage] = useState(1); const [mailEvent, setMailEvent] = useState(''); const [mailDateFrom, setMailDateFrom] = useState(''); const [mailDateTo, setMailDateTo] = useState(''); const [mailEventTypes, setMailEventTypes] = useState([]); // Logs sub-tab const [logsSubTab, setLogsSubTab] = useState('ai'); // Notification Logs const [notifLogs, setNotifLogs] = useState([]); const [notifLogsPage, setNotifLogsPage] = useState(1); const [notifLogsTotal, setNotifLogsTotal] = useState(0); const [notifLogsType, setNotifLogsType] = useState(''); const [notifLogsTypes, setNotifLogsTypes] = useState([]); const [notifLogsDateFrom, setNotifLogsDateFrom] = useState(''); const [notifLogsDateTo, setNotifLogsDateTo] = useState(''); // Notification stats chart const [notifsByDay, setNotifsByDay] = useState([]); const [mailByDay, setMailByDay] = useState([]); // Balance archive const [balanceRows, setBalanceRows] = useState([]); const [balanceTotal, setBalanceTotal] = useState(0); const [balancePage, setBalancePage] = useState(1); const [balanceUserId, setBalanceUserId] = useState(''); const [balanceKind, setBalanceKind] = useState(''); const [topUpSaving, setTopUpSaving] = useState(false); const [withdrawSaving, setWithdrawSaving] = useState(false); // User edit modal const [editUser, setEditUser] = useState(null); const [editUserSaving, setEditUserSaving] = useState(false); const [verifyingEmail, setVerifyingEmail] = useState(false); const [editUserTab, setEditUserTab] = useState('profile'); const [balanceModal, setBalanceModal] = useState(null); const [skillInput, setSkillInput] = useState(''); const [editUserCards, setEditUserCards] = useState([]); const [editUserCardsLoading, setEditUserCardsLoading] = useState(false); const [cardSkillInputs, setCardSkillInputs] = useState({}); const [cardSaving, setCardSaving] = useState({}); const [cardCatSelects, setCardCatSelects] = useState({}); const [cardLocSelects, setCardLocSelects] = useState({}); // Plans const [planRows, setPlanRows] = useState([]); const [planForm, setPlanForm] = useState(null); const [planSaving, setPlanSaving] = useState(false); // Locations const [locRows, setLocRows] = useState([]); const [locForm, setLocForm] = useState(null); const [locSaving, setLocSaving] = useState(false); const [locExpanded, setLocExpanded] = useState(new Set()); // Categories const [catRows, setCatRows] = useState([]); const [catForm, setCatForm] = useState(null); const [catSaving, setCatSaving] = useState(false); const [catExpanded, setCatExpanded] = useState(new Set()); const [catIconUploading, setCatIconUploading] = useState(false); const [catIconError, setCatIconError] = useState(null); const [categoryIconPresets, setCategoryIconPresets] = useState(DEFAULT_CATEGORY_ICON_PRESETS); // Category Skills const [catSkillsExpanded, setCatSkillsExpanded] = useState(new Set()); const [catSkillsCache, setCatSkillsCache] = useState({}); const [catSkillsLoading, setCatSkillsLoading] = useState(new Set()); const [skillForm, setSkillForm] = useState(null); const [skillSaving, setSkillSaving] = useState(false); // Settings const [settingsTab, setSettingsTab] = useState('general'); const [generalForm, setGeneralForm] = useState({ siteName: 'CanHelp', siteUrl: '', contactEmail: '', supportPhone: '' }); const [generalSaving, setGeneralSaving] = useState(false); const [generalSaved, setGeneralSaved] = useState(false); const [smtpForm, setSmtpForm] = useState({ host: '', port: '587', username: '', password: '', fromName: 'CanHelp', fromEmail: '', encryption: 'tls' }); const [smtpSaving, setSmtpSaving] = useState(false); const [smtpSaved, setSmtpSaved] = useState(false); const [testEmailSending, setTestEmailSending] = useState(false); const [testEmailResult, setTestEmailResult] = useState(null); const [notifTemplates, setNotifTemplates] = useState({ email_verification: { subject: 'ППЎтверЎОте ваш email — {{siteName}}', body: '' }, registration_success: { subject: 'ДПбрП пПжалПвать в {{siteName}}!', body: '' }, password_reset: { subject: 'ВПсстаМПвлеМОе парПля — {{siteName}}', body: '' }, new_offer: { subject: 'НПвПе преЎлПжеМОе пП вашей заЎаче «{{taskTitle}}»', body: '' }, new_task: { subject: 'НПвая заЎача: {{taskTitle}}', body: '' }, offer_accepted: { subject: 'Ваше преЎлПжеМОе прОМятП: {{taskTitle}}', body: '

Ваше преЎлПжеМОе прОМятП! 🎉

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

ЗаказчОк прОМял ваше преЎлПжеМОе Ма выпПлМеМОе заЎачО:

{{taskTitle}}

СуЌЌа: {{price}}€

Открыть чат →' }, new_message: { subject: 'НПвПе сППбщеМОе Пт {{senderName}}', body: '

НПвПе сППбщеМОе

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

ВаЌ МапОсал(а) {{senderName}}:

"{{preview}}"

ОтветОть →' }, offer_declined: { subject: 'Ваше преЎлПжеМОе ПтклПМеМП: {{taskTitle}}', body: '

Ваше преЎлПжеМОе ПтклПМеМП

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

К сПжалеМОю, заказчОк ПтклПМОл ваше преЎлПжеМОе Ма:

{{taskTitle}}

НайтО ЎругОе заказы →' }, offer_other_accepted: { subject: 'ВыбраМ ЎругПй ОспПлМОтель: {{taskTitle}}', body: '

ВыбраМ ЎругПй ОспПлМОтель

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

ЗаказчОк выбрал ЎругПгП ОспПлМОтеля Ўля заЎаМОя:

{{taskTitle}}

НайтО ЎругОе заказы →' }, task_updated: { subject: 'ЗаЎаМОе ПбМПвлеМП: {{taskTitle}}', body: '

ЗаЎаМОе ПбМПвлеМП

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

ЗаказчОк ПбМПвОл ЎеталО заЎаМОя:

{{taskTitle}}

СЌПтреть заказ →' }, deadline_reminder: { subject: 'ЗаЎаМОе Остекает завтра: {{taskTitle}}', body: '

НапПЌОМаМОе П ЎеЎлайМе

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

Ваше заЎаМОе Остекает через 24 часа. ОбМПвОте ЎеЎлайМ, ОМаче заЎаМОе буЎет автПЌатОческО сМятП с публОкацОО.

{{taskTitle}}

РеЎактОрПвать заЎаМОе →' }, task_archived: { subject: 'ЗаЎаМОе сМятП с публОкацОО: {{taskTitle}}', body: '

ЗаЎаМОе перевеЎеМП в черМПвОк

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

Ваше заЎаМОе ОстеклП О былП автПЌатОческО перевеЎеМП в черМПвОк. ОбМПвОте ЎеЎлайМ, чтПбы ПпублОкПвать егП сМПва.

{{taskTitle}}

РеЎактОрПвать заЎаМОе →' }, referral_reward: { subject: 'Вы пПлучОлО реферальМую МаграЎу — {{siteName}}', body: '

Вы пПлучОлО реферальМую МаграЎу! 🎁

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

Друг зарегОстрОрПвался пП вашей реферальМПй ссылке. На ваш аккауМт ЎПбавлеМП {{days}} ЎМей ЎПступа к плаМу {{planName}}!

+{{days}} ЎМей — {{planName}}

ПерейтО к аккауМту →' }, referral_reward_el: { subject: 'Λάβατε αΜταΌοιβή παραποΌπής — {{siteName}}', body: '

Λάβατε αΜταΌοιβή παραποΌπής! 🎁

Γεια {{userName}},

ΈΜας φίλος εγγράφηκε χρησιΌοποιώΜτας τοΜ σύΜΎεσΌο παραποΌπής σας. ΣτοΜ λογαριασΌό σας προστέΞηκαΜ {{days}} ηΌέρες πρόσβασης στο πλάΜο {{planName}}!

+{{days}} ηΌέρες — {{planName}}

Δες τοΜ λογαριασΌό σου →' }, referral_reward_en: { subject: 'You received a referral reward — {{siteName}}', body: '

You received a referral reward! 🎁

Hi {{userName}},

A friend registered using your referral link. {{days}} days of {{planName}} access have been added to your account!

+{{days}} days — {{planName}}

View your account →' }, referral_reward_ru: { subject: 'Вы пПлучОлО реферальМую МаграЎу — {{siteName}}', body: '

Вы пПлучОлО реферальМую МаграЎу! 🎁

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

Друг зарегОстрОрПвался пП вашей реферальМПй ссылке. На ваш аккауМт ЎПбавлеМП {{days}} ЎМей ЎПступа к плаМу {{planName}}!

+{{days}} ЎМей — {{planName}}

ПерейтО к аккауМту →' } }); const [editingTemplate, setEditingTemplate] = useState(null); const [templateLocale, setTemplateLocale] = useState('el'); const [templateSaving, setTemplateSaving] = useState(false); const [templateTranslating, setTemplateTranslating] = useState(false); const [ePayForm, setEPayForm] = useState({ merchantId: '', apiUser: '', apiPassword: '', environment: 'test', confirmationUrl: '', cancelUrl: '', enabled: false }); const [ePaySaving, setEPaySaving] = useState(false); const [ePaySaved, setEPaySaved] = useState(false); const [referralForm, setReferralForm] = useState({ enabled: false, planId: '', days: '30' }); const [referralSaving, setReferralSaving] = useState(false); const [referralSaved, setReferralSaved] = useState(false); const [seoForm, setSeoForm] = useState({ maintenanceMode: false, indexingEnabled: true, headScripts: '', siteTitleEl: '', siteTitleEn: '', siteTitleRu: '', siteTitleUk: '', siteDescriptionEl: '', siteDescriptionEn: '', siteDescriptionRu: '', siteDescriptionUk: '' }); const [seoSaving, setSeoSaving] = useState(false); const [seoSaved, setSeoSaved] = useState(false); const [seoLangTab, setSeoLangTab] = useState('el'); const [socialForm, setSocialForm] = useState({ telegram: '', instagram: '', facebook: '', twitter: '', youtube: '', tiktok: '', whatsapp: '', viber: '' }); const [socialSaving, setSocialSaving] = useState(false); const [socialSaved, setSocialSaved] = useState(false); const [telegramForm, setTelegramForm] = useState({ botToken: '', adminChatId: '', channelIdEl: '', channelIdEn: '', channelIdRu: '', channelIdUk: '', notifyRegistrations: false, postNewTasks: false }); const [telegramSaving, setTelegramSaving] = useState(false); const [telegramSaved, setTelegramSaved] = useState(false); const [testingTelegramAdmin, setTestingTelegramAdmin] = useState(false); const [testingTelegramChannel, setTestingTelegramChannel] = useState(false); const [testResultTelegramAdmin, setTestResultTelegramAdmin] = useState(null); const [testResultTelegramChannel, setTestResultTelegramChannel] = useState(null); const [testingLocale, setTestingLocale] = useState(null); const [testResultChannels, setTestResultChannels] = useState({}); const [verifyingTelegramToken, setVerifyingTelegramToken] = useState(false); const [verifyResultTelegramToken, setVerifyResultTelegramToken] = useState(null); // Backup const [backupAutoEnabled, setBackupAutoEnabled] = useState(false); const [backupAutoSaving, setBackupAutoSaving] = useState(false); const [backupTables, setBackupTables] = useState([]); const [backupTablesLoading, setBackupTablesLoading] = useState(false); const [backupStoredFiles, setBackupStoredFiles] = useState([]); const [backupExporting, setBackupExporting] = useState(false); const [backupImporting, setBackupImporting] = useState(null); const [backupRestoring, setBackupRestoring] = useState(null); const [backupMsg, setBackupMsg] = useState(null); const [backupMsgError, setBackupMsgError] = useState(false); const setBackupSuccess = (msg)=>{ setBackupMsg(msg); setBackupMsgError(false); }; const setBackupError = (msg)=>{ setBackupMsg(msg); setBackupMsgError(true); }; // ─── Translations state ─────────────────────────────────────────────────── const [transStats, setTransStats] = useState(null); const [transStatsLoading, setTransStatsLoading] = useState(false); const [transLang, setTransLang] = useState('uk'); const [transFromLang, setTransFromLang] = useState('el'); const [transTableTranslating, setTransTableTranslating] = useState({}); const [transMsg, setTransMsg] = useState(null); const [transPreview, setTransPreview] = useState(null); // ─── Referrals state ───────────────────────────────────────────────────── const [referralsData, setReferralsData] = useState(null); const [referralsLoading, setReferralsLoading] = useState(false); const [referralsExpanded, setReferralsExpanded] = useState(new Set()); // ─── Push state ────────────────────────────────────────────────────────── const [pushMode, setPushMode] = useState('broadcast'); const [pushTargetUserId, setPushTargetUserId] = useState(''); const [pushTitle, setPushTitle] = useState(''); const [pushBody, setPushBody] = useState(''); const [pushType, setPushType] = useState('general'); const [pushReferenceId, setPushReferenceId] = useState(''); const [pushOnlyActive, setPushOnlyActive] = useState(true); const [pushSending, setPushSending] = useState(false); const [pushResult, setPushResult] = useState(null); const [pushError, setPushError] = useState(null); const [loading, setLoading] = useState(false); const isAdmin = !isPending && session && ((_session_user = session.user) === null || _session_user === void 0 ? void 0 : _session_user.role) === 'admin'; useEffect(()=>{ var _session_user; if (!isPending && !session) router.push('/login'); if (!isPending && session && ((_session_user = session.user) === null || _session_user === void 0 ? void 0 : _session_user.role) !== 'admin') router.push('/'); }, [ session, isPending ]); useEffect(()=>{ if (!isAdmin) return; api.getAdminStats().then(setStats).catch(()=>{}); api.getAdminNotifStats().then(setNotifsByDay).catch(()=>{}); api.getAdminMailStats().then(setMailByDay).catch(()=>{}); api.getAdminReports(1, 'pending').then((d)=>setPendingReportsCount(d.total)).catch(()=>{}); api.getAdminSpecialistCards(1, 'pending').then((d)=>setPendingCardsCount(d.total)).catch(()=>{}); }, [ isAdmin ]); useEffect(()=>{ if (!isAdmin || tab !== 'users') return; setLoading(true); api.getAdminUsers(usersPage, usersQ || undefined, usersRole || undefined).then((d)=>{ setUsers(d.data); setUsersTotal(d.total); }).catch(()=>{}).finally(()=>setLoading(false)); }, [ isAdmin, tab, usersPage, usersQ, usersRole ]); useEffect(()=>{ if (!isAdmin || tab !== 'tasks') return; setLoading(true); api.getAdminTasks(tasksPage, tasksQ || undefined, tasksStatus || undefined).then((d)=>{ setTasks(d.data); setTasksTotal(d.total); }).catch(()=>{}).finally(()=>setLoading(false)); }, [ isAdmin, tab, tasksPage, tasksQ, tasksStatus ]); useEffect(()=>{ if (!isAdmin || tab !== 'reports') return; setLoading(true); api.getAdminReports(reportsPage).then((d)=>{ setReports(d.data); setReportsTotal(d.total); }).catch(()=>{}).finally(()=>setLoading(false)); }, [ isAdmin, tab, reportsPage ]); useEffect(()=>{ if (!isAdmin || tab !== 'moderation') return; setModerationCardsLoading(true); api.getAdminSpecialistCards(moderationCardsPage, 'review').then((d)=>{ setModerationCards(d.data); setModerationCardsTotal(d.total); }).catch(()=>{}).finally(()=>setModerationCardsLoading(false)); }, [ isAdmin, tab, moderationCardsPage ]); useEffect(()=>{ if (!isAdmin || tab !== 'support') return; setLoading(true); const params = { page: String(supportPage), limit: '30' }; if (supportStatus) params.status = supportStatus; if (supportType) params.type = supportType; if (supportQ) params.q = supportQ; api.getAdminSupportTickets(params).then((d)=>{ setSupportTickets(d.data); setSupportTotal(d.total); }).catch(()=>{}).finally(()=>setLoading(false)); }, [ isAdmin, tab, supportPage, supportStatus, supportType, supportQ ]); useEffect(()=>{ if (!isAdmin || tab !== 'balances') return; setLoading(true); api.getAdminBalanceHistory({ page: balancePage, userId: balanceUserId || undefined, kind: balanceKind || undefined }).then((d)=>{ setBalanceRows(d.data); setBalanceTotal(d.total); }).catch(()=>{}).finally(()=>setLoading(false)); }, [ isAdmin, tab, balancePage, balanceUserId, balanceKind ]); useEffect(()=>{ if (!isAdmin || tab !== 'logs') return; if (logsSubTab === 'ai') { setLoading(true); api.getAdminAiLogs(logsPage).then((d)=>{ setLogs(d.data); setLogsTotal(d.total); }).catch(()=>{}).finally(()=>setLoading(false)); } else if (logsSubTab === 'activity') { api.getAdminActivityLogs({ page: activityPage, event: activityEvent || undefined, userId: activityUserId || undefined, dateFrom: activityDateFrom || undefined, dateTo: activityDateTo || undefined }).then((d)=>{ var _d_eventTypes; setActivityLog(d.data); setActivityTotal(d.total); if ((_d_eventTypes = d.eventTypes) === null || _d_eventTypes === void 0 ? void 0 : _d_eventTypes.length) setActivityEventTypes(d.eventTypes); }).catch(()=>{}); } else if (logsSubTab === 'mail') { api.getAdminMailLogs({ page: mailPage, event: mailEvent || undefined, dateFrom: mailDateFrom || undefined, dateTo: mailDateTo || undefined }).then((d)=>{ var _d_eventTypes; setMailLog(d.data); setMailTotal(d.total); if ((_d_eventTypes = d.eventTypes) === null || _d_eventTypes === void 0 ? void 0 : _d_eventTypes.length) setMailEventTypes(d.eventTypes); }).catch(()=>{}); } else if (logsSubTab === 'notifications') { api.getAdminNotifLogs({ page: notifLogsPage, type: notifLogsType || undefined, dateFrom: notifLogsDateFrom || undefined, dateTo: notifLogsDateTo || undefined }).then((d)=>{ var _d_notifTypes; setNotifLogs(d.data); setNotifLogsTotal(d.total); if ((_d_notifTypes = d.notifTypes) === null || _d_notifTypes === void 0 ? void 0 : _d_notifTypes.length) setNotifLogsTypes(d.notifTypes); }).catch(()=>{}); } }, [ isAdmin, tab, logsSubTab, logsPage, activityPage, activityEvent, activityUserId, activityDateFrom, activityDateTo, mailPage, mailEvent, mailDateFrom, mailDateTo, notifLogsPage, notifLogsType, notifLogsDateFrom, notifLogsDateTo ]); useEffect(()=>{ setActivityPage(1); }, [ activityEvent, activityUserId, activityDateFrom, activityDateTo ]); useEffect(()=>{ setMailPage(1); }, [ mailEvent, mailDateFrom, mailDateTo ]); useEffect(()=>{ setNotifLogsPage(1); }, [ notifLogsType, notifLogsDateFrom, notifLogsDateTo ]); useEffect(()=>{ if (!isAdmin || tab !== 'plans') return; api.getAdminPlans().then(setPlanRows).catch(()=>{}); }, [ isAdmin, tab ]); useEffect(()=>{ if (!isAdmin || tab !== 'translations') return; setTransStatsLoading(true); api.getTranslationsStats().then((d)=>setTransStats(d.tables)).catch(()=>{}).finally(()=>setTransStatsLoading(false)); }, [ isAdmin, tab ]); useEffect(()=>{ if (!isAdmin || tab !== 'backup') return; request('/admin/backup/settings').then((d)=>setBackupAutoEnabled(!!d.autoEnabled)).catch(()=>{}); setBackupTablesLoading(true); request('/admin/backup/tables').then((d)=>setBackupTables(d.tables || [])).catch(()=>{}).finally(()=>setBackupTablesLoading(false)); request('/admin/backup/list').then((d)=>setBackupStoredFiles(d.files || [])).catch(()=>{}); }, [ isAdmin, tab ]); useEffect(()=>{ if (!isAdmin || tab !== 'referrals') return; setReferralsLoading(true); api.getAdminReferrals().then((d)=>setReferralsData(d)).catch(()=>{}).finally(()=>setReferralsLoading(false)); }, [ isAdmin, tab ]); // Load plans when users tab opens (for plan selector in edit modal) useEffect(()=>{ if (!isAdmin || tab !== 'users') return; if (planRows.length === 0) api.getAdminPlans().then(setPlanRows).catch(()=>{}); }, [ isAdmin, tab ]); // Reset page when filters change useEffect(()=>{ setUsersPage(1); }, [ usersQ, usersRole ]); useEffect(()=>{ setTasksPage(1); }, [ tasksQ, tasksStatus ]); useEffect(()=>{ setBalancePage(1); }, [ balanceUserId, balanceKind ]); async function sendAdminPush() { if (!pushTitle.trim()) return; if (pushMode === 'user' && !pushTargetUserId.trim()) { setPushError('УкажОте ID пПльзПвателя'); return; } setPushSending(true); setPushError(null); setPushResult(null); try { const payload = { title: pushTitle.trim(), body: pushBody.trim() || undefined, type: pushType.trim() || undefined, referenceId: pushReferenceId.trim() || undefined }; if (pushMode === 'broadcast') { const res = await api.adminBroadcastPush({ ...payload, onlyActive: pushOnlyActive }); setPushResult(res); } else { const res = await api.adminSendPushToUser(pushTargetUserId.trim(), payload); setPushResult(res); } } catch (err) { setPushError((err === null || err === void 0 ? void 0 : err.message) || 'Не уЎалПсь ПтправОть push'); } finally{ setPushSending(false); } } async function toggleUser(id, isActive) { const fn = isActive ? api.deactivateUser : api.activateUser; const updated = await fn(id).catch(()=>null); if (updated) setUsers((prev)=>prev.map((u)=>u.id === id ? updated : u)); } async function changeRole(id, role) { const updated = await api.changeUserRole(id, role).catch(()=>null); if (updated) setUsers((prev)=>prev.map((u)=>u.id === id ? updated : u)); } function openEditUser(u) { setEditUserTab('profile'); setSkillInput(''); setBalanceModal(null); setEditUserCards([]); setCardSkillInputs({}); setCardSaving({}); setCardCatSelects({}); setCardLocSelects({}); setEditUser({ ...u, topUpAmount: '', topUpDescription: '', withdrawAmount: '', withdrawDescription: '' }); api.getAdminUser(u.id).then((fresh)=>setEditUser((prev)=>prev && prev.id === fresh.id ? { ...fresh, topUpAmount: '', topUpDescription: '', withdrawAmount: '', withdrawDescription: '' } : prev)).catch(()=>{}); } function describeFcmFailure(key, message) { if (!key) return message || 'FCM прОМял 0 сППбщеМОй'; if (key === 'THIRD_PARTY_AUTH_ERROR') { return 'ОшОбка APNs/Firebase iOS: прПверьте Apple APNs Auth Key (.p8) О связку Firebase прПекта Ўля iOS-прОлПжеМОя'; } if (key === 'UNREGISTERED') { return 'ТПкеМ устрПйства бПльше Ме валОЎеМ'; } if (key === 'INVALID_ARGUMENT') { return 'НекПрректМый тПкеМ ОлО payload'; } if (key === 'REQUEST_FAILED') { return message || 'FCM request failed before response'; } return message ? "".concat(key, ": ").concat(message) : key; } async function saveEditUser() { if (!editUser) return; setEditUserSaving(true); try { var _editUser_languages, _editUser_showContactInfo, _editUser_notifyNewTasks, _editUser_notifMessages, _editUser_skills, _editUser_siteSettings; const updated = await api.updateAdminUser(editUser.id, { firstName: editUser.firstName, lastName: editUser.lastName, phone: editUser.phone || null, bio: editUser.bio || null, role: editUser.role, planId: editUser.planId || null, isActive: editUser.isActive, locale: editUser.locale, languages: (_editUser_languages = editUser.languages) !== null && _editUser_languages !== void 0 ? _editUser_languages : [], personalSiteSlug: editUser.personalSiteSlug || null, showContactInfo: (_editUser_showContactInfo = editUser.showContactInfo) !== null && _editUser_showContactInfo !== void 0 ? _editUser_showContactInfo : false, notifyNewTasks: (_editUser_notifyNewTasks = editUser.notifyNewTasks) !== null && _editUser_notifyNewTasks !== void 0 ? _editUser_notifyNewTasks : false, notifMessages: (_editUser_notifMessages = editUser.notifMessages) !== null && _editUser_notifMessages !== void 0 ? _editUser_notifMessages : true, skills: (_editUser_skills = editUser.skills) !== null && _editUser_skills !== void 0 ? _editUser_skills : [], siteSettings: (_editUser_siteSettings = editUser.siteSettings) !== null && _editUser_siteSettings !== void 0 ? _editUser_siteSettings : {} }); await Promise.all(editUserCards.map((card)=>{ var _card_skills, _card_categories, _card_locations; return api.adminUpdateSpecialistCard(card.id, { title: card.title, description: card.description || null, skills: (_card_skills = card.skills) !== null && _card_skills !== void 0 ? _card_skills : [], categories: (_card_categories = card.categories) !== null && _card_categories !== void 0 ? _card_categories : [], locations: (_card_locations = card.locations) !== null && _card_locations !== void 0 ? _card_locations : [], publicationStatus: card.publicationStatus, isActive: card.isActive }).catch(()=>null); })); setUsers((prev)=>prev.map((u)=>u.id === editUser.id ? updated : u)); setEditUser(null); } catch (e) {} finally{ setEditUserSaving(false); } } async function verifyEmail() { if (!editUser) return; setVerifyingEmail(true); try { const updated = await api.verifyAdminUserEmail(editUser.id); setEditUser((u)=>u ? { ...u, emailVerified: updated.emailVerified } : u); setUsers((prev)=>prev.map((u)=>u.id === editUser.id ? { ...u, emailVerified: updated.emailVerified } : u)); } catch (e) {} finally{ setVerifyingEmail(false); } } async function handleAdminTopUp() { if (!editUser) return; const amount = Number(editUser.topUpAmount); if (!amount || amount <= 0) return; setTopUpSaving(true); try { const result = await api.adminTopUpUserBalance(editUser.id, { amount, description: editUser.topUpDescription || undefined }); setUsers((prev)=>prev.map((u)=>u.id === editUser.id ? result.user : u)); setEditUser((prev)=>prev ? { ...prev, ...result.user, topUpAmount: '', topUpDescription: '' } : prev); if (tab === 'balances') { api.getAdminBalanceHistory({ page: balancePage, userId: balanceUserId || undefined, kind: balanceKind || undefined }).then((d)=>{ setBalanceRows(d.data); setBalanceTotal(d.total); }).catch(()=>{}); } } catch (e) { // ignore } finally{ setTopUpSaving(false); } } async function handleAdminWithdraw() { if (!editUser) return; const amount = Number(editUser.withdrawAmount); if (!amount || amount <= 0) return; setWithdrawSaving(true); try { const result = await api.adminWithdrawUserBalance(editUser.id, { amount, description: editUser.withdrawDescription || undefined }); setUsers((prev)=>prev.map((u)=>u.id === editUser.id ? result.user : u)); setEditUser((prev)=>prev ? { ...prev, ...result.user, withdrawAmount: '', withdrawDescription: '' } : prev); if (tab === 'balances') { api.getAdminBalanceHistory({ page: balancePage, userId: balanceUserId || undefined, kind: balanceKind || undefined }).then((d)=>{ setBalanceRows(d.data); setBalanceTotal(d.total); }).catch(()=>{}); } } catch (e) { // ignore } finally{ setWithdrawSaving(false); } } async function saveCard(cardId) { const card = editUserCards.find((c)=>c.id === cardId); if (!card) return; setCardSaving((prev)=>({ ...prev, [cardId]: true })); try { var _card_skills, _card_categories, _card_locations; const updated = await api.adminUpdateSpecialistCard(cardId, { title: card.title, description: card.description || null, skills: (_card_skills = card.skills) !== null && _card_skills !== void 0 ? _card_skills : [], categories: (_card_categories = card.categories) !== null && _card_categories !== void 0 ? _card_categories : [], locations: (_card_locations = card.locations) !== null && _card_locations !== void 0 ? _card_locations : [], publicationStatus: card.publicationStatus, isActive: card.isActive }); setEditUserCards((prev)=>prev.map((c)=>c.id === cardId ? updated : c)); } catch (e) {} finally{ setCardSaving((prev)=>({ ...prev, [cardId]: false })); } } async function updateModerationCard(cardId, publicationStatus) { const updated = await api.adminUpdateSpecialistCard(cardId, { publicationStatus, isActive: publicationStatus === 'active' }).catch(()=>null); if (!updated) return; setModerationCards((prev)=>prev.map((card)=>card.id === cardId ? updated : card)); if ((editUser === null || editUser === void 0 ? void 0 : editUser.id) === updated.specialistId) { setEditUserCards((prev)=>prev.map((card)=>card.id === cardId ? updated : card)); } api.getAdminReports(1, 'pending').then((d)=>setPendingReportsCount(d.total)).catch(()=>{}); api.getAdminSpecialistCards(1, 'pending').then((d)=>setPendingCardsCount(d.total)).catch(()=>{}); } async function cancelTask(id) { const updated = await api.cancelTaskAdmin(id).catch(()=>null); if (updated) { const task = updated.task || updated; setTasks((prev)=>prev.map((row)=>{ const t = row.task || row; return t.id === id ? { ...row, task: task } : row; })); } } async function deleteTask(id, title) { if (!window.confirm("".concat(t('admin.tasks.delete.confirm'), '\n"').concat(title, '"'))) return; const ok = await api.deleteTaskAdmin(id).catch(()=>null); if (ok) setTasks((prev)=>prev.filter((row)=>{ var _row_task; return (((_row_task = row.task) === null || _row_task === void 0 ? void 0 : _row_task.id) || row.id) !== id; })); } async function handleReport(id, status) { const updated = await api.updateReportStatus(id, status).catch(()=>null); if (updated) setReports((prev)=>prev.map((r)=>r.id === id ? { ...r, ...updated } : r)); } // Locations useEffect(()=>{ if (!isAdmin || tab !== 'locations') return; api.getAdminLocations().then(setLocRows).catch(()=>{}); }, [ isAdmin, tab ]); function openAddLoc(parentId) { setLocForm({ parentId: parentId !== null && parentId !== void 0 ? parentId : null, slug: '', nameEl: '', nameEn: '', nameRu: '', nameUk: '', order: 0, isActive: true }); } function openEditLoc(loc) { var _loc_names, _loc_names1, _loc_names2, _loc_names3; var _loc_parentId, _loc_nameEl, _ref, _loc_nameEn, _ref1, _loc_nameRu, _ref2, _loc_nameUk, _ref3, _loc_order, _loc_isActive; setLocForm({ id: loc.id, parentId: (_loc_parentId = loc.parentId) !== null && _loc_parentId !== void 0 ? _loc_parentId : null, slug: loc.slug, nameEl: (_ref = (_loc_nameEl = loc.nameEl) !== null && _loc_nameEl !== void 0 ? _loc_nameEl : (_loc_names = loc.names) === null || _loc_names === void 0 ? void 0 : _loc_names.el) !== null && _ref !== void 0 ? _ref : '', nameEn: (_ref1 = (_loc_nameEn = loc.nameEn) !== null && _loc_nameEn !== void 0 ? _loc_nameEn : (_loc_names1 = loc.names) === null || _loc_names1 === void 0 ? void 0 : _loc_names1.en) !== null && _ref1 !== void 0 ? _ref1 : '', nameRu: (_ref2 = (_loc_nameRu = loc.nameRu) !== null && _loc_nameRu !== void 0 ? _loc_nameRu : (_loc_names2 = loc.names) === null || _loc_names2 === void 0 ? void 0 : _loc_names2.ru) !== null && _ref2 !== void 0 ? _ref2 : '', nameUk: (_ref3 = (_loc_nameUk = loc.nameUk) !== null && _loc_nameUk !== void 0 ? _loc_nameUk : (_loc_names3 = loc.names) === null || _loc_names3 === void 0 ? void 0 : _loc_names3.uk) !== null && _ref3 !== void 0 ? _ref3 : '', order: (_loc_order = loc.order) !== null && _loc_order !== void 0 ? _loc_order : 0, isActive: (_loc_isActive = loc.isActive) !== null && _loc_isActive !== void 0 ? _loc_isActive : true }); } async function saveLoc() { if (!locForm) return; setLocSaving(true); try { if (locForm.id) { const updated = await api.updateLocation(locForm.id, locForm); setLocRows((prev)=>prev.map((r)=>r.id === locForm.id ? updated : r)); } else { const created = await api.createLocation({ slug: locForm.slug, nameEl: locForm.nameEl, nameEn: locForm.nameEn, nameRu: locForm.nameRu, nameUk: locForm.nameUk, parentId: locForm.parentId, order: locForm.order }); setLocRows((prev)=>[ ...prev, created ]); } setLocForm(null); } catch (e) { // ignore } finally{ setLocSaving(false); } } async function deleteLoc(id, name) { if (!window.confirm("".concat(t('admin.loc.delete.confirm'), '\n"').concat(name, '"'))) return; const ok = await api.deleteLocation(id).catch(()=>null); if (ok) setLocRows((prev)=>prev.filter((r)=>r.id !== id)); } function toggleLocExpand(id) { setLocExpanded((prev)=>{ const next = new Set(prev); next.has(id) ? next.delete(id) : next.add(id); return next; }); } // Categories useEffect(()=>{ if (!isAdmin || tab !== 'categories') return; api.getAdminCategories().then(setCatRows).catch(()=>{}); }, [ isAdmin, tab ]); useEffect(()=>{ if (!isAdmin) return; fetch('/category-icons/presets.json').then((res)=>res.ok ? res.json() : Promise.reject(new Error('Failed to load presets'))).then((data)=>{ if (!Array.isArray(data)) return; const cleaned = data.filter((x)=>!!x && typeof x === 'object' && typeof x.value === 'string' && typeof x.label === 'string').filter((x)=>x.value.startsWith('/category-icons/')); if (cleaned.length > 0) setCategoryIconPresets(cleaned); }).catch(()=>{}); }, [ isAdmin ]); function openAddCat(parentId) { setCatIconError(null); setCatForm({ parentId: parentId !== null && parentId !== void 0 ? parentId : null, slug: '', icon: '/category-icons/package.svg', namesEl: '', namesEn: '', namesRu: '', namesUk: '', order: 0, isActive: true }); } function openEditCat(cat) { var _cat_names, _cat_names1, _cat_names2, _cat_names3; const selectedIcon = typeof cat.icon === 'string' ? cat.icon : ''; const knownPreset = new Set(categoryIconPresets.map((p)=>p.value)); const normalizedIcon = selectedIcon.startsWith('/category-icons/') && !knownPreset.has(selectedIcon) ? '/category-icons/package.svg' : selectedIcon || '/category-icons/package.svg'; setCatIconError(null); var _cat_parentId, _cat_namesEl, _ref, _cat_namesEn, _ref1, _cat_namesRu, _ref2, _cat_namesUk, _ref3, _cat_order, _cat_isActive; setCatForm({ id: cat.id, parentId: (_cat_parentId = cat.parentId) !== null && _cat_parentId !== void 0 ? _cat_parentId : null, slug: cat.slug, icon: normalizedIcon, namesEl: (_ref = (_cat_namesEl = cat.namesEl) !== null && _cat_namesEl !== void 0 ? _cat_namesEl : (_cat_names = cat.names) === null || _cat_names === void 0 ? void 0 : _cat_names.el) !== null && _ref !== void 0 ? _ref : '', namesEn: (_ref1 = (_cat_namesEn = cat.namesEn) !== null && _cat_namesEn !== void 0 ? _cat_namesEn : (_cat_names1 = cat.names) === null || _cat_names1 === void 0 ? void 0 : _cat_names1.en) !== null && _ref1 !== void 0 ? _ref1 : '', namesRu: (_ref2 = (_cat_namesRu = cat.namesRu) !== null && _cat_namesRu !== void 0 ? _cat_namesRu : (_cat_names2 = cat.names) === null || _cat_names2 === void 0 ? void 0 : _cat_names2.ru) !== null && _ref2 !== void 0 ? _ref2 : '', namesUk: (_ref3 = (_cat_namesUk = cat.namesUk) !== null && _cat_namesUk !== void 0 ? _cat_namesUk : (_cat_names3 = cat.names) === null || _cat_names3 === void 0 ? void 0 : _cat_names3.uk) !== null && _ref3 !== void 0 ? _ref3 : '', order: (_cat_order = cat.order) !== null && _cat_order !== void 0 ? _cat_order : 0, isActive: (_cat_isActive = cat.isActive) !== null && _cat_isActive !== void 0 ? _cat_isActive : true }); } async function uploadCategoryIcon(file) { if (file.type !== 'image/svg+xml') { setCatIconError('Only SVG files are allowed'); return; } setCatIconUploading(true); setCatIconError(null); try { const fd = new FormData(); fd.append('file', file); const base = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; const res = await fetch("".concat(base, "/api/uploads"), { method: 'POST', credentials: 'include', body: fd }); if (!res.ok) { const err = await res.json().catch(()=>({ error: 'Upload failed' })); throw new Error(err.error || 'Upload failed'); } const data = await res.json(); setCatForm((f)=>f ? { ...f, icon: data.url } : f); } catch (err) { setCatIconError((err === null || err === void 0 ? void 0 : err.message) || 'Upload failed'); } finally{ setCatIconUploading(false); } } async function saveCat() { if (!catForm) return; setCatSaving(true); try { if (catForm.id) { const updated = await api.updateCategory(catForm.id, catForm); setCatRows((prev)=>prev.map((r)=>r.id === catForm.id ? updated : r)); } else { const created = await api.createCategory({ slug: catForm.slug, icon: catForm.icon, namesEl: catForm.namesEl, namesEn: catForm.namesEn, namesRu: catForm.namesRu, namesUk: catForm.namesUk, parentId: catForm.parentId, order: catForm.order }); setCatRows((prev)=>[ ...prev, created ]); } setCatForm(null); } catch (e) { // ignore } finally{ setCatSaving(false); } } async function deleteCat(id, name) { if (!window.confirm("".concat(t('admin.cat.delete.confirm'), '\n"').concat(name, '"'))) return; const ok = await api.deleteCategory(id).catch(()=>null); if (ok) setCatRows((prev)=>prev.filter((r)=>r.id !== id)); } function toggleCatExpand(id) { setCatExpanded((prev)=>{ const next = new Set(prev); next.has(id) ? next.delete(id) : next.add(id); return next; }); } async function toggleCatSkills(cat) { const id = cat.id; const slug = cat.slug; setCatSkillsExpanded((prev)=>{ const next = new Set(prev); if (next.has(id)) { next.delete(id); return next; } next.add(id); return next; }); if (!catSkillsCache[slug]) { setCatSkillsLoading((prev)=>new Set(prev).add(id)); try { const skills = await api.getAdminSkills(slug); setCatSkillsCache((prev)=>({ ...prev, [slug]: skills })); } catch (e) {} finally{ setCatSkillsLoading((prev)=>{ const n = new Set(prev); n.delete(id); return n; }); } } } function openAddSkill(catSlug) { setSkillForm({ catSlug, nameEl: '', nameEn: '', nameRu: '', nameUk: '', order: 0 }); } function openEditSkill(skill, catSlug) { var _skill_nameEl, _skill_nameEn, _skill_nameRu, _skill_nameUk, _skill_order; setSkillForm({ id: skill.id, catSlug, nameEl: (_skill_nameEl = skill.nameEl) !== null && _skill_nameEl !== void 0 ? _skill_nameEl : '', nameEn: (_skill_nameEn = skill.nameEn) !== null && _skill_nameEn !== void 0 ? _skill_nameEn : '', nameRu: (_skill_nameRu = skill.nameRu) !== null && _skill_nameRu !== void 0 ? _skill_nameRu : '', nameUk: (_skill_nameUk = skill.nameUk) !== null && _skill_nameUk !== void 0 ? _skill_nameUk : '', order: (_skill_order = skill.order) !== null && _skill_order !== void 0 ? _skill_order : 0 }); } async function saveSkill() { if (!skillForm) return; setSkillSaving(true); try { if (skillForm.id) { const updated = await api.updateSkill(skillForm.id, { nameEl: skillForm.nameEl, nameEn: skillForm.nameEn, nameRu: skillForm.nameRu, nameUk: skillForm.nameUk, order: skillForm.order }); setCatSkillsCache((prev)=>{ var _prev_skillForm_catSlug; return { ...prev, [skillForm.catSlug]: ((_prev_skillForm_catSlug = prev[skillForm.catSlug]) !== null && _prev_skillForm_catSlug !== void 0 ? _prev_skillForm_catSlug : []).map((s)=>s.id === skillForm.id ? updated : s) }; }); } else { const created = await api.createSkill({ categorySlug: skillForm.catSlug, nameEl: skillForm.nameEl, nameEn: skillForm.nameEn, nameRu: skillForm.nameRu, nameUk: skillForm.nameUk, order: skillForm.order }); setCatSkillsCache((prev)=>{ var _prev_skillForm_catSlug; return { ...prev, [skillForm.catSlug]: [ ...(_prev_skillForm_catSlug = prev[skillForm.catSlug]) !== null && _prev_skillForm_catSlug !== void 0 ? _prev_skillForm_catSlug : [], created ] }; }); } setSkillForm(null); } catch (e) {} finally{ setSkillSaving(false); } } async function deleteSkill(skill, catSlug) { if (!skill._skipConfirm && !window.confirm('УЎалОть Мавык "'.concat(skill.nameEl, '"?'))) return; const ok = skill._skipConfirm ? true : await api.deleteSkill(skill.id).catch(()=>null); if (ok) { setCatSkillsCache((prev)=>{ var _prev_catSlug; return { ...prev, [catSlug]: ((_prev_catSlug = prev[catSlug]) !== null && _prev_catSlug !== void 0 ? _prev_catSlug : []).filter((s)=>s.id !== skill.id) }; }); } } function openAddPlan() { setPlanForm({ 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: false, isActive: true, order: 0, notifyNewTasks: false, canContactFreePlan: false, canContactProPlan: true, canContactAll: false, canShowContactInfo: false, canViewPhone: false, canUploadVideo: false, hasFavorites: false, hasGoogleCalendar: false, hasVerifiedBadge: false, highlightedReviews: false, hasPersonalSite: false, hasCanHelpNowStatus: false, hasNeedHelpStatus: false, hasAutoResponse: false, hasAutoMatch: false, hasPriceList: false, receiveInstantDispatchFree: false, receiveInstantDispatchPro: false }); } function openEditPlan(plan) { var _plan_description, _plan_role, _plan_tier, _plan_price, _plan_oldPrice, _plan_currency, _plan_searchBoost, _plan_offersMultiplier, _plan_features, _plan_isDefault, _plan_isActive, _plan_order, _plan_notifyNewTasks, _plan_canContactFreePlan, _plan_canContactProPlan, _plan_canContactAll, _plan_canShowContactInfo, _plan_canViewPhone, _plan_canUploadVideo, _plan_hasFavorites, _plan_hasGoogleCalendar, _plan_hasVerifiedBadge, _plan_highlightedReviews, _plan_hasPersonalSite, _plan_hasCanHelpNowStatus, _plan_hasNeedHelpStatus, _plan_hasAutoResponse, _plan_hasAutoMatch, _plan_hasPriceList, _plan_receiveInstantDispatchFree, _plan_receiveInstantDispatchPro; setPlanForm({ id: plan.id, name: plan.name, description: (_plan_description = plan.description) !== null && _plan_description !== void 0 ? _plan_description : '', role: (_plan_role = plan.role) !== null && _plan_role !== void 0 ? _plan_role : 'customer', tier: (_plan_tier = plan.tier) !== null && _plan_tier !== void 0 ? _plan_tier : 'free', price: (_plan_price = plan.price) !== null && _plan_price !== void 0 ? _plan_price : '0', oldPrice: (_plan_oldPrice = plan.oldPrice) !== null && _plan_oldPrice !== void 0 ? _plan_oldPrice : '', currency: (_plan_currency = plan.currency) !== null && _plan_currency !== void 0 ? _plan_currency : 'EUR', maxTasks: plan.maxTasks != null ? String(plan.maxTasks) : '', maxOffers: plan.maxOffers != null ? String(plan.maxOffers) : '', maxCards: plan.maxCards != null ? String(plan.maxCards) : '', maxMessagesPerDay: plan.maxMessagesPerDay != null ? String(plan.maxMessagesPerDay) : '', maxOrdersPerDay: plan.maxOrdersPerDay != null ? String(plan.maxOrdersPerDay) : '', maxSkills: plan.maxSkills != null ? String(plan.maxSkills) : '', durationDays: plan.durationDays != null ? String(plan.durationDays) : '', searchBoost: (_plan_searchBoost = plan.searchBoost) !== null && _plan_searchBoost !== void 0 ? _plan_searchBoost : 0, offersMultiplier: (_plan_offersMultiplier = plan.offersMultiplier) !== null && _plan_offersMultiplier !== void 0 ? _plan_offersMultiplier : '1.00', features: ((_plan_features = plan.features) !== null && _plan_features !== void 0 ? _plan_features : []).join('\n'), isDefault: (_plan_isDefault = plan.isDefault) !== null && _plan_isDefault !== void 0 ? _plan_isDefault : false, isActive: (_plan_isActive = plan.isActive) !== null && _plan_isActive !== void 0 ? _plan_isActive : true, order: (_plan_order = plan.order) !== null && _plan_order !== void 0 ? _plan_order : 0, notifyNewTasks: (_plan_notifyNewTasks = plan.notifyNewTasks) !== null && _plan_notifyNewTasks !== void 0 ? _plan_notifyNewTasks : false, canContactFreePlan: (_plan_canContactFreePlan = plan.canContactFreePlan) !== null && _plan_canContactFreePlan !== void 0 ? _plan_canContactFreePlan : false, canContactProPlan: (_plan_canContactProPlan = plan.canContactProPlan) !== null && _plan_canContactProPlan !== void 0 ? _plan_canContactProPlan : true, canContactAll: (_plan_canContactAll = plan.canContactAll) !== null && _plan_canContactAll !== void 0 ? _plan_canContactAll : false, canShowContactInfo: (_plan_canShowContactInfo = plan.canShowContactInfo) !== null && _plan_canShowContactInfo !== void 0 ? _plan_canShowContactInfo : false, canViewPhone: (_plan_canViewPhone = plan.canViewPhone) !== null && _plan_canViewPhone !== void 0 ? _plan_canViewPhone : false, canUploadVideo: (_plan_canUploadVideo = plan.canUploadVideo) !== null && _plan_canUploadVideo !== void 0 ? _plan_canUploadVideo : false, hasFavorites: (_plan_hasFavorites = plan.hasFavorites) !== null && _plan_hasFavorites !== void 0 ? _plan_hasFavorites : false, hasGoogleCalendar: (_plan_hasGoogleCalendar = plan.hasGoogleCalendar) !== null && _plan_hasGoogleCalendar !== void 0 ? _plan_hasGoogleCalendar : false, hasVerifiedBadge: (_plan_hasVerifiedBadge = plan.hasVerifiedBadge) !== null && _plan_hasVerifiedBadge !== void 0 ? _plan_hasVerifiedBadge : false, highlightedReviews: (_plan_highlightedReviews = plan.highlightedReviews) !== null && _plan_highlightedReviews !== void 0 ? _plan_highlightedReviews : false, hasPersonalSite: (_plan_hasPersonalSite = plan.hasPersonalSite) !== null && _plan_hasPersonalSite !== void 0 ? _plan_hasPersonalSite : false, hasCanHelpNowStatus: (_plan_hasCanHelpNowStatus = plan.hasCanHelpNowStatus) !== null && _plan_hasCanHelpNowStatus !== void 0 ? _plan_hasCanHelpNowStatus : false, hasNeedHelpStatus: (_plan_hasNeedHelpStatus = plan.hasNeedHelpStatus) !== null && _plan_hasNeedHelpStatus !== void 0 ? _plan_hasNeedHelpStatus : false, hasAutoResponse: (_plan_hasAutoResponse = plan.hasAutoResponse) !== null && _plan_hasAutoResponse !== void 0 ? _plan_hasAutoResponse : false, hasAutoMatch: (_plan_hasAutoMatch = plan.hasAutoMatch) !== null && _plan_hasAutoMatch !== void 0 ? _plan_hasAutoMatch : false, hasPriceList: (_plan_hasPriceList = plan.hasPriceList) !== null && _plan_hasPriceList !== void 0 ? _plan_hasPriceList : false, receiveInstantDispatchFree: (_plan_receiveInstantDispatchFree = plan.receiveInstantDispatchFree) !== null && _plan_receiveInstantDispatchFree !== void 0 ? _plan_receiveInstantDispatchFree : false, receiveInstantDispatchPro: (_plan_receiveInstantDispatchPro = plan.receiveInstantDispatchPro) !== null && _plan_receiveInstantDispatchPro !== void 0 ? _plan_receiveInstantDispatchPro : false }); } async function savePlan() { if (!planForm) return; setPlanSaving(true); try { const payload = { name: planForm.name, description: planForm.description || undefined, role: planForm.role, tier: planForm.tier, price: planForm.price, oldPrice: planForm.oldPrice || null, currency: planForm.currency, maxTasks: planForm.maxTasks ? Number(planForm.maxTasks) : null, maxOffers: planForm.maxOffers ? Number(planForm.maxOffers) : null, maxCards: planForm.maxCards ? Number(planForm.maxCards) : null, maxMessagesPerDay: planForm.maxMessagesPerDay ? Number(planForm.maxMessagesPerDay) : null, maxOrdersPerDay: planForm.maxOrdersPerDay ? Number(planForm.maxOrdersPerDay) : null, maxSkills: planForm.maxSkills ? Number(planForm.maxSkills) : null, durationDays: planForm.durationDays ? Number(planForm.durationDays) : null, notifyNewTasks: planForm.notifyNewTasks, searchBoost: planForm.searchBoost, offersMultiplier: planForm.offersMultiplier, canContactFreePlan: planForm.canContactFreePlan, canContactProPlan: planForm.canContactProPlan, canContactAll: planForm.canContactAll, canShowContactInfo: planForm.canShowContactInfo, canViewPhone: planForm.canViewPhone, canUploadVideo: planForm.canUploadVideo, hasFavorites: planForm.hasFavorites, hasGoogleCalendar: planForm.hasGoogleCalendar, hasVerifiedBadge: planForm.hasVerifiedBadge, highlightedReviews: planForm.highlightedReviews, hasPersonalSite: planForm.hasPersonalSite, hasCanHelpNowStatus: planForm.hasCanHelpNowStatus, hasNeedHelpStatus: planForm.hasNeedHelpStatus, hasAutoResponse: planForm.hasAutoResponse, hasAutoMatch: planForm.hasAutoMatch, hasPriceList: planForm.hasPriceList, receiveInstantDispatchFree: planForm.receiveInstantDispatchFree, receiveInstantDispatchPro: planForm.receiveInstantDispatchPro, features: planForm.features ? planForm.features.split('\n').map((s)=>s.trim()).filter(Boolean) : [], isDefault: planForm.isDefault, isActive: planForm.isActive, order: planForm.order }; if (planForm.id) { const updated = await api.updatePlan(planForm.id, payload); setPlanRows((prev)=>prev.map((r)=>r.id === planForm.id ? updated : r)); } else { const created = await api.createPlan(payload); setPlanRows((prev)=>[ ...prev, created ]); } // If set as default — refresh all to sync isDefault flags if (planForm.isDefault) { api.getAdminPlans().then(setPlanRows).catch(()=>{}); } setPlanForm(null); } catch (e) { // ignore } finally{ setPlanSaving(false); } } async function deletePlan(id, name) { if (!window.confirm('Delete plan "'.concat(name, '"?'))) return; const ok = await api.deletePlan(id).catch(()=>null); if (ok) setPlanRows((prev)=>prev.filter((r)=>r.id !== id)); } // Settings useEffect(()=>{ if (!isAdmin || tab !== 'settings') return; if (planRows.length === 0) api.getAdminPlans().then(setPlanRows).catch(()=>{}); api.getAdminSettings().then((kv)=>{ var _kv_generalsiteName, _kv_generalsiteUrl, _kv_generalcontactEmail, _kv_generalsupportPhone; setGeneralForm({ siteName: (_kv_generalsiteName = kv['general.siteName']) !== null && _kv_generalsiteName !== void 0 ? _kv_generalsiteName : 'CanHelp', siteUrl: (_kv_generalsiteUrl = kv['general.siteUrl']) !== null && _kv_generalsiteUrl !== void 0 ? _kv_generalsiteUrl : '', contactEmail: (_kv_generalcontactEmail = kv['general.contactEmail']) !== null && _kv_generalcontactEmail !== void 0 ? _kv_generalcontactEmail : '', supportPhone: (_kv_generalsupportPhone = kv['general.supportPhone']) !== null && _kv_generalsupportPhone !== void 0 ? _kv_generalsupportPhone : '' }); var _kv_smtphost, _kv_smtpport, _kv_smtpusername, _kv_smtppassword, _kv_smtpfromName, _kv_smtpfromEmail, _kv_smtpencryption; setSmtpForm({ host: (_kv_smtphost = kv['smtp.host']) !== null && _kv_smtphost !== void 0 ? _kv_smtphost : '', port: (_kv_smtpport = kv['smtp.port']) !== null && _kv_smtpport !== void 0 ? _kv_smtpport : '587', username: (_kv_smtpusername = kv['smtp.username']) !== null && _kv_smtpusername !== void 0 ? _kv_smtpusername : '', password: (_kv_smtppassword = kv['smtp.password']) !== null && _kv_smtppassword !== void 0 ? _kv_smtppassword : '', fromName: (_kv_smtpfromName = kv['smtp.fromName']) !== null && _kv_smtpfromName !== void 0 ? _kv_smtpfromName : 'CanHelp', fromEmail: (_kv_smtpfromEmail = kv['smtp.fromEmail']) !== null && _kv_smtpfromEmail !== void 0 ? _kv_smtpfromEmail : '', encryption: (_kv_smtpencryption = kv['smtp.encryption']) !== null && _kv_smtpencryption !== void 0 ? _kv_smtpencryption : 'tls' }); var _kv_paymentepaymerchantId, _kv_paymentepayapiUser, _kv_paymentepayapiPassword, _kv_paymentepayenvironment, _kv_paymentepayconfirmationUrl, _kv_paymentepaycancelUrl; setEPayForm({ merchantId: (_kv_paymentepaymerchantId = kv['payment.epay.merchantId']) !== null && _kv_paymentepaymerchantId !== void 0 ? _kv_paymentepaymerchantId : '', apiUser: (_kv_paymentepayapiUser = kv['payment.epay.apiUser']) !== null && _kv_paymentepayapiUser !== void 0 ? _kv_paymentepayapiUser : '', apiPassword: (_kv_paymentepayapiPassword = kv['payment.epay.apiPassword']) !== null && _kv_paymentepayapiPassword !== void 0 ? _kv_paymentepayapiPassword : '', environment: (_kv_paymentepayenvironment = kv['payment.epay.environment']) !== null && _kv_paymentepayenvironment !== void 0 ? _kv_paymentepayenvironment : 'test', confirmationUrl: (_kv_paymentepayconfirmationUrl = kv['payment.epay.confirmationUrl']) !== null && _kv_paymentepayconfirmationUrl !== void 0 ? _kv_paymentepayconfirmationUrl : '', cancelUrl: (_kv_paymentepaycancelUrl = kv['payment.epay.cancelUrl']) !== null && _kv_paymentepaycancelUrl !== void 0 ? _kv_paymentepaycancelUrl : '', enabled: kv['payment.epay.enabled'] === 'true' }); var _kv_referral_plan_id, _ref, _ref1, _kv_referral_days, _ref2, _ref3; setReferralForm({ enabled: kv['referral_enabled'] === 'true', planId: (_ref1 = (_ref = (_kv_referral_plan_id = kv['referral_plan_id']) !== null && _kv_referral_plan_id !== void 0 ? _kv_referral_plan_id : kv['referral_customer_plan_id']) !== null && _ref !== void 0 ? _ref : kv['referral_specialist_plan_id']) !== null && _ref1 !== void 0 ? _ref1 : '', days: (_ref3 = (_ref2 = (_kv_referral_days = kv['referral_days']) !== null && _kv_referral_days !== void 0 ? _kv_referral_days : kv['referral_customer_days']) !== null && _ref2 !== void 0 ? _ref2 : kv['referral_specialist_days']) !== null && _ref3 !== void 0 ? _ref3 : '30' }); var _kv_seoheadScripts, _kv_seositeTitleel, _ref4, _kv_seositeTitleen, _kv_seositeTitleru, _kv_seositeTitleuk, _kv_seositeDescriptionel, _ref5, _kv_seositeDescriptionen, _kv_seositeDescriptionru, _kv_seositeDescriptionuk; setSeoForm({ maintenanceMode: kv['seo.maintenanceMode'] === 'true', indexingEnabled: kv['seo.indexingEnabled'] !== 'false', headScripts: (_kv_seoheadScripts = kv['seo.headScripts']) !== null && _kv_seoheadScripts !== void 0 ? _kv_seoheadScripts : '', siteTitleEl: (_ref4 = (_kv_seositeTitleel = kv['seo.siteTitle.el']) !== null && _kv_seositeTitleel !== void 0 ? _kv_seositeTitleel : kv['seo.siteTitle']) !== null && _ref4 !== void 0 ? _ref4 : '', siteTitleEn: (_kv_seositeTitleen = kv['seo.siteTitle.en']) !== null && _kv_seositeTitleen !== void 0 ? _kv_seositeTitleen : '', siteTitleRu: (_kv_seositeTitleru = kv['seo.siteTitle.ru']) !== null && _kv_seositeTitleru !== void 0 ? _kv_seositeTitleru : '', siteTitleUk: (_kv_seositeTitleuk = kv['seo.siteTitle.uk']) !== null && _kv_seositeTitleuk !== void 0 ? _kv_seositeTitleuk : '', siteDescriptionEl: (_ref5 = (_kv_seositeDescriptionel = kv['seo.siteDescription.el']) !== null && _kv_seositeDescriptionel !== void 0 ? _kv_seositeDescriptionel : kv['seo.siteDescription']) !== null && _ref5 !== void 0 ? _ref5 : '', siteDescriptionEn: (_kv_seositeDescriptionen = kv['seo.siteDescription.en']) !== null && _kv_seositeDescriptionen !== void 0 ? _kv_seositeDescriptionen : '', siteDescriptionRu: (_kv_seositeDescriptionru = kv['seo.siteDescription.ru']) !== null && _kv_seositeDescriptionru !== void 0 ? _kv_seositeDescriptionru : '', siteDescriptionUk: (_kv_seositeDescriptionuk = kv['seo.siteDescription.uk']) !== null && _kv_seositeDescriptionuk !== void 0 ? _kv_seositeDescriptionuk : '' }); var _kv_socialtelegram, _kv_socialinstagram, _kv_socialfacebook, _kv_socialtwitter, _kv_socialyoutube, _kv_socialtiktok, _kv_socialwhatsapp, _kv_socialviber; setSocialForm({ telegram: (_kv_socialtelegram = kv['social.telegram']) !== null && _kv_socialtelegram !== void 0 ? _kv_socialtelegram : '', instagram: (_kv_socialinstagram = kv['social.instagram']) !== null && _kv_socialinstagram !== void 0 ? _kv_socialinstagram : '', facebook: (_kv_socialfacebook = kv['social.facebook']) !== null && _kv_socialfacebook !== void 0 ? _kv_socialfacebook : '', twitter: (_kv_socialtwitter = kv['social.twitter']) !== null && _kv_socialtwitter !== void 0 ? _kv_socialtwitter : '', youtube: (_kv_socialyoutube = kv['social.youtube']) !== null && _kv_socialyoutube !== void 0 ? _kv_socialyoutube : '', tiktok: (_kv_socialtiktok = kv['social.tiktok']) !== null && _kv_socialtiktok !== void 0 ? _kv_socialtiktok : '', whatsapp: (_kv_socialwhatsapp = kv['social.whatsapp']) !== null && _kv_socialwhatsapp !== void 0 ? _kv_socialwhatsapp : '', viber: (_kv_socialviber = kv['social.viber']) !== null && _kv_socialviber !== void 0 ? _kv_socialviber : '' }); var _kv_telegrambotToken, _kv_telegramadminChatId, _kv_telegramchannelIdel, _kv_telegramchannelIden, _kv_telegramchannelIdru, _kv_telegramchannelIduk; setTelegramForm({ botToken: (_kv_telegrambotToken = kv['telegram.botToken']) !== null && _kv_telegrambotToken !== void 0 ? _kv_telegrambotToken : '', adminChatId: (_kv_telegramadminChatId = kv['telegram.adminChatId']) !== null && _kv_telegramadminChatId !== void 0 ? _kv_telegramadminChatId : '', channelIdEl: (_kv_telegramchannelIdel = kv['telegram.channelId.el']) !== null && _kv_telegramchannelIdel !== void 0 ? _kv_telegramchannelIdel : '', channelIdEn: (_kv_telegramchannelIden = kv['telegram.channelId.en']) !== null && _kv_telegramchannelIden !== void 0 ? _kv_telegramchannelIden : '', channelIdRu: (_kv_telegramchannelIdru = kv['telegram.channelId.ru']) !== null && _kv_telegramchannelIdru !== void 0 ? _kv_telegramchannelIdru : '', channelIdUk: (_kv_telegramchannelIduk = kv['telegram.channelId.uk']) !== null && _kv_telegramchannelIduk !== void 0 ? _kv_telegramchannelIduk : '', notifyRegistrations: kv['telegram.notifyRegistrations'] === 'true', postNewTasks: kv['telegram.postNewTasks'] === 'true' }); }).catch(()=>{}); api.getAdminEmailTemplates().then((rows)=>{ const map = {}; for (const r of rows)map[r.key] = { subject: r.subject, body: r.body }; setNotifTemplates((prev)=>({ ...prev, ...map })); }).catch(()=>{}); }, [ isAdmin, tab ]); async function saveGeneralSettings() { setGeneralSaving(true); try { await api.updateAdminSettings({ 'general.siteName': generalForm.siteName, 'general.siteUrl': generalForm.siteUrl, 'general.contactEmail': generalForm.contactEmail, 'general.supportPhone': generalForm.supportPhone }); setGeneralSaved(true); setTimeout(()=>setGeneralSaved(false), 2500); } catch (e) {} finally{ setGeneralSaving(false); } } async function saveSmtpSettings() { setSmtpSaving(true); try { await api.updateAdminSettings({ 'smtp.host': smtpForm.host, 'smtp.port': smtpForm.port, 'smtp.username': smtpForm.username, 'smtp.password': smtpForm.password, 'smtp.fromName': smtpForm.fromName, 'smtp.fromEmail': smtpForm.fromEmail, 'smtp.encryption': smtpForm.encryption }); setSmtpSaved(true); setTimeout(()=>setSmtpSaved(false), 2500); } catch (e) {} finally{ setSmtpSaving(false); } } async function autoTranslateTemplate(key) { const localeKey = "".concat(key, "_").concat(templateLocale); var _notifTemplates_localeKey, _ref; const current = (_ref = (_notifTemplates_localeKey = notifTemplates[localeKey]) !== null && _notifTemplates_localeKey !== void 0 ? _notifTemplates_localeKey : notifTemplates[key]) !== null && _ref !== void 0 ? _ref : { subject: '', body: '' }; if (!current.subject && !current.body) return; setTemplateTranslating(true); try { // СПхраМяеЌ ОсхПЎМый язык в БД (еслО ещё Ме сПхраМёМ) await api.updateAdminEmailTemplate(localeKey, current); // ПеревПЎОЌ Ма ПстальМые языкО const results = await api.translateAdminEmailTemplate({ subject: current.subject, body: current.body, fromLocale: templateLocale }); // ОбМПвляеЌ state setNotifTemplates((prev)=>{ const next = { ...prev, [localeKey]: current }; for (const [loc, tpl] of Object.entries(results)){ next["".concat(key, "_").concat(loc)] = tpl; } return next; }); // СПхраМяеЌ кажЎый перевПЎ в БД await Promise.all(Object.entries(results).map((param)=>{ let [loc, tpl] = param; return api.updateAdminEmailTemplate("".concat(key, "_").concat(loc), tpl); })); } catch (e) {} finally{ setTemplateTranslating(false); } } async function saveTemplate(key) { const localeKey = "".concat(key, "_").concat(templateLocale); setTemplateSaving(true); try { var _notifTemplates_localeKey; await api.updateAdminEmailTemplate(localeKey, (_notifTemplates_localeKey = notifTemplates[localeKey]) !== null && _notifTemplates_localeKey !== void 0 ? _notifTemplates_localeKey : { subject: '', body: '' }); setEditingTemplate(null); } catch (e) {} finally{ setTemplateSaving(false); } } async function saveEPaySettings() { setEPaySaving(true); try { await api.updateAdminSettings({ 'payment.epay.merchantId': ePayForm.merchantId, 'payment.epay.apiUser': ePayForm.apiUser, 'payment.epay.apiPassword': ePayForm.apiPassword, 'payment.epay.environment': ePayForm.environment, 'payment.epay.confirmationUrl': ePayForm.confirmationUrl, 'payment.epay.cancelUrl': ePayForm.cancelUrl, 'payment.epay.enabled': String(ePayForm.enabled) }); setEPaySaved(true); setTimeout(()=>setEPaySaved(false), 2500); } catch (e) {} finally{ setEPaySaving(false); } } async function saveReferralSettings() { setReferralSaving(true); try { await api.updateAdminSettings({ 'referral_enabled': String(referralForm.enabled), 'referral_plan_id': referralForm.planId, 'referral_days': referralForm.days }); setReferralSaved(true); setTimeout(()=>setReferralSaved(false), 2500); } catch (e) {} finally{ setReferralSaving(false); } } async function saveSeoSettings() { setSeoSaving(true); try { await api.updateAdminSettings({ 'seo.maintenanceMode': String(seoForm.maintenanceMode), 'seo.indexingEnabled': String(seoForm.indexingEnabled), 'seo.headScripts': seoForm.headScripts, 'seo.siteTitle.el': seoForm.siteTitleEl, 'seo.siteTitle.en': seoForm.siteTitleEn, 'seo.siteTitle.ru': seoForm.siteTitleRu, 'seo.siteTitle.uk': seoForm.siteTitleUk, 'seo.siteDescription.el': seoForm.siteDescriptionEl, 'seo.siteDescription.en': seoForm.siteDescriptionEn, 'seo.siteDescription.ru': seoForm.siteDescriptionRu, 'seo.siteDescription.uk': seoForm.siteDescriptionUk }); setSeoSaved(true); setTimeout(()=>setSeoSaved(false), 2500); } catch (e) {} finally{ setSeoSaving(false); } } async function saveSocialSettings() { setSocialSaving(true); try { await api.updateAdminSettings({ 'social.telegram': socialForm.telegram, 'social.instagram': socialForm.instagram, 'social.facebook': socialForm.facebook, 'social.twitter': socialForm.twitter, 'social.youtube': socialForm.youtube, 'social.tiktok': socialForm.tiktok, 'social.whatsapp': socialForm.whatsapp, 'social.viber': socialForm.viber }); setSocialSaved(true); setTimeout(()=>setSocialSaved(false), 2500); } catch (e) {} finally{ setSocialSaving(false); } } async function saveTelegramSettings() { setTelegramSaving(true); try { await api.updateAdminSettings({ 'telegram.botToken': telegramForm.botToken, 'telegram.adminChatId': telegramForm.adminChatId, 'telegram.channelId.el': telegramForm.channelIdEl, 'telegram.channelId.en': telegramForm.channelIdEn, 'telegram.channelId.ru': telegramForm.channelIdRu, 'telegram.channelId.uk': telegramForm.channelIdUk, 'telegram.notifyRegistrations': String(telegramForm.notifyRegistrations), 'telegram.postNewTasks': String(telegramForm.postNewTasks) }); setTelegramSaved(true); setTimeout(()=>setTelegramSaved(false), 2500); } catch (e) {} finally{ setTelegramSaving(false); } } async function testTelegram(type) { const chatIdMap = { admin: telegramForm.adminChatId, el: telegramForm.channelIdEl, en: telegramForm.channelIdEn, ru: telegramForm.channelIdRu, uk: telegramForm.channelIdUk }; var _chatIdMap_type; const chatId = (_chatIdMap_type = chatIdMap[type]) !== null && _chatIdMap_type !== void 0 ? _chatIdMap_type : ''; if (type === 'admin') { setTestingTelegramAdmin(true); setTestResultTelegramAdmin(null); } else { setTestingLocale(type); setTestResultChannels((p)=>{ const n = { ...p }; delete n[type]; return n; }); } try { const res = await api.testTelegramConnection(telegramForm.botToken, chatId); var _res_error; const result = { ok: res.ok, msg: res.ok ? res.botName ? "@".concat(res.botName) : t('admin.settings.telegram.test_ok') : (_res_error = res.error) !== null && _res_error !== void 0 ? _res_error : t('admin.settings.telegram.test_fail') }; if (type === 'admin') setTestResultTelegramAdmin(result); else setTestResultChannels((p)=>({ ...p, [type]: result })); } catch (e) { const result = { ok: false, msg: t('admin.settings.telegram.test_fail') }; if (type === 'admin') setTestResultTelegramAdmin(result); else setTestResultChannels((p)=>({ ...p, [type]: result })); } finally{ if (type === 'admin') setTestingTelegramAdmin(false); else setTestingLocale(null); } } async function verifyTelegramToken() { setVerifyingTelegramToken(true); setVerifyResultTelegramToken(null); try { const res = await api.verifyTelegramToken(telegramForm.botToken); var _res_error; setVerifyResultTelegramToken({ ok: res.ok, msg: res.ok ? "@".concat(res.botName) : (_res_error = res.error) !== null && _res_error !== void 0 ? _res_error : t('admin.settings.telegram.test_fail') }); } catch (e) { setVerifyResultTelegramToken({ ok: false, msg: t('admin.settings.telegram.test_fail') }); } finally{ setVerifyingTelegramToken(false); } } if (isPending) return /*#__PURE__*/ _jsx("div", { className: "text-center py-20 text-gray-500", children: t('common.loading') }); const dateLocale = locale === 'ru' ? 'ru-RU' : locale === 'en' ? 'en-US' : 'el-GR'; const catName = (id)=>{ const cat = catRows.find((c)=>c.id === id); if (!cat) return id; if (locale === 'en') return cat.namesEn || cat.namesEl; if (locale === 'ru') return cat.namesRu || cat.namesEl; if (locale === 'uk') return cat.namesUk || cat.namesEl; return cat.namesEl || cat.namesEn || id; }; const locName = (id)=>{ const loc = locRows.find((l)=>l.id === id); if (!loc) return id; if (locale === 'en') return loc.nameEn || loc.nameEl; if (locale === 'ru') return loc.nameRu || loc.nameEl; if (locale === 'uk') return loc.nameUk || loc.nameEl; return loc.nameEl || loc.nameEn || id; }; const TABS = [ { key: 'stats', label: t('admin.tab.stats'), icon: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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: t('admin.tab.users'), icon: /*#__PURE__*/ _jsxs("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M17 21v-2a4 4 0 00-4-4H5a4 4 0 00-4 4v2" }), /*#__PURE__*/ _jsx("circle", { cx: "9", cy: "7", r: "4" }), /*#__PURE__*/ _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: t('admin.tab.tasks'), icon: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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: t('admin.tab.reports'), badge: pendingReportsCount || undefined, icon: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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: t('admin.tab.moderation'), badge: pendingCardsCount || undefined, icon: /*#__PURE__*/ _jsxs("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ _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" }), /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 20h12" }) ] }) }, { key: 'categories', label: t('admin.tab.categories'), icon: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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: t('admin.tab.locations'), icon: /*#__PURE__*/ _jsxs("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ _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" }), /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 11a3 3 0 11-6 0 3 3 0 016 0z" }) ] }) }, { key: 'balances', label: t('admin.tab.balances', 'Balance'), icon: /*#__PURE__*/ _jsxs("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ _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" }), /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M20 12h-6m0 0a2 2 0 100 4h6v-8h-6a2 2 0 100 4z" }) ] }) }, { key: 'plans', label: t('admin.tab.plans'), icon: /*#__PURE__*/ _jsxs("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ _jsx("rect", { x: "1", y: "4", width: "22", height: "16", rx: "2", ry: "2" }), /*#__PURE__*/ _jsx("line", { x1: "1", y1: "10", x2: "23", y2: "10" }) ] }) }, { key: 'logs', label: t('admin.tab.logs'), icon: /*#__PURE__*/ _jsxs("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ _jsx("polyline", { points: "4 17 10 11 4 5" }), /*#__PURE__*/ _jsx("line", { x1: "12", y1: "19", x2: "20", y2: "19" }) ] }) }, { key: 'settings', label: t('admin.tab.settings'), icon: /*#__PURE__*/ _jsxs("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ _jsx("circle", { cx: "12", cy: "12", r: "3" }), /*#__PURE__*/ _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: t('admin.tab.support', 'Support'), icon: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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: t('admin.tab.push', 'Push'), icon: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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: t('admin.tab.backup', 'Backup'), icon: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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: t('admin.tab.translations', 'Translations'), icon: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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: t('admin.tab.dbcheck', 'DB check'), icon: /*#__PURE__*/ _jsxs("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ _jsx("ellipse", { cx: "12", cy: "5", rx: "9", ry: "3" }), /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M21 12c0 1.66-4.03 3-9 3S3 13.66 3 12" }), /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M3 5v14c0 1.66 4.03 3 9 3s9-1.34 9-3V5" }), /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 12l2 2 4-4" }) ] }) }, { key: 'referrals', label: t('admin.tab.referrals', 'Referrals'), icon: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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" }) }) } ]; const statusColors = { 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' }; const reportStatusColors = { pending: 'bg-yellow-100 text-yellow-700', reviewed: 'bg-green-100 text-green-700', dismissed: 'bg-gray-100 text-gray-500' }; const reasonColors = { 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' }; const cardStatus = (card)=>{ var _card_publicationStatus; return (_card_publicationStatus = card.publicationStatus) !== null && _card_publicationStatus !== void 0 ? _card_publicationStatus : card.isActive ? 'active' : 'inactive'; }; const pendingModerationCards = moderationCards.filter((card)=>cardStatus(card) === 'pending'); const activeModerationCards = moderationCards.filter((card)=>cardStatus(card) === 'active'); var _stats_totalCostUsd, _planForm_oldPrice, _pushResult_tokensFound, _pushResult_usersWithoutTokens, _pushResult_usersConfigBlocked, _pushResult_usersAuthFailed, _pushResult_usersAllFailed, _pushResult_usersWithoutTokens1, _pushResult_usersConfigBlocked1, _pushResult_usersAuthFailed1, _pushResult_usersAllFailed1, _referralsData_totalReferrers, _referralsData_totalReferrals, _referralsData_activeRewards, _editUser_firstName, _editUser_lastName, _editUser_phone, _editUser_bio, _editUser_planId, _editUser_locale, _editUser_balance, _editUser_showContactInfo, _editUser_notifyNewTasks, _editUser_notifMessages, _editUser_personalSiteSlug, _editUser_siteSettings, _siteTheme, _editUser_skills, _editUser_balance1, _editUser_topUpAmount, _editUser_withdrawAmount, _editUser_topUpDescription, _editUser_withdrawDescription; return /*#__PURE__*/ _jsx("div", { className: "min-h-screen bg-gray-50", children: /*#__PURE__*/ _jsxs("div", { className: "max-w-7xl mx-auto px-4 py-8", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between mb-6", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-7 h-7 text-yellow-500", fill: "currentColor", viewBox: "0 0 24 24", children: /*#__PURE__*/ _jsx("path", { d: "M5 16L3 5l5.5 5L12 4l3.5 6L21 5l-2 11H5zm0 3a1 1 0 000 2h14a1 1 0 000-2H5z" }) }), /*#__PURE__*/ _jsx("h1", { className: "text-2xl font-bold text-gray-900", children: t('admin.title') }) ] }), /*#__PURE__*/ _jsxs(Link, { href: "/", className: "flex items-center gap-1.5 text-sm text-gray-500 hover:text-green-600 transition", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 19l-7-7 7-7" }) }), t('admin.back_home') ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-6", children: [ /*#__PURE__*/ _jsx("aside", { className: "shrink-0 transition-all duration-200 ".concat(sidebarCollapsed ? 'w-12' : 'w-52'), children: /*#__PURE__*/ _jsxs("nav", { className: "bg-white rounded-xl border border-gray-200 overflow-hidden", children: [ /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setSidebarCollapsed((v)=>!v), title: sidebarCollapsed ? 'РазверМуть ЌеМю' : 'СверМуть ЌеМю', 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: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 transition-transform duration-200 ".concat(sidebarCollapsed ? 'rotate-180' : ''), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 19l-7-7 7-7" }) }) }), TABS.map((param)=>{ let { key, label, icon, badge } = param; return /*#__PURE__*/ _jsxs("button", { onClick: ()=>setTab(key), title: sidebarCollapsed ? label : undefined, className: "w-full flex items-center py-3 text-sm font-medium text-left transition ".concat(tab === key ? 'bg-green-50 text-green-700 border-r-2 border-green-600' : 'text-gray-600 hover:bg-gray-50 hover:text-gray-900', " ").concat(sidebarCollapsed ? 'justify-center px-3' : 'gap-3 px-4'), children: [ /*#__PURE__*/ _jsx("span", { className: "w-4 h-4 flex-shrink-0 flex items-center justify-center", children: icon }), !sidebarCollapsed && /*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-2 min-w-0", children: [ /*#__PURE__*/ _jsx("span", { children: label }), badge ? /*#__PURE__*/ _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: badge }) : null ] }) ] }, key); }) ] }) }), /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-0", children: [ tab === 'stats' && /*#__PURE__*/ _jsxs("div", { className: "space-y-6", children: [ /*#__PURE__*/ _jsx("div", { className: "grid grid-cols-2 md:grid-cols-5 gap-4", children: [ { label: t('admin.stats.users'), value: stats === null || stats === void 0 ? void 0 : stats.userCount, icon: /*#__PURE__*/ _jsx("svg", { className: "w-8 h-8", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ _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: t('admin.stats.specialists'), value: stats === null || stats === void 0 ? void 0 : stats.specialistCount, icon: /*#__PURE__*/ _jsxs("svg", { className: "w-8 h-8", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: [ /*#__PURE__*/ _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" }), /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 12a3 3 0 11-6 0 3 3 0 016 0z" }) ] }), color: 'text-purple-600' }, { label: t('admin.stats.tasks'), value: stats === null || stats === void 0 ? void 0 : stats.taskCount, icon: /*#__PURE__*/ _jsx("svg", { className: "w-8 h-8", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ _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: t('admin.stats.offers'), value: stats === null || stats === void 0 ? void 0 : stats.offerCount, icon: /*#__PURE__*/ _jsx("svg", { className: "w-8 h-8", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ _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: t('admin.stats.reviews'), value: stats === null || stats === void 0 ? void 0 : stats.reviewCount, icon: /*#__PURE__*/ _jsx("svg", { className: "w-8 h-8", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ _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((param)=>{ let { label, value, icon, color } = param; return /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-5", children: [ /*#__PURE__*/ _jsx("div", { className: "mb-2 ".concat(color), children: icon }), /*#__PURE__*/ _jsx("div", { className: "text-3xl font-bold ".concat(color), children: value !== null && value !== void 0 ? value : '—' }), /*#__PURE__*/ _jsx("div", { className: "text-sm text-gray-500 mt-1", children: label }) ] }, label); }) }), (stats === null || stats === void 0 ? void 0 : stats.tasksByDay) && /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between mb-4", children: [ /*#__PURE__*/ _jsx("h2", { className: "font-semibold text-gray-800", children: t('admin.stats.activity_30d') }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-4 text-xs text-gray-500", children: [ /*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-1.5", children: [ /*#__PURE__*/ _jsx("span", { className: "w-3 h-0.5 bg-green-500 inline-block rounded" }), t('admin.stats.users_label') ] }), /*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-1.5", children: [ /*#__PURE__*/ _jsx("span", { className: "w-3 h-0.5 bg-purple-400 inline-block rounded" }), t('admin.stats.specialists_label') ] }), /*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-1.5", children: [ /*#__PURE__*/ _jsx("span", { className: "w-3 h-0.5 bg-green-500 inline-block rounded" }), t('admin.stats.tasks_label') ] }) ] }) ] }), /*#__PURE__*/ _jsx(AdminAreaChart, { series: [ { data: stats.usersByDay, color: '#3b82f6', fill: '#3b82f615', label: t('admin.stats.users_label') }, { data: stats.specialistsByDay, color: '#a855f7', fill: '#a855f710', label: t('admin.stats.specialists_label') }, { data: stats.tasksByDay, color: '#22c55e', fill: '#22c55e10', label: t('admin.stats.tasks_label') } ] }) ] }), (stats === null || stats === void 0 ? void 0 : stats.tasksByStatus) && /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ _jsx("h2", { className: "font-semibold text-gray-800 mb-5", children: t('admin.stats.tasks_by_status') }), /*#__PURE__*/ _jsx("div", { className: "space-y-3", children: (()=>{ const total = stats.tasksByStatus.reduce((s, r)=>s + Number(r.count), 0) || 1; const statusMeta = { open: { label: t('admin.task_status.open'), bg: 'bg-green-50', bar: 'bg-green-500' }, in_progress: { label: t('admin.task_status.in_progress'), bg: 'bg-green-50', bar: 'bg-green-500' }, completed: { label: t('admin.task_status.completed'), bg: 'bg-gray-50', bar: 'bg-gray-400' }, cancelled: { label: t('admin.task_status.cancelled'), bg: 'bg-red-50', bar: 'bg-red-400' }, draft: { label: t('admin.task_status.draft'), bg: 'bg-yellow-50', bar: 'bg-yellow-400' } }; const order = [ 'open', 'in_progress', 'completed', 'draft', 'cancelled' ]; const sorted = [ ...stats.tasksByStatus ].sort((a, b)=>order.indexOf(a.status) - order.indexOf(b.status)); return sorted.map((param)=>{ let { status, count: c } = param; var _statusMeta_status; const meta = (_statusMeta_status = statusMeta[status]) !== null && _statusMeta_status !== void 0 ? _statusMeta_status : { label: status, bg: 'bg-gray-50', bar: 'bg-gray-300' }; const pct = Math.round(Number(c) / total * 100); return /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 px-3 py-2 rounded-lg ".concat(meta.bg), children: [ /*#__PURE__*/ _jsx("span", { className: "text-sm text-gray-600 w-28 shrink-0", children: meta.label }), /*#__PURE__*/ _jsx("div", { className: "flex-1 bg-gray-200 rounded-full h-2 overflow-hidden", children: /*#__PURE__*/ _jsx("div", { className: "h-full rounded-full ".concat(meta.bar, " transition-all"), style: { width: "".concat(pct, "%") } }) }), /*#__PURE__*/ _jsx("span", { className: "text-sm font-semibold text-gray-700 w-8 text-right", children: c }), /*#__PURE__*/ _jsxs("span", { className: "text-xs text-gray-400 w-8", children: [ pct, "%" ] }) ] }, status); }); })() }) ] }), notifsByDay.length > 0 && /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between mb-4", children: [ /*#__PURE__*/ _jsx("h2", { className: "font-semibold text-gray-800", children: t('admin.stats.notif_chart_title') }), /*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-1.5 text-xs text-gray-500", children: [ /*#__PURE__*/ _jsx("span", { className: "w-3 h-0.5 bg-orange-500 inline-block rounded" }), t('admin.stats.notif_label') ] }) ] }), /*#__PURE__*/ _jsx(AdminAreaChart, { series: [ { data: notifsByDay, color: '#f97316', fill: '#f9731615', label: t('admin.stats.notif_label') } ] }) ] }), mailByDay.length > 0 && /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between mb-4", children: [ /*#__PURE__*/ _jsx("h2", { className: "font-semibold text-gray-800", children: t('admin.stats.mail_chart_title') }), /*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-1.5 text-xs text-gray-500", children: [ /*#__PURE__*/ _jsx("span", { className: "w-3 h-0.5 bg-sky-500 inline-block rounded" }), t('admin.stats.mail_label') ] }) ] }), /*#__PURE__*/ _jsx(AdminAreaChart, { series: [ { data: mailByDay, color: '#0ea5e9', fill: '#0ea5e915', label: t('admin.stats.mail_label') } ] }) ] }), stats && /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6 space-y-5", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between", children: [ /*#__PURE__*/ _jsx("h2", { className: "font-semibold text-gray-800", children: t('admin.stats.tokens_title') }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-4 text-xs text-gray-500", children: [ /*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-1.5", children: [ /*#__PURE__*/ _jsx("span", { className: "w-3 h-0.5 bg-violet-500 inline-block rounded" }), t('admin.stats.tokens_out') ] }), /*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-1.5", children: [ /*#__PURE__*/ _jsx("span", { className: "w-3 h-0.5 bg-sky-500 inline-block rounded" }), t('admin.stats.tokens_in') ] }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "grid grid-cols-3 gap-4", children: [ /*#__PURE__*/ _jsxs("div", { className: "rounded-lg bg-violet-50 border border-violet-100 px-4 py-3", children: [ /*#__PURE__*/ _jsx("div", { className: "text-xs text-violet-600 mb-1", children: t('admin.stats.tokens_out_label') }), /*#__PURE__*/ _jsx("div", { className: "text-2xl font-bold text-violet-700", children: Number(stats.totalOutputTokens).toLocaleString() }) ] }), /*#__PURE__*/ _jsxs("div", { className: "rounded-lg bg-sky-50 border border-sky-100 px-4 py-3", children: [ /*#__PURE__*/ _jsx("div", { className: "text-xs text-sky-600 mb-1", children: t('admin.stats.tokens_in_label') }), /*#__PURE__*/ _jsx("div", { className: "text-2xl font-bold text-sky-700", children: Number(stats.totalInputTokens).toLocaleString() }) ] }), /*#__PURE__*/ _jsxs("div", { className: "rounded-lg bg-emerald-50 border border-emerald-100 px-4 py-3", children: [ /*#__PURE__*/ _jsx("div", { className: "text-xs text-emerald-600 mb-1", children: t('admin.stats.cost_label') }), /*#__PURE__*/ _jsxs("div", { className: "text-2xl font-bold text-emerald-700", children: [ "$", Number((_stats_totalCostUsd = stats.totalCostUsd) !== null && _stats_totalCostUsd !== void 0 ? _stats_totalCostUsd : 0).toFixed(4) ] }) ] }) ] }), ((_stats_tokensByMonth = stats.tokensByMonth) === null || _stats_tokensByMonth === void 0 ? void 0 : _stats_tokensByMonth.length) > 0 && /*#__PURE__*/ _jsx(AdminMonthChart, { dateLocale: dateLocale, series: [ { data: stats.tokensByMonth.map((r)=>({ month: r.month, count: Number(r.output) })), color: '#8b5cf6', fill: '#8b5cf610', label: t('admin.stats.tokens_out_label') }, { data: stats.tokensByMonth.map((r)=>({ month: r.month, count: Number(r.input) })), color: '#0ea5e9', fill: '#0ea5e915', label: t('admin.stats.tokens_in_label') } ] }) ] }) ] }), tab === 'users' && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("div", { className: "flex gap-3 mb-4", children: [ /*#__PURE__*/ _jsxs("form", { className: "flex gap-2 flex-1", onSubmit: (e)=>{ e.preventDefault(); setUsersQ(usersQInput); }, children: [ /*#__PURE__*/ _jsx("input", { value: usersQInput, onChange: (e)=>setUsersQInput(e.target.value), placeholder: t('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" }), /*#__PURE__*/ _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: t('tasks.search.btn') }) ] }), /*#__PURE__*/ _jsxs("select", { value: usersRole, onChange: (e)=>setUsersRole(e.target.value), className: "border border-gray-300 rounded-lg px-3 py-2 text-sm", children: [ /*#__PURE__*/ _jsx("option", { value: "", children: t('admin.filter.all_roles') }), /*#__PURE__*/ _jsx("option", { value: "user", children: t('admin.user_edit.role.user') }), /*#__PURE__*/ _jsx("option", { value: "admin", children: t('profile.role.admin') }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 overflow-hidden", children: [ /*#__PURE__*/ _jsxs("table", { className: "w-full text-sm", children: [ /*#__PURE__*/ _jsx("thead", { className: "bg-gray-50 text-left", children: /*#__PURE__*/ _jsxs("tr", { children: [ /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.col.user') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.col.email') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.col.role') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.col.plan', 'Plan') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.col.registered') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.col.status') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3" }) ] }) }), /*#__PURE__*/ _jsx("tbody", { className: "divide-y divide-gray-100", children: loading ? /*#__PURE__*/ _jsx("tr", { children: /*#__PURE__*/ _jsx("td", { colSpan: 6, className: "px-4 py-8 text-center text-gray-400", children: t('common.loading') }) }) : users.length === 0 ? /*#__PURE__*/ _jsx("tr", { children: /*#__PURE__*/ _jsx("td", { colSpan: 6, className: "px-4 py-8 text-center text-gray-400", children: "—" }) }) : users.map((u)=>{ var _planRows_find; var _planRows_find_name; return /*#__PURE__*/ _jsxs("tr", { className: "hover:bg-gray-50", children: [ /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 font-medium text-gray-800", children: formatShortName(u.firstName, u.lastName, u.name) }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-gray-500", children: u.email }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3", children: /*#__PURE__*/ _jsx("span", { className: "px-2 py-0.5 rounded-full text-xs font-medium ".concat(u.role === 'admin' ? 'bg-red-100 text-red-700' : u.role === 'specialist' ? 'bg-green-100 text-green-700' : 'bg-gray-100 text-gray-600'), children: t("profile.role.".concat(u.role)) || u.role }) }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-gray-400 text-xs", children: u.planId ? (_planRows_find_name = (_planRows_find = planRows.find((p)=>p.id === u.planId)) === null || _planRows_find === void 0 ? void 0 : _planRows_find.name) !== null && _planRows_find_name !== void 0 ? _planRows_find_name : /*#__PURE__*/ _jsxs("span", { className: "font-mono", children: [ u.planId.slice(0, 8), "
" ] }) : /*#__PURE__*/ _jsx("span", { className: "text-gray-300", children: "—" }) }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-gray-400", children: new Date(u.createdAt).toLocaleDateString(dateLocale) }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3", children: /*#__PURE__*/ _jsx("span", { className: "px-2 py-0.5 rounded-full text-xs font-medium ".concat(u.isActive !== false ? 'bg-green-100 text-green-700' : 'bg-red-100 text-red-600'), children: u.isActive !== false ? t('admin.users.active') : t('admin.users.inactive') }) }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-right", children: /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-end gap-1.5", children: [ /*#__PURE__*/ _jsx("button", { onClick: ()=>openEditUser(u), 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: /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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" }) }) }), u.role !== 'admin' && /*#__PURE__*/ _jsx("button", { onClick: ()=>toggleUser(u.id, u.isActive !== false), className: "text-xs px-3 py-1 rounded-lg font-medium ".concat(u.isActive !== false ? 'bg-red-50 text-red-600 hover:bg-red-100' : 'bg-green-50 text-green-600 hover:bg-green-100'), children: u.isActive !== false ? t('admin.users.deactivate') : t('admin.users.activate') }) ] }) }) ] }, u.id); }) }) ] }), /*#__PURE__*/ _jsx(Pagination, { page: usersPage, total: usersTotal, limit: 20, onChange: setUsersPage, totalLabel: t('admin.pagination.total') }) ] }) ] }), tab === 'balances' && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("div", { className: "flex flex-wrap gap-3 mb-4", children: [ /*#__PURE__*/ _jsx("input", { value: balanceUserId, onChange: (e)=>setBalanceUserId(e.target.value), placeholder: t('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" }), /*#__PURE__*/ _jsxs("select", { value: balanceKind, onChange: (e)=>setBalanceKind(e.target.value), className: "border border-gray-300 rounded-lg px-3 py-2 text-sm", children: [ /*#__PURE__*/ _jsx("option", { value: "", children: t('admin.balance.filter.all', 'All operations') }), /*#__PURE__*/ _jsx("option", { value: "topup", children: t('admin.balance.kind.topup', 'Top-up') }), /*#__PURE__*/ _jsx("option", { value: "plan_purchase", children: t('admin.balance.kind.plan_purchase', 'Plan charge') }), /*#__PURE__*/ _jsx("option", { value: "admin_topup", children: t('admin.balance.kind.admin_topup', 'Admin top-up') }), /*#__PURE__*/ _jsx("option", { value: "admin_adjustment", children: t('admin.balance.kind.admin_adjustment', 'Adjustment') }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 overflow-hidden", children: [ /*#__PURE__*/ _jsxs("table", { className: "w-full text-sm", children: [ /*#__PURE__*/ _jsx("thead", { className: "bg-gray-50 text-left", children: /*#__PURE__*/ _jsxs("tr", { children: [ /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.col.user') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.balance.col.operation', 'Operation') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.balance.col.amount', 'Amount') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.balance.col.result', 'Balance') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.balance.col.description', 'Description') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.balance.col.date', 'Date') }) ] }) }), /*#__PURE__*/ _jsx("tbody", { className: "divide-y divide-gray-100", children: loading ? /*#__PURE__*/ _jsx("tr", { children: /*#__PURE__*/ _jsx("td", { colSpan: 6, className: "px-4 py-8 text-center text-gray-400", children: t('common.loading') }) }) : balanceRows.length === 0 ? /*#__PURE__*/ _jsx("tr", { children: /*#__PURE__*/ _jsx("td", { colSpan: 6, className: "px-4 py-8 text-center text-gray-400", children: t('admin.balance.empty', 'No records yet') }) }) : balanceRows.map((row)=>{ const isCredit = row.direction === 'credit'; const kindLabel = row.kind === 'topup' ? t('admin.balance.kind.topup', 'Top-up') : row.kind === 'plan_purchase' ? t('admin.balance.kind.plan_purchase', 'Plan charge') : row.kind === 'admin_topup' ? t('admin.balance.kind.admin_topup', 'Admin top-up') : t('admin.balance.kind.admin_adjustment', 'Adjustment'); return /*#__PURE__*/ _jsxs("tr", { className: "hover:bg-gray-50 align-top", children: [ /*#__PURE__*/ _jsxs("td", { className: "px-4 py-3", children: [ /*#__PURE__*/ _jsx("div", { className: "font-medium text-gray-800", children: row.userName || '—' }), /*#__PURE__*/ _jsx("div", { className: "text-xs text-gray-500 mt-0.5", children: row.userEmail || row.userId }) ] }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3", children: /*#__PURE__*/ _jsx("span", { className: "inline-flex rounded-full px-2 py-0.5 text-xs font-medium ".concat(isCredit ? 'bg-emerald-50 text-emerald-700' : 'bg-rose-50 text-rose-700'), children: kindLabel }) }), /*#__PURE__*/ _jsxs("td", { className: "px-4 py-3 font-semibold ".concat(isCredit ? 'text-emerald-700' : 'text-rose-700'), children: [ isCredit ? '+' : '-', Number(row.amount).toFixed(2), " ", row.currency ] }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-gray-600", children: /*#__PURE__*/ _jsxs("div", { children: [ Number(row.balanceBefore).toFixed(2), " → ", Number(row.balanceAfter).toFixed(2), " ", row.currency ] }) }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-gray-500 max-w-sm", children: row.description || '—' }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-gray-500 whitespace-nowrap", children: new Date(row.createdAt).toLocaleString(dateLocale) }) ] }, row.id); }) }) ] }), /*#__PURE__*/ _jsx(Pagination, { page: balancePage, total: balanceTotal, limit: 50, onChange: setBalancePage, totalLabel: t('admin.pagination.total') }) ] }) ] }), tab === 'tasks' && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("div", { className: "flex gap-3 mb-4", children: [ /*#__PURE__*/ _jsxs("form", { className: "flex gap-2 flex-1", onSubmit: (e)=>{ e.preventDefault(); setTasksQ(tasksQInput); }, children: [ /*#__PURE__*/ _jsx("input", { value: tasksQInput, onChange: (e)=>setTasksQInput(e.target.value), placeholder: t('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" }), /*#__PURE__*/ _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: t('tasks.search.btn') }) ] }), /*#__PURE__*/ _jsxs("select", { value: tasksStatus, onChange: (e)=>setTasksStatus(e.target.value), className: "border border-gray-300 rounded-lg px-3 py-2 text-sm", children: [ /*#__PURE__*/ _jsx("option", { value: "", children: t('admin.filter.all_statuses') }), [ 'open', 'in_progress', 'completed', 'cancelled', 'draft' ].map((s)=>/*#__PURE__*/ _jsx("option", { value: s, children: t("task.status.".concat(s), s) }, s)) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 overflow-hidden", children: [ /*#__PURE__*/ _jsxs("table", { className: "w-full text-sm", children: [ /*#__PURE__*/ _jsx("thead", { className: "bg-gray-50 text-left", children: /*#__PURE__*/ _jsxs("tr", { children: [ /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.col.title') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.col.customer') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.col.status') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.col.budget') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.col.created') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3" }) ] }) }), /*#__PURE__*/ _jsx("tbody", { className: "divide-y divide-gray-100", children: loading ? /*#__PURE__*/ _jsx("tr", { children: /*#__PURE__*/ _jsx("td", { colSpan: 6, className: "px-4 py-8 text-center text-gray-400", children: t('common.loading') }) }) : tasks.length === 0 ? /*#__PURE__*/ _jsx("tr", { children: /*#__PURE__*/ _jsx("td", { colSpan: 6, className: "px-4 py-8 text-center text-gray-400", children: "—" }) }) : tasks.map((row)=>{ const task = row.task || row; const customer = row.customer; var _customer_name, _statusColors_task_status; return /*#__PURE__*/ _jsxs("tr", { className: "hover:bg-gray-50", children: [ /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 font-medium text-gray-800 max-w-xs", children: /*#__PURE__*/ _jsx(Link, { href: "/tasks/".concat(task.id), className: "hover:text-green-600 truncate block", target: "_blank", children: locale === 'en' && task.titleEn || locale === 'ru' && task.titleRu || locale === 'uk' && task.titleUk || task.titleEl || task.title }) }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-gray-500 text-xs", children: (_customer_name = customer === null || customer === void 0 ? void 0 : customer.name) !== null && _customer_name !== void 0 ? _customer_name : '—' }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3", children: /*#__PURE__*/ _jsx("span", { className: "px-2 py-0.5 rounded-full text-xs font-medium ".concat((_statusColors_task_status = statusColors[task.status]) !== null && _statusColors_task_status !== void 0 ? _statusColors_task_status : 'bg-gray-100 text-gray-600'), children: t("task.status.".concat(task.status), task.status) }) }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-gray-500", children: task.budget ? "".concat(formatPrice(task.budget), "€") : '—' }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-gray-400", children: new Date(task.createdAt).toLocaleDateString(dateLocale) }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-right", children: /*#__PURE__*/ _jsxs("div", { className: "flex gap-1.5 justify-end", children: [ task.status !== 'cancelled' && task.status !== 'completed' && /*#__PURE__*/ _jsx("button", { onClick: ()=>cancelTask(task.id), className: "text-xs px-2.5 py-1 rounded-lg font-medium bg-yellow-50 text-yellow-700 hover:bg-yellow-100", children: t('admin.tasks.cancel') }), /*#__PURE__*/ _jsx("button", { onClick: ()=>deleteTask(task.id, locale === 'en' && task.titleEn || locale === 'ru' && task.titleRu || locale === 'uk' && task.titleUk || task.titleEl || task.title), className: "text-xs px-2.5 py-1 rounded-lg font-medium bg-red-50 text-red-600 hover:bg-red-100", children: t('admin.tasks.delete') }) ] }) }) ] }, task.id); }) }) ] }), /*#__PURE__*/ _jsx(Pagination, { page: tasksPage, total: tasksTotal, limit: 20, onChange: setTasksPage, totalLabel: t('admin.pagination.total') }) ] }) ] }), tab === 'categories' && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("div", { className: "flex justify-between items-center mb-4", children: [ /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-500", children: t('admin.cat.hint') }), /*#__PURE__*/ _jsxs("button", { onClick: ()=>openAddCat(null), className: "px-4 py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700", children: [ "+ ", t('admin.cat.add_root') ] }) ] }), catForm && /*#__PURE__*/ _jsxs("div", { className: "bg-green-50 border border-green-200 rounded-xl p-5 mb-4", children: [ /*#__PURE__*/ _jsxs("h3", { className: "font-semibold text-gray-800 mb-4", children: [ catForm.id ? t('admin.cat.edit') : t('admin.cat.new'), catForm.parentId && /*#__PURE__*/ _jsxs("span", { className: "text-xs text-gray-400 ml-2", children: [ "(", t('admin.cat.subcategory'), ")" ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "grid grid-cols-2 md:grid-cols-3 gap-3 mb-3", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.cat.slug') }), /*#__PURE__*/ _jsx("input", { value: catForm.slug, onChange: (e)=>setCatForm((f)=>f && { ...f, slug: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm", placeholder: "e.g. repairs" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.cat.icon') }), /*#__PURE__*/ _jsx(CategoryIconPicker, { value: catForm.icon, onChange: (icon)=>setCatForm((f)=>f && { ...f, icon }), onUpload: uploadCategoryIcon, uploading: catIconUploading, error: catIconError, presets: categoryIconPresets }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.cat.order') }), /*#__PURE__*/ _jsx("input", { type: "number", value: catForm.order, onChange: (e)=>setCatForm((f)=>f && { ...f, order: Number(e.target.value) }), className: "w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: [ t('admin.cat.name_el'), " \uD83C\uDDEC\uD83C\uDDF7" ] }), /*#__PURE__*/ _jsx("input", { value: catForm.namesEl, onChange: (e)=>setCatForm((f)=>f && { ...f, namesEl: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: [ t('admin.cat.name_en'), " \uD83C\uDDEC\uD83C\uDDE7" ] }), /*#__PURE__*/ _jsx("input", { value: catForm.namesEn, onChange: (e)=>setCatForm((f)=>f && { ...f, namesEn: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: [ t('admin.cat.name_ru'), " \uD83C\uDDF7\uD83C\uDDFA" ] }), /*#__PURE__*/ _jsx("input", { value: catForm.namesRu, onChange: (e)=>setCatForm((f)=>f && { ...f, namesRu: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: [ t('admin.cat.name_uk'), " \uD83C\uDDFA\uD83C\uDDE6" ] }), /*#__PURE__*/ _jsx("input", { value: catForm.namesUk, onChange: (e)=>setCatForm((f)=>f && { ...f, namesUk: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }) ] }), catForm.id && /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-2 text-sm text-gray-700 mb-3", children: [ /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: catForm.isActive, onChange: (e)=>setCatForm((f)=>f && { ...f, isActive: e.target.checked }) }), t('admin.cat.active') ] }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-2", children: [ /*#__PURE__*/ _jsx("button", { onClick: saveCat, disabled: catSaving, className: "px-4 py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700 disabled:opacity-50", children: catSaving ? t('common.saving') : t('common.save') }), /*#__PURE__*/ _jsx("button", { onClick: ()=>setCatForm(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: t('common.cancel') }) ] }) ] }), /*#__PURE__*/ _jsx("div", { className: "bg-white rounded-xl border border-gray-200 divide-y divide-gray-100", children: catRows.length === 0 ? /*#__PURE__*/ _jsx("div", { className: "px-4 py-8 text-center text-gray-400", children: t('admin.cat.empty') }) : /*#__PURE__*/ _jsx(CatTree, { rows: catRows, parentId: null, depth: 0, locale: locale, expanded: catExpanded, onToggle: toggleCatExpand, onEdit: openEditCat, onDelete: deleteCat, onAddChild: openAddCat, skillsExpanded: catSkillsExpanded, skillsCache: catSkillsCache, skillsLoading: catSkillsLoading, onToggleSkills: toggleCatSkills, skillForm: skillForm, skillSaving: skillSaving, onOpenAddSkill: openAddSkill, onOpenEditSkill: openEditSkill, onSaveSkill: saveSkill, onDeleteSkill: deleteSkill, onCancelSkillForm: ()=>setSkillForm(null), onSkillFormChange: setSkillForm, t: t }) }) ] }), tab === 'locations' && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("div", { className: "flex justify-between items-center mb-4", children: [ /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-500", children: t('admin.loc.hint') }), /*#__PURE__*/ _jsxs("button", { onClick: ()=>openAddLoc(null), className: "px-4 py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700", children: [ "+ ", t('admin.loc.add_city') ] }) ] }), locForm && /*#__PURE__*/ _jsxs("div", { className: "bg-green-50 border border-green-200 rounded-xl p-5 mb-4", children: [ /*#__PURE__*/ _jsxs("h3", { className: "font-semibold text-gray-800 mb-4", children: [ locForm.id ? t('admin.loc.edit') : t('admin.loc.new'), locForm.parentId && /*#__PURE__*/ _jsxs("span", { className: "text-xs text-gray-400 ml-2", children: [ "(", t('admin.loc.district'), ")" ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "grid grid-cols-2 md:grid-cols-4 gap-3 mb-3", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.cat.slug') }), /*#__PURE__*/ _jsx("input", { value: locForm.slug, onChange: (e)=>setLocForm((f)=>f && { ...f, slug: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm", placeholder: "e.g. athens-center" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: [ t('admin.cat.name_el'), " \uD83C\uDDEC\uD83C\uDDF7" ] }), /*#__PURE__*/ _jsx("input", { value: locForm.nameEl, onChange: (e)=>setLocForm((f)=>f && { ...f, nameEl: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: [ t('admin.cat.name_en'), " \uD83C\uDDEC\uD83C\uDDE7" ] }), /*#__PURE__*/ _jsx("input", { value: locForm.nameEn, onChange: (e)=>setLocForm((f)=>f && { ...f, nameEn: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: [ t('admin.cat.name_ru'), " \uD83C\uDDF7\uD83C\uDDFA" ] }), /*#__PURE__*/ _jsx("input", { value: locForm.nameRu, onChange: (e)=>setLocForm((f)=>f && { ...f, nameRu: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: [ t('admin.cat.name_uk'), " \uD83C\uDDFA\uD83C\uDDE6" ] }), /*#__PURE__*/ _jsx("input", { value: locForm.nameUk, onChange: (e)=>setLocForm((f)=>f && { ...f, nameUk: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-4 mb-3", children: [ /*#__PURE__*/ _jsxs("div", { className: "w-24", children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.cat.order') }), /*#__PURE__*/ _jsx("input", { type: "number", value: locForm.order, onChange: (e)=>setLocForm((f)=>f && { ...f, order: Number(e.target.value) }), className: "w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), locForm.id && /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-2 text-sm text-gray-700 mt-4", children: [ /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: locForm.isActive, onChange: (e)=>setLocForm((f)=>f && { ...f, isActive: e.target.checked }) }), t('admin.cat.active') ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-2", children: [ /*#__PURE__*/ _jsx("button", { onClick: saveLoc, disabled: locSaving, className: "px-4 py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700 disabled:opacity-50", children: locSaving ? t('common.saving') : t('common.save') }), /*#__PURE__*/ _jsx("button", { onClick: ()=>setLocForm(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: t('common.cancel') }) ] }) ] }), /*#__PURE__*/ _jsx("div", { className: "bg-white rounded-xl border border-gray-200 divide-y divide-gray-100", children: locRows.length === 0 ? /*#__PURE__*/ _jsx("div", { className: "px-4 py-8 text-center text-gray-400", children: t('admin.loc.empty') }) : /*#__PURE__*/ _jsx(LocTree, { rows: locRows, parentId: null, depth: 0, locale: locale, expanded: locExpanded, onToggle: toggleLocExpand, onEdit: openEditLoc, onDelete: deleteLoc, onAddChild: openAddLoc, t: t }) }) ] }), tab === 'reports' && /*#__PURE__*/ _jsxs("div", { className: "space-y-3", children: [ loading ? /*#__PURE__*/ _jsx("div", { className: "text-center py-10 text-gray-400", children: t('common.loading') }) : reports.length === 0 ? /*#__PURE__*/ _jsx("div", { className: "text-center py-10 text-gray-400", children: t('admin.reports.none') }) : reports.map((r)=>{ var _r_targetId; var _reportStatusColors_r_status, _reasonColors_r_reason; return /*#__PURE__*/ _jsx("div", { className: "bg-white rounded-xl border border-gray-200 p-5", children: /*#__PURE__*/ _jsxs("div", { className: "flex items-start justify-between gap-4", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 flex-wrap mb-2", children: [ /*#__PURE__*/ _jsx("span", { className: "px-2 py-0.5 rounded-full text-xs font-medium ".concat((_reportStatusColors_r_status = reportStatusColors[r.status]) !== null && _reportStatusColors_r_status !== void 0 ? _reportStatusColors_r_status : 'bg-gray-100 text-gray-500'), children: r.status }), /*#__PURE__*/ _jsx("span", { className: "px-2 py-0.5 rounded-full text-xs font-medium ".concat((_reasonColors_r_reason = reasonColors[r.reason]) !== null && _reasonColors_r_reason !== void 0 ? _reasonColors_r_reason : 'bg-gray-100 text-gray-600'), children: r.reason }), /*#__PURE__*/ _jsxs("span", { className: "text-xs text-gray-400", children: [ r.targetType === 'task' ? t('admin.reports.target.task') : t('admin.reports.target.user'), ":", ' ', r.targetTitle ? /*#__PURE__*/ _jsx(Link, { href: r.targetType === 'task' ? "/tasks/".concat(r.targetId) : "/users/".concat(r.targetId), className: "text-green-600 hover:underline font-medium", target: "_blank", children: r.targetTitle }) : /*#__PURE__*/ _jsxs("span", { className: "font-mono", children: [ "#", (_r_targetId = r.targetId) === null || _r_targetId === void 0 ? void 0 : _r_targetId.slice(0, 8) ] }) ] }) ] }), r.reporterName && /*#__PURE__*/ _jsxs("p", { className: "text-xs text-gray-400 mb-1", children: [ t('admin.col.reporter'), ": ", /*#__PURE__*/ _jsx("span", { className: "font-medium text-gray-600", children: r.reporterName }) ] }), r.description && /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-700", children: r.description }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-1.5", children: new Date(r.createdAt).toLocaleString(dateLocale) }) ] }), r.status === 'pending' && /*#__PURE__*/ _jsxs("div", { className: "flex gap-2 flex-shrink-0", children: [ /*#__PURE__*/ _jsx("button", { onClick: ()=>handleReport(r.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: t('admin.reports.reviewed') }), /*#__PURE__*/ _jsx("button", { onClick: ()=>handleReport(r.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: t('admin.reports.dismiss') }) ] }) ] }) }, r.id); }), /*#__PURE__*/ _jsx(Pagination, { page: reportsPage, total: reportsTotal, limit: 20, onChange: setReportsPage, totalLabel: t('admin.pagination.total') }) ] }), tab === 'moderation' && /*#__PURE__*/ _jsxs("div", { className: "space-y-6", children: [ /*#__PURE__*/ _jsxs("div", { className: "grid md:grid-cols-2 gap-4", children: [ /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-5", children: [ /*#__PURE__*/ _jsx("div", { className: "text-sm text-gray-500", children: t('admin.moderation.pending_count', 'Pending') }), /*#__PURE__*/ _jsx("div", { className: "text-3xl font-bold text-gray-900 mt-1", children: pendingModerationCards.length }), /*#__PURE__*/ _jsx("div", { className: "text-xs text-gray-400 mt-1", children: t('admin.moderation.pending_hint', 'New proposals waiting for approval') }) ] }), /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-5", children: [ /*#__PURE__*/ _jsx("div", { className: "text-sm text-gray-500", children: t('admin.moderation.active_count', 'Active') }), /*#__PURE__*/ _jsx("div", { className: "text-3xl font-bold text-gray-900 mt-1", children: activeModerationCards.length }), /*#__PURE__*/ _jsx("div", { className: "text-xs text-gray-400 mt-1", children: t('admin.moderation.active_hint', 'Visible cards that can be blocked') }) ] }) ] }), moderationCardsLoading ? /*#__PURE__*/ _jsx("div", { className: "text-center py-10 text-gray-400", children: t('common.loading') }) : moderationCards.length === 0 ? /*#__PURE__*/ _jsx("div", { className: "text-center py-10 text-gray-400", children: t('admin.moderation.none', 'No specialist cards found') }) : /*#__PURE__*/ _jsxs("div", { className: "space-y-6", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-gray-800 mb-3", children: t('admin.moderation.pending_title', 'Pending approval') }), /*#__PURE__*/ _jsx("div", { className: "space-y-3", children: pendingModerationCards.length === 0 ? /*#__PURE__*/ _jsx("div", { className: "text-sm text-gray-400 bg-white border border-dashed border-gray-200 rounded-xl p-4", children: t('admin.moderation.pending_empty', 'No pending proposals right now') }) : pendingModerationCards.map((card)=>{ var _card_specialistName, _ref; return /*#__PURE__*/ _jsx("div", { className: "bg-white rounded-xl border border-gray-200 p-4", children: /*#__PURE__*/ _jsxs("div", { className: "flex flex-wrap items-start justify-between gap-3", children: [ /*#__PURE__*/ _jsxs("div", { className: "min-w-0 flex-1", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 flex-wrap mb-1", children: [ /*#__PURE__*/ _jsx("span", { className: "px-2 py-0.5 rounded-full text-xs font-medium bg-yellow-100 text-yellow-700", children: t('admin.moderation.pending', 'Pending') }), /*#__PURE__*/ _jsx("span", { className: "text-sm font-semibold text-gray-800 truncate", children: card.title }) ] }), /*#__PURE__*/ _jsx("div", { className: "text-xs text-gray-500 mb-2", children: /*#__PURE__*/ _jsx(Link, { href: "/users/".concat(card.specialistId), className: "hover:text-green-600 hover:underline font-medium", children: (_ref = (_card_specialistName = card.specialistName) !== null && _card_specialistName !== void 0 ? _card_specialistName : card.specialistEmail) !== null && _ref !== void 0 ? _ref : card.specialistId }) }), card.description && /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-700 line-clamp-3", children: card.description }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-2 flex-shrink-0", children: [ /*#__PURE__*/ _jsx("button", { onClick: ()=>updateModerationCard(card.id, 'active'), className: "px-3 py-1.5 rounded-lg text-xs font-medium bg-green-600 text-white hover:bg-green-700", children: t('admin.moderation.approve', 'Approve') }), /*#__PURE__*/ _jsx("button", { onClick: ()=>updateModerationCard(card.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: t('admin.moderation.block', 'Block') }) ] }) ] }) }, card.id); }) }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-gray-800 mb-3", children: t('admin.moderation.active_title', 'Active cards') }), /*#__PURE__*/ _jsx("div", { className: "space-y-3", children: activeModerationCards.length === 0 ? /*#__PURE__*/ _jsx("div", { className: "text-sm text-gray-400 bg-white border border-dashed border-gray-200 rounded-xl p-4", children: t('admin.moderation.active_empty', 'No active cards found') }) : activeModerationCards.map((card)=>{ var _card_specialistName, _ref; return /*#__PURE__*/ _jsx("div", { className: "bg-white rounded-xl border border-gray-200 p-4", children: /*#__PURE__*/ _jsxs("div", { className: "flex flex-wrap items-start justify-between gap-3", children: [ /*#__PURE__*/ _jsxs("div", { className: "min-w-0 flex-1", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 flex-wrap mb-1", children: [ /*#__PURE__*/ _jsx("span", { className: "px-2 py-0.5 rounded-full text-xs font-medium bg-green-100 text-green-700", children: t('admin.moderation.active', 'Active') }), /*#__PURE__*/ _jsx("span", { className: "text-sm font-semibold text-gray-800 truncate", children: card.title }) ] }), /*#__PURE__*/ _jsx("div", { className: "text-xs text-gray-500 mb-2", children: /*#__PURE__*/ _jsx(Link, { href: "/users/".concat(card.specialistId), className: "hover:text-green-600 hover:underline font-medium", children: (_ref = (_card_specialistName = card.specialistName) !== null && _card_specialistName !== void 0 ? _card_specialistName : card.specialistEmail) !== null && _ref !== void 0 ? _ref : card.specialistId }) }), card.description && /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-700 line-clamp-3", children: card.description }) ] }), /*#__PURE__*/ _jsx("button", { onClick: ()=>updateModerationCard(card.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: t('admin.moderation.block', 'Block') }) ] }) }, card.id); }) }) ] }), /*#__PURE__*/ _jsx(Pagination, { page: moderationCardsPage, total: moderationCardsTotal, limit: 20, onChange: setModerationCardsPage, totalLabel: t('admin.pagination.total') }) ] }) ] }), tab === 'logs' && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("div", { className: "flex gap-1 bg-gray-100 rounded-xl p-1 mb-5 w-fit", children: [ { key: 'ai', label: t('admin.logs.subtab.ai') }, { key: 'activity', label: t('admin.logs.subtab.activity') }, { key: 'mail', label: t('admin.logs.subtab.mail') }, { key: 'notifications', label: t('admin.logs.subtab.notifications') } ].map((param)=>{ let { key, label } = param; return /*#__PURE__*/ _jsx("button", { onClick: ()=>setLogsSubTab(key), className: "px-4 py-1.5 rounded-lg text-sm font-medium transition-colors ".concat(logsSubTab === key ? 'bg-white text-gray-900 shadow-sm' : 'text-gray-500 hover:text-gray-700'), children: label }, key); }) }), logsSubTab === 'ai' && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("div", { className: "flex justify-between items-center mb-4", children: [ /*#__PURE__*/ _jsxs("p", { className: "text-sm text-gray-500", children: [ t('admin.pagination.total'), ": ", logsTotal ] }), /*#__PURE__*/ _jsxs("button", { onClick: ()=>{ setLogsPage(1); api.getAdminAiLogs(1).then((d)=>{ setLogs(d.data); setLogsTotal(d.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: [ /*#__PURE__*/ _jsxs("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ _jsx("polyline", { points: "23 4 23 10 17 10" }), /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M20.49 15a9 9 0 11-2.12-9.36L23 10" }) ] }), t('common.refresh') ] }) ] }), loading ? /*#__PURE__*/ _jsx("div", { className: "text-center py-10 text-gray-400", children: t('common.loading') }) : logs.length === 0 ? /*#__PURE__*/ _jsx("div", { className: "text-center py-10 text-gray-400", children: t('admin.logs.empty') }) : /*#__PURE__*/ _jsx("div", { className: "overflow-x-auto rounded-xl border border-gray-200", children: /*#__PURE__*/ _jsxs("table", { className: "w-full text-sm", children: [ /*#__PURE__*/ _jsx("thead", { className: "bg-gray-50 text-gray-500 text-xs uppercase", children: /*#__PURE__*/ _jsxs("tr", { children: [ /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 text-left", children: t('admin.logs.date') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 text-left", children: t('admin.logs.provider') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 text-left", children: t('admin.logs.model') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 text-left", children: t('admin.logs.action') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 text-left", children: t('admin.logs.langs') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 text-right", children: t('admin.logs.in') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 text-right", children: t('admin.logs.out') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 text-right", children: t('admin.logs.total') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 text-right", children: t('admin.logs.ms') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 text-center", children: t('admin.logs.status') }) ] }) }), /*#__PURE__*/ _jsx("tbody", { className: "divide-y divide-gray-100", children: logs.map((log)=>{ var _log_inputTokens, _log_outputTokens, _log_totalTokens, _log_durationMs, _log_error; return /*#__PURE__*/ _jsxs("tr", { className: "bg-white hover:bg-gray-50", children: [ /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-gray-500 whitespace-nowrap", children: new Date(log.createdAt).toLocaleString(dateLocale) }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3", children: /*#__PURE__*/ _jsx("span", { className: "px-2 py-0.5 rounded-full text-xs font-medium ".concat(log.provider === 'anthropic' ? 'bg-purple-100 text-purple-700' : 'bg-green-100 text-green-700'), children: log.provider }) }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-gray-600 font-mono text-xs", children: log.model }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-gray-600", children: log.action }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-gray-500", children: log.fromLocale && log.toLocale ? "".concat(log.fromLocale, " → ").concat(log.toLocale) : '—' }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-right text-gray-600", children: (_log_inputTokens = log.inputTokens) !== null && _log_inputTokens !== void 0 ? _log_inputTokens : '—' }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-right text-gray-600", children: (_log_outputTokens = log.outputTokens) !== null && _log_outputTokens !== void 0 ? _log_outputTokens : '—' }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-right font-medium", children: (_log_totalTokens = log.totalTokens) !== null && _log_totalTokens !== void 0 ? _log_totalTokens : '—' }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-right text-gray-500", children: (_log_durationMs = log.durationMs) !== null && _log_durationMs !== void 0 ? _log_durationMs : '—' }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-center", children: log.success ? /*#__PURE__*/ _jsx("span", { className: "text-green-600 flex justify-center", children: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("polyline", { points: "20 6 9 17 4 12" }) }) }) : /*#__PURE__*/ _jsx("span", { className: "text-red-500 flex justify-center", title: (_log_error = log.error) !== null && _log_error !== void 0 ? _log_error : '', children: /*#__PURE__*/ _jsxs("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: [ /*#__PURE__*/ _jsx("line", { x1: "18", y1: "6", x2: "6", y2: "18" }), /*#__PURE__*/ _jsx("line", { x1: "6", y1: "6", x2: "18", y2: "18" }) ] }) }) }) ] }, log.id); }) }) ] }) }), /*#__PURE__*/ _jsx(Pagination, { page: logsPage, total: logsTotal, limit: 50, onChange: setLogsPage, totalLabel: t('admin.pagination.total') }) ] }), logsSubTab === 'activity' && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-4 mb-4 flex flex-wrap gap-3 items-end", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-500 mb-1", children: t('admin.activity.event') }), /*#__PURE__*/ _jsxs("select", { value: activityEvent, onChange: (e)=>setActivityEvent(e.target.value), className: "border border-gray-300 rounded-lg px-3 py-1.5 text-sm min-w-[180px]", children: [ /*#__PURE__*/ _jsx("option", { value: "", children: t('admin.activity.all_events') }), activityEventTypes.map((ev)=>/*#__PURE__*/ _jsx("option", { value: ev, children: ev }, ev)) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-500 mb-1", children: t('admin.activity.from') }), /*#__PURE__*/ _jsx("input", { type: "date", value: activityDateFrom, onChange: (e)=>setActivityDateFrom(e.target.value), className: "border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-500 mb-1", children: t('admin.activity.to') }), /*#__PURE__*/ _jsx("input", { type: "date", value: activityDateTo, onChange: (e)=>setActivityDateTo(e.target.value), className: "border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), (activityEvent || activityDateFrom || activityDateTo || activityUserId) && /*#__PURE__*/ _jsxs("button", { onClick: ()=>{ setActivityEvent(''); setActivityDateFrom(''); setActivityDateTo(''); setActivityUserId(''); }, 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: [ /*#__PURE__*/ _jsxs("svg", { className: "w-3 h-3", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: [ /*#__PURE__*/ _jsx("line", { x1: "18", y1: "6", x2: "6", y2: "18" }), /*#__PURE__*/ _jsx("line", { x1: "6", y1: "6", x2: "18", y2: "18" }) ] }), t('admin.activity.reset') ] }), /*#__PURE__*/ _jsxs("p", { className: "text-xs text-gray-400 self-end ml-auto", children: [ t('admin.activity.total'), ": ", activityTotal ] }) ] }), activityLog.length === 0 ? /*#__PURE__*/ _jsx("div", { className: "text-center py-10 text-gray-400", children: t('admin.activity.empty') }) : /*#__PURE__*/ _jsx("div", { className: "space-y-2", children: activityLog.map((entry)=>/*#__PURE__*/ _jsx(ActivityLogRow, { entry: entry, dateLocale: dateLocale, onFilterUser: (id)=>{ setActivityUserId(id); setActivityEvent(''); }, t: t }, entry.id)) }), /*#__PURE__*/ _jsx(Pagination, { page: activityPage, total: activityTotal, limit: 50, onChange: setActivityPage, totalLabel: t('admin.pagination.total') }) ] }), logsSubTab === 'mail' && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-4 mb-4 flex flex-wrap gap-3 items-end", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-500 mb-1", children: t('admin.mail.event') }), /*#__PURE__*/ _jsxs("select", { value: mailEvent, onChange: (e)=>setMailEvent(e.target.value), className: "border border-gray-300 rounded-lg px-3 py-1.5 text-sm min-w-[200px]", children: [ /*#__PURE__*/ _jsx("option", { value: "", children: t('admin.mail.all_events') }), mailEventTypes.map((ev)=>/*#__PURE__*/ _jsx("option", { value: ev, children: t("admin.event.".concat(ev.replace(/\./g, '_')), ev) }, ev)) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-500 mb-1", children: t('admin.mail.from') }), /*#__PURE__*/ _jsx("input", { type: "date", value: mailDateFrom, onChange: (e)=>setMailDateFrom(e.target.value), className: "border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-500 mb-1", children: t('admin.mail.to') }), /*#__PURE__*/ _jsx("input", { type: "date", value: mailDateTo, onChange: (e)=>setMailDateTo(e.target.value), className: "border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), (mailEvent || mailDateFrom || mailDateTo) && /*#__PURE__*/ _jsxs("button", { onClick: ()=>{ setMailEvent(''); setMailDateFrom(''); setMailDateTo(''); }, 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: [ /*#__PURE__*/ _jsxs("svg", { className: "w-3 h-3", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: [ /*#__PURE__*/ _jsx("line", { x1: "18", y1: "6", x2: "6", y2: "18" }), /*#__PURE__*/ _jsx("line", { x1: "6", y1: "6", x2: "18", y2: "18" }) ] }), t('admin.mail.reset') ] }), /*#__PURE__*/ _jsxs("p", { className: "text-xs text-gray-400 self-end ml-auto", children: [ t('admin.mail.total'), ": ", mailTotal ] }) ] }), mailLog.length === 0 ? /*#__PURE__*/ _jsx("div", { className: "text-center py-10 text-gray-400", children: t('admin.mail.empty') }) : /*#__PURE__*/ _jsx("div", { className: "overflow-x-auto rounded-xl border border-gray-200", children: /*#__PURE__*/ _jsxs("table", { className: "w-full text-sm", children: [ /*#__PURE__*/ _jsx("thead", { className: "bg-gray-50 text-gray-500 text-xs uppercase", children: /*#__PURE__*/ _jsxs("tr", { children: [ /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 text-left", children: t('admin.logs.date') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 text-left", children: t('admin.mail.recipient') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 text-left", children: t('admin.mail.event') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 text-left", children: t('admin.mail.provider') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 text-left", children: t('admin.mail.details') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 text-center", children: t('admin.mail.status') }) ] }) }), /*#__PURE__*/ _jsx("tbody", { className: "divide-y divide-gray-100", children: mailLog.map((entry)=>{ const details = parseLogDetails(entry.details); const provider = typeof (details === null || details === void 0 ? void 0 : details.provider) === 'string' ? details.provider : '—'; const recipient = typeof (details === null || details === void 0 ? void 0 : details.to) === 'string' ? details.to : entry.userEmail || '—'; const subject = typeof (details === null || details === void 0 ? void 0 : details.subject) === 'string' ? details.subject : ''; const error = typeof (details === null || details === void 0 ? void 0 : details.error) === 'string' ? details.error : ''; const success = entry.event === 'email.sent' || entry.event === 'admin.email.test.sent'; return /*#__PURE__*/ _jsxs("tr", { className: "bg-white hover:bg-gray-50 align-top", children: [ /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-gray-500 whitespace-nowrap", children: new Date(entry.createdAt).toLocaleString(dateLocale) }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-gray-700", children: recipient }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3", children: /*#__PURE__*/ _jsx("span", { className: "px-2 py-0.5 rounded-full text-xs font-medium bg-sky-50 text-sky-700", children: t("admin.event.".concat(entry.event.replace(/\./g, '_')), entry.event) }) }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-gray-600", children: provider }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-gray-600 max-w-md", children: /*#__PURE__*/ _jsx("div", { className: "truncate", title: subject || error || undefined, children: subject || error || '—' }) }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-center", children: success ? /*#__PURE__*/ _jsx("span", { className: "text-green-600 inline-flex justify-center", title: t('admin.mail.success'), children: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("polyline", { points: "20 6 9 17 4 12" }) }) }) : /*#__PURE__*/ _jsx("span", { className: "text-red-500 inline-flex justify-center", title: error || t('admin.mail.failed'), children: /*#__PURE__*/ _jsxs("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: [ /*#__PURE__*/ _jsx("line", { x1: "18", y1: "6", x2: "6", y2: "18" }), /*#__PURE__*/ _jsx("line", { x1: "6", y1: "6", x2: "18", y2: "18" }) ] }) }) }) ] }, entry.id); }) }) ] }) }), /*#__PURE__*/ _jsx(Pagination, { page: mailPage, total: mailTotal, limit: 50, onChange: setMailPage, totalLabel: t('admin.pagination.total') }) ] }), logsSubTab === 'notifications' && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-4 mb-4 flex flex-wrap gap-3 items-end", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-500 mb-1", children: t('admin.notif_logs.type') }), /*#__PURE__*/ _jsxs("select", { value: notifLogsType, onChange: (e)=>setNotifLogsType(e.target.value), className: "border border-gray-300 rounded-lg px-3 py-1.5 text-sm min-w-[200px]", children: [ /*#__PURE__*/ _jsx("option", { value: "", children: t('admin.filter.all') }), notifLogsTypes.map((tp)=>/*#__PURE__*/ _jsx("option", { value: tp, children: tp }, tp)) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-500 mb-1", children: t('admin.activity.from') }), /*#__PURE__*/ _jsx("input", { type: "date", value: notifLogsDateFrom, onChange: (e)=>setNotifLogsDateFrom(e.target.value), className: "border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-500 mb-1", children: t('admin.activity.to') }), /*#__PURE__*/ _jsx("input", { type: "date", value: notifLogsDateTo, onChange: (e)=>setNotifLogsDateTo(e.target.value), className: "border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), (notifLogsType || notifLogsDateFrom || notifLogsDateTo) && /*#__PURE__*/ _jsxs("button", { onClick: ()=>{ setNotifLogsType(''); setNotifLogsDateFrom(''); setNotifLogsDateTo(''); }, 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: [ /*#__PURE__*/ _jsxs("svg", { className: "w-3 h-3", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: [ /*#__PURE__*/ _jsx("line", { x1: "18", y1: "6", x2: "6", y2: "18" }), /*#__PURE__*/ _jsx("line", { x1: "6", y1: "6", x2: "18", y2: "18" }) ] }), t('admin.activity.reset') ] }), /*#__PURE__*/ _jsxs("p", { className: "text-xs text-gray-400 self-end ml-auto", children: [ t('admin.pagination.total'), ": ", notifLogsTotal ] }) ] }), notifLogs.length === 0 ? /*#__PURE__*/ _jsx("div", { className: "text-center py-10 text-gray-400", children: t('admin.notif_logs.empty') }) : /*#__PURE__*/ _jsx("div", { className: "overflow-x-auto rounded-xl border border-gray-200", children: /*#__PURE__*/ _jsxs("table", { className: "w-full text-sm", children: [ /*#__PURE__*/ _jsx("thead", { className: "bg-gray-50 text-gray-500 text-xs uppercase", children: /*#__PURE__*/ _jsxs("tr", { children: [ /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 text-left", children: t('admin.logs.date') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 text-left", children: t('admin.col.user') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 text-left", children: t('admin.notif_logs.type') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 text-left", children: t('admin.notif_logs.title') }), /*#__PURE__*/ _jsx("th", { className: "px-4 py-3 text-center", children: t('admin.notif_logs.read') }) ] }) }), /*#__PURE__*/ _jsx("tbody", { className: "divide-y divide-gray-100", children: notifLogs.map((n)=>{ var _n_recipientName, _ref; return /*#__PURE__*/ _jsxs("tr", { className: "bg-white hover:bg-gray-50", children: [ /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-gray-500 whitespace-nowrap", children: new Date(n.createdAt).toLocaleString(dateLocale) }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-gray-700", children: (_ref = (_n_recipientName = n.recipientName) !== null && _n_recipientName !== void 0 ? _n_recipientName : n.recipientEmail) !== null && _ref !== void 0 ? _ref : n.recipientId }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3", children: /*#__PURE__*/ _jsx("span", { className: "px-2 py-0.5 rounded-full text-xs font-medium bg-green-50 text-green-700", children: n.type }) }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-gray-600 max-w-xs truncate", children: n.title }), /*#__PURE__*/ _jsx("td", { className: "px-4 py-3 text-center", children: n.isRead ? /*#__PURE__*/ _jsx("span", { className: "text-green-600 flex justify-center", children: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("polyline", { points: "20 6 9 17 4 12" }) }) }) : /*#__PURE__*/ _jsx("span", { className: "text-gray-400 flex justify-center", children: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("circle", { cx: "12", cy: "12", r: "10" }) }) }) }) ] }, n.id); }) }) ] }) }), /*#__PURE__*/ _jsx(Pagination, { page: notifLogsPage, total: notifLogsTotal, limit: 50, onChange: setNotifLogsPage, totalLabel: t('admin.pagination.total') }) ] }) ] }), tab === 'plans' && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between mb-4", children: [ /*#__PURE__*/ _jsxs("h2", { className: "text-lg font-semibold text-gray-800 flex items-center gap-2", children: [ /*#__PURE__*/ _jsxs("svg", { className: "w-5 h-5 text-green-600", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: [ /*#__PURE__*/ _jsx("rect", { x: "1", y: "4", width: "22", height: "16", rx: "2", ry: "2" }), /*#__PURE__*/ _jsx("line", { x1: "1", y1: "10", x2: "23", y2: "10" }) ] }), t('admin.plans.title') ] }), /*#__PURE__*/ _jsx("button", { onClick: openAddPlan, className: "bg-green-600 text-white text-sm px-4 py-2 rounded-lg hover:bg-green-700 font-medium", children: t('admin.plans.add') }) ] }), planForm && /*#__PURE__*/ _jsxs("div", { className: "bg-white border border-gray-200 rounded-xl p-5 mb-4 space-y-3", children: [ /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-gray-800", children: planForm.id ? t('admin.plans.form.edit') : t('admin.plans.form.new') }), /*#__PURE__*/ _jsxs("div", { className: "grid grid-cols-2 gap-3", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.name') }), /*#__PURE__*/ _jsx("input", { value: planForm.name, onChange: (e)=>setPlanForm({ ...planForm, name: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.price') }), /*#__PURE__*/ _jsx("input", { type: "number", min: "0", step: "0.01", value: planForm.price, onChange: (e)=>setPlanForm({ ...planForm, price: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.old_price') }), /*#__PURE__*/ _jsx("input", { type: "number", min: "0", step: "0.01", value: (_planForm_oldPrice = planForm.oldPrice) !== null && _planForm_oldPrice !== void 0 ? _planForm_oldPrice : '', onChange: (e)=>setPlanForm({ ...planForm, oldPrice: e.target.value }), placeholder: "—", className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.tier') }), /*#__PURE__*/ _jsxs("select", { value: planForm.tier, onChange: (e)=>setPlanForm({ ...planForm, tier: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400", children: [ /*#__PURE__*/ _jsx("option", { value: "free", children: t('admin.plans.form.tier.free') }), /*#__PURE__*/ _jsx("option", { value: "pro", children: t('admin.plans.form.tier.pro') }), /*#__PURE__*/ _jsx("option", { value: "ultimate", children: t('admin.plans.form.tier.ultimate') }) ] }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.description') }), /*#__PURE__*/ _jsx("input", { value: planForm.description, onChange: (e)=>setPlanForm({ ...planForm, description: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ _jsx("p", { className: "text-xs font-semibold text-gray-500 uppercase tracking-wide pt-1", children: t('admin.plans.form.section.limits') }), /*#__PURE__*/ _jsxs("div", { className: "grid grid-cols-3 gap-3", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.max_tasks') }), /*#__PURE__*/ _jsx("input", { type: "number", min: "0", placeholder: "∞", value: planForm.maxTasks, onChange: (e)=>setPlanForm({ ...planForm, maxTasks: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.max_offers') }), /*#__PURE__*/ _jsx("input", { type: "number", min: "0", placeholder: "∞", value: planForm.maxOffers, onChange: (e)=>setPlanForm({ ...planForm, maxOffers: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.max_cards') }), /*#__PURE__*/ _jsx("input", { type: "number", min: "0", placeholder: "∞", value: planForm.maxCards, onChange: (e)=>setPlanForm({ ...planForm, maxCards: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.max_messages_day') }), /*#__PURE__*/ _jsx("input", { type: "number", min: "0", placeholder: "∞", value: planForm.maxMessagesPerDay, onChange: (e)=>setPlanForm({ ...planForm, maxMessagesPerDay: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.max_orders_day') }), /*#__PURE__*/ _jsx("input", { type: "number", min: "0", placeholder: "∞", value: planForm.maxOrdersPerDay, onChange: (e)=>setPlanForm({ ...planForm, maxOrdersPerDay: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.max_skills') }), /*#__PURE__*/ _jsx("input", { type: "number", min: "0", placeholder: "∞", value: planForm.maxSkills, onChange: (e)=>setPlanForm({ ...planForm, maxSkills: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.duration_days') }), /*#__PURE__*/ _jsx("input", { type: "number", min: "0", placeholder: "∞", value: planForm.durationDays, onChange: (e)=>setPlanForm({ ...planForm, durationDays: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }) ] }), /*#__PURE__*/ _jsx("p", { className: "text-xs font-semibold text-gray-500 uppercase tracking-wide pt-1", children: t('admin.plans.form.section.boost') }), /*#__PURE__*/ _jsxs("div", { className: "grid grid-cols-2 gap-3", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.search_boost') }), /*#__PURE__*/ _jsx("input", { type: "number", min: "0", value: planForm.searchBoost, onChange: (e)=>setPlanForm({ ...planForm, searchBoost: Number(e.target.value) }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.offers_multiplier') }), /*#__PURE__*/ _jsx("input", { type: "number", min: "0", step: "0.01", value: planForm.offersMultiplier, onChange: (e)=>setPlanForm({ ...planForm, offersMultiplier: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.features') }), /*#__PURE__*/ _jsx("textarea", { rows: 3, value: planForm.features, onChange: (e)=>setPlanForm({ ...planForm, features: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 resize-none" }) ] }), /*#__PURE__*/ _jsx("p", { className: "text-xs font-semibold text-gray-500 uppercase tracking-wide pt-1", children: t('admin.plans.form.section.contact') }), /*#__PURE__*/ _jsx("div", { className: "grid grid-cols-2 gap-2", children: [ [ 'canContactFreePlan', t('admin.plans.form.can_contact_free') ], [ 'canContactProPlan', t('admin.plans.form.can_contact_pro') ], [ 'canContactAll', t('admin.plans.form.can_contact_all') ], [ 'canShowContactInfo', t('admin.plans.form.can_show_contact') ], [ 'canViewPhone', t('admin.plans.form.can_view_phone') ] ].map((param)=>{ let [key, label] = param; return /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-2 cursor-pointer text-sm text-gray-700", children: [ /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: planForm[key], onChange: (e)=>setPlanForm({ ...planForm, [key]: e.target.checked }), className: "w-4 h-4 rounded text-green-600" }), label ] }, key); }) }), /*#__PURE__*/ _jsx("p", { className: "text-xs font-semibold text-gray-500 uppercase tracking-wide pt-1", children: t('admin.plans.form.section.features') }), /*#__PURE__*/ _jsx("div", { className: "grid grid-cols-2 gap-2", children: [ [ 'notifyNewTasks', t('admin.plans.form.notify') ], [ 'canUploadVideo', t('admin.plans.form.upload_video') ], [ 'hasFavorites', t('admin.plans.form.favorites') ], [ 'hasGoogleCalendar', t('admin.plans.form.google_calendar') ], [ 'hasVerifiedBadge', t('admin.plans.form.verified_badge') ], [ 'highlightedReviews', t('admin.plans.form.highlighted_reviews') ], [ 'hasPersonalSite', t('admin.plans.form.personal_site') ], [ 'hasCanHelpNowStatus', t('admin.plans.form.can_help_now') ], [ 'hasNeedHelpStatus', t('admin.plans.form.need_help') ], [ 'hasAutoResponse', t('admin.plans.form.auto_response') ], [ 'hasAutoMatch', t('admin.plans.form.auto_match') ], [ 'hasPriceList', t('admin.plans.form.price_list') ], [ 'receiveInstantDispatchFree', t('admin.plans.form.instant_dispatch_free') ], [ 'receiveInstantDispatchPro', t('admin.plans.form.instant_dispatch_pro') ] ].map((param)=>{ let [key, label] = param; return /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-2 cursor-pointer text-sm text-gray-700", children: [ /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: planForm[key], onChange: (e)=>setPlanForm({ ...planForm, [key]: e.target.checked }), className: "w-4 h-4 rounded text-green-600" }), label ] }, key); }) }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-6 pt-1", children: [ /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-2 cursor-pointer text-sm text-gray-700", children: [ /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: planForm.isDefault, onChange: (e)=>setPlanForm({ ...planForm, isDefault: e.target.checked }), className: "w-4 h-4 rounded text-green-600" }), t('admin.plans.form.default') ] }), /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-2 cursor-pointer text-sm text-gray-700", children: [ /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: planForm.isActive, onChange: (e)=>setPlanForm({ ...planForm, isActive: e.target.checked }), className: "w-4 h-4 rounded text-green-600" }), t('admin.plans.form.active') ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2", children: [ /*#__PURE__*/ _jsx("label", { className: "text-xs text-gray-600", children: t('admin.plans.form.order') }), /*#__PURE__*/ _jsx("input", { type: "number", value: planForm.order, onChange: (e)=>setPlanForm({ ...planForm, order: Number(e.target.value) }), className: "w-16 border border-gray-300 rounded-lg px-2 py-1 text-sm focus:outline-none" }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-2 pt-1", children: [ /*#__PURE__*/ _jsx("button", { onClick: savePlan, disabled: planSaving || !planForm.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: planSaving ? '...' : t('common.save') }), /*#__PURE__*/ _jsx("button", { onClick: ()=>setPlanForm(null), className: "px-4 py-2 rounded-lg text-sm font-medium text-gray-600 hover:bg-gray-100", children: t('common.cancel') }) ] }) ] }), /*#__PURE__*/ _jsx("div", { className: "bg-white rounded-xl border border-gray-200 overflow-hidden", children: planRows.length === 0 ? /*#__PURE__*/ _jsx("div", { className: "px-4 py-8 text-center text-gray-400 text-sm", children: t('admin.plans.empty') }) : /*#__PURE__*/ _jsx("div", { className: "divide-y divide-gray-100", children: planRows.sort((a, b)=>{ var _a_order, _b_order; return ((_a_order = a.order) !== null && _a_order !== void 0 ? _a_order : 0) - ((_b_order = b.order) !== null && _b_order !== void 0 ? _b_order : 0); }).map((plan)=>{ var _plan_features; return /*#__PURE__*/ _jsxs("div", { className: "flex items-start gap-4 px-4 py-4 ".concat(!plan.isActive ? 'opacity-50' : ''), children: [ /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 flex-wrap", children: [ /*#__PURE__*/ _jsx("span", { className: "font-semibold text-gray-900", children: plan.name }), plan.isDefault && /*#__PURE__*/ _jsx("span", { className: "bg-green-100 text-green-700 text-xs px-2 py-0.5 rounded-full font-medium", children: t('admin.plans.badge.default') }), !plan.isActive && /*#__PURE__*/ _jsx("span", { className: "bg-gray-100 text-gray-500 text-xs px-2 py-0.5 rounded-full", children: t('admin.plans.badge.inactive') }) ] }), plan.description && /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-500 mt-0.5", children: plan.description }), /*#__PURE__*/ _jsxs("div", { className: "flex flex-wrap gap-3 mt-1 text-xs text-gray-500", children: [ /*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-1.5 font-semibold text-gray-800", children: [ plan.oldPrice && /*#__PURE__*/ _jsxs("span", { className: "font-normal text-gray-400 line-through", children: [ plan.oldPrice, " ", plan.currency ] }), /*#__PURE__*/ _jsxs("span", { children: [ plan.price, " ", plan.currency ] }) ] }), plan.maxTasks != null && /*#__PURE__*/ _jsxs("span", { children: [ t('admin.plans.tasks'), ": ", plan.maxTasks ] }), plan.maxOffers != null && /*#__PURE__*/ _jsxs("span", { children: [ t('admin.plans.offers'), ": ", plan.maxOffers ] }), plan.maxCards != null && /*#__PURE__*/ _jsxs("span", { children: [ t('admin.plans.cards'), ": ", plan.maxCards ] }), plan.notifyNewTasks && /*#__PURE__*/ _jsxs("span", { className: "text-green-700 flex items-center gap-1", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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" }) }), t('admin.plans.notify_tasks') ] }) ] }), ((_plan_features = plan.features) !== null && _plan_features !== void 0 ? _plan_features : []).length > 0 && /*#__PURE__*/ _jsx("ul", { className: "mt-1.5 space-y-0.5", children: plan.features.map((f, i)=>/*#__PURE__*/ _jsxs("li", { className: "text-xs text-gray-600 flex items-center gap-1.5", children: [ /*#__PURE__*/ _jsx("span", { className: "text-green-500", children: /*#__PURE__*/ _jsx("svg", { className: "w-3 h-3", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("polyline", { points: "20 6 9 17 4 12" }) }) }), " ", f ] }, i)) }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-1 shrink-0", children: [ !plan.isDefault && /*#__PURE__*/ _jsx("button", { onClick: ()=>api.updatePlan(plan.id, { isDefault: true }).then(()=>api.getAdminPlans().then(setPlanRows)).catch(()=>{}), className: "text-xs px-2 py-1 rounded-lg bg-green-50 text-green-600 hover:bg-green-100 font-medium", title: t('admin.plans.make_default'), children: /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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" }) }) }), /*#__PURE__*/ _jsx("button", { onClick: ()=>openEditPlan(plan), className: "text-xs px-2 py-1 rounded-lg bg-gray-100 text-gray-600 hover:bg-gray-200 font-medium", children: t('common.edit') }), /*#__PURE__*/ _jsx("button", { onClick: ()=>deletePlan(plan.id, plan.name), className: "text-xs px-2 py-1 rounded-lg bg-red-50 text-red-600 hover:bg-red-100 font-medium", children: t('common.delete') }) ] }) ] }, plan.id); }) }) }) ] }), tab === 'settings' && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _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((st)=>{ const labels = { general: t('admin.settings.tab.general'), smtp: t('admin.settings.tab.smtp'), notifications: t('admin.settings.tab.notifications'), payment: t('admin.settings.tab.payment'), referral: t('admin.settings.tab.referral'), seo: t('admin.settings.tab.seo'), socials: t('admin.settings.tab.socials'), telegram: t('admin.settings.tab.telegram') }; return /*#__PURE__*/ _jsx("button", { onClick: ()=>setSettingsTab(st), className: "px-4 py-2 rounded-lg text-sm font-medium transition ".concat(settingsTab === st ? 'bg-green-600 text-white shadow-sm' : 'text-gray-600 hover:bg-gray-100'), children: labels[st] }, st); }) }), settingsTab === 'general' && /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6 max-w-lg", children: [ /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-gray-800 mb-5", children: t('admin.settings.general.title') }), /*#__PURE__*/ _jsxs("div", { className: "space-y-4", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.general.site_name') }), /*#__PURE__*/ _jsx("input", { value: generalForm.siteName, onChange: (e)=>setGeneralForm((f)=>({ ...f, siteName: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400", placeholder: "CanHelp" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.general.site_url') }), /*#__PURE__*/ _jsx("input", { value: generalForm.siteUrl, onChange: (e)=>setGeneralForm((f)=>({ ...f, siteUrl: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400", placeholder: "https://canhelp.com" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.general.contact_email') }), /*#__PURE__*/ _jsx("input", { type: "email", value: generalForm.contactEmail, onChange: (e)=>setGeneralForm((f)=>({ ...f, contactEmail: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400", placeholder: "contact@canhelp.com" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.general.support_phone') }), /*#__PURE__*/ _jsx("input", { value: generalForm.supportPhone, onChange: (e)=>setGeneralForm((f)=>({ ...f, supportPhone: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400", placeholder: "+30 21 000 0000" }) ] }), /*#__PURE__*/ _jsx("button", { onClick: saveGeneralSettings, disabled: generalSaving, 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: generalSaving ? t('admin.settings.saving') : generalSaved ? t('admin.settings.saved') : t('common.save') }) ] }) ] }), settingsTab === 'smtp' && /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6 max-w-lg", children: [ /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-gray-800 mb-1", children: t('admin.settings.smtp.title') }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-400 mb-5", children: t('admin.settings.smtp.hint') }), /*#__PURE__*/ _jsxs("div", { className: "space-y-4", children: [ /*#__PURE__*/ _jsxs("div", { className: "grid grid-cols-3 gap-3", children: [ /*#__PURE__*/ _jsxs("div", { className: "col-span-2", children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.smtp.host') }), /*#__PURE__*/ _jsx("input", { value: smtpForm.host, onChange: (e)=>setSmtpForm((f)=>({ ...f, host: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400", placeholder: "smtp.gmail.com" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.smtp.port') }), /*#__PURE__*/ _jsx("input", { value: smtpForm.port, onChange: (e)=>setSmtpForm((f)=>({ ...f, port: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400", placeholder: "587" }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.smtp.encryption') }), /*#__PURE__*/ _jsxs("select", { value: smtpForm.encryption, onChange: (e)=>setSmtpForm((f)=>({ ...f, encryption: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400", children: [ /*#__PURE__*/ _jsx("option", { value: "none", children: t('admin.settings.smtp.enc.none') }), /*#__PURE__*/ _jsx("option", { value: "tls", children: "STARTTLS (587)" }), /*#__PURE__*/ _jsx("option", { value: "ssl", children: "SSL/TLS (465)" }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.smtp.username') }), /*#__PURE__*/ _jsx("input", { value: smtpForm.username, onChange: (e)=>setSmtpForm((f)=>({ ...f, username: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400", placeholder: "user@gmail.com", autoComplete: "off" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.smtp.password') }), /*#__PURE__*/ _jsx("input", { type: "password", value: smtpForm.password, onChange: (e)=>setSmtpForm((f)=>({ ...f, password: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400", autoComplete: "new-password", placeholder: "••••••••••••" }) ] }), /*#__PURE__*/ _jsxs("div", { className: "grid grid-cols-2 gap-3", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.smtp.from_name') }), /*#__PURE__*/ _jsx("input", { value: smtpForm.fromName, onChange: (e)=>setSmtpForm((f)=>({ ...f, fromName: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400", placeholder: "CanHelp" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.smtp.from_email') }), /*#__PURE__*/ _jsx("input", { type: "email", value: smtpForm.fromEmail, onChange: (e)=>setSmtpForm((f)=>({ ...f, fromEmail: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400", placeholder: "noreply@canhelp.com" }) ] }) ] }), /*#__PURE__*/ _jsx("button", { onClick: saveSmtpSettings, disabled: smtpSaving, 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: smtpSaving ? t('admin.settings.saving') : smtpSaved ? t('admin.settings.saved') : t('common.save') }), /*#__PURE__*/ _jsx("button", { onClick: async ()=>{ setTestEmailSending(true); setTestEmailResult(null); try { const res = await api.sendTestEmail(); setTestEmailResult("✓ Sent to ".concat(res.to)); } catch (e) { setTestEmailResult("✗ Error: ".concat(e.message)); } finally{ setTestEmailSending(false); setTimeout(()=>setTestEmailResult(null), 5000); } }, disabled: testEmailSending, 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: testEmailSending ? t('admin.settings.smtp.sending') : /*#__PURE__*/ _jsxs("span", { className: "flex items-center justify-center gap-2", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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" }) }), t('admin.settings.smtp.test') ] }) }), testEmailResult && /*#__PURE__*/ _jsx("p", { className: "text-sm text-center font-medium ".concat(testEmailResult.startsWith('✓') ? 'text-green-600' : 'text-red-500'), children: testEmailResult }) ] }) ] }), settingsTab === 'payment' && /*#__PURE__*/ _jsxs("div", { className: "space-y-6 max-w-lg", children: [ /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between mb-5", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3", children: [ /*#__PURE__*/ _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" }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-gray-800", children: "ePay — Piraeus Bank" }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400", children: "ГреческОй платёжМый шлюз" }) ] }) ] }), /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-2 cursor-pointer", children: [ /*#__PURE__*/ _jsx("span", { className: "text-sm text-gray-500", children: t('admin.settings.active') }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setEPayForm((f)=>({ ...f, enabled: !f.enabled })), className: "relative w-10 h-6 rounded-full p-0 transition-colors cursor-pointer ".concat(ePayForm.enabled ? 'bg-green-600' : 'bg-gray-300'), children: /*#__PURE__*/ _jsx("span", { className: "absolute left-0 top-1 w-4 h-4 bg-white rounded-full shadow transition-transform ".concat(ePayForm.enabled ? 'translate-x-5' : 'translate-x-1') }) }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "space-y-4", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.env.label') }), /*#__PURE__*/ _jsxs("select", { value: ePayForm.environment, onChange: (e)=>setEPayForm((f)=>({ ...f, environment: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm", children: [ /*#__PURE__*/ _jsx("option", { value: "test", children: t('admin.settings.env.test') }), /*#__PURE__*/ _jsx("option", { value: "production", children: t('admin.settings.env.prod') }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.merchant_id') }), /*#__PURE__*/ _jsx("input", { value: ePayForm.merchantId, onChange: (e)=>setEPayForm((f)=>({ ...f, merchantId: e.target.value })), placeholder: t('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" }) ] }), /*#__PURE__*/ _jsxs("div", { className: "grid grid-cols-2 gap-3", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: "API User" }), /*#__PURE__*/ _jsx("input", { value: ePayForm.apiUser, onChange: (e)=>setEPayForm((f)=>({ ...f, apiUser: e.target.value })), autoComplete: "off", className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: "API Password" }), /*#__PURE__*/ _jsx("input", { type: "password", value: ePayForm.apiPassword, onChange: (e)=>setEPayForm((f)=>({ ...f, apiPassword: e.target.value })), autoComplete: "new-password", className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: "Confirmation URL (webhook)" }), /*#__PURE__*/ _jsx("input", { value: ePayForm.confirmationUrl, onChange: (e)=>setEPayForm((f)=>({ ...f, confirmationUrl: e.target.value })), placeholder: "https://yoursite.com/api/payments/epay/confirm", className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: "Cancel URL" }), /*#__PURE__*/ _jsx("input", { value: ePayForm.cancelUrl, onChange: (e)=>setEPayForm((f)=>({ ...f, cancelUrl: e.target.value })), placeholder: "https://yoursite.com/payment/cancelled", className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 mt-5", children: [ /*#__PURE__*/ _jsx("button", { onClick: saveEPaySettings, disabled: ePaySaving, className: "px-5 py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700 disabled:opacity-50", children: ePaySaving ? t('admin.settings.saving') : t('common.save') }), ePaySaved && /*#__PURE__*/ _jsx("span", { className: "text-sm text-green-600", children: t('admin.settings.saved') }) ] }) ] }), /*#__PURE__*/ _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: [ /*#__PURE__*/ _jsxs("svg", { className: "w-4 h-4 shrink-0 mt-0.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ _jsx("circle", { cx: "12", cy: "12", r: "10" }), /*#__PURE__*/ _jsx("line", { x1: "12", y1: "8", x2: "12", y2: "12" }), /*#__PURE__*/ _jsx("line", { x1: "12", y1: "16", x2: "12.01", y2: "16" }) ] }), /*#__PURE__*/ _jsx("span", { children: t('admin.settings.payment.hint') }) ] }) ] }), settingsTab === 'notifications' && /*#__PURE__*/ _jsxs("div", { className: "space-y-3 max-w-2xl", children: [ /*#__PURE__*/ _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: [ /*#__PURE__*/ _jsxs("svg", { className: "w-4 h-4 shrink-0 mt-0.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ _jsx("circle", { cx: "12", cy: "12", r: "10" }), /*#__PURE__*/ _jsx("line", { x1: "12", y1: "8", x2: "12", y2: "12" }), /*#__PURE__*/ _jsx("line", { x1: "12", y1: "16", x2: "12.01", y2: "16" }) ] }), /*#__PURE__*/ _jsxs("p", { children: [ t('admin.notif.vars_hint'), ' ', TEMPLATE_HINT_VARS.map((name)=>{ const v = "{{".concat(name, "}}"); return /*#__PURE__*/ _jsx("code", { className: "mx-0.5 bg-green-100 text-gray-800 px-1.5 py-0.5 rounded text-xs font-mono", children: v }, v); }) ] }) ] }), [ { key: 'email_verification', label: t('admin.notif.email_verification'), icon: /*#__PURE__*/ _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: /*#__PURE__*/ _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: t('admin.notif.registration_success'), icon: /*#__PURE__*/ _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: /*#__PURE__*/ _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: t('admin.notif.password_reset'), icon: /*#__PURE__*/ _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: /*#__PURE__*/ _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: t('admin.notif.new_offer'), icon: /*#__PURE__*/ _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: /*#__PURE__*/ _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: t('admin.notif.new_task'), icon: /*#__PURE__*/ _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: /*#__PURE__*/ _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: t('admin.notif.offer_accepted'), icon: /*#__PURE__*/ _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: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" }) }) }, { key: 'new_message', label: t('admin.notif.new_message'), icon: /*#__PURE__*/ _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: /*#__PURE__*/ _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: t('admin.notif.offer_declined'), icon: /*#__PURE__*/ _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: /*#__PURE__*/ _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: t('admin.notif.offer_other_accepted'), icon: /*#__PURE__*/ _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: /*#__PURE__*/ _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: t('admin.notif.task_updated'), icon: /*#__PURE__*/ _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: /*#__PURE__*/ _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: t('admin.notif.deadline_reminder'), icon: /*#__PURE__*/ _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: /*#__PURE__*/ _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: t('admin.notif.task_archived'), icon: /*#__PURE__*/ _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: /*#__PURE__*/ _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: t('admin.notif.referral_reward'), icon: /*#__PURE__*/ _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: /*#__PURE__*/ _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" }) }) }, // ── Plan / subscription emails ───────────────────────────── { key: 'plan_activated', label: t('admin.email_template.plan_activated'), icon: /*#__PURE__*/ _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: /*#__PURE__*/ _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: t('admin.email_template.plan_upgraded'), icon: /*#__PURE__*/ _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: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 10l7-7m0 0l7 7m-7-7v18" }) }) }, { key: 'plan_downgrade_scheduled', label: t('admin.email_template.plan_downgrade_scheduled'), icon: /*#__PURE__*/ _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: /*#__PURE__*/ _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: t('admin.email_template.plan_downgrade_applied'), icon: /*#__PURE__*/ _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: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19 14l-7 7m0 0l-7-7m7 7V3" }) }) }, { key: 'plan_renewal_reminder', label: t('admin.email_template.plan_renewal_reminder'), icon: /*#__PURE__*/ _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: /*#__PURE__*/ _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: t('admin.email_template.plan_insufficient_funds'), icon: /*#__PURE__*/ _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: /*#__PURE__*/ _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((param)=>{ let { key, label, icon } = param; const localeKey = "".concat(key, "_").concat(templateLocale); var _notifTemplates_localeKey, _ref; const tmpl = (_ref = (_notifTemplates_localeKey = notifTemplates[localeKey]) !== null && _notifTemplates_localeKey !== void 0 ? _notifTemplates_localeKey : notifTemplates[key]) !== null && _ref !== void 0 ? _ref : { subject: '', body: '' }; const isEditing = editingTemplate === key; var _TEMPLATE_VARS_key; const templateVars = (_TEMPLATE_VARS_key = TEMPLATE_VARS[key]) !== null && _TEMPLATE_VARS_key !== void 0 ? _TEMPLATE_VARS_key : []; return /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 overflow-hidden", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 px-5 py-4 cursor-pointer hover:bg-gray-50 select-none", onClick: ()=>setEditingTemplate(isEditing ? null : key), children: [ /*#__PURE__*/ _jsx("span", { className: "text-xl shrink-0", children: icon }), /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ _jsx("div", { className: "font-medium text-gray-800 text-sm", children: label }), tmpl.subject ? /*#__PURE__*/ _jsxs("div", { className: "text-xs text-gray-400 mt-0.5 truncate", children: [ t('admin.notif.tmpl.subject_label'), ": ", tmpl.subject ] }) : /*#__PURE__*/ _jsx("div", { className: "text-xs text-gray-300 mt-0.5 italic", children: t('admin.notif.tmpl.not_set') }) ] }), /*#__PURE__*/ _jsx("span", { className: "text-gray-400 transition-transform ".concat(isEditing ? 'rotate-90' : ''), children: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("polyline", { points: "9 18 15 12 9 6" }) }) }) ] }), isEditing && /*#__PURE__*/ _jsxs("div", { className: "px-5 pb-5 border-t border-gray-100 pt-4 space-y-3", children: [ /*#__PURE__*/ _jsx("div", { className: "flex gap-1 pb-2", children: [ 'el', 'en', 'uk', 'ru' ].map((loc)=>/*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setTemplateLocale(loc), className: "px-3 py-1 text-xs font-medium rounded-md transition-colors ".concat(templateLocale === loc ? 'bg-green-600 text-white' : 'bg-gray-100 text-gray-600 hover:bg-gray-200'), children: loc === 'el' ? 'ΕλληΜικά' : loc === 'en' ? 'English' : loc === 'uk' ? 'УкраїМська' : 'РусскОй' }, loc)) }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.notif.tmpl.subject_label') }), /*#__PURE__*/ _jsx("input", { value: tmpl.subject, onChange: (e)=>setNotifTemplates((prev)=>{ var _prev_localeKey; return { ...prev, [localeKey]: { ...(_prev_localeKey = prev[localeKey]) !== null && _prev_localeKey !== void 0 ? _prev_localeKey : { subject: '', body: '' }, subject: e.target.value } }; }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.notif.tmpl.body_label') }), /*#__PURE__*/ _jsx("textarea", { rows: 7, value: tmpl.body, onChange: (e)=>setNotifTemplates((prev)=>{ var _prev_localeKey; return { ...prev, [localeKey]: { ...(_prev_localeKey = prev[localeKey]) !== null && _prev_localeKey !== void 0 ? _prev_localeKey : { subject: '', body: '' }, body: e.target.value } }; }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 font-mono resize-y", placeholder: "

УважаеЌый {{userName}},

..." }) ] }), templateVars.length > 0 && /*#__PURE__*/ _jsxs("div", { className: "rounded-lg border border-amber-200 bg-amber-50 px-3 py-2", children: [ /*#__PURE__*/ _jsx("div", { className: "text-xs font-medium text-amber-800 mb-1", children: t('admin.notif.vars_hint') }), /*#__PURE__*/ _jsx("div", { className: "flex flex-wrap gap-1.5", children: templateVars.map((name)=>{ const variable = "{{".concat(name, "}}"); return /*#__PURE__*/ _jsx("code", { className: "bg-amber-100 text-amber-900 px-1.5 py-0.5 rounded text-xs font-mono", children: variable }, variable); }) }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-2 flex-wrap", children: [ /*#__PURE__*/ _jsx("button", { onClick: ()=>saveTemplate(key), disabled: templateSaving || templateTranslating, className: "px-4 py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700 disabled:opacity-50", children: templateSaving ? t('admin.notif.tmpl.saving') : t('admin.notif.tmpl.save') }), /*#__PURE__*/ _jsxs("button", { onClick: ()=>autoTranslateTemplate(key), disabled: templateSaving || templateTranslating, 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: [ /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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" }) }), templateTranslating ? t('admin.notif.tmpl.translating') : t('admin.notif.tmpl.translate') ] }), /*#__PURE__*/ _jsx("button", { onClick: ()=>setEditingTemplate(null), className: "px-4 py-2 bg-gray-100 text-gray-700 rounded-lg text-sm font-medium hover:bg-gray-200", children: t('admin.notif.tmpl.close') }) ] }) ] }) ] }, key); }) ] }), settingsTab === 'referral' && /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6 max-w-lg space-y-5", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-gray-800", children: t('admin.settings.referral.title') }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-400 mt-1", children: t('admin.settings.referral.hint') }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "text-sm font-medium text-gray-700", children: t('admin.settings.referral.enabled_label') }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400", children: t('admin.settings.referral.enabled_hint') }) ] }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setReferralForm((f)=>({ ...f, enabled: !f.enabled })), className: "relative w-10 h-6 rounded-full p-0 transition-colors cursor-pointer ".concat(referralForm.enabled ? 'bg-green-600' : 'bg-gray-300'), children: /*#__PURE__*/ _jsx("span", { className: "absolute left-0 top-1 w-4 h-4 bg-white rounded-full shadow transition-transform ".concat(referralForm.enabled ? 'translate-x-5' : 'translate-x-1') }) }) ] }), /*#__PURE__*/ _jsxs("div", { className: "border border-gray-100 rounded-lg p-4 space-y-4", children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs font-semibold text-gray-500 uppercase tracking-wide", children: t('admin.settings.referral.shared_section') }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.referral.plan_label') }), /*#__PURE__*/ _jsxs("select", { value: referralForm.planId, onChange: (e)=>setReferralForm((f)=>({ ...f, planId: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400", children: [ /*#__PURE__*/ _jsx("option", { value: "", children: t('admin.settings.referral.no_plan') }), planRows.map((p)=>/*#__PURE__*/ _jsx("option", { value: p.id, children: p.name }, p.id)) ] }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-1", children: t('admin.settings.referral.plan_hint') }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.referral.days_label') }), /*#__PURE__*/ _jsx("input", { type: "number", min: "1", max: "365", value: referralForm.days, onChange: (e)=>setReferralForm((f)=>({ ...f, days: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-1", children: t('admin.settings.referral.days_hint') }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3", children: [ /*#__PURE__*/ _jsx("button", { onClick: saveReferralSettings, disabled: referralSaving, className: "px-5 py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700 disabled:opacity-50", children: referralSaving ? t('admin.settings.saving') : t('common.save') }), referralSaved && /*#__PURE__*/ _jsx("span", { className: "text-sm text-green-600", children: t('admin.settings.saved') }) ] }) ] }), settingsTab === 'socials' && /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6 max-w-lg space-y-5", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-gray-800 mb-1", children: t('admin.settings.socials.title') }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400", children: t('admin.settings.socials.hint') }) ] }), [ { key: 'telegram', label: 'Telegram', placeholder: 'https://t.me/yourname', icon: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", viewBox: "0 0 24 24", fill: "currentColor", children: /*#__PURE__*/ _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: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", viewBox: "0 0 24 24", fill: "currentColor", children: /*#__PURE__*/ _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: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", viewBox: "0 0 24 24", fill: "currentColor", children: /*#__PURE__*/ _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: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", viewBox: "0 0 24 24", fill: "currentColor", children: /*#__PURE__*/ _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: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", viewBox: "0 0 24 24", fill: "currentColor", children: /*#__PURE__*/ _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: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", viewBox: "0 0 24 24", fill: "currentColor", children: /*#__PURE__*/ _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: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", viewBox: "0 0 24 24", fill: "currentColor", children: /*#__PURE__*/ _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: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", viewBox: "0 0 24 24", fill: "currentColor", children: /*#__PURE__*/ _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((param)=>{ let { key, label, placeholder, icon } = param; return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("label", { className: "block text-sm font-medium text-gray-700 mb-1 flex items-center gap-2", children: [ /*#__PURE__*/ _jsx("span", { className: "".concat(socialForm[key] ? 'text-green-600' : 'text-gray-300'), children: icon }), label, !socialForm[key] && /*#__PURE__*/ _jsx("span", { className: "text-xs font-normal text-gray-400 ml-auto", children: "Ме запПлМеМП" }) ] }), /*#__PURE__*/ _jsx("input", { type: "url", value: socialForm[key], onChange: (e)=>setSocialForm((f)=>({ ...f, [key]: e.target.value })), placeholder: placeholder, className: "w-full border rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 ".concat(socialForm[key] ? 'border-green-300 bg-green-50/30' : 'border-gray-300') }) ] }, key); }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 pt-2", children: [ /*#__PURE__*/ _jsx("button", { onClick: saveSocialSettings, disabled: socialSaving, className: "px-5 py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700 disabled:opacity-50", children: socialSaving ? t('admin.settings.saving') : t('common.save') }), socialSaved && /*#__PURE__*/ _jsx("span", { className: "text-sm text-green-600", children: t('admin.settings.saved') }) ] }) ] }), settingsTab === 'seo' && /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6 max-w-lg space-y-6", children: [ /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-gray-800", children: t('admin.settings.seo.title') }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "text-sm font-medium text-gray-700", children: t('admin.settings.seo.maintenance_label') }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-0.5", children: t('admin.settings.seo.maintenance_hint') }) ] }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setSeoForm((f)=>({ ...f, maintenanceMode: !f.maintenanceMode })), className: "relative w-10 h-6 rounded-full p-0 transition-colors cursor-pointer flex-shrink-0 ".concat(seoForm.maintenanceMode ? 'bg-red-500' : 'bg-gray-300'), children: /*#__PURE__*/ _jsx("span", { className: "absolute left-0 top-1 w-4 h-4 bg-white rounded-full shadow transition-transform ".concat(seoForm.maintenanceMode ? 'translate-x-5' : 'translate-x-1') }) }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "text-sm font-medium text-gray-700", children: t('admin.settings.seo.indexing_label') }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-0.5", children: t('admin.settings.seo.indexing_hint') }) ] }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setSeoForm((f)=>({ ...f, indexingEnabled: !f.indexingEnabled })), className: "relative w-10 h-6 rounded-full p-0 transition-colors cursor-pointer flex-shrink-0 ".concat(seoForm.indexingEnabled ? 'bg-green-600' : 'bg-gray-300'), children: /*#__PURE__*/ _jsx("span", { className: "absolute left-0 top-1 w-4 h-4 bg-white rounded-full shadow transition-transform ".concat(seoForm.indexingEnabled ? 'translate-x-5' : 'translate-x-1') }) }) ] }), /*#__PURE__*/ _jsx("div", { className: "space-y-4", children: /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("p", { className: "text-sm font-medium text-gray-700 mb-2", children: [ t('admin.settings.seo.site_title_label'), " / ", t('admin.settings.seo.site_description_label') ] }), /*#__PURE__*/ _jsx("div", { className: "flex gap-1 mb-3", children: [ { code: 'el', flag: '🇬🇷', label: 'EL' }, { code: 'en', flag: '🇬🇧', label: 'EN' }, { code: 'ru', flag: '🇷🇺', label: 'RU' }, { code: 'uk', flag: '🇺🇊', label: 'UK' } ].map((param)=>{ let { code, flag, label } = param; return /*#__PURE__*/ _jsxs("button", { type: "button", onClick: ()=>setSeoLangTab(code), className: "flex items-center gap-1 px-3 py-1.5 rounded-lg text-sm font-medium transition-colors ".concat(seoLangTab === code ? 'bg-green-600 text-white' : 'bg-gray-100 text-gray-600 hover:bg-gray-200'), children: [ flag, " ", label ] }, code); }) }), /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-500 mb-1", children: t('admin.settings.seo.site_title_label') }), /*#__PURE__*/ _jsx("input", { value: seoForm["siteTitle".concat(seoLangTab.charAt(0).toUpperCase() + seoLangTab.slice(1))], onChange: (e)=>setSeoForm((f)=>({ ...f, ["siteTitle".concat(seoLangTab.charAt(0).toUpperCase() + seoLangTab.slice(1))]: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 mb-3", placeholder: seoLangTab === 'el' ? 'CanHelp — ΚάΞε άΜΞρωπος έχει κάτι Μα προσφέρει' : seoLangTab === 'en' ? 'CanHelp — Everyone has something valuable to offer' : seoLangTab === 'ru' ? 'CanHelp — КажЎый челПвек ЌПжет чеЌ-тП пПЌПчь' : 'CanHelp — КПжеМ Ќає МавОчку, яка ЌПже ЎПпПЌПгтО іМшПЌу' }), /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-500 mb-1", children: t('admin.settings.seo.site_description_label') }), /*#__PURE__*/ _jsx("textarea", { rows: 3, value: seoForm["siteDescription".concat(seoLangTab.charAt(0).toUpperCase() + seoLangTab.slice(1))], onChange: (e)=>setSeoForm((f)=>({ ...f, ["siteDescription".concat(seoLangTab.charAt(0).toUpperCase() + seoLangTab.slice(1))]: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 resize-none", placeholder: seoLangTab === 'el' ? 'Η ελληΜική πλατφόρΌα για online αΜάΞεση εργασιώΜ...' : seoLangTab === 'en' ? 'The Greek platform for online task delegation...' : seoLangTab === 'ru' ? 'Греческая платфПрЌа Ўля ПМлайМ-пПОска спецОалОстПв...' : 'Грецька платфПрЌа Ўля пПшуку фахівців ПМлайМ...' }) ] }) }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.seo.head_scripts_label') }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mb-2", children: t('admin.settings.seo.head_scripts_hint') }), /*#__PURE__*/ _jsx("textarea", { rows: 6, value: seoForm.headScripts, onChange: (e)=>setSeoForm((f)=>({ ...f, headScripts: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm font-mono focus:outline-none focus:ring-2 focus:ring-blue-400 resize-y", placeholder: '\n', spellCheck: false }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3", children: [ /*#__PURE__*/ _jsx("button", { onClick: saveSeoSettings, disabled: seoSaving, className: "px-5 py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700 disabled:opacity-50", children: seoSaving ? t('admin.settings.saving') : t('common.save') }), seoSaved && /*#__PURE__*/ _jsx("span", { className: "text-sm text-green-600", children: t('admin.settings.saved') }) ] }) ] }), settingsTab === 'telegram' && /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6 max-w-lg space-y-6", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-gray-800 mb-1", children: t('admin.settings.telegram.title') }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400", children: t('admin.settings.telegram.help') }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.telegram.bot_token') }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-2", children: [ /*#__PURE__*/ _jsx("input", { type: "text", value: telegramForm.botToken, onChange: (e)=>{ setTelegramForm((f)=>({ ...f, botToken: e.target.value })); setVerifyResultTelegramToken(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" }), /*#__PURE__*/ _jsx("button", { onClick: verifyTelegramToken, disabled: verifyingTelegramToken || !telegramForm.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: verifyingTelegramToken ? '...' : t('admin.settings.telegram.verify') }) ] }), verifyResultTelegramToken && /*#__PURE__*/ _jsx("p", { className: "text-xs mt-1 font-medium ".concat(verifyResultTelegramToken.ok ? 'text-green-600' : 'text-red-500'), children: verifyResultTelegramToken.ok ? "✓ ".concat(verifyResultTelegramToken.msg) : "✗ ".concat(verifyResultTelegramToken.msg) }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.telegram.admin_chat_id') }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-2", children: [ /*#__PURE__*/ _jsx("input", { type: "text", value: telegramForm.adminChatId, onChange: (e)=>setTelegramForm((f)=>({ ...f, adminChatId: e.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" }), /*#__PURE__*/ _jsx("button", { onClick: ()=>testTelegram('admin'), disabled: testingTelegramAdmin || !telegramForm.botToken || !telegramForm.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: testingTelegramAdmin ? '...' : t('admin.settings.telegram.test') }) ] }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-1", children: t('admin.settings.telegram.admin_chat_hint') }), testResultTelegramAdmin && /*#__PURE__*/ _jsx("p", { className: "text-xs mt-1 font-medium ".concat(testResultTelegramAdmin.ok ? 'text-green-600' : 'text-red-500'), children: testResultTelegramAdmin.ok ? "✓ ".concat(testResultTelegramAdmin.msg) : "✗ ".concat(testResultTelegramAdmin.msg) }) ] }), /*#__PURE__*/ _jsxs("div", { className: "space-y-3", children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700", children: t('admin.settings.telegram.channels_title') }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 -mt-2", children: t('admin.settings.telegram.channel_hint') }), [ { locale: 'el', flag: '🇬🇷', label: 'ΕλληΜικά', field: 'channelIdEl' }, { locale: 'en', flag: '🇬🇧', label: 'English', field: 'channelIdEn' }, { locale: 'ru', flag: '🇷🇺', label: 'РусскОй', field: 'channelIdRu' }, { locale: 'uk', flag: '🇺🇊', label: 'УкраїМська', field: 'channelIdUk' } ].map((param)=>{ let { locale: loc, flag, label, field } = param; return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-1.5 mb-1", children: [ /*#__PURE__*/ _jsx("span", { className: "text-base leading-none", children: flag }), /*#__PURE__*/ _jsx("span", { className: "text-xs font-medium text-gray-600", children: label }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-2", children: [ /*#__PURE__*/ _jsx("input", { type: "text", value: telegramForm[field], onChange: (e)=>setTelegramForm((f)=>({ ...f, [field]: e.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" }), /*#__PURE__*/ _jsx("button", { onClick: ()=>testTelegram(loc), disabled: testingLocale === loc || !telegramForm.botToken || !telegramForm[field], className: "px-3 py-2 border border-gray-300 rounded-lg text-sm hover:bg-gray-50 disabled:opacity-40 flex-shrink-0", children: testingLocale === loc ? '...' : t('admin.settings.telegram.test') }) ] }), testResultChannels[loc] && /*#__PURE__*/ _jsx("p", { className: "text-xs mt-1 font-medium ".concat(testResultChannels[loc].ok ? 'text-green-600' : 'text-red-500'), children: testResultChannels[loc].ok ? "✓ ".concat(testResultChannels[loc].msg) : "✗ ".concat(testResultChannels[loc].msg) }) ] }, loc); }) ] }), /*#__PURE__*/ _jsxs("div", { className: "space-y-4", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "text-sm font-medium text-gray-700", children: t('admin.settings.telegram.notify_registrations') }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-0.5", children: t('admin.settings.telegram.notify_registrations_hint') }) ] }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setTelegramForm((f)=>({ ...f, notifyRegistrations: !f.notifyRegistrations })), className: "relative w-10 h-6 rounded-full transition-colors cursor-pointer flex-shrink-0 p-0 border-0 outline-none ".concat(telegramForm.notifyRegistrations ? 'bg-green-600' : 'bg-gray-300'), children: /*#__PURE__*/ _jsx("span", { className: "absolute top-1 left-0 w-4 h-4 bg-white rounded-full shadow transition-transform ".concat(telegramForm.notifyRegistrations ? 'translate-x-5' : 'translate-x-1') }) }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "text-sm font-medium text-gray-700", children: t('admin.settings.telegram.post_new_tasks') }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-0.5", children: t('admin.settings.telegram.post_new_tasks_hint') }) ] }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setTelegramForm((f)=>({ ...f, postNewTasks: !f.postNewTasks })), className: "relative w-10 h-6 rounded-full transition-colors cursor-pointer flex-shrink-0 p-0 border-0 outline-none ".concat(telegramForm.postNewTasks ? 'bg-green-600' : 'bg-gray-300'), children: /*#__PURE__*/ _jsx("span", { className: "absolute top-1 left-0 w-4 h-4 bg-white rounded-full shadow transition-transform ".concat(telegramForm.postNewTasks ? 'translate-x-5' : 'translate-x-1') }) }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 pt-2", children: [ /*#__PURE__*/ _jsx("button", { onClick: saveTelegramSettings, disabled: telegramSaving, className: "px-5 py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700 disabled:opacity-50", children: telegramSaving ? t('admin.settings.saving') : t('common.save') }), telegramSaved && /*#__PURE__*/ _jsx("span", { className: "text-sm text-green-600", children: t('admin.settings.saved') }) ] }) ] }) ] }), tab === 'support' && /*#__PURE__*/ _jsxs("div", { className: "space-y-4", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex flex-wrap gap-3 mb-2", children: [ /*#__PURE__*/ _jsxs("form", { className: "flex gap-2", onSubmit: (e)=>{ e.preventDefault(); setSupportQ(supportQInput); setSupportPage(1); }, children: [ /*#__PURE__*/ _jsx("input", { value: supportQInput, onChange: (e)=>setSupportQInput(e.target.value), placeholder: t('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" }), /*#__PURE__*/ _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: t('admin.search', 'Search') }), supportQ && /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>{ setSupportQInput(''); setSupportQ(''); setSupportPage(1); }, className: "text-sm text-gray-500 hover:text-gray-700 px-2", children: "✕" }) ] }), /*#__PURE__*/ _jsxs("select", { value: supportStatus, onChange: (e)=>{ setSupportStatus(e.target.value); setSupportPage(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: [ /*#__PURE__*/ _jsx("option", { value: "", children: t('admin.support.all_statuses', 'All statuses') }), /*#__PURE__*/ _jsx("option", { value: "open", children: t('admin.support.status.open', 'Open') }), /*#__PURE__*/ _jsx("option", { value: "in_progress", children: t('admin.support.status.in_progress', 'In progress') }), /*#__PURE__*/ _jsx("option", { value: "resolved", children: t('admin.support.status.resolved', 'Resolved') }), /*#__PURE__*/ _jsx("option", { value: "closed", children: t('admin.support.status.closed', 'Closed') }) ] }), /*#__PURE__*/ _jsxs("select", { value: supportType, onChange: (e)=>{ setSupportType(e.target.value); setSupportPage(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: [ /*#__PURE__*/ _jsx("option", { value: "", children: t('admin.support.all_types', 'All types') }), /*#__PURE__*/ _jsxs("option", { value: "bug", children: [ "\uD83D\uDC1B ", t('support.type.bug', 'Bug') ] }), /*#__PURE__*/ _jsxs("option", { value: "suggestion", children: [ "\uD83D\uDCA1 ", t('support.type.suggestion', 'Suggestion') ] }), /*#__PURE__*/ _jsxs("option", { value: "other", children: [ "\uD83D\uDCAC ", t('support.type.other', 'Other') ] }) ] }), /*#__PURE__*/ _jsxs("span", { className: "ml-auto text-sm text-gray-400 self-center", children: [ supportTotal, " ", t('admin.pagination.total', 'total') ] }) ] }), loading ? /*#__PURE__*/ _jsx("div", { className: "text-center py-10 text-gray-400", children: t('common.loading') }) : supportTickets.length === 0 ? /*#__PURE__*/ _jsx("div", { className: "text-center py-10 text-gray-400", children: t('admin.support.none', 'No tickets') }) : supportTickets.map((ticket)=>{ const typeColors = { bug: 'bg-red-100 text-red-700', suggestion: 'bg-green-100 text-green-700', other: 'bg-gray-100 text-gray-600' }; const statusColors2 = { 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' }; const typeIcons = { bug: '🐛', suggestion: '💡', other: '💬' }; const isReplying = supportReplyId === ticket.id; var _typeColors_ticket_type, _statusColors2_ticket_status; return /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-5", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-start justify-between gap-4 mb-3", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 flex-wrap mb-1", children: [ /*#__PURE__*/ _jsxs("span", { className: "px-2 py-0.5 rounded-full text-xs font-medium ".concat((_typeColors_ticket_type = typeColors[ticket.type]) !== null && _typeColors_ticket_type !== void 0 ? _typeColors_ticket_type : 'bg-gray-100 text-gray-600'), children: [ typeIcons[ticket.type], " ", ticket.type ] }), /*#__PURE__*/ _jsx("span", { className: "px-2 py-0.5 rounded-full text-xs font-medium ".concat((_statusColors2_ticket_status = statusColors2[ticket.status]) !== null && _statusColors2_ticket_status !== void 0 ? _statusColors2_ticket_status : 'bg-gray-100 text-gray-500'), children: ticket.status }), /*#__PURE__*/ _jsxs("span", { className: "text-xs text-gray-400", children: [ "#", ticket.id.slice(0, 8) ] }) ] }), /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-gray-900 text-sm", children: ticket.subject }), ticket.userName && /*#__PURE__*/ _jsxs("p", { className: "text-xs text-gray-400 mt-0.5", children: [ ticket.userName, " \xb7 ", ticket.userEmail ] }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-0.5", children: new Date(ticket.createdAt).toLocaleString(dateLocale) }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-2 flex-shrink-0", children: [ ticket.status !== 'closed' && /*#__PURE__*/ _jsx("button", { onClick: ()=>{ setSupportReplyId(isReplying ? null : ticket.id); setSupportReplyText(ticket.adminReply || ''); }, className: "text-xs px-3 py-1.5 rounded-lg font-medium bg-green-50 text-green-700 hover:bg-green-100", children: isReplying ? t('admin.support.cancel', 'Cancel') : t('admin.support.reply', 'Reply') }), ticket.status === 'open' && /*#__PURE__*/ _jsx("button", { onClick: ()=>api.setSupportTicketStatus(ticket.id, 'closed').then(()=>setSupportTickets((prev)=>prev.map((t)=>t.id === ticket.id ? { ...t, status: 'closed' } : t))), className: "text-xs px-3 py-1.5 rounded-lg font-medium bg-gray-100 text-gray-600 hover:bg-gray-200", children: t('admin.support.close', 'Close') }) ] }) ] }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-700 whitespace-pre-wrap bg-gray-50 rounded-lg p-3 mb-3", children: ticket.body }), ticket.adminReply && !isReplying && /*#__PURE__*/ _jsxs("div", { className: "bg-green-50 border border-green-100 rounded-lg p-3 mb-2", children: [ /*#__PURE__*/ _jsxs("p", { className: "text-xs font-medium text-green-600 mb-1", children: [ t('admin.support.your_reply', 'Your reply'), ":" ] }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-800 whitespace-pre-wrap", children: ticket.adminReply }) ] }), isReplying && /*#__PURE__*/ _jsxs("div", { className: "space-y-2 mt-2", children: [ /*#__PURE__*/ _jsx("textarea", { rows: 3, value: supportReplyText, onChange: (e)=>setSupportReplyText(e.target.value), placeholder: t('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" }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-2 items-center", children: [ /*#__PURE__*/ _jsxs("select", { id: "status-".concat(ticket.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: [ /*#__PURE__*/ _jsx("option", { value: "open", children: t('admin.support.status.open', 'Open') }), /*#__PURE__*/ _jsx("option", { value: "in_progress", children: t('admin.support.status.in_progress', 'In progress') }), /*#__PURE__*/ _jsx("option", { value: "resolved", children: t('admin.support.status.resolved', 'Resolved') }), /*#__PURE__*/ _jsx("option", { value: "closed", children: t('admin.support.status.closed', 'Closed') }) ] }), /*#__PURE__*/ _jsx("button", { disabled: supportReplySaving || !supportReplyText.trim(), onClick: async ()=>{ const statusEl = document.getElementById("status-".concat(ticket.id)); setSupportReplySaving(true); try { const updated = await api.replyToSupportTicket(ticket.id, { adminReply: supportReplyText, status: statusEl === null || statusEl === void 0 ? void 0 : statusEl.value }); setSupportTickets((prev)=>prev.map((t)=>t.id === ticket.id ? { ...t, ...updated } : t)); setSupportReplyId(null); } catch (e) {} finally{ setSupportReplySaving(false); } }, 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: supportReplySaving ? '...' : t('admin.support.send_reply', 'Send') }) ] }) ] }) ] }, ticket.id); }), /*#__PURE__*/ _jsx(Pagination, { page: supportPage, total: supportTotal, limit: 30, onChange: setSupportPage, totalLabel: t('admin.pagination.total') }) ] }), tab === 'push' && /*#__PURE__*/ _jsxs("div", { className: "space-y-4", children: [ /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-5 space-y-4", children: [ /*#__PURE__*/ _jsx("h2", { className: "text-lg font-semibold text-gray-800", children: "Push-рассылка" }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-2", children: [ /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setPushMode('broadcast'), className: "px-3 py-1.5 text-sm rounded-lg border ".concat(pushMode === 'broadcast' ? 'bg-green-600 text-white border-green-600' : 'bg-white text-gray-700 border-gray-300'), children: "ВсеЌ пПльзПвателяЌ" }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setPushMode('user'), className: "px-3 py-1.5 text-sm rounded-lg border ".concat(pushMode === 'user' ? 'bg-green-600 text-white border-green-600' : 'bg-white text-gray-700 border-gray-300'), children: "КПМкретМПЌу пПльзПвателю" }) ] }), pushMode === 'user' && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "text-sm text-gray-600 block mb-1", children: "User ID" }), /*#__PURE__*/ _jsx("input", { value: pushTargetUserId, onChange: (e)=>setPushTargetUserId(e.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" }) ] }), pushMode === 'broadcast' && /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-2 text-sm text-gray-700", children: [ /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: pushOnlyActive, onChange: (e)=>setPushOnlyActive(e.target.checked) }), "ТПлькП актОвМыЌ пПльзПвателяЌ" ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "text-sm text-gray-600 block mb-1", children: "ЗагПлПвПк" }), /*#__PURE__*/ _jsx("input", { value: pushTitle, onChange: (e)=>setPushTitle(e.target.value), placeholder: "НапрОЌер: НПвые заЎачО ряЎПЌ с ваЌО", className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "text-sm text-gray-600 block mb-1", children: "Текст" }), /*#__PURE__*/ _jsx("textarea", { rows: 3, value: pushBody, onChange: (e)=>setPushBody(e.target.value), placeholder: "КПрПткОй текст увеЎПЌлеМОя", className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 resize-none" }) ] }), /*#__PURE__*/ _jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-3", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "text-sm text-gray-600 block mb-1", children: "ТОп" }), /*#__PURE__*/ _jsx("input", { value: pushType, onChange: (e)=>setPushType(e.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" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "text-sm text-gray-600 block mb-1", children: "Reference ID (ПпцОПМальМП)" }), /*#__PURE__*/ _jsx("input", { value: pushReferenceId, onChange: (e)=>setPushReferenceId(e.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" }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3", children: [ /*#__PURE__*/ _jsx("button", { type: "button", onClick: sendAdminPush, disabled: pushSending || !pushTitle.trim() || pushMode === 'user' && !pushTargetUserId.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: pushSending ? 'Отправка...' : 'ОтправОть Push' }), pushError && /*#__PURE__*/ _jsx("span", { className: "text-sm text-red-600", children: pushError }) ] }) ] }), pushResult && /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-5", children: [ /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-gray-800 mb-3", children: "Результат" }), 'usersTotal' in pushResult ? /*#__PURE__*/ _jsxs("div", { className: "grid grid-cols-2 md:grid-cols-5 gap-3 text-sm", children: [ /*#__PURE__*/ _jsxs("div", { className: "rounded-lg bg-gray-50 border border-gray-200 px-3 py-2", children: [ /*#__PURE__*/ _jsx("div", { className: "text-gray-500", children: "ППльзПвателей" }), /*#__PURE__*/ _jsx("div", { className: "text-gray-900 font-semibold", children: pushResult.usersTotal }) ] }), /*#__PURE__*/ _jsxs("div", { className: "rounded-lg bg-gray-50 border border-gray-200 px-3 py-2", children: [ /*#__PURE__*/ _jsx("div", { className: "text-gray-500", children: "ППлучОлО" }), /*#__PURE__*/ _jsx("div", { className: "text-gray-900 font-semibold", children: pushResult.usersWithSent }) ] }), /*#__PURE__*/ _jsxs("div", { className: "rounded-lg bg-gray-50 border border-gray-200 px-3 py-2", children: [ /*#__PURE__*/ _jsx("div", { className: "text-gray-500", children: "ОтправлеМП push" }), /*#__PURE__*/ _jsx("div", { className: "text-gray-900 font-semibold", children: pushResult.pushesSent }) ] }), /*#__PURE__*/ _jsxs("div", { className: "rounded-lg bg-gray-50 border border-gray-200 px-3 py-2", children: [ /*#__PURE__*/ _jsx("div", { className: "text-gray-500", children: "НевалОЎМые тПкеМы" }), /*#__PURE__*/ _jsx("div", { className: "text-gray-900 font-semibold", children: pushResult.invalidTokens }) ] }), /*#__PURE__*/ _jsxs("div", { className: "rounded-lg bg-gray-50 border border-gray-200 px-3 py-2", children: [ /*#__PURE__*/ _jsx("div", { className: "text-gray-500", children: "ОшОбкО пП userId" }), /*#__PURE__*/ _jsx("div", { className: "text-gray-900 font-semibold", children: pushResult.failedUsers.length }) ] }) ] }) : /*#__PURE__*/ _jsxs("div", { className: "grid grid-cols-2 md:grid-cols-4 gap-3 text-sm", children: [ /*#__PURE__*/ _jsxs("div", { className: "rounded-lg bg-gray-50 border border-gray-200 px-3 py-2", children: [ /*#__PURE__*/ _jsx("div", { className: "text-gray-500", children: "User ID" }), /*#__PURE__*/ _jsx("div", { className: "text-gray-900 font-mono text-xs break-all", children: pushResult.targetUserId }) ] }), /*#__PURE__*/ _jsxs("div", { className: "rounded-lg bg-gray-50 border border-gray-200 px-3 py-2", children: [ /*#__PURE__*/ _jsx("div", { className: "text-gray-500", children: "ТПкеМПв МайЎеМП" }), /*#__PURE__*/ _jsx("div", { className: "text-gray-900 font-semibold", children: (_pushResult_tokensFound = pushResult.tokensFound) !== null && _pushResult_tokensFound !== void 0 ? _pushResult_tokensFound : 0 }) ] }), /*#__PURE__*/ _jsxs("div", { className: "rounded-lg bg-gray-50 border border-gray-200 px-3 py-2", children: [ /*#__PURE__*/ _jsx("div", { className: "text-gray-500", children: "ОтправлеМП push" }), /*#__PURE__*/ _jsx("div", { className: "text-gray-900 font-semibold", children: pushResult.sent }) ] }), /*#__PURE__*/ _jsxs("div", { className: "rounded-lg bg-gray-50 border border-gray-200 px-3 py-2", children: [ /*#__PURE__*/ _jsx("div", { className: "text-gray-500", children: "НевалОЎМые тПкеМы" }), /*#__PURE__*/ _jsx("div", { className: "text-gray-900 font-semibold", children: pushResult.invalidTokens }) ] }) ] }), 'usersTotal' in pushResult ? /*#__PURE__*/ _jsx(_Fragment, { children: ((_pushResult_usersWithoutTokens = pushResult.usersWithoutTokens) !== null && _pushResult_usersWithoutTokens !== void 0 ? _pushResult_usersWithoutTokens : 0) > 0 || ((_pushResult_usersConfigBlocked = pushResult.usersConfigBlocked) !== null && _pushResult_usersConfigBlocked !== void 0 ? _pushResult_usersConfigBlocked : 0) > 0 || ((_pushResult_usersAuthFailed = pushResult.usersAuthFailed) !== null && _pushResult_usersAuthFailed !== void 0 ? _pushResult_usersAuthFailed : 0) > 0 || ((_pushResult_usersAllFailed = pushResult.usersAllFailed) !== null && _pushResult_usersAllFailed !== void 0 ? _pushResult_usersAllFailed : 0) > 0 ? /*#__PURE__*/ _jsxs("div", { className: "mt-3 rounded-lg border border-amber-200 bg-amber-50 px-3 py-2 text-xs text-amber-900", children: [ /*#__PURE__*/ _jsxs("div", { children: [ "ДОагМПстОка: без тПкеМПв — ", (_pushResult_usersWithoutTokens1 = pushResult.usersWithoutTokens) !== null && _pushResult_usersWithoutTokens1 !== void 0 ? _pushResult_usersWithoutTokens1 : 0, ", FCM Ме МастрПеМ — ", (_pushResult_usersConfigBlocked1 = pushResult.usersConfigBlocked) !== null && _pushResult_usersConfigBlocked1 !== void 0 ? _pushResult_usersConfigBlocked1 : 0, ", ПшОбка auth FCM — ", (_pushResult_usersAuthFailed1 = pushResult.usersAuthFailed) !== null && _pushResult_usersAuthFailed1 !== void 0 ? _pushResult_usersAuthFailed1 : 0, ", FCM send failed — ", (_pushResult_usersAllFailed1 = pushResult.usersAllFailed) !== null && _pushResult_usersAllFailed1 !== void 0 ? _pushResult_usersAllFailed1 : 0 ] }), pushResult.failedReasonStats && Object.keys(pushResult.failedReasonStats).length > 0 ? /*#__PURE__*/ _jsxs("div", { className: "mt-1", children: [ "КПЎы ПшОбПк FCM: ", Object.entries(pushResult.failedReasonStats).map((param)=>{ let [key, count] = param; return "".concat(key, ": ").concat(count); }).join(', ') ] }) : null, pushResult.failedReasonSample ? /*#__PURE__*/ _jsxs("div", { className: "mt-1", children: [ "ПрОЌер ПшОбкО: ", describeFcmFailure(pushResult.failedReasonStats ? Object.keys(pushResult.failedReasonStats)[0] : null, pushResult.failedReasonSample) ] }) : null ] }) : null }) : /*#__PURE__*/ _jsx(_Fragment, { children: pushResult.reason ? /*#__PURE__*/ _jsxs("div", { className: "mt-3 rounded-lg border border-amber-200 bg-amber-50 px-3 py-2 text-xs text-amber-900", children: [ /*#__PURE__*/ _jsxs("div", { children: [ "ДОагМПстОка: ", pushResult.reason === 'no_tokens' ? 'у пПльзПвателя Мет push-тПкеМПв' : pushResult.reason === 'fcm_not_configured' ? 'FCM Ме МастрПеМ Ма API (переЌеММые FCM_*)' : pushResult.reason === 'fcm_auth_failed' ? 'ПшОбка автПрОзацОО FCM (service account)' : describeFcmFailure(pushResult.failureKey, pushResult.failureMessage) ] }), pushResult.failureKey ? /*#__PURE__*/ _jsxs("div", { className: "mt-1", children: [ "КПЎ FCM: ", pushResult.failureKey ] }) : null, pushResult.failureMessage ? /*#__PURE__*/ _jsxs("div", { className: "mt-1", children: [ "СППбщеМОе FCM: ", pushResult.failureMessage ] }) : null ] }) : null }) ] }) ] }), tab === 'backup' && /*#__PURE__*/ _jsxs("div", { className: "space-y-6", children: [ /*#__PURE__*/ _jsxs("h2", { className: "text-lg font-semibold text-gray-800 flex items-center gap-2", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5 text-green-600", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ _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" }) }), t('admin.backup.title', 'Backup') ] }), backupMsg && /*#__PURE__*/ _jsxs("div", { className: "".concat(backupMsgError ? '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: [ /*#__PURE__*/ _jsx("span", { children: backupMsg }), /*#__PURE__*/ _jsx("button", { onClick: ()=>setBackupMsg(null), className: "".concat(backupMsgError ? 'text-red-500 hover:text-red-700' : 'text-green-500 hover:text-green-700', " ml-4"), children: "\xd7" }) ] }), /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-5 flex items-center justify-between", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "font-medium text-gray-800 text-sm", children: t('admin.backup.autoBackup', 'Auto Backup') }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-500 mt-0.5", children: t('admin.backup.autoBackupDesc', 'Create a backup every day automatically') }) ] }), /*#__PURE__*/ _jsx("button", { disabled: backupAutoSaving, onClick: async ()=>{ setBackupAutoSaving(true); try { await request('/admin/backup/settings', { method: 'PUT', body: JSON.stringify({ autoEnabled: !backupAutoEnabled }) }); setBackupAutoEnabled((v)=>!v); } catch (e) {} setBackupAutoSaving(false); }, className: "relative w-11 h-6 rounded-full transition-colors ".concat(backupAutoEnabled ? 'bg-green-600' : 'bg-gray-300', " ").concat(backupAutoSaving ? 'opacity-50' : ''), children: /*#__PURE__*/ _jsx("span", { className: "absolute top-0.5 left-0.5 w-5 h-5 rounded-full bg-white shadow transition-transform ".concat(backupAutoEnabled ? 'translate-x-5' : 'translate-x-0') }) }) ] }), /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-5", children: [ /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-gray-800 text-sm mb-4", children: t('admin.backup.title', 'Database Backup') }), /*#__PURE__*/ _jsxs("div", { className: "flex flex-wrap gap-3", children: [ /*#__PURE__*/ _jsxs("button", { disabled: backupExporting, onClick: async ()=>{ setBackupExporting(true); try { const BASE = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; const res = await fetch("".concat(BASE, "/api/admin/backup/export"), { credentials: 'include' }); if (!res.ok) throw new Error('Export failed'); const blob = await res.blob(); const url = URL.createObjectURL(blob); const a = document.createElement('a'); a.href = url; a.download = "backup_".concat(new Date().toISOString().slice(0, 10), ".sql.gz"); a.click(); URL.revokeObjectURL(url); setBackupSuccess(t('admin.backup.exportSuccess', 'Export successful')); } catch (e) { setBackupError(e.message || 'Error'); } setBackupExporting(false); }, 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: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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" }) }), backupExporting ? t('admin.backup.exporting', 'Exporting...') : t('admin.backup.exportAll', 'Export Full DB') ] }), /*#__PURE__*/ _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 ".concat(backupImporting === 'full' ? 'opacity-50 pointer-events-none' : ''), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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" }) }), backupImporting === 'full' ? t('admin.backup.importing', 'Importing...') : t('admin.backup.importAll', 'Import Full DB'), /*#__PURE__*/ _jsx("input", { type: "file", accept: ".sql.gz,.gz", className: "hidden", onChange: async (e)=>{ var _e_target_files; const file = (_e_target_files = e.target.files) === null || _e_target_files === void 0 ? void 0 : _e_target_files[0]; if (!file) return; if (!window.confirm(t('admin.backup.restoreConfirm', 'Restore from this backup?'))) return; setBackupImporting('full'); try { const fd = new FormData(); fd.append('file', file); const BASE = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; const res = await fetch("".concat(BASE, "/api/admin/backup/import"), { method: 'POST', credentials: 'include', body: fd }); if (!res.ok) throw new Error('Import failed'); setBackupSuccess(t('admin.backup.importSuccess', 'Import successful')); } catch (err) { setBackupError(err.message || 'Error'); } setBackupImporting(null); e.target.value = ''; } }) ] }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-5", children: [ /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-gray-800 text-sm mb-4", children: t('admin.backup.storedBackups', 'Stored Backups') }), backupStoredFiles.length === 0 ? /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-400", children: t('admin.backup.noStoredBackups', 'No stored backups') }) : /*#__PURE__*/ _jsx("div", { className: "space-y-2", children: backupStoredFiles.map((f)=>/*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between py-2 px-3 bg-gray-50 rounded-lg border border-gray-100", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "text-sm font-medium text-gray-800", children: f.name === 'backup_today' ? t('admin.backup.today', 'Today') : t('admin.backup.yesterday', 'Yesterday') }), /*#__PURE__*/ _jsxs("p", { className: "text-xs text-gray-400", children: [ t('admin.backup.size', 'Size'), ": ", (f.size / 1024).toFixed(1), " KB \xb7 ", t('admin.backup.date', 'Date'), ": ", new Date(f.date).toLocaleString() ] }) ] }), /*#__PURE__*/ _jsx("button", { disabled: backupRestoring === f.name, onClick: async ()=>{ if (!window.confirm(t('admin.backup.restoreConfirm', 'Restore from this backup?'))) return; setBackupRestoring(f.name); try { await request('/admin/backup/restore', { method: 'POST', body: JSON.stringify({ name: f.name }) }); setBackupSuccess(t('admin.backup.restoreSuccess', 'Restore successful')); } catch (err) { setBackupError(err.message || 'Error'); } setBackupRestoring(null); }, className: "text-sm text-green-600 hover:text-gray-800 font-medium disabled:opacity-50", children: backupRestoring === f.name ? t('admin.backup.restoring', 'Restoring...') : t('admin.backup.restore', 'Restore') }) ] }, f.name)) }) ] }), /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-5", children: [ /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-gray-800 text-sm mb-4", children: t('admin.backup.tables', 'Tables') }), backupTablesLoading ? /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 text-sm text-gray-400", children: [ /*#__PURE__*/ _jsxs("svg", { className: "w-4 h-4 animate-spin", fill: "none", viewBox: "0 0 24 24", children: [ /*#__PURE__*/ _jsx("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }), /*#__PURE__*/ _jsx("path", { className: "opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8v8z" }) ] }), t('common.loading', 'Loading...') ] }) : backupTables.length === 0 ? /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-400", children: t('admin.noData', 'No data') }) : /*#__PURE__*/ _jsx("div", { className: "overflow-x-auto", children: /*#__PURE__*/ _jsx("table", { className: "w-full text-sm", children: /*#__PURE__*/ _jsx("tbody", { className: "divide-y divide-gray-100", children: backupTables.map((tbl)=>/*#__PURE__*/ _jsxs("tr", { className: "hover:bg-gray-50", children: [ /*#__PURE__*/ _jsx("td", { className: "py-2 pr-4 font-mono text-gray-700", children: tbl }), /*#__PURE__*/ _jsx("td", { className: "py-2 text-right", children: /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-end gap-2", children: [ /*#__PURE__*/ _jsx("button", { onClick: async ()=>{ try { const BASE = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; const res = await fetch("".concat(BASE, "/api/admin/backup/export/").concat(tbl), { credentials: 'include' }); if (!res.ok) throw new Error('Export failed'); const blob = await res.blob(); const url = URL.createObjectURL(blob); const a = document.createElement('a'); a.href = url; a.download = "".concat(tbl, "_").concat(new Date().toISOString().slice(0, 10), ".sql.gz"); a.click(); URL.revokeObjectURL(url); } catch (err) { setBackupError(err.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: t('admin.backup.exportTable', 'Export') }), /*#__PURE__*/ _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: [ backupImporting === tbl ? t('admin.backup.importing', 'Importing...') : t('admin.backup.importTable', 'Import'), /*#__PURE__*/ _jsx("input", { type: "file", accept: ".sql.gz,.gz", className: "hidden", onChange: async (e)=>{ var _e_target_files; const file = (_e_target_files = e.target.files) === null || _e_target_files === void 0 ? void 0 : _e_target_files[0]; if (!file) return; if (!window.confirm(t('admin.backup.restoreConfirm', 'Restore from this backup?'))) return; setBackupImporting(tbl); try { const fd = new FormData(); fd.append('file', file); const BASE = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; const res = await fetch("".concat(BASE, "/api/admin/backup/import/").concat(tbl), { method: 'POST', credentials: 'include', body: fd }); if (!res.ok) { const errData = await res.json().catch(()=>({ error: 'Import failed' })); throw new Error(errData.error || 'Import failed'); } setBackupSuccess(t('admin.backup.importSuccess', 'Import successful')); } catch (err) { setBackupError(err.message || 'Error'); } setBackupImporting(null); e.target.value = ''; } }) ] }) ] }) }) ] }, tbl)) }) }) }) ] }) ] }), tab === 'translations' && /*#__PURE__*/ _jsxs("div", { className: "space-y-6", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("h2", { className: "text-base font-semibold text-gray-900", children: "ПеревПЎы" }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-500 mt-0.5", children: "АвтПЌатОческОй перевПЎ прПпущеММых зМачеМОй пП таблОцаЌ" }) ] }), /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-4 flex flex-wrap gap-4 items-end", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: "ИстПчМОк" }), /*#__PURE__*/ _jsxs("select", { value: transFromLang, onChange: (e)=>setTransFromLang(e.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: [ /*#__PURE__*/ _jsx("option", { value: "el", children: "\uD83C\uDDEC\uD83C\uDDF7 Greek" }), /*#__PURE__*/ _jsx("option", { value: "en", children: "\uD83C\uDDEC\uD83C\uDDE7 English" }), /*#__PURE__*/ _jsx("option", { value: "ru", children: "\uD83C\uDDF7\uD83C\uDDFA Russian" }), /*#__PURE__*/ _jsx("option", { value: "uk", children: "\uD83C\uDDFA\uD83C\uDDE6 Ukrainian" }) ] }) ] }), /*#__PURE__*/ _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: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M13 7l5 5-5 5M6 12h12" }) }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: "ПеревестО Ма" }), /*#__PURE__*/ _jsxs("select", { value: transLang, onChange: (e)=>setTransLang(e.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: [ /*#__PURE__*/ _jsx("option", { value: "el", children: "\uD83C\uDDEC\uD83C\uDDF7 Greek" }), /*#__PURE__*/ _jsx("option", { value: "en", children: "\uD83C\uDDEC\uD83C\uDDE7 English" }), /*#__PURE__*/ _jsx("option", { value: "ru", children: "\uD83C\uDDF7\uD83C\uDDFA Russian" }), /*#__PURE__*/ _jsx("option", { value: "uk", children: "\uD83C\uDDFA\uD83C\uDDE6 Ukrainian" }) ] }) ] }), /*#__PURE__*/ _jsx("div", { className: "ml-auto self-end", children: /*#__PURE__*/ _jsxs("span", { className: "text-sm font-semibold text-gray-700 flex items-center gap-2", children: [ { el: '🇬🇷', en: '🇬🇧', ru: '🇷🇺', uk: '🇺🇊' }[transFromLang], " ", transFromLang.toUpperCase(), /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-gray-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M13 7l5 5-5 5M6 12h12" }) }), { el: '🇬🇷', en: '🇬🇧', ru: '🇷🇺', uk: '🇺🇊' }[transLang], " ", transLang.toUpperCase() ] }) }) ] }), transMsg && /*#__PURE__*/ _jsx("div", { className: "text-sm px-4 py-2 rounded-lg ".concat(transMsg.error ? 'bg-red-50 text-red-700' : 'bg-green-50 text-green-700'), children: transMsg.text }), transStatsLoading ? /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 text-sm text-gray-400 py-6", children: [ /*#__PURE__*/ _jsxs("svg", { className: "w-4 h-4 animate-spin", fill: "none", viewBox: "0 0 24 24", children: [ /*#__PURE__*/ _jsx("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }), /*#__PURE__*/ _jsx("path", { className: "opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8v8z" }) ] }), "Загрузка " ] }) : /*#__PURE__*/ _jsx("div", { className: "grid gap-4 sm:grid-cols-2 lg:grid-cols-3", children: (transStats !== null && transStats !== void 0 ? transStats : []).map((tbl)=>{ const isTasks = tbl.name === 'tasks'; // For tasks: total missing across all langs (tasks may miss multiple langs each) const totalMissingAllLangs = Object.values(tbl.missing).reduce((a, b)=>a + b, 0); var _tbl_missing_transLang; const missingCount = isTasks ? totalMissingAllLangs : (_tbl_missing_transLang = tbl.missing[transLang]) !== null && _tbl_missing_transLang !== void 0 ? _tbl_missing_transLang : 0; const isTranslating = !!transTableTranslating[tbl.name]; const anyTranslating = Object.values(transTableTranslating).some(Boolean); return /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-5 flex flex-col", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-start justify-between", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "font-semibold text-gray-900 text-sm", children: tbl.label }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-0.5", children: tbl.name }) ] }), /*#__PURE__*/ _jsx("span", { className: "text-xs font-semibold px-2 py-0.5 rounded-full ".concat(missingCount > 0 ? 'bg-red-100 text-red-700' : 'bg-green-100 text-green-700'), children: missingCount > 0 ? "".concat(missingCount, " missing") : 'Complete' }) ] }), /*#__PURE__*/ _jsxs("p", { className: "text-xs text-gray-500 mt-3", children: [ "ВсегП: ", tbl.total, isTasks && ' · с языка ПрОгОМала Ма все ПстальМые' ] }), /*#__PURE__*/ _jsx("div", { className: "mt-2 flex flex-wrap gap-1", children: [ 'el', 'en', 'ru', 'uk' ].map((lang)=>{ var _tbl_missing_lang; const cnt = (_tbl_missing_lang = tbl.missing[lang]) !== null && _tbl_missing_lang !== void 0 ? _tbl_missing_lang : 0; const isClickable = isTasks && cnt > 0; return /*#__PURE__*/ _jsxs("button", { type: "button", disabled: !isClickable, onClick: isClickable ? async ()=>{ setTransPreview({ lang, loading: true, rows: [] }); try { const d = await api.getTasksTranslationPreview(lang, 50); setTransPreview({ lang, loading: false, rows: d.rows }); } catch (e) { setTransPreview({ lang, loading: false, rows: [] }); } } : undefined, className: "text-xs px-2 py-0.5 rounded-full border transition ".concat(cnt > 0 ? 'border-red-200 bg-red-50 text-red-600' + (isClickable ? ' cursor-pointer hover:bg-red-100' : '') : 'border-green-200 bg-green-50 text-green-600 cursor-default'), children: [ lang, ": ", cnt > 0 ? "-".concat(cnt) : '✓' ] }, lang); }) }), /*#__PURE__*/ _jsx("div", { className: "mt-4 mt-auto pt-4", children: missingCount === 0 ? /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-1.5 text-xs text-emerald-600", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" }) }), "Все перевПЎы запПлМеМы" ] }) : /*#__PURE__*/ _jsx("button", { disabled: anyTranslating, onClick: async ()=>{ if (!isTasks && transFromLang === transLang) { setTransMsg({ text: 'ИсхПЎМый О целевПй язык сПвпаЎают', error: true }); return; } setTransTableTranslating((prev)=>({ ...prev, [tbl.name]: true })); setTransMsg(null); try { const res = isTasks ? await api.autoTranslateTasks(500) : tbl.name === 'email_templates' ? await api.autoTranslateEmailTemplates(transLang, transFromLang) : await api.autoTranslate(tbl.name, transLang, transFromLang, 500); setTransMsg({ text: "".concat(tbl.label, ": translated ").concat(res.translated, " of ").concat(res.total) + (res.failed > 0 ? " \xb7 errors: ".concat(res.failed) : ''), error: res.failed > 0 && res.translated === 0 }); api.getTranslationsStats().then((d)=>setTransStats(d.tables)).catch(()=>{}); } catch (err) { const msg = (err === null || err === void 0 ? void 0 : err.response) ? await err.response.text().catch(()=>err.message) : err.message || 'Error'; setTransMsg({ text: "Error: ".concat(msg), error: true }); } finally{ setTransTableTranslating((prev)=>{ const n = { ...prev }; delete n[tbl.name]; return n; }); } }, 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: isTranslating ? /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs("svg", { className: "w-3.5 h-3.5 animate-spin flex-shrink-0", fill: "none", viewBox: "0 0 24 24", children: [ /*#__PURE__*/ _jsx("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }), /*#__PURE__*/ _jsx("path", { className: "opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8v8z" }) ] }), "Translating..." ] }) : isTasks ? /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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 ", missingCount ] }) : /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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 ", missingCount, " \xb7 ", { el: '🇬🇷', en: '🇬🇧', ru: '🇷🇺', uk: '🇺🇊' }[transFromLang], " ", transFromLang.toUpperCase(), /*#__PURE__*/ _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: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M13 7l5 5-5 5M6 12h12" }) }), { el: '🇬🇷', en: '🇬🇧', ru: '🇷🇺', uk: '🇺🇊' }[transLang], " ", transLang.toUpperCase() ] }) }) }) ] }, tbl.name); }) }) ] }), tab === 'dbcheck' && /*#__PURE__*/ _jsx(DbCheckTab, {}), tab === 'referrals' && /*#__PURE__*/ _jsxs("div", { className: "space-y-6", children: [ /*#__PURE__*/ _jsx("div", { className: "grid grid-cols-3 gap-4", children: [ { label: 'РеферерПв', value: (_referralsData_totalReferrers = referralsData === null || referralsData === void 0 ? void 0 : referralsData.totalReferrers) !== null && _referralsData_totalReferrers !== void 0 ? _referralsData_totalReferrers : '—', color: 'text-green-600' }, { label: 'ПрОглашеМОй', value: (_referralsData_totalReferrals = referralsData === null || referralsData === void 0 ? void 0 : referralsData.totalReferrals) !== null && _referralsData_totalReferrals !== void 0 ? _referralsData_totalReferrals : '—', color: 'text-purple-600' }, { label: 'АктОвМых МаграЎ', value: (_referralsData_activeRewards = referralsData === null || referralsData === void 0 ? void 0 : referralsData.activeRewards) !== null && _referralsData_activeRewards !== void 0 ? _referralsData_activeRewards : '—', color: 'text-green-600' } ].map((param)=>{ let { label, value, color } = param; return /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-2xl border border-gray-200 p-5 text-center", children: [ /*#__PURE__*/ _jsx("div", { className: "text-3xl font-bold ".concat(color), children: value }), /*#__PURE__*/ _jsx("div", { className: "text-xs text-gray-500 mt-1", children: label }) ] }, label); }) }), /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-2xl border border-gray-200 overflow-hidden", children: [ /*#__PURE__*/ _jsxs("div", { className: "px-5 py-4 border-b border-gray-100 flex items-center justify-between", children: [ /*#__PURE__*/ _jsx("h2", { className: "font-semibold text-gray-800", children: "ДеревП рефералПв" }), /*#__PURE__*/ _jsxs("button", { onClick: ()=>{ setReferralsLoading(true); api.getAdminReferrals().then(setReferralsData).catch(()=>{}).finally(()=>setReferralsLoading(false)); }, className: "text-xs text-green-600 hover:underline flex items-center gap-1", children: [ referralsLoading && /*#__PURE__*/ _jsxs("svg", { className: "w-3 h-3 animate-spin", fill: "none", viewBox: "0 0 24 24", children: [ /*#__PURE__*/ _jsx("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }), /*#__PURE__*/ _jsx("path", { className: "opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8v8z" }) ] }), "ОбМПвОть" ] }) ] }), referralsLoading && !referralsData ? /*#__PURE__*/ _jsx("div", { className: "flex justify-center py-16", children: /*#__PURE__*/ _jsxs("svg", { className: "w-6 h-6 animate-spin text-purple-600", fill: "none", viewBox: "0 0 24 24", children: [ /*#__PURE__*/ _jsx("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }), /*#__PURE__*/ _jsx("path", { className: "opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8v8z" }) ] }) }) : !referralsData || referralsData.tree.length === 0 ? /*#__PURE__*/ _jsx("div", { className: "py-16 text-center text-sm text-gray-400", children: "Нет ЎаММых П рефералах" }) : /*#__PURE__*/ _jsx("div", { className: "divide-y divide-gray-100", children: referralsData.tree.map((node)=>{ var _node_referrer, _node_referrer1; var _node_referrer_id; const rid = (_node_referrer_id = (_node_referrer = node.referrer) === null || _node_referrer === void 0 ? void 0 : _node_referrer.id) !== null && _node_referrer_id !== void 0 ? _node_referrer_id : 'unknown'; const isExpanded = referralsExpanded.has(rid); var _node_referrer_firstName, _node_referrer_lastName; const referrerName = node.referrer ? "".concat((_node_referrer_firstName = node.referrer.firstName) !== null && _node_referrer_firstName !== void 0 ? _node_referrer_firstName : '', " ").concat((_node_referrer_lastName = node.referrer.lastName) !== null && _node_referrer_lastName !== void 0 ? _node_referrer_lastName : '').trim() || node.referrer.email : '(уЎалёМ)'; return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("button", { className: "w-full flex items-center gap-3 px-5 py-3.5 hover:bg-gray-50 text-left transition-colors", onClick: ()=>setReferralsExpanded((prev)=>{ const next = new Set(prev); next.has(rid) ? next.delete(rid) : next.add(rid); return next; }), children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-gray-400 flex-shrink-0 transition-transform ".concat(isExpanded ? 'rotate-90' : ''), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 5l7 7-7 7" }) }), /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ _jsx("span", { className: "font-medium text-sm text-gray-900", children: referrerName }), node.referrer && /*#__PURE__*/ _jsx("span", { className: "ml-2 text-xs text-gray-400", children: node.referrer.email }) ] }), ((_node_referrer1 = node.referrer) === null || _node_referrer1 === void 0 ? void 0 : _node_referrer1.referralCode) && /*#__PURE__*/ _jsx("code", { className: "text-xs bg-gray-100 text-gray-600 px-2 py-0.5 rounded font-mono", children: node.referrer.referralCode }), /*#__PURE__*/ _jsxs("span", { className: "ml-3 text-xs font-semibold text-purple-700 bg-purple-50 px-2 py-0.5 rounded-full", children: [ node.referees.length, " реф." ] }) ] }), isExpanded && /*#__PURE__*/ _jsx("div", { className: "bg-gray-50 border-t border-gray-100", children: /*#__PURE__*/ _jsxs("table", { className: "w-full text-xs", children: [ /*#__PURE__*/ _jsx("thead", { children: /*#__PURE__*/ _jsxs("tr", { className: "border-b border-gray-200", children: [ /*#__PURE__*/ _jsx("th", { className: "text-left px-10 py-2 font-semibold text-gray-500", children: "ПрОглашёММый" }), /*#__PURE__*/ _jsx("th", { className: "text-left px-3 py-2 font-semibold text-gray-500", children: "Email" }), /*#__PURE__*/ _jsx("th", { className: "text-center px-3 py-2 font-semibold text-gray-500", children: "+ЎМей" }), /*#__PURE__*/ _jsx("th", { className: "text-center px-3 py-2 font-semibold text-gray-500", children: "Истекает" }), /*#__PURE__*/ _jsx("th", { className: "text-center px-3 py-2 font-semibold text-gray-500", children: "Дата" }) ] }) }), /*#__PURE__*/ _jsx("tbody", { children: node.referees.map((referee)=>{ var _referee_firstName, _referee_lastName; const refName = "".concat((_referee_firstName = referee.firstName) !== null && _referee_firstName !== void 0 ? _referee_firstName : '', " ").concat((_referee_lastName = referee.lastName) !== null && _referee_lastName !== void 0 ? _referee_lastName : '').trim() || referee.email; const expiresAt = new Date(referee.expiresAt); const createdAt = new Date(referee.createdAt); const isActive = expiresAt > new Date(); return /*#__PURE__*/ _jsxs("tr", { className: "border-b border-gray-100 last:border-0 hover:bg-white transition-colors", children: [ /*#__PURE__*/ _jsx("td", { className: "px-10 py-2.5 font-medium text-gray-800", children: refName }), /*#__PURE__*/ _jsx("td", { className: "px-3 py-2.5 text-gray-500", children: referee.email }), /*#__PURE__*/ _jsx("td", { className: "px-3 py-2.5 text-center", children: /*#__PURE__*/ _jsxs("span", { className: "font-semibold text-green-700", children: [ "+", referee.daysAdded ] }) }), /*#__PURE__*/ _jsx("td", { className: "px-3 py-2.5 text-center", children: /*#__PURE__*/ _jsx("span", { className: "px-1.5 py-0.5 rounded text-xs font-medium ".concat(isActive ? 'bg-green-100 text-green-700' : 'bg-gray-100 text-gray-500'), children: expiresAt.toLocaleDateString('ru-RU', { day: '2-digit', month: '2-digit', year: '2-digit' }) }) }), /*#__PURE__*/ _jsx("td", { className: "px-3 py-2.5 text-center text-gray-400", children: createdAt.toLocaleDateString('ru-RU', { day: '2-digit', month: '2-digit', year: '2-digit' }) }) ] }, referee.id); }) }) ] }) }) ] }, rid); }) }) ] }) ] }), transPreview && /*#__PURE__*/ _jsx("div", { className: "fixed inset-0 z-50 flex items-center justify-center bg-black/50 px-4", onClick: ()=>setTransPreview(null), children: /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-2xl shadow-xl w-full max-w-3xl max-h-[80vh] flex flex-col", onClick: (e)=>e.stopPropagation(), children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between px-6 py-4 border-b border-gray-100 flex-shrink-0", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("h3", { className: "font-semibold text-gray-900", children: [ "ЗаЎачО без перевПЎа: ", /*#__PURE__*/ _jsx("span", { className: "uppercase font-bold text-red-600", children: transPreview.lang }) ] }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-0.5", children: "ППказаМы первые 50 запОсей" }) ] }), /*#__PURE__*/ _jsx("button", { onClick: ()=>setTransPreview(null), className: "text-gray-400 hover:text-gray-600 p-1", children: /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" }) }) }) ] }), /*#__PURE__*/ _jsx("div", { className: "overflow-y-auto flex-1 px-6 py-4", children: transPreview.loading ? /*#__PURE__*/ _jsx("div", { className: "flex justify-center py-12", children: /*#__PURE__*/ _jsxs("svg", { className: "w-6 h-6 animate-spin text-purple-600", fill: "none", viewBox: "0 0 24 24", children: [ /*#__PURE__*/ _jsx("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }), /*#__PURE__*/ _jsx("path", { className: "opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8v8z" }) ] }) }) : transPreview.rows.length === 0 ? /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-500 text-center py-12", children: "Нет заЎач без перевПЎа" }) : /*#__PURE__*/ _jsxs("table", { className: "w-full text-xs border-collapse", children: [ /*#__PURE__*/ _jsx("thead", { children: /*#__PURE__*/ _jsxs("tr", { className: "border-b border-gray-200", children: [ /*#__PURE__*/ _jsx("th", { className: "text-left py-2 pr-3 font-semibold text-gray-600 w-[35%]", children: "ОрОгОМал (title)" }), /*#__PURE__*/ _jsx("th", { className: "text-center py-2 px-2 font-semibold text-gray-600", children: "orig" }), [ 'el', 'en', 'ru', 'uk' ].map((l)=>/*#__PURE__*/ _jsx("th", { className: "text-center py-2 px-2 font-semibold text-gray-600 w-[14%]", children: l }, l)) ] }) }), /*#__PURE__*/ _jsx("tbody", { children: transPreview.rows.map((row)=>/*#__PURE__*/ _jsxs("tr", { className: "border-b border-gray-100 hover:bg-gray-50", children: [ /*#__PURE__*/ _jsx("td", { className: "py-2 pr-3 text-gray-800 truncate max-w-[200px]", title: row.title, children: row.title }), /*#__PURE__*/ _jsx("td", { className: "py-2 px-2 text-center", children: /*#__PURE__*/ _jsx("span", { className: "uppercase font-semibold text-purple-700 bg-purple-50 px-1.5 py-0.5 rounded", children: row.originalLocale }) }), [ [ 'el', row.titleEl ], [ 'en', row.titleEn ], [ 'ru', row.titleRu ], [ 'uk', row.titleUk ] ].map((param)=>{ let [l, val] = param; return /*#__PURE__*/ _jsx("td", { className: "py-2 px-2 text-center", title: val !== null && val !== void 0 ? val : '', children: val ? /*#__PURE__*/ _jsx("span", { className: "text-emerald-600 font-semibold", children: "✓" }) : /*#__PURE__*/ _jsx("span", { className: "text-red-500 font-semibold", children: "✗" }) }, l); }) ] }, row.id)) }) ] }) }) ] }) }), editUser && /*#__PURE__*/ _jsx("div", { className: "fixed inset-0 z-50 flex items-center justify-center bg-black/50 px-4", children: /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-2xl shadow-xl w-full max-w-4xl max-h-[90vh] flex flex-col", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between px-6 py-4 border-b border-gray-100 flex-shrink-0", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("h2", { className: "text-base font-semibold text-gray-900", children: t('admin.user_edit.title') }), /*#__PURE__*/ _jsxs("p", { className: "text-xs text-gray-400 mt-0.5", children: [ editUser.email, " \xb7 ID: ", editUser.id ] }) ] }), /*#__PURE__*/ _jsx("button", { onClick: ()=>setEditUser(null), className: "text-gray-400 hover:text-gray-600 text-2xl leading-none", children: "\xd7" }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex flex-1 min-h-0", children: [ /*#__PURE__*/ _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: t('admin.user_edit.tab.profile') }, { id: 'account', label: t('admin.user_edit.tab.account') }, { id: 'balance', label: t('admin.user_edit.tab.balance') }, { id: 'settings', label: t('admin.user_edit.tab.settings') }, { id: 'site', label: t('admin.user_edit.tab.site') }, { id: 'specialist', label: t('admin.user_edit.tab.specialist') } ].map((item)=>/*#__PURE__*/ _jsx("button", { onClick: ()=>{ setEditUserTab(item.id); if (item.id === 'specialist' && editUser) { setEditUserCardsLoading(true); const loadCards = api.getAdminUserSpecialistCards(editUser.id).then(setEditUserCards).catch(()=>{}); const loadCats = catRows.length === 0 ? api.getAdminCategories().then(setCatRows).catch(()=>{}) : Promise.resolve(); const loadLocs = locRows.length === 0 ? api.getAdminLocations().then(setLocRows).catch(()=>{}) : Promise.resolve(); Promise.all([ loadCards, loadCats, loadLocs ]).finally(()=>setEditUserCardsLoading(false)); } }, className: "w-full text-left px-3 py-2.5 text-sm rounded-lg transition-colors ".concat(editUserTab === item.id ? 'bg-green-50 text-green-700 font-medium' : 'text-gray-600 hover:bg-gray-50'), children: item.label }, item.id)) }), /*#__PURE__*/ _jsxs("div", { className: "flex-1 overflow-y-auto p-6", children: [ editUserTab === 'profile' && /*#__PURE__*/ _jsxs("div", { className: "space-y-4", children: [ /*#__PURE__*/ _jsxs("div", { className: "p-3 bg-gray-50 rounded-lg text-xs text-gray-500 space-y-0.5", children: [ /*#__PURE__*/ _jsxs("p", { children: [ /*#__PURE__*/ _jsxs("span", { className: "font-medium", children: [ t('admin.user_edit.registered'), ":" ] }), " ", new Date(editUser.createdAt).toLocaleDateString(dateLocale) ] }), editUser.lastSeenAt && /*#__PURE__*/ _jsxs("p", { children: [ /*#__PURE__*/ _jsxs("span", { className: "font-medium", children: [ t('admin.user_edit.last_seen'), ":" ] }), " ", new Date(editUser.lastSeenAt).toLocaleDateString(dateLocale) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "grid grid-cols-2 gap-3", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.user_edit.first_name') }), /*#__PURE__*/ _jsx("input", { value: (_editUser_firstName = editUser.firstName) !== null && _editUser_firstName !== void 0 ? _editUser_firstName : '', onChange: (e)=>setEditUser((u)=>({ ...u, firstName: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.user_edit.last_name') }), /*#__PURE__*/ _jsx("input", { value: (_editUser_lastName = editUser.lastName) !== null && _editUser_lastName !== void 0 ? _editUser_lastName : '', onChange: (e)=>setEditUser((u)=>({ ...u, lastName: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.user_edit.phone') }), /*#__PURE__*/ _jsx("input", { value: (_editUser_phone = editUser.phone) !== null && _editUser_phone !== void 0 ? _editUser_phone : '', onChange: (e)=>setEditUser((u)=>({ ...u, phone: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.user_edit.bio') }), /*#__PURE__*/ _jsx("textarea", { value: (_editUser_bio = editUser.bio) !== null && _editUser_bio !== void 0 ? _editUser_bio : '', onChange: (e)=>setEditUser((u)=>({ ...u, bio: e.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" }) ] }) ] }), editUserTab === 'account' && /*#__PURE__*/ _jsxs("div", { className: "space-y-4", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.user_edit.email') }), /*#__PURE__*/ _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: editUser.email }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between rounded-lg border px-3 py-2 bg-gray-50", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2", children: [ editUser.emailVerified ? /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-green-500 shrink-0", viewBox: "0 0 20 20", fill: "currentColor", children: /*#__PURE__*/ _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" }) }) : /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-red-400 shrink-0", viewBox: "0 0 20 20", fill: "currentColor", children: /*#__PURE__*/ _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" }) }), /*#__PURE__*/ _jsx("span", { className: "text-sm font-medium ".concat(editUser.emailVerified ? 'text-green-700' : 'text-red-600'), children: editUser.emailVerified ? t('admin.user_edit.email_verified') : t('admin.user_edit.email_not_verified') }) ] }), !editUser.emailVerified && /*#__PURE__*/ _jsx("button", { onClick: verifyEmail, disabled: verifyingEmail, className: "text-xs px-3 py-1 rounded-md bg-green-600 text-white hover:bg-green-700 disabled:opacity-50 transition-colors", children: verifyingEmail ? '...' : t('admin.user_edit.verify_email_btn') }) ] }), /*#__PURE__*/ _jsxs("div", { className: "grid grid-cols-2 gap-3", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.user_edit.role') }), /*#__PURE__*/ _jsxs("select", { value: editUser.role, onChange: (e)=>setEditUser((u)=>({ ...u, role: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm", children: [ /*#__PURE__*/ _jsx("option", { value: "user", children: t('admin.user_edit.role.user') }), /*#__PURE__*/ _jsx("option", { value: "admin", children: t('admin.user_edit.role.admin') }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.user_edit.plan') }), /*#__PURE__*/ _jsxs("select", { value: (_editUser_planId = editUser.planId) !== null && _editUser_planId !== void 0 ? _editUser_planId : '', onChange: (e)=>setEditUser((u)=>({ ...u, planId: e.target.value || null })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm", children: [ /*#__PURE__*/ _jsx("option", { value: "", children: t('admin.user_edit.no_plan') }), planRows.map((p)=>/*#__PURE__*/ _jsx("option", { value: p.id, children: p.name }, p.id)) ] }) ] }) ] }), editUser.planExpiresAt && /*#__PURE__*/ _jsxs("p", { className: "text-xs text-gray-500", children: [ t('admin.user_edit.plan_expires'), ": ", new Date(editUser.planExpiresAt).toLocaleDateString(dateLocale) ] }), /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-2 cursor-pointer", children: [ /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: editUser.isActive !== false, onChange: (e)=>setEditUser((u)=>({ ...u, isActive: e.target.checked })), className: "w-4 h-4 rounded border-gray-300 text-green-600" }), /*#__PURE__*/ _jsx("span", { className: "text-sm text-gray-700", children: t('admin.user_edit.active') }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.user_edit.interface_lang') }), /*#__PURE__*/ _jsxs("select", { value: (_editUser_locale = editUser.locale) !== null && _editUser_locale !== void 0 ? _editUser_locale : 'el', onChange: (e)=>setEditUser((u)=>({ ...u, locale: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm", children: [ /*#__PURE__*/ _jsx("option", { value: "el", children: "ΕλληΜικά" }), /*#__PURE__*/ _jsx("option", { value: "en", children: "English" }), /*#__PURE__*/ _jsx("option", { value: "ru", children: "РусскОй" }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: t('admin.user_edit.comm_languages') }), /*#__PURE__*/ _jsx("div", { className: "flex gap-5", children: [ 'el', 'en', 'uk', 'ru' ].map((lang)=>{ var _editUser_languages; return /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-1.5 cursor-pointer", children: [ /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: ((_editUser_languages = editUser.languages) !== null && _editUser_languages !== void 0 ? _editUser_languages : []).includes(lang), onChange: (e)=>{ var _editUser_languages; const langs = (_editUser_languages = editUser.languages) !== null && _editUser_languages !== void 0 ? _editUser_languages : []; setEditUser((u)=>({ ...u, languages: e.target.checked ? [ ...langs.filter((l)=>l !== lang), lang ] : langs.filter((l)=>l !== lang) })); }, className: "w-4 h-4 rounded border-gray-300 text-green-600" }), /*#__PURE__*/ _jsx("span", { className: "text-sm text-gray-700", children: lang === 'el' ? 'ΕλληΜικά' : lang === 'en' ? 'English' : lang === 'uk' ? 'УкраїМська' : 'РусскОй' }) ] }, lang); }) }) ] }) ] }), editUserTab === 'balance' && /*#__PURE__*/ _jsxs("div", { className: "space-y-6", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between p-5 bg-gray-50 rounded-xl border border-gray-200", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("div", { className: "text-xs text-gray-500 mb-1", children: t('admin.user_edit.balance') }), /*#__PURE__*/ _jsxs("div", { className: "text-2xl font-bold text-gray-900", children: [ Number((_editUser_balance = editUser.balance) !== null && _editUser_balance !== void 0 ? _editUser_balance : 0).toFixed(2), " EUR" ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-2", children: [ /*#__PURE__*/ _jsxs("button", { onClick: ()=>setBalanceModal('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: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M12 4v16m8-8H4" }) }), t('admin.balance.topup.btn') ] }), /*#__PURE__*/ _jsxs("button", { onClick: ()=>setBalanceModal('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: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M20 12H4" }) }), t('admin.balance.withdraw.btn') ] }) ] }) ] }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-center text-gray-400", children: t('admin.balance.modal_hint') }) ] }), editUserTab === 'settings' && /*#__PURE__*/ _jsx("div", { className: "space-y-4", children: /*#__PURE__*/ _jsxs("div", { className: "space-y-3 pt-1 divide-y divide-gray-100", children: [ /*#__PURE__*/ _jsxs("label", { className: "flex items-center justify-between cursor-pointer py-2", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("div", { className: "text-sm font-medium text-gray-700", children: t('admin.user_edit.show_contact_info') }), /*#__PURE__*/ _jsx("div", { className: "text-xs text-gray-400", children: t('admin.user_edit.show_contact_info.hint') }) ] }), /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: (_editUser_showContactInfo = editUser.showContactInfo) !== null && _editUser_showContactInfo !== void 0 ? _editUser_showContactInfo : false, onChange: (e)=>setEditUser((u)=>({ ...u, showContactInfo: e.target.checked })), className: "w-4 h-4 rounded border-gray-300 text-green-600" }) ] }), /*#__PURE__*/ _jsxs("label", { className: "flex items-center justify-between cursor-pointer py-2", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("div", { className: "text-sm font-medium text-gray-700", children: t('admin.user_edit.notify_new_tasks') }), /*#__PURE__*/ _jsx("div", { className: "text-xs text-gray-400", children: t('admin.user_edit.notify_new_tasks.hint') }) ] }), /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: (_editUser_notifyNewTasks = editUser.notifyNewTasks) !== null && _editUser_notifyNewTasks !== void 0 ? _editUser_notifyNewTasks : false, onChange: (e)=>setEditUser((u)=>({ ...u, notifyNewTasks: e.target.checked })), className: "w-4 h-4 rounded border-gray-300 text-green-600" }) ] }), /*#__PURE__*/ _jsxs("label", { className: "flex items-center justify-between cursor-pointer py-2", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("div", { className: "text-sm font-medium text-gray-700", children: t('admin.user_edit.notif_messages') }), /*#__PURE__*/ _jsx("div", { className: "text-xs text-gray-400", children: t('admin.user_edit.notif_messages.hint') }) ] }), /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: (_editUser_notifMessages = editUser.notifMessages) !== null && _editUser_notifMessages !== void 0 ? _editUser_notifMessages : true, onChange: (e)=>setEditUser((u)=>({ ...u, notifMessages: e.target.checked })), className: "w-4 h-4 rounded border-gray-300 text-green-600" }) ] }) ] }) }), editUserTab === 'site' && /*#__PURE__*/ _jsxs("div", { className: "space-y-4", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.user_edit.personal_site_slug') }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2", children: [ /*#__PURE__*/ _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: [ /*#__PURE__*/ _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/" }), /*#__PURE__*/ _jsx("input", { value: (_editUser_personalSiteSlug = editUser.personalSiteSlug) !== null && _editUser_personalSiteSlug !== void 0 ? _editUser_personalSiteSlug : '', onChange: (e)=>setEditUser((u)=>({ ...u, personalSiteSlug: e.target.value || null })), placeholder: "my-username", className: "flex-1 px-3 py-2 text-sm focus:outline-none" }) ] }), editUser.personalSiteSlug && /*#__PURE__*/ _jsx("a", { href: "/site/".concat(editUser.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: /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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" }) }) }) ] }) ] }), editUser.personalSiteSlug && /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx("h4", { className: "text-sm font-semibold text-gray-800 pt-3 border-t border-gray-100", children: t('profile.site.visible_title') }), /*#__PURE__*/ _jsx("div", { className: "space-y-1", children: [ { key: 'showBio', label: t('profile.site.visible.bio') }, { key: 'showRating', label: t('profile.site.visible.rating') }, { key: 'showServices', label: t('profile.site.visible.services') }, { key: 'showPortfolio', label: t('profile.site.visible.portfolio') }, { key: 'showReviews', label: t('profile.site.visible.reviews') }, { key: 'showPhone', label: t('profile.site.visible.contacts') }, { key: 'showFullLastName', label: t('profile.site.visible.full_last_name') }, { key: 'showStatus', label: t('profile.site.visible.status') } ].map((item)=>{ var _editUser_siteSettings; return /*#__PURE__*/ _jsxs("label", { className: "flex items-center justify-between cursor-pointer py-1.5", children: [ /*#__PURE__*/ _jsx("span", { className: "text-sm text-gray-700", children: item.label }), /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: ((_editUser_siteSettings = editUser.siteSettings) !== null && _editUser_siteSettings !== void 0 ? _editUser_siteSettings : {})[item.key] !== false, onChange: (e)=>setEditUser((u)=>{ var _u_siteSettings; return { ...u, siteSettings: { ...(_u_siteSettings = u.siteSettings) !== null && _u_siteSettings !== void 0 ? _u_siteSettings : {}, [item.key]: e.target.checked } }; }), className: "w-4 h-4 rounded border-gray-300 text-green-600" }) ] }, item.key); }) }), /*#__PURE__*/ _jsxs("div", { className: "pt-2", children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1.5", children: t('profile.site.theme') }), /*#__PURE__*/ _jsxs("select", { value: (_siteTheme = ((_editUser_siteSettings = editUser.siteSettings) !== null && _editUser_siteSettings !== void 0 ? _editUser_siteSettings : {}).siteTheme) !== null && _siteTheme !== void 0 ? _siteTheme : 'dark', onChange: (e)=>setEditUser((u)=>{ var _u_siteSettings; return { ...u, siteSettings: { ...(_u_siteSettings = u.siteSettings) !== null && _u_siteSettings !== void 0 ? _u_siteSettings : {}, siteTheme: e.target.value } }; }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm", children: [ /*#__PURE__*/ _jsx("option", { value: "dark", children: t('profile.site.theme.dark') }), /*#__PURE__*/ _jsx("option", { value: "light", children: t('profile.site.theme.light') }) ] }) ] }) ] }) ] }), editUserTab === 'specialist' && /*#__PURE__*/ _jsxs("div", { className: "space-y-6", children: [ (()=>{ if ((editUser === null || editUser === void 0 ? void 0 : editUser.role) === 'specialist') return null; var _editUser_bio; const bio = String((_editUser_bio = editUser === null || editUser === void 0 ? void 0 : editUser.bio) !== null && _editUser_bio !== void 0 ? _editUser_bio : '').trim(); const publishedCards = (editUserCards !== null && editUserCards !== void 0 ? editUserCards : []).filter((c)=>{ var _c_publicationStatus; return ((_c_publicationStatus = c.publicationStatus) !== null && _c_publicationStatus !== void 0 ? _c_publicationStatus : c.isActive ? 'active' : 'inactive') === 'active'; }); const hasPublishedCard = publishedCards.length > 0; const hasCategories = publishedCards.some((c)=>{ var _c_categories; var _c_categories_length; return ((_c_categories_length = (_c_categories = c.categories) === null || _c_categories === void 0 ? void 0 : _c_categories.length) !== null && _c_categories_length !== void 0 ? _c_categories_length : 0) > 0; }); const hasLocations = publishedCards.some((c)=>{ var _c_locations; var _c_locations_length; return ((_c_locations_length = (_c_locations = c.locations) === null || _c_locations === void 0 ? void 0 : _c_locations.length) !== null && _c_locations_length !== void 0 ? _c_locations_length : 0) > 0; }); const missing = []; if (!bio) missing.push(t('admin.user_edit.visibility_requirements.bio', 'Fill in bio')); if (!hasPublishedCard) missing.push(t('admin.user_edit.visibility_requirements.published_card', 'Publish at least one card')); if (!hasCategories) missing.push(t('admin.user_edit.visibility_requirements.categories', 'Add a category in a published card')); if (!hasLocations) missing.push(t('admin.user_edit.visibility_requirements.locations', 'Add a location in a published card')); if (missing.length === 0) return null; return /*#__PURE__*/ _jsxs("div", { className: "rounded-xl border border-amber-300 bg-amber-50 p-3", children: [ /*#__PURE__*/ _jsx("p", { className: "text-sm font-semibold text-amber-900", children: t('admin.user_edit.visibility_requirements.title', 'Profile is not yet visible in Offers') }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-amber-800 mt-1", children: t('admin.user_edit.visibility_requirements.hint', 'Visibility requirements to complete:') }), /*#__PURE__*/ _jsx("ul", { className: "mt-2 text-xs text-amber-900 list-disc pl-5 space-y-0.5", children: missing.map((m)=>/*#__PURE__*/ _jsx("li", { children: m }, m)) }) ] }); })(), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: t('admin.user_edit.skills') }), /*#__PURE__*/ _jsx("div", { className: "flex flex-wrap gap-1.5 mb-2 min-h-[28px]", children: ((_editUser_skills = editUser.skills) !== null && _editUser_skills !== void 0 ? _editUser_skills : []).map((s)=>/*#__PURE__*/ _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, /*#__PURE__*/ _jsx("button", { onClick: ()=>setEditUser((u)=>{ var _u_skills; return { ...u, skills: ((_u_skills = u.skills) !== null && _u_skills !== void 0 ? _u_skills : []).filter((x)=>x !== s) }; }), className: "text-gray-400 hover:text-green-700 leading-none", children: "\xd7" }) ] }, s)) }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-2", children: [ /*#__PURE__*/ _jsx("input", { value: skillInput, onChange: (e)=>setSkillInput(e.target.value), onKeyDown: (e)=>{ if ((e.key === 'Enter' || e.key === ',') && skillInput.trim()) { e.preventDefault(); const val = skillInput.trim().replace(/,$/, ''); var _editUser_skills; if (val && !((_editUser_skills = editUser.skills) !== null && _editUser_skills !== void 0 ? _editUser_skills : []).includes(val)) { setEditUser((u)=>{ var _u_skills; return { ...u, skills: [ ...(_u_skills = u.skills) !== null && _u_skills !== void 0 ? _u_skills : [], val ] }; }); } setSkillInput(''); } }, placeholder: t('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" }), /*#__PURE__*/ _jsx("button", { onClick: ()=>{ const val = skillInput.trim(); var _editUser_skills; if (val && !((_editUser_skills = editUser.skills) !== null && _editUser_skills !== void 0 ? _editUser_skills : []).includes(val)) { setEditUser((u)=>{ var _u_skills; return { ...u, skills: [ ...(_u_skills = u.skills) !== null && _u_skills !== void 0 ? _u_skills : [], val ] }; }); } setSkillInput(''); }, className: "px-3 py-2 bg-green-600 text-white rounded-lg text-sm hover:bg-green-700", children: t('common.add') }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "border-t border-gray-100 pt-4", children: [ /*#__PURE__*/ _jsx("div", { className: "text-sm font-medium text-gray-700 mb-3", children: t('admin.user_edit.specialist_cards') }), editUserCardsLoading ? /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 py-2", children: t('common.loading') }) : editUserCards.length === 0 ? /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 py-4 text-center", children: t('admin.user_edit.no_cards') }) : /*#__PURE__*/ _jsx("div", { className: "space-y-4", children: editUserCards.map((card)=>{ var _card_title, _card_description, _card_skills, _cardSkillInputs_card_id, _card_categories, _card_categories1, _card_locations, _card_locations1; return /*#__PURE__*/ _jsxs("div", { className: "border border-gray-200 bg-gray-50 rounded-xl p-4 space-y-3", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3", children: [ /*#__PURE__*/ _jsx("input", { value: (_card_title = card.title) !== null && _card_title !== void 0 ? _card_title : '', onChange: (e)=>setEditUserCards((prev)=>prev.map((c)=>c.id === card.id ? { ...c, title: e.target.value } : c)), placeholder: t('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" }), /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-1.5 cursor-pointer flex-shrink-0", children: [ /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: card.isActive !== false, onChange: (e)=>setEditUserCards((prev)=>prev.map((c)=>c.id === card.id ? { ...c, isActive: e.target.checked } : c)), className: "w-4 h-4 rounded border-gray-300 text-green-600" }), /*#__PURE__*/ _jsx("span", { className: "text-xs text-gray-600", children: t('admin.user_edit.published') }) ] }) ] }), /*#__PURE__*/ _jsx("textarea", { value: (_card_description = card.description) !== null && _card_description !== void 0 ? _card_description : '', onChange: (e)=>setEditUserCards((prev)=>prev.map((c)=>c.id === card.id ? { ...c, description: e.target.value } : c)), rows: 3, placeholder: t('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" }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("div", { className: "text-xs font-medium text-gray-500 mb-1.5", children: t('admin.user_edit.skills') }), /*#__PURE__*/ _jsx("div", { className: "flex flex-wrap gap-1.5 mb-1.5 min-h-[24px]", children: ((_card_skills = card.skills) !== null && _card_skills !== void 0 ? _card_skills : []).map((s)=>/*#__PURE__*/ _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, /*#__PURE__*/ _jsx("button", { onClick: ()=>setEditUserCards((prev)=>prev.map((c)=>{ var _c_skills; return c.id === card.id ? { ...c, skills: ((_c_skills = c.skills) !== null && _c_skills !== void 0 ? _c_skills : []).filter((x)=>x !== s) } : c; })), className: "text-gray-400 hover:text-green-700 leading-none", children: "\xd7" }) ] }, s)) }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-2", children: [ /*#__PURE__*/ _jsx("input", { value: (_cardSkillInputs_card_id = cardSkillInputs[card.id]) !== null && _cardSkillInputs_card_id !== void 0 ? _cardSkillInputs_card_id : '', onChange: (e)=>setCardSkillInputs((prev)=>({ ...prev, [card.id]: e.target.value })), onKeyDown: (e)=>{ var _cardSkillInputs_card_id; if ((e.key === 'Enter' || e.key === ',') && ((_cardSkillInputs_card_id = cardSkillInputs[card.id]) !== null && _cardSkillInputs_card_id !== void 0 ? _cardSkillInputs_card_id : '').trim()) { e.preventDefault(); var _cardSkillInputs_card_id1; const val = ((_cardSkillInputs_card_id1 = cardSkillInputs[card.id]) !== null && _cardSkillInputs_card_id1 !== void 0 ? _cardSkillInputs_card_id1 : '').trim().replace(/,$/, ''); var _card_skills; if (val && !((_card_skills = card.skills) !== null && _card_skills !== void 0 ? _card_skills : []).includes(val)) { setEditUserCards((prev)=>prev.map((c)=>{ var _c_skills; return c.id === card.id ? { ...c, skills: [ ...(_c_skills = c.skills) !== null && _c_skills !== void 0 ? _c_skills : [], val ] } : c; })); } setCardSkillInputs((prev)=>({ ...prev, [card.id]: '' })); } }, placeholder: t('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" }), /*#__PURE__*/ _jsx("button", { onClick: ()=>{ var _cardSkillInputs_card_id; const val = ((_cardSkillInputs_card_id = cardSkillInputs[card.id]) !== null && _cardSkillInputs_card_id !== void 0 ? _cardSkillInputs_card_id : '').trim(); var _card_skills; if (val && !((_card_skills = card.skills) !== null && _card_skills !== void 0 ? _card_skills : []).includes(val)) { setEditUserCards((prev)=>prev.map((c)=>{ var _c_skills; return c.id === card.id ? { ...c, skills: [ ...(_c_skills = c.skills) !== null && _c_skills !== void 0 ? _c_skills : [], val ] } : c; })); } setCardSkillInputs((prev)=>({ ...prev, [card.id]: '' })); }, className: "px-2.5 py-1.5 bg-green-600 text-white rounded-lg text-xs hover:bg-green-700", children: "+" }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("div", { className: "text-xs font-medium text-gray-500 mb-1.5", children: t('admin.user_edit.categories') }), /*#__PURE__*/ _jsx("div", { className: "flex flex-wrap gap-1.5 mb-1.5 min-h-[24px]", children: ((_card_categories = card.categories) !== null && _card_categories !== void 0 ? _card_categories : []).map((slug)=>{ var _catRows_find; return /*#__PURE__*/ _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: [ getCatLabel((_catRows_find = catRows.find((c)=>c.slug === slug)) !== null && _catRows_find !== void 0 ? _catRows_find : { slug }, locale), /*#__PURE__*/ _jsx("button", { onClick: ()=>setEditUserCards((prev)=>prev.map((c)=>{ var _c_categories; return c.id === card.id ? { ...c, categories: ((_c_categories = c.categories) !== null && _c_categories !== void 0 ? _c_categories : []).filter((x)=>x !== slug) } : c; })), className: "text-purple-400 hover:text-purple-700 leading-none", children: "\xd7" }) ] }, slug); }) }), /*#__PURE__*/ _jsx(AdminCatPicker, { catRows: catRows, locale: locale, selected: (_card_categories1 = card.categories) !== null && _card_categories1 !== void 0 ? _card_categories1 : [], onAdd: (id)=>setEditUserCards((prev)=>prev.map((c)=>{ var _c_categories; return c.id === card.id ? { ...c, categories: [ ...(_c_categories = c.categories) !== null && _c_categories !== void 0 ? _c_categories : [], id ] } : c; })), addLabel: t('admin.user_edit.add_category') }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("div", { className: "text-xs font-medium text-gray-500 mb-1.5", children: t('admin.user_edit.locations') }), /*#__PURE__*/ _jsx("div", { className: "flex flex-wrap gap-1.5 mb-1.5 min-h-[24px]", children: ((_card_locations = card.locations) !== null && _card_locations !== void 0 ? _card_locations : []).map((slug)=>{ var _locRows_find; return /*#__PURE__*/ _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: [ getLocLabel((_locRows_find = locRows.find((l)=>l.slug === slug)) !== null && _locRows_find !== void 0 ? _locRows_find : { slug }, locale), /*#__PURE__*/ _jsx("button", { onClick: ()=>setEditUserCards((prev)=>prev.map((c)=>{ var _c_locations; return c.id === card.id ? { ...c, locations: ((_c_locations = c.locations) !== null && _c_locations !== void 0 ? _c_locations : []).filter((x)=>x !== slug) } : c; })), className: "text-green-400 hover:text-green-700 leading-none", children: "\xd7" }) ] }, slug); }) }), /*#__PURE__*/ _jsx(AdminLocPicker, { locRows: locRows, locale: locale, selected: (_card_locations1 = card.locations) !== null && _card_locations1 !== void 0 ? _card_locations1 : [], onAdd: (id)=>setEditUserCards((prev)=>prev.map((c)=>{ var _c_locations; return c.id === card.id ? { ...c, locations: [ ...(_c_locations = c.locations) !== null && _c_locations !== void 0 ? _c_locations : [], id ] } : c; })), addLabel: t('admin.user_edit.add_location') }) ] }), /*#__PURE__*/ _jsx("div", { className: "flex justify-end pt-1", children: /*#__PURE__*/ _jsx("button", { onClick: ()=>saveCard(card.id), disabled: cardSaving[card.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: cardSaving[card.id] ? '...' : t('common.save') }) }) ] }, card.id); }) }) ] }) ] }) ] }) ] }), editUserTab !== 'balance' ? /*#__PURE__*/ _jsxs("div", { className: "border-t border-gray-100 px-6 py-4 flex gap-3 flex-shrink-0", children: [ /*#__PURE__*/ _jsx("button", { onClick: saveEditUser, disabled: editUserSaving, className: "flex-1 bg-green-600 hover:bg-green-700 text-white py-2 rounded-lg text-sm font-semibold disabled:opacity-50", children: editUserSaving ? '...' : t('common.save') }), /*#__PURE__*/ _jsx("button", { onClick: ()=>setEditUser(null), className: "flex-1 bg-gray-100 hover:bg-gray-200 text-gray-700 py-2 rounded-lg text-sm font-medium", children: t('common.cancel') }) ] }) : /*#__PURE__*/ _jsx("div", { className: "border-t border-gray-100 px-6 py-4 flex-shrink-0", children: /*#__PURE__*/ _jsx("button", { onClick: ()=>setEditUser(null), className: "w-full bg-gray-100 hover:bg-gray-200 text-gray-700 py-2 rounded-lg text-sm font-medium", children: t('common.close') }) }) ] }) }), editUser && balanceModal && /*#__PURE__*/ _jsx("div", { className: "fixed inset-0 z-[60] flex items-center justify-center bg-black/40 px-4", children: /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-2xl shadow-2xl p-6 w-full max-w-sm border-t-4 ".concat(balanceModal === 'topup' ? 'border-emerald-500' : 'border-rose-500'), children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between mb-4", children: [ /*#__PURE__*/ _jsx("h3", { className: "text-base font-semibold ".concat(balanceModal === 'topup' ? 'text-emerald-900' : 'text-rose-900'), children: balanceModal === 'topup' ? t('admin.balance.topup.title') : t('admin.balance.withdraw.title') }), /*#__PURE__*/ _jsx("button", { onClick: ()=>setBalanceModal(null), className: "text-gray-400 hover:text-gray-600 text-2xl leading-none", children: "\xd7" }) ] }), /*#__PURE__*/ _jsxs("p", { className: "text-xs text-gray-500 mb-4", children: [ t('admin.user_edit.balance'), ": ", /*#__PURE__*/ _jsxs("span", { className: "font-semibold text-gray-700", children: [ Number((_editUser_balance1 = editUser.balance) !== null && _editUser_balance1 !== void 0 ? _editUser_balance1 : 0).toFixed(2), " EUR" ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "space-y-3", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium mb-1 ".concat(balanceModal === 'topup' ? 'text-emerald-800' : 'text-rose-800'), children: balanceModal === 'topup' ? t('admin.balance.topup.amount') : t('admin.balance.withdraw.amount') }), /*#__PURE__*/ _jsx("input", { type: "number", min: "0.01", step: "0.01", value: balanceModal === 'topup' ? (_editUser_topUpAmount = editUser.topUpAmount) !== null && _editUser_topUpAmount !== void 0 ? _editUser_topUpAmount : '' : (_editUser_withdrawAmount = editUser.withdrawAmount) !== null && _editUser_withdrawAmount !== void 0 ? _editUser_withdrawAmount : '', onChange: (e)=>setEditUser((u)=>balanceModal === 'topup' ? { ...u, topUpAmount: e.target.value } : { ...u, withdrawAmount: e.target.value }), className: "w-full border rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 ".concat(balanceModal === 'topup' ? 'border-emerald-300 focus:ring-emerald-400' : 'border-rose-300 focus:ring-rose-400') }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium mb-1 ".concat(balanceModal === 'topup' ? 'text-emerald-800' : 'text-rose-800'), children: balanceModal === 'topup' ? t('admin.balance.topup.description') : t('admin.balance.withdraw.description') }), /*#__PURE__*/ _jsx("input", { value: balanceModal === 'topup' ? (_editUser_topUpDescription = editUser.topUpDescription) !== null && _editUser_topUpDescription !== void 0 ? _editUser_topUpDescription : '' : (_editUser_withdrawDescription = editUser.withdrawDescription) !== null && _editUser_withdrawDescription !== void 0 ? _editUser_withdrawDescription : '', onChange: (e)=>setEditUser((u)=>balanceModal === 'topup' ? { ...u, topUpDescription: e.target.value } : { ...u, withdrawDescription: e.target.value }), placeholder: balanceModal === 'topup' ? t('admin.balance.topup.description.placeholder') : t('admin.balance.withdraw.description.placeholder'), className: "w-full border rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 ".concat(balanceModal === 'topup' ? 'border-emerald-300 focus:ring-emerald-400' : 'border-rose-300 focus:ring-rose-400') }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-2 mt-5", children: [ /*#__PURE__*/ _jsx("button", { onClick: async ()=>{ if (balanceModal === 'topup') { await handleAdminTopUp(); } else { await handleAdminWithdraw(); } setBalanceModal(null); }, disabled: balanceModal === 'topup' ? topUpSaving || !Number(editUser.topUpAmount) : withdrawSaving || !Number(editUser.withdrawAmount), className: "flex-1 text-white py-2 rounded-lg text-sm font-semibold disabled:opacity-50 ".concat(balanceModal === 'topup' ? 'bg-emerald-600 hover:bg-emerald-700' : 'bg-rose-600 hover:bg-rose-700'), children: (balanceModal === 'topup' ? topUpSaving : withdrawSaving) ? t('common.loading') : balanceModal === 'topup' ? t('admin.balance.topup.submit') : t('admin.balance.withdraw.submit') }), /*#__PURE__*/ _jsx("button", { onClick: ()=>setBalanceModal(null), className: "flex-1 bg-gray-100 hover:bg-gray-200 text-gray-700 py-2 rounded-lg text-sm font-medium", children: t('common.cancel') }) ] }) ] }) }) ] }) ] }) ] }) }); } // ─── DbCheckTab ───────────────────────────────────────────────────────────── function DbCheckTab() { // ── Skill duplicates ────────────────────────────────────────────────────── const [dedupLoading, setDedupLoading] = useState(false); const [dedupGroups, setDedupGroups] = useState(null); const [keepIds, setKeepIds] = useState({}); const [merging, setMerging] = useState(null); function gk(group) { var _group__nameEl, _group_, _group_1; var _group__nameEl_toLowerCase_trim; return (_group__nameEl_toLowerCase_trim = (_group_ = group[0]) === null || _group_ === void 0 ? void 0 : (_group__nameEl = _group_.nameEl) === null || _group__nameEl === void 0 ? void 0 : _group__nameEl.toLowerCase().trim()) !== null && _group__nameEl_toLowerCase_trim !== void 0 ? _group__nameEl_toLowerCase_trim : (_group_1 = group[0]) === null || _group_1 === void 0 ? void 0 : _group_1.id; } async function findDuplicates() { setDedupLoading(true); setDedupGroups(null); setKeepIds({}); try { const groups = await api.getSkillDedup() // all categories ; setDedupGroups(groups); const auto = {}; groups.forEach((group)=>{ const best = [ ...group ].sort((a, b)=>{ var _b_usageCount, _a_usageCount; return ((_b_usageCount = b.usageCount) !== null && _b_usageCount !== void 0 ? _b_usageCount : 0) - ((_a_usageCount = a.usageCount) !== null && _a_usageCount !== void 0 ? _a_usageCount : 0); })[0]; auto[gk(group)] = best.id; }); setKeepIds(auto); } catch (e) { setDedupGroups([]); } finally{ setDedupLoading(false); } } async function mergeGroup(key, group) { const keepId = keepIds[key]; if (!keepId) return; const deleteIds = group.filter((s)=>s.id !== keepId).map((s)=>s.id); if (!deleteIds.length) return; setMerging(key); try { await api.mergeSkillDuplicates(keepId, deleteIds); setDedupGroups((prev)=>prev ? prev.filter((g)=>gk(g) !== key) : prev); } catch (e) {} finally{ setMerging(null); } } async function mergeAll() { if (!(dedupGroups === null || dedupGroups === void 0 ? void 0 : dedupGroups.length)) return; setMerging('__all__'); for (const group of [ ...dedupGroups ]){ const key = gk(group); const keepId = keepIds[key]; if (!keepId) continue; const deleteIds = group.filter((s)=>s.id !== keepId).map((s)=>s.id); if (!deleteIds.length) continue; try { await api.mergeSkillDuplicates(keepId, deleteIds); setDedupGroups((prev)=>prev ? prev.filter((g)=>gk(g) !== key) : prev); } catch (e) {} } setMerging(null); } var _dedupGroups_reduce; const totalDuplicates = (_dedupGroups_reduce = dedupGroups === null || dedupGroups === void 0 ? void 0 : dedupGroups.reduce((acc, g)=>acc + g.length - 1, 0)) !== null && _dedupGroups_reduce !== void 0 ? _dedupGroups_reduce : 0; return /*#__PURE__*/ _jsxs("div", { className: "space-y-6", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("h2", { className: "text-base font-semibold text-gray-900", children: "ПрПверка базы ЎаММых" }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-500 mt-0.5", children: "ДОагМПстОка О ОсправлеМОе прПблеЌ в базе ЎаММых" }) ] }), /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 overflow-hidden", children: [ /*#__PURE__*/ _jsxs("div", { className: "px-5 py-4 border-b border-gray-100 flex items-center justify-between", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("h3", { className: "text-sm font-semibold text-gray-800", children: "ДублОкаты МавыкПв" }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-0.5", children: "ППОск МавыкПв с ПЎОМакПвыЌ ОЌеМеЌ в ПЎМПй категПрОО. ПрО ПбъеЎОМеМОО — ссылкО в картПчках спецОалОстПв ПбМПвляются автПЌатОческО." }) ] }), /*#__PURE__*/ _jsxs("button", { onClick: findDuplicates, disabled: dedupLoading, 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: [ /*#__PURE__*/ _jsxs("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ _jsx("circle", { cx: "11", cy: "11", r: "8" }), /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M21 21l-4.35-4.35" }) ] }), dedupLoading ? 'Ищу ' : 'НайтО ЎублОкаты' ] }) ] }), dedupGroups !== null && /*#__PURE__*/ _jsx("div", { className: "p-5", children: dedupGroups.length === 0 ? /*#__PURE__*/ _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: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" }) }), "ДублОкатПв Ме МайЎеМП — база в пПряЎке" ] }) : /*#__PURE__*/ _jsxs("div", { className: "space-y-3", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between", children: [ /*#__PURE__*/ _jsxs("p", { className: "text-sm text-green-700 font-semibold", children: [ "НайЎеМП ", dedupGroups.length, " групп \xb7 ", totalDuplicates, " лОшМОх запОсей" ] }), /*#__PURE__*/ _jsx("button", { onClick: mergeAll, disabled: merging === '__all__', 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: merging === '__all__' ? 'ОбъеЎОМяю ' : "ОбъеЎОМОть все (".concat(dedupGroups.length, ")") }) ] }), dedupGroups.map((group)=>{ var _group_, _group_1; const key = gk(group); return /*#__PURE__*/ _jsxs("div", { className: "bg-white border border-orange-200 rounded-xl overflow-hidden shadow-sm", children: [ /*#__PURE__*/ _jsxs("div", { className: "px-4 py-2.5 bg-orange-50 border-b border-orange-100 flex items-center justify-between gap-3", children: [ /*#__PURE__*/ _jsxs("div", { className: "min-w-0", children: [ /*#__PURE__*/ _jsxs("span", { className: "text-sm font-semibold text-orange-800", children: [ "\xab", (_group_ = group[0]) === null || _group_ === void 0 ? void 0 : _group_.nameEl, "\xbb" ] }), /*#__PURE__*/ _jsx("span", { className: "ml-2 text-xs text-green-600 font-mono", children: (_group_1 = group[0]) === null || _group_1 === void 0 ? void 0 : _group_1.categorySlug }), /*#__PURE__*/ _jsxs("span", { className: "ml-2 text-xs text-orange-400", children: [ group.length, " варОаМта" ] }) ] }), /*#__PURE__*/ _jsx("button", { onClick: ()=>mergeGroup(key, group), disabled: !!merging, 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: merging === key ? 'ОбъеЎОМяю ' : 'ОбъеЎОМОть' }) ] }), /*#__PURE__*/ _jsx("div", { className: "divide-y divide-gray-50", children: group.map((skill)=>/*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-3 px-4 py-2.5 cursor-pointer hover:bg-gray-50 transition", children: [ /*#__PURE__*/ _jsx("input", { type: "radio", name: "dedup-global-".concat(key), checked: keepIds[key] === skill.id, onChange: ()=>setKeepIds((prev)=>({ ...prev, [key]: skill.id })), className: "accent-amber-600 shrink-0" }), /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 flex-wrap", children: [ /*#__PURE__*/ _jsx("span", { className: "text-sm font-medium text-gray-800", children: skill.nameEl }), skill.nameEn && skill.nameEn !== skill.nameEl && /*#__PURE__*/ _jsxs("span", { className: "text-xs text-gray-400", children: [ "EN: ", skill.nameEn ] }), skill.nameRu && skill.nameRu !== skill.nameEl && /*#__PURE__*/ _jsxs("span", { className: "text-xs text-gray-400", children: [ "RU: ", skill.nameRu ] }), skill.nameUk && /*#__PURE__*/ _jsxs("span", { className: "text-xs text-gray-400", children: [ "UK: ", skill.nameUk ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 mt-0.5", children: [ /*#__PURE__*/ _jsx("span", { className: "text-[11px] font-semibold ".concat(skill.usageCount > 0 ? 'text-green-600' : 'text-gray-400'), children: skill.usageCount > 0 ? "".concat(skill.usageCount, " ОспПльзПваМОй") : 'Ме ОспПльзПвался' }), /*#__PURE__*/ _jsxs("span", { className: "text-[11px] text-gray-300", children: [ "order: ", skill.order ] }), keepIds[key] === skill.id && /*#__PURE__*/ _jsx("span", { className: "text-[11px] font-bold text-amber-600 uppercase", children: "← ПставОть" }) ] }) ] }) ] }, skill.id)) }) ] }, key); }) ] }) }) ] }) ] }); } function LocTree(param) { let { rows, parentId, depth, locale, expanded, onToggle, onEdit, onDelete, onAddChild, t } = param; const children = rows.filter((r)=>{ var _r_parentId; return ((_r_parentId = r.parentId) !== null && _r_parentId !== void 0 ? _r_parentId : null) === parentId; }); if (children.length === 0) return null; return /*#__PURE__*/ _jsx(_Fragment, { children: children.sort((a, b)=>{ var _a_order, _b_order; return ((_a_order = a.order) !== null && _a_order !== void 0 ? _a_order : 0) - ((_b_order = b.order) !== null && _b_order !== void 0 ? _b_order : 0); }).map((loc)=>{ const hasChildren = rows.some((r)=>r.parentId === loc.id); const isOpen = expanded.has(loc.id); const name = (locale === 'en' ? loc.nameEn : locale === 'ru' ? loc.nameRu : locale === 'uk' ? loc.nameUk : loc.nameEl) || loc.nameEl || loc.slug; return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 px-4 py-3 hover:bg-gray-50 ".concat(!loc.isActive ? 'opacity-50' : ''), style: { paddingLeft: "".concat(16 + depth * 24, "px") }, children: [ /*#__PURE__*/ _jsx("button", { onClick: ()=>hasChildren && onToggle(loc.id), className: "w-5 h-5 flex items-center justify-center text-gray-400 rounded ".concat(hasChildren ? 'hover:bg-gray-200 cursor-pointer' : 'cursor-default'), children: hasChildren ? isOpen ? /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("polyline", { points: "6 9 12 15 18 9" }) }) : /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("polyline", { points: "9 18 15 12 9 6" }) }) : /*#__PURE__*/ _jsx("span", { className: "w-3.5 h-3.5 block" }) }), depth === 0 ? /*#__PURE__*/ _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: /*#__PURE__*/ _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" }) }) : /*#__PURE__*/ _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: [ /*#__PURE__*/ _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" }), /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 11a3 3 0 11-6 0 3 3 0 016 0z" }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ _jsx("span", { className: "font-medium text-gray-800 text-sm", children: name }), /*#__PURE__*/ _jsx("span", { className: "ml-2 text-xs text-gray-400", children: loc.nameEn }), /*#__PURE__*/ _jsxs("span", { className: "ml-1.5 font-mono text-xs text-gray-300", children: [ "/", loc.slug ] }) ] }), /*#__PURE__*/ _jsx("span", { className: "px-2 py-0.5 rounded-full text-xs font-medium ".concat(loc.isActive ? 'bg-green-100 text-green-700' : 'bg-gray-100 text-gray-500'), children: loc.isActive ? t('admin.cat.active') : t('admin.cat.inactive') }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-1 flex-shrink-0", children: [ depth === 0 && /*#__PURE__*/ _jsx("button", { onClick: ()=>onAddChild(loc.id), className: "text-xs px-2 py-1 rounded-lg bg-green-50 text-green-600 hover:bg-green-100 font-medium", title: t('admin.loc.add_district'), children: "+" }), /*#__PURE__*/ _jsx("button", { onClick: ()=>onEdit(loc), className: "text-xs px-2 py-1 rounded-lg bg-gray-100 text-gray-600 hover:bg-gray-200 font-medium", children: t('common.edit') }), /*#__PURE__*/ _jsx("button", { onClick: ()=>onDelete(loc.id, name), className: "text-xs px-2 py-1 rounded-lg bg-red-50 text-red-600 hover:bg-red-100 font-medium", children: t('common.delete') }) ] }) ] }), hasChildren && isOpen && /*#__PURE__*/ _jsx(LocTree, { rows: rows, parentId: loc.id, depth: depth + 1, locale: locale, expanded: expanded, onToggle: onToggle, onEdit: onEdit, onDelete: onDelete, onAddChild: onAddChild, t: t }) ] }, loc.id); }) }); } function CatTree(param) { let { rows, parentId, depth, locale, expanded, onToggle, onEdit, onDelete, onAddChild, skillsExpanded, skillsCache, skillsLoading, onToggleSkills, skillForm, skillSaving, onOpenAddSkill, onOpenEditSkill, onSaveSkill, onDeleteSkill, onCancelSkillForm, onSkillFormChange, t } = param; const children = rows.filter((r)=>{ var _r_parentId; return ((_r_parentId = r.parentId) !== null && _r_parentId !== void 0 ? _r_parentId : null) === parentId; }); if (children.length === 0) return null; return /*#__PURE__*/ _jsx(_Fragment, { children: children.sort((a, b)=>{ var _a_order, _b_order; return ((_a_order = a.order) !== null && _a_order !== void 0 ? _a_order : 0) - ((_b_order = b.order) !== null && _b_order !== void 0 ? _b_order : 0); }).map((cat)=>{ var _cat_names; const hasChildren = rows.some((r)=>r.parentId === cat.id); const isOpen = expanded.has(cat.id); const skillsOpen = skillsExpanded.has(cat.id); const isLoadingSkills = skillsLoading.has(cat.id); var _skillsCache_cat_slug; const skills = (_skillsCache_cat_slug = skillsCache[cat.slug]) !== null && _skillsCache_cat_slug !== void 0 ? _skillsCache_cat_slug : []; const name = (locale === 'en' ? cat.namesEn : locale === 'ru' ? cat.namesRu : locale === 'uk' ? cat.namesUk : cat.namesEl) || cat.namesEl || cat.slug; return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 px-4 py-3 hover:bg-gray-50 ".concat(!cat.isActive ? 'opacity-50' : ''), style: { paddingLeft: "".concat(16 + depth * 24, "px") }, children: [ /*#__PURE__*/ _jsx("button", { onClick: ()=>hasChildren && onToggle(cat.id), className: "w-5 h-5 flex items-center justify-center text-gray-400 rounded ".concat(hasChildren ? 'hover:bg-gray-200 cursor-pointer' : 'cursor-default'), children: hasChildren ? isOpen ? /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("polyline", { points: "6 9 12 15 18 9" }) }) : /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("polyline", { points: "9 18 15 12 9 6" }) }) : /*#__PURE__*/ _jsx("span", { className: "w-3.5 h-3.5 block" }) }), /*#__PURE__*/ _jsx("span", { className: "w-10 h-10 flex items-center justify-center rounded-xl bg-green-50", children: /*#__PURE__*/ _jsx(CategoryIcon, { icon: cat.icon, alt: name, className: "h-7 w-7 object-contain text-2xl leading-none", fallback: "\uD83D\uDCE6" }) }), /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ _jsx("span", { className: "font-medium text-gray-800 text-sm", children: name }), /*#__PURE__*/ _jsx("span", { className: "ml-2 text-xs text-gray-400", children: cat.namesEn || ((_cat_names = cat.names) === null || _cat_names === void 0 ? void 0 : _cat_names.en) }), /*#__PURE__*/ _jsxs("span", { className: "ml-1.5 font-mono text-xs text-gray-300", children: [ "/", cat.slug ] }) ] }), /*#__PURE__*/ _jsx("span", { className: "px-2 py-0.5 rounded-full text-xs font-medium ".concat(cat.isActive ? 'bg-green-100 text-green-700' : 'bg-gray-100 text-gray-500'), children: cat.isActive ? t('admin.cat.active') : t('admin.cat.inactive') }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-1 flex-shrink-0", children: [ /*#__PURE__*/ _jsxs("button", { onClick: ()=>onToggleSkills(cat), className: "text-xs px-2 py-1 rounded-lg font-medium flex items-center gap-1 ".concat(skillsOpen ? 'bg-amber-100 text-amber-700' : 'bg-amber-50 text-amber-600 hover:bg-amber-100'), title: "НавыкО", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-3 h-3", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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" }) }), skillsCache[cat.slug] ? skillsCache[cat.slug].length : t('admin.cat.skills', 'Skills') ] }), /*#__PURE__*/ _jsx("button", { onClick: ()=>onAddChild(cat.id), className: "text-xs px-2 py-1 rounded-lg bg-green-50 text-green-600 hover:bg-green-100 font-medium", title: t('admin.cat.add_child'), children: "+" }), /*#__PURE__*/ _jsx("button", { onClick: ()=>onEdit(cat), className: "text-xs px-2 py-1 rounded-lg bg-gray-100 text-gray-600 hover:bg-gray-200 font-medium", children: t('common.edit') }), /*#__PURE__*/ _jsx("button", { onClick: ()=>onDelete(cat.id, name), className: "text-xs px-2 py-1 rounded-lg bg-red-50 text-red-600 hover:bg-red-100 font-medium", children: t('common.delete') }) ] }) ] }), skillsOpen && /*#__PURE__*/ _jsx(SkillsPanel, { cat: cat, locale: locale, depth: depth, t: t, skills: skills, isLoading: isLoadingSkills, skillForm: skillForm, skillSaving: skillSaving, onOpenAddSkill: onOpenAddSkill, onOpenEditSkill: onOpenEditSkill, onSaveSkill: onSaveSkill, onDeleteSkill: onDeleteSkill, onCancelSkillForm: onCancelSkillForm, onSkillFormChange: onSkillFormChange }), hasChildren && isOpen && /*#__PURE__*/ _jsx(CatTree, { rows: rows, parentId: cat.id, depth: depth + 1, locale: locale, expanded: expanded, onToggle: onToggle, onEdit: onEdit, onDelete: onDelete, onAddChild: onAddChild, skillsExpanded: skillsExpanded, skillsCache: skillsCache, skillsLoading: skillsLoading, onToggleSkills: onToggleSkills, skillForm: skillForm, skillSaving: skillSaving, onOpenAddSkill: onOpenAddSkill, onOpenEditSkill: onOpenEditSkill, onSaveSkill: onSaveSkill, onDeleteSkill: onDeleteSkill, onCancelSkillForm: onCancelSkillForm, onSkillFormChange: onSkillFormChange, t: t }) ] }, cat.id); }) }); } // ─── SkillsPanel ──────────────────────────────────────────────────────────── // Self-contained component for the skill list + edit form + dedup panel per category const SKILL_LANG_LABELS = { nameEl: '🇬🇷 EL', nameEn: '🇬🇧 EN', nameRu: '🇷🇺 RU', nameUk: '🇺🇊 UK' }; function SkillForm(param) { let { form, saving, onSave, onCancel, onChange } = param; var _form_nameEl; var _form_order; return /*#__PURE__*/ _jsxs("div", { className: "bg-white border border-amber-200 rounded-xl p-4 shadow-sm", children: [ /*#__PURE__*/ _jsx("div", { className: "grid grid-cols-2 gap-3 mb-3", children: [ 'nameEl', 'nameEn', 'nameRu', 'nameUk' ].map((field, i)=>{ var _form_field; return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-[11px] font-semibold text-gray-500 mb-1 uppercase tracking-wide", children: SKILL_LANG_LABELS[field] }), /*#__PURE__*/ _jsx("input", { value: (_form_field = form[field]) !== null && _form_field !== void 0 ? _form_field : '', onChange: (e)=>onChange({ ...form, [field]: e.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: i === 0, placeholder: field === 'nameUk' ? 'МеПбПвʌязкПвП' : '' }) ] }, field); }) }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 pt-1 border-t border-gray-100", children: [ /*#__PURE__*/ _jsx("label", { className: "text-xs text-gray-400 font-medium", children: "ППряЎПк" }), /*#__PURE__*/ _jsx("input", { type: "number", value: (_form_order = form.order) !== null && _form_order !== void 0 ? _form_order : 0, onChange: (e)=>onChange({ ...form, order: Number(e.target.value) }), className: "w-16 border border-gray-200 rounded-lg px-2 py-1 text-xs text-center" }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-2 ml-auto", children: [ /*#__PURE__*/ _jsx("button", { onClick: onCancel, className: "px-3 py-1.5 bg-gray-100 text-gray-600 rounded-lg text-xs font-medium hover:bg-gray-200 transition", children: "ОтЌеМа" }), /*#__PURE__*/ _jsx("button", { onClick: onSave, disabled: saving || !((_form_nameEl = form.nameEl) === null || _form_nameEl === void 0 ? void 0 : _form_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: saving ? 'СПхраМяю ' : 'СПхраМОть' }) ] }) ] }) ] }); } function SkillsPanel(param) { let { cat, locale, depth, t, skills, isLoading, skillForm, skillSaving, onOpenAddSkill, onOpenEditSkill, onSaveSkill, onDeleteSkill, onCancelSkillForm, onSkillFormChange } = param; const showAddForm = (skillForm === null || skillForm === void 0 ? void 0 : skillForm.catSlug) === cat.slug && !(skillForm === null || skillForm === void 0 ? void 0 : skillForm.id); return /*#__PURE__*/ _jsxs("div", { className: "border-t border-amber-100 bg-gradient-to-b from-amber-50/60 to-white", style: { paddingLeft: "".concat(16 + depth * 24 + 36, "px"), paddingRight: '16px', paddingTop: '14px', paddingBottom: '14px' }, children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 mb-3", children: [ /*#__PURE__*/ _jsx("span", { className: "text-xs font-bold text-amber-700 uppercase tracking-wider", children: "НавыкО" }), /*#__PURE__*/ _jsxs("span", { className: "text-xs text-amber-500 font-mono", children: [ "/", cat.slug ] }), /*#__PURE__*/ _jsxs("span", { className: "ml-1 text-xs text-amber-400", children: [ "(", skills.length, ")" ] }), /*#__PURE__*/ _jsx("div", { className: "ml-auto", children: /*#__PURE__*/ _jsxs("button", { onClick: ()=>{ onCancelSkillForm(); onOpenAddSkill(cat.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: [ /*#__PURE__*/ _jsxs("svg", { className: "w-3 h-3", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: [ /*#__PURE__*/ _jsx("line", { x1: "12", y1: "5", x2: "12", y2: "19" }), /*#__PURE__*/ _jsx("line", { x1: "5", y1: "12", x2: "19", y2: "12" }) ] }), "ДПбавОть" ] }) }) ] }), isLoading ? /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 py-3 text-xs text-gray-400", children: [ /*#__PURE__*/ _jsxs("svg", { className: "w-3.5 h-3.5 animate-spin", fill: "none", viewBox: "0 0 24 24", children: [ /*#__PURE__*/ _jsx("circle", { cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4", className: "opacity-25" }), /*#__PURE__*/ _jsx("path", { fill: "currentColor", d: "M4 12a8 8 0 018-8v8z", className: "opacity-75" }) ] }), "Загрузка " ] }) : /*#__PURE__*/ _jsxs("div", { className: "space-y-1", children: [ skills.length === 0 && !showAddForm && /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 italic py-2", children: "НавыкО Ме ЎПбавлеМы" }), skills.map((skill)=>{ const isEditingThis = (skillForm === null || skillForm === void 0 ? void 0 : skillForm.id) === skill.id; const skillName = locale === 'en' ? skill.nameEn : locale === 'ru' ? skill.nameRu : locale === 'uk' ? skill.nameUk || skill.nameEn : skill.nameEl; return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 rounded-lg px-3 py-2 group transition ".concat(isEditingThis ? 'bg-amber-50 border border-amber-200' : 'bg-white border border-gray-100 hover:border-amber-200 hover:bg-amber-50/30'), children: [ /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ _jsx("span", { className: "text-sm font-medium text-gray-800", children: skillName }), locale !== 'en' && skill.nameEn && /*#__PURE__*/ _jsx("span", { className: "ml-2 text-xs text-gray-400", children: skill.nameEn }), locale !== 'ru' && skill.nameRu && skill.nameRu !== skill.nameEl && /*#__PURE__*/ _jsx("span", { className: "ml-1.5 text-xs text-gray-300", children: skill.nameRu }) ] }), skill.order > 0 && /*#__PURE__*/ _jsxs("span", { className: "text-[10px] text-gray-300 font-mono", children: [ "#", skill.order ] }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-1 transition-opacity ".concat(isEditingThis ? 'opacity-100' : 'opacity-0 group-hover:opacity-100'), children: [ /*#__PURE__*/ _jsx("button", { onClick: ()=>isEditingThis ? onCancelSkillForm() : (onCancelSkillForm(), onOpenEditSkill(skill, cat.slug)), className: "text-xs px-2 py-0.5 rounded-md font-medium transition ".concat(isEditingThis ? 'bg-amber-100 text-amber-700' : 'bg-gray-100 text-gray-600 hover:bg-amber-100 hover:text-amber-700'), children: isEditingThis ? '✕' : t('common.edit') }), /*#__PURE__*/ _jsx("button", { onClick: ()=>onDeleteSkill(skill, cat.slug), className: "text-xs px-2 py-0.5 rounded-md bg-red-50 text-red-600 hover:bg-red-100 transition", children: t('common.delete') }) ] }) ] }), isEditingThis && /*#__PURE__*/ _jsx("div", { className: "mt-1 mb-1 ml-0", children: /*#__PURE__*/ _jsx(SkillForm, { form: skillForm, saving: skillSaving, onSave: onSaveSkill, onCancel: onCancelSkillForm, onChange: onSkillFormChange }) }) ] }, skill.id); }), showAddForm && /*#__PURE__*/ _jsx("div", { className: "mt-2", children: /*#__PURE__*/ _jsx(SkillForm, { form: skillForm, saving: skillSaving, onSave: onSaveSkill, onCancel: onCancelSkillForm, onChange: onSkillFormChange }) }) ] }) ] }); } function Pagination(param) { let { page, total, limit, onChange, totalLabel } = param; const pages = Math.ceil(total / limit); if (pages <= 1) return null; return /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between px-4 py-3 border-t border-gray-100 text-sm text-gray-500", children: [ /*#__PURE__*/ _jsxs("span", { children: [ totalLabel, ": ", total ] }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-1", children: [ /*#__PURE__*/ _jsx("button", { onClick: ()=>onChange(page - 1), disabled: page === 1, className: "px-3 py-1 rounded-lg border border-gray-200 disabled:opacity-40 hover:bg-gray-50", children: "←" }), /*#__PURE__*/ _jsxs("span", { className: "px-3 py-1", children: [ page, " / ", pages ] }), /*#__PURE__*/ _jsx("button", { onClick: ()=>onChange(page + 1), disabled: page >= pages, className: "px-3 py-1 rounded-lg border border-gray-200 disabled:opacity-40 hover:bg-gray-50", children: "→" }) ] }) ] }); } // ── Activity log helpers ────────────────────────────────────────────────── function parseLogDetails(details) { try { return details ? JSON.parse(details) : null; } catch (e) { return null; } } const EVENT_META = { 'user.login': { icon: /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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: /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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: /*#__PURE__*/ _jsxs("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ _jsx("circle", { cx: "12", cy: "12", r: "10" }), /*#__PURE__*/ _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: /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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: /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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: /*#__PURE__*/ _jsxs("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ _jsx("circle", { cx: "12", cy: "12", r: "10" }), /*#__PURE__*/ _jsx("line", { x1: "15", y1: "9", x2: "9", y2: "15" }), /*#__PURE__*/ _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: /*#__PURE__*/ _jsxs("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ _jsx("polyline", { points: "3 6 5 6 21 6" }), /*#__PURE__*/ _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: /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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: /*#__PURE__*/ _jsxs("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ _jsx("line", { x1: "18", y1: "6", x2: "6", y2: "18" }), /*#__PURE__*/ _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: /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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 ActivityLogRow(param) { let { entry, dateLocale, onFilterUser, t } = param; var _EVENT_META_entry_event; const meta = (_EVENT_META_entry_event = EVENT_META[entry.event]) !== null && _EVENT_META_entry_event !== void 0 ? _EVENT_META_entry_event : { icon: /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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: entry.event, color: 'bg-gray-50 text-gray-700 border-gray-200' }; const details = parseLogDetails(entry.details); return /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 px-4 py-3 flex items-start gap-3", children: [ /*#__PURE__*/ _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 ".concat(meta.color), children: [ meta.icon, " ", t(meta.labelKey, meta.labelKey) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 flex-wrap", children: [ entry.userName && /*#__PURE__*/ _jsx("button", { onClick: ()=>entry.userId && onFilterUser(entry.userId), className: "text-sm font-medium text-gray-800 hover:text-green-600", children: entry.userName }), entry.userEmail && /*#__PURE__*/ _jsx("span", { className: "text-xs text-gray-400", children: entry.userEmail }) ] }), details && Object.keys(details).length > 0 && /*#__PURE__*/ _jsx("div", { className: "mt-1 flex flex-wrap gap-2", children: Object.entries(details).map((param)=>{ let [k, v] = param; return /*#__PURE__*/ _jsxs("span", { className: "text-xs bg-gray-100 text-gray-600 px-2 py-0.5 rounded", children: [ k, ": ", /*#__PURE__*/ _jsx("span", { className: "font-medium", children: String(v) }) ] }, k); }) }), entry.ipAddress && /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-0.5", children: entry.ipAddress }) ] }), /*#__PURE__*/ _jsx("time", { className: "shrink-0 text-xs text-gray-400 whitespace-nowrap", children: new Date(entry.createdAt).toLocaleString(dateLocale) }) ] }); } const MONTH_NAMES = [ 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec' ]; function AdminMonthChart(param) { let { series, dateLocale = 'en-US' } = param; // Collect all unique months from all series, sorted const monthSet = new Set(); series.forEach((s)=>s.data.forEach((r)=>monthSet.add(r.month))); const months = Array.from(monthSet).sort(); if (months.length === 0) return null; // Build lookup maps const seriesVals = series.map((s)=>{ const map = {}; s.data.forEach((r)=>{ map[r.month] = Number(r.count); }); return months.map((m)=>{ var _map_m; return (_map_m = map[m]) !== null && _map_m !== void 0 ? _map_m : 0; }); }); const allVals = seriesVals.flat(); const maxVal = Math.max(...allVals, 1); const W = 700; const H = 160; const padL = maxVal >= 1000000 ? 50 : maxVal >= 10000 ? 44 : maxVal >= 1000 ? 40 : 36; const padB = 24; const chartH = H - padB; const totalBars = months.length * series.length; const groupW = (W - padL - 8) / months.length; const barW = Math.max(4, Math.min(20, groupW / series.length - 2)); const yTicks = [ 0, Math.round(maxVal / 3), Math.round(maxVal * 2 / 3), maxVal ]; function barX(mi, si) { const groupStart = padL + mi * groupW + (groupW - series.length * (barW + 1)) / 2; return groupStart + si * (barW + 1); } function barHeight(v) { return v / maxVal * chartH; } return /*#__PURE__*/ _jsx("div", { className: "overflow-x-auto", children: /*#__PURE__*/ _jsxs("svg", { viewBox: "0 0 ".concat(W, " ").concat(H + 14), className: "w-full", style: { minWidth: Math.max(360, months.length * 40) }, children: [ yTicks.map((v, i)=>{ const y = chartH - v / maxVal * chartH; return /*#__PURE__*/ _jsxs("g", { children: [ /*#__PURE__*/ _jsx("line", { x1: padL, y1: y, x2: W - 4, y2: y, stroke: "#f3f4f6", strokeWidth: 1 }), /*#__PURE__*/ _jsx("text", { x: padL - 5, y: y + 3.5, textAnchor: "end", fontSize: 9, fill: "#9ca3af", children: fmtYLabel(v) }) ] }, i); }), months.map((m, mi)=>series.map((s, si)=>{ const v = seriesVals[si][mi]; const bh = barHeight(v); const x = barX(mi, si); return /*#__PURE__*/ _jsx("rect", { x: x, y: chartH - bh, width: barW, height: bh, fill: s.color, opacity: 0.8, rx: 2 }, "bar-".concat(mi, "-").concat(si)); })), months.map((m, mi)=>{ const [yr, mo] = m.slice(0, 7).split('-').map(Number); const d = new Date(Date.UTC(yr, mo - 1, 2)); const label = new Intl.DateTimeFormat(dateLocale, { month: 'short' }).format(d) + (mi === 0 || mo === 1 ? " ".concat(yr) : ''); const cx = padL + mi * groupW + groupW / 2; return /*#__PURE__*/ _jsx("text", { x: cx, y: H + 12, textAnchor: "middle", fontSize: 9, fill: "#9ca3af", children: label }, "xl-".concat(mi)); }), /*#__PURE__*/ _jsx("line", { x1: padL, y1: chartH, x2: W - 4, y2: chartH, stroke: "#e5e7eb", strokeWidth: 1 }) ] }) }); } function getLast30Days() { const days = []; for(let i = 29; i >= 0; i--){ const d = new Date(Date.now() - i * 86400000); days.push(d.toISOString().slice(0, 10)); } return days; } function smoothPath(pts) { if (pts.length < 2) return ''; let d = "M ".concat(pts[0][0].toFixed(1), " ").concat(pts[0][1].toFixed(1)); for(let i = 1; i < pts.length; i++){ const cpx = ((pts[i - 1][0] + pts[i][0]) / 2).toFixed(1); d += " C ".concat(cpx, " ").concat(pts[i - 1][1].toFixed(1), " ").concat(cpx, " ").concat(pts[i][1].toFixed(1), " ").concat(pts[i][0].toFixed(1), " ").concat(pts[i][1].toFixed(1)); } return d; } function fmtYLabel(v) { if (v >= 1000000) return "".concat(+(v / 1000000).toFixed(1), "M"); if (v >= 1000) return "".concat(Math.round(v / 1000), "K"); return String(v); } function AdminAreaChart(param) { let { series, days: daysProp } = param; const days = daysProp !== null && daysProp !== void 0 ? daysProp : getLast30Days(); const seriesVals = series.map((s)=>{ const map = {}; s.data.forEach((r)=>{ map[r.day] = Number(r.count); }); return days.map((d)=>{ var _map_d; return (_map_d = map[d]) !== null && _map_d !== void 0 ? _map_d : 0; }); }); const allVals = seriesVals.flat(); const maxVal = Math.max(...allVals, 1); const W = 700; const H = 160; const padL = maxVal >= 10000 ? 44 : maxVal >= 1000 ? 40 : 36; const padB = 22; const chartW = W - padL - 4; const chartH = H - padB; const stepX = chartW / (days.length - 1); function pts(vals) { return vals.map((v, i)=>[ padL + i * stepX, chartH - v / maxVal * chartH ]); } function areaPath(vals) { const points = pts(vals); const line = smoothPath(points); if (!line) return ''; const lastX = points[points.length - 1][0].toFixed(1); return "".concat(line, " L ").concat(lastX, " ").concat(chartH.toFixed(1), " L ").concat(padL.toFixed(1), " ").concat(chartH.toFixed(1), " Z"); } // Y-axis: 4 labels (0, 1/3, 2/3, max) const yTicks = [ 0, Math.round(maxVal / 3), Math.round(maxVal * 2 / 3), maxVal ]; // X-axis: every 7 days + last const xTicks = days.map((d, i)=>({ i, label: d.slice(8) })).filter((_, i)=>i % 7 === 0 || i === days.length - 1); return /*#__PURE__*/ _jsx("div", { className: "overflow-x-auto", children: /*#__PURE__*/ _jsxs("svg", { viewBox: "0 0 ".concat(W, " ").concat(H + 12), className: "w-full", style: { minWidth: 360 }, children: [ yTicks.map((v, i)=>{ const y = chartH - v / maxVal * chartH; return /*#__PURE__*/ _jsxs("g", { children: [ /*#__PURE__*/ _jsx("line", { x1: padL, y1: y, x2: W - 4, y2: y, stroke: "#f3f4f6", strokeWidth: 1 }), /*#__PURE__*/ _jsx("text", { x: padL - 5, y: y + 3.5, textAnchor: "end", fontSize: 9, fill: "#9ca3af", children: fmtYLabel(v) }) ] }, i); }), xTicks.map((param)=>{ let { i } = param; const x = padL + i * stepX; return /*#__PURE__*/ _jsx("line", { x1: x, y1: 0, x2: x, y2: chartH, stroke: "#f9fafb", strokeWidth: 1 }, "vg-".concat(i)); }), xTicks.map((param)=>{ let { i, label } = param; return /*#__PURE__*/ _jsx("text", { x: padL + i * stepX, y: H + 10, textAnchor: "middle", fontSize: 9, fill: "#9ca3af", children: label }, i); }), series.map((s, si)=>/*#__PURE__*/ _jsx("path", { d: areaPath(seriesVals[si]), fill: s.fill }, "fill-".concat(si))), series.map((s, si)=>/*#__PURE__*/ _jsx("path", { d: smoothPath(pts(seriesVals[si])), fill: "none", stroke: s.color, strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round" }, "line-".concat(si))), series.map((s, si)=>{ const points = pts(seriesVals[si]); const last = points[points.length - 1]; return /*#__PURE__*/ _jsx("g", { children: /*#__PURE__*/ _jsx("circle", { cx: last[0], cy: last[1], r: 4, fill: "white", stroke: s.color, strokeWidth: 2 }) }, "dot-".concat(si)); }), /*#__PURE__*/ _jsx("line", { x1: padL, y1: chartH, x2: W - 4, y2: chartH, stroke: "#e5e7eb", strokeWidth: 1 }) ] }) }); } 61146undefined148199undefined201244undefined246274undefined276315undefined317361undefined363395undefined397432undefined434484undefined486532undefined534590undefined83738377(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined84668470(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined86508653(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined88168819(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined88218832_components_CategoryIcon__WEBPACK_IMPORTED_MODULE_7__/* .CategoryIcon */ .Ezundefined91539156(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined95239527(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined96549658(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1009110094(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1090610909(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1112311126(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1132011323(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1146411467(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1171111715(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1225912262(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1226412275_components_CategoryIcon__WEBPACK_IMPORTED_MODULE_7__/* .CategoryIcon */ .Ezundefined1260512608(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1306713074(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined1311613123(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined1317813185(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined1321013215(0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)undefined1322813236(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined1392713931(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1403714041(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1447314476(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1478014783(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1505015053(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1523015233(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1559015593(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1587615880(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1612616129(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1628316286(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1742417428(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1752517529(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1839618399(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1840118412_components_CategoryIcon__WEBPACK_IMPORTED_MODULE_7__/* .CategoryIcon */ .Ezundefined1882718830(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1910819111(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1959719600(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2009820102(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2072520728(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2095320956(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2153121538(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined2158021587(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined2163821645(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined2167021675(0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)undefined2168821696(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined2238622390(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2249622500(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2293222936(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2327023273(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2359223595(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2390523908(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2408524088(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2444524448(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2473124735(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2498124984(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2513825141(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2626426268(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2636526369(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2721527218(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2751827521(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2788627889(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2816628169(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2865528658(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2915329157(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2977629779(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3000430007(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3044730461undefined3054930557(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)undefined3060330612(0,_lib_auth__WEBPACK_IMPORTED_MODULE_4__/* .useSession */ .wV)undefined3064330651(0,_context_locale__WEBPACK_IMPORTED_MODULE_5__/* .useLocale */ .Y)undefined3068230689(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3075330760(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3077430782(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined3090030907(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3095930966(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3101131018(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3106431071(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3110931116(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3116531172(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3121731224(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3127431281(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3132631333(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3137931386(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3142431431(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3148031487(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3153631543(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3159931606(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3165531662(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3171231719(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3178331790(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3188031887(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3195231959(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3202532032(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3210232109(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3217332180(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3225732264(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3231332320(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3237032377(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3242932436(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3248532492(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3253532542(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3259532602(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3265732664(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3272532732(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3279532802(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3285532862(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3290532912(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3295632963(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3303233039(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3309233099(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3314933156(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3320833215(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3327033277(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3333633343(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3339833405(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3346833475(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3353333540(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3358533592(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3363433641(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3368533692(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3374333750(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3379733804(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3385933866(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3393333940(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3401234019(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3407234079(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3413334140(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3419234199(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3425434261(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3432234329(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3438634393(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3447434481(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3452634533(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3460534612(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3466334670(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3471834725(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3477734784(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3483334840(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3488934896(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3495434961(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3503035037(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3509435101(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3515935166(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3521835225(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3528335290(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3533935346(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3539935406(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3547335480(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3554035547(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3559435601(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3565635663(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3571835725(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3578135788(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3583135838(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3588735894(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3595535962(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3600336010(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3605736064(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3611636123(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3618936196(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3623736244(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3629136298(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3635036357(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3642336430(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3648436491(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3655836565(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3667636683(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3674536752(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3681136818(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3687036877(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3692836935(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3700337010(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3706637073(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3723237239(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3729337300(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3734637353(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3756637573(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3762137628(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3769037697(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3775737764(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined3782137828(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined4708847095(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined4715247159(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined4721647223(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined4729147298(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined4734447351(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined4757747584(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined4763247639(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined4769347700(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined4782347830(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined4788647893(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined4793747944(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined4830548312(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined4835848365(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined4841548422(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined4847148478(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined4870348710(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined4876248769(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined4882348830(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined4910149108(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined4916449171(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined4924149248(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined4932249329(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined4940549412(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined4949149498(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined4955349560(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined4962549632(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined4970349710(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined4979049797(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined4987449881(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined4994349950(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined5000450011(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined5007650083(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined5014750154(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined5021150218(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined5027850285(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined5034450351(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined5039850405(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined5046250469(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined5081050817(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined5088050887(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined5093550942(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined5099751004(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined5107551082(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined5112551132(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined5118551192(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined5132851335(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined5139651403(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined5146751474(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined5160551612(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined5168051687(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined5173251739(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined5178251789(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined5183251839(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined5190351910(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined5196551972(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined5202352030(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined5208052087(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined5213452141(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined5218452191(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined5236352371(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined5268952697(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined5274352759_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminStats */ .dEundefined5280152822_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminNotifStats */ .biundefined5287052890_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminMailStats */ .u4undefined5293652954_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminReports */ .z5undefined5303653062_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminSpecialistCards */ .s_undefined5317153179(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined5327053286_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminUsers */ .cSundefined5358353591(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined5368253698_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminTasks */ .Yjundefined5399954007(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined5410054118_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminReports */ .z5undefined5434354351(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined5446254488_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminSpecialistCards */ .s_undefined5477054778(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined5512355148_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminSupportTickets */ .KZundefined5543755445(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined5553955564_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminBalanceHistory */ .g0undefined5595955967(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined5610056117_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminAiLogs */ .j_undefined5633456357_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminActivityLogs */ .yOundefined5699957018_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminMailLogs */ .qtundefined5758857608_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminNotifLogs */ .Brundefined5853258540(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined5869358701(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined5881458822(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined5895458962(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined5902759043_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminPlans */ .OXundefined5913059138(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined5924659269_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getTranslationsStats */ .YQundefined5941459422(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined5948859494(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .request */ .Em)undefined5963259638(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .request */ .Em)undefined5977359779(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .request */ .Em)undefined5991559923(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined6002760047_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminReferrals */ .cJundefined6026060268(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined6036060376_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminPlans */ .OXundefined6050160509(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined6059760605(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined6069560703(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined6145461475_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .adminBroadcastPush */ .V7undefined6166961691_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .adminSendPushToUser */ .g1undefined6206262079_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .deactivateUser */ .Wiundefined6208362098_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .activateUser */ .Heundefined6231462331_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .changeUserRole */ .Mmundefined6291362928_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminUser */ .jdundefined6424964267_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updateAdminUser */ .wlundefined6580165829_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .adminUpdateSpecialistCard */ .oqundefined6682266845_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .verifyAdminUserEmail */ .uQundefined6752267546_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .adminTopUpUserBalance */ .P0undefined6802168046_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminBalanceHistory */ .g0undefined6872968756_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .adminWithdrawUserBalance */ .hDundefined6924069265_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminBalanceHistory */ .g0undefined7004470072_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .adminUpdateSpecialistCard */ .oqundefined7100871036_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .adminUpdateSpecialistCard */ .oqundefined7149871516_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminReports */ .z5undefined7159871624_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminSpecialistCards */ .s_undefined7176871786_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .cancelTaskAdmin */ .nfundefined7232772345_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .deleteTaskAdmin */ .GBundefined7267772698_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updateReportStatus */ .eUundefined7290872916(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined7298573005_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminLocations */ .k_undefined7517075187_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updateLocation */ .Ntundefined7535675373_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .createLocation */ .yJundefined7615076167_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .deleteLocation */ .zRundefined7649576503(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined7657376594_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminCategories */ .KDundefined7668076688(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined8002580055"https://api.canhelp.gr"undefined80060800820undefined8104081057_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updateCategory */ .$7undefined8122681243_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .createCategory */ .zZundefined8206882085_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .deleteCategory */ .K7undefined8289782914_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminSkills */ .i_undefined8446384477_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updateSkill */ .fPundefined8522285236_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .createSkill */ .S9undefined8634686360_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .deleteSkill */ .hpundefined9662896641_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updatePlan */ .tdundefined9681396826_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .createPlan */ .qTundefined9710497120_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminPlans */ .OXundefined9745197464_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .deletePlan */ .bRundefined9758197589(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined9768497700_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminPlans */ .OXundefined9774597764_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminSettings */ .rCundefined106399106424_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminEmailTemplates */ .Lpundefined106896106918_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updateAdminSettings */ .CXundefined107462107484_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updateAdminSettings */ .CXundefined108665108692_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updateAdminEmailTemplate */ .jgundefined108793108823_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .translateAdminEmailTemplate */ .wcundefined109527109554_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updateAdminEmailTemplate */ .jgundefined109920109947_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updateAdminEmailTemplate */ .jgundefined110392110414_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updateAdminSettings */ .CXundefined111167111189_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updateAdminSettings */ .CXundefined111663111685_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updateAdminSettings */ .CXundefined112679112701_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updateAdminSettings */ .CXundefined113440113462_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updateAdminSettings */ .CXundefined115079115104_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .testTelegramConnection */ .qXundefined116325116347_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .verifyTelegramToken */ .clundefined116946116949(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined117982117985(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined118228118231(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined118708118712(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined118977118980(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined119216119219(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined119388119391(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined119754119757(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined120000120003(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined120500120503(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined120746120749(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined121223121227(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined121492121495(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined121810121813(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined122146122149(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined122392122395(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined122943122947(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined123212123215(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined123494123497(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined123861123865(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined124130124133(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined124398124401(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined124762124766(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined125031125034(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined125308125311(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined125631125635(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined125900125903(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined126026126029(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined126358126362(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined126627126630(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined126801126804(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined127721127724(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined127967127970(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined128417128420(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined128663128666(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined129067129070(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined129313129316(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined129689129692(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined129935129938(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined130352130356(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined130621130624(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined130829130832(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined131066131069(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined131304131307(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined131656131659(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined131902131905(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined134379134382(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined134471134475(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined134594134598(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined134752134756(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined134919134922(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined135183135186(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined135439135442(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined135729135733(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined135735135738(next_link__WEBPACK_IMPORTED_MODULE_3___default())undefined135990135993(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined136342136345(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined136804136808(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined136934136937(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined137125137129(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined137339137342(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined137850137853(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined138330138333(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined138887138891(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined139515139518(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined139853139857(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined140101140104(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined140330140333(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined141061141065(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined141238141242(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined141415141418(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined141908141911(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined142382142385(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined143280143284(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined143817143820(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined144700144703(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined145626145629(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined146100146103(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined147048147051(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined147522147525(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined148502148505(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined148976148979(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined150048150052(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined150310150313(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined150623150626(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined150994150997(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined151570151574(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined151808151812(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined152062152065(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined152407152411(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined152679152683(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined152969152972(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined153510153514(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined153800153803(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined154348154352(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined154638154641(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined155389155392(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined157167157171(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined157405157408(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined157726157729(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined161886161890(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined162199162202(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined162583162586(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined162831162834(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined163491163494(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined163881163885(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined164875164879(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined165113165117(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined165367165370(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined165717165721(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined166005166008(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined166596166599(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined167402167406(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined167640167644(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined167894167897(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined168243168247(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined168531168534(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined169118169121(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined169906169910(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined170154170158(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined170403170406(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined170748170752(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined171020171024(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined171310171313(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined171851171855(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined172141172144(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined172888172892(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined173126173130(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined173424173427(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined173807173810(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined174324174328(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined174616174619(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined174995174998(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined175508175512(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined175808175811(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined176186176190(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined177242177245(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined179170179174(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined179287179291(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined179494179498(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined180008180011(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined180635180638(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined181205181209(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined181642181645(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined181958181961(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined182281182284(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined182776182780(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined183026183030(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined183258183261(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined183453183457(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined183625183628(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined184016184019(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined184408184411(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined184799184802(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined185198185201(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined185595185598(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined185988185991(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined186426186429(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined186635186638(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined186736186739(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined187212187215(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined187313187316(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined188013188017(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined188292188295(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined188517188531(0,_lib_formatName__WEBPACK_IMPORTED_MODULE_8__/* .formatShortName */ .H)undefined188728188731(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined189111189114(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined189324189327(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined189997190000(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined190460190464(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined191043191046(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined191501191504(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined191929191932(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined192142192145(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined192792192795(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined193016193020(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined193353193356(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined193811193814(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined194503194506(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined195373195376(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined196732196735(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined197404197408(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined197521197525(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined197738197741(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined198348198352(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined198789198792(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined199125199128(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined199458199461(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined199812199815(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined200163200166(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined200700200704(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined200950200954(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined201182201185(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined201377201381(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined201549201552(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined201940201943(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined202357202360(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined202768202771(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined203180203183(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined203601203604(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined204184204187(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined204393204396(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined204494204497(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined204976204979(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined205077205080(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined206132206136(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined206421206425(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined206717206720(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined207147207150(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined207733207736(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined207946207949(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined208535208539(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined209439209442(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined209666209670(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined210616210619(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined211023211026(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined211816211819(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined212491212495(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined212608212612(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined212815212819(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined213329213332(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined213956213959(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined214526214530(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined214967214970(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined215712215715(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined216224216228(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined216474216478(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined216706216709(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined216901216905(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined217073217076(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined217465217468(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined217860217863(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined218253218256(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined218646218649(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined219040219043(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined219478219481(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined219687219690(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined219788219791(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined220264220267(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined220365220368(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined221194221198(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined221473221476(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined221721221724(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined221726221729(next_link__WEBPACK_IMPORTED_MODULE_3___default())undefined222538222541(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined223067223070(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined223280223283(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined223988223991(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined224225224235(0,_lib_taskLocale__WEBPACK_IMPORTED_MODULE_9__/* .formatPrice */ .$g)undefined224424224427(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined224855224858(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined225079225083(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined225465225468(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined226106226109(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined227445227448(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined228119228123(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined228236228240(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined228466228469(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined228762228766(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined229479229483(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined229726229730(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined230104230108(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined230811230815(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined231069231073(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined231234231237(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined231621231624(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined232597232601(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined232762232765(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined233149233152(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined234265234269(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined234430234433(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined234818234821(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined235791235795(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined235956235960(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined236592236595(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined237477237481(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined237642237646(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined238278238281(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined239163239167(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined239328239332(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined239964239967(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined240849240853(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined241014241018(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined241650241653(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined242646242650(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined242914242917(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined243747243751(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined243973243976(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined244577244580(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined245260245263(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined245491245494(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined245745245748(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined247596247600(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined247713247717(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined247943247946(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined248239248243(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined248956248960(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined249203249207(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined249581249585(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined250285250289(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined250543250547(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined250708250711(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined251095251098(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined252077252081(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined252242252246(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined252878252881(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined253761253765(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined253926253930(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined254562254565(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined255445255449(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined255610255614(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined256246256249(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined257129257133(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined257294257298(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined257930257933(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined258910258914(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined259154259158(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined259398259401(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined259786259789(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined260773260777(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined261065261068(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined262083262087(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined262309262312(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined262913262916(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined263596263599(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined263827263830(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined264081264084(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined264986264990(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined265173265176(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined265433265436(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined265907265910(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined266102266106(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined266356266360(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined266610266614(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined266912266915(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined267503267506(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined268070268074(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined268737268740(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined268742268745(next_link__WEBPACK_IMPORTED_MODULE_3___default())undefined269377269381(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined270431270435(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined270894270897(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined271434271437(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined271788271791(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined272323272327(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined272587272590(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined273140273143(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined273990273993(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined274533274537(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined274710274714(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined274927274931(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined275189275192(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined275546275549(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined275902275905(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined276387276391(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined276649276652(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined277004277007(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined277359277362(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined277948277951(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined278216278219(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined278489278493(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined278690278694(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined278839278842(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined279215279218(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined279435279438(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined280037280040(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined280272280276(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined280596280600(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined280910280914(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined281272281275(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined281821281824(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined282479282482(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined282734282737(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined282739282742(next_link__WEBPACK_IMPORTED_MODULE_3___default())undefined283635283638(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined284238284242(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined284562284565(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined285234285237(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined286479286483(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined286628286631(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined286999287002(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined287218287221(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined287809287812(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined288044288048(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined288368288372(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined288682288686(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined289044289047(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined289589289592(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined290247290250(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined290502290505(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined290507290510(next_link__WEBPACK_IMPORTED_MODULE_3___default())undefined291403291406(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined292006292009(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined293054293057(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined293752293756(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined293869293872(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined295285295288(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined295910295914(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined296043296047(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined296297296301(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined296907296911(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined297144297161_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminAiLogs */ .j_undefined297824297828(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined298447298450(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined298731298734(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined299659299662(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined299940299943(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined300203300206(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined300409300413(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined300653300656(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined300878300882(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined301058301061(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined301450301453(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined301846301849(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined302239302242(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined302633302636(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined303026303029(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined303417303420(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined303809303812(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined304203304206(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined304594304597(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined305178305181(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined305634305638(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined305934305937(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined306394306397(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined306615306618(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined307237307240(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined307656307659(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined308058308061(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined308542308545(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined309046309049(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined309554309557(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined310056310059(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined310556310559(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined310803310806(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined311059311062(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined311725311728(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined312138312141(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined312561312565(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined313322313325(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined313960313963(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined315341315344(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined315952315956(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined316085316089(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined316383316387(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined316548316551(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined316941316945(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined317482317485(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined317894317897(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined318508318512(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined318673318676(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined319065319068(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined319770319774(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined319935319938(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined320325320328(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined321101321105(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined321940321944(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined322561322564(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined323079323082(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined323930323934(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined324683324686(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined324950324953(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined325141325144(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined325889325892(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined326508326512(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined326641326645(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined326939326943(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined327104327107(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined327493327497(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined328026328029(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined328430328433(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined329094329098(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined329259329262(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined329647329650(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined330344330348(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined330509330512(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined330895330898(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined331633331637(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined332373332377(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined332994332997(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined333512333515(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined334359334363(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined335100335103(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined335363335366(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined335569335573(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined335813335816(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined336038336042(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined336218336221(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined336610336613(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined337007337010(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined337400337403(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined337796337799(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined338191338194(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined338775338778(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined340147340151(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined340457340460(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined340919340922(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined341320341323(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined341541341544(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined342140342143(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined342540342543(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined342784342787(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined343398343401(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined343641343644(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined344020344023(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined344686344689(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined345099345102(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined345484345488(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined346245346248(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined346883346886(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined348266348269(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined348882348886(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined349015349019(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined349313349317(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined349478349481(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined349872349876(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined350413350416(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined350812350815(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined351426351430(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined351591351594(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined351983351986(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined352690352694(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined352855352858(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined353245353248(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined354007354011(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined354761354765(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined355382355385(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined355900355903(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined356751356755(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined357505357508(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined357774357777(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined357980357984(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined358224358227(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined358449358453(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined358629358632(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined359021359024(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined359412359415(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined359810359813(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined360209360212(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined360797360800(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined361196361200(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined361496361499(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined361954361957(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined362520362523(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined362741362744(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined363280363283(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined363697363700(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined363941363944(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined364197364200(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined364863364866(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined365276365279(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined365531365534(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined366195366198(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined367365367368(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined368046368050(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined368163368167(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined368393368397(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined368667368671(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined369247369250(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined369876369879(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined370637370640(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined371168371172(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined371421371424(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined371773371777(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined372011372015(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined372176372179(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined372570372573(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined373486373490(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined373651373654(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined374046374049(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined375208375212(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined375373375376(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined375772375775(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined377117377121(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined377282377285(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined377676377680(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined378502378505(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined378890378893(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined379276379279(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined380011380015(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined380160380163(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined380529380532(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined381379381382(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined381735381739(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined381973381977(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined382138382141(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined382537382540(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined383709383713(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined383874383877(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined384274384277(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined385448385452(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined385613385616(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined386012386015(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined387184387188(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined387349387352(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined387755387758(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined388945388949(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined389110389113(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined389514389517(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined390700390704(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined390865390868(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined391265391268(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined392439392443(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined392604392607(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined393007393010(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined394284394287(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined394639394643(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined394877394881(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined395042395045(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined395444395447(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined396544396548(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined396709396712(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined397116397119(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined398397398401(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined398546398549(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined398912398915(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined399840399843(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined400197400200(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined402065402069(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined402367402370(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined403469403472(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined403827403830(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined408332408336(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined408634408637(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined409736409740(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined409980409984(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined410282410285(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined411313411317(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined411615411618(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined412643412647(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined412906412909(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined413278413281(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined414350414354(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined414581414584(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined415193415196(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined415846415849(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined416069416072(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined416333416336(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined417004417008(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined417308417312(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined417574417578(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined417883417886(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined418308418311(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined418799418802(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined419416419419(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined419796419800(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined420119420123(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined420490420494(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined421333421337(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined422210422214(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined422892422896(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined423575423579(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined424254424258(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined424593424596(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined425261425264(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined426498426501(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined426738426742(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined427084427087(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined427328427331(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined428018428021(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined429047429051(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined429337429340(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined429439429452_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updatePlan */ .tdundefined429649429665_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminPlans */ .OXundefined430082430085(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined430678430681(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined431189431192(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined431735431738(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined432743432747(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined432860432863(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined434525434528(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined435150435154(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined435397435400(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined435719435723(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined435944435948(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined436109436112(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined436514436517(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined437548437552(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined437713437716(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined438117438120(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined439161439165(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined439326439329(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined439735439738(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined440872440876(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined441037441040(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined441446441449(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined442496442499(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined443388443392(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined443635443638(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined443954443957(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined444265444269(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined444490444494(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined444752444756(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined445026445029(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined445455445458(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined446570446574(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined446751446754(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined447180447183(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined448397448401(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined448562448565(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined448965448969(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined449815449818(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined450205450208(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined450577450580(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined451190451194(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined451355451358(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined451756451759(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined452880452884(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined453045453048(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined453446453449(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined454663454667(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined454925454929(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined455106455109(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined455540455543(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined456656456660(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined456837456840(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined457272457275(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined458606458609(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined459282459285(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined459717459733_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .sendTestEmail */ .FIundefined460886460890(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined461177461180(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined461745461748(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined462666462669(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined463284463288(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined463494463498(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined463756463760(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined464034464038(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined464321464324(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined464783464787(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined464980464983(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined465413465416(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined466118466122(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined466422466425(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined466824466827(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined467650467653(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined468383468387(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined468632468636(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined468813468816(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined469242469246(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined470106470109(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined470523470526(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined471220471224(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined471401471404(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined471832471835(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined472974472978(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined473260473264(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined473457473460(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined473899473902(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined475098475102(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined475295475298(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined475741475744(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined477188477192(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined477369477372(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined477797477800(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined478966478970(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined479147479150(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined479559479562(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined480821480825(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined481089481092(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined481773481776(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined482353482357(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined482665482669(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined483244483247(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined483639483642(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined484110484113(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined484698484701(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined485159485163(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined485370485374(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined485687485691(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined486266486269(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined486661486664(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined487132487135(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined487720487724(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined488255488258(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined489246489249(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined489767489770(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined490623490626(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined491145491148(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined491934491937(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined492456492459(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined493312493315(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined493835493838(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined494672494675(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined495195495198(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined496066496069(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined496588496591(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined497340497343(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined497861497864(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined498705498708(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined499225499228(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined500049500052(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined500571500574(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined501512501515(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined502033502036(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined502901502904(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined503424503427(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined504209504212(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined504729504732(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined505567505570(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined506091506094(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined507151507154(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined507672507675(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined508468508471(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined508990508993(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined509788509791(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined510311510314(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined511166511169(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined511688511691(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined512481512484(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined513004513007(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined513964513967(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined514484514487(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined516293516297(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined516579516583(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined517029517032(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined517388517392(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined517678517681(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined518101518105(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined518825518828(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined519396519399(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined519666519669(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined520260520263(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined520826520830(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined521127521130(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined521753521756(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined522668522672(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined522857522860(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined523308523311(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined525383525387(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined525572525575(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined526020526023(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined528357528361(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined528689528692(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined529124529127(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined529603529606(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined530383530387(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined530679530682(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined531470531474(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined532154532157(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined532822532825(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined533890533893(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined535020535024(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined535277535281(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined535426535429(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined535776535779(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined536220536224(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined536469536473(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined536634536637(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined537029537032(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined537524537527(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined538246538249(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined538774538778(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined539037539040(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined539427539431(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined539592539595(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined539999540003(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined540849540852(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined541256541259(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined541765541768(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined542262542266(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined542427542430(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined542834542837(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined543899543902(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined544493544497(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined544732544735(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined545384545387(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined545929545933(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined546186546190(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined546335546338(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined546689546692(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined547487547490(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined547831547834(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined549106549109(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined549450549453(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined551004551007(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined551348551351(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined552271552274(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined552615552618(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined553413553416(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined553757553760(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined554742554745(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined555086555089(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined556036556039(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined556380556383(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined558132558135(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined558476558479(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined560444560448(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined560601560605(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined560923560926(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined561422561425(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined561937561940(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined563115563119(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined563359563362(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined564003564006(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined564544564548(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined564801564804(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined565114565118(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined565363565367(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined565528565531(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined565922565925(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined566423566426(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined567171567174(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined567702567706(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined567951567955(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined568116568119(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined568507568510(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined569005569008(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined569755569758(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined570286570289(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined570452570456(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined570609570613(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined571319571322(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined573355573359(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined574529574532(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined574921574924(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined576210576213(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined576608576611(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined578149578153(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined578298578301(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined578676578679(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined579031579034(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined580187580191(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined580426580429(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined581058581061(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined581604581608(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined581861581865(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined582010582013(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined582365582368(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined582804582808(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined582953582956(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined583327583331(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined583577583580(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined584860584863(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined585723585726(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined586324586328(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined586473586476(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined586851586855(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined587101587104(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined588128588131(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined588991588994(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined589376589379(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined589969589973(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined590194590197(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined590568590571(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined592970592974(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined593143593147(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined593449593452(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined593846593849(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined594392594396(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined594678594681(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined595823595826(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined596802596805(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined597625597629(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined597850597854(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined598123598127(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined598304598307(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined598738598741(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined599301599304(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined600151600154(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined600739600743(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined601012601016(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined601193601196(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined601621601624(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined602178602181(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined603007603010(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined603685603689(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined603929603932(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined604581604584(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined605183605187(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined605360605364(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined605577605581(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined606163606166(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined606795606798(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined607286607289(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined608189608193(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined608874608877(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined609210609213(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined609541609544(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined609893609896(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined610236610239(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined610670610674(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined611351611354(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined611681611685(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined612211612215(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined612762612766(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined613395613399(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined614066614069(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined614333614336(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined615991615995(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined616241616245(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined616512616516(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined616778616782(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined617092617096(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined618048618051(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined618660618664(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined619468619471(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined619873619877(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined620585620588(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined621123621127(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined621429621432(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined622380622383(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined622482622507_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .setSupportTicketStatus */ .u0undefined623576623579(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined623967623971(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined624250624254(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined624846624849(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined625327625331(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined625569625572(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined626339626343(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined626614626618(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined627201627204(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined627612627615(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined628044628047(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined628467628470(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined629021629024(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined629697629720_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .replyToSupportTicket */ .nTundefined631862631865(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined632399632403(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined632576632580(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined632824632827(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined633131633135(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined633357633360(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined634004634007(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined634767634771(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined634916634919(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined635249635252(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined635995635999(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined636258636261(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined636864636868(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined637013637016(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined637348637351(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined638070638074(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefinedÀ638219638222(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined638550638553(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined639345639349(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined639598639602(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined639763639766(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined640124640127(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined640917640921(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined641082641085(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined641466641469(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined642347642351(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined642586642589(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined643356643359(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined643868643872(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined644106644109(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined644435644439(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined644696644700(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined644990644993(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined645340645343(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined645823645827(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined646117646120(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined646462646465(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined646948646952(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined647242647245(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined647594647597(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined648077648081(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined648371648374(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined648725648728(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined649211649215(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined649505649508(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined649858649861(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined650399650403(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined650660650664(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined650954650957(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined651298651301(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined651797651801(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined652091652094(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined652443652446(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined653032653036(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined653326653329(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined653678653681(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined654155654159(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined654449654452(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined654803654806(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined655415655418(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined655420655428react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragmentundefined656140656144(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined656452656456(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined658092658096(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined659021659025(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined659807659810(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined659812659820react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragmentundefined659921659925(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined660233660237(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined661024661028(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined661608661612(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined662499662503(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined662676662680(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined662926662929(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined663391663394(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined664037664041(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined664416664419(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined664617664620(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined665158665162(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined665430665434(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined665579665582(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined665943665946(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined666431666434(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined666812666818(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .request */ .Em)undefined667847667850(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined668328668332(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined668566668569(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined668905668909(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined669141669145(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined669568669598"https://api.canhelp.gr"undefined6696036696250undefined671662671665(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined672206672209(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined673059673063(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined673500673503(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined674044674047(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined674795674798(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined676173676203"https://api.canhelp.gr"undefined6762086762300undefined677996678000(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined678234678237(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined678613678616(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined678897678900(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined679090679094(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined679418679422(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined679599679602(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined680087680091(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined681380681383(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined682016682022(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .request */ .Em)undefined683846683850(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined684084684087(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined684437684441(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined684698684702(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined685114685117(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined685780685783(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined686500686503(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined686758686761(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined686930686933(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined687111687114(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined687334687338(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined687613687616(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined688002688005(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined688221688225(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined688556688559(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined688889688919"https://api.canhelp.gr"undefined6889246889460undefined691388691392(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined692046692049(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined693785693815"https://api.canhelp.gr"undefined6938206938420undefined697242697246(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined697419697423(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined697552697555(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined697856697859(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined698278698282(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined698547698551(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined698696698699(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined699042699046(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined699582699585(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined699937699940(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined700294700297(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined700651700654(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined701220701223(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined701701701704(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined702129702133(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined702278702281(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined702628702632(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined703160703163(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined703515703518(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined703872703875(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined704229704232(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined704798704801(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined704971704975(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined705856705859(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined706392706395(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined707726707729(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined708095708099(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined708337708341(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined708713708716(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined709315709318(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined709913709916(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined711105711109(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined711381711385(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined711653711657(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined711834711837(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined712230712233(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined712747712750(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined713382713386(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined714025714028(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined715024715028(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined715915715944_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getTasksTranslationPreview */ .QYundefined718084718087(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined718295718299(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined718597718600(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined719183719186(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined719880719883(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined721326721347_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .autoTranslateTasks */ .Iundefined721395721425_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .autoTranslateEmailTemplates */ .fuundefined721461721477_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .autoTranslate */ .cpundefined722109722132_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getTranslationsStats */ .YQundefined724024724028(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined724030724038react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragmentundefined724209724213(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined724723724726(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined725517725520(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined726346726350(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined726352726360react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragmentundefined726531726534(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined727141727144(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined728059728063(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined728065728073react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragmentundefined728244728247(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined728854728857(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined730469730472(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined731088731091(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined732864732867(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined732955732959(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined733132733135(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined735077735081(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined735352735355(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined735680735683(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined736188736192(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined736439736443(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined736723736726(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined737057737061(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined737305737325_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminReferrals */ .cJundefined737777737781(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined738233738236(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined738963738966(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined739893739896(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined740075740079(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined740487740490(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined741121741124(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined741696741699(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined741970741973(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined743320743324(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined743485743489(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined744346744349(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined745026745029(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined745589745593(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined745891745894(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined746340746343(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined747035747038(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined747479747483(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined748327748330(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined748551748555(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined748843748846(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined748963748967(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined749298749301(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined749777749780(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined750248750251(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined750721750724(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined751197751200(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined751905751908(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined753024753028(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined753418753421(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined753896753899(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined754367754370(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined754634754638(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined755539755542(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined755806755809(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined756973756976(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined758846758849(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined759111759115(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined759440759444(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined759726759730(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined759883759887(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined760254760257(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined760763760766(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined761228761231(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined761525761528(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined762021762024(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined762636762639(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined762840762843(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined763022763026(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined763434763437(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined764068764071(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined764624764627(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined764896764900(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined765144765147(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined765244765248(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined765519765522(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined765929765932(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined766713766716(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined767300767303(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined767429767433(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined767733767736(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined768235768238(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined768460768463(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined770605770608(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined770974770977(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined771315771318(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined772326772329(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined772519772523(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined772773772777(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined773059773063(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined773216773219(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined773584773588(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined774335774338(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined774850774854(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined775073775076(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined777224777227(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined777718777748_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminUserSpecialistCards */ .vyundefined777913777934_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminCategories */ .KDundefined778102778122_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminLocations */ .k_undefined779314779318(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined779597779601(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined779858779862(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined780193780197(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined780396780400(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined781533781537(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined781736781740(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined782987782991(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined783285783289(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined783490783493(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined783969783972(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined785201785205(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined785406785409(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined785884785887(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined787248787252(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined787437787440(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined787879787882(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined789011789015(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined789200789203(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined789640789643(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined791016791020(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined791277791281(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined791466791469(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined791908791911(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined792523792527(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined792871792875(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined793219793222(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined793699793702(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined794346794349(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined794824794827(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined795655795658(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined796427796430(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined797316797320(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined797614797618(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined797819797822(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined798292798296(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined799238799241(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined799705799708(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined800496800500(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined800701800704(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined801174801178(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined802217802220(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined802696802699(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined803641803645(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined804407804411(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined804723804726(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined805690805693(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined806246806250(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined806435806438(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined806886806890(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined807859807862(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined808272808275(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined808684808687(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined809386809390(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined809575809578(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined810026810029(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined810906810910(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined811272811275(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined813449813452(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined814619814623(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined814880814884(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined815238815242(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined815443815446(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined815899815903(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined816893816897(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined817203817207(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined817770817773(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined818370818373(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined819462819466(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined820026820029(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined820626820629(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined822005822008(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined822554822557(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined822744822748(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined823047823051(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined823390823394(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined823603823606(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined824092824095(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined824735824738(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined826002826006(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined826345826349(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined826558826561(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined827046827049(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined827688827691(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined828950828954(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined829293829297(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined829506829509(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined829992829995(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined830632830635(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined832102832106(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined832363832367(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined832552832555(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined833007833011(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined833330833334(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined833775833778(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined834309834312(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined835750835753(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined836454836457(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined837146837149(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined838271838275(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined838277838285react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragmentundefined838464838467(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined838929838932(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined842736842740(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined843117843120(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined843583843586(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined845939845943(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined846243846246(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined846716846720(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined848603848606(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined849068849071(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined850147850151(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined854047854051(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined854385854388(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined854895854898(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined855395855398(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined855686855689(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined856291856295(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined856480856483(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined856923856926(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined857288857292(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined857798857801(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined859429859433(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined859739859742(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined863012863015(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined865822865826(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined866127866130(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined866595866598(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined866962866965(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined867322867325(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined867895867899(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined868277868281(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined868648868651(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined870025870029(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined870453870456(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined871760871763(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined872696872699(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined874157874161(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined874394874397(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined874927874930(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined875326875330(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined875932875935(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined877969877973(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined878351878354(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined883811883814(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined887953887957(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined888190888193(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined888727888730(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined889389889393(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined890369890372(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined892546892549(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined894984894988(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined895221895224(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined895757895760(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined896415896419(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined897393897396(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined899562899565(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined901990901993(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined902256902259(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined904027904031(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined904290904293(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined904876904879(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined905391905394(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined905588905591(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined906211906214(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined906406906410(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined906725906729(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined906967906970(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined907429907432(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined907948907952(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined908316908320(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined909021909025(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined909234909238(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined909391909394(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined909897909900(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined911672911676(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined911829911832(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined912345912348(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined914232914236(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined914451914454(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined915905915908(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined916887916894(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined916946916953(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined916996917003(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined917044917051(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined917755917771_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getSkillDedup */ .GEundefined918787918810_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .mergeSkillDuplicates */ .Uqundefined919503919526_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .mergeSkillDuplicates */ .Uqundefined919990919994(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined920083920087(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined920160920163(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined920364920367(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined920610920614(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined920776920780(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined920976920980(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined921085921088(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined921348921351(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined921772921776(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined922211922215(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined922634922637(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined922928922931(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined923539923542(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined923670923674(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined923923923926(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined924289924292(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined924714924718(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined924867924871(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined925068925072(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined925699925702(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined926524926528(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined926774926778(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined927069927073(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined927304927308(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined928014928017(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined928444928448(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined929114929117(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined929822929825(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined930013930017(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined930321930324(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined931210931214(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined931476931480(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined931785931788(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined932250932254(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined932964932968(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined933645933649(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined934447934451(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined934753934756(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined935305935309(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined936005936008(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined937429937432(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined937434937442react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragmentundefined938022938026(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined938099938103(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined938458938461(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined938818938821(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined939176939179(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined939350939353(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined939708939711(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined939882939885(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined940087940090(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined940440940443(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined940837940841(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined941229941232(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined941591941594(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined941960941964(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined942130942133(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined942378942381(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined942625942629(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined943077943080(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined943446943450(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined943641943644(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined944092944095(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined944471944474(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined944982944985(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined946062946065(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined946067946075react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragmentundefined946999947003(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined947076947080(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined947435947438(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined947795947798(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined948153948156(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined948327948330(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined948685948688(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined948859948862(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined949050949053(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined949233949236(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined949238949249_components_CategoryIcon__WEBPACK_IMPORTED_MODULE_7__/* .CategoryIcon */ .Ezundefined949618949622(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined949788949791(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined950036950039(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined950373950377(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined950825950828(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined951194951198(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined951374951378(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined951854951857(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined952278952281(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined953025953028(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined953473953476(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined953852953855(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined954352954355(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined955126955129(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined956737956741(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined956878956881(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined957211957215(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined957304957307(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined957582957585(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined958417958421(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined958578958581(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined958768958771(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined959285959289(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined959435959438(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined959772959775(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined960790960794(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined961134961138(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined961270961273(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined961482961486(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined961759961763(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined962069962072(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined962177962181(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined962631962635(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined963028963031(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined963355963358(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined963896963900(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined964054964058(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined964294964297(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined964672964675(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined965018965022(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined965174965177(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined965725965729(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined965826965830(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined966198966202(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined966404966407(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined966740966743(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined967105967108(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined967504967508(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined967927967931(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined968225968228(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined968862968865(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined969482969485(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined969621969624(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined970170970173(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined970275970278(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined970845970849(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined971019971023(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined971207971211(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined971325971328(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined971660971664(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined971947971950(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined972596972599(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined972808972811(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined973238973241(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined973450973453(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined973853973857(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined974084974087(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined974239974242(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined974602974605(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined974814974817(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined975192975195(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined975404975407(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined975783975787(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined976014976017(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined976169976172(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined976351976354(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined976708976712(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined976939976942(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined977051977054(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined977476977479(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined977688977691(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined977955977959(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined978186978189(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined978368978371(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined978716978719(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined978928978931(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined979615979618(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined979827979830(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined980272980276(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined980431980435(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined980787980791(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined980909980913(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined981092981095(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined981449981452(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined981751981754(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined981999982003(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined982290982293(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined982643982646(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined982855982858(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined983083983082(/* unused pure expression or super */ null && (undefined983217983216))undefined984710984713(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined984794984798(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined985159985163(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined985250985253(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined985600985603(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined986262986265(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined987118987121(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined987455987458(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined990256990259(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined990340990344(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined990675990679(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined990766990769(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined991116991119(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined991690991693(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined992102992105(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined992458992461(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined992658992661(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined993188993191(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined993248993251(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined993632993635(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefinedÑÒ, /***/ 7067:  W«webpack/lib/util/registerExternalSerializerœwebpack-sources/ConcatSource€«webpack/lib/util/registerExternalSerializer™webpack-sources/RawSourceV/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { «webpack/lib/util/registerExternalSerializerœwebpack-sources/CachedSource T«webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSource«webpack/lib/util/registerExternalSerializer™webpack-sources/RawSourceSimport(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/admin/page.tsx"); `PßPromise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 6961))€†buffer†source„size„maps„hashaPromise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 6961)); €”{"finalSource":true}ƒmap‹bufferedMap ReplaceSourceRawSourceSimport(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/admin/page.tsx"); k080Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 6961))undefined /***/ }) ŸÁ/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 6961)); /***/ }) ¿Â ÃV/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { ÅSimport(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/admin/page.tsx"); k080Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 6961))undefinedÆÇ }, «webpack/lib/util/registerExternalSerializerœwebpack-sources/PrefixSource‰/******/ 2__webpack_require__ => { // webpackRuntimeModules ívar __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId)) __webpack_require__.O(0, [1516,9664,9906,2982,587,18,7358], () => (__webpack_exec__(7067))); var __webpack_exports__ = __webpack_require__.O(); _N_E = __webpack_exports__; } ]); ÉþÿÿØ(self["webpackChunk_N_E"] = self["webpackChunk_N_E"] || []).push([[3698],{ /***/ 1258: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ E: () => (/* binding */ shortName), /* harmony export */ H: () => (/* binding */ formatShortName) /* harmony export */ }); /** * Shortens the last name to first letter + period. * "ИваМ ПетрПв" → "ИваМ П." * Works with a pre-composed full name string. */ function shortName(fullName) { if (!(fullName === null || fullName === void 0 ? void 0 : fullName.trim())) return '—'; const parts = fullName.trim().split(/\s+/); if (parts.length < 2 || !parts[1]) return parts[0]; return "".concat(parts[0], " ").concat(parts[1][0].toUpperCase(), "."); } /** * Formats separate firstName + lastName fields, shortening the last name. * Falls back to parsing fullName if firstName is not available. */ function formatShortName(firstName, lastName, fallbackName) { if (firstName === null || firstName === void 0 ? void 0 : firstName.trim()) { const l = lastName === null || lastName === void 0 ? void 0 : lastName.trim(); return l ? "".concat(firstName.trim(), " ").concat(l[0].toUpperCase(), ".") : firstName.trim(); } return shortName(fallbackName); } /***/ }), /***/ 1592: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ CI: () => (/* binding */ signOut), /* harmony export */ Hh: () => (/* binding */ signUp), /* harmony export */ Jv: () => (/* binding */ signIn), /* harmony export */ wV: () => (/* binding */ useSession), /* harmony export */ yK: () => (/* binding */ authClient) /* harmony export */ }); /* harmony import */ var better_auth_react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6504); const API_URL = "https://api.canhelp.gr" || 0; const authClient = (0,better_auth_react__WEBPACK_IMPORTED_MODULE_0__/* .createAuthClient */ .M)({ baseURL: API_URL }); const { signIn, signOut, signUp, useSession } = authClient; /***/ }), /***/ 4017: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ $g: () => (/* binding */ formatPrice), /* harmony export */ GZ: () => (/* binding */ taskDescription), /* harmony export */ Oj: () => (/* binding */ taskTitle) /* harmony export */ }); function taskTitle(task, locale) { if (locale === 'el' && task.titleEl) return task.titleEl; if (locale === 'en' && task.titleEn) return task.titleEn; if (locale === 'ru' && task.titleRu) return task.titleRu; return task.title; } /** Display a price without decimal cents: 100.00 → 100, 99.5 → 100 */ function formatPrice(value) { if (value === null || value === undefined || value === '') return ''; return Math.round(Number(value)).toString(); } function taskDescription(task, locale) { if (locale === 'el' && task.descriptionEl) return task.descriptionEl; if (locale === 'en' && task.descriptionEn) return task.descriptionEn; if (locale === 'ru' && task.descriptionRu) return task.descriptionRu; return task.description; } /***/ }), /***/ 5940: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ Ez: () => (/* binding */ CategoryIcon), /* harmony export */ V: () => (/* binding */ isCategoryIconUrl) /* harmony export */ }); /* unused harmony export resolveCategoryIconUrl */ /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); const API_URL = "https://api.canhelp.gr" || 0; function isCategoryIconUrl(icon) { if (!icon) return false; const value = icon.trim(); return value.startsWith('http://') || value.startsWith('https://') || value.startsWith('/'); } function resolveCategoryIconUrl(icon) { if (icon.startsWith('/api/')) return "".concat(API_URL).concat(icon); return icon; } function CategoryIcon(param) { let { icon, alt = '', className, fallback = '📊' } = param; const value = (icon || '').trim(); const [hasError, setHasError] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ setHasError(false); }, [ value ]); const url = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(()=>isCategoryIconUrl(value) ? resolveCategoryIconUrl(value) : '', [ value ]); const fallbackUrl = '/category-icons/package.svg'; if (isCategoryIconUrl(value)) { if (hasError && value !== fallbackUrl) { return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: fallbackUrl, alt: alt, className: className, loading: "lazy", onError: ()=>setHasError(true) }); } if (hasError && value === fallbackUrl) { return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: className, children: fallback }); } return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: url, alt: alt, className: className, loading: "lazy", onError: ()=>setHasError(true) }); } return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: className, children: value || fallback }); } /***/ }), /***/ 6961: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ AdminPage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7541); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(9664); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(next_link__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(1592); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(9906); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(2982); /* harmony import */ var _lib_formatName__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(1258); /* harmony import */ var _lib_taskLocale__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(4017); /* harmony import */ var _components_CategoryIcon__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(5940); /* __next_internal_client_entry_do_not_use__ default auto */ const TEMPLATE_VARS = { 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' ] }; const TEMPLATE_HINT_VARS = Array.from(new Set(Object.values(TEMPLATE_VARS).flat())); const DEFAULT_CATEGORY_ICON_PRESETS = [ { 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 getCatLabel(row, locale) { if (!row) return ''; if (locale === 'en') return row.namesEn || row.namesEl || row.slug || ''; if (locale === 'ru') return row.namesRu || row.namesEl || row.slug || ''; if (locale === 'uk') return row.namesUk || row.namesEl || row.slug || ''; return row.namesEl || row.namesEn || row.slug || ''; } function getLocLabel(row, locale) { if (!row) return ''; if (locale === 'en') return row.nameEn || row.nameEl || row.slug || ''; if (locale === 'ru') return row.nameRu || row.nameEl || row.slug || ''; if (locale === 'uk') return row.nameUk || row.nameEl || row.slug || ''; return row.nameEl || row.nameEn || row.slug || ''; } function CategoryIconPicker(param) { let { value, onChange, onUpload, uploading, error, presets } = param; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-3 rounded-xl border border-gray-200 bg-white px-3 py-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex h-12 w-12 items-center justify-center rounded-lg bg-green-50", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components_CategoryIcon__WEBPACK_IMPORTED_MODULE_7__/* .CategoryIcon */ .Ez, { icon: value, alt: "category icon", className: "h-9 w-9 object-contain text-3xl leading-none", fallback: "\uD83D\uDCE6" }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: value, onChange: (e)=>onChange(e.target.value), className: "flex-1 border-0 bg-transparent p-0 text-sm outline-none ring-0", placeholder: "/category-icons/package.svg" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "inline-flex cursor-pointer items-center rounded-lg border px-3 py-1.5 text-xs font-medium transition ".concat(uploading ? 'border-gray-200 bg-gray-100 text-gray-400' : 'border-green-300 bg-green-50 text-green-700 hover:bg-green-100'), children: [ uploading ? 'Uploading...' : 'Upload SVG', /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "file", accept: ".svg,image/svg+xml", className: "hidden", disabled: uploading, onChange: async (e)=>{ var _e_target_files; const file = (_e_target_files = e.target.files) === null || _e_target_files === void 0 ? void 0 : _e_target_files[0]; if (!file) return; await onUpload(file); e.target.value = ''; } }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-xs text-gray-500", children: "or choose from presets" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-[11px] text-gray-500", children: "Preset source: /public/category-icons/presets.json" }), error ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-red-600", children: error }) : null, /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "grid grid-cols-2 gap-2 sm:grid-cols-3 lg:grid-cols-4", children: presets.map((preset)=>{ const active = value === preset.value; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { type: "button", onClick: ()=>onChange(preset.value), className: "flex h-20 flex-col items-center justify-center gap-1 rounded-lg border px-2 transition ".concat(active ? 'border-green-500 bg-green-50 shadow-sm' : 'border-gray-200 bg-white hover:border-green-300 hover:bg-green-50'), "aria-label": preset.label, title: preset.label, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components_CategoryIcon__WEBPACK_IMPORTED_MODULE_7__/* .CategoryIcon */ .Ez, { icon: preset.value, alt: preset.label, className: "h-8 w-8 object-contain text-3xl leading-none", fallback: "\uD83D\uDCE6" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "max-w-full truncate text-[11px] font-medium text-gray-600 leading-tight", children: preset.label }) ] }, preset.value); }) }) ] }); } function AdminCatPicker(param) { let { catRows, locale, selected, onAdd, addLabel } = param; const [open, setOpen] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [search, setSearch] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [expandedParent, setExpandedParent] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const ref = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ function h(e) { if (ref.current && !ref.current.contains(e.target)) { setOpen(false); setSearch(''); } } document.addEventListener('mousedown', h); return ()=>document.removeEventListener('mousedown', h); }, []); const parents = catRows.filter((r)=>!r.parentId); const lowerSearch = search.toLowerCase(); const matchesSearch = (r)=>{ var _r_slug; return !search || getCatLabel(r, locale).toLowerCase().includes(lowerSearch) || ((_r_slug = r.slug) !== null && _r_slug !== void 0 ? _r_slug : '').toLowerCase().includes(lowerSearch); }; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "relative", ref: ref, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { type: "button", onClick: ()=>setOpen((v)=>!v), className: "w-full flex items-center gap-1.5 px-3 py-1.5 text-xs transition-colors ".concat(open ? '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: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4 6h16M4 10h16M4 14h16M4 18h16" }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "flex-1 text-left truncate", children: addLabel }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3 h-3 text-gray-400 shrink-0 transition-transform ".concat(open ? 'rotate-180' : ''), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19 9l-7 7-7-7" }) }) ] }), open && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "sticky top-0 bg-white px-3 py-2 border-b border-gray-100", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { autoFocus: true, value: search, onChange: (e)=>setSearch(e.target.value), placeholder: "ППОск...", className: "w-full text-xs border border-gray-200 rounded-lg px-2.5 py-1.5 focus:outline-none focus:ring-2 focus:ring-blue-300" }) }), parents.map((parent)=>{ const children = catRows.filter((r)=>r.parentId === parent.id); const parentLabel = getCatLabel(parent, locale); const isExpanded = expandedParent === parent.id; const matchingChildren = children.filter((c)=>!selected.includes(c.slug) && matchesSearch(c)); const parentAvail = !selected.includes(parent.slug) && matchesSearch(parent); const hasChildren = children.length > 0; if (!parentAvail && matchingChildren.length === 0 && search) return null; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: ()=>{ if (hasChildren && !search) { setExpandedParent(isExpanded ? null : parent.id); } else if (parentAvail) { onAdd(parent.slug); setOpen(false); setSearch(''); } }, children: [ parent.icon ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components_CategoryIcon__WEBPACK_IMPORTED_MODULE_7__/* .CategoryIcon */ .Ez, { icon: parent.icon, alt: parentLabel, className: "h-5 w-5 shrink-0 object-contain text-sm leading-none", fallback: "\uD83D\uDCE6" }) : null, /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "flex-1 font-medium", children: parentLabel }), hasChildren && !search ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3.5 h-3.5 text-gray-400 shrink-0 transition-transform ".concat(isExpanded ? 'rotate-90' : ''), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 5l7 7-7 7" }) }) : null ] }), (isExpanded || !!search) && matchingChildren.map((child)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: ()=>{ onAdd(child.slug); setOpen(false); setSearch(''); }, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "w-1.5 h-1.5 rounded-full bg-gray-300 shrink-0" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "flex-1", children: getCatLabel(child, locale) }) ] }, child.id)) ] }, parent.id); }) ] }) ] }); } function AdminLocPicker(param) { let { locRows, locale, selected, onAdd, addLabel } = param; const [open, setOpen] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [search, setSearch] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [expandedCity, setExpandedCity] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const ref = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ function h(e) { if (ref.current && !ref.current.contains(e.target)) { setOpen(false); setSearch(''); } } document.addEventListener('mousedown', h); return ()=>document.removeEventListener('mousedown', h); }, []); const cities = locRows.filter((r)=>!r.parentId); const lowerSearch = search.toLowerCase(); const matchesSearch = (r)=>{ var _r_slug; return !search || getLocLabel(r, locale).toLowerCase().includes(lowerSearch) || ((_r_slug = r.slug) !== null && _r_slug !== void 0 ? _r_slug : '').toLowerCase().includes(lowerSearch); }; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "relative", ref: ref, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { type: "button", onClick: ()=>setOpen((v)=>!v), className: "w-full flex items-center gap-1.5 px-3 py-1.5 text-xs transition-colors ".concat(open ? '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: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 11a3 3 0 11-6 0 3 3 0 016 0z" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "flex-1 text-left truncate", children: addLabel }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3 h-3 text-gray-400 shrink-0 transition-transform ".concat(open ? 'rotate-180' : ''), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19 9l-7 7-7-7" }) }) ] }), open && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "sticky top-0 bg-white px-3 py-2 border-b border-gray-100", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { autoFocus: true, value: search, onChange: (e)=>setSearch(e.target.value), placeholder: "ППОск...", className: "w-full text-xs border border-gray-200 rounded-lg px-2.5 py-1.5 focus:outline-none focus:ring-2 focus:ring-blue-300" }) }), cities.map((city)=>{ const districts = locRows.filter((r)=>r.parentId === city.id); const cityLabel = getLocLabel(city, locale); const isExpanded = expandedCity === city.id; const hasDistricts = districts.length > 0; const matchingDistricts = districts.filter((d)=>!selected.includes(d.slug) && matchesSearch(d)); const cityAvail = !selected.includes(city.slug) && matchesSearch(city); if (!cityAvail && matchingDistricts.length === 0 && search) return null; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: ()=>{ if (hasDistricts && !search) { setExpandedCity(isExpanded ? null : city.id); } else if (cityAvail) { onAdd(city.slug); setOpen(false); setSearch(''); } }, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3 h-3 text-gray-300 shrink-0", fill: "currentColor", viewBox: "0 0 24 24", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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" }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "flex-1 font-medium", children: cityLabel }), hasDistricts && !search ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3.5 h-3.5 text-gray-400 shrink-0 transition-transform ".concat(isExpanded ? 'rotate-90' : ''), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 5l7 7-7 7" }) }) : null ] }), (isExpanded || !!search) && matchingDistricts.map((d)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: ()=>{ onAdd(d.slug); setOpen(false); setSearch(''); }, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "w-1.5 h-1.5 rounded-full bg-gray-300 shrink-0" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "flex-1", children: getLocLabel(d, locale) }) ] }, d.id)) ] }, city.id); }) ] }) ] }); } function AdminPage() { var _session_user, _stats_tokensByMonth; const router = (0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)(); const { data: session, isPending } = (0,_lib_auth__WEBPACK_IMPORTED_MODULE_4__/* .useSession */ .wV)(); const { t, locale } = (0,_context_locale__WEBPACK_IMPORTED_MODULE_5__/* .useLocale */ .Y)(); const [tab, setTab] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)('stats'); const [sidebarCollapsed, setSidebarCollapsed] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ setSidebarCollapsed(window.innerWidth < 1024); }, []); // Stats const [stats, setStats] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); // Users const [users, setUsers] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [usersPage, setUsersPage] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(1); const [usersTotal, setUsersTotal] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(0); const [usersQ, setUsersQ] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [usersQInput, setUsersQInput] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [usersRole, setUsersRole] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); // Tasks const [tasks, setTasks] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [tasksPage, setTasksPage] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(1); const [tasksTotal, setTasksTotal] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(0); const [tasksQ, setTasksQ] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [tasksQInput, setTasksQInput] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [tasksStatus, setTasksStatus] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); // Reports const [reports, setReports] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [reportsPage, setReportsPage] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(1); const [reportsTotal, setReportsTotal] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(0); const [pendingReportsCount, setPendingReportsCount] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(0); // Specialist card moderation const [moderationCards, setModerationCards] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [moderationCardsPage, setModerationCardsPage] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(1); const [moderationCardsTotal, setModerationCardsTotal] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(0); const [moderationCardsLoading, setModerationCardsLoading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [pendingCardsCount, setPendingCardsCount] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(0); // Support tickets const [supportTickets, setSupportTickets] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [supportPage, setSupportPage] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(1); const [supportTotal, setSupportTotal] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(0); const [supportStatus, setSupportStatus] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [supportType, setSupportType] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [supportQ, setSupportQ] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [supportQInput, setSupportQInput] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [supportReplyId, setSupportReplyId] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [supportReplyText, setSupportReplyText] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [supportReplySaving, setSupportReplySaving] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); // AI Logs const [logs, setLogs] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [logsPage, setLogsPage] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(1); const [logsTotal, setLogsTotal] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(0); // Activity Logs const [activityLog, setActivityLog] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [activityTotal, setActivityTotal] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(0); const [activityPage, setActivityPage] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(1); const [activityEvent, setActivityEvent] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [activityUserId, setActivityUserId] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [activityDateFrom, setActivityDateFrom] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [activityDateTo, setActivityDateTo] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [activityEventTypes, setActivityEventTypes] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); // Mail Logs const [mailLog, setMailLog] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [mailTotal, setMailTotal] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(0); const [mailPage, setMailPage] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(1); const [mailEvent, setMailEvent] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [mailDateFrom, setMailDateFrom] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [mailDateTo, setMailDateTo] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [mailEventTypes, setMailEventTypes] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); // Logs sub-tab const [logsSubTab, setLogsSubTab] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)('ai'); // Notification Logs const [notifLogs, setNotifLogs] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [notifLogsPage, setNotifLogsPage] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(1); const [notifLogsTotal, setNotifLogsTotal] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(0); const [notifLogsType, setNotifLogsType] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [notifLogsTypes, setNotifLogsTypes] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [notifLogsDateFrom, setNotifLogsDateFrom] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [notifLogsDateTo, setNotifLogsDateTo] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); // Notification stats chart const [notifsByDay, setNotifsByDay] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [mailByDay, setMailByDay] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); // Balance archive const [balanceRows, setBalanceRows] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [balanceTotal, setBalanceTotal] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(0); const [balancePage, setBalancePage] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(1); const [balanceUserId, setBalanceUserId] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [balanceKind, setBalanceKind] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [topUpSaving, setTopUpSaving] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [withdrawSaving, setWithdrawSaving] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); // User edit modal const [editUser, setEditUser] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [editUserSaving, setEditUserSaving] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [verifyingEmail, setVerifyingEmail] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [editUserTab, setEditUserTab] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)('profile'); const [balanceModal, setBalanceModal] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [skillInput, setSkillInput] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [editUserCards, setEditUserCards] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [editUserCardsLoading, setEditUserCardsLoading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [cardSkillInputs, setCardSkillInputs] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)({}); const [cardSaving, setCardSaving] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)({}); const [cardCatSelects, setCardCatSelects] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)({}); const [cardLocSelects, setCardLocSelects] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)({}); // Plans const [planRows, setPlanRows] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [planForm, setPlanForm] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [planSaving, setPlanSaving] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); // Locations const [locRows, setLocRows] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [locForm, setLocForm] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [locSaving, setLocSaving] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [locExpanded, setLocExpanded] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(new Set()); // Categories const [catRows, setCatRows] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [catForm, setCatForm] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [catSaving, setCatSaving] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [catExpanded, setCatExpanded] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(new Set()); const [catIconUploading, setCatIconUploading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [catIconError, setCatIconError] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [categoryIconPresets, setCategoryIconPresets] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(DEFAULT_CATEGORY_ICON_PRESETS); // Category Skills const [catSkillsExpanded, setCatSkillsExpanded] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(new Set()); const [catSkillsCache, setCatSkillsCache] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)({}); const [catSkillsLoading, setCatSkillsLoading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(new Set()); const [skillForm, setSkillForm] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [skillSaving, setSkillSaving] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); // Settings const [settingsTab, setSettingsTab] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)('general'); const [generalForm, setGeneralForm] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)({ siteName: 'CanHelp', siteUrl: '', contactEmail: '', supportPhone: '' }); const [generalSaving, setGeneralSaving] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [generalSaved, setGeneralSaved] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [smtpForm, setSmtpForm] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)({ host: '', port: '587', username: '', password: '', fromName: 'CanHelp', fromEmail: '', encryption: 'tls' }); const [smtpSaving, setSmtpSaving] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [smtpSaved, setSmtpSaved] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [testEmailSending, setTestEmailSending] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [testEmailResult, setTestEmailResult] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [notifTemplates, setNotifTemplates] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)({ email_verification: { subject: 'ППЎтверЎОте ваш email — {{siteName}}', body: '' }, registration_success: { subject: 'ДПбрП пПжалПвать в {{siteName}}!', body: '' }, password_reset: { subject: 'ВПсстаМПвлеМОе парПля — {{siteName}}', body: '' }, new_offer: { subject: 'НПвПе преЎлПжеМОе пП вашей заЎаче «{{taskTitle}}»', body: '' }, new_task: { subject: 'НПвая заЎача: {{taskTitle}}', body: '' }, offer_accepted: { subject: 'Ваше преЎлПжеМОе прОМятП: {{taskTitle}}', body: '

Ваше преЎлПжеМОе прОМятП! 🎉

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

ЗаказчОк прОМял ваше преЎлПжеМОе Ма выпПлМеМОе заЎачО:

{{taskTitle}}

СуЌЌа: {{price}}€

Открыть чат →' }, new_message: { subject: 'НПвПе сППбщеМОе Пт {{senderName}}', body: '

НПвПе сППбщеМОе

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

ВаЌ МапОсал(а) {{senderName}}:

"{{preview}}"

ОтветОть →' }, offer_declined: { subject: 'Ваше преЎлПжеМОе ПтклПМеМП: {{taskTitle}}', body: '

Ваше преЎлПжеМОе ПтклПМеМП

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

К сПжалеМОю, заказчОк ПтклПМОл ваше преЎлПжеМОе Ма:

{{taskTitle}}

НайтО ЎругОе заказы →' }, offer_other_accepted: { subject: 'ВыбраМ ЎругПй ОспПлМОтель: {{taskTitle}}', body: '

ВыбраМ ЎругПй ОспПлМОтель

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

ЗаказчОк выбрал ЎругПгП ОспПлМОтеля Ўля заЎаМОя:

{{taskTitle}}

НайтО ЎругОе заказы →' }, task_updated: { subject: 'ЗаЎаМОе ПбМПвлеМП: {{taskTitle}}', body: '

ЗаЎаМОе ПбМПвлеМП

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

ЗаказчОк ПбМПвОл ЎеталО заЎаМОя:

{{taskTitle}}

СЌПтреть заказ →' }, deadline_reminder: { subject: 'ЗаЎаМОе Остекает завтра: {{taskTitle}}', body: '

НапПЌОМаМОе П ЎеЎлайМе

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

Ваше заЎаМОе Остекает через 24 часа. ОбМПвОте ЎеЎлайМ, ОМаче заЎаМОе буЎет автПЌатОческО сМятП с публОкацОО.

{{taskTitle}}

РеЎактОрПвать заЎаМОе →' }, task_archived: { subject: 'ЗаЎаМОе сМятП с публОкацОО: {{taskTitle}}', body: '

ЗаЎаМОе перевеЎеМП в черМПвОк

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

Ваше заЎаМОе ОстеклП О былП автПЌатОческО перевеЎеМП в черМПвОк. ОбМПвОте ЎеЎлайМ, чтПбы ПпублОкПвать егП сМПва.

{{taskTitle}}

РеЎактОрПвать заЎаМОе →' }, referral_reward: { subject: 'Вы пПлучОлО реферальМую МаграЎу — {{siteName}}', body: '

Вы пПлучОлО реферальМую МаграЎу! 🎁

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

Друг зарегОстрОрПвался пП вашей реферальМПй ссылке. На ваш аккауМт ЎПбавлеМП {{days}} ЎМей ЎПступа к плаМу {{planName}}!

+{{days}} ЎМей — {{planName}}

ПерейтО к аккауМту →' }, referral_reward_el: { subject: 'Λάβατε αΜταΌοιβή παραποΌπής — {{siteName}}', body: '

Λάβατε αΜταΌοιβή παραποΌπής! 🎁

Γεια {{userName}},

ΈΜας φίλος εγγράφηκε χρησιΌοποιώΜτας τοΜ σύΜΎεσΌο παραποΌπής σας. ΣτοΜ λογαριασΌό σας προστέΞηκαΜ {{days}} ηΌέρες πρόσβασης στο πλάΜο {{planName}}!

+{{days}} ηΌέρες — {{planName}}

Δες τοΜ λογαριασΌό σου →' }, referral_reward_en: { subject: 'You received a referral reward — {{siteName}}', body: '

You received a referral reward! 🎁

Hi {{userName}},

A friend registered using your referral link. {{days}} days of {{planName}} access have been added to your account!

+{{days}} days — {{planName}}

View your account →' }, referral_reward_ru: { subject: 'Вы пПлучОлО реферальМую МаграЎу — {{siteName}}', body: '

Вы пПлучОлО реферальМую МаграЎу! 🎁

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

Друг зарегОстрОрПвался пП вашей реферальМПй ссылке. На ваш аккауМт ЎПбавлеМП {{days}} ЎМей ЎПступа к плаМу {{planName}}!

+{{days}} ЎМей — {{planName}}

ПерейтО к аккауМту →' } }); const [editingTemplate, setEditingTemplate] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [templateLocale, setTemplateLocale] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)('el'); const [templateSaving, setTemplateSaving] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [templateTranslating, setTemplateTranslating] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [ePayForm, setEPayForm] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)({ merchantId: '', apiUser: '', apiPassword: '', environment: 'test', confirmationUrl: '', cancelUrl: '', enabled: false }); const [ePaySaving, setEPaySaving] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [ePaySaved, setEPaySaved] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [referralForm, setReferralForm] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)({ enabled: false, planId: '', days: '30' }); const [referralSaving, setReferralSaving] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [referralSaved, setReferralSaved] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [seoForm, setSeoForm] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)({ maintenanceMode: false, indexingEnabled: true, headScripts: '', siteTitleEl: '', siteTitleEn: '', siteTitleRu: '', siteTitleUk: '', siteDescriptionEl: '', siteDescriptionEn: '', siteDescriptionRu: '', siteDescriptionUk: '' }); const [seoSaving, setSeoSaving] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [seoSaved, setSeoSaved] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [seoLangTab, setSeoLangTab] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)('el'); const [socialForm, setSocialForm] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)({ telegram: '', instagram: '', facebook: '', twitter: '', youtube: '', tiktok: '', whatsapp: '', viber: '' }); const [socialSaving, setSocialSaving] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [socialSaved, setSocialSaved] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [telegramForm, setTelegramForm] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)({ botToken: '', adminChatId: '', channelIdEl: '', channelIdEn: '', channelIdRu: '', channelIdUk: '', notifyRegistrations: false, postNewTasks: false }); const [telegramSaving, setTelegramSaving] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [telegramSaved, setTelegramSaved] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [testingTelegramAdmin, setTestingTelegramAdmin] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [testingTelegramChannel, setTestingTelegramChannel] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [testResultTelegramAdmin, setTestResultTelegramAdmin] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [testResultTelegramChannel, setTestResultTelegramChannel] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [testingLocale, setTestingLocale] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [testResultChannels, setTestResultChannels] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)({}); const [verifyingTelegramToken, setVerifyingTelegramToken] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [verifyResultTelegramToken, setVerifyResultTelegramToken] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); // Backup const [backupAutoEnabled, setBackupAutoEnabled] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [backupAutoSaving, setBackupAutoSaving] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [backupTables, setBackupTables] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [backupTablesLoading, setBackupTablesLoading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [backupStoredFiles, setBackupStoredFiles] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [backupExporting, setBackupExporting] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [backupImporting, setBackupImporting] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [backupRestoring, setBackupRestoring] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [backupMsg, setBackupMsg] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [backupMsgError, setBackupMsgError] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const setBackupSuccess = (msg)=>{ setBackupMsg(msg); setBackupMsgError(false); }; const setBackupError = (msg)=>{ setBackupMsg(msg); setBackupMsgError(true); }; // ─── Translations state ─────────────────────────────────────────────────── const [transStats, setTransStats] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [transStatsLoading, setTransStatsLoading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [transLang, setTransLang] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)('uk'); const [transFromLang, setTransFromLang] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)('el'); const [transTableTranslating, setTransTableTranslating] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)({}); const [transMsg, setTransMsg] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [transPreview, setTransPreview] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); // ─── Referrals state ───────────────────────────────────────────────────── const [referralsData, setReferralsData] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [referralsLoading, setReferralsLoading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [referralsExpanded, setReferralsExpanded] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(new Set()); // ─── Push state ────────────────────────────────────────────────────────── const [pushMode, setPushMode] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)('broadcast'); const [pushTargetUserId, setPushTargetUserId] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [pushTitle, setPushTitle] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [pushBody, setPushBody] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [pushType, setPushType] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)('general'); const [pushReferenceId, setPushReferenceId] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [pushOnlyActive, setPushOnlyActive] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(true); const [pushSending, setPushSending] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [pushResult, setPushResult] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [pushError, setPushError] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [loading, setLoading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const isAdmin = !isPending && session && ((_session_user = session.user) === null || _session_user === void 0 ? void 0 : _session_user.role) === 'admin'; (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ var _session_user; if (!isPending && !session) router.push('/login'); if (!isPending && session && ((_session_user = session.user) === null || _session_user === void 0 ? void 0 : _session_user.role) !== 'admin') router.push('/'); }, [ session, isPending ]); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!isAdmin) return; _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminStats */ .dE().then(setStats).catch(()=>{}); _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminNotifStats */ .bi().then(setNotifsByDay).catch(()=>{}); _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminMailStats */ .u4().then(setMailByDay).catch(()=>{}); _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminReports */ .z5(1, 'pending').then((d)=>setPendingReportsCount(d.total)).catch(()=>{}); _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminSpecialistCards */ .s_(1, 'pending').then((d)=>setPendingCardsCount(d.total)).catch(()=>{}); }, [ isAdmin ]); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!isAdmin || tab !== 'users') return; setLoading(true); _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminUsers */ .cS(usersPage, usersQ || undefined, usersRole || undefined).then((d)=>{ setUsers(d.data); setUsersTotal(d.total); }).catch(()=>{}).finally(()=>setLoading(false)); }, [ isAdmin, tab, usersPage, usersQ, usersRole ]); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!isAdmin || tab !== 'tasks') return; setLoading(true); _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminTasks */ .Yj(tasksPage, tasksQ || undefined, tasksStatus || undefined).then((d)=>{ setTasks(d.data); setTasksTotal(d.total); }).catch(()=>{}).finally(()=>setLoading(false)); }, [ isAdmin, tab, tasksPage, tasksQ, tasksStatus ]); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!isAdmin || tab !== 'reports') return; setLoading(true); _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminReports */ .z5(reportsPage).then((d)=>{ setReports(d.data); setReportsTotal(d.total); }).catch(()=>{}).finally(()=>setLoading(false)); }, [ isAdmin, tab, reportsPage ]); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!isAdmin || tab !== 'moderation') return; setModerationCardsLoading(true); _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminSpecialistCards */ .s_(moderationCardsPage, 'review').then((d)=>{ setModerationCards(d.data); setModerationCardsTotal(d.total); }).catch(()=>{}).finally(()=>setModerationCardsLoading(false)); }, [ isAdmin, tab, moderationCardsPage ]); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!isAdmin || tab !== 'support') return; setLoading(true); const params = { page: String(supportPage), limit: '30' }; if (supportStatus) params.status = supportStatus; if (supportType) params.type = supportType; if (supportQ) params.q = supportQ; _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminSupportTickets */ .KZ(params).then((d)=>{ setSupportTickets(d.data); setSupportTotal(d.total); }).catch(()=>{}).finally(()=>setLoading(false)); }, [ isAdmin, tab, supportPage, supportStatus, supportType, supportQ ]); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!isAdmin || tab !== 'balances') return; setLoading(true); _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminBalanceHistory */ .g0({ page: balancePage, userId: balanceUserId || undefined, kind: balanceKind || undefined }).then((d)=>{ setBalanceRows(d.data); setBalanceTotal(d.total); }).catch(()=>{}).finally(()=>setLoading(false)); }, [ isAdmin, tab, balancePage, balanceUserId, balanceKind ]); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!isAdmin || tab !== 'logs') return; if (logsSubTab === 'ai') { setLoading(true); _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminAiLogs */ .j_(logsPage).then((d)=>{ setLogs(d.data); setLogsTotal(d.total); }).catch(()=>{}).finally(()=>setLoading(false)); } else if (logsSubTab === 'activity') { _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminActivityLogs */ .yO({ page: activityPage, event: activityEvent || undefined, userId: activityUserId || undefined, dateFrom: activityDateFrom || undefined, dateTo: activityDateTo || undefined }).then((d)=>{ var _d_eventTypes; setActivityLog(d.data); setActivityTotal(d.total); if ((_d_eventTypes = d.eventTypes) === null || _d_eventTypes === void 0 ? void 0 : _d_eventTypes.length) setActivityEventTypes(d.eventTypes); }).catch(()=>{}); } else if (logsSubTab === 'mail') { _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminMailLogs */ .qt({ page: mailPage, event: mailEvent || undefined, dateFrom: mailDateFrom || undefined, dateTo: mailDateTo || undefined }).then((d)=>{ var _d_eventTypes; setMailLog(d.data); setMailTotal(d.total); if ((_d_eventTypes = d.eventTypes) === null || _d_eventTypes === void 0 ? void 0 : _d_eventTypes.length) setMailEventTypes(d.eventTypes); }).catch(()=>{}); } else if (logsSubTab === 'notifications') { _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminNotifLogs */ .Br({ page: notifLogsPage, type: notifLogsType || undefined, dateFrom: notifLogsDateFrom || undefined, dateTo: notifLogsDateTo || undefined }).then((d)=>{ var _d_notifTypes; setNotifLogs(d.data); setNotifLogsTotal(d.total); if ((_d_notifTypes = d.notifTypes) === null || _d_notifTypes === void 0 ? void 0 : _d_notifTypes.length) setNotifLogsTypes(d.notifTypes); }).catch(()=>{}); } }, [ isAdmin, tab, logsSubTab, logsPage, activityPage, activityEvent, activityUserId, activityDateFrom, activityDateTo, mailPage, mailEvent, mailDateFrom, mailDateTo, notifLogsPage, notifLogsType, notifLogsDateFrom, notifLogsDateTo ]); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ setActivityPage(1); }, [ activityEvent, activityUserId, activityDateFrom, activityDateTo ]); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ setMailPage(1); }, [ mailEvent, mailDateFrom, mailDateTo ]); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ setNotifLogsPage(1); }, [ notifLogsType, notifLogsDateFrom, notifLogsDateTo ]); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!isAdmin || tab !== 'plans') return; _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminPlans */ .OX().then(setPlanRows).catch(()=>{}); }, [ isAdmin, tab ]); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!isAdmin || tab !== 'translations') return; setTransStatsLoading(true); _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getTranslationsStats */ .YQ().then((d)=>setTransStats(d.tables)).catch(()=>{}).finally(()=>setTransStatsLoading(false)); }, [ isAdmin, tab ]); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!isAdmin || tab !== 'backup') return; (0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .request */ .Em)('/admin/backup/settings').then((d)=>setBackupAutoEnabled(!!d.autoEnabled)).catch(()=>{}); setBackupTablesLoading(true); (0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .request */ .Em)('/admin/backup/tables').then((d)=>setBackupTables(d.tables || [])).catch(()=>{}).finally(()=>setBackupTablesLoading(false)); (0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .request */ .Em)('/admin/backup/list').then((d)=>setBackupStoredFiles(d.files || [])).catch(()=>{}); }, [ isAdmin, tab ]); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!isAdmin || tab !== 'referrals') return; setReferralsLoading(true); _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminReferrals */ .cJ().then((d)=>setReferralsData(d)).catch(()=>{}).finally(()=>setReferralsLoading(false)); }, [ isAdmin, tab ]); // Load plans when users tab opens (for plan selector in edit modal) (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!isAdmin || tab !== 'users') return; if (planRows.length === 0) _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminPlans */ .OX().then(setPlanRows).catch(()=>{}); }, [ isAdmin, tab ]); // Reset page when filters change (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ setUsersPage(1); }, [ usersQ, usersRole ]); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ setTasksPage(1); }, [ tasksQ, tasksStatus ]); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ setBalancePage(1); }, [ balanceUserId, balanceKind ]); async function sendAdminPush() { if (!pushTitle.trim()) return; if (pushMode === 'user' && !pushTargetUserId.trim()) { setPushError('УкажОте ID пПльзПвателя'); return; } setPushSending(true); setPushError(null); setPushResult(null); try { const payload = { title: pushTitle.trim(), body: pushBody.trim() || undefined, type: pushType.trim() || undefined, referenceId: pushReferenceId.trim() || undefined }; if (pushMode === 'broadcast') { const res = await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .adminBroadcastPush */ .V7({ ...payload, onlyActive: pushOnlyActive }); setPushResult(res); } else { const res = await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .adminSendPushToUser */ .g1(pushTargetUserId.trim(), payload); setPushResult(res); } } catch (err) { setPushError((err === null || err === void 0 ? void 0 : err.message) || 'Не уЎалПсь ПтправОть push'); } finally{ setPushSending(false); } } async function toggleUser(id, isActive) { const fn = isActive ? _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .deactivateUser */ .Wi : _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .activateUser */ .He; const updated = await fn(id).catch(()=>null); if (updated) setUsers((prev)=>prev.map((u)=>u.id === id ? updated : u)); } async function changeRole(id, role) { const updated = await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .changeUserRole */ .Mm(id, role).catch(()=>null); if (updated) setUsers((prev)=>prev.map((u)=>u.id === id ? updated : u)); } function openEditUser(u) { setEditUserTab('profile'); setSkillInput(''); setBalanceModal(null); setEditUserCards([]); setCardSkillInputs({}); setCardSaving({}); setCardCatSelects({}); setCardLocSelects({}); setEditUser({ ...u, topUpAmount: '', topUpDescription: '', withdrawAmount: '', withdrawDescription: '' }); _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminUser */ .jd(u.id).then((fresh)=>setEditUser((prev)=>prev && prev.id === fresh.id ? { ...fresh, topUpAmount: '', topUpDescription: '', withdrawAmount: '', withdrawDescription: '' } : prev)).catch(()=>{}); } function describeFcmFailure(key, message) { if (!key) return message || 'FCM прОМял 0 сППбщеМОй'; if (key === 'THIRD_PARTY_AUTH_ERROR') { return 'ОшОбка APNs/Firebase iOS: прПверьте Apple APNs Auth Key (.p8) О связку Firebase прПекта Ўля iOS-прОлПжеМОя'; } if (key === 'UNREGISTERED') { return 'ТПкеМ устрПйства бПльше Ме валОЎеМ'; } if (key === 'INVALID_ARGUMENT') { return 'НекПрректМый тПкеМ ОлО payload'; } if (key === 'REQUEST_FAILED') { return message || 'FCM request failed before response'; } return message ? "".concat(key, ": ").concat(message) : key; } async function saveEditUser() { if (!editUser) return; setEditUserSaving(true); try { var _editUser_languages, _editUser_showContactInfo, _editUser_notifyNewTasks, _editUser_notifMessages, _editUser_skills, _editUser_siteSettings; const updated = await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updateAdminUser */ .wl(editUser.id, { firstName: editUser.firstName, lastName: editUser.lastName, phone: editUser.phone || null, bio: editUser.bio || null, role: editUser.role, planId: editUser.planId || null, isActive: editUser.isActive, locale: editUser.locale, languages: (_editUser_languages = editUser.languages) !== null && _editUser_languages !== void 0 ? _editUser_languages : [], personalSiteSlug: editUser.personalSiteSlug || null, showContactInfo: (_editUser_showContactInfo = editUser.showContactInfo) !== null && _editUser_showContactInfo !== void 0 ? _editUser_showContactInfo : false, notifyNewTasks: (_editUser_notifyNewTasks = editUser.notifyNewTasks) !== null && _editUser_notifyNewTasks !== void 0 ? _editUser_notifyNewTasks : false, notifMessages: (_editUser_notifMessages = editUser.notifMessages) !== null && _editUser_notifMessages !== void 0 ? _editUser_notifMessages : true, skills: (_editUser_skills = editUser.skills) !== null && _editUser_skills !== void 0 ? _editUser_skills : [], siteSettings: (_editUser_siteSettings = editUser.siteSettings) !== null && _editUser_siteSettings !== void 0 ? _editUser_siteSettings : {} }); await Promise.all(editUserCards.map((card)=>{ var _card_skills, _card_categories, _card_locations; return _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .adminUpdateSpecialistCard */ .oq(card.id, { title: card.title, description: card.description || null, skills: (_card_skills = card.skills) !== null && _card_skills !== void 0 ? _card_skills : [], categories: (_card_categories = card.categories) !== null && _card_categories !== void 0 ? _card_categories : [], locations: (_card_locations = card.locations) !== null && _card_locations !== void 0 ? _card_locations : [], publicationStatus: card.publicationStatus, isActive: card.isActive }).catch(()=>null); })); setUsers((prev)=>prev.map((u)=>u.id === editUser.id ? updated : u)); setEditUser(null); } catch (e) {} finally{ setEditUserSaving(false); } } async function verifyEmail() { if (!editUser) return; setVerifyingEmail(true); try { const updated = await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .verifyAdminUserEmail */ .uQ(editUser.id); setEditUser((u)=>u ? { ...u, emailVerified: updated.emailVerified } : u); setUsers((prev)=>prev.map((u)=>u.id === editUser.id ? { ...u, emailVerified: updated.emailVerified } : u)); } catch (e) {} finally{ setVerifyingEmail(false); } } async function handleAdminTopUp() { if (!editUser) return; const amount = Number(editUser.topUpAmount); if (!amount || amount <= 0) return; setTopUpSaving(true); try { const result = await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .adminTopUpUserBalance */ .P0(editUser.id, { amount, description: editUser.topUpDescription || undefined }); setUsers((prev)=>prev.map((u)=>u.id === editUser.id ? result.user : u)); setEditUser((prev)=>prev ? { ...prev, ...result.user, topUpAmount: '', topUpDescription: '' } : prev); if (tab === 'balances') { _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminBalanceHistory */ .g0({ page: balancePage, userId: balanceUserId || undefined, kind: balanceKind || undefined }).then((d)=>{ setBalanceRows(d.data); setBalanceTotal(d.total); }).catch(()=>{}); } } catch (e) { // ignore } finally{ setTopUpSaving(false); } } async function handleAdminWithdraw() { if (!editUser) return; const amount = Number(editUser.withdrawAmount); if (!amount || amount <= 0) return; setWithdrawSaving(true); try { const result = await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .adminWithdrawUserBalance */ .hD(editUser.id, { amount, description: editUser.withdrawDescription || undefined }); setUsers((prev)=>prev.map((u)=>u.id === editUser.id ? result.user : u)); setEditUser((prev)=>prev ? { ...prev, ...result.user, withdrawAmount: '', withdrawDescription: '' } : prev); if (tab === 'balances') { _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminBalanceHistory */ .g0({ page: balancePage, userId: balanceUserId || undefined, kind: balanceKind || undefined }).then((d)=>{ setBalanceRows(d.data); setBalanceTotal(d.total); }).catch(()=>{}); } } catch (e) { // ignore } finally{ setWithdrawSaving(false); } } async function saveCard(cardId) { const card = editUserCards.find((c)=>c.id === cardId); if (!card) return; setCardSaving((prev)=>({ ...prev, [cardId]: true })); try { var _card_skills, _card_categories, _card_locations; const updated = await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .adminUpdateSpecialistCard */ .oq(cardId, { title: card.title, description: card.description || null, skills: (_card_skills = card.skills) !== null && _card_skills !== void 0 ? _card_skills : [], categories: (_card_categories = card.categories) !== null && _card_categories !== void 0 ? _card_categories : [], locations: (_card_locations = card.locations) !== null && _card_locations !== void 0 ? _card_locations : [], publicationStatus: card.publicationStatus, isActive: card.isActive }); setEditUserCards((prev)=>prev.map((c)=>c.id === cardId ? updated : c)); } catch (e) {} finally{ setCardSaving((prev)=>({ ...prev, [cardId]: false })); } } async function updateModerationCard(cardId, publicationStatus) { const updated = await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .adminUpdateSpecialistCard */ .oq(cardId, { publicationStatus, isActive: publicationStatus === 'active' }).catch(()=>null); if (!updated) return; setModerationCards((prev)=>prev.map((card)=>card.id === cardId ? updated : card)); if ((editUser === null || editUser === void 0 ? void 0 : editUser.id) === updated.specialistId) { setEditUserCards((prev)=>prev.map((card)=>card.id === cardId ? updated : card)); } _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminReports */ .z5(1, 'pending').then((d)=>setPendingReportsCount(d.total)).catch(()=>{}); _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminSpecialistCards */ .s_(1, 'pending').then((d)=>setPendingCardsCount(d.total)).catch(()=>{}); } async function cancelTask(id) { const updated = await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .cancelTaskAdmin */ .nf(id).catch(()=>null); if (updated) { const task = updated.task || updated; setTasks((prev)=>prev.map((row)=>{ const t = row.task || row; return t.id === id ? { ...row, task: task } : row; })); } } async function deleteTask(id, title) { if (!window.confirm("".concat(t('admin.tasks.delete.confirm'), '\n"').concat(title, '"'))) return; const ok = await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .deleteTaskAdmin */ .GB(id).catch(()=>null); if (ok) setTasks((prev)=>prev.filter((row)=>{ var _row_task; return (((_row_task = row.task) === null || _row_task === void 0 ? void 0 : _row_task.id) || row.id) !== id; })); } async function handleReport(id, status) { const updated = await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updateReportStatus */ .eU(id, status).catch(()=>null); if (updated) setReports((prev)=>prev.map((r)=>r.id === id ? { ...r, ...updated } : r)); } // Locations (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!isAdmin || tab !== 'locations') return; _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminLocations */ .k_().then(setLocRows).catch(()=>{}); }, [ isAdmin, tab ]); function openAddLoc(parentId) { setLocForm({ parentId: parentId !== null && parentId !== void 0 ? parentId : null, slug: '', nameEl: '', nameEn: '', nameRu: '', nameUk: '', order: 0, isActive: true }); } function openEditLoc(loc) { var _loc_names, _loc_names1, _loc_names2, _loc_names3; var _loc_parentId, _loc_nameEl, _ref, _loc_nameEn, _ref1, _loc_nameRu, _ref2, _loc_nameUk, _ref3, _loc_order, _loc_isActive; setLocForm({ id: loc.id, parentId: (_loc_parentId = loc.parentId) !== null && _loc_parentId !== void 0 ? _loc_parentId : null, slug: loc.slug, nameEl: (_ref = (_loc_nameEl = loc.nameEl) !== null && _loc_nameEl !== void 0 ? _loc_nameEl : (_loc_names = loc.names) === null || _loc_names === void 0 ? void 0 : _loc_names.el) !== null && _ref !== void 0 ? _ref : '', nameEn: (_ref1 = (_loc_nameEn = loc.nameEn) !== null && _loc_nameEn !== void 0 ? _loc_nameEn : (_loc_names1 = loc.names) === null || _loc_names1 === void 0 ? void 0 : _loc_names1.en) !== null && _ref1 !== void 0 ? _ref1 : '', nameRu: (_ref2 = (_loc_nameRu = loc.nameRu) !== null && _loc_nameRu !== void 0 ? _loc_nameRu : (_loc_names2 = loc.names) === null || _loc_names2 === void 0 ? void 0 : _loc_names2.ru) !== null && _ref2 !== void 0 ? _ref2 : '', nameUk: (_ref3 = (_loc_nameUk = loc.nameUk) !== null && _loc_nameUk !== void 0 ? _loc_nameUk : (_loc_names3 = loc.names) === null || _loc_names3 === void 0 ? void 0 : _loc_names3.uk) !== null && _ref3 !== void 0 ? _ref3 : '', order: (_loc_order = loc.order) !== null && _loc_order !== void 0 ? _loc_order : 0, isActive: (_loc_isActive = loc.isActive) !== null && _loc_isActive !== void 0 ? _loc_isActive : true }); } async function saveLoc() { if (!locForm) return; setLocSaving(true); try { if (locForm.id) { const updated = await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updateLocation */ .Nt(locForm.id, locForm); setLocRows((prev)=>prev.map((r)=>r.id === locForm.id ? updated : r)); } else { const created = await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .createLocation */ .yJ({ slug: locForm.slug, nameEl: locForm.nameEl, nameEn: locForm.nameEn, nameRu: locForm.nameRu, nameUk: locForm.nameUk, parentId: locForm.parentId, order: locForm.order }); setLocRows((prev)=>[ ...prev, created ]); } setLocForm(null); } catch (e) { // ignore } finally{ setLocSaving(false); } } async function deleteLoc(id, name) { if (!window.confirm("".concat(t('admin.loc.delete.confirm'), '\n"').concat(name, '"'))) return; const ok = await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .deleteLocation */ .zR(id).catch(()=>null); if (ok) setLocRows((prev)=>prev.filter((r)=>r.id !== id)); } function toggleLocExpand(id) { setLocExpanded((prev)=>{ const next = new Set(prev); next.has(id) ? next.delete(id) : next.add(id); return next; }); } // Categories (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!isAdmin || tab !== 'categories') return; _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminCategories */ .KD().then(setCatRows).catch(()=>{}); }, [ isAdmin, tab ]); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!isAdmin) return; fetch('/category-icons/presets.json').then((res)=>res.ok ? res.json() : Promise.reject(new Error('Failed to load presets'))).then((data)=>{ if (!Array.isArray(data)) return; const cleaned = data.filter((x)=>!!x && typeof x === 'object' && typeof x.value === 'string' && typeof x.label === 'string').filter((x)=>x.value.startsWith('/category-icons/')); if (cleaned.length > 0) setCategoryIconPresets(cleaned); }).catch(()=>{}); }, [ isAdmin ]); function openAddCat(parentId) { setCatIconError(null); setCatForm({ parentId: parentId !== null && parentId !== void 0 ? parentId : null, slug: '', icon: '/category-icons/package.svg', namesEl: '', namesEn: '', namesRu: '', namesUk: '', order: 0, isActive: true }); } function openEditCat(cat) { var _cat_names, _cat_names1, _cat_names2, _cat_names3; const selectedIcon = typeof cat.icon === 'string' ? cat.icon : ''; const knownPreset = new Set(categoryIconPresets.map((p)=>p.value)); const normalizedIcon = selectedIcon.startsWith('/category-icons/') && !knownPreset.has(selectedIcon) ? '/category-icons/package.svg' : selectedIcon || '/category-icons/package.svg'; setCatIconError(null); var _cat_parentId, _cat_namesEl, _ref, _cat_namesEn, _ref1, _cat_namesRu, _ref2, _cat_namesUk, _ref3, _cat_order, _cat_isActive; setCatForm({ id: cat.id, parentId: (_cat_parentId = cat.parentId) !== null && _cat_parentId !== void 0 ? _cat_parentId : null, slug: cat.slug, icon: normalizedIcon, namesEl: (_ref = (_cat_namesEl = cat.namesEl) !== null && _cat_namesEl !== void 0 ? _cat_namesEl : (_cat_names = cat.names) === null || _cat_names === void 0 ? void 0 : _cat_names.el) !== null && _ref !== void 0 ? _ref : '', namesEn: (_ref1 = (_cat_namesEn = cat.namesEn) !== null && _cat_namesEn !== void 0 ? _cat_namesEn : (_cat_names1 = cat.names) === null || _cat_names1 === void 0 ? void 0 : _cat_names1.en) !== null && _ref1 !== void 0 ? _ref1 : '', namesRu: (_ref2 = (_cat_namesRu = cat.namesRu) !== null && _cat_namesRu !== void 0 ? _cat_namesRu : (_cat_names2 = cat.names) === null || _cat_names2 === void 0 ? void 0 : _cat_names2.ru) !== null && _ref2 !== void 0 ? _ref2 : '', namesUk: (_ref3 = (_cat_namesUk = cat.namesUk) !== null && _cat_namesUk !== void 0 ? _cat_namesUk : (_cat_names3 = cat.names) === null || _cat_names3 === void 0 ? void 0 : _cat_names3.uk) !== null && _ref3 !== void 0 ? _ref3 : '', order: (_cat_order = cat.order) !== null && _cat_order !== void 0 ? _cat_order : 0, isActive: (_cat_isActive = cat.isActive) !== null && _cat_isActive !== void 0 ? _cat_isActive : true }); } async function uploadCategoryIcon(file) { if (file.type !== 'image/svg+xml') { setCatIconError('Only SVG files are allowed'); return; } setCatIconUploading(true); setCatIconError(null); try { const fd = new FormData(); fd.append('file', file); const base = "https://api.canhelp.gr" || 0; const res = await fetch("".concat(base, "/api/uploads"), { method: 'POST', credentials: 'include', body: fd }); if (!res.ok) { const err = await res.json().catch(()=>({ error: 'Upload failed' })); throw new Error(err.error || 'Upload failed'); } const data = await res.json(); setCatForm((f)=>f ? { ...f, icon: data.url } : f); } catch (err) { setCatIconError((err === null || err === void 0 ? void 0 : err.message) || 'Upload failed'); } finally{ setCatIconUploading(false); } } async function saveCat() { if (!catForm) return; setCatSaving(true); try { if (catForm.id) { const updated = await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updateCategory */ .$7(catForm.id, catForm); setCatRows((prev)=>prev.map((r)=>r.id === catForm.id ? updated : r)); } else { const created = await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .createCategory */ .zZ({ slug: catForm.slug, icon: catForm.icon, namesEl: catForm.namesEl, namesEn: catForm.namesEn, namesRu: catForm.namesRu, namesUk: catForm.namesUk, parentId: catForm.parentId, order: catForm.order }); setCatRows((prev)=>[ ...prev, created ]); } setCatForm(null); } catch (e) { // ignore } finally{ setCatSaving(false); } } async function deleteCat(id, name) { if (!window.confirm("".concat(t('admin.cat.delete.confirm'), '\n"').concat(name, '"'))) return; const ok = await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .deleteCategory */ .K7(id).catch(()=>null); if (ok) setCatRows((prev)=>prev.filter((r)=>r.id !== id)); } function toggleCatExpand(id) { setCatExpanded((prev)=>{ const next = new Set(prev); next.has(id) ? next.delete(id) : next.add(id); return next; }); } async function toggleCatSkills(cat) { const id = cat.id; const slug = cat.slug; setCatSkillsExpanded((prev)=>{ const next = new Set(prev); if (next.has(id)) { next.delete(id); return next; } next.add(id); return next; }); if (!catSkillsCache[slug]) { setCatSkillsLoading((prev)=>new Set(prev).add(id)); try { const skills = await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminSkills */ .i_(slug); setCatSkillsCache((prev)=>({ ...prev, [slug]: skills })); } catch (e) {} finally{ setCatSkillsLoading((prev)=>{ const n = new Set(prev); n.delete(id); return n; }); } } } function openAddSkill(catSlug) { setSkillForm({ catSlug, nameEl: '', nameEn: '', nameRu: '', nameUk: '', order: 0 }); } function openEditSkill(skill, catSlug) { var _skill_nameEl, _skill_nameEn, _skill_nameRu, _skill_nameUk, _skill_order; setSkillForm({ id: skill.id, catSlug, nameEl: (_skill_nameEl = skill.nameEl) !== null && _skill_nameEl !== void 0 ? _skill_nameEl : '', nameEn: (_skill_nameEn = skill.nameEn) !== null && _skill_nameEn !== void 0 ? _skill_nameEn : '', nameRu: (_skill_nameRu = skill.nameRu) !== null && _skill_nameRu !== void 0 ? _skill_nameRu : '', nameUk: (_skill_nameUk = skill.nameUk) !== null && _skill_nameUk !== void 0 ? _skill_nameUk : '', order: (_skill_order = skill.order) !== null && _skill_order !== void 0 ? _skill_order : 0 }); } async function saveSkill() { if (!skillForm) return; setSkillSaving(true); try { if (skillForm.id) { const updated = await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updateSkill */ .fP(skillForm.id, { nameEl: skillForm.nameEl, nameEn: skillForm.nameEn, nameRu: skillForm.nameRu, nameUk: skillForm.nameUk, order: skillForm.order }); setCatSkillsCache((prev)=>{ var _prev_skillForm_catSlug; return { ...prev, [skillForm.catSlug]: ((_prev_skillForm_catSlug = prev[skillForm.catSlug]) !== null && _prev_skillForm_catSlug !== void 0 ? _prev_skillForm_catSlug : []).map((s)=>s.id === skillForm.id ? updated : s) }; }); } else { const created = await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .createSkill */ .S9({ categorySlug: skillForm.catSlug, nameEl: skillForm.nameEl, nameEn: skillForm.nameEn, nameRu: skillForm.nameRu, nameUk: skillForm.nameUk, order: skillForm.order }); setCatSkillsCache((prev)=>{ var _prev_skillForm_catSlug; return { ...prev, [skillForm.catSlug]: [ ...(_prev_skillForm_catSlug = prev[skillForm.catSlug]) !== null && _prev_skillForm_catSlug !== void 0 ? _prev_skillForm_catSlug : [], created ] }; }); } setSkillForm(null); } catch (e) {} finally{ setSkillSaving(false); } } async function deleteSkill(skill, catSlug) { if (!skill._skipConfirm && !window.confirm('УЎалОть Мавык "'.concat(skill.nameEl, '"?'))) return; const ok = skill._skipConfirm ? true : await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .deleteSkill */ .hp(skill.id).catch(()=>null); if (ok) { setCatSkillsCache((prev)=>{ var _prev_catSlug; return { ...prev, [catSlug]: ((_prev_catSlug = prev[catSlug]) !== null && _prev_catSlug !== void 0 ? _prev_catSlug : []).filter((s)=>s.id !== skill.id) }; }); } } function openAddPlan() { setPlanForm({ 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: false, isActive: true, order: 0, notifyNewTasks: false, canContactFreePlan: false, canContactProPlan: true, canContactAll: false, canShowContactInfo: false, canViewPhone: false, canUploadVideo: false, hasFavorites: false, hasGoogleCalendar: false, hasVerifiedBadge: false, highlightedReviews: false, hasPersonalSite: false, hasCanHelpNowStatus: false, hasNeedHelpStatus: false, hasAutoResponse: false, hasAutoMatch: false, hasPriceList: false, receiveInstantDispatchFree: false, receiveInstantDispatchPro: false }); } function openEditPlan(plan) { var _plan_description, _plan_role, _plan_tier, _plan_price, _plan_oldPrice, _plan_currency, _plan_searchBoost, _plan_offersMultiplier, _plan_features, _plan_isDefault, _plan_isActive, _plan_order, _plan_notifyNewTasks, _plan_canContactFreePlan, _plan_canContactProPlan, _plan_canContactAll, _plan_canShowContactInfo, _plan_canViewPhone, _plan_canUploadVideo, _plan_hasFavorites, _plan_hasGoogleCalendar, _plan_hasVerifiedBadge, _plan_highlightedReviews, _plan_hasPersonalSite, _plan_hasCanHelpNowStatus, _plan_hasNeedHelpStatus, _plan_hasAutoResponse, _plan_hasAutoMatch, _plan_hasPriceList, _plan_receiveInstantDispatchFree, _plan_receiveInstantDispatchPro; setPlanForm({ id: plan.id, name: plan.name, description: (_plan_description = plan.description) !== null && _plan_description !== void 0 ? _plan_description : '', role: (_plan_role = plan.role) !== null && _plan_role !== void 0 ? _plan_role : 'customer', tier: (_plan_tier = plan.tier) !== null && _plan_tier !== void 0 ? _plan_tier : 'free', price: (_plan_price = plan.price) !== null && _plan_price !== void 0 ? _plan_price : '0', oldPrice: (_plan_oldPrice = plan.oldPrice) !== null && _plan_oldPrice !== void 0 ? _plan_oldPrice : '', currency: (_plan_currency = plan.currency) !== null && _plan_currency !== void 0 ? _plan_currency : 'EUR', maxTasks: plan.maxTasks != null ? String(plan.maxTasks) : '', maxOffers: plan.maxOffers != null ? String(plan.maxOffers) : '', maxCards: plan.maxCards != null ? String(plan.maxCards) : '', maxMessagesPerDay: plan.maxMessagesPerDay != null ? String(plan.maxMessagesPerDay) : '', maxOrdersPerDay: plan.maxOrdersPerDay != null ? String(plan.maxOrdersPerDay) : '', maxSkills: plan.maxSkills != null ? String(plan.maxSkills) : '', durationDays: plan.durationDays != null ? String(plan.durationDays) : '', searchBoost: (_plan_searchBoost = plan.searchBoost) !== null && _plan_searchBoost !== void 0 ? _plan_searchBoost : 0, offersMultiplier: (_plan_offersMultiplier = plan.offersMultiplier) !== null && _plan_offersMultiplier !== void 0 ? _plan_offersMultiplier : '1.00', features: ((_plan_features = plan.features) !== null && _plan_features !== void 0 ? _plan_features : []).join('\n'), isDefault: (_plan_isDefault = plan.isDefault) !== null && _plan_isDefault !== void 0 ? _plan_isDefault : false, isActive: (_plan_isActive = plan.isActive) !== null && _plan_isActive !== void 0 ? _plan_isActive : true, order: (_plan_order = plan.order) !== null && _plan_order !== void 0 ? _plan_order : 0, notifyNewTasks: (_plan_notifyNewTasks = plan.notifyNewTasks) !== null && _plan_notifyNewTasks !== void 0 ? _plan_notifyNewTasks : false, canContactFreePlan: (_plan_canContactFreePlan = plan.canContactFreePlan) !== null && _plan_canContactFreePlan !== void 0 ? _plan_canContactFreePlan : false, canContactProPlan: (_plan_canContactProPlan = plan.canContactProPlan) !== null && _plan_canContactProPlan !== void 0 ? _plan_canContactProPlan : true, canContactAll: (_plan_canContactAll = plan.canContactAll) !== null && _plan_canContactAll !== void 0 ? _plan_canContactAll : false, canShowContactInfo: (_plan_canShowContactInfo = plan.canShowContactInfo) !== null && _plan_canShowContactInfo !== void 0 ? _plan_canShowContactInfo : false, canViewPhone: (_plan_canViewPhone = plan.canViewPhone) !== null && _plan_canViewPhone !== void 0 ? _plan_canViewPhone : false, canUploadVideo: (_plan_canUploadVideo = plan.canUploadVideo) !== null && _plan_canUploadVideo !== void 0 ? _plan_canUploadVideo : false, hasFavorites: (_plan_hasFavorites = plan.hasFavorites) !== null && _plan_hasFavorites !== void 0 ? _plan_hasFavorites : false, hasGoogleCalendar: (_plan_hasGoogleCalendar = plan.hasGoogleCalendar) !== null && _plan_hasGoogleCalendar !== void 0 ? _plan_hasGoogleCalendar : false, hasVerifiedBadge: (_plan_hasVerifiedBadge = plan.hasVerifiedBadge) !== null && _plan_hasVerifiedBadge !== void 0 ? _plan_hasVerifiedBadge : false, highlightedReviews: (_plan_highlightedReviews = plan.highlightedReviews) !== null && _plan_highlightedReviews !== void 0 ? _plan_highlightedReviews : false, hasPersonalSite: (_plan_hasPersonalSite = plan.hasPersonalSite) !== null && _plan_hasPersonalSite !== void 0 ? _plan_hasPersonalSite : false, hasCanHelpNowStatus: (_plan_hasCanHelpNowStatus = plan.hasCanHelpNowStatus) !== null && _plan_hasCanHelpNowStatus !== void 0 ? _plan_hasCanHelpNowStatus : false, hasNeedHelpStatus: (_plan_hasNeedHelpStatus = plan.hasNeedHelpStatus) !== null && _plan_hasNeedHelpStatus !== void 0 ? _plan_hasNeedHelpStatus : false, hasAutoResponse: (_plan_hasAutoResponse = plan.hasAutoResponse) !== null && _plan_hasAutoResponse !== void 0 ? _plan_hasAutoResponse : false, hasAutoMatch: (_plan_hasAutoMatch = plan.hasAutoMatch) !== null && _plan_hasAutoMatch !== void 0 ? _plan_hasAutoMatch : false, hasPriceList: (_plan_hasPriceList = plan.hasPriceList) !== null && _plan_hasPriceList !== void 0 ? _plan_hasPriceList : false, receiveInstantDispatchFree: (_plan_receiveInstantDispatchFree = plan.receiveInstantDispatchFree) !== null && _plan_receiveInstantDispatchFree !== void 0 ? _plan_receiveInstantDispatchFree : false, receiveInstantDispatchPro: (_plan_receiveInstantDispatchPro = plan.receiveInstantDispatchPro) !== null && _plan_receiveInstantDispatchPro !== void 0 ? _plan_receiveInstantDispatchPro : false }); } async function savePlan() { if (!planForm) return; setPlanSaving(true); try { const payload = { name: planForm.name, description: planForm.description || undefined, role: planForm.role, tier: planForm.tier, price: planForm.price, oldPrice: planForm.oldPrice || null, currency: planForm.currency, maxTasks: planForm.maxTasks ? Number(planForm.maxTasks) : null, maxOffers: planForm.maxOffers ? Number(planForm.maxOffers) : null, maxCards: planForm.maxCards ? Number(planForm.maxCards) : null, maxMessagesPerDay: planForm.maxMessagesPerDay ? Number(planForm.maxMessagesPerDay) : null, maxOrdersPerDay: planForm.maxOrdersPerDay ? Number(planForm.maxOrdersPerDay) : null, maxSkills: planForm.maxSkills ? Number(planForm.maxSkills) : null, durationDays: planForm.durationDays ? Number(planForm.durationDays) : null, notifyNewTasks: planForm.notifyNewTasks, searchBoost: planForm.searchBoost, offersMultiplier: planForm.offersMultiplier, canContactFreePlan: planForm.canContactFreePlan, canContactProPlan: planForm.canContactProPlan, canContactAll: planForm.canContactAll, canShowContactInfo: planForm.canShowContactInfo, canViewPhone: planForm.canViewPhone, canUploadVideo: planForm.canUploadVideo, hasFavorites: planForm.hasFavorites, hasGoogleCalendar: planForm.hasGoogleCalendar, hasVerifiedBadge: planForm.hasVerifiedBadge, highlightedReviews: planForm.highlightedReviews, hasPersonalSite: planForm.hasPersonalSite, hasCanHelpNowStatus: planForm.hasCanHelpNowStatus, hasNeedHelpStatus: planForm.hasNeedHelpStatus, hasAutoResponse: planForm.hasAutoResponse, hasAutoMatch: planForm.hasAutoMatch, hasPriceList: planForm.hasPriceList, receiveInstantDispatchFree: planForm.receiveInstantDispatchFree, receiveInstantDispatchPro: planForm.receiveInstantDispatchPro, features: planForm.features ? planForm.features.split('\n').map((s)=>s.trim()).filter(Boolean) : [], isDefault: planForm.isDefault, isActive: planForm.isActive, order: planForm.order }; if (planForm.id) { const updated = await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updatePlan */ .td(planForm.id, payload); setPlanRows((prev)=>prev.map((r)=>r.id === planForm.id ? updated : r)); } else { const created = await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .createPlan */ .qT(payload); setPlanRows((prev)=>[ ...prev, created ]); } // If set as default — refresh all to sync isDefault flags if (planForm.isDefault) { _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminPlans */ .OX().then(setPlanRows).catch(()=>{}); } setPlanForm(null); } catch (e) { // ignore } finally{ setPlanSaving(false); } } async function deletePlan(id, name) { if (!window.confirm('Delete plan "'.concat(name, '"?'))) return; const ok = await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .deletePlan */ .bR(id).catch(()=>null); if (ok) setPlanRows((prev)=>prev.filter((r)=>r.id !== id)); } // Settings (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!isAdmin || tab !== 'settings') return; if (planRows.length === 0) _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminPlans */ .OX().then(setPlanRows).catch(()=>{}); _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminSettings */ .rC().then((kv)=>{ var _kv_generalsiteName, _kv_generalsiteUrl, _kv_generalcontactEmail, _kv_generalsupportPhone; setGeneralForm({ siteName: (_kv_generalsiteName = kv['general.siteName']) !== null && _kv_generalsiteName !== void 0 ? _kv_generalsiteName : 'CanHelp', siteUrl: (_kv_generalsiteUrl = kv['general.siteUrl']) !== null && _kv_generalsiteUrl !== void 0 ? _kv_generalsiteUrl : '', contactEmail: (_kv_generalcontactEmail = kv['general.contactEmail']) !== null && _kv_generalcontactEmail !== void 0 ? _kv_generalcontactEmail : '', supportPhone: (_kv_generalsupportPhone = kv['general.supportPhone']) !== null && _kv_generalsupportPhone !== void 0 ? _kv_generalsupportPhone : '' }); var _kv_smtphost, _kv_smtpport, _kv_smtpusername, _kv_smtppassword, _kv_smtpfromName, _kv_smtpfromEmail, _kv_smtpencryption; setSmtpForm({ host: (_kv_smtphost = kv['smtp.host']) !== null && _kv_smtphost !== void 0 ? _kv_smtphost : '', port: (_kv_smtpport = kv['smtp.port']) !== null && _kv_smtpport !== void 0 ? _kv_smtpport : '587', username: (_kv_smtpusername = kv['smtp.username']) !== null && _kv_smtpusername !== void 0 ? _kv_smtpusername : '', password: (_kv_smtppassword = kv['smtp.password']) !== null && _kv_smtppassword !== void 0 ? _kv_smtppassword : '', fromName: (_kv_smtpfromName = kv['smtp.fromName']) !== null && _kv_smtpfromName !== void 0 ? _kv_smtpfromName : 'CanHelp', fromEmail: (_kv_smtpfromEmail = kv['smtp.fromEmail']) !== null && _kv_smtpfromEmail !== void 0 ? _kv_smtpfromEmail : '', encryption: (_kv_smtpencryption = kv['smtp.encryption']) !== null && _kv_smtpencryption !== void 0 ? _kv_smtpencryption : 'tls' }); var _kv_paymentepaymerchantId, _kv_paymentepayapiUser, _kv_paymentepayapiPassword, _kv_paymentepayenvironment, _kv_paymentepayconfirmationUrl, _kv_paymentepaycancelUrl; setEPayForm({ merchantId: (_kv_paymentepaymerchantId = kv['payment.epay.merchantId']) !== null && _kv_paymentepaymerchantId !== void 0 ? _kv_paymentepaymerchantId : '', apiUser: (_kv_paymentepayapiUser = kv['payment.epay.apiUser']) !== null && _kv_paymentepayapiUser !== void 0 ? _kv_paymentepayapiUser : '', apiPassword: (_kv_paymentepayapiPassword = kv['payment.epay.apiPassword']) !== null && _kv_paymentepayapiPassword !== void 0 ? _kv_paymentepayapiPassword : '', environment: (_kv_paymentepayenvironment = kv['payment.epay.environment']) !== null && _kv_paymentepayenvironment !== void 0 ? _kv_paymentepayenvironment : 'test', confirmationUrl: (_kv_paymentepayconfirmationUrl = kv['payment.epay.confirmationUrl']) !== null && _kv_paymentepayconfirmationUrl !== void 0 ? _kv_paymentepayconfirmationUrl : '', cancelUrl: (_kv_paymentepaycancelUrl = kv['payment.epay.cancelUrl']) !== null && _kv_paymentepaycancelUrl !== void 0 ? _kv_paymentepaycancelUrl : '', enabled: kv['payment.epay.enabled'] === 'true' }); var _kv_referral_plan_id, _ref, _ref1, _kv_referral_days, _ref2, _ref3; setReferralForm({ enabled: kv['referral_enabled'] === 'true', planId: (_ref1 = (_ref = (_kv_referral_plan_id = kv['referral_plan_id']) !== null && _kv_referral_plan_id !== void 0 ? _kv_referral_plan_id : kv['referral_customer_plan_id']) !== null && _ref !== void 0 ? _ref : kv['referral_specialist_plan_id']) !== null && _ref1 !== void 0 ? _ref1 : '', days: (_ref3 = (_ref2 = (_kv_referral_days = kv['referral_days']) !== null && _kv_referral_days !== void 0 ? _kv_referral_days : kv['referral_customer_days']) !== null && _ref2 !== void 0 ? _ref2 : kv['referral_specialist_days']) !== null && _ref3 !== void 0 ? _ref3 : '30' }); var _kv_seoheadScripts, _kv_seositeTitleel, _ref4, _kv_seositeTitleen, _kv_seositeTitleru, _kv_seositeTitleuk, _kv_seositeDescriptionel, _ref5, _kv_seositeDescriptionen, _kv_seositeDescriptionru, _kv_seositeDescriptionuk; setSeoForm({ maintenanceMode: kv['seo.maintenanceMode'] === 'true', indexingEnabled: kv['seo.indexingEnabled'] !== 'false', headScripts: (_kv_seoheadScripts = kv['seo.headScripts']) !== null && _kv_seoheadScripts !== void 0 ? _kv_seoheadScripts : '', siteTitleEl: (_ref4 = (_kv_seositeTitleel = kv['seo.siteTitle.el']) !== null && _kv_seositeTitleel !== void 0 ? _kv_seositeTitleel : kv['seo.siteTitle']) !== null && _ref4 !== void 0 ? _ref4 : '', siteTitleEn: (_kv_seositeTitleen = kv['seo.siteTitle.en']) !== null && _kv_seositeTitleen !== void 0 ? _kv_seositeTitleen : '', siteTitleRu: (_kv_seositeTitleru = kv['seo.siteTitle.ru']) !== null && _kv_seositeTitleru !== void 0 ? _kv_seositeTitleru : '', siteTitleUk: (_kv_seositeTitleuk = kv['seo.siteTitle.uk']) !== null && _kv_seositeTitleuk !== void 0 ? _kv_seositeTitleuk : '', siteDescriptionEl: (_ref5 = (_kv_seositeDescriptionel = kv['seo.siteDescription.el']) !== null && _kv_seositeDescriptionel !== void 0 ? _kv_seositeDescriptionel : kv['seo.siteDescription']) !== null && _ref5 !== void 0 ? _ref5 : '', siteDescriptionEn: (_kv_seositeDescriptionen = kv['seo.siteDescription.en']) !== null && _kv_seositeDescriptionen !== void 0 ? _kv_seositeDescriptionen : '', siteDescriptionRu: (_kv_seositeDescriptionru = kv['seo.siteDescription.ru']) !== null && _kv_seositeDescriptionru !== void 0 ? _kv_seositeDescriptionru : '', siteDescriptionUk: (_kv_seositeDescriptionuk = kv['seo.siteDescription.uk']) !== null && _kv_seositeDescriptionuk !== void 0 ? _kv_seositeDescriptionuk : '' }); var _kv_socialtelegram, _kv_socialinstagram, _kv_socialfacebook, _kv_socialtwitter, _kv_socialyoutube, _kv_socialtiktok, _kv_socialwhatsapp, _kv_socialviber; setSocialForm({ telegram: (_kv_socialtelegram = kv['social.telegram']) !== null && _kv_socialtelegram !== void 0 ? _kv_socialtelegram : '', instagram: (_kv_socialinstagram = kv['social.instagram']) !== null && _kv_socialinstagram !== void 0 ? _kv_socialinstagram : '', facebook: (_kv_socialfacebook = kv['social.facebook']) !== null && _kv_socialfacebook !== void 0 ? _kv_socialfacebook : '', twitter: (_kv_socialtwitter = kv['social.twitter']) !== null && _kv_socialtwitter !== void 0 ? _kv_socialtwitter : '', youtube: (_kv_socialyoutube = kv['social.youtube']) !== null && _kv_socialyoutube !== void 0 ? _kv_socialyoutube : '', tiktok: (_kv_socialtiktok = kv['social.tiktok']) !== null && _kv_socialtiktok !== void 0 ? _kv_socialtiktok : '', whatsapp: (_kv_socialwhatsapp = kv['social.whatsapp']) !== null && _kv_socialwhatsapp !== void 0 ? _kv_socialwhatsapp : '', viber: (_kv_socialviber = kv['social.viber']) !== null && _kv_socialviber !== void 0 ? _kv_socialviber : '' }); var _kv_telegrambotToken, _kv_telegramadminChatId, _kv_telegramchannelIdel, _kv_telegramchannelIden, _kv_telegramchannelIdru, _kv_telegramchannelIduk; setTelegramForm({ botToken: (_kv_telegrambotToken = kv['telegram.botToken']) !== null && _kv_telegrambotToken !== void 0 ? _kv_telegrambotToken : '', adminChatId: (_kv_telegramadminChatId = kv['telegram.adminChatId']) !== null && _kv_telegramadminChatId !== void 0 ? _kv_telegramadminChatId : '', channelIdEl: (_kv_telegramchannelIdel = kv['telegram.channelId.el']) !== null && _kv_telegramchannelIdel !== void 0 ? _kv_telegramchannelIdel : '', channelIdEn: (_kv_telegramchannelIden = kv['telegram.channelId.en']) !== null && _kv_telegramchannelIden !== void 0 ? _kv_telegramchannelIden : '', channelIdRu: (_kv_telegramchannelIdru = kv['telegram.channelId.ru']) !== null && _kv_telegramchannelIdru !== void 0 ? _kv_telegramchannelIdru : '', channelIdUk: (_kv_telegramchannelIduk = kv['telegram.channelId.uk']) !== null && _kv_telegramchannelIduk !== void 0 ? _kv_telegramchannelIduk : '', notifyRegistrations: kv['telegram.notifyRegistrations'] === 'true', postNewTasks: kv['telegram.postNewTasks'] === 'true' }); }).catch(()=>{}); _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminEmailTemplates */ .Lp().then((rows)=>{ const map = {}; for (const r of rows)map[r.key] = { subject: r.subject, body: r.body }; setNotifTemplates((prev)=>({ ...prev, ...map })); }).catch(()=>{}); }, [ isAdmin, tab ]); async function saveGeneralSettings() { setGeneralSaving(true); try { await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updateAdminSettings */ .CX({ 'general.siteName': generalForm.siteName, 'general.siteUrl': generalForm.siteUrl, 'general.contactEmail': generalForm.contactEmail, 'general.supportPhone': generalForm.supportPhone }); setGeneralSaved(true); setTimeout(()=>setGeneralSaved(false), 2500); } catch (e) {} finally{ setGeneralSaving(false); } } async function saveSmtpSettings() { setSmtpSaving(true); try { await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updateAdminSettings */ .CX({ 'smtp.host': smtpForm.host, 'smtp.port': smtpForm.port, 'smtp.username': smtpForm.username, 'smtp.password': smtpForm.password, 'smtp.fromName': smtpForm.fromName, 'smtp.fromEmail': smtpForm.fromEmail, 'smtp.encryption': smtpForm.encryption }); setSmtpSaved(true); setTimeout(()=>setSmtpSaved(false), 2500); } catch (e) {} finally{ setSmtpSaving(false); } } async function autoTranslateTemplate(key) { const localeKey = "".concat(key, "_").concat(templateLocale); var _notifTemplates_localeKey, _ref; const current = (_ref = (_notifTemplates_localeKey = notifTemplates[localeKey]) !== null && _notifTemplates_localeKey !== void 0 ? _notifTemplates_localeKey : notifTemplates[key]) !== null && _ref !== void 0 ? _ref : { subject: '', body: '' }; if (!current.subject && !current.body) return; setTemplateTranslating(true); try { // СПхраМяеЌ ОсхПЎМый язык в БД (еслО ещё Ме сПхраМёМ) await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updateAdminEmailTemplate */ .jg(localeKey, current); // ПеревПЎОЌ Ма ПстальМые языкО const results = await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .translateAdminEmailTemplate */ .wc({ subject: current.subject, body: current.body, fromLocale: templateLocale }); // ОбМПвляеЌ state setNotifTemplates((prev)=>{ const next = { ...prev, [localeKey]: current }; for (const [loc, tpl] of Object.entries(results)){ next["".concat(key, "_").concat(loc)] = tpl; } return next; }); // СПхраМяеЌ кажЎый перевПЎ в БД await Promise.all(Object.entries(results).map((param)=>{ let [loc, tpl] = param; return _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updateAdminEmailTemplate */ .jg("".concat(key, "_").concat(loc), tpl); })); } catch (e) {} finally{ setTemplateTranslating(false); } } async function saveTemplate(key) { const localeKey = "".concat(key, "_").concat(templateLocale); setTemplateSaving(true); try { var _notifTemplates_localeKey; await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updateAdminEmailTemplate */ .jg(localeKey, (_notifTemplates_localeKey = notifTemplates[localeKey]) !== null && _notifTemplates_localeKey !== void 0 ? _notifTemplates_localeKey : { subject: '', body: '' }); setEditingTemplate(null); } catch (e) {} finally{ setTemplateSaving(false); } } async function saveEPaySettings() { setEPaySaving(true); try { await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updateAdminSettings */ .CX({ 'payment.epay.merchantId': ePayForm.merchantId, 'payment.epay.apiUser': ePayForm.apiUser, 'payment.epay.apiPassword': ePayForm.apiPassword, 'payment.epay.environment': ePayForm.environment, 'payment.epay.confirmationUrl': ePayForm.confirmationUrl, 'payment.epay.cancelUrl': ePayForm.cancelUrl, 'payment.epay.enabled': String(ePayForm.enabled) }); setEPaySaved(true); setTimeout(()=>setEPaySaved(false), 2500); } catch (e) {} finally{ setEPaySaving(false); } } async function saveReferralSettings() { setReferralSaving(true); try { await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updateAdminSettings */ .CX({ 'referral_enabled': String(referralForm.enabled), 'referral_plan_id': referralForm.planId, 'referral_days': referralForm.days }); setReferralSaved(true); setTimeout(()=>setReferralSaved(false), 2500); } catch (e) {} finally{ setReferralSaving(false); } } async function saveSeoSettings() { setSeoSaving(true); try { await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updateAdminSettings */ .CX({ 'seo.maintenanceMode': String(seoForm.maintenanceMode), 'seo.indexingEnabled': String(seoForm.indexingEnabled), 'seo.headScripts': seoForm.headScripts, 'seo.siteTitle.el': seoForm.siteTitleEl, 'seo.siteTitle.en': seoForm.siteTitleEn, 'seo.siteTitle.ru': seoForm.siteTitleRu, 'seo.siteTitle.uk': seoForm.siteTitleUk, 'seo.siteDescription.el': seoForm.siteDescriptionEl, 'seo.siteDescription.en': seoForm.siteDescriptionEn, 'seo.siteDescription.ru': seoForm.siteDescriptionRu, 'seo.siteDescription.uk': seoForm.siteDescriptionUk }); setSeoSaved(true); setTimeout(()=>setSeoSaved(false), 2500); } catch (e) {} finally{ setSeoSaving(false); } } async function saveSocialSettings() { setSocialSaving(true); try { await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updateAdminSettings */ .CX({ 'social.telegram': socialForm.telegram, 'social.instagram': socialForm.instagram, 'social.facebook': socialForm.facebook, 'social.twitter': socialForm.twitter, 'social.youtube': socialForm.youtube, 'social.tiktok': socialForm.tiktok, 'social.whatsapp': socialForm.whatsapp, 'social.viber': socialForm.viber }); setSocialSaved(true); setTimeout(()=>setSocialSaved(false), 2500); } catch (e) {} finally{ setSocialSaving(false); } } async function saveTelegramSettings() { setTelegramSaving(true); try { await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updateAdminSettings */ .CX({ 'telegram.botToken': telegramForm.botToken, 'telegram.adminChatId': telegramForm.adminChatId, 'telegram.channelId.el': telegramForm.channelIdEl, 'telegram.channelId.en': telegramForm.channelIdEn, 'telegram.channelId.ru': telegramForm.channelIdRu, 'telegram.channelId.uk': telegramForm.channelIdUk, 'telegram.notifyRegistrations': String(telegramForm.notifyRegistrations), 'telegram.postNewTasks': String(telegramForm.postNewTasks) }); setTelegramSaved(true); setTimeout(()=>setTelegramSaved(false), 2500); } catch (e) {} finally{ setTelegramSaving(false); } } async function testTelegram(type) { const chatIdMap = { admin: telegramForm.adminChatId, el: telegramForm.channelIdEl, en: telegramForm.channelIdEn, ru: telegramForm.channelIdRu, uk: telegramForm.channelIdUk }; var _chatIdMap_type; const chatId = (_chatIdMap_type = chatIdMap[type]) !== null && _chatIdMap_type !== void 0 ? _chatIdMap_type : ''; if (type === 'admin') { setTestingTelegramAdmin(true); setTestResultTelegramAdmin(null); } else { setTestingLocale(type); setTestResultChannels((p)=>{ const n = { ...p }; delete n[type]; return n; }); } try { const res = await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .testTelegramConnection */ .qX(telegramForm.botToken, chatId); var _res_error; const result = { ok: res.ok, msg: res.ok ? res.botName ? "@".concat(res.botName) : t('admin.settings.telegram.test_ok') : (_res_error = res.error) !== null && _res_error !== void 0 ? _res_error : t('admin.settings.telegram.test_fail') }; if (type === 'admin') setTestResultTelegramAdmin(result); else setTestResultChannels((p)=>({ ...p, [type]: result })); } catch (e) { const result = { ok: false, msg: t('admin.settings.telegram.test_fail') }; if (type === 'admin') setTestResultTelegramAdmin(result); else setTestResultChannels((p)=>({ ...p, [type]: result })); } finally{ if (type === 'admin') setTestingTelegramAdmin(false); else setTestingLocale(null); } } async function verifyTelegramToken() { setVerifyingTelegramToken(true); setVerifyResultTelegramToken(null); try { const res = await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .verifyTelegramToken */ .cl(telegramForm.botToken); var _res_error; setVerifyResultTelegramToken({ ok: res.ok, msg: res.ok ? "@".concat(res.botName) : (_res_error = res.error) !== null && _res_error !== void 0 ? _res_error : t('admin.settings.telegram.test_fail') }); } catch (e) { setVerifyResultTelegramToken({ ok: false, msg: t('admin.settings.telegram.test_fail') }); } finally{ setVerifyingTelegramToken(false); } } if (isPending) return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-center py-20 text-gray-500", children: t('common.loading') }); const dateLocale = locale === 'ru' ? 'ru-RU' : locale === 'en' ? 'en-US' : 'el-GR'; const catName = (id)=>{ const cat = catRows.find((c)=>c.id === id); if (!cat) return id; if (locale === 'en') return cat.namesEn || cat.namesEl; if (locale === 'ru') return cat.namesRu || cat.namesEl; if (locale === 'uk') return cat.namesUk || cat.namesEl; return cat.namesEl || cat.namesEn || id; }; const locName = (id)=>{ const loc = locRows.find((l)=>l.id === id); if (!loc) return id; if (locale === 'en') return loc.nameEn || loc.nameEl; if (locale === 'ru') return loc.nameRu || loc.nameEl; if (locale === 'uk') return loc.nameUk || loc.nameEl; return loc.nameEl || loc.nameEn || id; }; const TABS = [ { key: 'stats', label: t('admin.tab.stats'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: t('admin.tab.users'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M17 21v-2a4 4 0 00-4-4H5a4 4 0 00-4 4v2" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("circle", { cx: "9", cy: "7", r: "4" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: t('admin.tab.tasks'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: t('admin.tab.reports'), badge: pendingReportsCount || undefined, icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: t('admin.tab.moderation'), badge: pendingCardsCount || undefined, icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 20h12" }) ] }) }, { key: 'categories', label: t('admin.tab.categories'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: t('admin.tab.locations'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 11a3 3 0 11-6 0 3 3 0 016 0z" }) ] }) }, { key: 'balances', label: t('admin.tab.balances', 'Balance'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M20 12h-6m0 0a2 2 0 100 4h6v-8h-6a2 2 0 100 4z" }) ] }) }, { key: 'plans', label: t('admin.tab.plans'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("rect", { x: "1", y: "4", width: "22", height: "16", rx: "2", ry: "2" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: "1", y1: "10", x2: "23", y2: "10" }) ] }) }, { key: 'logs', label: t('admin.tab.logs'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("polyline", { points: "4 17 10 11 4 5" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: "12", y1: "19", x2: "20", y2: "19" }) ] }) }, { key: 'settings', label: t('admin.tab.settings'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("circle", { cx: "12", cy: "12", r: "3" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: t('admin.tab.support', 'Support'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: t('admin.tab.push', 'Push'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: t('admin.tab.backup', 'Backup'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: t('admin.tab.translations', 'Translations'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: t('admin.tab.dbcheck', 'DB check'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("ellipse", { cx: "12", cy: "5", rx: "9", ry: "3" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M21 12c0 1.66-4.03 3-9 3S3 13.66 3 12" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M3 5v14c0 1.66 4.03 3 9 3s9-1.34 9-3V5" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 12l2 2 4-4" }) ] }) }, { key: 'referrals', label: t('admin.tab.referrals', 'Referrals'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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" }) }) } ]; const statusColors = { 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' }; const reportStatusColors = { pending: 'bg-yellow-100 text-yellow-700', reviewed: 'bg-green-100 text-green-700', dismissed: 'bg-gray-100 text-gray-500' }; const reasonColors = { 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' }; const cardStatus = (card)=>{ var _card_publicationStatus; return (_card_publicationStatus = card.publicationStatus) !== null && _card_publicationStatus !== void 0 ? _card_publicationStatus : card.isActive ? 'active' : 'inactive'; }; const pendingModerationCards = moderationCards.filter((card)=>cardStatus(card) === 'pending'); const activeModerationCards = moderationCards.filter((card)=>cardStatus(card) === 'active'); var _stats_totalCostUsd, _planForm_oldPrice, _pushResult_tokensFound, _pushResult_usersWithoutTokens, _pushResult_usersConfigBlocked, _pushResult_usersAuthFailed, _pushResult_usersAllFailed, _pushResult_usersWithoutTokens1, _pushResult_usersConfigBlocked1, _pushResult_usersAuthFailed1, _pushResult_usersAllFailed1, _referralsData_totalReferrers, _referralsData_totalReferrals, _referralsData_activeRewards, _editUser_firstName, _editUser_lastName, _editUser_phone, _editUser_bio, _editUser_planId, _editUser_locale, _editUser_balance, _editUser_showContactInfo, _editUser_notifyNewTasks, _editUser_notifMessages, _editUser_personalSiteSlug, _editUser_siteSettings, _siteTheme, _editUser_skills, _editUser_balance1, _editUser_topUpAmount, _editUser_withdrawAmount, _editUser_topUpDescription, _editUser_withdrawDescription; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "min-h-screen bg-gray-50", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "max-w-7xl mx-auto px-4 py-8", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-between mb-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-7 h-7 text-yellow-500", fill: "currentColor", viewBox: "0 0 24 24", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M5 16L3 5l5.5 5L12 4l3.5 6L21 5l-2 11H5zm0 3a1 1 0 000 2h14a1 1 0 000-2H5z" }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h1", { className: "text-2xl font-bold text-gray-900", children: t('admin.title') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)((next_link__WEBPACK_IMPORTED_MODULE_3___default()), { href: "/", className: "flex items-center gap-1.5 text-sm text-gray-500 hover:text-green-600 transition", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 19l-7-7 7-7" }) }), t('admin.back_home') ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("aside", { className: "shrink-0 transition-all duration-200 ".concat(sidebarCollapsed ? 'w-12' : 'w-52'), children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("nav", { className: "bg-white rounded-xl border border-gray-200 overflow-hidden", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>setSidebarCollapsed((v)=>!v), title: sidebarCollapsed ? 'РазверМуть ЌеМю' : 'СверМуть ЌеМю', 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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 transition-transform duration-200 ".concat(sidebarCollapsed ? 'rotate-180' : ''), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 19l-7-7 7-7" }) }) }), TABS.map((param)=>{ let { key, label, icon, badge } = param; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { onClick: ()=>setTab(key), title: sidebarCollapsed ? label : undefined, className: "w-full flex items-center py-3 text-sm font-medium text-left transition ".concat(tab === key ? 'bg-green-50 text-green-700 border-r-2 border-green-600' : 'text-gray-600 hover:bg-gray-50 hover:text-gray-900', " ").concat(sidebarCollapsed ? 'justify-center px-3' : 'gap-3 px-4'), children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "w-4 h-4 flex-shrink-0 flex items-center justify-center", children: icon }), !sidebarCollapsed && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "flex items-center gap-2 min-w-0", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { children: label }), badge ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: badge }) : null ] }) ] }, key); }) ] }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex-1 min-w-0", children: [ tab === 'stats' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "grid grid-cols-2 md:grid-cols-5 gap-4", children: [ { label: t('admin.stats.users'), value: stats === null || stats === void 0 ? void 0 : stats.userCount, icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-8 h-8", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: t('admin.stats.specialists'), value: stats === null || stats === void 0 ? void 0 : stats.specialistCount, icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-8 h-8", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 12a3 3 0 11-6 0 3 3 0 016 0z" }) ] }), color: 'text-purple-600' }, { label: t('admin.stats.tasks'), value: stats === null || stats === void 0 ? void 0 : stats.taskCount, icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-8 h-8", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: t('admin.stats.offers'), value: stats === null || stats === void 0 ? void 0 : stats.offerCount, icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-8 h-8", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: t('admin.stats.reviews'), value: stats === null || stats === void 0 ? void 0 : stats.reviewCount, icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-8 h-8", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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((param)=>{ let { label, value, icon, color } = param; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "mb-2 ".concat(color), children: icon }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-3xl font-bold ".concat(color), children: value !== null && value !== void 0 ? value : '—' }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-sm text-gray-500 mt-1", children: label }) ] }, label); }) }), (stats === null || stats === void 0 ? void 0 : stats.tasksByDay) && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-between mb-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "font-semibold text-gray-800", children: t('admin.stats.activity_30d') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-4 text-xs text-gray-500", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "flex items-center gap-1.5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "w-3 h-0.5 bg-green-500 inline-block rounded" }), t('admin.stats.users_label') ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "flex items-center gap-1.5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "w-3 h-0.5 bg-purple-400 inline-block rounded" }), t('admin.stats.specialists_label') ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "flex items-center gap-1.5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "w-3 h-0.5 bg-green-500 inline-block rounded" }), t('admin.stats.tasks_label') ] }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(AdminAreaChart, { series: [ { data: stats.usersByDay, color: '#3b82f6', fill: '#3b82f615', label: t('admin.stats.users_label') }, { data: stats.specialistsByDay, color: '#a855f7', fill: '#a855f710', label: t('admin.stats.specialists_label') }, { data: stats.tasksByDay, color: '#22c55e', fill: '#22c55e10', label: t('admin.stats.tasks_label') } ] }) ] }), (stats === null || stats === void 0 ? void 0 : stats.tasksByStatus) && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "font-semibold text-gray-800 mb-5", children: t('admin.stats.tasks_by_status') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "space-y-3", children: (()=>{ const total = stats.tasksByStatus.reduce((s, r)=>s + Number(r.count), 0) || 1; const statusMeta = { open: { label: t('admin.task_status.open'), bg: 'bg-green-50', bar: 'bg-green-500' }, in_progress: { label: t('admin.task_status.in_progress'), bg: 'bg-green-50', bar: 'bg-green-500' }, completed: { label: t('admin.task_status.completed'), bg: 'bg-gray-50', bar: 'bg-gray-400' }, cancelled: { label: t('admin.task_status.cancelled'), bg: 'bg-red-50', bar: 'bg-red-400' }, draft: { label: t('admin.task_status.draft'), bg: 'bg-yellow-50', bar: 'bg-yellow-400' } }; const order = [ 'open', 'in_progress', 'completed', 'draft', 'cancelled' ]; const sorted = [ ...stats.tasksByStatus ].sort((a, b)=>order.indexOf(a.status) - order.indexOf(b.status)); return sorted.map((param)=>{ let { status, count: c } = param; var _statusMeta_status; const meta = (_statusMeta_status = statusMeta[status]) !== null && _statusMeta_status !== void 0 ? _statusMeta_status : { label: status, bg: 'bg-gray-50', bar: 'bg-gray-300' }; const pct = Math.round(Number(c) / total * 100); return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-3 px-3 py-2 rounded-lg ".concat(meta.bg), children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-sm text-gray-600 w-28 shrink-0", children: meta.label }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex-1 bg-gray-200 rounded-full h-2 overflow-hidden", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "h-full rounded-full ".concat(meta.bar, " transition-all"), style: { width: "".concat(pct, "%") } }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-sm font-semibold text-gray-700 w-8 text-right", children: c }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "text-xs text-gray-400 w-8", children: [ pct, "%" ] }) ] }, status); }); })() }) ] }), notifsByDay.length > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-between mb-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "font-semibold text-gray-800", children: t('admin.stats.notif_chart_title') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "flex items-center gap-1.5 text-xs text-gray-500", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "w-3 h-0.5 bg-orange-500 inline-block rounded" }), t('admin.stats.notif_label') ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(AdminAreaChart, { series: [ { data: notifsByDay, color: '#f97316', fill: '#f9731615', label: t('admin.stats.notif_label') } ] }) ] }), mailByDay.length > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-between mb-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "font-semibold text-gray-800", children: t('admin.stats.mail_chart_title') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "flex items-center gap-1.5 text-xs text-gray-500", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "w-3 h-0.5 bg-sky-500 inline-block rounded" }), t('admin.stats.mail_label') ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(AdminAreaChart, { series: [ { data: mailByDay, color: '#0ea5e9', fill: '#0ea5e915', label: t('admin.stats.mail_label') } ] }) ] }), stats && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-6 space-y-5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-between", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "font-semibold text-gray-800", children: t('admin.stats.tokens_title') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-4 text-xs text-gray-500", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "flex items-center gap-1.5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "w-3 h-0.5 bg-violet-500 inline-block rounded" }), t('admin.stats.tokens_out') ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "flex items-center gap-1.5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "w-3 h-0.5 bg-sky-500 inline-block rounded" }), t('admin.stats.tokens_in') ] }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "grid grid-cols-3 gap-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "rounded-lg bg-violet-50 border border-violet-100 px-4 py-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-xs text-violet-600 mb-1", children: t('admin.stats.tokens_out_label') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-2xl font-bold text-violet-700", children: Number(stats.totalOutputTokens).toLocaleString() }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "rounded-lg bg-sky-50 border border-sky-100 px-4 py-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-xs text-sky-600 mb-1", children: t('admin.stats.tokens_in_label') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-2xl font-bold text-sky-700", children: Number(stats.totalInputTokens).toLocaleString() }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "rounded-lg bg-emerald-50 border border-emerald-100 px-4 py-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-xs text-emerald-600 mb-1", children: t('admin.stats.cost_label') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "text-2xl font-bold text-emerald-700", children: [ "$", Number((_stats_totalCostUsd = stats.totalCostUsd) !== null && _stats_totalCostUsd !== void 0 ? _stats_totalCostUsd : 0).toFixed(4) ] }) ] }) ] }), ((_stats_tokensByMonth = stats.tokensByMonth) === null || _stats_tokensByMonth === void 0 ? void 0 : _stats_tokensByMonth.length) > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(AdminMonthChart, { dateLocale: dateLocale, series: [ { data: stats.tokensByMonth.map((r)=>({ month: r.month, count: Number(r.output) })), color: '#8b5cf6', fill: '#8b5cf610', label: t('admin.stats.tokens_out_label') }, { data: stats.tokensByMonth.map((r)=>({ month: r.month, count: Number(r.input) })), color: '#0ea5e9', fill: '#0ea5e915', label: t('admin.stats.tokens_in_label') } ] }) ] }) ] }), tab === 'users' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-3 mb-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("form", { className: "flex gap-2 flex-1", onSubmit: (e)=>{ e.preventDefault(); setUsersQ(usersQInput); }, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: usersQInput, onChange: (e)=>setUsersQInput(e.target.value), placeholder: t('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" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: t('tasks.search.btn') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("select", { value: usersRole, onChange: (e)=>setUsersRole(e.target.value), className: "border border-gray-300 rounded-lg px-3 py-2 text-sm", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "", children: t('admin.filter.all_roles') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "user", children: t('admin.user_edit.role.user') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "admin", children: t('profile.role.admin') }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 overflow-hidden", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("table", { className: "w-full text-sm", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("thead", { className: "bg-gray-50 text-left", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("tr", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.col.user') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.col.email') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.col.role') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.col.plan', 'Plan') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.col.registered') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.col.status') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3" }) ] }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("tbody", { className: "divide-y divide-gray-100", children: loading ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("tr", { children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { colSpan: 6, className: "px-4 py-8 text-center text-gray-400", children: t('common.loading') }) }) : users.length === 0 ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("tr", { children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { colSpan: 6, className: "px-4 py-8 text-center text-gray-400", children: "—" }) }) : users.map((u)=>{ var _planRows_find; var _planRows_find_name; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("tr", { className: "hover:bg-gray-50", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3 font-medium text-gray-800", children: (0,_lib_formatName__WEBPACK_IMPORTED_MODULE_8__/* .formatShortName */ .H)(u.firstName, u.lastName, u.name) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3 text-gray-500", children: u.email }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "px-2 py-0.5 rounded-full text-xs font-medium ".concat(u.role === 'admin' ? 'bg-red-100 text-red-700' : u.role === 'specialist' ? 'bg-green-100 text-green-700' : 'bg-gray-100 text-gray-600'), children: t("profile.role.".concat(u.role)) || u.role }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3 text-gray-400 text-xs", children: u.planId ? (_planRows_find_name = (_planRows_find = planRows.find((p)=>p.id === u.planId)) === null || _planRows_find === void 0 ? void 0 : _planRows_find.name) !== null && _planRows_find_name !== void 0 ? _planRows_find_name : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "font-mono", children: [ u.planId.slice(0, 8), "
" ] }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-gray-300", children: "—" }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3 text-gray-400", children: new Date(u.createdAt).toLocaleDateString(dateLocale) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "px-2 py-0.5 rounded-full text-xs font-medium ".concat(u.isActive !== false ? 'bg-green-100 text-green-700' : 'bg-red-100 text-red-600'), children: u.isActive !== false ? t('admin.users.active') : t('admin.users.inactive') }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3 text-right", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-end gap-1.5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>openEditUser(u), 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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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" }) }) }), u.role !== 'admin' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>toggleUser(u.id, u.isActive !== false), className: "text-xs px-3 py-1 rounded-lg font-medium ".concat(u.isActive !== false ? 'bg-red-50 text-red-600 hover:bg-red-100' : 'bg-green-50 text-green-600 hover:bg-green-100'), children: u.isActive !== false ? t('admin.users.deactivate') : t('admin.users.activate') }) ] }) }) ] }, u.id); }) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Pagination, { page: usersPage, total: usersTotal, limit: 20, onChange: setUsersPage, totalLabel: t('admin.pagination.total') }) ] }) ] }), tab === 'balances' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex flex-wrap gap-3 mb-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: balanceUserId, onChange: (e)=>setBalanceUserId(e.target.value), placeholder: t('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" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("select", { value: balanceKind, onChange: (e)=>setBalanceKind(e.target.value), className: "border border-gray-300 rounded-lg px-3 py-2 text-sm", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "", children: t('admin.balance.filter.all', 'All operations') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "topup", children: t('admin.balance.kind.topup', 'Top-up') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "plan_purchase", children: t('admin.balance.kind.plan_purchase', 'Plan charge') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "admin_topup", children: t('admin.balance.kind.admin_topup', 'Admin top-up') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "admin_adjustment", children: t('admin.balance.kind.admin_adjustment', 'Adjustment') }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 overflow-hidden", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("table", { className: "w-full text-sm", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("thead", { className: "bg-gray-50 text-left", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("tr", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.col.user') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.balance.col.operation', 'Operation') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.balance.col.amount', 'Amount') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.balance.col.result', 'Balance') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.balance.col.description', 'Description') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.balance.col.date', 'Date') }) ] }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("tbody", { className: "divide-y divide-gray-100", children: loading ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("tr", { children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { colSpan: 6, className: "px-4 py-8 text-center text-gray-400", children: t('common.loading') }) }) : balanceRows.length === 0 ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("tr", { children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { colSpan: 6, className: "px-4 py-8 text-center text-gray-400", children: t('admin.balance.empty', 'No records yet') }) }) : balanceRows.map((row)=>{ const isCredit = row.direction === 'credit'; const kindLabel = row.kind === 'topup' ? t('admin.balance.kind.topup', 'Top-up') : row.kind === 'plan_purchase' ? t('admin.balance.kind.plan_purchase', 'Plan charge') : row.kind === 'admin_topup' ? t('admin.balance.kind.admin_topup', 'Admin top-up') : t('admin.balance.kind.admin_adjustment', 'Adjustment'); return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("tr", { className: "hover:bg-gray-50 align-top", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("td", { className: "px-4 py-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "font-medium text-gray-800", children: row.userName || '—' }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-xs text-gray-500 mt-0.5", children: row.userEmail || row.userId }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "inline-flex rounded-full px-2 py-0.5 text-xs font-medium ".concat(isCredit ? 'bg-emerald-50 text-emerald-700' : 'bg-rose-50 text-rose-700'), children: kindLabel }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("td", { className: "px-4 py-3 font-semibold ".concat(isCredit ? 'text-emerald-700' : 'text-rose-700'), children: [ isCredit ? '+' : '-', Number(row.amount).toFixed(2), " ", row.currency ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3 text-gray-600", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ Number(row.balanceBefore).toFixed(2), " → ", Number(row.balanceAfter).toFixed(2), " ", row.currency ] }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3 text-gray-500 max-w-sm", children: row.description || '—' }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3 text-gray-500 whitespace-nowrap", children: new Date(row.createdAt).toLocaleString(dateLocale) }) ] }, row.id); }) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Pagination, { page: balancePage, total: balanceTotal, limit: 50, onChange: setBalancePage, totalLabel: t('admin.pagination.total') }) ] }) ] }), tab === 'tasks' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-3 mb-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("form", { className: "flex gap-2 flex-1", onSubmit: (e)=>{ e.preventDefault(); setTasksQ(tasksQInput); }, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: tasksQInput, onChange: (e)=>setTasksQInput(e.target.value), placeholder: t('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" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: t('tasks.search.btn') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("select", { value: tasksStatus, onChange: (e)=>setTasksStatus(e.target.value), className: "border border-gray-300 rounded-lg px-3 py-2 text-sm", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "", children: t('admin.filter.all_statuses') }), [ 'open', 'in_progress', 'completed', 'cancelled', 'draft' ].map((s)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: s, children: t("task.status.".concat(s), s) }, s)) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 overflow-hidden", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("table", { className: "w-full text-sm", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("thead", { className: "bg-gray-50 text-left", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("tr", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.col.title') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.col.customer') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.col.status') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.col.budget') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 font-medium text-gray-600", children: t('admin.col.created') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3" }) ] }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("tbody", { className: "divide-y divide-gray-100", children: loading ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("tr", { children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { colSpan: 6, className: "px-4 py-8 text-center text-gray-400", children: t('common.loading') }) }) : tasks.length === 0 ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("tr", { children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { colSpan: 6, className: "px-4 py-8 text-center text-gray-400", children: "—" }) }) : tasks.map((row)=>{ const task = row.task || row; const customer = row.customer; var _customer_name, _statusColors_task_status; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("tr", { className: "hover:bg-gray-50", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3 font-medium text-gray-800 max-w-xs", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)((next_link__WEBPACK_IMPORTED_MODULE_3___default()), { href: "/tasks/".concat(task.id), className: "hover:text-green-600 truncate block", target: "_blank", children: locale === 'en' && task.titleEn || locale === 'ru' && task.titleRu || locale === 'uk' && task.titleUk || task.titleEl || task.title }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3 text-gray-500 text-xs", children: (_customer_name = customer === null || customer === void 0 ? void 0 : customer.name) !== null && _customer_name !== void 0 ? _customer_name : '—' }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "px-2 py-0.5 rounded-full text-xs font-medium ".concat((_statusColors_task_status = statusColors[task.status]) !== null && _statusColors_task_status !== void 0 ? _statusColors_task_status : 'bg-gray-100 text-gray-600'), children: t("task.status.".concat(task.status), task.status) }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3 text-gray-500", children: task.budget ? "".concat((0,_lib_taskLocale__WEBPACK_IMPORTED_MODULE_9__/* .formatPrice */ .$g)(task.budget), "€") : '—' }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3 text-gray-400", children: new Date(task.createdAt).toLocaleDateString(dateLocale) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3 text-right", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-1.5 justify-end", children: [ task.status !== 'cancelled' && task.status !== 'completed' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>cancelTask(task.id), className: "text-xs px-2.5 py-1 rounded-lg font-medium bg-yellow-50 text-yellow-700 hover:bg-yellow-100", children: t('admin.tasks.cancel') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>deleteTask(task.id, locale === 'en' && task.titleEn || locale === 'ru' && task.titleRu || locale === 'uk' && task.titleUk || task.titleEl || task.title), className: "text-xs px-2.5 py-1 rounded-lg font-medium bg-red-50 text-red-600 hover:bg-red-100", children: t('admin.tasks.delete') }) ] }) }) ] }, task.id); }) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Pagination, { page: tasksPage, total: tasksTotal, limit: 20, onChange: setTasksPage, totalLabel: t('admin.pagination.total') }) ] }) ] }), tab === 'categories' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex justify-between items-center mb-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-gray-500", children: t('admin.cat.hint') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { onClick: ()=>openAddCat(null), className: "px-4 py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700", children: [ "+ ", t('admin.cat.add_root') ] }) ] }), catForm && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-green-50 border border-green-200 rounded-xl p-5 mb-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("h3", { className: "font-semibold text-gray-800 mb-4", children: [ catForm.id ? t('admin.cat.edit') : t('admin.cat.new'), catForm.parentId && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "text-xs text-gray-400 ml-2", children: [ "(", t('admin.cat.subcategory'), ")" ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "grid grid-cols-2 md:grid-cols-3 gap-3 mb-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.cat.slug') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: catForm.slug, onChange: (e)=>setCatForm((f)=>f && { ...f, slug: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm", placeholder: "e.g. repairs" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.cat.icon') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(CategoryIconPicker, { value: catForm.icon, onChange: (icon)=>setCatForm((f)=>f && { ...f, icon }), onUpload: uploadCategoryIcon, uploading: catIconUploading, error: catIconError, presets: categoryIconPresets }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.cat.order') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "number", value: catForm.order, onChange: (e)=>setCatForm((f)=>f && { ...f, order: Number(e.target.value) }), className: "w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: [ t('admin.cat.name_el'), " \uD83C\uDDEC\uD83C\uDDF7" ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: catForm.namesEl, onChange: (e)=>setCatForm((f)=>f && { ...f, namesEl: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: [ t('admin.cat.name_en'), " \uD83C\uDDEC\uD83C\uDDE7" ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: catForm.namesEn, onChange: (e)=>setCatForm((f)=>f && { ...f, namesEn: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: [ t('admin.cat.name_ru'), " \uD83C\uDDF7\uD83C\uDDFA" ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: catForm.namesRu, onChange: (e)=>setCatForm((f)=>f && { ...f, namesRu: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: [ t('admin.cat.name_uk'), " \uD83C\uDDFA\uD83C\uDDE6" ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: catForm.namesUk, onChange: (e)=>setCatForm((f)=>f && { ...f, namesUk: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }) ] }), catForm.id && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "flex items-center gap-2 text-sm text-gray-700 mb-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "checkbox", checked: catForm.isActive, onChange: (e)=>setCatForm((f)=>f && { ...f, isActive: e.target.checked }) }), t('admin.cat.active') ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: saveCat, disabled: catSaving, className: "px-4 py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700 disabled:opacity-50", children: catSaving ? t('common.saving') : t('common.save') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>setCatForm(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: t('common.cancel') }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "bg-white rounded-xl border border-gray-200 divide-y divide-gray-100", children: catRows.length === 0 ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "px-4 py-8 text-center text-gray-400", children: t('admin.cat.empty') }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(CatTree, { rows: catRows, parentId: null, depth: 0, locale: locale, expanded: catExpanded, onToggle: toggleCatExpand, onEdit: openEditCat, onDelete: deleteCat, onAddChild: openAddCat, skillsExpanded: catSkillsExpanded, skillsCache: catSkillsCache, skillsLoading: catSkillsLoading, onToggleSkills: toggleCatSkills, skillForm: skillForm, skillSaving: skillSaving, onOpenAddSkill: openAddSkill, onOpenEditSkill: openEditSkill, onSaveSkill: saveSkill, onDeleteSkill: deleteSkill, onCancelSkillForm: ()=>setSkillForm(null), onSkillFormChange: setSkillForm, t: t }) }) ] }), tab === 'locations' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex justify-between items-center mb-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-gray-500", children: t('admin.loc.hint') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { onClick: ()=>openAddLoc(null), className: "px-4 py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700", children: [ "+ ", t('admin.loc.add_city') ] }) ] }), locForm && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-green-50 border border-green-200 rounded-xl p-5 mb-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("h3", { className: "font-semibold text-gray-800 mb-4", children: [ locForm.id ? t('admin.loc.edit') : t('admin.loc.new'), locForm.parentId && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "text-xs text-gray-400 ml-2", children: [ "(", t('admin.loc.district'), ")" ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "grid grid-cols-2 md:grid-cols-4 gap-3 mb-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.cat.slug') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: locForm.slug, onChange: (e)=>setLocForm((f)=>f && { ...f, slug: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm", placeholder: "e.g. athens-center" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: [ t('admin.cat.name_el'), " \uD83C\uDDEC\uD83C\uDDF7" ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: locForm.nameEl, onChange: (e)=>setLocForm((f)=>f && { ...f, nameEl: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: [ t('admin.cat.name_en'), " \uD83C\uDDEC\uD83C\uDDE7" ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: locForm.nameEn, onChange: (e)=>setLocForm((f)=>f && { ...f, nameEn: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: [ t('admin.cat.name_ru'), " \uD83C\uDDF7\uD83C\uDDFA" ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: locForm.nameRu, onChange: (e)=>setLocForm((f)=>f && { ...f, nameRu: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: [ t('admin.cat.name_uk'), " \uD83C\uDDFA\uD83C\uDDE6" ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: locForm.nameUk, onChange: (e)=>setLocForm((f)=>f && { ...f, nameUk: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-4 mb-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "w-24", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.cat.order') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "number", value: locForm.order, onChange: (e)=>setLocForm((f)=>f && { ...f, order: Number(e.target.value) }), className: "w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), locForm.id && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "flex items-center gap-2 text-sm text-gray-700 mt-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "checkbox", checked: locForm.isActive, onChange: (e)=>setLocForm((f)=>f && { ...f, isActive: e.target.checked }) }), t('admin.cat.active') ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: saveLoc, disabled: locSaving, className: "px-4 py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700 disabled:opacity-50", children: locSaving ? t('common.saving') : t('common.save') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>setLocForm(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: t('common.cancel') }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "bg-white rounded-xl border border-gray-200 divide-y divide-gray-100", children: locRows.length === 0 ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "px-4 py-8 text-center text-gray-400", children: t('admin.loc.empty') }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(LocTree, { rows: locRows, parentId: null, depth: 0, locale: locale, expanded: locExpanded, onToggle: toggleLocExpand, onEdit: openEditLoc, onDelete: deleteLoc, onAddChild: openAddLoc, t: t }) }) ] }), tab === 'reports' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-3", children: [ loading ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-center py-10 text-gray-400", children: t('common.loading') }) : reports.length === 0 ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-center py-10 text-gray-400", children: t('admin.reports.none') }) : reports.map((r)=>{ var _r_targetId; var _reportStatusColors_r_status, _reasonColors_r_reason; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "bg-white rounded-xl border border-gray-200 p-5", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-start justify-between gap-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-2 flex-wrap mb-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "px-2 py-0.5 rounded-full text-xs font-medium ".concat((_reportStatusColors_r_status = reportStatusColors[r.status]) !== null && _reportStatusColors_r_status !== void 0 ? _reportStatusColors_r_status : 'bg-gray-100 text-gray-500'), children: r.status }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "px-2 py-0.5 rounded-full text-xs font-medium ".concat((_reasonColors_r_reason = reasonColors[r.reason]) !== null && _reasonColors_r_reason !== void 0 ? _reasonColors_r_reason : 'bg-gray-100 text-gray-600'), children: r.reason }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "text-xs text-gray-400", children: [ r.targetType === 'task' ? t('admin.reports.target.task') : t('admin.reports.target.user'), ":", ' ', r.targetTitle ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)((next_link__WEBPACK_IMPORTED_MODULE_3___default()), { href: r.targetType === 'task' ? "/tasks/".concat(r.targetId) : "/users/".concat(r.targetId), className: "text-green-600 hover:underline font-medium", target: "_blank", children: r.targetTitle }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "font-mono", children: [ "#", (_r_targetId = r.targetId) === null || _r_targetId === void 0 ? void 0 : _r_targetId.slice(0, 8) ] }) ] }) ] }), r.reporterName && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { className: "text-xs text-gray-400 mb-1", children: [ t('admin.col.reporter'), ": ", /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "font-medium text-gray-600", children: r.reporterName }) ] }), r.description && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-gray-700", children: r.description }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400 mt-1.5", children: new Date(r.createdAt).toLocaleString(dateLocale) }) ] }), r.status === 'pending' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-2 flex-shrink-0", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>handleReport(r.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: t('admin.reports.reviewed') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>handleReport(r.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: t('admin.reports.dismiss') }) ] }) ] }) }, r.id); }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Pagination, { page: reportsPage, total: reportsTotal, limit: 20, onChange: setReportsPage, totalLabel: t('admin.pagination.total') }) ] }), tab === 'moderation' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "grid md:grid-cols-2 gap-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-sm text-gray-500", children: t('admin.moderation.pending_count', 'Pending') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-3xl font-bold text-gray-900 mt-1", children: pendingModerationCards.length }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-xs text-gray-400 mt-1", children: t('admin.moderation.pending_hint', 'New proposals waiting for approval') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-sm text-gray-500", children: t('admin.moderation.active_count', 'Active') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-3xl font-bold text-gray-900 mt-1", children: activeModerationCards.length }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-xs text-gray-400 mt-1", children: t('admin.moderation.active_hint', 'Visible cards that can be blocked') }) ] }) ] }), moderationCardsLoading ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-center py-10 text-gray-400", children: t('common.loading') }) : moderationCards.length === 0 ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-center py-10 text-gray-400", children: t('admin.moderation.none', 'No specialist cards found') }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h3", { className: "font-semibold text-gray-800 mb-3", children: t('admin.moderation.pending_title', 'Pending approval') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "space-y-3", children: pendingModerationCards.length === 0 ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-sm text-gray-400 bg-white border border-dashed border-gray-200 rounded-xl p-4", children: t('admin.moderation.pending_empty', 'No pending proposals right now') }) : pendingModerationCards.map((card)=>{ var _card_specialistName, _ref; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "bg-white rounded-xl border border-gray-200 p-4", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex flex-wrap items-start justify-between gap-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "min-w-0 flex-1", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-2 flex-wrap mb-1", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "px-2 py-0.5 rounded-full text-xs font-medium bg-yellow-100 text-yellow-700", children: t('admin.moderation.pending', 'Pending') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-sm font-semibold text-gray-800 truncate", children: card.title }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-xs text-gray-500 mb-2", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)((next_link__WEBPACK_IMPORTED_MODULE_3___default()), { href: "/users/".concat(card.specialistId), className: "hover:text-green-600 hover:underline font-medium", children: (_ref = (_card_specialistName = card.specialistName) !== null && _card_specialistName !== void 0 ? _card_specialistName : card.specialistEmail) !== null && _ref !== void 0 ? _ref : card.specialistId }) }), card.description && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-gray-700 line-clamp-3", children: card.description }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-2 flex-shrink-0", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>updateModerationCard(card.id, 'active'), className: "px-3 py-1.5 rounded-lg text-xs font-medium bg-green-600 text-white hover:bg-green-700", children: t('admin.moderation.approve', 'Approve') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>updateModerationCard(card.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: t('admin.moderation.block', 'Block') }) ] }) ] }) }, card.id); }) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h3", { className: "font-semibold text-gray-800 mb-3", children: t('admin.moderation.active_title', 'Active cards') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "space-y-3", children: activeModerationCards.length === 0 ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-sm text-gray-400 bg-white border border-dashed border-gray-200 rounded-xl p-4", children: t('admin.moderation.active_empty', 'No active cards found') }) : activeModerationCards.map((card)=>{ var _card_specialistName, _ref; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "bg-white rounded-xl border border-gray-200 p-4", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex flex-wrap items-start justify-between gap-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "min-w-0 flex-1", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-2 flex-wrap mb-1", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "px-2 py-0.5 rounded-full text-xs font-medium bg-green-100 text-green-700", children: t('admin.moderation.active', 'Active') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-sm font-semibold text-gray-800 truncate", children: card.title }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-xs text-gray-500 mb-2", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)((next_link__WEBPACK_IMPORTED_MODULE_3___default()), { href: "/users/".concat(card.specialistId), className: "hover:text-green-600 hover:underline font-medium", children: (_ref = (_card_specialistName = card.specialistName) !== null && _card_specialistName !== void 0 ? _card_specialistName : card.specialistEmail) !== null && _ref !== void 0 ? _ref : card.specialistId }) }), card.description && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-gray-700 line-clamp-3", children: card.description }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>updateModerationCard(card.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: t('admin.moderation.block', 'Block') }) ] }) }, card.id); }) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Pagination, { page: moderationCardsPage, total: moderationCardsTotal, limit: 20, onChange: setModerationCardsPage, totalLabel: t('admin.pagination.total') }) ] }) ] }), tab === 'logs' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex gap-1 bg-gray-100 rounded-xl p-1 mb-5 w-fit", children: [ { key: 'ai', label: t('admin.logs.subtab.ai') }, { key: 'activity', label: t('admin.logs.subtab.activity') }, { key: 'mail', label: t('admin.logs.subtab.mail') }, { key: 'notifications', label: t('admin.logs.subtab.notifications') } ].map((param)=>{ let { key, label } = param; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>setLogsSubTab(key), className: "px-4 py-1.5 rounded-lg text-sm font-medium transition-colors ".concat(logsSubTab === key ? 'bg-white text-gray-900 shadow-sm' : 'text-gray-500 hover:text-gray-700'), children: label }, key); }) }), logsSubTab === 'ai' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex justify-between items-center mb-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { className: "text-sm text-gray-500", children: [ t('admin.pagination.total'), ": ", logsTotal ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { onClick: ()=>{ setLogsPage(1); _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminAiLogs */ .j_(1).then((d)=>{ setLogs(d.data); setLogsTotal(d.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: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("polyline", { points: "23 4 23 10 17 10" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M20.49 15a9 9 0 11-2.12-9.36L23 10" }) ] }), t('common.refresh') ] }) ] }), loading ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-center py-10 text-gray-400", children: t('common.loading') }) : logs.length === 0 ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-center py-10 text-gray-400", children: t('admin.logs.empty') }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "overflow-x-auto rounded-xl border border-gray-200", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("table", { className: "w-full text-sm", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("thead", { className: "bg-gray-50 text-gray-500 text-xs uppercase", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("tr", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 text-left", children: t('admin.logs.date') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 text-left", children: t('admin.logs.provider') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 text-left", children: t('admin.logs.model') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 text-left", children: t('admin.logs.action') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 text-left", children: t('admin.logs.langs') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 text-right", children: t('admin.logs.in') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 text-right", children: t('admin.logs.out') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 text-right", children: t('admin.logs.total') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 text-right", children: t('admin.logs.ms') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 text-center", children: t('admin.logs.status') }) ] }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("tbody", { className: "divide-y divide-gray-100", children: logs.map((log)=>{ var _log_inputTokens, _log_outputTokens, _log_totalTokens, _log_durationMs, _log_error; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("tr", { className: "bg-white hover:bg-gray-50", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3 text-gray-500 whitespace-nowrap", children: new Date(log.createdAt).toLocaleString(dateLocale) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "px-2 py-0.5 rounded-full text-xs font-medium ".concat(log.provider === 'anthropic' ? 'bg-purple-100 text-purple-700' : 'bg-green-100 text-green-700'), children: log.provider }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3 text-gray-600 font-mono text-xs", children: log.model }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3 text-gray-600", children: log.action }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3 text-gray-500", children: log.fromLocale && log.toLocale ? "".concat(log.fromLocale, " → ").concat(log.toLocale) : '—' }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3 text-right text-gray-600", children: (_log_inputTokens = log.inputTokens) !== null && _log_inputTokens !== void 0 ? _log_inputTokens : '—' }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3 text-right text-gray-600", children: (_log_outputTokens = log.outputTokens) !== null && _log_outputTokens !== void 0 ? _log_outputTokens : '—' }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3 text-right font-medium", children: (_log_totalTokens = log.totalTokens) !== null && _log_totalTokens !== void 0 ? _log_totalTokens : '—' }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3 text-right text-gray-500", children: (_log_durationMs = log.durationMs) !== null && _log_durationMs !== void 0 ? _log_durationMs : '—' }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3 text-center", children: log.success ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-green-600 flex justify-center", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("polyline", { points: "20 6 9 17 4 12" }) }) }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-red-500 flex justify-center", title: (_log_error = log.error) !== null && _log_error !== void 0 ? _log_error : '', children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: "18", y1: "6", x2: "6", y2: "18" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: "6", y1: "6", x2: "18", y2: "18" }) ] }) }) }) ] }, log.id); }) }) ] }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Pagination, { page: logsPage, total: logsTotal, limit: 50, onChange: setLogsPage, totalLabel: t('admin.pagination.total') }) ] }), logsSubTab === 'activity' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-4 mb-4 flex flex-wrap gap-3 items-end", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs font-medium text-gray-500 mb-1", children: t('admin.activity.event') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("select", { value: activityEvent, onChange: (e)=>setActivityEvent(e.target.value), className: "border border-gray-300 rounded-lg px-3 py-1.5 text-sm min-w-[180px]", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "", children: t('admin.activity.all_events') }), activityEventTypes.map((ev)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: ev, children: ev }, ev)) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs font-medium text-gray-500 mb-1", children: t('admin.activity.from') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "date", value: activityDateFrom, onChange: (e)=>setActivityDateFrom(e.target.value), className: "border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs font-medium text-gray-500 mb-1", children: t('admin.activity.to') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "date", value: activityDateTo, onChange: (e)=>setActivityDateTo(e.target.value), className: "border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), (activityEvent || activityDateFrom || activityDateTo || activityUserId) && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { onClick: ()=>{ setActivityEvent(''); setActivityDateFrom(''); setActivityDateTo(''); setActivityUserId(''); }, 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: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-3 h-3", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: "18", y1: "6", x2: "6", y2: "18" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: "6", y1: "6", x2: "18", y2: "18" }) ] }), t('admin.activity.reset') ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { className: "text-xs text-gray-400 self-end ml-auto", children: [ t('admin.activity.total'), ": ", activityTotal ] }) ] }), activityLog.length === 0 ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-center py-10 text-gray-400", children: t('admin.activity.empty') }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "space-y-2", children: activityLog.map((entry)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(ActivityLogRow, { entry: entry, dateLocale: dateLocale, onFilterUser: (id)=>{ setActivityUserId(id); setActivityEvent(''); }, t: t }, entry.id)) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Pagination, { page: activityPage, total: activityTotal, limit: 50, onChange: setActivityPage, totalLabel: t('admin.pagination.total') }) ] }), logsSubTab === 'mail' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-4 mb-4 flex flex-wrap gap-3 items-end", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs font-medium text-gray-500 mb-1", children: t('admin.mail.event') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("select", { value: mailEvent, onChange: (e)=>setMailEvent(e.target.value), className: "border border-gray-300 rounded-lg px-3 py-1.5 text-sm min-w-[200px]", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "", children: t('admin.mail.all_events') }), mailEventTypes.map((ev)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: ev, children: t("admin.event.".concat(ev.replace(/\./g, '_')), ev) }, ev)) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs font-medium text-gray-500 mb-1", children: t('admin.mail.from') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "date", value: mailDateFrom, onChange: (e)=>setMailDateFrom(e.target.value), className: "border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs font-medium text-gray-500 mb-1", children: t('admin.mail.to') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "date", value: mailDateTo, onChange: (e)=>setMailDateTo(e.target.value), className: "border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), (mailEvent || mailDateFrom || mailDateTo) && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { onClick: ()=>{ setMailEvent(''); setMailDateFrom(''); setMailDateTo(''); }, 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: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-3 h-3", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: "18", y1: "6", x2: "6", y2: "18" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: "6", y1: "6", x2: "18", y2: "18" }) ] }), t('admin.mail.reset') ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { className: "text-xs text-gray-400 self-end ml-auto", children: [ t('admin.mail.total'), ": ", mailTotal ] }) ] }), mailLog.length === 0 ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-center py-10 text-gray-400", children: t('admin.mail.empty') }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "overflow-x-auto rounded-xl border border-gray-200", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("table", { className: "w-full text-sm", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("thead", { className: "bg-gray-50 text-gray-500 text-xs uppercase", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("tr", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 text-left", children: t('admin.logs.date') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 text-left", children: t('admin.mail.recipient') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 text-left", children: t('admin.mail.event') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 text-left", children: t('admin.mail.provider') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 text-left", children: t('admin.mail.details') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 text-center", children: t('admin.mail.status') }) ] }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("tbody", { className: "divide-y divide-gray-100", children: mailLog.map((entry)=>{ const details = parseLogDetails(entry.details); const provider = typeof (details === null || details === void 0 ? void 0 : details.provider) === 'string' ? details.provider : '—'; const recipient = typeof (details === null || details === void 0 ? void 0 : details.to) === 'string' ? details.to : entry.userEmail || '—'; const subject = typeof (details === null || details === void 0 ? void 0 : details.subject) === 'string' ? details.subject : ''; const error = typeof (details === null || details === void 0 ? void 0 : details.error) === 'string' ? details.error : ''; const success = entry.event === 'email.sent' || entry.event === 'admin.email.test.sent'; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("tr", { className: "bg-white hover:bg-gray-50 align-top", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3 text-gray-500 whitespace-nowrap", children: new Date(entry.createdAt).toLocaleString(dateLocale) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3 text-gray-700", children: recipient }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "px-2 py-0.5 rounded-full text-xs font-medium bg-sky-50 text-sky-700", children: t("admin.event.".concat(entry.event.replace(/\./g, '_')), entry.event) }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3 text-gray-600", children: provider }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3 text-gray-600 max-w-md", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "truncate", title: subject || error || undefined, children: subject || error || '—' }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3 text-center", children: success ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-green-600 inline-flex justify-center", title: t('admin.mail.success'), children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("polyline", { points: "20 6 9 17 4 12" }) }) }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-red-500 inline-flex justify-center", title: error || t('admin.mail.failed'), children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: "18", y1: "6", x2: "6", y2: "18" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: "6", y1: "6", x2: "18", y2: "18" }) ] }) }) }) ] }, entry.id); }) }) ] }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Pagination, { page: mailPage, total: mailTotal, limit: 50, onChange: setMailPage, totalLabel: t('admin.pagination.total') }) ] }), logsSubTab === 'notifications' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-4 mb-4 flex flex-wrap gap-3 items-end", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs font-medium text-gray-500 mb-1", children: t('admin.notif_logs.type') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("select", { value: notifLogsType, onChange: (e)=>setNotifLogsType(e.target.value), className: "border border-gray-300 rounded-lg px-3 py-1.5 text-sm min-w-[200px]", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "", children: t('admin.filter.all') }), notifLogsTypes.map((tp)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: tp, children: tp }, tp)) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs font-medium text-gray-500 mb-1", children: t('admin.activity.from') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "date", value: notifLogsDateFrom, onChange: (e)=>setNotifLogsDateFrom(e.target.value), className: "border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs font-medium text-gray-500 mb-1", children: t('admin.activity.to') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "date", value: notifLogsDateTo, onChange: (e)=>setNotifLogsDateTo(e.target.value), className: "border border-gray-300 rounded-lg px-3 py-1.5 text-sm" }) ] }), (notifLogsType || notifLogsDateFrom || notifLogsDateTo) && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { onClick: ()=>{ setNotifLogsType(''); setNotifLogsDateFrom(''); setNotifLogsDateTo(''); }, 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: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-3 h-3", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: "18", y1: "6", x2: "6", y2: "18" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: "6", y1: "6", x2: "18", y2: "18" }) ] }), t('admin.activity.reset') ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { className: "text-xs text-gray-400 self-end ml-auto", children: [ t('admin.pagination.total'), ": ", notifLogsTotal ] }) ] }), notifLogs.length === 0 ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-center py-10 text-gray-400", children: t('admin.notif_logs.empty') }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "overflow-x-auto rounded-xl border border-gray-200", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("table", { className: "w-full text-sm", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("thead", { className: "bg-gray-50 text-gray-500 text-xs uppercase", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("tr", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 text-left", children: t('admin.logs.date') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 text-left", children: t('admin.col.user') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 text-left", children: t('admin.notif_logs.type') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 text-left", children: t('admin.notif_logs.title') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "px-4 py-3 text-center", children: t('admin.notif_logs.read') }) ] }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("tbody", { className: "divide-y divide-gray-100", children: notifLogs.map((n)=>{ var _n_recipientName, _ref; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("tr", { className: "bg-white hover:bg-gray-50", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3 text-gray-500 whitespace-nowrap", children: new Date(n.createdAt).toLocaleString(dateLocale) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3 text-gray-700", children: (_ref = (_n_recipientName = n.recipientName) !== null && _n_recipientName !== void 0 ? _n_recipientName : n.recipientEmail) !== null && _ref !== void 0 ? _ref : n.recipientId }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "px-2 py-0.5 rounded-full text-xs font-medium bg-green-50 text-green-700", children: n.type }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3 text-gray-600 max-w-xs truncate", children: n.title }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-4 py-3 text-center", children: n.isRead ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-green-600 flex justify-center", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("polyline", { points: "20 6 9 17 4 12" }) }) }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-gray-400 flex justify-center", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("circle", { cx: "12", cy: "12", r: "10" }) }) }) }) ] }, n.id); }) }) ] }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Pagination, { page: notifLogsPage, total: notifLogsTotal, limit: 50, onChange: setNotifLogsPage, totalLabel: t('admin.pagination.total') }) ] }) ] }), tab === 'plans' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-between mb-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("h2", { className: "text-lg font-semibold text-gray-800 flex items-center gap-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-5 h-5 text-green-600", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("rect", { x: "1", y: "4", width: "22", height: "16", rx: "2", ry: "2" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: "1", y1: "10", x2: "23", y2: "10" }) ] }), t('admin.plans.title') ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: openAddPlan, className: "bg-green-600 text-white text-sm px-4 py-2 rounded-lg hover:bg-green-700 font-medium", children: t('admin.plans.add') }) ] }), planForm && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white border border-gray-200 rounded-xl p-5 mb-4 space-y-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h3", { className: "font-semibold text-gray-800", children: planForm.id ? t('admin.plans.form.edit') : t('admin.plans.form.new') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "grid grid-cols-2 gap-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.name') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: planForm.name, onChange: (e)=>setPlanForm({ ...planForm, name: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.price') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "number", min: "0", step: "0.01", value: planForm.price, onChange: (e)=>setPlanForm({ ...planForm, price: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.old_price') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "number", min: "0", step: "0.01", value: (_planForm_oldPrice = planForm.oldPrice) !== null && _planForm_oldPrice !== void 0 ? _planForm_oldPrice : '', onChange: (e)=>setPlanForm({ ...planForm, oldPrice: e.target.value }), placeholder: "—", className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.tier') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("select", { value: planForm.tier, onChange: (e)=>setPlanForm({ ...planForm, tier: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "free", children: t('admin.plans.form.tier.free') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "pro", children: t('admin.plans.form.tier.pro') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "ultimate", children: t('admin.plans.form.tier.ultimate') }) ] }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.description') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: planForm.description, onChange: (e)=>setPlanForm({ ...planForm, description: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs font-semibold text-gray-500 uppercase tracking-wide pt-1", children: t('admin.plans.form.section.limits') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "grid grid-cols-3 gap-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.max_tasks') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "number", min: "0", placeholder: "∞", value: planForm.maxTasks, onChange: (e)=>setPlanForm({ ...planForm, maxTasks: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.max_offers') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "number", min: "0", placeholder: "∞", value: planForm.maxOffers, onChange: (e)=>setPlanForm({ ...planForm, maxOffers: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.max_cards') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "number", min: "0", placeholder: "∞", value: planForm.maxCards, onChange: (e)=>setPlanForm({ ...planForm, maxCards: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.max_messages_day') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "number", min: "0", placeholder: "∞", value: planForm.maxMessagesPerDay, onChange: (e)=>setPlanForm({ ...planForm, maxMessagesPerDay: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.max_orders_day') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "number", min: "0", placeholder: "∞", value: planForm.maxOrdersPerDay, onChange: (e)=>setPlanForm({ ...planForm, maxOrdersPerDay: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.max_skills') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "number", min: "0", placeholder: "∞", value: planForm.maxSkills, onChange: (e)=>setPlanForm({ ...planForm, maxSkills: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.duration_days') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "number", min: "0", placeholder: "∞", value: planForm.durationDays, onChange: (e)=>setPlanForm({ ...planForm, durationDays: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs font-semibold text-gray-500 uppercase tracking-wide pt-1", children: t('admin.plans.form.section.boost') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "grid grid-cols-2 gap-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.search_boost') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "number", min: "0", value: planForm.searchBoost, onChange: (e)=>setPlanForm({ ...planForm, searchBoost: Number(e.target.value) }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.offers_multiplier') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "number", min: "0", step: "0.01", value: planForm.offersMultiplier, onChange: (e)=>setPlanForm({ ...planForm, offersMultiplier: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.plans.form.features') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("textarea", { rows: 3, value: planForm.features, onChange: (e)=>setPlanForm({ ...planForm, features: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 resize-none" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs font-semibold text-gray-500 uppercase tracking-wide pt-1", children: t('admin.plans.form.section.contact') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "grid grid-cols-2 gap-2", children: [ [ 'canContactFreePlan', t('admin.plans.form.can_contact_free') ], [ 'canContactProPlan', t('admin.plans.form.can_contact_pro') ], [ 'canContactAll', t('admin.plans.form.can_contact_all') ], [ 'canShowContactInfo', t('admin.plans.form.can_show_contact') ], [ 'canViewPhone', t('admin.plans.form.can_view_phone') ] ].map((param)=>{ let [key, label] = param; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "flex items-center gap-2 cursor-pointer text-sm text-gray-700", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "checkbox", checked: planForm[key], onChange: (e)=>setPlanForm({ ...planForm, [key]: e.target.checked }), className: "w-4 h-4 rounded text-green-600" }), label ] }, key); }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs font-semibold text-gray-500 uppercase tracking-wide pt-1", children: t('admin.plans.form.section.features') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "grid grid-cols-2 gap-2", children: [ [ 'notifyNewTasks', t('admin.plans.form.notify') ], [ 'canUploadVideo', t('admin.plans.form.upload_video') ], [ 'hasFavorites', t('admin.plans.form.favorites') ], [ 'hasGoogleCalendar', t('admin.plans.form.google_calendar') ], [ 'hasVerifiedBadge', t('admin.plans.form.verified_badge') ], [ 'highlightedReviews', t('admin.plans.form.highlighted_reviews') ], [ 'hasPersonalSite', t('admin.plans.form.personal_site') ], [ 'hasCanHelpNowStatus', t('admin.plans.form.can_help_now') ], [ 'hasNeedHelpStatus', t('admin.plans.form.need_help') ], [ 'hasAutoResponse', t('admin.plans.form.auto_response') ], [ 'hasAutoMatch', t('admin.plans.form.auto_match') ], [ 'hasPriceList', t('admin.plans.form.price_list') ], [ 'receiveInstantDispatchFree', t('admin.plans.form.instant_dispatch_free') ], [ 'receiveInstantDispatchPro', t('admin.plans.form.instant_dispatch_pro') ] ].map((param)=>{ let [key, label] = param; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "flex items-center gap-2 cursor-pointer text-sm text-gray-700", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "checkbox", checked: planForm[key], onChange: (e)=>setPlanForm({ ...planForm, [key]: e.target.checked }), className: "w-4 h-4 rounded text-green-600" }), label ] }, key); }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-6 pt-1", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "flex items-center gap-2 cursor-pointer text-sm text-gray-700", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "checkbox", checked: planForm.isDefault, onChange: (e)=>setPlanForm({ ...planForm, isDefault: e.target.checked }), className: "w-4 h-4 rounded text-green-600" }), t('admin.plans.form.default') ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "flex items-center gap-2 cursor-pointer text-sm text-gray-700", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "checkbox", checked: planForm.isActive, onChange: (e)=>setPlanForm({ ...planForm, isActive: e.target.checked }), className: "w-4 h-4 rounded text-green-600" }), t('admin.plans.form.active') ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "text-xs text-gray-600", children: t('admin.plans.form.order') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "number", value: planForm.order, onChange: (e)=>setPlanForm({ ...planForm, order: Number(e.target.value) }), className: "w-16 border border-gray-300 rounded-lg px-2 py-1 text-sm focus:outline-none" }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-2 pt-1", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: savePlan, disabled: planSaving || !planForm.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: planSaving ? '...' : t('common.save') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>setPlanForm(null), className: "px-4 py-2 rounded-lg text-sm font-medium text-gray-600 hover:bg-gray-100", children: t('common.cancel') }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "bg-white rounded-xl border border-gray-200 overflow-hidden", children: planRows.length === 0 ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "px-4 py-8 text-center text-gray-400 text-sm", children: t('admin.plans.empty') }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "divide-y divide-gray-100", children: planRows.sort((a, b)=>{ var _a_order, _b_order; return ((_a_order = a.order) !== null && _a_order !== void 0 ? _a_order : 0) - ((_b_order = b.order) !== null && _b_order !== void 0 ? _b_order : 0); }).map((plan)=>{ var _plan_features; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-start gap-4 px-4 py-4 ".concat(!plan.isActive ? 'opacity-50' : ''), children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-2 flex-wrap", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "font-semibold text-gray-900", children: plan.name }), plan.isDefault && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "bg-green-100 text-green-700 text-xs px-2 py-0.5 rounded-full font-medium", children: t('admin.plans.badge.default') }), !plan.isActive && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "bg-gray-100 text-gray-500 text-xs px-2 py-0.5 rounded-full", children: t('admin.plans.badge.inactive') }) ] }), plan.description && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-gray-500 mt-0.5", children: plan.description }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex flex-wrap gap-3 mt-1 text-xs text-gray-500", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "flex items-center gap-1.5 font-semibold text-gray-800", children: [ plan.oldPrice && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "font-normal text-gray-400 line-through", children: [ plan.oldPrice, " ", plan.currency ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { children: [ plan.price, " ", plan.currency ] }) ] }), plan.maxTasks != null && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { children: [ t('admin.plans.tasks'), ": ", plan.maxTasks ] }), plan.maxOffers != null && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { children: [ t('admin.plans.offers'), ": ", plan.maxOffers ] }), plan.maxCards != null && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { children: [ t('admin.plans.cards'), ": ", plan.maxCards ] }), plan.notifyNewTasks && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "text-green-700 flex items-center gap-1", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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" }) }), t('admin.plans.notify_tasks') ] }) ] }), ((_plan_features = plan.features) !== null && _plan_features !== void 0 ? _plan_features : []).length > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("ul", { className: "mt-1.5 space-y-0.5", children: plan.features.map((f, i)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("li", { className: "text-xs text-gray-600 flex items-center gap-1.5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-green-500", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3 h-3", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("polyline", { points: "20 6 9 17 4 12" }) }) }), " ", f ] }, i)) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-1 shrink-0", children: [ !plan.isDefault && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updatePlan */ .td(plan.id, { isDefault: true }).then(()=>_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminPlans */ .OX().then(setPlanRows)).catch(()=>{}), className: "text-xs px-2 py-1 rounded-lg bg-green-50 text-green-600 hover:bg-green-100 font-medium", title: t('admin.plans.make_default'), children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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" }) }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>openEditPlan(plan), className: "text-xs px-2 py-1 rounded-lg bg-gray-100 text-gray-600 hover:bg-gray-200 font-medium", children: t('common.edit') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>deletePlan(plan.id, plan.name), className: "text-xs px-2 py-1 rounded-lg bg-red-50 text-red-600 hover:bg-red-100 font-medium", children: t('common.delete') }) ] }) ] }, plan.id); }) }) }) ] }), tab === 'settings' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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((st)=>{ const labels = { general: t('admin.settings.tab.general'), smtp: t('admin.settings.tab.smtp'), notifications: t('admin.settings.tab.notifications'), payment: t('admin.settings.tab.payment'), referral: t('admin.settings.tab.referral'), seo: t('admin.settings.tab.seo'), socials: t('admin.settings.tab.socials'), telegram: t('admin.settings.tab.telegram') }; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>setSettingsTab(st), className: "px-4 py-2 rounded-lg text-sm font-medium transition ".concat(settingsTab === st ? 'bg-green-600 text-white shadow-sm' : 'text-gray-600 hover:bg-gray-100'), children: labels[st] }, st); }) }), settingsTab === 'general' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-6 max-w-lg", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h3", { className: "font-semibold text-gray-800 mb-5", children: t('admin.settings.general.title') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.general.site_name') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: generalForm.siteName, onChange: (e)=>setGeneralForm((f)=>({ ...f, siteName: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400", placeholder: "CanHelp" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.general.site_url') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: generalForm.siteUrl, onChange: (e)=>setGeneralForm((f)=>({ ...f, siteUrl: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400", placeholder: "https://canhelp.com" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.general.contact_email') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "email", value: generalForm.contactEmail, onChange: (e)=>setGeneralForm((f)=>({ ...f, contactEmail: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400", placeholder: "contact@canhelp.com" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.general.support_phone') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: generalForm.supportPhone, onChange: (e)=>setGeneralForm((f)=>({ ...f, supportPhone: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400", placeholder: "+30 21 000 0000" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: saveGeneralSettings, disabled: generalSaving, 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: generalSaving ? t('admin.settings.saving') : generalSaved ? t('admin.settings.saved') : t('common.save') }) ] }) ] }), settingsTab === 'smtp' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-6 max-w-lg", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h3", { className: "font-semibold text-gray-800 mb-1", children: t('admin.settings.smtp.title') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-gray-400 mb-5", children: t('admin.settings.smtp.hint') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "grid grid-cols-3 gap-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "col-span-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.smtp.host') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: smtpForm.host, onChange: (e)=>setSmtpForm((f)=>({ ...f, host: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400", placeholder: "smtp.gmail.com" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.smtp.port') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: smtpForm.port, onChange: (e)=>setSmtpForm((f)=>({ ...f, port: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400", placeholder: "587" }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.smtp.encryption') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("select", { value: smtpForm.encryption, onChange: (e)=>setSmtpForm((f)=>({ ...f, encryption: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "none", children: t('admin.settings.smtp.enc.none') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "tls", children: "STARTTLS (587)" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "ssl", children: "SSL/TLS (465)" }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.smtp.username') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: smtpForm.username, onChange: (e)=>setSmtpForm((f)=>({ ...f, username: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400", placeholder: "user@gmail.com", autoComplete: "off" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.smtp.password') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "password", value: smtpForm.password, onChange: (e)=>setSmtpForm((f)=>({ ...f, password: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400", autoComplete: "new-password", placeholder: "••••••••••••" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "grid grid-cols-2 gap-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.smtp.from_name') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: smtpForm.fromName, onChange: (e)=>setSmtpForm((f)=>({ ...f, fromName: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400", placeholder: "CanHelp" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.smtp.from_email') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "email", value: smtpForm.fromEmail, onChange: (e)=>setSmtpForm((f)=>({ ...f, fromEmail: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400", placeholder: "noreply@canhelp.com" }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: saveSmtpSettings, disabled: smtpSaving, 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: smtpSaving ? t('admin.settings.saving') : smtpSaved ? t('admin.settings.saved') : t('common.save') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: async ()=>{ setTestEmailSending(true); setTestEmailResult(null); try { const res = await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .sendTestEmail */ .FI(); setTestEmailResult("✓ Sent to ".concat(res.to)); } catch (e) { setTestEmailResult("✗ Error: ".concat(e.message)); } finally{ setTestEmailSending(false); setTimeout(()=>setTestEmailResult(null), 5000); } }, disabled: testEmailSending, 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: testEmailSending ? t('admin.settings.smtp.sending') : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "flex items-center justify-center gap-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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" }) }), t('admin.settings.smtp.test') ] }) }), testEmailResult && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-center font-medium ".concat(testEmailResult.startsWith('✓') ? 'text-green-600' : 'text-red-500'), children: testEmailResult }) ] }) ] }), settingsTab === 'payment' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-6 max-w-lg", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-between mb-5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h3", { className: "font-semibold text-gray-800", children: "ePay — Piraeus Bank" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400", children: "ГреческОй платёжМый шлюз" }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "flex items-center gap-2 cursor-pointer", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-sm text-gray-500", children: t('admin.settings.active') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>setEPayForm((f)=>({ ...f, enabled: !f.enabled })), className: "relative w-10 h-6 rounded-full p-0 transition-colors cursor-pointer ".concat(ePayForm.enabled ? 'bg-green-600' : 'bg-gray-300'), children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "absolute left-0 top-1 w-4 h-4 bg-white rounded-full shadow transition-transform ".concat(ePayForm.enabled ? 'translate-x-5' : 'translate-x-1') }) }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.env.label') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("select", { value: ePayForm.environment, onChange: (e)=>setEPayForm((f)=>({ ...f, environment: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "test", children: t('admin.settings.env.test') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "production", children: t('admin.settings.env.prod') }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.merchant_id') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: ePayForm.merchantId, onChange: (e)=>setEPayForm((f)=>({ ...f, merchantId: e.target.value })), placeholder: t('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" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "grid grid-cols-2 gap-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: "API User" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: ePayForm.apiUser, onChange: (e)=>setEPayForm((f)=>({ ...f, apiUser: e.target.value })), autoComplete: "off", className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: "API Password" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "password", value: ePayForm.apiPassword, onChange: (e)=>setEPayForm((f)=>({ ...f, apiPassword: e.target.value })), autoComplete: "new-password", className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: "Confirmation URL (webhook)" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: ePayForm.confirmationUrl, onChange: (e)=>setEPayForm((f)=>({ ...f, confirmationUrl: e.target.value })), placeholder: "https://yoursite.com/api/payments/epay/confirm", className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: "Cancel URL" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: ePayForm.cancelUrl, onChange: (e)=>setEPayForm((f)=>({ ...f, cancelUrl: e.target.value })), placeholder: "https://yoursite.com/payment/cancelled", className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-3 mt-5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: saveEPaySettings, disabled: ePaySaving, className: "px-5 py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700 disabled:opacity-50", children: ePaySaving ? t('admin.settings.saving') : t('common.save') }), ePaySaved && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-sm text-green-600", children: t('admin.settings.saved') }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-4 h-4 shrink-0 mt-0.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("circle", { cx: "12", cy: "12", r: "10" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: "12", y1: "8", x2: "12", y2: "12" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: "12", y1: "16", x2: "12.01", y2: "16" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { children: t('admin.settings.payment.hint') }) ] }) ] }), settingsTab === 'notifications' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-3 max-w-2xl", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-4 h-4 shrink-0 mt-0.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("circle", { cx: "12", cy: "12", r: "10" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: "12", y1: "8", x2: "12", y2: "12" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: "12", y1: "16", x2: "12.01", y2: "16" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { children: [ t('admin.notif.vars_hint'), ' ', TEMPLATE_HINT_VARS.map((name)=>{ const v = "{{".concat(name, "}}"); return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("code", { className: "mx-0.5 bg-green-100 text-gray-800 px-1.5 py-0.5 rounded text-xs font-mono", children: v }, v); }) ] }) ] }), [ { key: 'email_verification', label: t('admin.notif.email_verification'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: t('admin.notif.registration_success'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: t('admin.notif.password_reset'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: t('admin.notif.new_offer'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: t('admin.notif.new_task'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: t('admin.notif.offer_accepted'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" }) }) }, { key: 'new_message', label: t('admin.notif.new_message'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: t('admin.notif.offer_declined'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: t('admin.notif.offer_other_accepted'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: t('admin.notif.task_updated'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: t('admin.notif.deadline_reminder'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: t('admin.notif.task_archived'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: t('admin.notif.referral_reward'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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" }) }) }, // ── Plan / subscription emails ───────────────────────────── { key: 'plan_activated', label: t('admin.email_template.plan_activated'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: t('admin.email_template.plan_upgraded'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 10l7-7m0 0l7 7m-7-7v18" }) }) }, { key: 'plan_downgrade_scheduled', label: t('admin.email_template.plan_downgrade_scheduled'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: t('admin.email_template.plan_downgrade_applied'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19 14l-7 7m0 0l-7-7m7 7V3" }) }) }, { key: 'plan_renewal_reminder', label: t('admin.email_template.plan_renewal_reminder'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: t('admin.email_template.plan_insufficient_funds'), icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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((param)=>{ let { key, label, icon } = param; const localeKey = "".concat(key, "_").concat(templateLocale); var _notifTemplates_localeKey, _ref; const tmpl = (_ref = (_notifTemplates_localeKey = notifTemplates[localeKey]) !== null && _notifTemplates_localeKey !== void 0 ? _notifTemplates_localeKey : notifTemplates[key]) !== null && _ref !== void 0 ? _ref : { subject: '', body: '' }; const isEditing = editingTemplate === key; var _TEMPLATE_VARS_key; const templateVars = (_TEMPLATE_VARS_key = TEMPLATE_VARS[key]) !== null && _TEMPLATE_VARS_key !== void 0 ? _TEMPLATE_VARS_key : []; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 overflow-hidden", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-3 px-5 py-4 cursor-pointer hover:bg-gray-50 select-none", onClick: ()=>setEditingTemplate(isEditing ? null : key), children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-xl shrink-0", children: icon }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "font-medium text-gray-800 text-sm", children: label }), tmpl.subject ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "text-xs text-gray-400 mt-0.5 truncate", children: [ t('admin.notif.tmpl.subject_label'), ": ", tmpl.subject ] }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-xs text-gray-300 mt-0.5 italic", children: t('admin.notif.tmpl.not_set') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-gray-400 transition-transform ".concat(isEditing ? 'rotate-90' : ''), children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("polyline", { points: "9 18 15 12 9 6" }) }) }) ] }), isEditing && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "px-5 pb-5 border-t border-gray-100 pt-4 space-y-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex gap-1 pb-2", children: [ 'el', 'en', 'uk', 'ru' ].map((loc)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>setTemplateLocale(loc), className: "px-3 py-1 text-xs font-medium rounded-md transition-colors ".concat(templateLocale === loc ? 'bg-green-600 text-white' : 'bg-gray-100 text-gray-600 hover:bg-gray-200'), children: loc === 'el' ? 'ΕλληΜικά' : loc === 'en' ? 'English' : loc === 'uk' ? 'УкраїМська' : 'РусскОй' }, loc)) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.notif.tmpl.subject_label') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: tmpl.subject, onChange: (e)=>setNotifTemplates((prev)=>{ var _prev_localeKey; return { ...prev, [localeKey]: { ...(_prev_localeKey = prev[localeKey]) !== null && _prev_localeKey !== void 0 ? _prev_localeKey : { subject: '', body: '' }, subject: e.target.value } }; }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: t('admin.notif.tmpl.body_label') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("textarea", { rows: 7, value: tmpl.body, onChange: (e)=>setNotifTemplates((prev)=>{ var _prev_localeKey; return { ...prev, [localeKey]: { ...(_prev_localeKey = prev[localeKey]) !== null && _prev_localeKey !== void 0 ? _prev_localeKey : { subject: '', body: '' }, body: e.target.value } }; }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 font-mono resize-y", placeholder: "

УважаеЌый {{userName}},

..." }) ] }), templateVars.length > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "rounded-lg border border-amber-200 bg-amber-50 px-3 py-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-xs font-medium text-amber-800 mb-1", children: t('admin.notif.vars_hint') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex flex-wrap gap-1.5", children: templateVars.map((name)=>{ const variable = "{{".concat(name, "}}"); return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("code", { className: "bg-amber-100 text-amber-900 px-1.5 py-0.5 rounded text-xs font-mono", children: variable }, variable); }) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-2 flex-wrap", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>saveTemplate(key), disabled: templateSaving || templateTranslating, className: "px-4 py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700 disabled:opacity-50", children: templateSaving ? t('admin.notif.tmpl.saving') : t('admin.notif.tmpl.save') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { onClick: ()=>autoTranslateTemplate(key), disabled: templateSaving || templateTranslating, 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: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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" }) }), templateTranslating ? t('admin.notif.tmpl.translating') : t('admin.notif.tmpl.translate') ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>setEditingTemplate(null), className: "px-4 py-2 bg-gray-100 text-gray-700 rounded-lg text-sm font-medium hover:bg-gray-200", children: t('admin.notif.tmpl.close') }) ] }) ] }) ] }, key); }) ] }), settingsTab === 'referral' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-6 max-w-lg space-y-5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h3", { className: "font-semibold text-gray-800", children: t('admin.settings.referral.title') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-gray-400 mt-1", children: t('admin.settings.referral.hint') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-between", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm font-medium text-gray-700", children: t('admin.settings.referral.enabled_label') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400", children: t('admin.settings.referral.enabled_hint') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>setReferralForm((f)=>({ ...f, enabled: !f.enabled })), className: "relative w-10 h-6 rounded-full p-0 transition-colors cursor-pointer ".concat(referralForm.enabled ? 'bg-green-600' : 'bg-gray-300'), children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "absolute left-0 top-1 w-4 h-4 bg-white rounded-full shadow transition-transform ".concat(referralForm.enabled ? 'translate-x-5' : 'translate-x-1') }) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "border border-gray-100 rounded-lg p-4 space-y-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs font-semibold text-gray-500 uppercase tracking-wide", children: t('admin.settings.referral.shared_section') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.referral.plan_label') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("select", { value: referralForm.planId, onChange: (e)=>setReferralForm((f)=>({ ...f, planId: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "", children: t('admin.settings.referral.no_plan') }), planRows.map((p)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: p.id, children: p.name }, p.id)) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400 mt-1", children: t('admin.settings.referral.plan_hint') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.referral.days_label') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "number", min: "1", max: "365", value: referralForm.days, onChange: (e)=>setReferralForm((f)=>({ ...f, days: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400 mt-1", children: t('admin.settings.referral.days_hint') }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: saveReferralSettings, disabled: referralSaving, className: "px-5 py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700 disabled:opacity-50", children: referralSaving ? t('admin.settings.saving') : t('common.save') }), referralSaved && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-sm text-green-600", children: t('admin.settings.saved') }) ] }) ] }), settingsTab === 'socials' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-6 max-w-lg space-y-5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h3", { className: "font-semibold text-gray-800 mb-1", children: t('admin.settings.socials.title') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400", children: t('admin.settings.socials.hint') }) ] }), [ { key: 'telegram', label: 'Telegram', placeholder: 'https://t.me/yourname', icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4", viewBox: "0 0 24 24", fill: "currentColor", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4", viewBox: "0 0 24 24", fill: "currentColor", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4", viewBox: "0 0 24 24", fill: "currentColor", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4", viewBox: "0 0 24 24", fill: "currentColor", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4", viewBox: "0 0 24 24", fill: "currentColor", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4", viewBox: "0 0 24 24", fill: "currentColor", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4", viewBox: "0 0 24 24", fill: "currentColor", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4", viewBox: "0 0 24 24", fill: "currentColor", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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((param)=>{ let { key, label, placeholder, icon } = param; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "block text-sm font-medium text-gray-700 mb-1 flex items-center gap-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "".concat(socialForm[key] ? 'text-green-600' : 'text-gray-300'), children: icon }), label, !socialForm[key] && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-xs font-normal text-gray-400 ml-auto", children: "Ме запПлМеМП" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "url", value: socialForm[key], onChange: (e)=>setSocialForm((f)=>({ ...f, [key]: e.target.value })), placeholder: placeholder, className: "w-full border rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 ".concat(socialForm[key] ? 'border-green-300 bg-green-50/30' : 'border-gray-300') }) ] }, key); }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-3 pt-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: saveSocialSettings, disabled: socialSaving, className: "px-5 py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700 disabled:opacity-50", children: socialSaving ? t('admin.settings.saving') : t('common.save') }), socialSaved && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-sm text-green-600", children: t('admin.settings.saved') }) ] }) ] }), settingsTab === 'seo' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-6 max-w-lg space-y-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h3", { className: "font-semibold text-gray-800", children: t('admin.settings.seo.title') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-between", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm font-medium text-gray-700", children: t('admin.settings.seo.maintenance_label') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400 mt-0.5", children: t('admin.settings.seo.maintenance_hint') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>setSeoForm((f)=>({ ...f, maintenanceMode: !f.maintenanceMode })), className: "relative w-10 h-6 rounded-full p-0 transition-colors cursor-pointer flex-shrink-0 ".concat(seoForm.maintenanceMode ? 'bg-red-500' : 'bg-gray-300'), children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "absolute left-0 top-1 w-4 h-4 bg-white rounded-full shadow transition-transform ".concat(seoForm.maintenanceMode ? 'translate-x-5' : 'translate-x-1') }) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-between", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm font-medium text-gray-700", children: t('admin.settings.seo.indexing_label') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400 mt-0.5", children: t('admin.settings.seo.indexing_hint') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>setSeoForm((f)=>({ ...f, indexingEnabled: !f.indexingEnabled })), className: "relative w-10 h-6 rounded-full p-0 transition-colors cursor-pointer flex-shrink-0 ".concat(seoForm.indexingEnabled ? 'bg-green-600' : 'bg-gray-300'), children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "absolute left-0 top-1 w-4 h-4 bg-white rounded-full shadow transition-transform ".concat(seoForm.indexingEnabled ? 'translate-x-5' : 'translate-x-1') }) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "space-y-4", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { className: "text-sm font-medium text-gray-700 mb-2", children: [ t('admin.settings.seo.site_title_label'), " / ", t('admin.settings.seo.site_description_label') ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex gap-1 mb-3", children: [ { code: 'el', flag: '🇬🇷', label: 'EL' }, { code: 'en', flag: '🇬🇧', label: 'EN' }, { code: 'ru', flag: '🇷🇺', label: 'RU' }, { code: 'uk', flag: '🇺🇊', label: 'UK' } ].map((param)=>{ let { code, flag, label } = param; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { type: "button", onClick: ()=>setSeoLangTab(code), className: "flex items-center gap-1 px-3 py-1.5 rounded-lg text-sm font-medium transition-colors ".concat(seoLangTab === code ? 'bg-green-600 text-white' : 'bg-gray-100 text-gray-600 hover:bg-gray-200'), children: [ flag, " ", label ] }, code); }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs font-medium text-gray-500 mb-1", children: t('admin.settings.seo.site_title_label') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: seoForm["siteTitle".concat(seoLangTab.charAt(0).toUpperCase() + seoLangTab.slice(1))], onChange: (e)=>setSeoForm((f)=>({ ...f, ["siteTitle".concat(seoLangTab.charAt(0).toUpperCase() + seoLangTab.slice(1))]: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 mb-3", placeholder: seoLangTab === 'el' ? 'CanHelp — ΚάΞε άΜΞρωπος έχει κάτι Μα προσφέρει' : seoLangTab === 'en' ? 'CanHelp — Everyone has something valuable to offer' : seoLangTab === 'ru' ? 'CanHelp — КажЎый челПвек ЌПжет чеЌ-тП пПЌПчь' : 'CanHelp — КПжеМ Ќає МавОчку, яка ЌПже ЎПпПЌПгтО іМшПЌу' }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs font-medium text-gray-500 mb-1", children: t('admin.settings.seo.site_description_label') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("textarea", { rows: 3, value: seoForm["siteDescription".concat(seoLangTab.charAt(0).toUpperCase() + seoLangTab.slice(1))], onChange: (e)=>setSeoForm((f)=>({ ...f, ["siteDescription".concat(seoLangTab.charAt(0).toUpperCase() + seoLangTab.slice(1))]: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 resize-none", placeholder: seoLangTab === 'el' ? 'Η ελληΜική πλατφόρΌα για online αΜάΞεση εργασιώΜ...' : seoLangTab === 'en' ? 'The Greek platform for online task delegation...' : seoLangTab === 'ru' ? 'Греческая платфПрЌа Ўля ПМлайМ-пПОска спецОалОстПв...' : 'Грецька платфПрЌа Ўля пПшуку фахівців ПМлайМ...' }) ] }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.seo.head_scripts_label') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400 mb-2", children: t('admin.settings.seo.head_scripts_hint') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("textarea", { rows: 6, value: seoForm.headScripts, onChange: (e)=>setSeoForm((f)=>({ ...f, headScripts: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm font-mono focus:outline-none focus:ring-2 focus:ring-blue-400 resize-y", placeholder: '\n', spellCheck: false }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: saveSeoSettings, disabled: seoSaving, className: "px-5 py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700 disabled:opacity-50", children: seoSaving ? t('admin.settings.saving') : t('common.save') }), seoSaved && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-sm text-green-600", children: t('admin.settings.saved') }) ] }) ] }), settingsTab === 'telegram' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-6 max-w-lg space-y-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h3", { className: "font-semibold text-gray-800 mb-1", children: t('admin.settings.telegram.title') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400", children: t('admin.settings.telegram.help') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.telegram.bot_token') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "text", value: telegramForm.botToken, onChange: (e)=>{ setTelegramForm((f)=>({ ...f, botToken: e.target.value })); setVerifyResultTelegramToken(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" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: verifyTelegramToken, disabled: verifyingTelegramToken || !telegramForm.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: verifyingTelegramToken ? '...' : t('admin.settings.telegram.verify') }) ] }), verifyResultTelegramToken && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs mt-1 font-medium ".concat(verifyResultTelegramToken.ok ? 'text-green-600' : 'text-red-500'), children: verifyResultTelegramToken.ok ? "✓ ".concat(verifyResultTelegramToken.msg) : "✗ ".concat(verifyResultTelegramToken.msg) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.settings.telegram.admin_chat_id') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "text", value: telegramForm.adminChatId, onChange: (e)=>setTelegramForm((f)=>({ ...f, adminChatId: e.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" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>testTelegram('admin'), disabled: testingTelegramAdmin || !telegramForm.botToken || !telegramForm.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: testingTelegramAdmin ? '...' : t('admin.settings.telegram.test') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400 mt-1", children: t('admin.settings.telegram.admin_chat_hint') }), testResultTelegramAdmin && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs mt-1 font-medium ".concat(testResultTelegramAdmin.ok ? 'text-green-600' : 'text-red-500'), children: testResultTelegramAdmin.ok ? "✓ ".concat(testResultTelegramAdmin.msg) : "✗ ".concat(testResultTelegramAdmin.msg) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700", children: t('admin.settings.telegram.channels_title') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400 -mt-2", children: t('admin.settings.telegram.channel_hint') }), [ { locale: 'el', flag: '🇬🇷', label: 'ΕλληΜικά', field: 'channelIdEl' }, { locale: 'en', flag: '🇬🇧', label: 'English', field: 'channelIdEn' }, { locale: 'ru', flag: '🇷🇺', label: 'РусскОй', field: 'channelIdRu' }, { locale: 'uk', flag: '🇺🇊', label: 'УкраїМська', field: 'channelIdUk' } ].map((param)=>{ let { locale: loc, flag, label, field } = param; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-1.5 mb-1", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-base leading-none", children: flag }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-xs font-medium text-gray-600", children: label }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "text", value: telegramForm[field], onChange: (e)=>setTelegramForm((f)=>({ ...f, [field]: e.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" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>testTelegram(loc), disabled: testingLocale === loc || !telegramForm.botToken || !telegramForm[field], className: "px-3 py-2 border border-gray-300 rounded-lg text-sm hover:bg-gray-50 disabled:opacity-40 flex-shrink-0", children: testingLocale === loc ? '...' : t('admin.settings.telegram.test') }) ] }), testResultChannels[loc] && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs mt-1 font-medium ".concat(testResultChannels[loc].ok ? 'text-green-600' : 'text-red-500'), children: testResultChannels[loc].ok ? "✓ ".concat(testResultChannels[loc].msg) : "✗ ".concat(testResultChannels[loc].msg) }) ] }, loc); }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-between", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm font-medium text-gray-700", children: t('admin.settings.telegram.notify_registrations') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400 mt-0.5", children: t('admin.settings.telegram.notify_registrations_hint') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>setTelegramForm((f)=>({ ...f, notifyRegistrations: !f.notifyRegistrations })), className: "relative w-10 h-6 rounded-full transition-colors cursor-pointer flex-shrink-0 p-0 border-0 outline-none ".concat(telegramForm.notifyRegistrations ? 'bg-green-600' : 'bg-gray-300'), children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "absolute top-1 left-0 w-4 h-4 bg-white rounded-full shadow transition-transform ".concat(telegramForm.notifyRegistrations ? 'translate-x-5' : 'translate-x-1') }) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-between", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm font-medium text-gray-700", children: t('admin.settings.telegram.post_new_tasks') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400 mt-0.5", children: t('admin.settings.telegram.post_new_tasks_hint') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>setTelegramForm((f)=>({ ...f, postNewTasks: !f.postNewTasks })), className: "relative w-10 h-6 rounded-full transition-colors cursor-pointer flex-shrink-0 p-0 border-0 outline-none ".concat(telegramForm.postNewTasks ? 'bg-green-600' : 'bg-gray-300'), children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "absolute top-1 left-0 w-4 h-4 bg-white rounded-full shadow transition-transform ".concat(telegramForm.postNewTasks ? 'translate-x-5' : 'translate-x-1') }) }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-3 pt-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: saveTelegramSettings, disabled: telegramSaving, className: "px-5 py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700 disabled:opacity-50", children: telegramSaving ? t('admin.settings.saving') : t('common.save') }), telegramSaved && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-sm text-green-600", children: t('admin.settings.saved') }) ] }) ] }) ] }), tab === 'support' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex flex-wrap gap-3 mb-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("form", { className: "flex gap-2", onSubmit: (e)=>{ e.preventDefault(); setSupportQ(supportQInput); setSupportPage(1); }, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: supportQInput, onChange: (e)=>setSupportQInput(e.target.value), placeholder: t('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" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: t('admin.search', 'Search') }), supportQ && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>{ setSupportQInput(''); setSupportQ(''); setSupportPage(1); }, className: "text-sm text-gray-500 hover:text-gray-700 px-2", children: "✕" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("select", { value: supportStatus, onChange: (e)=>{ setSupportStatus(e.target.value); setSupportPage(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: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "", children: t('admin.support.all_statuses', 'All statuses') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "open", children: t('admin.support.status.open', 'Open') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "in_progress", children: t('admin.support.status.in_progress', 'In progress') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "resolved", children: t('admin.support.status.resolved', 'Resolved') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "closed", children: t('admin.support.status.closed', 'Closed') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("select", { value: supportType, onChange: (e)=>{ setSupportType(e.target.value); setSupportPage(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: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "", children: t('admin.support.all_types', 'All types') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("option", { value: "bug", children: [ "\uD83D\uDC1B ", t('support.type.bug', 'Bug') ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("option", { value: "suggestion", children: [ "\uD83D\uDCA1 ", t('support.type.suggestion', 'Suggestion') ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("option", { value: "other", children: [ "\uD83D\uDCAC ", t('support.type.other', 'Other') ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "ml-auto text-sm text-gray-400 self-center", children: [ supportTotal, " ", t('admin.pagination.total', 'total') ] }) ] }), loading ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-center py-10 text-gray-400", children: t('common.loading') }) : supportTickets.length === 0 ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-center py-10 text-gray-400", children: t('admin.support.none', 'No tickets') }) : supportTickets.map((ticket)=>{ const typeColors = { bug: 'bg-red-100 text-red-700', suggestion: 'bg-green-100 text-green-700', other: 'bg-gray-100 text-gray-600' }; const statusColors2 = { 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' }; const typeIcons = { bug: '🐛', suggestion: '💡', other: '💬' }; const isReplying = supportReplyId === ticket.id; var _typeColors_ticket_type, _statusColors2_ticket_status; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-start justify-between gap-4 mb-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-2 flex-wrap mb-1", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "px-2 py-0.5 rounded-full text-xs font-medium ".concat((_typeColors_ticket_type = typeColors[ticket.type]) !== null && _typeColors_ticket_type !== void 0 ? _typeColors_ticket_type : 'bg-gray-100 text-gray-600'), children: [ typeIcons[ticket.type], " ", ticket.type ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "px-2 py-0.5 rounded-full text-xs font-medium ".concat((_statusColors2_ticket_status = statusColors2[ticket.status]) !== null && _statusColors2_ticket_status !== void 0 ? _statusColors2_ticket_status : 'bg-gray-100 text-gray-500'), children: ticket.status }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "text-xs text-gray-400", children: [ "#", ticket.id.slice(0, 8) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h3", { className: "font-semibold text-gray-900 text-sm", children: ticket.subject }), ticket.userName && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { className: "text-xs text-gray-400 mt-0.5", children: [ ticket.userName, " \xb7 ", ticket.userEmail ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400 mt-0.5", children: new Date(ticket.createdAt).toLocaleString(dateLocale) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-2 flex-shrink-0", children: [ ticket.status !== 'closed' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>{ setSupportReplyId(isReplying ? null : ticket.id); setSupportReplyText(ticket.adminReply || ''); }, className: "text-xs px-3 py-1.5 rounded-lg font-medium bg-green-50 text-green-700 hover:bg-green-100", children: isReplying ? t('admin.support.cancel', 'Cancel') : t('admin.support.reply', 'Reply') }), ticket.status === 'open' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .setSupportTicketStatus */ .u0(ticket.id, 'closed').then(()=>setSupportTickets((prev)=>prev.map((t)=>t.id === ticket.id ? { ...t, status: 'closed' } : t))), className: "text-xs px-3 py-1.5 rounded-lg font-medium bg-gray-100 text-gray-600 hover:bg-gray-200", children: t('admin.support.close', 'Close') }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-gray-700 whitespace-pre-wrap bg-gray-50 rounded-lg p-3 mb-3", children: ticket.body }), ticket.adminReply && !isReplying && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-green-50 border border-green-100 rounded-lg p-3 mb-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { className: "text-xs font-medium text-green-600 mb-1", children: [ t('admin.support.your_reply', 'Your reply'), ":" ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-gray-800 whitespace-pre-wrap", children: ticket.adminReply }) ] }), isReplying && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-2 mt-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("textarea", { rows: 3, value: supportReplyText, onChange: (e)=>setSupportReplyText(e.target.value), placeholder: t('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" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-2 items-center", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("select", { id: "status-".concat(ticket.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: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "open", children: t('admin.support.status.open', 'Open') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "in_progress", children: t('admin.support.status.in_progress', 'In progress') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "resolved", children: t('admin.support.status.resolved', 'Resolved') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "closed", children: t('admin.support.status.closed', 'Closed') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { disabled: supportReplySaving || !supportReplyText.trim(), onClick: async ()=>{ const statusEl = document.getElementById("status-".concat(ticket.id)); setSupportReplySaving(true); try { const updated = await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .replyToSupportTicket */ .nT(ticket.id, { adminReply: supportReplyText, status: statusEl === null || statusEl === void 0 ? void 0 : statusEl.value }); setSupportTickets((prev)=>prev.map((t)=>t.id === ticket.id ? { ...t, ...updated } : t)); setSupportReplyId(null); } catch (e) {} finally{ setSupportReplySaving(false); } }, 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: supportReplySaving ? '...' : t('admin.support.send_reply', 'Send') }) ] }) ] }) ] }, ticket.id); }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(Pagination, { page: supportPage, total: supportTotal, limit: 30, onChange: setSupportPage, totalLabel: t('admin.pagination.total') }) ] }), tab === 'push' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-5 space-y-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "text-lg font-semibold text-gray-800", children: "Push-рассылка" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>setPushMode('broadcast'), className: "px-3 py-1.5 text-sm rounded-lg border ".concat(pushMode === 'broadcast' ? 'bg-green-600 text-white border-green-600' : 'bg-white text-gray-700 border-gray-300'), children: "ВсеЌ пПльзПвателяЌ" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>setPushMode('user'), className: "px-3 py-1.5 text-sm rounded-lg border ".concat(pushMode === 'user' ? 'bg-green-600 text-white border-green-600' : 'bg-white text-gray-700 border-gray-300'), children: "КПМкретМПЌу пПльзПвателю" }) ] }), pushMode === 'user' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "text-sm text-gray-600 block mb-1", children: "User ID" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: pushTargetUserId, onChange: (e)=>setPushTargetUserId(e.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" }) ] }), pushMode === 'broadcast' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "flex items-center gap-2 text-sm text-gray-700", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "checkbox", checked: pushOnlyActive, onChange: (e)=>setPushOnlyActive(e.target.checked) }), "ТПлькП актОвМыЌ пПльзПвателяЌ" ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "text-sm text-gray-600 block mb-1", children: "ЗагПлПвПк" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: pushTitle, onChange: (e)=>setPushTitle(e.target.value), placeholder: "НапрОЌер: НПвые заЎачО ряЎПЌ с ваЌО", className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "text-sm text-gray-600 block mb-1", children: "Текст" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("textarea", { rows: 3, value: pushBody, onChange: (e)=>setPushBody(e.target.value), placeholder: "КПрПткОй текст увеЎПЌлеМОя", className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 resize-none" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "text-sm text-gray-600 block mb-1", children: "ТОп" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: pushType, onChange: (e)=>setPushType(e.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" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "text-sm text-gray-600 block mb-1", children: "Reference ID (ПпцОПМальМП)" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: pushReferenceId, onChange: (e)=>setPushReferenceId(e.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" }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: sendAdminPush, disabled: pushSending || !pushTitle.trim() || pushMode === 'user' && !pushTargetUserId.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: pushSending ? 'Отправка...' : 'ОтправОть Push' }), pushError && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-sm text-red-600", children: pushError }) ] }) ] }), pushResult && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h3", { className: "font-semibold text-gray-800 mb-3", children: "Результат" }), 'usersTotal' in pushResult ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "grid grid-cols-2 md:grid-cols-5 gap-3 text-sm", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "rounded-lg bg-gray-50 border border-gray-200 px-3 py-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-gray-500", children: "ППльзПвателей" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-gray-900 font-semibold", children: pushResult.usersTotal }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "rounded-lg bg-gray-50 border border-gray-200 px-3 py-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-gray-500", children: "ППлучОлО" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-gray-900 font-semibold", children: pushResult.usersWithSent }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "rounded-lg bg-gray-50 border border-gray-200 px-3 py-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-gray-500", children: "ОтправлеМП push" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-gray-900 font-semibold", children: pushResult.pushesSent }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "rounded-lg bg-gray-50 border border-gray-200 px-3 py-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-gray-500", children: "НевалОЎМые тПкеМы" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-gray-900 font-semibold", children: pushResult.invalidTokens }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "rounded-lg bg-gray-50 border border-gray-200 px-3 py-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-gray-500", children: "ОшОбкО пП userId" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-gray-900 font-semibold", children: pushResult.failedUsers.length }) ] }) ] }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "grid grid-cols-2 md:grid-cols-4 gap-3 text-sm", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "rounded-lg bg-gray-50 border border-gray-200 px-3 py-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-gray-500", children: "User ID" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-gray-900 font-mono text-xs break-all", children: pushResult.targetUserId }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "rounded-lg bg-gray-50 border border-gray-200 px-3 py-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-gray-500", children: "ТПкеМПв МайЎеМП" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-gray-900 font-semibold", children: (_pushResult_tokensFound = pushResult.tokensFound) !== null && _pushResult_tokensFound !== void 0 ? _pushResult_tokensFound : 0 }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "rounded-lg bg-gray-50 border border-gray-200 px-3 py-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-gray-500", children: "ОтправлеМП push" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-gray-900 font-semibold", children: pushResult.sent }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "rounded-lg bg-gray-50 border border-gray-200 px-3 py-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-gray-500", children: "НевалОЎМые тПкеМы" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-gray-900 font-semibold", children: pushResult.invalidTokens }) ] }) ] }), 'usersTotal' in pushResult ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: ((_pushResult_usersWithoutTokens = pushResult.usersWithoutTokens) !== null && _pushResult_usersWithoutTokens !== void 0 ? _pushResult_usersWithoutTokens : 0) > 0 || ((_pushResult_usersConfigBlocked = pushResult.usersConfigBlocked) !== null && _pushResult_usersConfigBlocked !== void 0 ? _pushResult_usersConfigBlocked : 0) > 0 || ((_pushResult_usersAuthFailed = pushResult.usersAuthFailed) !== null && _pushResult_usersAuthFailed !== void 0 ? _pushResult_usersAuthFailed : 0) > 0 || ((_pushResult_usersAllFailed = pushResult.usersAllFailed) !== null && _pushResult_usersAllFailed !== void 0 ? _pushResult_usersAllFailed : 0) > 0 ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "mt-3 rounded-lg border border-amber-200 bg-amber-50 px-3 py-2 text-xs text-amber-900", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ "ДОагМПстОка: без тПкеМПв — ", (_pushResult_usersWithoutTokens1 = pushResult.usersWithoutTokens) !== null && _pushResult_usersWithoutTokens1 !== void 0 ? _pushResult_usersWithoutTokens1 : 0, ", FCM Ме МастрПеМ — ", (_pushResult_usersConfigBlocked1 = pushResult.usersConfigBlocked) !== null && _pushResult_usersConfigBlocked1 !== void 0 ? _pushResult_usersConfigBlocked1 : 0, ", ПшОбка auth FCM — ", (_pushResult_usersAuthFailed1 = pushResult.usersAuthFailed) !== null && _pushResult_usersAuthFailed1 !== void 0 ? _pushResult_usersAuthFailed1 : 0, ", FCM send failed — ", (_pushResult_usersAllFailed1 = pushResult.usersAllFailed) !== null && _pushResult_usersAllFailed1 !== void 0 ? _pushResult_usersAllFailed1 : 0 ] }), pushResult.failedReasonStats && Object.keys(pushResult.failedReasonStats).length > 0 ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "mt-1", children: [ "КПЎы ПшОбПк FCM: ", Object.entries(pushResult.failedReasonStats).map((param)=>{ let [key, count] = param; return "".concat(key, ": ").concat(count); }).join(', ') ] }) : null, pushResult.failedReasonSample ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "mt-1", children: [ "ПрОЌер ПшОбкО: ", describeFcmFailure(pushResult.failedReasonStats ? Object.keys(pushResult.failedReasonStats)[0] : null, pushResult.failedReasonSample) ] }) : null ] }) : null }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: pushResult.reason ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "mt-3 rounded-lg border border-amber-200 bg-amber-50 px-3 py-2 text-xs text-amber-900", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ "ДОагМПстОка: ", pushResult.reason === 'no_tokens' ? 'у пПльзПвателя Мет push-тПкеМПв' : pushResult.reason === 'fcm_not_configured' ? 'FCM Ме МастрПеМ Ма API (переЌеММые FCM_*)' : pushResult.reason === 'fcm_auth_failed' ? 'ПшОбка автПрОзацОО FCM (service account)' : describeFcmFailure(pushResult.failureKey, pushResult.failureMessage) ] }), pushResult.failureKey ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "mt-1", children: [ "КПЎ FCM: ", pushResult.failureKey ] }) : null, pushResult.failureMessage ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "mt-1", children: [ "СППбщеМОе FCM: ", pushResult.failureMessage ] }) : null ] }) : null }) ] }) ] }), tab === 'backup' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("h2", { className: "text-lg font-semibold text-gray-800 flex items-center gap-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-5 h-5 text-green-600", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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" }) }), t('admin.backup.title', 'Backup') ] }), backupMsg && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "".concat(backupMsgError ? '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: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { children: backupMsg }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>setBackupMsg(null), className: "".concat(backupMsgError ? 'text-red-500 hover:text-red-700' : 'text-green-500 hover:text-green-700', " ml-4"), children: "\xd7" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-5 flex items-center justify-between", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "font-medium text-gray-800 text-sm", children: t('admin.backup.autoBackup', 'Auto Backup') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-500 mt-0.5", children: t('admin.backup.autoBackupDesc', 'Create a backup every day automatically') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { disabled: backupAutoSaving, onClick: async ()=>{ setBackupAutoSaving(true); try { await (0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .request */ .Em)('/admin/backup/settings', { method: 'PUT', body: JSON.stringify({ autoEnabled: !backupAutoEnabled }) }); setBackupAutoEnabled((v)=>!v); } catch (e) {} setBackupAutoSaving(false); }, className: "relative w-11 h-6 rounded-full transition-colors ".concat(backupAutoEnabled ? 'bg-green-600' : 'bg-gray-300', " ").concat(backupAutoSaving ? 'opacity-50' : ''), children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "absolute top-0.5 left-0.5 w-5 h-5 rounded-full bg-white shadow transition-transform ".concat(backupAutoEnabled ? 'translate-x-5' : 'translate-x-0') }) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h3", { className: "font-semibold text-gray-800 text-sm mb-4", children: t('admin.backup.title', 'Database Backup') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex flex-wrap gap-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { disabled: backupExporting, onClick: async ()=>{ setBackupExporting(true); try { const BASE = "https://api.canhelp.gr" || 0; const res = await fetch("".concat(BASE, "/api/admin/backup/export"), { credentials: 'include' }); if (!res.ok) throw new Error('Export failed'); const blob = await res.blob(); const url = URL.createObjectURL(blob); const a = document.createElement('a'); a.href = url; a.download = "backup_".concat(new Date().toISOString().slice(0, 10), ".sql.gz"); a.click(); URL.revokeObjectURL(url); setBackupSuccess(t('admin.backup.exportSuccess', 'Export successful')); } catch (e) { setBackupError(e.message || 'Error'); } setBackupExporting(false); }, 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: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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" }) }), backupExporting ? t('admin.backup.exporting', 'Exporting...') : t('admin.backup.exportAll', 'Export Full DB') ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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 ".concat(backupImporting === 'full' ? 'opacity-50 pointer-events-none' : ''), children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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" }) }), backupImporting === 'full' ? t('admin.backup.importing', 'Importing...') : t('admin.backup.importAll', 'Import Full DB'), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "file", accept: ".sql.gz,.gz", className: "hidden", onChange: async (e)=>{ var _e_target_files; const file = (_e_target_files = e.target.files) === null || _e_target_files === void 0 ? void 0 : _e_target_files[0]; if (!file) return; if (!window.confirm(t('admin.backup.restoreConfirm', 'Restore from this backup?'))) return; setBackupImporting('full'); try { const fd = new FormData(); fd.append('file', file); const BASE = "https://api.canhelp.gr" || 0; const res = await fetch("".concat(BASE, "/api/admin/backup/import"), { method: 'POST', credentials: 'include', body: fd }); if (!res.ok) throw new Error('Import failed'); setBackupSuccess(t('admin.backup.importSuccess', 'Import successful')); } catch (err) { setBackupError(err.message || 'Error'); } setBackupImporting(null); e.target.value = ''; } }) ] }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h3", { className: "font-semibold text-gray-800 text-sm mb-4", children: t('admin.backup.storedBackups', 'Stored Backups') }), backupStoredFiles.length === 0 ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-gray-400", children: t('admin.backup.noStoredBackups', 'No stored backups') }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "space-y-2", children: backupStoredFiles.map((f)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-between py-2 px-3 bg-gray-50 rounded-lg border border-gray-100", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm font-medium text-gray-800", children: f.name === 'backup_today' ? t('admin.backup.today', 'Today') : t('admin.backup.yesterday', 'Yesterday') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { className: "text-xs text-gray-400", children: [ t('admin.backup.size', 'Size'), ": ", (f.size / 1024).toFixed(1), " KB \xb7 ", t('admin.backup.date', 'Date'), ": ", new Date(f.date).toLocaleString() ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { disabled: backupRestoring === f.name, onClick: async ()=>{ if (!window.confirm(t('admin.backup.restoreConfirm', 'Restore from this backup?'))) return; setBackupRestoring(f.name); try { await (0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .request */ .Em)('/admin/backup/restore', { method: 'POST', body: JSON.stringify({ name: f.name }) }); setBackupSuccess(t('admin.backup.restoreSuccess', 'Restore successful')); } catch (err) { setBackupError(err.message || 'Error'); } setBackupRestoring(null); }, className: "text-sm text-green-600 hover:text-gray-800 font-medium disabled:opacity-50", children: backupRestoring === f.name ? t('admin.backup.restoring', 'Restoring...') : t('admin.backup.restore', 'Restore') }) ] }, f.name)) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h3", { className: "font-semibold text-gray-800 text-sm mb-4", children: t('admin.backup.tables', 'Tables') }), backupTablesLoading ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-2 text-sm text-gray-400", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-4 h-4 animate-spin", fill: "none", viewBox: "0 0 24 24", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { className: "opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8v8z" }) ] }), t('common.loading', 'Loading...') ] }) : backupTables.length === 0 ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-gray-400", children: t('admin.noData', 'No data') }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "overflow-x-auto", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("table", { className: "w-full text-sm", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("tbody", { className: "divide-y divide-gray-100", children: backupTables.map((tbl)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("tr", { className: "hover:bg-gray-50", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "py-2 pr-4 font-mono text-gray-700", children: tbl }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "py-2 text-right", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-end gap-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: async ()=>{ try { const BASE = "https://api.canhelp.gr" || 0; const res = await fetch("".concat(BASE, "/api/admin/backup/export/").concat(tbl), { credentials: 'include' }); if (!res.ok) throw new Error('Export failed'); const blob = await res.blob(); const url = URL.createObjectURL(blob); const a = document.createElement('a'); a.href = url; a.download = "".concat(tbl, "_").concat(new Date().toISOString().slice(0, 10), ".sql.gz"); a.click(); URL.revokeObjectURL(url); } catch (err) { setBackupError(err.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: t('admin.backup.exportTable', 'Export') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: [ backupImporting === tbl ? t('admin.backup.importing', 'Importing...') : t('admin.backup.importTable', 'Import'), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "file", accept: ".sql.gz,.gz", className: "hidden", onChange: async (e)=>{ var _e_target_files; const file = (_e_target_files = e.target.files) === null || _e_target_files === void 0 ? void 0 : _e_target_files[0]; if (!file) return; if (!window.confirm(t('admin.backup.restoreConfirm', 'Restore from this backup?'))) return; setBackupImporting(tbl); try { const fd = new FormData(); fd.append('file', file); const BASE = "https://api.canhelp.gr" || 0; const res = await fetch("".concat(BASE, "/api/admin/backup/import/").concat(tbl), { method: 'POST', credentials: 'include', body: fd }); if (!res.ok) { const errData = await res.json().catch(()=>({ error: 'Import failed' })); throw new Error(errData.error || 'Import failed'); } setBackupSuccess(t('admin.backup.importSuccess', 'Import successful')); } catch (err) { setBackupError(err.message || 'Error'); } setBackupImporting(null); e.target.value = ''; } }) ] }) ] }) }) ] }, tbl)) }) }) }) ] }) ] }), tab === 'translations' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "text-base font-semibold text-gray-900", children: "ПеревПЎы" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-gray-500 mt-0.5", children: "АвтПЌатОческОй перевПЎ прПпущеММых зМачеМОй пП таблОцаЌ" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-4 flex flex-wrap gap-4 items-end", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: "ИстПчМОк" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("select", { value: transFromLang, onChange: (e)=>setTransFromLang(e.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: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "el", children: "\uD83C\uDDEC\uD83C\uDDF7 Greek" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "en", children: "\uD83C\uDDEC\uD83C\uDDE7 English" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "ru", children: "\uD83C\uDDF7\uD83C\uDDFA Russian" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "uk", children: "\uD83C\uDDFA\uD83C\uDDE6 Ukrainian" }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M13 7l5 5-5 5M6 12h12" }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs font-medium text-gray-600 mb-1", children: "ПеревестО Ма" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("select", { value: transLang, onChange: (e)=>setTransLang(e.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: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "el", children: "\uD83C\uDDEC\uD83C\uDDF7 Greek" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "en", children: "\uD83C\uDDEC\uD83C\uDDE7 English" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "ru", children: "\uD83C\uDDF7\uD83C\uDDFA Russian" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "uk", children: "\uD83C\uDDFA\uD83C\uDDE6 Ukrainian" }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "ml-auto self-end", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "text-sm font-semibold text-gray-700 flex items-center gap-2", children: [ { el: '🇬🇷', en: '🇬🇧', ru: '🇷🇺', uk: '🇺🇊' }[transFromLang], " ", transFromLang.toUpperCase(), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 text-gray-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M13 7l5 5-5 5M6 12h12" }) }), { el: '🇬🇷', en: '🇬🇧', ru: '🇷🇺', uk: '🇺🇊' }[transLang], " ", transLang.toUpperCase() ] }) }) ] }), transMsg && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-sm px-4 py-2 rounded-lg ".concat(transMsg.error ? 'bg-red-50 text-red-700' : 'bg-green-50 text-green-700'), children: transMsg.text }), transStatsLoading ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-2 text-sm text-gray-400 py-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-4 h-4 animate-spin", fill: "none", viewBox: "0 0 24 24", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { className: "opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8v8z" }) ] }), "Загрузка " ] }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "grid gap-4 sm:grid-cols-2 lg:grid-cols-3", children: (transStats !== null && transStats !== void 0 ? transStats : []).map((tbl)=>{ const isTasks = tbl.name === 'tasks'; // For tasks: total missing across all langs (tasks may miss multiple langs each) const totalMissingAllLangs = Object.values(tbl.missing).reduce((a, b)=>a + b, 0); var _tbl_missing_transLang; const missingCount = isTasks ? totalMissingAllLangs : (_tbl_missing_transLang = tbl.missing[transLang]) !== null && _tbl_missing_transLang !== void 0 ? _tbl_missing_transLang : 0; const isTranslating = !!transTableTranslating[tbl.name]; const anyTranslating = Object.values(transTableTranslating).some(Boolean); return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-5 flex flex-col", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-start justify-between", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "font-semibold text-gray-900 text-sm", children: tbl.label }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400 mt-0.5", children: tbl.name }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-xs font-semibold px-2 py-0.5 rounded-full ".concat(missingCount > 0 ? 'bg-red-100 text-red-700' : 'bg-green-100 text-green-700'), children: missingCount > 0 ? "".concat(missingCount, " missing") : 'Complete' }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { className: "text-xs text-gray-500 mt-3", children: [ "ВсегП: ", tbl.total, isTasks && ' · с языка ПрОгОМала Ма все ПстальМые' ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "mt-2 flex flex-wrap gap-1", children: [ 'el', 'en', 'ru', 'uk' ].map((lang)=>{ var _tbl_missing_lang; const cnt = (_tbl_missing_lang = tbl.missing[lang]) !== null && _tbl_missing_lang !== void 0 ? _tbl_missing_lang : 0; const isClickable = isTasks && cnt > 0; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { type: "button", disabled: !isClickable, onClick: isClickable ? async ()=>{ setTransPreview({ lang, loading: true, rows: [] }); try { const d = await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getTasksTranslationPreview */ .QY(lang, 50); setTransPreview({ lang, loading: false, rows: d.rows }); } catch (e) { setTransPreview({ lang, loading: false, rows: [] }); } } : undefined, className: "text-xs px-2 py-0.5 rounded-full border transition ".concat(cnt > 0 ? 'border-red-200 bg-red-50 text-red-600' + (isClickable ? ' cursor-pointer hover:bg-red-100' : '') : 'border-green-200 bg-green-50 text-green-600 cursor-default'), children: [ lang, ": ", cnt > 0 ? "-".concat(cnt) : '✓' ] }, lang); }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "mt-4 mt-auto pt-4", children: missingCount === 0 ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-1.5 text-xs text-emerald-600", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3.5 h-3.5 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" }) }), "Все перевПЎы запПлМеМы" ] }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { disabled: anyTranslating, onClick: async ()=>{ if (!isTasks && transFromLang === transLang) { setTransMsg({ text: 'ИсхПЎМый О целевПй язык сПвпаЎают', error: true }); return; } setTransTableTranslating((prev)=>({ ...prev, [tbl.name]: true })); setTransMsg(null); try { const res = isTasks ? await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .autoTranslateTasks */ .I(500) : tbl.name === 'email_templates' ? await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .autoTranslateEmailTemplates */ .fu(transLang, transFromLang) : await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .autoTranslate */ .cp(tbl.name, transLang, transFromLang, 500); setTransMsg({ text: "".concat(tbl.label, ": translated ").concat(res.translated, " of ").concat(res.total) + (res.failed > 0 ? " \xb7 errors: ".concat(res.failed) : ''), error: res.failed > 0 && res.translated === 0 }); _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getTranslationsStats */ .YQ().then((d)=>setTransStats(d.tables)).catch(()=>{}); } catch (err) { const msg = (err === null || err === void 0 ? void 0 : err.response) ? await err.response.text().catch(()=>err.message) : err.message || 'Error'; setTransMsg({ text: "Error: ".concat(msg), error: true }); } finally{ setTransTableTranslating((prev)=>{ const n = { ...prev }; delete n[tbl.name]; return n; }); } }, 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: isTranslating ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-3.5 h-3.5 animate-spin flex-shrink-0", fill: "none", viewBox: "0 0 24 24", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { className: "opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8v8z" }) ] }), "Translating..." ] }) : isTasks ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3.5 h-3.5 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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 ", missingCount ] }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3.5 h-3.5 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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 ", missingCount, " \xb7 ", { el: '🇬🇷', en: '🇬🇧', ru: '🇷🇺', uk: '🇺🇊' }[transFromLang], " ", transFromLang.toUpperCase(), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M13 7l5 5-5 5M6 12h12" }) }), { el: '🇬🇷', en: '🇬🇧', ru: '🇷🇺', uk: '🇺🇊' }[transLang], " ", transLang.toUpperCase() ] }) }) }) ] }, tbl.name); }) }) ] }), tab === 'dbcheck' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(DbCheckTab, {}), tab === 'referrals' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "grid grid-cols-3 gap-4", children: [ { label: 'РеферерПв', value: (_referralsData_totalReferrers = referralsData === null || referralsData === void 0 ? void 0 : referralsData.totalReferrers) !== null && _referralsData_totalReferrers !== void 0 ? _referralsData_totalReferrers : '—', color: 'text-green-600' }, { label: 'ПрОглашеМОй', value: (_referralsData_totalReferrals = referralsData === null || referralsData === void 0 ? void 0 : referralsData.totalReferrals) !== null && _referralsData_totalReferrals !== void 0 ? _referralsData_totalReferrals : '—', color: 'text-purple-600' }, { label: 'АктОвМых МаграЎ', value: (_referralsData_activeRewards = referralsData === null || referralsData === void 0 ? void 0 : referralsData.activeRewards) !== null && _referralsData_activeRewards !== void 0 ? _referralsData_activeRewards : '—', color: 'text-green-600' } ].map((param)=>{ let { label, value, color } = param; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-2xl border border-gray-200 p-5 text-center", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-3xl font-bold ".concat(color), children: value }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-xs text-gray-500 mt-1", children: label }) ] }, label); }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-2xl border border-gray-200 overflow-hidden", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "px-5 py-4 border-b border-gray-100 flex items-center justify-between", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "font-semibold text-gray-800", children: "ДеревП рефералПв" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { onClick: ()=>{ setReferralsLoading(true); _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminReferrals */ .cJ().then(setReferralsData).catch(()=>{}).finally(()=>setReferralsLoading(false)); }, className: "text-xs text-green-600 hover:underline flex items-center gap-1", children: [ referralsLoading && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-3 h-3 animate-spin", fill: "none", viewBox: "0 0 24 24", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { className: "opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8v8z" }) ] }), "ОбМПвОть" ] }) ] }), referralsLoading && !referralsData ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex justify-center py-16", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-6 h-6 animate-spin text-purple-600", fill: "none", viewBox: "0 0 24 24", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { className: "opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8v8z" }) ] }) }) : !referralsData || referralsData.tree.length === 0 ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "py-16 text-center text-sm text-gray-400", children: "Нет ЎаММых П рефералах" }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "divide-y divide-gray-100", children: referralsData.tree.map((node)=>{ var _node_referrer, _node_referrer1; var _node_referrer_id; const rid = (_node_referrer_id = (_node_referrer = node.referrer) === null || _node_referrer === void 0 ? void 0 : _node_referrer.id) !== null && _node_referrer_id !== void 0 ? _node_referrer_id : 'unknown'; const isExpanded = referralsExpanded.has(rid); var _node_referrer_firstName, _node_referrer_lastName; const referrerName = node.referrer ? "".concat((_node_referrer_firstName = node.referrer.firstName) !== null && _node_referrer_firstName !== void 0 ? _node_referrer_firstName : '', " ").concat((_node_referrer_lastName = node.referrer.lastName) !== null && _node_referrer_lastName !== void 0 ? _node_referrer_lastName : '').trim() || node.referrer.email : '(уЎалёМ)'; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { className: "w-full flex items-center gap-3 px-5 py-3.5 hover:bg-gray-50 text-left transition-colors", onClick: ()=>setReferralsExpanded((prev)=>{ const next = new Set(prev); next.has(rid) ? next.delete(rid) : next.add(rid); return next; }), children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 text-gray-400 flex-shrink-0 transition-transform ".concat(isExpanded ? 'rotate-90' : ''), fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 5l7 7-7 7" }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "font-medium text-sm text-gray-900", children: referrerName }), node.referrer && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "ml-2 text-xs text-gray-400", children: node.referrer.email }) ] }), ((_node_referrer1 = node.referrer) === null || _node_referrer1 === void 0 ? void 0 : _node_referrer1.referralCode) && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("code", { className: "text-xs bg-gray-100 text-gray-600 px-2 py-0.5 rounded font-mono", children: node.referrer.referralCode }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "ml-3 text-xs font-semibold text-purple-700 bg-purple-50 px-2 py-0.5 rounded-full", children: [ node.referees.length, " реф." ] }) ] }), isExpanded && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "bg-gray-50 border-t border-gray-100", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("table", { className: "w-full text-xs", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("thead", { children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("tr", { className: "border-b border-gray-200", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "text-left px-10 py-2 font-semibold text-gray-500", children: "ПрОглашёММый" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "text-left px-3 py-2 font-semibold text-gray-500", children: "Email" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "text-center px-3 py-2 font-semibold text-gray-500", children: "+ЎМей" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "text-center px-3 py-2 font-semibold text-gray-500", children: "Истекает" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "text-center px-3 py-2 font-semibold text-gray-500", children: "Дата" }) ] }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("tbody", { children: node.referees.map((referee)=>{ var _referee_firstName, _referee_lastName; const refName = "".concat((_referee_firstName = referee.firstName) !== null && _referee_firstName !== void 0 ? _referee_firstName : '', " ").concat((_referee_lastName = referee.lastName) !== null && _referee_lastName !== void 0 ? _referee_lastName : '').trim() || referee.email; const expiresAt = new Date(referee.expiresAt); const createdAt = new Date(referee.createdAt); const isActive = expiresAt > new Date(); return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("tr", { className: "border-b border-gray-100 last:border-0 hover:bg-white transition-colors", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-10 py-2.5 font-medium text-gray-800", children: refName }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-3 py-2.5 text-gray-500", children: referee.email }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-3 py-2.5 text-center", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "font-semibold text-green-700", children: [ "+", referee.daysAdded ] }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-3 py-2.5 text-center", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "px-1.5 py-0.5 rounded text-xs font-medium ".concat(isActive ? 'bg-green-100 text-green-700' : 'bg-gray-100 text-gray-500'), children: expiresAt.toLocaleDateString('ru-RU', { day: '2-digit', month: '2-digit', year: '2-digit' }) }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "px-3 py-2.5 text-center text-gray-400", children: createdAt.toLocaleDateString('ru-RU', { day: '2-digit', month: '2-digit', year: '2-digit' }) }) ] }, referee.id); }) }) ] }) }) ] }, rid); }) }) ] }) ] }), transPreview && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "fixed inset-0 z-50 flex items-center justify-center bg-black/50 px-4", onClick: ()=>setTransPreview(null), children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-2xl shadow-xl w-full max-w-3xl max-h-[80vh] flex flex-col", onClick: (e)=>e.stopPropagation(), children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-between px-6 py-4 border-b border-gray-100 flex-shrink-0", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("h3", { className: "font-semibold text-gray-900", children: [ "ЗаЎачО без перевПЎа: ", /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "uppercase font-bold text-red-600", children: transPreview.lang }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400 mt-0.5", children: "ППказаМы первые 50 запОсей" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>setTransPreview(null), className: "text-gray-400 hover:text-gray-600 p-1", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-5 h-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" }) }) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "overflow-y-auto flex-1 px-6 py-4", children: transPreview.loading ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex justify-center py-12", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-6 h-6 animate-spin text-purple-600", fill: "none", viewBox: "0 0 24 24", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { className: "opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8v8z" }) ] }) }) : transPreview.rows.length === 0 ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-gray-500 text-center py-12", children: "Нет заЎач без перевПЎа" }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("table", { className: "w-full text-xs border-collapse", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("thead", { children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("tr", { className: "border-b border-gray-200", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "text-left py-2 pr-3 font-semibold text-gray-600 w-[35%]", children: "ОрОгОМал (title)" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "text-center py-2 px-2 font-semibold text-gray-600", children: "orig" }), [ 'el', 'en', 'ru', 'uk' ].map((l)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("th", { className: "text-center py-2 px-2 font-semibold text-gray-600 w-[14%]", children: l }, l)) ] }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("tbody", { children: transPreview.rows.map((row)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("tr", { className: "border-b border-gray-100 hover:bg-gray-50", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "py-2 pr-3 text-gray-800 truncate max-w-[200px]", title: row.title, children: row.title }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "py-2 px-2 text-center", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "uppercase font-semibold text-purple-700 bg-purple-50 px-1.5 py-0.5 rounded", children: row.originalLocale }) }), [ [ 'el', row.titleEl ], [ 'en', row.titleEn ], [ 'ru', row.titleRu ], [ 'uk', row.titleUk ] ].map((param)=>{ let [l, val] = param; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("td", { className: "py-2 px-2 text-center", title: val !== null && val !== void 0 ? val : '', children: val ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-emerald-600 font-semibold", children: "✓" }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-red-500 font-semibold", children: "✗" }) }, l); }) ] }, row.id)) }) ] }) }) ] }) }), editUser && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "fixed inset-0 z-50 flex items-center justify-center bg-black/50 px-4", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-2xl shadow-xl w-full max-w-4xl max-h-[90vh] flex flex-col", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-between px-6 py-4 border-b border-gray-100 flex-shrink-0", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "text-base font-semibold text-gray-900", children: t('admin.user_edit.title') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { className: "text-xs text-gray-400 mt-0.5", children: [ editUser.email, " \xb7 ID: ", editUser.id ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>setEditUser(null), className: "text-gray-400 hover:text-gray-600 text-2xl leading-none", children: "\xd7" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex flex-1 min-h-0", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: t('admin.user_edit.tab.profile') }, { id: 'account', label: t('admin.user_edit.tab.account') }, { id: 'balance', label: t('admin.user_edit.tab.balance') }, { id: 'settings', label: t('admin.user_edit.tab.settings') }, { id: 'site', label: t('admin.user_edit.tab.site') }, { id: 'specialist', label: t('admin.user_edit.tab.specialist') } ].map((item)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>{ setEditUserTab(item.id); if (item.id === 'specialist' && editUser) { setEditUserCardsLoading(true); const loadCards = _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminUserSpecialistCards */ .vy(editUser.id).then(setEditUserCards).catch(()=>{}); const loadCats = catRows.length === 0 ? _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminCategories */ .KD().then(setCatRows).catch(()=>{}) : Promise.resolve(); const loadLocs = locRows.length === 0 ? _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getAdminLocations */ .k_().then(setLocRows).catch(()=>{}) : Promise.resolve(); Promise.all([ loadCards, loadCats, loadLocs ]).finally(()=>setEditUserCardsLoading(false)); } }, className: "w-full text-left px-3 py-2.5 text-sm rounded-lg transition-colors ".concat(editUserTab === item.id ? 'bg-green-50 text-green-700 font-medium' : 'text-gray-600 hover:bg-gray-50'), children: item.label }, item.id)) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex-1 overflow-y-auto p-6", children: [ editUserTab === 'profile' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "p-3 bg-gray-50 rounded-lg text-xs text-gray-500 space-y-0.5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "font-medium", children: [ t('admin.user_edit.registered'), ":" ] }), " ", new Date(editUser.createdAt).toLocaleDateString(dateLocale) ] }), editUser.lastSeenAt && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "font-medium", children: [ t('admin.user_edit.last_seen'), ":" ] }), " ", new Date(editUser.lastSeenAt).toLocaleDateString(dateLocale) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "grid grid-cols-2 gap-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.user_edit.first_name') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: (_editUser_firstName = editUser.firstName) !== null && _editUser_firstName !== void 0 ? _editUser_firstName : '', onChange: (e)=>setEditUser((u)=>({ ...u, firstName: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.user_edit.last_name') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: (_editUser_lastName = editUser.lastName) !== null && _editUser_lastName !== void 0 ? _editUser_lastName : '', onChange: (e)=>setEditUser((u)=>({ ...u, lastName: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.user_edit.phone') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: (_editUser_phone = editUser.phone) !== null && _editUser_phone !== void 0 ? _editUser_phone : '', onChange: (e)=>setEditUser((u)=>({ ...u, phone: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.user_edit.bio') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("textarea", { value: (_editUser_bio = editUser.bio) !== null && _editUser_bio !== void 0 ? _editUser_bio : '', onChange: (e)=>setEditUser((u)=>({ ...u, bio: e.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" }) ] }) ] }), editUserTab === 'account' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.user_edit.email') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: editUser.email }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-between rounded-lg border px-3 py-2 bg-gray-50", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-2", children: [ editUser.emailVerified ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 text-green-500 shrink-0", viewBox: "0 0 20 20", fill: "currentColor", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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" }) }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 text-red-400 shrink-0", viewBox: "0 0 20 20", fill: "currentColor", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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" }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-sm font-medium ".concat(editUser.emailVerified ? 'text-green-700' : 'text-red-600'), children: editUser.emailVerified ? t('admin.user_edit.email_verified') : t('admin.user_edit.email_not_verified') }) ] }), !editUser.emailVerified && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: verifyEmail, disabled: verifyingEmail, className: "text-xs px-3 py-1 rounded-md bg-green-600 text-white hover:bg-green-700 disabled:opacity-50 transition-colors", children: verifyingEmail ? '...' : t('admin.user_edit.verify_email_btn') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "grid grid-cols-2 gap-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.user_edit.role') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("select", { value: editUser.role, onChange: (e)=>setEditUser((u)=>({ ...u, role: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "user", children: t('admin.user_edit.role.user') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "admin", children: t('admin.user_edit.role.admin') }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.user_edit.plan') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("select", { value: (_editUser_planId = editUser.planId) !== null && _editUser_planId !== void 0 ? _editUser_planId : '', onChange: (e)=>setEditUser((u)=>({ ...u, planId: e.target.value || null })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "", children: t('admin.user_edit.no_plan') }), planRows.map((p)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: p.id, children: p.name }, p.id)) ] }) ] }) ] }), editUser.planExpiresAt && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { className: "text-xs text-gray-500", children: [ t('admin.user_edit.plan_expires'), ": ", new Date(editUser.planExpiresAt).toLocaleDateString(dateLocale) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "flex items-center gap-2 cursor-pointer", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "checkbox", checked: editUser.isActive !== false, onChange: (e)=>setEditUser((u)=>({ ...u, isActive: e.target.checked })), className: "w-4 h-4 rounded border-gray-300 text-green-600" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-sm text-gray-700", children: t('admin.user_edit.active') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.user_edit.interface_lang') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("select", { value: (_editUser_locale = editUser.locale) !== null && _editUser_locale !== void 0 ? _editUser_locale : 'el', onChange: (e)=>setEditUser((u)=>({ ...u, locale: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "el", children: "ΕλληΜικά" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "en", children: "English" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "ru", children: "РусскОй" }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: t('admin.user_edit.comm_languages') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex gap-5", children: [ 'el', 'en', 'uk', 'ru' ].map((lang)=>{ var _editUser_languages; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "flex items-center gap-1.5 cursor-pointer", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "checkbox", checked: ((_editUser_languages = editUser.languages) !== null && _editUser_languages !== void 0 ? _editUser_languages : []).includes(lang), onChange: (e)=>{ var _editUser_languages; const langs = (_editUser_languages = editUser.languages) !== null && _editUser_languages !== void 0 ? _editUser_languages : []; setEditUser((u)=>({ ...u, languages: e.target.checked ? [ ...langs.filter((l)=>l !== lang), lang ] : langs.filter((l)=>l !== lang) })); }, className: "w-4 h-4 rounded border-gray-300 text-green-600" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-sm text-gray-700", children: lang === 'el' ? 'ΕλληΜικά' : lang === 'en' ? 'English' : lang === 'uk' ? 'УкраїМська' : 'РусскОй' }) ] }, lang); }) }) ] }) ] }), editUserTab === 'balance' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-between p-5 bg-gray-50 rounded-xl border border-gray-200", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-xs text-gray-500 mb-1", children: t('admin.user_edit.balance') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "text-2xl font-bold text-gray-900", children: [ Number((_editUser_balance = editUser.balance) !== null && _editUser_balance !== void 0 ? _editUser_balance : 0).toFixed(2), " EUR" ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { onClick: ()=>setBalanceModal('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: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M12 4v16m8-8H4" }) }), t('admin.balance.topup.btn') ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { onClick: ()=>setBalanceModal('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: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M20 12H4" }) }), t('admin.balance.withdraw.btn') ] }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-center text-gray-400", children: t('admin.balance.modal_hint') }) ] }), editUserTab === 'settings' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "space-y-4", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-3 pt-1 divide-y divide-gray-100", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "flex items-center justify-between cursor-pointer py-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-sm font-medium text-gray-700", children: t('admin.user_edit.show_contact_info') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-xs text-gray-400", children: t('admin.user_edit.show_contact_info.hint') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "checkbox", checked: (_editUser_showContactInfo = editUser.showContactInfo) !== null && _editUser_showContactInfo !== void 0 ? _editUser_showContactInfo : false, onChange: (e)=>setEditUser((u)=>({ ...u, showContactInfo: e.target.checked })), className: "w-4 h-4 rounded border-gray-300 text-green-600" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "flex items-center justify-between cursor-pointer py-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-sm font-medium text-gray-700", children: t('admin.user_edit.notify_new_tasks') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-xs text-gray-400", children: t('admin.user_edit.notify_new_tasks.hint') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "checkbox", checked: (_editUser_notifyNewTasks = editUser.notifyNewTasks) !== null && _editUser_notifyNewTasks !== void 0 ? _editUser_notifyNewTasks : false, onChange: (e)=>setEditUser((u)=>({ ...u, notifyNewTasks: e.target.checked })), className: "w-4 h-4 rounded border-gray-300 text-green-600" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "flex items-center justify-between cursor-pointer py-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-sm font-medium text-gray-700", children: t('admin.user_edit.notif_messages') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-xs text-gray-400", children: t('admin.user_edit.notif_messages.hint') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "checkbox", checked: (_editUser_notifMessages = editUser.notifMessages) !== null && _editUser_notifMessages !== void 0 ? _editUser_notifMessages : true, onChange: (e)=>setEditUser((u)=>({ ...u, notifMessages: e.target.checked })), className: "w-4 h-4 rounded border-gray-300 text-green-600" }) ] }) ] }) }), editUserTab === 'site' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('admin.user_edit.personal_site_slug') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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/" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: (_editUser_personalSiteSlug = editUser.personalSiteSlug) !== null && _editUser_personalSiteSlug !== void 0 ? _editUser_personalSiteSlug : '', onChange: (e)=>setEditUser((u)=>({ ...u, personalSiteSlug: e.target.value || null })), placeholder: "my-username", className: "flex-1 px-3 py-2 text-sm focus:outline-none" }) ] }), editUser.personalSiteSlug && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("a", { href: "/site/".concat(editUser.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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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" }) }) }) ] }) ] }), editUser.personalSiteSlug && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h4", { className: "text-sm font-semibold text-gray-800 pt-3 border-t border-gray-100", children: t('profile.site.visible_title') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "space-y-1", children: [ { key: 'showBio', label: t('profile.site.visible.bio') }, { key: 'showRating', label: t('profile.site.visible.rating') }, { key: 'showServices', label: t('profile.site.visible.services') }, { key: 'showPortfolio', label: t('profile.site.visible.portfolio') }, { key: 'showReviews', label: t('profile.site.visible.reviews') }, { key: 'showPhone', label: t('profile.site.visible.contacts') }, { key: 'showFullLastName', label: t('profile.site.visible.full_last_name') }, { key: 'showStatus', label: t('profile.site.visible.status') } ].map((item)=>{ var _editUser_siteSettings; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "flex items-center justify-between cursor-pointer py-1.5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-sm text-gray-700", children: item.label }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "checkbox", checked: ((_editUser_siteSettings = editUser.siteSettings) !== null && _editUser_siteSettings !== void 0 ? _editUser_siteSettings : {})[item.key] !== false, onChange: (e)=>setEditUser((u)=>{ var _u_siteSettings; return { ...u, siteSettings: { ...(_u_siteSettings = u.siteSettings) !== null && _u_siteSettings !== void 0 ? _u_siteSettings : {}, [item.key]: e.target.checked } }; }), className: "w-4 h-4 rounded border-gray-300 text-green-600" }) ] }, item.key); }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "pt-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1.5", children: t('profile.site.theme') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("select", { value: (_siteTheme = ((_editUser_siteSettings = editUser.siteSettings) !== null && _editUser_siteSettings !== void 0 ? _editUser_siteSettings : {}).siteTheme) !== null && _siteTheme !== void 0 ? _siteTheme : 'dark', onChange: (e)=>setEditUser((u)=>{ var _u_siteSettings; return { ...u, siteSettings: { ...(_u_siteSettings = u.siteSettings) !== null && _u_siteSettings !== void 0 ? _u_siteSettings : {}, siteTheme: e.target.value } }; }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "dark", children: t('profile.site.theme.dark') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "light", children: t('profile.site.theme.light') }) ] }) ] }) ] }) ] }), editUserTab === 'specialist' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-6", children: [ (()=>{ if ((editUser === null || editUser === void 0 ? void 0 : editUser.role) === 'specialist') return null; var _editUser_bio; const bio = String((_editUser_bio = editUser === null || editUser === void 0 ? void 0 : editUser.bio) !== null && _editUser_bio !== void 0 ? _editUser_bio : '').trim(); const publishedCards = (editUserCards !== null && editUserCards !== void 0 ? editUserCards : []).filter((c)=>{ var _c_publicationStatus; return ((_c_publicationStatus = c.publicationStatus) !== null && _c_publicationStatus !== void 0 ? _c_publicationStatus : c.isActive ? 'active' : 'inactive') === 'active'; }); const hasPublishedCard = publishedCards.length > 0; const hasCategories = publishedCards.some((c)=>{ var _c_categories; var _c_categories_length; return ((_c_categories_length = (_c_categories = c.categories) === null || _c_categories === void 0 ? void 0 : _c_categories.length) !== null && _c_categories_length !== void 0 ? _c_categories_length : 0) > 0; }); const hasLocations = publishedCards.some((c)=>{ var _c_locations; var _c_locations_length; return ((_c_locations_length = (_c_locations = c.locations) === null || _c_locations === void 0 ? void 0 : _c_locations.length) !== null && _c_locations_length !== void 0 ? _c_locations_length : 0) > 0; }); const missing = []; if (!bio) missing.push(t('admin.user_edit.visibility_requirements.bio', 'Fill in bio')); if (!hasPublishedCard) missing.push(t('admin.user_edit.visibility_requirements.published_card', 'Publish at least one card')); if (!hasCategories) missing.push(t('admin.user_edit.visibility_requirements.categories', 'Add a category in a published card')); if (!hasLocations) missing.push(t('admin.user_edit.visibility_requirements.locations', 'Add a location in a published card')); if (missing.length === 0) return null; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "rounded-xl border border-amber-300 bg-amber-50 p-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm font-semibold text-amber-900", children: t('admin.user_edit.visibility_requirements.title', 'Profile is not yet visible in Offers') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-amber-800 mt-1", children: t('admin.user_edit.visibility_requirements.hint', 'Visibility requirements to complete:') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("ul", { className: "mt-2 text-xs text-amber-900 list-disc pl-5 space-y-0.5", children: missing.map((m)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("li", { children: m }, m)) }) ] }); })(), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: t('admin.user_edit.skills') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex flex-wrap gap-1.5 mb-2 min-h-[28px]", children: ((_editUser_skills = editUser.skills) !== null && _editUser_skills !== void 0 ? _editUser_skills : []).map((s)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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, /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>setEditUser((u)=>{ var _u_skills; return { ...u, skills: ((_u_skills = u.skills) !== null && _u_skills !== void 0 ? _u_skills : []).filter((x)=>x !== s) }; }), className: "text-gray-400 hover:text-green-700 leading-none", children: "\xd7" }) ] }, s)) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: skillInput, onChange: (e)=>setSkillInput(e.target.value), onKeyDown: (e)=>{ if ((e.key === 'Enter' || e.key === ',') && skillInput.trim()) { e.preventDefault(); const val = skillInput.trim().replace(/,$/, ''); var _editUser_skills; if (val && !((_editUser_skills = editUser.skills) !== null && _editUser_skills !== void 0 ? _editUser_skills : []).includes(val)) { setEditUser((u)=>{ var _u_skills; return { ...u, skills: [ ...(_u_skills = u.skills) !== null && _u_skills !== void 0 ? _u_skills : [], val ] }; }); } setSkillInput(''); } }, placeholder: t('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" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>{ const val = skillInput.trim(); var _editUser_skills; if (val && !((_editUser_skills = editUser.skills) !== null && _editUser_skills !== void 0 ? _editUser_skills : []).includes(val)) { setEditUser((u)=>{ var _u_skills; return { ...u, skills: [ ...(_u_skills = u.skills) !== null && _u_skills !== void 0 ? _u_skills : [], val ] }; }); } setSkillInput(''); }, className: "px-3 py-2 bg-green-600 text-white rounded-lg text-sm hover:bg-green-700", children: t('common.add') }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "border-t border-gray-100 pt-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-sm font-medium text-gray-700 mb-3", children: t('admin.user_edit.specialist_cards') }), editUserCardsLoading ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400 py-2", children: t('common.loading') }) : editUserCards.length === 0 ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400 py-4 text-center", children: t('admin.user_edit.no_cards') }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "space-y-4", children: editUserCards.map((card)=>{ var _card_title, _card_description, _card_skills, _cardSkillInputs_card_id, _card_categories, _card_categories1, _card_locations, _card_locations1; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "border border-gray-200 bg-gray-50 rounded-xl p-4 space-y-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: (_card_title = card.title) !== null && _card_title !== void 0 ? _card_title : '', onChange: (e)=>setEditUserCards((prev)=>prev.map((c)=>c.id === card.id ? { ...c, title: e.target.value } : c)), placeholder: t('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" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "flex items-center gap-1.5 cursor-pointer flex-shrink-0", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "checkbox", checked: card.isActive !== false, onChange: (e)=>setEditUserCards((prev)=>prev.map((c)=>c.id === card.id ? { ...c, isActive: e.target.checked } : c)), className: "w-4 h-4 rounded border-gray-300 text-green-600" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-xs text-gray-600", children: t('admin.user_edit.published') }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("textarea", { value: (_card_description = card.description) !== null && _card_description !== void 0 ? _card_description : '', onChange: (e)=>setEditUserCards((prev)=>prev.map((c)=>c.id === card.id ? { ...c, description: e.target.value } : c)), rows: 3, placeholder: t('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" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-xs font-medium text-gray-500 mb-1.5", children: t('admin.user_edit.skills') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex flex-wrap gap-1.5 mb-1.5 min-h-[24px]", children: ((_card_skills = card.skills) !== null && _card_skills !== void 0 ? _card_skills : []).map((s)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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, /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>setEditUserCards((prev)=>prev.map((c)=>{ var _c_skills; return c.id === card.id ? { ...c, skills: ((_c_skills = c.skills) !== null && _c_skills !== void 0 ? _c_skills : []).filter((x)=>x !== s) } : c; })), className: "text-gray-400 hover:text-green-700 leading-none", children: "\xd7" }) ] }, s)) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: (_cardSkillInputs_card_id = cardSkillInputs[card.id]) !== null && _cardSkillInputs_card_id !== void 0 ? _cardSkillInputs_card_id : '', onChange: (e)=>setCardSkillInputs((prev)=>({ ...prev, [card.id]: e.target.value })), onKeyDown: (e)=>{ var _cardSkillInputs_card_id; if ((e.key === 'Enter' || e.key === ',') && ((_cardSkillInputs_card_id = cardSkillInputs[card.id]) !== null && _cardSkillInputs_card_id !== void 0 ? _cardSkillInputs_card_id : '').trim()) { e.preventDefault(); var _cardSkillInputs_card_id1; const val = ((_cardSkillInputs_card_id1 = cardSkillInputs[card.id]) !== null && _cardSkillInputs_card_id1 !== void 0 ? _cardSkillInputs_card_id1 : '').trim().replace(/,$/, ''); var _card_skills; if (val && !((_card_skills = card.skills) !== null && _card_skills !== void 0 ? _card_skills : []).includes(val)) { setEditUserCards((prev)=>prev.map((c)=>{ var _c_skills; return c.id === card.id ? { ...c, skills: [ ...(_c_skills = c.skills) !== null && _c_skills !== void 0 ? _c_skills : [], val ] } : c; })); } setCardSkillInputs((prev)=>({ ...prev, [card.id]: '' })); } }, placeholder: t('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" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>{ var _cardSkillInputs_card_id; const val = ((_cardSkillInputs_card_id = cardSkillInputs[card.id]) !== null && _cardSkillInputs_card_id !== void 0 ? _cardSkillInputs_card_id : '').trim(); var _card_skills; if (val && !((_card_skills = card.skills) !== null && _card_skills !== void 0 ? _card_skills : []).includes(val)) { setEditUserCards((prev)=>prev.map((c)=>{ var _c_skills; return c.id === card.id ? { ...c, skills: [ ...(_c_skills = c.skills) !== null && _c_skills !== void 0 ? _c_skills : [], val ] } : c; })); } setCardSkillInputs((prev)=>({ ...prev, [card.id]: '' })); }, className: "px-2.5 py-1.5 bg-green-600 text-white rounded-lg text-xs hover:bg-green-700", children: "+" }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-xs font-medium text-gray-500 mb-1.5", children: t('admin.user_edit.categories') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex flex-wrap gap-1.5 mb-1.5 min-h-[24px]", children: ((_card_categories = card.categories) !== null && _card_categories !== void 0 ? _card_categories : []).map((slug)=>{ var _catRows_find; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: [ getCatLabel((_catRows_find = catRows.find((c)=>c.slug === slug)) !== null && _catRows_find !== void 0 ? _catRows_find : { slug }, locale), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>setEditUserCards((prev)=>prev.map((c)=>{ var _c_categories; return c.id === card.id ? { ...c, categories: ((_c_categories = c.categories) !== null && _c_categories !== void 0 ? _c_categories : []).filter((x)=>x !== slug) } : c; })), className: "text-purple-400 hover:text-purple-700 leading-none", children: "\xd7" }) ] }, slug); }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(AdminCatPicker, { catRows: catRows, locale: locale, selected: (_card_categories1 = card.categories) !== null && _card_categories1 !== void 0 ? _card_categories1 : [], onAdd: (id)=>setEditUserCards((prev)=>prev.map((c)=>{ var _c_categories; return c.id === card.id ? { ...c, categories: [ ...(_c_categories = c.categories) !== null && _c_categories !== void 0 ? _c_categories : [], id ] } : c; })), addLabel: t('admin.user_edit.add_category') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-xs font-medium text-gray-500 mb-1.5", children: t('admin.user_edit.locations') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex flex-wrap gap-1.5 mb-1.5 min-h-[24px]", children: ((_card_locations = card.locations) !== null && _card_locations !== void 0 ? _card_locations : []).map((slug)=>{ var _locRows_find; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: [ getLocLabel((_locRows_find = locRows.find((l)=>l.slug === slug)) !== null && _locRows_find !== void 0 ? _locRows_find : { slug }, locale), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>setEditUserCards((prev)=>prev.map((c)=>{ var _c_locations; return c.id === card.id ? { ...c, locations: ((_c_locations = c.locations) !== null && _c_locations !== void 0 ? _c_locations : []).filter((x)=>x !== slug) } : c; })), className: "text-green-400 hover:text-green-700 leading-none", children: "\xd7" }) ] }, slug); }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(AdminLocPicker, { locRows: locRows, locale: locale, selected: (_card_locations1 = card.locations) !== null && _card_locations1 !== void 0 ? _card_locations1 : [], onAdd: (id)=>setEditUserCards((prev)=>prev.map((c)=>{ var _c_locations; return c.id === card.id ? { ...c, locations: [ ...(_c_locations = c.locations) !== null && _c_locations !== void 0 ? _c_locations : [], id ] } : c; })), addLabel: t('admin.user_edit.add_location') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex justify-end pt-1", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>saveCard(card.id), disabled: cardSaving[card.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: cardSaving[card.id] ? '...' : t('common.save') }) }) ] }, card.id); }) }) ] }) ] }) ] }) ] }), editUserTab !== 'balance' ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "border-t border-gray-100 px-6 py-4 flex gap-3 flex-shrink-0", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: saveEditUser, disabled: editUserSaving, className: "flex-1 bg-green-600 hover:bg-green-700 text-white py-2 rounded-lg text-sm font-semibold disabled:opacity-50", children: editUserSaving ? '...' : t('common.save') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>setEditUser(null), className: "flex-1 bg-gray-100 hover:bg-gray-200 text-gray-700 py-2 rounded-lg text-sm font-medium", children: t('common.cancel') }) ] }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "border-t border-gray-100 px-6 py-4 flex-shrink-0", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>setEditUser(null), className: "w-full bg-gray-100 hover:bg-gray-200 text-gray-700 py-2 rounded-lg text-sm font-medium", children: t('common.close') }) }) ] }) }), editUser && balanceModal && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "fixed inset-0 z-[60] flex items-center justify-center bg-black/40 px-4", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-2xl shadow-2xl p-6 w-full max-w-sm border-t-4 ".concat(balanceModal === 'topup' ? 'border-emerald-500' : 'border-rose-500'), children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-between mb-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h3", { className: "text-base font-semibold ".concat(balanceModal === 'topup' ? 'text-emerald-900' : 'text-rose-900'), children: balanceModal === 'topup' ? t('admin.balance.topup.title') : t('admin.balance.withdraw.title') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>setBalanceModal(null), className: "text-gray-400 hover:text-gray-600 text-2xl leading-none", children: "\xd7" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { className: "text-xs text-gray-500 mb-4", children: [ t('admin.user_edit.balance'), ": ", /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "font-semibold text-gray-700", children: [ Number((_editUser_balance1 = editUser.balance) !== null && _editUser_balance1 !== void 0 ? _editUser_balance1 : 0).toFixed(2), " EUR" ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium mb-1 ".concat(balanceModal === 'topup' ? 'text-emerald-800' : 'text-rose-800'), children: balanceModal === 'topup' ? t('admin.balance.topup.amount') : t('admin.balance.withdraw.amount') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "number", min: "0.01", step: "0.01", value: balanceModal === 'topup' ? (_editUser_topUpAmount = editUser.topUpAmount) !== null && _editUser_topUpAmount !== void 0 ? _editUser_topUpAmount : '' : (_editUser_withdrawAmount = editUser.withdrawAmount) !== null && _editUser_withdrawAmount !== void 0 ? _editUser_withdrawAmount : '', onChange: (e)=>setEditUser((u)=>balanceModal === 'topup' ? { ...u, topUpAmount: e.target.value } : { ...u, withdrawAmount: e.target.value }), className: "w-full border rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 ".concat(balanceModal === 'topup' ? 'border-emerald-300 focus:ring-emerald-400' : 'border-rose-300 focus:ring-rose-400') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium mb-1 ".concat(balanceModal === 'topup' ? 'text-emerald-800' : 'text-rose-800'), children: balanceModal === 'topup' ? t('admin.balance.topup.description') : t('admin.balance.withdraw.description') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: balanceModal === 'topup' ? (_editUser_topUpDescription = editUser.topUpDescription) !== null && _editUser_topUpDescription !== void 0 ? _editUser_topUpDescription : '' : (_editUser_withdrawDescription = editUser.withdrawDescription) !== null && _editUser_withdrawDescription !== void 0 ? _editUser_withdrawDescription : '', onChange: (e)=>setEditUser((u)=>balanceModal === 'topup' ? { ...u, topUpDescription: e.target.value } : { ...u, withdrawDescription: e.target.value }), placeholder: balanceModal === 'topup' ? t('admin.balance.topup.description.placeholder') : t('admin.balance.withdraw.description.placeholder'), className: "w-full border rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 ".concat(balanceModal === 'topup' ? 'border-emerald-300 focus:ring-emerald-400' : 'border-rose-300 focus:ring-rose-400') }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-2 mt-5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: async ()=>{ if (balanceModal === 'topup') { await handleAdminTopUp(); } else { await handleAdminWithdraw(); } setBalanceModal(null); }, disabled: balanceModal === 'topup' ? topUpSaving || !Number(editUser.topUpAmount) : withdrawSaving || !Number(editUser.withdrawAmount), className: "flex-1 text-white py-2 rounded-lg text-sm font-semibold disabled:opacity-50 ".concat(balanceModal === 'topup' ? 'bg-emerald-600 hover:bg-emerald-700' : 'bg-rose-600 hover:bg-rose-700'), children: (balanceModal === 'topup' ? topUpSaving : withdrawSaving) ? t('common.loading') : balanceModal === 'topup' ? t('admin.balance.topup.submit') : t('admin.balance.withdraw.submit') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>setBalanceModal(null), className: "flex-1 bg-gray-100 hover:bg-gray-200 text-gray-700 py-2 rounded-lg text-sm font-medium", children: t('common.cancel') }) ] }) ] }) }) ] }) ] }) ] }) }); } // ─── DbCheckTab ───────────────────────────────────────────────────────────── function DbCheckTab() { // ── Skill duplicates ────────────────────────────────────────────────────── const [dedupLoading, setDedupLoading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [dedupGroups, setDedupGroups] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [keepIds, setKeepIds] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)({}); const [merging, setMerging] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); function gk(group) { var _group__nameEl, _group_, _group_1; var _group__nameEl_toLowerCase_trim; return (_group__nameEl_toLowerCase_trim = (_group_ = group[0]) === null || _group_ === void 0 ? void 0 : (_group__nameEl = _group_.nameEl) === null || _group__nameEl === void 0 ? void 0 : _group__nameEl.toLowerCase().trim()) !== null && _group__nameEl_toLowerCase_trim !== void 0 ? _group__nameEl_toLowerCase_trim : (_group_1 = group[0]) === null || _group_1 === void 0 ? void 0 : _group_1.id; } async function findDuplicates() { setDedupLoading(true); setDedupGroups(null); setKeepIds({}); try { const groups = await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getSkillDedup */ .GE() // all categories ; setDedupGroups(groups); const auto = {}; groups.forEach((group)=>{ const best = [ ...group ].sort((a, b)=>{ var _b_usageCount, _a_usageCount; return ((_b_usageCount = b.usageCount) !== null && _b_usageCount !== void 0 ? _b_usageCount : 0) - ((_a_usageCount = a.usageCount) !== null && _a_usageCount !== void 0 ? _a_usageCount : 0); })[0]; auto[gk(group)] = best.id; }); setKeepIds(auto); } catch (e) { setDedupGroups([]); } finally{ setDedupLoading(false); } } async function mergeGroup(key, group) { const keepId = keepIds[key]; if (!keepId) return; const deleteIds = group.filter((s)=>s.id !== keepId).map((s)=>s.id); if (!deleteIds.length) return; setMerging(key); try { await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .mergeSkillDuplicates */ .Uq(keepId, deleteIds); setDedupGroups((prev)=>prev ? prev.filter((g)=>gk(g) !== key) : prev); } catch (e) {} finally{ setMerging(null); } } async function mergeAll() { if (!(dedupGroups === null || dedupGroups === void 0 ? void 0 : dedupGroups.length)) return; setMerging('__all__'); for (const group of [ ...dedupGroups ]){ const key = gk(group); const keepId = keepIds[key]; if (!keepId) continue; const deleteIds = group.filter((s)=>s.id !== keepId).map((s)=>s.id); if (!deleteIds.length) continue; try { await _lib_api__WEBPACK_IMPORTED_MODULE_6__/* .mergeSkillDuplicates */ .Uq(keepId, deleteIds); setDedupGroups((prev)=>prev ? prev.filter((g)=>gk(g) !== key) : prev); } catch (e) {} } setMerging(null); } var _dedupGroups_reduce; const totalDuplicates = (_dedupGroups_reduce = dedupGroups === null || dedupGroups === void 0 ? void 0 : dedupGroups.reduce((acc, g)=>acc + g.length - 1, 0)) !== null && _dedupGroups_reduce !== void 0 ? _dedupGroups_reduce : 0; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "text-base font-semibold text-gray-900", children: "ПрПверка базы ЎаММых" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-gray-500 mt-0.5", children: "ДОагМПстОка О ОсправлеМОе прПблеЌ в базе ЎаММых" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 overflow-hidden", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "px-5 py-4 border-b border-gray-100 flex items-center justify-between", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h3", { className: "text-sm font-semibold text-gray-800", children: "ДублОкаты МавыкПв" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400 mt-0.5", children: "ППОск МавыкПв с ПЎОМакПвыЌ ОЌеМеЌ в ПЎМПй категПрОО. ПрО ПбъеЎОМеМОО — ссылкО в картПчках спецОалОстПв ПбМПвляются автПЌатОческО." }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { onClick: findDuplicates, disabled: dedupLoading, 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: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("circle", { cx: "11", cy: "11", r: "8" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M21 21l-4.35-4.35" }) ] }), dedupLoading ? 'Ищу ' : 'НайтО ЎублОкаты' ] }) ] }), dedupGroups !== null && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "p-5", children: dedupGroups.length === 0 ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" }) }), "ДублОкатПв Ме МайЎеМП — база в пПряЎке" ] }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-between", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { className: "text-sm text-green-700 font-semibold", children: [ "НайЎеМП ", dedupGroups.length, " групп \xb7 ", totalDuplicates, " лОшМОх запОсей" ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: mergeAll, disabled: merging === '__all__', 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: merging === '__all__' ? 'ОбъеЎОМяю ' : "ОбъеЎОМОть все (".concat(dedupGroups.length, ")") }) ] }), dedupGroups.map((group)=>{ var _group_, _group_1; const key = gk(group); return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white border border-orange-200 rounded-xl overflow-hidden shadow-sm", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "px-4 py-2.5 bg-orange-50 border-b border-orange-100 flex items-center justify-between gap-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "min-w-0", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "text-sm font-semibold text-orange-800", children: [ "\xab", (_group_ = group[0]) === null || _group_ === void 0 ? void 0 : _group_.nameEl, "\xbb" ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "ml-2 text-xs text-green-600 font-mono", children: (_group_1 = group[0]) === null || _group_1 === void 0 ? void 0 : _group_1.categorySlug }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "ml-2 text-xs text-orange-400", children: [ group.length, " варОаМта" ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>mergeGroup(key, group), disabled: !!merging, 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: merging === key ? 'ОбъеЎОМяю ' : 'ОбъеЎОМОть' }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "divide-y divide-gray-50", children: group.map((skill)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "flex items-center gap-3 px-4 py-2.5 cursor-pointer hover:bg-gray-50 transition", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "radio", name: "dedup-global-".concat(key), checked: keepIds[key] === skill.id, onChange: ()=>setKeepIds((prev)=>({ ...prev, [key]: skill.id })), className: "accent-amber-600 shrink-0" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-3 flex-wrap", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-sm font-medium text-gray-800", children: skill.nameEl }), skill.nameEn && skill.nameEn !== skill.nameEl && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "text-xs text-gray-400", children: [ "EN: ", skill.nameEn ] }), skill.nameRu && skill.nameRu !== skill.nameEl && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "text-xs text-gray-400", children: [ "RU: ", skill.nameRu ] }), skill.nameUk && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "text-xs text-gray-400", children: [ "UK: ", skill.nameUk ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-3 mt-0.5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-[11px] font-semibold ".concat(skill.usageCount > 0 ? 'text-green-600' : 'text-gray-400'), children: skill.usageCount > 0 ? "".concat(skill.usageCount, " ОспПльзПваМОй") : 'Ме ОспПльзПвался' }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "text-[11px] text-gray-300", children: [ "order: ", skill.order ] }), keepIds[key] === skill.id && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-[11px] font-bold text-amber-600 uppercase", children: "← ПставОть" }) ] }) ] }) ] }, skill.id)) }) ] }, key); }) ] }) }) ] }) ] }); } function LocTree(param) { let { rows, parentId, depth, locale, expanded, onToggle, onEdit, onDelete, onAddChild, t } = param; const children = rows.filter((r)=>{ var _r_parentId; return ((_r_parentId = r.parentId) !== null && _r_parentId !== void 0 ? _r_parentId : null) === parentId; }); if (children.length === 0) return null; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: children.sort((a, b)=>{ var _a_order, _b_order; return ((_a_order = a.order) !== null && _a_order !== void 0 ? _a_order : 0) - ((_b_order = b.order) !== null && _b_order !== void 0 ? _b_order : 0); }).map((loc)=>{ const hasChildren = rows.some((r)=>r.parentId === loc.id); const isOpen = expanded.has(loc.id); const name = (locale === 'en' ? loc.nameEn : locale === 'ru' ? loc.nameRu : locale === 'uk' ? loc.nameUk : loc.nameEl) || loc.nameEl || loc.slug; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-2 px-4 py-3 hover:bg-gray-50 ".concat(!loc.isActive ? 'opacity-50' : ''), style: { paddingLeft: "".concat(16 + depth * 24, "px") }, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>hasChildren && onToggle(loc.id), className: "w-5 h-5 flex items-center justify-center text-gray-400 rounded ".concat(hasChildren ? 'hover:bg-gray-200 cursor-pointer' : 'cursor-default'), children: hasChildren ? isOpen ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("polyline", { points: "6 9 12 15 18 9" }) }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("polyline", { points: "9 18 15 12 9 6" }) }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "w-3.5 h-3.5 block" }) }), depth === 0 ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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" }) }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 11a3 3 0 11-6 0 3 3 0 016 0z" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "font-medium text-gray-800 text-sm", children: name }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "ml-2 text-xs text-gray-400", children: loc.nameEn }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "ml-1.5 font-mono text-xs text-gray-300", children: [ "/", loc.slug ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "px-2 py-0.5 rounded-full text-xs font-medium ".concat(loc.isActive ? 'bg-green-100 text-green-700' : 'bg-gray-100 text-gray-500'), children: loc.isActive ? t('admin.cat.active') : t('admin.cat.inactive') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-1 flex-shrink-0", children: [ depth === 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>onAddChild(loc.id), className: "text-xs px-2 py-1 rounded-lg bg-green-50 text-green-600 hover:bg-green-100 font-medium", title: t('admin.loc.add_district'), children: "+" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>onEdit(loc), className: "text-xs px-2 py-1 rounded-lg bg-gray-100 text-gray-600 hover:bg-gray-200 font-medium", children: t('common.edit') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>onDelete(loc.id, name), className: "text-xs px-2 py-1 rounded-lg bg-red-50 text-red-600 hover:bg-red-100 font-medium", children: t('common.delete') }) ] }) ] }), hasChildren && isOpen && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(LocTree, { rows: rows, parentId: loc.id, depth: depth + 1, locale: locale, expanded: expanded, onToggle: onToggle, onEdit: onEdit, onDelete: onDelete, onAddChild: onAddChild, t: t }) ] }, loc.id); }) }); } function CatTree(param) { let { rows, parentId, depth, locale, expanded, onToggle, onEdit, onDelete, onAddChild, skillsExpanded, skillsCache, skillsLoading, onToggleSkills, skillForm, skillSaving, onOpenAddSkill, onOpenEditSkill, onSaveSkill, onDeleteSkill, onCancelSkillForm, onSkillFormChange, t } = param; const children = rows.filter((r)=>{ var _r_parentId; return ((_r_parentId = r.parentId) !== null && _r_parentId !== void 0 ? _r_parentId : null) === parentId; }); if (children.length === 0) return null; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: children.sort((a, b)=>{ var _a_order, _b_order; return ((_a_order = a.order) !== null && _a_order !== void 0 ? _a_order : 0) - ((_b_order = b.order) !== null && _b_order !== void 0 ? _b_order : 0); }).map((cat)=>{ var _cat_names; const hasChildren = rows.some((r)=>r.parentId === cat.id); const isOpen = expanded.has(cat.id); const skillsOpen = skillsExpanded.has(cat.id); const isLoadingSkills = skillsLoading.has(cat.id); var _skillsCache_cat_slug; const skills = (_skillsCache_cat_slug = skillsCache[cat.slug]) !== null && _skillsCache_cat_slug !== void 0 ? _skillsCache_cat_slug : []; const name = (locale === 'en' ? cat.namesEn : locale === 'ru' ? cat.namesRu : locale === 'uk' ? cat.namesUk : cat.namesEl) || cat.namesEl || cat.slug; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-2 px-4 py-3 hover:bg-gray-50 ".concat(!cat.isActive ? 'opacity-50' : ''), style: { paddingLeft: "".concat(16 + depth * 24, "px") }, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>hasChildren && onToggle(cat.id), className: "w-5 h-5 flex items-center justify-center text-gray-400 rounded ".concat(hasChildren ? 'hover:bg-gray-200 cursor-pointer' : 'cursor-default'), children: hasChildren ? isOpen ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("polyline", { points: "6 9 12 15 18 9" }) }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("polyline", { points: "9 18 15 12 9 6" }) }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "w-3.5 h-3.5 block" }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "w-10 h-10 flex items-center justify-center rounded-xl bg-green-50", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components_CategoryIcon__WEBPACK_IMPORTED_MODULE_7__/* .CategoryIcon */ .Ez, { icon: cat.icon, alt: name, className: "h-7 w-7 object-contain text-2xl leading-none", fallback: "\uD83D\uDCE6" }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "font-medium text-gray-800 text-sm", children: name }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "ml-2 text-xs text-gray-400", children: cat.namesEn || ((_cat_names = cat.names) === null || _cat_names === void 0 ? void 0 : _cat_names.en) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "ml-1.5 font-mono text-xs text-gray-300", children: [ "/", cat.slug ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "px-2 py-0.5 rounded-full text-xs font-medium ".concat(cat.isActive ? 'bg-green-100 text-green-700' : 'bg-gray-100 text-gray-500'), children: cat.isActive ? t('admin.cat.active') : t('admin.cat.inactive') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-1 flex-shrink-0", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { onClick: ()=>onToggleSkills(cat), className: "text-xs px-2 py-1 rounded-lg font-medium flex items-center gap-1 ".concat(skillsOpen ? 'bg-amber-100 text-amber-700' : 'bg-amber-50 text-amber-600 hover:bg-amber-100'), title: "НавыкО", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3 h-3", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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" }) }), skillsCache[cat.slug] ? skillsCache[cat.slug].length : t('admin.cat.skills', 'Skills') ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>onAddChild(cat.id), className: "text-xs px-2 py-1 rounded-lg bg-green-50 text-green-600 hover:bg-green-100 font-medium", title: t('admin.cat.add_child'), children: "+" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>onEdit(cat), className: "text-xs px-2 py-1 rounded-lg bg-gray-100 text-gray-600 hover:bg-gray-200 font-medium", children: t('common.edit') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>onDelete(cat.id, name), className: "text-xs px-2 py-1 rounded-lg bg-red-50 text-red-600 hover:bg-red-100 font-medium", children: t('common.delete') }) ] }) ] }), skillsOpen && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(SkillsPanel, { cat: cat, locale: locale, depth: depth, t: t, skills: skills, isLoading: isLoadingSkills, skillForm: skillForm, skillSaving: skillSaving, onOpenAddSkill: onOpenAddSkill, onOpenEditSkill: onOpenEditSkill, onSaveSkill: onSaveSkill, onDeleteSkill: onDeleteSkill, onCancelSkillForm: onCancelSkillForm, onSkillFormChange: onSkillFormChange }), hasChildren && isOpen && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(CatTree, { rows: rows, parentId: cat.id, depth: depth + 1, locale: locale, expanded: expanded, onToggle: onToggle, onEdit: onEdit, onDelete: onDelete, onAddChild: onAddChild, skillsExpanded: skillsExpanded, skillsCache: skillsCache, skillsLoading: skillsLoading, onToggleSkills: onToggleSkills, skillForm: skillForm, skillSaving: skillSaving, onOpenAddSkill: onOpenAddSkill, onOpenEditSkill: onOpenEditSkill, onSaveSkill: onSaveSkill, onDeleteSkill: onDeleteSkill, onCancelSkillForm: onCancelSkillForm, onSkillFormChange: onSkillFormChange, t: t }) ] }, cat.id); }) }); } // ─── SkillsPanel ──────────────────────────────────────────────────────────── // Self-contained component for the skill list + edit form + dedup panel per category const SKILL_LANG_LABELS = { nameEl: '🇬🇷 EL', nameEn: '🇬🇧 EN', nameRu: '🇷🇺 RU', nameUk: '🇺🇊 UK' }; function SkillForm(param) { let { form, saving, onSave, onCancel, onChange } = param; var _form_nameEl; var _form_order; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white border border-amber-200 rounded-xl p-4 shadow-sm", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "grid grid-cols-2 gap-3 mb-3", children: [ 'nameEl', 'nameEn', 'nameRu', 'nameUk' ].map((field, i)=>{ var _form_field; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-[11px] font-semibold text-gray-500 mb-1 uppercase tracking-wide", children: SKILL_LANG_LABELS[field] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: (_form_field = form[field]) !== null && _form_field !== void 0 ? _form_field : '', onChange: (e)=>onChange({ ...form, [field]: e.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: i === 0, placeholder: field === 'nameUk' ? 'МеПбПвʌязкПвП' : '' }) ] }, field); }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-3 pt-1 border-t border-gray-100", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "text-xs text-gray-400 font-medium", children: "ППряЎПк" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "number", value: (_form_order = form.order) !== null && _form_order !== void 0 ? _form_order : 0, onChange: (e)=>onChange({ ...form, order: Number(e.target.value) }), className: "w-16 border border-gray-200 rounded-lg px-2 py-1 text-xs text-center" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-2 ml-auto", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: onCancel, className: "px-3 py-1.5 bg-gray-100 text-gray-600 rounded-lg text-xs font-medium hover:bg-gray-200 transition", children: "ОтЌеМа" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: onSave, disabled: saving || !((_form_nameEl = form.nameEl) === null || _form_nameEl === void 0 ? void 0 : _form_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: saving ? 'СПхраМяю ' : 'СПхраМОть' }) ] }) ] }) ] }); } function SkillsPanel(param) { let { cat, locale, depth, t, skills, isLoading, skillForm, skillSaving, onOpenAddSkill, onOpenEditSkill, onSaveSkill, onDeleteSkill, onCancelSkillForm, onSkillFormChange } = param; const showAddForm = (skillForm === null || skillForm === void 0 ? void 0 : skillForm.catSlug) === cat.slug && !(skillForm === null || skillForm === void 0 ? void 0 : skillForm.id); return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "border-t border-amber-100 bg-gradient-to-b from-amber-50/60 to-white", style: { paddingLeft: "".concat(16 + depth * 24 + 36, "px"), paddingRight: '16px', paddingTop: '14px', paddingBottom: '14px' }, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-2 mb-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-xs font-bold text-amber-700 uppercase tracking-wider", children: "НавыкО" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "text-xs text-amber-500 font-mono", children: [ "/", cat.slug ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "ml-1 text-xs text-amber-400", children: [ "(", skills.length, ")" ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "ml-auto", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { onClick: ()=>{ onCancelSkillForm(); onOpenAddSkill(cat.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: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-3 h-3", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: "12", y1: "5", x2: "12", y2: "19" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: "5", y1: "12", x2: "19", y2: "12" }) ] }), "ДПбавОть" ] }) }) ] }), isLoading ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-2 py-3 text-xs text-gray-400", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-3.5 h-3.5 animate-spin", fill: "none", viewBox: "0 0 24 24", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("circle", { cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4", className: "opacity-25" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { fill: "currentColor", d: "M4 12a8 8 0 018-8v8z", className: "opacity-75" }) ] }), "Загрузка " ] }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-1", children: [ skills.length === 0 && !showAddForm && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400 italic py-2", children: "НавыкО Ме ЎПбавлеМы" }), skills.map((skill)=>{ const isEditingThis = (skillForm === null || skillForm === void 0 ? void 0 : skillForm.id) === skill.id; const skillName = locale === 'en' ? skill.nameEn : locale === 'ru' ? skill.nameRu : locale === 'uk' ? skill.nameUk || skill.nameEn : skill.nameEl; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-2 rounded-lg px-3 py-2 group transition ".concat(isEditingThis ? 'bg-amber-50 border border-amber-200' : 'bg-white border border-gray-100 hover:border-amber-200 hover:bg-amber-50/30'), children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-sm font-medium text-gray-800", children: skillName }), locale !== 'en' && skill.nameEn && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "ml-2 text-xs text-gray-400", children: skill.nameEn }), locale !== 'ru' && skill.nameRu && skill.nameRu !== skill.nameEl && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "ml-1.5 text-xs text-gray-300", children: skill.nameRu }) ] }), skill.order > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "text-[10px] text-gray-300 font-mono", children: [ "#", skill.order ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-1 transition-opacity ".concat(isEditingThis ? 'opacity-100' : 'opacity-0 group-hover:opacity-100'), children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>isEditingThis ? onCancelSkillForm() : (onCancelSkillForm(), onOpenEditSkill(skill, cat.slug)), className: "text-xs px-2 py-0.5 rounded-md font-medium transition ".concat(isEditingThis ? 'bg-amber-100 text-amber-700' : 'bg-gray-100 text-gray-600 hover:bg-amber-100 hover:text-amber-700'), children: isEditingThis ? '✕' : t('common.edit') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>onDeleteSkill(skill, cat.slug), className: "text-xs px-2 py-0.5 rounded-md bg-red-50 text-red-600 hover:bg-red-100 transition", children: t('common.delete') }) ] }) ] }), isEditingThis && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "mt-1 mb-1 ml-0", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(SkillForm, { form: skillForm, saving: skillSaving, onSave: onSaveSkill, onCancel: onCancelSkillForm, onChange: onSkillFormChange }) }) ] }, skill.id); }), showAddForm && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "mt-2", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(SkillForm, { form: skillForm, saving: skillSaving, onSave: onSaveSkill, onCancel: onCancelSkillForm, onChange: onSkillFormChange }) }) ] }) ] }); } function Pagination(param) { let { page, total, limit, onChange, totalLabel } = param; const pages = Math.ceil(total / limit); if (pages <= 1) return null; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-between px-4 py-3 border-t border-gray-100 text-sm text-gray-500", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { children: [ totalLabel, ": ", total ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-1", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>onChange(page - 1), disabled: page === 1, className: "px-3 py-1 rounded-lg border border-gray-200 disabled:opacity-40 hover:bg-gray-50", children: "←" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "px-3 py-1", children: [ page, " / ", pages ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>onChange(page + 1), disabled: page >= pages, className: "px-3 py-1 rounded-lg border border-gray-200 disabled:opacity-40 hover:bg-gray-50", children: "→" }) ] }) ] }); } // ── Activity log helpers ────────────────────────────────────────────────── function parseLogDetails(details) { try { return details ? JSON.parse(details) : null; } catch (e) { return null; } } const EVENT_META = { 'user.login': { icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("circle", { cx: "12", cy: "12", r: "10" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("circle", { cx: "12", cy: "12", r: "10" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: "15", y1: "9", x2: "9", y2: "15" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("polyline", { points: "3 6 5 6 21 6" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: "18", y1: "6", x2: "6", y2: "18" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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 ActivityLogRow(param) { let { entry, dateLocale, onFilterUser, t } = param; var _EVENT_META_entry_event; const meta = (_EVENT_META_entry_event = EVENT_META[entry.event]) !== null && _EVENT_META_entry_event !== void 0 ? _EVENT_META_entry_event : { icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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: entry.event, color: 'bg-gray-50 text-gray-700 border-gray-200' }; const details = parseLogDetails(entry.details); return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 px-4 py-3 flex items-start gap-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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 ".concat(meta.color), children: [ meta.icon, " ", t(meta.labelKey, meta.labelKey) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-2 flex-wrap", children: [ entry.userName && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>entry.userId && onFilterUser(entry.userId), className: "text-sm font-medium text-gray-800 hover:text-green-600", children: entry.userName }), entry.userEmail && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-xs text-gray-400", children: entry.userEmail }) ] }), details && Object.keys(details).length > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "mt-1 flex flex-wrap gap-2", children: Object.entries(details).map((param)=>{ let [k, v] = param; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "text-xs bg-gray-100 text-gray-600 px-2 py-0.5 rounded", children: [ k, ": ", /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "font-medium", children: String(v) }) ] }, k); }) }), entry.ipAddress && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400 mt-0.5", children: entry.ipAddress }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("time", { className: "shrink-0 text-xs text-gray-400 whitespace-nowrap", children: new Date(entry.createdAt).toLocaleString(dateLocale) }) ] }); } const MONTH_NAMES = (/* unused pure expression or super */ null && ([ 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec' ])); function AdminMonthChart(param) { let { series, dateLocale = 'en-US' } = param; // Collect all unique months from all series, sorted const monthSet = new Set(); series.forEach((s)=>s.data.forEach((r)=>monthSet.add(r.month))); const months = Array.from(monthSet).sort(); if (months.length === 0) return null; // Build lookup maps const seriesVals = series.map((s)=>{ const map = {}; s.data.forEach((r)=>{ map[r.month] = Number(r.count); }); return months.map((m)=>{ var _map_m; return (_map_m = map[m]) !== null && _map_m !== void 0 ? _map_m : 0; }); }); const allVals = seriesVals.flat(); const maxVal = Math.max(...allVals, 1); const W = 700; const H = 160; const padL = maxVal >= 1000000 ? 50 : maxVal >= 10000 ? 44 : maxVal >= 1000 ? 40 : 36; const padB = 24; const chartH = H - padB; const totalBars = months.length * series.length; const groupW = (W - padL - 8) / months.length; const barW = Math.max(4, Math.min(20, groupW / series.length - 2)); const yTicks = [ 0, Math.round(maxVal / 3), Math.round(maxVal * 2 / 3), maxVal ]; function barX(mi, si) { const groupStart = padL + mi * groupW + (groupW - series.length * (barW + 1)) / 2; return groupStart + si * (barW + 1); } function barHeight(v) { return v / maxVal * chartH; } return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "overflow-x-auto", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { viewBox: "0 0 ".concat(W, " ").concat(H + 14), className: "w-full", style: { minWidth: Math.max(360, months.length * 40) }, children: [ yTicks.map((v, i)=>{ const y = chartH - v / maxVal * chartH; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("g", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: padL, y1: y, x2: W - 4, y2: y, stroke: "#f3f4f6", strokeWidth: 1 }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("text", { x: padL - 5, y: y + 3.5, textAnchor: "end", fontSize: 9, fill: "#9ca3af", children: fmtYLabel(v) }) ] }, i); }), months.map((m, mi)=>series.map((s, si)=>{ const v = seriesVals[si][mi]; const bh = barHeight(v); const x = barX(mi, si); return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("rect", { x: x, y: chartH - bh, width: barW, height: bh, fill: s.color, opacity: 0.8, rx: 2 }, "bar-".concat(mi, "-").concat(si)); })), months.map((m, mi)=>{ const [yr, mo] = m.slice(0, 7).split('-').map(Number); const d = new Date(Date.UTC(yr, mo - 1, 2)); const label = new Intl.DateTimeFormat(dateLocale, { month: 'short' }).format(d) + (mi === 0 || mo === 1 ? " ".concat(yr) : ''); const cx = padL + mi * groupW + groupW / 2; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("text", { x: cx, y: H + 12, textAnchor: "middle", fontSize: 9, fill: "#9ca3af", children: label }, "xl-".concat(mi)); }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: padL, y1: chartH, x2: W - 4, y2: chartH, stroke: "#e5e7eb", strokeWidth: 1 }) ] }) }); } function getLast30Days() { const days = []; for(let i = 29; i >= 0; i--){ const d = new Date(Date.now() - i * 86400000); days.push(d.toISOString().slice(0, 10)); } return days; } function smoothPath(pts) { if (pts.length < 2) return ''; let d = "M ".concat(pts[0][0].toFixed(1), " ").concat(pts[0][1].toFixed(1)); for(let i = 1; i < pts.length; i++){ const cpx = ((pts[i - 1][0] + pts[i][0]) / 2).toFixed(1); d += " C ".concat(cpx, " ").concat(pts[i - 1][1].toFixed(1), " ").concat(cpx, " ").concat(pts[i][1].toFixed(1), " ").concat(pts[i][0].toFixed(1), " ").concat(pts[i][1].toFixed(1)); } return d; } function fmtYLabel(v) { if (v >= 1000000) return "".concat(+(v / 1000000).toFixed(1), "M"); if (v >= 1000) return "".concat(Math.round(v / 1000), "K"); return String(v); } function AdminAreaChart(param) { let { series, days: daysProp } = param; const days = daysProp !== null && daysProp !== void 0 ? daysProp : getLast30Days(); const seriesVals = series.map((s)=>{ const map = {}; s.data.forEach((r)=>{ map[r.day] = Number(r.count); }); return days.map((d)=>{ var _map_d; return (_map_d = map[d]) !== null && _map_d !== void 0 ? _map_d : 0; }); }); const allVals = seriesVals.flat(); const maxVal = Math.max(...allVals, 1); const W = 700; const H = 160; const padL = maxVal >= 10000 ? 44 : maxVal >= 1000 ? 40 : 36; const padB = 22; const chartW = W - padL - 4; const chartH = H - padB; const stepX = chartW / (days.length - 1); function pts(vals) { return vals.map((v, i)=>[ padL + i * stepX, chartH - v / maxVal * chartH ]); } function areaPath(vals) { const points = pts(vals); const line = smoothPath(points); if (!line) return ''; const lastX = points[points.length - 1][0].toFixed(1); return "".concat(line, " L ").concat(lastX, " ").concat(chartH.toFixed(1), " L ").concat(padL.toFixed(1), " ").concat(chartH.toFixed(1), " Z"); } // Y-axis: 4 labels (0, 1/3, 2/3, max) const yTicks = [ 0, Math.round(maxVal / 3), Math.round(maxVal * 2 / 3), maxVal ]; // X-axis: every 7 days + last const xTicks = days.map((d, i)=>({ i, label: d.slice(8) })).filter((_, i)=>i % 7 === 0 || i === days.length - 1); return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "overflow-x-auto", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { viewBox: "0 0 ".concat(W, " ").concat(H + 12), className: "w-full", style: { minWidth: 360 }, children: [ yTicks.map((v, i)=>{ const y = chartH - v / maxVal * chartH; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("g", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: padL, y1: y, x2: W - 4, y2: y, stroke: "#f3f4f6", strokeWidth: 1 }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("text", { x: padL - 5, y: y + 3.5, textAnchor: "end", fontSize: 9, fill: "#9ca3af", children: fmtYLabel(v) }) ] }, i); }), xTicks.map((param)=>{ let { i } = param; const x = padL + i * stepX; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: x, y1: 0, x2: x, y2: chartH, stroke: "#f9fafb", strokeWidth: 1 }, "vg-".concat(i)); }), xTicks.map((param)=>{ let { i, label } = param; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("text", { x: padL + i * stepX, y: H + 10, textAnchor: "middle", fontSize: 9, fill: "#9ca3af", children: label }, i); }), series.map((s, si)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: areaPath(seriesVals[si]), fill: s.fill }, "fill-".concat(si))), series.map((s, si)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: smoothPath(pts(seriesVals[si])), fill: "none", stroke: s.color, strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round" }, "line-".concat(si))), series.map((s, si)=>{ const points = pts(seriesVals[si]); const last = points[points.length - 1]; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("g", { children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("circle", { cx: last[0], cy: last[1], r: 4, fill: "white", stroke: s.color, strokeWidth: 2 }) }, "dot-".concat(si)); }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: padL, y1: chartH, x2: W - 4, y2: chartH, stroke: "#e5e7eb", strokeWidth: 1 }) ] }) }); } /***/ }), /***/ 7067: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 6961)); /***/ }) }, /******/ __webpack_require__ => { // webpackRuntimeModules /******/ var __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId)) /******/ __webpack_require__.O(0, [1516,9664,9906,2982,587,18,7358], () => (__webpack_exec__(7067))); /******/ var __webpack_exports__ = __webpack_require__.O(); /******/ _N_E = __webpack_exports__; /******/ } ]); mÿÿÿÍþÿÿ `KÎþÿÿX(self["webpackChunk_N_E"] = self["webpackChunk_N_E"] || []).push([[3698],{ /***/ 1258: ÍþÿÿnÿÿÿÍþÿÿuÿÿÿÏþÿÿvÿÿÿwÿÿÿrÿÿÿsÿÿÿrÿÿÿxÿÿÿÍþÿÿnÿÿÿÍþÿÿyÿÿÿÏþÿÿzÿÿÿ{ÿÿÿrÿÿÿsÿÿÿrÿÿÿÚÍþÿÿnÿÿÿÍþÿÿÛÏþÿÿÜÝrÿÿÿsÿÿÿrÿÿÿ, /***/ 5940: ÌþÿÿmÿÿÿÌþÿÿÍ/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ Ez: () => (/* binding */ CategoryIcon), /* harmony export */ V: () => (/* binding */ isCategoryIconUrl) /* harmony export */ }); /* unused harmony export resolveCategoryIconUrl */ /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); Íþÿÿ'import { jsx as _jsx } from "react/jsx-runtime"; import React, { useEffect, useMemo, useState } from 'react'; const API_URL = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; export function isCategoryIconUrl(icon) { if (!icon) return false; const value = icon.trim(); return value.startsWith('http://') || value.startsWith('https://') || value.startsWith('/'); } export function resolveCategoryIconUrl(icon) { if (icon.startsWith('/api/')) return "".concat(API_URL).concat(icon); return icon; } export function CategoryIcon(param) { let { icon, alt = '', className, fallback = '📊' } = param; const value = (icon || '').trim(); const [hasError, setHasError] = useState(false); useEffect(()=>{ setHasError(false); }, [ value ]); const url = useMemo(()=>isCategoryIconUrl(value) ? resolveCategoryIconUrl(value) : '', [ value ]); const fallbackUrl = '/category-icons/package.svg'; if (isCategoryIconUrl(value)) { if (hasError && value !== fallbackUrl) { return /*#__PURE__*/ _jsx("img", { src: fallbackUrl, alt: alt, className: className, loading: "lazy", onError: ()=>setHasError(true) }); } if (hasError && value === fallbackUrl) { return /*#__PURE__*/ _jsx("span", { className: className, children: fallback }); } return /*#__PURE__*/ _jsx("img", { src: url, alt: alt, className: className, loading: "lazy", onError: ()=>setHasError(true) }); } return /*#__PURE__*/ _jsx("span", { className: className, children: value || fallback }); } T047undefined49108undefined126156"https://api.canhelp.gr"undefined1611830undefined186192undefined387393undefined527533undefined704711(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined725733(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined816822(0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)undefined10881091(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined13881391(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined15311534(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined17381741(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefinednÿÿÿoÿÿÿnÿÿÿ, /***/ 6961: ÈþÿÿiÿÿÿÈþÿÿúþÿÿÊþÿÿ,Äÿÿûþÿÿüþÿÿmÿÿÿnÿÿÿmÿÿÿ, /***/ 7067: ÇþÿÿwÿÿÿÉþÿÿSimport(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/admin/page.tsx"); k080Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 6961))undefinedjÿÿÿkÿÿÿjÿÿÿ³Åµjÿÿÿívar __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId)) __webpack_require__.O(0, [1516,9664,9906,2982,587,18,7358], () => (__webpack_exec__(7067))); var __webpack_exports__ = __webpack_require__.O(); iÿÿÿ¶·ž €©«webpack/lib/util/registerExternalSerializerœwebpack-sources/ConcatSource€` «webpack/lib/util/registerExternalSerializer™webpack-sources/RawSourceX(self["webpackChunk_N_E"] = self["webpackChunk_N_E"] || []).push([[2822],{ /***/ 1258: «webpack/lib/util/registerExternalSerializerœwebpack-sources/CachedSource d«webpack/lib/util/registerExternalSerializerœwebpack-sources/ConcatSource€«webpack/lib/util/registerExternalSerializer™webpack-sources/RawSource_/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; «webpack/lib/util/registerExternalSerializerœwebpack-sources/CachedSource Ê«webpack/lib/util/registerExternalSerializerœwebpack-sources/ConcatSource€«webpack/lib/util/registerExternalSerializer™webpack-sources/RawSourceÖ/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ E: () => (/* binding */ shortName), /* harmony export */ H: () => (/* binding */ formatShortName) /* harmony export */ }); «webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourceé/** * Shortens the last name to first letter + period. * "ИваМ ПетрПв" → "ИваМ П." * Works with a pre-composed full name string. */ export function shortName(fullName) { if (!(fullName === null || fullName === void 0 ? void 0 : fullName.trim())) return '—'; const parts = fullName.trim().split(/\s+/); if (parts.length < 2 || !parts[1]) return parts[0]; return "".concat(parts[0], " ").concat(parts[1][0].toUpperCase(), "."); } /** * Formats separate firstName + lastName fields, shortening the last name. * Falls back to parsing fullName if firstName is not available. */ export function formatShortName(firstName, lastName, fallbackName) { if (firstName === null || firstName === void 0 ? void 0 : firstName.trim()) { const l = lastName === null || lastName === void 0 ? void 0 : lastName.trim(); return l ? "".concat(firstName.trim(), " ").concat(l[0].toUpperCase(), ".") : firstName.trim(); } return shortName(fallbackName); } CˆŽTZ€€€†buffer†source„size„maps„hash±/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ E: () => (/* binding */ shortName), /* harmony export */ H: () => (/* binding */ formatShortName) /* harmony export */ }); /** * Shortens the last name to first letter + period. * "ИваМ ПетрПв" → "ИваМ П." * Works with a pre-composed full name string. */ function shortName(fullName) { if (!(fullName === null || fullName === void 0 ? void 0 : fullName.trim())) return '—'; const parts = fullName.trim().split(/\s+/); if (parts.length < 2 || !parts[1]) return parts[0]; return "".concat(parts[0], " ").concat(parts[1][0].toUpperCase(), "."); } /** * Formats separate firstName + lastName fields, shortening the last name. * Falls back to parsing fullName if firstName is not available. */ function formatShortName(firstName, lastName, fallbackName) { if (firstName === null || firstName === void 0 ? void 0 : firstName.trim()) { const l = lastName === null || lastName === void 0 ? void 0 : lastName.trim(); return l ? "".concat(firstName.trim(), " ").concat(l[0].toUpperCase(), ".") : firstName.trim(); } return shortName(fallbackName); } €”{"finalSource":true}ƒmap‹bufferedMap ConcatSourceRawSourceÖ/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ E: () => (/* binding */ shortName), /* harmony export */ H: () => (/* binding */ formatShortName) /* harmony export */ }); ReplaceSourceRawSourceé/** * Shortens the last name to first letter + period. * "ИваМ ПетрПв" → "ИваМ П." * Works with a pre-composed full name string. */ export function shortName(fullName) { if (!(fullName === null || fullName === void 0 ? void 0 : fullName.trim())) return '—'; const parts = fullName.trim().split(/\s+/); if (parts.length < 2 || !parts[1]) return parts[0]; return "".concat(parts[0], " ").concat(parts[1][0].toUpperCase(), "."); } /** * Formats separate firstName + lastName fields, shortening the last name. * Falls back to parsing fullName if firstName is not available. */ export function formatShortName(firstName, lastName, fallbackName) { if (firstName === null || firstName === void 0 ? void 0 : firstName.trim()) { const l = lastName === null || lastName === void 0 ? void 0 : lastName.trim(); return l ? "".concat(firstName.trim(), " ").concat(l[0].toUpperCase(), ".") : firstName.trim(); } return shortName(fallbackName); } 136142undefined596602undefined /***/ }) €†buffer†source„size„maps„hash/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ E: () => (/* binding */ shortName), /* harmony export */ H: () => (/* binding */ formatShortName) /* harmony export */ }); /** * Shortens the last name to first letter + period. * "ИваМ ПетрПв" → "ИваМ П." * Works with a pre-composed full name string. */ function shortName(fullName) { if (!(fullName === null || fullName === void 0 ? void 0 : fullName.trim())) return '—'; const parts = fullName.trim().split(/\s+/); if (parts.length < 2 || !parts[1]) return parts[0]; return "".concat(parts[0], " ").concat(parts[1][0].toUpperCase(), "."); } /** * Formats separate firstName + lastName fields, shortening the last name. * Falls back to parsing fullName if firstName is not available. */ function formatShortName(firstName, lastName, fallbackName) { if (firstName === null || firstName === void 0 ? void 0 : firstName.trim()) { const l = lastName === null || lastName === void 0 ? void 0 : lastName.trim(); return l ? "".concat(firstName.trim(), " ").concat(l[0].toUpperCase(), ".") : firstName.trim(); } return shortName(fallbackName); } /***/ }) €”{"finalSource":true}ƒmap‹bufferedMap  ConcatSourceRawSource_/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; þÖ/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ E: () => (/* binding */ shortName), /* harmony export */ H: () => (/* binding */ formatShortName) /* harmony export */ }); ReplaceSourceRawSourceé/** * Shortens the last name to first letter + period. * "ИваМ ПетрПв" → "ИваМ П." * Works with a pre-composed full name string. */ export function shortName(fullName) { if (!(fullName === null || fullName === void 0 ? void 0 : fullName.trim())) return '—'; const parts = fullName.trim().split(/\s+/); if (parts.length < 2 || !parts[1]) return parts[0]; return "".concat(parts[0], " ").concat(parts[1][0].toUpperCase(), "."); } /** * Formats separate firstName + lastName fields, shortening the last name. * Falls back to parsing fullName if firstName is not available. */ export function formatShortName(firstName, lastName, fallbackName) { if (firstName === null || firstName === void 0 ? void 0 : firstName.trim()) { const l = lastName === null || lastName === void 0 ? void 0 : lastName.trim(); return l ? "".concat(firstName.trim(), " ").concat(l[0].toUpperCase(), ".") : firstName.trim(); } return shortName(fallbackName); } 136142undefined596602undefined RawSource /***/ }), /***/ 1592:  ú «webpack/lib/util/registerExternalSerializerœwebpack-sources/ConcatSource€«webpack/lib/util/registerExternalSerializer™webpack-sources/RawSource_/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; «webpack/lib/util/registerExternalSerializerœwebpack-sources/CachedSource w«webpack/lib/util/registerExternalSerializerœwebpack-sources/ConcatSource€«webpack/lib/util/registerExternalSerializer™webpack-sources/RawSourceå/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ CI: () => (/* binding */ signOut), /* harmony export */ Hh: () => (/* binding */ signUp), /* harmony export */ Jv: () => (/* binding */ signIn), /* harmony export */ wV: () => (/* binding */ useSession), /* harmony export */ yK: () => (/* binding */ authClient) /* harmony export */ }); /* harmony import */ var better_auth_react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6504); «webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSource import { createAuthClient } from 'better-auth/react'; const API_URL = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; export const authClient = createAuthClient({ baseURL: API_URL }); export const { signIn, signOut, signUp, useSession } = authClient; d4FdiE‚ˆœ«È΀˜"https://api.canhelp.gr"0€Ì(0,better_auth_react__WEBPACK_IMPORTED_MODULE_0__/* .createAuthClient */ .M)€€†buffer†source„size„maps„hashÌ/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ CI: () => (/* binding */ signOut), /* harmony export */ Hh: () => (/* binding */ signUp), /* harmony export */ Jv: () => (/* binding */ signIn), /* harmony export */ wV: () => (/* binding */ useSession), /* harmony export */ yK: () => (/* binding */ authClient) /* harmony export */ }); /* harmony import */ var better_auth_react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6504); const API_URL = "https://api.canhelp.gr" || 0; const authClient = (0,better_auth_react__WEBPACK_IMPORTED_MODULE_0__/* .createAuthClient */ .M)({ baseURL: API_URL }); const { signIn, signOut, signUp, useSession } = authClient; €”{"finalSource":true}ƒmap‹bufferedMap ConcatSourceRawSourceå/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ CI: () => (/* binding */ signOut), /* harmony export */ Hh: () => (/* binding */ signUp), /* harmony export */ Jv: () => (/* binding */ signIn), /* harmony export */ wV: () => (/* binding */ useSession), /* harmony export */ yK: () => (/* binding */ authClient) /* harmony export */ }); /* harmony import */ var better_auth_react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6504); ReplaceSourceRawSource import { createAuthClient } from 'better-auth/react'; const API_URL = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; export const authClient = createAuthClient({ baseURL: API_URL }); export const { signIn, signOut, signUp, useSession } = authClient; »052undefined70100"https://api.canhelp.gr"undefined1051270undefined130136undefined156171(0,better_auth_react__WEBPACK_IMPORTED_MODULE_0__/* .createAuthClient */ .M)undefined200206undefined /***/ }) ë5/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ CI: () => (/* binding */ signOut), /* harmony export */ Hh: () => (/* binding */ signUp), /* harmony export */ Jv: () => (/* binding */ signIn), /* harmony export */ wV: () => (/* binding */ useSession), /* harmony export */ yK: () => (/* binding */ authClient) /* harmony export */ }); /* harmony import */ var better_auth_react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6504); const API_URL = "https://api.canhelp.gr" || 0; const authClient = (0,better_auth_react__WEBPACK_IMPORTED_MODULE_0__/* .createAuthClient */ .M)({ baseURL: API_URL }); const { signIn, signOut, signUp, useSession } = authClient; /***/ }) ìï  ðñðå/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ CI: () => (/* binding */ signOut), /* harmony export */ Hh: () => (/* binding */ signUp), /* harmony export */ Jv: () => (/* binding */ signIn), /* harmony export */ wV: () => (/* binding */ useSession), /* harmony export */ yK: () => (/* binding */ authClient) /* harmony export */ }); /* harmony import */ var better_auth_react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6504); ò import { createAuthClient } from 'better-auth/react'; const API_URL = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; export const authClient = createAuthClient({ baseURL: API_URL }); export const { signIn, signOut, signUp, useSession } = authClient; »052undefined70100"https://api.canhelp.gr"undefined1051270undefined130136undefined156171(0,better_auth_react__WEBPACK_IMPORTED_MODULE_0__/* .createAuthClient */ .M)undefined200206undefinedóô, /***/ 3899:  ¹Ë«webpack/lib/util/registerExternalSerializerœwebpack-sources/ConcatSource€«webpack/lib/util/registerExternalSerializer™webpack-sources/RawSource_/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; «webpack/lib/util/registerExternalSerializerœwebpack-sources/CachedSource ê?«webpack/lib/util/registerExternalSerializerœwebpack-sources/ConcatSource€«webpack/lib/util/registerExternalSerializer™webpack-sources/RawSourceÃ__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ MakeOfferPage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7541); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(9664); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(next_link__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(1592); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(9906); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(2982); /* harmony import */ var _lib_formatName__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(1258); /* harmony import */ var _lib_taskLocale__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(4017); «webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourceÊ3/* __next_internal_client_entry_do_not_use__ default auto */ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { useState, useEffect } from 'react'; import { useRouter, useParams } from 'next/navigation'; import Link from 'next/link'; import { useSession } from '@/lib/auth'; import { useLocale } from '@/context/locale'; import { getTask, createOffer, getLocations } from '@/lib/api'; import { shortName } from '@/lib/formatName'; import { formatPrice, taskTitle, taskDescription } from '@/lib/taskLocale'; export default function MakeOfferPage() { const { id } = useParams(); const router = useRouter(); const { data: session, isPending } = useSession(); const { t, locale } = useLocale(); const [task, setTask] = useState(null); const [loading, setLoading] = useState(true); const [rawLocs, setRawLocs] = useState([]); const [submitting, setSubmitting] = useState(false); const [error, setError] = useState(''); const locMap = rawLocs.reduce((acc, city)=>{ var _city_names, _city_names1; var _city_names_locale, _ref; acc[city.slug] = (_ref = (_city_names_locale = (_city_names = city.names) === null || _city_names === void 0 ? void 0 : _city_names[locale]) !== null && _city_names_locale !== void 0 ? _city_names_locale : (_city_names1 = city.names) === null || _city_names1 === void 0 ? void 0 : _city_names1.el) !== null && _ref !== void 0 ? _ref : city.slug; var _city_children; for (const d of (_city_children = city.children) !== null && _city_children !== void 0 ? _city_children : []){ var _d_names, _d_names1; var _d_names_locale, _ref1; acc[d.slug] = (_ref1 = (_d_names_locale = (_d_names = d.names) === null || _d_names === void 0 ? void 0 : _d_names[locale]) !== null && _d_names_locale !== void 0 ? _d_names_locale : (_d_names1 = d.names) === null || _d_names1 === void 0 ? void 0 : _d_names1.el) !== null && _ref1 !== void 0 ? _ref1 : d.slug; } return acc; }, {}); useEffect(()=>{ if (!isPending && !session) router.push('/login'); }, [ session, isPending ]); useEffect(()=>{ if (!id) return; getTask(id).then((data)=>setTask(data)).catch(()=>router.push("/tasks/".concat(id))).finally(()=>setLoading(false)); getLocations().then((locs)=>setRawLocs(locs)).catch(()=>{}); }, [ id ]); async function handleSubmit(e) { e.preventDefault(); setError(''); setSubmitting(true); const form = new FormData(e.currentTarget); try { await createOffer({ taskId: id, price: Number(form.get('price')), message: form.get('message') || undefined }); router.push("/tasks/".concat(id)); } catch (err) { setError(err.message || t('common.error')); } finally{ setSubmitting(false); } } if (isPending || loading) { return /*#__PURE__*/ _jsx("div", { className: "text-center py-20 text-white", children: t('common.loading') }); } var _task_task; const taskData = (_task_task = task === null || task === void 0 ? void 0 : task.task) !== null && _task_task !== void 0 ? _task_task : task; const customer = task === null || task === void 0 ? void 0 : task.customer; const customerName = (customer === null || customer === void 0 ? void 0 : customer.name) ? shortName(customer.name) : null; var _taskData_title, _locMap_taskData_location; return /*#__PURE__*/ _jsxs("div", { className: "max-w-xl mx-auto px-4 py-10", children: [ /*#__PURE__*/ _jsxs(Link, { href: "/tasks/".concat(id), className: "inline-flex items-center gap-1.5 text-sm text-white/70 hover:text-white mb-8 transition", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 19l-7-7 7-7" }) }), (_taskData_title = taskData === null || taskData === void 0 ? void 0 : taskData.title) !== null && _taskData_title !== void 0 ? _taskData_title : t('common.back_home', 'Back') ] }), /*#__PURE__*/ _jsx("h1", { className: "text-2xl font-bold text-white mb-1", children: t('task.offer.btn') }), customerName && /*#__PURE__*/ _jsxs("p", { className: "text-sm text-white/60 mb-6", children: [ t('common.from'), " ", customerName ] }), taskData && /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-4 mb-6 shadow-sm", children: [ /*#__PURE__*/ _jsx("p", { className: "font-semibold text-gray-900 text-sm line-clamp-2", children: taskTitle(taskData, locale) }), taskDescription(taskData, locale) && /*#__PURE__*/ _jsx("p", { className: "text-gray-500 text-xs mt-1 line-clamp-2", children: taskDescription(taskData, locale) }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-4 mt-2", children: [ taskData.budget && /*#__PURE__*/ _jsxs("span", { className: "text-xs text-gray-500", children: [ "\uD83D\uDCB0 ", t('task.budget'), ": ", /*#__PURE__*/ _jsxs("strong", { className: "text-gray-900", children: [ formatPrice(taskData.budget), "€" ] }) ] }), taskData.budgetNegotiable && !taskData.budget && /*#__PURE__*/ _jsxs("span", { className: "text-xs text-gray-500", children: [ "\uD83D\uDCAC ", t('task.budget_negotiable') ] }), taskData.location && /*#__PURE__*/ _jsxs("span", { className: "text-xs text-gray-500", children: [ "\uD83D\uDCCD ", (_locMap_taskData_location = locMap[taskData.location]) !== null && _locMap_taskData_location !== void 0 ? _locMap_taskData_location : taskData.location ] }) ] }) ] }), /*#__PURE__*/ _jsxs("form", { onSubmit: handleSubmit, className: "bg-white rounded-2xl border border-gray-100 p-6 shadow-sm space-y-5", children: [ error && /*#__PURE__*/ _jsx("div", { className: "bg-red-50 text-red-700 p-3 rounded-lg text-sm", children: error }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("label", { className: "block text-sm font-medium text-gray-700 mb-1.5", children: [ t('offer.price'), " (€) ", /*#__PURE__*/ _jsx("span", { className: "text-red-500", children: "*" }) ] }), /*#__PURE__*/ _jsxs("div", { className: "relative", children: [ /*#__PURE__*/ _jsx("span", { className: "absolute left-3 top-1/2 -translate-y-1/2 text-gray-400 font-medium select-none", children: "€" }), /*#__PURE__*/ _jsx("input", { name: "price", type: "number", required: true, min: 1, step: 1, placeholder: t('offer.price.placeholder'), className: "w-full border border-gray-200 rounded-xl pl-8 pr-3 py-3 focus:outline-none focus:ring-2 focus:ring-blue-400 text-xl font-bold text-gray-900" }) ] }), (taskData === null || taskData === void 0 ? void 0 : taskData.budget) && /*#__PURE__*/ _jsxs("p", { className: "text-xs text-gray-400 mt-1.5", children: [ t('offer.customer_budget'), ": ", /*#__PURE__*/ _jsxs("strong", { children: [ formatPrice(taskData.budget), "€" ] }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("label", { className: "block text-sm font-medium text-gray-700 mb-1.5", children: [ t('offer.message'), /*#__PURE__*/ _jsxs("span", { className: "text-gray-400 font-normal ml-1", children: [ "(", t('offer.optional'), ")" ] }) ] }), /*#__PURE__*/ _jsx("textarea", { name: "message", rows: 5, maxLength: 2000, placeholder: t('offer.message.placeholder'), className: "w-full border border-gray-200 rounded-xl px-3 py-2.5 focus:outline-none focus:ring-2 focus:ring-blue-400 resize-none text-sm text-gray-700" }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-3 pt-1", children: [ /*#__PURE__*/ _jsx("button", { type: "submit", disabled: submitting, className: "flex-1 bg-green-600 text-white py-3 rounded-xl font-semibold hover:bg-green-700 disabled:opacity-50 disabled:cursor-not-allowed transition", children: submitting ? t('offer.submitting') : t('task.offer.btn') }), /*#__PURE__*/ _jsx(Link, { href: "/tasks/".concat(id), className: "px-5 py-3 rounded-xl border border-gray-200 text-gray-600 hover:bg-gray-50 font-medium text-sm flex items-center transition", children: t('common.cancel') }) ] }) ] }) ] }); } c@={}_šªàâþ')UW•—ÃÅNVnv€­ÌÔõü'.Y`_–ŸÅü‡°¶- 8 N X õ ø Ê Ò 8<§«­°•˜­°‰Œ?CI_Mòõw¿Íòõn|ÊÎ}ÄÈz„¶º,0LP-0ñõN R }!\€!˜"œ"<#?#`$c$h'l'ˆ(Œ(ú().*2*‹**+“+‡-Š-/¡/0030 2222€€€€€€€€€€º(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useParams)º(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)¿(0,_lib_auth__WEBPACK_IMPORTED_MODULE_4__/* .useSession */ .wV)Ã(0,_context_locale__WEBPACK_IMPORTED_MODULE_5__/* .useLocale */ .Y)¯(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)ÿÿÿÿ°(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)ÿ»(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getTask */ .gg)À(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getLocations */ .Vs)¿(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .createOffer */ .ts)¶(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)Ã(0,_lib_formatName__WEBPACK_IMPORTED_MODULE_7__/* .shortName */ .E)·(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)ÿ²(next_link__WEBPACK_IMPORTED_MODULE_3___default())üüüþþüÄ(0,_lib_taskLocale__WEBPACK_IMPORTED_MODULE_8__/* .taskTitle */ .Oj)Ê(0,_lib_taskLocale__WEBPACK_IMPORTED_MODULE_8__/* .taskDescription */ .GZ)úÿüüüÆ(0,_lib_taskLocale__WEBPACK_IMPORTED_MODULE_8__/* .formatPrice */ .$g)ûûûùûûùûùùûûÿûûûùûùùü€†buffer†source„size„maps„hash.A__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ MakeOfferPage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7541); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(9664); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(next_link__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(1592); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(9906); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(2982); /* harmony import */ var _lib_formatName__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(1258); /* harmony import */ var _lib_taskLocale__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(4017); /* __next_internal_client_entry_do_not_use__ default auto */ function MakeOfferPage() { const { id } = (0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useParams)(); const router = (0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)(); const { data: session, isPending } = (0,_lib_auth__WEBPACK_IMPORTED_MODULE_4__/* .useSession */ .wV)(); const { t, locale } = (0,_context_locale__WEBPACK_IMPORTED_MODULE_5__/* .useLocale */ .Y)(); const [task, setTask] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [loading, setLoading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(true); const [rawLocs, setRawLocs] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [submitting, setSubmitting] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [error, setError] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const locMap = rawLocs.reduce((acc, city)=>{ var _city_names, _city_names1; var _city_names_locale, _ref; acc[city.slug] = (_ref = (_city_names_locale = (_city_names = city.names) === null || _city_names === void 0 ? void 0 : _city_names[locale]) !== null && _city_names_locale !== void 0 ? _city_names_locale : (_city_names1 = city.names) === null || _city_names1 === void 0 ? void 0 : _city_names1.el) !== null && _ref !== void 0 ? _ref : city.slug; var _city_children; for (const d of (_city_children = city.children) !== null && _city_children !== void 0 ? _city_children : []){ var _d_names, _d_names1; var _d_names_locale, _ref1; acc[d.slug] = (_ref1 = (_d_names_locale = (_d_names = d.names) === null || _d_names === void 0 ? void 0 : _d_names[locale]) !== null && _d_names_locale !== void 0 ? _d_names_locale : (_d_names1 = d.names) === null || _d_names1 === void 0 ? void 0 : _d_names1.el) !== null && _ref1 !== void 0 ? _ref1 : d.slug; } return acc; }, {}); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!isPending && !session) router.push('/login'); }, [ session, isPending ]); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!id) return; (0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getTask */ .gg)(id).then((data)=>setTask(data)).catch(()=>router.push("/tasks/".concat(id))).finally(()=>setLoading(false)); (0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getLocations */ .Vs)().then((locs)=>setRawLocs(locs)).catch(()=>{}); }, [ id ]); async function handleSubmit(e) { e.preventDefault(); setError(''); setSubmitting(true); const form = new FormData(e.currentTarget); try { await (0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .createOffer */ .ts)({ taskId: id, price: Number(form.get('price')), message: form.get('message') || undefined }); router.push("/tasks/".concat(id)); } catch (err) { setError(err.message || t('common.error')); } finally{ setSubmitting(false); } } if (isPending || loading) { return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-center py-20 text-white", children: t('common.loading') }); } var _task_task; const taskData = (_task_task = task === null || task === void 0 ? void 0 : task.task) !== null && _task_task !== void 0 ? _task_task : task; const customer = task === null || task === void 0 ? void 0 : task.customer; const customerName = (customer === null || customer === void 0 ? void 0 : customer.name) ? (0,_lib_formatName__WEBPACK_IMPORTED_MODULE_7__/* .shortName */ .E)(customer.name) : null; var _taskData_title, _locMap_taskData_location; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "max-w-xl mx-auto px-4 py-10", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)((next_link__WEBPACK_IMPORTED_MODULE_3___default()), { href: "/tasks/".concat(id), className: "inline-flex items-center gap-1.5 text-sm text-white/70 hover:text-white mb-8 transition", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 19l-7-7 7-7" }) }), (_taskData_title = taskData === null || taskData === void 0 ? void 0 : taskData.title) !== null && _taskData_title !== void 0 ? _taskData_title : t('common.back_home', 'Back') ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h1", { className: "text-2xl font-bold text-white mb-1", children: t('task.offer.btn') }), customerName && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { className: "text-sm text-white/60 mb-6", children: [ t('common.from'), " ", customerName ] }), taskData && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-4 mb-6 shadow-sm", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "font-semibold text-gray-900 text-sm line-clamp-2", children: (0,_lib_taskLocale__WEBPACK_IMPORTED_MODULE_8__/* .taskTitle */ .Oj)(taskData, locale) }), (0,_lib_taskLocale__WEBPACK_IMPORTED_MODULE_8__/* .taskDescription */ .GZ)(taskData, locale) && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-gray-500 text-xs mt-1 line-clamp-2", children: (0,_lib_taskLocale__WEBPACK_IMPORTED_MODULE_8__/* .taskDescription */ .GZ)(taskData, locale) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-4 mt-2", children: [ taskData.budget && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "text-xs text-gray-500", children: [ "\uD83D\uDCB0 ", t('task.budget'), ": ", /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("strong", { className: "text-gray-900", children: [ (0,_lib_taskLocale__WEBPACK_IMPORTED_MODULE_8__/* .formatPrice */ .$g)(taskData.budget), "€" ] }) ] }), taskData.budgetNegotiable && !taskData.budget && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "text-xs text-gray-500", children: [ "\uD83D\uDCAC ", t('task.budget_negotiable') ] }), taskData.location && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "text-xs text-gray-500", children: [ "\uD83D\uDCCD ", (_locMap_taskData_location = locMap[taskData.location]) !== null && _locMap_taskData_location !== void 0 ? _locMap_taskData_location : taskData.location ] }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("form", { onSubmit: handleSubmit, className: "bg-white rounded-2xl border border-gray-100 p-6 shadow-sm space-y-5", children: [ error && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "bg-red-50 text-red-700 p-3 rounded-lg text-sm", children: error }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "block text-sm font-medium text-gray-700 mb-1.5", children: [ t('offer.price'), " (€) ", /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-red-500", children: "*" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "relative", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "absolute left-3 top-1/2 -translate-y-1/2 text-gray-400 font-medium select-none", children: "€" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { name: "price", type: "number", required: true, min: 1, step: 1, placeholder: t('offer.price.placeholder'), className: "w-full border border-gray-200 rounded-xl pl-8 pr-3 py-3 focus:outline-none focus:ring-2 focus:ring-blue-400 text-xl font-bold text-gray-900" }) ] }), (taskData === null || taskData === void 0 ? void 0 : taskData.budget) && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { className: "text-xs text-gray-400 mt-1.5", children: [ t('offer.customer_budget'), ": ", /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("strong", { children: [ (0,_lib_taskLocale__WEBPACK_IMPORTED_MODULE_8__/* .formatPrice */ .$g)(taskData.budget), "€" ] }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "block text-sm font-medium text-gray-700 mb-1.5", children: [ t('offer.message'), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "text-gray-400 font-normal ml-1", children: [ "(", t('offer.optional'), ")" ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("textarea", { name: "message", rows: 5, maxLength: 2000, placeholder: t('offer.message.placeholder'), className: "w-full border border-gray-200 rounded-xl px-3 py-2.5 focus:outline-none focus:ring-2 focus:ring-blue-400 resize-none text-sm text-gray-700" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-3 pt-1", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "submit", disabled: submitting, className: "flex-1 bg-green-600 text-white py-3 rounded-xl font-semibold hover:bg-green-700 disabled:opacity-50 disabled:cursor-not-allowed transition", children: submitting ? t('offer.submitting') : t('task.offer.btn') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)((next_link__WEBPACK_IMPORTED_MODULE_3___default()), { href: "/tasks/".concat(id), className: "px-5 py-3 rounded-xl border border-gray-200 text-gray-600 hover:bg-gray-50 font-medium text-sm flex items-center transition", children: t('common.cancel') }) ] }) ] }) ] }); } €”{"finalSource":true}ƒmap‹bufferedMap ConcatSourceRawSourceÃ__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ MakeOfferPage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7541); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(9664); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(next_link__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(1592); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(9906); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(2982); /* harmony import */ var _lib_formatName__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(1258); /* harmony import */ var _lib_taskLocale__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(4017); ReplaceSourceRawSourceÊ3/* __next_internal_client_entry_do_not_use__ default auto */ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { useState, useEffect } from 'react'; import { useRouter, useParams } from 'next/navigation'; import Link from 'next/link'; import { useSession } from '@/lib/auth'; import { useLocale } from '@/context/locale'; import { getTask, createOffer, getLocations } from '@/lib/api'; import { shortName } from '@/lib/formatName'; import { formatPrice, taskTitle, taskDescription } from '@/lib/taskLocale'; export default function MakeOfferPage() { const { id } = useParams(); const router = useRouter(); const { data: session, isPending } = useSession(); const { t, locale } = useLocale(); const [task, setTask] = useState(null); const [loading, setLoading] = useState(true); const [rawLocs, setRawLocs] = useState([]); const [submitting, setSubmitting] = useState(false); const [error, setError] = useState(''); const locMap = rawLocs.reduce((acc, city)=>{ var _city_names, _city_names1; var _city_names_locale, _ref; acc[city.slug] = (_ref = (_city_names_locale = (_city_names = city.names) === null || _city_names === void 0 ? void 0 : _city_names[locale]) !== null && _city_names_locale !== void 0 ? _city_names_locale : (_city_names1 = city.names) === null || _city_names1 === void 0 ? void 0 : _city_names1.el) !== null && _ref !== void 0 ? _ref : city.slug; var _city_children; for (const d of (_city_children = city.children) !== null && _city_children !== void 0 ? _city_children : []){ var _d_names, _d_names1; var _d_names_locale, _ref1; acc[d.slug] = (_ref1 = (_d_names_locale = (_d_names = d.names) === null || _d_names === void 0 ? void 0 : _d_names[locale]) !== null && _d_names_locale !== void 0 ? _d_names_locale : (_d_names1 = d.names) === null || _d_names1 === void 0 ? void 0 : _d_names1.el) !== null && _ref1 !== void 0 ? _ref1 : d.slug; } return acc; }, {}); useEffect(()=>{ if (!isPending && !session) router.push('/login'); }, [ session, isPending ]); useEffect(()=>{ if (!id) return; getTask(id).then((data)=>setTask(data)).catch(()=>router.push("/tasks/".concat(id))).finally(()=>setLoading(false)); getLocations().then((locs)=>setRawLocs(locs)).catch(()=>{}); }, [ id ]); async function handleSubmit(e) { e.preventDefault(); setError(''); setSubmitting(true); const form = new FormData(e.currentTarget); try { await createOffer({ taskId: id, price: Number(form.get('price')), message: form.get('message') || undefined }); router.push("/tasks/".concat(id)); } catch (err) { setError(err.message || t('common.error')); } finally{ setSubmitting(false); } } if (isPending || loading) { return /*#__PURE__*/ _jsx("div", { className: "text-center py-20 text-white", children: t('common.loading') }); } var _task_task; const taskData = (_task_task = task === null || task === void 0 ? void 0 : task.task) !== null && _task_task !== void 0 ? _task_task : task; const customer = task === null || task === void 0 ? void 0 : task.customer; const customerName = (customer === null || customer === void 0 ? void 0 : customer.name) ? shortName(customer.name) : null; var _taskData_title, _locMap_taskData_location; return /*#__PURE__*/ _jsxs("div", { className: "max-w-xl mx-auto px-4 py-10", children: [ /*#__PURE__*/ _jsxs(Link, { href: "/tasks/".concat(id), className: "inline-flex items-center gap-1.5 text-sm text-white/70 hover:text-white mb-8 transition", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 19l-7-7 7-7" }) }), (_taskData_title = taskData === null || taskData === void 0 ? void 0 : taskData.title) !== null && _taskData_title !== void 0 ? _taskData_title : t('common.back_home', 'Back') ] }), /*#__PURE__*/ _jsx("h1", { className: "text-2xl font-bold text-white mb-1", children: t('task.offer.btn') }), customerName && /*#__PURE__*/ _jsxs("p", { className: "text-sm text-white/60 mb-6", children: [ t('common.from'), " ", customerName ] }), taskData && /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-4 mb-6 shadow-sm", children: [ /*#__PURE__*/ _jsx("p", { className: "font-semibold text-gray-900 text-sm line-clamp-2", children: taskTitle(taskData, locale) }), taskDescription(taskData, locale) && /*#__PURE__*/ _jsx("p", { className: "text-gray-500 text-xs mt-1 line-clamp-2", children: taskDescription(taskData, locale) }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-4 mt-2", children: [ taskData.budget && /*#__PURE__*/ _jsxs("span", { className: "text-xs text-gray-500", children: [ "\uD83D\uDCB0 ", t('task.budget'), ": ", /*#__PURE__*/ _jsxs("strong", { className: "text-gray-900", children: [ formatPrice(taskData.budget), "€" ] }) ] }), taskData.budgetNegotiable && !taskData.budget && /*#__PURE__*/ _jsxs("span", { className: "text-xs text-gray-500", children: [ "\uD83D\uDCAC ", t('task.budget_negotiable') ] }), taskData.location && /*#__PURE__*/ _jsxs("span", { className: "text-xs text-gray-500", children: [ "\uD83D\uDCCD ", (_locMap_taskData_location = locMap[taskData.location]) !== null && _locMap_taskData_location !== void 0 ? _locMap_taskData_location : taskData.location ] }) ] }) ] }), /*#__PURE__*/ _jsxs("form", { onSubmit: handleSubmit, className: "bg-white rounded-2xl border border-gray-100 p-6 shadow-sm space-y-5", children: [ error && /*#__PURE__*/ _jsx("div", { className: "bg-red-50 text-red-700 p-3 rounded-lg text-sm", children: error }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("label", { className: "block text-sm font-medium text-gray-700 mb-1.5", children: [ t('offer.price'), " (€) ", /*#__PURE__*/ _jsx("span", { className: "text-red-500", children: "*" }) ] }), /*#__PURE__*/ _jsxs("div", { className: "relative", children: [ /*#__PURE__*/ _jsx("span", { className: "absolute left-3 top-1/2 -translate-y-1/2 text-gray-400 font-medium select-none", children: "€" }), /*#__PURE__*/ _jsx("input", { name: "price", type: "number", required: true, min: 1, step: 1, placeholder: t('offer.price.placeholder'), className: "w-full border border-gray-200 rounded-xl pl-8 pr-3 py-3 focus:outline-none focus:ring-2 focus:ring-blue-400 text-xl font-bold text-gray-900" }) ] }), (taskData === null || taskData === void 0 ? void 0 : taskData.budget) && /*#__PURE__*/ _jsxs("p", { className: "text-xs text-gray-400 mt-1.5", children: [ t('offer.customer_budget'), ": ", /*#__PURE__*/ _jsxs("strong", { children: [ formatPrice(taskData.budget), "€" ] }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("label", { className: "block text-sm font-medium text-gray-700 mb-1.5", children: [ t('offer.message'), /*#__PURE__*/ _jsxs("span", { className: "text-gray-400 font-normal ml-1", children: [ "(", t('offer.optional'), ")" ] }) ] }), /*#__PURE__*/ _jsx("textarea", { name: "message", rows: 5, maxLength: 2000, placeholder: t('offer.message.placeholder'), className: "w-full border border-gray-200 rounded-xl px-3 py-2.5 focus:outline-none focus:ring-2 focus:ring-blue-400 resize-none text-sm text-gray-700" }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-3 pt-1", children: [ /*#__PURE__*/ _jsx("button", { type: "submit", disabled: submitting, className: "flex-1 bg-green-600 text-white py-3 rounded-xl font-semibold hover:bg-green-700 disabled:opacity-50 disabled:cursor-not-allowed transition", children: submitting ? t('offer.submitting') : t('task.offer.btn') }), /*#__PURE__*/ _jsx(Link, { href: "/tasks/".concat(id), className: "px-5 py-3 rounded-xl border border-gray-200 text-gray-600 hover:bg-gray-50 font-medium text-sm flex items-center transition", children: t('common.cancel') }) ] }) ] }) ] }); } 61123undefined125168undefined170224undefined226254undefined256295undefined297341undefined343405undefined407451undefined453527undefined529543undefined590598(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useParams)undefined622630(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)undefined676685(0,_lib_auth__WEBPACK_IMPORTED_MODULE_4__/* .useSession */ .wV)undefined716724(0,_context_locale__WEBPACK_IMPORTED_MODULE_5__/* .useLocale */ .Y)undefined757764(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined807814(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined857864(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined911918(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined958965(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined20442052(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined21752183(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined22242230(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getTask */ .gg)undefined23492360(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getLocations */ .Vs)undefined26382648(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .createOffer */ .ts)undefined30613064(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined35303538(0,_lib_formatName__WEBPACK_IMPORTED_MODULE_7__/* .shortName */ .E)undefined36403644(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined37513755(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined37573760(next_link__WEBPACK_IMPORTED_MODULE_3___default())undefined39893992(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined42694272(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined47454748(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined49274931(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined51935197(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined53625365(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined54955503(0,_lib_taskLocale__WEBPACK_IMPORTED_MODULE_8__/* .taskTitle */ .Oj)undefined55675581(0,_lib_taskLocale__WEBPACK_IMPORTED_MODULE_8__/* .taskDescription */ .GZ)undefined56185621(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined57425756(0,_lib_taskLocale__WEBPACK_IMPORTED_MODULE_8__/* .taskDescription */ .GZ)undefined58345838(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined60136017(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined63406344(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined65226532(0,_lib_taskLocale__WEBPACK_IMPORTED_MODULE_8__/* .formatPrice */ .$g)undefined68386842(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined72127216(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined77567760(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined79817984(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined81778181(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined82708274(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined85738576(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined88568860(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined90209023(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined93129315(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1008810092(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1037610380(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1049010500(0,_lib_taskLocale__WEBPACK_IMPORTED_MODULE_8__/* .formatPrice */ .$g)undefined1079810802(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1089110895(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1115111155(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1165511658(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1218912193(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1233612339(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1281312816(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1281812821(next_link__WEBPACK_IMPORTED_MODULE_3___default())undefined /***/ }) à—A/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ MakeOfferPage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7541); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(9664); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(next_link__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(1592); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(9906); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(2982); /* harmony import */ var _lib_formatName__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(1258); /* harmony import */ var _lib_taskLocale__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(4017); /* __next_internal_client_entry_do_not_use__ default auto */ function MakeOfferPage() { const { id } = (0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useParams)(); const router = (0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)(); const { data: session, isPending } = (0,_lib_auth__WEBPACK_IMPORTED_MODULE_4__/* .useSession */ .wV)(); const { t, locale } = (0,_context_locale__WEBPACK_IMPORTED_MODULE_5__/* .useLocale */ .Y)(); const [task, setTask] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [loading, setLoading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(true); const [rawLocs, setRawLocs] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [submitting, setSubmitting] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [error, setError] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const locMap = rawLocs.reduce((acc, city)=>{ var _city_names, _city_names1; var _city_names_locale, _ref; acc[city.slug] = (_ref = (_city_names_locale = (_city_names = city.names) === null || _city_names === void 0 ? void 0 : _city_names[locale]) !== null && _city_names_locale !== void 0 ? _city_names_locale : (_city_names1 = city.names) === null || _city_names1 === void 0 ? void 0 : _city_names1.el) !== null && _ref !== void 0 ? _ref : city.slug; var _city_children; for (const d of (_city_children = city.children) !== null && _city_children !== void 0 ? _city_children : []){ var _d_names, _d_names1; var _d_names_locale, _ref1; acc[d.slug] = (_ref1 = (_d_names_locale = (_d_names = d.names) === null || _d_names === void 0 ? void 0 : _d_names[locale]) !== null && _d_names_locale !== void 0 ? _d_names_locale : (_d_names1 = d.names) === null || _d_names1 === void 0 ? void 0 : _d_names1.el) !== null && _ref1 !== void 0 ? _ref1 : d.slug; } return acc; }, {}); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!isPending && !session) router.push('/login'); }, [ session, isPending ]); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!id) return; (0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getTask */ .gg)(id).then((data)=>setTask(data)).catch(()=>router.push("/tasks/".concat(id))).finally(()=>setLoading(false)); (0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getLocations */ .Vs)().then((locs)=>setRawLocs(locs)).catch(()=>{}); }, [ id ]); async function handleSubmit(e) { e.preventDefault(); setError(''); setSubmitting(true); const form = new FormData(e.currentTarget); try { await (0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .createOffer */ .ts)({ taskId: id, price: Number(form.get('price')), message: form.get('message') || undefined }); router.push("/tasks/".concat(id)); } catch (err) { setError(err.message || t('common.error')); } finally{ setSubmitting(false); } } if (isPending || loading) { return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-center py-20 text-white", children: t('common.loading') }); } var _task_task; const taskData = (_task_task = task === null || task === void 0 ? void 0 : task.task) !== null && _task_task !== void 0 ? _task_task : task; const customer = task === null || task === void 0 ? void 0 : task.customer; const customerName = (customer === null || customer === void 0 ? void 0 : customer.name) ? (0,_lib_formatName__WEBPACK_IMPORTED_MODULE_7__/* .shortName */ .E)(customer.name) : null; var _taskData_title, _locMap_taskData_location; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "max-w-xl mx-auto px-4 py-10", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)((next_link__WEBPACK_IMPORTED_MODULE_3___default()), { href: "/tasks/".concat(id), className: "inline-flex items-center gap-1.5 text-sm text-white/70 hover:text-white mb-8 transition", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 19l-7-7 7-7" }) }), (_taskData_title = taskData === null || taskData === void 0 ? void 0 : taskData.title) !== null && _taskData_title !== void 0 ? _taskData_title : t('common.back_home', 'Back') ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h1", { className: "text-2xl font-bold text-white mb-1", children: t('task.offer.btn') }), customerName && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { className: "text-sm text-white/60 mb-6", children: [ t('common.from'), " ", customerName ] }), taskData && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-4 mb-6 shadow-sm", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "font-semibold text-gray-900 text-sm line-clamp-2", children: (0,_lib_taskLocale__WEBPACK_IMPORTED_MODULE_8__/* .taskTitle */ .Oj)(taskData, locale) }), (0,_lib_taskLocale__WEBPACK_IMPORTED_MODULE_8__/* .taskDescription */ .GZ)(taskData, locale) && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-gray-500 text-xs mt-1 line-clamp-2", children: (0,_lib_taskLocale__WEBPACK_IMPORTED_MODULE_8__/* .taskDescription */ .GZ)(taskData, locale) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-4 mt-2", children: [ taskData.budget && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "text-xs text-gray-500", children: [ "\uD83D\uDCB0 ", t('task.budget'), ": ", /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("strong", { className: "text-gray-900", children: [ (0,_lib_taskLocale__WEBPACK_IMPORTED_MODULE_8__/* .formatPrice */ .$g)(taskData.budget), "€" ] }) ] }), taskData.budgetNegotiable && !taskData.budget && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "text-xs text-gray-500", children: [ "\uD83D\uDCAC ", t('task.budget_negotiable') ] }), taskData.location && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "text-xs text-gray-500", children: [ "\uD83D\uDCCD ", (_locMap_taskData_location = locMap[taskData.location]) !== null && _locMap_taskData_location !== void 0 ? _locMap_taskData_location : taskData.location ] }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("form", { onSubmit: handleSubmit, className: "bg-white rounded-2xl border border-gray-100 p-6 shadow-sm space-y-5", children: [ error && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "bg-red-50 text-red-700 p-3 rounded-lg text-sm", children: error }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "block text-sm font-medium text-gray-700 mb-1.5", children: [ t('offer.price'), " (€) ", /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-red-500", children: "*" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "relative", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "absolute left-3 top-1/2 -translate-y-1/2 text-gray-400 font-medium select-none", children: "€" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { name: "price", type: "number", required: true, min: 1, step: 1, placeholder: t('offer.price.placeholder'), className: "w-full border border-gray-200 rounded-xl pl-8 pr-3 py-3 focus:outline-none focus:ring-2 focus:ring-blue-400 text-xl font-bold text-gray-900" }) ] }), (taskData === null || taskData === void 0 ? void 0 : taskData.budget) && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { className: "text-xs text-gray-400 mt-1.5", children: [ t('offer.customer_budget'), ": ", /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("strong", { children: [ (0,_lib_taskLocale__WEBPACK_IMPORTED_MODULE_8__/* .formatPrice */ .$g)(taskData.budget), "€" ] }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "block text-sm font-medium text-gray-700 mb-1.5", children: [ t('offer.message'), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "text-gray-400 font-normal ml-1", children: [ "(", t('offer.optional'), ")" ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("textarea", { name: "message", rows: 5, maxLength: 2000, placeholder: t('offer.message.placeholder'), className: "w-full border border-gray-200 rounded-xl px-3 py-2.5 focus:outline-none focus:ring-2 focus:ring-blue-400 resize-none text-sm text-gray-700" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-3 pt-1", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "submit", disabled: submitting, className: "flex-1 bg-green-600 text-white py-3 rounded-xl font-semibold hover:bg-green-700 disabled:opacity-50 disabled:cursor-not-allowed transition", children: submitting ? t('offer.submitting') : t('task.offer.btn') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)((next_link__WEBPACK_IMPORTED_MODULE_3___default()), { href: "/tasks/".concat(id), className: "px-5 py-3 rounded-xl border border-gray-200 text-gray-600 hover:bg-gray-50 font-medium text-sm flex items-center transition", children: t('common.cancel') }) ] }) ] }) ] }); } /***/ }) áä  åæåÃ__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ MakeOfferPage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7541); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(9664); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(next_link__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(1592); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(9906); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(2982); /* harmony import */ var _lib_formatName__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(1258); /* harmony import */ var _lib_taskLocale__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(4017); çÊ3/* __next_internal_client_entry_do_not_use__ default auto */ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { useState, useEffect } from 'react'; import { useRouter, useParams } from 'next/navigation'; import Link from 'next/link'; import { useSession } from '@/lib/auth'; import { useLocale } from '@/context/locale'; import { getTask, createOffer, getLocations } from '@/lib/api'; import { shortName } from '@/lib/formatName'; import { formatPrice, taskTitle, taskDescription } from '@/lib/taskLocale'; export default function MakeOfferPage() { const { id } = useParams(); const router = useRouter(); const { data: session, isPending } = useSession(); const { t, locale } = useLocale(); const [task, setTask] = useState(null); const [loading, setLoading] = useState(true); const [rawLocs, setRawLocs] = useState([]); const [submitting, setSubmitting] = useState(false); const [error, setError] = useState(''); const locMap = rawLocs.reduce((acc, city)=>{ var _city_names, _city_names1; var _city_names_locale, _ref; acc[city.slug] = (_ref = (_city_names_locale = (_city_names = city.names) === null || _city_names === void 0 ? void 0 : _city_names[locale]) !== null && _city_names_locale !== void 0 ? _city_names_locale : (_city_names1 = city.names) === null || _city_names1 === void 0 ? void 0 : _city_names1.el) !== null && _ref !== void 0 ? _ref : city.slug; var _city_children; for (const d of (_city_children = city.children) !== null && _city_children !== void 0 ? _city_children : []){ var _d_names, _d_names1; var _d_names_locale, _ref1; acc[d.slug] = (_ref1 = (_d_names_locale = (_d_names = d.names) === null || _d_names === void 0 ? void 0 : _d_names[locale]) !== null && _d_names_locale !== void 0 ? _d_names_locale : (_d_names1 = d.names) === null || _d_names1 === void 0 ? void 0 : _d_names1.el) !== null && _ref1 !== void 0 ? _ref1 : d.slug; } return acc; }, {}); useEffect(()=>{ if (!isPending && !session) router.push('/login'); }, [ session, isPending ]); useEffect(()=>{ if (!id) return; getTask(id).then((data)=>setTask(data)).catch(()=>router.push("/tasks/".concat(id))).finally(()=>setLoading(false)); getLocations().then((locs)=>setRawLocs(locs)).catch(()=>{}); }, [ id ]); async function handleSubmit(e) { e.preventDefault(); setError(''); setSubmitting(true); const form = new FormData(e.currentTarget); try { await createOffer({ taskId: id, price: Number(form.get('price')), message: form.get('message') || undefined }); router.push("/tasks/".concat(id)); } catch (err) { setError(err.message || t('common.error')); } finally{ setSubmitting(false); } } if (isPending || loading) { return /*#__PURE__*/ _jsx("div", { className: "text-center py-20 text-white", children: t('common.loading') }); } var _task_task; const taskData = (_task_task = task === null || task === void 0 ? void 0 : task.task) !== null && _task_task !== void 0 ? _task_task : task; const customer = task === null || task === void 0 ? void 0 : task.customer; const customerName = (customer === null || customer === void 0 ? void 0 : customer.name) ? shortName(customer.name) : null; var _taskData_title, _locMap_taskData_location; return /*#__PURE__*/ _jsxs("div", { className: "max-w-xl mx-auto px-4 py-10", children: [ /*#__PURE__*/ _jsxs(Link, { href: "/tasks/".concat(id), className: "inline-flex items-center gap-1.5 text-sm text-white/70 hover:text-white mb-8 transition", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 19l-7-7 7-7" }) }), (_taskData_title = taskData === null || taskData === void 0 ? void 0 : taskData.title) !== null && _taskData_title !== void 0 ? _taskData_title : t('common.back_home', 'Back') ] }), /*#__PURE__*/ _jsx("h1", { className: "text-2xl font-bold text-white mb-1", children: t('task.offer.btn') }), customerName && /*#__PURE__*/ _jsxs("p", { className: "text-sm text-white/60 mb-6", children: [ t('common.from'), " ", customerName ] }), taskData && /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-4 mb-6 shadow-sm", children: [ /*#__PURE__*/ _jsx("p", { className: "font-semibold text-gray-900 text-sm line-clamp-2", children: taskTitle(taskData, locale) }), taskDescription(taskData, locale) && /*#__PURE__*/ _jsx("p", { className: "text-gray-500 text-xs mt-1 line-clamp-2", children: taskDescription(taskData, locale) }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-4 mt-2", children: [ taskData.budget && /*#__PURE__*/ _jsxs("span", { className: "text-xs text-gray-500", children: [ "\uD83D\uDCB0 ", t('task.budget'), ": ", /*#__PURE__*/ _jsxs("strong", { className: "text-gray-900", children: [ formatPrice(taskData.budget), "€" ] }) ] }), taskData.budgetNegotiable && !taskData.budget && /*#__PURE__*/ _jsxs("span", { className: "text-xs text-gray-500", children: [ "\uD83D\uDCAC ", t('task.budget_negotiable') ] }), taskData.location && /*#__PURE__*/ _jsxs("span", { className: "text-xs text-gray-500", children: [ "\uD83D\uDCCD ", (_locMap_taskData_location = locMap[taskData.location]) !== null && _locMap_taskData_location !== void 0 ? _locMap_taskData_location : taskData.location ] }) ] }) ] }), /*#__PURE__*/ _jsxs("form", { onSubmit: handleSubmit, className: "bg-white rounded-2xl border border-gray-100 p-6 shadow-sm space-y-5", children: [ error && /*#__PURE__*/ _jsx("div", { className: "bg-red-50 text-red-700 p-3 rounded-lg text-sm", children: error }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("label", { className: "block text-sm font-medium text-gray-700 mb-1.5", children: [ t('offer.price'), " (€) ", /*#__PURE__*/ _jsx("span", { className: "text-red-500", children: "*" }) ] }), /*#__PURE__*/ _jsxs("div", { className: "relative", children: [ /*#__PURE__*/ _jsx("span", { className: "absolute left-3 top-1/2 -translate-y-1/2 text-gray-400 font-medium select-none", children: "€" }), /*#__PURE__*/ _jsx("input", { name: "price", type: "number", required: true, min: 1, step: 1, placeholder: t('offer.price.placeholder'), className: "w-full border border-gray-200 rounded-xl pl-8 pr-3 py-3 focus:outline-none focus:ring-2 focus:ring-blue-400 text-xl font-bold text-gray-900" }) ] }), (taskData === null || taskData === void 0 ? void 0 : taskData.budget) && /*#__PURE__*/ _jsxs("p", { className: "text-xs text-gray-400 mt-1.5", children: [ t('offer.customer_budget'), ": ", /*#__PURE__*/ _jsxs("strong", { children: [ formatPrice(taskData.budget), "€" ] }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("label", { className: "block text-sm font-medium text-gray-700 mb-1.5", children: [ t('offer.message'), /*#__PURE__*/ _jsxs("span", { className: "text-gray-400 font-normal ml-1", children: [ "(", t('offer.optional'), ")" ] }) ] }), /*#__PURE__*/ _jsx("textarea", { name: "message", rows: 5, maxLength: 2000, placeholder: t('offer.message.placeholder'), className: "w-full border border-gray-200 rounded-xl px-3 py-2.5 focus:outline-none focus:ring-2 focus:ring-blue-400 resize-none text-sm text-gray-700" }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-3 pt-1", children: [ /*#__PURE__*/ _jsx("button", { type: "submit", disabled: submitting, className: "flex-1 bg-green-600 text-white py-3 rounded-xl font-semibold hover:bg-green-700 disabled:opacity-50 disabled:cursor-not-allowed transition", children: submitting ? t('offer.submitting') : t('task.offer.btn') }), /*#__PURE__*/ _jsx(Link, { href: "/tasks/".concat(id), className: "px-5 py-3 rounded-xl border border-gray-200 text-gray-600 hover:bg-gray-50 font-medium text-sm flex items-center transition", children: t('common.cancel') }) ] }) ] }) ] }); } 61123undefined125168undefined170224undefined226254undefined256295undefined297341undefined343405undefined407451undefined453527undefined529543undefined590598(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useParams)undefined622630(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)undefined676685(0,_lib_auth__WEBPACK_IMPORTED_MODULE_4__/* .useSession */ .wV)undefined716724(0,_context_locale__WEBPACK_IMPORTED_MODULE_5__/* .useLocale */ .Y)undefined757764(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined807814(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined857864(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined911918(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined958965(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined20442052(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined21752183(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined22242230(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getTask */ .gg)undefined23492360(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getLocations */ .Vs)undefined26382648(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .createOffer */ .ts)undefined30613064(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined35303538(0,_lib_formatName__WEBPACK_IMPORTED_MODULE_7__/* .shortName */ .E)undefined36403644(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined37513755(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined37573760(next_link__WEBPACK_IMPORTED_MODULE_3___default())undefined39893992(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined42694272(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined47454748(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined49274931(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined51935197(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined53625365(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined54955503(0,_lib_taskLocale__WEBPACK_IMPORTED_MODULE_8__/* .taskTitle */ .Oj)undefined55675581(0,_lib_taskLocale__WEBPACK_IMPORTED_MODULE_8__/* .taskDescription */ .GZ)undefined56185621(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined57425756(0,_lib_taskLocale__WEBPACK_IMPORTED_MODULE_8__/* .taskDescription */ .GZ)undefined58345838(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined60136017(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined63406344(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined65226532(0,_lib_taskLocale__WEBPACK_IMPORTED_MODULE_8__/* .formatPrice */ .$g)undefined68386842(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined72127216(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined77567760(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined79817984(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined81778181(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined82708274(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined85738576(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined88568860(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined90209023(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined93129315(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1008810092(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1037610380(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1049010500(0,_lib_taskLocale__WEBPACK_IMPORTED_MODULE_8__/* .formatPrice */ .$g)undefined1079810802(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1089110895(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1115111155(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1165511658(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1218912193(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1233612339(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1281312816(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1281812821(next_link__WEBPACK_IMPORTED_MODULE_3___default())undefinedèé, /***/ 4017:  ¶«webpack/lib/util/registerExternalSerializerœwebpack-sources/ConcatSource€«webpack/lib/util/registerExternalSerializer™webpack-sources/RawSource_/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; «webpack/lib/util/registerExternalSerializerœwebpack-sources/CachedSource <«webpack/lib/util/registerExternalSerializerœwebpack-sources/ConcatSource€«webpack/lib/util/registerExternalSerializer™webpack-sources/RawSource/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ $g: () => (/* binding */ formatPrice), /* harmony export */ GZ: () => (/* binding */ taskDescription), /* harmony export */ Oj: () => (/* binding */ taskTitle) /* harmony export */ }); «webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourceexport function taskTitle(task, locale) { if (locale === 'el' && task.titleEl) return task.titleEl; if (locale === 'en' && task.titleEn) return task.titleEn; if (locale === 'ru' && task.titleRu) return task.titleRu; return task.title; } /** Display a price without decimal cents: 100.00 → 100, 99.5 → 100 */ export function formatPrice(value) { if (value === null || value === undefined || value === '') return ''; return Math.round(Number(value)).toString(); } export function taskDescription(task, locale) { if (locale === 'el' && task.descriptionEl) return task.descriptionEl; if (locale === 'en' && task.descriptionEn) return task.descriptionEn; if (locale === 'ru' && task.descriptionRu) return task.descriptionRu; return task.description; } CDJæì€€€€†buffer†source„size„maps„hash/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ $g: () => (/* binding */ formatPrice), /* harmony export */ GZ: () => (/* binding */ taskDescription), /* harmony export */ Oj: () => (/* binding */ taskTitle) /* harmony export */ }); function taskTitle(task, locale) { if (locale === 'el' && task.titleEl) return task.titleEl; if (locale === 'en' && task.titleEn) return task.titleEn; if (locale === 'ru' && task.titleRu) return task.titleRu; return task.title; } /** Display a price without decimal cents: 100.00 → 100, 99.5 → 100 */ function formatPrice(value) { if (value === null || value === undefined || value === '') return ''; return Math.round(Number(value)).toString(); } function taskDescription(task, locale) { if (locale === 'el' && task.descriptionEl) return task.descriptionEl; if (locale === 'en' && task.descriptionEn) return task.descriptionEn; if (locale === 'ru' && task.descriptionRu) return task.descriptionRu; return task.description; } €”{"finalSource":true}ƒmap‹bufferedMap ConcatSourceRawSource/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ $g: () => (/* binding */ formatPrice), /* harmony export */ GZ: () => (/* binding */ taskDescription), /* harmony export */ Oj: () => (/* binding */ taskTitle) /* harmony export */ }); ReplaceSourceRawSourceexport function taskTitle(task, locale) { if (locale === 'el' && task.titleEl) return task.titleEl; if (locale === 'en' && task.titleEn) return task.titleEn; if (locale === 'ru' && task.titleRu) return task.titleRu; return task.title; } /** Display a price without decimal cents: 100.00 → 100, 99.5 → 100 */ export function formatPrice(value) { if (value === null || value === undefined || value === '') return ''; return Math.round(Number(value)).toString(); } export function taskDescription(task, locale) { if (locale === 'el' && task.descriptionEl) return task.descriptionEl; if (locale === 'en' && task.descriptionEn) return task.descriptionEn; if (locale === 'ru' && task.descriptionRu) return task.descriptionRu; return task.description; } )06undefined324330undefined486492undefined /***/ }) Ձ/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ $g: () => (/* binding */ formatPrice), /* harmony export */ GZ: () => (/* binding */ taskDescription), /* harmony export */ Oj: () => (/* binding */ taskTitle) /* harmony export */ }); function taskTitle(task, locale) { if (locale === 'el' && task.titleEl) return task.titleEl; if (locale === 'en' && task.titleEn) return task.titleEn; if (locale === 'ru' && task.titleRu) return task.titleRu; return task.title; } /** Display a price without decimal cents: 100.00 → 100, 99.5 → 100 */ function formatPrice(value) { if (value === null || value === undefined || value === '') return ''; return Math.round(Number(value)).toString(); } function taskDescription(task, locale) { if (locale === 'el' && task.descriptionEl) return task.descriptionEl; if (locale === 'en' && task.descriptionEn) return task.descriptionEn; if (locale === 'ru' && task.descriptionRu) return task.descriptionRu; return task.description; } /***/ }) ÖÙ  ÚÛÚ/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ $g: () => (/* binding */ formatPrice), /* harmony export */ GZ: () => (/* binding */ taskDescription), /* harmony export */ Oj: () => (/* binding */ taskTitle) /* harmony export */ }); Üexport function taskTitle(task, locale) { if (locale === 'el' && task.titleEl) return task.titleEl; if (locale === 'en' && task.titleEn) return task.titleEn; if (locale === 'ru' && task.titleRu) return task.titleRu; return task.title; } /** Display a price without decimal cents: 100.00 → 100, 99.5 → 100 */ export function formatPrice(value) { if (value === null || value === undefined || value === '') return ''; return Math.round(Number(value)).toString(); } export function taskDescription(task, locale) { if (locale === 'el' && task.descriptionEl) return task.descriptionEl; if (locale === 'en' && task.descriptionEn) return task.descriptionEn; if (locale === 'ru' && task.descriptionRu) return task.descriptionRu; return task.description; } )06undefined324330undefined486492undefinedÝÞ, /***/ 6763:  m«webpack/lib/util/registerExternalSerializerœwebpack-sources/ConcatSource€«webpack/lib/util/registerExternalSerializer™webpack-sources/RawSourceV/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { «webpack/lib/util/registerExternalSerializerœwebpack-sources/CachedSource _«webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSource«webpack/lib/util/registerExternalSerializer™webpack-sources/RawSource^import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/tasks/[id]/offer/page.tsx"); `[ßPromise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 3899))€†buffer†source„size„maps„hashaPromise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 3899)); €”{"finalSource":true}ƒmap‹bufferedMap ReplaceSourceRawSource^import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/tasks/[id]/offer/page.tsx"); k091Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 3899))undefined /***/ }) ÊÁ/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 3899)); /***/ }) ËÎ ÏV/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { Ñ^import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/tasks/[id]/offer/page.tsx"); k091Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 3899))undefinedÒÓ }, «webpack/lib/util/registerExternalSerializerœwebpack-sources/PrefixSource‰/******/ 2__webpack_require__ => { // webpackRuntimeModules ívar __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId)) __webpack_require__.O(0, [1516,9664,9906,2982,587,18,7358], () => (__webpack_exec__(6763))); var __webpack_exports__ = __webpack_require__.O(); _N_E = __webpack_exports__; } ]); ¹þÿÿ7Q(self["webpackChunk_N_E"] = self["webpackChunk_N_E"] || []).push([[2822],{ /***/ 1258: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ E: () => (/* binding */ shortName), /* harmony export */ H: () => (/* binding */ formatShortName) /* harmony export */ }); /** * Shortens the last name to first letter + period. * "ИваМ ПетрПв" → "ИваМ П." * Works with a pre-composed full name string. */ function shortName(fullName) { if (!(fullName === null || fullName === void 0 ? void 0 : fullName.trim())) return '—'; const parts = fullName.trim().split(/\s+/); if (parts.length < 2 || !parts[1]) return parts[0]; return "".concat(parts[0], " ").concat(parts[1][0].toUpperCase(), "."); } /** * Formats separate firstName + lastName fields, shortening the last name. * Falls back to parsing fullName if firstName is not available. */ function formatShortName(firstName, lastName, fallbackName) { if (firstName === null || firstName === void 0 ? void 0 : firstName.trim()) { const l = lastName === null || lastName === void 0 ? void 0 : lastName.trim(); return l ? "".concat(firstName.trim(), " ").concat(l[0].toUpperCase(), ".") : firstName.trim(); } return shortName(fallbackName); } /***/ }), /***/ 1592: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ CI: () => (/* binding */ signOut), /* harmony export */ Hh: () => (/* binding */ signUp), /* harmony export */ Jv: () => (/* binding */ signIn), /* harmony export */ wV: () => (/* binding */ useSession), /* harmony export */ yK: () => (/* binding */ authClient) /* harmony export */ }); /* harmony import */ var better_auth_react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6504); const API_URL = "https://api.canhelp.gr" || 0; const authClient = (0,better_auth_react__WEBPACK_IMPORTED_MODULE_0__/* .createAuthClient */ .M)({ baseURL: API_URL }); const { signIn, signOut, signUp, useSession } = authClient; /***/ }), /***/ 3899: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ MakeOfferPage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7541); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(9664); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(next_link__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(1592); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(9906); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(2982); /* harmony import */ var _lib_formatName__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(1258); /* harmony import */ var _lib_taskLocale__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(4017); /* __next_internal_client_entry_do_not_use__ default auto */ function MakeOfferPage() { const { id } = (0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useParams)(); const router = (0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)(); const { data: session, isPending } = (0,_lib_auth__WEBPACK_IMPORTED_MODULE_4__/* .useSession */ .wV)(); const { t, locale } = (0,_context_locale__WEBPACK_IMPORTED_MODULE_5__/* .useLocale */ .Y)(); const [task, setTask] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [loading, setLoading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(true); const [rawLocs, setRawLocs] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [submitting, setSubmitting] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [error, setError] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const locMap = rawLocs.reduce((acc, city)=>{ var _city_names, _city_names1; var _city_names_locale, _ref; acc[city.slug] = (_ref = (_city_names_locale = (_city_names = city.names) === null || _city_names === void 0 ? void 0 : _city_names[locale]) !== null && _city_names_locale !== void 0 ? _city_names_locale : (_city_names1 = city.names) === null || _city_names1 === void 0 ? void 0 : _city_names1.el) !== null && _ref !== void 0 ? _ref : city.slug; var _city_children; for (const d of (_city_children = city.children) !== null && _city_children !== void 0 ? _city_children : []){ var _d_names, _d_names1; var _d_names_locale, _ref1; acc[d.slug] = (_ref1 = (_d_names_locale = (_d_names = d.names) === null || _d_names === void 0 ? void 0 : _d_names[locale]) !== null && _d_names_locale !== void 0 ? _d_names_locale : (_d_names1 = d.names) === null || _d_names1 === void 0 ? void 0 : _d_names1.el) !== null && _ref1 !== void 0 ? _ref1 : d.slug; } return acc; }, {}); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!isPending && !session) router.push('/login'); }, [ session, isPending ]); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!id) return; (0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getTask */ .gg)(id).then((data)=>setTask(data)).catch(()=>router.push("/tasks/".concat(id))).finally(()=>setLoading(false)); (0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getLocations */ .Vs)().then((locs)=>setRawLocs(locs)).catch(()=>{}); }, [ id ]); async function handleSubmit(e) { e.preventDefault(); setError(''); setSubmitting(true); const form = new FormData(e.currentTarget); try { await (0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .createOffer */ .ts)({ taskId: id, price: Number(form.get('price')), message: form.get('message') || undefined }); router.push("/tasks/".concat(id)); } catch (err) { setError(err.message || t('common.error')); } finally{ setSubmitting(false); } } if (isPending || loading) { return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-center py-20 text-white", children: t('common.loading') }); } var _task_task; const taskData = (_task_task = task === null || task === void 0 ? void 0 : task.task) !== null && _task_task !== void 0 ? _task_task : task; const customer = task === null || task === void 0 ? void 0 : task.customer; const customerName = (customer === null || customer === void 0 ? void 0 : customer.name) ? (0,_lib_formatName__WEBPACK_IMPORTED_MODULE_7__/* .shortName */ .E)(customer.name) : null; var _taskData_title, _locMap_taskData_location; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "max-w-xl mx-auto px-4 py-10", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)((next_link__WEBPACK_IMPORTED_MODULE_3___default()), { href: "/tasks/".concat(id), className: "inline-flex items-center gap-1.5 text-sm text-white/70 hover:text-white mb-8 transition", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 19l-7-7 7-7" }) }), (_taskData_title = taskData === null || taskData === void 0 ? void 0 : taskData.title) !== null && _taskData_title !== void 0 ? _taskData_title : t('common.back_home', 'Back') ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h1", { className: "text-2xl font-bold text-white mb-1", children: t('task.offer.btn') }), customerName && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { className: "text-sm text-white/60 mb-6", children: [ t('common.from'), " ", customerName ] }), taskData && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-4 mb-6 shadow-sm", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "font-semibold text-gray-900 text-sm line-clamp-2", children: (0,_lib_taskLocale__WEBPACK_IMPORTED_MODULE_8__/* .taskTitle */ .Oj)(taskData, locale) }), (0,_lib_taskLocale__WEBPACK_IMPORTED_MODULE_8__/* .taskDescription */ .GZ)(taskData, locale) && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-gray-500 text-xs mt-1 line-clamp-2", children: (0,_lib_taskLocale__WEBPACK_IMPORTED_MODULE_8__/* .taskDescription */ .GZ)(taskData, locale) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-4 mt-2", children: [ taskData.budget && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "text-xs text-gray-500", children: [ "\uD83D\uDCB0 ", t('task.budget'), ": ", /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("strong", { className: "text-gray-900", children: [ (0,_lib_taskLocale__WEBPACK_IMPORTED_MODULE_8__/* .formatPrice */ .$g)(taskData.budget), "€" ] }) ] }), taskData.budgetNegotiable && !taskData.budget && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "text-xs text-gray-500", children: [ "\uD83D\uDCAC ", t('task.budget_negotiable') ] }), taskData.location && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "text-xs text-gray-500", children: [ "\uD83D\uDCCD ", (_locMap_taskData_location = locMap[taskData.location]) !== null && _locMap_taskData_location !== void 0 ? _locMap_taskData_location : taskData.location ] }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("form", { onSubmit: handleSubmit, className: "bg-white rounded-2xl border border-gray-100 p-6 shadow-sm space-y-5", children: [ error && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "bg-red-50 text-red-700 p-3 rounded-lg text-sm", children: error }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "block text-sm font-medium text-gray-700 mb-1.5", children: [ t('offer.price'), " (€) ", /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-red-500", children: "*" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "relative", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "absolute left-3 top-1/2 -translate-y-1/2 text-gray-400 font-medium select-none", children: "€" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { name: "price", type: "number", required: true, min: 1, step: 1, placeholder: t('offer.price.placeholder'), className: "w-full border border-gray-200 rounded-xl pl-8 pr-3 py-3 focus:outline-none focus:ring-2 focus:ring-blue-400 text-xl font-bold text-gray-900" }) ] }), (taskData === null || taskData === void 0 ? void 0 : taskData.budget) && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { className: "text-xs text-gray-400 mt-1.5", children: [ t('offer.customer_budget'), ": ", /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("strong", { children: [ (0,_lib_taskLocale__WEBPACK_IMPORTED_MODULE_8__/* .formatPrice */ .$g)(taskData.budget), "€" ] }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "block text-sm font-medium text-gray-700 mb-1.5", children: [ t('offer.message'), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "text-gray-400 font-normal ml-1", children: [ "(", t('offer.optional'), ")" ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("textarea", { name: "message", rows: 5, maxLength: 2000, placeholder: t('offer.message.placeholder'), className: "w-full border border-gray-200 rounded-xl px-3 py-2.5 focus:outline-none focus:ring-2 focus:ring-blue-400 resize-none text-sm text-gray-700" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-3 pt-1", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "submit", disabled: submitting, className: "flex-1 bg-green-600 text-white py-3 rounded-xl font-semibold hover:bg-green-700 disabled:opacity-50 disabled:cursor-not-allowed transition", children: submitting ? t('offer.submitting') : t('task.offer.btn') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)((next_link__WEBPACK_IMPORTED_MODULE_3___default()), { href: "/tasks/".concat(id), className: "px-5 py-3 rounded-xl border border-gray-200 text-gray-600 hover:bg-gray-50 font-medium text-sm flex items-center transition", children: t('common.cancel') }) ] }) ] }) ] }); } /***/ }), /***/ 4017: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ $g: () => (/* binding */ formatPrice), /* harmony export */ GZ: () => (/* binding */ taskDescription), /* harmony export */ Oj: () => (/* binding */ taskTitle) /* harmony export */ }); function taskTitle(task, locale) { if (locale === 'el' && task.titleEl) return task.titleEl; if (locale === 'en' && task.titleEn) return task.titleEn; if (locale === 'ru' && task.titleRu) return task.titleRu; return task.title; } /** Display a price without decimal cents: 100.00 → 100, 99.5 → 100 */ function formatPrice(value) { if (value === null || value === undefined || value === '') return ''; return Math.round(Number(value)).toString(); } function taskDescription(task, locale) { if (locale === 'el' && task.descriptionEl) return task.descriptionEl; if (locale === 'en' && task.descriptionEn) return task.descriptionEn; if (locale === 'ru' && task.descriptionRu) return task.descriptionRu; return task.description; } /***/ }), /***/ 6763: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 3899)); /***/ }) }, /******/ __webpack_require__ => { // webpackRuntimeModules /******/ var __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId)) /******/ __webpack_require__.O(0, [1516,9664,9906,2982,587,18,7358], () => (__webpack_exec__(6763))); /******/ var __webpack_exports__ = __webpack_require__.O(); /******/ _N_E = __webpack_exports__; /******/ } ]); ]ÿÿÿœþÿÿ `?ŸþÿÿX(self["webpackChunk_N_E"] = self["webpackChunk_N_E"] || []).push([[2822],{ /***/ 1258: œþÿÿ^ÿÿÿœþÿÿeÿÿÿ¿þÿÿfÿÿÿgÿÿÿbÿÿÿcÿÿÿbÿÿÿhÿÿÿœþÿÿ^ÿÿÿœþÿÿiÿÿÿ¿þÿÿjÿÿÿkÿÿÿbÿÿÿcÿÿÿbÿÿÿ, /***/ 3899: Œþÿÿ]ÿÿÿŒþÿÿúþÿÿŸþÿÿªäÿÿûþÿÿaÿÿÿbÿÿÿaÿÿÿÉŒþÿÿ]ÿÿÿŒþÿÿÊŸþÿÿËÌaÿÿÿbÿÿÿaÿÿÿ, /***/ 6763: »þÿÿkÿÿÿœþÿÿ^import(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/tasks/[id]/offer/page.tsx"); k091Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 3899))undefined^ÿÿÿ_ÿÿÿ^ÿÿÿ§¹©^ÿÿÿívar __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId)) __webpack_require__.O(0, [1516,9664,9906,2982,587,18,7358], () => (__webpack_exec__(6763))); var __webpack_exports__ = __webpack_require__.O(); ]ÿÿÿª«¬ Qx «webpack/lib/util/registerExternalSerializerœwebpack-sources/ConcatSource€`«webpack/lib/util/registerExternalSerializer™webpack-sources/RawSourceX(self["webpackChunk_N_E"] = self["webpackChunk_N_E"] || []).push([[6043],{ /***/ 1258: «webpack/lib/util/registerExternalSerializerœwebpack-sources/CachedSource d«webpack/lib/util/registerExternalSerializerœwebpack-sources/ConcatSource€«webpack/lib/util/registerExternalSerializer™webpack-sources/RawSource_/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; «webpack/lib/util/registerExternalSerializerœwebpack-sources/CachedSource Ê«webpack/lib/util/registerExternalSerializerœwebpack-sources/ConcatSource€«webpack/lib/util/registerExternalSerializer™webpack-sources/RawSourceÖ/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ E: () => (/* binding */ shortName), /* harmony export */ H: () => (/* binding */ formatShortName) /* harmony export */ }); «webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourceé/** * Shortens the last name to first letter + period. * "ИваМ ПетрПв" → "ИваМ П." * Works with a pre-composed full name string. */ export function shortName(fullName) { if (!(fullName === null || fullName === void 0 ? void 0 : fullName.trim())) return '—'; const parts = fullName.trim().split(/\s+/); if (parts.length < 2 || !parts[1]) return parts[0]; return "".concat(parts[0], " ").concat(parts[1][0].toUpperCase(), "."); } /** * Formats separate firstName + lastName fields, shortening the last name. * Falls back to parsing fullName if firstName is not available. */ export function formatShortName(firstName, lastName, fallbackName) { if (firstName === null || firstName === void 0 ? void 0 : firstName.trim()) { const l = lastName === null || lastName === void 0 ? void 0 : lastName.trim(); return l ? "".concat(firstName.trim(), " ").concat(l[0].toUpperCase(), ".") : firstName.trim(); } return shortName(fallbackName); } CˆŽTZ€€€†buffer†source„size„maps„hash±/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ E: () => (/* binding */ shortName), /* harmony export */ H: () => (/* binding */ formatShortName) /* harmony export */ }); /** * Shortens the last name to first letter + period. * "ИваМ ПетрПв" → "ИваМ П." * Works with a pre-composed full name string. */ function shortName(fullName) { if (!(fullName === null || fullName === void 0 ? void 0 : fullName.trim())) return '—'; const parts = fullName.trim().split(/\s+/); if (parts.length < 2 || !parts[1]) return parts[0]; return "".concat(parts[0], " ").concat(parts[1][0].toUpperCase(), "."); } /** * Formats separate firstName + lastName fields, shortening the last name. * Falls back to parsing fullName if firstName is not available. */ function formatShortName(firstName, lastName, fallbackName) { if (firstName === null || firstName === void 0 ? void 0 : firstName.trim()) { const l = lastName === null || lastName === void 0 ? void 0 : lastName.trim(); return l ? "".concat(firstName.trim(), " ").concat(l[0].toUpperCase(), ".") : firstName.trim(); } return shortName(fallbackName); } €”{"finalSource":true}ƒmap‹bufferedMap ConcatSourceRawSourceÖ/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ E: () => (/* binding */ shortName), /* harmony export */ H: () => (/* binding */ formatShortName) /* harmony export */ }); ReplaceSourceRawSourceé/** * Shortens the last name to first letter + period. * "ИваМ ПетрПв" → "ИваМ П." * Works with a pre-composed full name string. */ export function shortName(fullName) { if (!(fullName === null || fullName === void 0 ? void 0 : fullName.trim())) return '—'; const parts = fullName.trim().split(/\s+/); if (parts.length < 2 || !parts[1]) return parts[0]; return "".concat(parts[0], " ").concat(parts[1][0].toUpperCase(), "."); } /** * Formats separate firstName + lastName fields, shortening the last name. * Falls back to parsing fullName if firstName is not available. */ export function formatShortName(firstName, lastName, fallbackName) { if (firstName === null || firstName === void 0 ? void 0 : firstName.trim()) { const l = lastName === null || lastName === void 0 ? void 0 : lastName.trim(); return l ? "".concat(firstName.trim(), " ").concat(l[0].toUpperCase(), ".") : firstName.trim(); } return shortName(fallbackName); } 136142undefined596602undefined /***/ }) €†buffer†source„size„maps„hash/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ E: () => (/* binding */ shortName), /* harmony export */ H: () => (/* binding */ formatShortName) /* harmony export */ }); /** * Shortens the last name to first letter + period. * "ИваМ ПетрПв" → "ИваМ П." * Works with a pre-composed full name string. */ function shortName(fullName) { if (!(fullName === null || fullName === void 0 ? void 0 : fullName.trim())) return '—'; const parts = fullName.trim().split(/\s+/); if (parts.length < 2 || !parts[1]) return parts[0]; return "".concat(parts[0], " ").concat(parts[1][0].toUpperCase(), "."); } /** * Formats separate firstName + lastName fields, shortening the last name. * Falls back to parsing fullName if firstName is not available. */ function formatShortName(firstName, lastName, fallbackName) { if (firstName === null || firstName === void 0 ? void 0 : firstName.trim()) { const l = lastName === null || lastName === void 0 ? void 0 : lastName.trim(); return l ? "".concat(firstName.trim(), " ").concat(l[0].toUpperCase(), ".") : firstName.trim(); } return shortName(fallbackName); } /***/ }) €”{"finalSource":true}ƒmap‹bufferedMap  ConcatSourceRawSource_/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; þÖ/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ E: () => (/* binding */ shortName), /* harmony export */ H: () => (/* binding */ formatShortName) /* harmony export */ }); ReplaceSourceRawSourceé/** * Shortens the last name to first letter + period. * "ИваМ ПетрПв" → "ИваМ П." * Works with a pre-composed full name string. */ export function shortName(fullName) { if (!(fullName === null || fullName === void 0 ? void 0 : fullName.trim())) return '—'; const parts = fullName.trim().split(/\s+/); if (parts.length < 2 || !parts[1]) return parts[0]; return "".concat(parts[0], " ").concat(parts[1][0].toUpperCase(), "."); } /** * Formats separate firstName + lastName fields, shortening the last name. * Falls back to parsing fullName if firstName is not available. */ export function formatShortName(firstName, lastName, fallbackName) { if (firstName === null || firstName === void 0 ? void 0 : firstName.trim()) { const l = lastName === null || lastName === void 0 ? void 0 : lastName.trim(); return l ? "".concat(firstName.trim(), " ").concat(l[0].toUpperCase(), ".") : firstName.trim(); } return shortName(fallbackName); } 136142undefined596602undefined RawSource /***/ }), /***/ 1569:  Ž«webpack/lib/util/registerExternalSerializerœwebpack-sources/ConcatSource€«webpack/lib/util/registerExternalSerializer™webpack-sources/RawSourceV/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { «webpack/lib/util/registerExternalSerializerœwebpack-sources/CachedSource ‚«webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSource«webpack/lib/util/registerExternalSerializer™webpack-sources/RawSourceimport(/* webpackMode: "eager", webpackExports: ["default"] */ "/opt/canhelp/apps/web/src/app/tasks/[id]/TaskDetailClient.tsx"); `~ßPromise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 2026))€†buffer†source„size„maps„hashaPromise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 2026)); €”{"finalSource":true}ƒmap‹bufferedMap ReplaceSourceRawSourceimport(/* webpackMode: "eager", webpackExports: ["default"] */ "/opt/canhelp/apps/web/src/app/tasks/[id]/TaskDetailClient.tsx"); l0126Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 2026))undefined /***/ }) ëÁ/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 2026)); /***/ }) ìï ðV/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { òimport(/* webpackMode: "eager", webpackExports: ["default"] */ "/opt/canhelp/apps/web/src/app/tasks/[id]/TaskDetailClient.tsx"); l0126Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 2026))undefinedóô, /***/ 1592:  ú «webpack/lib/util/registerExternalSerializerœwebpack-sources/ConcatSource€«webpack/lib/util/registerExternalSerializer™webpack-sources/RawSource_/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; «webpack/lib/util/registerExternalSerializerœwebpack-sources/CachedSource w«webpack/lib/util/registerExternalSerializerœwebpack-sources/ConcatSource€«webpack/lib/util/registerExternalSerializer™webpack-sources/RawSourceå/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ CI: () => (/* binding */ signOut), /* harmony export */ Hh: () => (/* binding */ signUp), /* harmony export */ Jv: () => (/* binding */ signIn), /* harmony export */ wV: () => (/* binding */ useSession), /* harmony export */ yK: () => (/* binding */ authClient) /* harmony export */ }); /* harmony import */ var better_auth_react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6504); «webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSource import { createAuthClient } from 'better-auth/react'; const API_URL = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; export const authClient = createAuthClient({ baseURL: API_URL }); export const { signIn, signOut, signUp, useSession } = authClient; d4FdiE‚ˆœ«È΀˜"https://api.canhelp.gr"0€Ì(0,better_auth_react__WEBPACK_IMPORTED_MODULE_0__/* .createAuthClient */ .M)€€†buffer†source„size„maps„hashÌ/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ CI: () => (/* binding */ signOut), /* harmony export */ Hh: () => (/* binding */ signUp), /* harmony export */ Jv: () => (/* binding */ signIn), /* harmony export */ wV: () => (/* binding */ useSession), /* harmony export */ yK: () => (/* binding */ authClient) /* harmony export */ }); /* harmony import */ var better_auth_react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6504); const API_URL = "https://api.canhelp.gr" || 0; const authClient = (0,better_auth_react__WEBPACK_IMPORTED_MODULE_0__/* .createAuthClient */ .M)({ baseURL: API_URL }); const { signIn, signOut, signUp, useSession } = authClient; €”{"finalSource":true}ƒmap‹bufferedMap ConcatSourceRawSourceå/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ CI: () => (/* binding */ signOut), /* harmony export */ Hh: () => (/* binding */ signUp), /* harmony export */ Jv: () => (/* binding */ signIn), /* harmony export */ wV: () => (/* binding */ useSession), /* harmony export */ yK: () => (/* binding */ authClient) /* harmony export */ }); /* harmony import */ var better_auth_react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6504); ReplaceSourceRawSource import { createAuthClient } from 'better-auth/react'; const API_URL = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; export const authClient = createAuthClient({ baseURL: API_URL }); export const { signIn, signOut, signUp, useSession } = authClient; »052undefined70100"https://api.canhelp.gr"undefined1051270undefined130136undefined156171(0,better_auth_react__WEBPACK_IMPORTED_MODULE_0__/* .createAuthClient */ .M)undefined200206undefined /***/ }) à5/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ CI: () => (/* binding */ signOut), /* harmony export */ Hh: () => (/* binding */ signUp), /* harmony export */ Jv: () => (/* binding */ signIn), /* harmony export */ wV: () => (/* binding */ useSession), /* harmony export */ yK: () => (/* binding */ authClient) /* harmony export */ }); /* harmony import */ var better_auth_react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6504); const API_URL = "https://api.canhelp.gr" || 0; const authClient = (0,better_auth_react__WEBPACK_IMPORTED_MODULE_0__/* .createAuthClient */ .M)({ baseURL: API_URL }); const { signIn, signOut, signUp, useSession } = authClient; /***/ }) áä  åæåå/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ CI: () => (/* binding */ signOut), /* harmony export */ Hh: () => (/* binding */ signUp), /* harmony export */ Jv: () => (/* binding */ signIn), /* harmony export */ wV: () => (/* binding */ useSession), /* harmony export */ yK: () => (/* binding */ authClient) /* harmony export */ }); /* harmony import */ var better_auth_react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6504); ç import { createAuthClient } from 'better-auth/react'; const API_URL = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; export const authClient = createAuthClient({ baseURL: API_URL }); export const { signIn, signOut, signUp, useSession } = authClient; »052undefined70100"https://api.canhelp.gr"undefined1051270undefined130136undefined156171(0,better_auth_react__WEBPACK_IMPORTED_MODULE_0__/* .createAuthClient */ .M)undefined200206undefinedèé, /***/ 2026:  )«webpack/lib/util/registerExternalSerializerœwebpack-sources/ConcatSource€«webpack/lib/util/registerExternalSerializer™webpack-sources/RawSource_/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; «webpack/lib/util/registerExternalSerializerœwebpack-sources/CachedSource „–«webpack/lib/util/registerExternalSerializerœwebpack-sources/ConcatSource€«webpack/lib/util/registerExternalSerializer™webpack-sources/RawSource/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ TaskDetailClient) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(9664); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(next_link__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(7541); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(1592); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(9906); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(2982); /* harmony import */ var _lib_taskLocale__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(4017); /* harmony import */ var _lib_formatName__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(1258); /* harmony import */ var _components_PlanBadge__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(2035); «webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourceZ|/* __next_internal_client_entry_do_not_use__ default auto */ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime"; import { useState, useEffect } from 'react'; import Link from 'next/link'; import { useRouter } from 'next/navigation'; import { useSession } from '@/lib/auth'; import { useLocale } from '@/context/locale'; import { getOffers, acceptOffer, declineOffer, completeTask, createReview, getMyOffers, getTaskReviews, getTaskInvite, dismissNotification, getOrCreateDirectRoom, updateTask, getTaskStats, runAutoMatch, getMyDashboard } from '@/lib/api'; import { taskTitle, taskDescription, formatPrice } from '@/lib/taskLocale'; import { shortName } from '@/lib/formatName'; import { PlanBadge } from '@/components/PlanBadge'; const statusColors = { open: 'bg-green-100 text-green-700', in_progress: 'bg-green-100 text-green-700', completed: 'bg-gray-100 text-gray-700', cancelled: 'bg-red-100 text-red-700', draft: 'bg-yellow-100 text-yellow-700' }; export default function TaskDetailClient(param) { let { taskId, initialTask, initialCustomer, catMap = {}, locMap = {} } = param; var _session_user, _acceptedOffer_specialist; const { data: session } = useSession(); const { t, locale } = useLocale(); const router = useRouter(); const [task, setTask] = useState(initialTask); const [customer] = useState(initialCustomer); const [offers, setOffers] = useState([]); const [offersLoaded, setOffersLoaded] = useState(false); const [myOffer, setMyOffer] = useState(null); const [myOfferLoaded, setMyOfferLoaded] = useState(false); const [myReview, setMyReview] = useState(null); const [myReviewLoaded, setMyReviewLoaded] = useState(false); const [reviewTargetId, setReviewTargetId] = useState(null); const [reviewRating, setReviewRating] = useState(5); const [reviewComment, setReviewComment] = useState(''); const [reviewSubmitting, setReviewSubmitting] = useState(false); const [reviewDone, setReviewDone] = useState(false); const [invite, setInvite] = useState(null); const [inviteLoaded, setInviteLoaded] = useState(false); const [inviteDeclining, setInviteDeclining] = useState(false); const [msgLoading, setMsgLoading] = useState(false); const [lightboxIndex, setLightboxIndex] = useState(null); // FOMO stats + auto-match const [taskStats, setTaskStats] = useState(null); const [autoMatchResults, setAutoMatchResults] = useState(null); const [autoMatchLoading, setAutoMatchLoading] = useState(false); const [hasAutoMatch, setHasAutoMatch] = useState(false); // Edit task state const [editing, setEditing] = useState(false); const [editSaving, setEditSaving] = useState(false); const [editForm, setEditForm] = useState(null); // Keyboard navigation for lightbox useEffect(()=>{ const handler = (e)=>{ if (e.key === 'Escape') setLightboxIndex(null); if (e.key === 'ArrowLeft') setLightboxIndex((prev)=>prev !== null && prev > 0 ? prev - 1 : prev); if (e.key === 'ArrowRight') setLightboxIndex((prev)=>{ if (prev === null) return prev; const imgs = task.images; return imgs && prev < imgs.length - 1 ? prev + 1 : prev; }); }; window.addEventListener('keydown', handler); return ()=>window.removeEventListener('keydown', handler); }, [ task.images ]); const dateLocale = locale === 'ru' ? 'ru-RU' : locale === 'uk' ? 'uk-UA' : locale === 'en' ? 'en-US' : 'el-GR'; const currentUserId = session === null || session === void 0 ? void 0 : (_session_user = session.user) === null || _session_user === void 0 ? void 0 : _session_user.id; const isOwner = currentUserId === task.customerId; const loginRedirectHref = "/login?redirect=".concat(encodeURIComponent("/tasks/".concat(taskId))); // Load offers if owner useEffect(()=>{ if (!isOwner || offersLoaded) return; getOffers(taskId).then((data)=>{ setOffers(data); setOffersLoaded(true); }).catch(()=>setOffersLoaded(true)); }, [ isOwner, taskId, offersLoaded ]); // Load task stats + dashboard features for owner useEffect(()=>{ if (!isOwner) return; getTaskStats(taskId).then(setTaskStats).catch(()=>{}); getMyDashboard().then((d)=>{ var _d_features; return setHasAutoMatch(!!((_d_features = d.features) === null || _d_features === void 0 ? void 0 : _d_features.hasAutoMatch)); }).catch(()=>{}); }, [ isOwner, taskId ]); // Load specialist's own offer useEffect(()=>{ if (!currentUserId || isOwner || myOfferLoaded) return; getMyOffers().then((rows)=>{ const found = rows.find((r)=>{ var _r_task; return ((_r_task = r.task) === null || _r_task === void 0 ? void 0 : _r_task.id) === taskId; }); var _found_offer; setMyOffer((_found_offer = found === null || found === void 0 ? void 0 : found.offer) !== null && _found_offer !== void 0 ? _found_offer : null); setMyOfferLoaded(true); }).catch(()=>setMyOfferLoaded(true)); }, [ currentUserId, isOwner, taskId, myOfferLoaded ]); // Load task invite for specialist useEffect(()=>{ if (!currentUserId || isOwner || inviteLoaded) return; getTaskInvite(taskId).then((rows)=>{ var _rows_; setInvite((_rows_ = rows[0]) !== null && _rows_ !== void 0 ? _rows_ : null); setInviteLoaded(true); }).catch(()=>setInviteLoaded(true)); }, [ currentUserId, isOwner, taskId, inviteLoaded ]); // Load review for specialist when task completed useEffect(()=>{ if (!currentUserId || isOwner || myReviewLoaded || task.status !== 'completed') return; getTaskReviews(taskId).then((rows)=>{ const found = rows.find((r)=>r.targetId === currentUserId); setMyReview(found !== null && found !== void 0 ? found : null); setMyReviewLoaded(true); }).catch(()=>setMyReviewLoaded(true)); }, [ currentUserId, isOwner, taskId, task.status, myReviewLoaded ]); async function handleAccept(offerId) { const updated = await acceptOffer(offerId).catch(()=>null); if (updated) { setOffers((prev)=>prev.map((r)=>r.offer.id === offerId ? { ...r, offer: updated } : r)); setTask((t)=>({ ...t, status: 'in_progress' })); } } async function handleDecline(offerId) { const updated = await declineOffer(offerId).catch(()=>null); if (updated) { setOffers((prev)=>prev.map((r)=>r.offer.id === offerId ? { ...r, offer: updated } : r)); } } async function handleComplete() { if (!window.confirm(t('task.complete.confirm'))) return; const updated = await completeTask(taskId).catch(()=>null); if (updated) setTask((t)=>({ ...t, status: 'completed' })); } async function handleReview(e) { e.preventDefault(); if (!reviewTargetId) return; setReviewSubmitting(true); const ok = await createReview({ taskId, targetId: reviewTargetId, rating: reviewRating, comment: reviewComment || undefined }).catch(()=>null); setReviewSubmitting(false); if (ok) { setReviewDone(true); setReviewTargetId(null); } } async function handleMessage(otherUserId) { setMsgLoading(true); try { const { room } = await getOrCreateDirectRoom(otherUserId); router.push("/chat?room=".concat(room.id)); } catch (e) {} setMsgLoading(false); } function handleEditOpen() { var _task_budgetNegotiable, _task_category, _task_location, _task_district, _task_street, _task_houseNumber, _task_timeSlot, _task_confidentialNote; setEditForm({ title: task.title, description: task.description, budget: task.budget ? Number(task.budget) : '', budgetNegotiable: (_task_budgetNegotiable = task.budgetNegotiable) !== null && _task_budgetNegotiable !== void 0 ? _task_budgetNegotiable : false, category: (_task_category = task.category) !== null && _task_category !== void 0 ? _task_category : '', location: (_task_location = task.location) !== null && _task_location !== void 0 ? _task_location : '', district: (_task_district = task.district) !== null && _task_district !== void 0 ? _task_district : '', street: (_task_street = task.street) !== null && _task_street !== void 0 ? _task_street : '', houseNumber: (_task_houseNumber = task.houseNumber) !== null && _task_houseNumber !== void 0 ? _task_houseNumber : '', timeSlot: (_task_timeSlot = task.timeSlot) !== null && _task_timeSlot !== void 0 ? _task_timeSlot : '', confidentialNote: (_task_confidentialNote = task.confidentialNote) !== null && _task_confidentialNote !== void 0 ? _task_confidentialNote : '', deadline: task.deadline ? new Date(task.deadline).toISOString().slice(0, 10) : '', expiresAt: task.expiresAt ? new Date(task.expiresAt).toISOString().slice(0, 10) : '', status: task.status === 'draft' ? 'draft' : 'open' }); setEditing(true); } async function handleEditSave(e) { e.preventDefault(); if (!editForm) return; setEditSaving(true); try { const payload = { title: editForm.title, description: editForm.description, budgetNegotiable: editForm.budgetNegotiable, status: editForm.status }; if (editForm.budget !== '' && editForm.budget > 0) payload.budget = Number(editForm.budget); if (editForm.category) payload.category = editForm.category; if (editForm.location) payload.location = editForm.location; if (editForm.district) payload.district = editForm.district; if (editForm.street) payload.street = editForm.street; if (editForm.houseNumber) payload.houseNumber = editForm.houseNumber; if (editForm.timeSlot) payload.timeSlot = editForm.timeSlot; if (editForm.confidentialNote !== undefined) payload.confidentialNote = editForm.confidentialNote; if (editForm.deadline) payload.deadline = new Date(editForm.deadline).toISOString(); if (editForm.expiresAt) payload.expiresAt = new Date(editForm.expiresAt).toISOString(); const updated = await updateTask(taskId, payload); setTask((prev)=>({ ...prev, ...updated })); setEditing(false); } catch (err) { alert((err === null || err === void 0 ? void 0 : err.message) || t('common.error')); } finally{ setEditSaving(false); } } const acceptedOffer = offers.find((r)=>r.offer.status === 'accepted'); var _catMap_task_category, _locMap_task_location; return /*#__PURE__*/ _jsxs("div", { className: "max-w-4xl mx-auto px-4 py-8", children: [ /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6 mb-6", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex justify-between items-start gap-4 mb-4", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [ /*#__PURE__*/ _jsx("span", { className: "text-xs font-medium px-2 py-1 rounded-full ".concat(statusColors[task.status]), children: t("task.status.".concat(task.status), task.status) }), task.category && /*#__PURE__*/ _jsx("span", { className: "text-xs font-medium text-green-600 bg-green-50 px-2 py-1 rounded-full", children: (_catMap_task_category = catMap[task.category]) !== null && _catMap_task_category !== void 0 ? _catMap_task_category : task.category }), isOwner && /*#__PURE__*/ _jsx("span", { className: "text-xs text-gray-400 bg-gray-100 px-2 py-1 rounded-full", children: t('task.yours') }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 shrink-0", children: [ isOwner && (task.status === 'draft' || task.status === 'open') && /*#__PURE__*/ _jsxs("button", { onClick: handleEditOpen, className: "flex items-center gap-1.5 text-xs font-medium text-green-600 bg-green-50 hover:bg-green-100 px-3 py-1.5 rounded-lg transition", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M16.862 4.487l1.687-1.688a1.875 1.875 0 112.652 2.652L10.582 16.07a4.5 4.5 0 01-1.897 1.13L6 18l.8-2.685a4.5 4.5 0 011.13-1.897l8.932-8.931zm0 0L19.5 7.125" }) }), t('task.edit') ] }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-400", children: new Date(task.createdAt).toLocaleDateString(dateLocale) }) ] }) ] }), /*#__PURE__*/ _jsx("h1", { className: "text-2xl font-bold text-gray-900 mb-4", children: taskTitle(task, locale) }), /*#__PURE__*/ _jsx("p", { className: "text-gray-700 whitespace-pre-wrap mb-6", children: taskDescription(task, locale) }), /*#__PURE__*/ _jsxs("div", { className: "grid grid-cols-2 md:grid-cols-4 gap-4 p-4 bg-gray-50 rounded-lg", children: [ task.budget && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-500", children: t('task.budget') }), /*#__PURE__*/ _jsxs("p", { className: "font-bold text-green-600 text-lg", children: [ task.budget, "€" ] }), task.budgetNegotiable && /*#__PURE__*/ _jsx("p", { className: "text-xs text-green-600 mt-0.5", children: t('task.budget_negotiable') }) ] }), !task.budget && task.budgetNegotiable && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-500", children: t('task.budget') }), /*#__PURE__*/ _jsx("p", { className: "font-medium text-green-600", children: t('task.budget_negotiable') }) ] }), task.location && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-500", children: t('task.location') }), /*#__PURE__*/ _jsxs("p", { className: "font-medium", children: [ "\uD83D\uDCCD ", (_locMap_task_location = locMap[task.location]) !== null && _locMap_task_location !== void 0 ? _locMap_task_location : task.location ] }) ] }), task.deadline && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-500", children: t('task.deadline') }), /*#__PURE__*/ _jsx("p", { className: "font-medium", children: new Date(task.deadline).toLocaleDateString(dateLocale) }), task.timeSlot && task.timeSlot !== '' && /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-500 mt-0.5", children: t("create.field.time_slot.".concat(task.timeSlot), task.timeSlot) }) ] }), !task.deadline && task.timeSlot && task.timeSlot !== '' && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-500", children: t('task.time_slot') }), /*#__PURE__*/ _jsx("p", { className: "font-medium", children: t("create.field.time_slot.".concat(task.timeSlot), task.timeSlot) }) ] }), task.expiresAt && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-500", children: t('task.expires_at') }), /*#__PURE__*/ _jsx("p", { className: "font-medium", children: new Date(task.expiresAt).toLocaleDateString(dateLocale) }) ] }), customer && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-500", children: t('task.customer') }), /*#__PURE__*/ _jsxs(Link, { href: "/users/".concat(customer.id), className: "flex items-center gap-2 mt-1 group", children: [ /*#__PURE__*/ _jsx("div", { className: "w-8 h-8 rounded-full overflow-hidden bg-green-100 shrink-0 flex items-center justify-center", children: customer.image ? /*#__PURE__*/ _jsx("img", { src: customer.image, alt: shortName(customer.name), className: "w-full h-full object-cover" }) : /*#__PURE__*/ _jsx("span", { className: "text-green-600 font-semibold text-xs", children: shortName(customer.name).charAt(0).toUpperCase() }) }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "font-medium text-gray-900 group-hover:text-green-600 leading-none", children: shortName(customer.name) }), customer.rating && /*#__PURE__*/ _jsxs("p", { className: "text-xs text-yellow-500 leading-none mt-0.5", children: [ "★ ", Number(customer.rating).toFixed(1) ] }) ] }) ] }) ] }) ] }), task.images && task.images.length > 0 && /*#__PURE__*/ _jsx("div", { className: "mt-4", children: /*#__PURE__*/ _jsx("div", { className: "flex flex-wrap gap-2", children: task.images.map((url, i)=>/*#__PURE__*/ _jsx("button", { onClick: ()=>setLightboxIndex(i), className: "block w-24 h-24 rounded-lg overflow-hidden border border-gray-200 hover:opacity-90 hover:border-green-300 transition", children: /*#__PURE__*/ _jsx("img", { src: url, alt: "", className: "w-full h-full object-cover" }) }, i)) }) }), lightboxIndex !== null && task.images && /*#__PURE__*/ _jsx("div", { className: "fixed inset-0 z-50 flex items-center justify-center bg-black/85", onClick: ()=>setLightboxIndex(null), children: /*#__PURE__*/ _jsxs("div", { className: "relative max-w-4xl w-full mx-4", onClick: (e)=>e.stopPropagation(), children: [ /*#__PURE__*/ _jsx("img", { src: task.images[lightboxIndex], alt: "", className: "w-full max-h-[80vh] object-contain rounded-lg" }), /*#__PURE__*/ _jsx("button", { onClick: ()=>setLightboxIndex(null), className: "absolute -top-10 right-0 text-white/80 hover:text-white p-2", children: /*#__PURE__*/ _jsx("svg", { className: "w-6 h-6", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" }) }) }), lightboxIndex > 0 && /*#__PURE__*/ _jsx("button", { onClick: ()=>setLightboxIndex(lightboxIndex - 1), className: "absolute left-0 top-1/2 -translate-y-1/2 -translate-x-12 text-white/80 hover:text-white p-2", children: /*#__PURE__*/ _jsx("svg", { className: "w-8 h-8", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 19l-7-7 7-7" }) }) }), lightboxIndex < task.images.length - 1 && /*#__PURE__*/ _jsx("button", { onClick: ()=>setLightboxIndex(lightboxIndex + 1), className: "absolute right-0 top-1/2 -translate-y-1/2 translate-x-12 text-white/80 hover:text-white p-2", children: /*#__PURE__*/ _jsx("svg", { className: "w-8 h-8", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 5l7 7-7 7" }) }) }), task.images.length > 1 && /*#__PURE__*/ _jsxs("p", { className: "text-white/60 text-sm text-center mt-3", children: [ lightboxIndex + 1, " / ", task.images.length ] }) ] }) }), (isOwner || (myOffer === null || myOffer === void 0 ? void 0 : myOffer.status) === 'accepted') && (task.district || task.street || task.confidentialNote) && /*#__PURE__*/ _jsxs("div", { className: "mt-4 p-3 bg-yellow-50 border border-yellow-200 rounded-lg space-y-2", children: [ /*#__PURE__*/ _jsxs("p", { className: "text-xs font-medium text-yellow-700 flex items-center gap-1", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z" }) }), t('task.confidential') ] }), (task.district || task.street) && /*#__PURE__*/ _jsxs("p", { className: "text-sm text-yellow-800", children: [ "\uD83D\uDCCD ", [ task.district, task.street, task.houseNumber ].filter(Boolean).join(', ') ] }), task.confidentialNote && /*#__PURE__*/ _jsx("p", { className: "text-sm text-yellow-800", children: task.confidentialNote }) ] }), /*#__PURE__*/ _jsxs("div", { className: "mt-6 flex flex-wrap gap-3", children: [ !session && !isOwner && task.status === 'open' && /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx(Link, { href: loginRedirectHref, className: "bg-green-600 text-white px-6 py-3 rounded-xl font-semibold hover:bg-green-700", children: t('task.make_offer', 'Send offer') }), /*#__PURE__*/ _jsxs(Link, { href: loginRedirectHref, className: "flex items-center gap-2 bg-green-50 text-green-600 border border-green-200 px-4 py-2.5 rounded-xl font-medium hover:bg-green-100", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }), t('chat.write_customer', 'Write to customer') ] }) ] }), isOwner && task.status === 'in_progress' && /*#__PURE__*/ _jsx("button", { onClick: handleComplete, className: "bg-green-600 text-white px-6 py-3 rounded-xl font-semibold hover:bg-green-700", children: t('task.complete') }), isOwner && (acceptedOffer === null || acceptedOffer === void 0 ? void 0 : (_acceptedOffer_specialist = acceptedOffer.specialist) === null || _acceptedOffer_specialist === void 0 ? void 0 : _acceptedOffer_specialist.id) && /*#__PURE__*/ _jsxs("button", { onClick: ()=>handleMessage(acceptedOffer.specialist.id), disabled: msgLoading, className: "flex items-center gap-2 bg-green-50 text-green-600 border border-green-200 px-4 py-2.5 rounded-xl font-medium hover:bg-green-100 disabled:opacity-50", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }), t('chat.write_specialist') ] }), isOwner && task.status === 'completed' && acceptedOffer && !reviewDone && /*#__PURE__*/ _jsx("button", { onClick: ()=>{ var _acceptedOffer_specialist; var _acceptedOffer_specialist_id; return setReviewTargetId((_acceptedOffer_specialist_id = (_acceptedOffer_specialist = acceptedOffer.specialist) === null || _acceptedOffer_specialist === void 0 ? void 0 : _acceptedOffer_specialist.id) !== null && _acceptedOffer_specialist_id !== void 0 ? _acceptedOffer_specialist_id : null); }, className: "bg-yellow-500 text-white px-6 py-3 rounded-xl font-semibold hover:bg-yellow-600", children: t('review.leave') }), reviewDone && /*#__PURE__*/ _jsx("span", { className: "text-green-600 font-medium py-3", children: t('review.done') }) ] }), reviewTargetId && /*#__PURE__*/ _jsxs("form", { onSubmit: handleReview, className: "mt-6 border-t border-gray-100 pt-6 space-y-4", children: [ /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-gray-800", children: t('review.leave') }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "text-sm font-medium text-gray-700 mb-2", children: t('review.rating') }), /*#__PURE__*/ _jsx("div", { className: "flex gap-1", children: [ 1, 2, 3, 4, 5 ].map((star)=>/*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setReviewRating(star), className: "text-2xl transition ".concat(star <= reviewRating ? 'text-yellow-400' : 'text-gray-300'), children: "★" }, star)) }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('review.comment') }), /*#__PURE__*/ _jsx("textarea", { value: reviewComment, onChange: (e)=>setReviewComment(e.target.value), rows: 3, maxLength: 2000, placeholder: t('review.comment.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" }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-3", children: [ /*#__PURE__*/ _jsx("button", { type: "submit", disabled: reviewSubmitting, className: "bg-green-600 text-white px-5 py-2 rounded-xl font-semibold hover:bg-green-700 disabled:opacity-50", children: reviewSubmitting ? t('review.submitting') : t('review.submit') }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setReviewTargetId(null), className: "px-5 py-2 rounded-xl border border-gray-200 text-gray-600 hover:bg-gray-50", children: t('common.cancel') }) ] }) ] }) ] }), isOwner && /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between mb-4 flex-wrap gap-2", children: [ /*#__PURE__*/ _jsxs("h2", { className: "text-lg font-bold text-gray-900", children: [ t('task.offers'), " (", offers.length, ")" ] }), taskStats && /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 text-xs text-gray-500", children: [ taskStats.totalViews > 0 && /*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-1", children: [ /*#__PURE__*/ _jsxs("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: [ /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 12a3 3 0 11-6 0 3 3 0 016 0z" }), /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z" }) ] }), taskStats.totalViews ] }), taskStats.offerCount > 0 && /*#__PURE__*/ _jsxs("span", { className: "font-medium text-green-600", children: [ "⚡ ", taskStats.offerCount, " ", t('task.offers').toLowerCase() ] }) ] }), hasAutoMatch && task.status === 'open' && /*#__PURE__*/ _jsxs("button", { onClick: async ()=>{ setAutoMatchLoading(true); try { const res = await runAutoMatch(taskId); var _res_matches; setAutoMatchResults((_res_matches = res.matches) !== null && _res_matches !== void 0 ? _res_matches : []); } catch (e) {} finally{ setAutoMatchLoading(false); } }, disabled: autoMatchLoading, className: "flex items-center gap-1.5 text-xs font-medium bg-purple-50 text-purple-700 border border-purple-200 px-3 py-1.5 rounded-lg hover:bg-purple-100 transition disabled:opacity-50", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M13 10V3L4 14h7v7l9-11h-7z" }) }), autoMatchLoading ? t('common.loading') : t('task.auto_match', 'Auto match') ] }) ] }), autoMatchResults && autoMatchResults.length > 0 && /*#__PURE__*/ _jsxs("div", { className: "mb-4 p-3 bg-purple-50 rounded-xl border border-purple-100", children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs font-medium text-purple-700 mb-2", children: t('task.auto_match_results', 'Top specialists') }), /*#__PURE__*/ _jsx("div", { className: "space-y-2", children: autoMatchResults.slice(0, 5).map((s)=>{ var _s_name_, _s_name; var _s_firstName; return /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between gap-2", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2", children: [ /*#__PURE__*/ _jsx("div", { className: "w-7 h-7 rounded-full bg-purple-100 flex items-center justify-center text-purple-700 text-xs font-bold overflow-hidden", children: s.image ? /*#__PURE__*/ _jsx("img", { src: s.image, alt: "", className: "w-full h-full object-cover" }) : (_s_name = s.name) === null || _s_name === void 0 ? void 0 : (_s_name_ = _s_name[0]) === null || _s_name_ === void 0 ? void 0 : _s_name_.toUpperCase() }), /*#__PURE__*/ _jsx("span", { className: "text-sm text-gray-800", children: (_s_firstName = s.firstName) !== null && _s_firstName !== void 0 ? _s_firstName : s.name }), s.rating && /*#__PURE__*/ _jsxs("span", { className: "text-xs text-yellow-500", children: [ "★", Number(s.rating).toFixed(1) ] }) ] }), /*#__PURE__*/ _jsx("button", { onClick: ()=>handleMessage(s.id), className: "text-xs text-green-600 hover:underline", children: t('chat.write_btn') }) ] }, s.id); }) }) ] }), !offersLoaded ? /*#__PURE__*/ _jsx("p", { className: "text-gray-400 text-sm", children: t('common.loading') }) : offers.length === 0 ? /*#__PURE__*/ _jsx("p", { className: "text-gray-500 text-sm", children: t('task.offers.none') }) : /*#__PURE__*/ _jsx("div", { className: "space-y-4", children: offers.map((row)=>{ var _specialist_name_, _specialist_name; const offer = row.offer; const specialist = row.specialist; var _specialist_name__toUpperCase; return /*#__PURE__*/ _jsxs("div", { className: "border border-gray-100 rounded-xl p-4", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex justify-between items-start gap-4", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-start gap-3", children: [ /*#__PURE__*/ _jsx("div", { className: "w-10 h-10 rounded-full bg-green-100 flex-shrink-0 flex items-center justify-center text-green-700 font-bold overflow-hidden", children: (specialist === null || specialist === void 0 ? void 0 : specialist.image) ? /*#__PURE__*/ _jsx("img", { src: specialist.image, alt: specialist.name, className: "w-full h-full object-cover" }) : (_specialist_name__toUpperCase = specialist === null || specialist === void 0 ? void 0 : (_specialist_name = specialist.name) === null || _specialist_name === void 0 ? void 0 : (_specialist_name_ = _specialist_name[0]) === null || _specialist_name_ === void 0 ? void 0 : _specialist_name_.toUpperCase()) !== null && _specialist_name__toUpperCase !== void 0 ? _specialist_name__toUpperCase : '?' }), /*#__PURE__*/ _jsxs("div", { children: [ specialist && /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-1.5", children: [ /*#__PURE__*/ _jsx(Link, { href: "/users/".concat(specialist.id), className: "font-medium text-gray-900 hover:text-green-600", children: shortName(specialist.name) }), specialist.planTier && specialist.planTier !== 'free' && /*#__PURE__*/ _jsx(PlanBadge, { tier: specialist.planTier }), specialist.hasVerifiedBadge && /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5 text-gray-500", viewBox: "0 0 24 24", fill: "currentColor", children: /*#__PURE__*/ _jsx("path", { d: "M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z" }) }) ] }), offer.message && /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-600 mt-1", children: offer.message }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "text-right shrink-0", children: [ /*#__PURE__*/ _jsxs("p", { className: "text-lg font-bold text-green-600", children: [ formatPrice(offer.price), "€" ] }), /*#__PURE__*/ _jsx("span", { className: "text-xs px-2 py-0.5 rounded-full ".concat(offer.status === 'accepted' ? 'bg-green-100 text-green-700' : offer.status === 'declined' ? 'bg-red-100 text-red-700' : 'bg-gray-100 text-gray-700'), children: t("offer.status.".concat(offer.status), offer.status) }) ] }) ] }), offer.status === 'pending' && task.status === 'open' && /*#__PURE__*/ _jsxs("div", { className: "flex gap-2 mt-3 pt-3 border-t border-gray-50", children: [ /*#__PURE__*/ _jsx("button", { onClick: ()=>handleAccept(offer.id), className: "flex-1 bg-green-600 text-white py-2 rounded-lg text-sm font-semibold hover:bg-green-700", children: t('offer.accept') }), /*#__PURE__*/ _jsx("button", { onClick: ()=>handleDecline(offer.id), className: "flex-1 bg-gray-100 text-gray-700 py-2 rounded-lg text-sm font-semibold hover:bg-gray-200", children: t('offer.decline') }) ] }) ] }, offer.id); }) }) ] }), !isOwner && session && invite && inviteLoaded && task.status === 'open' && !myOffer && /*#__PURE__*/ _jsx("div", { className: "rounded-xl border border-green-200 bg-green-50 p-5", children: /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between gap-4 flex-wrap gap-y-3", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3", children: [ /*#__PURE__*/ _jsx("div", { className: "w-10 h-10 rounded-full bg-green-100 flex items-center justify-center shrink-0", children: /*#__PURE__*/ _jsx("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", strokeWidth: 1.5, stroke: "currentColor", className: "w-5 h-5 text-green-600", children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M21.75 6.75v10.5a2.25 2.25 0 0 1-2.25 2.25h-15a2.25 2.25 0 0 1-2.25-2.25V6.75m19.5 0A2.25 2.25 0 0 0 19.5 4.5h-15a2.25 2.25 0 0 0-2.25 2.25m19.5 0v.243a2.25 2.25 0 0 1-1.07 1.916l-7.5 4.615a2.25 2.25 0 0 1-2.36 0L3.32 8.91a2.25 2.25 0 0 1-1.07-1.916V6.75" }) }) }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "font-semibold text-gray-900 text-sm", children: t('task.invite.banner_title') }), /*#__PURE__*/ _jsx("p", { className: "text-gray-500 text-sm mt-0.5", children: t('task.invite.banner_hint') }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-2 shrink-0", children: [ /*#__PURE__*/ _jsx(Link, { href: "/tasks/".concat(taskId, "/offer"), className: "bg-green-600 text-white px-4 py-2 rounded-lg text-sm font-semibold hover:bg-green-700 transition", children: t('task.invite.accept') }), /*#__PURE__*/ _jsx("button", { onClick: async ()=>{ if (!invite) return; setInviteDeclining(true); await dismissNotification(invite.id).catch(()=>{}); setInvite(null); setInviteDeclining(false); }, disabled: inviteDeclining, className: "border border-gray-300 bg-white text-gray-600 px-4 py-2 rounded-lg text-sm font-medium hover:bg-gray-50 disabled:opacity-50 transition", children: t('task.invite.decline') }) ] }) ] }) }), !isOwner && session && myOfferLoaded && /*#__PURE__*/ _jsxs("div", { className: "space-y-4", children: [ task.status === 'completed' && (myOffer === null || myOffer === void 0 ? void 0 : myOffer.status) === 'accepted' && /*#__PURE__*/ _jsxs("div", { className: "bg-green-50 border border-green-200 rounded-xl p-5 flex items-center gap-4", children: [ /*#__PURE__*/ _jsx("span", { className: "text-3xl", children: "\uD83C\uDF89" }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "font-bold text-green-800 text-lg", children: "ЗаЎаМОе завершеМП!" }), /*#__PURE__*/ _jsx("p", { className: "text-green-700 text-sm", children: "ЗаказчОк ПтЌетОл заЎаМОе как выпПлМеММПе." }) ] }), /*#__PURE__*/ _jsxs("button", { onClick: ()=>handleMessage(task.customerId), disabled: msgLoading, className: "ml-auto flex items-center gap-2 bg-white text-green-600 border border-green-200 px-4 py-2 rounded-xl text-sm font-medium hover:bg-green-50 disabled:opacity-50", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }), t('chat.write_customer') ] }) ] }), (myOffer || task.status === 'open' && !invite || task.status !== 'open') && /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ _jsx("h2", { className: "text-lg font-bold text-gray-900 mb-4", children: "МПё преЎлПжеМОе" }), myOffer ? /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-start justify-between gap-4", children: [ /*#__PURE__*/ _jsxs("div", { className: "space-y-1", children: [ myOffer.message && /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-600", children: myOffer.message }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400", children: new Date(myOffer.createdAt).toLocaleString(dateLocale) }) ] }), /*#__PURE__*/ _jsxs("div", { className: "text-right shrink-0", children: [ /*#__PURE__*/ _jsxs("p", { className: "text-xl font-bold text-green-600", children: [ formatPrice(myOffer.price), "€" ] }), /*#__PURE__*/ _jsx("span", { className: "text-xs px-2 py-0.5 rounded-full font-medium ".concat(myOffer.status === 'accepted' ? 'bg-green-100 text-green-700' : myOffer.status === 'declined' ? 'bg-red-100 text-red-700' : 'bg-yellow-100 text-yellow-700'), children: myOffer.status === 'accepted' ? '✓ ПрОМятП' : myOffer.status === 'declined' ? '✗ ОтклПМеМП' : '⏳ На рассЌПтреМОО' }) ] }) ] }), myOffer.status === 'accepted' && task.status === 'in_progress' && /*#__PURE__*/ _jsx("div", { className: "mt-3 pt-3 border-t border-gray-100", children: /*#__PURE__*/ _jsxs("button", { onClick: ()=>handleMessage(task.customerId), disabled: msgLoading, className: "flex items-center gap-2 bg-green-50 text-green-600 border border-green-200 px-4 py-2 rounded-xl text-sm font-medium hover:bg-green-100 disabled:opacity-50", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }), t('chat.write_customer') ] }) }) ] }) : task.status === 'open' && !invite ? /*#__PURE__*/ _jsxs("div", { className: "space-y-3", children: [ taskStats && taskStats.offerCount > 0 && /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 p-2.5 bg-amber-50 rounded-lg border border-amber-100", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-amber-500 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M13 10V3L4 14h7v7l9-11h-7z" }) }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-amber-700", children: t('fomo.already_offered', '\u0423\u0436\u0435 {n} \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0441\u0442\u043e\u0432 \u043e\u0442\u043a\u043b\u0438\u043a\u043d\u0443\u043b\u0438\u0441\u044c').replace('{n}', String(taskStats.offerCount)) }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between", children: [ /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-500", children: t('task.no_offer_yet', '\u0412\u044b \u0435\u0449\u0451 \u043d\u0435 \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u043b\u0438 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u0435') }), /*#__PURE__*/ _jsx(Link, { href: "/tasks/".concat(taskId, "/offer"), className: "bg-green-600 text-white px-4 py-2 rounded-lg text-sm font-semibold hover:bg-green-700", children: t('task.make_offer', '\u041e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u0435') }) ] }) ] }) : null ] }), task.status === 'completed' && (myOffer === null || myOffer === void 0 ? void 0 : myOffer.status) === 'accepted' && /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ _jsx("h2", { className: "text-lg font-bold text-gray-900 mb-4", children: "ОцеМка заказчОка" }), !myReviewLoaded ? /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-400", children: "Загрузка..." }) : myReview ? /*#__PURE__*/ _jsxs("div", { className: "space-y-3", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-1", children: [ [ 1, 2, 3, 4, 5 ].map((star)=>/*#__PURE__*/ _jsx("span", { className: "text-2xl ".concat(star <= myReview.rating ? 'text-yellow-400' : 'text-gray-200'), children: "★" }, star)), /*#__PURE__*/ _jsxs("span", { className: "ml-2 text-lg font-bold text-gray-800", children: [ myReview.rating, "/5" ] }) ] }), myReview.comment && /*#__PURE__*/ _jsx("p", { className: "text-gray-700 text-sm leading-relaxed", children: myReview.comment }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400", children: new Date(myReview.createdAt).toLocaleDateString(dateLocale) }) ] }) : /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-500", children: "ЗаказчОк ещё Ме ПставОл ПцеМку." }) ] }) ] }), editing && editForm && /*#__PURE__*/ _jsx("div", { className: "fixed inset-0 z-50 flex items-start justify-center bg-black/50 overflow-y-auto py-8 px-4", children: /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-2xl w-full max-w-2xl shadow-xl", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between px-6 py-4 border-b border-gray-100", children: [ /*#__PURE__*/ _jsx("h2", { className: "text-lg font-bold text-gray-900", children: t('task.edit') }), /*#__PURE__*/ _jsx("button", { onClick: ()=>setEditing(false), className: "text-gray-400 hover:text-gray-600 p-1", children: /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" }) }) }) ] }), /*#__PURE__*/ _jsxs("form", { onSubmit: handleEditSave, className: "p-6 space-y-4", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: [ t('create.field.title'), " *" ] }), /*#__PURE__*/ _jsx("input", { type: "text", required: true, minLength: 5, maxLength: 200, value: editForm.title, onChange: (e)=>setEditForm((p)=>({ ...p, title: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: [ t('create.field.description'), " *" ] }), /*#__PURE__*/ _jsx("textarea", { required: true, minLength: 20, value: editForm.description, onChange: (e)=>setEditForm((p)=>({ ...p, description: e.target.value })), rows: 4, 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" }) ] }), /*#__PURE__*/ _jsxs("div", { className: "grid grid-cols-2 gap-4", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('create.field.budget') }), /*#__PURE__*/ _jsx("input", { type: "number", min: 1, value: editForm.budget, onChange: (e)=>setEditForm((p)=>({ ...p, budget: e.target.value })), placeholder: "€", className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ _jsx("div", { className: "flex items-end pb-2", children: /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-2 cursor-pointer", children: [ /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: editForm.budgetNegotiable, onChange: (e)=>setEditForm((p)=>({ ...p, budgetNegotiable: e.target.checked })), className: "w-4 h-4 rounded text-green-600" }), /*#__PURE__*/ _jsx("span", { className: "text-sm text-gray-700", children: t('create.field.budget_negotiable') }) ] }) }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('create.field.deadline') }), /*#__PURE__*/ _jsx("input", { type: "date", value: editForm.deadline, onChange: (e)=>setEditForm((p)=>({ ...p, deadline: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('create.field.expires_at') }), /*#__PURE__*/ _jsx("input", { type: "date", value: editForm.expiresAt, onChange: (e)=>setEditForm((p)=>({ ...p, expiresAt: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ _jsxs("div", { className: "grid grid-cols-3 gap-3", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('create.field.address.district') }), /*#__PURE__*/ _jsx("input", { type: "text", value: editForm.district, onChange: (e)=>setEditForm((p)=>({ ...p, district: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('create.field.address.street') }), /*#__PURE__*/ _jsx("input", { type: "text", value: editForm.street, onChange: (e)=>setEditForm((p)=>({ ...p, street: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('create.field.address.house') }), /*#__PURE__*/ _jsx("input", { type: "text", value: editForm.houseNumber, onChange: (e)=>setEditForm((p)=>({ ...p, houseNumber: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('create.field.confidential') }), /*#__PURE__*/ _jsx("textarea", { value: editForm.confidentialNote, onChange: (e)=>setEditForm((p)=>({ ...p, confidentialNote: e.target.value })), rows: 2, 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" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('task.status_label', 'Status') }), /*#__PURE__*/ _jsxs("select", { value: editForm.status, onChange: (e)=>setEditForm((p)=>({ ...p, status: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400", children: [ /*#__PURE__*/ _jsx("option", { value: "open", children: t('task.status.open') }), /*#__PURE__*/ _jsx("option", { value: "draft", children: t('task.status.draft') }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-3 pt-2", children: [ /*#__PURE__*/ _jsx("button", { type: "submit", disabled: editSaving, className: "flex-1 bg-green-600 text-white py-2.5 rounded-xl font-semibold hover:bg-green-700 disabled:opacity-50 transition", children: editSaving ? t('common.saving', '...') : t('common.save') }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setEditing(false), className: "px-6 py-2.5 rounded-xl border border-gray-200 text-gray-600 hover:bg-gray-50 transition", children: t('common.cancel') }) ] }) ] }) ] }) }) ] }); } @8`=_’”¿ÁÝß  35acOQ›ÉËýóÉÒñù:Aho£_ªÝäNUƒŠÃÊ @G{‚œÄöý'.cjŠ­ßæ % s _z · Ÿ û  8 ? ‚ ‰ »  ð ÷ , 4 ‚ŠÈÐ×ß LYƒ‹ÛåU]¬_ž*2¢¯nx#.ŸªÝèž²£+¬+§-«-..µ.¹.d/h/!0$0„1‡1+3.3~4_‚4|5€5ñ6ô68 8<;?;º<œ<5===‡=Š=>>Z>^>,?0?™?œ?Ž@’@,B/B–CšCDDøD_ûDGFKFŽF·F«G¯GêIîIWJZJNKQKˆL‹L)N-N–N™NŽO‘OõPùPbQeQ[R^R²S¶ST"TU_UUU8V;V9WYZZ‘Z”Zg[o[ \\R_U_»_Ÿ_V`Y`a“ac cþc_dëdîdff g#g˜h›h/j2j`kckØlÛln‚n°o³o(q+qŒrÀrPuTuvvìvïvjxmxŽz_žzù|ü|þ}~Í~Ñ~Ó~Û~>ACF¿€Ã€Å€È€3‚6‚݃àƒ‡‡-‰1‰ïŠòŠiŒlŒ`’_c’}““^”a”;•?•š•«•°–³–a˜d˜£š§š››#œ&œÐžÔžvŸyŸf¡i¡££§£=€A€÷€û€³Š_·Š˜§œ§dšhšIªLªÑ«Ô«°®Ž®± ±²²(µ+µ€¶§¶¹¹Ð¹Ó¹×ºÚºŒŒôŒøŒ×œÚœûŸ_þŸJÁMÁÖÂÚÂ.Å1ÅqÇtÇ,È/ÈÓÈÖÈpÊtÊ1Ë5Ë ÌÌíÌðÌZÎ]γѷÑ^ÒbÒsÓvÓxÓ{ÓÆÔ_ÎÔŽÕ·Õ¹ÕÁÕáÖäÖ{Ø~ØxÚ{ڑܕÜpÝtÝdÞnÞrßußQâUâ1ã4ããäæä¿çÂçFèJè÷èûèžé_¡éhêkê>ìAìªî®îï"ï?ðBðÉñÍñlòoòqòtòòóõóéôûôÐ÷Ô÷¹øœø‡ùŠùPúTúœúÀúÁû_Äû ýýËþÎþEH!ÏÒ¿ÃÅÍ04 òõ&)Ú Þ ¹ œ ­ · œ À ö_ù¡•˜WZ‹Y]Y\²µó÷Èˍ!!’!•!ä$è$–%™%&’&Q'_U'ö'ú'û)þ)S+W+y-|-~..Œ/¿/û0þ0š1¬1O2S2#3&344ú4ý4r6u6%8)8ù8ý8n9_r9,;/;Ê>Î>??C?AA|D€D:E>E¿EÂEG GÑJÔJqKuKeLhLJOMOVQZQËQÎQõRøRçU_ëU\V_VˆW‹W|Z€Z:[>[¿[Â[]][`_`à`ã`0b3bvezeûeþeJgMgÛjßjPkSk~llŠoNŽoÿop/q3q¹sŒsÓtÖtv…v8w;wDyGy€€€€€€€€€€€¿(0,_lib_auth__WEBPACK_IMPORTED_MODULE_4__/* .useSession */ .wV)Ã(0,_context_locale__WEBPACK_IMPORTED_MODULE_5__/* .useLocale */ .Y)º(0,next_navigation__WEBPACK_IMPORTED_MODULE_3__.useRouter)¯(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ°(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)ÿœ(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getOffers */ .Sw)þÀ(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getTaskStats */ .vh)Á(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getMyDashboard */ .H)ü¿(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getMyOffers */ .aT)ûÁ(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getTaskInvite */ .F9)úÂ(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getTaskReviews */ .H6)¿(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .acceptOffer */ .$H)À(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .declineOffer */ .Lb)À(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .completeTask */ .Rt)À(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .createReview */ .bx)É(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getOrCreateDirectRoom */ .QN)Ÿ(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updateTask */ .lC)·(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)ÿÿÿ¶(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)ÿÿþþÿÿÿÿÄ(0,_lib_taskLocale__WEBPACK_IMPORTED_MODULE_8__/* .taskTitle */ .Oj)þÊ(0,_lib_taskLocale__WEBPACK_IMPORTED_MODULE_8__/* .taskDescription */ .GZ)üüýüýüýýüýüüýýýüýýüýýüýü²(next_link__WEBPACK_IMPORTED_MODULE_2___default())üüÃ(0,_lib_formatName__WEBPACK_IMPORTED_MODULE_9__/* .shortName */ .E)ûÿúûÿúûûûûûúûûûûûûûûûûúúúûûúûúú·react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.FragmentúýùýúúúùúúúúùúùúúúùúúùúúùùùùùùúúùùÀ(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .runAutoMatch */ .OV)ùùøùùøøùùùøùùùùøøøùùøøùüýùÅ_components_PlanBadge__WEBPACK_IMPORTED_MODULE_7__/* .PlanBadge */ .døøø÷÷Æ(0,_lib_taskLocale__WEBPACK_IMPORTED_MODULE_8__/* .formatPrice */ .$g)÷ö÷÷÷öö÷÷÷ö÷÷ö÷ú÷Ç(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .dismissNotification */ .yk)õõöõööõööõöõûõõööõõþööõööõõöööõööùõööõõöõööööõõööööõõõöõõöõõöööõööõööõööõõööõööõööõööõöõööõöö€†buffer†source„size„maps„hash^ž/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ TaskDetailClient) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(9664); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(next_link__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(7541); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(1592); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(9906); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(2982); /* harmony import */ var _lib_taskLocale__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(4017); /* harmony import */ var _lib_formatName__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(1258); /* harmony import */ var _components_PlanBadge__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(2035); /* __next_internal_client_entry_do_not_use__ default auto */ const statusColors = { open: 'bg-green-100 text-green-700', in_progress: 'bg-green-100 text-green-700', completed: 'bg-gray-100 text-gray-700', cancelled: 'bg-red-100 text-red-700', draft: 'bg-yellow-100 text-yellow-700' }; function TaskDetailClient(param) { let { taskId, initialTask, initialCustomer, catMap = {}, locMap = {} } = param; var _session_user, _acceptedOffer_specialist; const { data: session } = (0,_lib_auth__WEBPACK_IMPORTED_MODULE_4__/* .useSession */ .wV)(); const { t, locale } = (0,_context_locale__WEBPACK_IMPORTED_MODULE_5__/* .useLocale */ .Y)(); const router = (0,next_navigation__WEBPACK_IMPORTED_MODULE_3__.useRouter)(); const [task, setTask] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(initialTask); const [customer] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(initialCustomer); const [offers, setOffers] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [offersLoaded, setOffersLoaded] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [myOffer, setMyOffer] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [myOfferLoaded, setMyOfferLoaded] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [myReview, setMyReview] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [myReviewLoaded, setMyReviewLoaded] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [reviewTargetId, setReviewTargetId] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [reviewRating, setReviewRating] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(5); const [reviewComment, setReviewComment] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [reviewSubmitting, setReviewSubmitting] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [reviewDone, setReviewDone] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [invite, setInvite] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [inviteLoaded, setInviteLoaded] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [inviteDeclining, setInviteDeclining] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [msgLoading, setMsgLoading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [lightboxIndex, setLightboxIndex] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); // FOMO stats + auto-match const [taskStats, setTaskStats] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [autoMatchResults, setAutoMatchResults] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [autoMatchLoading, setAutoMatchLoading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [hasAutoMatch, setHasAutoMatch] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); // Edit task state const [editing, setEditing] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [editSaving, setEditSaving] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [editForm, setEditForm] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); // Keyboard navigation for lightbox (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ const handler = (e)=>{ if (e.key === 'Escape') setLightboxIndex(null); if (e.key === 'ArrowLeft') setLightboxIndex((prev)=>prev !== null && prev > 0 ? prev - 1 : prev); if (e.key === 'ArrowRight') setLightboxIndex((prev)=>{ if (prev === null) return prev; const imgs = task.images; return imgs && prev < imgs.length - 1 ? prev + 1 : prev; }); }; window.addEventListener('keydown', handler); return ()=>window.removeEventListener('keydown', handler); }, [ task.images ]); const dateLocale = locale === 'ru' ? 'ru-RU' : locale === 'uk' ? 'uk-UA' : locale === 'en' ? 'en-US' : 'el-GR'; const currentUserId = session === null || session === void 0 ? void 0 : (_session_user = session.user) === null || _session_user === void 0 ? void 0 : _session_user.id; const isOwner = currentUserId === task.customerId; const loginRedirectHref = "/login?redirect=".concat(encodeURIComponent("/tasks/".concat(taskId))); // Load offers if owner (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!isOwner || offersLoaded) return; (0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getOffers */ .Sw)(taskId).then((data)=>{ setOffers(data); setOffersLoaded(true); }).catch(()=>setOffersLoaded(true)); }, [ isOwner, taskId, offersLoaded ]); // Load task stats + dashboard features for owner (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!isOwner) return; (0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getTaskStats */ .vh)(taskId).then(setTaskStats).catch(()=>{}); (0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getMyDashboard */ .H)().then((d)=>{ var _d_features; return setHasAutoMatch(!!((_d_features = d.features) === null || _d_features === void 0 ? void 0 : _d_features.hasAutoMatch)); }).catch(()=>{}); }, [ isOwner, taskId ]); // Load specialist's own offer (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!currentUserId || isOwner || myOfferLoaded) return; (0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getMyOffers */ .aT)().then((rows)=>{ const found = rows.find((r)=>{ var _r_task; return ((_r_task = r.task) === null || _r_task === void 0 ? void 0 : _r_task.id) === taskId; }); var _found_offer; setMyOffer((_found_offer = found === null || found === void 0 ? void 0 : found.offer) !== null && _found_offer !== void 0 ? _found_offer : null); setMyOfferLoaded(true); }).catch(()=>setMyOfferLoaded(true)); }, [ currentUserId, isOwner, taskId, myOfferLoaded ]); // Load task invite for specialist (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!currentUserId || isOwner || inviteLoaded) return; (0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getTaskInvite */ .F9)(taskId).then((rows)=>{ var _rows_; setInvite((_rows_ = rows[0]) !== null && _rows_ !== void 0 ? _rows_ : null); setInviteLoaded(true); }).catch(()=>setInviteLoaded(true)); }, [ currentUserId, isOwner, taskId, inviteLoaded ]); // Load review for specialist when task completed (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!currentUserId || isOwner || myReviewLoaded || task.status !== 'completed') return; (0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getTaskReviews */ .H6)(taskId).then((rows)=>{ const found = rows.find((r)=>r.targetId === currentUserId); setMyReview(found !== null && found !== void 0 ? found : null); setMyReviewLoaded(true); }).catch(()=>setMyReviewLoaded(true)); }, [ currentUserId, isOwner, taskId, task.status, myReviewLoaded ]); async function handleAccept(offerId) { const updated = await (0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .acceptOffer */ .$H)(offerId).catch(()=>null); if (updated) { setOffers((prev)=>prev.map((r)=>r.offer.id === offerId ? { ...r, offer: updated } : r)); setTask((t)=>({ ...t, status: 'in_progress' })); } } async function handleDecline(offerId) { const updated = await (0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .declineOffer */ .Lb)(offerId).catch(()=>null); if (updated) { setOffers((prev)=>prev.map((r)=>r.offer.id === offerId ? { ...r, offer: updated } : r)); } } async function handleComplete() { if (!window.confirm(t('task.complete.confirm'))) return; const updated = await (0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .completeTask */ .Rt)(taskId).catch(()=>null); if (updated) setTask((t)=>({ ...t, status: 'completed' })); } async function handleReview(e) { e.preventDefault(); if (!reviewTargetId) return; setReviewSubmitting(true); const ok = await (0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .createReview */ .bx)({ taskId, targetId: reviewTargetId, rating: reviewRating, comment: reviewComment || undefined }).catch(()=>null); setReviewSubmitting(false); if (ok) { setReviewDone(true); setReviewTargetId(null); } } async function handleMessage(otherUserId) { setMsgLoading(true); try { const { room } = await (0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getOrCreateDirectRoom */ .QN)(otherUserId); router.push("/chat?room=".concat(room.id)); } catch (e) {} setMsgLoading(false); } function handleEditOpen() { var _task_budgetNegotiable, _task_category, _task_location, _task_district, _task_street, _task_houseNumber, _task_timeSlot, _task_confidentialNote; setEditForm({ title: task.title, description: task.description, budget: task.budget ? Number(task.budget) : '', budgetNegotiable: (_task_budgetNegotiable = task.budgetNegotiable) !== null && _task_budgetNegotiable !== void 0 ? _task_budgetNegotiable : false, category: (_task_category = task.category) !== null && _task_category !== void 0 ? _task_category : '', location: (_task_location = task.location) !== null && _task_location !== void 0 ? _task_location : '', district: (_task_district = task.district) !== null && _task_district !== void 0 ? _task_district : '', street: (_task_street = task.street) !== null && _task_street !== void 0 ? _task_street : '', houseNumber: (_task_houseNumber = task.houseNumber) !== null && _task_houseNumber !== void 0 ? _task_houseNumber : '', timeSlot: (_task_timeSlot = task.timeSlot) !== null && _task_timeSlot !== void 0 ? _task_timeSlot : '', confidentialNote: (_task_confidentialNote = task.confidentialNote) !== null && _task_confidentialNote !== void 0 ? _task_confidentialNote : '', deadline: task.deadline ? new Date(task.deadline).toISOString().slice(0, 10) : '', expiresAt: task.expiresAt ? new Date(task.expiresAt).toISOString().slice(0, 10) : '', status: task.status === 'draft' ? 'draft' : 'open' }); setEditing(true); } async function handleEditSave(e) { e.preventDefault(); if (!editForm) return; setEditSaving(true); try { const payload = { title: editForm.title, description: editForm.description, budgetNegotiable: editForm.budgetNegotiable, status: editForm.status }; if (editForm.budget !== '' && editForm.budget > 0) payload.budget = Number(editForm.budget); if (editForm.category) payload.category = editForm.category; if (editForm.location) payload.location = editForm.location; if (editForm.district) payload.district = editForm.district; if (editForm.street) payload.street = editForm.street; if (editForm.houseNumber) payload.houseNumber = editForm.houseNumber; if (editForm.timeSlot) payload.timeSlot = editForm.timeSlot; if (editForm.confidentialNote !== undefined) payload.confidentialNote = editForm.confidentialNote; if (editForm.deadline) payload.deadline = new Date(editForm.deadline).toISOString(); if (editForm.expiresAt) payload.expiresAt = new Date(editForm.expiresAt).toISOString(); const updated = await (0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updateTask */ .lC)(taskId, payload); setTask((prev)=>({ ...prev, ...updated })); setEditing(false); } catch (err) { alert((err === null || err === void 0 ? void 0 : err.message) || t('common.error')); } finally{ setEditSaving(false); } } const acceptedOffer = offers.find((r)=>r.offer.status === 'accepted'); var _catMap_task_category, _locMap_task_location; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "max-w-4xl mx-auto px-4 py-8", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-6 mb-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex justify-between items-start gap-4 mb-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex flex-wrap items-center gap-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-xs font-medium px-2 py-1 rounded-full ".concat(statusColors[task.status]), children: t("task.status.".concat(task.status), task.status) }), task.category && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-xs font-medium text-green-600 bg-green-50 px-2 py-1 rounded-full", children: (_catMap_task_category = catMap[task.category]) !== null && _catMap_task_category !== void 0 ? _catMap_task_category : task.category }), isOwner && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-xs text-gray-400 bg-gray-100 px-2 py-1 rounded-full", children: t('task.yours') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-2 shrink-0", children: [ isOwner && (task.status === 'draft' || task.status === 'open') && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { onClick: handleEditOpen, className: "flex items-center gap-1.5 text-xs font-medium text-green-600 bg-green-50 hover:bg-green-100 px-3 py-1.5 rounded-lg transition", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M16.862 4.487l1.687-1.688a1.875 1.875 0 112.652 2.652L10.582 16.07a4.5 4.5 0 01-1.897 1.13L6 18l.8-2.685a4.5 4.5 0 011.13-1.897l8.932-8.931zm0 0L19.5 7.125" }) }), t('task.edit') ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-gray-400", children: new Date(task.createdAt).toLocaleDateString(dateLocale) }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h1", { className: "text-2xl font-bold text-gray-900 mb-4", children: (0,_lib_taskLocale__WEBPACK_IMPORTED_MODULE_8__/* .taskTitle */ .Oj)(task, locale) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-gray-700 whitespace-pre-wrap mb-6", children: (0,_lib_taskLocale__WEBPACK_IMPORTED_MODULE_8__/* .taskDescription */ .GZ)(task, locale) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "grid grid-cols-2 md:grid-cols-4 gap-4 p-4 bg-gray-50 rounded-lg", children: [ task.budget && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-500", children: t('task.budget') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { className: "font-bold text-green-600 text-lg", children: [ task.budget, "€" ] }), task.budgetNegotiable && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-green-600 mt-0.5", children: t('task.budget_negotiable') }) ] }), !task.budget && task.budgetNegotiable && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-500", children: t('task.budget') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "font-medium text-green-600", children: t('task.budget_negotiable') }) ] }), task.location && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-500", children: t('task.location') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { className: "font-medium", children: [ "\uD83D\uDCCD ", (_locMap_task_location = locMap[task.location]) !== null && _locMap_task_location !== void 0 ? _locMap_task_location : task.location ] }) ] }), task.deadline && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-500", children: t('task.deadline') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "font-medium", children: new Date(task.deadline).toLocaleDateString(dateLocale) }), task.timeSlot && task.timeSlot !== '' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-500 mt-0.5", children: t("create.field.time_slot.".concat(task.timeSlot), task.timeSlot) }) ] }), !task.deadline && task.timeSlot && task.timeSlot !== '' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-500", children: t('task.time_slot') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "font-medium", children: t("create.field.time_slot.".concat(task.timeSlot), task.timeSlot) }) ] }), task.expiresAt && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-500", children: t('task.expires_at') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "font-medium", children: new Date(task.expiresAt).toLocaleDateString(dateLocale) }) ] }), customer && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-500", children: t('task.customer') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)((next_link__WEBPACK_IMPORTED_MODULE_2___default()), { href: "/users/".concat(customer.id), className: "flex items-center gap-2 mt-1 group", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "w-8 h-8 rounded-full overflow-hidden bg-green-100 shrink-0 flex items-center justify-center", children: customer.image ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: customer.image, alt: (0,_lib_formatName__WEBPACK_IMPORTED_MODULE_9__/* .shortName */ .E)(customer.name), className: "w-full h-full object-cover" }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-green-600 font-semibold text-xs", children: (0,_lib_formatName__WEBPACK_IMPORTED_MODULE_9__/* .shortName */ .E)(customer.name).charAt(0).toUpperCase() }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "font-medium text-gray-900 group-hover:text-green-600 leading-none", children: (0,_lib_formatName__WEBPACK_IMPORTED_MODULE_9__/* .shortName */ .E)(customer.name) }), customer.rating && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { className: "text-xs text-yellow-500 leading-none mt-0.5", children: [ "★ ", Number(customer.rating).toFixed(1) ] }) ] }) ] }) ] }) ] }), task.images && task.images.length > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "mt-4", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex flex-wrap gap-2", children: task.images.map((url, i)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>setLightboxIndex(i), className: "block w-24 h-24 rounded-lg overflow-hidden border border-gray-200 hover:opacity-90 hover:border-green-300 transition", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: url, alt: "", className: "w-full h-full object-cover" }) }, i)) }) }), lightboxIndex !== null && task.images && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "fixed inset-0 z-50 flex items-center justify-center bg-black/85", onClick: ()=>setLightboxIndex(null), children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "relative max-w-4xl w-full mx-4", onClick: (e)=>e.stopPropagation(), children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: task.images[lightboxIndex], alt: "", className: "w-full max-h-[80vh] object-contain rounded-lg" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>setLightboxIndex(null), className: "absolute -top-10 right-0 text-white/80 hover:text-white p-2", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-6 h-6", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" }) }) }), lightboxIndex > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>setLightboxIndex(lightboxIndex - 1), className: "absolute left-0 top-1/2 -translate-y-1/2 -translate-x-12 text-white/80 hover:text-white p-2", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-8 h-8", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 19l-7-7 7-7" }) }) }), lightboxIndex < task.images.length - 1 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>setLightboxIndex(lightboxIndex + 1), className: "absolute right-0 top-1/2 -translate-y-1/2 translate-x-12 text-white/80 hover:text-white p-2", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-8 h-8", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 5l7 7-7 7" }) }) }), task.images.length > 1 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { className: "text-white/60 text-sm text-center mt-3", children: [ lightboxIndex + 1, " / ", task.images.length ] }) ] }) }), (isOwner || (myOffer === null || myOffer === void 0 ? void 0 : myOffer.status) === 'accepted') && (task.district || task.street || task.confidentialNote) && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "mt-4 p-3 bg-yellow-50 border border-yellow-200 rounded-lg space-y-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { className: "text-xs font-medium text-yellow-700 flex items-center gap-1", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z" }) }), t('task.confidential') ] }), (task.district || task.street) && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { className: "text-sm text-yellow-800", children: [ "\uD83D\uDCCD ", [ task.district, task.street, task.houseNumber ].filter(Boolean).join(', ') ] }), task.confidentialNote && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-yellow-800", children: task.confidentialNote }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "mt-6 flex flex-wrap gap-3", children: [ !session && !isOwner && task.status === 'open' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)((next_link__WEBPACK_IMPORTED_MODULE_2___default()), { href: loginRedirectHref, className: "bg-green-600 text-white px-6 py-3 rounded-xl font-semibold hover:bg-green-700", children: t('task.make_offer', 'Send offer') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)((next_link__WEBPACK_IMPORTED_MODULE_2___default()), { href: loginRedirectHref, className: "flex items-center gap-2 bg-green-50 text-green-600 border border-green-200 px-4 py-2.5 rounded-xl font-medium hover:bg-green-100", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }), t('chat.write_customer', 'Write to customer') ] }) ] }), isOwner && task.status === 'in_progress' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: handleComplete, className: "bg-green-600 text-white px-6 py-3 rounded-xl font-semibold hover:bg-green-700", children: t('task.complete') }), isOwner && (acceptedOffer === null || acceptedOffer === void 0 ? void 0 : (_acceptedOffer_specialist = acceptedOffer.specialist) === null || _acceptedOffer_specialist === void 0 ? void 0 : _acceptedOffer_specialist.id) && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { onClick: ()=>handleMessage(acceptedOffer.specialist.id), disabled: msgLoading, className: "flex items-center gap-2 bg-green-50 text-green-600 border border-green-200 px-4 py-2.5 rounded-xl font-medium hover:bg-green-100 disabled:opacity-50", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }), t('chat.write_specialist') ] }), isOwner && task.status === 'completed' && acceptedOffer && !reviewDone && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>{ var _acceptedOffer_specialist; var _acceptedOffer_specialist_id; return setReviewTargetId((_acceptedOffer_specialist_id = (_acceptedOffer_specialist = acceptedOffer.specialist) === null || _acceptedOffer_specialist === void 0 ? void 0 : _acceptedOffer_specialist.id) !== null && _acceptedOffer_specialist_id !== void 0 ? _acceptedOffer_specialist_id : null); }, className: "bg-yellow-500 text-white px-6 py-3 rounded-xl font-semibold hover:bg-yellow-600", children: t('review.leave') }), reviewDone && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-green-600 font-medium py-3", children: t('review.done') }) ] }), reviewTargetId && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("form", { onSubmit: handleReview, className: "mt-6 border-t border-gray-100 pt-6 space-y-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h3", { className: "font-semibold text-gray-800", children: t('review.leave') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm font-medium text-gray-700 mb-2", children: t('review.rating') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex gap-1", children: [ 1, 2, 3, 4, 5 ].map((star)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>setReviewRating(star), className: "text-2xl transition ".concat(star <= reviewRating ? 'text-yellow-400' : 'text-gray-300'), children: "★" }, star)) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('review.comment') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("textarea", { value: reviewComment, onChange: (e)=>setReviewComment(e.target.value), rows: 3, maxLength: 2000, placeholder: t('review.comment.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" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "submit", disabled: reviewSubmitting, className: "bg-green-600 text-white px-5 py-2 rounded-xl font-semibold hover:bg-green-700 disabled:opacity-50", children: reviewSubmitting ? t('review.submitting') : t('review.submit') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>setReviewTargetId(null), className: "px-5 py-2 rounded-xl border border-gray-200 text-gray-600 hover:bg-gray-50", children: t('common.cancel') }) ] }) ] }) ] }), isOwner && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-between mb-4 flex-wrap gap-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("h2", { className: "text-lg font-bold text-gray-900", children: [ t('task.offers'), " (", offers.length, ")" ] }), taskStats && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-3 text-xs text-gray-500", children: [ taskStats.totalViews > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "flex items-center gap-1", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 12a3 3 0 11-6 0 3 3 0 016 0z" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z" }) ] }), taskStats.totalViews ] }), taskStats.offerCount > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "font-medium text-green-600", children: [ "⚡ ", taskStats.offerCount, " ", t('task.offers').toLowerCase() ] }) ] }), hasAutoMatch && task.status === 'open' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { onClick: async ()=>{ setAutoMatchLoading(true); try { const res = await (0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .runAutoMatch */ .OV)(taskId); var _res_matches; setAutoMatchResults((_res_matches = res.matches) !== null && _res_matches !== void 0 ? _res_matches : []); } catch (e) {} finally{ setAutoMatchLoading(false); } }, disabled: autoMatchLoading, className: "flex items-center gap-1.5 text-xs font-medium bg-purple-50 text-purple-700 border border-purple-200 px-3 py-1.5 rounded-lg hover:bg-purple-100 transition disabled:opacity-50", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M13 10V3L4 14h7v7l9-11h-7z" }) }), autoMatchLoading ? t('common.loading') : t('task.auto_match', 'Auto match') ] }) ] }), autoMatchResults && autoMatchResults.length > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "mb-4 p-3 bg-purple-50 rounded-xl border border-purple-100", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs font-medium text-purple-700 mb-2", children: t('task.auto_match_results', 'Top specialists') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "space-y-2", children: autoMatchResults.slice(0, 5).map((s)=>{ var _s_name_, _s_name; var _s_firstName; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-between gap-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "w-7 h-7 rounded-full bg-purple-100 flex items-center justify-center text-purple-700 text-xs font-bold overflow-hidden", children: s.image ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: s.image, alt: "", className: "w-full h-full object-cover" }) : (_s_name = s.name) === null || _s_name === void 0 ? void 0 : (_s_name_ = _s_name[0]) === null || _s_name_ === void 0 ? void 0 : _s_name_.toUpperCase() }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-sm text-gray-800", children: (_s_firstName = s.firstName) !== null && _s_firstName !== void 0 ? _s_firstName : s.name }), s.rating && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "text-xs text-yellow-500", children: [ "★", Number(s.rating).toFixed(1) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>handleMessage(s.id), className: "text-xs text-green-600 hover:underline", children: t('chat.write_btn') }) ] }, s.id); }) }) ] }), !offersLoaded ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-gray-400 text-sm", children: t('common.loading') }) : offers.length === 0 ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-gray-500 text-sm", children: t('task.offers.none') }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "space-y-4", children: offers.map((row)=>{ var _specialist_name_, _specialist_name; const offer = row.offer; const specialist = row.specialist; var _specialist_name__toUpperCase; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "border border-gray-100 rounded-xl p-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex justify-between items-start gap-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-start gap-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "w-10 h-10 rounded-full bg-green-100 flex-shrink-0 flex items-center justify-center text-green-700 font-bold overflow-hidden", children: (specialist === null || specialist === void 0 ? void 0 : specialist.image) ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: specialist.image, alt: specialist.name, className: "w-full h-full object-cover" }) : (_specialist_name__toUpperCase = specialist === null || specialist === void 0 ? void 0 : (_specialist_name = specialist.name) === null || _specialist_name === void 0 ? void 0 : (_specialist_name_ = _specialist_name[0]) === null || _specialist_name_ === void 0 ? void 0 : _specialist_name_.toUpperCase()) !== null && _specialist_name__toUpperCase !== void 0 ? _specialist_name__toUpperCase : '?' }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ specialist && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-1.5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)((next_link__WEBPACK_IMPORTED_MODULE_2___default()), { href: "/users/".concat(specialist.id), className: "font-medium text-gray-900 hover:text-green-600", children: (0,_lib_formatName__WEBPACK_IMPORTED_MODULE_9__/* .shortName */ .E)(specialist.name) }), specialist.planTier && specialist.planTier !== 'free' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components_PlanBadge__WEBPACK_IMPORTED_MODULE_7__/* .PlanBadge */ .d, { tier: specialist.planTier }), specialist.hasVerifiedBadge && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3.5 h-3.5 text-gray-500", viewBox: "0 0 24 24", fill: "currentColor", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z" }) }) ] }), offer.message && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-gray-600 mt-1", children: offer.message }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "text-right shrink-0", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { className: "text-lg font-bold text-green-600", children: [ (0,_lib_taskLocale__WEBPACK_IMPORTED_MODULE_8__/* .formatPrice */ .$g)(offer.price), "€" ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-xs px-2 py-0.5 rounded-full ".concat(offer.status === 'accepted' ? 'bg-green-100 text-green-700' : offer.status === 'declined' ? 'bg-red-100 text-red-700' : 'bg-gray-100 text-gray-700'), children: t("offer.status.".concat(offer.status), offer.status) }) ] }) ] }), offer.status === 'pending' && task.status === 'open' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-2 mt-3 pt-3 border-t border-gray-50", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>handleAccept(offer.id), className: "flex-1 bg-green-600 text-white py-2 rounded-lg text-sm font-semibold hover:bg-green-700", children: t('offer.accept') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>handleDecline(offer.id), className: "flex-1 bg-gray-100 text-gray-700 py-2 rounded-lg text-sm font-semibold hover:bg-gray-200", children: t('offer.decline') }) ] }) ] }, offer.id); }) }) ] }), !isOwner && session && invite && inviteLoaded && task.status === 'open' && !myOffer && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "rounded-xl border border-green-200 bg-green-50 p-5", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-between gap-4 flex-wrap gap-y-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "w-10 h-10 rounded-full bg-green-100 flex items-center justify-center shrink-0", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", strokeWidth: 1.5, stroke: "currentColor", className: "w-5 h-5 text-green-600", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M21.75 6.75v10.5a2.25 2.25 0 0 1-2.25 2.25h-15a2.25 2.25 0 0 1-2.25-2.25V6.75m19.5 0A2.25 2.25 0 0 0 19.5 4.5h-15a2.25 2.25 0 0 0-2.25 2.25m19.5 0v.243a2.25 2.25 0 0 1-1.07 1.916l-7.5 4.615a2.25 2.25 0 0 1-2.36 0L3.32 8.91a2.25 2.25 0 0 1-1.07-1.916V6.75" }) }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "font-semibold text-gray-900 text-sm", children: t('task.invite.banner_title') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-gray-500 text-sm mt-0.5", children: t('task.invite.banner_hint') }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-2 shrink-0", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)((next_link__WEBPACK_IMPORTED_MODULE_2___default()), { href: "/tasks/".concat(taskId, "/offer"), className: "bg-green-600 text-white px-4 py-2 rounded-lg text-sm font-semibold hover:bg-green-700 transition", children: t('task.invite.accept') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: async ()=>{ if (!invite) return; setInviteDeclining(true); await (0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .dismissNotification */ .yk)(invite.id).catch(()=>{}); setInvite(null); setInviteDeclining(false); }, disabled: inviteDeclining, className: "border border-gray-300 bg-white text-gray-600 px-4 py-2 rounded-lg text-sm font-medium hover:bg-gray-50 disabled:opacity-50 transition", children: t('task.invite.decline') }) ] }) ] }) }), !isOwner && session && myOfferLoaded && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-4", children: [ task.status === 'completed' && (myOffer === null || myOffer === void 0 ? void 0 : myOffer.status) === 'accepted' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-green-50 border border-green-200 rounded-xl p-5 flex items-center gap-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-3xl", children: "\uD83C\uDF89" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "font-bold text-green-800 text-lg", children: "ЗаЎаМОе завершеМП!" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-green-700 text-sm", children: "ЗаказчОк ПтЌетОл заЎаМОе как выпПлМеММПе." }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { onClick: ()=>handleMessage(task.customerId), disabled: msgLoading, className: "ml-auto flex items-center gap-2 bg-white text-green-600 border border-green-200 px-4 py-2 rounded-xl text-sm font-medium hover:bg-green-50 disabled:opacity-50", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }), t('chat.write_customer') ] }) ] }), (myOffer || task.status === 'open' && !invite || task.status !== 'open') && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "text-lg font-bold text-gray-900 mb-4", children: "МПё преЎлПжеМОе" }), myOffer ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-start justify-between gap-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-1", children: [ myOffer.message && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-gray-600", children: myOffer.message }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400", children: new Date(myOffer.createdAt).toLocaleString(dateLocale) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "text-right shrink-0", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { className: "text-xl font-bold text-green-600", children: [ (0,_lib_taskLocale__WEBPACK_IMPORTED_MODULE_8__/* .formatPrice */ .$g)(myOffer.price), "€" ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-xs px-2 py-0.5 rounded-full font-medium ".concat(myOffer.status === 'accepted' ? 'bg-green-100 text-green-700' : myOffer.status === 'declined' ? 'bg-red-100 text-red-700' : 'bg-yellow-100 text-yellow-700'), children: myOffer.status === 'accepted' ? '✓ ПрОМятП' : myOffer.status === 'declined' ? '✗ ОтклПМеМП' : '⏳ На рассЌПтреМОО' }) ] }) ] }), myOffer.status === 'accepted' && task.status === 'in_progress' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "mt-3 pt-3 border-t border-gray-100", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { onClick: ()=>handleMessage(task.customerId), disabled: msgLoading, className: "flex items-center gap-2 bg-green-50 text-green-600 border border-green-200 px-4 py-2 rounded-xl text-sm font-medium hover:bg-green-100 disabled:opacity-50", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }), t('chat.write_customer') ] }) }) ] }) : task.status === 'open' && !invite ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-3", children: [ taskStats && taskStats.offerCount > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-2 p-2.5 bg-amber-50 rounded-lg border border-amber-100", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 text-amber-500 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M13 10V3L4 14h7v7l9-11h-7z" }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-amber-700", children: t('fomo.already_offered', '\u0423\u0436\u0435 {n} \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0441\u0442\u043e\u0432 \u043e\u0442\u043a\u043b\u0438\u043a\u043d\u0443\u043b\u0438\u0441\u044c').replace('{n}', String(taskStats.offerCount)) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-between", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-gray-500", children: t('task.no_offer_yet', '\u0412\u044b \u0435\u0449\u0451 \u043d\u0435 \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u043b\u0438 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u0435') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)((next_link__WEBPACK_IMPORTED_MODULE_2___default()), { href: "/tasks/".concat(taskId, "/offer"), className: "bg-green-600 text-white px-4 py-2 rounded-lg text-sm font-semibold hover:bg-green-700", children: t('task.make_offer', '\u041e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u0435') }) ] }) ] }) : null ] }), task.status === 'completed' && (myOffer === null || myOffer === void 0 ? void 0 : myOffer.status) === 'accepted' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "text-lg font-bold text-gray-900 mb-4", children: "ОцеМка заказчОка" }), !myReviewLoaded ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-gray-400", children: "Загрузка..." }) : myReview ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-1", children: [ [ 1, 2, 3, 4, 5 ].map((star)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-2xl ".concat(star <= myReview.rating ? 'text-yellow-400' : 'text-gray-200'), children: "★" }, star)), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "ml-2 text-lg font-bold text-gray-800", children: [ myReview.rating, "/5" ] }) ] }), myReview.comment && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-gray-700 text-sm leading-relaxed", children: myReview.comment }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400", children: new Date(myReview.createdAt).toLocaleDateString(dateLocale) }) ] }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-gray-500", children: "ЗаказчОк ещё Ме ПставОл ПцеМку." }) ] }) ] }), editing && editForm && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "fixed inset-0 z-50 flex items-start justify-center bg-black/50 overflow-y-auto py-8 px-4", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-2xl w-full max-w-2xl shadow-xl", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-between px-6 py-4 border-b border-gray-100", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "text-lg font-bold text-gray-900", children: t('task.edit') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>setEditing(false), className: "text-gray-400 hover:text-gray-600 p-1", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-5 h-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" }) }) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("form", { onSubmit: handleEditSave, className: "p-6 space-y-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: [ t('create.field.title'), " *" ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "text", required: true, minLength: 5, maxLength: 200, value: editForm.title, onChange: (e)=>setEditForm((p)=>({ ...p, title: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: [ t('create.field.description'), " *" ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("textarea", { required: true, minLength: 20, value: editForm.description, onChange: (e)=>setEditForm((p)=>({ ...p, description: e.target.value })), rows: 4, 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" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "grid grid-cols-2 gap-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('create.field.budget') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "number", min: 1, value: editForm.budget, onChange: (e)=>setEditForm((p)=>({ ...p, budget: e.target.value })), placeholder: "€", className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex items-end pb-2", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "flex items-center gap-2 cursor-pointer", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "checkbox", checked: editForm.budgetNegotiable, onChange: (e)=>setEditForm((p)=>({ ...p, budgetNegotiable: e.target.checked })), className: "w-4 h-4 rounded text-green-600" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-sm text-gray-700", children: t('create.field.budget_negotiable') }) ] }) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('create.field.deadline') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "date", value: editForm.deadline, onChange: (e)=>setEditForm((p)=>({ ...p, deadline: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('create.field.expires_at') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "date", value: editForm.expiresAt, onChange: (e)=>setEditForm((p)=>({ ...p, expiresAt: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "grid grid-cols-3 gap-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('create.field.address.district') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "text", value: editForm.district, onChange: (e)=>setEditForm((p)=>({ ...p, district: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('create.field.address.street') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "text", value: editForm.street, onChange: (e)=>setEditForm((p)=>({ ...p, street: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('create.field.address.house') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "text", value: editForm.houseNumber, onChange: (e)=>setEditForm((p)=>({ ...p, houseNumber: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('create.field.confidential') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("textarea", { value: editForm.confidentialNote, onChange: (e)=>setEditForm((p)=>({ ...p, confidentialNote: e.target.value })), rows: 2, 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" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('task.status_label', 'Status') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("select", { value: editForm.status, onChange: (e)=>setEditForm((p)=>({ ...p, status: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "open", children: t('task.status.open') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "draft", children: t('task.status.draft') }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-3 pt-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "submit", disabled: editSaving, className: "flex-1 bg-green-600 text-white py-2.5 rounded-xl font-semibold hover:bg-green-700 disabled:opacity-50 transition", children: editSaving ? t('common.saving', '...') : t('common.save') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>setEditing(false), className: "px-6 py-2.5 rounded-xl border border-gray-200 text-gray-600 hover:bg-gray-50 transition", children: t('common.cancel') }) ] }) ] }) ] }) }) ] }); } €”{"finalSource":true}ƒmap‹bufferedMap ConcatSourceRawSource/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ TaskDetailClient) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(9664); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(next_link__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(7541); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(1592); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(9906); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(2982); /* harmony import */ var _lib_taskLocale__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(4017); /* harmony import */ var _lib_formatName__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(1258); /* harmony import */ var _components_PlanBadge__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(2035); ReplaceSourceRawSourceZ|/* __next_internal_client_entry_do_not_use__ default auto */ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime"; import { useState, useEffect } from 'react'; import Link from 'next/link'; import { useRouter } from 'next/navigation'; import { useSession } from '@/lib/auth'; import { useLocale } from '@/context/locale'; import { getOffers, acceptOffer, declineOffer, completeTask, createReview, getMyOffers, getTaskReviews, getTaskInvite, dismissNotification, getOrCreateDirectRoom, updateTask, getTaskStats, runAutoMatch, getMyDashboard } from '@/lib/api'; import { taskTitle, taskDescription, formatPrice } from '@/lib/taskLocale'; import { shortName } from '@/lib/formatName'; import { PlanBadge } from '@/components/PlanBadge'; const statusColors = { open: 'bg-green-100 text-green-700', in_progress: 'bg-green-100 text-green-700', completed: 'bg-gray-100 text-gray-700', cancelled: 'bg-red-100 text-red-700', draft: 'bg-yellow-100 text-yellow-700' }; export default function TaskDetailClient(param) { let { taskId, initialTask, initialCustomer, catMap = {}, locMap = {} } = param; var _session_user, _acceptedOffer_specialist; const { data: session } = useSession(); const { t, locale } = useLocale(); const router = useRouter(); const [task, setTask] = useState(initialTask); const [customer] = useState(initialCustomer); const [offers, setOffers] = useState([]); const [offersLoaded, setOffersLoaded] = useState(false); const [myOffer, setMyOffer] = useState(null); const [myOfferLoaded, setMyOfferLoaded] = useState(false); const [myReview, setMyReview] = useState(null); const [myReviewLoaded, setMyReviewLoaded] = useState(false); const [reviewTargetId, setReviewTargetId] = useState(null); const [reviewRating, setReviewRating] = useState(5); const [reviewComment, setReviewComment] = useState(''); const [reviewSubmitting, setReviewSubmitting] = useState(false); const [reviewDone, setReviewDone] = useState(false); const [invite, setInvite] = useState(null); const [inviteLoaded, setInviteLoaded] = useState(false); const [inviteDeclining, setInviteDeclining] = useState(false); const [msgLoading, setMsgLoading] = useState(false); const [lightboxIndex, setLightboxIndex] = useState(null); // FOMO stats + auto-match const [taskStats, setTaskStats] = useState(null); const [autoMatchResults, setAutoMatchResults] = useState(null); const [autoMatchLoading, setAutoMatchLoading] = useState(false); const [hasAutoMatch, setHasAutoMatch] = useState(false); // Edit task state const [editing, setEditing] = useState(false); const [editSaving, setEditSaving] = useState(false); const [editForm, setEditForm] = useState(null); // Keyboard navigation for lightbox useEffect(()=>{ const handler = (e)=>{ if (e.key === 'Escape') setLightboxIndex(null); if (e.key === 'ArrowLeft') setLightboxIndex((prev)=>prev !== null && prev > 0 ? prev - 1 : prev); if (e.key === 'ArrowRight') setLightboxIndex((prev)=>{ if (prev === null) return prev; const imgs = task.images; return imgs && prev < imgs.length - 1 ? prev + 1 : prev; }); }; window.addEventListener('keydown', handler); return ()=>window.removeEventListener('keydown', handler); }, [ task.images ]); const dateLocale = locale === 'ru' ? 'ru-RU' : locale === 'uk' ? 'uk-UA' : locale === 'en' ? 'en-US' : 'el-GR'; const currentUserId = session === null || session === void 0 ? void 0 : (_session_user = session.user) === null || _session_user === void 0 ? void 0 : _session_user.id; const isOwner = currentUserId === task.customerId; const loginRedirectHref = "/login?redirect=".concat(encodeURIComponent("/tasks/".concat(taskId))); // Load offers if owner useEffect(()=>{ if (!isOwner || offersLoaded) return; getOffers(taskId).then((data)=>{ setOffers(data); setOffersLoaded(true); }).catch(()=>setOffersLoaded(true)); }, [ isOwner, taskId, offersLoaded ]); // Load task stats + dashboard features for owner useEffect(()=>{ if (!isOwner) return; getTaskStats(taskId).then(setTaskStats).catch(()=>{}); getMyDashboard().then((d)=>{ var _d_features; return setHasAutoMatch(!!((_d_features = d.features) === null || _d_features === void 0 ? void 0 : _d_features.hasAutoMatch)); }).catch(()=>{}); }, [ isOwner, taskId ]); // Load specialist's own offer useEffect(()=>{ if (!currentUserId || isOwner || myOfferLoaded) return; getMyOffers().then((rows)=>{ const found = rows.find((r)=>{ var _r_task; return ((_r_task = r.task) === null || _r_task === void 0 ? void 0 : _r_task.id) === taskId; }); var _found_offer; setMyOffer((_found_offer = found === null || found === void 0 ? void 0 : found.offer) !== null && _found_offer !== void 0 ? _found_offer : null); setMyOfferLoaded(true); }).catch(()=>setMyOfferLoaded(true)); }, [ currentUserId, isOwner, taskId, myOfferLoaded ]); // Load task invite for specialist useEffect(()=>{ if (!currentUserId || isOwner || inviteLoaded) return; getTaskInvite(taskId).then((rows)=>{ var _rows_; setInvite((_rows_ = rows[0]) !== null && _rows_ !== void 0 ? _rows_ : null); setInviteLoaded(true); }).catch(()=>setInviteLoaded(true)); }, [ currentUserId, isOwner, taskId, inviteLoaded ]); // Load review for specialist when task completed useEffect(()=>{ if (!currentUserId || isOwner || myReviewLoaded || task.status !== 'completed') return; getTaskReviews(taskId).then((rows)=>{ const found = rows.find((r)=>r.targetId === currentUserId); setMyReview(found !== null && found !== void 0 ? found : null); setMyReviewLoaded(true); }).catch(()=>setMyReviewLoaded(true)); }, [ currentUserId, isOwner, taskId, task.status, myReviewLoaded ]); async function handleAccept(offerId) { const updated = await acceptOffer(offerId).catch(()=>null); if (updated) { setOffers((prev)=>prev.map((r)=>r.offer.id === offerId ? { ...r, offer: updated } : r)); setTask((t)=>({ ...t, status: 'in_progress' })); } } async function handleDecline(offerId) { const updated = await declineOffer(offerId).catch(()=>null); if (updated) { setOffers((prev)=>prev.map((r)=>r.offer.id === offerId ? { ...r, offer: updated } : r)); } } async function handleComplete() { if (!window.confirm(t('task.complete.confirm'))) return; const updated = await completeTask(taskId).catch(()=>null); if (updated) setTask((t)=>({ ...t, status: 'completed' })); } async function handleReview(e) { e.preventDefault(); if (!reviewTargetId) return; setReviewSubmitting(true); const ok = await createReview({ taskId, targetId: reviewTargetId, rating: reviewRating, comment: reviewComment || undefined }).catch(()=>null); setReviewSubmitting(false); if (ok) { setReviewDone(true); setReviewTargetId(null); } } async function handleMessage(otherUserId) { setMsgLoading(true); try { const { room } = await getOrCreateDirectRoom(otherUserId); router.push("/chat?room=".concat(room.id)); } catch (e) {} setMsgLoading(false); } function handleEditOpen() { var _task_budgetNegotiable, _task_category, _task_location, _task_district, _task_street, _task_houseNumber, _task_timeSlot, _task_confidentialNote; setEditForm({ title: task.title, description: task.description, budget: task.budget ? Number(task.budget) : '', budgetNegotiable: (_task_budgetNegotiable = task.budgetNegotiable) !== null && _task_budgetNegotiable !== void 0 ? _task_budgetNegotiable : false, category: (_task_category = task.category) !== null && _task_category !== void 0 ? _task_category : '', location: (_task_location = task.location) !== null && _task_location !== void 0 ? _task_location : '', district: (_task_district = task.district) !== null && _task_district !== void 0 ? _task_district : '', street: (_task_street = task.street) !== null && _task_street !== void 0 ? _task_street : '', houseNumber: (_task_houseNumber = task.houseNumber) !== null && _task_houseNumber !== void 0 ? _task_houseNumber : '', timeSlot: (_task_timeSlot = task.timeSlot) !== null && _task_timeSlot !== void 0 ? _task_timeSlot : '', confidentialNote: (_task_confidentialNote = task.confidentialNote) !== null && _task_confidentialNote !== void 0 ? _task_confidentialNote : '', deadline: task.deadline ? new Date(task.deadline).toISOString().slice(0, 10) : '', expiresAt: task.expiresAt ? new Date(task.expiresAt).toISOString().slice(0, 10) : '', status: task.status === 'draft' ? 'draft' : 'open' }); setEditing(true); } async function handleEditSave(e) { e.preventDefault(); if (!editForm) return; setEditSaving(true); try { const payload = { title: editForm.title, description: editForm.description, budgetNegotiable: editForm.budgetNegotiable, status: editForm.status }; if (editForm.budget !== '' && editForm.budget > 0) payload.budget = Number(editForm.budget); if (editForm.category) payload.category = editForm.category; if (editForm.location) payload.location = editForm.location; if (editForm.district) payload.district = editForm.district; if (editForm.street) payload.street = editForm.street; if (editForm.houseNumber) payload.houseNumber = editForm.houseNumber; if (editForm.timeSlot) payload.timeSlot = editForm.timeSlot; if (editForm.confidentialNote !== undefined) payload.confidentialNote = editForm.confidentialNote; if (editForm.deadline) payload.deadline = new Date(editForm.deadline).toISOString(); if (editForm.expiresAt) payload.expiresAt = new Date(editForm.expiresAt).toISOString(); const updated = await updateTask(taskId, payload); setTask((prev)=>({ ...prev, ...updated })); setEditing(false); } catch (err) { alert((err === null || err === void 0 ? void 0 : err.message) || t('common.error')); } finally{ setEditSaving(false); } } const acceptedOffer = offers.find((r)=>r.offer.status === 'accepted'); var _catMap_task_category, _locMap_task_location; return /*#__PURE__*/ _jsxs("div", { className: "max-w-4xl mx-auto px-4 py-8", children: [ /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6 mb-6", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex justify-between items-start gap-4 mb-4", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [ /*#__PURE__*/ _jsx("span", { className: "text-xs font-medium px-2 py-1 rounded-full ".concat(statusColors[task.status]), children: t("task.status.".concat(task.status), task.status) }), task.category && /*#__PURE__*/ _jsx("span", { className: "text-xs font-medium text-green-600 bg-green-50 px-2 py-1 rounded-full", children: (_catMap_task_category = catMap[task.category]) !== null && _catMap_task_category !== void 0 ? _catMap_task_category : task.category }), isOwner && /*#__PURE__*/ _jsx("span", { className: "text-xs text-gray-400 bg-gray-100 px-2 py-1 rounded-full", children: t('task.yours') }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 shrink-0", children: [ isOwner && (task.status === 'draft' || task.status === 'open') && /*#__PURE__*/ _jsxs("button", { onClick: handleEditOpen, className: "flex items-center gap-1.5 text-xs font-medium text-green-600 bg-green-50 hover:bg-green-100 px-3 py-1.5 rounded-lg transition", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M16.862 4.487l1.687-1.688a1.875 1.875 0 112.652 2.652L10.582 16.07a4.5 4.5 0 01-1.897 1.13L6 18l.8-2.685a4.5 4.5 0 011.13-1.897l8.932-8.931zm0 0L19.5 7.125" }) }), t('task.edit') ] }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-400", children: new Date(task.createdAt).toLocaleDateString(dateLocale) }) ] }) ] }), /*#__PURE__*/ _jsx("h1", { className: "text-2xl font-bold text-gray-900 mb-4", children: taskTitle(task, locale) }), /*#__PURE__*/ _jsx("p", { className: "text-gray-700 whitespace-pre-wrap mb-6", children: taskDescription(task, locale) }), /*#__PURE__*/ _jsxs("div", { className: "grid grid-cols-2 md:grid-cols-4 gap-4 p-4 bg-gray-50 rounded-lg", children: [ task.budget && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-500", children: t('task.budget') }), /*#__PURE__*/ _jsxs("p", { className: "font-bold text-green-600 text-lg", children: [ task.budget, "€" ] }), task.budgetNegotiable && /*#__PURE__*/ _jsx("p", { className: "text-xs text-green-600 mt-0.5", children: t('task.budget_negotiable') }) ] }), !task.budget && task.budgetNegotiable && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-500", children: t('task.budget') }), /*#__PURE__*/ _jsx("p", { className: "font-medium text-green-600", children: t('task.budget_negotiable') }) ] }), task.location && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-500", children: t('task.location') }), /*#__PURE__*/ _jsxs("p", { className: "font-medium", children: [ "\uD83D\uDCCD ", (_locMap_task_location = locMap[task.location]) !== null && _locMap_task_location !== void 0 ? _locMap_task_location : task.location ] }) ] }), task.deadline && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-500", children: t('task.deadline') }), /*#__PURE__*/ _jsx("p", { className: "font-medium", children: new Date(task.deadline).toLocaleDateString(dateLocale) }), task.timeSlot && task.timeSlot !== '' && /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-500 mt-0.5", children: t("create.field.time_slot.".concat(task.timeSlot), task.timeSlot) }) ] }), !task.deadline && task.timeSlot && task.timeSlot !== '' && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-500", children: t('task.time_slot') }), /*#__PURE__*/ _jsx("p", { className: "font-medium", children: t("create.field.time_slot.".concat(task.timeSlot), task.timeSlot) }) ] }), task.expiresAt && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-500", children: t('task.expires_at') }), /*#__PURE__*/ _jsx("p", { className: "font-medium", children: new Date(task.expiresAt).toLocaleDateString(dateLocale) }) ] }), customer && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-500", children: t('task.customer') }), /*#__PURE__*/ _jsxs(Link, { href: "/users/".concat(customer.id), className: "flex items-center gap-2 mt-1 group", children: [ /*#__PURE__*/ _jsx("div", { className: "w-8 h-8 rounded-full overflow-hidden bg-green-100 shrink-0 flex items-center justify-center", children: customer.image ? /*#__PURE__*/ _jsx("img", { src: customer.image, alt: shortName(customer.name), className: "w-full h-full object-cover" }) : /*#__PURE__*/ _jsx("span", { className: "text-green-600 font-semibold text-xs", children: shortName(customer.name).charAt(0).toUpperCase() }) }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "font-medium text-gray-900 group-hover:text-green-600 leading-none", children: shortName(customer.name) }), customer.rating && /*#__PURE__*/ _jsxs("p", { className: "text-xs text-yellow-500 leading-none mt-0.5", children: [ "★ ", Number(customer.rating).toFixed(1) ] }) ] }) ] }) ] }) ] }), task.images && task.images.length > 0 && /*#__PURE__*/ _jsx("div", { className: "mt-4", children: /*#__PURE__*/ _jsx("div", { className: "flex flex-wrap gap-2", children: task.images.map((url, i)=>/*#__PURE__*/ _jsx("button", { onClick: ()=>setLightboxIndex(i), className: "block w-24 h-24 rounded-lg overflow-hidden border border-gray-200 hover:opacity-90 hover:border-green-300 transition", children: /*#__PURE__*/ _jsx("img", { src: url, alt: "", className: "w-full h-full object-cover" }) }, i)) }) }), lightboxIndex !== null && task.images && /*#__PURE__*/ _jsx("div", { className: "fixed inset-0 z-50 flex items-center justify-center bg-black/85", onClick: ()=>setLightboxIndex(null), children: /*#__PURE__*/ _jsxs("div", { className: "relative max-w-4xl w-full mx-4", onClick: (e)=>e.stopPropagation(), children: [ /*#__PURE__*/ _jsx("img", { src: task.images[lightboxIndex], alt: "", className: "w-full max-h-[80vh] object-contain rounded-lg" }), /*#__PURE__*/ _jsx("button", { onClick: ()=>setLightboxIndex(null), className: "absolute -top-10 right-0 text-white/80 hover:text-white p-2", children: /*#__PURE__*/ _jsx("svg", { className: "w-6 h-6", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" }) }) }), lightboxIndex > 0 && /*#__PURE__*/ _jsx("button", { onClick: ()=>setLightboxIndex(lightboxIndex - 1), className: "absolute left-0 top-1/2 -translate-y-1/2 -translate-x-12 text-white/80 hover:text-white p-2", children: /*#__PURE__*/ _jsx("svg", { className: "w-8 h-8", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 19l-7-7 7-7" }) }) }), lightboxIndex < task.images.length - 1 && /*#__PURE__*/ _jsx("button", { onClick: ()=>setLightboxIndex(lightboxIndex + 1), className: "absolute right-0 top-1/2 -translate-y-1/2 translate-x-12 text-white/80 hover:text-white p-2", children: /*#__PURE__*/ _jsx("svg", { className: "w-8 h-8", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 5l7 7-7 7" }) }) }), task.images.length > 1 && /*#__PURE__*/ _jsxs("p", { className: "text-white/60 text-sm text-center mt-3", children: [ lightboxIndex + 1, " / ", task.images.length ] }) ] }) }), (isOwner || (myOffer === null || myOffer === void 0 ? void 0 : myOffer.status) === 'accepted') && (task.district || task.street || task.confidentialNote) && /*#__PURE__*/ _jsxs("div", { className: "mt-4 p-3 bg-yellow-50 border border-yellow-200 rounded-lg space-y-2", children: [ /*#__PURE__*/ _jsxs("p", { className: "text-xs font-medium text-yellow-700 flex items-center gap-1", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z" }) }), t('task.confidential') ] }), (task.district || task.street) && /*#__PURE__*/ _jsxs("p", { className: "text-sm text-yellow-800", children: [ "\uD83D\uDCCD ", [ task.district, task.street, task.houseNumber ].filter(Boolean).join(', ') ] }), task.confidentialNote && /*#__PURE__*/ _jsx("p", { className: "text-sm text-yellow-800", children: task.confidentialNote }) ] }), /*#__PURE__*/ _jsxs("div", { className: "mt-6 flex flex-wrap gap-3", children: [ !session && !isOwner && task.status === 'open' && /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx(Link, { href: loginRedirectHref, className: "bg-green-600 text-white px-6 py-3 rounded-xl font-semibold hover:bg-green-700", children: t('task.make_offer', 'Send offer') }), /*#__PURE__*/ _jsxs(Link, { href: loginRedirectHref, className: "flex items-center gap-2 bg-green-50 text-green-600 border border-green-200 px-4 py-2.5 rounded-xl font-medium hover:bg-green-100", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }), t('chat.write_customer', 'Write to customer') ] }) ] }), isOwner && task.status === 'in_progress' && /*#__PURE__*/ _jsx("button", { onClick: handleComplete, className: "bg-green-600 text-white px-6 py-3 rounded-xl font-semibold hover:bg-green-700", children: t('task.complete') }), isOwner && (acceptedOffer === null || acceptedOffer === void 0 ? void 0 : (_acceptedOffer_specialist = acceptedOffer.specialist) === null || _acceptedOffer_specialist === void 0 ? void 0 : _acceptedOffer_specialist.id) && /*#__PURE__*/ _jsxs("button", { onClick: ()=>handleMessage(acceptedOffer.specialist.id), disabled: msgLoading, className: "flex items-center gap-2 bg-green-50 text-green-600 border border-green-200 px-4 py-2.5 rounded-xl font-medium hover:bg-green-100 disabled:opacity-50", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }), t('chat.write_specialist') ] }), isOwner && task.status === 'completed' && acceptedOffer && !reviewDone && /*#__PURE__*/ _jsx("button", { onClick: ()=>{ var _acceptedOffer_specialist; var _acceptedOffer_specialist_id; return setReviewTargetId((_acceptedOffer_specialist_id = (_acceptedOffer_specialist = acceptedOffer.specialist) === null || _acceptedOffer_specialist === void 0 ? void 0 : _acceptedOffer_specialist.id) !== null && _acceptedOffer_specialist_id !== void 0 ? _acceptedOffer_specialist_id : null); }, className: "bg-yellow-500 text-white px-6 py-3 rounded-xl font-semibold hover:bg-yellow-600", children: t('review.leave') }), reviewDone && /*#__PURE__*/ _jsx("span", { className: "text-green-600 font-medium py-3", children: t('review.done') }) ] }), reviewTargetId && /*#__PURE__*/ _jsxs("form", { onSubmit: handleReview, className: "mt-6 border-t border-gray-100 pt-6 space-y-4", children: [ /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-gray-800", children: t('review.leave') }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "text-sm font-medium text-gray-700 mb-2", children: t('review.rating') }), /*#__PURE__*/ _jsx("div", { className: "flex gap-1", children: [ 1, 2, 3, 4, 5 ].map((star)=>/*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setReviewRating(star), className: "text-2xl transition ".concat(star <= reviewRating ? 'text-yellow-400' : 'text-gray-300'), children: "★" }, star)) }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('review.comment') }), /*#__PURE__*/ _jsx("textarea", { value: reviewComment, onChange: (e)=>setReviewComment(e.target.value), rows: 3, maxLength: 2000, placeholder: t('review.comment.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" }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-3", children: [ /*#__PURE__*/ _jsx("button", { type: "submit", disabled: reviewSubmitting, className: "bg-green-600 text-white px-5 py-2 rounded-xl font-semibold hover:bg-green-700 disabled:opacity-50", children: reviewSubmitting ? t('review.submitting') : t('review.submit') }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setReviewTargetId(null), className: "px-5 py-2 rounded-xl border border-gray-200 text-gray-600 hover:bg-gray-50", children: t('common.cancel') }) ] }) ] }) ] }), isOwner && /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between mb-4 flex-wrap gap-2", children: [ /*#__PURE__*/ _jsxs("h2", { className: "text-lg font-bold text-gray-900", children: [ t('task.offers'), " (", offers.length, ")" ] }), taskStats && /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 text-xs text-gray-500", children: [ taskStats.totalViews > 0 && /*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-1", children: [ /*#__PURE__*/ _jsxs("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: [ /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 12a3 3 0 11-6 0 3 3 0 016 0z" }), /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z" }) ] }), taskStats.totalViews ] }), taskStats.offerCount > 0 && /*#__PURE__*/ _jsxs("span", { className: "font-medium text-green-600", children: [ "⚡ ", taskStats.offerCount, " ", t('task.offers').toLowerCase() ] }) ] }), hasAutoMatch && task.status === 'open' && /*#__PURE__*/ _jsxs("button", { onClick: async ()=>{ setAutoMatchLoading(true); try { const res = await runAutoMatch(taskId); var _res_matches; setAutoMatchResults((_res_matches = res.matches) !== null && _res_matches !== void 0 ? _res_matches : []); } catch (e) {} finally{ setAutoMatchLoading(false); } }, disabled: autoMatchLoading, className: "flex items-center gap-1.5 text-xs font-medium bg-purple-50 text-purple-700 border border-purple-200 px-3 py-1.5 rounded-lg hover:bg-purple-100 transition disabled:opacity-50", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M13 10V3L4 14h7v7l9-11h-7z" }) }), autoMatchLoading ? t('common.loading') : t('task.auto_match', 'Auto match') ] }) ] }), autoMatchResults && autoMatchResults.length > 0 && /*#__PURE__*/ _jsxs("div", { className: "mb-4 p-3 bg-purple-50 rounded-xl border border-purple-100", children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs font-medium text-purple-700 mb-2", children: t('task.auto_match_results', 'Top specialists') }), /*#__PURE__*/ _jsx("div", { className: "space-y-2", children: autoMatchResults.slice(0, 5).map((s)=>{ var _s_name_, _s_name; var _s_firstName; return /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between gap-2", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2", children: [ /*#__PURE__*/ _jsx("div", { className: "w-7 h-7 rounded-full bg-purple-100 flex items-center justify-center text-purple-700 text-xs font-bold overflow-hidden", children: s.image ? /*#__PURE__*/ _jsx("img", { src: s.image, alt: "", className: "w-full h-full object-cover" }) : (_s_name = s.name) === null || _s_name === void 0 ? void 0 : (_s_name_ = _s_name[0]) === null || _s_name_ === void 0 ? void 0 : _s_name_.toUpperCase() }), /*#__PURE__*/ _jsx("span", { className: "text-sm text-gray-800", children: (_s_firstName = s.firstName) !== null && _s_firstName !== void 0 ? _s_firstName : s.name }), s.rating && /*#__PURE__*/ _jsxs("span", { className: "text-xs text-yellow-500", children: [ "★", Number(s.rating).toFixed(1) ] }) ] }), /*#__PURE__*/ _jsx("button", { onClick: ()=>handleMessage(s.id), className: "text-xs text-green-600 hover:underline", children: t('chat.write_btn') }) ] }, s.id); }) }) ] }), !offersLoaded ? /*#__PURE__*/ _jsx("p", { className: "text-gray-400 text-sm", children: t('common.loading') }) : offers.length === 0 ? /*#__PURE__*/ _jsx("p", { className: "text-gray-500 text-sm", children: t('task.offers.none') }) : /*#__PURE__*/ _jsx("div", { className: "space-y-4", children: offers.map((row)=>{ var _specialist_name_, _specialist_name; const offer = row.offer; const specialist = row.specialist; var _specialist_name__toUpperCase; return /*#__PURE__*/ _jsxs("div", { className: "border border-gray-100 rounded-xl p-4", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex justify-between items-start gap-4", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-start gap-3", children: [ /*#__PURE__*/ _jsx("div", { className: "w-10 h-10 rounded-full bg-green-100 flex-shrink-0 flex items-center justify-center text-green-700 font-bold overflow-hidden", children: (specialist === null || specialist === void 0 ? void 0 : specialist.image) ? /*#__PURE__*/ _jsx("img", { src: specialist.image, alt: specialist.name, className: "w-full h-full object-cover" }) : (_specialist_name__toUpperCase = specialist === null || specialist === void 0 ? void 0 : (_specialist_name = specialist.name) === null || _specialist_name === void 0 ? void 0 : (_specialist_name_ = _specialist_name[0]) === null || _specialist_name_ === void 0 ? void 0 : _specialist_name_.toUpperCase()) !== null && _specialist_name__toUpperCase !== void 0 ? _specialist_name__toUpperCase : '?' }), /*#__PURE__*/ _jsxs("div", { children: [ specialist && /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-1.5", children: [ /*#__PURE__*/ _jsx(Link, { href: "/users/".concat(specialist.id), className: "font-medium text-gray-900 hover:text-green-600", children: shortName(specialist.name) }), specialist.planTier && specialist.planTier !== 'free' && /*#__PURE__*/ _jsx(PlanBadge, { tier: specialist.planTier }), specialist.hasVerifiedBadge && /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5 text-gray-500", viewBox: "0 0 24 24", fill: "currentColor", children: /*#__PURE__*/ _jsx("path", { d: "M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z" }) }) ] }), offer.message && /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-600 mt-1", children: offer.message }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "text-right shrink-0", children: [ /*#__PURE__*/ _jsxs("p", { className: "text-lg font-bold text-green-600", children: [ formatPrice(offer.price), "€" ] }), /*#__PURE__*/ _jsx("span", { className: "text-xs px-2 py-0.5 rounded-full ".concat(offer.status === 'accepted' ? 'bg-green-100 text-green-700' : offer.status === 'declined' ? 'bg-red-100 text-red-700' : 'bg-gray-100 text-gray-700'), children: t("offer.status.".concat(offer.status), offer.status) }) ] }) ] }), offer.status === 'pending' && task.status === 'open' && /*#__PURE__*/ _jsxs("div", { className: "flex gap-2 mt-3 pt-3 border-t border-gray-50", children: [ /*#__PURE__*/ _jsx("button", { onClick: ()=>handleAccept(offer.id), className: "flex-1 bg-green-600 text-white py-2 rounded-lg text-sm font-semibold hover:bg-green-700", children: t('offer.accept') }), /*#__PURE__*/ _jsx("button", { onClick: ()=>handleDecline(offer.id), className: "flex-1 bg-gray-100 text-gray-700 py-2 rounded-lg text-sm font-semibold hover:bg-gray-200", children: t('offer.decline') }) ] }) ] }, offer.id); }) }) ] }), !isOwner && session && invite && inviteLoaded && task.status === 'open' && !myOffer && /*#__PURE__*/ _jsx("div", { className: "rounded-xl border border-green-200 bg-green-50 p-5", children: /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between gap-4 flex-wrap gap-y-3", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3", children: [ /*#__PURE__*/ _jsx("div", { className: "w-10 h-10 rounded-full bg-green-100 flex items-center justify-center shrink-0", children: /*#__PURE__*/ _jsx("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", strokeWidth: 1.5, stroke: "currentColor", className: "w-5 h-5 text-green-600", children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M21.75 6.75v10.5a2.25 2.25 0 0 1-2.25 2.25h-15a2.25 2.25 0 0 1-2.25-2.25V6.75m19.5 0A2.25 2.25 0 0 0 19.5 4.5h-15a2.25 2.25 0 0 0-2.25 2.25m19.5 0v.243a2.25 2.25 0 0 1-1.07 1.916l-7.5 4.615a2.25 2.25 0 0 1-2.36 0L3.32 8.91a2.25 2.25 0 0 1-1.07-1.916V6.75" }) }) }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "font-semibold text-gray-900 text-sm", children: t('task.invite.banner_title') }), /*#__PURE__*/ _jsx("p", { className: "text-gray-500 text-sm mt-0.5", children: t('task.invite.banner_hint') }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-2 shrink-0", children: [ /*#__PURE__*/ _jsx(Link, { href: "/tasks/".concat(taskId, "/offer"), className: "bg-green-600 text-white px-4 py-2 rounded-lg text-sm font-semibold hover:bg-green-700 transition", children: t('task.invite.accept') }), /*#__PURE__*/ _jsx("button", { onClick: async ()=>{ if (!invite) return; setInviteDeclining(true); await dismissNotification(invite.id).catch(()=>{}); setInvite(null); setInviteDeclining(false); }, disabled: inviteDeclining, className: "border border-gray-300 bg-white text-gray-600 px-4 py-2 rounded-lg text-sm font-medium hover:bg-gray-50 disabled:opacity-50 transition", children: t('task.invite.decline') }) ] }) ] }) }), !isOwner && session && myOfferLoaded && /*#__PURE__*/ _jsxs("div", { className: "space-y-4", children: [ task.status === 'completed' && (myOffer === null || myOffer === void 0 ? void 0 : myOffer.status) === 'accepted' && /*#__PURE__*/ _jsxs("div", { className: "bg-green-50 border border-green-200 rounded-xl p-5 flex items-center gap-4", children: [ /*#__PURE__*/ _jsx("span", { className: "text-3xl", children: "\uD83C\uDF89" }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "font-bold text-green-800 text-lg", children: "ЗаЎаМОе завершеМП!" }), /*#__PURE__*/ _jsx("p", { className: "text-green-700 text-sm", children: "ЗаказчОк ПтЌетОл заЎаМОе как выпПлМеММПе." }) ] }), /*#__PURE__*/ _jsxs("button", { onClick: ()=>handleMessage(task.customerId), disabled: msgLoading, className: "ml-auto flex items-center gap-2 bg-white text-green-600 border border-green-200 px-4 py-2 rounded-xl text-sm font-medium hover:bg-green-50 disabled:opacity-50", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }), t('chat.write_customer') ] }) ] }), (myOffer || task.status === 'open' && !invite || task.status !== 'open') && /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ _jsx("h2", { className: "text-lg font-bold text-gray-900 mb-4", children: "МПё преЎлПжеМОе" }), myOffer ? /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-start justify-between gap-4", children: [ /*#__PURE__*/ _jsxs("div", { className: "space-y-1", children: [ myOffer.message && /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-600", children: myOffer.message }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400", children: new Date(myOffer.createdAt).toLocaleString(dateLocale) }) ] }), /*#__PURE__*/ _jsxs("div", { className: "text-right shrink-0", children: [ /*#__PURE__*/ _jsxs("p", { className: "text-xl font-bold text-green-600", children: [ formatPrice(myOffer.price), "€" ] }), /*#__PURE__*/ _jsx("span", { className: "text-xs px-2 py-0.5 rounded-full font-medium ".concat(myOffer.status === 'accepted' ? 'bg-green-100 text-green-700' : myOffer.status === 'declined' ? 'bg-red-100 text-red-700' : 'bg-yellow-100 text-yellow-700'), children: myOffer.status === 'accepted' ? '✓ ПрОМятП' : myOffer.status === 'declined' ? '✗ ОтклПМеМП' : '⏳ На рассЌПтреМОО' }) ] }) ] }), myOffer.status === 'accepted' && task.status === 'in_progress' && /*#__PURE__*/ _jsx("div", { className: "mt-3 pt-3 border-t border-gray-100", children: /*#__PURE__*/ _jsxs("button", { onClick: ()=>handleMessage(task.customerId), disabled: msgLoading, className: "flex items-center gap-2 bg-green-50 text-green-600 border border-green-200 px-4 py-2 rounded-xl text-sm font-medium hover:bg-green-100 disabled:opacity-50", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }), t('chat.write_customer') ] }) }) ] }) : task.status === 'open' && !invite ? /*#__PURE__*/ _jsxs("div", { className: "space-y-3", children: [ taskStats && taskStats.offerCount > 0 && /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 p-2.5 bg-amber-50 rounded-lg border border-amber-100", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-amber-500 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M13 10V3L4 14h7v7l9-11h-7z" }) }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-amber-700", children: t('fomo.already_offered', '\u0423\u0436\u0435 {n} \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0441\u0442\u043e\u0432 \u043e\u0442\u043a\u043b\u0438\u043a\u043d\u0443\u043b\u0438\u0441\u044c').replace('{n}', String(taskStats.offerCount)) }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between", children: [ /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-500", children: t('task.no_offer_yet', '\u0412\u044b \u0435\u0449\u0451 \u043d\u0435 \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u043b\u0438 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u0435') }), /*#__PURE__*/ _jsx(Link, { href: "/tasks/".concat(taskId, "/offer"), className: "bg-green-600 text-white px-4 py-2 rounded-lg text-sm font-semibold hover:bg-green-700", children: t('task.make_offer', '\u041e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u0435') }) ] }) ] }) : null ] }), task.status === 'completed' && (myOffer === null || myOffer === void 0 ? void 0 : myOffer.status) === 'accepted' && /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ _jsx("h2", { className: "text-lg font-bold text-gray-900 mb-4", children: "ОцеМка заказчОка" }), !myReviewLoaded ? /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-400", children: "Загрузка..." }) : myReview ? /*#__PURE__*/ _jsxs("div", { className: "space-y-3", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-1", children: [ [ 1, 2, 3, 4, 5 ].map((star)=>/*#__PURE__*/ _jsx("span", { className: "text-2xl ".concat(star <= myReview.rating ? 'text-yellow-400' : 'text-gray-200'), children: "★" }, star)), /*#__PURE__*/ _jsxs("span", { className: "ml-2 text-lg font-bold text-gray-800", children: [ myReview.rating, "/5" ] }) ] }), myReview.comment && /*#__PURE__*/ _jsx("p", { className: "text-gray-700 text-sm leading-relaxed", children: myReview.comment }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400", children: new Date(myReview.createdAt).toLocaleDateString(dateLocale) }) ] }) : /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-500", children: "ЗаказчОк ещё Ме ПставОл ПцеМку." }) ] }) ] }), editing && editForm && /*#__PURE__*/ _jsx("div", { className: "fixed inset-0 z-50 flex items-start justify-center bg-black/50 overflow-y-auto py-8 px-4", children: /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-2xl w-full max-w-2xl shadow-xl", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between px-6 py-4 border-b border-gray-100", children: [ /*#__PURE__*/ _jsx("h2", { className: "text-lg font-bold text-gray-900", children: t('task.edit') }), /*#__PURE__*/ _jsx("button", { onClick: ()=>setEditing(false), className: "text-gray-400 hover:text-gray-600 p-1", children: /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" }) }) }) ] }), /*#__PURE__*/ _jsxs("form", { onSubmit: handleEditSave, className: "p-6 space-y-4", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: [ t('create.field.title'), " *" ] }), /*#__PURE__*/ _jsx("input", { type: "text", required: true, minLength: 5, maxLength: 200, value: editForm.title, onChange: (e)=>setEditForm((p)=>({ ...p, title: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: [ t('create.field.description'), " *" ] }), /*#__PURE__*/ _jsx("textarea", { required: true, minLength: 20, value: editForm.description, onChange: (e)=>setEditForm((p)=>({ ...p, description: e.target.value })), rows: 4, 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" }) ] }), /*#__PURE__*/ _jsxs("div", { className: "grid grid-cols-2 gap-4", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('create.field.budget') }), /*#__PURE__*/ _jsx("input", { type: "number", min: 1, value: editForm.budget, onChange: (e)=>setEditForm((p)=>({ ...p, budget: e.target.value })), placeholder: "€", className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ _jsx("div", { className: "flex items-end pb-2", children: /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-2 cursor-pointer", children: [ /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: editForm.budgetNegotiable, onChange: (e)=>setEditForm((p)=>({ ...p, budgetNegotiable: e.target.checked })), className: "w-4 h-4 rounded text-green-600" }), /*#__PURE__*/ _jsx("span", { className: "text-sm text-gray-700", children: t('create.field.budget_negotiable') }) ] }) }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('create.field.deadline') }), /*#__PURE__*/ _jsx("input", { type: "date", value: editForm.deadline, onChange: (e)=>setEditForm((p)=>({ ...p, deadline: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('create.field.expires_at') }), /*#__PURE__*/ _jsx("input", { type: "date", value: editForm.expiresAt, onChange: (e)=>setEditForm((p)=>({ ...p, expiresAt: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ _jsxs("div", { className: "grid grid-cols-3 gap-3", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('create.field.address.district') }), /*#__PURE__*/ _jsx("input", { type: "text", value: editForm.district, onChange: (e)=>setEditForm((p)=>({ ...p, district: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('create.field.address.street') }), /*#__PURE__*/ _jsx("input", { type: "text", value: editForm.street, onChange: (e)=>setEditForm((p)=>({ ...p, street: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('create.field.address.house') }), /*#__PURE__*/ _jsx("input", { type: "text", value: editForm.houseNumber, onChange: (e)=>setEditForm((p)=>({ ...p, houseNumber: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('create.field.confidential') }), /*#__PURE__*/ _jsx("textarea", { value: editForm.confidentialNote, onChange: (e)=>setEditForm((p)=>({ ...p, confidentialNote: e.target.value })), rows: 2, 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" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('task.status_label', 'Status') }), /*#__PURE__*/ _jsxs("select", { value: editForm.status, onChange: (e)=>setEditForm((p)=>({ ...p, status: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400", children: [ /*#__PURE__*/ _jsx("option", { value: "open", children: t('task.status.open') }), /*#__PURE__*/ _jsx("option", { value: "draft", children: t('task.status.draft') }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-3 pt-2", children: [ /*#__PURE__*/ _jsx("button", { type: "submit", disabled: editSaving, className: "flex-1 bg-green-600 text-white py-2.5 rounded-xl font-semibold hover:bg-green-700 disabled:opacity-50 transition", children: editSaving ? t('common.saving', '...') : t('common.save') }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setEditing(false), className: "px-6 py-2.5 rounded-xl border border-gray-200 text-gray-600 hover:bg-gray-50 transition", children: t('common.cancel') }) ] }) ] }) ] }) }) ] }); } ÎV61146undefined148191undefined193221undefined223266undefined268307undefined309353undefined355591undefined593667undefined669713undefined715765undefined10111025undefined12251234(0,_lib_auth__WEBPACK_IMPORTED_MODULE_4__/* .useSession */ .wV)undefined12651273(0,_context_locale__WEBPACK_IMPORTED_MODULE_5__/* .useLocale */ .Y)undefined12971305(0,next_navigation__WEBPACK_IMPORTED_MODULE_3__.useRouter)undefined13381345(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined13841391(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined14431450(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined15011508(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined15521559(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined16141621(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined16671674(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined17311738(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined17961803(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined18561863(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined19151922(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined19811988(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined20382045(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined20872094(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined21472154(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined22142221(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined22712278(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined23342341(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined24192426(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined24872494(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined25552562(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined26162623(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined26902697(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined27472754(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined28002807(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined28602868(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined39703978(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined40404048(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getOffers */ .Sw)undefined43114319(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined43654376(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getTaskStats */ .vh)undefined44284441(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getMyDashboard */ .H)undefined47394747(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined48274837(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getMyOffers */ .aT)undefined54615469(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined55485560(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getTaskInvite */ .F9)undefined59305938(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined60506063(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getTaskReviews */ .H6)undefined65106520(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .acceptOffer */ .$H)undefined69476958(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .declineOffer */ .Lb)undefined73277338(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .completeTask */ .Rt)undefined76457656(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .createReview */ .bx)undefined80948114(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getOrCreateDirectRoom */ .QN)undefined1117111180(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updateTask */ .lC)undefined1168711691(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1179811802(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1195711961(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1213212136(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1232112324(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1267612679(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1309913102(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1343813442(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1369213696(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1406514068(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1449314496(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1516415167(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1554615549(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1566915677(0,_lib_taskLocale__WEBPACK_IMPORTED_MODULE_8__/* .taskTitle */ .Oj)undefined1575115754(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1587415888(0,_lib_taskLocale__WEBPACK_IMPORTED_MODULE_8__/* .taskDescription */ .GZ)undefined1596215966(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1617216176(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1628116284(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1652616530(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1694016943(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1730217306(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1741117414(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1765617659(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1799117995(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1810018103(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1834718351(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1892218926(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1903119034(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1927819281(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1959219595(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2000920013(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2011820121(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2036620369(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2072520729(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2083420837(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2108321086(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2142621430(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2153521538(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2178221786(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2178821791(next_link__WEBPACK_IMPORTED_MODULE_2___default())undefined2207222075(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2232922332(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2247322481(0,_lib_formatName__WEBPACK_IMPORTED_MODULE_9__/* .shortName */ .E)undefined2265822661(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2283822846(0,_lib_formatName__WEBPACK_IMPORTED_MODULE_9__/* .shortName */ .E)undefined2304423048(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2318523188(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2339923407(0,_lib_formatName__WEBPACK_IMPORTED_MODULE_9__/* .shortName */ .E)undefined2356523569(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2440224405(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2450724510(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2466224665(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2497624979(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2537325376(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2559825602(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2583525838(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2614026143(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2640026403(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2677626779(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2718327186(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2748827491(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2786427867(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2828728290(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2859228595(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2896828971(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2937229376(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3003230036(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3023130235(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3044430447(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3082630829(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3141231416(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3199331996(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3225432258(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3246132465(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3246732475react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragmentundefined3257432577(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3257932582(next_link__WEBPACK_IMPORTED_MODULE_2___default())undefined3295932963(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3296532968(next_link__WEBPACK_IMPORTED_MODULE_2___default())undefined3333133334(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3375733760(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3456234565(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3511735121(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3556735570(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3594535948(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3663236635(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3747237475(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3775737761(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3798237985(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3820338207(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3831238315(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3857638579(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3900939012(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3958739591(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3969639699(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3997139974(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4065640660(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined4082240825(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4131841321(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4189141895(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined4204542049(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined4223142235(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined4267542679(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined4290442908(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined4310843112(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined4359343596(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4398543988(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4472044724(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined4534045344(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined4557445585(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .runAutoMatch */ .OV)undefined4637646379(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4675646759(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4737947383(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined4756847571(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4783147834(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4815348157(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined4837248376(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined4859948602(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4889148894(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4948249485(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4987849882(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined5047850481(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined5105751060(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined5124451247(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined5141151414(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined5182451828(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined5201752021(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined5223552239(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined5246152464(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined5282652829(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined5368353687(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined5385453858(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined5413154134(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined5413654139(next_link__WEBPACK_IMPORTED_MODULE_2___default())undefined5447054478(0,_lib_formatName__WEBPACK_IMPORTED_MODULE_9__/* .shortName */ .E)undefined5470854711(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined5471354721_components_PlanBadge__WEBPACK_IMPORTED_MODULE_7__/* .PlanBadge */ .dundefined5500955012(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined5541955422(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined5592855931(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined5646556469(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined5668856692(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined5693256942(0,_lib_taskLocale__WEBPACK_IMPORTED_MODULE_8__/* .formatPrice */ .$g)undefined5720257205(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined5793757941(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined5816158164(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined5859558598(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined5932759330(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined5946259466(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined5963959643(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined5980659809(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined6000860011(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined6047860481(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined6109861102(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined6121561218(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined6150361506(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined6189761901(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined6206062063(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined6206562068(next_link__WEBPACK_IMPORTED_MODULE_2___default())undefined6245062453(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined6269762715(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .dismissNotification */ .yk)undefined6344063444(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined6367363677(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined6387963882(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined6408064084(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined6418964192(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined6444964452(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined6477964783(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined6522765230(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined6560565608(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined6633366337(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined6651166514(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined6675166755(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined6675766765react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragmentundefined6686466868(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined6708267086(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined6731467317(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined6762267625(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined6805868062(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined6828168285(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined6852568535(0,_lib_taskLocale__WEBPACK_IMPORTED_MODULE_8__/* .formatPrice */ .$g)undefined6879768800(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined6962269625(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined6978969793(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined7029370296(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined7074370746(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined7156371567(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined7176971773(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined7202572028(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined7247372476(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined7288272885(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined7345973463(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined7367273675(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined7412574128(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined7413074133(next_link__WEBPACK_IMPORTED_MODULE_2___default())undefined7498074984(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined7515875161(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined7540775410(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined7560175605(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined7576675770(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined7628376286(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined7662776631(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined7717777180(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined7743877441(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined7775677759(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined7807578078(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined7824878252(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined7841578419(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined7862778630(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined7886578868(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined7909879101(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined7947479477(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined7990979913(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined8012180125(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined8023880242(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined8068480687(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined8161081614(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined8172781731(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined8217982182(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined8306883072(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined8325883262(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined8339183394(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined8371983722(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined8468984692(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined8484984853(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined8509385096(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined8583485837(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined8635886362(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined8647586478(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined8677386776(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined8752787531(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined8764487647(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined8794487947(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined8870088704(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined8889088894(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined8902389026(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined8936189364(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined9020390207(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined9033690339(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined9067290675(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined9151091514(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined9164391646(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined9197891981(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined9289192895(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined9300893011(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined9331093313(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined9409094094(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined9420794210(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined9451194515(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined9516195164(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined9544395446(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined9587395877(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined9605696059(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined9658096583(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined /***/ }) ÕÇž/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ TaskDetailClient) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(9664); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(next_link__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(7541); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(1592); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(9906); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(2982); /* harmony import */ var _lib_taskLocale__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(4017); /* harmony import */ var _lib_formatName__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(1258); /* harmony import */ var _components_PlanBadge__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(2035); /* __next_internal_client_entry_do_not_use__ default auto */ const statusColors = { open: 'bg-green-100 text-green-700', in_progress: 'bg-green-100 text-green-700', completed: 'bg-gray-100 text-gray-700', cancelled: 'bg-red-100 text-red-700', draft: 'bg-yellow-100 text-yellow-700' }; function TaskDetailClient(param) { let { taskId, initialTask, initialCustomer, catMap = {}, locMap = {} } = param; var _session_user, _acceptedOffer_specialist; const { data: session } = (0,_lib_auth__WEBPACK_IMPORTED_MODULE_4__/* .useSession */ .wV)(); const { t, locale } = (0,_context_locale__WEBPACK_IMPORTED_MODULE_5__/* .useLocale */ .Y)(); const router = (0,next_navigation__WEBPACK_IMPORTED_MODULE_3__.useRouter)(); const [task, setTask] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(initialTask); const [customer] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(initialCustomer); const [offers, setOffers] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [offersLoaded, setOffersLoaded] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [myOffer, setMyOffer] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [myOfferLoaded, setMyOfferLoaded] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [myReview, setMyReview] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [myReviewLoaded, setMyReviewLoaded] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [reviewTargetId, setReviewTargetId] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [reviewRating, setReviewRating] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(5); const [reviewComment, setReviewComment] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [reviewSubmitting, setReviewSubmitting] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [reviewDone, setReviewDone] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [invite, setInvite] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [inviteLoaded, setInviteLoaded] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [inviteDeclining, setInviteDeclining] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [msgLoading, setMsgLoading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [lightboxIndex, setLightboxIndex] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); // FOMO stats + auto-match const [taskStats, setTaskStats] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [autoMatchResults, setAutoMatchResults] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [autoMatchLoading, setAutoMatchLoading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [hasAutoMatch, setHasAutoMatch] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); // Edit task state const [editing, setEditing] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [editSaving, setEditSaving] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [editForm, setEditForm] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); // Keyboard navigation for lightbox (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ const handler = (e)=>{ if (e.key === 'Escape') setLightboxIndex(null); if (e.key === 'ArrowLeft') setLightboxIndex((prev)=>prev !== null && prev > 0 ? prev - 1 : prev); if (e.key === 'ArrowRight') setLightboxIndex((prev)=>{ if (prev === null) return prev; const imgs = task.images; return imgs && prev < imgs.length - 1 ? prev + 1 : prev; }); }; window.addEventListener('keydown', handler); return ()=>window.removeEventListener('keydown', handler); }, [ task.images ]); const dateLocale = locale === 'ru' ? 'ru-RU' : locale === 'uk' ? 'uk-UA' : locale === 'en' ? 'en-US' : 'el-GR'; const currentUserId = session === null || session === void 0 ? void 0 : (_session_user = session.user) === null || _session_user === void 0 ? void 0 : _session_user.id; const isOwner = currentUserId === task.customerId; const loginRedirectHref = "/login?redirect=".concat(encodeURIComponent("/tasks/".concat(taskId))); // Load offers if owner (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!isOwner || offersLoaded) return; (0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getOffers */ .Sw)(taskId).then((data)=>{ setOffers(data); setOffersLoaded(true); }).catch(()=>setOffersLoaded(true)); }, [ isOwner, taskId, offersLoaded ]); // Load task stats + dashboard features for owner (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!isOwner) return; (0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getTaskStats */ .vh)(taskId).then(setTaskStats).catch(()=>{}); (0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getMyDashboard */ .H)().then((d)=>{ var _d_features; return setHasAutoMatch(!!((_d_features = d.features) === null || _d_features === void 0 ? void 0 : _d_features.hasAutoMatch)); }).catch(()=>{}); }, [ isOwner, taskId ]); // Load specialist's own offer (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!currentUserId || isOwner || myOfferLoaded) return; (0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getMyOffers */ .aT)().then((rows)=>{ const found = rows.find((r)=>{ var _r_task; return ((_r_task = r.task) === null || _r_task === void 0 ? void 0 : _r_task.id) === taskId; }); var _found_offer; setMyOffer((_found_offer = found === null || found === void 0 ? void 0 : found.offer) !== null && _found_offer !== void 0 ? _found_offer : null); setMyOfferLoaded(true); }).catch(()=>setMyOfferLoaded(true)); }, [ currentUserId, isOwner, taskId, myOfferLoaded ]); // Load task invite for specialist (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!currentUserId || isOwner || inviteLoaded) return; (0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getTaskInvite */ .F9)(taskId).then((rows)=>{ var _rows_; setInvite((_rows_ = rows[0]) !== null && _rows_ !== void 0 ? _rows_ : null); setInviteLoaded(true); }).catch(()=>setInviteLoaded(true)); }, [ currentUserId, isOwner, taskId, inviteLoaded ]); // Load review for specialist when task completed (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!currentUserId || isOwner || myReviewLoaded || task.status !== 'completed') return; (0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getTaskReviews */ .H6)(taskId).then((rows)=>{ const found = rows.find((r)=>r.targetId === currentUserId); setMyReview(found !== null && found !== void 0 ? found : null); setMyReviewLoaded(true); }).catch(()=>setMyReviewLoaded(true)); }, [ currentUserId, isOwner, taskId, task.status, myReviewLoaded ]); async function handleAccept(offerId) { const updated = await (0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .acceptOffer */ .$H)(offerId).catch(()=>null); if (updated) { setOffers((prev)=>prev.map((r)=>r.offer.id === offerId ? { ...r, offer: updated } : r)); setTask((t)=>({ ...t, status: 'in_progress' })); } } async function handleDecline(offerId) { const updated = await (0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .declineOffer */ .Lb)(offerId).catch(()=>null); if (updated) { setOffers((prev)=>prev.map((r)=>r.offer.id === offerId ? { ...r, offer: updated } : r)); } } async function handleComplete() { if (!window.confirm(t('task.complete.confirm'))) return; const updated = await (0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .completeTask */ .Rt)(taskId).catch(()=>null); if (updated) setTask((t)=>({ ...t, status: 'completed' })); } async function handleReview(e) { e.preventDefault(); if (!reviewTargetId) return; setReviewSubmitting(true); const ok = await (0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .createReview */ .bx)({ taskId, targetId: reviewTargetId, rating: reviewRating, comment: reviewComment || undefined }).catch(()=>null); setReviewSubmitting(false); if (ok) { setReviewDone(true); setReviewTargetId(null); } } async function handleMessage(otherUserId) { setMsgLoading(true); try { const { room } = await (0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getOrCreateDirectRoom */ .QN)(otherUserId); router.push("/chat?room=".concat(room.id)); } catch (e) {} setMsgLoading(false); } function handleEditOpen() { var _task_budgetNegotiable, _task_category, _task_location, _task_district, _task_street, _task_houseNumber, _task_timeSlot, _task_confidentialNote; setEditForm({ title: task.title, description: task.description, budget: task.budget ? Number(task.budget) : '', budgetNegotiable: (_task_budgetNegotiable = task.budgetNegotiable) !== null && _task_budgetNegotiable !== void 0 ? _task_budgetNegotiable : false, category: (_task_category = task.category) !== null && _task_category !== void 0 ? _task_category : '', location: (_task_location = task.location) !== null && _task_location !== void 0 ? _task_location : '', district: (_task_district = task.district) !== null && _task_district !== void 0 ? _task_district : '', street: (_task_street = task.street) !== null && _task_street !== void 0 ? _task_street : '', houseNumber: (_task_houseNumber = task.houseNumber) !== null && _task_houseNumber !== void 0 ? _task_houseNumber : '', timeSlot: (_task_timeSlot = task.timeSlot) !== null && _task_timeSlot !== void 0 ? _task_timeSlot : '', confidentialNote: (_task_confidentialNote = task.confidentialNote) !== null && _task_confidentialNote !== void 0 ? _task_confidentialNote : '', deadline: task.deadline ? new Date(task.deadline).toISOString().slice(0, 10) : '', expiresAt: task.expiresAt ? new Date(task.expiresAt).toISOString().slice(0, 10) : '', status: task.status === 'draft' ? 'draft' : 'open' }); setEditing(true); } async function handleEditSave(e) { e.preventDefault(); if (!editForm) return; setEditSaving(true); try { const payload = { title: editForm.title, description: editForm.description, budgetNegotiable: editForm.budgetNegotiable, status: editForm.status }; if (editForm.budget !== '' && editForm.budget > 0) payload.budget = Number(editForm.budget); if (editForm.category) payload.category = editForm.category; if (editForm.location) payload.location = editForm.location; if (editForm.district) payload.district = editForm.district; if (editForm.street) payload.street = editForm.street; if (editForm.houseNumber) payload.houseNumber = editForm.houseNumber; if (editForm.timeSlot) payload.timeSlot = editForm.timeSlot; if (editForm.confidentialNote !== undefined) payload.confidentialNote = editForm.confidentialNote; if (editForm.deadline) payload.deadline = new Date(editForm.deadline).toISOString(); if (editForm.expiresAt) payload.expiresAt = new Date(editForm.expiresAt).toISOString(); const updated = await (0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updateTask */ .lC)(taskId, payload); setTask((prev)=>({ ...prev, ...updated })); setEditing(false); } catch (err) { alert((err === null || err === void 0 ? void 0 : err.message) || t('common.error')); } finally{ setEditSaving(false); } } const acceptedOffer = offers.find((r)=>r.offer.status === 'accepted'); var _catMap_task_category, _locMap_task_location; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "max-w-4xl mx-auto px-4 py-8", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-6 mb-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex justify-between items-start gap-4 mb-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex flex-wrap items-center gap-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-xs font-medium px-2 py-1 rounded-full ".concat(statusColors[task.status]), children: t("task.status.".concat(task.status), task.status) }), task.category && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-xs font-medium text-green-600 bg-green-50 px-2 py-1 rounded-full", children: (_catMap_task_category = catMap[task.category]) !== null && _catMap_task_category !== void 0 ? _catMap_task_category : task.category }), isOwner && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-xs text-gray-400 bg-gray-100 px-2 py-1 rounded-full", children: t('task.yours') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-2 shrink-0", children: [ isOwner && (task.status === 'draft' || task.status === 'open') && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { onClick: handleEditOpen, className: "flex items-center gap-1.5 text-xs font-medium text-green-600 bg-green-50 hover:bg-green-100 px-3 py-1.5 rounded-lg transition", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M16.862 4.487l1.687-1.688a1.875 1.875 0 112.652 2.652L10.582 16.07a4.5 4.5 0 01-1.897 1.13L6 18l.8-2.685a4.5 4.5 0 011.13-1.897l8.932-8.931zm0 0L19.5 7.125" }) }), t('task.edit') ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-gray-400", children: new Date(task.createdAt).toLocaleDateString(dateLocale) }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h1", { className: "text-2xl font-bold text-gray-900 mb-4", children: (0,_lib_taskLocale__WEBPACK_IMPORTED_MODULE_8__/* .taskTitle */ .Oj)(task, locale) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-gray-700 whitespace-pre-wrap mb-6", children: (0,_lib_taskLocale__WEBPACK_IMPORTED_MODULE_8__/* .taskDescription */ .GZ)(task, locale) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "grid grid-cols-2 md:grid-cols-4 gap-4 p-4 bg-gray-50 rounded-lg", children: [ task.budget && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-500", children: t('task.budget') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { className: "font-bold text-green-600 text-lg", children: [ task.budget, "€" ] }), task.budgetNegotiable && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-green-600 mt-0.5", children: t('task.budget_negotiable') }) ] }), !task.budget && task.budgetNegotiable && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-500", children: t('task.budget') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "font-medium text-green-600", children: t('task.budget_negotiable') }) ] }), task.location && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-500", children: t('task.location') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { className: "font-medium", children: [ "\uD83D\uDCCD ", (_locMap_task_location = locMap[task.location]) !== null && _locMap_task_location !== void 0 ? _locMap_task_location : task.location ] }) ] }), task.deadline && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-500", children: t('task.deadline') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "font-medium", children: new Date(task.deadline).toLocaleDateString(dateLocale) }), task.timeSlot && task.timeSlot !== '' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-500 mt-0.5", children: t("create.field.time_slot.".concat(task.timeSlot), task.timeSlot) }) ] }), !task.deadline && task.timeSlot && task.timeSlot !== '' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-500", children: t('task.time_slot') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "font-medium", children: t("create.field.time_slot.".concat(task.timeSlot), task.timeSlot) }) ] }), task.expiresAt && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-500", children: t('task.expires_at') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "font-medium", children: new Date(task.expiresAt).toLocaleDateString(dateLocale) }) ] }), customer && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-500", children: t('task.customer') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)((next_link__WEBPACK_IMPORTED_MODULE_2___default()), { href: "/users/".concat(customer.id), className: "flex items-center gap-2 mt-1 group", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "w-8 h-8 rounded-full overflow-hidden bg-green-100 shrink-0 flex items-center justify-center", children: customer.image ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: customer.image, alt: (0,_lib_formatName__WEBPACK_IMPORTED_MODULE_9__/* .shortName */ .E)(customer.name), className: "w-full h-full object-cover" }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-green-600 font-semibold text-xs", children: (0,_lib_formatName__WEBPACK_IMPORTED_MODULE_9__/* .shortName */ .E)(customer.name).charAt(0).toUpperCase() }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "font-medium text-gray-900 group-hover:text-green-600 leading-none", children: (0,_lib_formatName__WEBPACK_IMPORTED_MODULE_9__/* .shortName */ .E)(customer.name) }), customer.rating && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { className: "text-xs text-yellow-500 leading-none mt-0.5", children: [ "★ ", Number(customer.rating).toFixed(1) ] }) ] }) ] }) ] }) ] }), task.images && task.images.length > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "mt-4", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex flex-wrap gap-2", children: task.images.map((url, i)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>setLightboxIndex(i), className: "block w-24 h-24 rounded-lg overflow-hidden border border-gray-200 hover:opacity-90 hover:border-green-300 transition", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: url, alt: "", className: "w-full h-full object-cover" }) }, i)) }) }), lightboxIndex !== null && task.images && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "fixed inset-0 z-50 flex items-center justify-center bg-black/85", onClick: ()=>setLightboxIndex(null), children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "relative max-w-4xl w-full mx-4", onClick: (e)=>e.stopPropagation(), children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: task.images[lightboxIndex], alt: "", className: "w-full max-h-[80vh] object-contain rounded-lg" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>setLightboxIndex(null), className: "absolute -top-10 right-0 text-white/80 hover:text-white p-2", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-6 h-6", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" }) }) }), lightboxIndex > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>setLightboxIndex(lightboxIndex - 1), className: "absolute left-0 top-1/2 -translate-y-1/2 -translate-x-12 text-white/80 hover:text-white p-2", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-8 h-8", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 19l-7-7 7-7" }) }) }), lightboxIndex < task.images.length - 1 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>setLightboxIndex(lightboxIndex + 1), className: "absolute right-0 top-1/2 -translate-y-1/2 translate-x-12 text-white/80 hover:text-white p-2", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-8 h-8", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 5l7 7-7 7" }) }) }), task.images.length > 1 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { className: "text-white/60 text-sm text-center mt-3", children: [ lightboxIndex + 1, " / ", task.images.length ] }) ] }) }), (isOwner || (myOffer === null || myOffer === void 0 ? void 0 : myOffer.status) === 'accepted') && (task.district || task.street || task.confidentialNote) && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "mt-4 p-3 bg-yellow-50 border border-yellow-200 rounded-lg space-y-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { className: "text-xs font-medium text-yellow-700 flex items-center gap-1", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z" }) }), t('task.confidential') ] }), (task.district || task.street) && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { className: "text-sm text-yellow-800", children: [ "\uD83D\uDCCD ", [ task.district, task.street, task.houseNumber ].filter(Boolean).join(', ') ] }), task.confidentialNote && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-yellow-800", children: task.confidentialNote }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "mt-6 flex flex-wrap gap-3", children: [ !session && !isOwner && task.status === 'open' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)((next_link__WEBPACK_IMPORTED_MODULE_2___default()), { href: loginRedirectHref, className: "bg-green-600 text-white px-6 py-3 rounded-xl font-semibold hover:bg-green-700", children: t('task.make_offer', 'Send offer') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)((next_link__WEBPACK_IMPORTED_MODULE_2___default()), { href: loginRedirectHref, className: "flex items-center gap-2 bg-green-50 text-green-600 border border-green-200 px-4 py-2.5 rounded-xl font-medium hover:bg-green-100", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }), t('chat.write_customer', 'Write to customer') ] }) ] }), isOwner && task.status === 'in_progress' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: handleComplete, className: "bg-green-600 text-white px-6 py-3 rounded-xl font-semibold hover:bg-green-700", children: t('task.complete') }), isOwner && (acceptedOffer === null || acceptedOffer === void 0 ? void 0 : (_acceptedOffer_specialist = acceptedOffer.specialist) === null || _acceptedOffer_specialist === void 0 ? void 0 : _acceptedOffer_specialist.id) && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { onClick: ()=>handleMessage(acceptedOffer.specialist.id), disabled: msgLoading, className: "flex items-center gap-2 bg-green-50 text-green-600 border border-green-200 px-4 py-2.5 rounded-xl font-medium hover:bg-green-100 disabled:opacity-50", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }), t('chat.write_specialist') ] }), isOwner && task.status === 'completed' && acceptedOffer && !reviewDone && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>{ var _acceptedOffer_specialist; var _acceptedOffer_specialist_id; return setReviewTargetId((_acceptedOffer_specialist_id = (_acceptedOffer_specialist = acceptedOffer.specialist) === null || _acceptedOffer_specialist === void 0 ? void 0 : _acceptedOffer_specialist.id) !== null && _acceptedOffer_specialist_id !== void 0 ? _acceptedOffer_specialist_id : null); }, className: "bg-yellow-500 text-white px-6 py-3 rounded-xl font-semibold hover:bg-yellow-600", children: t('review.leave') }), reviewDone && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-green-600 font-medium py-3", children: t('review.done') }) ] }), reviewTargetId && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("form", { onSubmit: handleReview, className: "mt-6 border-t border-gray-100 pt-6 space-y-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h3", { className: "font-semibold text-gray-800", children: t('review.leave') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm font-medium text-gray-700 mb-2", children: t('review.rating') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex gap-1", children: [ 1, 2, 3, 4, 5 ].map((star)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>setReviewRating(star), className: "text-2xl transition ".concat(star <= reviewRating ? 'text-yellow-400' : 'text-gray-300'), children: "★" }, star)) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('review.comment') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("textarea", { value: reviewComment, onChange: (e)=>setReviewComment(e.target.value), rows: 3, maxLength: 2000, placeholder: t('review.comment.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" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "submit", disabled: reviewSubmitting, className: "bg-green-600 text-white px-5 py-2 rounded-xl font-semibold hover:bg-green-700 disabled:opacity-50", children: reviewSubmitting ? t('review.submitting') : t('review.submit') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>setReviewTargetId(null), className: "px-5 py-2 rounded-xl border border-gray-200 text-gray-600 hover:bg-gray-50", children: t('common.cancel') }) ] }) ] }) ] }), isOwner && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-between mb-4 flex-wrap gap-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("h2", { className: "text-lg font-bold text-gray-900", children: [ t('task.offers'), " (", offers.length, ")" ] }), taskStats && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-3 text-xs text-gray-500", children: [ taskStats.totalViews > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "flex items-center gap-1", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 12a3 3 0 11-6 0 3 3 0 016 0z" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z" }) ] }), taskStats.totalViews ] }), taskStats.offerCount > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "font-medium text-green-600", children: [ "⚡ ", taskStats.offerCount, " ", t('task.offers').toLowerCase() ] }) ] }), hasAutoMatch && task.status === 'open' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { onClick: async ()=>{ setAutoMatchLoading(true); try { const res = await (0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .runAutoMatch */ .OV)(taskId); var _res_matches; setAutoMatchResults((_res_matches = res.matches) !== null && _res_matches !== void 0 ? _res_matches : []); } catch (e) {} finally{ setAutoMatchLoading(false); } }, disabled: autoMatchLoading, className: "flex items-center gap-1.5 text-xs font-medium bg-purple-50 text-purple-700 border border-purple-200 px-3 py-1.5 rounded-lg hover:bg-purple-100 transition disabled:opacity-50", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M13 10V3L4 14h7v7l9-11h-7z" }) }), autoMatchLoading ? t('common.loading') : t('task.auto_match', 'Auto match') ] }) ] }), autoMatchResults && autoMatchResults.length > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "mb-4 p-3 bg-purple-50 rounded-xl border border-purple-100", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs font-medium text-purple-700 mb-2", children: t('task.auto_match_results', 'Top specialists') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "space-y-2", children: autoMatchResults.slice(0, 5).map((s)=>{ var _s_name_, _s_name; var _s_firstName; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-between gap-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "w-7 h-7 rounded-full bg-purple-100 flex items-center justify-center text-purple-700 text-xs font-bold overflow-hidden", children: s.image ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: s.image, alt: "", className: "w-full h-full object-cover" }) : (_s_name = s.name) === null || _s_name === void 0 ? void 0 : (_s_name_ = _s_name[0]) === null || _s_name_ === void 0 ? void 0 : _s_name_.toUpperCase() }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-sm text-gray-800", children: (_s_firstName = s.firstName) !== null && _s_firstName !== void 0 ? _s_firstName : s.name }), s.rating && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "text-xs text-yellow-500", children: [ "★", Number(s.rating).toFixed(1) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>handleMessage(s.id), className: "text-xs text-green-600 hover:underline", children: t('chat.write_btn') }) ] }, s.id); }) }) ] }), !offersLoaded ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-gray-400 text-sm", children: t('common.loading') }) : offers.length === 0 ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-gray-500 text-sm", children: t('task.offers.none') }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "space-y-4", children: offers.map((row)=>{ var _specialist_name_, _specialist_name; const offer = row.offer; const specialist = row.specialist; var _specialist_name__toUpperCase; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "border border-gray-100 rounded-xl p-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex justify-between items-start gap-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-start gap-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "w-10 h-10 rounded-full bg-green-100 flex-shrink-0 flex items-center justify-center text-green-700 font-bold overflow-hidden", children: (specialist === null || specialist === void 0 ? void 0 : specialist.image) ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: specialist.image, alt: specialist.name, className: "w-full h-full object-cover" }) : (_specialist_name__toUpperCase = specialist === null || specialist === void 0 ? void 0 : (_specialist_name = specialist.name) === null || _specialist_name === void 0 ? void 0 : (_specialist_name_ = _specialist_name[0]) === null || _specialist_name_ === void 0 ? void 0 : _specialist_name_.toUpperCase()) !== null && _specialist_name__toUpperCase !== void 0 ? _specialist_name__toUpperCase : '?' }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ specialist && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-1.5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)((next_link__WEBPACK_IMPORTED_MODULE_2___default()), { href: "/users/".concat(specialist.id), className: "font-medium text-gray-900 hover:text-green-600", children: (0,_lib_formatName__WEBPACK_IMPORTED_MODULE_9__/* .shortName */ .E)(specialist.name) }), specialist.planTier && specialist.planTier !== 'free' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components_PlanBadge__WEBPACK_IMPORTED_MODULE_7__/* .PlanBadge */ .d, { tier: specialist.planTier }), specialist.hasVerifiedBadge && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3.5 h-3.5 text-gray-500", viewBox: "0 0 24 24", fill: "currentColor", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z" }) }) ] }), offer.message && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-gray-600 mt-1", children: offer.message }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "text-right shrink-0", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { className: "text-lg font-bold text-green-600", children: [ (0,_lib_taskLocale__WEBPACK_IMPORTED_MODULE_8__/* .formatPrice */ .$g)(offer.price), "€" ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-xs px-2 py-0.5 rounded-full ".concat(offer.status === 'accepted' ? 'bg-green-100 text-green-700' : offer.status === 'declined' ? 'bg-red-100 text-red-700' : 'bg-gray-100 text-gray-700'), children: t("offer.status.".concat(offer.status), offer.status) }) ] }) ] }), offer.status === 'pending' && task.status === 'open' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-2 mt-3 pt-3 border-t border-gray-50", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>handleAccept(offer.id), className: "flex-1 bg-green-600 text-white py-2 rounded-lg text-sm font-semibold hover:bg-green-700", children: t('offer.accept') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>handleDecline(offer.id), className: "flex-1 bg-gray-100 text-gray-700 py-2 rounded-lg text-sm font-semibold hover:bg-gray-200", children: t('offer.decline') }) ] }) ] }, offer.id); }) }) ] }), !isOwner && session && invite && inviteLoaded && task.status === 'open' && !myOffer && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "rounded-xl border border-green-200 bg-green-50 p-5", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-between gap-4 flex-wrap gap-y-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "w-10 h-10 rounded-full bg-green-100 flex items-center justify-center shrink-0", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", strokeWidth: 1.5, stroke: "currentColor", className: "w-5 h-5 text-green-600", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M21.75 6.75v10.5a2.25 2.25 0 0 1-2.25 2.25h-15a2.25 2.25 0 0 1-2.25-2.25V6.75m19.5 0A2.25 2.25 0 0 0 19.5 4.5h-15a2.25 2.25 0 0 0-2.25 2.25m19.5 0v.243a2.25 2.25 0 0 1-1.07 1.916l-7.5 4.615a2.25 2.25 0 0 1-2.36 0L3.32 8.91a2.25 2.25 0 0 1-1.07-1.916V6.75" }) }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "font-semibold text-gray-900 text-sm", children: t('task.invite.banner_title') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-gray-500 text-sm mt-0.5", children: t('task.invite.banner_hint') }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-2 shrink-0", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)((next_link__WEBPACK_IMPORTED_MODULE_2___default()), { href: "/tasks/".concat(taskId, "/offer"), className: "bg-green-600 text-white px-4 py-2 rounded-lg text-sm font-semibold hover:bg-green-700 transition", children: t('task.invite.accept') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: async ()=>{ if (!invite) return; setInviteDeclining(true); await (0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .dismissNotification */ .yk)(invite.id).catch(()=>{}); setInvite(null); setInviteDeclining(false); }, disabled: inviteDeclining, className: "border border-gray-300 bg-white text-gray-600 px-4 py-2 rounded-lg text-sm font-medium hover:bg-gray-50 disabled:opacity-50 transition", children: t('task.invite.decline') }) ] }) ] }) }), !isOwner && session && myOfferLoaded && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-4", children: [ task.status === 'completed' && (myOffer === null || myOffer === void 0 ? void 0 : myOffer.status) === 'accepted' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-green-50 border border-green-200 rounded-xl p-5 flex items-center gap-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-3xl", children: "\uD83C\uDF89" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "font-bold text-green-800 text-lg", children: "ЗаЎаМОе завершеМП!" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-green-700 text-sm", children: "ЗаказчОк ПтЌетОл заЎаМОе как выпПлМеММПе." }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { onClick: ()=>handleMessage(task.customerId), disabled: msgLoading, className: "ml-auto flex items-center gap-2 bg-white text-green-600 border border-green-200 px-4 py-2 rounded-xl text-sm font-medium hover:bg-green-50 disabled:opacity-50", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }), t('chat.write_customer') ] }) ] }), (myOffer || task.status === 'open' && !invite || task.status !== 'open') && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "text-lg font-bold text-gray-900 mb-4", children: "МПё преЎлПжеМОе" }), myOffer ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-start justify-between gap-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-1", children: [ myOffer.message && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-gray-600", children: myOffer.message }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400", children: new Date(myOffer.createdAt).toLocaleString(dateLocale) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "text-right shrink-0", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { className: "text-xl font-bold text-green-600", children: [ (0,_lib_taskLocale__WEBPACK_IMPORTED_MODULE_8__/* .formatPrice */ .$g)(myOffer.price), "€" ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-xs px-2 py-0.5 rounded-full font-medium ".concat(myOffer.status === 'accepted' ? 'bg-green-100 text-green-700' : myOffer.status === 'declined' ? 'bg-red-100 text-red-700' : 'bg-yellow-100 text-yellow-700'), children: myOffer.status === 'accepted' ? '✓ ПрОМятП' : myOffer.status === 'declined' ? '✗ ОтклПМеМП' : '⏳ На рассЌПтреМОО' }) ] }) ] }), myOffer.status === 'accepted' && task.status === 'in_progress' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "mt-3 pt-3 border-t border-gray-100", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { onClick: ()=>handleMessage(task.customerId), disabled: msgLoading, className: "flex items-center gap-2 bg-green-50 text-green-600 border border-green-200 px-4 py-2 rounded-xl text-sm font-medium hover:bg-green-100 disabled:opacity-50", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }), t('chat.write_customer') ] }) }) ] }) : task.status === 'open' && !invite ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-3", children: [ taskStats && taskStats.offerCount > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-2 p-2.5 bg-amber-50 rounded-lg border border-amber-100", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 text-amber-500 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M13 10V3L4 14h7v7l9-11h-7z" }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-amber-700", children: t('fomo.already_offered', '\u0423\u0436\u0435 {n} \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0441\u0442\u043e\u0432 \u043e\u0442\u043a\u043b\u0438\u043a\u043d\u0443\u043b\u0438\u0441\u044c').replace('{n}', String(taskStats.offerCount)) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-between", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-gray-500", children: t('task.no_offer_yet', '\u0412\u044b \u0435\u0449\u0451 \u043d\u0435 \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u043b\u0438 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u0435') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)((next_link__WEBPACK_IMPORTED_MODULE_2___default()), { href: "/tasks/".concat(taskId, "/offer"), className: "bg-green-600 text-white px-4 py-2 rounded-lg text-sm font-semibold hover:bg-green-700", children: t('task.make_offer', '\u041e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u0435') }) ] }) ] }) : null ] }), task.status === 'completed' && (myOffer === null || myOffer === void 0 ? void 0 : myOffer.status) === 'accepted' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "text-lg font-bold text-gray-900 mb-4", children: "ОцеМка заказчОка" }), !myReviewLoaded ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-gray-400", children: "Загрузка..." }) : myReview ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-1", children: [ [ 1, 2, 3, 4, 5 ].map((star)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-2xl ".concat(star <= myReview.rating ? 'text-yellow-400' : 'text-gray-200'), children: "★" }, star)), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "ml-2 text-lg font-bold text-gray-800", children: [ myReview.rating, "/5" ] }) ] }), myReview.comment && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-gray-700 text-sm leading-relaxed", children: myReview.comment }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400", children: new Date(myReview.createdAt).toLocaleDateString(dateLocale) }) ] }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-gray-500", children: "ЗаказчОк ещё Ме ПставОл ПцеМку." }) ] }) ] }), editing && editForm && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "fixed inset-0 z-50 flex items-start justify-center bg-black/50 overflow-y-auto py-8 px-4", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-2xl w-full max-w-2xl shadow-xl", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-between px-6 py-4 border-b border-gray-100", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "text-lg font-bold text-gray-900", children: t('task.edit') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>setEditing(false), className: "text-gray-400 hover:text-gray-600 p-1", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-5 h-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" }) }) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("form", { onSubmit: handleEditSave, className: "p-6 space-y-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: [ t('create.field.title'), " *" ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "text", required: true, minLength: 5, maxLength: 200, value: editForm.title, onChange: (e)=>setEditForm((p)=>({ ...p, title: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: [ t('create.field.description'), " *" ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("textarea", { required: true, minLength: 20, value: editForm.description, onChange: (e)=>setEditForm((p)=>({ ...p, description: e.target.value })), rows: 4, 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" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "grid grid-cols-2 gap-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('create.field.budget') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "number", min: 1, value: editForm.budget, onChange: (e)=>setEditForm((p)=>({ ...p, budget: e.target.value })), placeholder: "€", className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex items-end pb-2", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "flex items-center gap-2 cursor-pointer", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "checkbox", checked: editForm.budgetNegotiable, onChange: (e)=>setEditForm((p)=>({ ...p, budgetNegotiable: e.target.checked })), className: "w-4 h-4 rounded text-green-600" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-sm text-gray-700", children: t('create.field.budget_negotiable') }) ] }) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('create.field.deadline') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "date", value: editForm.deadline, onChange: (e)=>setEditForm((p)=>({ ...p, deadline: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('create.field.expires_at') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "date", value: editForm.expiresAt, onChange: (e)=>setEditForm((p)=>({ ...p, expiresAt: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "grid grid-cols-3 gap-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('create.field.address.district') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "text", value: editForm.district, onChange: (e)=>setEditForm((p)=>({ ...p, district: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('create.field.address.street') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "text", value: editForm.street, onChange: (e)=>setEditForm((p)=>({ ...p, street: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('create.field.address.house') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "text", value: editForm.houseNumber, onChange: (e)=>setEditForm((p)=>({ ...p, houseNumber: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('create.field.confidential') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("textarea", { value: editForm.confidentialNote, onChange: (e)=>setEditForm((p)=>({ ...p, confidentialNote: e.target.value })), rows: 2, 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" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('task.status_label', 'Status') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("select", { value: editForm.status, onChange: (e)=>setEditForm((p)=>({ ...p, status: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "open", children: t('task.status.open') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "draft", children: t('task.status.draft') }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-3 pt-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "submit", disabled: editSaving, className: "flex-1 bg-green-600 text-white py-2.5 rounded-xl font-semibold hover:bg-green-700 disabled:opacity-50 transition", children: editSaving ? t('common.saving', '...') : t('common.save') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>setEditing(false), className: "px-6 py-2.5 rounded-xl border border-gray-200 text-gray-600 hover:bg-gray-50 transition", children: t('common.cancel') }) ] }) ] }) ] }) }) ] }); } /***/ }) ÖÙ  ÚÛÚ/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ TaskDetailClient) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(9664); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(next_link__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(7541); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(1592); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(9906); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(2982); /* harmony import */ var _lib_taskLocale__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(4017); /* harmony import */ var _lib_formatName__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(1258); /* harmony import */ var _components_PlanBadge__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(2035); ÜZ|/* __next_internal_client_entry_do_not_use__ default auto */ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime"; import { useState, useEffect } from 'react'; import Link from 'next/link'; import { useRouter } from 'next/navigation'; import { useSession } from '@/lib/auth'; import { useLocale } from '@/context/locale'; import { getOffers, acceptOffer, declineOffer, completeTask, createReview, getMyOffers, getTaskReviews, getTaskInvite, dismissNotification, getOrCreateDirectRoom, updateTask, getTaskStats, runAutoMatch, getMyDashboard } from '@/lib/api'; import { taskTitle, taskDescription, formatPrice } from '@/lib/taskLocale'; import { shortName } from '@/lib/formatName'; import { PlanBadge } from '@/components/PlanBadge'; const statusColors = { open: 'bg-green-100 text-green-700', in_progress: 'bg-green-100 text-green-700', completed: 'bg-gray-100 text-gray-700', cancelled: 'bg-red-100 text-red-700', draft: 'bg-yellow-100 text-yellow-700' }; export default function TaskDetailClient(param) { let { taskId, initialTask, initialCustomer, catMap = {}, locMap = {} } = param; var _session_user, _acceptedOffer_specialist; const { data: session } = useSession(); const { t, locale } = useLocale(); const router = useRouter(); const [task, setTask] = useState(initialTask); const [customer] = useState(initialCustomer); const [offers, setOffers] = useState([]); const [offersLoaded, setOffersLoaded] = useState(false); const [myOffer, setMyOffer] = useState(null); const [myOfferLoaded, setMyOfferLoaded] = useState(false); const [myReview, setMyReview] = useState(null); const [myReviewLoaded, setMyReviewLoaded] = useState(false); const [reviewTargetId, setReviewTargetId] = useState(null); const [reviewRating, setReviewRating] = useState(5); const [reviewComment, setReviewComment] = useState(''); const [reviewSubmitting, setReviewSubmitting] = useState(false); const [reviewDone, setReviewDone] = useState(false); const [invite, setInvite] = useState(null); const [inviteLoaded, setInviteLoaded] = useState(false); const [inviteDeclining, setInviteDeclining] = useState(false); const [msgLoading, setMsgLoading] = useState(false); const [lightboxIndex, setLightboxIndex] = useState(null); // FOMO stats + auto-match const [taskStats, setTaskStats] = useState(null); const [autoMatchResults, setAutoMatchResults] = useState(null); const [autoMatchLoading, setAutoMatchLoading] = useState(false); const [hasAutoMatch, setHasAutoMatch] = useState(false); // Edit task state const [editing, setEditing] = useState(false); const [editSaving, setEditSaving] = useState(false); const [editForm, setEditForm] = useState(null); // Keyboard navigation for lightbox useEffect(()=>{ const handler = (e)=>{ if (e.key === 'Escape') setLightboxIndex(null); if (e.key === 'ArrowLeft') setLightboxIndex((prev)=>prev !== null && prev > 0 ? prev - 1 : prev); if (e.key === 'ArrowRight') setLightboxIndex((prev)=>{ if (prev === null) return prev; const imgs = task.images; return imgs && prev < imgs.length - 1 ? prev + 1 : prev; }); }; window.addEventListener('keydown', handler); return ()=>window.removeEventListener('keydown', handler); }, [ task.images ]); const dateLocale = locale === 'ru' ? 'ru-RU' : locale === 'uk' ? 'uk-UA' : locale === 'en' ? 'en-US' : 'el-GR'; const currentUserId = session === null || session === void 0 ? void 0 : (_session_user = session.user) === null || _session_user === void 0 ? void 0 : _session_user.id; const isOwner = currentUserId === task.customerId; const loginRedirectHref = "/login?redirect=".concat(encodeURIComponent("/tasks/".concat(taskId))); // Load offers if owner useEffect(()=>{ if (!isOwner || offersLoaded) return; getOffers(taskId).then((data)=>{ setOffers(data); setOffersLoaded(true); }).catch(()=>setOffersLoaded(true)); }, [ isOwner, taskId, offersLoaded ]); // Load task stats + dashboard features for owner useEffect(()=>{ if (!isOwner) return; getTaskStats(taskId).then(setTaskStats).catch(()=>{}); getMyDashboard().then((d)=>{ var _d_features; return setHasAutoMatch(!!((_d_features = d.features) === null || _d_features === void 0 ? void 0 : _d_features.hasAutoMatch)); }).catch(()=>{}); }, [ isOwner, taskId ]); // Load specialist's own offer useEffect(()=>{ if (!currentUserId || isOwner || myOfferLoaded) return; getMyOffers().then((rows)=>{ const found = rows.find((r)=>{ var _r_task; return ((_r_task = r.task) === null || _r_task === void 0 ? void 0 : _r_task.id) === taskId; }); var _found_offer; setMyOffer((_found_offer = found === null || found === void 0 ? void 0 : found.offer) !== null && _found_offer !== void 0 ? _found_offer : null); setMyOfferLoaded(true); }).catch(()=>setMyOfferLoaded(true)); }, [ currentUserId, isOwner, taskId, myOfferLoaded ]); // Load task invite for specialist useEffect(()=>{ if (!currentUserId || isOwner || inviteLoaded) return; getTaskInvite(taskId).then((rows)=>{ var _rows_; setInvite((_rows_ = rows[0]) !== null && _rows_ !== void 0 ? _rows_ : null); setInviteLoaded(true); }).catch(()=>setInviteLoaded(true)); }, [ currentUserId, isOwner, taskId, inviteLoaded ]); // Load review for specialist when task completed useEffect(()=>{ if (!currentUserId || isOwner || myReviewLoaded || task.status !== 'completed') return; getTaskReviews(taskId).then((rows)=>{ const found = rows.find((r)=>r.targetId === currentUserId); setMyReview(found !== null && found !== void 0 ? found : null); setMyReviewLoaded(true); }).catch(()=>setMyReviewLoaded(true)); }, [ currentUserId, isOwner, taskId, task.status, myReviewLoaded ]); async function handleAccept(offerId) { const updated = await acceptOffer(offerId).catch(()=>null); if (updated) { setOffers((prev)=>prev.map((r)=>r.offer.id === offerId ? { ...r, offer: updated } : r)); setTask((t)=>({ ...t, status: 'in_progress' })); } } async function handleDecline(offerId) { const updated = await declineOffer(offerId).catch(()=>null); if (updated) { setOffers((prev)=>prev.map((r)=>r.offer.id === offerId ? { ...r, offer: updated } : r)); } } async function handleComplete() { if (!window.confirm(t('task.complete.confirm'))) return; const updated = await completeTask(taskId).catch(()=>null); if (updated) setTask((t)=>({ ...t, status: 'completed' })); } async function handleReview(e) { e.preventDefault(); if (!reviewTargetId) return; setReviewSubmitting(true); const ok = await createReview({ taskId, targetId: reviewTargetId, rating: reviewRating, comment: reviewComment || undefined }).catch(()=>null); setReviewSubmitting(false); if (ok) { setReviewDone(true); setReviewTargetId(null); } } async function handleMessage(otherUserId) { setMsgLoading(true); try { const { room } = await getOrCreateDirectRoom(otherUserId); router.push("/chat?room=".concat(room.id)); } catch (e) {} setMsgLoading(false); } function handleEditOpen() { var _task_budgetNegotiable, _task_category, _task_location, _task_district, _task_street, _task_houseNumber, _task_timeSlot, _task_confidentialNote; setEditForm({ title: task.title, description: task.description, budget: task.budget ? Number(task.budget) : '', budgetNegotiable: (_task_budgetNegotiable = task.budgetNegotiable) !== null && _task_budgetNegotiable !== void 0 ? _task_budgetNegotiable : false, category: (_task_category = task.category) !== null && _task_category !== void 0 ? _task_category : '', location: (_task_location = task.location) !== null && _task_location !== void 0 ? _task_location : '', district: (_task_district = task.district) !== null && _task_district !== void 0 ? _task_district : '', street: (_task_street = task.street) !== null && _task_street !== void 0 ? _task_street : '', houseNumber: (_task_houseNumber = task.houseNumber) !== null && _task_houseNumber !== void 0 ? _task_houseNumber : '', timeSlot: (_task_timeSlot = task.timeSlot) !== null && _task_timeSlot !== void 0 ? _task_timeSlot : '', confidentialNote: (_task_confidentialNote = task.confidentialNote) !== null && _task_confidentialNote !== void 0 ? _task_confidentialNote : '', deadline: task.deadline ? new Date(task.deadline).toISOString().slice(0, 10) : '', expiresAt: task.expiresAt ? new Date(task.expiresAt).toISOString().slice(0, 10) : '', status: task.status === 'draft' ? 'draft' : 'open' }); setEditing(true); } async function handleEditSave(e) { e.preventDefault(); if (!editForm) return; setEditSaving(true); try { const payload = { title: editForm.title, description: editForm.description, budgetNegotiable: editForm.budgetNegotiable, status: editForm.status }; if (editForm.budget !== '' && editForm.budget > 0) payload.budget = Number(editForm.budget); if (editForm.category) payload.category = editForm.category; if (editForm.location) payload.location = editForm.location; if (editForm.district) payload.district = editForm.district; if (editForm.street) payload.street = editForm.street; if (editForm.houseNumber) payload.houseNumber = editForm.houseNumber; if (editForm.timeSlot) payload.timeSlot = editForm.timeSlot; if (editForm.confidentialNote !== undefined) payload.confidentialNote = editForm.confidentialNote; if (editForm.deadline) payload.deadline = new Date(editForm.deadline).toISOString(); if (editForm.expiresAt) payload.expiresAt = new Date(editForm.expiresAt).toISOString(); const updated = await updateTask(taskId, payload); setTask((prev)=>({ ...prev, ...updated })); setEditing(false); } catch (err) { alert((err === null || err === void 0 ? void 0 : err.message) || t('common.error')); } finally{ setEditSaving(false); } } const acceptedOffer = offers.find((r)=>r.offer.status === 'accepted'); var _catMap_task_category, _locMap_task_location; return /*#__PURE__*/ _jsxs("div", { className: "max-w-4xl mx-auto px-4 py-8", children: [ /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6 mb-6", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex justify-between items-start gap-4 mb-4", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [ /*#__PURE__*/ _jsx("span", { className: "text-xs font-medium px-2 py-1 rounded-full ".concat(statusColors[task.status]), children: t("task.status.".concat(task.status), task.status) }), task.category && /*#__PURE__*/ _jsx("span", { className: "text-xs font-medium text-green-600 bg-green-50 px-2 py-1 rounded-full", children: (_catMap_task_category = catMap[task.category]) !== null && _catMap_task_category !== void 0 ? _catMap_task_category : task.category }), isOwner && /*#__PURE__*/ _jsx("span", { className: "text-xs text-gray-400 bg-gray-100 px-2 py-1 rounded-full", children: t('task.yours') }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 shrink-0", children: [ isOwner && (task.status === 'draft' || task.status === 'open') && /*#__PURE__*/ _jsxs("button", { onClick: handleEditOpen, className: "flex items-center gap-1.5 text-xs font-medium text-green-600 bg-green-50 hover:bg-green-100 px-3 py-1.5 rounded-lg transition", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M16.862 4.487l1.687-1.688a1.875 1.875 0 112.652 2.652L10.582 16.07a4.5 4.5 0 01-1.897 1.13L6 18l.8-2.685a4.5 4.5 0 011.13-1.897l8.932-8.931zm0 0L19.5 7.125" }) }), t('task.edit') ] }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-400", children: new Date(task.createdAt).toLocaleDateString(dateLocale) }) ] }) ] }), /*#__PURE__*/ _jsx("h1", { className: "text-2xl font-bold text-gray-900 mb-4", children: taskTitle(task, locale) }), /*#__PURE__*/ _jsx("p", { className: "text-gray-700 whitespace-pre-wrap mb-6", children: taskDescription(task, locale) }), /*#__PURE__*/ _jsxs("div", { className: "grid grid-cols-2 md:grid-cols-4 gap-4 p-4 bg-gray-50 rounded-lg", children: [ task.budget && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-500", children: t('task.budget') }), /*#__PURE__*/ _jsxs("p", { className: "font-bold text-green-600 text-lg", children: [ task.budget, "€" ] }), task.budgetNegotiable && /*#__PURE__*/ _jsx("p", { className: "text-xs text-green-600 mt-0.5", children: t('task.budget_negotiable') }) ] }), !task.budget && task.budgetNegotiable && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-500", children: t('task.budget') }), /*#__PURE__*/ _jsx("p", { className: "font-medium text-green-600", children: t('task.budget_negotiable') }) ] }), task.location && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-500", children: t('task.location') }), /*#__PURE__*/ _jsxs("p", { className: "font-medium", children: [ "\uD83D\uDCCD ", (_locMap_task_location = locMap[task.location]) !== null && _locMap_task_location !== void 0 ? _locMap_task_location : task.location ] }) ] }), task.deadline && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-500", children: t('task.deadline') }), /*#__PURE__*/ _jsx("p", { className: "font-medium", children: new Date(task.deadline).toLocaleDateString(dateLocale) }), task.timeSlot && task.timeSlot !== '' && /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-500 mt-0.5", children: t("create.field.time_slot.".concat(task.timeSlot), task.timeSlot) }) ] }), !task.deadline && task.timeSlot && task.timeSlot !== '' && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-500", children: t('task.time_slot') }), /*#__PURE__*/ _jsx("p", { className: "font-medium", children: t("create.field.time_slot.".concat(task.timeSlot), task.timeSlot) }) ] }), task.expiresAt && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-500", children: t('task.expires_at') }), /*#__PURE__*/ _jsx("p", { className: "font-medium", children: new Date(task.expiresAt).toLocaleDateString(dateLocale) }) ] }), customer && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-500", children: t('task.customer') }), /*#__PURE__*/ _jsxs(Link, { href: "/users/".concat(customer.id), className: "flex items-center gap-2 mt-1 group", children: [ /*#__PURE__*/ _jsx("div", { className: "w-8 h-8 rounded-full overflow-hidden bg-green-100 shrink-0 flex items-center justify-center", children: customer.image ? /*#__PURE__*/ _jsx("img", { src: customer.image, alt: shortName(customer.name), className: "w-full h-full object-cover" }) : /*#__PURE__*/ _jsx("span", { className: "text-green-600 font-semibold text-xs", children: shortName(customer.name).charAt(0).toUpperCase() }) }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "font-medium text-gray-900 group-hover:text-green-600 leading-none", children: shortName(customer.name) }), customer.rating && /*#__PURE__*/ _jsxs("p", { className: "text-xs text-yellow-500 leading-none mt-0.5", children: [ "★ ", Number(customer.rating).toFixed(1) ] }) ] }) ] }) ] }) ] }), task.images && task.images.length > 0 && /*#__PURE__*/ _jsx("div", { className: "mt-4", children: /*#__PURE__*/ _jsx("div", { className: "flex flex-wrap gap-2", children: task.images.map((url, i)=>/*#__PURE__*/ _jsx("button", { onClick: ()=>setLightboxIndex(i), className: "block w-24 h-24 rounded-lg overflow-hidden border border-gray-200 hover:opacity-90 hover:border-green-300 transition", children: /*#__PURE__*/ _jsx("img", { src: url, alt: "", className: "w-full h-full object-cover" }) }, i)) }) }), lightboxIndex !== null && task.images && /*#__PURE__*/ _jsx("div", { className: "fixed inset-0 z-50 flex items-center justify-center bg-black/85", onClick: ()=>setLightboxIndex(null), children: /*#__PURE__*/ _jsxs("div", { className: "relative max-w-4xl w-full mx-4", onClick: (e)=>e.stopPropagation(), children: [ /*#__PURE__*/ _jsx("img", { src: task.images[lightboxIndex], alt: "", className: "w-full max-h-[80vh] object-contain rounded-lg" }), /*#__PURE__*/ _jsx("button", { onClick: ()=>setLightboxIndex(null), className: "absolute -top-10 right-0 text-white/80 hover:text-white p-2", children: /*#__PURE__*/ _jsx("svg", { className: "w-6 h-6", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" }) }) }), lightboxIndex > 0 && /*#__PURE__*/ _jsx("button", { onClick: ()=>setLightboxIndex(lightboxIndex - 1), className: "absolute left-0 top-1/2 -translate-y-1/2 -translate-x-12 text-white/80 hover:text-white p-2", children: /*#__PURE__*/ _jsx("svg", { className: "w-8 h-8", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 19l-7-7 7-7" }) }) }), lightboxIndex < task.images.length - 1 && /*#__PURE__*/ _jsx("button", { onClick: ()=>setLightboxIndex(lightboxIndex + 1), className: "absolute right-0 top-1/2 -translate-y-1/2 translate-x-12 text-white/80 hover:text-white p-2", children: /*#__PURE__*/ _jsx("svg", { className: "w-8 h-8", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 5l7 7-7 7" }) }) }), task.images.length > 1 && /*#__PURE__*/ _jsxs("p", { className: "text-white/60 text-sm text-center mt-3", children: [ lightboxIndex + 1, " / ", task.images.length ] }) ] }) }), (isOwner || (myOffer === null || myOffer === void 0 ? void 0 : myOffer.status) === 'accepted') && (task.district || task.street || task.confidentialNote) && /*#__PURE__*/ _jsxs("div", { className: "mt-4 p-3 bg-yellow-50 border border-yellow-200 rounded-lg space-y-2", children: [ /*#__PURE__*/ _jsxs("p", { className: "text-xs font-medium text-yellow-700 flex items-center gap-1", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z" }) }), t('task.confidential') ] }), (task.district || task.street) && /*#__PURE__*/ _jsxs("p", { className: "text-sm text-yellow-800", children: [ "\uD83D\uDCCD ", [ task.district, task.street, task.houseNumber ].filter(Boolean).join(', ') ] }), task.confidentialNote && /*#__PURE__*/ _jsx("p", { className: "text-sm text-yellow-800", children: task.confidentialNote }) ] }), /*#__PURE__*/ _jsxs("div", { className: "mt-6 flex flex-wrap gap-3", children: [ !session && !isOwner && task.status === 'open' && /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx(Link, { href: loginRedirectHref, className: "bg-green-600 text-white px-6 py-3 rounded-xl font-semibold hover:bg-green-700", children: t('task.make_offer', 'Send offer') }), /*#__PURE__*/ _jsxs(Link, { href: loginRedirectHref, className: "flex items-center gap-2 bg-green-50 text-green-600 border border-green-200 px-4 py-2.5 rounded-xl font-medium hover:bg-green-100", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }), t('chat.write_customer', 'Write to customer') ] }) ] }), isOwner && task.status === 'in_progress' && /*#__PURE__*/ _jsx("button", { onClick: handleComplete, className: "bg-green-600 text-white px-6 py-3 rounded-xl font-semibold hover:bg-green-700", children: t('task.complete') }), isOwner && (acceptedOffer === null || acceptedOffer === void 0 ? void 0 : (_acceptedOffer_specialist = acceptedOffer.specialist) === null || _acceptedOffer_specialist === void 0 ? void 0 : _acceptedOffer_specialist.id) && /*#__PURE__*/ _jsxs("button", { onClick: ()=>handleMessage(acceptedOffer.specialist.id), disabled: msgLoading, className: "flex items-center gap-2 bg-green-50 text-green-600 border border-green-200 px-4 py-2.5 rounded-xl font-medium hover:bg-green-100 disabled:opacity-50", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }), t('chat.write_specialist') ] }), isOwner && task.status === 'completed' && acceptedOffer && !reviewDone && /*#__PURE__*/ _jsx("button", { onClick: ()=>{ var _acceptedOffer_specialist; var _acceptedOffer_specialist_id; return setReviewTargetId((_acceptedOffer_specialist_id = (_acceptedOffer_specialist = acceptedOffer.specialist) === null || _acceptedOffer_specialist === void 0 ? void 0 : _acceptedOffer_specialist.id) !== null && _acceptedOffer_specialist_id !== void 0 ? _acceptedOffer_specialist_id : null); }, className: "bg-yellow-500 text-white px-6 py-3 rounded-xl font-semibold hover:bg-yellow-600", children: t('review.leave') }), reviewDone && /*#__PURE__*/ _jsx("span", { className: "text-green-600 font-medium py-3", children: t('review.done') }) ] }), reviewTargetId && /*#__PURE__*/ _jsxs("form", { onSubmit: handleReview, className: "mt-6 border-t border-gray-100 pt-6 space-y-4", children: [ /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-gray-800", children: t('review.leave') }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "text-sm font-medium text-gray-700 mb-2", children: t('review.rating') }), /*#__PURE__*/ _jsx("div", { className: "flex gap-1", children: [ 1, 2, 3, 4, 5 ].map((star)=>/*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setReviewRating(star), className: "text-2xl transition ".concat(star <= reviewRating ? 'text-yellow-400' : 'text-gray-300'), children: "★" }, star)) }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('review.comment') }), /*#__PURE__*/ _jsx("textarea", { value: reviewComment, onChange: (e)=>setReviewComment(e.target.value), rows: 3, maxLength: 2000, placeholder: t('review.comment.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" }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-3", children: [ /*#__PURE__*/ _jsx("button", { type: "submit", disabled: reviewSubmitting, className: "bg-green-600 text-white px-5 py-2 rounded-xl font-semibold hover:bg-green-700 disabled:opacity-50", children: reviewSubmitting ? t('review.submitting') : t('review.submit') }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setReviewTargetId(null), className: "px-5 py-2 rounded-xl border border-gray-200 text-gray-600 hover:bg-gray-50", children: t('common.cancel') }) ] }) ] }) ] }), isOwner && /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between mb-4 flex-wrap gap-2", children: [ /*#__PURE__*/ _jsxs("h2", { className: "text-lg font-bold text-gray-900", children: [ t('task.offers'), " (", offers.length, ")" ] }), taskStats && /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 text-xs text-gray-500", children: [ taskStats.totalViews > 0 && /*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-1", children: [ /*#__PURE__*/ _jsxs("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: [ /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 12a3 3 0 11-6 0 3 3 0 016 0z" }), /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z" }) ] }), taskStats.totalViews ] }), taskStats.offerCount > 0 && /*#__PURE__*/ _jsxs("span", { className: "font-medium text-green-600", children: [ "⚡ ", taskStats.offerCount, " ", t('task.offers').toLowerCase() ] }) ] }), hasAutoMatch && task.status === 'open' && /*#__PURE__*/ _jsxs("button", { onClick: async ()=>{ setAutoMatchLoading(true); try { const res = await runAutoMatch(taskId); var _res_matches; setAutoMatchResults((_res_matches = res.matches) !== null && _res_matches !== void 0 ? _res_matches : []); } catch (e) {} finally{ setAutoMatchLoading(false); } }, disabled: autoMatchLoading, className: "flex items-center gap-1.5 text-xs font-medium bg-purple-50 text-purple-700 border border-purple-200 px-3 py-1.5 rounded-lg hover:bg-purple-100 transition disabled:opacity-50", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M13 10V3L4 14h7v7l9-11h-7z" }) }), autoMatchLoading ? t('common.loading') : t('task.auto_match', 'Auto match') ] }) ] }), autoMatchResults && autoMatchResults.length > 0 && /*#__PURE__*/ _jsxs("div", { className: "mb-4 p-3 bg-purple-50 rounded-xl border border-purple-100", children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs font-medium text-purple-700 mb-2", children: t('task.auto_match_results', 'Top specialists') }), /*#__PURE__*/ _jsx("div", { className: "space-y-2", children: autoMatchResults.slice(0, 5).map((s)=>{ var _s_name_, _s_name; var _s_firstName; return /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between gap-2", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2", children: [ /*#__PURE__*/ _jsx("div", { className: "w-7 h-7 rounded-full bg-purple-100 flex items-center justify-center text-purple-700 text-xs font-bold overflow-hidden", children: s.image ? /*#__PURE__*/ _jsx("img", { src: s.image, alt: "", className: "w-full h-full object-cover" }) : (_s_name = s.name) === null || _s_name === void 0 ? void 0 : (_s_name_ = _s_name[0]) === null || _s_name_ === void 0 ? void 0 : _s_name_.toUpperCase() }), /*#__PURE__*/ _jsx("span", { className: "text-sm text-gray-800", children: (_s_firstName = s.firstName) !== null && _s_firstName !== void 0 ? _s_firstName : s.name }), s.rating && /*#__PURE__*/ _jsxs("span", { className: "text-xs text-yellow-500", children: [ "★", Number(s.rating).toFixed(1) ] }) ] }), /*#__PURE__*/ _jsx("button", { onClick: ()=>handleMessage(s.id), className: "text-xs text-green-600 hover:underline", children: t('chat.write_btn') }) ] }, s.id); }) }) ] }), !offersLoaded ? /*#__PURE__*/ _jsx("p", { className: "text-gray-400 text-sm", children: t('common.loading') }) : offers.length === 0 ? /*#__PURE__*/ _jsx("p", { className: "text-gray-500 text-sm", children: t('task.offers.none') }) : /*#__PURE__*/ _jsx("div", { className: "space-y-4", children: offers.map((row)=>{ var _specialist_name_, _specialist_name; const offer = row.offer; const specialist = row.specialist; var _specialist_name__toUpperCase; return /*#__PURE__*/ _jsxs("div", { className: "border border-gray-100 rounded-xl p-4", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex justify-between items-start gap-4", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-start gap-3", children: [ /*#__PURE__*/ _jsx("div", { className: "w-10 h-10 rounded-full bg-green-100 flex-shrink-0 flex items-center justify-center text-green-700 font-bold overflow-hidden", children: (specialist === null || specialist === void 0 ? void 0 : specialist.image) ? /*#__PURE__*/ _jsx("img", { src: specialist.image, alt: specialist.name, className: "w-full h-full object-cover" }) : (_specialist_name__toUpperCase = specialist === null || specialist === void 0 ? void 0 : (_specialist_name = specialist.name) === null || _specialist_name === void 0 ? void 0 : (_specialist_name_ = _specialist_name[0]) === null || _specialist_name_ === void 0 ? void 0 : _specialist_name_.toUpperCase()) !== null && _specialist_name__toUpperCase !== void 0 ? _specialist_name__toUpperCase : '?' }), /*#__PURE__*/ _jsxs("div", { children: [ specialist && /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-1.5", children: [ /*#__PURE__*/ _jsx(Link, { href: "/users/".concat(specialist.id), className: "font-medium text-gray-900 hover:text-green-600", children: shortName(specialist.name) }), specialist.planTier && specialist.planTier !== 'free' && /*#__PURE__*/ _jsx(PlanBadge, { tier: specialist.planTier }), specialist.hasVerifiedBadge && /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5 text-gray-500", viewBox: "0 0 24 24", fill: "currentColor", children: /*#__PURE__*/ _jsx("path", { d: "M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z" }) }) ] }), offer.message && /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-600 mt-1", children: offer.message }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "text-right shrink-0", children: [ /*#__PURE__*/ _jsxs("p", { className: "text-lg font-bold text-green-600", children: [ formatPrice(offer.price), "€" ] }), /*#__PURE__*/ _jsx("span", { className: "text-xs px-2 py-0.5 rounded-full ".concat(offer.status === 'accepted' ? 'bg-green-100 text-green-700' : offer.status === 'declined' ? 'bg-red-100 text-red-700' : 'bg-gray-100 text-gray-700'), children: t("offer.status.".concat(offer.status), offer.status) }) ] }) ] }), offer.status === 'pending' && task.status === 'open' && /*#__PURE__*/ _jsxs("div", { className: "flex gap-2 mt-3 pt-3 border-t border-gray-50", children: [ /*#__PURE__*/ _jsx("button", { onClick: ()=>handleAccept(offer.id), className: "flex-1 bg-green-600 text-white py-2 rounded-lg text-sm font-semibold hover:bg-green-700", children: t('offer.accept') }), /*#__PURE__*/ _jsx("button", { onClick: ()=>handleDecline(offer.id), className: "flex-1 bg-gray-100 text-gray-700 py-2 rounded-lg text-sm font-semibold hover:bg-gray-200", children: t('offer.decline') }) ] }) ] }, offer.id); }) }) ] }), !isOwner && session && invite && inviteLoaded && task.status === 'open' && !myOffer && /*#__PURE__*/ _jsx("div", { className: "rounded-xl border border-green-200 bg-green-50 p-5", children: /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between gap-4 flex-wrap gap-y-3", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3", children: [ /*#__PURE__*/ _jsx("div", { className: "w-10 h-10 rounded-full bg-green-100 flex items-center justify-center shrink-0", children: /*#__PURE__*/ _jsx("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", strokeWidth: 1.5, stroke: "currentColor", className: "w-5 h-5 text-green-600", children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M21.75 6.75v10.5a2.25 2.25 0 0 1-2.25 2.25h-15a2.25 2.25 0 0 1-2.25-2.25V6.75m19.5 0A2.25 2.25 0 0 0 19.5 4.5h-15a2.25 2.25 0 0 0-2.25 2.25m19.5 0v.243a2.25 2.25 0 0 1-1.07 1.916l-7.5 4.615a2.25 2.25 0 0 1-2.36 0L3.32 8.91a2.25 2.25 0 0 1-1.07-1.916V6.75" }) }) }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "font-semibold text-gray-900 text-sm", children: t('task.invite.banner_title') }), /*#__PURE__*/ _jsx("p", { className: "text-gray-500 text-sm mt-0.5", children: t('task.invite.banner_hint') }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-2 shrink-0", children: [ /*#__PURE__*/ _jsx(Link, { href: "/tasks/".concat(taskId, "/offer"), className: "bg-green-600 text-white px-4 py-2 rounded-lg text-sm font-semibold hover:bg-green-700 transition", children: t('task.invite.accept') }), /*#__PURE__*/ _jsx("button", { onClick: async ()=>{ if (!invite) return; setInviteDeclining(true); await dismissNotification(invite.id).catch(()=>{}); setInvite(null); setInviteDeclining(false); }, disabled: inviteDeclining, className: "border border-gray-300 bg-white text-gray-600 px-4 py-2 rounded-lg text-sm font-medium hover:bg-gray-50 disabled:opacity-50 transition", children: t('task.invite.decline') }) ] }) ] }) }), !isOwner && session && myOfferLoaded && /*#__PURE__*/ _jsxs("div", { className: "space-y-4", children: [ task.status === 'completed' && (myOffer === null || myOffer === void 0 ? void 0 : myOffer.status) === 'accepted' && /*#__PURE__*/ _jsxs("div", { className: "bg-green-50 border border-green-200 rounded-xl p-5 flex items-center gap-4", children: [ /*#__PURE__*/ _jsx("span", { className: "text-3xl", children: "\uD83C\uDF89" }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "font-bold text-green-800 text-lg", children: "ЗаЎаМОе завершеМП!" }), /*#__PURE__*/ _jsx("p", { className: "text-green-700 text-sm", children: "ЗаказчОк ПтЌетОл заЎаМОе как выпПлМеММПе." }) ] }), /*#__PURE__*/ _jsxs("button", { onClick: ()=>handleMessage(task.customerId), disabled: msgLoading, className: "ml-auto flex items-center gap-2 bg-white text-green-600 border border-green-200 px-4 py-2 rounded-xl text-sm font-medium hover:bg-green-50 disabled:opacity-50", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }), t('chat.write_customer') ] }) ] }), (myOffer || task.status === 'open' && !invite || task.status !== 'open') && /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ _jsx("h2", { className: "text-lg font-bold text-gray-900 mb-4", children: "МПё преЎлПжеМОе" }), myOffer ? /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-start justify-between gap-4", children: [ /*#__PURE__*/ _jsxs("div", { className: "space-y-1", children: [ myOffer.message && /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-600", children: myOffer.message }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400", children: new Date(myOffer.createdAt).toLocaleString(dateLocale) }) ] }), /*#__PURE__*/ _jsxs("div", { className: "text-right shrink-0", children: [ /*#__PURE__*/ _jsxs("p", { className: "text-xl font-bold text-green-600", children: [ formatPrice(myOffer.price), "€" ] }), /*#__PURE__*/ _jsx("span", { className: "text-xs px-2 py-0.5 rounded-full font-medium ".concat(myOffer.status === 'accepted' ? 'bg-green-100 text-green-700' : myOffer.status === 'declined' ? 'bg-red-100 text-red-700' : 'bg-yellow-100 text-yellow-700'), children: myOffer.status === 'accepted' ? '✓ ПрОМятП' : myOffer.status === 'declined' ? '✗ ОтклПМеМП' : '⏳ На рассЌПтреМОО' }) ] }) ] }), myOffer.status === 'accepted' && task.status === 'in_progress' && /*#__PURE__*/ _jsx("div", { className: "mt-3 pt-3 border-t border-gray-100", children: /*#__PURE__*/ _jsxs("button", { onClick: ()=>handleMessage(task.customerId), disabled: msgLoading, className: "flex items-center gap-2 bg-green-50 text-green-600 border border-green-200 px-4 py-2 rounded-xl text-sm font-medium hover:bg-green-100 disabled:opacity-50", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }), t('chat.write_customer') ] }) }) ] }) : task.status === 'open' && !invite ? /*#__PURE__*/ _jsxs("div", { className: "space-y-3", children: [ taskStats && taskStats.offerCount > 0 && /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 p-2.5 bg-amber-50 rounded-lg border border-amber-100", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-amber-500 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M13 10V3L4 14h7v7l9-11h-7z" }) }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-amber-700", children: t('fomo.already_offered', '\u0423\u0436\u0435 {n} \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0441\u0442\u043e\u0432 \u043e\u0442\u043a\u043b\u0438\u043a\u043d\u0443\u043b\u0438\u0441\u044c').replace('{n}', String(taskStats.offerCount)) }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between", children: [ /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-500", children: t('task.no_offer_yet', '\u0412\u044b \u0435\u0449\u0451 \u043d\u0435 \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u043b\u0438 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u0435') }), /*#__PURE__*/ _jsx(Link, { href: "/tasks/".concat(taskId, "/offer"), className: "bg-green-600 text-white px-4 py-2 rounded-lg text-sm font-semibold hover:bg-green-700", children: t('task.make_offer', '\u041e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u0435') }) ] }) ] }) : null ] }), task.status === 'completed' && (myOffer === null || myOffer === void 0 ? void 0 : myOffer.status) === 'accepted' && /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ _jsx("h2", { className: "text-lg font-bold text-gray-900 mb-4", children: "ОцеМка заказчОка" }), !myReviewLoaded ? /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-400", children: "Загрузка..." }) : myReview ? /*#__PURE__*/ _jsxs("div", { className: "space-y-3", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-1", children: [ [ 1, 2, 3, 4, 5 ].map((star)=>/*#__PURE__*/ _jsx("span", { className: "text-2xl ".concat(star <= myReview.rating ? 'text-yellow-400' : 'text-gray-200'), children: "★" }, star)), /*#__PURE__*/ _jsxs("span", { className: "ml-2 text-lg font-bold text-gray-800", children: [ myReview.rating, "/5" ] }) ] }), myReview.comment && /*#__PURE__*/ _jsx("p", { className: "text-gray-700 text-sm leading-relaxed", children: myReview.comment }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400", children: new Date(myReview.createdAt).toLocaleDateString(dateLocale) }) ] }) : /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-500", children: "ЗаказчОк ещё Ме ПставОл ПцеМку." }) ] }) ] }), editing && editForm && /*#__PURE__*/ _jsx("div", { className: "fixed inset-0 z-50 flex items-start justify-center bg-black/50 overflow-y-auto py-8 px-4", children: /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-2xl w-full max-w-2xl shadow-xl", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between px-6 py-4 border-b border-gray-100", children: [ /*#__PURE__*/ _jsx("h2", { className: "text-lg font-bold text-gray-900", children: t('task.edit') }), /*#__PURE__*/ _jsx("button", { onClick: ()=>setEditing(false), className: "text-gray-400 hover:text-gray-600 p-1", children: /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" }) }) }) ] }), /*#__PURE__*/ _jsxs("form", { onSubmit: handleEditSave, className: "p-6 space-y-4", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: [ t('create.field.title'), " *" ] }), /*#__PURE__*/ _jsx("input", { type: "text", required: true, minLength: 5, maxLength: 200, value: editForm.title, onChange: (e)=>setEditForm((p)=>({ ...p, title: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: [ t('create.field.description'), " *" ] }), /*#__PURE__*/ _jsx("textarea", { required: true, minLength: 20, value: editForm.description, onChange: (e)=>setEditForm((p)=>({ ...p, description: e.target.value })), rows: 4, 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" }) ] }), /*#__PURE__*/ _jsxs("div", { className: "grid grid-cols-2 gap-4", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('create.field.budget') }), /*#__PURE__*/ _jsx("input", { type: "number", min: 1, value: editForm.budget, onChange: (e)=>setEditForm((p)=>({ ...p, budget: e.target.value })), placeholder: "€", className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ _jsx("div", { className: "flex items-end pb-2", children: /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-2 cursor-pointer", children: [ /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: editForm.budgetNegotiable, onChange: (e)=>setEditForm((p)=>({ ...p, budgetNegotiable: e.target.checked })), className: "w-4 h-4 rounded text-green-600" }), /*#__PURE__*/ _jsx("span", { className: "text-sm text-gray-700", children: t('create.field.budget_negotiable') }) ] }) }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('create.field.deadline') }), /*#__PURE__*/ _jsx("input", { type: "date", value: editForm.deadline, onChange: (e)=>setEditForm((p)=>({ ...p, deadline: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('create.field.expires_at') }), /*#__PURE__*/ _jsx("input", { type: "date", value: editForm.expiresAt, onChange: (e)=>setEditForm((p)=>({ ...p, expiresAt: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ _jsxs("div", { className: "grid grid-cols-3 gap-3", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('create.field.address.district') }), /*#__PURE__*/ _jsx("input", { type: "text", value: editForm.district, onChange: (e)=>setEditForm((p)=>({ ...p, district: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('create.field.address.street') }), /*#__PURE__*/ _jsx("input", { type: "text", value: editForm.street, onChange: (e)=>setEditForm((p)=>({ ...p, street: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('create.field.address.house') }), /*#__PURE__*/ _jsx("input", { type: "text", value: editForm.houseNumber, onChange: (e)=>setEditForm((p)=>({ ...p, houseNumber: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('create.field.confidential') }), /*#__PURE__*/ _jsx("textarea", { value: editForm.confidentialNote, onChange: (e)=>setEditForm((p)=>({ ...p, confidentialNote: e.target.value })), rows: 2, 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" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('task.status_label', 'Status') }), /*#__PURE__*/ _jsxs("select", { value: editForm.status, onChange: (e)=>setEditForm((p)=>({ ...p, status: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400", children: [ /*#__PURE__*/ _jsx("option", { value: "open", children: t('task.status.open') }), /*#__PURE__*/ _jsx("option", { value: "draft", children: t('task.status.draft') }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-3 pt-2", children: [ /*#__PURE__*/ _jsx("button", { type: "submit", disabled: editSaving, className: "flex-1 bg-green-600 text-white py-2.5 rounded-xl font-semibold hover:bg-green-700 disabled:opacity-50 transition", children: editSaving ? t('common.saving', '...') : t('common.save') }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setEditing(false), className: "px-6 py-2.5 rounded-xl border border-gray-200 text-gray-600 hover:bg-gray-50 transition", children: t('common.cancel') }) ] }) ] }) ] }) }) ] }); } ÎV61146undefined148191undefined193221undefined223266undefined268307undefined309353undefined355591undefined593667undefined669713undefined715765undefined10111025undefined12251234(0,_lib_auth__WEBPACK_IMPORTED_MODULE_4__/* .useSession */ .wV)undefined12651273(0,_context_locale__WEBPACK_IMPORTED_MODULE_5__/* .useLocale */ .Y)undefined12971305(0,next_navigation__WEBPACK_IMPORTED_MODULE_3__.useRouter)undefined13381345(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined13841391(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined14431450(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined15011508(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined15521559(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined16141621(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined16671674(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined17311738(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined17961803(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined18561863(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined19151922(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined19811988(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined20382045(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined20872094(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined21472154(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined22142221(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined22712278(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined23342341(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined24192426(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined24872494(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined25552562(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined26162623(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined26902697(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined27472754(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined28002807(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined28602868(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined39703978(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined40404048(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getOffers */ .Sw)undefined43114319(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined43654376(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getTaskStats */ .vh)undefined44284441(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getMyDashboard */ .H)undefined47394747(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined48274837(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getMyOffers */ .aT)undefined54615469(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined55485560(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getTaskInvite */ .F9)undefined59305938(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined60506063(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getTaskReviews */ .H6)undefined65106520(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .acceptOffer */ .$H)undefined69476958(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .declineOffer */ .Lb)undefined73277338(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .completeTask */ .Rt)undefined76457656(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .createReview */ .bx)undefined80948114(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getOrCreateDirectRoom */ .QN)undefined1117111180(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updateTask */ .lC)undefined1168711691(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1179811802(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1195711961(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1213212136(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1232112324(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1267612679(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1309913102(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1343813442(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1369213696(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1406514068(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1449314496(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1516415167(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1554615549(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1566915677(0,_lib_taskLocale__WEBPACK_IMPORTED_MODULE_8__/* .taskTitle */ .Oj)undefined1575115754(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1587415888(0,_lib_taskLocale__WEBPACK_IMPORTED_MODULE_8__/* .taskDescription */ .GZ)undefined1596215966(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1617216176(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1628116284(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1652616530(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1694016943(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1730217306(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1741117414(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1765617659(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1799117995(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1810018103(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1834718351(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1892218926(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1903119034(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1927819281(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1959219595(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2000920013(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2011820121(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2036620369(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2072520729(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2083420837(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2108321086(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2142621430(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2153521538(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2178221786(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2178821791(next_link__WEBPACK_IMPORTED_MODULE_2___default())undefined2207222075(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2232922332(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2247322481(0,_lib_formatName__WEBPACK_IMPORTED_MODULE_9__/* .shortName */ .E)undefined2265822661(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2283822846(0,_lib_formatName__WEBPACK_IMPORTED_MODULE_9__/* .shortName */ .E)undefined2304423048(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2318523188(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2339923407(0,_lib_formatName__WEBPACK_IMPORTED_MODULE_9__/* .shortName */ .E)undefined2356523569(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2440224405(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2450724510(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2466224665(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2497624979(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2537325376(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2559825602(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2583525838(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2614026143(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2640026403(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2677626779(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2718327186(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2748827491(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2786427867(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2828728290(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2859228595(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2896828971(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2937229376(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3003230036(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3023130235(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3044430447(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3082630829(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3141231416(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3199331996(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3225432258(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3246132465(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3246732475react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragmentundefined3257432577(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3257932582(next_link__WEBPACK_IMPORTED_MODULE_2___default())undefined3295932963(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3296532968(next_link__WEBPACK_IMPORTED_MODULE_2___default())undefined3333133334(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3375733760(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3456234565(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3511735121(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3556735570(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3594535948(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3663236635(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3747237475(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3775737761(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3798237985(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3820338207(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3831238315(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3857638579(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3900939012(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3958739591(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3969639699(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3997139974(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4065640660(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined4082240825(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4131841321(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4189141895(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined4204542049(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined4223142235(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined4267542679(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined4290442908(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined4310843112(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined4359343596(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4398543988(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4472044724(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined4534045344(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined4557445585(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .runAutoMatch */ .OV)undefined4637646379(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4675646759(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4737947383(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined4756847571(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4783147834(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4815348157(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined4837248376(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined4859948602(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4889148894(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4948249485(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4987849882(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined5047850481(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined5105751060(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined5124451247(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined5141151414(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined5182451828(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined5201752021(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined5223552239(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined5246152464(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined5282652829(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined5368353687(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined5385453858(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined5413154134(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined5413654139(next_link__WEBPACK_IMPORTED_MODULE_2___default())undefined5447054478(0,_lib_formatName__WEBPACK_IMPORTED_MODULE_9__/* .shortName */ .E)undefined5470854711(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined5471354721_components_PlanBadge__WEBPACK_IMPORTED_MODULE_7__/* .PlanBadge */ .dundefined5500955012(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined5541955422(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined5592855931(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined5646556469(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined5668856692(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined5693256942(0,_lib_taskLocale__WEBPACK_IMPORTED_MODULE_8__/* .formatPrice */ .$g)undefined5720257205(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined5793757941(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined5816158164(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined5859558598(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined5932759330(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined5946259466(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined5963959643(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined5980659809(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined6000860011(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined6047860481(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined6109861102(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined6121561218(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined6150361506(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined6189761901(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined6206062063(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined6206562068(next_link__WEBPACK_IMPORTED_MODULE_2___default())undefined6245062453(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined6269762715(0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .dismissNotification */ .yk)undefined6344063444(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined6367363677(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined6387963882(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined6408064084(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined6418964192(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined6444964452(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined6477964783(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined6522765230(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined6560565608(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined6633366337(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined6651166514(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined6675166755(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined6675766765react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragmentundefined6686466868(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined6708267086(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined6731467317(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined6762267625(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined6805868062(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined6828168285(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined6852568535(0,_lib_taskLocale__WEBPACK_IMPORTED_MODULE_8__/* .formatPrice */ .$g)undefined6879768800(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined6962269625(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined6978969793(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined7029370296(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined7074370746(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined7156371567(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined7176971773(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined7202572028(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined7247372476(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined7288272885(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined7345973463(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined7367273675(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined7412574128(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined7413074133(next_link__WEBPACK_IMPORTED_MODULE_2___default())undefined7498074984(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined7515875161(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined7540775410(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined7560175605(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined7576675770(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined7628376286(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined7662776631(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined7717777180(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined7743877441(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined7775677759(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined7807578078(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined7824878252(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined7841578419(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined7862778630(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined7886578868(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined7909879101(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined7947479477(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined7990979913(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined8012180125(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined8023880242(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined8068480687(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined8161081614(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined8172781731(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined8217982182(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined8306883072(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined8325883262(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined8339183394(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined8371983722(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined8468984692(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined8484984853(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined8509385096(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined8583485837(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined8635886362(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined8647586478(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined8677386776(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined8752787531(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined8764487647(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined8794487947(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined8870088704(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined8889088894(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined8902389026(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined8936189364(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined9020390207(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined9033690339(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined9067290675(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined9151091514(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined9164391646(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined9197891981(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined9289192895(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined9300893011(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined9331093313(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined9409094094(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined9420794210(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined9451194515(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined9516195164(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined9544395446(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined9587395877(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined9605696059(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined9658096583(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefinedÝÞ, /***/ 2035:  R?«webpack/lib/util/registerExternalSerializerœwebpack-sources/ConcatSource€«webpack/lib/util/registerExternalSerializer™webpack-sources/RawSource_/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; «webpack/lib/util/registerExternalSerializerœwebpack-sources/CachedSource A«webpack/lib/util/registerExternalSerializerœwebpack-sources/ConcatSource€«webpack/lib/util/registerExternalSerializer™webpack-sources/RawSourceú/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ d: () => (/* binding */ PlanBadge) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); «webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourceimport { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; const tierConfig = { free: { label: 'Free', class: 'bg-gray-100 text-gray-500 border border-gray-200', icon: '' }, pro: { label: 'Pro', class: 'bg-green-100 text-green-700 border border-green-200', icon: /*#__PURE__*/ _jsx("svg", { viewBox: "0 0 16 16", fill: "none", className: "w-3 h-3 inline-block mr-0.5 -mt-px", children: /*#__PURE__*/ _jsx("path", { d: "M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z", fill: "currentColor" }) }) }, ultimate: { label: 'Ultimate', class: 'bg-gradient-to-r from-amber-400 via-yellow-400 to-amber-400 text-gray-900 border border-amber-500 shadow-sm shadow-amber-300/50', icon: /*#__PURE__*/ _jsx("svg", { viewBox: "0 0 16 16", fill: "none", className: "w-3 h-3 inline-block mr-0.5 -mt-px", children: /*#__PURE__*/ _jsx("path", { d: "M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z", fill: "currentColor" }) }) } }; export function PlanBadge(param) { let { tier, verified, size = 'sm', className = '' } = param; if (tier === 'free' && !verified) return null; const sizeClass = size === 'sm' ? 'text-[10px] px-1.5 py-0.5' : 'text-xs px-2 py-0.5'; if (verified && tier !== 'free') { return /*#__PURE__*/ _jsxs("span", { className: "inline-flex items-center gap-1 rounded-full font-semibold ".concat(sizeClass, " ").concat(tierConfig[tier].class, " ").concat(className), children: [ tier === 'ultimate' ? /*#__PURE__*/ _jsx(StarIcon, { className: "w-3 h-3 fill-gray-900" }) : /*#__PURE__*/ _jsx(VerifiedIcon, { className: "w-3 h-3" }), tierConfig[tier].label ] }); } if (verified) { return /*#__PURE__*/ _jsx("span", { className: "inline-flex items-center gap-0.5 rounded-full font-semibold ".concat(sizeClass, " bg-green-100 text-green-700 border border-green-200 ").concat(className), children: /*#__PURE__*/ _jsx(VerifiedIcon, { className: "w-3 h-3" }) }); } const cfg = tierConfig[tier]; return /*#__PURE__*/ _jsxs("span", { className: "inline-flex items-center rounded-full font-semibold ".concat(sizeClass, " ").concat(cfg.class, " ").concat(className), children: [ tier === 'pro' && /*#__PURE__*/ _jsx(StarIcon, { className: "w-3 h-3 mr-0.5 -mt-px" }), tier === 'ultimate' && /*#__PURE__*/ _jsx(StarIcon, { className: "w-3 h-3 mr-0.5 -mt-px fill-gray-900" }), cfg.label ] }); } function StarIcon(param) { let { className = '' } = param; return /*#__PURE__*/ _jsx("svg", { viewBox: "0 0 16 16", fill: "none", className: className, children: /*#__PURE__*/ _jsx("path", { d: "M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z", fill: "currentColor" }) }); } function VerifiedIcon(param) { let { className = '' } = param; return /*#__PURE__*/ _jsxs("svg", { viewBox: "0 0 16 16", fill: "none", className: className, children: [ /*#__PURE__*/ _jsx("path", { d: "M8 1l2 1.4 2.4-.4 1 2.2 2 1.2-.4 2.4L16 10l-1.8 1.6.4 2.4-2.2.8L10.8 17 8 16.2 5.2 17l-1.2-2.2-2.2-.8.4-2.4L0 10l1-2.2-.4-2.4 2-1.2 1-2.2 2.4.4L8 1z", fill: "#3B82F6" }), /*#__PURE__*/ _jsx("path", { d: "M5.5 8.5l1.5 1.5 3-3", stroke: "white", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) ] }); } b>_VYŽ‘9<ïõ%)#&Ž‘X[? B Õ Ù ° ³ 5 8   ™ œ • ™ C$'(+€¶(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)ÿÿÿ€·(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)þþþþÿþþþþÿþþ€†buffer†source„size„maps„hash /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ d: () => (/* binding */ PlanBadge) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); const tierConfig = { free: { label: 'Free', class: 'bg-gray-100 text-gray-500 border border-gray-200', icon: '' }, pro: { label: 'Pro', class: 'bg-green-100 text-green-700 border border-green-200', icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { viewBox: "0 0 16 16", fill: "none", className: "w-3 h-3 inline-block mr-0.5 -mt-px", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z", fill: "currentColor" }) }) }, ultimate: { label: 'Ultimate', class: 'bg-gradient-to-r from-amber-400 via-yellow-400 to-amber-400 text-gray-900 border border-amber-500 shadow-sm shadow-amber-300/50', icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { viewBox: "0 0 16 16", fill: "none", className: "w-3 h-3 inline-block mr-0.5 -mt-px", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z", fill: "currentColor" }) }) } }; function PlanBadge(param) { let { tier, verified, size = 'sm', className = '' } = param; if (tier === 'free' && !verified) return null; const sizeClass = size === 'sm' ? 'text-[10px] px-1.5 py-0.5' : 'text-xs px-2 py-0.5'; if (verified && tier !== 'free') { return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "inline-flex items-center gap-1 rounded-full font-semibold ".concat(sizeClass, " ").concat(tierConfig[tier].class, " ").concat(className), children: [ tier === 'ultimate' ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(StarIcon, { className: "w-3 h-3 fill-gray-900" }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(VerifiedIcon, { className: "w-3 h-3" }), tierConfig[tier].label ] }); } if (verified) { return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "inline-flex items-center gap-0.5 rounded-full font-semibold ".concat(sizeClass, " bg-green-100 text-green-700 border border-green-200 ").concat(className), children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(VerifiedIcon, { className: "w-3 h-3" }) }); } const cfg = tierConfig[tier]; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "inline-flex items-center rounded-full font-semibold ".concat(sizeClass, " ").concat(cfg.class, " ").concat(className), children: [ tier === 'pro' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(StarIcon, { className: "w-3 h-3 mr-0.5 -mt-px" }), tier === 'ultimate' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(StarIcon, { className: "w-3 h-3 mr-0.5 -mt-px fill-gray-900" }), cfg.label ] }); } function StarIcon(param) { let { className = '' } = param; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { viewBox: "0 0 16 16", fill: "none", className: className, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z", fill: "currentColor" }) }); } function VerifiedIcon(param) { let { className = '' } = param; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { viewBox: "0 0 16 16", fill: "none", className: className, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M8 1l2 1.4 2.4-.4 1 2.2 2 1.2-.4 2.4L16 10l-1.8 1.6.4 2.4-2.2.8L10.8 17 8 16.2 5.2 17l-1.2-2.2-2.2-.8.4-2.4L0 10l1-2.2-.4-2.4 2-1.2 1-2.2 2.4.4L8 1z", fill: "#3B82F6" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M5.5 8.5l1.5 1.5 3-3", stroke: "white", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) ] }); } €”{"finalSource":true}ƒmap‹bufferedMap ConcatSourceRawSourceú/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ d: () => (/* binding */ PlanBadge) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); ReplaceSourceRawSourceimport { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; const tierConfig = { free: { label: 'Free', class: 'bg-gray-100 text-gray-500 border border-gray-200', icon: '' }, pro: { label: 'Pro', class: 'bg-green-100 text-green-700 border border-green-200', icon: /*#__PURE__*/ _jsx("svg", { viewBox: "0 0 16 16", fill: "none", className: "w-3 h-3 inline-block mr-0.5 -mt-px", children: /*#__PURE__*/ _jsx("path", { d: "M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z", fill: "currentColor" }) }) }, ultimate: { label: 'Ultimate', class: 'bg-gradient-to-r from-amber-400 via-yellow-400 to-amber-400 text-gray-900 border border-amber-500 shadow-sm shadow-amber-300/50', icon: /*#__PURE__*/ _jsx("svg", { viewBox: "0 0 16 16", fill: "none", className: "w-3 h-3 inline-block mr-0.5 -mt-px", children: /*#__PURE__*/ _jsx("path", { d: "M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z", fill: "currentColor" }) }) } }; export function PlanBadge(param) { let { tier, verified, size = 'sm', className = '' } = param; if (tier === 'free' && !verified) return null; const sizeClass = size === 'sm' ? 'text-[10px] px-1.5 py-0.5' : 'text-xs px-2 py-0.5'; if (verified && tier !== 'free') { return /*#__PURE__*/ _jsxs("span", { className: "inline-flex items-center gap-1 rounded-full font-semibold ".concat(sizeClass, " ").concat(tierConfig[tier].class, " ").concat(className), children: [ tier === 'ultimate' ? /*#__PURE__*/ _jsx(StarIcon, { className: "w-3 h-3 fill-gray-900" }) : /*#__PURE__*/ _jsx(VerifiedIcon, { className: "w-3 h-3" }), tierConfig[tier].label ] }); } if (verified) { return /*#__PURE__*/ _jsx("span", { className: "inline-flex items-center gap-0.5 rounded-full font-semibold ".concat(sizeClass, " bg-green-100 text-green-700 border border-green-200 ").concat(className), children: /*#__PURE__*/ _jsx(VerifiedIcon, { className: "w-3 h-3" }) }); } const cfg = tierConfig[tier]; return /*#__PURE__*/ _jsxs("span", { className: "inline-flex items-center rounded-full font-semibold ".concat(sizeClass, " ").concat(cfg.class, " ").concat(className), children: [ tier === 'pro' && /*#__PURE__*/ _jsx(StarIcon, { className: "w-3 h-3 mr-0.5 -mt-px" }), tier === 'ultimate' && /*#__PURE__*/ _jsx(StarIcon, { className: "w-3 h-3 mr-0.5 -mt-px fill-gray-900" }), cfg.label ] }); } function StarIcon(param) { let { className = '' } = param; return /*#__PURE__*/ _jsx("svg", { viewBox: "0 0 16 16", fill: "none", className: className, children: /*#__PURE__*/ _jsx("path", { d: "M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z", fill: "currentColor" }) }); } function VerifiedIcon(param) { let { className = '' } = param; return /*#__PURE__*/ _jsxs("svg", { viewBox: "0 0 16 16", fill: "none", className: className, children: [ /*#__PURE__*/ _jsx("path", { d: "M8 1l2 1.4 2.4-.4 1 2.2 2 1.2-.4 2.4L16 10l-1.8 1.6.4 2.4-2.2.8L10.8 17 8 16.2 5.2 17l-1.2-2.2-2.2-.8.4-2.4L0 10l1-2.2-.4-2.4 2-1.2 1-2.2 2.4.4L8 1z", fill: "#3B82F6" }), /*#__PURE__*/ _jsx("path", { d: "M5.5 8.5l1.5 1.5 3-3", stroke: "white", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) ] }); } Ñ062undefined342345(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined513516(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined910913(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined10811084(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined12631269undefined15731577(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined18271830(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined19341937(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined21362139(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined23672370(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined25172521(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined27362739(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined28692872(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined30973100(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined32253228(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined34773481(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined36203623(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined38803883(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined /***/ }) ʉ/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ d: () => (/* binding */ PlanBadge) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); const tierConfig = { free: { label: 'Free', class: 'bg-gray-100 text-gray-500 border border-gray-200', icon: '' }, pro: { label: 'Pro', class: 'bg-green-100 text-green-700 border border-green-200', icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { viewBox: "0 0 16 16", fill: "none", className: "w-3 h-3 inline-block mr-0.5 -mt-px", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z", fill: "currentColor" }) }) }, ultimate: { label: 'Ultimate', class: 'bg-gradient-to-r from-amber-400 via-yellow-400 to-amber-400 text-gray-900 border border-amber-500 shadow-sm shadow-amber-300/50', icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { viewBox: "0 0 16 16", fill: "none", className: "w-3 h-3 inline-block mr-0.5 -mt-px", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z", fill: "currentColor" }) }) } }; function PlanBadge(param) { let { tier, verified, size = 'sm', className = '' } = param; if (tier === 'free' && !verified) return null; const sizeClass = size === 'sm' ? 'text-[10px] px-1.5 py-0.5' : 'text-xs px-2 py-0.5'; if (verified && tier !== 'free') { return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "inline-flex items-center gap-1 rounded-full font-semibold ".concat(sizeClass, " ").concat(tierConfig[tier].class, " ").concat(className), children: [ tier === 'ultimate' ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(StarIcon, { className: "w-3 h-3 fill-gray-900" }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(VerifiedIcon, { className: "w-3 h-3" }), tierConfig[tier].label ] }); } if (verified) { return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "inline-flex items-center gap-0.5 rounded-full font-semibold ".concat(sizeClass, " bg-green-100 text-green-700 border border-green-200 ").concat(className), children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(VerifiedIcon, { className: "w-3 h-3" }) }); } const cfg = tierConfig[tier]; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "inline-flex items-center rounded-full font-semibold ".concat(sizeClass, " ").concat(cfg.class, " ").concat(className), children: [ tier === 'pro' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(StarIcon, { className: "w-3 h-3 mr-0.5 -mt-px" }), tier === 'ultimate' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(StarIcon, { className: "w-3 h-3 mr-0.5 -mt-px fill-gray-900" }), cfg.label ] }); } function StarIcon(param) { let { className = '' } = param; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { viewBox: "0 0 16 16", fill: "none", className: className, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z", fill: "currentColor" }) }); } function VerifiedIcon(param) { let { className = '' } = param; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { viewBox: "0 0 16 16", fill: "none", className: className, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M8 1l2 1.4 2.4-.4 1 2.2 2 1.2-.4 2.4L16 10l-1.8 1.6.4 2.4-2.2.8L10.8 17 8 16.2 5.2 17l-1.2-2.2-2.2-.8.4-2.4L0 10l1-2.2-.4-2.4 2-1.2 1-2.2 2.4.4L8 1z", fill: "#3B82F6" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M5.5 8.5l1.5 1.5 3-3", stroke: "white", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) ] }); } /***/ }) ËÎ  ÏÐÏú/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ d: () => (/* binding */ PlanBadge) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); Ñimport { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; const tierConfig = { free: { label: 'Free', class: 'bg-gray-100 text-gray-500 border border-gray-200', icon: '' }, pro: { label: 'Pro', class: 'bg-green-100 text-green-700 border border-green-200', icon: /*#__PURE__*/ _jsx("svg", { viewBox: "0 0 16 16", fill: "none", className: "w-3 h-3 inline-block mr-0.5 -mt-px", children: /*#__PURE__*/ _jsx("path", { d: "M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z", fill: "currentColor" }) }) }, ultimate: { label: 'Ultimate', class: 'bg-gradient-to-r from-amber-400 via-yellow-400 to-amber-400 text-gray-900 border border-amber-500 shadow-sm shadow-amber-300/50', icon: /*#__PURE__*/ _jsx("svg", { viewBox: "0 0 16 16", fill: "none", className: "w-3 h-3 inline-block mr-0.5 -mt-px", children: /*#__PURE__*/ _jsx("path", { d: "M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z", fill: "currentColor" }) }) } }; export function PlanBadge(param) { let { tier, verified, size = 'sm', className = '' } = param; if (tier === 'free' && !verified) return null; const sizeClass = size === 'sm' ? 'text-[10px] px-1.5 py-0.5' : 'text-xs px-2 py-0.5'; if (verified && tier !== 'free') { return /*#__PURE__*/ _jsxs("span", { className: "inline-flex items-center gap-1 rounded-full font-semibold ".concat(sizeClass, " ").concat(tierConfig[tier].class, " ").concat(className), children: [ tier === 'ultimate' ? /*#__PURE__*/ _jsx(StarIcon, { className: "w-3 h-3 fill-gray-900" }) : /*#__PURE__*/ _jsx(VerifiedIcon, { className: "w-3 h-3" }), tierConfig[tier].label ] }); } if (verified) { return /*#__PURE__*/ _jsx("span", { className: "inline-flex items-center gap-0.5 rounded-full font-semibold ".concat(sizeClass, " bg-green-100 text-green-700 border border-green-200 ").concat(className), children: /*#__PURE__*/ _jsx(VerifiedIcon, { className: "w-3 h-3" }) }); } const cfg = tierConfig[tier]; return /*#__PURE__*/ _jsxs("span", { className: "inline-flex items-center rounded-full font-semibold ".concat(sizeClass, " ").concat(cfg.class, " ").concat(className), children: [ tier === 'pro' && /*#__PURE__*/ _jsx(StarIcon, { className: "w-3 h-3 mr-0.5 -mt-px" }), tier === 'ultimate' && /*#__PURE__*/ _jsx(StarIcon, { className: "w-3 h-3 mr-0.5 -mt-px fill-gray-900" }), cfg.label ] }); } function StarIcon(param) { let { className = '' } = param; return /*#__PURE__*/ _jsx("svg", { viewBox: "0 0 16 16", fill: "none", className: className, children: /*#__PURE__*/ _jsx("path", { d: "M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z", fill: "currentColor" }) }); } function VerifiedIcon(param) { let { className = '' } = param; return /*#__PURE__*/ _jsxs("svg", { viewBox: "0 0 16 16", fill: "none", className: className, children: [ /*#__PURE__*/ _jsx("path", { d: "M8 1l2 1.4 2.4-.4 1 2.2 2 1.2-.4 2.4L16 10l-1.8 1.6.4 2.4-2.2.8L10.8 17 8 16.2 5.2 17l-1.2-2.2-2.2-.8.4-2.4L0 10l1-2.2-.4-2.4 2-1.2 1-2.2 2.4.4L8 1z", fill: "#3B82F6" }), /*#__PURE__*/ _jsx("path", { d: "M5.5 8.5l1.5 1.5 3-3", stroke: "white", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) ] }); } Ñ062undefined342345(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined513516(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined910913(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined10811084(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined12631269undefined15731577(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined18271830(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined19341937(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined21362139(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined23672370(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined25172521(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined27362739(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined28692872(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined30973100(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined32253228(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined34773481(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined36203623(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined38803883(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefinedÒÓ, /***/ 4017:  ¶«webpack/lib/util/registerExternalSerializerœwebpack-sources/ConcatSource€«webpack/lib/util/registerExternalSerializer™webpack-sources/RawSource_/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; «webpack/lib/util/registerExternalSerializerœwebpack-sources/CachedSource <«webpack/lib/util/registerExternalSerializerœwebpack-sources/ConcatSource€«webpack/lib/util/registerExternalSerializer™webpack-sources/RawSource/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ $g: () => (/* binding */ formatPrice), /* harmony export */ GZ: () => (/* binding */ taskDescription), /* harmony export */ Oj: () => (/* binding */ taskTitle) /* harmony export */ }); «webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourceexport function taskTitle(task, locale) { if (locale === 'el' && task.titleEl) return task.titleEl; if (locale === 'en' && task.titleEn) return task.titleEn; if (locale === 'ru' && task.titleRu) return task.titleRu; return task.title; } /** Display a price without decimal cents: 100.00 → 100, 99.5 → 100 */ export function formatPrice(value) { if (value === null || value === undefined || value === '') return ''; return Math.round(Number(value)).toString(); } export function taskDescription(task, locale) { if (locale === 'el' && task.descriptionEl) return task.descriptionEl; if (locale === 'en' && task.descriptionEn) return task.descriptionEn; if (locale === 'ru' && task.descriptionRu) return task.descriptionRu; return task.description; } CDJæì€€€€†buffer†source„size„maps„hash/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ $g: () => (/* binding */ formatPrice), /* harmony export */ GZ: () => (/* binding */ taskDescription), /* harmony export */ Oj: () => (/* binding */ taskTitle) /* harmony export */ }); function taskTitle(task, locale) { if (locale === 'el' && task.titleEl) return task.titleEl; if (locale === 'en' && task.titleEn) return task.titleEn; if (locale === 'ru' && task.titleRu) return task.titleRu; return task.title; } /** Display a price without decimal cents: 100.00 → 100, 99.5 → 100 */ function formatPrice(value) { if (value === null || value === undefined || value === '') return ''; return Math.round(Number(value)).toString(); } function taskDescription(task, locale) { if (locale === 'el' && task.descriptionEl) return task.descriptionEl; if (locale === 'en' && task.descriptionEn) return task.descriptionEn; if (locale === 'ru' && task.descriptionRu) return task.descriptionRu; return task.description; } €”{"finalSource":true}ƒmap‹bufferedMap ConcatSourceRawSource/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ $g: () => (/* binding */ formatPrice), /* harmony export */ GZ: () => (/* binding */ taskDescription), /* harmony export */ Oj: () => (/* binding */ taskTitle) /* harmony export */ }); ReplaceSourceRawSourceexport function taskTitle(task, locale) { if (locale === 'el' && task.titleEl) return task.titleEl; if (locale === 'en' && task.titleEn) return task.titleEn; if (locale === 'ru' && task.titleRu) return task.titleRu; return task.title; } /** Display a price without decimal cents: 100.00 → 100, 99.5 → 100 */ export function formatPrice(value) { if (value === null || value === undefined || value === '') return ''; return Math.round(Number(value)).toString(); } export function taskDescription(task, locale) { if (locale === 'el' && task.descriptionEl) return task.descriptionEl; if (locale === 'en' && task.descriptionEn) return task.descriptionEn; if (locale === 'ru' && task.descriptionRu) return task.descriptionRu; return task.description; } )06undefined324330undefined486492undefined /***/ }) ¿/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ $g: () => (/* binding */ formatPrice), /* harmony export */ GZ: () => (/* binding */ taskDescription), /* harmony export */ Oj: () => (/* binding */ taskTitle) /* harmony export */ }); function taskTitle(task, locale) { if (locale === 'el' && task.titleEl) return task.titleEl; if (locale === 'en' && task.titleEn) return task.titleEn; if (locale === 'ru' && task.titleRu) return task.titleRu; return task.title; } /** Display a price without decimal cents: 100.00 → 100, 99.5 → 100 */ function formatPrice(value) { if (value === null || value === undefined || value === '') return ''; return Math.round(Number(value)).toString(); } function taskDescription(task, locale) { if (locale === 'el' && task.descriptionEl) return task.descriptionEl; if (locale === 'en' && task.descriptionEn) return task.descriptionEn; if (locale === 'ru' && task.descriptionRu) return task.descriptionRu; return task.description; } /***/ }) Àà  ÄÅÄ/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ $g: () => (/* binding */ formatPrice), /* harmony export */ GZ: () => (/* binding */ taskDescription), /* harmony export */ Oj: () => (/* binding */ taskTitle) /* harmony export */ }); Æexport function taskTitle(task, locale) { if (locale === 'el' && task.titleEl) return task.titleEl; if (locale === 'en' && task.titleEn) return task.titleEn; if (locale === 'ru' && task.titleRu) return task.titleRu; return task.title; } /** Display a price without decimal cents: 100.00 → 100, 99.5 → 100 */ export function formatPrice(value) { if (value === null || value === undefined || value === '') return ''; return Math.round(Number(value)).toString(); } export function taskDescription(task, locale) { if (locale === 'el' && task.descriptionEl) return task.descriptionEl; if (locale === 'en' && task.descriptionEn) return task.descriptionEn; if (locale === 'ru' && task.descriptionRu) return task.descriptionRu; return task.description; } )06undefined324330undefined486492undefinedÇÈ }, «webpack/lib/util/registerExternalSerializerœwebpack-sources/PrefixSource‰/******/ 2__webpack_require__ => { // webpackRuntimeModules ívar __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId)) __webpack_require__.O(0, [1516,9664,9906,2982,587,18,7358], () => (__webpack_exec__(1569))); var __webpack_exports__ = __webpack_require__.O(); _N_E = __webpack_exports__; } ]); ­þÿÿÿÜ(self["webpackChunk_N_E"] = self["webpackChunk_N_E"] || []).push([[6043],{ /***/ 1258: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ E: () => (/* binding */ shortName), /* harmony export */ H: () => (/* binding */ formatShortName) /* harmony export */ }); /** * Shortens the last name to first letter + period. * "ИваМ ПетрПв" → "ИваМ П." * Works with a pre-composed full name string. */ function shortName(fullName) { if (!(fullName === null || fullName === void 0 ? void 0 : fullName.trim())) return '—'; const parts = fullName.trim().split(/\s+/); if (parts.length < 2 || !parts[1]) return parts[0]; return "".concat(parts[0], " ").concat(parts[1][0].toUpperCase(), "."); } /** * Formats separate firstName + lastName fields, shortening the last name. * Falls back to parsing fullName if firstName is not available. */ function formatShortName(firstName, lastName, fallbackName) { if (firstName === null || firstName === void 0 ? void 0 : firstName.trim()) { const l = lastName === null || lastName === void 0 ? void 0 : lastName.trim(); return l ? "".concat(firstName.trim(), " ").concat(l[0].toUpperCase(), ".") : firstName.trim(); } return shortName(fallbackName); } /***/ }), /***/ 1569: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 2026)); /***/ }), /***/ 1592: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ CI: () => (/* binding */ signOut), /* harmony export */ Hh: () => (/* binding */ signUp), /* harmony export */ Jv: () => (/* binding */ signIn), /* harmony export */ wV: () => (/* binding */ useSession), /* harmony export */ yK: () => (/* binding */ authClient) /* harmony export */ }); /* harmony import */ var better_auth_react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6504); const API_URL = "https://api.canhelp.gr" || 0; const authClient = (0,better_auth_react__WEBPACK_IMPORTED_MODULE_0__/* .createAuthClient */ .M)({ baseURL: API_URL }); const { signIn, signOut, signUp, useSession } = authClient; /***/ }), /***/ 2026: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ TaskDetailClient) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(9664); /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(next_link__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(7541); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(1592); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(9906); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(2982); /* harmony import */ var _lib_taskLocale__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(4017); /* harmony import */ var _lib_formatName__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(1258); /* harmony import */ var _components_PlanBadge__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(2035); /* __next_internal_client_entry_do_not_use__ default auto */ const statusColors = { open: 'bg-green-100 text-green-700', in_progress: 'bg-green-100 text-green-700', completed: 'bg-gray-100 text-gray-700', cancelled: 'bg-red-100 text-red-700', draft: 'bg-yellow-100 text-yellow-700' }; function TaskDetailClient(param) { let { taskId, initialTask, initialCustomer, catMap = {}, locMap = {} } = param; var _session_user, _acceptedOffer_specialist; const { data: session } = (0,_lib_auth__WEBPACK_IMPORTED_MODULE_4__/* .useSession */ .wV)(); const { t, locale } = (0,_context_locale__WEBPACK_IMPORTED_MODULE_5__/* .useLocale */ .Y)(); const router = (0,next_navigation__WEBPACK_IMPORTED_MODULE_3__.useRouter)(); const [task, setTask] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(initialTask); const [customer] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(initialCustomer); const [offers, setOffers] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [offersLoaded, setOffersLoaded] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [myOffer, setMyOffer] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [myOfferLoaded, setMyOfferLoaded] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [myReview, setMyReview] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [myReviewLoaded, setMyReviewLoaded] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [reviewTargetId, setReviewTargetId] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [reviewRating, setReviewRating] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(5); const [reviewComment, setReviewComment] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [reviewSubmitting, setReviewSubmitting] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [reviewDone, setReviewDone] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [invite, setInvite] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [inviteLoaded, setInviteLoaded] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [inviteDeclining, setInviteDeclining] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [msgLoading, setMsgLoading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [lightboxIndex, setLightboxIndex] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); // FOMO stats + auto-match const [taskStats, setTaskStats] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [autoMatchResults, setAutoMatchResults] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [autoMatchLoading, setAutoMatchLoading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [hasAutoMatch, setHasAutoMatch] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); // Edit task state const [editing, setEditing] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [editSaving, setEditSaving] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [editForm, setEditForm] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); // Keyboard navigation for lightbox (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ const handler = (e)=>{ if (e.key === 'Escape') setLightboxIndex(null); if (e.key === 'ArrowLeft') setLightboxIndex((prev)=>prev !== null && prev > 0 ? prev - 1 : prev); if (e.key === 'ArrowRight') setLightboxIndex((prev)=>{ if (prev === null) return prev; const imgs = task.images; return imgs && prev < imgs.length - 1 ? prev + 1 : prev; }); }; window.addEventListener('keydown', handler); return ()=>window.removeEventListener('keydown', handler); }, [ task.images ]); const dateLocale = locale === 'ru' ? 'ru-RU' : locale === 'uk' ? 'uk-UA' : locale === 'en' ? 'en-US' : 'el-GR'; const currentUserId = session === null || session === void 0 ? void 0 : (_session_user = session.user) === null || _session_user === void 0 ? void 0 : _session_user.id; const isOwner = currentUserId === task.customerId; const loginRedirectHref = "/login?redirect=".concat(encodeURIComponent("/tasks/".concat(taskId))); // Load offers if owner (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!isOwner || offersLoaded) return; (0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getOffers */ .Sw)(taskId).then((data)=>{ setOffers(data); setOffersLoaded(true); }).catch(()=>setOffersLoaded(true)); }, [ isOwner, taskId, offersLoaded ]); // Load task stats + dashboard features for owner (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!isOwner) return; (0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getTaskStats */ .vh)(taskId).then(setTaskStats).catch(()=>{}); (0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getMyDashboard */ .H)().then((d)=>{ var _d_features; return setHasAutoMatch(!!((_d_features = d.features) === null || _d_features === void 0 ? void 0 : _d_features.hasAutoMatch)); }).catch(()=>{}); }, [ isOwner, taskId ]); // Load specialist's own offer (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!currentUserId || isOwner || myOfferLoaded) return; (0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getMyOffers */ .aT)().then((rows)=>{ const found = rows.find((r)=>{ var _r_task; return ((_r_task = r.task) === null || _r_task === void 0 ? void 0 : _r_task.id) === taskId; }); var _found_offer; setMyOffer((_found_offer = found === null || found === void 0 ? void 0 : found.offer) !== null && _found_offer !== void 0 ? _found_offer : null); setMyOfferLoaded(true); }).catch(()=>setMyOfferLoaded(true)); }, [ currentUserId, isOwner, taskId, myOfferLoaded ]); // Load task invite for specialist (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!currentUserId || isOwner || inviteLoaded) return; (0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getTaskInvite */ .F9)(taskId).then((rows)=>{ var _rows_; setInvite((_rows_ = rows[0]) !== null && _rows_ !== void 0 ? _rows_ : null); setInviteLoaded(true); }).catch(()=>setInviteLoaded(true)); }, [ currentUserId, isOwner, taskId, inviteLoaded ]); // Load review for specialist when task completed (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!currentUserId || isOwner || myReviewLoaded || task.status !== 'completed') return; (0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getTaskReviews */ .H6)(taskId).then((rows)=>{ const found = rows.find((r)=>r.targetId === currentUserId); setMyReview(found !== null && found !== void 0 ? found : null); setMyReviewLoaded(true); }).catch(()=>setMyReviewLoaded(true)); }, [ currentUserId, isOwner, taskId, task.status, myReviewLoaded ]); async function handleAccept(offerId) { const updated = await (0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .acceptOffer */ .$H)(offerId).catch(()=>null); if (updated) { setOffers((prev)=>prev.map((r)=>r.offer.id === offerId ? { ...r, offer: updated } : r)); setTask((t)=>({ ...t, status: 'in_progress' })); } } async function handleDecline(offerId) { const updated = await (0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .declineOffer */ .Lb)(offerId).catch(()=>null); if (updated) { setOffers((prev)=>prev.map((r)=>r.offer.id === offerId ? { ...r, offer: updated } : r)); } } async function handleComplete() { if (!window.confirm(t('task.complete.confirm'))) return; const updated = await (0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .completeTask */ .Rt)(taskId).catch(()=>null); if (updated) setTask((t)=>({ ...t, status: 'completed' })); } async function handleReview(e) { e.preventDefault(); if (!reviewTargetId) return; setReviewSubmitting(true); const ok = await (0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .createReview */ .bx)({ taskId, targetId: reviewTargetId, rating: reviewRating, comment: reviewComment || undefined }).catch(()=>null); setReviewSubmitting(false); if (ok) { setReviewDone(true); setReviewTargetId(null); } } async function handleMessage(otherUserId) { setMsgLoading(true); try { const { room } = await (0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .getOrCreateDirectRoom */ .QN)(otherUserId); router.push("/chat?room=".concat(room.id)); } catch (e) {} setMsgLoading(false); } function handleEditOpen() { var _task_budgetNegotiable, _task_category, _task_location, _task_district, _task_street, _task_houseNumber, _task_timeSlot, _task_confidentialNote; setEditForm({ title: task.title, description: task.description, budget: task.budget ? Number(task.budget) : '', budgetNegotiable: (_task_budgetNegotiable = task.budgetNegotiable) !== null && _task_budgetNegotiable !== void 0 ? _task_budgetNegotiable : false, category: (_task_category = task.category) !== null && _task_category !== void 0 ? _task_category : '', location: (_task_location = task.location) !== null && _task_location !== void 0 ? _task_location : '', district: (_task_district = task.district) !== null && _task_district !== void 0 ? _task_district : '', street: (_task_street = task.street) !== null && _task_street !== void 0 ? _task_street : '', houseNumber: (_task_houseNumber = task.houseNumber) !== null && _task_houseNumber !== void 0 ? _task_houseNumber : '', timeSlot: (_task_timeSlot = task.timeSlot) !== null && _task_timeSlot !== void 0 ? _task_timeSlot : '', confidentialNote: (_task_confidentialNote = task.confidentialNote) !== null && _task_confidentialNote !== void 0 ? _task_confidentialNote : '', deadline: task.deadline ? new Date(task.deadline).toISOString().slice(0, 10) : '', expiresAt: task.expiresAt ? new Date(task.expiresAt).toISOString().slice(0, 10) : '', status: task.status === 'draft' ? 'draft' : 'open' }); setEditing(true); } async function handleEditSave(e) { e.preventDefault(); if (!editForm) return; setEditSaving(true); try { const payload = { title: editForm.title, description: editForm.description, budgetNegotiable: editForm.budgetNegotiable, status: editForm.status }; if (editForm.budget !== '' && editForm.budget > 0) payload.budget = Number(editForm.budget); if (editForm.category) payload.category = editForm.category; if (editForm.location) payload.location = editForm.location; if (editForm.district) payload.district = editForm.district; if (editForm.street) payload.street = editForm.street; if (editForm.houseNumber) payload.houseNumber = editForm.houseNumber; if (editForm.timeSlot) payload.timeSlot = editForm.timeSlot; if (editForm.confidentialNote !== undefined) payload.confidentialNote = editForm.confidentialNote; if (editForm.deadline) payload.deadline = new Date(editForm.deadline).toISOString(); if (editForm.expiresAt) payload.expiresAt = new Date(editForm.expiresAt).toISOString(); const updated = await (0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .updateTask */ .lC)(taskId, payload); setTask((prev)=>({ ...prev, ...updated })); setEditing(false); } catch (err) { alert((err === null || err === void 0 ? void 0 : err.message) || t('common.error')); } finally{ setEditSaving(false); } } const acceptedOffer = offers.find((r)=>r.offer.status === 'accepted'); var _catMap_task_category, _locMap_task_location; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "max-w-4xl mx-auto px-4 py-8", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-6 mb-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex justify-between items-start gap-4 mb-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex flex-wrap items-center gap-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-xs font-medium px-2 py-1 rounded-full ".concat(statusColors[task.status]), children: t("task.status.".concat(task.status), task.status) }), task.category && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-xs font-medium text-green-600 bg-green-50 px-2 py-1 rounded-full", children: (_catMap_task_category = catMap[task.category]) !== null && _catMap_task_category !== void 0 ? _catMap_task_category : task.category }), isOwner && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-xs text-gray-400 bg-gray-100 px-2 py-1 rounded-full", children: t('task.yours') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-2 shrink-0", children: [ isOwner && (task.status === 'draft' || task.status === 'open') && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { onClick: handleEditOpen, className: "flex items-center gap-1.5 text-xs font-medium text-green-600 bg-green-50 hover:bg-green-100 px-3 py-1.5 rounded-lg transition", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M16.862 4.487l1.687-1.688a1.875 1.875 0 112.652 2.652L10.582 16.07a4.5 4.5 0 01-1.897 1.13L6 18l.8-2.685a4.5 4.5 0 011.13-1.897l8.932-8.931zm0 0L19.5 7.125" }) }), t('task.edit') ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-gray-400", children: new Date(task.createdAt).toLocaleDateString(dateLocale) }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h1", { className: "text-2xl font-bold text-gray-900 mb-4", children: (0,_lib_taskLocale__WEBPACK_IMPORTED_MODULE_8__/* .taskTitle */ .Oj)(task, locale) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-gray-700 whitespace-pre-wrap mb-6", children: (0,_lib_taskLocale__WEBPACK_IMPORTED_MODULE_8__/* .taskDescription */ .GZ)(task, locale) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "grid grid-cols-2 md:grid-cols-4 gap-4 p-4 bg-gray-50 rounded-lg", children: [ task.budget && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-500", children: t('task.budget') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { className: "font-bold text-green-600 text-lg", children: [ task.budget, "€" ] }), task.budgetNegotiable && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-green-600 mt-0.5", children: t('task.budget_negotiable') }) ] }), !task.budget && task.budgetNegotiable && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-500", children: t('task.budget') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "font-medium text-green-600", children: t('task.budget_negotiable') }) ] }), task.location && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-500", children: t('task.location') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { className: "font-medium", children: [ "\uD83D\uDCCD ", (_locMap_task_location = locMap[task.location]) !== null && _locMap_task_location !== void 0 ? _locMap_task_location : task.location ] }) ] }), task.deadline && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-500", children: t('task.deadline') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "font-medium", children: new Date(task.deadline).toLocaleDateString(dateLocale) }), task.timeSlot && task.timeSlot !== '' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-500 mt-0.5", children: t("create.field.time_slot.".concat(task.timeSlot), task.timeSlot) }) ] }), !task.deadline && task.timeSlot && task.timeSlot !== '' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-500", children: t('task.time_slot') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "font-medium", children: t("create.field.time_slot.".concat(task.timeSlot), task.timeSlot) }) ] }), task.expiresAt && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-500", children: t('task.expires_at') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "font-medium", children: new Date(task.expiresAt).toLocaleDateString(dateLocale) }) ] }), customer && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-500", children: t('task.customer') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)((next_link__WEBPACK_IMPORTED_MODULE_2___default()), { href: "/users/".concat(customer.id), className: "flex items-center gap-2 mt-1 group", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "w-8 h-8 rounded-full overflow-hidden bg-green-100 shrink-0 flex items-center justify-center", children: customer.image ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: customer.image, alt: (0,_lib_formatName__WEBPACK_IMPORTED_MODULE_9__/* .shortName */ .E)(customer.name), className: "w-full h-full object-cover" }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-green-600 font-semibold text-xs", children: (0,_lib_formatName__WEBPACK_IMPORTED_MODULE_9__/* .shortName */ .E)(customer.name).charAt(0).toUpperCase() }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "font-medium text-gray-900 group-hover:text-green-600 leading-none", children: (0,_lib_formatName__WEBPACK_IMPORTED_MODULE_9__/* .shortName */ .E)(customer.name) }), customer.rating && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { className: "text-xs text-yellow-500 leading-none mt-0.5", children: [ "★ ", Number(customer.rating).toFixed(1) ] }) ] }) ] }) ] }) ] }), task.images && task.images.length > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "mt-4", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex flex-wrap gap-2", children: task.images.map((url, i)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>setLightboxIndex(i), className: "block w-24 h-24 rounded-lg overflow-hidden border border-gray-200 hover:opacity-90 hover:border-green-300 transition", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: url, alt: "", className: "w-full h-full object-cover" }) }, i)) }) }), lightboxIndex !== null && task.images && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "fixed inset-0 z-50 flex items-center justify-center bg-black/85", onClick: ()=>setLightboxIndex(null), children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "relative max-w-4xl w-full mx-4", onClick: (e)=>e.stopPropagation(), children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: task.images[lightboxIndex], alt: "", className: "w-full max-h-[80vh] object-contain rounded-lg" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>setLightboxIndex(null), className: "absolute -top-10 right-0 text-white/80 hover:text-white p-2", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-6 h-6", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" }) }) }), lightboxIndex > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>setLightboxIndex(lightboxIndex - 1), className: "absolute left-0 top-1/2 -translate-y-1/2 -translate-x-12 text-white/80 hover:text-white p-2", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-8 h-8", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 19l-7-7 7-7" }) }) }), lightboxIndex < task.images.length - 1 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>setLightboxIndex(lightboxIndex + 1), className: "absolute right-0 top-1/2 -translate-y-1/2 translate-x-12 text-white/80 hover:text-white p-2", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-8 h-8", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 5l7 7-7 7" }) }) }), task.images.length > 1 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { className: "text-white/60 text-sm text-center mt-3", children: [ lightboxIndex + 1, " / ", task.images.length ] }) ] }) }), (isOwner || (myOffer === null || myOffer === void 0 ? void 0 : myOffer.status) === 'accepted') && (task.district || task.street || task.confidentialNote) && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "mt-4 p-3 bg-yellow-50 border border-yellow-200 rounded-lg space-y-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { className: "text-xs font-medium text-yellow-700 flex items-center gap-1", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z" }) }), t('task.confidential') ] }), (task.district || task.street) && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { className: "text-sm text-yellow-800", children: [ "\uD83D\uDCCD ", [ task.district, task.street, task.houseNumber ].filter(Boolean).join(', ') ] }), task.confidentialNote && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-yellow-800", children: task.confidentialNote }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "mt-6 flex flex-wrap gap-3", children: [ !session && !isOwner && task.status === 'open' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)((next_link__WEBPACK_IMPORTED_MODULE_2___default()), { href: loginRedirectHref, className: "bg-green-600 text-white px-6 py-3 rounded-xl font-semibold hover:bg-green-700", children: t('task.make_offer', 'Send offer') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)((next_link__WEBPACK_IMPORTED_MODULE_2___default()), { href: loginRedirectHref, className: "flex items-center gap-2 bg-green-50 text-green-600 border border-green-200 px-4 py-2.5 rounded-xl font-medium hover:bg-green-100", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }), t('chat.write_customer', 'Write to customer') ] }) ] }), isOwner && task.status === 'in_progress' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: handleComplete, className: "bg-green-600 text-white px-6 py-3 rounded-xl font-semibold hover:bg-green-700", children: t('task.complete') }), isOwner && (acceptedOffer === null || acceptedOffer === void 0 ? void 0 : (_acceptedOffer_specialist = acceptedOffer.specialist) === null || _acceptedOffer_specialist === void 0 ? void 0 : _acceptedOffer_specialist.id) && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { onClick: ()=>handleMessage(acceptedOffer.specialist.id), disabled: msgLoading, className: "flex items-center gap-2 bg-green-50 text-green-600 border border-green-200 px-4 py-2.5 rounded-xl font-medium hover:bg-green-100 disabled:opacity-50", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }), t('chat.write_specialist') ] }), isOwner && task.status === 'completed' && acceptedOffer && !reviewDone && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>{ var _acceptedOffer_specialist; var _acceptedOffer_specialist_id; return setReviewTargetId((_acceptedOffer_specialist_id = (_acceptedOffer_specialist = acceptedOffer.specialist) === null || _acceptedOffer_specialist === void 0 ? void 0 : _acceptedOffer_specialist.id) !== null && _acceptedOffer_specialist_id !== void 0 ? _acceptedOffer_specialist_id : null); }, className: "bg-yellow-500 text-white px-6 py-3 rounded-xl font-semibold hover:bg-yellow-600", children: t('review.leave') }), reviewDone && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-green-600 font-medium py-3", children: t('review.done') }) ] }), reviewTargetId && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("form", { onSubmit: handleReview, className: "mt-6 border-t border-gray-100 pt-6 space-y-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h3", { className: "font-semibold text-gray-800", children: t('review.leave') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm font-medium text-gray-700 mb-2", children: t('review.rating') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex gap-1", children: [ 1, 2, 3, 4, 5 ].map((star)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>setReviewRating(star), className: "text-2xl transition ".concat(star <= reviewRating ? 'text-yellow-400' : 'text-gray-300'), children: "★" }, star)) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('review.comment') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("textarea", { value: reviewComment, onChange: (e)=>setReviewComment(e.target.value), rows: 3, maxLength: 2000, placeholder: t('review.comment.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" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "submit", disabled: reviewSubmitting, className: "bg-green-600 text-white px-5 py-2 rounded-xl font-semibold hover:bg-green-700 disabled:opacity-50", children: reviewSubmitting ? t('review.submitting') : t('review.submit') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>setReviewTargetId(null), className: "px-5 py-2 rounded-xl border border-gray-200 text-gray-600 hover:bg-gray-50", children: t('common.cancel') }) ] }) ] }) ] }), isOwner && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-between mb-4 flex-wrap gap-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("h2", { className: "text-lg font-bold text-gray-900", children: [ t('task.offers'), " (", offers.length, ")" ] }), taskStats && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-3 text-xs text-gray-500", children: [ taskStats.totalViews > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "flex items-center gap-1", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 12a3 3 0 11-6 0 3 3 0 016 0z" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z" }) ] }), taskStats.totalViews ] }), taskStats.offerCount > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "font-medium text-green-600", children: [ "⚡ ", taskStats.offerCount, " ", t('task.offers').toLowerCase() ] }) ] }), hasAutoMatch && task.status === 'open' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { onClick: async ()=>{ setAutoMatchLoading(true); try { const res = await (0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .runAutoMatch */ .OV)(taskId); var _res_matches; setAutoMatchResults((_res_matches = res.matches) !== null && _res_matches !== void 0 ? _res_matches : []); } catch (e) {} finally{ setAutoMatchLoading(false); } }, disabled: autoMatchLoading, className: "flex items-center gap-1.5 text-xs font-medium bg-purple-50 text-purple-700 border border-purple-200 px-3 py-1.5 rounded-lg hover:bg-purple-100 transition disabled:opacity-50", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M13 10V3L4 14h7v7l9-11h-7z" }) }), autoMatchLoading ? t('common.loading') : t('task.auto_match', 'Auto match') ] }) ] }), autoMatchResults && autoMatchResults.length > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "mb-4 p-3 bg-purple-50 rounded-xl border border-purple-100", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs font-medium text-purple-700 mb-2", children: t('task.auto_match_results', 'Top specialists') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "space-y-2", children: autoMatchResults.slice(0, 5).map((s)=>{ var _s_name_, _s_name; var _s_firstName; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-between gap-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "w-7 h-7 rounded-full bg-purple-100 flex items-center justify-center text-purple-700 text-xs font-bold overflow-hidden", children: s.image ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: s.image, alt: "", className: "w-full h-full object-cover" }) : (_s_name = s.name) === null || _s_name === void 0 ? void 0 : (_s_name_ = _s_name[0]) === null || _s_name_ === void 0 ? void 0 : _s_name_.toUpperCase() }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-sm text-gray-800", children: (_s_firstName = s.firstName) !== null && _s_firstName !== void 0 ? _s_firstName : s.name }), s.rating && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "text-xs text-yellow-500", children: [ "★", Number(s.rating).toFixed(1) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>handleMessage(s.id), className: "text-xs text-green-600 hover:underline", children: t('chat.write_btn') }) ] }, s.id); }) }) ] }), !offersLoaded ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-gray-400 text-sm", children: t('common.loading') }) : offers.length === 0 ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-gray-500 text-sm", children: t('task.offers.none') }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "space-y-4", children: offers.map((row)=>{ var _specialist_name_, _specialist_name; const offer = row.offer; const specialist = row.specialist; var _specialist_name__toUpperCase; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "border border-gray-100 rounded-xl p-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex justify-between items-start gap-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-start gap-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "w-10 h-10 rounded-full bg-green-100 flex-shrink-0 flex items-center justify-center text-green-700 font-bold overflow-hidden", children: (specialist === null || specialist === void 0 ? void 0 : specialist.image) ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: specialist.image, alt: specialist.name, className: "w-full h-full object-cover" }) : (_specialist_name__toUpperCase = specialist === null || specialist === void 0 ? void 0 : (_specialist_name = specialist.name) === null || _specialist_name === void 0 ? void 0 : (_specialist_name_ = _specialist_name[0]) === null || _specialist_name_ === void 0 ? void 0 : _specialist_name_.toUpperCase()) !== null && _specialist_name__toUpperCase !== void 0 ? _specialist_name__toUpperCase : '?' }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ specialist && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-1.5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)((next_link__WEBPACK_IMPORTED_MODULE_2___default()), { href: "/users/".concat(specialist.id), className: "font-medium text-gray-900 hover:text-green-600", children: (0,_lib_formatName__WEBPACK_IMPORTED_MODULE_9__/* .shortName */ .E)(specialist.name) }), specialist.planTier && specialist.planTier !== 'free' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components_PlanBadge__WEBPACK_IMPORTED_MODULE_7__/* .PlanBadge */ .d, { tier: specialist.planTier }), specialist.hasVerifiedBadge && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3.5 h-3.5 text-gray-500", viewBox: "0 0 24 24", fill: "currentColor", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z" }) }) ] }), offer.message && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-gray-600 mt-1", children: offer.message }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "text-right shrink-0", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { className: "text-lg font-bold text-green-600", children: [ (0,_lib_taskLocale__WEBPACK_IMPORTED_MODULE_8__/* .formatPrice */ .$g)(offer.price), "€" ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-xs px-2 py-0.5 rounded-full ".concat(offer.status === 'accepted' ? 'bg-green-100 text-green-700' : offer.status === 'declined' ? 'bg-red-100 text-red-700' : 'bg-gray-100 text-gray-700'), children: t("offer.status.".concat(offer.status), offer.status) }) ] }) ] }), offer.status === 'pending' && task.status === 'open' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-2 mt-3 pt-3 border-t border-gray-50", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>handleAccept(offer.id), className: "flex-1 bg-green-600 text-white py-2 rounded-lg text-sm font-semibold hover:bg-green-700", children: t('offer.accept') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>handleDecline(offer.id), className: "flex-1 bg-gray-100 text-gray-700 py-2 rounded-lg text-sm font-semibold hover:bg-gray-200", children: t('offer.decline') }) ] }) ] }, offer.id); }) }) ] }), !isOwner && session && invite && inviteLoaded && task.status === 'open' && !myOffer && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "rounded-xl border border-green-200 bg-green-50 p-5", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-between gap-4 flex-wrap gap-y-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "w-10 h-10 rounded-full bg-green-100 flex items-center justify-center shrink-0", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", strokeWidth: 1.5, stroke: "currentColor", className: "w-5 h-5 text-green-600", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M21.75 6.75v10.5a2.25 2.25 0 0 1-2.25 2.25h-15a2.25 2.25 0 0 1-2.25-2.25V6.75m19.5 0A2.25 2.25 0 0 0 19.5 4.5h-15a2.25 2.25 0 0 0-2.25 2.25m19.5 0v.243a2.25 2.25 0 0 1-1.07 1.916l-7.5 4.615a2.25 2.25 0 0 1-2.36 0L3.32 8.91a2.25 2.25 0 0 1-1.07-1.916V6.75" }) }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "font-semibold text-gray-900 text-sm", children: t('task.invite.banner_title') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-gray-500 text-sm mt-0.5", children: t('task.invite.banner_hint') }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-2 shrink-0", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)((next_link__WEBPACK_IMPORTED_MODULE_2___default()), { href: "/tasks/".concat(taskId, "/offer"), className: "bg-green-600 text-white px-4 py-2 rounded-lg text-sm font-semibold hover:bg-green-700 transition", children: t('task.invite.accept') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: async ()=>{ if (!invite) return; setInviteDeclining(true); await (0,_lib_api__WEBPACK_IMPORTED_MODULE_6__/* .dismissNotification */ .yk)(invite.id).catch(()=>{}); setInvite(null); setInviteDeclining(false); }, disabled: inviteDeclining, className: "border border-gray-300 bg-white text-gray-600 px-4 py-2 rounded-lg text-sm font-medium hover:bg-gray-50 disabled:opacity-50 transition", children: t('task.invite.decline') }) ] }) ] }) }), !isOwner && session && myOfferLoaded && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-4", children: [ task.status === 'completed' && (myOffer === null || myOffer === void 0 ? void 0 : myOffer.status) === 'accepted' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-green-50 border border-green-200 rounded-xl p-5 flex items-center gap-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-3xl", children: "\uD83C\uDF89" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "font-bold text-green-800 text-lg", children: "ЗаЎаМОе завершеМП!" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-green-700 text-sm", children: "ЗаказчОк ПтЌетОл заЎаМОе как выпПлМеММПе." }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { onClick: ()=>handleMessage(task.customerId), disabled: msgLoading, className: "ml-auto flex items-center gap-2 bg-white text-green-600 border border-green-200 px-4 py-2 rounded-xl text-sm font-medium hover:bg-green-50 disabled:opacity-50", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }), t('chat.write_customer') ] }) ] }), (myOffer || task.status === 'open' && !invite || task.status !== 'open') && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "text-lg font-bold text-gray-900 mb-4", children: "МПё преЎлПжеМОе" }), myOffer ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-start justify-between gap-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-1", children: [ myOffer.message && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-gray-600", children: myOffer.message }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400", children: new Date(myOffer.createdAt).toLocaleString(dateLocale) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "text-right shrink-0", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { className: "text-xl font-bold text-green-600", children: [ (0,_lib_taskLocale__WEBPACK_IMPORTED_MODULE_8__/* .formatPrice */ .$g)(myOffer.price), "€" ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-xs px-2 py-0.5 rounded-full font-medium ".concat(myOffer.status === 'accepted' ? 'bg-green-100 text-green-700' : myOffer.status === 'declined' ? 'bg-red-100 text-red-700' : 'bg-yellow-100 text-yellow-700'), children: myOffer.status === 'accepted' ? '✓ ПрОМятП' : myOffer.status === 'declined' ? '✗ ОтклПМеМП' : '⏳ На рассЌПтреМОО' }) ] }) ] }), myOffer.status === 'accepted' && task.status === 'in_progress' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "mt-3 pt-3 border-t border-gray-100", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { onClick: ()=>handleMessage(task.customerId), disabled: msgLoading, className: "flex items-center gap-2 bg-green-50 text-green-600 border border-green-200 px-4 py-2 rounded-xl text-sm font-medium hover:bg-green-100 disabled:opacity-50", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }), t('chat.write_customer') ] }) }) ] }) : task.status === 'open' && !invite ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-3", children: [ taskStats && taskStats.offerCount > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-2 p-2.5 bg-amber-50 rounded-lg border border-amber-100", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 text-amber-500 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M13 10V3L4 14h7v7l9-11h-7z" }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-amber-700", children: t('fomo.already_offered', '\u0423\u0436\u0435 {n} \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0441\u0442\u043e\u0432 \u043e\u0442\u043a\u043b\u0438\u043a\u043d\u0443\u043b\u0438\u0441\u044c').replace('{n}', String(taskStats.offerCount)) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-between", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-gray-500", children: t('task.no_offer_yet', '\u0412\u044b \u0435\u0449\u0451 \u043d\u0435 \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u043b\u0438 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u0435') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)((next_link__WEBPACK_IMPORTED_MODULE_2___default()), { href: "/tasks/".concat(taskId, "/offer"), className: "bg-green-600 text-white px-4 py-2 rounded-lg text-sm font-semibold hover:bg-green-700", children: t('task.make_offer', '\u041e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u0435') }) ] }) ] }) : null ] }), task.status === 'completed' && (myOffer === null || myOffer === void 0 ? void 0 : myOffer.status) === 'accepted' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "text-lg font-bold text-gray-900 mb-4", children: "ОцеМка заказчОка" }), !myReviewLoaded ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-gray-400", children: "Загрузка..." }) : myReview ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-1", children: [ [ 1, 2, 3, 4, 5 ].map((star)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-2xl ".concat(star <= myReview.rating ? 'text-yellow-400' : 'text-gray-200'), children: "★" }, star)), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "ml-2 text-lg font-bold text-gray-800", children: [ myReview.rating, "/5" ] }) ] }), myReview.comment && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-gray-700 text-sm leading-relaxed", children: myReview.comment }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400", children: new Date(myReview.createdAt).toLocaleDateString(dateLocale) }) ] }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-gray-500", children: "ЗаказчОк ещё Ме ПставОл ПцеМку." }) ] }) ] }), editing && editForm && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "fixed inset-0 z-50 flex items-start justify-center bg-black/50 overflow-y-auto py-8 px-4", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-2xl w-full max-w-2xl shadow-xl", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-between px-6 py-4 border-b border-gray-100", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "text-lg font-bold text-gray-900", children: t('task.edit') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>setEditing(false), className: "text-gray-400 hover:text-gray-600 p-1", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-5 h-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" }) }) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("form", { onSubmit: handleEditSave, className: "p-6 space-y-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: [ t('create.field.title'), " *" ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "text", required: true, minLength: 5, maxLength: 200, value: editForm.title, onChange: (e)=>setEditForm((p)=>({ ...p, title: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: [ t('create.field.description'), " *" ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("textarea", { required: true, minLength: 20, value: editForm.description, onChange: (e)=>setEditForm((p)=>({ ...p, description: e.target.value })), rows: 4, 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" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "grid grid-cols-2 gap-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('create.field.budget') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "number", min: 1, value: editForm.budget, onChange: (e)=>setEditForm((p)=>({ ...p, budget: e.target.value })), placeholder: "€", className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex items-end pb-2", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "flex items-center gap-2 cursor-pointer", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "checkbox", checked: editForm.budgetNegotiable, onChange: (e)=>setEditForm((p)=>({ ...p, budgetNegotiable: e.target.checked })), className: "w-4 h-4 rounded text-green-600" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-sm text-gray-700", children: t('create.field.budget_negotiable') }) ] }) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('create.field.deadline') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "date", value: editForm.deadline, onChange: (e)=>setEditForm((p)=>({ ...p, deadline: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('create.field.expires_at') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "date", value: editForm.expiresAt, onChange: (e)=>setEditForm((p)=>({ ...p, expiresAt: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "grid grid-cols-3 gap-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('create.field.address.district') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "text", value: editForm.district, onChange: (e)=>setEditForm((p)=>({ ...p, district: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('create.field.address.street') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "text", value: editForm.street, onChange: (e)=>setEditForm((p)=>({ ...p, street: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('create.field.address.house') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "text", value: editForm.houseNumber, onChange: (e)=>setEditForm((p)=>({ ...p, houseNumber: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('create.field.confidential') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("textarea", { value: editForm.confidentialNote, onChange: (e)=>setEditForm((p)=>({ ...p, confidentialNote: e.target.value })), rows: 2, 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" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('task.status_label', 'Status') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("select", { value: editForm.status, onChange: (e)=>setEditForm((p)=>({ ...p, status: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "open", children: t('task.status.open') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "draft", children: t('task.status.draft') }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-3 pt-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "submit", disabled: editSaving, className: "flex-1 bg-green-600 text-white py-2.5 rounded-xl font-semibold hover:bg-green-700 disabled:opacity-50 transition", children: editSaving ? t('common.saving', '...') : t('common.save') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>setEditing(false), className: "px-6 py-2.5 rounded-xl border border-gray-200 text-gray-600 hover:bg-gray-50 transition", children: t('common.cancel') }) ] }) ] }) ] }) }) ] }); } /***/ }), /***/ 2035: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ d: () => (/* binding */ PlanBadge) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); const tierConfig = { free: { label: 'Free', class: 'bg-gray-100 text-gray-500 border border-gray-200', icon: '' }, pro: { label: 'Pro', class: 'bg-green-100 text-green-700 border border-green-200', icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { viewBox: "0 0 16 16", fill: "none", className: "w-3 h-3 inline-block mr-0.5 -mt-px", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z", fill: "currentColor" }) }) }, ultimate: { label: 'Ultimate', class: 'bg-gradient-to-r from-amber-400 via-yellow-400 to-amber-400 text-gray-900 border border-amber-500 shadow-sm shadow-amber-300/50', icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { viewBox: "0 0 16 16", fill: "none", className: "w-3 h-3 inline-block mr-0.5 -mt-px", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z", fill: "currentColor" }) }) } }; function PlanBadge(param) { let { tier, verified, size = 'sm', className = '' } = param; if (tier === 'free' && !verified) return null; const sizeClass = size === 'sm' ? 'text-[10px] px-1.5 py-0.5' : 'text-xs px-2 py-0.5'; if (verified && tier !== 'free') { return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "inline-flex items-center gap-1 rounded-full font-semibold ".concat(sizeClass, " ").concat(tierConfig[tier].class, " ").concat(className), children: [ tier === 'ultimate' ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(StarIcon, { className: "w-3 h-3 fill-gray-900" }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(VerifiedIcon, { className: "w-3 h-3" }), tierConfig[tier].label ] }); } if (verified) { return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "inline-flex items-center gap-0.5 rounded-full font-semibold ".concat(sizeClass, " bg-green-100 text-green-700 border border-green-200 ").concat(className), children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(VerifiedIcon, { className: "w-3 h-3" }) }); } const cfg = tierConfig[tier]; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "inline-flex items-center rounded-full font-semibold ".concat(sizeClass, " ").concat(cfg.class, " ").concat(className), children: [ tier === 'pro' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(StarIcon, { className: "w-3 h-3 mr-0.5 -mt-px" }), tier === 'ultimate' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(StarIcon, { className: "w-3 h-3 mr-0.5 -mt-px fill-gray-900" }), cfg.label ] }); } function StarIcon(param) { let { className = '' } = param; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { viewBox: "0 0 16 16", fill: "none", className: className, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z", fill: "currentColor" }) }); } function VerifiedIcon(param) { let { className = '' } = param; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { viewBox: "0 0 16 16", fill: "none", className: className, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M8 1l2 1.4 2.4-.4 1 2.2 2 1.2-.4 2.4L16 10l-1.8 1.6.4 2.4-2.2.8L10.8 17 8 16.2 5.2 17l-1.2-2.2-2.2-.8.4-2.4L0 10l1-2.2-.4-2.4 2-1.2 1-2.2 2.4.4L8 1z", fill: "#3B82F6" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M5.5 8.5l1.5 1.5 3-3", stroke: "white", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) ] }); } /***/ }), /***/ 4017: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ $g: () => (/* binding */ formatPrice), /* harmony export */ GZ: () => (/* binding */ taskDescription), /* harmony export */ Oj: () => (/* binding */ taskTitle) /* harmony export */ }); function taskTitle(task, locale) { if (locale === 'el' && task.titleEl) return task.titleEl; if (locale === 'en' && task.titleEn) return task.titleEn; if (locale === 'ru' && task.titleRu) return task.titleRu; return task.title; } /** Display a price without decimal cents: 100.00 → 100, 99.5 → 100 */ function formatPrice(value) { if (value === null || value === undefined || value === '') return ''; return Math.round(Number(value)).toString(); } function taskDescription(task, locale) { if (locale === 'el' && task.descriptionEl) return task.descriptionEl; if (locale === 'en' && task.descriptionEn) return task.descriptionEn; if (locale === 'ru' && task.descriptionRu) return task.descriptionRu; return task.description; } /***/ }) }, /******/ __webpack_require__ => { // webpackRuntimeModules /******/ var __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId)) /******/ __webpack_require__.O(0, [1516,9664,9906,2982,587,18,7358], () => (__webpack_exec__(1569))); /******/ var __webpack_exports__ = __webpack_require__.O(); /******/ _N_E = __webpack_exports__; /******/ } ]); Qÿÿÿ±þÿÿ `J²þÿÿX(self["webpackChunk_N_E"] = self["webpackChunk_N_E"] || []).push([[6043],{ /***/ 1258: ±þÿÿRÿÿÿ±þÿÿYÿÿÿ³þÿÿZÿÿÿ[ÿÿÿVÿÿÿWÿÿÿVÿÿÿ, /***/ 1569: °þÿÿ`ÿÿÿ²þÿÿimport(/* webpackMode: "eager", webpackExports: ["default"] */ "/opt/canhelp/apps/web/src/app/tasks/[id]/TaskDetailClient.tsx"); l0126Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 2026))undefinedSÿÿÿTÿÿÿSÿÿÿYÿÿÿ®þÿÿOÿÿÿ®þÿÿZÿÿÿ°þÿÿ[ÿÿÿ\ÿÿÿSÿÿÿTÿÿÿSÿÿÿ, /***/ 2026: ­þÿÿNÿÿÿ­þÿÿöþÿÿ¯þÿÿªåÿÿ÷þÿÿRÿÿÿSÿÿÿRÿÿÿ¶­þÿÿNÿÿÿ­þÿÿ·¯þÿÿž¹RÿÿÿSÿÿÿRÿÿÿº­þÿÿNÿÿÿ­þÿÿ»¯þÿÿŒœRÿÿÿSÿÿÿRÿÿÿ›­Rÿÿÿívar __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId)) __webpack_require__.O(0, [1516,9664,9906,2982,587,18,7358], () => (__webpack_exec__(1569))); var __webpack_exports__ = __webpack_require__.O(); QÿÿÿžŸ  8 «webpack/lib/util/registerExternalSerializerœwebpack-sources/ConcatSource€`«webpack/lib/util/registerExternalSerializer™webpack-sources/RawSourceX(self["webpackChunk_N_E"] = self["webpackChunk_N_E"] || []).push([[7845],{ /***/ 1258: «webpack/lib/util/registerExternalSerializerœwebpack-sources/CachedSource d«webpack/lib/util/registerExternalSerializerœwebpack-sources/ConcatSource€«webpack/lib/util/registerExternalSerializer™webpack-sources/RawSource_/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; «webpack/lib/util/registerExternalSerializerœwebpack-sources/CachedSource Ê«webpack/lib/util/registerExternalSerializerœwebpack-sources/ConcatSource€«webpack/lib/util/registerExternalSerializer™webpack-sources/RawSourceÖ/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ E: () => (/* binding */ shortName), /* harmony export */ H: () => (/* binding */ formatShortName) /* harmony export */ }); «webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourceé/** * Shortens the last name to first letter + period. * "ИваМ ПетрПв" → "ИваМ П." * Works with a pre-composed full name string. */ export function shortName(fullName) { if (!(fullName === null || fullName === void 0 ? void 0 : fullName.trim())) return '—'; const parts = fullName.trim().split(/\s+/); if (parts.length < 2 || !parts[1]) return parts[0]; return "".concat(parts[0], " ").concat(parts[1][0].toUpperCase(), "."); } /** * Formats separate firstName + lastName fields, shortening the last name. * Falls back to parsing fullName if firstName is not available. */ export function formatShortName(firstName, lastName, fallbackName) { if (firstName === null || firstName === void 0 ? void 0 : firstName.trim()) { const l = lastName === null || lastName === void 0 ? void 0 : lastName.trim(); return l ? "".concat(firstName.trim(), " ").concat(l[0].toUpperCase(), ".") : firstName.trim(); } return shortName(fallbackName); } CˆŽTZ€€€†buffer†source„size„maps„hash±/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ E: () => (/* binding */ shortName), /* harmony export */ H: () => (/* binding */ formatShortName) /* harmony export */ }); /** * Shortens the last name to first letter + period. * "ИваМ ПетрПв" → "ИваМ П." * Works with a pre-composed full name string. */ function shortName(fullName) { if (!(fullName === null || fullName === void 0 ? void 0 : fullName.trim())) return '—'; const parts = fullName.trim().split(/\s+/); if (parts.length < 2 || !parts[1]) return parts[0]; return "".concat(parts[0], " ").concat(parts[1][0].toUpperCase(), "."); } /** * Formats separate firstName + lastName fields, shortening the last name. * Falls back to parsing fullName if firstName is not available. */ function formatShortName(firstName, lastName, fallbackName) { if (firstName === null || firstName === void 0 ? void 0 : firstName.trim()) { const l = lastName === null || lastName === void 0 ? void 0 : lastName.trim(); return l ? "".concat(firstName.trim(), " ").concat(l[0].toUpperCase(), ".") : firstName.trim(); } return shortName(fallbackName); } €”{"finalSource":true}ƒmap‹bufferedMap ConcatSourceRawSourceÖ/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ E: () => (/* binding */ shortName), /* harmony export */ H: () => (/* binding */ formatShortName) /* harmony export */ }); ReplaceSourceRawSourceé/** * Shortens the last name to first letter + period. * "ИваМ ПетрПв" → "ИваМ П." * Works with a pre-composed full name string. */ export function shortName(fullName) { if (!(fullName === null || fullName === void 0 ? void 0 : fullName.trim())) return '—'; const parts = fullName.trim().split(/\s+/); if (parts.length < 2 || !parts[1]) return parts[0]; return "".concat(parts[0], " ").concat(parts[1][0].toUpperCase(), "."); } /** * Formats separate firstName + lastName fields, shortening the last name. * Falls back to parsing fullName if firstName is not available. */ export function formatShortName(firstName, lastName, fallbackName) { if (firstName === null || firstName === void 0 ? void 0 : firstName.trim()) { const l = lastName === null || lastName === void 0 ? void 0 : lastName.trim(); return l ? "".concat(firstName.trim(), " ").concat(l[0].toUpperCase(), ".") : firstName.trim(); } return shortName(fallbackName); } 136142undefined596602undefined /***/ }) €†buffer†source„size„maps„hash/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ E: () => (/* binding */ shortName), /* harmony export */ H: () => (/* binding */ formatShortName) /* harmony export */ }); /** * Shortens the last name to first letter + period. * "ИваМ ПетрПв" → "ИваМ П." * Works with a pre-composed full name string. */ function shortName(fullName) { if (!(fullName === null || fullName === void 0 ? void 0 : fullName.trim())) return '—'; const parts = fullName.trim().split(/\s+/); if (parts.length < 2 || !parts[1]) return parts[0]; return "".concat(parts[0], " ").concat(parts[1][0].toUpperCase(), "."); } /** * Formats separate firstName + lastName fields, shortening the last name. * Falls back to parsing fullName if firstName is not available. */ function formatShortName(firstName, lastName, fallbackName) { if (firstName === null || firstName === void 0 ? void 0 : firstName.trim()) { const l = lastName === null || lastName === void 0 ? void 0 : lastName.trim(); return l ? "".concat(firstName.trim(), " ").concat(l[0].toUpperCase(), ".") : firstName.trim(); } return shortName(fallbackName); } /***/ }) €”{"finalSource":true}ƒmap‹bufferedMap  ConcatSourceRawSource_/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; þÖ/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ E: () => (/* binding */ shortName), /* harmony export */ H: () => (/* binding */ formatShortName) /* harmony export */ }); ReplaceSourceRawSourceé/** * Shortens the last name to first letter + period. * "ИваМ ПетрПв" → "ИваМ П." * Works with a pre-composed full name string. */ export function shortName(fullName) { if (!(fullName === null || fullName === void 0 ? void 0 : fullName.trim())) return '—'; const parts = fullName.trim().split(/\s+/); if (parts.length < 2 || !parts[1]) return parts[0]; return "".concat(parts[0], " ").concat(parts[1][0].toUpperCase(), "."); } /** * Formats separate firstName + lastName fields, shortening the last name. * Falls back to parsing fullName if firstName is not available. */ export function formatShortName(firstName, lastName, fallbackName) { if (firstName === null || firstName === void 0 ? void 0 : firstName.trim()) { const l = lastName === null || lastName === void 0 ? void 0 : lastName.trim(); return l ? "".concat(firstName.trim(), " ").concat(l[0].toUpperCase(), ".") : firstName.trim(); } return shortName(fallbackName); } 136142undefined596602undefined RawSource /***/ }), /***/ 1592:  ú «webpack/lib/util/registerExternalSerializerœwebpack-sources/ConcatSource€«webpack/lib/util/registerExternalSerializer™webpack-sources/RawSource_/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; «webpack/lib/util/registerExternalSerializerœwebpack-sources/CachedSource w«webpack/lib/util/registerExternalSerializerœwebpack-sources/ConcatSource€«webpack/lib/util/registerExternalSerializer™webpack-sources/RawSourceå/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ CI: () => (/* binding */ signOut), /* harmony export */ Hh: () => (/* binding */ signUp), /* harmony export */ Jv: () => (/* binding */ signIn), /* harmony export */ wV: () => (/* binding */ useSession), /* harmony export */ yK: () => (/* binding */ authClient) /* harmony export */ }); /* harmony import */ var better_auth_react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6504); «webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSource import { createAuthClient } from 'better-auth/react'; const API_URL = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; export const authClient = createAuthClient({ baseURL: API_URL }); export const { signIn, signOut, signUp, useSession } = authClient; d4FdiE‚ˆœ«È΀˜"https://api.canhelp.gr"0€Ì(0,better_auth_react__WEBPACK_IMPORTED_MODULE_0__/* .createAuthClient */ .M)€€†buffer†source„size„maps„hashÌ/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ CI: () => (/* binding */ signOut), /* harmony export */ Hh: () => (/* binding */ signUp), /* harmony export */ Jv: () => (/* binding */ signIn), /* harmony export */ wV: () => (/* binding */ useSession), /* harmony export */ yK: () => (/* binding */ authClient) /* harmony export */ }); /* harmony import */ var better_auth_react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6504); const API_URL = "https://api.canhelp.gr" || 0; const authClient = (0,better_auth_react__WEBPACK_IMPORTED_MODULE_0__/* .createAuthClient */ .M)({ baseURL: API_URL }); const { signIn, signOut, signUp, useSession } = authClient; €”{"finalSource":true}ƒmap‹bufferedMap ConcatSourceRawSourceå/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ CI: () => (/* binding */ signOut), /* harmony export */ Hh: () => (/* binding */ signUp), /* harmony export */ Jv: () => (/* binding */ signIn), /* harmony export */ wV: () => (/* binding */ useSession), /* harmony export */ yK: () => (/* binding */ authClient) /* harmony export */ }); /* harmony import */ var better_auth_react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6504); ReplaceSourceRawSource import { createAuthClient } from 'better-auth/react'; const API_URL = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; export const authClient = createAuthClient({ baseURL: API_URL }); export const { signIn, signOut, signUp, useSession } = authClient; »052undefined70100"https://api.canhelp.gr"undefined1051270undefined130136undefined156171(0,better_auth_react__WEBPACK_IMPORTED_MODULE_0__/* .createAuthClient */ .M)undefined200206undefined /***/ }) ë5/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ CI: () => (/* binding */ signOut), /* harmony export */ Hh: () => (/* binding */ signUp), /* harmony export */ Jv: () => (/* binding */ signIn), /* harmony export */ wV: () => (/* binding */ useSession), /* harmony export */ yK: () => (/* binding */ authClient) /* harmony export */ }); /* harmony import */ var better_auth_react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6504); const API_URL = "https://api.canhelp.gr" || 0; const authClient = (0,better_auth_react__WEBPACK_IMPORTED_MODULE_0__/* .createAuthClient */ .M)({ baseURL: API_URL }); const { signIn, signOut, signUp, useSession } = authClient; /***/ }) ìï  ðñðå/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ CI: () => (/* binding */ signOut), /* harmony export */ Hh: () => (/* binding */ signUp), /* harmony export */ Jv: () => (/* binding */ signIn), /* harmony export */ wV: () => (/* binding */ useSession), /* harmony export */ yK: () => (/* binding */ authClient) /* harmony export */ }); /* harmony import */ var better_auth_react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6504); ò import { createAuthClient } from 'better-auth/react'; const API_URL = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; export const authClient = createAuthClient({ baseURL: API_URL }); export const { signIn, signOut, signUp, useSession } = authClient; »052undefined70100"https://api.canhelp.gr"undefined1051270undefined130136undefined156171(0,better_auth_react__WEBPACK_IMPORTED_MODULE_0__/* .createAuthClient */ .M)undefined200206undefinedóô, /***/ 1875:  '7«webpack/lib/util/registerExternalSerializerœwebpack-sources/ConcatSource€«webpack/lib/util/registerExternalSerializer™webpack-sources/RawSource_/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; «webpack/lib/util/registerExternalSerializerœwebpack-sources/CachedSource ªI«webpack/lib/util/registerExternalSerializerœwebpack-sources/ConcatSource€«webpack/lib/util/registerExternalSerializer™webpack-sources/RawSourceà// ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); // EXPORTS __webpack_require__.d(__webpack_exports__, { "default": () => (/* binding */ UserProfilePage) }); // EXTERNAL MODULE: ../../node_modules/next/dist/compiled/react/jsx-runtime.js var jsx_runtime = __webpack_require__(4568); // EXTERNAL MODULE: ../../node_modules/next/dist/compiled/react/index.js var react = __webpack_require__(7620); // EXTERNAL MODULE: ../../node_modules/next/dist/api/navigation.js var navigation = __webpack_require__(7541); // EXTERNAL MODULE: ./src/context/locale.tsx var context_locale = __webpack_require__(9906); // EXTERNAL MODULE: ./src/lib/auth.ts var auth = __webpack_require__(1592); // EXTERNAL MODULE: ./src/lib/api.ts var api = __webpack_require__(2982); // EXTERNAL MODULE: ../../node_modules/next/dist/client/app-dir/link.js var app_dir_link = __webpack_require__(9664); var link_default = /*#__PURE__*/__webpack_require__.n(app_dir_link); ;// ./src/components/UpgradePrompt.tsx «webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSource«webpack/lib/util/registerExternalSerializerœwebpack-sources/CachedSource *«webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSource«webpack/lib/util/registerExternalSerializer™webpack-sources/RawSource£import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import Link from 'next/link'; const tierLabels = { free: 'Free', pro: 'Pro', ultimate: 'Ultimate' }; const tierColors = { free: 'bg-gray-50 border-gray-200 text-gray-700', pro: 'bg-green-50 border-green-200 text-gray-800', ultimate: 'bg-amber-50 border-amber-200 text-amber-800' }; const tierBtnColors = { free: 'bg-gray-600 hover:bg-gray-700 text-white', pro: 'bg-green-600 hover:bg-green-700 text-white', ultimate: 'bg-amber-500 hover:bg-amber-600 text-white' }; export function UpgradePrompt(param) { let { feature, requiredTier, variant = 'inline', t, className = '' } = param; const tierLabel = tierLabels[requiredTier]; if (variant === 'banner') { return /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between gap-3 rounded-xl border px-4 py-3 ".concat(tierColors[requiredTier], " ").concat(className), children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 min-w-0", children: [ /*#__PURE__*/ _jsx(LockIcon, { className: "w-4 h-4 shrink-0 opacity-60" }), /*#__PURE__*/ _jsxs("span", { className: "text-sm font-medium truncate", children: [ feature, " — ", t('upgrade.available_in', 'Available in'), " ", /*#__PURE__*/ _jsx("b", { children: tierLabel }) ] }) ] }), /*#__PURE__*/ _jsx(Link, { href: "/pricing?highlight=".concat(requiredTier), className: "shrink-0 text-xs font-semibold px-3 py-1.5 rounded-lg transition ".concat(tierBtnColors[requiredTier]), children: t('upgrade.cta', 'Upgrade') }) ] }); } if (variant === 'block') { return /*#__PURE__*/ _jsxs("div", { className: "rounded-2xl border p-6 text-center ".concat(tierColors[requiredTier], " ").concat(className), children: [ /*#__PURE__*/ _jsx(LockIcon, { className: "w-8 h-8 mx-auto mb-3 opacity-40" }), /*#__PURE__*/ _jsx("p", { className: "font-semibold text-base mb-1", children: feature }), /*#__PURE__*/ _jsxs("p", { className: "text-sm opacity-70 mb-4", children: [ t('upgrade.available_in', 'Available in plan'), " ", /*#__PURE__*/ _jsx("b", { children: tierLabel }) ] }), /*#__PURE__*/ _jsx(Link, { href: "/pricing?highlight=".concat(requiredTier), className: "inline-block text-sm font-semibold px-5 py-2 rounded-xl transition ".concat(tierBtnColors[requiredTier]), children: t('upgrade.cta', 'Upgrade plan') }) ] }); } // inline variant return /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 text-sm ".concat(className), children: [ /*#__PURE__*/ _jsx(LockIcon, { className: "w-4 h-4 text-gray-400 shrink-0" }), /*#__PURE__*/ _jsxs("span", { className: "text-gray-500", children: [ t('upgrade.available_in', 'Available in'), " ", /*#__PURE__*/ _jsx("b", { className: "text-gray-700", children: tierLabel }), ".", ' ', /*#__PURE__*/ _jsx(Link, { href: "/pricing?highlight=".concat(requiredTier), className: "text-green-600 hover:underline", children: t('upgrade.cta', 'Upgrade') }) ] }) ] }); } function LockIcon(param) { let { className = '' } = param; return /*#__PURE__*/ _jsx("svg", { viewBox: "0 0 20 20", fill: "currentColor", className: className, children: /*#__PURE__*/ _jsx("path", { fillRule: "evenodd", d: "M10 1a4.5 4.5 0 00-4.5 4.5V9H5a2 2 0 00-2 2v6a2 2 0 002 2h10a2 2 0 002-2v-6a2 2 0 00-2-2h-.5V5.5A4.5 4.5 0 0010 1zm3 8V5.5a3 3 0 10-6 0V9h6z", clipRule: "evenodd" }) }); } d>@\_5;÷ûŽ‘&*“–{~€ƒÿ º œ > A á å Ó Ö r u w z ð ô Mvyíñ¿Â—šœŸ €€€Í__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._ÿË__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._þÿÿÎ__WEBPACK_MODULE_REFERENCE__6_5b2264656661756c74225d_directImport_asiSafe1__._ýþþýþþÿýþýþþÿþþ€†buffer†source„size„maps„hashj const tierLabels = { free: 'Free', pro: 'Pro', ultimate: 'Ultimate' }; const tierColors = { free: 'bg-gray-50 border-gray-200 text-gray-700', pro: 'bg-green-50 border-green-200 text-gray-800', ultimate: 'bg-amber-50 border-amber-200 text-amber-800' }; const tierBtnColors = { free: 'bg-gray-600 hover:bg-gray-700 text-white', pro: 'bg-green-600 hover:bg-green-700 text-white', ultimate: 'bg-amber-500 hover:bg-amber-600 text-white' }; function UpgradePrompt(param) { let { feature, requiredTier, variant = 'inline', t, className = '' } = param; const tierLabel = tierLabels[requiredTier]; if (variant === 'banner') { return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "flex items-center justify-between gap-3 rounded-xl border px-4 py-3 ".concat(tierColors[requiredTier], " ").concat(className), children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "flex items-center gap-2 min-w-0", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(LockIcon, { className: "w-4 h-4 shrink-0 opacity-60" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("span", { className: "text-sm font-medium truncate", children: [ feature, " — ", t('upgrade.available_in', 'Available in'), " ", /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("b", { children: tierLabel }) ] }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__6_5b2264656661756c74225d_directImport_asiSafe1__._, { href: "/pricing?highlight=".concat(requiredTier), className: "shrink-0 text-xs font-semibold px-3 py-1.5 rounded-lg transition ".concat(tierBtnColors[requiredTier]), children: t('upgrade.cta', 'Upgrade') }) ] }); } if (variant === 'block') { return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "rounded-2xl border p-6 text-center ".concat(tierColors[requiredTier], " ").concat(className), children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(LockIcon, { className: "w-8 h-8 mx-auto mb-3 opacity-40" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { className: "font-semibold text-base mb-1", children: feature }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("p", { className: "text-sm opacity-70 mb-4", children: [ t('upgrade.available_in', 'Available in plan'), " ", /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("b", { children: tierLabel }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__6_5b2264656661756c74225d_directImport_asiSafe1__._, { href: "/pricing?highlight=".concat(requiredTier), className: "inline-block text-sm font-semibold px-5 py-2 rounded-xl transition ".concat(tierBtnColors[requiredTier]), children: t('upgrade.cta', 'Upgrade plan') }) ] }); } // inline variant return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "flex items-center gap-2 text-sm ".concat(className), children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(LockIcon, { className: "w-4 h-4 text-gray-400 shrink-0" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("span", { className: "text-gray-500", children: [ t('upgrade.available_in', 'Available in'), " ", /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("b", { className: "text-gray-700", children: tierLabel }), ".", ' ', /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__6_5b2264656661756c74225d_directImport_asiSafe1__._, { href: "/pricing?highlight=".concat(requiredTier), className: "text-green-600 hover:underline", children: t('upgrade.cta', 'Upgrade') }) ] }) ] }); } function LockIcon(param) { let { className = '' } = param; return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("svg", { viewBox: "0 0 20 20", fill: "currentColor", className: className, children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("path", { fillRule: "evenodd", d: "M10 1a4.5 4.5 0 00-4.5 4.5V9H5a2 2 0 00-2 2v6a2 2 0 002 2h10a2 2 0 002-2v-6a2 2 0 00-2-2h-.5V5.5A4.5 4.5 0 0010 1zm3 8V5.5a3 3 0 10-6 0V9h6z", clipRule: "evenodd" }) }); } €•{"finalSource":false}ƒmap‹bufferedMap ReplaceSourceRawSource£import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import Link from 'next/link'; const tierLabels = { free: 'Free', pro: 'Pro', ultimate: 'Ultimate' }; const tierColors = { free: 'bg-gray-50 border-gray-200 text-gray-700', pro: 'bg-green-50 border-green-200 text-gray-800', ultimate: 'bg-amber-50 border-amber-200 text-amber-800' }; const tierBtnColors = { free: 'bg-gray-600 hover:bg-gray-700 text-white', pro: 'bg-green-600 hover:bg-green-700 text-white', ultimate: 'bg-amber-500 hover:bg-amber-600 text-white' }; export function UpgradePrompt(param) { let { feature, requiredTier, variant = 'inline', t, className = '' } = param; const tierLabel = tierLabels[requiredTier]; if (variant === 'banner') { return /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between gap-3 rounded-xl border px-4 py-3 ".concat(tierColors[requiredTier], " ").concat(className), children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 min-w-0", children: [ /*#__PURE__*/ _jsx(LockIcon, { className: "w-4 h-4 shrink-0 opacity-60" }), /*#__PURE__*/ _jsxs("span", { className: "text-sm font-medium truncate", children: [ feature, " — ", t('upgrade.available_in', 'Available in'), " ", /*#__PURE__*/ _jsx("b", { children: tierLabel }) ] }) ] }), /*#__PURE__*/ _jsx(Link, { href: "/pricing?highlight=".concat(requiredTier), className: "shrink-0 text-xs font-semibold px-3 py-1.5 rounded-lg transition ".concat(tierBtnColors[requiredTier]), children: t('upgrade.cta', 'Upgrade') }) ] }); } if (variant === 'block') { return /*#__PURE__*/ _jsxs("div", { className: "rounded-2xl border p-6 text-center ".concat(tierColors[requiredTier], " ").concat(className), children: [ /*#__PURE__*/ _jsx(LockIcon, { className: "w-8 h-8 mx-auto mb-3 opacity-40" }), /*#__PURE__*/ _jsx("p", { className: "font-semibold text-base mb-1", children: feature }), /*#__PURE__*/ _jsxs("p", { className: "text-sm opacity-70 mb-4", children: [ t('upgrade.available_in', 'Available in plan'), " ", /*#__PURE__*/ _jsx("b", { children: tierLabel }) ] }), /*#__PURE__*/ _jsx(Link, { href: "/pricing?highlight=".concat(requiredTier), className: "inline-block text-sm font-semibold px-5 py-2 rounded-xl transition ".concat(tierBtnColors[requiredTier]), children: t('upgrade.cta', 'Upgrade plan') }) ] }); } // inline variant return /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 text-sm ".concat(className), children: [ /*#__PURE__*/ _jsx(LockIcon, { className: "w-4 h-4 text-gray-400 shrink-0" }), /*#__PURE__*/ _jsxs("span", { className: "text-gray-500", children: [ t('upgrade.available_in', 'Available in'), " ", /*#__PURE__*/ _jsx("b", { className: "text-gray-700", children: tierLabel }), ".", ' ', /*#__PURE__*/ _jsx(Link, { href: "/pricing?highlight=".concat(requiredTier), className: "text-green-600 hover:underline", children: t('upgrade.cta', 'Upgrade') }) ] }) ] }); } function LockIcon(param) { let { className = '' } = param; return /*#__PURE__*/ _jsx("svg", { viewBox: "0 0 20 20", fill: "currentColor", className: className, children: /*#__PURE__*/ _jsx("path", { fillRule: "evenodd", d: "M10 1a4.5 4.5 0 00-4.5 4.5V9H5a2 2 0 00-2 2v6a2 2 0 002 2h10a2 2 0 002-2v-6a2 2 0 00-2-2h-.5V5.5A4.5 4.5 0 0010 1zm3 8V5.5a3 3 0 10-6 0V9h6z", clipRule: "evenodd" }) }); } %062undefined6492undefined565571undefined795799__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined10151019__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined11661169__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined13181322__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined16831686__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined19151918__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined19201923__WEBPACK_MODULE_REFERENCE__6_5b2264656661756c74225d_directImport_asiSafe1__._undefined23032307__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined24902493__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined26222625__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined27852789__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined30273030__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined31863189__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined31913194__WEBPACK_MODULE_REFERENCE__6_5b2264656661756c74225d_directImport_asiSafe1__._undefined35683572__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined37023705__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined38213825__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined40314034__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined42474250__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined42524255__WEBPACK_MODULE_REFERENCE__6_5b2264656661756c74225d_directImport_asiSafe1__._undefined46294632__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined47654768__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined`_žÜ(»šæO™~ÈÊ “ ß – à a « K — …Ïkµ·zÆH’KR j?‰‹ØN˜g”(0,jsx_runtime.jsxs)ÿ“(0,jsx_runtime.jsx)þÿÿ(link_default())ýþþýþþÿýþýþþÿþþ // EXTERNAL MODULE: ./src/lib/formatName.ts var formatName = __webpack_require__(1258); // EXTERNAL MODULE: ./src/lib/formatLastSeen.ts var formatLastSeen = __webpack_require__(5338); // EXTERNAL MODULE: ./src/components/PlanBadge.tsx var PlanBadge = __webpack_require__(2035); // EXTERNAL MODULE: ./src/components/CategoryIcon.tsx var CategoryIcon = __webpack_require__(5940); ;// ./src/app/users/[id]/page.tsx  z,«webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSource«webpack/lib/util/registerExternalSerializer™webpack-sources/RawSourceÑ/* __next_internal_client_entry_do_not_use__ default auto */ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { useState, useEffect } from 'react'; import { useParams, useRouter } from 'next/navigation'; import { useLocale } from '@/context/locale'; import { useSession } from '@/lib/auth'; import { getUserProfile, getUserReviews, getUserRating, getSpecialistAvailability, getSpecialistCards, getCategories, getLocations, getSpecialistFavorites, addSpecialistFavorite, removeSpecialistFavorite, getOrCreateDirectRoom, getCanMessage, getPriceList } from '@/lib/api'; import { UpgradePrompt } from '@/components/UpgradePrompt'; import { formatShortName, shortName } from '@/lib/formatName'; import { formatLastSeen } from '@/lib/formatLastSeen'; import { PlanBadge } from '@/components/PlanBadge'; import { CategoryIcon, isCategoryIconUrl } from '@/components/CategoryIcon'; const MONTHS_BY_LOCALE = { ru: [ 'ЯМварь', 'Ѐевраль', 'Март', 'Апрель', 'Май', 'ИюМь', 'Июль', 'Август', 'СеМтябрь', 'Октябрь', 'НПябрь', 'Декабрь' ], en: [ 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December' ], el: [ 'ΙαΜουάριος', 'Ίεβρουάριος', 'Μάρτιος', 'Απρίλιος', 'Μάιος', 'ΙούΜιος', 'Ιούλιος', 'Αύγουστος', 'ΣεπτέΌβριος', 'Οκτώβριος', 'ΝοέΌβριος', 'ΔεκέΌβριος' ], uk: [ 'СічеМь', 'ЛютОй', 'БерезеМь', 'КвітеМь', 'ТравеМь', 'ЧервеМь', 'ЛОпеМь', 'СерпеМь', 'ВересеМь', 'ЖПвтеМь', 'ЛОстПпаЎ', 'ГруЎеМь' ] }; const WEEK_DAYS_BY_LOCALE = { ru: [ 'ПМ', 'Вт', 'Ср', 'Чт', 'Пт', 'Сб', 'Вс' ], en: [ 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa', 'Su' ], el: [ 'Δε', '΀ρ', '΀ε', 'Πε', 'Πα', 'Σά', 'Κυ' ], uk: [ 'ПМ', 'Вт', 'Ср', 'Чт', 'Пт', 'Сб', 'НЎ' ] }; export default function UserProfilePage() { var _user_firstName, _user_lastName, _user_name_, _user_name, _user_siteSettings, _session_user; const { id } = useParams(); const { t, locale } = useLocale(); const { data: session } = useSession(); const router = useRouter(); const [user, setUser] = useState(null); const [reviews, setReviews] = useState([]); const [rating, setRating] = useState(null); const [loading, setLoading] = useState(true); const [specialistCards, setSpecialistCards] = useState([]); const [priceLists, setPriceLists] = useState({}); const [catMap, setCatMap] = useState(new Map()); const [locMap, setLocMap] = useState(new Map()); const [isFavorite, setIsFavorite] = useState(false); const [favLoading, setFavLoading] = useState(false); const [msgLoading, setMsgLoading] = useState(false); const [canMsg, setCanMsg] = useState(null); // Availability const now = new Date(); const [availYear, setAvailYear] = useState(now.getFullYear()); const [availMonth, setAvailMonth] = useState(now.getMonth()); const [availMap, setAvailMap] = useState({}); const today = new Date().toISOString().slice(0, 10); const dateLocale = locale === 'ru' ? 'ru-RU' : locale === 'uk' ? 'uk-UA' : locale === 'en' ? 'en-US' : 'el-GR'; useEffect(()=>{ if (!id) return; Promise.all([ getUserProfile(id, locale), getUserReviews(id), getUserRating(id), getCategories().catch(()=>[]), getLocations().catch(()=>[]) ]).then((param)=>{ let [u, r, rt, cats, locs] = param; setUser(u); setReviews(r); setRating(rt.avg); setCatMap(new Map(flattenTree(cats).map((c)=>[ c.slug, c ]))); setLocMap(new Map(flattenTree(locs).map((l)=>[ l.slug, l ]))); if (u.role === 'specialist' || u.role === 'admin') { getSpecialistCards(id, locale).then((cards)=>{ setSpecialistCards(cards); cards.forEach((c)=>{ getPriceList(c.id, locale).then((pl)=>{ if (pl.length > 0) setPriceLists((prev)=>({ ...prev, [c.id]: pl })); }).catch(()=>{}); }); }).catch(()=>{}); } }).catch(()=>{}).finally(()=>setLoading(false)); }, [ id, locale ]); // Load favorite status when session available useEffect(()=>{ var _session_user; if (!session || !id) return; getSpecialistFavorites().then((rows)=>setIsFavorite(rows.some((r)=>{ var _r_specialist; return ((_r_specialist = r.specialist) === null || _r_specialist === void 0 ? void 0 : _r_specialist.id) === id; }))).catch(()=>{}); // Check if current user can message this person const myId = (_session_user = session.user) === null || _session_user === void 0 ? void 0 : _session_user.id; if (myId && myId !== id) { getCanMessage(id).then(setCanMsg).catch(()=>{}); } }, [ session, id ]); async function toggleFavorite() { if (!session) { router.push('/register'); return; } setFavLoading(true); try { if (isFavorite) { await removeSpecialistFavorite(id); setIsFavorite(false); } else { await addSpecialistFavorite(id); setIsFavorite(true); } } catch (e) {} setFavLoading(false); } async function handleMessage() { if (!session) { router.push('/login'); return; } setMsgLoading(true); try { const { room } = await getOrCreateDirectRoom(id); router.push("/chat?room=".concat(room.id)); } catch (e) {} setMsgLoading(false); } useEffect(()=>{ if (!id) return; const monthKey = "".concat(availYear, "-").concat(String(availMonth + 1).padStart(2, '0')); getSpecialistAvailability(id, monthKey).then((rows)=>{ setAvailMap((prev)=>{ const next = { ...prev }; rows.forEach((r)=>{ next[r.date] = r.status; }); return next; }); }).catch(()=>{}); }, [ id, availYear, availMonth ]); if (loading) return /*#__PURE__*/ _jsx("div", { className: "text-center py-20 text-white", children: t('common.loading') }); if (!user) return /*#__PURE__*/ _jsx("div", { className: "text-center py-20 text-white/70", children: t('common.error') }); var _user_firstName_, _user_lastName_; const initials = "".concat((_user_firstName_ = (_user_firstName = user.firstName) === null || _user_firstName === void 0 ? void 0 : _user_firstName[0]) !== null && _user_firstName_ !== void 0 ? _user_firstName_ : '').concat((_user_lastName_ = (_user_lastName = user.lastName) === null || _user_lastName === void 0 ? void 0 : _user_lastName[0]) !== null && _user_lastName_ !== void 0 ? _user_lastName_ : '').toUpperCase() || ((_user_name = user.name) === null || _user_name === void 0 ? void 0 : (_user_name_ = _user_name[0]) === null || _user_name_ === void 0 ? void 0 : _user_name_.toUpperCase()) || '?'; const displayName = formatShortName(user.firstName, user.lastName, user.name); const profileBackgroundImage = typeof ((_user_siteSettings = user.siteSettings) === null || _user_siteSettings === void 0 ? void 0 : _user_siteSettings.profileBackgroundImage) === 'string' && user.siteSettings.profileBackgroundImage.trim().length > 0 ? user.siteSettings.profileBackgroundImage : null; return /*#__PURE__*/ _jsxs("div", { className: "max-w-3xl mx-auto px-4 py-10", children: [ /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6 mb-6", children: [ /*#__PURE__*/ _jsxs("div", { className: "relative -mx-6 -mt-6 mb-5 h-44 overflow-hidden rounded-t-xl", style: { backgroundImage: profileBackgroundImage ? "linear-gradient(135deg, rgba(21, 128, 61, 0.45), rgba(22, 163, 74, 0.65)), url(".concat(profileBackgroundImage, ")") : 'linear-gradient(135deg, #22c55e 0%, #16a34a 45%, #166534 100%)', backgroundSize: 'cover', backgroundPosition: 'center' }, children: [ /*#__PURE__*/ _jsx("div", { className: "absolute inset-0 bg-gradient-to-b from-black/10 to-black/30" }), /*#__PURE__*/ _jsxs("div", { className: "relative h-full w-full p-5 flex items-end justify-between", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 min-w-0", children: [ /*#__PURE__*/ _jsx("div", { className: "w-14 h-14 rounded-full bg-white/20 border border-white/40 overflow-hidden flex items-center justify-center text-white text-xl font-bold backdrop-blur-sm", children: user.image ? /*#__PURE__*/ _jsx("img", { src: user.image, alt: displayName, className: "w-full h-full object-cover" }) : initials }), /*#__PURE__*/ _jsxs("div", { className: "min-w-0", children: [ /*#__PURE__*/ _jsx("p", { className: "text-white text-lg font-bold truncate", children: displayName }), /*#__PURE__*/ _jsxs("p", { className: "text-white/85 text-xs", children: [ t('profile.member_since'), " ", new Date(user.createdAt).toLocaleDateString(dateLocale) ] }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "shrink-0", children: [ user.planTier && user.planTier !== 'free' && /*#__PURE__*/ _jsx(PlanBadge, { tier: user.planTier, verified: user.hasVerifiedBadge, size: "sm" }), user.hasVerifiedBadge && user.planTier === 'free' && /*#__PURE__*/ _jsx(PlanBadge, { tier: "free", verified: true, size: "sm" }) ] }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-start gap-5", children: [ /*#__PURE__*/ _jsx("div", { className: "w-20 h-20 rounded-full bg-green-100 flex-shrink-0 flex items-center justify-center text-green-700 text-2xl font-bold overflow-hidden border-2 border-gray-100", children: user.image ? /*#__PURE__*/ _jsx("img", { src: user.image, alt: displayName, className: "w-full h-full object-cover" }) : initials }), /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 flex-wrap mb-1", children: [ /*#__PURE__*/ _jsx("h1", { className: "text-xl font-bold text-gray-900", children: displayName }), user.planTier && user.planTier !== 'free' && /*#__PURE__*/ _jsx(PlanBadge, { tier: user.planTier, verified: user.hasVerifiedBadge, size: "sm" }), user.hasVerifiedBadge && user.planTier === 'free' && /*#__PURE__*/ _jsx(PlanBadge, { tier: "free", verified: true, size: "sm" }), Array.isArray(user.activeStatuses) && user.activeStatuses.includes('can_help_now') && /*#__PURE__*/ _jsxs("span", { className: "inline-flex items-center gap-1 text-xs font-medium text-green-700 bg-green-50 border border-green-200 px-2 py-0.5 rounded-full", children: [ /*#__PURE__*/ _jsx("span", { className: "w-1.5 h-1.5 rounded-full bg-green-500 animate-pulse" }), t('status.can_help_now', 'Available now') ] }), Array.isArray(user.activeStatuses) && user.activeStatuses.includes('need_help') && /*#__PURE__*/ _jsxs("span", { className: "inline-flex items-center gap-1 text-xs font-medium text-green-700 bg-green-50 border border-green-200 px-2 py-0.5 rounded-full", children: [ /*#__PURE__*/ _jsx("span", { className: "w-1.5 h-1.5 rounded-full bg-green-500" }), t('status.need_help', 'Need help') ] }), (session ? ((_session_user = session.user) === null || _session_user === void 0 ? void 0 : _session_user.id) !== id : true) && /*#__PURE__*/ _jsxs("div", { className: "ml-auto flex items-center gap-2", children: [ !session ? // Guest — show button that leads to registration /*#__PURE__*/ _jsxs("a", { href: "/register", className: "flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-sm font-medium bg-green-50 text-green-600 border border-green-200 hover:bg-green-100 transition", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }), /*#__PURE__*/ _jsx("span", { children: t('chat.write_btn', 'Write') }) ] }) : (canMsg === null || canMsg === void 0 ? void 0 : canMsg.allowed) === false ? /*#__PURE__*/ _jsx(UpgradePrompt, { feature: t('chat.write_btn', 'Write'), requiredTier: "pro", variant: "inline", t: t }) : /*#__PURE__*/ _jsxs("button", { onClick: handleMessage, disabled: msgLoading, className: "flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-sm font-medium bg-green-50 text-green-600 border border-green-200 hover:bg-green-100 transition disabled:opacity-50", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }), /*#__PURE__*/ _jsx("span", { children: t('chat.write_btn') }) ] }), /*#__PURE__*/ _jsxs("button", { onClick: toggleFavorite, disabled: favLoading, title: isFavorite ? t('specialist.unfavorite') : t('specialist.favorite'), className: "flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-sm font-medium transition disabled:opacity-50 ".concat(isFavorite ? 'bg-pink-50 text-pink-600 border border-pink-200 hover:bg-pink-100' : 'bg-gray-50 text-gray-600 border border-gray-200 hover:bg-gray-100'), children: [ /*#__PURE__*/ _jsx("span", { children: isFavorite ? '❀' : '🀍' }), /*#__PURE__*/ _jsx("span", { children: isFavorite ? t('specialist.unfavorite') : t('specialist.favorite') }) ] }) ] }) ] }), rating && /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-1.5 mb-2", children: [ /*#__PURE__*/ _jsx("span", { className: "text-yellow-400 text-lg", children: "★" }), /*#__PURE__*/ _jsx("span", { className: "font-semibold text-gray-800", children: Number(rating).toFixed(1) }), /*#__PURE__*/ _jsxs("span", { className: "text-sm text-gray-400", children: [ "(", reviews.length, " ", t('profile.reviews').toLowerCase(), ")" ] }) ] }), /*#__PURE__*/ _jsxs("p", { className: "text-sm text-gray-400", children: [ t('profile.member_since'), " ", new Date(user.createdAt).toLocaleDateString(dateLocale), user.lastSeenAt && /*#__PURE__*/ _jsxs("span", { className: "ml-2", children: [ "\xb7 ", formatLastSeen(user.lastSeenAt, t) ] }) ] }) ] }) ] }), user.bio && /*#__PURE__*/ _jsx("p", { className: "mt-4 text-gray-700 text-sm leading-relaxed border-t border-gray-100 pt-4", children: user.bio }), user.phone && /*#__PURE__*/ _jsxs("div", { className: "mt-4 border-t border-gray-100 pt-4 flex items-center gap-2", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M3 5a2 2 0 012-2h3.28a1 1 0 01.948.684l1.498 4.493a1 1 0 01-.502 1.21l-2.257 1.13a11.042 11.042 0 005.516 5.516l1.13-2.257a1 1 0 011.21-.502l4.493 1.498a1 1 0 01.684.949V19a2 2 0 01-2 2h-1C9.716 21 3 14.284 3 6V5z" }) }), /*#__PURE__*/ _jsx("a", { href: "tel:".concat(user.phone), className: "text-sm font-medium text-gray-700 hover:text-green-600", children: user.phone }) ] }), user.personalSiteSlug && /*#__PURE__*/ _jsxs("div", { className: "mt-3 flex items-center gap-2", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _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" }) }), /*#__PURE__*/ _jsxs("a", { href: "/site/".concat(user.personalSiteSlug), target: "_blank", rel: "noopener noreferrer", className: "text-sm text-green-600 hover:underline", children: [ "canhelp.gr/site/", user.personalSiteSlug ] }) ] }), user.languages && user.languages.length > 0 && /*#__PURE__*/ _jsxs("div", { className: "mt-4 border-t border-gray-100 pt-4", children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs font-medium text-gray-500 mb-2 uppercase tracking-wide", children: t('profile.languages') }), /*#__PURE__*/ _jsx("div", { className: "flex flex-wrap gap-2", children: user.languages.map((code)=>{ const langMap = { el: { flag: '🇬🇷', label: 'ΕλληΜικά' }, en: { flag: '🇬🇧', label: 'English' }, ru: { flag: '🇷🇺', label: 'РусскОй' }, uk: { flag: '🇺🇊', label: 'УкраїМська' }, de: { flag: '🇩🇪', label: 'Deutsch' }, fr: { flag: '🇫🇷', label: 'Français' }, it: { flag: '🇮🇹', label: 'Italiano' }, es: { flag: '🇪🇞', label: 'Español' }, ar: { flag: '🇞🇊', label: 'العرؚية' }, zh: { flag: '🇚🇳', label: 'äž­æ–‡' } }; const lang = langMap[code]; if (!lang) return null; return /*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-1.5 bg-indigo-50 text-indigo-700 text-sm px-3 py-1 rounded-full border border-indigo-100", children: [ /*#__PURE__*/ _jsx("span", { children: lang.flag }), /*#__PURE__*/ _jsx("span", { children: lang.label }) ] }, code); }) }) ] }), user.skills && user.skills.length > 0 && specialistCards.length === 0 && /*#__PURE__*/ _jsxs("div", { className: "mt-4 border-t border-gray-100 pt-4", children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs font-medium text-gray-500 mb-2 uppercase tracking-wide", children: t('profile.skills.label') }), /*#__PURE__*/ _jsx("div", { className: "flex flex-wrap gap-2", children: user.skills.map((skill)=>/*#__PURE__*/ _jsx("span", { className: "bg-green-50 text-green-700 text-sm px-3 py-1 rounded-full", children: skill }, skill)) }) ] }), user.role === 'specialist' && user.specialistCategories && user.specialistCategories.length > 0 && specialistCards.length === 0 && /*#__PURE__*/ _jsxs("div", { className: "mt-4 border-t border-gray-100 pt-4", children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs font-medium text-gray-500 mb-2 uppercase tracking-wide", children: t('user.categories') }), /*#__PURE__*/ _jsx("div", { className: "flex flex-wrap gap-2", children: user.specialistCategories.map((slug)=>/*#__PURE__*/ _jsx("span", { className: "bg-purple-50 text-purple-700 text-sm px-3 py-1 rounded-full", children: slug }, slug)) }) ] }), user.role === 'specialist' && user.specialistLocations && user.specialistLocations.length > 0 && specialistCards.length === 0 && /*#__PURE__*/ _jsxs("div", { className: "mt-4 border-t border-gray-100 pt-4", children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs font-medium text-gray-500 mb-2 uppercase tracking-wide", children: t('user.work_area') }), /*#__PURE__*/ _jsx("div", { className: "flex flex-wrap gap-2", children: user.specialistLocations.map((slug)=>/*#__PURE__*/ _jsxs("span", { className: "bg-emerald-50 text-emerald-700 text-sm px-3 py-1 rounded-full", children: [ "\uD83D\uDCCD ", slug ] }, slug)) }) ] }) ] }), user.role === 'specialist' && /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6 mb-6", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between mb-4", children: [ /*#__PURE__*/ _jsxs("h2", { className: "font-bold text-gray-900 text-lg", children: [ "\uD83D\uDCC5 ", t('nav.schedule') ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 text-xs text-gray-500", children: [ /*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-1.5", children: [ /*#__PURE__*/ _jsx("span", { className: "w-3 h-3 rounded bg-emerald-200 border border-emerald-400 inline-block" }), t('schedule.available') ] }), /*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-1.5", children: [ /*#__PURE__*/ _jsx("span", { className: "w-3 h-3 rounded bg-red-200 border border-red-400 inline-block" }), t('schedule.busy') ] }) ] }) ] }), /*#__PURE__*/ _jsx(ReadOnlyCalendar, { year: availYear, month: availMonth, availMap: availMap, today: today, onPrev: ()=>{ if (availMonth === 0) { setAvailYear((y)=>y - 1); setAvailMonth(11); } else setAvailMonth((m)=>m - 1); }, onNext: ()=>{ if (availMonth === 11) { setAvailYear((y)=>y + 1); setAvailMonth(0); } else setAvailMonth((m)=>m + 1); } }) ] }), (user.role === 'specialist' || user.role === 'admin') && specialistCards.length > 0 && /*#__PURE__*/ _jsxs("div", { className: "space-y-4 mb-6", children: [ /*#__PURE__*/ _jsx("h2", { className: "font-bold text-white text-lg", children: t('nav.specialists') }), specialistCards.map((card)=>{ var _priceLists_card_id; return /*#__PURE__*/ _jsx(PublicCardView, { card: card, locale: locale, catMap: catMap, locMap: locMap, t: t, priceList: (_priceLists_card_id = priceLists[card.id]) !== null && _priceLists_card_id !== void 0 ? _priceLists_card_id : [] }, card.id); }) ] }), /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ _jsxs("h2", { className: "font-bold text-gray-900 text-lg mb-4", children: [ t('profile.reviews'), reviews.length > 0 && /*#__PURE__*/ _jsxs("span", { className: "text-gray-400 font-normal text-base ml-2", children: [ "(", reviews.length, ")" ] }) ] }), reviews.length === 0 ? /*#__PURE__*/ _jsx("p", { className: "text-gray-500 text-sm", children: t('profile.no_reviews') }) : /*#__PURE__*/ _jsx("div", { className: "space-y-4", children: reviews.map((param)=>{ let { review, author } = param; var _author_name_, _author_name; var _author_name__toUpperCase, _shortName; return /*#__PURE__*/ _jsx("div", { className: "border-b border-gray-50 pb-4 last:border-0 last:pb-0", children: /*#__PURE__*/ _jsxs("div", { className: "flex items-start gap-3", children: [ /*#__PURE__*/ _jsx("div", { className: "w-8 h-8 rounded-full bg-gray-100 flex-shrink-0 flex items-center justify-center text-gray-600 text-sm font-bold overflow-hidden", children: (author === null || author === void 0 ? void 0 : author.image) ? /*#__PURE__*/ _jsx("img", { src: author.image, alt: author.name, className: "w-full h-full object-cover" }) : (_author_name__toUpperCase = author === null || author === void 0 ? void 0 : (_author_name = author.name) === null || _author_name === void 0 ? void 0 : (_author_name_ = _author_name[0]) === null || _author_name_ === void 0 ? void 0 : _author_name_.toUpperCase()) !== null && _author_name__toUpperCase !== void 0 ? _author_name__toUpperCase : '?' }), /*#__PURE__*/ _jsxs("div", { className: "flex-1", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 mb-1", children: [ /*#__PURE__*/ _jsx("span", { className: "text-sm font-medium text-gray-800", children: (_shortName = shortName(author === null || author === void 0 ? void 0 : author.name)) !== null && _shortName !== void 0 ? _shortName : '—' }), /*#__PURE__*/ _jsxs("span", { className: "text-yellow-400", children: [ '★'.repeat(review.rating), '☆'.repeat(5 - review.rating) ] }) ] }), review.comment && /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-600", children: review.comment }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-1", children: new Date(review.createdAt).toLocaleDateString(dateLocale) }) ] }) ] }) }, review.id); }) }) ] }) ] }); } function ReadOnlyCalendar(param) { let { year, month, availMap, today, onPrev, onNext } = param; const { locale, t } = useLocale(); var _WEEK_DAYS_BY_LOCALE_locale; const weekDays = (_WEEK_DAYS_BY_LOCALE_locale = WEEK_DAYS_BY_LOCALE[locale]) !== null && _WEEK_DAYS_BY_LOCALE_locale !== void 0 ? _WEEK_DAYS_BY_LOCALE_locale : WEEK_DAYS_BY_LOCALE.ru; var _MONTHS_BY_LOCALE_locale; const months = (_MONTHS_BY_LOCALE_locale = MONTHS_BY_LOCALE[locale]) !== null && _MONTHS_BY_LOCALE_locale !== void 0 ? _MONTHS_BY_LOCALE_locale : MONTHS_BY_LOCALE.ru; const firstDay = new Date(year, month, 1); const startDow = (firstDay.getDay() + 6) % 7; const daysInMonth = new Date(year, month + 1, 0).getDate(); const prevMonthDays = new Date(year, month, 0).getDate(); const cells = []; for(let i = startDow - 1; i >= 0; i--){ cells.push({ day: prevMonthDays - i, cur: false, dateKey: '' }); } for(let d = 1; d <= daysInMonth; d++){ const dateKey = "".concat(year, "-").concat(String(month + 1).padStart(2, '0'), "-").concat(String(d).padStart(2, '0')); cells.push({ day: d, cur: true, dateKey }); } const remainder = cells.length % 7; if (remainder !== 0) { for(let d = 1; d <= 7 - remainder; d++){ cells.push({ day: d, cur: false, dateKey: '' }); } } const monthPrefix = "".concat(year, "-").concat(String(month + 1).padStart(2, '0')); const availCount = Object.entries(availMap).filter((param)=>{ let [k, v] = param; return k.startsWith(monthPrefix) && k >= today && v === 'available'; }).length; return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between mb-3", children: [ /*#__PURE__*/ _jsx("button", { onClick: onPrev, className: "w-7 h-7 rounded-lg hover:bg-gray-100 flex items-center justify-center text-gray-500", children: "‹" }), /*#__PURE__*/ _jsxs("div", { className: "text-center", children: [ /*#__PURE__*/ _jsxs("span", { className: "font-medium text-gray-800 text-sm", children: [ months[month], " ", year ] }), availCount > 0 && /*#__PURE__*/ _jsxs("span", { className: "ml-2 text-xs text-emerald-600", children: [ availCount, " ", t('schedule.free_days') ] }) ] }), /*#__PURE__*/ _jsx("button", { onClick: onNext, className: "w-7 h-7 rounded-lg hover:bg-gray-100 flex items-center justify-center text-gray-500", children: "›" }) ] }), /*#__PURE__*/ _jsx("div", { className: "grid grid-cols-7 mb-1", children: weekDays.map((d)=>/*#__PURE__*/ _jsx("div", { className: "text-center text-xs text-gray-400 py-1", children: d }, d)) }), /*#__PURE__*/ _jsx("div", { className: "grid grid-cols-7 gap-0.5", children: cells.map((cell, idx)=>{ if (!cell.cur) { return /*#__PURE__*/ _jsx("div", { className: "h-9 flex items-center justify-center text-xs text-gray-200", children: cell.day }, "e-".concat(idx)); } const status = availMap[cell.dateKey]; const isPast = cell.dateKey < today; const isToday = cell.dateKey === today; let cls = 'h-9 flex items-center justify-center rounded-lg text-sm font-medium '; if (isPast) { cls += 'text-gray-200 '; } else if (status === 'available') { cls += 'bg-emerald-100 border border-emerald-300 text-emerald-700 '; } else if (status === 'busy') { cls += 'bg-red-100 border border-red-300 text-red-600 '; } else { cls += 'text-gray-500 '; } if (isToday) cls += 'ring-2 ring-blue-400 ring-offset-1 '; return /*#__PURE__*/ _jsx("div", { className: cls, children: cell.day }, cell.dateKey); }) }) ] }); } // ─── Public card view ───────────────────────────────────────────────────────── function flattenTree(nodes) { return nodes.flatMap((n)=>{ var _n_children; return [ n, ...flattenTree((_n_children = n.children) !== null && _n_children !== void 0 ? _n_children : []) ]; }); } function PublicCardView(param) { let { card, locale, catMap, locMap, t, priceList } = param; const [lightbox, setLightbox] = useState(null); const [expandedAreas, setExpandedAreas] = useState([]); const locById = new Map(); for (const node of locMap.values()){ if (node === null || node === void 0 ? void 0 : node.id) locById.set(node.id, node); } const getLocName = (loc, fallback)=>{ var _loc_names, _loc_names1; return (loc === null || loc === void 0 ? void 0 : (_loc_names = loc.names) === null || _loc_names === void 0 ? void 0 : _loc_names[locale]) || (loc === null || loc === void 0 ? void 0 : (_loc_names1 = loc.names) === null || _loc_names1 === void 0 ? void 0 : _loc_names1.el) || fallback; }; const locationGroups = (()=>{ const grouped = new Map(); var _card_locations; for (const slug of (_card_locations = card.locations) !== null && _card_locations !== void 0 ? _card_locations : []){ const loc = locMap.get(slug); if (!loc) { if (!grouped.has(slug)) { grouped.set(slug, { root: { slug, names: { el: slug } }, rootSlug: slug, districts: [], districtSlugs: new Set() }); } continue; } let root = loc; const seenIds = new Set(); while((root === null || root === void 0 ? void 0 : root.parentId) && locById.has(root.parentId) && !seenIds.has(root.parentId)){ seenIds.add(root.parentId); root = locById.get(root.parentId); } var _root_slug; const rootSlug = (_root_slug = root === null || root === void 0 ? void 0 : root.slug) !== null && _root_slug !== void 0 ? _root_slug : slug; if (!grouped.has(rootSlug)) { grouped.set(rootSlug, { root, rootSlug, districts: [], districtSlugs: new Set() }); } const group = grouped.get(rootSlug); if (loc.slug !== rootSlug && !group.districtSlugs.has(loc.slug)) { group.districtSlugs.add(loc.slug); group.districts.push(loc); } } return Array.from(grouped.values()); })(); var _lightbox_title; return /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 overflow-hidden", children: [ /*#__PURE__*/ _jsxs("div", { className: "px-5 py-4 border-b border-gray-100", children: [ /*#__PURE__*/ _jsx("h3", { className: "font-bold text-gray-900", children: card.title }), card.description && /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-600 mt-1", children: card.description }) ] }), /*#__PURE__*/ _jsxs("div", { className: "p-5 space-y-4", children: [ card.skills && card.skills.length > 0 && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs font-semibold text-gray-500 uppercase tracking-wide mb-2", children: t('card.skills') }), /*#__PURE__*/ _jsx("div", { className: "flex flex-wrap gap-2", children: card.skills.map((s)=>/*#__PURE__*/ _jsx("span", { className: "bg-green-50 text-green-700 text-sm px-3 py-1 rounded-full", children: s }, s)) }) ] }), card.categories && card.categories.length > 0 && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs font-semibold text-gray-500 uppercase tracking-wide mb-2", children: t('card.categories') }), /*#__PURE__*/ _jsx("div", { className: "flex flex-wrap gap-2", children: card.categories.map((s)=>{ var _cat_names, _cat_names1; const cat = catMap.get(s); const name = cat ? ((_cat_names = cat.names) === null || _cat_names === void 0 ? void 0 : _cat_names[locale]) || ((_cat_names1 = cat.names) === null || _cat_names1 === void 0 ? void 0 : _cat_names1.el) || s : s; return /*#__PURE__*/ _jsxs("span", { className: "bg-purple-50 text-purple-700 text-sm px-3 py-1 rounded-full", children: [ (cat === null || cat === void 0 ? void 0 : cat.icon) ? /*#__PURE__*/ _jsx("span", { className: "mr-1 inline-flex align-middle", children: /*#__PURE__*/ _jsx(CategoryIcon, { icon: cat.icon, alt: name, className: isCategoryIconUrl(cat.icon) ? 'h-4 w-4 object-contain' : 'text-sm leading-none', fallback: "\uD83D\uDCE6" }) }) : null, name ] }, s); }) }) ] }), card.locations && card.locations.length > 0 && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs font-semibold text-gray-500 uppercase tracking-wide mb-2", children: t('user.work_area') }), /*#__PURE__*/ _jsxs("div", { className: "space-y-2", children: [ /*#__PURE__*/ _jsx("div", { className: "flex flex-wrap gap-2", children: locationGroups.map((group)=>{ const expanded = expandedAreas.includes(group.rootSlug); const canExpand = group.districts.length > 0; return /*#__PURE__*/ _jsxs("button", { type: "button", onClick: ()=>{ if (!canExpand) return; setExpandedAreas((prev)=>prev.includes(group.rootSlug) ? prev.filter((slug)=>slug !== group.rootSlug) : [ ...prev, group.rootSlug ]); }, className: "inline-flex items-center gap-1.5 text-sm px-3 py-1.5 rounded-full border transition ".concat(expanded ? 'bg-emerald-100 text-emerald-800 border-emerald-300' : 'bg-emerald-50 text-emerald-700 border-emerald-200 hover:bg-emerald-100', " ").concat(canExpand ? 'cursor-pointer' : 'cursor-default'), children: [ /*#__PURE__*/ _jsx("span", { children: "\uD83D\uDCCD" }), /*#__PURE__*/ _jsx("span", { children: getLocName(group.root, group.rootSlug) }), canExpand && /*#__PURE__*/ _jsx("span", { className: "text-[11px] font-semibold px-1.5 py-0.5 rounded-full bg-white/80 text-emerald-700 border border-emerald-200", children: expanded ? '−' : "+".concat(group.districts.length) }) ] }, group.rootSlug); }) }), locationGroups.filter((group)=>expandedAreas.includes(group.rootSlug) && group.districts.length > 0).map((group)=>/*#__PURE__*/ _jsxs("div", { className: "rounded-xl border border-emerald-100 bg-emerald-50/40 p-3", children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs text-emerald-700 font-medium mb-2", children: getLocName(group.root, group.rootSlug) }), /*#__PURE__*/ _jsx("div", { className: "flex flex-wrap gap-1.5", children: group.districts.map((district)=>/*#__PURE__*/ _jsx("span", { className: "text-xs px-2.5 py-1 rounded-full bg-white border border-emerald-200 text-emerald-700", children: getLocName(district, district.slug) }, district.slug)) }) ] }, "".concat(group.rootSlug, "-children"))) ] }) ] }), priceList.length > 0 && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs font-semibold text-gray-500 uppercase tracking-wide mb-3", children: t('profile.card.tab.pricelist') }), /*#__PURE__*/ _jsx("div", { className: "space-y-3", children: priceList.map((group)=>/*#__PURE__*/ _jsxs("div", { className: "border border-gray-200 rounded-xl overflow-hidden", children: [ /*#__PURE__*/ _jsx("div", { className: "bg-gray-50 px-4 py-2 border-b border-gray-200", children: /*#__PURE__*/ _jsx("span", { className: "font-semibold text-sm text-gray-800", children: group.title }) }), /*#__PURE__*/ _jsx("div", { className: "divide-y divide-gray-100", children: group.items.map((item)=>/*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 px-4 py-2.5 text-sm", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ _jsx("p", { className: "font-medium text-gray-800", children: item.name }), item.description && /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-500", children: item.description }) ] }), (item.price || item.unit) && /*#__PURE__*/ _jsxs("span", { className: "text-green-700 font-semibold whitespace-nowrap", children: [ item.price ? "€".concat(item.price) : '', item.unit ? " ".concat(item.unit) : '' ] }) ] }, item.id)) }) ] }, group.id)) }) ] }), card.portfolio && card.portfolio.length > 0 && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs font-semibold text-gray-500 uppercase tracking-wide mb-2", children: t('card.portfolio') }), /*#__PURE__*/ _jsx("div", { className: "grid grid-cols-2 sm:grid-cols-3 gap-3", children: card.portfolio.map((item)=>{ var _item_title; return /*#__PURE__*/ _jsxs("button", { type: "button", onClick: ()=>setLightbox(item), className: "group relative rounded-xl overflow-hidden border border-gray-200 bg-gray-50 text-left", children: [ /*#__PURE__*/ _jsx("img", { src: item.imageUrl, alt: (_item_title = item.title) !== null && _item_title !== void 0 ? _item_title : '', className: "w-full aspect-square object-cover group-hover:scale-105 transition-transform duration-200" }), item.title && /*#__PURE__*/ _jsx("div", { className: "px-2 py-1.5", children: /*#__PURE__*/ _jsx("p", { className: "text-xs font-medium text-gray-700 truncate", children: item.title }) }) ] }, item.id); }) }) ] }) ] }), lightbox && /*#__PURE__*/ _jsx("div", { className: "fixed inset-0 z-50 flex items-center justify-center bg-black/80 px-4", onClick: ()=>setLightbox(null), children: /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-2xl overflow-hidden max-w-lg w-full shadow-2xl", onClick: (e)=>e.stopPropagation(), children: [ /*#__PURE__*/ _jsx("img", { src: lightbox.imageUrl, alt: (_lightbox_title = lightbox.title) !== null && _lightbox_title !== void 0 ? _lightbox_title : '', className: "w-full max-h-[60vh] object-contain bg-gray-900" }), (lightbox.title || lightbox.description) && /*#__PURE__*/ _jsxs("div", { className: "p-4", children: [ lightbox.title && /*#__PURE__*/ _jsx("p", { className: "font-semibold text-gray-800 mb-1", children: lightbox.title }), lightbox.description && /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-600", children: lightbox.description }) ] }), /*#__PURE__*/ _jsx("div", { className: "flex justify-end px-4 pb-4", children: /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setLightbox(null), className: "text-sm text-gray-500 hover:text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-100", children: t('card.close') }) }) ] }) }) ] }); } @ãb={}_šªàâ79KM‡‰ÆÈýÿ13~M [ ñ ù  C L d l  ” ¿ _Æ í ô  & a h — ž Å Ì ú  7 > p w © ° Ú á @ G … Œ Ã Ê ‚ŠÍÚõ_!4@_jpf{MY–­Znìô™=@ÐÓå_ók!o!Û!ß!z"~"ã$æ$€%š%y&}&L'O'†(‰(#*'*ö*ù*6,:,E/I/.01030;0°1³1µ1_œ13”3*4-4I5L5†6Š60747 8 8R9U9W9_9Ô:×:Ù:á:_<c<ª=­=·?»?AA&C*C‚D_†DDFGFNHQHÊJÍJMLPLRL^LÞMâM PPRR’T•TòUöUþXYúYýY5\9\] ]^^;__?_b bœcÁcœdÊd3f6f!g%gßgâg@iCi4k7k§l«lGmJmšn«npp“r—r9s€B€ü€ÿ€IŠLŠ"©&©è©ì©Üªßª««³«ª¬®¬H¯K¯k°n°2³:³Ä¹È¹ºº“º–º§»«»6Œ_:ŒÅœÉœw¿z¿€À§À Á#ÁäÁçÁ®Â±ÂôÆ÷ÆÉˆÉ¿ÉÆÉQÓUÓßÓãÓmÔpÔ3Õ6ÕÖ ÖšÖ¬Ö×_רأ؊Ø%Ú)ڂڅچۉÛÍÝÑÝôÞ÷ާߪ߬߷ß~àŽàÑâÕâ.ã1ã1ä5äÖäÙäæƒæÚê_ÝêŽë·ë³ì¶ìŠïŽïƒð†ðÒñÕñ¥òšòjõnõÇõÊõÖöÙök÷o÷PøSøùùnúqú3û7ûBüFüLý_OýÒþÕþÝឌ/3»Ÿ£ Š C F } € FJ47¿Ãdgjm„B‡ €€€€€€€€€€€€×__WEBPACK_MODULE_REFERENCE__2_5b22757365506172616d73225d_call_directImport_asiSafe1__._×__WEBPACK_MODULE_REFERENCE__3_5b227573654c6f63616c65225d_call_directImport_asiSafe1__._Ù__WEBPACK_MODULE_REFERENCE__4_5b2275736553657373696f6e225d_call_directImport_asiSafe1__._×__WEBPACK_MODULE_REFERENCE__2_5b22757365526f75746572225d_call_directImport_asiSafe1__._Õ__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._ÿÿÿÿÿÿÿÿÿÿÿÿÿÿ×__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._á__WEBPACK_MODULE_REFERENCE__5_5b226765745573657250726f66696c65225d_call_directImport_asiSafe1__._á__WEBPACK_MODULE_REFERENCE__5_5b226765745573657252657669657773225d_call_directImport_asiSafe1__._ß__WEBPACK_MODULE_REFERENCE__5_5b2267657455736572526174696e67225d_call_directImport_asiSafe1__._ß__WEBPACK_MODULE_REFERENCE__5_5b2267657443617465676f72696573225d_call_directImport_asiSafe1__._Ý__WEBPACK_MODULE_REFERENCE__5_5b226765744c6f636174696f6e73225d_call_directImport_asiSafe1__._é__WEBPACK_MODULE_REFERENCE__5_5b226765745370656369616c6973744361726473225d_call_directImport_asiSafe1__._Ý__WEBPACK_MODULE_REFERENCE__5_5b2267657450726963654c697374225d_call_directImport_asiSafe1__._øñ__WEBPACK_MODULE_REFERENCE__5_5b226765745370656369616c6973744661766f7269746573225d_call_directImport_asiSafe1__._ß__WEBPACK_MODULE_REFERENCE__5_5b2267657443616e4d657373616765225d_call_directImport_asiSafe1__._õ__WEBPACK_MODULE_REFERENCE__5_5b2272656d6f76655370656369616c6973744661766f72697465225d_call_directImport_asiSafe1__._ï__WEBPACK_MODULE_REFERENCE__5_5b226164645370656369616c6973744661766f72697465225d_call_directImport_asiSafe1__._ï__WEBPACK_MODULE_REFERENCE__5_5b226765744f72437265617465446972656374526f6f6d225d_call_directImport_asiSafe1__._ó÷__WEBPACK_MODULE_REFERENCE__5_5b226765745370656369616c697374417661696c6162696c697479225d_call_directImport_asiSafe1__._Ë__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._ÿã__WEBPACK_MODULE_REFERENCE__8_5b22666f726d617453686f72744e616d65225d_call_directImport_asiSafe1__._Í__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._ÿÿýÿÿýýÿýÿÿýÓ__WEBPACK_MODULE_REFERENCE__10_5b22506c616e4261646765225d_directImport_asiSafe1__._üÿþüüþþüüÿüÿþüþüþþüüüüÚ__WEBPACK_MODULE_REFERENCE__7_5b225570677261646550726f6d7074225d_directImport_asiSafe1__._ýûûûýûûýûûýýýá__WEBPACK_MODULE_REFERENCE__9_5b22666f726d61744c6173745365656e225d_call_directImport_asiSafe1__._úüúúúüúúüüúúüúúüúúúüúúúüúúüüüüüüúüúúüúúüüüúúúüúúüüú×__WEBPACK_MODULE_REFERENCE__8_5b2273686f72744e616d65225d_call_directImport_asiSafe1__._ûùùçûûùûûûùùùùùùêêûûùùûûùùùûùùûùùÙ__WEBPACK_MODULE_REFERENCE__11_5b2243617465676f727949636f6e225d_directImport_asiSafe1__._è__WEBPACK_MODULE_REFERENCE__11_5b22697343617465676f727949636f6e55726c225d_call_directImport_asiSafe1__._ù÷ù÷ù÷÷÷ù÷÷÷ù÷÷ù÷÷÷ùù÷÷ùù÷÷ù÷÷÷÷ù÷ù÷÷÷÷ìR/* __next_internal_client_entry_do_not_use__ default auto */ const MONTHS_BY_LOCALE = { ru: [ 'ЯМварь', 'Ѐевраль', 'Март', 'Апрель', 'Май', 'ИюМь', 'Июль', 'Август', 'СеМтябрь', 'Октябрь', 'НПябрь', 'Декабрь' ], en: [ 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December' ], el: [ 'ΙαΜουάριος', 'Ίεβρουάριος', 'Μάρτιος', 'Απρίλιος', 'Μάιος', 'ΙούΜιος', 'Ιούλιος', 'Αύγουστος', 'ΣεπτέΌβριος', 'Οκτώβριος', 'ΝοέΌβριος', 'ΔεκέΌβριος' ], uk: [ 'СічеМь', 'ЛютОй', 'БерезеМь', 'КвітеМь', 'ТравеМь', 'ЧервеМь', 'ЛОпеМь', 'СерпеМь', 'ВересеМь', 'ЖПвтеМь', 'ЛОстПпаЎ', 'ГруЎеМь' ] }; const WEEK_DAYS_BY_LOCALE = { ru: [ 'ПМ', 'Вт', 'Ср', 'Чт', 'Пт', 'Сб', 'Вс' ], en: [ 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa', 'Su' ], el: [ 'Δε', '΀ρ', '΀ε', 'Πε', 'Πα', 'Σά', 'Κυ' ], uk: [ 'ПМ', 'Вт', 'Ср', 'Чт', 'Пт', 'Сб', 'НЎ' ] }; function UserProfilePage() { var _user_firstName, _user_lastName, _user_name_, _user_name, _user_siteSettings, _session_user; const { id } = __WEBPACK_MODULE_REFERENCE__2_5b22757365506172616d73225d_call_directImport_asiSafe1__._(); const { t, locale } = __WEBPACK_MODULE_REFERENCE__3_5b227573654c6f63616c65225d_call_directImport_asiSafe1__._(); const { data: session } = __WEBPACK_MODULE_REFERENCE__4_5b2275736553657373696f6e225d_call_directImport_asiSafe1__._(); const router = __WEBPACK_MODULE_REFERENCE__2_5b22757365526f75746572225d_call_directImport_asiSafe1__._(); const [user, setUser] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._(null); const [reviews, setReviews] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._([]); const [rating, setRating] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._(null); const [loading, setLoading] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._(true); const [specialistCards, setSpecialistCards] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._([]); const [priceLists, setPriceLists] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._({}); const [catMap, setCatMap] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._(new Map()); const [locMap, setLocMap] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._(new Map()); const [isFavorite, setIsFavorite] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._(false); const [favLoading, setFavLoading] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._(false); const [msgLoading, setMsgLoading] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._(false); const [canMsg, setCanMsg] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._(null); // Availability const now = new Date(); const [availYear, setAvailYear] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._(now.getFullYear()); const [availMonth, setAvailMonth] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._(now.getMonth()); const [availMap, setAvailMap] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._({}); const today = new Date().toISOString().slice(0, 10); const dateLocale = locale === 'ru' ? 'ru-RU' : locale === 'uk' ? 'uk-UA' : locale === 'en' ? 'en-US' : 'el-GR'; __WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._(()=>{ if (!id) return; Promise.all([ __WEBPACK_MODULE_REFERENCE__5_5b226765745573657250726f66696c65225d_call_directImport_asiSafe1__._(id, locale), __WEBPACK_MODULE_REFERENCE__5_5b226765745573657252657669657773225d_call_directImport_asiSafe1__._(id), __WEBPACK_MODULE_REFERENCE__5_5b2267657455736572526174696e67225d_call_directImport_asiSafe1__._(id), __WEBPACK_MODULE_REFERENCE__5_5b2267657443617465676f72696573225d_call_directImport_asiSafe1__._().catch(()=>[]), __WEBPACK_MODULE_REFERENCE__5_5b226765744c6f636174696f6e73225d_call_directImport_asiSafe1__._().catch(()=>[]) ]).then((param)=>{ let [u, r, rt, cats, locs] = param; setUser(u); setReviews(r); setRating(rt.avg); setCatMap(new Map(flattenTree(cats).map((c)=>[ c.slug, c ]))); setLocMap(new Map(flattenTree(locs).map((l)=>[ l.slug, l ]))); if (u.role === 'specialist' || u.role === 'admin') { __WEBPACK_MODULE_REFERENCE__5_5b226765745370656369616c6973744361726473225d_call_directImport_asiSafe1__._(id, locale).then((cards)=>{ setSpecialistCards(cards); cards.forEach((c)=>{ __WEBPACK_MODULE_REFERENCE__5_5b2267657450726963654c697374225d_call_directImport_asiSafe1__._(c.id, locale).then((pl)=>{ if (pl.length > 0) setPriceLists((prev)=>({ ...prev, [c.id]: pl })); }).catch(()=>{}); }); }).catch(()=>{}); } }).catch(()=>{}).finally(()=>setLoading(false)); }, [ id, locale ]); // Load favorite status when session available __WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._(()=>{ var _session_user; if (!session || !id) return; __WEBPACK_MODULE_REFERENCE__5_5b226765745370656369616c6973744661766f7269746573225d_call_directImport_asiSafe1__._().then((rows)=>setIsFavorite(rows.some((r)=>{ var _r_specialist; return ((_r_specialist = r.specialist) === null || _r_specialist === void 0 ? void 0 : _r_specialist.id) === id; }))).catch(()=>{}); // Check if current user can message this person const myId = (_session_user = session.user) === null || _session_user === void 0 ? void 0 : _session_user.id; if (myId && myId !== id) { __WEBPACK_MODULE_REFERENCE__5_5b2267657443616e4d657373616765225d_call_directImport_asiSafe1__._(id).then(setCanMsg).catch(()=>{}); } }, [ session, id ]); async function toggleFavorite() { if (!session) { router.push('/register'); return; } setFavLoading(true); try { if (isFavorite) { await __WEBPACK_MODULE_REFERENCE__5_5b2272656d6f76655370656369616c6973744661766f72697465225d_call_directImport_asiSafe1__._(id); setIsFavorite(false); } else { await __WEBPACK_MODULE_REFERENCE__5_5b226164645370656369616c6973744661766f72697465225d_call_directImport_asiSafe1__._(id); setIsFavorite(true); } } catch (e) {} setFavLoading(false); } async function handleMessage() { if (!session) { router.push('/login'); return; } setMsgLoading(true); try { const { room } = await __WEBPACK_MODULE_REFERENCE__5_5b226765744f72437265617465446972656374526f6f6d225d_call_directImport_asiSafe1__._(id); router.push("/chat?room=".concat(room.id)); } catch (e) {} setMsgLoading(false); } __WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._(()=>{ if (!id) return; const monthKey = "".concat(availYear, "-").concat(String(availMonth + 1).padStart(2, '0')); __WEBPACK_MODULE_REFERENCE__5_5b226765745370656369616c697374417661696c6162696c697479225d_call_directImport_asiSafe1__._(id, monthKey).then((rows)=>{ setAvailMap((prev)=>{ const next = { ...prev }; rows.forEach((r)=>{ next[r.date] = r.status; }); return next; }); }).catch(()=>{}); }, [ id, availYear, availMonth ]); if (loading) return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "text-center py-20 text-white", children: t('common.loading') }); if (!user) return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "text-center py-20 text-white/70", children: t('common.error') }); var _user_firstName_, _user_lastName_; const initials = "".concat((_user_firstName_ = (_user_firstName = user.firstName) === null || _user_firstName === void 0 ? void 0 : _user_firstName[0]) !== null && _user_firstName_ !== void 0 ? _user_firstName_ : '').concat((_user_lastName_ = (_user_lastName = user.lastName) === null || _user_lastName === void 0 ? void 0 : _user_lastName[0]) !== null && _user_lastName_ !== void 0 ? _user_lastName_ : '').toUpperCase() || ((_user_name = user.name) === null || _user_name === void 0 ? void 0 : (_user_name_ = _user_name[0]) === null || _user_name_ === void 0 ? void 0 : _user_name_.toUpperCase()) || '?'; const displayName = __WEBPACK_MODULE_REFERENCE__8_5b22666f726d617453686f72744e616d65225d_call_directImport_asiSafe1__._(user.firstName, user.lastName, user.name); const profileBackgroundImage = typeof ((_user_siteSettings = user.siteSettings) === null || _user_siteSettings === void 0 ? void 0 : _user_siteSettings.profileBackgroundImage) === 'string' && user.siteSettings.profileBackgroundImage.trim().length > 0 ? user.siteSettings.profileBackgroundImage : null; return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "max-w-3xl mx-auto px-4 py-10", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "bg-white rounded-xl border border-gray-200 p-6 mb-6", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "relative -mx-6 -mt-6 mb-5 h-44 overflow-hidden rounded-t-xl", style: { backgroundImage: profileBackgroundImage ? "linear-gradient(135deg, rgba(21, 128, 61, 0.45), rgba(22, 163, 74, 0.65)), url(".concat(profileBackgroundImage, ")") : 'linear-gradient(135deg, #22c55e 0%, #16a34a 45%, #166534 100%)', backgroundSize: 'cover', backgroundPosition: 'center' }, children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "absolute inset-0 bg-gradient-to-b from-black/10 to-black/30" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "relative h-full w-full p-5 flex items-end justify-between", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "flex items-center gap-3 min-w-0", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "w-14 h-14 rounded-full bg-white/20 border border-white/40 overflow-hidden flex items-center justify-center text-white text-xl font-bold backdrop-blur-sm", children: user.image ? /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("img", { src: user.image, alt: displayName, className: "w-full h-full object-cover" }) : initials }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "min-w-0", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { className: "text-white text-lg font-bold truncate", children: displayName }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("p", { className: "text-white/85 text-xs", children: [ t('profile.member_since'), " ", new Date(user.createdAt).toLocaleDateString(dateLocale) ] }) ] }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "shrink-0", children: [ user.planTier && user.planTier !== 'free' && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__10_5b22506c616e4261646765225d_directImport_asiSafe1__._, { tier: user.planTier, verified: user.hasVerifiedBadge, size: "sm" }), user.hasVerifiedBadge && user.planTier === 'free' && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__10_5b22506c616e4261646765225d_directImport_asiSafe1__._, { tier: "free", verified: true, size: "sm" }) ] }) ] }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "flex items-start gap-5", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "w-20 h-20 rounded-full bg-green-100 flex-shrink-0 flex items-center justify-center text-green-700 text-2xl font-bold overflow-hidden border-2 border-gray-100", children: user.image ? /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("img", { src: user.image, alt: displayName, className: "w-full h-full object-cover" }) : initials }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "flex items-center gap-2 flex-wrap mb-1", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("h1", { className: "text-xl font-bold text-gray-900", children: displayName }), user.planTier && user.planTier !== 'free' && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__10_5b22506c616e4261646765225d_directImport_asiSafe1__._, { tier: user.planTier, verified: user.hasVerifiedBadge, size: "sm" }), user.hasVerifiedBadge && user.planTier === 'free' && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__10_5b22506c616e4261646765225d_directImport_asiSafe1__._, { tier: "free", verified: true, size: "sm" }), Array.isArray(user.activeStatuses) && user.activeStatuses.includes('can_help_now') && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("span", { className: "inline-flex items-center gap-1 text-xs font-medium text-green-700 bg-green-50 border border-green-200 px-2 py-0.5 rounded-full", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { className: "w-1.5 h-1.5 rounded-full bg-green-500 animate-pulse" }), t('status.can_help_now', 'Available now') ] }), Array.isArray(user.activeStatuses) && user.activeStatuses.includes('need_help') && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("span", { className: "inline-flex items-center gap-1 text-xs font-medium text-green-700 bg-green-50 border border-green-200 px-2 py-0.5 rounded-full", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { className: "w-1.5 h-1.5 rounded-full bg-green-500" }), t('status.need_help', 'Need help') ] }), (session ? ((_session_user = session.user) === null || _session_user === void 0 ? void 0 : _session_user.id) !== id : true) && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "ml-auto flex items-center gap-2", children: [ !session ? // Guest — show button that leads to registration /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("a", { href: "/register", className: "flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-sm font-medium bg-green-50 text-green-600 border border-green-200 hover:bg-green-100 transition", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { children: t('chat.write_btn', 'Write') }) ] }) : (canMsg === null || canMsg === void 0 ? void 0 : canMsg.allowed) === false ? /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__7_5b225570677261646550726f6d7074225d_directImport_asiSafe1__._, { feature: t('chat.write_btn', 'Write'), requiredTier: "pro", variant: "inline", t: t }) : /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("button", { onClick: handleMessage, disabled: msgLoading, className: "flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-sm font-medium bg-green-50 text-green-600 border border-green-200 hover:bg-green-100 transition disabled:opacity-50", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { children: t('chat.write_btn') }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("button", { onClick: toggleFavorite, disabled: favLoading, title: isFavorite ? t('specialist.unfavorite') : t('specialist.favorite'), className: "flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-sm font-medium transition disabled:opacity-50 ".concat(isFavorite ? 'bg-pink-50 text-pink-600 border border-pink-200 hover:bg-pink-100' : 'bg-gray-50 text-gray-600 border border-gray-200 hover:bg-gray-100'), children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { children: isFavorite ? '❀' : '🀍' }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { children: isFavorite ? t('specialist.unfavorite') : t('specialist.favorite') }) ] }) ] }) ] }), rating && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "flex items-center gap-1.5 mb-2", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { className: "text-yellow-400 text-lg", children: "★" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { className: "font-semibold text-gray-800", children: Number(rating).toFixed(1) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("span", { className: "text-sm text-gray-400", children: [ "(", reviews.length, " ", t('profile.reviews').toLowerCase(), ")" ] }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("p", { className: "text-sm text-gray-400", children: [ t('profile.member_since'), " ", new Date(user.createdAt).toLocaleDateString(dateLocale), user.lastSeenAt && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("span", { className: "ml-2", children: [ "\xb7 ", __WEBPACK_MODULE_REFERENCE__9_5b22666f726d61744c6173745365656e225d_call_directImport_asiSafe1__._(user.lastSeenAt, t) ] }) ] }) ] }) ] }), user.bio && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { className: "mt-4 text-gray-700 text-sm leading-relaxed border-t border-gray-100 pt-4", children: user.bio }), user.phone && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "mt-4 border-t border-gray-100 pt-4 flex items-center gap-2", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M3 5a2 2 0 012-2h3.28a1 1 0 01.948.684l1.498 4.493a1 1 0 01-.502 1.21l-2.257 1.13a11.042 11.042 0 005.516 5.516l1.13-2.257a1 1 0 011.21-.502l4.493 1.498a1 1 0 01.684.949V19a2 2 0 01-2 2h-1C9.716 21 3 14.284 3 6V5z" }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("a", { href: "tel:".concat(user.phone), className: "text-sm font-medium text-gray-700 hover:text-green-600", children: user.phone }) ] }), user.personalSiteSlug && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "mt-3 flex items-center gap-2", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("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" }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("a", { href: "/site/".concat(user.personalSiteSlug), target: "_blank", rel: "noopener noreferrer", className: "text-sm text-green-600 hover:underline", children: [ "canhelp.gr/site/", user.personalSiteSlug ] }) ] }), user.languages && user.languages.length > 0 && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "mt-4 border-t border-gray-100 pt-4", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { className: "text-xs font-medium text-gray-500 mb-2 uppercase tracking-wide", children: t('profile.languages') }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "flex flex-wrap gap-2", children: user.languages.map((code)=>{ const langMap = { el: { flag: '🇬🇷', label: 'ΕλληΜικά' }, en: { flag: '🇬🇧', label: 'English' }, ru: { flag: '🇷🇺', label: 'РусскОй' }, uk: { flag: '🇺🇊', label: 'УкраїМська' }, de: { flag: '🇩🇪', label: 'Deutsch' }, fr: { flag: '🇫🇷', label: 'Français' }, it: { flag: '🇮🇹', label: 'Italiano' }, es: { flag: '🇪🇞', label: 'Español' }, ar: { flag: '🇞🇊', label: 'العرؚية' }, zh: { flag: '🇚🇳', label: 'äž­æ–‡' } }; const lang = langMap[code]; if (!lang) return null; return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("span", { className: "flex items-center gap-1.5 bg-indigo-50 text-indigo-700 text-sm px-3 py-1 rounded-full border border-indigo-100", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { children: lang.flag }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { children: lang.label }) ] }, code); }) }) ] }), user.skills && user.skills.length > 0 && specialistCards.length === 0 && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "mt-4 border-t border-gray-100 pt-4", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { className: "text-xs font-medium text-gray-500 mb-2 uppercase tracking-wide", children: t('profile.skills.label') }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "flex flex-wrap gap-2", children: user.skills.map((skill)=>/*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { className: "bg-green-50 text-green-700 text-sm px-3 py-1 rounded-full", children: skill }, skill)) }) ] }), user.role === 'specialist' && user.specialistCategories && user.specialistCategories.length > 0 && specialistCards.length === 0 && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "mt-4 border-t border-gray-100 pt-4", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { className: "text-xs font-medium text-gray-500 mb-2 uppercase tracking-wide", children: t('user.categories') }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "flex flex-wrap gap-2", children: user.specialistCategories.map((slug)=>/*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { className: "bg-purple-50 text-purple-700 text-sm px-3 py-1 rounded-full", children: slug }, slug)) }) ] }), user.role === 'specialist' && user.specialistLocations && user.specialistLocations.length > 0 && specialistCards.length === 0 && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "mt-4 border-t border-gray-100 pt-4", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { className: "text-xs font-medium text-gray-500 mb-2 uppercase tracking-wide", children: t('user.work_area') }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "flex flex-wrap gap-2", children: user.specialistLocations.map((slug)=>/*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("span", { className: "bg-emerald-50 text-emerald-700 text-sm px-3 py-1 rounded-full", children: [ "\uD83D\uDCCD ", slug ] }, slug)) }) ] }) ] }), user.role === 'specialist' && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "bg-white rounded-xl border border-gray-200 p-6 mb-6", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "flex items-center justify-between mb-4", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("h2", { className: "font-bold text-gray-900 text-lg", children: [ "\uD83D\uDCC5 ", t('nav.schedule') ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "flex items-center gap-3 text-xs text-gray-500", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("span", { className: "flex items-center gap-1.5", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { className: "w-3 h-3 rounded bg-emerald-200 border border-emerald-400 inline-block" }), t('schedule.available') ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("span", { className: "flex items-center gap-1.5", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { className: "w-3 h-3 rounded bg-red-200 border border-red-400 inline-block" }), t('schedule.busy') ] }) ] }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(ReadOnlyCalendar, { year: availYear, month: availMonth, availMap: availMap, today: today, onPrev: ()=>{ if (availMonth === 0) { setAvailYear((y)=>y - 1); setAvailMonth(11); } else setAvailMonth((m)=>m - 1); }, onNext: ()=>{ if (availMonth === 11) { setAvailYear((y)=>y + 1); setAvailMonth(0); } else setAvailMonth((m)=>m + 1); } }) ] }), (user.role === 'specialist' || user.role === 'admin') && specialistCards.length > 0 && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "space-y-4 mb-6", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("h2", { className: "font-bold text-white text-lg", children: t('nav.specialists') }), specialistCards.map((card)=>{ var _priceLists_card_id; return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(PublicCardView, { card: card, locale: locale, catMap: catMap, locMap: locMap, t: t, priceList: (_priceLists_card_id = priceLists[card.id]) !== null && _priceLists_card_id !== void 0 ? _priceLists_card_id : [] }, card.id); }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("h2", { className: "font-bold text-gray-900 text-lg mb-4", children: [ t('profile.reviews'), reviews.length > 0 && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("span", { className: "text-gray-400 font-normal text-base ml-2", children: [ "(", reviews.length, ")" ] }) ] }), reviews.length === 0 ? /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { className: "text-gray-500 text-sm", children: t('profile.no_reviews') }) : /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "space-y-4", children: reviews.map((param)=>{ let { review, author } = param; var _author_name_, _author_name; var _author_name__toUpperCase, _shortName; return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "border-b border-gray-50 pb-4 last:border-0 last:pb-0", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "flex items-start gap-3", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "w-8 h-8 rounded-full bg-gray-100 flex-shrink-0 flex items-center justify-center text-gray-600 text-sm font-bold overflow-hidden", children: (author === null || author === void 0 ? void 0 : author.image) ? /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("img", { src: author.image, alt: author.name, className: "w-full h-full object-cover" }) : (_author_name__toUpperCase = author === null || author === void 0 ? void 0 : (_author_name = author.name) === null || _author_name === void 0 ? void 0 : (_author_name_ = _author_name[0]) === null || _author_name_ === void 0 ? void 0 : _author_name_.toUpperCase()) !== null && _author_name__toUpperCase !== void 0 ? _author_name__toUpperCase : '?' }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "flex-1", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "flex items-center gap-2 mb-1", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { className: "text-sm font-medium text-gray-800", children: (_shortName = __WEBPACK_MODULE_REFERENCE__8_5b2273686f72744e616d65225d_call_directImport_asiSafe1__._(author === null || author === void 0 ? void 0 : author.name)) !== null && _shortName !== void 0 ? _shortName : '—' }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("span", { className: "text-yellow-400", children: [ '★'.repeat(review.rating), '☆'.repeat(5 - review.rating) ] }) ] }), review.comment && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { className: "text-sm text-gray-600", children: review.comment }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { className: "text-xs text-gray-400 mt-1", children: new Date(review.createdAt).toLocaleDateString(dateLocale) }) ] }) ] }) }, review.id); }) }) ] }) ] }); } function ReadOnlyCalendar(param) { let { year, month, availMap, today, onPrev, onNext } = param; const { locale, t } = __WEBPACK_MODULE_REFERENCE__3_5b227573654c6f63616c65225d_call_directImport_asiSafe1__._(); var _WEEK_DAYS_BY_LOCALE_locale; const weekDays = (_WEEK_DAYS_BY_LOCALE_locale = WEEK_DAYS_BY_LOCALE[locale]) !== null && _WEEK_DAYS_BY_LOCALE_locale !== void 0 ? _WEEK_DAYS_BY_LOCALE_locale : WEEK_DAYS_BY_LOCALE.ru; var _MONTHS_BY_LOCALE_locale; const months = (_MONTHS_BY_LOCALE_locale = MONTHS_BY_LOCALE[locale]) !== null && _MONTHS_BY_LOCALE_locale !== void 0 ? _MONTHS_BY_LOCALE_locale : MONTHS_BY_LOCALE.ru; const firstDay = new Date(year, month, 1); const startDow = (firstDay.getDay() + 6) % 7; const daysInMonth = new Date(year, month + 1, 0).getDate(); const prevMonthDays = new Date(year, month, 0).getDate(); const cells = []; for(let i = startDow - 1; i >= 0; i--){ cells.push({ day: prevMonthDays - i, cur: false, dateKey: '' }); } for(let d = 1; d <= daysInMonth; d++){ const dateKey = "".concat(year, "-").concat(String(month + 1).padStart(2, '0'), "-").concat(String(d).padStart(2, '0')); cells.push({ day: d, cur: true, dateKey }); } const remainder = cells.length % 7; if (remainder !== 0) { for(let d = 1; d <= 7 - remainder; d++){ cells.push({ day: d, cur: false, dateKey: '' }); } } const monthPrefix = "".concat(year, "-").concat(String(month + 1).padStart(2, '0')); const availCount = Object.entries(availMap).filter((param)=>{ let [k, v] = param; return k.startsWith(monthPrefix) && k >= today && v === 'available'; }).length; return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "flex items-center justify-between mb-3", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("button", { onClick: onPrev, className: "w-7 h-7 rounded-lg hover:bg-gray-100 flex items-center justify-center text-gray-500", children: "‹" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "text-center", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("span", { className: "font-medium text-gray-800 text-sm", children: [ months[month], " ", year ] }), availCount > 0 && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("span", { className: "ml-2 text-xs text-emerald-600", children: [ availCount, " ", t('schedule.free_days') ] }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("button", { onClick: onNext, className: "w-7 h-7 rounded-lg hover:bg-gray-100 flex items-center justify-center text-gray-500", children: "›" }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "grid grid-cols-7 mb-1", children: weekDays.map((d)=>/*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "text-center text-xs text-gray-400 py-1", children: d }, d)) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "grid grid-cols-7 gap-0.5", children: cells.map((cell, idx)=>{ if (!cell.cur) { return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "h-9 flex items-center justify-center text-xs text-gray-200", children: cell.day }, "e-".concat(idx)); } const status = availMap[cell.dateKey]; const isPast = cell.dateKey < today; const isToday = cell.dateKey === today; let cls = 'h-9 flex items-center justify-center rounded-lg text-sm font-medium '; if (isPast) { cls += 'text-gray-200 '; } else if (status === 'available') { cls += 'bg-emerald-100 border border-emerald-300 text-emerald-700 '; } else if (status === 'busy') { cls += 'bg-red-100 border border-red-300 text-red-600 '; } else { cls += 'text-gray-500 '; } if (isToday) cls += 'ring-2 ring-blue-400 ring-offset-1 '; return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: cls, children: cell.day }, cell.dateKey); }) }) ] }); } // ─── Public card view ───────────────────────────────────────────────────────── function flattenTree(nodes) { return nodes.flatMap((n)=>{ var _n_children; return [ n, ...flattenTree((_n_children = n.children) !== null && _n_children !== void 0 ? _n_children : []) ]; }); } function PublicCardView(param) { let { card, locale, catMap, locMap, t, priceList } = param; const [lightbox, setLightbox] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._(null); const [expandedAreas, setExpandedAreas] = __WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._([]); const locById = new Map(); for (const node of locMap.values()){ if (node === null || node === void 0 ? void 0 : node.id) locById.set(node.id, node); } const getLocName = (loc, fallback)=>{ var _loc_names, _loc_names1; return (loc === null || loc === void 0 ? void 0 : (_loc_names = loc.names) === null || _loc_names === void 0 ? void 0 : _loc_names[locale]) || (loc === null || loc === void 0 ? void 0 : (_loc_names1 = loc.names) === null || _loc_names1 === void 0 ? void 0 : _loc_names1.el) || fallback; }; const locationGroups = (()=>{ const grouped = new Map(); var _card_locations; for (const slug of (_card_locations = card.locations) !== null && _card_locations !== void 0 ? _card_locations : []){ const loc = locMap.get(slug); if (!loc) { if (!grouped.has(slug)) { grouped.set(slug, { root: { slug, names: { el: slug } }, rootSlug: slug, districts: [], districtSlugs: new Set() }); } continue; } let root = loc; const seenIds = new Set(); while((root === null || root === void 0 ? void 0 : root.parentId) && locById.has(root.parentId) && !seenIds.has(root.parentId)){ seenIds.add(root.parentId); root = locById.get(root.parentId); } var _root_slug; const rootSlug = (_root_slug = root === null || root === void 0 ? void 0 : root.slug) !== null && _root_slug !== void 0 ? _root_slug : slug; if (!grouped.has(rootSlug)) { grouped.set(rootSlug, { root, rootSlug, districts: [], districtSlugs: new Set() }); } const group = grouped.get(rootSlug); if (loc.slug !== rootSlug && !group.districtSlugs.has(loc.slug)) { group.districtSlugs.add(loc.slug); group.districts.push(loc); } } return Array.from(grouped.values()); })(); var _lightbox_title; return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "bg-white rounded-xl border border-gray-200 overflow-hidden", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "px-5 py-4 border-b border-gray-100", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("h3", { className: "font-bold text-gray-900", children: card.title }), card.description && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { className: "text-sm text-gray-600 mt-1", children: card.description }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "p-5 space-y-4", children: [ card.skills && card.skills.length > 0 && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { className: "text-xs font-semibold text-gray-500 uppercase tracking-wide mb-2", children: t('card.skills') }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "flex flex-wrap gap-2", children: card.skills.map((s)=>/*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { className: "bg-green-50 text-green-700 text-sm px-3 py-1 rounded-full", children: s }, s)) }) ] }), card.categories && card.categories.length > 0 && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { className: "text-xs font-semibold text-gray-500 uppercase tracking-wide mb-2", children: t('card.categories') }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "flex flex-wrap gap-2", children: card.categories.map((s)=>{ var _cat_names, _cat_names1; const cat = catMap.get(s); const name = cat ? ((_cat_names = cat.names) === null || _cat_names === void 0 ? void 0 : _cat_names[locale]) || ((_cat_names1 = cat.names) === null || _cat_names1 === void 0 ? void 0 : _cat_names1.el) || s : s; return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("span", { className: "bg-purple-50 text-purple-700 text-sm px-3 py-1 rounded-full", children: [ (cat === null || cat === void 0 ? void 0 : cat.icon) ? /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { className: "mr-1 inline-flex align-middle", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._(__WEBPACK_MODULE_REFERENCE__11_5b2243617465676f727949636f6e225d_directImport_asiSafe1__._, { icon: cat.icon, alt: name, className: __WEBPACK_MODULE_REFERENCE__11_5b22697343617465676f727949636f6e55726c225d_call_directImport_asiSafe1__._(cat.icon) ? 'h-4 w-4 object-contain' : 'text-sm leading-none', fallback: "\uD83D\uDCE6" }) }) : null, name ] }, s); }) }) ] }), card.locations && card.locations.length > 0 && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { className: "text-xs font-semibold text-gray-500 uppercase tracking-wide mb-2", children: t('user.work_area') }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "space-y-2", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "flex flex-wrap gap-2", children: locationGroups.map((group)=>{ const expanded = expandedAreas.includes(group.rootSlug); const canExpand = group.districts.length > 0; return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("button", { type: "button", onClick: ()=>{ if (!canExpand) return; setExpandedAreas((prev)=>prev.includes(group.rootSlug) ? prev.filter((slug)=>slug !== group.rootSlug) : [ ...prev, group.rootSlug ]); }, className: "inline-flex items-center gap-1.5 text-sm px-3 py-1.5 rounded-full border transition ".concat(expanded ? 'bg-emerald-100 text-emerald-800 border-emerald-300' : 'bg-emerald-50 text-emerald-700 border-emerald-200 hover:bg-emerald-100', " ").concat(canExpand ? 'cursor-pointer' : 'cursor-default'), children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { children: "\uD83D\uDCCD" }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { children: getLocName(group.root, group.rootSlug) }), canExpand && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { className: "text-[11px] font-semibold px-1.5 py-0.5 rounded-full bg-white/80 text-emerald-700 border border-emerald-200", children: expanded ? '−' : "+".concat(group.districts.length) }) ] }, group.rootSlug); }) }), locationGroups.filter((group)=>expandedAreas.includes(group.rootSlug) && group.districts.length > 0).map((group)=>/*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "rounded-xl border border-emerald-100 bg-emerald-50/40 p-3", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { className: "text-xs text-emerald-700 font-medium mb-2", children: getLocName(group.root, group.rootSlug) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "flex flex-wrap gap-1.5", children: group.districts.map((district)=>/*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { className: "text-xs px-2.5 py-1 rounded-full bg-white border border-emerald-200 text-emerald-700", children: getLocName(district, district.slug) }, district.slug)) }) ] }, "".concat(group.rootSlug, "-children"))) ] }) ] }), priceList.length > 0 && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { className: "text-xs font-semibold text-gray-500 uppercase tracking-wide mb-3", children: t('profile.card.tab.pricelist') }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "space-y-3", children: priceList.map((group)=>/*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "border border-gray-200 rounded-xl overflow-hidden", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "bg-gray-50 px-4 py-2 border-b border-gray-200", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("span", { className: "font-semibold text-sm text-gray-800", children: group.title }) }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "divide-y divide-gray-100", children: group.items.map((item)=>/*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "flex items-center gap-3 px-4 py-2.5 text-sm", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { className: "font-medium text-gray-800", children: item.name }), item.description && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { className: "text-xs text-gray-500", children: item.description }) ] }), (item.price || item.unit) && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("span", { className: "text-green-700 font-semibold whitespace-nowrap", children: [ item.price ? "€".concat(item.price) : '', item.unit ? " ".concat(item.unit) : '' ] }) ] }, item.id)) }) ] }, group.id)) }) ] }), card.portfolio && card.portfolio.length > 0 && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { className: "text-xs font-semibold text-gray-500 uppercase tracking-wide mb-2", children: t('card.portfolio') }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "grid grid-cols-2 sm:grid-cols-3 gap-3", children: card.portfolio.map((item)=>{ var _item_title; return /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("button", { type: "button", onClick: ()=>setLightbox(item), className: "group relative rounded-xl overflow-hidden border border-gray-200 bg-gray-50 text-left", children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("img", { src: item.imageUrl, alt: (_item_title = item.title) !== null && _item_title !== void 0 ? _item_title : '', className: "w-full aspect-square object-cover group-hover:scale-105 transition-transform duration-200" }), item.title && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "px-2 py-1.5", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { className: "text-xs font-medium text-gray-700 truncate", children: item.title }) }) ] }, item.id); }) }) ] }) ] }), lightbox && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "fixed inset-0 z-50 flex items-center justify-center bg-black/80 px-4", onClick: ()=>setLightbox(null), children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "bg-white rounded-2xl overflow-hidden max-w-lg w-full shadow-2xl", onClick: (e)=>e.stopPropagation(), children: [ /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("img", { src: lightbox.imageUrl, alt: (_lightbox_title = lightbox.title) !== null && _lightbox_title !== void 0 ? _lightbox_title : '', className: "w-full max-h-[60vh] object-contain bg-gray-900" }), (lightbox.title || lightbox.description) && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._("div", { className: "p-4", children: [ lightbox.title && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { className: "font-semibold text-gray-800 mb-1", children: lightbox.title }), lightbox.description && /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("p", { className: "text-sm text-gray-600", children: lightbox.description }) ] }), /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("div", { className: "flex justify-end px-4 pb-4", children: /*#__PURE__*/ __WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._("button", { type: "button", onClick: ()=>setLightbox(null), className: "text-sm text-gray-500 hover:text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-100", children: t('card.close') }) }) ] }) }) ] }); } íð ñÑ/* __next_internal_client_entry_do_not_use__ default auto */ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { useState, useEffect } from 'react'; import { useParams, useRouter } from 'next/navigation'; import { useLocale } from '@/context/locale'; import { useSession } from '@/lib/auth'; import { getUserProfile, getUserReviews, getUserRating, getSpecialistAvailability, getSpecialistCards, getCategories, getLocations, getSpecialistFavorites, addSpecialistFavorite, removeSpecialistFavorite, getOrCreateDirectRoom, getCanMessage, getPriceList } from '@/lib/api'; import { UpgradePrompt } from '@/components/UpgradePrompt'; import { formatShortName, shortName } from '@/lib/formatName'; import { formatLastSeen } from '@/lib/formatLastSeen'; import { PlanBadge } from '@/components/PlanBadge'; import { CategoryIcon, isCategoryIconUrl } from '@/components/CategoryIcon'; const MONTHS_BY_LOCALE = { ru: [ 'ЯМварь', 'Ѐевраль', 'Март', 'Апрель', 'Май', 'ИюМь', 'Июль', 'Август', 'СеМтябрь', 'Октябрь', 'НПябрь', 'Декабрь' ], en: [ 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December' ], el: [ 'ΙαΜουάριος', 'Ίεβρουάριος', 'Μάρτιος', 'Απρίλιος', 'Μάιος', 'ΙούΜιος', 'Ιούλιος', 'Αύγουστος', 'ΣεπτέΌβριος', 'Οκτώβριος', 'ΝοέΌβριος', 'ΔεκέΌβριος' ], uk: [ 'СічеМь', 'ЛютОй', 'БерезеМь', 'КвітеМь', 'ТравеМь', 'ЧервеМь', 'ЛОпеМь', 'СерпеМь', 'ВересеМь', 'ЖПвтеМь', 'ЛОстПпаЎ', 'ГруЎеМь' ] }; const WEEK_DAYS_BY_LOCALE = { ru: [ 'ПМ', 'Вт', 'Ср', 'Чт', 'Пт', 'Сб', 'Вс' ], en: [ 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa', 'Su' ], el: [ 'Δε', '΀ρ', '΀ε', 'Πε', 'Πα', 'Σά', 'Κυ' ], uk: [ 'ПМ', 'Вт', 'Ср', 'Чт', 'Пт', 'Сб', 'НЎ' ] }; export default function UserProfilePage() { var _user_firstName, _user_lastName, _user_name_, _user_name, _user_siteSettings, _session_user; const { id } = useParams(); const { t, locale } = useLocale(); const { data: session } = useSession(); const router = useRouter(); const [user, setUser] = useState(null); const [reviews, setReviews] = useState([]); const [rating, setRating] = useState(null); const [loading, setLoading] = useState(true); const [specialistCards, setSpecialistCards] = useState([]); const [priceLists, setPriceLists] = useState({}); const [catMap, setCatMap] = useState(new Map()); const [locMap, setLocMap] = useState(new Map()); const [isFavorite, setIsFavorite] = useState(false); const [favLoading, setFavLoading] = useState(false); const [msgLoading, setMsgLoading] = useState(false); const [canMsg, setCanMsg] = useState(null); // Availability const now = new Date(); const [availYear, setAvailYear] = useState(now.getFullYear()); const [availMonth, setAvailMonth] = useState(now.getMonth()); const [availMap, setAvailMap] = useState({}); const today = new Date().toISOString().slice(0, 10); const dateLocale = locale === 'ru' ? 'ru-RU' : locale === 'uk' ? 'uk-UA' : locale === 'en' ? 'en-US' : 'el-GR'; useEffect(()=>{ if (!id) return; Promise.all([ getUserProfile(id, locale), getUserReviews(id), getUserRating(id), getCategories().catch(()=>[]), getLocations().catch(()=>[]) ]).then((param)=>{ let [u, r, rt, cats, locs] = param; setUser(u); setReviews(r); setRating(rt.avg); setCatMap(new Map(flattenTree(cats).map((c)=>[ c.slug, c ]))); setLocMap(new Map(flattenTree(locs).map((l)=>[ l.slug, l ]))); if (u.role === 'specialist' || u.role === 'admin') { getSpecialistCards(id, locale).then((cards)=>{ setSpecialistCards(cards); cards.forEach((c)=>{ getPriceList(c.id, locale).then((pl)=>{ if (pl.length > 0) setPriceLists((prev)=>({ ...prev, [c.id]: pl })); }).catch(()=>{}); }); }).catch(()=>{}); } }).catch(()=>{}).finally(()=>setLoading(false)); }, [ id, locale ]); // Load favorite status when session available useEffect(()=>{ var _session_user; if (!session || !id) return; getSpecialistFavorites().then((rows)=>setIsFavorite(rows.some((r)=>{ var _r_specialist; return ((_r_specialist = r.specialist) === null || _r_specialist === void 0 ? void 0 : _r_specialist.id) === id; }))).catch(()=>{}); // Check if current user can message this person const myId = (_session_user = session.user) === null || _session_user === void 0 ? void 0 : _session_user.id; if (myId && myId !== id) { getCanMessage(id).then(setCanMsg).catch(()=>{}); } }, [ session, id ]); async function toggleFavorite() { if (!session) { router.push('/register'); return; } setFavLoading(true); try { if (isFavorite) { await removeSpecialistFavorite(id); setIsFavorite(false); } else { await addSpecialistFavorite(id); setIsFavorite(true); } } catch (e) {} setFavLoading(false); } async function handleMessage() { if (!session) { router.push('/login'); return; } setMsgLoading(true); try { const { room } = await getOrCreateDirectRoom(id); router.push("/chat?room=".concat(room.id)); } catch (e) {} setMsgLoading(false); } useEffect(()=>{ if (!id) return; const monthKey = "".concat(availYear, "-").concat(String(availMonth + 1).padStart(2, '0')); getSpecialistAvailability(id, monthKey).then((rows)=>{ setAvailMap((prev)=>{ const next = { ...prev }; rows.forEach((r)=>{ next[r.date] = r.status; }); return next; }); }).catch(()=>{}); }, [ id, availYear, availMonth ]); if (loading) return /*#__PURE__*/ _jsx("div", { className: "text-center py-20 text-white", children: t('common.loading') }); if (!user) return /*#__PURE__*/ _jsx("div", { className: "text-center py-20 text-white/70", children: t('common.error') }); var _user_firstName_, _user_lastName_; const initials = "".concat((_user_firstName_ = (_user_firstName = user.firstName) === null || _user_firstName === void 0 ? void 0 : _user_firstName[0]) !== null && _user_firstName_ !== void 0 ? _user_firstName_ : '').concat((_user_lastName_ = (_user_lastName = user.lastName) === null || _user_lastName === void 0 ? void 0 : _user_lastName[0]) !== null && _user_lastName_ !== void 0 ? _user_lastName_ : '').toUpperCase() || ((_user_name = user.name) === null || _user_name === void 0 ? void 0 : (_user_name_ = _user_name[0]) === null || _user_name_ === void 0 ? void 0 : _user_name_.toUpperCase()) || '?'; const displayName = formatShortName(user.firstName, user.lastName, user.name); const profileBackgroundImage = typeof ((_user_siteSettings = user.siteSettings) === null || _user_siteSettings === void 0 ? void 0 : _user_siteSettings.profileBackgroundImage) === 'string' && user.siteSettings.profileBackgroundImage.trim().length > 0 ? user.siteSettings.profileBackgroundImage : null; return /*#__PURE__*/ _jsxs("div", { className: "max-w-3xl mx-auto px-4 py-10", children: [ /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6 mb-6", children: [ /*#__PURE__*/ _jsxs("div", { className: "relative -mx-6 -mt-6 mb-5 h-44 overflow-hidden rounded-t-xl", style: { backgroundImage: profileBackgroundImage ? "linear-gradient(135deg, rgba(21, 128, 61, 0.45), rgba(22, 163, 74, 0.65)), url(".concat(profileBackgroundImage, ")") : 'linear-gradient(135deg, #22c55e 0%, #16a34a 45%, #166534 100%)', backgroundSize: 'cover', backgroundPosition: 'center' }, children: [ /*#__PURE__*/ _jsx("div", { className: "absolute inset-0 bg-gradient-to-b from-black/10 to-black/30" }), /*#__PURE__*/ _jsxs("div", { className: "relative h-full w-full p-5 flex items-end justify-between", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 min-w-0", children: [ /*#__PURE__*/ _jsx("div", { className: "w-14 h-14 rounded-full bg-white/20 border border-white/40 overflow-hidden flex items-center justify-center text-white text-xl font-bold backdrop-blur-sm", children: user.image ? /*#__PURE__*/ _jsx("img", { src: user.image, alt: displayName, className: "w-full h-full object-cover" }) : initials }), /*#__PURE__*/ _jsxs("div", { className: "min-w-0", children: [ /*#__PURE__*/ _jsx("p", { className: "text-white text-lg font-bold truncate", children: displayName }), /*#__PURE__*/ _jsxs("p", { className: "text-white/85 text-xs", children: [ t('profile.member_since'), " ", new Date(user.createdAt).toLocaleDateString(dateLocale) ] }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "shrink-0", children: [ user.planTier && user.planTier !== 'free' && /*#__PURE__*/ _jsx(PlanBadge, { tier: user.planTier, verified: user.hasVerifiedBadge, size: "sm" }), user.hasVerifiedBadge && user.planTier === 'free' && /*#__PURE__*/ _jsx(PlanBadge, { tier: "free", verified: true, size: "sm" }) ] }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-start gap-5", children: [ /*#__PURE__*/ _jsx("div", { className: "w-20 h-20 rounded-full bg-green-100 flex-shrink-0 flex items-center justify-center text-green-700 text-2xl font-bold overflow-hidden border-2 border-gray-100", children: user.image ? /*#__PURE__*/ _jsx("img", { src: user.image, alt: displayName, className: "w-full h-full object-cover" }) : initials }), /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 flex-wrap mb-1", children: [ /*#__PURE__*/ _jsx("h1", { className: "text-xl font-bold text-gray-900", children: displayName }), user.planTier && user.planTier !== 'free' && /*#__PURE__*/ _jsx(PlanBadge, { tier: user.planTier, verified: user.hasVerifiedBadge, size: "sm" }), user.hasVerifiedBadge && user.planTier === 'free' && /*#__PURE__*/ _jsx(PlanBadge, { tier: "free", verified: true, size: "sm" }), Array.isArray(user.activeStatuses) && user.activeStatuses.includes('can_help_now') && /*#__PURE__*/ _jsxs("span", { className: "inline-flex items-center gap-1 text-xs font-medium text-green-700 bg-green-50 border border-green-200 px-2 py-0.5 rounded-full", children: [ /*#__PURE__*/ _jsx("span", { className: "w-1.5 h-1.5 rounded-full bg-green-500 animate-pulse" }), t('status.can_help_now', 'Available now') ] }), Array.isArray(user.activeStatuses) && user.activeStatuses.includes('need_help') && /*#__PURE__*/ _jsxs("span", { className: "inline-flex items-center gap-1 text-xs font-medium text-green-700 bg-green-50 border border-green-200 px-2 py-0.5 rounded-full", children: [ /*#__PURE__*/ _jsx("span", { className: "w-1.5 h-1.5 rounded-full bg-green-500" }), t('status.need_help', 'Need help') ] }), (session ? ((_session_user = session.user) === null || _session_user === void 0 ? void 0 : _session_user.id) !== id : true) && /*#__PURE__*/ _jsxs("div", { className: "ml-auto flex items-center gap-2", children: [ !session ? // Guest — show button that leads to registration /*#__PURE__*/ _jsxs("a", { href: "/register", className: "flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-sm font-medium bg-green-50 text-green-600 border border-green-200 hover:bg-green-100 transition", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }), /*#__PURE__*/ _jsx("span", { children: t('chat.write_btn', 'Write') }) ] }) : (canMsg === null || canMsg === void 0 ? void 0 : canMsg.allowed) === false ? /*#__PURE__*/ _jsx(UpgradePrompt, { feature: t('chat.write_btn', 'Write'), requiredTier: "pro", variant: "inline", t: t }) : /*#__PURE__*/ _jsxs("button", { onClick: handleMessage, disabled: msgLoading, className: "flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-sm font-medium bg-green-50 text-green-600 border border-green-200 hover:bg-green-100 transition disabled:opacity-50", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }), /*#__PURE__*/ _jsx("span", { children: t('chat.write_btn') }) ] }), /*#__PURE__*/ _jsxs("button", { onClick: toggleFavorite, disabled: favLoading, title: isFavorite ? t('specialist.unfavorite') : t('specialist.favorite'), className: "flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-sm font-medium transition disabled:opacity-50 ".concat(isFavorite ? 'bg-pink-50 text-pink-600 border border-pink-200 hover:bg-pink-100' : 'bg-gray-50 text-gray-600 border border-gray-200 hover:bg-gray-100'), children: [ /*#__PURE__*/ _jsx("span", { children: isFavorite ? '❀' : '🀍' }), /*#__PURE__*/ _jsx("span", { children: isFavorite ? t('specialist.unfavorite') : t('specialist.favorite') }) ] }) ] }) ] }), rating && /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-1.5 mb-2", children: [ /*#__PURE__*/ _jsx("span", { className: "text-yellow-400 text-lg", children: "★" }), /*#__PURE__*/ _jsx("span", { className: "font-semibold text-gray-800", children: Number(rating).toFixed(1) }), /*#__PURE__*/ _jsxs("span", { className: "text-sm text-gray-400", children: [ "(", reviews.length, " ", t('profile.reviews').toLowerCase(), ")" ] }) ] }), /*#__PURE__*/ _jsxs("p", { className: "text-sm text-gray-400", children: [ t('profile.member_since'), " ", new Date(user.createdAt).toLocaleDateString(dateLocale), user.lastSeenAt && /*#__PURE__*/ _jsxs("span", { className: "ml-2", children: [ "\xb7 ", formatLastSeen(user.lastSeenAt, t) ] }) ] }) ] }) ] }), user.bio && /*#__PURE__*/ _jsx("p", { className: "mt-4 text-gray-700 text-sm leading-relaxed border-t border-gray-100 pt-4", children: user.bio }), user.phone && /*#__PURE__*/ _jsxs("div", { className: "mt-4 border-t border-gray-100 pt-4 flex items-center gap-2", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M3 5a2 2 0 012-2h3.28a1 1 0 01.948.684l1.498 4.493a1 1 0 01-.502 1.21l-2.257 1.13a11.042 11.042 0 005.516 5.516l1.13-2.257a1 1 0 011.21-.502l4.493 1.498a1 1 0 01.684.949V19a2 2 0 01-2 2h-1C9.716 21 3 14.284 3 6V5z" }) }), /*#__PURE__*/ _jsx("a", { href: "tel:".concat(user.phone), className: "text-sm font-medium text-gray-700 hover:text-green-600", children: user.phone }) ] }), user.personalSiteSlug && /*#__PURE__*/ _jsxs("div", { className: "mt-3 flex items-center gap-2", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _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" }) }), /*#__PURE__*/ _jsxs("a", { href: "/site/".concat(user.personalSiteSlug), target: "_blank", rel: "noopener noreferrer", className: "text-sm text-green-600 hover:underline", children: [ "canhelp.gr/site/", user.personalSiteSlug ] }) ] }), user.languages && user.languages.length > 0 && /*#__PURE__*/ _jsxs("div", { className: "mt-4 border-t border-gray-100 pt-4", children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs font-medium text-gray-500 mb-2 uppercase tracking-wide", children: t('profile.languages') }), /*#__PURE__*/ _jsx("div", { className: "flex flex-wrap gap-2", children: user.languages.map((code)=>{ const langMap = { el: { flag: '🇬🇷', label: 'ΕλληΜικά' }, en: { flag: '🇬🇧', label: 'English' }, ru: { flag: '🇷🇺', label: 'РусскОй' }, uk: { flag: '🇺🇊', label: 'УкраїМська' }, de: { flag: '🇩🇪', label: 'Deutsch' }, fr: { flag: '🇫🇷', label: 'Français' }, it: { flag: '🇮🇹', label: 'Italiano' }, es: { flag: '🇪🇞', label: 'Español' }, ar: { flag: '🇞🇊', label: 'العرؚية' }, zh: { flag: '🇚🇳', label: 'äž­æ–‡' } }; const lang = langMap[code]; if (!lang) return null; return /*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-1.5 bg-indigo-50 text-indigo-700 text-sm px-3 py-1 rounded-full border border-indigo-100", children: [ /*#__PURE__*/ _jsx("span", { children: lang.flag }), /*#__PURE__*/ _jsx("span", { children: lang.label }) ] }, code); }) }) ] }), user.skills && user.skills.length > 0 && specialistCards.length === 0 && /*#__PURE__*/ _jsxs("div", { className: "mt-4 border-t border-gray-100 pt-4", children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs font-medium text-gray-500 mb-2 uppercase tracking-wide", children: t('profile.skills.label') }), /*#__PURE__*/ _jsx("div", { className: "flex flex-wrap gap-2", children: user.skills.map((skill)=>/*#__PURE__*/ _jsx("span", { className: "bg-green-50 text-green-700 text-sm px-3 py-1 rounded-full", children: skill }, skill)) }) ] }), user.role === 'specialist' && user.specialistCategories && user.specialistCategories.length > 0 && specialistCards.length === 0 && /*#__PURE__*/ _jsxs("div", { className: "mt-4 border-t border-gray-100 pt-4", children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs font-medium text-gray-500 mb-2 uppercase tracking-wide", children: t('user.categories') }), /*#__PURE__*/ _jsx("div", { className: "flex flex-wrap gap-2", children: user.specialistCategories.map((slug)=>/*#__PURE__*/ _jsx("span", { className: "bg-purple-50 text-purple-700 text-sm px-3 py-1 rounded-full", children: slug }, slug)) }) ] }), user.role === 'specialist' && user.specialistLocations && user.specialistLocations.length > 0 && specialistCards.length === 0 && /*#__PURE__*/ _jsxs("div", { className: "mt-4 border-t border-gray-100 pt-4", children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs font-medium text-gray-500 mb-2 uppercase tracking-wide", children: t('user.work_area') }), /*#__PURE__*/ _jsx("div", { className: "flex flex-wrap gap-2", children: user.specialistLocations.map((slug)=>/*#__PURE__*/ _jsxs("span", { className: "bg-emerald-50 text-emerald-700 text-sm px-3 py-1 rounded-full", children: [ "\uD83D\uDCCD ", slug ] }, slug)) }) ] }) ] }), user.role === 'specialist' && /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6 mb-6", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between mb-4", children: [ /*#__PURE__*/ _jsxs("h2", { className: "font-bold text-gray-900 text-lg", children: [ "\uD83D\uDCC5 ", t('nav.schedule') ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 text-xs text-gray-500", children: [ /*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-1.5", children: [ /*#__PURE__*/ _jsx("span", { className: "w-3 h-3 rounded bg-emerald-200 border border-emerald-400 inline-block" }), t('schedule.available') ] }), /*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-1.5", children: [ /*#__PURE__*/ _jsx("span", { className: "w-3 h-3 rounded bg-red-200 border border-red-400 inline-block" }), t('schedule.busy') ] }) ] }) ] }), /*#__PURE__*/ _jsx(ReadOnlyCalendar, { year: availYear, month: availMonth, availMap: availMap, today: today, onPrev: ()=>{ if (availMonth === 0) { setAvailYear((y)=>y - 1); setAvailMonth(11); } else setAvailMonth((m)=>m - 1); }, onNext: ()=>{ if (availMonth === 11) { setAvailYear((y)=>y + 1); setAvailMonth(0); } else setAvailMonth((m)=>m + 1); } }) ] }), (user.role === 'specialist' || user.role === 'admin') && specialistCards.length > 0 && /*#__PURE__*/ _jsxs("div", { className: "space-y-4 mb-6", children: [ /*#__PURE__*/ _jsx("h2", { className: "font-bold text-white text-lg", children: t('nav.specialists') }), specialistCards.map((card)=>{ var _priceLists_card_id; return /*#__PURE__*/ _jsx(PublicCardView, { card: card, locale: locale, catMap: catMap, locMap: locMap, t: t, priceList: (_priceLists_card_id = priceLists[card.id]) !== null && _priceLists_card_id !== void 0 ? _priceLists_card_id : [] }, card.id); }) ] }), /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ _jsxs("h2", { className: "font-bold text-gray-900 text-lg mb-4", children: [ t('profile.reviews'), reviews.length > 0 && /*#__PURE__*/ _jsxs("span", { className: "text-gray-400 font-normal text-base ml-2", children: [ "(", reviews.length, ")" ] }) ] }), reviews.length === 0 ? /*#__PURE__*/ _jsx("p", { className: "text-gray-500 text-sm", children: t('profile.no_reviews') }) : /*#__PURE__*/ _jsx("div", { className: "space-y-4", children: reviews.map((param)=>{ let { review, author } = param; var _author_name_, _author_name; var _author_name__toUpperCase, _shortName; return /*#__PURE__*/ _jsx("div", { className: "border-b border-gray-50 pb-4 last:border-0 last:pb-0", children: /*#__PURE__*/ _jsxs("div", { className: "flex items-start gap-3", children: [ /*#__PURE__*/ _jsx("div", { className: "w-8 h-8 rounded-full bg-gray-100 flex-shrink-0 flex items-center justify-center text-gray-600 text-sm font-bold overflow-hidden", children: (author === null || author === void 0 ? void 0 : author.image) ? /*#__PURE__*/ _jsx("img", { src: author.image, alt: author.name, className: "w-full h-full object-cover" }) : (_author_name__toUpperCase = author === null || author === void 0 ? void 0 : (_author_name = author.name) === null || _author_name === void 0 ? void 0 : (_author_name_ = _author_name[0]) === null || _author_name_ === void 0 ? void 0 : _author_name_.toUpperCase()) !== null && _author_name__toUpperCase !== void 0 ? _author_name__toUpperCase : '?' }), /*#__PURE__*/ _jsxs("div", { className: "flex-1", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 mb-1", children: [ /*#__PURE__*/ _jsx("span", { className: "text-sm font-medium text-gray-800", children: (_shortName = shortName(author === null || author === void 0 ? void 0 : author.name)) !== null && _shortName !== void 0 ? _shortName : '—' }), /*#__PURE__*/ _jsxs("span", { className: "text-yellow-400", children: [ '★'.repeat(review.rating), '☆'.repeat(5 - review.rating) ] }) ] }), review.comment && /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-600", children: review.comment }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-1", children: new Date(review.createdAt).toLocaleDateString(dateLocale) }) ] }) ] }) }, review.id); }) }) ] }) ] }); } function ReadOnlyCalendar(param) { let { year, month, availMap, today, onPrev, onNext } = param; const { locale, t } = useLocale(); var _WEEK_DAYS_BY_LOCALE_locale; const weekDays = (_WEEK_DAYS_BY_LOCALE_locale = WEEK_DAYS_BY_LOCALE[locale]) !== null && _WEEK_DAYS_BY_LOCALE_locale !== void 0 ? _WEEK_DAYS_BY_LOCALE_locale : WEEK_DAYS_BY_LOCALE.ru; var _MONTHS_BY_LOCALE_locale; const months = (_MONTHS_BY_LOCALE_locale = MONTHS_BY_LOCALE[locale]) !== null && _MONTHS_BY_LOCALE_locale !== void 0 ? _MONTHS_BY_LOCALE_locale : MONTHS_BY_LOCALE.ru; const firstDay = new Date(year, month, 1); const startDow = (firstDay.getDay() + 6) % 7; const daysInMonth = new Date(year, month + 1, 0).getDate(); const prevMonthDays = new Date(year, month, 0).getDate(); const cells = []; for(let i = startDow - 1; i >= 0; i--){ cells.push({ day: prevMonthDays - i, cur: false, dateKey: '' }); } for(let d = 1; d <= daysInMonth; d++){ const dateKey = "".concat(year, "-").concat(String(month + 1).padStart(2, '0'), "-").concat(String(d).padStart(2, '0')); cells.push({ day: d, cur: true, dateKey }); } const remainder = cells.length % 7; if (remainder !== 0) { for(let d = 1; d <= 7 - remainder; d++){ cells.push({ day: d, cur: false, dateKey: '' }); } } const monthPrefix = "".concat(year, "-").concat(String(month + 1).padStart(2, '0')); const availCount = Object.entries(availMap).filter((param)=>{ let [k, v] = param; return k.startsWith(monthPrefix) && k >= today && v === 'available'; }).length; return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between mb-3", children: [ /*#__PURE__*/ _jsx("button", { onClick: onPrev, className: "w-7 h-7 rounded-lg hover:bg-gray-100 flex items-center justify-center text-gray-500", children: "‹" }), /*#__PURE__*/ _jsxs("div", { className: "text-center", children: [ /*#__PURE__*/ _jsxs("span", { className: "font-medium text-gray-800 text-sm", children: [ months[month], " ", year ] }), availCount > 0 && /*#__PURE__*/ _jsxs("span", { className: "ml-2 text-xs text-emerald-600", children: [ availCount, " ", t('schedule.free_days') ] }) ] }), /*#__PURE__*/ _jsx("button", { onClick: onNext, className: "w-7 h-7 rounded-lg hover:bg-gray-100 flex items-center justify-center text-gray-500", children: "›" }) ] }), /*#__PURE__*/ _jsx("div", { className: "grid grid-cols-7 mb-1", children: weekDays.map((d)=>/*#__PURE__*/ _jsx("div", { className: "text-center text-xs text-gray-400 py-1", children: d }, d)) }), /*#__PURE__*/ _jsx("div", { className: "grid grid-cols-7 gap-0.5", children: cells.map((cell, idx)=>{ if (!cell.cur) { return /*#__PURE__*/ _jsx("div", { className: "h-9 flex items-center justify-center text-xs text-gray-200", children: cell.day }, "e-".concat(idx)); } const status = availMap[cell.dateKey]; const isPast = cell.dateKey < today; const isToday = cell.dateKey === today; let cls = 'h-9 flex items-center justify-center rounded-lg text-sm font-medium '; if (isPast) { cls += 'text-gray-200 '; } else if (status === 'available') { cls += 'bg-emerald-100 border border-emerald-300 text-emerald-700 '; } else if (status === 'busy') { cls += 'bg-red-100 border border-red-300 text-red-600 '; } else { cls += 'text-gray-500 '; } if (isToday) cls += 'ring-2 ring-blue-400 ring-offset-1 '; return /*#__PURE__*/ _jsx("div", { className: cls, children: cell.day }, cell.dateKey); }) }) ] }); } // ─── Public card view ───────────────────────────────────────────────────────── function flattenTree(nodes) { return nodes.flatMap((n)=>{ var _n_children; return [ n, ...flattenTree((_n_children = n.children) !== null && _n_children !== void 0 ? _n_children : []) ]; }); } function PublicCardView(param) { let { card, locale, catMap, locMap, t, priceList } = param; const [lightbox, setLightbox] = useState(null); const [expandedAreas, setExpandedAreas] = useState([]); const locById = new Map(); for (const node of locMap.values()){ if (node === null || node === void 0 ? void 0 : node.id) locById.set(node.id, node); } const getLocName = (loc, fallback)=>{ var _loc_names, _loc_names1; return (loc === null || loc === void 0 ? void 0 : (_loc_names = loc.names) === null || _loc_names === void 0 ? void 0 : _loc_names[locale]) || (loc === null || loc === void 0 ? void 0 : (_loc_names1 = loc.names) === null || _loc_names1 === void 0 ? void 0 : _loc_names1.el) || fallback; }; const locationGroups = (()=>{ const grouped = new Map(); var _card_locations; for (const slug of (_card_locations = card.locations) !== null && _card_locations !== void 0 ? _card_locations : []){ const loc = locMap.get(slug); if (!loc) { if (!grouped.has(slug)) { grouped.set(slug, { root: { slug, names: { el: slug } }, rootSlug: slug, districts: [], districtSlugs: new Set() }); } continue; } let root = loc; const seenIds = new Set(); while((root === null || root === void 0 ? void 0 : root.parentId) && locById.has(root.parentId) && !seenIds.has(root.parentId)){ seenIds.add(root.parentId); root = locById.get(root.parentId); } var _root_slug; const rootSlug = (_root_slug = root === null || root === void 0 ? void 0 : root.slug) !== null && _root_slug !== void 0 ? _root_slug : slug; if (!grouped.has(rootSlug)) { grouped.set(rootSlug, { root, rootSlug, districts: [], districtSlugs: new Set() }); } const group = grouped.get(rootSlug); if (loc.slug !== rootSlug && !group.districtSlugs.has(loc.slug)) { group.districtSlugs.add(loc.slug); group.districts.push(loc); } } return Array.from(grouped.values()); })(); var _lightbox_title; return /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 overflow-hidden", children: [ /*#__PURE__*/ _jsxs("div", { className: "px-5 py-4 border-b border-gray-100", children: [ /*#__PURE__*/ _jsx("h3", { className: "font-bold text-gray-900", children: card.title }), card.description && /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-600 mt-1", children: card.description }) ] }), /*#__PURE__*/ _jsxs("div", { className: "p-5 space-y-4", children: [ card.skills && card.skills.length > 0 && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs font-semibold text-gray-500 uppercase tracking-wide mb-2", children: t('card.skills') }), /*#__PURE__*/ _jsx("div", { className: "flex flex-wrap gap-2", children: card.skills.map((s)=>/*#__PURE__*/ _jsx("span", { className: "bg-green-50 text-green-700 text-sm px-3 py-1 rounded-full", children: s }, s)) }) ] }), card.categories && card.categories.length > 0 && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs font-semibold text-gray-500 uppercase tracking-wide mb-2", children: t('card.categories') }), /*#__PURE__*/ _jsx("div", { className: "flex flex-wrap gap-2", children: card.categories.map((s)=>{ var _cat_names, _cat_names1; const cat = catMap.get(s); const name = cat ? ((_cat_names = cat.names) === null || _cat_names === void 0 ? void 0 : _cat_names[locale]) || ((_cat_names1 = cat.names) === null || _cat_names1 === void 0 ? void 0 : _cat_names1.el) || s : s; return /*#__PURE__*/ _jsxs("span", { className: "bg-purple-50 text-purple-700 text-sm px-3 py-1 rounded-full", children: [ (cat === null || cat === void 0 ? void 0 : cat.icon) ? /*#__PURE__*/ _jsx("span", { className: "mr-1 inline-flex align-middle", children: /*#__PURE__*/ _jsx(CategoryIcon, { icon: cat.icon, alt: name, className: isCategoryIconUrl(cat.icon) ? 'h-4 w-4 object-contain' : 'text-sm leading-none', fallback: "\uD83D\uDCE6" }) }) : null, name ] }, s); }) }) ] }), card.locations && card.locations.length > 0 && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs font-semibold text-gray-500 uppercase tracking-wide mb-2", children: t('user.work_area') }), /*#__PURE__*/ _jsxs("div", { className: "space-y-2", children: [ /*#__PURE__*/ _jsx("div", { className: "flex flex-wrap gap-2", children: locationGroups.map((group)=>{ const expanded = expandedAreas.includes(group.rootSlug); const canExpand = group.districts.length > 0; return /*#__PURE__*/ _jsxs("button", { type: "button", onClick: ()=>{ if (!canExpand) return; setExpandedAreas((prev)=>prev.includes(group.rootSlug) ? prev.filter((slug)=>slug !== group.rootSlug) : [ ...prev, group.rootSlug ]); }, className: "inline-flex items-center gap-1.5 text-sm px-3 py-1.5 rounded-full border transition ".concat(expanded ? 'bg-emerald-100 text-emerald-800 border-emerald-300' : 'bg-emerald-50 text-emerald-700 border-emerald-200 hover:bg-emerald-100', " ").concat(canExpand ? 'cursor-pointer' : 'cursor-default'), children: [ /*#__PURE__*/ _jsx("span", { children: "\uD83D\uDCCD" }), /*#__PURE__*/ _jsx("span", { children: getLocName(group.root, group.rootSlug) }), canExpand && /*#__PURE__*/ _jsx("span", { className: "text-[11px] font-semibold px-1.5 py-0.5 rounded-full bg-white/80 text-emerald-700 border border-emerald-200", children: expanded ? '−' : "+".concat(group.districts.length) }) ] }, group.rootSlug); }) }), locationGroups.filter((group)=>expandedAreas.includes(group.rootSlug) && group.districts.length > 0).map((group)=>/*#__PURE__*/ _jsxs("div", { className: "rounded-xl border border-emerald-100 bg-emerald-50/40 p-3", children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs text-emerald-700 font-medium mb-2", children: getLocName(group.root, group.rootSlug) }), /*#__PURE__*/ _jsx("div", { className: "flex flex-wrap gap-1.5", children: group.districts.map((district)=>/*#__PURE__*/ _jsx("span", { className: "text-xs px-2.5 py-1 rounded-full bg-white border border-emerald-200 text-emerald-700", children: getLocName(district, district.slug) }, district.slug)) }) ] }, "".concat(group.rootSlug, "-children"))) ] }) ] }), priceList.length > 0 && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs font-semibold text-gray-500 uppercase tracking-wide mb-3", children: t('profile.card.tab.pricelist') }), /*#__PURE__*/ _jsx("div", { className: "space-y-3", children: priceList.map((group)=>/*#__PURE__*/ _jsxs("div", { className: "border border-gray-200 rounded-xl overflow-hidden", children: [ /*#__PURE__*/ _jsx("div", { className: "bg-gray-50 px-4 py-2 border-b border-gray-200", children: /*#__PURE__*/ _jsx("span", { className: "font-semibold text-sm text-gray-800", children: group.title }) }), /*#__PURE__*/ _jsx("div", { className: "divide-y divide-gray-100", children: group.items.map((item)=>/*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 px-4 py-2.5 text-sm", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ _jsx("p", { className: "font-medium text-gray-800", children: item.name }), item.description && /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-500", children: item.description }) ] }), (item.price || item.unit) && /*#__PURE__*/ _jsxs("span", { className: "text-green-700 font-semibold whitespace-nowrap", children: [ item.price ? "€".concat(item.price) : '', item.unit ? " ".concat(item.unit) : '' ] }) ] }, item.id)) }) ] }, group.id)) }) ] }), card.portfolio && card.portfolio.length > 0 && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs font-semibold text-gray-500 uppercase tracking-wide mb-2", children: t('card.portfolio') }), /*#__PURE__*/ _jsx("div", { className: "grid grid-cols-2 sm:grid-cols-3 gap-3", children: card.portfolio.map((item)=>{ var _item_title; return /*#__PURE__*/ _jsxs("button", { type: "button", onClick: ()=>setLightbox(item), className: "group relative rounded-xl overflow-hidden border border-gray-200 bg-gray-50 text-left", children: [ /*#__PURE__*/ _jsx("img", { src: item.imageUrl, alt: (_item_title = item.title) !== null && _item_title !== void 0 ? _item_title : '', className: "w-full aspect-square object-cover group-hover:scale-105 transition-transform duration-200" }), item.title && /*#__PURE__*/ _jsx("div", { className: "px-2 py-1.5", children: /*#__PURE__*/ _jsx("p", { className: "text-xs font-medium text-gray-700 truncate", children: item.title }) }) ] }, item.id); }) }) ] }) ] }), lightbox && /*#__PURE__*/ _jsx("div", { className: "fixed inset-0 z-50 flex items-center justify-center bg-black/80 px-4", onClick: ()=>setLightbox(null), children: /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-2xl overflow-hidden max-w-lg w-full shadow-2xl", onClick: (e)=>e.stopPropagation(), children: [ /*#__PURE__*/ _jsx("img", { src: lightbox.imageUrl, alt: (_lightbox_title = lightbox.title) !== null && _lightbox_title !== void 0 ? _lightbox_title : '', className: "w-full max-h-[60vh] object-contain bg-gray-900" }), (lightbox.title || lightbox.description) && /*#__PURE__*/ _jsxs("div", { className: "p-4", children: [ lightbox.title && /*#__PURE__*/ _jsx("p", { className: "font-semibold text-gray-800 mb-1", children: lightbox.title }), lightbox.description && /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-600", children: lightbox.description }) ] }), /*#__PURE__*/ _jsx("div", { className: "flex justify-end px-4 pb-4", children: /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setLightbox(null), className: "text-sm text-gray-500 hover:text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-100", children: t('card.close') }) }) ] }) }) ] }); } åR61123undefined125168undefined170224undefined226270undefined272311undefined313587undefined589647undefined649710undefined712765undefined767817undefined819894undefined23812395undefined25452553__WEBPACK_MODULE_REFERENCE__2_5b22757365506172616d73225d_call_directImport_asiSafe1__._undefined25842592__WEBPACK_MODULE_REFERENCE__3_5b227573654c6f63616c65225d_call_directImport_asiSafe1__._undefined26272636__WEBPACK_MODULE_REFERENCE__4_5b2275736553657373696f6e225d_call_directImport_asiSafe1__._undefined26602668__WEBPACK_MODULE_REFERENCE__2_5b22757365526f75746572225d_call_directImport_asiSafe1__._undefined27012708__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined27512758__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined27972804__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined28472854__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined29132920__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined29672974__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined30133020__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined30663073__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined31273134__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined31843191__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined32413248__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined32903297__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined33923399__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined34613468__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined35233530__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined37143722__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined37893802__WEBPACK_MODULE_REFERENCE__5_5b226765745573657250726f66696c65225d_call_directImport_asiSafe1__._undefined38293842__WEBPACK_MODULE_REFERENCE__5_5b226765745573657252657669657773225d_call_directImport_asiSafe1__._undefined38613873__WEBPACK_MODULE_REFERENCE__5_5b2267657455736572526174696e67225d_call_directImport_asiSafe1__._undefined38923904__WEBPACK_MODULE_REFERENCE__5_5b2267657443617465676f72696573225d_call_directImport_asiSafe1__._undefined39353946__WEBPACK_MODULE_REFERENCE__5_5b226765744c6f636174696f6e73225d_call_directImport_asiSafe1__._undefined44644481__WEBPACK_MODULE_REFERENCE__5_5b226765745370656369616c6973744361726473225d_call_directImport_asiSafe1__._undefined46234634__WEBPACK_MODULE_REFERENCE__5_5b2267657450726963654c697374225d_call_directImport_asiSafe1__._undefined51345142__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined52225243__WEBPACK_MODULE_REFERENCE__5_5b226765745370656369616c6973744661766f7269746573225d_call_directImport_asiSafe1__._undefined57095721__WEBPACK_MODULE_REFERENCE__5_5b2267657443616e4d657373616765225d_call_directImport_asiSafe1__._undefined60386061__WEBPACK_MODULE_REFERENCE__5_5b2272656d6f76655370656369616c6973744661766f72697465225d_call_directImport_asiSafe1__._undefined61496169__WEBPACK_MODULE_REFERENCE__5_5b226164645370656369616c6973744661766f72697465225d_call_directImport_asiSafe1__._undefined64906510__WEBPACK_MODULE_REFERENCE__5_5b226765744f72437265617465446972656374526f6f6d225d_call_directImport_asiSafe1__._undefined66366644__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined67856809__WEBPACK_MODULE_REFERENCE__5_5b226765745370656369616c697374417661696c6162696c697479225d_call_directImport_asiSafe1__._undefined72297232__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined73767379__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined81658179__WEBPACK_MODULE_REFERENCE__8_5b22666f726d617453686f72744e616d65225d_call_directImport_asiSafe1__._undefined85558559__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined86678671__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined88268830__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined94439446__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined96369640__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined98499853__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1006010063__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1037410377__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1078710791__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1099811001__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1131811322__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1210112105__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1233412337__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1233912347__WEBPACK_MODULE_REFERENCE__10_5b22506c616e4261646765225d_directImport_asiSafe1__._undefined1272012723__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1272512733__WEBPACK_MODULE_REFERENCE__10_5b22506c616e4261646765225d_directImport_asiSafe1__._undefined1320013204__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1335413357__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1364113644__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1395813962__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1412814132__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1434614349__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1467414677__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1467914687__WEBPACK_MODULE_REFERENCE__10_5b22506c616e4261646765225d_directImport_asiSafe1__._undefined1506015063__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1506515073__WEBPACK_MODULE_REFERENCE__10_5b22506c616e4261646765225d_directImport_asiSafe1__._undefined1545515459__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1578615789__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1631116315__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1664216645__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1719017194__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1753817542__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1798817991__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1851018513__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1914619149__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1953319536__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1953819550__WEBPACK_MODULE_REFERENCE__7_5b225570677261646550726f6d7074225d_directImport_asiSafe1__._undefined1993419938__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2049220495__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2101421017__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2165021653__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2200222006__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2278222785__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2303423037__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2360523609__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2381523818__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2408424087__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2437924383__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2509425098__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2553325537__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2578925802__WEBPACK_MODULE_REFERENCE__9_5b22666f726d61744c6173745365656e225d_call_directImport_asiSafe1__._undefined2616326166__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2640126405__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2659126594__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2694426947__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2744427447__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2781527819__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2797527978__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2832828331__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2869128695__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2933129335__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2949729500__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2975729760__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3226332267__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3255432557__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3274332746__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3318533189__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3335133354__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3361433617__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3377633779__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3425234256__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3441834421__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3467634679__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3485134854__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3532535329__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3549135494__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3574835751__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3592235926__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3647436478__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3663336637__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3680336807__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3715437158__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3735537359__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3756137564__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3795537959__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3816138164__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3864038643__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3957639580__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3969839701__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4000140004__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4050340507__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4065740661__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4089640900__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4134841351__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4151741520__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4187741880__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4204642050__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4223642239__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4256942572__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4329843302__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4349643500__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4374043743__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4394743955__WEBPACK_MODULE_REFERENCE__8_5b2273686f72744e616d65225d_call_directImport_asiSafe1__._undefined4420244206__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4487244875__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4516345166__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4587445882__WEBPACK_MODULE_REFERENCE__3_5b227573654c6f63616c65225d_call_directImport_asiSafe1__._undefined4755647560__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4761747621__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4776347766__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4803948043__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4818248186__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4858148585__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4901549018__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4931649319__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4944049443__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4963649639__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4983849841__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5093250935__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5158551592__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined5164751654__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined5409754101__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5423954243__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5438154384__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5457954582__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5479054794__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5495254956__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5504555048__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5530155304__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5545955462__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5584555849__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5593855941__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5619856201__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5678156785__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5707657079__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5725557258__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5726057271__WEBPACK_MODULE_REFERENCE__11_5b2243617465676f727949636f6e225d_directImport_asiSafe1__._undefined5747057486__WEBPACK_MODULE_REFERENCE__11_5b22697343617465676f727949636f6e55726c225d_call_directImport_asiSafe1__._undefined5806558069__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5815858161__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5841758421__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5858258585__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5900759011__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined6012260125__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6034060343__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6059560598__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6132261326__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined6157161574__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6190661909__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6211762120__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6282662830__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined6291962922__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6319063193__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6333963343__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined6356863571__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6376263765__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6411064113__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6430764311__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined6457864582__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined6484464847__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6523465237__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6575765761__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined6674466748__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined6683766840__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6709667099__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6737567379__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined6777167774__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6825968262__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6841968422__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6898968992__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6919069194__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined6942869431__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6982369827__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined6998869991__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7025070253__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7053270535__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7066770670__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined_תu˜ð^ÓþR y Í ø L ‡ Û ^ … Ù  [ ‘ å  k  ñ _oÎ"`Žë?÷Mð k~ÜïMlÈÎ6Ä jº*üZ— c_Ñ € þ T!á!W"û#E$Õ$%1(“( *W*Ã*+ª+ö+[.¥.c/¯/€0Ì0›1å13f35L56_e6¢7î7ù:E;*<t<v<È<=>‡>‰>Û>®@ú@AÚAöB@CzDÆDlEžEŽFØFHgHiH»H0JzJ|J_ÎJLL˜LßM)N3PPÆQR1T}TÕU!VßW)X0ZzZó\=]œ^_ _b_â`.aXc¢c©eóelh¶hj__jgm±mªnôn,qxqFrršsäsuTuxgxzfzb{Â{+}u}`~¬~f°XIƒ“ƒ…O…ë…_5†“‡Ý‡E‰‘‰ ŒYŒûŒEFސŽW˜£˜Â™ šÆš›ÇœµÿŸMŸìŸ6 ¢[¢ý¢G£F€€<¥_†¥]§©§Kš•š“©Ý©ˆªÔªø¬D­ß­+®Ñ®¯x°Ä°‰±Õ±Ÿ²é²pŽŒŽ†µÐµ¬·ö·›»ç»]Œ§ŒÓœ_ŸÀ\ÀòÀ>Á)ÂuÂ5ÄÄ%ÅoÅÔÆÇÄÇÈÊÈÉ^ÊšÊ~ÍÊÍŒÎØÎÈÏÐÞÐ4Ñ+ÒwÒÕ[Õ{Ö_Å։ÙßÙiàµàîà:áÈáâ#ãoãúãFäÑåæËçè?é‰éêLê ëWëìhì«ðõðóÓó ô^ôéý_5þ¿þ ÿ•ÿßÿ¢ìŒŠòK•’ÜwÁ@Œå/0 z Ÿ  - w 'qsË’_ù<ˆá++wbT«õÌ\0!|!q"»"$Q$!%k%-(y(Ò()(*r*+_P+1,{,:-„-Ý.'/é/50@1Œ1’2Ü2_4©4±6ý6Ô: ;y;Ã;Ã< =!>m>õ??@$BnB CUCŒENÖEœFèFÒGH€IðI‘JÛJÞK(L?M‰M NWN˜(0,navigation.useParams)£(0,context_locale/* useLocale */.Y)›(0,auth/* useSession */.wV)˜(0,navigation.useRouter)’(0,react.useState)ÿÿÿÿÿÿÿÿÿÿÿÿÿÿ“(0,react.useEffect)ž(0,api/* getUserProfile */.VM)ž(0,api/* getUserReviews */.v9)(0,api/* getUserRating */.Bm)(0,api/* getCategories */.bW)œ(0,api/* getLocations */.Vs)¢(0,api/* getSpecialistCards */.Bq)œ(0,api/* getPriceList */.Ck)øŠ(0,api/* getSpecialistFavorites */.pD)(0,api/* getCanMessage */.On)š(0,api/* removeSpecialistFavorite */.sD)€(0,api/* addSpecialistFavorite */.V)¥(0,api/* getOrCreateDirectRoom */.QN)ó©(0,api/* getSpecialistAvailability */.Xz)àà¥(0,formatName/* formatShortName */.H)ÞÞÞßÞÞßßÞßÞÞßšPlanBadge/* PlanBadge */.dÞÿÝÞÞÝÝÞÞÿÞÿÝÞÝÞÝÝÞÞÞލUpgradePromptÜÝÝÝÜÝÝÜÝÝÜÜÜš(0,formatLastSeen/* formatLastSeen */.V)ÜÛÜÜÜÛÜÜÛÛÜÜÛÜÜÛÜÜÜÛÜÜÜÛÜÜÛÛÛÛÛÛÜÛÜÜÛÜÜÛÛÛÜÜÜÛÜÜÛÛÜŸ(0,formatName/* shortName */.E)ÚÛÛéÚÚÛÚÚÚÛÛÛÛÛÛììÚÚÛÛÚÚÛÛÛÚÛÛÚÛÛ¡CategoryIcon/* CategoryIcon */.Ez©(0,CategoryIcon/* isCategoryIconUrl */.V)ØÙØÙØÙÙÙØÙÙÙØÙÙØÙÙÙØØÙÙØØÙÙØÙÙÙÙØÙØÙÙÙÙ€†buffer†source„size„maps„hash;// ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); // EXPORTS __webpack_require__.d(__webpack_exports__, { "default": () => (/* binding */ UserProfilePage) }); // EXTERNAL MODULE: ../../node_modules/next/dist/compiled/react/jsx-runtime.js var jsx_runtime = __webpack_require__(4568); // EXTERNAL MODULE: ../../node_modules/next/dist/compiled/react/index.js var react = __webpack_require__(7620); // EXTERNAL MODULE: ../../node_modules/next/dist/api/navigation.js var navigation = __webpack_require__(7541); // EXTERNAL MODULE: ./src/context/locale.tsx var context_locale = __webpack_require__(9906); // EXTERNAL MODULE: ./src/lib/auth.ts var auth = __webpack_require__(1592); // EXTERNAL MODULE: ./src/lib/api.ts var api = __webpack_require__(2982); // EXTERNAL MODULE: ../../node_modules/next/dist/client/app-dir/link.js var app_dir_link = __webpack_require__(9664); var link_default = /*#__PURE__*/__webpack_require__.n(app_dir_link); ;// ./src/components/UpgradePrompt.tsx const tierLabels = { free: 'Free', pro: 'Pro', ultimate: 'Ultimate' }; const tierColors = { free: 'bg-gray-50 border-gray-200 text-gray-700', pro: 'bg-green-50 border-green-200 text-gray-800', ultimate: 'bg-amber-50 border-amber-200 text-amber-800' }; const tierBtnColors = { free: 'bg-gray-600 hover:bg-gray-700 text-white', pro: 'bg-green-600 hover:bg-green-700 text-white', ultimate: 'bg-amber-500 hover:bg-amber-600 text-white' }; function UpgradePrompt(param) { let { feature, requiredTier, variant = 'inline', t, className = '' } = param; const tierLabel = tierLabels[requiredTier]; if (variant === 'banner') { return /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex items-center justify-between gap-3 rounded-xl border px-4 py-3 ".concat(tierColors[requiredTier], " ").concat(className), children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex items-center gap-2 min-w-0", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)(LockIcon, { className: "w-4 h-4 shrink-0 opacity-60" }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("span", { className: "text-sm font-medium truncate", children: [ feature, " — ", t('upgrade.available_in', 'Available in'), " ", /*#__PURE__*/ (0,jsx_runtime.jsx)("b", { children: tierLabel }) ] }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)((link_default()), { href: "/pricing?highlight=".concat(requiredTier), className: "shrink-0 text-xs font-semibold px-3 py-1.5 rounded-lg transition ".concat(tierBtnColors[requiredTier]), children: t('upgrade.cta', 'Upgrade') }) ] }); } if (variant === 'block') { return /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "rounded-2xl border p-6 text-center ".concat(tierColors[requiredTier], " ").concat(className), children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)(LockIcon, { className: "w-8 h-8 mx-auto mb-3 opacity-40" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "font-semibold text-base mb-1", children: feature }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("p", { className: "text-sm opacity-70 mb-4", children: [ t('upgrade.available_in', 'Available in plan'), " ", /*#__PURE__*/ (0,jsx_runtime.jsx)("b", { children: tierLabel }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)((link_default()), { href: "/pricing?highlight=".concat(requiredTier), className: "inline-block text-sm font-semibold px-5 py-2 rounded-xl transition ".concat(tierBtnColors[requiredTier]), children: t('upgrade.cta', 'Upgrade plan') }) ] }); } // inline variant return /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex items-center gap-2 text-sm ".concat(className), children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)(LockIcon, { className: "w-4 h-4 text-gray-400 shrink-0" }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("span", { className: "text-gray-500", children: [ t('upgrade.available_in', 'Available in'), " ", /*#__PURE__*/ (0,jsx_runtime.jsx)("b", { className: "text-gray-700", children: tierLabel }), ".", ' ', /*#__PURE__*/ (0,jsx_runtime.jsx)((link_default()), { href: "/pricing?highlight=".concat(requiredTier), className: "text-green-600 hover:underline", children: t('upgrade.cta', 'Upgrade') }) ] }) ] }); } function LockIcon(param) { let { className = '' } = param; return /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { viewBox: "0 0 20 20", fill: "currentColor", className: className, children: /*#__PURE__*/ (0,jsx_runtime.jsx)("path", { fillRule: "evenodd", d: "M10 1a4.5 4.5 0 00-4.5 4.5V9H5a2 2 0 00-2 2v6a2 2 0 002 2h10a2 2 0 002-2v-6a2 2 0 00-2-2h-.5V5.5A4.5 4.5 0 0010 1zm3 8V5.5a3 3 0 10-6 0V9h6z", clipRule: "evenodd" }) }); } // EXTERNAL MODULE: ./src/lib/formatName.ts var formatName = __webpack_require__(1258); // EXTERNAL MODULE: ./src/lib/formatLastSeen.ts var formatLastSeen = __webpack_require__(5338); // EXTERNAL MODULE: ./src/components/PlanBadge.tsx var PlanBadge = __webpack_require__(2035); // EXTERNAL MODULE: ./src/components/CategoryIcon.tsx var CategoryIcon = __webpack_require__(5940); ;// ./src/app/users/[id]/page.tsx /* __next_internal_client_entry_do_not_use__ default auto */ const MONTHS_BY_LOCALE = { ru: [ 'ЯМварь', 'Ѐевраль', 'Март', 'Апрель', 'Май', 'ИюМь', 'Июль', 'Август', 'СеМтябрь', 'Октябрь', 'НПябрь', 'Декабрь' ], en: [ 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December' ], el: [ 'ΙαΜουάριος', 'Ίεβρουάριος', 'Μάρτιος', 'Απρίλιος', 'Μάιος', 'ΙούΜιος', 'Ιούλιος', 'Αύγουστος', 'ΣεπτέΌβριος', 'Οκτώβριος', 'ΝοέΌβριος', 'ΔεκέΌβριος' ], uk: [ 'СічеМь', 'ЛютОй', 'БерезеМь', 'КвітеМь', 'ТравеМь', 'ЧервеМь', 'ЛОпеМь', 'СерпеМь', 'ВересеМь', 'ЖПвтеМь', 'ЛОстПпаЎ', 'ГруЎеМь' ] }; const WEEK_DAYS_BY_LOCALE = { ru: [ 'ПМ', 'Вт', 'Ср', 'Чт', 'Пт', 'Сб', 'Вс' ], en: [ 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa', 'Su' ], el: [ 'Δε', '΀ρ', '΀ε', 'Πε', 'Πα', 'Σά', 'Κυ' ], uk: [ 'ПМ', 'Вт', 'Ср', 'Чт', 'Пт', 'Сб', 'НЎ' ] }; function UserProfilePage() { var _user_firstName, _user_lastName, _user_name_, _user_name, _user_siteSettings, _session_user; const { id } = (0,navigation.useParams)(); const { t, locale } = (0,context_locale/* useLocale */.Y)(); const { data: session } = (0,auth/* useSession */.wV)(); const router = (0,navigation.useRouter)(); const [user, setUser] = (0,react.useState)(null); const [reviews, setReviews] = (0,react.useState)([]); const [rating, setRating] = (0,react.useState)(null); const [loading, setLoading] = (0,react.useState)(true); const [specialistCards, setSpecialistCards] = (0,react.useState)([]); const [priceLists, setPriceLists] = (0,react.useState)({}); const [catMap, setCatMap] = (0,react.useState)(new Map()); const [locMap, setLocMap] = (0,react.useState)(new Map()); const [isFavorite, setIsFavorite] = (0,react.useState)(false); const [favLoading, setFavLoading] = (0,react.useState)(false); const [msgLoading, setMsgLoading] = (0,react.useState)(false); const [canMsg, setCanMsg] = (0,react.useState)(null); // Availability const now = new Date(); const [availYear, setAvailYear] = (0,react.useState)(now.getFullYear()); const [availMonth, setAvailMonth] = (0,react.useState)(now.getMonth()); const [availMap, setAvailMap] = (0,react.useState)({}); const today = new Date().toISOString().slice(0, 10); const dateLocale = locale === 'ru' ? 'ru-RU' : locale === 'uk' ? 'uk-UA' : locale === 'en' ? 'en-US' : 'el-GR'; (0,react.useEffect)(()=>{ if (!id) return; Promise.all([ (0,api/* getUserProfile */.VM)(id, locale), (0,api/* getUserReviews */.v9)(id), (0,api/* getUserRating */.Bm)(id), (0,api/* getCategories */.bW)().catch(()=>[]), (0,api/* getLocations */.Vs)().catch(()=>[]) ]).then((param)=>{ let [u, r, rt, cats, locs] = param; setUser(u); setReviews(r); setRating(rt.avg); setCatMap(new Map(flattenTree(cats).map((c)=>[ c.slug, c ]))); setLocMap(new Map(flattenTree(locs).map((l)=>[ l.slug, l ]))); if (u.role === 'specialist' || u.role === 'admin') { (0,api/* getSpecialistCards */.Bq)(id, locale).then((cards)=>{ setSpecialistCards(cards); cards.forEach((c)=>{ (0,api/* getPriceList */.Ck)(c.id, locale).then((pl)=>{ if (pl.length > 0) setPriceLists((prev)=>({ ...prev, [c.id]: pl })); }).catch(()=>{}); }); }).catch(()=>{}); } }).catch(()=>{}).finally(()=>setLoading(false)); }, [ id, locale ]); // Load favorite status when session available (0,react.useEffect)(()=>{ var _session_user; if (!session || !id) return; (0,api/* getSpecialistFavorites */.pD)().then((rows)=>setIsFavorite(rows.some((r)=>{ var _r_specialist; return ((_r_specialist = r.specialist) === null || _r_specialist === void 0 ? void 0 : _r_specialist.id) === id; }))).catch(()=>{}); // Check if current user can message this person const myId = (_session_user = session.user) === null || _session_user === void 0 ? void 0 : _session_user.id; if (myId && myId !== id) { (0,api/* getCanMessage */.On)(id).then(setCanMsg).catch(()=>{}); } }, [ session, id ]); async function toggleFavorite() { if (!session) { router.push('/register'); return; } setFavLoading(true); try { if (isFavorite) { await (0,api/* removeSpecialistFavorite */.sD)(id); setIsFavorite(false); } else { await (0,api/* addSpecialistFavorite */.V)(id); setIsFavorite(true); } } catch (e) {} setFavLoading(false); } async function handleMessage() { if (!session) { router.push('/login'); return; } setMsgLoading(true); try { const { room } = await (0,api/* getOrCreateDirectRoom */.QN)(id); router.push("/chat?room=".concat(room.id)); } catch (e) {} setMsgLoading(false); } (0,react.useEffect)(()=>{ if (!id) return; const monthKey = "".concat(availYear, "-").concat(String(availMonth + 1).padStart(2, '0')); (0,api/* getSpecialistAvailability */.Xz)(id, monthKey).then((rows)=>{ setAvailMap((prev)=>{ const next = { ...prev }; rows.forEach((r)=>{ next[r.date] = r.status; }); return next; }); }).catch(()=>{}); }, [ id, availYear, availMonth ]); if (loading) return /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "text-center py-20 text-white", children: t('common.loading') }); if (!user) return /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "text-center py-20 text-white/70", children: t('common.error') }); var _user_firstName_, _user_lastName_; const initials = "".concat((_user_firstName_ = (_user_firstName = user.firstName) === null || _user_firstName === void 0 ? void 0 : _user_firstName[0]) !== null && _user_firstName_ !== void 0 ? _user_firstName_ : '').concat((_user_lastName_ = (_user_lastName = user.lastName) === null || _user_lastName === void 0 ? void 0 : _user_lastName[0]) !== null && _user_lastName_ !== void 0 ? _user_lastName_ : '').toUpperCase() || ((_user_name = user.name) === null || _user_name === void 0 ? void 0 : (_user_name_ = _user_name[0]) === null || _user_name_ === void 0 ? void 0 : _user_name_.toUpperCase()) || '?'; const displayName = (0,formatName/* formatShortName */.H)(user.firstName, user.lastName, user.name); const profileBackgroundImage = typeof ((_user_siteSettings = user.siteSettings) === null || _user_siteSettings === void 0 ? void 0 : _user_siteSettings.profileBackgroundImage) === 'string' && user.siteSettings.profileBackgroundImage.trim().length > 0 ? user.siteSettings.profileBackgroundImage : null; return /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "max-w-3xl mx-auto px-4 py-10", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-6 mb-6", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "relative -mx-6 -mt-6 mb-5 h-44 overflow-hidden rounded-t-xl", style: { backgroundImage: profileBackgroundImage ? "linear-gradient(135deg, rgba(21, 128, 61, 0.45), rgba(22, 163, 74, 0.65)), url(".concat(profileBackgroundImage, ")") : 'linear-gradient(135deg, #22c55e 0%, #16a34a 45%, #166534 100%)', backgroundSize: 'cover', backgroundPosition: 'center' }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "absolute inset-0 bg-gradient-to-b from-black/10 to-black/30" }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "relative h-full w-full p-5 flex items-end justify-between", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex items-center gap-3 min-w-0", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "w-14 h-14 rounded-full bg-white/20 border border-white/40 overflow-hidden flex items-center justify-center text-white text-xl font-bold backdrop-blur-sm", children: user.image ? /*#__PURE__*/ (0,jsx_runtime.jsx)("img", { src: user.image, alt: displayName, className: "w-full h-full object-cover" }) : initials }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "min-w-0", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "text-white text-lg font-bold truncate", children: displayName }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("p", { className: "text-white/85 text-xs", children: [ t('profile.member_since'), " ", new Date(user.createdAt).toLocaleDateString(dateLocale) ] }) ] }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "shrink-0", children: [ user.planTier && user.planTier !== 'free' && /*#__PURE__*/ (0,jsx_runtime.jsx)(PlanBadge/* PlanBadge */.d, { tier: user.planTier, verified: user.hasVerifiedBadge, size: "sm" }), user.hasVerifiedBadge && user.planTier === 'free' && /*#__PURE__*/ (0,jsx_runtime.jsx)(PlanBadge/* PlanBadge */.d, { tier: "free", verified: true, size: "sm" }) ] }) ] }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex items-start gap-5", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "w-20 h-20 rounded-full bg-green-100 flex-shrink-0 flex items-center justify-center text-green-700 text-2xl font-bold overflow-hidden border-2 border-gray-100", children: user.image ? /*#__PURE__*/ (0,jsx_runtime.jsx)("img", { src: user.image, alt: displayName, className: "w-full h-full object-cover" }) : initials }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex items-center gap-2 flex-wrap mb-1", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("h1", { className: "text-xl font-bold text-gray-900", children: displayName }), user.planTier && user.planTier !== 'free' && /*#__PURE__*/ (0,jsx_runtime.jsx)(PlanBadge/* PlanBadge */.d, { tier: user.planTier, verified: user.hasVerifiedBadge, size: "sm" }), user.hasVerifiedBadge && user.planTier === 'free' && /*#__PURE__*/ (0,jsx_runtime.jsx)(PlanBadge/* PlanBadge */.d, { tier: "free", verified: true, size: "sm" }), Array.isArray(user.activeStatuses) && user.activeStatuses.includes('can_help_now') && /*#__PURE__*/ (0,jsx_runtime.jsxs)("span", { className: "inline-flex items-center gap-1 text-xs font-medium text-green-700 bg-green-50 border border-green-200 px-2 py-0.5 rounded-full", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "w-1.5 h-1.5 rounded-full bg-green-500 animate-pulse" }), t('status.can_help_now', 'Available now') ] }), Array.isArray(user.activeStatuses) && user.activeStatuses.includes('need_help') && /*#__PURE__*/ (0,jsx_runtime.jsxs)("span", { className: "inline-flex items-center gap-1 text-xs font-medium text-green-700 bg-green-50 border border-green-200 px-2 py-0.5 rounded-full", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "w-1.5 h-1.5 rounded-full bg-green-500" }), t('status.need_help', 'Need help') ] }), (session ? ((_session_user = session.user) === null || _session_user === void 0 ? void 0 : _session_user.id) !== id : true) && /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "ml-auto flex items-center gap-2", children: [ !session ? // Guest — show button that leads to registration /*#__PURE__*/ (0,jsx_runtime.jsxs)("a", { href: "/register", className: "flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-sm font-medium bg-green-50 text-green-600 border border-green-200 hover:bg-green-100 transition", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { children: t('chat.write_btn', 'Write') }) ] }) : (canMsg === null || canMsg === void 0 ? void 0 : canMsg.allowed) === false ? /*#__PURE__*/ (0,jsx_runtime.jsx)(UpgradePrompt, { feature: t('chat.write_btn', 'Write'), requiredTier: "pro", variant: "inline", t: t }) : /*#__PURE__*/ (0,jsx_runtime.jsxs)("button", { onClick: handleMessage, disabled: msgLoading, className: "flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-sm font-medium bg-green-50 text-green-600 border border-green-200 hover:bg-green-100 transition disabled:opacity-50", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { children: t('chat.write_btn') }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("button", { onClick: toggleFavorite, disabled: favLoading, title: isFavorite ? t('specialist.unfavorite') : t('specialist.favorite'), className: "flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-sm font-medium transition disabled:opacity-50 ".concat(isFavorite ? 'bg-pink-50 text-pink-600 border border-pink-200 hover:bg-pink-100' : 'bg-gray-50 text-gray-600 border border-gray-200 hover:bg-gray-100'), children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { children: isFavorite ? '❀' : '🀍' }), /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { children: isFavorite ? t('specialist.unfavorite') : t('specialist.favorite') }) ] }) ] }) ] }), rating && /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex items-center gap-1.5 mb-2", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "text-yellow-400 text-lg", children: "★" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "font-semibold text-gray-800", children: Number(rating).toFixed(1) }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("span", { className: "text-sm text-gray-400", children: [ "(", reviews.length, " ", t('profile.reviews').toLowerCase(), ")" ] }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("p", { className: "text-sm text-gray-400", children: [ t('profile.member_since'), " ", new Date(user.createdAt).toLocaleDateString(dateLocale), user.lastSeenAt && /*#__PURE__*/ (0,jsx_runtime.jsxs)("span", { className: "ml-2", children: [ "\xb7 ", (0,formatLastSeen/* formatLastSeen */.V)(user.lastSeenAt, t) ] }) ] }) ] }) ] }), user.bio && /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "mt-4 text-gray-700 text-sm leading-relaxed border-t border-gray-100 pt-4", children: user.bio }), user.phone && /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "mt-4 border-t border-gray-100 pt-4 flex items-center gap-2", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M3 5a2 2 0 012-2h3.28a1 1 0 01.948.684l1.498 4.493a1 1 0 01-.502 1.21l-2.257 1.13a11.042 11.042 0 005.516 5.516l1.13-2.257a1 1 0 011.21-.502l4.493 1.498a1 1 0 01.684.949V19a2 2 0 01-2 2h-1C9.716 21 3 14.284 3 6V5z" }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)("a", { href: "tel:".concat(user.phone), className: "text-sm font-medium text-gray-700 hover:text-green-600", children: user.phone }) ] }), user.personalSiteSlug && /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "mt-3 flex items-center gap-2", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,jsx_runtime.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" }) }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("a", { href: "/site/".concat(user.personalSiteSlug), target: "_blank", rel: "noopener noreferrer", className: "text-sm text-green-600 hover:underline", children: [ "canhelp.gr/site/", user.personalSiteSlug ] }) ] }), user.languages && user.languages.length > 0 && /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "mt-4 border-t border-gray-100 pt-4", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "text-xs font-medium text-gray-500 mb-2 uppercase tracking-wide", children: t('profile.languages') }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "flex flex-wrap gap-2", children: user.languages.map((code)=>{ const langMap = { el: { flag: '🇬🇷', label: 'ΕλληΜικά' }, en: { flag: '🇬🇧', label: 'English' }, ru: { flag: '🇷🇺', label: 'РусскОй' }, uk: { flag: '🇺🇊', label: 'УкраїМська' }, de: { flag: '🇩🇪', label: 'Deutsch' }, fr: { flag: '🇫🇷', label: 'Français' }, it: { flag: '🇮🇹', label: 'Italiano' }, es: { flag: '🇪🇞', label: 'Español' }, ar: { flag: '🇞🇊', label: 'العرؚية' }, zh: { flag: '🇚🇳', label: 'äž­æ–‡' } }; const lang = langMap[code]; if (!lang) return null; return /*#__PURE__*/ (0,jsx_runtime.jsxs)("span", { className: "flex items-center gap-1.5 bg-indigo-50 text-indigo-700 text-sm px-3 py-1 rounded-full border border-indigo-100", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { children: lang.flag }), /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { children: lang.label }) ] }, code); }) }) ] }), user.skills && user.skills.length > 0 && specialistCards.length === 0 && /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "mt-4 border-t border-gray-100 pt-4", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "text-xs font-medium text-gray-500 mb-2 uppercase tracking-wide", children: t('profile.skills.label') }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "flex flex-wrap gap-2", children: user.skills.map((skill)=>/*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "bg-green-50 text-green-700 text-sm px-3 py-1 rounded-full", children: skill }, skill)) }) ] }), user.role === 'specialist' && user.specialistCategories && user.specialistCategories.length > 0 && specialistCards.length === 0 && /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "mt-4 border-t border-gray-100 pt-4", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "text-xs font-medium text-gray-500 mb-2 uppercase tracking-wide", children: t('user.categories') }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "flex flex-wrap gap-2", children: user.specialistCategories.map((slug)=>/*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "bg-purple-50 text-purple-700 text-sm px-3 py-1 rounded-full", children: slug }, slug)) }) ] }), user.role === 'specialist' && user.specialistLocations && user.specialistLocations.length > 0 && specialistCards.length === 0 && /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "mt-4 border-t border-gray-100 pt-4", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "text-xs font-medium text-gray-500 mb-2 uppercase tracking-wide", children: t('user.work_area') }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "flex flex-wrap gap-2", children: user.specialistLocations.map((slug)=>/*#__PURE__*/ (0,jsx_runtime.jsxs)("span", { className: "bg-emerald-50 text-emerald-700 text-sm px-3 py-1 rounded-full", children: [ "\uD83D\uDCCD ", slug ] }, slug)) }) ] }) ] }), user.role === 'specialist' && /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-6 mb-6", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex items-center justify-between mb-4", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("h2", { className: "font-bold text-gray-900 text-lg", children: [ "\uD83D\uDCC5 ", t('nav.schedule') ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex items-center gap-3 text-xs text-gray-500", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("span", { className: "flex items-center gap-1.5", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "w-3 h-3 rounded bg-emerald-200 border border-emerald-400 inline-block" }), t('schedule.available') ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("span", { className: "flex items-center gap-1.5", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "w-3 h-3 rounded bg-red-200 border border-red-400 inline-block" }), t('schedule.busy') ] }) ] }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)(ReadOnlyCalendar, { year: availYear, month: availMonth, availMap: availMap, today: today, onPrev: ()=>{ if (availMonth === 0) { setAvailYear((y)=>y - 1); setAvailMonth(11); } else setAvailMonth((m)=>m - 1); }, onNext: ()=>{ if (availMonth === 11) { setAvailYear((y)=>y + 1); setAvailMonth(0); } else setAvailMonth((m)=>m + 1); } }) ] }), (user.role === 'specialist' || user.role === 'admin') && specialistCards.length > 0 && /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "space-y-4 mb-6", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("h2", { className: "font-bold text-white text-lg", children: t('nav.specialists') }), specialistCards.map((card)=>{ var _priceLists_card_id; return /*#__PURE__*/ (0,jsx_runtime.jsx)(PublicCardView, { card: card, locale: locale, catMap: catMap, locMap: locMap, t: t, priceList: (_priceLists_card_id = priceLists[card.id]) !== null && _priceLists_card_id !== void 0 ? _priceLists_card_id : [] }, card.id); }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("h2", { className: "font-bold text-gray-900 text-lg mb-4", children: [ t('profile.reviews'), reviews.length > 0 && /*#__PURE__*/ (0,jsx_runtime.jsxs)("span", { className: "text-gray-400 font-normal text-base ml-2", children: [ "(", reviews.length, ")" ] }) ] }), reviews.length === 0 ? /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "text-gray-500 text-sm", children: t('profile.no_reviews') }) : /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "space-y-4", children: reviews.map((param)=>{ let { review, author } = param; var _author_name_, _author_name; var _author_name__toUpperCase, _shortName; return /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "border-b border-gray-50 pb-4 last:border-0 last:pb-0", children: /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex items-start gap-3", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "w-8 h-8 rounded-full bg-gray-100 flex-shrink-0 flex items-center justify-center text-gray-600 text-sm font-bold overflow-hidden", children: (author === null || author === void 0 ? void 0 : author.image) ? /*#__PURE__*/ (0,jsx_runtime.jsx)("img", { src: author.image, alt: author.name, className: "w-full h-full object-cover" }) : (_author_name__toUpperCase = author === null || author === void 0 ? void 0 : (_author_name = author.name) === null || _author_name === void 0 ? void 0 : (_author_name_ = _author_name[0]) === null || _author_name_ === void 0 ? void 0 : _author_name_.toUpperCase()) !== null && _author_name__toUpperCase !== void 0 ? _author_name__toUpperCase : '?' }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex-1", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex items-center gap-2 mb-1", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "text-sm font-medium text-gray-800", children: (_shortName = (0,formatName/* shortName */.E)(author === null || author === void 0 ? void 0 : author.name)) !== null && _shortName !== void 0 ? _shortName : '—' }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("span", { className: "text-yellow-400", children: [ '★'.repeat(review.rating), '☆'.repeat(5 - review.rating) ] }) ] }), review.comment && /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "text-sm text-gray-600", children: review.comment }), /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "text-xs text-gray-400 mt-1", children: new Date(review.createdAt).toLocaleDateString(dateLocale) }) ] }) ] }) }, review.id); }) }) ] }) ] }); } function ReadOnlyCalendar(param) { let { year, month, availMap, today, onPrev, onNext } = param; const { locale, t } = (0,context_locale/* useLocale */.Y)(); var _WEEK_DAYS_BY_LOCALE_locale; const weekDays = (_WEEK_DAYS_BY_LOCALE_locale = WEEK_DAYS_BY_LOCALE[locale]) !== null && _WEEK_DAYS_BY_LOCALE_locale !== void 0 ? _WEEK_DAYS_BY_LOCALE_locale : WEEK_DAYS_BY_LOCALE.ru; var _MONTHS_BY_LOCALE_locale; const months = (_MONTHS_BY_LOCALE_locale = MONTHS_BY_LOCALE[locale]) !== null && _MONTHS_BY_LOCALE_locale !== void 0 ? _MONTHS_BY_LOCALE_locale : MONTHS_BY_LOCALE.ru; const firstDay = new Date(year, month, 1); const startDow = (firstDay.getDay() + 6) % 7; const daysInMonth = new Date(year, month + 1, 0).getDate(); const prevMonthDays = new Date(year, month, 0).getDate(); const cells = []; for(let i = startDow - 1; i >= 0; i--){ cells.push({ day: prevMonthDays - i, cur: false, dateKey: '' }); } for(let d = 1; d <= daysInMonth; d++){ const dateKey = "".concat(year, "-").concat(String(month + 1).padStart(2, '0'), "-").concat(String(d).padStart(2, '0')); cells.push({ day: d, cur: true, dateKey }); } const remainder = cells.length % 7; if (remainder !== 0) { for(let d = 1; d <= 7 - remainder; d++){ cells.push({ day: d, cur: false, dateKey: '' }); } } const monthPrefix = "".concat(year, "-").concat(String(month + 1).padStart(2, '0')); const availCount = Object.entries(availMap).filter((param)=>{ let [k, v] = param; return k.startsWith(monthPrefix) && k >= today && v === 'available'; }).length; return /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex items-center justify-between mb-3", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { onClick: onPrev, className: "w-7 h-7 rounded-lg hover:bg-gray-100 flex items-center justify-center text-gray-500", children: "‹" }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "text-center", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("span", { className: "font-medium text-gray-800 text-sm", children: [ months[month], " ", year ] }), availCount > 0 && /*#__PURE__*/ (0,jsx_runtime.jsxs)("span", { className: "ml-2 text-xs text-emerald-600", children: [ availCount, " ", t('schedule.free_days') ] }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { onClick: onNext, className: "w-7 h-7 rounded-lg hover:bg-gray-100 flex items-center justify-center text-gray-500", children: "›" }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "grid grid-cols-7 mb-1", children: weekDays.map((d)=>/*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "text-center text-xs text-gray-400 py-1", children: d }, d)) }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "grid grid-cols-7 gap-0.5", children: cells.map((cell, idx)=>{ if (!cell.cur) { return /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "h-9 flex items-center justify-center text-xs text-gray-200", children: cell.day }, "e-".concat(idx)); } const status = availMap[cell.dateKey]; const isPast = cell.dateKey < today; const isToday = cell.dateKey === today; let cls = 'h-9 flex items-center justify-center rounded-lg text-sm font-medium '; if (isPast) { cls += 'text-gray-200 '; } else if (status === 'available') { cls += 'bg-emerald-100 border border-emerald-300 text-emerald-700 '; } else if (status === 'busy') { cls += 'bg-red-100 border border-red-300 text-red-600 '; } else { cls += 'text-gray-500 '; } if (isToday) cls += 'ring-2 ring-blue-400 ring-offset-1 '; return /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: cls, children: cell.day }, cell.dateKey); }) }) ] }); } // ─── Public card view ───────────────────────────────────────────────────────── function flattenTree(nodes) { return nodes.flatMap((n)=>{ var _n_children; return [ n, ...flattenTree((_n_children = n.children) !== null && _n_children !== void 0 ? _n_children : []) ]; }); } function PublicCardView(param) { let { card, locale, catMap, locMap, t, priceList } = param; const [lightbox, setLightbox] = (0,react.useState)(null); const [expandedAreas, setExpandedAreas] = (0,react.useState)([]); const locById = new Map(); for (const node of locMap.values()){ if (node === null || node === void 0 ? void 0 : node.id) locById.set(node.id, node); } const getLocName = (loc, fallback)=>{ var _loc_names, _loc_names1; return (loc === null || loc === void 0 ? void 0 : (_loc_names = loc.names) === null || _loc_names === void 0 ? void 0 : _loc_names[locale]) || (loc === null || loc === void 0 ? void 0 : (_loc_names1 = loc.names) === null || _loc_names1 === void 0 ? void 0 : _loc_names1.el) || fallback; }; const locationGroups = (()=>{ const grouped = new Map(); var _card_locations; for (const slug of (_card_locations = card.locations) !== null && _card_locations !== void 0 ? _card_locations : []){ const loc = locMap.get(slug); if (!loc) { if (!grouped.has(slug)) { grouped.set(slug, { root: { slug, names: { el: slug } }, rootSlug: slug, districts: [], districtSlugs: new Set() }); } continue; } let root = loc; const seenIds = new Set(); while((root === null || root === void 0 ? void 0 : root.parentId) && locById.has(root.parentId) && !seenIds.has(root.parentId)){ seenIds.add(root.parentId); root = locById.get(root.parentId); } var _root_slug; const rootSlug = (_root_slug = root === null || root === void 0 ? void 0 : root.slug) !== null && _root_slug !== void 0 ? _root_slug : slug; if (!grouped.has(rootSlug)) { grouped.set(rootSlug, { root, rootSlug, districts: [], districtSlugs: new Set() }); } const group = grouped.get(rootSlug); if (loc.slug !== rootSlug && !group.districtSlugs.has(loc.slug)) { group.districtSlugs.add(loc.slug); group.districts.push(loc); } } return Array.from(grouped.values()); })(); var _lightbox_title; return /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 overflow-hidden", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "px-5 py-4 border-b border-gray-100", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("h3", { className: "font-bold text-gray-900", children: card.title }), card.description && /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "text-sm text-gray-600 mt-1", children: card.description }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "p-5 space-y-4", children: [ card.skills && card.skills.length > 0 && /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "text-xs font-semibold text-gray-500 uppercase tracking-wide mb-2", children: t('card.skills') }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "flex flex-wrap gap-2", children: card.skills.map((s)=>/*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "bg-green-50 text-green-700 text-sm px-3 py-1 rounded-full", children: s }, s)) }) ] }), card.categories && card.categories.length > 0 && /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "text-xs font-semibold text-gray-500 uppercase tracking-wide mb-2", children: t('card.categories') }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "flex flex-wrap gap-2", children: card.categories.map((s)=>{ var _cat_names, _cat_names1; const cat = catMap.get(s); const name = cat ? ((_cat_names = cat.names) === null || _cat_names === void 0 ? void 0 : _cat_names[locale]) || ((_cat_names1 = cat.names) === null || _cat_names1 === void 0 ? void 0 : _cat_names1.el) || s : s; return /*#__PURE__*/ (0,jsx_runtime.jsxs)("span", { className: "bg-purple-50 text-purple-700 text-sm px-3 py-1 rounded-full", children: [ (cat === null || cat === void 0 ? void 0 : cat.icon) ? /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "mr-1 inline-flex align-middle", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(CategoryIcon/* CategoryIcon */.Ez, { icon: cat.icon, alt: name, className: (0,CategoryIcon/* isCategoryIconUrl */.V)(cat.icon) ? 'h-4 w-4 object-contain' : 'text-sm leading-none', fallback: "\uD83D\uDCE6" }) }) : null, name ] }, s); }) }) ] }), card.locations && card.locations.length > 0 && /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "text-xs font-semibold text-gray-500 uppercase tracking-wide mb-2", children: t('user.work_area') }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "space-y-2", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "flex flex-wrap gap-2", children: locationGroups.map((group)=>{ const expanded = expandedAreas.includes(group.rootSlug); const canExpand = group.districts.length > 0; return /*#__PURE__*/ (0,jsx_runtime.jsxs)("button", { type: "button", onClick: ()=>{ if (!canExpand) return; setExpandedAreas((prev)=>prev.includes(group.rootSlug) ? prev.filter((slug)=>slug !== group.rootSlug) : [ ...prev, group.rootSlug ]); }, className: "inline-flex items-center gap-1.5 text-sm px-3 py-1.5 rounded-full border transition ".concat(expanded ? 'bg-emerald-100 text-emerald-800 border-emerald-300' : 'bg-emerald-50 text-emerald-700 border-emerald-200 hover:bg-emerald-100', " ").concat(canExpand ? 'cursor-pointer' : 'cursor-default'), children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { children: "\uD83D\uDCCD" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { children: getLocName(group.root, group.rootSlug) }), canExpand && /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "text-[11px] font-semibold px-1.5 py-0.5 rounded-full bg-white/80 text-emerald-700 border border-emerald-200", children: expanded ? '−' : "+".concat(group.districts.length) }) ] }, group.rootSlug); }) }), locationGroups.filter((group)=>expandedAreas.includes(group.rootSlug) && group.districts.length > 0).map((group)=>/*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "rounded-xl border border-emerald-100 bg-emerald-50/40 p-3", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "text-xs text-emerald-700 font-medium mb-2", children: getLocName(group.root, group.rootSlug) }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "flex flex-wrap gap-1.5", children: group.districts.map((district)=>/*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "text-xs px-2.5 py-1 rounded-full bg-white border border-emerald-200 text-emerald-700", children: getLocName(district, district.slug) }, district.slug)) }) ] }, "".concat(group.rootSlug, "-children"))) ] }) ] }), priceList.length > 0 && /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "text-xs font-semibold text-gray-500 uppercase tracking-wide mb-3", children: t('profile.card.tab.pricelist') }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "space-y-3", children: priceList.map((group)=>/*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "border border-gray-200 rounded-xl overflow-hidden", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "bg-gray-50 px-4 py-2 border-b border-gray-200", children: /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "font-semibold text-sm text-gray-800", children: group.title }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "divide-y divide-gray-100", children: group.items.map((item)=>/*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex items-center gap-3 px-4 py-2.5 text-sm", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "font-medium text-gray-800", children: item.name }), item.description && /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "text-xs text-gray-500", children: item.description }) ] }), (item.price || item.unit) && /*#__PURE__*/ (0,jsx_runtime.jsxs)("span", { className: "text-green-700 font-semibold whitespace-nowrap", children: [ item.price ? "€".concat(item.price) : '', item.unit ? " ".concat(item.unit) : '' ] }) ] }, item.id)) }) ] }, group.id)) }) ] }), card.portfolio && card.portfolio.length > 0 && /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "text-xs font-semibold text-gray-500 uppercase tracking-wide mb-2", children: t('card.portfolio') }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "grid grid-cols-2 sm:grid-cols-3 gap-3", children: card.portfolio.map((item)=>{ var _item_title; return /*#__PURE__*/ (0,jsx_runtime.jsxs)("button", { type: "button", onClick: ()=>setLightbox(item), className: "group relative rounded-xl overflow-hidden border border-gray-200 bg-gray-50 text-left", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("img", { src: item.imageUrl, alt: (_item_title = item.title) !== null && _item_title !== void 0 ? _item_title : '', className: "w-full aspect-square object-cover group-hover:scale-105 transition-transform duration-200" }), item.title && /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "px-2 py-1.5", children: /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "text-xs font-medium text-gray-700 truncate", children: item.title }) }) ] }, item.id); }) }) ] }) ] }), lightbox && /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "fixed inset-0 z-50 flex items-center justify-center bg-black/80 px-4", onClick: ()=>setLightbox(null), children: /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "bg-white rounded-2xl overflow-hidden max-w-lg w-full shadow-2xl", onClick: (e)=>e.stopPropagation(), children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("img", { src: lightbox.imageUrl, alt: (_lightbox_title = lightbox.title) !== null && _lightbox_title !== void 0 ? _lightbox_title : '', className: "w-full max-h-[60vh] object-contain bg-gray-900" }), (lightbox.title || lightbox.description) && /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "p-4", children: [ lightbox.title && /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "font-semibold text-gray-800 mb-1", children: lightbox.title }), lightbox.description && /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "text-sm text-gray-600", children: lightbox.description }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "flex justify-end px-4 pb-4", children: /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { type: "button", onClick: ()=>setLightbox(null), className: "text-sm text-gray-500 hover:text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-100", children: t('card.close') }) }) ] }) }) ] }); } €”{"finalSource":true}ƒmap‹bufferedMap ` ConcatSourceRawSourceà// ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); // EXPORTS __webpack_require__.d(__webpack_exports__, { "default": () => (/* binding */ UserProfilePage) }); // EXTERNAL MODULE: ../../node_modules/next/dist/compiled/react/jsx-runtime.js var jsx_runtime = __webpack_require__(4568); // EXTERNAL MODULE: ../../node_modules/next/dist/compiled/react/index.js var react = __webpack_require__(7620); // EXTERNAL MODULE: ../../node_modules/next/dist/api/navigation.js var navigation = __webpack_require__(7541); // EXTERNAL MODULE: ./src/context/locale.tsx var context_locale = __webpack_require__(9906); // EXTERNAL MODULE: ./src/lib/auth.ts var auth = __webpack_require__(1592); // EXTERNAL MODULE: ./src/lib/api.ts var api = __webpack_require__(2982); // EXTERNAL MODULE: ../../node_modules/next/dist/client/app-dir/link.js var app_dir_link = __webpack_require__(9664); var link_default = /*#__PURE__*/__webpack_require__.n(app_dir_link); ;// ./src/components/UpgradePrompt.tsx  ReplaceSourceReplaceSourceRawSource£import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import Link from 'next/link'; const tierLabels = { free: 'Free', pro: 'Pro', ultimate: 'Ultimate' }; const tierColors = { free: 'bg-gray-50 border-gray-200 text-gray-700', pro: 'bg-green-50 border-green-200 text-gray-800', ultimate: 'bg-amber-50 border-amber-200 text-amber-800' }; const tierBtnColors = { free: 'bg-gray-600 hover:bg-gray-700 text-white', pro: 'bg-green-600 hover:bg-green-700 text-white', ultimate: 'bg-amber-500 hover:bg-amber-600 text-white' }; export function UpgradePrompt(param) { let { feature, requiredTier, variant = 'inline', t, className = '' } = param; const tierLabel = tierLabels[requiredTier]; if (variant === 'banner') { return /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between gap-3 rounded-xl border px-4 py-3 ".concat(tierColors[requiredTier], " ").concat(className), children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 min-w-0", children: [ /*#__PURE__*/ _jsx(LockIcon, { className: "w-4 h-4 shrink-0 opacity-60" }), /*#__PURE__*/ _jsxs("span", { className: "text-sm font-medium truncate", children: [ feature, " — ", t('upgrade.available_in', 'Available in'), " ", /*#__PURE__*/ _jsx("b", { children: tierLabel }) ] }) ] }), /*#__PURE__*/ _jsx(Link, { href: "/pricing?highlight=".concat(requiredTier), className: "shrink-0 text-xs font-semibold px-3 py-1.5 rounded-lg transition ".concat(tierBtnColors[requiredTier]), children: t('upgrade.cta', 'Upgrade') }) ] }); } if (variant === 'block') { return /*#__PURE__*/ _jsxs("div", { className: "rounded-2xl border p-6 text-center ".concat(tierColors[requiredTier], " ").concat(className), children: [ /*#__PURE__*/ _jsx(LockIcon, { className: "w-8 h-8 mx-auto mb-3 opacity-40" }), /*#__PURE__*/ _jsx("p", { className: "font-semibold text-base mb-1", children: feature }), /*#__PURE__*/ _jsxs("p", { className: "text-sm opacity-70 mb-4", children: [ t('upgrade.available_in', 'Available in plan'), " ", /*#__PURE__*/ _jsx("b", { children: tierLabel }) ] }), /*#__PURE__*/ _jsx(Link, { href: "/pricing?highlight=".concat(requiredTier), className: "inline-block text-sm font-semibold px-5 py-2 rounded-xl transition ".concat(tierBtnColors[requiredTier]), children: t('upgrade.cta', 'Upgrade plan') }) ] }); } // inline variant return /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 text-sm ".concat(className), children: [ /*#__PURE__*/ _jsx(LockIcon, { className: "w-4 h-4 text-gray-400 shrink-0" }), /*#__PURE__*/ _jsxs("span", { className: "text-gray-500", children: [ t('upgrade.available_in', 'Available in'), " ", /*#__PURE__*/ _jsx("b", { className: "text-gray-700", children: tierLabel }), ".", ' ', /*#__PURE__*/ _jsx(Link, { href: "/pricing?highlight=".concat(requiredTier), className: "text-green-600 hover:underline", children: t('upgrade.cta', 'Upgrade') }) ] }) ] }); } function LockIcon(param) { let { className = '' } = param; return /*#__PURE__*/ _jsx("svg", { viewBox: "0 0 20 20", fill: "currentColor", className: className, children: /*#__PURE__*/ _jsx("path", { fillRule: "evenodd", d: "M10 1a4.5 4.5 0 00-4.5 4.5V9H5a2 2 0 00-2 2v6a2 2 0 002 2h10a2 2 0 002-2v-6a2 2 0 00-2-2h-.5V5.5A4.5 4.5 0 0010 1zm3 8V5.5a3 3 0 10-6 0V9h6z", clipRule: "evenodd" }) }); } %062undefined6492undefined565571undefined795799__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined10151019__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined11661169__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined13181322__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined16831686__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined19151918__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined19201923__WEBPACK_MODULE_REFERENCE__6_5b2264656661756c74225d_directImport_asiSafe1__._undefined23032307__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined24902493__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined26222625__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined27852789__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined30273030__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined31863189__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined31913194__WEBPACK_MODULE_REFERENCE__6_5b2264656661756c74225d_directImport_asiSafe1__._undefined35683572__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined37023705__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined38213825__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined40314034__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined42474250__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined42524255__WEBPACK_MODULE_REFERENCE__6_5b2264656661756c74225d_directImport_asiSafe1__._undefined46294632__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined47654768__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined696772(0,jsx_runtime.jsxs)undefined9881064(0,jsx_runtime.jsxs)undefined12111285(0,jsx_runtime.jsx)undefined14341510(0,jsx_runtime.jsxs)undefined18711945(0,jsx_runtime.jsx)undefined21742248(0,jsx_runtime.jsx)undefined22502327(link_default())undefined27072783(0,jsx_runtime.jsxs)undefined29663040(0,jsx_runtime.jsx)undefined31693243(0,jsx_runtime.jsx)undefined34033479(0,jsx_runtime.jsxs)undefined37173791(0,jsx_runtime.jsx)undefined39474021(0,jsx_runtime.jsx)undefined40234100(link_default())undefined44744550(0,jsx_runtime.jsxs)undefined46804754(0,jsx_runtime.jsx)undefined48704946(0,jsx_runtime.jsxs)undefined51525226(0,jsx_runtime.jsx)undefined54395513(0,jsx_runtime.jsx)undefined55155592(link_default())undefined59666040(0,jsx_runtime.jsx)undefined61736247(0,jsx_runtime.jsx)undefinedRawSource // EXTERNAL MODULE: ./src/lib/formatName.ts var formatName = __webpack_require__(1258); // EXTERNAL MODULE: ./src/lib/formatLastSeen.ts var formatLastSeen = __webpack_require__(5338); // EXTERNAL MODULE: ./src/components/PlanBadge.tsx var PlanBadge = __webpack_require__(2035); // EXTERNAL MODULE: ./src/components/CategoryIcon.tsx var CategoryIcon = __webpack_require__(5940); ;// ./src/app/users/[id]/page.tsx úûÑ/* __next_internal_client_entry_do_not_use__ default auto */ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { useState, useEffect } from 'react'; import { useParams, useRouter } from 'next/navigation'; import { useLocale } from '@/context/locale'; import { useSession } from '@/lib/auth'; import { getUserProfile, getUserReviews, getUserRating, getSpecialistAvailability, getSpecialistCards, getCategories, getLocations, getSpecialistFavorites, addSpecialistFavorite, removeSpecialistFavorite, getOrCreateDirectRoom, getCanMessage, getPriceList } from '@/lib/api'; import { UpgradePrompt } from '@/components/UpgradePrompt'; import { formatShortName, shortName } from '@/lib/formatName'; import { formatLastSeen } from '@/lib/formatLastSeen'; import { PlanBadge } from '@/components/PlanBadge'; import { CategoryIcon, isCategoryIconUrl } from '@/components/CategoryIcon'; const MONTHS_BY_LOCALE = { ru: [ 'ЯМварь', 'Ѐевраль', 'Март', 'Апрель', 'Май', 'ИюМь', 'Июль', 'Август', 'СеМтябрь', 'Октябрь', 'НПябрь', 'Декабрь' ], en: [ 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December' ], el: [ 'ΙαΜουάριος', 'Ίεβρουάριος', 'Μάρτιος', 'Απρίλιος', 'Μάιος', 'ΙούΜιος', 'Ιούλιος', 'Αύγουστος', 'ΣεπτέΌβριος', 'Οκτώβριος', 'ΝοέΌβριος', 'ΔεκέΌβριος' ], uk: [ 'СічеМь', 'ЛютОй', 'БерезеМь', 'КвітеМь', 'ТравеМь', 'ЧервеМь', 'ЛОпеМь', 'СерпеМь', 'ВересеМь', 'ЖПвтеМь', 'ЛОстПпаЎ', 'ГруЎеМь' ] }; const WEEK_DAYS_BY_LOCALE = { ru: [ 'ПМ', 'Вт', 'Ср', 'Чт', 'Пт', 'Сб', 'Вс' ], en: [ 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa', 'Su' ], el: [ 'Δε', '΀ρ', '΀ε', 'Πε', 'Πα', 'Σά', 'Κυ' ], uk: [ 'ПМ', 'Вт', 'Ср', 'Чт', 'Пт', 'Сб', 'НЎ' ] }; export default function UserProfilePage() { var _user_firstName, _user_lastName, _user_name_, _user_name, _user_siteSettings, _session_user; const { id } = useParams(); const { t, locale } = useLocale(); const { data: session } = useSession(); const router = useRouter(); const [user, setUser] = useState(null); const [reviews, setReviews] = useState([]); const [rating, setRating] = useState(null); const [loading, setLoading] = useState(true); const [specialistCards, setSpecialistCards] = useState([]); const [priceLists, setPriceLists] = useState({}); const [catMap, setCatMap] = useState(new Map()); const [locMap, setLocMap] = useState(new Map()); const [isFavorite, setIsFavorite] = useState(false); const [favLoading, setFavLoading] = useState(false); const [msgLoading, setMsgLoading] = useState(false); const [canMsg, setCanMsg] = useState(null); // Availability const now = new Date(); const [availYear, setAvailYear] = useState(now.getFullYear()); const [availMonth, setAvailMonth] = useState(now.getMonth()); const [availMap, setAvailMap] = useState({}); const today = new Date().toISOString().slice(0, 10); const dateLocale = locale === 'ru' ? 'ru-RU' : locale === 'uk' ? 'uk-UA' : locale === 'en' ? 'en-US' : 'el-GR'; useEffect(()=>{ if (!id) return; Promise.all([ getUserProfile(id, locale), getUserReviews(id), getUserRating(id), getCategories().catch(()=>[]), getLocations().catch(()=>[]) ]).then((param)=>{ let [u, r, rt, cats, locs] = param; setUser(u); setReviews(r); setRating(rt.avg); setCatMap(new Map(flattenTree(cats).map((c)=>[ c.slug, c ]))); setLocMap(new Map(flattenTree(locs).map((l)=>[ l.slug, l ]))); if (u.role === 'specialist' || u.role === 'admin') { getSpecialistCards(id, locale).then((cards)=>{ setSpecialistCards(cards); cards.forEach((c)=>{ getPriceList(c.id, locale).then((pl)=>{ if (pl.length > 0) setPriceLists((prev)=>({ ...prev, [c.id]: pl })); }).catch(()=>{}); }); }).catch(()=>{}); } }).catch(()=>{}).finally(()=>setLoading(false)); }, [ id, locale ]); // Load favorite status when session available useEffect(()=>{ var _session_user; if (!session || !id) return; getSpecialistFavorites().then((rows)=>setIsFavorite(rows.some((r)=>{ var _r_specialist; return ((_r_specialist = r.specialist) === null || _r_specialist === void 0 ? void 0 : _r_specialist.id) === id; }))).catch(()=>{}); // Check if current user can message this person const myId = (_session_user = session.user) === null || _session_user === void 0 ? void 0 : _session_user.id; if (myId && myId !== id) { getCanMessage(id).then(setCanMsg).catch(()=>{}); } }, [ session, id ]); async function toggleFavorite() { if (!session) { router.push('/register'); return; } setFavLoading(true); try { if (isFavorite) { await removeSpecialistFavorite(id); setIsFavorite(false); } else { await addSpecialistFavorite(id); setIsFavorite(true); } } catch (e) {} setFavLoading(false); } async function handleMessage() { if (!session) { router.push('/login'); return; } setMsgLoading(true); try { const { room } = await getOrCreateDirectRoom(id); router.push("/chat?room=".concat(room.id)); } catch (e) {} setMsgLoading(false); } useEffect(()=>{ if (!id) return; const monthKey = "".concat(availYear, "-").concat(String(availMonth + 1).padStart(2, '0')); getSpecialistAvailability(id, monthKey).then((rows)=>{ setAvailMap((prev)=>{ const next = { ...prev }; rows.forEach((r)=>{ next[r.date] = r.status; }); return next; }); }).catch(()=>{}); }, [ id, availYear, availMonth ]); if (loading) return /*#__PURE__*/ _jsx("div", { className: "text-center py-20 text-white", children: t('common.loading') }); if (!user) return /*#__PURE__*/ _jsx("div", { className: "text-center py-20 text-white/70", children: t('common.error') }); var _user_firstName_, _user_lastName_; const initials = "".concat((_user_firstName_ = (_user_firstName = user.firstName) === null || _user_firstName === void 0 ? void 0 : _user_firstName[0]) !== null && _user_firstName_ !== void 0 ? _user_firstName_ : '').concat((_user_lastName_ = (_user_lastName = user.lastName) === null || _user_lastName === void 0 ? void 0 : _user_lastName[0]) !== null && _user_lastName_ !== void 0 ? _user_lastName_ : '').toUpperCase() || ((_user_name = user.name) === null || _user_name === void 0 ? void 0 : (_user_name_ = _user_name[0]) === null || _user_name_ === void 0 ? void 0 : _user_name_.toUpperCase()) || '?'; const displayName = formatShortName(user.firstName, user.lastName, user.name); const profileBackgroundImage = typeof ((_user_siteSettings = user.siteSettings) === null || _user_siteSettings === void 0 ? void 0 : _user_siteSettings.profileBackgroundImage) === 'string' && user.siteSettings.profileBackgroundImage.trim().length > 0 ? user.siteSettings.profileBackgroundImage : null; return /*#__PURE__*/ _jsxs("div", { className: "max-w-3xl mx-auto px-4 py-10", children: [ /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6 mb-6", children: [ /*#__PURE__*/ _jsxs("div", { className: "relative -mx-6 -mt-6 mb-5 h-44 overflow-hidden rounded-t-xl", style: { backgroundImage: profileBackgroundImage ? "linear-gradient(135deg, rgba(21, 128, 61, 0.45), rgba(22, 163, 74, 0.65)), url(".concat(profileBackgroundImage, ")") : 'linear-gradient(135deg, #22c55e 0%, #16a34a 45%, #166534 100%)', backgroundSize: 'cover', backgroundPosition: 'center' }, children: [ /*#__PURE__*/ _jsx("div", { className: "absolute inset-0 bg-gradient-to-b from-black/10 to-black/30" }), /*#__PURE__*/ _jsxs("div", { className: "relative h-full w-full p-5 flex items-end justify-between", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 min-w-0", children: [ /*#__PURE__*/ _jsx("div", { className: "w-14 h-14 rounded-full bg-white/20 border border-white/40 overflow-hidden flex items-center justify-center text-white text-xl font-bold backdrop-blur-sm", children: user.image ? /*#__PURE__*/ _jsx("img", { src: user.image, alt: displayName, className: "w-full h-full object-cover" }) : initials }), /*#__PURE__*/ _jsxs("div", { className: "min-w-0", children: [ /*#__PURE__*/ _jsx("p", { className: "text-white text-lg font-bold truncate", children: displayName }), /*#__PURE__*/ _jsxs("p", { className: "text-white/85 text-xs", children: [ t('profile.member_since'), " ", new Date(user.createdAt).toLocaleDateString(dateLocale) ] }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "shrink-0", children: [ user.planTier && user.planTier !== 'free' && /*#__PURE__*/ _jsx(PlanBadge, { tier: user.planTier, verified: user.hasVerifiedBadge, size: "sm" }), user.hasVerifiedBadge && user.planTier === 'free' && /*#__PURE__*/ _jsx(PlanBadge, { tier: "free", verified: true, size: "sm" }) ] }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-start gap-5", children: [ /*#__PURE__*/ _jsx("div", { className: "w-20 h-20 rounded-full bg-green-100 flex-shrink-0 flex items-center justify-center text-green-700 text-2xl font-bold overflow-hidden border-2 border-gray-100", children: user.image ? /*#__PURE__*/ _jsx("img", { src: user.image, alt: displayName, className: "w-full h-full object-cover" }) : initials }), /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 flex-wrap mb-1", children: [ /*#__PURE__*/ _jsx("h1", { className: "text-xl font-bold text-gray-900", children: displayName }), user.planTier && user.planTier !== 'free' && /*#__PURE__*/ _jsx(PlanBadge, { tier: user.planTier, verified: user.hasVerifiedBadge, size: "sm" }), user.hasVerifiedBadge && user.planTier === 'free' && /*#__PURE__*/ _jsx(PlanBadge, { tier: "free", verified: true, size: "sm" }), Array.isArray(user.activeStatuses) && user.activeStatuses.includes('can_help_now') && /*#__PURE__*/ _jsxs("span", { className: "inline-flex items-center gap-1 text-xs font-medium text-green-700 bg-green-50 border border-green-200 px-2 py-0.5 rounded-full", children: [ /*#__PURE__*/ _jsx("span", { className: "w-1.5 h-1.5 rounded-full bg-green-500 animate-pulse" }), t('status.can_help_now', 'Available now') ] }), Array.isArray(user.activeStatuses) && user.activeStatuses.includes('need_help') && /*#__PURE__*/ _jsxs("span", { className: "inline-flex items-center gap-1 text-xs font-medium text-green-700 bg-green-50 border border-green-200 px-2 py-0.5 rounded-full", children: [ /*#__PURE__*/ _jsx("span", { className: "w-1.5 h-1.5 rounded-full bg-green-500" }), t('status.need_help', 'Need help') ] }), (session ? ((_session_user = session.user) === null || _session_user === void 0 ? void 0 : _session_user.id) !== id : true) && /*#__PURE__*/ _jsxs("div", { className: "ml-auto flex items-center gap-2", children: [ !session ? // Guest — show button that leads to registration /*#__PURE__*/ _jsxs("a", { href: "/register", className: "flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-sm font-medium bg-green-50 text-green-600 border border-green-200 hover:bg-green-100 transition", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }), /*#__PURE__*/ _jsx("span", { children: t('chat.write_btn', 'Write') }) ] }) : (canMsg === null || canMsg === void 0 ? void 0 : canMsg.allowed) === false ? /*#__PURE__*/ _jsx(UpgradePrompt, { feature: t('chat.write_btn', 'Write'), requiredTier: "pro", variant: "inline", t: t }) : /*#__PURE__*/ _jsxs("button", { onClick: handleMessage, disabled: msgLoading, className: "flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-sm font-medium bg-green-50 text-green-600 border border-green-200 hover:bg-green-100 transition disabled:opacity-50", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }), /*#__PURE__*/ _jsx("span", { children: t('chat.write_btn') }) ] }), /*#__PURE__*/ _jsxs("button", { onClick: toggleFavorite, disabled: favLoading, title: isFavorite ? t('specialist.unfavorite') : t('specialist.favorite'), className: "flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-sm font-medium transition disabled:opacity-50 ".concat(isFavorite ? 'bg-pink-50 text-pink-600 border border-pink-200 hover:bg-pink-100' : 'bg-gray-50 text-gray-600 border border-gray-200 hover:bg-gray-100'), children: [ /*#__PURE__*/ _jsx("span", { children: isFavorite ? '❀' : '🀍' }), /*#__PURE__*/ _jsx("span", { children: isFavorite ? t('specialist.unfavorite') : t('specialist.favorite') }) ] }) ] }) ] }), rating && /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-1.5 mb-2", children: [ /*#__PURE__*/ _jsx("span", { className: "text-yellow-400 text-lg", children: "★" }), /*#__PURE__*/ _jsx("span", { className: "font-semibold text-gray-800", children: Number(rating).toFixed(1) }), /*#__PURE__*/ _jsxs("span", { className: "text-sm text-gray-400", children: [ "(", reviews.length, " ", t('profile.reviews').toLowerCase(), ")" ] }) ] }), /*#__PURE__*/ _jsxs("p", { className: "text-sm text-gray-400", children: [ t('profile.member_since'), " ", new Date(user.createdAt).toLocaleDateString(dateLocale), user.lastSeenAt && /*#__PURE__*/ _jsxs("span", { className: "ml-2", children: [ "\xb7 ", formatLastSeen(user.lastSeenAt, t) ] }) ] }) ] }) ] }), user.bio && /*#__PURE__*/ _jsx("p", { className: "mt-4 text-gray-700 text-sm leading-relaxed border-t border-gray-100 pt-4", children: user.bio }), user.phone && /*#__PURE__*/ _jsxs("div", { className: "mt-4 border-t border-gray-100 pt-4 flex items-center gap-2", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M3 5a2 2 0 012-2h3.28a1 1 0 01.948.684l1.498 4.493a1 1 0 01-.502 1.21l-2.257 1.13a11.042 11.042 0 005.516 5.516l1.13-2.257a1 1 0 011.21-.502l4.493 1.498a1 1 0 01.684.949V19a2 2 0 01-2 2h-1C9.716 21 3 14.284 3 6V5z" }) }), /*#__PURE__*/ _jsx("a", { href: "tel:".concat(user.phone), className: "text-sm font-medium text-gray-700 hover:text-green-600", children: user.phone }) ] }), user.personalSiteSlug && /*#__PURE__*/ _jsxs("div", { className: "mt-3 flex items-center gap-2", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _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" }) }), /*#__PURE__*/ _jsxs("a", { href: "/site/".concat(user.personalSiteSlug), target: "_blank", rel: "noopener noreferrer", className: "text-sm text-green-600 hover:underline", children: [ "canhelp.gr/site/", user.personalSiteSlug ] }) ] }), user.languages && user.languages.length > 0 && /*#__PURE__*/ _jsxs("div", { className: "mt-4 border-t border-gray-100 pt-4", children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs font-medium text-gray-500 mb-2 uppercase tracking-wide", children: t('profile.languages') }), /*#__PURE__*/ _jsx("div", { className: "flex flex-wrap gap-2", children: user.languages.map((code)=>{ const langMap = { el: { flag: '🇬🇷', label: 'ΕλληΜικά' }, en: { flag: '🇬🇧', label: 'English' }, ru: { flag: '🇷🇺', label: 'РусскОй' }, uk: { flag: '🇺🇊', label: 'УкраїМська' }, de: { flag: '🇩🇪', label: 'Deutsch' }, fr: { flag: '🇫🇷', label: 'Français' }, it: { flag: '🇮🇹', label: 'Italiano' }, es: { flag: '🇪🇞', label: 'Español' }, ar: { flag: '🇞🇊', label: 'العرؚية' }, zh: { flag: '🇚🇳', label: 'äž­æ–‡' } }; const lang = langMap[code]; if (!lang) return null; return /*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-1.5 bg-indigo-50 text-indigo-700 text-sm px-3 py-1 rounded-full border border-indigo-100", children: [ /*#__PURE__*/ _jsx("span", { children: lang.flag }), /*#__PURE__*/ _jsx("span", { children: lang.label }) ] }, code); }) }) ] }), user.skills && user.skills.length > 0 && specialistCards.length === 0 && /*#__PURE__*/ _jsxs("div", { className: "mt-4 border-t border-gray-100 pt-4", children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs font-medium text-gray-500 mb-2 uppercase tracking-wide", children: t('profile.skills.label') }), /*#__PURE__*/ _jsx("div", { className: "flex flex-wrap gap-2", children: user.skills.map((skill)=>/*#__PURE__*/ _jsx("span", { className: "bg-green-50 text-green-700 text-sm px-3 py-1 rounded-full", children: skill }, skill)) }) ] }), user.role === 'specialist' && user.specialistCategories && user.specialistCategories.length > 0 && specialistCards.length === 0 && /*#__PURE__*/ _jsxs("div", { className: "mt-4 border-t border-gray-100 pt-4", children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs font-medium text-gray-500 mb-2 uppercase tracking-wide", children: t('user.categories') }), /*#__PURE__*/ _jsx("div", { className: "flex flex-wrap gap-2", children: user.specialistCategories.map((slug)=>/*#__PURE__*/ _jsx("span", { className: "bg-purple-50 text-purple-700 text-sm px-3 py-1 rounded-full", children: slug }, slug)) }) ] }), user.role === 'specialist' && user.specialistLocations && user.specialistLocations.length > 0 && specialistCards.length === 0 && /*#__PURE__*/ _jsxs("div", { className: "mt-4 border-t border-gray-100 pt-4", children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs font-medium text-gray-500 mb-2 uppercase tracking-wide", children: t('user.work_area') }), /*#__PURE__*/ _jsx("div", { className: "flex flex-wrap gap-2", children: user.specialistLocations.map((slug)=>/*#__PURE__*/ _jsxs("span", { className: "bg-emerald-50 text-emerald-700 text-sm px-3 py-1 rounded-full", children: [ "\uD83D\uDCCD ", slug ] }, slug)) }) ] }) ] }), user.role === 'specialist' && /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6 mb-6", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between mb-4", children: [ /*#__PURE__*/ _jsxs("h2", { className: "font-bold text-gray-900 text-lg", children: [ "\uD83D\uDCC5 ", t('nav.schedule') ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 text-xs text-gray-500", children: [ /*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-1.5", children: [ /*#__PURE__*/ _jsx("span", { className: "w-3 h-3 rounded bg-emerald-200 border border-emerald-400 inline-block" }), t('schedule.available') ] }), /*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-1.5", children: [ /*#__PURE__*/ _jsx("span", { className: "w-3 h-3 rounded bg-red-200 border border-red-400 inline-block" }), t('schedule.busy') ] }) ] }) ] }), /*#__PURE__*/ _jsx(ReadOnlyCalendar, { year: availYear, month: availMonth, availMap: availMap, today: today, onPrev: ()=>{ if (availMonth === 0) { setAvailYear((y)=>y - 1); setAvailMonth(11); } else setAvailMonth((m)=>m - 1); }, onNext: ()=>{ if (availMonth === 11) { setAvailYear((y)=>y + 1); setAvailMonth(0); } else setAvailMonth((m)=>m + 1); } }) ] }), (user.role === 'specialist' || user.role === 'admin') && specialistCards.length > 0 && /*#__PURE__*/ _jsxs("div", { className: "space-y-4 mb-6", children: [ /*#__PURE__*/ _jsx("h2", { className: "font-bold text-white text-lg", children: t('nav.specialists') }), specialistCards.map((card)=>{ var _priceLists_card_id; return /*#__PURE__*/ _jsx(PublicCardView, { card: card, locale: locale, catMap: catMap, locMap: locMap, t: t, priceList: (_priceLists_card_id = priceLists[card.id]) !== null && _priceLists_card_id !== void 0 ? _priceLists_card_id : [] }, card.id); }) ] }), /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ _jsxs("h2", { className: "font-bold text-gray-900 text-lg mb-4", children: [ t('profile.reviews'), reviews.length > 0 && /*#__PURE__*/ _jsxs("span", { className: "text-gray-400 font-normal text-base ml-2", children: [ "(", reviews.length, ")" ] }) ] }), reviews.length === 0 ? /*#__PURE__*/ _jsx("p", { className: "text-gray-500 text-sm", children: t('profile.no_reviews') }) : /*#__PURE__*/ _jsx("div", { className: "space-y-4", children: reviews.map((param)=>{ let { review, author } = param; var _author_name_, _author_name; var _author_name__toUpperCase, _shortName; return /*#__PURE__*/ _jsx("div", { className: "border-b border-gray-50 pb-4 last:border-0 last:pb-0", children: /*#__PURE__*/ _jsxs("div", { className: "flex items-start gap-3", children: [ /*#__PURE__*/ _jsx("div", { className: "w-8 h-8 rounded-full bg-gray-100 flex-shrink-0 flex items-center justify-center text-gray-600 text-sm font-bold overflow-hidden", children: (author === null || author === void 0 ? void 0 : author.image) ? /*#__PURE__*/ _jsx("img", { src: author.image, alt: author.name, className: "w-full h-full object-cover" }) : (_author_name__toUpperCase = author === null || author === void 0 ? void 0 : (_author_name = author.name) === null || _author_name === void 0 ? void 0 : (_author_name_ = _author_name[0]) === null || _author_name_ === void 0 ? void 0 : _author_name_.toUpperCase()) !== null && _author_name__toUpperCase !== void 0 ? _author_name__toUpperCase : '?' }), /*#__PURE__*/ _jsxs("div", { className: "flex-1", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 mb-1", children: [ /*#__PURE__*/ _jsx("span", { className: "text-sm font-medium text-gray-800", children: (_shortName = shortName(author === null || author === void 0 ? void 0 : author.name)) !== null && _shortName !== void 0 ? _shortName : '—' }), /*#__PURE__*/ _jsxs("span", { className: "text-yellow-400", children: [ '★'.repeat(review.rating), '☆'.repeat(5 - review.rating) ] }) ] }), review.comment && /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-600", children: review.comment }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-1", children: new Date(review.createdAt).toLocaleDateString(dateLocale) }) ] }) ] }) }, review.id); }) }) ] }) ] }); } function ReadOnlyCalendar(param) { let { year, month, availMap, today, onPrev, onNext } = param; const { locale, t } = useLocale(); var _WEEK_DAYS_BY_LOCALE_locale; const weekDays = (_WEEK_DAYS_BY_LOCALE_locale = WEEK_DAYS_BY_LOCALE[locale]) !== null && _WEEK_DAYS_BY_LOCALE_locale !== void 0 ? _WEEK_DAYS_BY_LOCALE_locale : WEEK_DAYS_BY_LOCALE.ru; var _MONTHS_BY_LOCALE_locale; const months = (_MONTHS_BY_LOCALE_locale = MONTHS_BY_LOCALE[locale]) !== null && _MONTHS_BY_LOCALE_locale !== void 0 ? _MONTHS_BY_LOCALE_locale : MONTHS_BY_LOCALE.ru; const firstDay = new Date(year, month, 1); const startDow = (firstDay.getDay() + 6) % 7; const daysInMonth = new Date(year, month + 1, 0).getDate(); const prevMonthDays = new Date(year, month, 0).getDate(); const cells = []; for(let i = startDow - 1; i >= 0; i--){ cells.push({ day: prevMonthDays - i, cur: false, dateKey: '' }); } for(let d = 1; d <= daysInMonth; d++){ const dateKey = "".concat(year, "-").concat(String(month + 1).padStart(2, '0'), "-").concat(String(d).padStart(2, '0')); cells.push({ day: d, cur: true, dateKey }); } const remainder = cells.length % 7; if (remainder !== 0) { for(let d = 1; d <= 7 - remainder; d++){ cells.push({ day: d, cur: false, dateKey: '' }); } } const monthPrefix = "".concat(year, "-").concat(String(month + 1).padStart(2, '0')); const availCount = Object.entries(availMap).filter((param)=>{ let [k, v] = param; return k.startsWith(monthPrefix) && k >= today && v === 'available'; }).length; return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between mb-3", children: [ /*#__PURE__*/ _jsx("button", { onClick: onPrev, className: "w-7 h-7 rounded-lg hover:bg-gray-100 flex items-center justify-center text-gray-500", children: "‹" }), /*#__PURE__*/ _jsxs("div", { className: "text-center", children: [ /*#__PURE__*/ _jsxs("span", { className: "font-medium text-gray-800 text-sm", children: [ months[month], " ", year ] }), availCount > 0 && /*#__PURE__*/ _jsxs("span", { className: "ml-2 text-xs text-emerald-600", children: [ availCount, " ", t('schedule.free_days') ] }) ] }), /*#__PURE__*/ _jsx("button", { onClick: onNext, className: "w-7 h-7 rounded-lg hover:bg-gray-100 flex items-center justify-center text-gray-500", children: "›" }) ] }), /*#__PURE__*/ _jsx("div", { className: "grid grid-cols-7 mb-1", children: weekDays.map((d)=>/*#__PURE__*/ _jsx("div", { className: "text-center text-xs text-gray-400 py-1", children: d }, d)) }), /*#__PURE__*/ _jsx("div", { className: "grid grid-cols-7 gap-0.5", children: cells.map((cell, idx)=>{ if (!cell.cur) { return /*#__PURE__*/ _jsx("div", { className: "h-9 flex items-center justify-center text-xs text-gray-200", children: cell.day }, "e-".concat(idx)); } const status = availMap[cell.dateKey]; const isPast = cell.dateKey < today; const isToday = cell.dateKey === today; let cls = 'h-9 flex items-center justify-center rounded-lg text-sm font-medium '; if (isPast) { cls += 'text-gray-200 '; } else if (status === 'available') { cls += 'bg-emerald-100 border border-emerald-300 text-emerald-700 '; } else if (status === 'busy') { cls += 'bg-red-100 border border-red-300 text-red-600 '; } else { cls += 'text-gray-500 '; } if (isToday) cls += 'ring-2 ring-blue-400 ring-offset-1 '; return /*#__PURE__*/ _jsx("div", { className: cls, children: cell.day }, cell.dateKey); }) }) ] }); } // ─── Public card view ───────────────────────────────────────────────────────── function flattenTree(nodes) { return nodes.flatMap((n)=>{ var _n_children; return [ n, ...flattenTree((_n_children = n.children) !== null && _n_children !== void 0 ? _n_children : []) ]; }); } function PublicCardView(param) { let { card, locale, catMap, locMap, t, priceList } = param; const [lightbox, setLightbox] = useState(null); const [expandedAreas, setExpandedAreas] = useState([]); const locById = new Map(); for (const node of locMap.values()){ if (node === null || node === void 0 ? void 0 : node.id) locById.set(node.id, node); } const getLocName = (loc, fallback)=>{ var _loc_names, _loc_names1; return (loc === null || loc === void 0 ? void 0 : (_loc_names = loc.names) === null || _loc_names === void 0 ? void 0 : _loc_names[locale]) || (loc === null || loc === void 0 ? void 0 : (_loc_names1 = loc.names) === null || _loc_names1 === void 0 ? void 0 : _loc_names1.el) || fallback; }; const locationGroups = (()=>{ const grouped = new Map(); var _card_locations; for (const slug of (_card_locations = card.locations) !== null && _card_locations !== void 0 ? _card_locations : []){ const loc = locMap.get(slug); if (!loc) { if (!grouped.has(slug)) { grouped.set(slug, { root: { slug, names: { el: slug } }, rootSlug: slug, districts: [], districtSlugs: new Set() }); } continue; } let root = loc; const seenIds = new Set(); while((root === null || root === void 0 ? void 0 : root.parentId) && locById.has(root.parentId) && !seenIds.has(root.parentId)){ seenIds.add(root.parentId); root = locById.get(root.parentId); } var _root_slug; const rootSlug = (_root_slug = root === null || root === void 0 ? void 0 : root.slug) !== null && _root_slug !== void 0 ? _root_slug : slug; if (!grouped.has(rootSlug)) { grouped.set(rootSlug, { root, rootSlug, districts: [], districtSlugs: new Set() }); } const group = grouped.get(rootSlug); if (loc.slug !== rootSlug && !group.districtSlugs.has(loc.slug)) { group.districtSlugs.add(loc.slug); group.districts.push(loc); } } return Array.from(grouped.values()); })(); var _lightbox_title; return /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 overflow-hidden", children: [ /*#__PURE__*/ _jsxs("div", { className: "px-5 py-4 border-b border-gray-100", children: [ /*#__PURE__*/ _jsx("h3", { className: "font-bold text-gray-900", children: card.title }), card.description && /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-600 mt-1", children: card.description }) ] }), /*#__PURE__*/ _jsxs("div", { className: "p-5 space-y-4", children: [ card.skills && card.skills.length > 0 && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs font-semibold text-gray-500 uppercase tracking-wide mb-2", children: t('card.skills') }), /*#__PURE__*/ _jsx("div", { className: "flex flex-wrap gap-2", children: card.skills.map((s)=>/*#__PURE__*/ _jsx("span", { className: "bg-green-50 text-green-700 text-sm px-3 py-1 rounded-full", children: s }, s)) }) ] }), card.categories && card.categories.length > 0 && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs font-semibold text-gray-500 uppercase tracking-wide mb-2", children: t('card.categories') }), /*#__PURE__*/ _jsx("div", { className: "flex flex-wrap gap-2", children: card.categories.map((s)=>{ var _cat_names, _cat_names1; const cat = catMap.get(s); const name = cat ? ((_cat_names = cat.names) === null || _cat_names === void 0 ? void 0 : _cat_names[locale]) || ((_cat_names1 = cat.names) === null || _cat_names1 === void 0 ? void 0 : _cat_names1.el) || s : s; return /*#__PURE__*/ _jsxs("span", { className: "bg-purple-50 text-purple-700 text-sm px-3 py-1 rounded-full", children: [ (cat === null || cat === void 0 ? void 0 : cat.icon) ? /*#__PURE__*/ _jsx("span", { className: "mr-1 inline-flex align-middle", children: /*#__PURE__*/ _jsx(CategoryIcon, { icon: cat.icon, alt: name, className: isCategoryIconUrl(cat.icon) ? 'h-4 w-4 object-contain' : 'text-sm leading-none', fallback: "\uD83D\uDCE6" }) }) : null, name ] }, s); }) }) ] }), card.locations && card.locations.length > 0 && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs font-semibold text-gray-500 uppercase tracking-wide mb-2", children: t('user.work_area') }), /*#__PURE__*/ _jsxs("div", { className: "space-y-2", children: [ /*#__PURE__*/ _jsx("div", { className: "flex flex-wrap gap-2", children: locationGroups.map((group)=>{ const expanded = expandedAreas.includes(group.rootSlug); const canExpand = group.districts.length > 0; return /*#__PURE__*/ _jsxs("button", { type: "button", onClick: ()=>{ if (!canExpand) return; setExpandedAreas((prev)=>prev.includes(group.rootSlug) ? prev.filter((slug)=>slug !== group.rootSlug) : [ ...prev, group.rootSlug ]); }, className: "inline-flex items-center gap-1.5 text-sm px-3 py-1.5 rounded-full border transition ".concat(expanded ? 'bg-emerald-100 text-emerald-800 border-emerald-300' : 'bg-emerald-50 text-emerald-700 border-emerald-200 hover:bg-emerald-100', " ").concat(canExpand ? 'cursor-pointer' : 'cursor-default'), children: [ /*#__PURE__*/ _jsx("span", { children: "\uD83D\uDCCD" }), /*#__PURE__*/ _jsx("span", { children: getLocName(group.root, group.rootSlug) }), canExpand && /*#__PURE__*/ _jsx("span", { className: "text-[11px] font-semibold px-1.5 py-0.5 rounded-full bg-white/80 text-emerald-700 border border-emerald-200", children: expanded ? '−' : "+".concat(group.districts.length) }) ] }, group.rootSlug); }) }), locationGroups.filter((group)=>expandedAreas.includes(group.rootSlug) && group.districts.length > 0).map((group)=>/*#__PURE__*/ _jsxs("div", { className: "rounded-xl border border-emerald-100 bg-emerald-50/40 p-3", children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs text-emerald-700 font-medium mb-2", children: getLocName(group.root, group.rootSlug) }), /*#__PURE__*/ _jsx("div", { className: "flex flex-wrap gap-1.5", children: group.districts.map((district)=>/*#__PURE__*/ _jsx("span", { className: "text-xs px-2.5 py-1 rounded-full bg-white border border-emerald-200 text-emerald-700", children: getLocName(district, district.slug) }, district.slug)) }) ] }, "".concat(group.rootSlug, "-children"))) ] }) ] }), priceList.length > 0 && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs font-semibold text-gray-500 uppercase tracking-wide mb-3", children: t('profile.card.tab.pricelist') }), /*#__PURE__*/ _jsx("div", { className: "space-y-3", children: priceList.map((group)=>/*#__PURE__*/ _jsxs("div", { className: "border border-gray-200 rounded-xl overflow-hidden", children: [ /*#__PURE__*/ _jsx("div", { className: "bg-gray-50 px-4 py-2 border-b border-gray-200", children: /*#__PURE__*/ _jsx("span", { className: "font-semibold text-sm text-gray-800", children: group.title }) }), /*#__PURE__*/ _jsx("div", { className: "divide-y divide-gray-100", children: group.items.map((item)=>/*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 px-4 py-2.5 text-sm", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ _jsx("p", { className: "font-medium text-gray-800", children: item.name }), item.description && /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-500", children: item.description }) ] }), (item.price || item.unit) && /*#__PURE__*/ _jsxs("span", { className: "text-green-700 font-semibold whitespace-nowrap", children: [ item.price ? "€".concat(item.price) : '', item.unit ? " ".concat(item.unit) : '' ] }) ] }, item.id)) }) ] }, group.id)) }) ] }), card.portfolio && card.portfolio.length > 0 && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs font-semibold text-gray-500 uppercase tracking-wide mb-2", children: t('card.portfolio') }), /*#__PURE__*/ _jsx("div", { className: "grid grid-cols-2 sm:grid-cols-3 gap-3", children: card.portfolio.map((item)=>{ var _item_title; return /*#__PURE__*/ _jsxs("button", { type: "button", onClick: ()=>setLightbox(item), className: "group relative rounded-xl overflow-hidden border border-gray-200 bg-gray-50 text-left", children: [ /*#__PURE__*/ _jsx("img", { src: item.imageUrl, alt: (_item_title = item.title) !== null && _item_title !== void 0 ? _item_title : '', className: "w-full aspect-square object-cover group-hover:scale-105 transition-transform duration-200" }), item.title && /*#__PURE__*/ _jsx("div", { className: "px-2 py-1.5", children: /*#__PURE__*/ _jsx("p", { className: "text-xs font-medium text-gray-700 truncate", children: item.title }) }) ] }, item.id); }) }) ] }) ] }), lightbox && /*#__PURE__*/ _jsx("div", { className: "fixed inset-0 z-50 flex items-center justify-center bg-black/80 px-4", onClick: ()=>setLightbox(null), children: /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-2xl overflow-hidden max-w-lg w-full shadow-2xl", onClick: (e)=>e.stopPropagation(), children: [ /*#__PURE__*/ _jsx("img", { src: lightbox.imageUrl, alt: (_lightbox_title = lightbox.title) !== null && _lightbox_title !== void 0 ? _lightbox_title : '', className: "w-full max-h-[60vh] object-contain bg-gray-900" }), (lightbox.title || lightbox.description) && /*#__PURE__*/ _jsxs("div", { className: "p-4", children: [ lightbox.title && /*#__PURE__*/ _jsx("p", { className: "font-semibold text-gray-800 mb-1", children: lightbox.title }), lightbox.description && /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-600", children: lightbox.description }) ] }), /*#__PURE__*/ _jsx("div", { className: "flex justify-end px-4 pb-4", children: /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setLightbox(null), className: "text-sm text-gray-500 hover:text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-100", children: t('card.close') }) }) ] }) }) ] }); } åR61123undefined125168undefined170224undefined226270undefined272311undefined313587undefined589647undefined649710undefined712765undefined767817undefined819894undefined23812395undefined25452553__WEBPACK_MODULE_REFERENCE__2_5b22757365506172616d73225d_call_directImport_asiSafe1__._undefined25842592__WEBPACK_MODULE_REFERENCE__3_5b227573654c6f63616c65225d_call_directImport_asiSafe1__._undefined26272636__WEBPACK_MODULE_REFERENCE__4_5b2275736553657373696f6e225d_call_directImport_asiSafe1__._undefined26602668__WEBPACK_MODULE_REFERENCE__2_5b22757365526f75746572225d_call_directImport_asiSafe1__._undefined27012708__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined27512758__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined27972804__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined28472854__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined29132920__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined29672974__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined30133020__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined30663073__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined31273134__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined31843191__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined32413248__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined32903297__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined33923399__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined34613468__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined35233530__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined37143722__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined37893802__WEBPACK_MODULE_REFERENCE__5_5b226765745573657250726f66696c65225d_call_directImport_asiSafe1__._undefined38293842__WEBPACK_MODULE_REFERENCE__5_5b226765745573657252657669657773225d_call_directImport_asiSafe1__._undefined38613873__WEBPACK_MODULE_REFERENCE__5_5b2267657455736572526174696e67225d_call_directImport_asiSafe1__._undefined38923904__WEBPACK_MODULE_REFERENCE__5_5b2267657443617465676f72696573225d_call_directImport_asiSafe1__._undefined39353946__WEBPACK_MODULE_REFERENCE__5_5b226765744c6f636174696f6e73225d_call_directImport_asiSafe1__._undefined44644481__WEBPACK_MODULE_REFERENCE__5_5b226765745370656369616c6973744361726473225d_call_directImport_asiSafe1__._undefined46234634__WEBPACK_MODULE_REFERENCE__5_5b2267657450726963654c697374225d_call_directImport_asiSafe1__._undefined51345142__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined52225243__WEBPACK_MODULE_REFERENCE__5_5b226765745370656369616c6973744661766f7269746573225d_call_directImport_asiSafe1__._undefined57095721__WEBPACK_MODULE_REFERENCE__5_5b2267657443616e4d657373616765225d_call_directImport_asiSafe1__._undefined60386061__WEBPACK_MODULE_REFERENCE__5_5b2272656d6f76655370656369616c6973744661766f72697465225d_call_directImport_asiSafe1__._undefined61496169__WEBPACK_MODULE_REFERENCE__5_5b226164645370656369616c6973744661766f72697465225d_call_directImport_asiSafe1__._undefined64906510__WEBPACK_MODULE_REFERENCE__5_5b226765744f72437265617465446972656374526f6f6d225d_call_directImport_asiSafe1__._undefined66366644__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined67856809__WEBPACK_MODULE_REFERENCE__5_5b226765745370656369616c697374417661696c6162696c697479225d_call_directImport_asiSafe1__._undefined72297232__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined73767379__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined81658179__WEBPACK_MODULE_REFERENCE__8_5b22666f726d617453686f72744e616d65225d_call_directImport_asiSafe1__._undefined85558559__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined86678671__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined88268830__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined94439446__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined96369640__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined98499853__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1006010063__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1037410377__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1078710791__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1099811001__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1131811322__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1210112105__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1233412337__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1233912347__WEBPACK_MODULE_REFERENCE__10_5b22506c616e4261646765225d_directImport_asiSafe1__._undefined1272012723__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1272512733__WEBPACK_MODULE_REFERENCE__10_5b22506c616e4261646765225d_directImport_asiSafe1__._undefined1320013204__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1335413357__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1364113644__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1395813962__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1412814132__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1434614349__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1467414677__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1467914687__WEBPACK_MODULE_REFERENCE__10_5b22506c616e4261646765225d_directImport_asiSafe1__._undefined1506015063__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1506515073__WEBPACK_MODULE_REFERENCE__10_5b22506c616e4261646765225d_directImport_asiSafe1__._undefined1545515459__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1578615789__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1631116315__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1664216645__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1719017194__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1753817542__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1798817991__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1851018513__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1914619149__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1953319536__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1953819550__WEBPACK_MODULE_REFERENCE__7_5b225570677261646550726f6d7074225d_directImport_asiSafe1__._undefined1993419938__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2049220495__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2101421017__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2165021653__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2200222006__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2278222785__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2303423037__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2360523609__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2381523818__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2408424087__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2437924383__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2509425098__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2553325537__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2578925802__WEBPACK_MODULE_REFERENCE__9_5b22666f726d61744c6173745365656e225d_call_directImport_asiSafe1__._undefined2616326166__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2640126405__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2659126594__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2694426947__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2744427447__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2781527819__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2797527978__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2832828331__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2869128695__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2933129335__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2949729500__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2975729760__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3226332267__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3255432557__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3274332746__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3318533189__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3335133354__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3361433617__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3377633779__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3425234256__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3441834421__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3467634679__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3485134854__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3532535329__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3549135494__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3574835751__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3592235926__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3647436478__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3663336637__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3680336807__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3715437158__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3735537359__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3756137564__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3795537959__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3816138164__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3864038643__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3957639580__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3969839701__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4000140004__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4050340507__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4065740661__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4089640900__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4134841351__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4151741520__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4187741880__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4204642050__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4223642239__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4256942572__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4329843302__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4349643500__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4374043743__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4394743955__WEBPACK_MODULE_REFERENCE__8_5b2273686f72744e616d65225d_call_directImport_asiSafe1__._undefined4420244206__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4487244875__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4516345166__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4587445882__WEBPACK_MODULE_REFERENCE__3_5b227573654c6f63616c65225d_call_directImport_asiSafe1__._undefined4755647560__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4761747621__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4776347766__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4803948043__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4818248186__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4858148585__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4901549018__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4931649319__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4944049443__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4963649639__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4983849841__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5093250935__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5158551592__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined5164751654__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined5409754101__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5423954243__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5438154384__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5457954582__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5479054794__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5495254956__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5504555048__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5530155304__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5545955462__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5584555849__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5593855941__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5619856201__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5678156785__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5707657079__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5725557258__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5726057271__WEBPACK_MODULE_REFERENCE__11_5b2243617465676f727949636f6e225d_directImport_asiSafe1__._undefined5747057486__WEBPACK_MODULE_REFERENCE__11_5b22697343617465676f727949636f6e55726c225d_call_directImport_asiSafe1__._undefined5806558069__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5815858161__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5841758421__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5858258585__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5900759011__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined6012260125__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6034060343__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6059560598__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6132261326__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined6157161574__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6190661909__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6211762120__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6282662830__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined6291962922__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6319063193__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6333963343__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined6356863571__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6376263765__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6411064113__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6430764311__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined6457864582__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined6484464847__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6523465237__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6575765761__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined6674466748__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined6683766840__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6709667099__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6737567379__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined6777167774__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6825968262__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6841968422__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6898968992__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6919069194__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined6942869431__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6982369827__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined6998869991__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7025070253__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7053270535__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7066770670__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined(!17061792(0,navigation.useParams)undefined18231909(0,context_locale/* useLocale */.Y)undefined19442032(0,auth/* useSession */.wV)undefined20562142(0,navigation.useRouter)undefined21752259(0,react.useState)undefined23022386(0,react.useState)undefined24252509(0,react.useState)undefined25522636(0,react.useState)undefined26952779(0,react.useState)undefined28262910(0,react.useState)undefined29493033(0,react.useState)undefined30793163(0,react.useState)undefined32173301(0,react.useState)undefined33513435(0,react.useState)undefined34853569(0,react.useState)undefined36113695(0,react.useState)undefined37903874(0,react.useState)undefined39364020(0,react.useState)undefined40754159(0,react.useState)undefined43434429(0,react.useEffect)undefined44964592(0,api/* getUserProfile */.VM)undefined46194715(0,api/* getUserReviews */.v9)undefined47344828(0,api/* getUserRating */.Bm)undefined48474941(0,api/* getCategories */.bW)undefined49725064(0,api/* getLocations */.Vs)undefined55825686(0,api/* getSpecialistCards */.Bq)undefined58285920(0,api/* getPriceList */.Ck)undefined64206506(0,react.useEffect)undefined65866698(0,api/* getSpecialistFavorites */.pD)undefined71647258(0,api/* getCanMessage */.On)undefined75757691(0,api/* removeSpecialistFavorite */.sD)undefined77797889(0,api/* addSpecialistFavorite */.V)undefined82108320(0,api/* getOrCreateDirectRoom */.QN)undefined84468532(0,react.useEffect)undefined86738791(0,api/* getSpecialistAvailability */.Xz)undefined92119285(0,jsx_runtime.jsx)undefined94299503(0,jsx_runtime.jsx)undefined1028910387(0,formatName/* formatShortName */.H)undefined1076310839(0,jsx_runtime.jsxs)undefined1094711023(0,jsx_runtime.jsxs)undefined1117811254(0,jsx_runtime.jsxs)undefined1186711941(0,jsx_runtime.jsx)undefined1213112207(0,jsx_runtime.jsxs)undefined1241612492(0,jsx_runtime.jsxs)undefined1269912773(0,jsx_runtime.jsx)undefined1308413158(0,jsx_runtime.jsx)undefined1356813644(0,jsx_runtime.jsxs)undefined1385113925(0,jsx_runtime.jsx)undefined1424214318(0,jsx_runtime.jsxs)undefined1509715173(0,jsx_runtime.jsxs)undefined1540215476(0,jsx_runtime.jsx)undefined1547815560PlanBadge/* PlanBadge */.dundefined1593316007(0,jsx_runtime.jsx)undefined1600916091PlanBadge/* PlanBadge */.dundefined1655816634(0,jsx_runtime.jsxs)undefined1678416858(0,jsx_runtime.jsx)undefined1714217216(0,jsx_runtime.jsx)undefined1753017606(0,jsx_runtime.jsxs)undefined1777217848(0,jsx_runtime.jsxs)undefined1806218136(0,jsx_runtime.jsx)undefined1846118535(0,jsx_runtime.jsx)undefined1853718619PlanBadge/* PlanBadge */.dundefined1899219066(0,jsx_runtime.jsx)undefined1906819150PlanBadge/* PlanBadge */.dundefined1953219608(0,jsx_runtime.jsxs)undefined1993520009(0,jsx_runtime.jsx)undefined2053120607(0,jsx_runtime.jsxs)undefined2093421008(0,jsx_runtime.jsx)undefined2155321629(0,jsx_runtime.jsxs)undefined2197322049(0,jsx_runtime.jsxs)undefined2249522569(0,jsx_runtime.jsx)undefined2308823162(0,jsx_runtime.jsx)undefined2379523869(0,jsx_runtime.jsx)undefined2425324327(0,jsx_runtime.jsx)undefined2432924418UpgradePromptundefined2480224878(0,jsx_runtime.jsxs)undefined2543225506(0,jsx_runtime.jsx)undefined2602526099(0,jsx_runtime.jsx)undefined2673226806(0,jsx_runtime.jsx)undefined2715527231(0,jsx_runtime.jsxs)undefined2800728081(0,jsx_runtime.jsx)undefined2833028404(0,jsx_runtime.jsx)undefined2897229048(0,jsx_runtime.jsxs)undefined2925429328(0,jsx_runtime.jsx)undefined2959429668(0,jsx_runtime.jsx)undefined2996030036(0,jsx_runtime.jsxs)undefined3074730823(0,jsx_runtime.jsxs)undefined3125831334(0,jsx_runtime.jsxs)undefined3158631682(0,formatLastSeen/* formatLastSeen */.V)undefined3204332117(0,jsx_runtime.jsx)undefined3235232428(0,jsx_runtime.jsxs)undefined3261432688(0,jsx_runtime.jsx)undefined3303833112(0,jsx_runtime.jsx)undefined3360933683(0,jsx_runtime.jsx)undefined3405134127(0,jsx_runtime.jsxs)undefined3428334357(0,jsx_runtime.jsx)undefined3470734781(0,jsx_runtime.jsx)undefined3514135217(0,jsx_runtime.jsxs)undefined3585335929(0,jsx_runtime.jsxs)undefined3609136165(0,jsx_runtime.jsx)undefined3642236496(0,jsx_runtime.jsx)undefined3899939075(0,jsx_runtime.jsxs)undefined3936239436(0,jsx_runtime.jsx)undefined3962239696(0,jsx_runtime.jsx)undefined4013540211(0,jsx_runtime.jsxs)undefined4037340447(0,jsx_runtime.jsx)undefined4070740781(0,jsx_runtime.jsx)undefined4094041014(0,jsx_runtime.jsx)undefined4148741563(0,jsx_runtime.jsxs)undefined4172541799(0,jsx_runtime.jsx)undefined4205442128(0,jsx_runtime.jsx)undefined4230042374(0,jsx_runtime.jsx)undefined4284542921(0,jsx_runtime.jsxs)undefined4308343157(0,jsx_runtime.jsx)undefined4341143485(0,jsx_runtime.jsx)undefined4365643732(0,jsx_runtime.jsxs)undefined4428044356(0,jsx_runtime.jsxs)undefined4451144587(0,jsx_runtime.jsxs)undefined4475344829(0,jsx_runtime.jsxs)undefined4517645252(0,jsx_runtime.jsxs)undefined4544945525(0,jsx_runtime.jsxs)undefined4572745801(0,jsx_runtime.jsx)undefined4619246268(0,jsx_runtime.jsxs)undefined4647046544(0,jsx_runtime.jsx)undefined4702047094(0,jsx_runtime.jsx)undefined4802748103(0,jsx_runtime.jsxs)undefined4822148295(0,jsx_runtime.jsx)undefined4859548669(0,jsx_runtime.jsx)undefined4916849244(0,jsx_runtime.jsxs)undefined4939449470(0,jsx_runtime.jsxs)undefined4970549781(0,jsx_runtime.jsxs)undefined5022950303(0,jsx_runtime.jsx)undefined5046950543(0,jsx_runtime.jsx)undefined5090050974(0,jsx_runtime.jsx)undefined5114051216(0,jsx_runtime.jsxs)undefined5140251476(0,jsx_runtime.jsx)undefined5180651880(0,jsx_runtime.jsx)undefined5260652682(0,jsx_runtime.jsxs)undefined5287652952(0,jsx_runtime.jsxs)undefined5319253266(0,jsx_runtime.jsx)undefined5347053556(0,formatName/* shortName */.E)undefined5380353879(0,jsx_runtime.jsxs)undefined5454554619(0,jsx_runtime.jsx)undefined5490754981(0,jsx_runtime.jsx)undefined5568955775(0,context_locale/* useLocale */.Y)undefined5744957525(0,jsx_runtime.jsxs)undefined5758257658(0,jsx_runtime.jsxs)undefined5780057874(0,jsx_runtime.jsx)undefined5814758223(0,jsx_runtime.jsxs)undefined5836258438(0,jsx_runtime.jsxs)undefined5883358909(0,jsx_runtime.jsxs)undefined5933959413(0,jsx_runtime.jsx)undefined5971159785(0,jsx_runtime.jsx)undefined5990659980(0,jsx_runtime.jsx)undefined6017360247(0,jsx_runtime.jsx)undefined6044660520(0,jsx_runtime.jsx)undefined6161161685(0,jsx_runtime.jsx)undefined6233562419(0,react.useState)undefined6247462558(0,react.useState)undefined6500165077(0,jsx_runtime.jsxs)undefined6521565291(0,jsx_runtime.jsxs)undefined6542965503(0,jsx_runtime.jsx)undefined6569865772(0,jsx_runtime.jsx)undefined6598066056(0,jsx_runtime.jsxs)undefined6621466290(0,jsx_runtime.jsxs)undefined6637966453(0,jsx_runtime.jsx)undefined6670666780(0,jsx_runtime.jsx)undefined6693567009(0,jsx_runtime.jsx)undefined6739267468(0,jsx_runtime.jsxs)undefined6755767631(0,jsx_runtime.jsx)undefined6788867962(0,jsx_runtime.jsx)undefined6854268618(0,jsx_runtime.jsxs)undefined6890968983(0,jsx_runtime.jsx)undefined6915969233(0,jsx_runtime.jsx)undefined6923569323CategoryIcon/* CategoryIcon */.Ezundefined6952269625(0,CategoryIcon/* isCategoryIconUrl */.V)undefined7020470280(0,jsx_runtime.jsxs)undefined7036970443(0,jsx_runtime.jsx)undefined7069970775(0,jsx_runtime.jsxs)undefined7093671010(0,jsx_runtime.jsx)undefined7143271508(0,jsx_runtime.jsxs)undefined7261972693(0,jsx_runtime.jsx)undefined7290872982(0,jsx_runtime.jsx)undefined7323473308(0,jsx_runtime.jsx)undefined7403274108(0,jsx_runtime.jsxs)undefined7435374427(0,jsx_runtime.jsx)undefined7475974833(0,jsx_runtime.jsx)undefined7504175115(0,jsx_runtime.jsx)undefined7582175897(0,jsx_runtime.jsxs)undefined7598676060(0,jsx_runtime.jsx)undefined7632876402(0,jsx_runtime.jsx)undefined7654876624(0,jsx_runtime.jsxs)undefined7684976923(0,jsx_runtime.jsx)undefined7711477188(0,jsx_runtime.jsx)undefined7753377607(0,jsx_runtime.jsx)undefined7780177877(0,jsx_runtime.jsxs)undefined7814478220(0,jsx_runtime.jsxs)undefined7848278556(0,jsx_runtime.jsx)undefined7894379017(0,jsx_runtime.jsx)undefined7953779613(0,jsx_runtime.jsxs)undefined8059680672(0,jsx_runtime.jsxs)undefined8076180835(0,jsx_runtime.jsx)undefined8109181165(0,jsx_runtime.jsx)undefined8144181517(0,jsx_runtime.jsxs)undefined8190981983(0,jsx_runtime.jsx)undefined8246882542(0,jsx_runtime.jsx)undefined8269982773(0,jsx_runtime.jsx)undefined8334083414(0,jsx_runtime.jsx)undefined8361283688(0,jsx_runtime.jsxs)undefined8392283996(0,jsx_runtime.jsx)undefined8438884464(0,jsx_runtime.jsxs)undefined8462584699(0,jsx_runtime.jsx)undefined8495885032(0,jsx_runtime.jsx)undefined8531185385(0,jsx_runtime.jsx)undefined8551785591(0,jsx_runtime.jsx)undefined /***/ }) àk;/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; // ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); // EXPORTS __webpack_require__.d(__webpack_exports__, { "default": () => (/* binding */ UserProfilePage) }); // EXTERNAL MODULE: ../../node_modules/next/dist/compiled/react/jsx-runtime.js var jsx_runtime = __webpack_require__(4568); // EXTERNAL MODULE: ../../node_modules/next/dist/compiled/react/index.js var react = __webpack_require__(7620); // EXTERNAL MODULE: ../../node_modules/next/dist/api/navigation.js var navigation = __webpack_require__(7541); // EXTERNAL MODULE: ./src/context/locale.tsx var context_locale = __webpack_require__(9906); // EXTERNAL MODULE: ./src/lib/auth.ts var auth = __webpack_require__(1592); // EXTERNAL MODULE: ./src/lib/api.ts var api = __webpack_require__(2982); // EXTERNAL MODULE: ../../node_modules/next/dist/client/app-dir/link.js var app_dir_link = __webpack_require__(9664); var link_default = /*#__PURE__*/__webpack_require__.n(app_dir_link); ;// ./src/components/UpgradePrompt.tsx const tierLabels = { free: 'Free', pro: 'Pro', ultimate: 'Ultimate' }; const tierColors = { free: 'bg-gray-50 border-gray-200 text-gray-700', pro: 'bg-green-50 border-green-200 text-gray-800', ultimate: 'bg-amber-50 border-amber-200 text-amber-800' }; const tierBtnColors = { free: 'bg-gray-600 hover:bg-gray-700 text-white', pro: 'bg-green-600 hover:bg-green-700 text-white', ultimate: 'bg-amber-500 hover:bg-amber-600 text-white' }; function UpgradePrompt(param) { let { feature, requiredTier, variant = 'inline', t, className = '' } = param; const tierLabel = tierLabels[requiredTier]; if (variant === 'banner') { return /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex items-center justify-between gap-3 rounded-xl border px-4 py-3 ".concat(tierColors[requiredTier], " ").concat(className), children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex items-center gap-2 min-w-0", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)(LockIcon, { className: "w-4 h-4 shrink-0 opacity-60" }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("span", { className: "text-sm font-medium truncate", children: [ feature, " — ", t('upgrade.available_in', 'Available in'), " ", /*#__PURE__*/ (0,jsx_runtime.jsx)("b", { children: tierLabel }) ] }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)((link_default()), { href: "/pricing?highlight=".concat(requiredTier), className: "shrink-0 text-xs font-semibold px-3 py-1.5 rounded-lg transition ".concat(tierBtnColors[requiredTier]), children: t('upgrade.cta', 'Upgrade') }) ] }); } if (variant === 'block') { return /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "rounded-2xl border p-6 text-center ".concat(tierColors[requiredTier], " ").concat(className), children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)(LockIcon, { className: "w-8 h-8 mx-auto mb-3 opacity-40" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "font-semibold text-base mb-1", children: feature }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("p", { className: "text-sm opacity-70 mb-4", children: [ t('upgrade.available_in', 'Available in plan'), " ", /*#__PURE__*/ (0,jsx_runtime.jsx)("b", { children: tierLabel }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)((link_default()), { href: "/pricing?highlight=".concat(requiredTier), className: "inline-block text-sm font-semibold px-5 py-2 rounded-xl transition ".concat(tierBtnColors[requiredTier]), children: t('upgrade.cta', 'Upgrade plan') }) ] }); } // inline variant return /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex items-center gap-2 text-sm ".concat(className), children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)(LockIcon, { className: "w-4 h-4 text-gray-400 shrink-0" }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("span", { className: "text-gray-500", children: [ t('upgrade.available_in', 'Available in'), " ", /*#__PURE__*/ (0,jsx_runtime.jsx)("b", { className: "text-gray-700", children: tierLabel }), ".", ' ', /*#__PURE__*/ (0,jsx_runtime.jsx)((link_default()), { href: "/pricing?highlight=".concat(requiredTier), className: "text-green-600 hover:underline", children: t('upgrade.cta', 'Upgrade') }) ] }) ] }); } function LockIcon(param) { let { className = '' } = param; return /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { viewBox: "0 0 20 20", fill: "currentColor", className: className, children: /*#__PURE__*/ (0,jsx_runtime.jsx)("path", { fillRule: "evenodd", d: "M10 1a4.5 4.5 0 00-4.5 4.5V9H5a2 2 0 00-2 2v6a2 2 0 002 2h10a2 2 0 002-2v-6a2 2 0 00-2-2h-.5V5.5A4.5 4.5 0 0010 1zm3 8V5.5a3 3 0 10-6 0V9h6z", clipRule: "evenodd" }) }); } // EXTERNAL MODULE: ./src/lib/formatName.ts var formatName = __webpack_require__(1258); // EXTERNAL MODULE: ./src/lib/formatLastSeen.ts var formatLastSeen = __webpack_require__(5338); // EXTERNAL MODULE: ./src/components/PlanBadge.tsx var PlanBadge = __webpack_require__(2035); // EXTERNAL MODULE: ./src/components/CategoryIcon.tsx var CategoryIcon = __webpack_require__(5940); ;// ./src/app/users/[id]/page.tsx /* __next_internal_client_entry_do_not_use__ default auto */ const MONTHS_BY_LOCALE = { ru: [ 'ЯМварь', 'Ѐевраль', 'Март', 'Апрель', 'Май', 'ИюМь', 'Июль', 'Август', 'СеМтябрь', 'Октябрь', 'НПябрь', 'Декабрь' ], en: [ 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December' ], el: [ 'ΙαΜουάριος', 'Ίεβρουάριος', 'Μάρτιος', 'Απρίλιος', 'Μάιος', 'ΙούΜιος', 'Ιούλιος', 'Αύγουστος', 'ΣεπτέΌβριος', 'Οκτώβριος', 'ΝοέΌβριος', 'ΔεκέΌβριος' ], uk: [ 'СічеМь', 'ЛютОй', 'БерезеМь', 'КвітеМь', 'ТравеМь', 'ЧервеМь', 'ЛОпеМь', 'СерпеМь', 'ВересеМь', 'ЖПвтеМь', 'ЛОстПпаЎ', 'ГруЎеМь' ] }; const WEEK_DAYS_BY_LOCALE = { ru: [ 'ПМ', 'Вт', 'Ср', 'Чт', 'Пт', 'Сб', 'Вс' ], en: [ 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa', 'Su' ], el: [ 'Δε', '΀ρ', '΀ε', 'Πε', 'Πα', 'Σά', 'Κυ' ], uk: [ 'ПМ', 'Вт', 'Ср', 'Чт', 'Пт', 'Сб', 'НЎ' ] }; function UserProfilePage() { var _user_firstName, _user_lastName, _user_name_, _user_name, _user_siteSettings, _session_user; const { id } = (0,navigation.useParams)(); const { t, locale } = (0,context_locale/* useLocale */.Y)(); const { data: session } = (0,auth/* useSession */.wV)(); const router = (0,navigation.useRouter)(); const [user, setUser] = (0,react.useState)(null); const [reviews, setReviews] = (0,react.useState)([]); const [rating, setRating] = (0,react.useState)(null); const [loading, setLoading] = (0,react.useState)(true); const [specialistCards, setSpecialistCards] = (0,react.useState)([]); const [priceLists, setPriceLists] = (0,react.useState)({}); const [catMap, setCatMap] = (0,react.useState)(new Map()); const [locMap, setLocMap] = (0,react.useState)(new Map()); const [isFavorite, setIsFavorite] = (0,react.useState)(false); const [favLoading, setFavLoading] = (0,react.useState)(false); const [msgLoading, setMsgLoading] = (0,react.useState)(false); const [canMsg, setCanMsg] = (0,react.useState)(null); // Availability const now = new Date(); const [availYear, setAvailYear] = (0,react.useState)(now.getFullYear()); const [availMonth, setAvailMonth] = (0,react.useState)(now.getMonth()); const [availMap, setAvailMap] = (0,react.useState)({}); const today = new Date().toISOString().slice(0, 10); const dateLocale = locale === 'ru' ? 'ru-RU' : locale === 'uk' ? 'uk-UA' : locale === 'en' ? 'en-US' : 'el-GR'; (0,react.useEffect)(()=>{ if (!id) return; Promise.all([ (0,api/* getUserProfile */.VM)(id, locale), (0,api/* getUserReviews */.v9)(id), (0,api/* getUserRating */.Bm)(id), (0,api/* getCategories */.bW)().catch(()=>[]), (0,api/* getLocations */.Vs)().catch(()=>[]) ]).then((param)=>{ let [u, r, rt, cats, locs] = param; setUser(u); setReviews(r); setRating(rt.avg); setCatMap(new Map(flattenTree(cats).map((c)=>[ c.slug, c ]))); setLocMap(new Map(flattenTree(locs).map((l)=>[ l.slug, l ]))); if (u.role === 'specialist' || u.role === 'admin') { (0,api/* getSpecialistCards */.Bq)(id, locale).then((cards)=>{ setSpecialistCards(cards); cards.forEach((c)=>{ (0,api/* getPriceList */.Ck)(c.id, locale).then((pl)=>{ if (pl.length > 0) setPriceLists((prev)=>({ ...prev, [c.id]: pl })); }).catch(()=>{}); }); }).catch(()=>{}); } }).catch(()=>{}).finally(()=>setLoading(false)); }, [ id, locale ]); // Load favorite status when session available (0,react.useEffect)(()=>{ var _session_user; if (!session || !id) return; (0,api/* getSpecialistFavorites */.pD)().then((rows)=>setIsFavorite(rows.some((r)=>{ var _r_specialist; return ((_r_specialist = r.specialist) === null || _r_specialist === void 0 ? void 0 : _r_specialist.id) === id; }))).catch(()=>{}); // Check if current user can message this person const myId = (_session_user = session.user) === null || _session_user === void 0 ? void 0 : _session_user.id; if (myId && myId !== id) { (0,api/* getCanMessage */.On)(id).then(setCanMsg).catch(()=>{}); } }, [ session, id ]); async function toggleFavorite() { if (!session) { router.push('/register'); return; } setFavLoading(true); try { if (isFavorite) { await (0,api/* removeSpecialistFavorite */.sD)(id); setIsFavorite(false); } else { await (0,api/* addSpecialistFavorite */.V)(id); setIsFavorite(true); } } catch (e) {} setFavLoading(false); } async function handleMessage() { if (!session) { router.push('/login'); return; } setMsgLoading(true); try { const { room } = await (0,api/* getOrCreateDirectRoom */.QN)(id); router.push("/chat?room=".concat(room.id)); } catch (e) {} setMsgLoading(false); } (0,react.useEffect)(()=>{ if (!id) return; const monthKey = "".concat(availYear, "-").concat(String(availMonth + 1).padStart(2, '0')); (0,api/* getSpecialistAvailability */.Xz)(id, monthKey).then((rows)=>{ setAvailMap((prev)=>{ const next = { ...prev }; rows.forEach((r)=>{ next[r.date] = r.status; }); return next; }); }).catch(()=>{}); }, [ id, availYear, availMonth ]); if (loading) return /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "text-center py-20 text-white", children: t('common.loading') }); if (!user) return /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "text-center py-20 text-white/70", children: t('common.error') }); var _user_firstName_, _user_lastName_; const initials = "".concat((_user_firstName_ = (_user_firstName = user.firstName) === null || _user_firstName === void 0 ? void 0 : _user_firstName[0]) !== null && _user_firstName_ !== void 0 ? _user_firstName_ : '').concat((_user_lastName_ = (_user_lastName = user.lastName) === null || _user_lastName === void 0 ? void 0 : _user_lastName[0]) !== null && _user_lastName_ !== void 0 ? _user_lastName_ : '').toUpperCase() || ((_user_name = user.name) === null || _user_name === void 0 ? void 0 : (_user_name_ = _user_name[0]) === null || _user_name_ === void 0 ? void 0 : _user_name_.toUpperCase()) || '?'; const displayName = (0,formatName/* formatShortName */.H)(user.firstName, user.lastName, user.name); const profileBackgroundImage = typeof ((_user_siteSettings = user.siteSettings) === null || _user_siteSettings === void 0 ? void 0 : _user_siteSettings.profileBackgroundImage) === 'string' && user.siteSettings.profileBackgroundImage.trim().length > 0 ? user.siteSettings.profileBackgroundImage : null; return /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "max-w-3xl mx-auto px-4 py-10", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-6 mb-6", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "relative -mx-6 -mt-6 mb-5 h-44 overflow-hidden rounded-t-xl", style: { backgroundImage: profileBackgroundImage ? "linear-gradient(135deg, rgba(21, 128, 61, 0.45), rgba(22, 163, 74, 0.65)), url(".concat(profileBackgroundImage, ")") : 'linear-gradient(135deg, #22c55e 0%, #16a34a 45%, #166534 100%)', backgroundSize: 'cover', backgroundPosition: 'center' }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "absolute inset-0 bg-gradient-to-b from-black/10 to-black/30" }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "relative h-full w-full p-5 flex items-end justify-between", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex items-center gap-3 min-w-0", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "w-14 h-14 rounded-full bg-white/20 border border-white/40 overflow-hidden flex items-center justify-center text-white text-xl font-bold backdrop-blur-sm", children: user.image ? /*#__PURE__*/ (0,jsx_runtime.jsx)("img", { src: user.image, alt: displayName, className: "w-full h-full object-cover" }) : initials }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "min-w-0", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "text-white text-lg font-bold truncate", children: displayName }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("p", { className: "text-white/85 text-xs", children: [ t('profile.member_since'), " ", new Date(user.createdAt).toLocaleDateString(dateLocale) ] }) ] }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "shrink-0", children: [ user.planTier && user.planTier !== 'free' && /*#__PURE__*/ (0,jsx_runtime.jsx)(PlanBadge/* PlanBadge */.d, { tier: user.planTier, verified: user.hasVerifiedBadge, size: "sm" }), user.hasVerifiedBadge && user.planTier === 'free' && /*#__PURE__*/ (0,jsx_runtime.jsx)(PlanBadge/* PlanBadge */.d, { tier: "free", verified: true, size: "sm" }) ] }) ] }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex items-start gap-5", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "w-20 h-20 rounded-full bg-green-100 flex-shrink-0 flex items-center justify-center text-green-700 text-2xl font-bold overflow-hidden border-2 border-gray-100", children: user.image ? /*#__PURE__*/ (0,jsx_runtime.jsx)("img", { src: user.image, alt: displayName, className: "w-full h-full object-cover" }) : initials }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex items-center gap-2 flex-wrap mb-1", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("h1", { className: "text-xl font-bold text-gray-900", children: displayName }), user.planTier && user.planTier !== 'free' && /*#__PURE__*/ (0,jsx_runtime.jsx)(PlanBadge/* PlanBadge */.d, { tier: user.planTier, verified: user.hasVerifiedBadge, size: "sm" }), user.hasVerifiedBadge && user.planTier === 'free' && /*#__PURE__*/ (0,jsx_runtime.jsx)(PlanBadge/* PlanBadge */.d, { tier: "free", verified: true, size: "sm" }), Array.isArray(user.activeStatuses) && user.activeStatuses.includes('can_help_now') && /*#__PURE__*/ (0,jsx_runtime.jsxs)("span", { className: "inline-flex items-center gap-1 text-xs font-medium text-green-700 bg-green-50 border border-green-200 px-2 py-0.5 rounded-full", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "w-1.5 h-1.5 rounded-full bg-green-500 animate-pulse" }), t('status.can_help_now', 'Available now') ] }), Array.isArray(user.activeStatuses) && user.activeStatuses.includes('need_help') && /*#__PURE__*/ (0,jsx_runtime.jsxs)("span", { className: "inline-flex items-center gap-1 text-xs font-medium text-green-700 bg-green-50 border border-green-200 px-2 py-0.5 rounded-full", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "w-1.5 h-1.5 rounded-full bg-green-500" }), t('status.need_help', 'Need help') ] }), (session ? ((_session_user = session.user) === null || _session_user === void 0 ? void 0 : _session_user.id) !== id : true) && /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "ml-auto flex items-center gap-2", children: [ !session ? // Guest — show button that leads to registration /*#__PURE__*/ (0,jsx_runtime.jsxs)("a", { href: "/register", className: "flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-sm font-medium bg-green-50 text-green-600 border border-green-200 hover:bg-green-100 transition", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { children: t('chat.write_btn', 'Write') }) ] }) : (canMsg === null || canMsg === void 0 ? void 0 : canMsg.allowed) === false ? /*#__PURE__*/ (0,jsx_runtime.jsx)(UpgradePrompt, { feature: t('chat.write_btn', 'Write'), requiredTier: "pro", variant: "inline", t: t }) : /*#__PURE__*/ (0,jsx_runtime.jsxs)("button", { onClick: handleMessage, disabled: msgLoading, className: "flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-sm font-medium bg-green-50 text-green-600 border border-green-200 hover:bg-green-100 transition disabled:opacity-50", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { children: t('chat.write_btn') }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("button", { onClick: toggleFavorite, disabled: favLoading, title: isFavorite ? t('specialist.unfavorite') : t('specialist.favorite'), className: "flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-sm font-medium transition disabled:opacity-50 ".concat(isFavorite ? 'bg-pink-50 text-pink-600 border border-pink-200 hover:bg-pink-100' : 'bg-gray-50 text-gray-600 border border-gray-200 hover:bg-gray-100'), children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { children: isFavorite ? '❀' : '🀍' }), /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { children: isFavorite ? t('specialist.unfavorite') : t('specialist.favorite') }) ] }) ] }) ] }), rating && /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex items-center gap-1.5 mb-2", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "text-yellow-400 text-lg", children: "★" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "font-semibold text-gray-800", children: Number(rating).toFixed(1) }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("span", { className: "text-sm text-gray-400", children: [ "(", reviews.length, " ", t('profile.reviews').toLowerCase(), ")" ] }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("p", { className: "text-sm text-gray-400", children: [ t('profile.member_since'), " ", new Date(user.createdAt).toLocaleDateString(dateLocale), user.lastSeenAt && /*#__PURE__*/ (0,jsx_runtime.jsxs)("span", { className: "ml-2", children: [ "\xb7 ", (0,formatLastSeen/* formatLastSeen */.V)(user.lastSeenAt, t) ] }) ] }) ] }) ] }), user.bio && /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "mt-4 text-gray-700 text-sm leading-relaxed border-t border-gray-100 pt-4", children: user.bio }), user.phone && /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "mt-4 border-t border-gray-100 pt-4 flex items-center gap-2", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M3 5a2 2 0 012-2h3.28a1 1 0 01.948.684l1.498 4.493a1 1 0 01-.502 1.21l-2.257 1.13a11.042 11.042 0 005.516 5.516l1.13-2.257a1 1 0 011.21-.502l4.493 1.498a1 1 0 01.684.949V19a2 2 0 01-2 2h-1C9.716 21 3 14.284 3 6V5z" }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)("a", { href: "tel:".concat(user.phone), className: "text-sm font-medium text-gray-700 hover:text-green-600", children: user.phone }) ] }), user.personalSiteSlug && /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "mt-3 flex items-center gap-2", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,jsx_runtime.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" }) }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("a", { href: "/site/".concat(user.personalSiteSlug), target: "_blank", rel: "noopener noreferrer", className: "text-sm text-green-600 hover:underline", children: [ "canhelp.gr/site/", user.personalSiteSlug ] }) ] }), user.languages && user.languages.length > 0 && /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "mt-4 border-t border-gray-100 pt-4", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "text-xs font-medium text-gray-500 mb-2 uppercase tracking-wide", children: t('profile.languages') }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "flex flex-wrap gap-2", children: user.languages.map((code)=>{ const langMap = { el: { flag: '🇬🇷', label: 'ΕλληΜικά' }, en: { flag: '🇬🇧', label: 'English' }, ru: { flag: '🇷🇺', label: 'РусскОй' }, uk: { flag: '🇺🇊', label: 'УкраїМська' }, de: { flag: '🇩🇪', label: 'Deutsch' }, fr: { flag: '🇫🇷', label: 'Français' }, it: { flag: '🇮🇹', label: 'Italiano' }, es: { flag: '🇪🇞', label: 'Español' }, ar: { flag: '🇞🇊', label: 'العرؚية' }, zh: { flag: '🇚🇳', label: 'äž­æ–‡' } }; const lang = langMap[code]; if (!lang) return null; return /*#__PURE__*/ (0,jsx_runtime.jsxs)("span", { className: "flex items-center gap-1.5 bg-indigo-50 text-indigo-700 text-sm px-3 py-1 rounded-full border border-indigo-100", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { children: lang.flag }), /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { children: lang.label }) ] }, code); }) }) ] }), user.skills && user.skills.length > 0 && specialistCards.length === 0 && /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "mt-4 border-t border-gray-100 pt-4", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "text-xs font-medium text-gray-500 mb-2 uppercase tracking-wide", children: t('profile.skills.label') }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "flex flex-wrap gap-2", children: user.skills.map((skill)=>/*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "bg-green-50 text-green-700 text-sm px-3 py-1 rounded-full", children: skill }, skill)) }) ] }), user.role === 'specialist' && user.specialistCategories && user.specialistCategories.length > 0 && specialistCards.length === 0 && /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "mt-4 border-t border-gray-100 pt-4", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "text-xs font-medium text-gray-500 mb-2 uppercase tracking-wide", children: t('user.categories') }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "flex flex-wrap gap-2", children: user.specialistCategories.map((slug)=>/*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "bg-purple-50 text-purple-700 text-sm px-3 py-1 rounded-full", children: slug }, slug)) }) ] }), user.role === 'specialist' && user.specialistLocations && user.specialistLocations.length > 0 && specialistCards.length === 0 && /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "mt-4 border-t border-gray-100 pt-4", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "text-xs font-medium text-gray-500 mb-2 uppercase tracking-wide", children: t('user.work_area') }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "flex flex-wrap gap-2", children: user.specialistLocations.map((slug)=>/*#__PURE__*/ (0,jsx_runtime.jsxs)("span", { className: "bg-emerald-50 text-emerald-700 text-sm px-3 py-1 rounded-full", children: [ "\uD83D\uDCCD ", slug ] }, slug)) }) ] }) ] }), user.role === 'specialist' && /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-6 mb-6", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex items-center justify-between mb-4", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("h2", { className: "font-bold text-gray-900 text-lg", children: [ "\uD83D\uDCC5 ", t('nav.schedule') ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex items-center gap-3 text-xs text-gray-500", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("span", { className: "flex items-center gap-1.5", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "w-3 h-3 rounded bg-emerald-200 border border-emerald-400 inline-block" }), t('schedule.available') ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("span", { className: "flex items-center gap-1.5", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "w-3 h-3 rounded bg-red-200 border border-red-400 inline-block" }), t('schedule.busy') ] }) ] }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)(ReadOnlyCalendar, { year: availYear, month: availMonth, availMap: availMap, today: today, onPrev: ()=>{ if (availMonth === 0) { setAvailYear((y)=>y - 1); setAvailMonth(11); } else setAvailMonth((m)=>m - 1); }, onNext: ()=>{ if (availMonth === 11) { setAvailYear((y)=>y + 1); setAvailMonth(0); } else setAvailMonth((m)=>m + 1); } }) ] }), (user.role === 'specialist' || user.role === 'admin') && specialistCards.length > 0 && /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "space-y-4 mb-6", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("h2", { className: "font-bold text-white text-lg", children: t('nav.specialists') }), specialistCards.map((card)=>{ var _priceLists_card_id; return /*#__PURE__*/ (0,jsx_runtime.jsx)(PublicCardView, { card: card, locale: locale, catMap: catMap, locMap: locMap, t: t, priceList: (_priceLists_card_id = priceLists[card.id]) !== null && _priceLists_card_id !== void 0 ? _priceLists_card_id : [] }, card.id); }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("h2", { className: "font-bold text-gray-900 text-lg mb-4", children: [ t('profile.reviews'), reviews.length > 0 && /*#__PURE__*/ (0,jsx_runtime.jsxs)("span", { className: "text-gray-400 font-normal text-base ml-2", children: [ "(", reviews.length, ")" ] }) ] }), reviews.length === 0 ? /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "text-gray-500 text-sm", children: t('profile.no_reviews') }) : /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "space-y-4", children: reviews.map((param)=>{ let { review, author } = param; var _author_name_, _author_name; var _author_name__toUpperCase, _shortName; return /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "border-b border-gray-50 pb-4 last:border-0 last:pb-0", children: /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex items-start gap-3", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "w-8 h-8 rounded-full bg-gray-100 flex-shrink-0 flex items-center justify-center text-gray-600 text-sm font-bold overflow-hidden", children: (author === null || author === void 0 ? void 0 : author.image) ? /*#__PURE__*/ (0,jsx_runtime.jsx)("img", { src: author.image, alt: author.name, className: "w-full h-full object-cover" }) : (_author_name__toUpperCase = author === null || author === void 0 ? void 0 : (_author_name = author.name) === null || _author_name === void 0 ? void 0 : (_author_name_ = _author_name[0]) === null || _author_name_ === void 0 ? void 0 : _author_name_.toUpperCase()) !== null && _author_name__toUpperCase !== void 0 ? _author_name__toUpperCase : '?' }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex-1", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex items-center gap-2 mb-1", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "text-sm font-medium text-gray-800", children: (_shortName = (0,formatName/* shortName */.E)(author === null || author === void 0 ? void 0 : author.name)) !== null && _shortName !== void 0 ? _shortName : '—' }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("span", { className: "text-yellow-400", children: [ '★'.repeat(review.rating), '☆'.repeat(5 - review.rating) ] }) ] }), review.comment && /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "text-sm text-gray-600", children: review.comment }), /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "text-xs text-gray-400 mt-1", children: new Date(review.createdAt).toLocaleDateString(dateLocale) }) ] }) ] }) }, review.id); }) }) ] }) ] }); } function ReadOnlyCalendar(param) { let { year, month, availMap, today, onPrev, onNext } = param; const { locale, t } = (0,context_locale/* useLocale */.Y)(); var _WEEK_DAYS_BY_LOCALE_locale; const weekDays = (_WEEK_DAYS_BY_LOCALE_locale = WEEK_DAYS_BY_LOCALE[locale]) !== null && _WEEK_DAYS_BY_LOCALE_locale !== void 0 ? _WEEK_DAYS_BY_LOCALE_locale : WEEK_DAYS_BY_LOCALE.ru; var _MONTHS_BY_LOCALE_locale; const months = (_MONTHS_BY_LOCALE_locale = MONTHS_BY_LOCALE[locale]) !== null && _MONTHS_BY_LOCALE_locale !== void 0 ? _MONTHS_BY_LOCALE_locale : MONTHS_BY_LOCALE.ru; const firstDay = new Date(year, month, 1); const startDow = (firstDay.getDay() + 6) % 7; const daysInMonth = new Date(year, month + 1, 0).getDate(); const prevMonthDays = new Date(year, month, 0).getDate(); const cells = []; for(let i = startDow - 1; i >= 0; i--){ cells.push({ day: prevMonthDays - i, cur: false, dateKey: '' }); } for(let d = 1; d <= daysInMonth; d++){ const dateKey = "".concat(year, "-").concat(String(month + 1).padStart(2, '0'), "-").concat(String(d).padStart(2, '0')); cells.push({ day: d, cur: true, dateKey }); } const remainder = cells.length % 7; if (remainder !== 0) { for(let d = 1; d <= 7 - remainder; d++){ cells.push({ day: d, cur: false, dateKey: '' }); } } const monthPrefix = "".concat(year, "-").concat(String(month + 1).padStart(2, '0')); const availCount = Object.entries(availMap).filter((param)=>{ let [k, v] = param; return k.startsWith(monthPrefix) && k >= today && v === 'available'; }).length; return /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex items-center justify-between mb-3", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { onClick: onPrev, className: "w-7 h-7 rounded-lg hover:bg-gray-100 flex items-center justify-center text-gray-500", children: "‹" }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "text-center", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("span", { className: "font-medium text-gray-800 text-sm", children: [ months[month], " ", year ] }), availCount > 0 && /*#__PURE__*/ (0,jsx_runtime.jsxs)("span", { className: "ml-2 text-xs text-emerald-600", children: [ availCount, " ", t('schedule.free_days') ] }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { onClick: onNext, className: "w-7 h-7 rounded-lg hover:bg-gray-100 flex items-center justify-center text-gray-500", children: "›" }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "grid grid-cols-7 mb-1", children: weekDays.map((d)=>/*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "text-center text-xs text-gray-400 py-1", children: d }, d)) }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "grid grid-cols-7 gap-0.5", children: cells.map((cell, idx)=>{ if (!cell.cur) { return /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "h-9 flex items-center justify-center text-xs text-gray-200", children: cell.day }, "e-".concat(idx)); } const status = availMap[cell.dateKey]; const isPast = cell.dateKey < today; const isToday = cell.dateKey === today; let cls = 'h-9 flex items-center justify-center rounded-lg text-sm font-medium '; if (isPast) { cls += 'text-gray-200 '; } else if (status === 'available') { cls += 'bg-emerald-100 border border-emerald-300 text-emerald-700 '; } else if (status === 'busy') { cls += 'bg-red-100 border border-red-300 text-red-600 '; } else { cls += 'text-gray-500 '; } if (isToday) cls += 'ring-2 ring-blue-400 ring-offset-1 '; return /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: cls, children: cell.day }, cell.dateKey); }) }) ] }); } // ─── Public card view ───────────────────────────────────────────────────────── function flattenTree(nodes) { return nodes.flatMap((n)=>{ var _n_children; return [ n, ...flattenTree((_n_children = n.children) !== null && _n_children !== void 0 ? _n_children : []) ]; }); } function PublicCardView(param) { let { card, locale, catMap, locMap, t, priceList } = param; const [lightbox, setLightbox] = (0,react.useState)(null); const [expandedAreas, setExpandedAreas] = (0,react.useState)([]); const locById = new Map(); for (const node of locMap.values()){ if (node === null || node === void 0 ? void 0 : node.id) locById.set(node.id, node); } const getLocName = (loc, fallback)=>{ var _loc_names, _loc_names1; return (loc === null || loc === void 0 ? void 0 : (_loc_names = loc.names) === null || _loc_names === void 0 ? void 0 : _loc_names[locale]) || (loc === null || loc === void 0 ? void 0 : (_loc_names1 = loc.names) === null || _loc_names1 === void 0 ? void 0 : _loc_names1.el) || fallback; }; const locationGroups = (()=>{ const grouped = new Map(); var _card_locations; for (const slug of (_card_locations = card.locations) !== null && _card_locations !== void 0 ? _card_locations : []){ const loc = locMap.get(slug); if (!loc) { if (!grouped.has(slug)) { grouped.set(slug, { root: { slug, names: { el: slug } }, rootSlug: slug, districts: [], districtSlugs: new Set() }); } continue; } let root = loc; const seenIds = new Set(); while((root === null || root === void 0 ? void 0 : root.parentId) && locById.has(root.parentId) && !seenIds.has(root.parentId)){ seenIds.add(root.parentId); root = locById.get(root.parentId); } var _root_slug; const rootSlug = (_root_slug = root === null || root === void 0 ? void 0 : root.slug) !== null && _root_slug !== void 0 ? _root_slug : slug; if (!grouped.has(rootSlug)) { grouped.set(rootSlug, { root, rootSlug, districts: [], districtSlugs: new Set() }); } const group = grouped.get(rootSlug); if (loc.slug !== rootSlug && !group.districtSlugs.has(loc.slug)) { group.districtSlugs.add(loc.slug); group.districts.push(loc); } } return Array.from(grouped.values()); })(); var _lightbox_title; return /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 overflow-hidden", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "px-5 py-4 border-b border-gray-100", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("h3", { className: "font-bold text-gray-900", children: card.title }), card.description && /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "text-sm text-gray-600 mt-1", children: card.description }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "p-5 space-y-4", children: [ card.skills && card.skills.length > 0 && /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "text-xs font-semibold text-gray-500 uppercase tracking-wide mb-2", children: t('card.skills') }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "flex flex-wrap gap-2", children: card.skills.map((s)=>/*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "bg-green-50 text-green-700 text-sm px-3 py-1 rounded-full", children: s }, s)) }) ] }), card.categories && card.categories.length > 0 && /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "text-xs font-semibold text-gray-500 uppercase tracking-wide mb-2", children: t('card.categories') }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "flex flex-wrap gap-2", children: card.categories.map((s)=>{ var _cat_names, _cat_names1; const cat = catMap.get(s); const name = cat ? ((_cat_names = cat.names) === null || _cat_names === void 0 ? void 0 : _cat_names[locale]) || ((_cat_names1 = cat.names) === null || _cat_names1 === void 0 ? void 0 : _cat_names1.el) || s : s; return /*#__PURE__*/ (0,jsx_runtime.jsxs)("span", { className: "bg-purple-50 text-purple-700 text-sm px-3 py-1 rounded-full", children: [ (cat === null || cat === void 0 ? void 0 : cat.icon) ? /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "mr-1 inline-flex align-middle", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(CategoryIcon/* CategoryIcon */.Ez, { icon: cat.icon, alt: name, className: (0,CategoryIcon/* isCategoryIconUrl */.V)(cat.icon) ? 'h-4 w-4 object-contain' : 'text-sm leading-none', fallback: "\uD83D\uDCE6" }) }) : null, name ] }, s); }) }) ] }), card.locations && card.locations.length > 0 && /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "text-xs font-semibold text-gray-500 uppercase tracking-wide mb-2", children: t('user.work_area') }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "space-y-2", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "flex flex-wrap gap-2", children: locationGroups.map((group)=>{ const expanded = expandedAreas.includes(group.rootSlug); const canExpand = group.districts.length > 0; return /*#__PURE__*/ (0,jsx_runtime.jsxs)("button", { type: "button", onClick: ()=>{ if (!canExpand) return; setExpandedAreas((prev)=>prev.includes(group.rootSlug) ? prev.filter((slug)=>slug !== group.rootSlug) : [ ...prev, group.rootSlug ]); }, className: "inline-flex items-center gap-1.5 text-sm px-3 py-1.5 rounded-full border transition ".concat(expanded ? 'bg-emerald-100 text-emerald-800 border-emerald-300' : 'bg-emerald-50 text-emerald-700 border-emerald-200 hover:bg-emerald-100', " ").concat(canExpand ? 'cursor-pointer' : 'cursor-default'), children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { children: "\uD83D\uDCCD" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { children: getLocName(group.root, group.rootSlug) }), canExpand && /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "text-[11px] font-semibold px-1.5 py-0.5 rounded-full bg-white/80 text-emerald-700 border border-emerald-200", children: expanded ? '−' : "+".concat(group.districts.length) }) ] }, group.rootSlug); }) }), locationGroups.filter((group)=>expandedAreas.includes(group.rootSlug) && group.districts.length > 0).map((group)=>/*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "rounded-xl border border-emerald-100 bg-emerald-50/40 p-3", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "text-xs text-emerald-700 font-medium mb-2", children: getLocName(group.root, group.rootSlug) }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "flex flex-wrap gap-1.5", children: group.districts.map((district)=>/*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "text-xs px-2.5 py-1 rounded-full bg-white border border-emerald-200 text-emerald-700", children: getLocName(district, district.slug) }, district.slug)) }) ] }, "".concat(group.rootSlug, "-children"))) ] }) ] }), priceList.length > 0 && /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "text-xs font-semibold text-gray-500 uppercase tracking-wide mb-3", children: t('profile.card.tab.pricelist') }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "space-y-3", children: priceList.map((group)=>/*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "border border-gray-200 rounded-xl overflow-hidden", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "bg-gray-50 px-4 py-2 border-b border-gray-200", children: /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "font-semibold text-sm text-gray-800", children: group.title }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "divide-y divide-gray-100", children: group.items.map((item)=>/*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex items-center gap-3 px-4 py-2.5 text-sm", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "font-medium text-gray-800", children: item.name }), item.description && /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "text-xs text-gray-500", children: item.description }) ] }), (item.price || item.unit) && /*#__PURE__*/ (0,jsx_runtime.jsxs)("span", { className: "text-green-700 font-semibold whitespace-nowrap", children: [ item.price ? "€".concat(item.price) : '', item.unit ? " ".concat(item.unit) : '' ] }) ] }, item.id)) }) ] }, group.id)) }) ] }), card.portfolio && card.portfolio.length > 0 && /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "text-xs font-semibold text-gray-500 uppercase tracking-wide mb-2", children: t('card.portfolio') }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "grid grid-cols-2 sm:grid-cols-3 gap-3", children: card.portfolio.map((item)=>{ var _item_title; return /*#__PURE__*/ (0,jsx_runtime.jsxs)("button", { type: "button", onClick: ()=>setLightbox(item), className: "group relative rounded-xl overflow-hidden border border-gray-200 bg-gray-50 text-left", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("img", { src: item.imageUrl, alt: (_item_title = item.title) !== null && _item_title !== void 0 ? _item_title : '', className: "w-full aspect-square object-cover group-hover:scale-105 transition-transform duration-200" }), item.title && /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "px-2 py-1.5", children: /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "text-xs font-medium text-gray-700 truncate", children: item.title }) }) ] }, item.id); }) }) ] }) ] }), lightbox && /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "fixed inset-0 z-50 flex items-center justify-center bg-black/80 px-4", onClick: ()=>setLightbox(null), children: /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "bg-white rounded-2xl overflow-hidden max-w-lg w-full shadow-2xl", onClick: (e)=>e.stopPropagation(), children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("img", { src: lightbox.imageUrl, alt: (_lightbox_title = lightbox.title) !== null && _lightbox_title !== void 0 ? _lightbox_title : '', className: "w-full max-h-[60vh] object-contain bg-gray-900" }), (lightbox.title || lightbox.description) && /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "p-4", children: [ lightbox.title && /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "font-semibold text-gray-800 mb-1", children: lightbox.title }), lightbox.description && /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "text-sm text-gray-600", children: lightbox.description }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "flex justify-end px-4 pb-4", children: /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { type: "button", onClick: ()=>setLightbox(null), className: "text-sm text-gray-500 hover:text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-100", children: t('card.close') }) }) ] }) }) ] }); } /***/ }) áä `åæåà// ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); // EXPORTS __webpack_require__.d(__webpack_exports__, { "default": () => (/* binding */ UserProfilePage) }); // EXTERNAL MODULE: ../../node_modules/next/dist/compiled/react/jsx-runtime.js var jsx_runtime = __webpack_require__(4568); // EXTERNAL MODULE: ../../node_modules/next/dist/compiled/react/index.js var react = __webpack_require__(7620); // EXTERNAL MODULE: ../../node_modules/next/dist/api/navigation.js var navigation = __webpack_require__(7541); // EXTERNAL MODULE: ./src/context/locale.tsx var context_locale = __webpack_require__(9906); // EXTERNAL MODULE: ./src/lib/auth.ts var auth = __webpack_require__(1592); // EXTERNAL MODULE: ./src/lib/api.ts var api = __webpack_require__(2982); // EXTERNAL MODULE: ../../node_modules/next/dist/client/app-dir/link.js var app_dir_link = __webpack_require__(9664); var link_default = /*#__PURE__*/__webpack_require__.n(app_dir_link); ;// ./src/components/UpgradePrompt.tsx  ReplaceSourceæ£import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import Link from 'next/link'; const tierLabels = { free: 'Free', pro: 'Pro', ultimate: 'Ultimate' }; const tierColors = { free: 'bg-gray-50 border-gray-200 text-gray-700', pro: 'bg-green-50 border-green-200 text-gray-800', ultimate: 'bg-amber-50 border-amber-200 text-amber-800' }; const tierBtnColors = { free: 'bg-gray-600 hover:bg-gray-700 text-white', pro: 'bg-green-600 hover:bg-green-700 text-white', ultimate: 'bg-amber-500 hover:bg-amber-600 text-white' }; export function UpgradePrompt(param) { let { feature, requiredTier, variant = 'inline', t, className = '' } = param; const tierLabel = tierLabels[requiredTier]; if (variant === 'banner') { return /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between gap-3 rounded-xl border px-4 py-3 ".concat(tierColors[requiredTier], " ").concat(className), children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 min-w-0", children: [ /*#__PURE__*/ _jsx(LockIcon, { className: "w-4 h-4 shrink-0 opacity-60" }), /*#__PURE__*/ _jsxs("span", { className: "text-sm font-medium truncate", children: [ feature, " — ", t('upgrade.available_in', 'Available in'), " ", /*#__PURE__*/ _jsx("b", { children: tierLabel }) ] }) ] }), /*#__PURE__*/ _jsx(Link, { href: "/pricing?highlight=".concat(requiredTier), className: "shrink-0 text-xs font-semibold px-3 py-1.5 rounded-lg transition ".concat(tierBtnColors[requiredTier]), children: t('upgrade.cta', 'Upgrade') }) ] }); } if (variant === 'block') { return /*#__PURE__*/ _jsxs("div", { className: "rounded-2xl border p-6 text-center ".concat(tierColors[requiredTier], " ").concat(className), children: [ /*#__PURE__*/ _jsx(LockIcon, { className: "w-8 h-8 mx-auto mb-3 opacity-40" }), /*#__PURE__*/ _jsx("p", { className: "font-semibold text-base mb-1", children: feature }), /*#__PURE__*/ _jsxs("p", { className: "text-sm opacity-70 mb-4", children: [ t('upgrade.available_in', 'Available in plan'), " ", /*#__PURE__*/ _jsx("b", { children: tierLabel }) ] }), /*#__PURE__*/ _jsx(Link, { href: "/pricing?highlight=".concat(requiredTier), className: "inline-block text-sm font-semibold px-5 py-2 rounded-xl transition ".concat(tierBtnColors[requiredTier]), children: t('upgrade.cta', 'Upgrade plan') }) ] }); } // inline variant return /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 text-sm ".concat(className), children: [ /*#__PURE__*/ _jsx(LockIcon, { className: "w-4 h-4 text-gray-400 shrink-0" }), /*#__PURE__*/ _jsxs("span", { className: "text-gray-500", children: [ t('upgrade.available_in', 'Available in'), " ", /*#__PURE__*/ _jsx("b", { className: "text-gray-700", children: tierLabel }), ".", ' ', /*#__PURE__*/ _jsx(Link, { href: "/pricing?highlight=".concat(requiredTier), className: "text-green-600 hover:underline", children: t('upgrade.cta', 'Upgrade') }) ] }) ] }); } function LockIcon(param) { let { className = '' } = param; return /*#__PURE__*/ _jsx("svg", { viewBox: "0 0 20 20", fill: "currentColor", className: className, children: /*#__PURE__*/ _jsx("path", { fillRule: "evenodd", d: "M10 1a4.5 4.5 0 00-4.5 4.5V9H5a2 2 0 00-2 2v6a2 2 0 002 2h10a2 2 0 002-2v-6a2 2 0 00-2-2h-.5V5.5A4.5 4.5 0 0010 1zm3 8V5.5a3 3 0 10-6 0V9h6z", clipRule: "evenodd" }) }); } %062undefined6492undefined565571undefined795799__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined10151019__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined11661169__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined13181322__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined16831686__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined19151918__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined19201923__WEBPACK_MODULE_REFERENCE__6_5b2264656661756c74225d_directImport_asiSafe1__._undefined23032307__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined24902493__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined26222625__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined27852789__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined30273030__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined31863189__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined31913194__WEBPACK_MODULE_REFERENCE__6_5b2264656661756c74225d_directImport_asiSafe1__._undefined35683572__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined37023705__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined38213825__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined40314034__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined42474250__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined42524255__WEBPACK_MODULE_REFERENCE__6_5b2264656661756c74225d_directImport_asiSafe1__._undefined46294632__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined47654768__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined696772(0,jsx_runtime.jsxs)undefined9881064(0,jsx_runtime.jsxs)undefined12111285(0,jsx_runtime.jsx)undefined14341510(0,jsx_runtime.jsxs)undefined18711945(0,jsx_runtime.jsx)undefined21742248(0,jsx_runtime.jsx)undefined22502327(link_default())undefined27072783(0,jsx_runtime.jsxs)undefined29663040(0,jsx_runtime.jsx)undefined31693243(0,jsx_runtime.jsx)undefined34033479(0,jsx_runtime.jsxs)undefined37173791(0,jsx_runtime.jsx)undefined39474021(0,jsx_runtime.jsx)undefined40234100(link_default())undefined44744550(0,jsx_runtime.jsxs)undefined46804754(0,jsx_runtime.jsx)undefined48704946(0,jsx_runtime.jsxs)undefined51525226(0,jsx_runtime.jsx)undefined54395513(0,jsx_runtime.jsx)undefined55155592(link_default())undefined59666040(0,jsx_runtime.jsx)undefined61736247(0,jsx_runtime.jsx)undefinedRawSource // EXTERNAL MODULE: ./src/lib/formatName.ts var formatName = __webpack_require__(1258); // EXTERNAL MODULE: ./src/lib/formatLastSeen.ts var formatLastSeen = __webpack_require__(5338); // EXTERNAL MODULE: ./src/components/PlanBadge.tsx var PlanBadge = __webpack_require__(2035); // EXTERNAL MODULE: ./src/components/CategoryIcon.tsx var CategoryIcon = __webpack_require__(5940); ;// ./src/app/users/[id]/page.tsx ûâÑ/* __next_internal_client_entry_do_not_use__ default auto */ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { useState, useEffect } from 'react'; import { useParams, useRouter } from 'next/navigation'; import { useLocale } from '@/context/locale'; import { useSession } from '@/lib/auth'; import { getUserProfile, getUserReviews, getUserRating, getSpecialistAvailability, getSpecialistCards, getCategories, getLocations, getSpecialistFavorites, addSpecialistFavorite, removeSpecialistFavorite, getOrCreateDirectRoom, getCanMessage, getPriceList } from '@/lib/api'; import { UpgradePrompt } from '@/components/UpgradePrompt'; import { formatShortName, shortName } from '@/lib/formatName'; import { formatLastSeen } from '@/lib/formatLastSeen'; import { PlanBadge } from '@/components/PlanBadge'; import { CategoryIcon, isCategoryIconUrl } from '@/components/CategoryIcon'; const MONTHS_BY_LOCALE = { ru: [ 'ЯМварь', 'Ѐевраль', 'Март', 'Апрель', 'Май', 'ИюМь', 'Июль', 'Август', 'СеМтябрь', 'Октябрь', 'НПябрь', 'Декабрь' ], en: [ 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December' ], el: [ 'ΙαΜουάριος', 'Ίεβρουάριος', 'Μάρτιος', 'Απρίλιος', 'Μάιος', 'ΙούΜιος', 'Ιούλιος', 'Αύγουστος', 'ΣεπτέΌβριος', 'Οκτώβριος', 'ΝοέΌβριος', 'ΔεκέΌβριος' ], uk: [ 'СічеМь', 'ЛютОй', 'БерезеМь', 'КвітеМь', 'ТравеМь', 'ЧервеМь', 'ЛОпеМь', 'СерпеМь', 'ВересеМь', 'ЖПвтеМь', 'ЛОстПпаЎ', 'ГруЎеМь' ] }; const WEEK_DAYS_BY_LOCALE = { ru: [ 'ПМ', 'Вт', 'Ср', 'Чт', 'Пт', 'Сб', 'Вс' ], en: [ 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa', 'Su' ], el: [ 'Δε', '΀ρ', '΀ε', 'Πε', 'Πα', 'Σά', 'Κυ' ], uk: [ 'ПМ', 'Вт', 'Ср', 'Чт', 'Пт', 'Сб', 'НЎ' ] }; export default function UserProfilePage() { var _user_firstName, _user_lastName, _user_name_, _user_name, _user_siteSettings, _session_user; const { id } = useParams(); const { t, locale } = useLocale(); const { data: session } = useSession(); const router = useRouter(); const [user, setUser] = useState(null); const [reviews, setReviews] = useState([]); const [rating, setRating] = useState(null); const [loading, setLoading] = useState(true); const [specialistCards, setSpecialistCards] = useState([]); const [priceLists, setPriceLists] = useState({}); const [catMap, setCatMap] = useState(new Map()); const [locMap, setLocMap] = useState(new Map()); const [isFavorite, setIsFavorite] = useState(false); const [favLoading, setFavLoading] = useState(false); const [msgLoading, setMsgLoading] = useState(false); const [canMsg, setCanMsg] = useState(null); // Availability const now = new Date(); const [availYear, setAvailYear] = useState(now.getFullYear()); const [availMonth, setAvailMonth] = useState(now.getMonth()); const [availMap, setAvailMap] = useState({}); const today = new Date().toISOString().slice(0, 10); const dateLocale = locale === 'ru' ? 'ru-RU' : locale === 'uk' ? 'uk-UA' : locale === 'en' ? 'en-US' : 'el-GR'; useEffect(()=>{ if (!id) return; Promise.all([ getUserProfile(id, locale), getUserReviews(id), getUserRating(id), getCategories().catch(()=>[]), getLocations().catch(()=>[]) ]).then((param)=>{ let [u, r, rt, cats, locs] = param; setUser(u); setReviews(r); setRating(rt.avg); setCatMap(new Map(flattenTree(cats).map((c)=>[ c.slug, c ]))); setLocMap(new Map(flattenTree(locs).map((l)=>[ l.slug, l ]))); if (u.role === 'specialist' || u.role === 'admin') { getSpecialistCards(id, locale).then((cards)=>{ setSpecialistCards(cards); cards.forEach((c)=>{ getPriceList(c.id, locale).then((pl)=>{ if (pl.length > 0) setPriceLists((prev)=>({ ...prev, [c.id]: pl })); }).catch(()=>{}); }); }).catch(()=>{}); } }).catch(()=>{}).finally(()=>setLoading(false)); }, [ id, locale ]); // Load favorite status when session available useEffect(()=>{ var _session_user; if (!session || !id) return; getSpecialistFavorites().then((rows)=>setIsFavorite(rows.some((r)=>{ var _r_specialist; return ((_r_specialist = r.specialist) === null || _r_specialist === void 0 ? void 0 : _r_specialist.id) === id; }))).catch(()=>{}); // Check if current user can message this person const myId = (_session_user = session.user) === null || _session_user === void 0 ? void 0 : _session_user.id; if (myId && myId !== id) { getCanMessage(id).then(setCanMsg).catch(()=>{}); } }, [ session, id ]); async function toggleFavorite() { if (!session) { router.push('/register'); return; } setFavLoading(true); try { if (isFavorite) { await removeSpecialistFavorite(id); setIsFavorite(false); } else { await addSpecialistFavorite(id); setIsFavorite(true); } } catch (e) {} setFavLoading(false); } async function handleMessage() { if (!session) { router.push('/login'); return; } setMsgLoading(true); try { const { room } = await getOrCreateDirectRoom(id); router.push("/chat?room=".concat(room.id)); } catch (e) {} setMsgLoading(false); } useEffect(()=>{ if (!id) return; const monthKey = "".concat(availYear, "-").concat(String(availMonth + 1).padStart(2, '0')); getSpecialistAvailability(id, monthKey).then((rows)=>{ setAvailMap((prev)=>{ const next = { ...prev }; rows.forEach((r)=>{ next[r.date] = r.status; }); return next; }); }).catch(()=>{}); }, [ id, availYear, availMonth ]); if (loading) return /*#__PURE__*/ _jsx("div", { className: "text-center py-20 text-white", children: t('common.loading') }); if (!user) return /*#__PURE__*/ _jsx("div", { className: "text-center py-20 text-white/70", children: t('common.error') }); var _user_firstName_, _user_lastName_; const initials = "".concat((_user_firstName_ = (_user_firstName = user.firstName) === null || _user_firstName === void 0 ? void 0 : _user_firstName[0]) !== null && _user_firstName_ !== void 0 ? _user_firstName_ : '').concat((_user_lastName_ = (_user_lastName = user.lastName) === null || _user_lastName === void 0 ? void 0 : _user_lastName[0]) !== null && _user_lastName_ !== void 0 ? _user_lastName_ : '').toUpperCase() || ((_user_name = user.name) === null || _user_name === void 0 ? void 0 : (_user_name_ = _user_name[0]) === null || _user_name_ === void 0 ? void 0 : _user_name_.toUpperCase()) || '?'; const displayName = formatShortName(user.firstName, user.lastName, user.name); const profileBackgroundImage = typeof ((_user_siteSettings = user.siteSettings) === null || _user_siteSettings === void 0 ? void 0 : _user_siteSettings.profileBackgroundImage) === 'string' && user.siteSettings.profileBackgroundImage.trim().length > 0 ? user.siteSettings.profileBackgroundImage : null; return /*#__PURE__*/ _jsxs("div", { className: "max-w-3xl mx-auto px-4 py-10", children: [ /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6 mb-6", children: [ /*#__PURE__*/ _jsxs("div", { className: "relative -mx-6 -mt-6 mb-5 h-44 overflow-hidden rounded-t-xl", style: { backgroundImage: profileBackgroundImage ? "linear-gradient(135deg, rgba(21, 128, 61, 0.45), rgba(22, 163, 74, 0.65)), url(".concat(profileBackgroundImage, ")") : 'linear-gradient(135deg, #22c55e 0%, #16a34a 45%, #166534 100%)', backgroundSize: 'cover', backgroundPosition: 'center' }, children: [ /*#__PURE__*/ _jsx("div", { className: "absolute inset-0 bg-gradient-to-b from-black/10 to-black/30" }), /*#__PURE__*/ _jsxs("div", { className: "relative h-full w-full p-5 flex items-end justify-between", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 min-w-0", children: [ /*#__PURE__*/ _jsx("div", { className: "w-14 h-14 rounded-full bg-white/20 border border-white/40 overflow-hidden flex items-center justify-center text-white text-xl font-bold backdrop-blur-sm", children: user.image ? /*#__PURE__*/ _jsx("img", { src: user.image, alt: displayName, className: "w-full h-full object-cover" }) : initials }), /*#__PURE__*/ _jsxs("div", { className: "min-w-0", children: [ /*#__PURE__*/ _jsx("p", { className: "text-white text-lg font-bold truncate", children: displayName }), /*#__PURE__*/ _jsxs("p", { className: "text-white/85 text-xs", children: [ t('profile.member_since'), " ", new Date(user.createdAt).toLocaleDateString(dateLocale) ] }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "shrink-0", children: [ user.planTier && user.planTier !== 'free' && /*#__PURE__*/ _jsx(PlanBadge, { tier: user.planTier, verified: user.hasVerifiedBadge, size: "sm" }), user.hasVerifiedBadge && user.planTier === 'free' && /*#__PURE__*/ _jsx(PlanBadge, { tier: "free", verified: true, size: "sm" }) ] }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-start gap-5", children: [ /*#__PURE__*/ _jsx("div", { className: "w-20 h-20 rounded-full bg-green-100 flex-shrink-0 flex items-center justify-center text-green-700 text-2xl font-bold overflow-hidden border-2 border-gray-100", children: user.image ? /*#__PURE__*/ _jsx("img", { src: user.image, alt: displayName, className: "w-full h-full object-cover" }) : initials }), /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 flex-wrap mb-1", children: [ /*#__PURE__*/ _jsx("h1", { className: "text-xl font-bold text-gray-900", children: displayName }), user.planTier && user.planTier !== 'free' && /*#__PURE__*/ _jsx(PlanBadge, { tier: user.planTier, verified: user.hasVerifiedBadge, size: "sm" }), user.hasVerifiedBadge && user.planTier === 'free' && /*#__PURE__*/ _jsx(PlanBadge, { tier: "free", verified: true, size: "sm" }), Array.isArray(user.activeStatuses) && user.activeStatuses.includes('can_help_now') && /*#__PURE__*/ _jsxs("span", { className: "inline-flex items-center gap-1 text-xs font-medium text-green-700 bg-green-50 border border-green-200 px-2 py-0.5 rounded-full", children: [ /*#__PURE__*/ _jsx("span", { className: "w-1.5 h-1.5 rounded-full bg-green-500 animate-pulse" }), t('status.can_help_now', 'Available now') ] }), Array.isArray(user.activeStatuses) && user.activeStatuses.includes('need_help') && /*#__PURE__*/ _jsxs("span", { className: "inline-flex items-center gap-1 text-xs font-medium text-green-700 bg-green-50 border border-green-200 px-2 py-0.5 rounded-full", children: [ /*#__PURE__*/ _jsx("span", { className: "w-1.5 h-1.5 rounded-full bg-green-500" }), t('status.need_help', 'Need help') ] }), (session ? ((_session_user = session.user) === null || _session_user === void 0 ? void 0 : _session_user.id) !== id : true) && /*#__PURE__*/ _jsxs("div", { className: "ml-auto flex items-center gap-2", children: [ !session ? // Guest — show button that leads to registration /*#__PURE__*/ _jsxs("a", { href: "/register", className: "flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-sm font-medium bg-green-50 text-green-600 border border-green-200 hover:bg-green-100 transition", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }), /*#__PURE__*/ _jsx("span", { children: t('chat.write_btn', 'Write') }) ] }) : (canMsg === null || canMsg === void 0 ? void 0 : canMsg.allowed) === false ? /*#__PURE__*/ _jsx(UpgradePrompt, { feature: t('chat.write_btn', 'Write'), requiredTier: "pro", variant: "inline", t: t }) : /*#__PURE__*/ _jsxs("button", { onClick: handleMessage, disabled: msgLoading, className: "flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-sm font-medium bg-green-50 text-green-600 border border-green-200 hover:bg-green-100 transition disabled:opacity-50", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }), /*#__PURE__*/ _jsx("span", { children: t('chat.write_btn') }) ] }), /*#__PURE__*/ _jsxs("button", { onClick: toggleFavorite, disabled: favLoading, title: isFavorite ? t('specialist.unfavorite') : t('specialist.favorite'), className: "flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-sm font-medium transition disabled:opacity-50 ".concat(isFavorite ? 'bg-pink-50 text-pink-600 border border-pink-200 hover:bg-pink-100' : 'bg-gray-50 text-gray-600 border border-gray-200 hover:bg-gray-100'), children: [ /*#__PURE__*/ _jsx("span", { children: isFavorite ? '❀' : '🀍' }), /*#__PURE__*/ _jsx("span", { children: isFavorite ? t('specialist.unfavorite') : t('specialist.favorite') }) ] }) ] }) ] }), rating && /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-1.5 mb-2", children: [ /*#__PURE__*/ _jsx("span", { className: "text-yellow-400 text-lg", children: "★" }), /*#__PURE__*/ _jsx("span", { className: "font-semibold text-gray-800", children: Number(rating).toFixed(1) }), /*#__PURE__*/ _jsxs("span", { className: "text-sm text-gray-400", children: [ "(", reviews.length, " ", t('profile.reviews').toLowerCase(), ")" ] }) ] }), /*#__PURE__*/ _jsxs("p", { className: "text-sm text-gray-400", children: [ t('profile.member_since'), " ", new Date(user.createdAt).toLocaleDateString(dateLocale), user.lastSeenAt && /*#__PURE__*/ _jsxs("span", { className: "ml-2", children: [ "\xb7 ", formatLastSeen(user.lastSeenAt, t) ] }) ] }) ] }) ] }), user.bio && /*#__PURE__*/ _jsx("p", { className: "mt-4 text-gray-700 text-sm leading-relaxed border-t border-gray-100 pt-4", children: user.bio }), user.phone && /*#__PURE__*/ _jsxs("div", { className: "mt-4 border-t border-gray-100 pt-4 flex items-center gap-2", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M3 5a2 2 0 012-2h3.28a1 1 0 01.948.684l1.498 4.493a1 1 0 01-.502 1.21l-2.257 1.13a11.042 11.042 0 005.516 5.516l1.13-2.257a1 1 0 011.21-.502l4.493 1.498a1 1 0 01.684.949V19a2 2 0 01-2 2h-1C9.716 21 3 14.284 3 6V5z" }) }), /*#__PURE__*/ _jsx("a", { href: "tel:".concat(user.phone), className: "text-sm font-medium text-gray-700 hover:text-green-600", children: user.phone }) ] }), user.personalSiteSlug && /*#__PURE__*/ _jsxs("div", { className: "mt-3 flex items-center gap-2", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _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" }) }), /*#__PURE__*/ _jsxs("a", { href: "/site/".concat(user.personalSiteSlug), target: "_blank", rel: "noopener noreferrer", className: "text-sm text-green-600 hover:underline", children: [ "canhelp.gr/site/", user.personalSiteSlug ] }) ] }), user.languages && user.languages.length > 0 && /*#__PURE__*/ _jsxs("div", { className: "mt-4 border-t border-gray-100 pt-4", children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs font-medium text-gray-500 mb-2 uppercase tracking-wide", children: t('profile.languages') }), /*#__PURE__*/ _jsx("div", { className: "flex flex-wrap gap-2", children: user.languages.map((code)=>{ const langMap = { el: { flag: '🇬🇷', label: 'ΕλληΜικά' }, en: { flag: '🇬🇧', label: 'English' }, ru: { flag: '🇷🇺', label: 'РусскОй' }, uk: { flag: '🇺🇊', label: 'УкраїМська' }, de: { flag: '🇩🇪', label: 'Deutsch' }, fr: { flag: '🇫🇷', label: 'Français' }, it: { flag: '🇮🇹', label: 'Italiano' }, es: { flag: '🇪🇞', label: 'Español' }, ar: { flag: '🇞🇊', label: 'العرؚية' }, zh: { flag: '🇚🇳', label: 'äž­æ–‡' } }; const lang = langMap[code]; if (!lang) return null; return /*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-1.5 bg-indigo-50 text-indigo-700 text-sm px-3 py-1 rounded-full border border-indigo-100", children: [ /*#__PURE__*/ _jsx("span", { children: lang.flag }), /*#__PURE__*/ _jsx("span", { children: lang.label }) ] }, code); }) }) ] }), user.skills && user.skills.length > 0 && specialistCards.length === 0 && /*#__PURE__*/ _jsxs("div", { className: "mt-4 border-t border-gray-100 pt-4", children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs font-medium text-gray-500 mb-2 uppercase tracking-wide", children: t('profile.skills.label') }), /*#__PURE__*/ _jsx("div", { className: "flex flex-wrap gap-2", children: user.skills.map((skill)=>/*#__PURE__*/ _jsx("span", { className: "bg-green-50 text-green-700 text-sm px-3 py-1 rounded-full", children: skill }, skill)) }) ] }), user.role === 'specialist' && user.specialistCategories && user.specialistCategories.length > 0 && specialistCards.length === 0 && /*#__PURE__*/ _jsxs("div", { className: "mt-4 border-t border-gray-100 pt-4", children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs font-medium text-gray-500 mb-2 uppercase tracking-wide", children: t('user.categories') }), /*#__PURE__*/ _jsx("div", { className: "flex flex-wrap gap-2", children: user.specialistCategories.map((slug)=>/*#__PURE__*/ _jsx("span", { className: "bg-purple-50 text-purple-700 text-sm px-3 py-1 rounded-full", children: slug }, slug)) }) ] }), user.role === 'specialist' && user.specialistLocations && user.specialistLocations.length > 0 && specialistCards.length === 0 && /*#__PURE__*/ _jsxs("div", { className: "mt-4 border-t border-gray-100 pt-4", children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs font-medium text-gray-500 mb-2 uppercase tracking-wide", children: t('user.work_area') }), /*#__PURE__*/ _jsx("div", { className: "flex flex-wrap gap-2", children: user.specialistLocations.map((slug)=>/*#__PURE__*/ _jsxs("span", { className: "bg-emerald-50 text-emerald-700 text-sm px-3 py-1 rounded-full", children: [ "\uD83D\uDCCD ", slug ] }, slug)) }) ] }) ] }), user.role === 'specialist' && /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6 mb-6", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between mb-4", children: [ /*#__PURE__*/ _jsxs("h2", { className: "font-bold text-gray-900 text-lg", children: [ "\uD83D\uDCC5 ", t('nav.schedule') ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 text-xs text-gray-500", children: [ /*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-1.5", children: [ /*#__PURE__*/ _jsx("span", { className: "w-3 h-3 rounded bg-emerald-200 border border-emerald-400 inline-block" }), t('schedule.available') ] }), /*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-1.5", children: [ /*#__PURE__*/ _jsx("span", { className: "w-3 h-3 rounded bg-red-200 border border-red-400 inline-block" }), t('schedule.busy') ] }) ] }) ] }), /*#__PURE__*/ _jsx(ReadOnlyCalendar, { year: availYear, month: availMonth, availMap: availMap, today: today, onPrev: ()=>{ if (availMonth === 0) { setAvailYear((y)=>y - 1); setAvailMonth(11); } else setAvailMonth((m)=>m - 1); }, onNext: ()=>{ if (availMonth === 11) { setAvailYear((y)=>y + 1); setAvailMonth(0); } else setAvailMonth((m)=>m + 1); } }) ] }), (user.role === 'specialist' || user.role === 'admin') && specialistCards.length > 0 && /*#__PURE__*/ _jsxs("div", { className: "space-y-4 mb-6", children: [ /*#__PURE__*/ _jsx("h2", { className: "font-bold text-white text-lg", children: t('nav.specialists') }), specialistCards.map((card)=>{ var _priceLists_card_id; return /*#__PURE__*/ _jsx(PublicCardView, { card: card, locale: locale, catMap: catMap, locMap: locMap, t: t, priceList: (_priceLists_card_id = priceLists[card.id]) !== null && _priceLists_card_id !== void 0 ? _priceLists_card_id : [] }, card.id); }) ] }), /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ _jsxs("h2", { className: "font-bold text-gray-900 text-lg mb-4", children: [ t('profile.reviews'), reviews.length > 0 && /*#__PURE__*/ _jsxs("span", { className: "text-gray-400 font-normal text-base ml-2", children: [ "(", reviews.length, ")" ] }) ] }), reviews.length === 0 ? /*#__PURE__*/ _jsx("p", { className: "text-gray-500 text-sm", children: t('profile.no_reviews') }) : /*#__PURE__*/ _jsx("div", { className: "space-y-4", children: reviews.map((param)=>{ let { review, author } = param; var _author_name_, _author_name; var _author_name__toUpperCase, _shortName; return /*#__PURE__*/ _jsx("div", { className: "border-b border-gray-50 pb-4 last:border-0 last:pb-0", children: /*#__PURE__*/ _jsxs("div", { className: "flex items-start gap-3", children: [ /*#__PURE__*/ _jsx("div", { className: "w-8 h-8 rounded-full bg-gray-100 flex-shrink-0 flex items-center justify-center text-gray-600 text-sm font-bold overflow-hidden", children: (author === null || author === void 0 ? void 0 : author.image) ? /*#__PURE__*/ _jsx("img", { src: author.image, alt: author.name, className: "w-full h-full object-cover" }) : (_author_name__toUpperCase = author === null || author === void 0 ? void 0 : (_author_name = author.name) === null || _author_name === void 0 ? void 0 : (_author_name_ = _author_name[0]) === null || _author_name_ === void 0 ? void 0 : _author_name_.toUpperCase()) !== null && _author_name__toUpperCase !== void 0 ? _author_name__toUpperCase : '?' }), /*#__PURE__*/ _jsxs("div", { className: "flex-1", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 mb-1", children: [ /*#__PURE__*/ _jsx("span", { className: "text-sm font-medium text-gray-800", children: (_shortName = shortName(author === null || author === void 0 ? void 0 : author.name)) !== null && _shortName !== void 0 ? _shortName : '—' }), /*#__PURE__*/ _jsxs("span", { className: "text-yellow-400", children: [ '★'.repeat(review.rating), '☆'.repeat(5 - review.rating) ] }) ] }), review.comment && /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-600", children: review.comment }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-1", children: new Date(review.createdAt).toLocaleDateString(dateLocale) }) ] }) ] }) }, review.id); }) }) ] }) ] }); } function ReadOnlyCalendar(param) { let { year, month, availMap, today, onPrev, onNext } = param; const { locale, t } = useLocale(); var _WEEK_DAYS_BY_LOCALE_locale; const weekDays = (_WEEK_DAYS_BY_LOCALE_locale = WEEK_DAYS_BY_LOCALE[locale]) !== null && _WEEK_DAYS_BY_LOCALE_locale !== void 0 ? _WEEK_DAYS_BY_LOCALE_locale : WEEK_DAYS_BY_LOCALE.ru; var _MONTHS_BY_LOCALE_locale; const months = (_MONTHS_BY_LOCALE_locale = MONTHS_BY_LOCALE[locale]) !== null && _MONTHS_BY_LOCALE_locale !== void 0 ? _MONTHS_BY_LOCALE_locale : MONTHS_BY_LOCALE.ru; const firstDay = new Date(year, month, 1); const startDow = (firstDay.getDay() + 6) % 7; const daysInMonth = new Date(year, month + 1, 0).getDate(); const prevMonthDays = new Date(year, month, 0).getDate(); const cells = []; for(let i = startDow - 1; i >= 0; i--){ cells.push({ day: prevMonthDays - i, cur: false, dateKey: '' }); } for(let d = 1; d <= daysInMonth; d++){ const dateKey = "".concat(year, "-").concat(String(month + 1).padStart(2, '0'), "-").concat(String(d).padStart(2, '0')); cells.push({ day: d, cur: true, dateKey }); } const remainder = cells.length % 7; if (remainder !== 0) { for(let d = 1; d <= 7 - remainder; d++){ cells.push({ day: d, cur: false, dateKey: '' }); } } const monthPrefix = "".concat(year, "-").concat(String(month + 1).padStart(2, '0')); const availCount = Object.entries(availMap).filter((param)=>{ let [k, v] = param; return k.startsWith(monthPrefix) && k >= today && v === 'available'; }).length; return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between mb-3", children: [ /*#__PURE__*/ _jsx("button", { onClick: onPrev, className: "w-7 h-7 rounded-lg hover:bg-gray-100 flex items-center justify-center text-gray-500", children: "‹" }), /*#__PURE__*/ _jsxs("div", { className: "text-center", children: [ /*#__PURE__*/ _jsxs("span", { className: "font-medium text-gray-800 text-sm", children: [ months[month], " ", year ] }), availCount > 0 && /*#__PURE__*/ _jsxs("span", { className: "ml-2 text-xs text-emerald-600", children: [ availCount, " ", t('schedule.free_days') ] }) ] }), /*#__PURE__*/ _jsx("button", { onClick: onNext, className: "w-7 h-7 rounded-lg hover:bg-gray-100 flex items-center justify-center text-gray-500", children: "›" }) ] }), /*#__PURE__*/ _jsx("div", { className: "grid grid-cols-7 mb-1", children: weekDays.map((d)=>/*#__PURE__*/ _jsx("div", { className: "text-center text-xs text-gray-400 py-1", children: d }, d)) }), /*#__PURE__*/ _jsx("div", { className: "grid grid-cols-7 gap-0.5", children: cells.map((cell, idx)=>{ if (!cell.cur) { return /*#__PURE__*/ _jsx("div", { className: "h-9 flex items-center justify-center text-xs text-gray-200", children: cell.day }, "e-".concat(idx)); } const status = availMap[cell.dateKey]; const isPast = cell.dateKey < today; const isToday = cell.dateKey === today; let cls = 'h-9 flex items-center justify-center rounded-lg text-sm font-medium '; if (isPast) { cls += 'text-gray-200 '; } else if (status === 'available') { cls += 'bg-emerald-100 border border-emerald-300 text-emerald-700 '; } else if (status === 'busy') { cls += 'bg-red-100 border border-red-300 text-red-600 '; } else { cls += 'text-gray-500 '; } if (isToday) cls += 'ring-2 ring-blue-400 ring-offset-1 '; return /*#__PURE__*/ _jsx("div", { className: cls, children: cell.day }, cell.dateKey); }) }) ] }); } // ─── Public card view ───────────────────────────────────────────────────────── function flattenTree(nodes) { return nodes.flatMap((n)=>{ var _n_children; return [ n, ...flattenTree((_n_children = n.children) !== null && _n_children !== void 0 ? _n_children : []) ]; }); } function PublicCardView(param) { let { card, locale, catMap, locMap, t, priceList } = param; const [lightbox, setLightbox] = useState(null); const [expandedAreas, setExpandedAreas] = useState([]); const locById = new Map(); for (const node of locMap.values()){ if (node === null || node === void 0 ? void 0 : node.id) locById.set(node.id, node); } const getLocName = (loc, fallback)=>{ var _loc_names, _loc_names1; return (loc === null || loc === void 0 ? void 0 : (_loc_names = loc.names) === null || _loc_names === void 0 ? void 0 : _loc_names[locale]) || (loc === null || loc === void 0 ? void 0 : (_loc_names1 = loc.names) === null || _loc_names1 === void 0 ? void 0 : _loc_names1.el) || fallback; }; const locationGroups = (()=>{ const grouped = new Map(); var _card_locations; for (const slug of (_card_locations = card.locations) !== null && _card_locations !== void 0 ? _card_locations : []){ const loc = locMap.get(slug); if (!loc) { if (!grouped.has(slug)) { grouped.set(slug, { root: { slug, names: { el: slug } }, rootSlug: slug, districts: [], districtSlugs: new Set() }); } continue; } let root = loc; const seenIds = new Set(); while((root === null || root === void 0 ? void 0 : root.parentId) && locById.has(root.parentId) && !seenIds.has(root.parentId)){ seenIds.add(root.parentId); root = locById.get(root.parentId); } var _root_slug; const rootSlug = (_root_slug = root === null || root === void 0 ? void 0 : root.slug) !== null && _root_slug !== void 0 ? _root_slug : slug; if (!grouped.has(rootSlug)) { grouped.set(rootSlug, { root, rootSlug, districts: [], districtSlugs: new Set() }); } const group = grouped.get(rootSlug); if (loc.slug !== rootSlug && !group.districtSlugs.has(loc.slug)) { group.districtSlugs.add(loc.slug); group.districts.push(loc); } } return Array.from(grouped.values()); })(); var _lightbox_title; return /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 overflow-hidden", children: [ /*#__PURE__*/ _jsxs("div", { className: "px-5 py-4 border-b border-gray-100", children: [ /*#__PURE__*/ _jsx("h3", { className: "font-bold text-gray-900", children: card.title }), card.description && /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-600 mt-1", children: card.description }) ] }), /*#__PURE__*/ _jsxs("div", { className: "p-5 space-y-4", children: [ card.skills && card.skills.length > 0 && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs font-semibold text-gray-500 uppercase tracking-wide mb-2", children: t('card.skills') }), /*#__PURE__*/ _jsx("div", { className: "flex flex-wrap gap-2", children: card.skills.map((s)=>/*#__PURE__*/ _jsx("span", { className: "bg-green-50 text-green-700 text-sm px-3 py-1 rounded-full", children: s }, s)) }) ] }), card.categories && card.categories.length > 0 && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs font-semibold text-gray-500 uppercase tracking-wide mb-2", children: t('card.categories') }), /*#__PURE__*/ _jsx("div", { className: "flex flex-wrap gap-2", children: card.categories.map((s)=>{ var _cat_names, _cat_names1; const cat = catMap.get(s); const name = cat ? ((_cat_names = cat.names) === null || _cat_names === void 0 ? void 0 : _cat_names[locale]) || ((_cat_names1 = cat.names) === null || _cat_names1 === void 0 ? void 0 : _cat_names1.el) || s : s; return /*#__PURE__*/ _jsxs("span", { className: "bg-purple-50 text-purple-700 text-sm px-3 py-1 rounded-full", children: [ (cat === null || cat === void 0 ? void 0 : cat.icon) ? /*#__PURE__*/ _jsx("span", { className: "mr-1 inline-flex align-middle", children: /*#__PURE__*/ _jsx(CategoryIcon, { icon: cat.icon, alt: name, className: isCategoryIconUrl(cat.icon) ? 'h-4 w-4 object-contain' : 'text-sm leading-none', fallback: "\uD83D\uDCE6" }) }) : null, name ] }, s); }) }) ] }), card.locations && card.locations.length > 0 && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs font-semibold text-gray-500 uppercase tracking-wide mb-2", children: t('user.work_area') }), /*#__PURE__*/ _jsxs("div", { className: "space-y-2", children: [ /*#__PURE__*/ _jsx("div", { className: "flex flex-wrap gap-2", children: locationGroups.map((group)=>{ const expanded = expandedAreas.includes(group.rootSlug); const canExpand = group.districts.length > 0; return /*#__PURE__*/ _jsxs("button", { type: "button", onClick: ()=>{ if (!canExpand) return; setExpandedAreas((prev)=>prev.includes(group.rootSlug) ? prev.filter((slug)=>slug !== group.rootSlug) : [ ...prev, group.rootSlug ]); }, className: "inline-flex items-center gap-1.5 text-sm px-3 py-1.5 rounded-full border transition ".concat(expanded ? 'bg-emerald-100 text-emerald-800 border-emerald-300' : 'bg-emerald-50 text-emerald-700 border-emerald-200 hover:bg-emerald-100', " ").concat(canExpand ? 'cursor-pointer' : 'cursor-default'), children: [ /*#__PURE__*/ _jsx("span", { children: "\uD83D\uDCCD" }), /*#__PURE__*/ _jsx("span", { children: getLocName(group.root, group.rootSlug) }), canExpand && /*#__PURE__*/ _jsx("span", { className: "text-[11px] font-semibold px-1.5 py-0.5 rounded-full bg-white/80 text-emerald-700 border border-emerald-200", children: expanded ? '−' : "+".concat(group.districts.length) }) ] }, group.rootSlug); }) }), locationGroups.filter((group)=>expandedAreas.includes(group.rootSlug) && group.districts.length > 0).map((group)=>/*#__PURE__*/ _jsxs("div", { className: "rounded-xl border border-emerald-100 bg-emerald-50/40 p-3", children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs text-emerald-700 font-medium mb-2", children: getLocName(group.root, group.rootSlug) }), /*#__PURE__*/ _jsx("div", { className: "flex flex-wrap gap-1.5", children: group.districts.map((district)=>/*#__PURE__*/ _jsx("span", { className: "text-xs px-2.5 py-1 rounded-full bg-white border border-emerald-200 text-emerald-700", children: getLocName(district, district.slug) }, district.slug)) }) ] }, "".concat(group.rootSlug, "-children"))) ] }) ] }), priceList.length > 0 && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs font-semibold text-gray-500 uppercase tracking-wide mb-3", children: t('profile.card.tab.pricelist') }), /*#__PURE__*/ _jsx("div", { className: "space-y-3", children: priceList.map((group)=>/*#__PURE__*/ _jsxs("div", { className: "border border-gray-200 rounded-xl overflow-hidden", children: [ /*#__PURE__*/ _jsx("div", { className: "bg-gray-50 px-4 py-2 border-b border-gray-200", children: /*#__PURE__*/ _jsx("span", { className: "font-semibold text-sm text-gray-800", children: group.title }) }), /*#__PURE__*/ _jsx("div", { className: "divide-y divide-gray-100", children: group.items.map((item)=>/*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 px-4 py-2.5 text-sm", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ _jsx("p", { className: "font-medium text-gray-800", children: item.name }), item.description && /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-500", children: item.description }) ] }), (item.price || item.unit) && /*#__PURE__*/ _jsxs("span", { className: "text-green-700 font-semibold whitespace-nowrap", children: [ item.price ? "€".concat(item.price) : '', item.unit ? " ".concat(item.unit) : '' ] }) ] }, item.id)) }) ] }, group.id)) }) ] }), card.portfolio && card.portfolio.length > 0 && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs font-semibold text-gray-500 uppercase tracking-wide mb-2", children: t('card.portfolio') }), /*#__PURE__*/ _jsx("div", { className: "grid grid-cols-2 sm:grid-cols-3 gap-3", children: card.portfolio.map((item)=>{ var _item_title; return /*#__PURE__*/ _jsxs("button", { type: "button", onClick: ()=>setLightbox(item), className: "group relative rounded-xl overflow-hidden border border-gray-200 bg-gray-50 text-left", children: [ /*#__PURE__*/ _jsx("img", { src: item.imageUrl, alt: (_item_title = item.title) !== null && _item_title !== void 0 ? _item_title : '', className: "w-full aspect-square object-cover group-hover:scale-105 transition-transform duration-200" }), item.title && /*#__PURE__*/ _jsx("div", { className: "px-2 py-1.5", children: /*#__PURE__*/ _jsx("p", { className: "text-xs font-medium text-gray-700 truncate", children: item.title }) }) ] }, item.id); }) }) ] }) ] }), lightbox && /*#__PURE__*/ _jsx("div", { className: "fixed inset-0 z-50 flex items-center justify-center bg-black/80 px-4", onClick: ()=>setLightbox(null), children: /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-2xl overflow-hidden max-w-lg w-full shadow-2xl", onClick: (e)=>e.stopPropagation(), children: [ /*#__PURE__*/ _jsx("img", { src: lightbox.imageUrl, alt: (_lightbox_title = lightbox.title) !== null && _lightbox_title !== void 0 ? _lightbox_title : '', className: "w-full max-h-[60vh] object-contain bg-gray-900" }), (lightbox.title || lightbox.description) && /*#__PURE__*/ _jsxs("div", { className: "p-4", children: [ lightbox.title && /*#__PURE__*/ _jsx("p", { className: "font-semibold text-gray-800 mb-1", children: lightbox.title }), lightbox.description && /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-600", children: lightbox.description }) ] }), /*#__PURE__*/ _jsx("div", { className: "flex justify-end px-4 pb-4", children: /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setLightbox(null), className: "text-sm text-gray-500 hover:text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-100", children: t('card.close') }) }) ] }) }) ] }); } åR61123undefined125168undefined170224undefined226270undefined272311undefined313587undefined589647undefined649710undefined712765undefined767817undefined819894undefined23812395undefined25452553__WEBPACK_MODULE_REFERENCE__2_5b22757365506172616d73225d_call_directImport_asiSafe1__._undefined25842592__WEBPACK_MODULE_REFERENCE__3_5b227573654c6f63616c65225d_call_directImport_asiSafe1__._undefined26272636__WEBPACK_MODULE_REFERENCE__4_5b2275736553657373696f6e225d_call_directImport_asiSafe1__._undefined26602668__WEBPACK_MODULE_REFERENCE__2_5b22757365526f75746572225d_call_directImport_asiSafe1__._undefined27012708__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined27512758__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined27972804__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined28472854__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined29132920__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined29672974__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined30133020__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined30663073__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined31273134__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined31843191__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined32413248__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined32903297__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined33923399__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined34613468__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined35233530__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined37143722__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined37893802__WEBPACK_MODULE_REFERENCE__5_5b226765745573657250726f66696c65225d_call_directImport_asiSafe1__._undefined38293842__WEBPACK_MODULE_REFERENCE__5_5b226765745573657252657669657773225d_call_directImport_asiSafe1__._undefined38613873__WEBPACK_MODULE_REFERENCE__5_5b2267657455736572526174696e67225d_call_directImport_asiSafe1__._undefined38923904__WEBPACK_MODULE_REFERENCE__5_5b2267657443617465676f72696573225d_call_directImport_asiSafe1__._undefined39353946__WEBPACK_MODULE_REFERENCE__5_5b226765744c6f636174696f6e73225d_call_directImport_asiSafe1__._undefined44644481__WEBPACK_MODULE_REFERENCE__5_5b226765745370656369616c6973744361726473225d_call_directImport_asiSafe1__._undefined46234634__WEBPACK_MODULE_REFERENCE__5_5b2267657450726963654c697374225d_call_directImport_asiSafe1__._undefined51345142__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined52225243__WEBPACK_MODULE_REFERENCE__5_5b226765745370656369616c6973744661766f7269746573225d_call_directImport_asiSafe1__._undefined57095721__WEBPACK_MODULE_REFERENCE__5_5b2267657443616e4d657373616765225d_call_directImport_asiSafe1__._undefined60386061__WEBPACK_MODULE_REFERENCE__5_5b2272656d6f76655370656369616c6973744661766f72697465225d_call_directImport_asiSafe1__._undefined61496169__WEBPACK_MODULE_REFERENCE__5_5b226164645370656369616c6973744661766f72697465225d_call_directImport_asiSafe1__._undefined64906510__WEBPACK_MODULE_REFERENCE__5_5b226765744f72437265617465446972656374526f6f6d225d_call_directImport_asiSafe1__._undefined66366644__WEBPACK_MODULE_REFERENCE__1_5b22757365456666656374225d_call_directImport_asiSafe1__._undefined67856809__WEBPACK_MODULE_REFERENCE__5_5b226765745370656369616c697374417661696c6162696c697479225d_call_directImport_asiSafe1__._undefined72297232__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined73767379__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined81658179__WEBPACK_MODULE_REFERENCE__8_5b22666f726d617453686f72744e616d65225d_call_directImport_asiSafe1__._undefined85558559__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined86678671__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined88268830__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined94439446__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined96369640__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined98499853__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1006010063__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1037410377__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1078710791__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1099811001__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1131811322__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1210112105__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1233412337__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1233912347__WEBPACK_MODULE_REFERENCE__10_5b22506c616e4261646765225d_directImport_asiSafe1__._undefined1272012723__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1272512733__WEBPACK_MODULE_REFERENCE__10_5b22506c616e4261646765225d_directImport_asiSafe1__._undefined1320013204__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1335413357__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1364113644__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1395813962__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1412814132__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1434614349__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1467414677__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1467914687__WEBPACK_MODULE_REFERENCE__10_5b22506c616e4261646765225d_directImport_asiSafe1__._undefined1506015063__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1506515073__WEBPACK_MODULE_REFERENCE__10_5b22506c616e4261646765225d_directImport_asiSafe1__._undefined1545515459__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1578615789__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1631116315__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1664216645__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1719017194__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1753817542__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined1798817991__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1851018513__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1914619149__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1953319536__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined1953819550__WEBPACK_MODULE_REFERENCE__7_5b225570677261646550726f6d7074225d_directImport_asiSafe1__._undefined1993419938__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2049220495__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2101421017__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2165021653__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2200222006__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2278222785__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2303423037__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2360523609__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2381523818__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2408424087__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2437924383__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2509425098__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2553325537__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2578925802__WEBPACK_MODULE_REFERENCE__9_5b22666f726d61744c6173745365656e225d_call_directImport_asiSafe1__._undefined2616326166__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2640126405__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2659126594__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2694426947__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2744427447__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2781527819__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2797527978__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2832828331__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2869128695__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2933129335__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined2949729500__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined2975729760__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3226332267__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3255432557__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3274332746__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3318533189__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3335133354__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3361433617__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3377633779__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3425234256__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3441834421__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3467634679__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3485134854__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3532535329__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3549135494__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3574835751__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3592235926__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3647436478__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3663336637__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3680336807__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3715437158__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3735537359__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3756137564__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3795537959__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3816138164__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3864038643__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined3957639580__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined3969839701__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4000140004__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4050340507__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4065740661__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4089640900__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4134841351__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4151741520__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4187741880__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4204642050__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4223642239__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4256942572__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4329843302__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4349643500__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4374043743__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4394743955__WEBPACK_MODULE_REFERENCE__8_5b2273686f72744e616d65225d_call_directImport_asiSafe1__._undefined4420244206__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4487244875__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4516345166__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4587445882__WEBPACK_MODULE_REFERENCE__3_5b227573654c6f63616c65225d_call_directImport_asiSafe1__._undefined4755647560__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4761747621__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4776347766__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4803948043__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4818248186__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4858148585__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined4901549018__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4931649319__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4944049443__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4963649639__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined4983849841__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5093250935__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5158551592__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined5164751654__WEBPACK_MODULE_REFERENCE__1_5b227573655374617465225d_call_directImport_asiSafe1__._undefined5409754101__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5423954243__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5438154384__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5457954582__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5479054794__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5495254956__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5504555048__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5530155304__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5545955462__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5584555849__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5593855941__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5619856201__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5678156785__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5707657079__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5725557258__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5726057271__WEBPACK_MODULE_REFERENCE__11_5b2243617465676f727949636f6e225d_directImport_asiSafe1__._undefined5747057486__WEBPACK_MODULE_REFERENCE__11_5b22697343617465676f727949636f6e55726c225d_call_directImport_asiSafe1__._undefined5806558069__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5815858161__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5841758421__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined5858258585__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined5900759011__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined6012260125__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6034060343__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6059560598__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6132261326__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined6157161574__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6190661909__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6211762120__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6282662830__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined6291962922__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6319063193__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6333963343__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined6356863571__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6376263765__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6411064113__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6430764311__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined6457864582__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined6484464847__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6523465237__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6575765761__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined6674466748__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined6683766840__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6709667099__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6737567379__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined6777167774__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6825968262__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6841968422__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6898968992__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6919069194__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined6942869431__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined6982369827__WEBPACK_MODULE_REFERENCE__0_5b226a737873225d_call_directImport_asiSafe1__._undefined6998869991__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7025070253__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7053270535__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined7066770670__WEBPACK_MODULE_REFERENCE__0_5b226a7378225d_call_directImport_asiSafe1__._undefined(!17061792(0,navigation.useParams)undefined18231909(0,context_locale/* useLocale */.Y)undefined19442032(0,auth/* useSession */.wV)undefined20562142(0,navigation.useRouter)undefined21752259(0,react.useState)undefined23022386(0,react.useState)undefined24252509(0,react.useState)undefined25522636(0,react.useState)undefined26952779(0,react.useState)undefined28262910(0,react.useState)undefined29493033(0,react.useState)undefined30793163(0,react.useState)undefined32173301(0,react.useState)undefined33513435(0,react.useState)undefined34853569(0,react.useState)undefined36113695(0,react.useState)undefined37903874(0,react.useState)undefined39364020(0,react.useState)undefined40754159(0,react.useState)undefined43434429(0,react.useEffect)undefined44964592(0,api/* getUserProfile */.VM)undefined46194715(0,api/* getUserReviews */.v9)undefined47344828(0,api/* getUserRating */.Bm)undefined48474941(0,api/* getCategories */.bW)undefined49725064(0,api/* getLocations */.Vs)undefined55825686(0,api/* getSpecialistCards */.Bq)undefined58285920(0,api/* getPriceList */.Ck)undefined64206506(0,react.useEffect)undefined65866698(0,api/* getSpecialistFavorites */.pD)undefined71647258(0,api/* getCanMessage */.On)undefined75757691(0,api/* removeSpecialistFavorite */.sD)undefined77797889(0,api/* addSpecialistFavorite */.V)undefined82108320(0,api/* getOrCreateDirectRoom */.QN)undefined84468532(0,react.useEffect)undefined86738791(0,api/* getSpecialistAvailability */.Xz)undefined92119285(0,jsx_runtime.jsx)undefined94299503(0,jsx_runtime.jsx)undefined1028910387(0,formatName/* formatShortName */.H)undefined1076310839(0,jsx_runtime.jsxs)undefined1094711023(0,jsx_runtime.jsxs)undefined1117811254(0,jsx_runtime.jsxs)undefined1186711941(0,jsx_runtime.jsx)undefined1213112207(0,jsx_runtime.jsxs)undefined1241612492(0,jsx_runtime.jsxs)undefined1269912773(0,jsx_runtime.jsx)undefined1308413158(0,jsx_runtime.jsx)undefined1356813644(0,jsx_runtime.jsxs)undefined1385113925(0,jsx_runtime.jsx)undefined1424214318(0,jsx_runtime.jsxs)undefined1509715173(0,jsx_runtime.jsxs)undefined1540215476(0,jsx_runtime.jsx)undefined1547815560PlanBadge/* PlanBadge */.dundefined1593316007(0,jsx_runtime.jsx)undefined1600916091PlanBadge/* PlanBadge */.dundefined1655816634(0,jsx_runtime.jsxs)undefined1678416858(0,jsx_runtime.jsx)undefined1714217216(0,jsx_runtime.jsx)undefined1753017606(0,jsx_runtime.jsxs)undefined1777217848(0,jsx_runtime.jsxs)undefined1806218136(0,jsx_runtime.jsx)undefined1846118535(0,jsx_runtime.jsx)undefined1853718619PlanBadge/* PlanBadge */.dundefined1899219066(0,jsx_runtime.jsx)undefined1906819150PlanBadge/* PlanBadge */.dundefined1953219608(0,jsx_runtime.jsxs)undefined1993520009(0,jsx_runtime.jsx)undefined2053120607(0,jsx_runtime.jsxs)undefined2093421008(0,jsx_runtime.jsx)undefined2155321629(0,jsx_runtime.jsxs)undefined2197322049(0,jsx_runtime.jsxs)undefined2249522569(0,jsx_runtime.jsx)undefined2308823162(0,jsx_runtime.jsx)undefined2379523869(0,jsx_runtime.jsx)undefined2425324327(0,jsx_runtime.jsx)undefined2432924418UpgradePromptundefined2480224878(0,jsx_runtime.jsxs)undefined2543225506(0,jsx_runtime.jsx)undefined2602526099(0,jsx_runtime.jsx)undefined2673226806(0,jsx_runtime.jsx)undefined2715527231(0,jsx_runtime.jsxs)undefined2800728081(0,jsx_runtime.jsx)undefined2833028404(0,jsx_runtime.jsx)undefined2897229048(0,jsx_runtime.jsxs)undefined2925429328(0,jsx_runtime.jsx)undefined2959429668(0,jsx_runtime.jsx)undefined2996030036(0,jsx_runtime.jsxs)undefined3074730823(0,jsx_runtime.jsxs)undefined3125831334(0,jsx_runtime.jsxs)undefined3158631682(0,formatLastSeen/* formatLastSeen */.V)undefined3204332117(0,jsx_runtime.jsx)undefined3235232428(0,jsx_runtime.jsxs)undefined3261432688(0,jsx_runtime.jsx)undefined3303833112(0,jsx_runtime.jsx)undefined3360933683(0,jsx_runtime.jsx)undefined3405134127(0,jsx_runtime.jsxs)undefined3428334357(0,jsx_runtime.jsx)undefined3470734781(0,jsx_runtime.jsx)undefined3514135217(0,jsx_runtime.jsxs)undefined3585335929(0,jsx_runtime.jsxs)undefined3609136165(0,jsx_runtime.jsx)undefined3642236496(0,jsx_runtime.jsx)undefined3899939075(0,jsx_runtime.jsxs)undefined3936239436(0,jsx_runtime.jsx)undefined3962239696(0,jsx_runtime.jsx)undefined4013540211(0,jsx_runtime.jsxs)undefined4037340447(0,jsx_runtime.jsx)undefined4070740781(0,jsx_runtime.jsx)undefined4094041014(0,jsx_runtime.jsx)undefined4148741563(0,jsx_runtime.jsxs)undefined4172541799(0,jsx_runtime.jsx)undefined4205442128(0,jsx_runtime.jsx)undefined4230042374(0,jsx_runtime.jsx)undefined4284542921(0,jsx_runtime.jsxs)undefined4308343157(0,jsx_runtime.jsx)undefined4341143485(0,jsx_runtime.jsx)undefined4365643732(0,jsx_runtime.jsxs)undefined4428044356(0,jsx_runtime.jsxs)undefined4451144587(0,jsx_runtime.jsxs)undefined4475344829(0,jsx_runtime.jsxs)undefined4517645252(0,jsx_runtime.jsxs)undefined4544945525(0,jsx_runtime.jsxs)undefined4572745801(0,jsx_runtime.jsx)undefined4619246268(0,jsx_runtime.jsxs)undefined4647046544(0,jsx_runtime.jsx)undefined4702047094(0,jsx_runtime.jsx)undefined4802748103(0,jsx_runtime.jsxs)undefined4822148295(0,jsx_runtime.jsx)undefined4859548669(0,jsx_runtime.jsx)undefined4916849244(0,jsx_runtime.jsxs)undefined4939449470(0,jsx_runtime.jsxs)undefined4970549781(0,jsx_runtime.jsxs)undefined5022950303(0,jsx_runtime.jsx)undefined5046950543(0,jsx_runtime.jsx)undefined5090050974(0,jsx_runtime.jsx)undefined5114051216(0,jsx_runtime.jsxs)undefined5140251476(0,jsx_runtime.jsx)undefined5180651880(0,jsx_runtime.jsx)undefined5260652682(0,jsx_runtime.jsxs)undefined5287652952(0,jsx_runtime.jsxs)undefined5319253266(0,jsx_runtime.jsx)undefined5347053556(0,formatName/* shortName */.E)undefined5380353879(0,jsx_runtime.jsxs)undefined5454554619(0,jsx_runtime.jsx)undefined5490754981(0,jsx_runtime.jsx)undefined5568955775(0,context_locale/* useLocale */.Y)undefined5744957525(0,jsx_runtime.jsxs)undefined5758257658(0,jsx_runtime.jsxs)undefined5780057874(0,jsx_runtime.jsx)undefined5814758223(0,jsx_runtime.jsxs)undefined5836258438(0,jsx_runtime.jsxs)undefined5883358909(0,jsx_runtime.jsxs)undefined5933959413(0,jsx_runtime.jsx)undefined5971159785(0,jsx_runtime.jsx)undefined5990659980(0,jsx_runtime.jsx)undefined6017360247(0,jsx_runtime.jsx)undefined6044660520(0,jsx_runtime.jsx)undefined6161161685(0,jsx_runtime.jsx)undefined6233562419(0,react.useState)undefined6247462558(0,react.useState)undefined6500165077(0,jsx_runtime.jsxs)undefined6521565291(0,jsx_runtime.jsxs)undefined6542965503(0,jsx_runtime.jsx)undefined6569865772(0,jsx_runtime.jsx)undefined6598066056(0,jsx_runtime.jsxs)undefined6621466290(0,jsx_runtime.jsxs)undefined6637966453(0,jsx_runtime.jsx)undefined6670666780(0,jsx_runtime.jsx)undefined6693567009(0,jsx_runtime.jsx)undefined6739267468(0,jsx_runtime.jsxs)undefined6755767631(0,jsx_runtime.jsx)undefined6788867962(0,jsx_runtime.jsx)undefined6854268618(0,jsx_runtime.jsxs)undefined6890968983(0,jsx_runtime.jsx)undefined6915969233(0,jsx_runtime.jsx)undefined6923569323CategoryIcon/* CategoryIcon */.Ezundefined6952269625(0,CategoryIcon/* isCategoryIconUrl */.V)undefined7020470280(0,jsx_runtime.jsxs)undefined7036970443(0,jsx_runtime.jsx)undefined7069970775(0,jsx_runtime.jsxs)undefined7093671010(0,jsx_runtime.jsx)undefined7143271508(0,jsx_runtime.jsxs)undefined7261972693(0,jsx_runtime.jsx)undefined7290872982(0,jsx_runtime.jsx)undefined7323473308(0,jsx_runtime.jsx)undefined7403274108(0,jsx_runtime.jsxs)undefined7435374427(0,jsx_runtime.jsx)undefined7475974833(0,jsx_runtime.jsx)undefined7504175115(0,jsx_runtime.jsx)undefined7582175897(0,jsx_runtime.jsxs)undefined7598676060(0,jsx_runtime.jsx)undefined7632876402(0,jsx_runtime.jsx)undefined7654876624(0,jsx_runtime.jsxs)undefined7684976923(0,jsx_runtime.jsx)undefined7711477188(0,jsx_runtime.jsx)undefined7753377607(0,jsx_runtime.jsx)undefined7780177877(0,jsx_runtime.jsxs)undefined7814478220(0,jsx_runtime.jsxs)undefined7848278556(0,jsx_runtime.jsx)undefined7894379017(0,jsx_runtime.jsx)undefined7953779613(0,jsx_runtime.jsxs)undefined8059680672(0,jsx_runtime.jsxs)undefined8076180835(0,jsx_runtime.jsx)undefined8109181165(0,jsx_runtime.jsx)undefined8144181517(0,jsx_runtime.jsxs)undefined8190981983(0,jsx_runtime.jsx)undefined8246882542(0,jsx_runtime.jsx)undefined8269982773(0,jsx_runtime.jsx)undefined8334083414(0,jsx_runtime.jsx)undefined8361283688(0,jsx_runtime.jsxs)undefined8392283996(0,jsx_runtime.jsx)undefined8438884464(0,jsx_runtime.jsxs)undefined8462584699(0,jsx_runtime.jsx)undefined8495885032(0,jsx_runtime.jsx)undefined8531185385(0,jsx_runtime.jsx)undefined8551785591(0,jsx_runtime.jsx)undefinedâã, /***/ 2035:  R?«webpack/lib/util/registerExternalSerializerœwebpack-sources/ConcatSource€«webpack/lib/util/registerExternalSerializer™webpack-sources/RawSource_/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; «webpack/lib/util/registerExternalSerializerœwebpack-sources/CachedSource A«webpack/lib/util/registerExternalSerializerœwebpack-sources/ConcatSource€«webpack/lib/util/registerExternalSerializer™webpack-sources/RawSourceú/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ d: () => (/* binding */ PlanBadge) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); «webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourceimport { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; const tierConfig = { free: { label: 'Free', class: 'bg-gray-100 text-gray-500 border border-gray-200', icon: '' }, pro: { label: 'Pro', class: 'bg-green-100 text-green-700 border border-green-200', icon: /*#__PURE__*/ _jsx("svg", { viewBox: "0 0 16 16", fill: "none", className: "w-3 h-3 inline-block mr-0.5 -mt-px", children: /*#__PURE__*/ _jsx("path", { d: "M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z", fill: "currentColor" }) }) }, ultimate: { label: 'Ultimate', class: 'bg-gradient-to-r from-amber-400 via-yellow-400 to-amber-400 text-gray-900 border border-amber-500 shadow-sm shadow-amber-300/50', icon: /*#__PURE__*/ _jsx("svg", { viewBox: "0 0 16 16", fill: "none", className: "w-3 h-3 inline-block mr-0.5 -mt-px", children: /*#__PURE__*/ _jsx("path", { d: "M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z", fill: "currentColor" }) }) } }; export function PlanBadge(param) { let { tier, verified, size = 'sm', className = '' } = param; if (tier === 'free' && !verified) return null; const sizeClass = size === 'sm' ? 'text-[10px] px-1.5 py-0.5' : 'text-xs px-2 py-0.5'; if (verified && tier !== 'free') { return /*#__PURE__*/ _jsxs("span", { className: "inline-flex items-center gap-1 rounded-full font-semibold ".concat(sizeClass, " ").concat(tierConfig[tier].class, " ").concat(className), children: [ tier === 'ultimate' ? /*#__PURE__*/ _jsx(StarIcon, { className: "w-3 h-3 fill-gray-900" }) : /*#__PURE__*/ _jsx(VerifiedIcon, { className: "w-3 h-3" }), tierConfig[tier].label ] }); } if (verified) { return /*#__PURE__*/ _jsx("span", { className: "inline-flex items-center gap-0.5 rounded-full font-semibold ".concat(sizeClass, " bg-green-100 text-green-700 border border-green-200 ").concat(className), children: /*#__PURE__*/ _jsx(VerifiedIcon, { className: "w-3 h-3" }) }); } const cfg = tierConfig[tier]; return /*#__PURE__*/ _jsxs("span", { className: "inline-flex items-center rounded-full font-semibold ".concat(sizeClass, " ").concat(cfg.class, " ").concat(className), children: [ tier === 'pro' && /*#__PURE__*/ _jsx(StarIcon, { className: "w-3 h-3 mr-0.5 -mt-px" }), tier === 'ultimate' && /*#__PURE__*/ _jsx(StarIcon, { className: "w-3 h-3 mr-0.5 -mt-px fill-gray-900" }), cfg.label ] }); } function StarIcon(param) { let { className = '' } = param; return /*#__PURE__*/ _jsx("svg", { viewBox: "0 0 16 16", fill: "none", className: className, children: /*#__PURE__*/ _jsx("path", { d: "M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z", fill: "currentColor" }) }); } function VerifiedIcon(param) { let { className = '' } = param; return /*#__PURE__*/ _jsxs("svg", { viewBox: "0 0 16 16", fill: "none", className: className, children: [ /*#__PURE__*/ _jsx("path", { d: "M8 1l2 1.4 2.4-.4 1 2.2 2 1.2-.4 2.4L16 10l-1.8 1.6.4 2.4-2.2.8L10.8 17 8 16.2 5.2 17l-1.2-2.2-2.2-.8.4-2.4L0 10l1-2.2-.4-2.4 2-1.2 1-2.2 2.4.4L8 1z", fill: "#3B82F6" }), /*#__PURE__*/ _jsx("path", { d: "M5.5 8.5l1.5 1.5 3-3", stroke: "white", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) ] }); } b>_VYŽ‘9<ïõ%)#&Ž‘X[? B Õ Ù ° ³ 5 8   ™ œ • ™ C$'(+€¶(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)ÿÿÿ€·(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)þþþþÿþþþþÿþþ€†buffer†source„size„maps„hash /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ d: () => (/* binding */ PlanBadge) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); const tierConfig = { free: { label: 'Free', class: 'bg-gray-100 text-gray-500 border border-gray-200', icon: '' }, pro: { label: 'Pro', class: 'bg-green-100 text-green-700 border border-green-200', icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { viewBox: "0 0 16 16", fill: "none", className: "w-3 h-3 inline-block mr-0.5 -mt-px", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z", fill: "currentColor" }) }) }, ultimate: { label: 'Ultimate', class: 'bg-gradient-to-r from-amber-400 via-yellow-400 to-amber-400 text-gray-900 border border-amber-500 shadow-sm shadow-amber-300/50', icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { viewBox: "0 0 16 16", fill: "none", className: "w-3 h-3 inline-block mr-0.5 -mt-px", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z", fill: "currentColor" }) }) } }; function PlanBadge(param) { let { tier, verified, size = 'sm', className = '' } = param; if (tier === 'free' && !verified) return null; const sizeClass = size === 'sm' ? 'text-[10px] px-1.5 py-0.5' : 'text-xs px-2 py-0.5'; if (verified && tier !== 'free') { return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "inline-flex items-center gap-1 rounded-full font-semibold ".concat(sizeClass, " ").concat(tierConfig[tier].class, " ").concat(className), children: [ tier === 'ultimate' ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(StarIcon, { className: "w-3 h-3 fill-gray-900" }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(VerifiedIcon, { className: "w-3 h-3" }), tierConfig[tier].label ] }); } if (verified) { return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "inline-flex items-center gap-0.5 rounded-full font-semibold ".concat(sizeClass, " bg-green-100 text-green-700 border border-green-200 ").concat(className), children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(VerifiedIcon, { className: "w-3 h-3" }) }); } const cfg = tierConfig[tier]; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "inline-flex items-center rounded-full font-semibold ".concat(sizeClass, " ").concat(cfg.class, " ").concat(className), children: [ tier === 'pro' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(StarIcon, { className: "w-3 h-3 mr-0.5 -mt-px" }), tier === 'ultimate' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(StarIcon, { className: "w-3 h-3 mr-0.5 -mt-px fill-gray-900" }), cfg.label ] }); } function StarIcon(param) { let { className = '' } = param; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { viewBox: "0 0 16 16", fill: "none", className: className, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z", fill: "currentColor" }) }); } function VerifiedIcon(param) { let { className = '' } = param; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { viewBox: "0 0 16 16", fill: "none", className: className, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M8 1l2 1.4 2.4-.4 1 2.2 2 1.2-.4 2.4L16 10l-1.8 1.6.4 2.4-2.2.8L10.8 17 8 16.2 5.2 17l-1.2-2.2-2.2-.8.4-2.4L0 10l1-2.2-.4-2.4 2-1.2 1-2.2 2.4.4L8 1z", fill: "#3B82F6" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M5.5 8.5l1.5 1.5 3-3", stroke: "white", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) ] }); } €”{"finalSource":true}ƒmap‹bufferedMap ConcatSourceRawSourceú/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ d: () => (/* binding */ PlanBadge) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); ReplaceSourceRawSourceimport { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; const tierConfig = { free: { label: 'Free', class: 'bg-gray-100 text-gray-500 border border-gray-200', icon: '' }, pro: { label: 'Pro', class: 'bg-green-100 text-green-700 border border-green-200', icon: /*#__PURE__*/ _jsx("svg", { viewBox: "0 0 16 16", fill: "none", className: "w-3 h-3 inline-block mr-0.5 -mt-px", children: /*#__PURE__*/ _jsx("path", { d: "M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z", fill: "currentColor" }) }) }, ultimate: { label: 'Ultimate', class: 'bg-gradient-to-r from-amber-400 via-yellow-400 to-amber-400 text-gray-900 border border-amber-500 shadow-sm shadow-amber-300/50', icon: /*#__PURE__*/ _jsx("svg", { viewBox: "0 0 16 16", fill: "none", className: "w-3 h-3 inline-block mr-0.5 -mt-px", children: /*#__PURE__*/ _jsx("path", { d: "M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z", fill: "currentColor" }) }) } }; export function PlanBadge(param) { let { tier, verified, size = 'sm', className = '' } = param; if (tier === 'free' && !verified) return null; const sizeClass = size === 'sm' ? 'text-[10px] px-1.5 py-0.5' : 'text-xs px-2 py-0.5'; if (verified && tier !== 'free') { return /*#__PURE__*/ _jsxs("span", { className: "inline-flex items-center gap-1 rounded-full font-semibold ".concat(sizeClass, " ").concat(tierConfig[tier].class, " ").concat(className), children: [ tier === 'ultimate' ? /*#__PURE__*/ _jsx(StarIcon, { className: "w-3 h-3 fill-gray-900" }) : /*#__PURE__*/ _jsx(VerifiedIcon, { className: "w-3 h-3" }), tierConfig[tier].label ] }); } if (verified) { return /*#__PURE__*/ _jsx("span", { className: "inline-flex items-center gap-0.5 rounded-full font-semibold ".concat(sizeClass, " bg-green-100 text-green-700 border border-green-200 ").concat(className), children: /*#__PURE__*/ _jsx(VerifiedIcon, { className: "w-3 h-3" }) }); } const cfg = tierConfig[tier]; return /*#__PURE__*/ _jsxs("span", { className: "inline-flex items-center rounded-full font-semibold ".concat(sizeClass, " ").concat(cfg.class, " ").concat(className), children: [ tier === 'pro' && /*#__PURE__*/ _jsx(StarIcon, { className: "w-3 h-3 mr-0.5 -mt-px" }), tier === 'ultimate' && /*#__PURE__*/ _jsx(StarIcon, { className: "w-3 h-3 mr-0.5 -mt-px fill-gray-900" }), cfg.label ] }); } function StarIcon(param) { let { className = '' } = param; return /*#__PURE__*/ _jsx("svg", { viewBox: "0 0 16 16", fill: "none", className: className, children: /*#__PURE__*/ _jsx("path", { d: "M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z", fill: "currentColor" }) }); } function VerifiedIcon(param) { let { className = '' } = param; return /*#__PURE__*/ _jsxs("svg", { viewBox: "0 0 16 16", fill: "none", className: className, children: [ /*#__PURE__*/ _jsx("path", { d: "M8 1l2 1.4 2.4-.4 1 2.2 2 1.2-.4 2.4L16 10l-1.8 1.6.4 2.4-2.2.8L10.8 17 8 16.2 5.2 17l-1.2-2.2-2.2-.8.4-2.4L0 10l1-2.2-.4-2.4 2-1.2 1-2.2 2.4.4L8 1z", fill: "#3B82F6" }), /*#__PURE__*/ _jsx("path", { d: "M5.5 8.5l1.5 1.5 3-3", stroke: "white", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) ] }); } Ñ062undefined342345(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined513516(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined910913(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined10811084(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined12631269undefined15731577(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined18271830(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined19341937(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined21362139(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined23672370(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined25172521(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined27362739(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined28692872(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined30973100(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined32253228(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined34773481(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined36203623(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined38803883(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined /***/ }) ω/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ d: () => (/* binding */ PlanBadge) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); const tierConfig = { free: { label: 'Free', class: 'bg-gray-100 text-gray-500 border border-gray-200', icon: '' }, pro: { label: 'Pro', class: 'bg-green-100 text-green-700 border border-green-200', icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { viewBox: "0 0 16 16", fill: "none", className: "w-3 h-3 inline-block mr-0.5 -mt-px", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z", fill: "currentColor" }) }) }, ultimate: { label: 'Ultimate', class: 'bg-gradient-to-r from-amber-400 via-yellow-400 to-amber-400 text-gray-900 border border-amber-500 shadow-sm shadow-amber-300/50', icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { viewBox: "0 0 16 16", fill: "none", className: "w-3 h-3 inline-block mr-0.5 -mt-px", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z", fill: "currentColor" }) }) } }; function PlanBadge(param) { let { tier, verified, size = 'sm', className = '' } = param; if (tier === 'free' && !verified) return null; const sizeClass = size === 'sm' ? 'text-[10px] px-1.5 py-0.5' : 'text-xs px-2 py-0.5'; if (verified && tier !== 'free') { return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "inline-flex items-center gap-1 rounded-full font-semibold ".concat(sizeClass, " ").concat(tierConfig[tier].class, " ").concat(className), children: [ tier === 'ultimate' ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(StarIcon, { className: "w-3 h-3 fill-gray-900" }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(VerifiedIcon, { className: "w-3 h-3" }), tierConfig[tier].label ] }); } if (verified) { return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "inline-flex items-center gap-0.5 rounded-full font-semibold ".concat(sizeClass, " bg-green-100 text-green-700 border border-green-200 ").concat(className), children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(VerifiedIcon, { className: "w-3 h-3" }) }); } const cfg = tierConfig[tier]; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "inline-flex items-center rounded-full font-semibold ".concat(sizeClass, " ").concat(cfg.class, " ").concat(className), children: [ tier === 'pro' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(StarIcon, { className: "w-3 h-3 mr-0.5 -mt-px" }), tier === 'ultimate' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(StarIcon, { className: "w-3 h-3 mr-0.5 -mt-px fill-gray-900" }), cfg.label ] }); } function StarIcon(param) { let { className = '' } = param; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { viewBox: "0 0 16 16", fill: "none", className: className, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z", fill: "currentColor" }) }); } function VerifiedIcon(param) { let { className = '' } = param; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { viewBox: "0 0 16 16", fill: "none", className: className, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M8 1l2 1.4 2.4-.4 1 2.2 2 1.2-.4 2.4L16 10l-1.8 1.6.4 2.4-2.2.8L10.8 17 8 16.2 5.2 17l-1.2-2.2-2.2-.8.4-2.4L0 10l1-2.2-.4-2.4 2-1.2 1-2.2 2.4.4L8 1z", fill: "#3B82F6" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M5.5 8.5l1.5 1.5 3-3", stroke: "white", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) ] }); } /***/ }) ÐÓ  ÔÕÔú/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ d: () => (/* binding */ PlanBadge) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); Öimport { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; const tierConfig = { free: { label: 'Free', class: 'bg-gray-100 text-gray-500 border border-gray-200', icon: '' }, pro: { label: 'Pro', class: 'bg-green-100 text-green-700 border border-green-200', icon: /*#__PURE__*/ _jsx("svg", { viewBox: "0 0 16 16", fill: "none", className: "w-3 h-3 inline-block mr-0.5 -mt-px", children: /*#__PURE__*/ _jsx("path", { d: "M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z", fill: "currentColor" }) }) }, ultimate: { label: 'Ultimate', class: 'bg-gradient-to-r from-amber-400 via-yellow-400 to-amber-400 text-gray-900 border border-amber-500 shadow-sm shadow-amber-300/50', icon: /*#__PURE__*/ _jsx("svg", { viewBox: "0 0 16 16", fill: "none", className: "w-3 h-3 inline-block mr-0.5 -mt-px", children: /*#__PURE__*/ _jsx("path", { d: "M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z", fill: "currentColor" }) }) } }; export function PlanBadge(param) { let { tier, verified, size = 'sm', className = '' } = param; if (tier === 'free' && !verified) return null; const sizeClass = size === 'sm' ? 'text-[10px] px-1.5 py-0.5' : 'text-xs px-2 py-0.5'; if (verified && tier !== 'free') { return /*#__PURE__*/ _jsxs("span", { className: "inline-flex items-center gap-1 rounded-full font-semibold ".concat(sizeClass, " ").concat(tierConfig[tier].class, " ").concat(className), children: [ tier === 'ultimate' ? /*#__PURE__*/ _jsx(StarIcon, { className: "w-3 h-3 fill-gray-900" }) : /*#__PURE__*/ _jsx(VerifiedIcon, { className: "w-3 h-3" }), tierConfig[tier].label ] }); } if (verified) { return /*#__PURE__*/ _jsx("span", { className: "inline-flex items-center gap-0.5 rounded-full font-semibold ".concat(sizeClass, " bg-green-100 text-green-700 border border-green-200 ").concat(className), children: /*#__PURE__*/ _jsx(VerifiedIcon, { className: "w-3 h-3" }) }); } const cfg = tierConfig[tier]; return /*#__PURE__*/ _jsxs("span", { className: "inline-flex items-center rounded-full font-semibold ".concat(sizeClass, " ").concat(cfg.class, " ").concat(className), children: [ tier === 'pro' && /*#__PURE__*/ _jsx(StarIcon, { className: "w-3 h-3 mr-0.5 -mt-px" }), tier === 'ultimate' && /*#__PURE__*/ _jsx(StarIcon, { className: "w-3 h-3 mr-0.5 -mt-px fill-gray-900" }), cfg.label ] }); } function StarIcon(param) { let { className = '' } = param; return /*#__PURE__*/ _jsx("svg", { viewBox: "0 0 16 16", fill: "none", className: className, children: /*#__PURE__*/ _jsx("path", { d: "M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z", fill: "currentColor" }) }); } function VerifiedIcon(param) { let { className = '' } = param; return /*#__PURE__*/ _jsxs("svg", { viewBox: "0 0 16 16", fill: "none", className: className, children: [ /*#__PURE__*/ _jsx("path", { d: "M8 1l2 1.4 2.4-.4 1 2.2 2 1.2-.4 2.4L16 10l-1.8 1.6.4 2.4-2.2.8L10.8 17 8 16.2 5.2 17l-1.2-2.2-2.2-.8.4-2.4L0 10l1-2.2-.4-2.4 2-1.2 1-2.2 2.4.4L8 1z", fill: "#3B82F6" }), /*#__PURE__*/ _jsx("path", { d: "M5.5 8.5l1.5 1.5 3-3", stroke: "white", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) ] }); } Ñ062undefined342345(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined513516(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined910913(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined10811084(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined12631269undefined15731577(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined18271830(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined19341937(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined21362139(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined23672370(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined25172521(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined27362739(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined28692872(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined30973100(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined32253228(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined34773481(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined36203623(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined38803883(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefinedר, /***/ 5338:  Ý «webpack/lib/util/registerExternalSerializerœwebpack-sources/ConcatSource€«webpack/lib/util/registerExternalSerializer™webpack-sources/RawSource_/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; «webpack/lib/util/registerExternalSerializerœwebpack-sources/CachedSource ë«webpack/lib/util/registerExternalSerializerœwebpack-sources/ConcatSource€«webpack/lib/util/registerExternalSerializer™webpack-sources/RawSourceš/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ V: () => (/* binding */ formatLastSeen) /* harmony export */ }); «webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourceWexport function formatLastSeen(lastSeenAt, t) { if (!lastSeenAt) return ''; const diff = Date.now() - new Date(lastSeenAt).getTime(); const minutes = Math.floor(diff / 60000); if (minutes < 5) return t('user.online'); if (minutes < 60) return t('user.seen_minutes').replace('{n}', String(minutes)); const hours = Math.floor(minutes / 60); if (hours < 24) return t('user.seen_hours').replace('{n}', String(hours)); const days = Math.floor(hours / 24); if (days === 1) return t('user.seen_yesterday'); return t('user.seen_days').replace('{n}', String(days)); } €€†buffer†source„size„maps„hashê/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ V: () => (/* binding */ formatLastSeen) /* harmony export */ }); function formatLastSeen(lastSeenAt, t) { if (!lastSeenAt) return ''; const diff = Date.now() - new Date(lastSeenAt).getTime(); const minutes = Math.floor(diff / 60000); if (minutes < 5) return t('user.online'); if (minutes < 60) return t('user.seen_minutes').replace('{n}', String(minutes)); const hours = Math.floor(minutes / 60); if (hours < 24) return t('user.seen_hours').replace('{n}', String(hours)); const days = Math.floor(hours / 24); if (days === 1) return t('user.seen_yesterday'); return t('user.seen_days').replace('{n}', String(days)); } €”{"finalSource":true}ƒmap‹bufferedMap ConcatSourceRawSourceš/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ V: () => (/* binding */ formatLastSeen) /* harmony export */ }); ReplaceSourceRawSourceWexport function formatLastSeen(lastSeenAt, t) { if (!lastSeenAt) return ''; const diff = Date.now() - new Date(lastSeenAt).getTime(); const minutes = Math.floor(diff / 60000); if (minutes < 5) return t('user.online'); if (minutes < 60) return t('user.seen_minutes').replace('{n}', String(minutes)); const hours = Math.floor(minutes / 60); if (hours < 24) return t('user.seen_hours').replace('{n}', String(hours)); const days = Math.floor(hours / 24); if (days === 1) return t('user.seen_yesterday'); return t('user.seen_days').replace('{n}', String(days)); }  06undefined /***/ }) ÄS/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ V: () => (/* binding */ formatLastSeen) /* harmony export */ }); function formatLastSeen(lastSeenAt, t) { if (!lastSeenAt) return ''; const diff = Date.now() - new Date(lastSeenAt).getTime(); const minutes = Math.floor(diff / 60000); if (minutes < 5) return t('user.online'); if (minutes < 60) return t('user.seen_minutes').replace('{n}', String(minutes)); const hours = Math.floor(minutes / 60); if (hours < 24) return t('user.seen_hours').replace('{n}', String(hours)); const days = Math.floor(hours / 24); if (days === 1) return t('user.seen_yesterday'); return t('user.seen_days').replace('{n}', String(days)); } /***/ }) ÅÈ  ÉÊÉš/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ V: () => (/* binding */ formatLastSeen) /* harmony export */ }); ËWexport function formatLastSeen(lastSeenAt, t) { if (!lastSeenAt) return ''; const diff = Date.now() - new Date(lastSeenAt).getTime(); const minutes = Math.floor(diff / 60000); if (minutes < 5) return t('user.online'); if (minutes < 60) return t('user.seen_minutes').replace('{n}', String(minutes)); const hours = Math.floor(minutes / 60); if (hours < 24) return t('user.seen_hours').replace('{n}', String(hours)); const days = Math.floor(hours / 24); if (days === 1) return t('user.seen_yesterday'); return t('user.seen_days').replace('{n}', String(days)); }  06undefinedÌÍ, /***/ 5940:  /"«webpack/lib/util/registerExternalSerializerœwebpack-sources/ConcatSource€«webpack/lib/util/registerExternalSerializer™webpack-sources/RawSource_/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; «webpack/lib/util/registerExternalSerializerœwebpack-sources/CachedSource H «webpack/lib/util/registerExternalSerializerœwebpack-sources/ConcatSource€«webpack/lib/util/registerExternalSerializer™webpack-sources/RawSourceÍ/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ Ez: () => (/* binding */ CategoryIcon), /* harmony export */ V: () => (/* binding */ isCategoryIconUrl) /* harmony export */ }); /* unused harmony export resolveCategoryIconUrl */ /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); «webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSource'import { jsx as _jsx } from "react/jsx-runtime"; import React, { useEffect, useMemo, useState } from 'react'; const API_URL = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; export function isCategoryIconUrl(icon) { if (!icon) return false; const value = icon.trim(); return value.startsWith('http://') || value.startsWith('https://') || value.startsWith('/'); } export function resolveCategoryIconUrl(icon) { if (icon.startsWith('/api/')) return "".concat(API_URL).concat(icon); return icon; } export function CategoryIcon(param) { let { icon, alt = '', className, fallback = '📊' } = param; const value = (icon || '').trim(); const [hasError, setHasError] = useState(false); useEffect(()=>{ setHasError(false); }, [ value ]); const url = useMemo(()=>isCategoryIconUrl(value) ? resolveCategoryIconUrl(value) : '', [ value ]); const fallbackUrl = '/category-icons/package.svg'; if (isCategoryIconUrl(value)) { if (hasError && value !== fallbackUrl) { return /*#__PURE__*/ _jsx("img", { src: fallbackUrl, alt: alt, className: className, loading: "lazy", onError: ()=>setHasError(true) }); } if (hasError && value === fallbackUrl) { return /*#__PURE__*/ _jsx("span", { className: className, children: fallback }); } return /*#__PURE__*/ _jsx("img", { src: url, alt: alt, className: className, loading: "lazy", onError: ()=>setHasError(true) }); } return /*#__PURE__*/ _jsx("span", { className: className, children: value || fallback }); } e/1l~Vœ¡·ºÀƒ‰ÀÇÕÝ06@CloûþÊÍ€€˜"https://api.canhelp.gr"0€€€¯(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)°(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)®(0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)¶(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)ÿÿÿ€†buffer†source„size„maps„hash“ /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ Ez: () => (/* binding */ CategoryIcon), /* harmony export */ V: () => (/* binding */ isCategoryIconUrl) /* harmony export */ }); /* unused harmony export resolveCategoryIconUrl */ /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); const API_URL = "https://api.canhelp.gr" || 0; function isCategoryIconUrl(icon) { if (!icon) return false; const value = icon.trim(); return value.startsWith('http://') || value.startsWith('https://') || value.startsWith('/'); } function resolveCategoryIconUrl(icon) { if (icon.startsWith('/api/')) return "".concat(API_URL).concat(icon); return icon; } function CategoryIcon(param) { let { icon, alt = '', className, fallback = '📊' } = param; const value = (icon || '').trim(); const [hasError, setHasError] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ setHasError(false); }, [ value ]); const url = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(()=>isCategoryIconUrl(value) ? resolveCategoryIconUrl(value) : '', [ value ]); const fallbackUrl = '/category-icons/package.svg'; if (isCategoryIconUrl(value)) { if (hasError && value !== fallbackUrl) { return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: fallbackUrl, alt: alt, className: className, loading: "lazy", onError: ()=>setHasError(true) }); } if (hasError && value === fallbackUrl) { return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: className, children: fallback }); } return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: url, alt: alt, className: className, loading: "lazy", onError: ()=>setHasError(true) }); } return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: className, children: value || fallback }); } €”{"finalSource":true}ƒmap‹bufferedMap ConcatSourceRawSourceÍ/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ Ez: () => (/* binding */ CategoryIcon), /* harmony export */ V: () => (/* binding */ isCategoryIconUrl) /* harmony export */ }); /* unused harmony export resolveCategoryIconUrl */ /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); ReplaceSourceRawSource'import { jsx as _jsx } from "react/jsx-runtime"; import React, { useEffect, useMemo, useState } from 'react'; const API_URL = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; export function isCategoryIconUrl(icon) { if (!icon) return false; const value = icon.trim(); return value.startsWith('http://') || value.startsWith('https://') || value.startsWith('/'); } export function resolveCategoryIconUrl(icon) { if (icon.startsWith('/api/')) return "".concat(API_URL).concat(icon); return icon; } export function CategoryIcon(param) { let { icon, alt = '', className, fallback = '📊' } = param; const value = (icon || '').trim(); const [hasError, setHasError] = useState(false); useEffect(()=>{ setHasError(false); }, [ value ]); const url = useMemo(()=>isCategoryIconUrl(value) ? resolveCategoryIconUrl(value) : '', [ value ]); const fallbackUrl = '/category-icons/package.svg'; if (isCategoryIconUrl(value)) { if (hasError && value !== fallbackUrl) { return /*#__PURE__*/ _jsx("img", { src: fallbackUrl, alt: alt, className: className, loading: "lazy", onError: ()=>setHasError(true) }); } if (hasError && value === fallbackUrl) { return /*#__PURE__*/ _jsx("span", { className: className, children: fallback }); } return /*#__PURE__*/ _jsx("img", { src: url, alt: alt, className: className, loading: "lazy", onError: ()=>setHasError(true) }); } return /*#__PURE__*/ _jsx("span", { className: className, children: value || fallback }); } T047undefined49108undefined126156"https://api.canhelp.gr"undefined1611830undefined186192undefined387393undefined527533undefined704711(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined725733(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined816822(0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)undefined10881091(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined13881391(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined15311534(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined17381741(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined /***/ }) ¹ü /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ Ez: () => (/* binding */ CategoryIcon), /* harmony export */ V: () => (/* binding */ isCategoryIconUrl) /* harmony export */ }); /* unused harmony export resolveCategoryIconUrl */ /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); const API_URL = "https://api.canhelp.gr" || 0; function isCategoryIconUrl(icon) { if (!icon) return false; const value = icon.trim(); return value.startsWith('http://') || value.startsWith('https://') || value.startsWith('/'); } function resolveCategoryIconUrl(icon) { if (icon.startsWith('/api/')) return "".concat(API_URL).concat(icon); return icon; } function CategoryIcon(param) { let { icon, alt = '', className, fallback = '📊' } = param; const value = (icon || '').trim(); const [hasError, setHasError] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ setHasError(false); }, [ value ]); const url = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(()=>isCategoryIconUrl(value) ? resolveCategoryIconUrl(value) : '', [ value ]); const fallbackUrl = '/category-icons/package.svg'; if (isCategoryIconUrl(value)) { if (hasError && value !== fallbackUrl) { return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: fallbackUrl, alt: alt, className: className, loading: "lazy", onError: ()=>setHasError(true) }); } if (hasError && value === fallbackUrl) { return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: className, children: fallback }); } return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: url, alt: alt, className: className, loading: "lazy", onError: ()=>setHasError(true) }); } return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: className, children: value || fallback }); } /***/ }) ºœ  Ÿ¿ŸÍ/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ Ez: () => (/* binding */ CategoryIcon), /* harmony export */ V: () => (/* binding */ isCategoryIconUrl) /* harmony export */ }); /* unused harmony export resolveCategoryIconUrl */ /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); À'import { jsx as _jsx } from "react/jsx-runtime"; import React, { useEffect, useMemo, useState } from 'react'; const API_URL = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; export function isCategoryIconUrl(icon) { if (!icon) return false; const value = icon.trim(); return value.startsWith('http://') || value.startsWith('https://') || value.startsWith('/'); } export function resolveCategoryIconUrl(icon) { if (icon.startsWith('/api/')) return "".concat(API_URL).concat(icon); return icon; } export function CategoryIcon(param) { let { icon, alt = '', className, fallback = '📊' } = param; const value = (icon || '').trim(); const [hasError, setHasError] = useState(false); useEffect(()=>{ setHasError(false); }, [ value ]); const url = useMemo(()=>isCategoryIconUrl(value) ? resolveCategoryIconUrl(value) : '', [ value ]); const fallbackUrl = '/category-icons/package.svg'; if (isCategoryIconUrl(value)) { if (hasError && value !== fallbackUrl) { return /*#__PURE__*/ _jsx("img", { src: fallbackUrl, alt: alt, className: className, loading: "lazy", onError: ()=>setHasError(true) }); } if (hasError && value === fallbackUrl) { return /*#__PURE__*/ _jsx("span", { className: className, children: fallback }); } return /*#__PURE__*/ _jsx("img", { src: url, alt: alt, className: className, loading: "lazy", onError: ()=>setHasError(true) }); } return /*#__PURE__*/ _jsx("span", { className: className, children: value || fallback }); } T047undefined49108undefined126156"https://api.canhelp.gr"undefined1611830undefined186192undefined387393undefined527533undefined704711(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined725733(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined816822(0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)undefined10881091(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined13881391(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined15311534(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined17381741(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefinedÁÂ, /***/ 6828:  a«webpack/lib/util/registerExternalSerializerœwebpack-sources/ConcatSource€«webpack/lib/util/registerExternalSerializer™webpack-sources/RawSourceV/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { «webpack/lib/util/registerExternalSerializerœwebpack-sources/CachedSource Y«webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSource«webpack/lib/util/registerExternalSerializer™webpack-sources/RawSourceXimport(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/users/[id]/page.tsx"); `UßPromise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 1875))€†buffer†source„size„maps„hashaPromise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 1875)); €”{"finalSource":true}ƒmap‹bufferedMap ReplaceSourceRawSourceXimport(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/users/[id]/page.tsx"); k085Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 1875))undefined /***/ }) ®Á/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 1875)); /***/ }) ¯² ³V/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { µXimport(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/users/[id]/page.tsx"); k085Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 1875))undefined¶· }, «webpack/lib/util/registerExternalSerializerœwebpack-sources/PrefixSource‰/******/ 2__webpack_require__ => { // webpackRuntimeModules ívar __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId)) __webpack_require__.O(0, [1516,9664,9906,2982,587,18,7358], () => (__webpack_exec__(6828))); var __webpack_exports__ = __webpack_require__.O(); _N_E = __webpack_exports__; } ]); ¡þÿÿ€h(self["webpackChunk_N_E"] = self["webpackChunk_N_E"] || []).push([[7845],{ /***/ 1258: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ E: () => (/* binding */ shortName), /* harmony export */ H: () => (/* binding */ formatShortName) /* harmony export */ }); /** * Shortens the last name to first letter + period. * "ИваМ ПетрПв" → "ИваМ П." * Works with a pre-composed full name string. */ function shortName(fullName) { if (!(fullName === null || fullName === void 0 ? void 0 : fullName.trim())) return '—'; const parts = fullName.trim().split(/\s+/); if (parts.length < 2 || !parts[1]) return parts[0]; return "".concat(parts[0], " ").concat(parts[1][0].toUpperCase(), "."); } /** * Formats separate firstName + lastName fields, shortening the last name. * Falls back to parsing fullName if firstName is not available. */ function formatShortName(firstName, lastName, fallbackName) { if (firstName === null || firstName === void 0 ? void 0 : firstName.trim()) { const l = lastName === null || lastName === void 0 ? void 0 : lastName.trim(); return l ? "".concat(firstName.trim(), " ").concat(l[0].toUpperCase(), ".") : firstName.trim(); } return shortName(fallbackName); } /***/ }), /***/ 1592: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ CI: () => (/* binding */ signOut), /* harmony export */ Hh: () => (/* binding */ signUp), /* harmony export */ Jv: () => (/* binding */ signIn), /* harmony export */ wV: () => (/* binding */ useSession), /* harmony export */ yK: () => (/* binding */ authClient) /* harmony export */ }); /* harmony import */ var better_auth_react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6504); const API_URL = "https://api.canhelp.gr" || 0; const authClient = (0,better_auth_react__WEBPACK_IMPORTED_MODULE_0__/* .createAuthClient */ .M)({ baseURL: API_URL }); const { signIn, signOut, signUp, useSession } = authClient; /***/ }), /***/ 1875: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; // ESM COMPAT FLAG __webpack_require__.r(__webpack_exports__); // EXPORTS __webpack_require__.d(__webpack_exports__, { "default": () => (/* binding */ UserProfilePage) }); // EXTERNAL MODULE: ../../node_modules/next/dist/compiled/react/jsx-runtime.js var jsx_runtime = __webpack_require__(4568); // EXTERNAL MODULE: ../../node_modules/next/dist/compiled/react/index.js var react = __webpack_require__(7620); // EXTERNAL MODULE: ../../node_modules/next/dist/api/navigation.js var navigation = __webpack_require__(7541); // EXTERNAL MODULE: ./src/context/locale.tsx var context_locale = __webpack_require__(9906); // EXTERNAL MODULE: ./src/lib/auth.ts var auth = __webpack_require__(1592); // EXTERNAL MODULE: ./src/lib/api.ts var api = __webpack_require__(2982); // EXTERNAL MODULE: ../../node_modules/next/dist/client/app-dir/link.js var app_dir_link = __webpack_require__(9664); var link_default = /*#__PURE__*/__webpack_require__.n(app_dir_link); ;// ./src/components/UpgradePrompt.tsx const tierLabels = { free: 'Free', pro: 'Pro', ultimate: 'Ultimate' }; const tierColors = { free: 'bg-gray-50 border-gray-200 text-gray-700', pro: 'bg-green-50 border-green-200 text-gray-800', ultimate: 'bg-amber-50 border-amber-200 text-amber-800' }; const tierBtnColors = { free: 'bg-gray-600 hover:bg-gray-700 text-white', pro: 'bg-green-600 hover:bg-green-700 text-white', ultimate: 'bg-amber-500 hover:bg-amber-600 text-white' }; function UpgradePrompt(param) { let { feature, requiredTier, variant = 'inline', t, className = '' } = param; const tierLabel = tierLabels[requiredTier]; if (variant === 'banner') { return /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex items-center justify-between gap-3 rounded-xl border px-4 py-3 ".concat(tierColors[requiredTier], " ").concat(className), children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex items-center gap-2 min-w-0", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)(LockIcon, { className: "w-4 h-4 shrink-0 opacity-60" }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("span", { className: "text-sm font-medium truncate", children: [ feature, " — ", t('upgrade.available_in', 'Available in'), " ", /*#__PURE__*/ (0,jsx_runtime.jsx)("b", { children: tierLabel }) ] }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)((link_default()), { href: "/pricing?highlight=".concat(requiredTier), className: "shrink-0 text-xs font-semibold px-3 py-1.5 rounded-lg transition ".concat(tierBtnColors[requiredTier]), children: t('upgrade.cta', 'Upgrade') }) ] }); } if (variant === 'block') { return /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "rounded-2xl border p-6 text-center ".concat(tierColors[requiredTier], " ").concat(className), children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)(LockIcon, { className: "w-8 h-8 mx-auto mb-3 opacity-40" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "font-semibold text-base mb-1", children: feature }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("p", { className: "text-sm opacity-70 mb-4", children: [ t('upgrade.available_in', 'Available in plan'), " ", /*#__PURE__*/ (0,jsx_runtime.jsx)("b", { children: tierLabel }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)((link_default()), { href: "/pricing?highlight=".concat(requiredTier), className: "inline-block text-sm font-semibold px-5 py-2 rounded-xl transition ".concat(tierBtnColors[requiredTier]), children: t('upgrade.cta', 'Upgrade plan') }) ] }); } // inline variant return /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex items-center gap-2 text-sm ".concat(className), children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)(LockIcon, { className: "w-4 h-4 text-gray-400 shrink-0" }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("span", { className: "text-gray-500", children: [ t('upgrade.available_in', 'Available in'), " ", /*#__PURE__*/ (0,jsx_runtime.jsx)("b", { className: "text-gray-700", children: tierLabel }), ".", ' ', /*#__PURE__*/ (0,jsx_runtime.jsx)((link_default()), { href: "/pricing?highlight=".concat(requiredTier), className: "text-green-600 hover:underline", children: t('upgrade.cta', 'Upgrade') }) ] }) ] }); } function LockIcon(param) { let { className = '' } = param; return /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { viewBox: "0 0 20 20", fill: "currentColor", className: className, children: /*#__PURE__*/ (0,jsx_runtime.jsx)("path", { fillRule: "evenodd", d: "M10 1a4.5 4.5 0 00-4.5 4.5V9H5a2 2 0 00-2 2v6a2 2 0 002 2h10a2 2 0 002-2v-6a2 2 0 00-2-2h-.5V5.5A4.5 4.5 0 0010 1zm3 8V5.5a3 3 0 10-6 0V9h6z", clipRule: "evenodd" }) }); } // EXTERNAL MODULE: ./src/lib/formatName.ts var formatName = __webpack_require__(1258); // EXTERNAL MODULE: ./src/lib/formatLastSeen.ts var formatLastSeen = __webpack_require__(5338); // EXTERNAL MODULE: ./src/components/PlanBadge.tsx var PlanBadge = __webpack_require__(2035); // EXTERNAL MODULE: ./src/components/CategoryIcon.tsx var CategoryIcon = __webpack_require__(5940); ;// ./src/app/users/[id]/page.tsx /* __next_internal_client_entry_do_not_use__ default auto */ const MONTHS_BY_LOCALE = { ru: [ 'ЯМварь', 'Ѐевраль', 'Март', 'Апрель', 'Май', 'ИюМь', 'Июль', 'Август', 'СеМтябрь', 'Октябрь', 'НПябрь', 'Декабрь' ], en: [ 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December' ], el: [ 'ΙαΜουάριος', 'Ίεβρουάριος', 'Μάρτιος', 'Απρίλιος', 'Μάιος', 'ΙούΜιος', 'Ιούλιος', 'Αύγουστος', 'ΣεπτέΌβριος', 'Οκτώβριος', 'ΝοέΌβριος', 'ΔεκέΌβριος' ], uk: [ 'СічеМь', 'ЛютОй', 'БерезеМь', 'КвітеМь', 'ТравеМь', 'ЧервеМь', 'ЛОпеМь', 'СерпеМь', 'ВересеМь', 'ЖПвтеМь', 'ЛОстПпаЎ', 'ГруЎеМь' ] }; const WEEK_DAYS_BY_LOCALE = { ru: [ 'ПМ', 'Вт', 'Ср', 'Чт', 'Пт', 'Сб', 'Вс' ], en: [ 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa', 'Su' ], el: [ 'Δε', '΀ρ', '΀ε', 'Πε', 'Πα', 'Σά', 'Κυ' ], uk: [ 'ПМ', 'Вт', 'Ср', 'Чт', 'Пт', 'Сб', 'НЎ' ] }; function UserProfilePage() { var _user_firstName, _user_lastName, _user_name_, _user_name, _user_siteSettings, _session_user; const { id } = (0,navigation.useParams)(); const { t, locale } = (0,context_locale/* useLocale */.Y)(); const { data: session } = (0,auth/* useSession */.wV)(); const router = (0,navigation.useRouter)(); const [user, setUser] = (0,react.useState)(null); const [reviews, setReviews] = (0,react.useState)([]); const [rating, setRating] = (0,react.useState)(null); const [loading, setLoading] = (0,react.useState)(true); const [specialistCards, setSpecialistCards] = (0,react.useState)([]); const [priceLists, setPriceLists] = (0,react.useState)({}); const [catMap, setCatMap] = (0,react.useState)(new Map()); const [locMap, setLocMap] = (0,react.useState)(new Map()); const [isFavorite, setIsFavorite] = (0,react.useState)(false); const [favLoading, setFavLoading] = (0,react.useState)(false); const [msgLoading, setMsgLoading] = (0,react.useState)(false); const [canMsg, setCanMsg] = (0,react.useState)(null); // Availability const now = new Date(); const [availYear, setAvailYear] = (0,react.useState)(now.getFullYear()); const [availMonth, setAvailMonth] = (0,react.useState)(now.getMonth()); const [availMap, setAvailMap] = (0,react.useState)({}); const today = new Date().toISOString().slice(0, 10); const dateLocale = locale === 'ru' ? 'ru-RU' : locale === 'uk' ? 'uk-UA' : locale === 'en' ? 'en-US' : 'el-GR'; (0,react.useEffect)(()=>{ if (!id) return; Promise.all([ (0,api/* getUserProfile */.VM)(id, locale), (0,api/* getUserReviews */.v9)(id), (0,api/* getUserRating */.Bm)(id), (0,api/* getCategories */.bW)().catch(()=>[]), (0,api/* getLocations */.Vs)().catch(()=>[]) ]).then((param)=>{ let [u, r, rt, cats, locs] = param; setUser(u); setReviews(r); setRating(rt.avg); setCatMap(new Map(flattenTree(cats).map((c)=>[ c.slug, c ]))); setLocMap(new Map(flattenTree(locs).map((l)=>[ l.slug, l ]))); if (u.role === 'specialist' || u.role === 'admin') { (0,api/* getSpecialistCards */.Bq)(id, locale).then((cards)=>{ setSpecialistCards(cards); cards.forEach((c)=>{ (0,api/* getPriceList */.Ck)(c.id, locale).then((pl)=>{ if (pl.length > 0) setPriceLists((prev)=>({ ...prev, [c.id]: pl })); }).catch(()=>{}); }); }).catch(()=>{}); } }).catch(()=>{}).finally(()=>setLoading(false)); }, [ id, locale ]); // Load favorite status when session available (0,react.useEffect)(()=>{ var _session_user; if (!session || !id) return; (0,api/* getSpecialistFavorites */.pD)().then((rows)=>setIsFavorite(rows.some((r)=>{ var _r_specialist; return ((_r_specialist = r.specialist) === null || _r_specialist === void 0 ? void 0 : _r_specialist.id) === id; }))).catch(()=>{}); // Check if current user can message this person const myId = (_session_user = session.user) === null || _session_user === void 0 ? void 0 : _session_user.id; if (myId && myId !== id) { (0,api/* getCanMessage */.On)(id).then(setCanMsg).catch(()=>{}); } }, [ session, id ]); async function toggleFavorite() { if (!session) { router.push('/register'); return; } setFavLoading(true); try { if (isFavorite) { await (0,api/* removeSpecialistFavorite */.sD)(id); setIsFavorite(false); } else { await (0,api/* addSpecialistFavorite */.V)(id); setIsFavorite(true); } } catch (e) {} setFavLoading(false); } async function handleMessage() { if (!session) { router.push('/login'); return; } setMsgLoading(true); try { const { room } = await (0,api/* getOrCreateDirectRoom */.QN)(id); router.push("/chat?room=".concat(room.id)); } catch (e) {} setMsgLoading(false); } (0,react.useEffect)(()=>{ if (!id) return; const monthKey = "".concat(availYear, "-").concat(String(availMonth + 1).padStart(2, '0')); (0,api/* getSpecialistAvailability */.Xz)(id, monthKey).then((rows)=>{ setAvailMap((prev)=>{ const next = { ...prev }; rows.forEach((r)=>{ next[r.date] = r.status; }); return next; }); }).catch(()=>{}); }, [ id, availYear, availMonth ]); if (loading) return /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "text-center py-20 text-white", children: t('common.loading') }); if (!user) return /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "text-center py-20 text-white/70", children: t('common.error') }); var _user_firstName_, _user_lastName_; const initials = "".concat((_user_firstName_ = (_user_firstName = user.firstName) === null || _user_firstName === void 0 ? void 0 : _user_firstName[0]) !== null && _user_firstName_ !== void 0 ? _user_firstName_ : '').concat((_user_lastName_ = (_user_lastName = user.lastName) === null || _user_lastName === void 0 ? void 0 : _user_lastName[0]) !== null && _user_lastName_ !== void 0 ? _user_lastName_ : '').toUpperCase() || ((_user_name = user.name) === null || _user_name === void 0 ? void 0 : (_user_name_ = _user_name[0]) === null || _user_name_ === void 0 ? void 0 : _user_name_.toUpperCase()) || '?'; const displayName = (0,formatName/* formatShortName */.H)(user.firstName, user.lastName, user.name); const profileBackgroundImage = typeof ((_user_siteSettings = user.siteSettings) === null || _user_siteSettings === void 0 ? void 0 : _user_siteSettings.profileBackgroundImage) === 'string' && user.siteSettings.profileBackgroundImage.trim().length > 0 ? user.siteSettings.profileBackgroundImage : null; return /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "max-w-3xl mx-auto px-4 py-10", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-6 mb-6", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "relative -mx-6 -mt-6 mb-5 h-44 overflow-hidden rounded-t-xl", style: { backgroundImage: profileBackgroundImage ? "linear-gradient(135deg, rgba(21, 128, 61, 0.45), rgba(22, 163, 74, 0.65)), url(".concat(profileBackgroundImage, ")") : 'linear-gradient(135deg, #22c55e 0%, #16a34a 45%, #166534 100%)', backgroundSize: 'cover', backgroundPosition: 'center' }, children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "absolute inset-0 bg-gradient-to-b from-black/10 to-black/30" }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "relative h-full w-full p-5 flex items-end justify-between", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex items-center gap-3 min-w-0", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "w-14 h-14 rounded-full bg-white/20 border border-white/40 overflow-hidden flex items-center justify-center text-white text-xl font-bold backdrop-blur-sm", children: user.image ? /*#__PURE__*/ (0,jsx_runtime.jsx)("img", { src: user.image, alt: displayName, className: "w-full h-full object-cover" }) : initials }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "min-w-0", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "text-white text-lg font-bold truncate", children: displayName }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("p", { className: "text-white/85 text-xs", children: [ t('profile.member_since'), " ", new Date(user.createdAt).toLocaleDateString(dateLocale) ] }) ] }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "shrink-0", children: [ user.planTier && user.planTier !== 'free' && /*#__PURE__*/ (0,jsx_runtime.jsx)(PlanBadge/* PlanBadge */.d, { tier: user.planTier, verified: user.hasVerifiedBadge, size: "sm" }), user.hasVerifiedBadge && user.planTier === 'free' && /*#__PURE__*/ (0,jsx_runtime.jsx)(PlanBadge/* PlanBadge */.d, { tier: "free", verified: true, size: "sm" }) ] }) ] }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex items-start gap-5", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "w-20 h-20 rounded-full bg-green-100 flex-shrink-0 flex items-center justify-center text-green-700 text-2xl font-bold overflow-hidden border-2 border-gray-100", children: user.image ? /*#__PURE__*/ (0,jsx_runtime.jsx)("img", { src: user.image, alt: displayName, className: "w-full h-full object-cover" }) : initials }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex items-center gap-2 flex-wrap mb-1", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("h1", { className: "text-xl font-bold text-gray-900", children: displayName }), user.planTier && user.planTier !== 'free' && /*#__PURE__*/ (0,jsx_runtime.jsx)(PlanBadge/* PlanBadge */.d, { tier: user.planTier, verified: user.hasVerifiedBadge, size: "sm" }), user.hasVerifiedBadge && user.planTier === 'free' && /*#__PURE__*/ (0,jsx_runtime.jsx)(PlanBadge/* PlanBadge */.d, { tier: "free", verified: true, size: "sm" }), Array.isArray(user.activeStatuses) && user.activeStatuses.includes('can_help_now') && /*#__PURE__*/ (0,jsx_runtime.jsxs)("span", { className: "inline-flex items-center gap-1 text-xs font-medium text-green-700 bg-green-50 border border-green-200 px-2 py-0.5 rounded-full", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "w-1.5 h-1.5 rounded-full bg-green-500 animate-pulse" }), t('status.can_help_now', 'Available now') ] }), Array.isArray(user.activeStatuses) && user.activeStatuses.includes('need_help') && /*#__PURE__*/ (0,jsx_runtime.jsxs)("span", { className: "inline-flex items-center gap-1 text-xs font-medium text-green-700 bg-green-50 border border-green-200 px-2 py-0.5 rounded-full", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "w-1.5 h-1.5 rounded-full bg-green-500" }), t('status.need_help', 'Need help') ] }), (session ? ((_session_user = session.user) === null || _session_user === void 0 ? void 0 : _session_user.id) !== id : true) && /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "ml-auto flex items-center gap-2", children: [ !session ? // Guest — show button that leads to registration /*#__PURE__*/ (0,jsx_runtime.jsxs)("a", { href: "/register", className: "flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-sm font-medium bg-green-50 text-green-600 border border-green-200 hover:bg-green-100 transition", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { children: t('chat.write_btn', 'Write') }) ] }) : (canMsg === null || canMsg === void 0 ? void 0 : canMsg.allowed) === false ? /*#__PURE__*/ (0,jsx_runtime.jsx)(UpgradePrompt, { feature: t('chat.write_btn', 'Write'), requiredTier: "pro", variant: "inline", t: t }) : /*#__PURE__*/ (0,jsx_runtime.jsxs)("button", { onClick: handleMessage, disabled: msgLoading, className: "flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-sm font-medium bg-green-50 text-green-600 border border-green-200 hover:bg-green-100 transition disabled:opacity-50", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { children: t('chat.write_btn') }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("button", { onClick: toggleFavorite, disabled: favLoading, title: isFavorite ? t('specialist.unfavorite') : t('specialist.favorite'), className: "flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-sm font-medium transition disabled:opacity-50 ".concat(isFavorite ? 'bg-pink-50 text-pink-600 border border-pink-200 hover:bg-pink-100' : 'bg-gray-50 text-gray-600 border border-gray-200 hover:bg-gray-100'), children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { children: isFavorite ? '❀' : '🀍' }), /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { children: isFavorite ? t('specialist.unfavorite') : t('specialist.favorite') }) ] }) ] }) ] }), rating && /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex items-center gap-1.5 mb-2", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "text-yellow-400 text-lg", children: "★" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "font-semibold text-gray-800", children: Number(rating).toFixed(1) }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("span", { className: "text-sm text-gray-400", children: [ "(", reviews.length, " ", t('profile.reviews').toLowerCase(), ")" ] }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("p", { className: "text-sm text-gray-400", children: [ t('profile.member_since'), " ", new Date(user.createdAt).toLocaleDateString(dateLocale), user.lastSeenAt && /*#__PURE__*/ (0,jsx_runtime.jsxs)("span", { className: "ml-2", children: [ "\xb7 ", (0,formatLastSeen/* formatLastSeen */.V)(user.lastSeenAt, t) ] }) ] }) ] }) ] }), user.bio && /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "mt-4 text-gray-700 text-sm leading-relaxed border-t border-gray-100 pt-4", children: user.bio }), user.phone && /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "mt-4 border-t border-gray-100 pt-4 flex items-center gap-2", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,jsx_runtime.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M3 5a2 2 0 012-2h3.28a1 1 0 01.948.684l1.498 4.493a1 1 0 01-.502 1.21l-2.257 1.13a11.042 11.042 0 005.516 5.516l1.13-2.257a1 1 0 011.21-.502l4.493 1.498a1 1 0 01.684.949V19a2 2 0 01-2 2h-1C9.716 21 3 14.284 3 6V5z" }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)("a", { href: "tel:".concat(user.phone), className: "text-sm font-medium text-gray-700 hover:text-green-600", children: user.phone }) ] }), user.personalSiteSlug && /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "mt-3 flex items-center gap-2", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("svg", { className: "w-4 h-4 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,jsx_runtime.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" }) }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("a", { href: "/site/".concat(user.personalSiteSlug), target: "_blank", rel: "noopener noreferrer", className: "text-sm text-green-600 hover:underline", children: [ "canhelp.gr/site/", user.personalSiteSlug ] }) ] }), user.languages && user.languages.length > 0 && /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "mt-4 border-t border-gray-100 pt-4", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "text-xs font-medium text-gray-500 mb-2 uppercase tracking-wide", children: t('profile.languages') }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "flex flex-wrap gap-2", children: user.languages.map((code)=>{ const langMap = { el: { flag: '🇬🇷', label: 'ΕλληΜικά' }, en: { flag: '🇬🇧', label: 'English' }, ru: { flag: '🇷🇺', label: 'РусскОй' }, uk: { flag: '🇺🇊', label: 'УкраїМська' }, de: { flag: '🇩🇪', label: 'Deutsch' }, fr: { flag: '🇫🇷', label: 'Français' }, it: { flag: '🇮🇹', label: 'Italiano' }, es: { flag: '🇪🇞', label: 'Español' }, ar: { flag: '🇞🇊', label: 'العرؚية' }, zh: { flag: '🇚🇳', label: 'äž­æ–‡' } }; const lang = langMap[code]; if (!lang) return null; return /*#__PURE__*/ (0,jsx_runtime.jsxs)("span", { className: "flex items-center gap-1.5 bg-indigo-50 text-indigo-700 text-sm px-3 py-1 rounded-full border border-indigo-100", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { children: lang.flag }), /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { children: lang.label }) ] }, code); }) }) ] }), user.skills && user.skills.length > 0 && specialistCards.length === 0 && /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "mt-4 border-t border-gray-100 pt-4", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "text-xs font-medium text-gray-500 mb-2 uppercase tracking-wide", children: t('profile.skills.label') }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "flex flex-wrap gap-2", children: user.skills.map((skill)=>/*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "bg-green-50 text-green-700 text-sm px-3 py-1 rounded-full", children: skill }, skill)) }) ] }), user.role === 'specialist' && user.specialistCategories && user.specialistCategories.length > 0 && specialistCards.length === 0 && /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "mt-4 border-t border-gray-100 pt-4", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "text-xs font-medium text-gray-500 mb-2 uppercase tracking-wide", children: t('user.categories') }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "flex flex-wrap gap-2", children: user.specialistCategories.map((slug)=>/*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "bg-purple-50 text-purple-700 text-sm px-3 py-1 rounded-full", children: slug }, slug)) }) ] }), user.role === 'specialist' && user.specialistLocations && user.specialistLocations.length > 0 && specialistCards.length === 0 && /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "mt-4 border-t border-gray-100 pt-4", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "text-xs font-medium text-gray-500 mb-2 uppercase tracking-wide", children: t('user.work_area') }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "flex flex-wrap gap-2", children: user.specialistLocations.map((slug)=>/*#__PURE__*/ (0,jsx_runtime.jsxs)("span", { className: "bg-emerald-50 text-emerald-700 text-sm px-3 py-1 rounded-full", children: [ "\uD83D\uDCCD ", slug ] }, slug)) }) ] }) ] }), user.role === 'specialist' && /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-6 mb-6", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex items-center justify-between mb-4", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("h2", { className: "font-bold text-gray-900 text-lg", children: [ "\uD83D\uDCC5 ", t('nav.schedule') ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex items-center gap-3 text-xs text-gray-500", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("span", { className: "flex items-center gap-1.5", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "w-3 h-3 rounded bg-emerald-200 border border-emerald-400 inline-block" }), t('schedule.available') ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("span", { className: "flex items-center gap-1.5", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "w-3 h-3 rounded bg-red-200 border border-red-400 inline-block" }), t('schedule.busy') ] }) ] }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)(ReadOnlyCalendar, { year: availYear, month: availMonth, availMap: availMap, today: today, onPrev: ()=>{ if (availMonth === 0) { setAvailYear((y)=>y - 1); setAvailMonth(11); } else setAvailMonth((m)=>m - 1); }, onNext: ()=>{ if (availMonth === 11) { setAvailYear((y)=>y + 1); setAvailMonth(0); } else setAvailMonth((m)=>m + 1); } }) ] }), (user.role === 'specialist' || user.role === 'admin') && specialistCards.length > 0 && /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "space-y-4 mb-6", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("h2", { className: "font-bold text-white text-lg", children: t('nav.specialists') }), specialistCards.map((card)=>{ var _priceLists_card_id; return /*#__PURE__*/ (0,jsx_runtime.jsx)(PublicCardView, { card: card, locale: locale, catMap: catMap, locMap: locMap, t: t, priceList: (_priceLists_card_id = priceLists[card.id]) !== null && _priceLists_card_id !== void 0 ? _priceLists_card_id : [] }, card.id); }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("h2", { className: "font-bold text-gray-900 text-lg mb-4", children: [ t('profile.reviews'), reviews.length > 0 && /*#__PURE__*/ (0,jsx_runtime.jsxs)("span", { className: "text-gray-400 font-normal text-base ml-2", children: [ "(", reviews.length, ")" ] }) ] }), reviews.length === 0 ? /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "text-gray-500 text-sm", children: t('profile.no_reviews') }) : /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "space-y-4", children: reviews.map((param)=>{ let { review, author } = param; var _author_name_, _author_name; var _author_name__toUpperCase, _shortName; return /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "border-b border-gray-50 pb-4 last:border-0 last:pb-0", children: /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex items-start gap-3", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "w-8 h-8 rounded-full bg-gray-100 flex-shrink-0 flex items-center justify-center text-gray-600 text-sm font-bold overflow-hidden", children: (author === null || author === void 0 ? void 0 : author.image) ? /*#__PURE__*/ (0,jsx_runtime.jsx)("img", { src: author.image, alt: author.name, className: "w-full h-full object-cover" }) : (_author_name__toUpperCase = author === null || author === void 0 ? void 0 : (_author_name = author.name) === null || _author_name === void 0 ? void 0 : (_author_name_ = _author_name[0]) === null || _author_name_ === void 0 ? void 0 : _author_name_.toUpperCase()) !== null && _author_name__toUpperCase !== void 0 ? _author_name__toUpperCase : '?' }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex-1", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex items-center gap-2 mb-1", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "text-sm font-medium text-gray-800", children: (_shortName = (0,formatName/* shortName */.E)(author === null || author === void 0 ? void 0 : author.name)) !== null && _shortName !== void 0 ? _shortName : '—' }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("span", { className: "text-yellow-400", children: [ '★'.repeat(review.rating), '☆'.repeat(5 - review.rating) ] }) ] }), review.comment && /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "text-sm text-gray-600", children: review.comment }), /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "text-xs text-gray-400 mt-1", children: new Date(review.createdAt).toLocaleDateString(dateLocale) }) ] }) ] }) }, review.id); }) }) ] }) ] }); } function ReadOnlyCalendar(param) { let { year, month, availMap, today, onPrev, onNext } = param; const { locale, t } = (0,context_locale/* useLocale */.Y)(); var _WEEK_DAYS_BY_LOCALE_locale; const weekDays = (_WEEK_DAYS_BY_LOCALE_locale = WEEK_DAYS_BY_LOCALE[locale]) !== null && _WEEK_DAYS_BY_LOCALE_locale !== void 0 ? _WEEK_DAYS_BY_LOCALE_locale : WEEK_DAYS_BY_LOCALE.ru; var _MONTHS_BY_LOCALE_locale; const months = (_MONTHS_BY_LOCALE_locale = MONTHS_BY_LOCALE[locale]) !== null && _MONTHS_BY_LOCALE_locale !== void 0 ? _MONTHS_BY_LOCALE_locale : MONTHS_BY_LOCALE.ru; const firstDay = new Date(year, month, 1); const startDow = (firstDay.getDay() + 6) % 7; const daysInMonth = new Date(year, month + 1, 0).getDate(); const prevMonthDays = new Date(year, month, 0).getDate(); const cells = []; for(let i = startDow - 1; i >= 0; i--){ cells.push({ day: prevMonthDays - i, cur: false, dateKey: '' }); } for(let d = 1; d <= daysInMonth; d++){ const dateKey = "".concat(year, "-").concat(String(month + 1).padStart(2, '0'), "-").concat(String(d).padStart(2, '0')); cells.push({ day: d, cur: true, dateKey }); } const remainder = cells.length % 7; if (remainder !== 0) { for(let d = 1; d <= 7 - remainder; d++){ cells.push({ day: d, cur: false, dateKey: '' }); } } const monthPrefix = "".concat(year, "-").concat(String(month + 1).padStart(2, '0')); const availCount = Object.entries(availMap).filter((param)=>{ let [k, v] = param; return k.startsWith(monthPrefix) && k >= today && v === 'available'; }).length; return /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex items-center justify-between mb-3", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { onClick: onPrev, className: "w-7 h-7 rounded-lg hover:bg-gray-100 flex items-center justify-center text-gray-500", children: "‹" }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "text-center", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("span", { className: "font-medium text-gray-800 text-sm", children: [ months[month], " ", year ] }), availCount > 0 && /*#__PURE__*/ (0,jsx_runtime.jsxs)("span", { className: "ml-2 text-xs text-emerald-600", children: [ availCount, " ", t('schedule.free_days') ] }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { onClick: onNext, className: "w-7 h-7 rounded-lg hover:bg-gray-100 flex items-center justify-center text-gray-500", children: "›" }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "grid grid-cols-7 mb-1", children: weekDays.map((d)=>/*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "text-center text-xs text-gray-400 py-1", children: d }, d)) }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "grid grid-cols-7 gap-0.5", children: cells.map((cell, idx)=>{ if (!cell.cur) { return /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "h-9 flex items-center justify-center text-xs text-gray-200", children: cell.day }, "e-".concat(idx)); } const status = availMap[cell.dateKey]; const isPast = cell.dateKey < today; const isToday = cell.dateKey === today; let cls = 'h-9 flex items-center justify-center rounded-lg text-sm font-medium '; if (isPast) { cls += 'text-gray-200 '; } else if (status === 'available') { cls += 'bg-emerald-100 border border-emerald-300 text-emerald-700 '; } else if (status === 'busy') { cls += 'bg-red-100 border border-red-300 text-red-600 '; } else { cls += 'text-gray-500 '; } if (isToday) cls += 'ring-2 ring-blue-400 ring-offset-1 '; return /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: cls, children: cell.day }, cell.dateKey); }) }) ] }); } // ─── Public card view ───────────────────────────────────────────────────────── function flattenTree(nodes) { return nodes.flatMap((n)=>{ var _n_children; return [ n, ...flattenTree((_n_children = n.children) !== null && _n_children !== void 0 ? _n_children : []) ]; }); } function PublicCardView(param) { let { card, locale, catMap, locMap, t, priceList } = param; const [lightbox, setLightbox] = (0,react.useState)(null); const [expandedAreas, setExpandedAreas] = (0,react.useState)([]); const locById = new Map(); for (const node of locMap.values()){ if (node === null || node === void 0 ? void 0 : node.id) locById.set(node.id, node); } const getLocName = (loc, fallback)=>{ var _loc_names, _loc_names1; return (loc === null || loc === void 0 ? void 0 : (_loc_names = loc.names) === null || _loc_names === void 0 ? void 0 : _loc_names[locale]) || (loc === null || loc === void 0 ? void 0 : (_loc_names1 = loc.names) === null || _loc_names1 === void 0 ? void 0 : _loc_names1.el) || fallback; }; const locationGroups = (()=>{ const grouped = new Map(); var _card_locations; for (const slug of (_card_locations = card.locations) !== null && _card_locations !== void 0 ? _card_locations : []){ const loc = locMap.get(slug); if (!loc) { if (!grouped.has(slug)) { grouped.set(slug, { root: { slug, names: { el: slug } }, rootSlug: slug, districts: [], districtSlugs: new Set() }); } continue; } let root = loc; const seenIds = new Set(); while((root === null || root === void 0 ? void 0 : root.parentId) && locById.has(root.parentId) && !seenIds.has(root.parentId)){ seenIds.add(root.parentId); root = locById.get(root.parentId); } var _root_slug; const rootSlug = (_root_slug = root === null || root === void 0 ? void 0 : root.slug) !== null && _root_slug !== void 0 ? _root_slug : slug; if (!grouped.has(rootSlug)) { grouped.set(rootSlug, { root, rootSlug, districts: [], districtSlugs: new Set() }); } const group = grouped.get(rootSlug); if (loc.slug !== rootSlug && !group.districtSlugs.has(loc.slug)) { group.districtSlugs.add(loc.slug); group.districts.push(loc); } } return Array.from(grouped.values()); })(); var _lightbox_title; return /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 overflow-hidden", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "px-5 py-4 border-b border-gray-100", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("h3", { className: "font-bold text-gray-900", children: card.title }), card.description && /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "text-sm text-gray-600 mt-1", children: card.description }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "p-5 space-y-4", children: [ card.skills && card.skills.length > 0 && /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "text-xs font-semibold text-gray-500 uppercase tracking-wide mb-2", children: t('card.skills') }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "flex flex-wrap gap-2", children: card.skills.map((s)=>/*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "bg-green-50 text-green-700 text-sm px-3 py-1 rounded-full", children: s }, s)) }) ] }), card.categories && card.categories.length > 0 && /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "text-xs font-semibold text-gray-500 uppercase tracking-wide mb-2", children: t('card.categories') }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "flex flex-wrap gap-2", children: card.categories.map((s)=>{ var _cat_names, _cat_names1; const cat = catMap.get(s); const name = cat ? ((_cat_names = cat.names) === null || _cat_names === void 0 ? void 0 : _cat_names[locale]) || ((_cat_names1 = cat.names) === null || _cat_names1 === void 0 ? void 0 : _cat_names1.el) || s : s; return /*#__PURE__*/ (0,jsx_runtime.jsxs)("span", { className: "bg-purple-50 text-purple-700 text-sm px-3 py-1 rounded-full", children: [ (cat === null || cat === void 0 ? void 0 : cat.icon) ? /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "mr-1 inline-flex align-middle", children: /*#__PURE__*/ (0,jsx_runtime.jsx)(CategoryIcon/* CategoryIcon */.Ez, { icon: cat.icon, alt: name, className: (0,CategoryIcon/* isCategoryIconUrl */.V)(cat.icon) ? 'h-4 w-4 object-contain' : 'text-sm leading-none', fallback: "\uD83D\uDCE6" }) }) : null, name ] }, s); }) }) ] }), card.locations && card.locations.length > 0 && /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "text-xs font-semibold text-gray-500 uppercase tracking-wide mb-2", children: t('user.work_area') }), /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "space-y-2", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "flex flex-wrap gap-2", children: locationGroups.map((group)=>{ const expanded = expandedAreas.includes(group.rootSlug); const canExpand = group.districts.length > 0; return /*#__PURE__*/ (0,jsx_runtime.jsxs)("button", { type: "button", onClick: ()=>{ if (!canExpand) return; setExpandedAreas((prev)=>prev.includes(group.rootSlug) ? prev.filter((slug)=>slug !== group.rootSlug) : [ ...prev, group.rootSlug ]); }, className: "inline-flex items-center gap-1.5 text-sm px-3 py-1.5 rounded-full border transition ".concat(expanded ? 'bg-emerald-100 text-emerald-800 border-emerald-300' : 'bg-emerald-50 text-emerald-700 border-emerald-200 hover:bg-emerald-100', " ").concat(canExpand ? 'cursor-pointer' : 'cursor-default'), children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { children: "\uD83D\uDCCD" }), /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { children: getLocName(group.root, group.rootSlug) }), canExpand && /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "text-[11px] font-semibold px-1.5 py-0.5 rounded-full bg-white/80 text-emerald-700 border border-emerald-200", children: expanded ? '−' : "+".concat(group.districts.length) }) ] }, group.rootSlug); }) }), locationGroups.filter((group)=>expandedAreas.includes(group.rootSlug) && group.districts.length > 0).map((group)=>/*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "rounded-xl border border-emerald-100 bg-emerald-50/40 p-3", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "text-xs text-emerald-700 font-medium mb-2", children: getLocName(group.root, group.rootSlug) }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "flex flex-wrap gap-1.5", children: group.districts.map((district)=>/*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "text-xs px-2.5 py-1 rounded-full bg-white border border-emerald-200 text-emerald-700", children: getLocName(district, district.slug) }, district.slug)) }) ] }, "".concat(group.rootSlug, "-children"))) ] }) ] }), priceList.length > 0 && /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "text-xs font-semibold text-gray-500 uppercase tracking-wide mb-3", children: t('profile.card.tab.pricelist') }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "space-y-3", children: priceList.map((group)=>/*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "border border-gray-200 rounded-xl overflow-hidden", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "bg-gray-50 px-4 py-2 border-b border-gray-200", children: /*#__PURE__*/ (0,jsx_runtime.jsx)("span", { className: "font-semibold text-sm text-gray-800", children: group.title }) }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "divide-y divide-gray-100", children: group.items.map((item)=>/*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex items-center gap-3 px-4 py-2.5 text-sm", children: [ /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "font-medium text-gray-800", children: item.name }), item.description && /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "text-xs text-gray-500", children: item.description }) ] }), (item.price || item.unit) && /*#__PURE__*/ (0,jsx_runtime.jsxs)("span", { className: "text-green-700 font-semibold whitespace-nowrap", children: [ item.price ? "€".concat(item.price) : '', item.unit ? " ".concat(item.unit) : '' ] }) ] }, item.id)) }) ] }, group.id)) }) ] }), card.portfolio && card.portfolio.length > 0 && /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "text-xs font-semibold text-gray-500 uppercase tracking-wide mb-2", children: t('card.portfolio') }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "grid grid-cols-2 sm:grid-cols-3 gap-3", children: card.portfolio.map((item)=>{ var _item_title; return /*#__PURE__*/ (0,jsx_runtime.jsxs)("button", { type: "button", onClick: ()=>setLightbox(item), className: "group relative rounded-xl overflow-hidden border border-gray-200 bg-gray-50 text-left", children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("img", { src: item.imageUrl, alt: (_item_title = item.title) !== null && _item_title !== void 0 ? _item_title : '', className: "w-full aspect-square object-cover group-hover:scale-105 transition-transform duration-200" }), item.title && /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "px-2 py-1.5", children: /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "text-xs font-medium text-gray-700 truncate", children: item.title }) }) ] }, item.id); }) }) ] }) ] }), lightbox && /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "fixed inset-0 z-50 flex items-center justify-center bg-black/80 px-4", onClick: ()=>setLightbox(null), children: /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "bg-white rounded-2xl overflow-hidden max-w-lg w-full shadow-2xl", onClick: (e)=>e.stopPropagation(), children: [ /*#__PURE__*/ (0,jsx_runtime.jsx)("img", { src: lightbox.imageUrl, alt: (_lightbox_title = lightbox.title) !== null && _lightbox_title !== void 0 ? _lightbox_title : '', className: "w-full max-h-[60vh] object-contain bg-gray-900" }), (lightbox.title || lightbox.description) && /*#__PURE__*/ (0,jsx_runtime.jsxs)("div", { className: "p-4", children: [ lightbox.title && /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "font-semibold text-gray-800 mb-1", children: lightbox.title }), lightbox.description && /*#__PURE__*/ (0,jsx_runtime.jsx)("p", { className: "text-sm text-gray-600", children: lightbox.description }) ] }), /*#__PURE__*/ (0,jsx_runtime.jsx)("div", { className: "flex justify-end px-4 pb-4", children: /*#__PURE__*/ (0,jsx_runtime.jsx)("button", { type: "button", onClick: ()=>setLightbox(null), className: "text-sm text-gray-500 hover:text-gray-700 px-4 py-2 rounded-lg hover:bg-gray-100", children: t('card.close') }) }) ] }) }) ] }); } /***/ }), /***/ 2035: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ d: () => (/* binding */ PlanBadge) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); const tierConfig = { free: { label: 'Free', class: 'bg-gray-100 text-gray-500 border border-gray-200', icon: '' }, pro: { label: 'Pro', class: 'bg-green-100 text-green-700 border border-green-200', icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { viewBox: "0 0 16 16", fill: "none", className: "w-3 h-3 inline-block mr-0.5 -mt-px", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z", fill: "currentColor" }) }) }, ultimate: { label: 'Ultimate', class: 'bg-gradient-to-r from-amber-400 via-yellow-400 to-amber-400 text-gray-900 border border-amber-500 shadow-sm shadow-amber-300/50', icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { viewBox: "0 0 16 16", fill: "none", className: "w-3 h-3 inline-block mr-0.5 -mt-px", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z", fill: "currentColor" }) }) } }; function PlanBadge(param) { let { tier, verified, size = 'sm', className = '' } = param; if (tier === 'free' && !verified) return null; const sizeClass = size === 'sm' ? 'text-[10px] px-1.5 py-0.5' : 'text-xs px-2 py-0.5'; if (verified && tier !== 'free') { return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "inline-flex items-center gap-1 rounded-full font-semibold ".concat(sizeClass, " ").concat(tierConfig[tier].class, " ").concat(className), children: [ tier === 'ultimate' ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(StarIcon, { className: "w-3 h-3 fill-gray-900" }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(VerifiedIcon, { className: "w-3 h-3" }), tierConfig[tier].label ] }); } if (verified) { return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "inline-flex items-center gap-0.5 rounded-full font-semibold ".concat(sizeClass, " bg-green-100 text-green-700 border border-green-200 ").concat(className), children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(VerifiedIcon, { className: "w-3 h-3" }) }); } const cfg = tierConfig[tier]; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "inline-flex items-center rounded-full font-semibold ".concat(sizeClass, " ").concat(cfg.class, " ").concat(className), children: [ tier === 'pro' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(StarIcon, { className: "w-3 h-3 mr-0.5 -mt-px" }), tier === 'ultimate' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(StarIcon, { className: "w-3 h-3 mr-0.5 -mt-px fill-gray-900" }), cfg.label ] }); } function StarIcon(param) { let { className = '' } = param; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { viewBox: "0 0 16 16", fill: "none", className: className, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z", fill: "currentColor" }) }); } function VerifiedIcon(param) { let { className = '' } = param; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { viewBox: "0 0 16 16", fill: "none", className: className, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M8 1l2 1.4 2.4-.4 1 2.2 2 1.2-.4 2.4L16 10l-1.8 1.6.4 2.4-2.2.8L10.8 17 8 16.2 5.2 17l-1.2-2.2-2.2-.8.4-2.4L0 10l1-2.2-.4-2.4 2-1.2 1-2.2 2.4.4L8 1z", fill: "#3B82F6" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M5.5 8.5l1.5 1.5 3-3", stroke: "white", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) ] }); } /***/ }), /***/ 5338: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ V: () => (/* binding */ formatLastSeen) /* harmony export */ }); function formatLastSeen(lastSeenAt, t) { if (!lastSeenAt) return ''; const diff = Date.now() - new Date(lastSeenAt).getTime(); const minutes = Math.floor(diff / 60000); if (minutes < 5) return t('user.online'); if (minutes < 60) return t('user.seen_minutes').replace('{n}', String(minutes)); const hours = Math.floor(minutes / 60); if (hours < 24) return t('user.seen_hours').replace('{n}', String(hours)); const days = Math.floor(hours / 24); if (days === 1) return t('user.seen_yesterday'); return t('user.seen_days').replace('{n}', String(days)); } /***/ }), /***/ 5940: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ Ez: () => (/* binding */ CategoryIcon), /* harmony export */ V: () => (/* binding */ isCategoryIconUrl) /* harmony export */ }); /* unused harmony export resolveCategoryIconUrl */ /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); const API_URL = "https://api.canhelp.gr" || 0; function isCategoryIconUrl(icon) { if (!icon) return false; const value = icon.trim(); return value.startsWith('http://') || value.startsWith('https://') || value.startsWith('/'); } function resolveCategoryIconUrl(icon) { if (icon.startsWith('/api/')) return "".concat(API_URL).concat(icon); return icon; } function CategoryIcon(param) { let { icon, alt = '', className, fallback = '📊' } = param; const value = (icon || '').trim(); const [hasError, setHasError] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ setHasError(false); }, [ value ]); const url = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(()=>isCategoryIconUrl(value) ? resolveCategoryIconUrl(value) : '', [ value ]); const fallbackUrl = '/category-icons/package.svg'; if (isCategoryIconUrl(value)) { if (hasError && value !== fallbackUrl) { return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: fallbackUrl, alt: alt, className: className, loading: "lazy", onError: ()=>setHasError(true) }); } if (hasError && value === fallbackUrl) { return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: className, children: fallback }); } return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: url, alt: alt, className: className, loading: "lazy", onError: ()=>setHasError(true) }); } return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: className, children: value || fallback }); } /***/ }), /***/ 6828: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 1875)); /***/ }) }, /******/ __webpack_require__ => { // webpackRuntimeModules /******/ var __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId)) /******/ __webpack_require__.O(0, [1516,9664,9906,2982,587,18,7358], () => (__webpack_exec__(6828))); /******/ var __webpack_exports__ = __webpack_require__.O(); /******/ _N_E = __webpack_exports__; /******/ } ]); Eÿÿÿ¥þÿÿ `]ŠþÿÿX(self["webpackChunk_N_E"] = self["webpackChunk_N_E"] || []).push([[7845],{ /***/ 1258: ¥þÿÿFÿÿÿ¥þÿÿMÿÿÿ§þÿÿNÿÿÿOÿÿÿJÿÿÿKÿÿÿJÿÿÿPÿÿÿ¥þÿÿFÿÿÿ¥þÿÿQÿÿÿ§þÿÿRÿÿÿSÿÿÿJÿÿÿKÿÿÿJÿÿÿ, /***/ 1875: €þÿÿEÿÿÿ€þÿÿ0ÿÿÿÿÿÿŠþÿÿõýÿÿ1ÿÿÿ2ÿÿÿ3ÿÿÿÿÿÿŠþÿÿêÿÿ4ÿÿÿ5ÿÿÿIÿÿÿJÿÿÿIÿÿÿ­€þÿÿEÿÿÿ€þÿÿ®Šþÿÿ¯°IÿÿÿJÿÿÿIÿÿÿ, /***/ 5338: £þÿÿDÿÿÿ£þÿÿš/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ V: () => (/* binding */ formatLastSeen) /* harmony export */ }); €þÿÿWexport function formatLastSeen(lastSeenAt, t) { if (!lastSeenAt) return ''; const diff = Date.now() - new Date(lastSeenAt).getTime(); const minutes = Math.floor(diff / 60000); if (minutes < 5) return t('user.online'); if (minutes < 60) return t('user.seen_minutes').replace('{n}', String(minutes)); const hours = Math.floor(minutes / 60); if (hours < 24) return t('user.seen_hours').replace('{n}', String(hours)); const days = Math.floor(hours / 24); if (days === 1) return t('user.seen_yesterday'); return t('user.seen_days').replace('{n}', String(days)); }  06undefinedEÿÿÿFÿÿÿEÿÿÿÓ þÿÿAÿÿÿ þÿÿÔ¢þÿÿÕÖEÿÿÿFÿÿÿEÿÿÿ, /***/ 6828: ŸþÿÿOÿÿÿ¡þÿÿXimport(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/users/[id]/page.tsx"); k085Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 1875))undefinedBÿÿÿCÿÿÿBÿÿÿ‹Bÿÿÿívar __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId)) __webpack_require__.O(0, [1516,9664,9906,2982,587,18,7358], () => (__webpack_exec__(6828))); var __webpack_exports__ = __webpack_require__.O(); AÿÿÿŽ ð«webpack/lib/util/registerExternalSerializerœwebpack-sources/ConcatSource€` «webpack/lib/util/registerExternalSerializer™webpack-sources/RawSourceX(self["webpackChunk_N_E"] = self["webpackChunk_N_E"] || []).push([[6636],{ /***/ 1511: «webpack/lib/util/registerExternalSerializerœwebpack-sources/CachedSource  -«webpack/lib/util/registerExternalSerializerœwebpack-sources/ConcatSource€«webpack/lib/util/registerExternalSerializer™webpack-sources/RawSource_/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; «webpack/lib/util/registerExternalSerializerœwebpack-sources/CachedSource /¿«webpack/lib/util/registerExternalSerializerœwebpack-sources/ConcatSource€«webpack/lib/util/registerExternalSerializer™webpack-sources/RawSourcet__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ ProfilePage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7541); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(1592); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(9906); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(2982); /* harmony import */ var _components_CategoryIcon__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(5940); «webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSource’/* __next_internal_client_entry_do_not_use__ default auto */ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime"; import { useState, useEffect, useRef, Suspense } from 'react'; import { useRouter, useSearchParams } from 'next/navigation'; import { useSession, authClient } from '@/lib/auth'; import { useLocale } from '@/context/locale'; import * as api from '@/lib/api'; import { CategoryIcon, isCategoryIconUrl } from '@/components/CategoryIcon'; function SpecialistCardEditor(param) { let { card, isOpen, onToggle, onUpdate, onDelete, categories, locationTree, catLocale, locale, hasPriceList, visibilityIssues = [], moderationNotice = null } = param; const { t } = useLocale(); const hasVisibilityIssues = visibilityIssues.length > 0; const [cardTab, setCardTab] = useState('main'); const [saving, setSaving] = useState(false); const [savedOk, setSavedOk] = useState(false); const [localTitle, setLocalTitle] = useState(card.title); var _card_descriptionEl; const [localDescEl, setLocalDescEl] = useState((_card_descriptionEl = card.descriptionEl) !== null && _card_descriptionEl !== void 0 ? _card_descriptionEl : ''); var _card_descriptionEn; const [localDescEn, setLocalDescEn] = useState((_card_descriptionEn = card.descriptionEn) !== null && _card_descriptionEn !== void 0 ? _card_descriptionEn : ''); var _card_descriptionRu; const [localDescRu, setLocalDescRu] = useState((_card_descriptionRu = card.descriptionRu) !== null && _card_descriptionRu !== void 0 ? _card_descriptionRu : ''); var _card_descriptionUk; const [localDescUk, setLocalDescUk] = useState((_card_descriptionUk = card.descriptionUk) !== null && _card_descriptionUk !== void 0 ? _card_descriptionUk : ''); var _card_skills; const [localSkills, setLocalSkills] = useState((_card_skills = card.skills) !== null && _card_skills !== void 0 ? _card_skills : []); const [skillInput, setSkillInput] = useState(''); var _card_categories; const [localCategories, setLocalCategories] = useState((_card_categories = card.categories) !== null && _card_categories !== void 0 ? _card_categories : []); var _card_locations; const [localLocations, setLocalLocations] = useState((_card_locations = card.locations) !== null && _card_locations !== void 0 ? _card_locations : []); var _card_publicationStatus; const [localPublicationStatus, setLocalPublicationStatus] = useState((_card_publicationStatus = card.publicationStatus) !== null && _card_publicationStatus !== void 0 ? _card_publicationStatus : card.isActive ? 'active' : 'inactive'); const [apiSkillSugs, setApiSkillSugs] = useState([]); var _card_portfolio; const [portfolio, setPortfolio] = useState((_card_portfolio = card.portfolio) !== null && _card_portfolio !== void 0 ? _card_portfolio : []); const [portfolioUploading, setPortfolioUploading] = useState(false); const [editingItem, setEditingItem] = useState(null); const [editTitle, setEditTitle] = useState(''); const [editDesc, setEditDesc] = useState(''); const portfolioFileRef = useRef(null); // Price list state const [priceList, setPriceList] = useState([]); const [priceListLoading, setPriceListLoading] = useState(false); const [newGroupTitle, setNewGroupTitle] = useState(''); const [addingGroupId, setAddingGroupId] = useState(null); const [newItem, setNewItem] = useState({ name: '', description: '', price: '', unit: '' }); const [editingGroupId, setEditingGroupId] = useState(null); const [editGroupTitle, setEditGroupTitle] = useState(''); useEffect(()=>{ if (cardTab !== 'pricelist' || priceList.length > 0 || priceListLoading) return; setPriceListLoading(true); api.getPriceList(card.id, locale).then(setPriceList).catch(()=>{}).finally(()=>setPriceListLoading(false)); }, [ cardTab, locale ]); async function handleAddGroup() { if (!newGroupTitle.trim()) return; const group = await api.createPriceListGroup(card.id, { title: newGroupTitle.trim(), locale: [ 'el', 'en', 'ru', 'uk' ].includes(locale) ? locale : 'el', autoTranslate: true }); setPriceList((prev)=>[ ...prev, group ]); setNewGroupTitle(''); } async function handleDeleteGroup(groupId) { await api.deletePriceListGroup(groupId); setPriceList((prev)=>prev.filter((g)=>g.id !== groupId)); } async function handleSaveGroupTitle(groupId) { const updated = await api.updatePriceListGroup(groupId, { title: editGroupTitle.trim(), locale: [ 'el', 'en', 'ru', 'uk' ].includes(locale) ? locale : 'el', autoTranslate: true }); setPriceList((prev)=>prev.map((g)=>g.id === groupId ? { ...g, title: updated.title } : g)); setEditingGroupId(null); } async function handleAddItem(groupId) { if (!newItem.name.trim()) return; const item = await api.createPriceListItem(groupId, { name: newItem.name.trim(), description: newItem.description.trim() || null, price: newItem.price.trim() || null, unit: newItem.unit.trim() || null, locale: [ 'el', 'en', 'ru', 'uk' ].includes(locale) ? locale : 'el', autoTranslate: true }); setPriceList((prev)=>prev.map((g)=>g.id === groupId ? { ...g, items: [ ...g.items, item ] } : g)); setNewItem({ name: '', description: '', price: '', unit: '' }); setAddingGroupId(null); } async function handleDeleteItem(itemId, groupId) { await api.deletePriceListItem(itemId); setPriceList((prev)=>prev.map((g)=>g.id === groupId ? { ...g, items: g.items.filter((i)=>i.id !== itemId) } : g)); } useEffect(()=>{ if (cardTab !== 'skills') return; api.getSkillSuggestions(localCategories.length > 0 ? localCategories : undefined).then(setApiSkillSugs).catch(()=>setApiSkillSugs([])); }, [ localCategories, cardTab ]); const lbl = (ru, en, el)=>locale === 'ru' ? ru : locale === 'en' ? en : el; async function saveAll() { setSaving(true); try { const activeLocale = [ 'el', 'en', 'ru', 'uk' ].includes(locale) ? locale : 'el'; const cap = activeLocale.charAt(0).toUpperCase() + activeLocale.slice(1); const descField = "description".concat(cap); const descValue = { el: localDescEl, en: localDescEn, ru: localDescRu, uk: localDescUk }[activeLocale] || null; const updated = await api.updateSpecialistCard(card.id, { title: localTitle, [descField]: descValue, descriptionLocale: activeLocale, autoTranslate: !!descValue, skills: localSkills, categories: localCategories, locations: localLocations, publicationStatus: localPublicationStatus, isActive: localPublicationStatus === 'active' }); onUpdate({ ...updated, portfolio }); setSavedOk(true); setTimeout(()=>setSavedOk(false), 2000); } catch (e) {} finally{ setSaving(false); } } async function updatePublicationStatus(next) { setLocalPublicationStatus(next); try { await api.updateSpecialistCard(card.id, { publicationStatus: next, isActive: next === 'active' }); } catch (e) {} } function addSkill(s) { const trimmed = s.trim(); if (trimmed && !localSkills.includes(trimmed)) setLocalSkills([ ...localSkills, trimmed ]); setSkillInput(''); } function toggleCategory(slug) { let childSlugs = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : []; if (localCategories.includes(slug)) { setLocalCategories(localCategories.filter((c)=>c !== slug && !childSlugs.includes(c))); } else { setLocalCategories([ ...new Set([ ...localCategories, slug, ...childSlugs ]) ]); } } function toggleLocation(slug) { let childSlugs = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : []; if (localLocations.includes(slug)) { setLocalLocations(localLocations.filter((c)=>c !== slug && !childSlugs.includes(c))); } else { setLocalLocations([ ...new Set([ ...localLocations, slug, ...childSlugs ]) ]); } } async function handlePortfolioUpload(e) { var _e_target_files; const file = (_e_target_files = e.target.files) === null || _e_target_files === void 0 ? void 0 : _e_target_files[0]; if (!file) return; setPortfolioUploading(true); try { const form = new FormData(); form.append('file', file); form.append('cardId', card.id); const res = await fetch("".concat(process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000', "/api/portfolio"), { method: 'POST', credentials: 'include', body: form }); if (!res.ok) throw new Error('Upload failed'); const item = await res.json(); const next = [ ...portfolio, item ]; setPortfolio(next); onUpdate({ ...card, portfolio: next }); } catch (e) {} finally{ setPortfolioUploading(false); if (portfolioFileRef.current) portfolioFileRef.current.value = ''; } } async function handlePortfolioDelete(id) { try { await api.deletePortfolioItem(id); const next = portfolio.filter((p)=>p.id !== id); setPortfolio(next); onUpdate({ ...card, portfolio: next }); } catch (e) {} } async function handlePortfolioSave(id) { try { const item = await api.updatePortfolioItem(id, { title: editTitle, description: editDesc }); setPortfolio((prev)=>prev.map((p)=>p.id === id ? item : p)); setEditingItem(null); } catch (e) {} } const cardTabs = [ { id: 'main', label: t('profile.card.tab.main') }, { id: 'categories', label: t('profile.card.tab.categories') }, { id: 'skills', label: t('profile.card.tab.skills') }, { id: 'geography', label: t('profile.card.tab.geography') }, { id: 'pricelist', label: t('profile.card.tab.pricelist'), hidden: !hasPriceList }, { id: 'portfolio', label: t('profile.card.tab.portfolio') } ]; const pendingReviewNotice = localPublicationStatus === 'pending' ? { title: t('profile.card.review_pending', 'Pending approval'), body: t('profile.card.review_pending_hint', 'Your card is being reviewed by the admin team.'), tone: 'amber' } : null; const effectiveModerationNotice = moderationNotice !== null && moderationNotice !== void 0 ? moderationNotice : pendingReviewNotice; return /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 overflow-hidden", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 px-4 py-3 border-b border-gray-100 ".concat(hasVisibilityIssues ? 'bg-amber-50' : ''), children: [ /*#__PURE__*/ _jsxs("button", { type: "button", onClick: onToggle, className: "flex-1 flex items-center gap-3 text-left", children: [ /*#__PURE__*/ _jsx("span", { className: "text-sm font-semibold text-gray-800 flex-1", children: localTitle || card.title }), hasVisibilityIssues && /*#__PURE__*/ _jsx("span", { className: "inline-flex items-center justify-center w-5 h-5 rounded-full bg-amber-500 text-white text-xs font-bold", title: t('profile.card.visibility_issue', 'Card is not shown in offers'), children: "!" }), /*#__PURE__*/ _jsx("span", { className: "text-gray-400 text-xs", children: isOpen ? '▲' : 'â–Œ' }) ] }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>updatePublicationStatus(localPublicationStatus === 'active' ? 'inactive' : localPublicationStatus === 'pending' ? 'inactive' : 'pending'), className: "px-3 py-1.5 rounded-lg text-xs font-medium whitespace-nowrap ".concat(localPublicationStatus === 'active' ? 'bg-red-50 text-red-700 hover:bg-red-100' : localPublicationStatus === 'pending' ? 'bg-amber-50 text-amber-700 hover:bg-amber-100' : 'bg-green-50 text-green-700 hover:bg-green-100'), children: localPublicationStatus === 'active' ? t('profile.card.unpublish', 'Unpublish') : localPublicationStatus === 'pending' ? t('profile.card.withdraw_review', 'Withdraw request') : t('profile.card.submit_review', 'Submit for review') }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: onDelete, className: "text-red-400 hover:text-red-600 text-sm px-1 flex-shrink-0", title: t('profile.card.delete'), children: "\uD83D\uDDD1" }) ] }), isOpen && /*#__PURE__*/ _jsxs("div", { children: [ hasVisibilityIssues && /*#__PURE__*/ _jsxs("div", { className: "mx-4 mt-4 mb-2 rounded-lg border border-amber-300 bg-amber-50 p-3", children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs font-semibold text-amber-900", children: t('profile.card.visibility_issue', 'Card is not shown in offers') }), /*#__PURE__*/ _jsx("ul", { className: "mt-1.5 list-disc pl-4 text-xs text-amber-900 space-y-0.5", children: visibilityIssues.map((issue)=>/*#__PURE__*/ _jsx("li", { children: issue }, issue)) }) ] }), effectiveModerationNotice && /*#__PURE__*/ _jsxs("div", { className: "mx-4 mt-4 mb-2 rounded-lg border p-3 ".concat(effectiveModerationNotice.tone === 'green' ? 'border-green-300 bg-green-50' : effectiveModerationNotice.tone === 'red' ? 'border-red-300 bg-red-50' : 'border-amber-300 bg-amber-50'), children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs font-semibold ".concat(effectiveModerationNotice.tone === 'green' ? 'text-green-900' : effectiveModerationNotice.tone === 'red' ? 'text-red-900' : 'text-amber-900'), children: effectiveModerationNotice.title }), effectiveModerationNotice.body && /*#__PURE__*/ _jsx("p", { className: "mt-1 text-xs ".concat(effectiveModerationNotice.tone === 'green' ? 'text-green-800' : effectiveModerationNotice.tone === 'red' ? 'text-red-800' : 'text-amber-800'), children: effectiveModerationNotice.body }) ] }), /*#__PURE__*/ _jsx("div", { className: "flex overflow-x-auto border-b border-gray-100 bg-gray-50 gap-0", children: cardTabs.filter((t)=>!t.hidden).map((t)=>/*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setCardTab(t.id), className: "px-4 py-2.5 text-xs font-medium whitespace-nowrap border-b-2 transition -mb-px ".concat(cardTab === t.id ? 'border-green-500 text-green-600 bg-white' : 'border-transparent text-gray-500 hover:text-gray-700'), children: t.label }, t.id)) }), /*#__PURE__*/ _jsxs("div", { className: "p-4", children: [ cardTab === 'main' && /*#__PURE__*/ _jsxs("div", { className: "space-y-3", children: [ /*#__PURE__*/ _jsx("input", { value: localTitle, onChange: (e)=>setLocalTitle(e.target.value), maxLength: 200, placeholder: t('profile.cards.new_title'), 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" }), (()=>{ const activeLocale = [ 'el', 'en', 'ru', 'uk' ].includes(locale) ? locale : 'el'; const descMap = { el: [ localDescEl, setLocalDescEl ], en: [ localDescEn, setLocalDescEn ], ru: [ localDescRu, setLocalDescRu ], uk: [ localDescUk, setLocalDescUk ] }; const [val, setVal] = descMap[activeLocale]; const flags = { el: '🇬🇷', en: '🇬🇧', ru: '🇷🇺', uk: '🇺🇊' }; const otherLocales = [ 'el', 'en', 'ru', 'uk' ].filter((l)=>l !== activeLocale); const otherHasContent = otherLocales.some((l)=>descMap[l][0]); return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-1.5 text-xs font-medium text-gray-500 mb-1", children: [ flags[activeLocale], " ", t('profile.card.description', 'Description') ] }), /*#__PURE__*/ _jsx("textarea", { value: val, onChange: (e)=>setVal(e.target.value), rows: 4, maxLength: 2000, placeholder: t('profile.bio.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" }), val && /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-1", children: t('profile.card.desc_auto_translate', 'Will be automatically translated into other languages on save') }), otherHasContent && /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-1.5 mt-1.5", children: [ /*#__PURE__*/ _jsx("span", { className: "text-xs text-gray-400", children: t('profile.card.desc_translated', 'Translations available:') }), otherLocales.map((l)=>/*#__PURE__*/ _jsx("span", { className: "text-xs px-1.5 py-0.5 rounded-full ".concat(descMap[l][0] ? 'bg-green-50 text-green-600' : 'bg-gray-100 text-gray-400'), children: flags[l] }, l)) ] }) ] }); })() ] }), cardTab === 'skills' && /*#__PURE__*/ _jsxs("div", { className: "space-y-3", children: [ localSkills.length > 0 && /*#__PURE__*/ _jsx("div", { className: "flex flex-wrap gap-2", children: localSkills.map((s)=>/*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-1.5 bg-green-50 text-green-700 text-sm px-3 py-1 rounded-full", children: [ s, /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setLocalSkills(localSkills.filter((x)=>x !== s)), className: "text-gray-400 hover:text-green-700 leading-none", children: "\xd7" }) ] }, s)) }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-2", children: [ /*#__PURE__*/ _jsx("input", { value: skillInput, onChange: (e)=>setSkillInput(e.target.value), onKeyDown: (e)=>{ if (e.key === 'Enter') { e.preventDefault(); addSkill(skillInput); } }, placeholder: t('profile.card.skill.add'), 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" }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>addSkill(skillInput), className: "px-3 py-2 bg-gray-100 hover:bg-gray-200 rounded-lg text-sm font-medium", children: "+" }) ] }), apiSkillSugs.length > 0 && /*#__PURE__*/ _jsx("div", { className: "flex flex-wrap gap-1.5", children: apiSkillSugs.map((s)=>{ var _s_names_catLocale; return (_s_names_catLocale = s.names[catLocale]) !== null && _s_names_catLocale !== void 0 ? _s_names_catLocale : s.names.el; }).filter((name, i, arr)=>arr.indexOf(name) === i && !localSkills.includes(name)).slice(0, 16).map((name)=>/*#__PURE__*/ _jsxs("button", { type: "button", onClick: ()=>addSkill(name), className: "text-xs px-2.5 py-1 border border-gray-200 rounded-full text-gray-500 hover:border-green-400 hover:text-green-600 transition", children: [ "+ ", name ] }, name)) }) ] }), cardTab === 'categories' && /*#__PURE__*/ _jsx("div", { className: "space-y-3", children: categories.map((cat)=>{ var _cat_names, _cat_names1; var _cat_names_catLocale, _ref; const catName = (_ref = (_cat_names_catLocale = (_cat_names = cat.names) === null || _cat_names === void 0 ? void 0 : _cat_names[catLocale]) !== null && _cat_names_catLocale !== void 0 ? _cat_names_catLocale : (_cat_names1 = cat.names) === null || _cat_names1 === void 0 ? void 0 : _cat_names1.el) !== null && _ref !== void 0 ? _ref : cat.slug; var _cat_children; const children = (_cat_children = cat.children) !== null && _cat_children !== void 0 ? _cat_children : []; const childSlugs = children.map((c)=>c.slug); return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-2.5 cursor-pointer", children: [ /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: localCategories.includes(cat.slug), onChange: ()=>toggleCategory(cat.slug, childSlugs), className: "w-4 h-4 rounded border-gray-300 text-green-600 focus:ring-blue-400" }), /*#__PURE__*/ _jsxs("span", { className: "text-sm font-medium text-gray-800 inline-flex items-center gap-1", children: [ cat.icon && /*#__PURE__*/ _jsx(CategoryIcon, { icon: cat.icon, alt: catName, className: isCategoryIconUrl(cat.icon) ? 'h-4 w-4 object-contain' : 'text-sm leading-none', fallback: "\uD83D\uDCE6" }), catName ] }) ] }), children.length > 0 && /*#__PURE__*/ _jsx("div", { className: "ml-6 mt-2 space-y-2", children: children.map((sub)=>{ var _sub_names, _sub_names1; var _sub_names_catLocale, _ref; const subName = (_ref = (_sub_names_catLocale = (_sub_names = sub.names) === null || _sub_names === void 0 ? void 0 : _sub_names[catLocale]) !== null && _sub_names_catLocale !== void 0 ? _sub_names_catLocale : (_sub_names1 = sub.names) === null || _sub_names1 === void 0 ? void 0 : _sub_names1.el) !== null && _ref !== void 0 ? _ref : sub.slug; return /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-2.5 cursor-pointer", children: [ /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: localCategories.includes(sub.slug), onChange: ()=>toggleCategory(sub.slug), className: "w-4 h-4 rounded border-gray-300 text-green-600 focus:ring-blue-400" }), /*#__PURE__*/ _jsx("span", { className: "text-sm text-gray-600", children: subName }) ] }, sub.id); }) }) ] }, cat.id); }) }), cardTab === 'geography' && /*#__PURE__*/ _jsx("div", { className: "space-y-3", children: locationTree.map((city)=>{ var _city_names, _city_names1; var _city_names_catLocale, _ref; const cityName = (_ref = (_city_names_catLocale = (_city_names = city.names) === null || _city_names === void 0 ? void 0 : _city_names[catLocale]) !== null && _city_names_catLocale !== void 0 ? _city_names_catLocale : (_city_names1 = city.names) === null || _city_names1 === void 0 ? void 0 : _city_names1.el) !== null && _ref !== void 0 ? _ref : city.slug; var _city_children; const districts = (_city_children = city.children) !== null && _city_children !== void 0 ? _city_children : []; const districtSlugs = districts.map((d)=>d.slug); return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-2.5 cursor-pointer", children: [ /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: localLocations.includes(city.slug), onChange: ()=>toggleLocation(city.slug, districtSlugs), className: "w-4 h-4 rounded border-gray-300 text-green-600 focus:ring-blue-400" }), /*#__PURE__*/ _jsx("span", { className: "text-sm font-medium text-gray-800", children: cityName }) ] }), districts.length > 0 && /*#__PURE__*/ _jsx("div", { className: "ml-6 mt-2 space-y-2", children: districts.map((d)=>{ var _d_names, _d_names1; var _d_names_catLocale, _ref; const dName = (_ref = (_d_names_catLocale = (_d_names = d.names) === null || _d_names === void 0 ? void 0 : _d_names[catLocale]) !== null && _d_names_catLocale !== void 0 ? _d_names_catLocale : (_d_names1 = d.names) === null || _d_names1 === void 0 ? void 0 : _d_names1.el) !== null && _ref !== void 0 ? _ref : d.slug; return /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-2.5 cursor-pointer", children: [ /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: localLocations.includes(d.slug), onChange: ()=>toggleLocation(d.slug), className: "w-4 h-4 rounded border-gray-300 text-green-600 focus:ring-blue-400" }), /*#__PURE__*/ _jsx("span", { className: "text-sm text-gray-600", children: dName }) ] }, d.id); }) }) ] }, city.id); }) }), cardTab === 'pricelist' && /*#__PURE__*/ _jsx("div", { className: "space-y-4", children: priceListLoading ? /*#__PURE__*/ _jsx("div", { className: "text-center py-6 text-gray-400 text-sm", children: t('common.loading', 'Loading...') }) : /*#__PURE__*/ _jsxs(_Fragment, { children: [ priceList.length === 0 && /*#__PURE__*/ _jsx("div", { className: "text-center py-6 text-gray-400 text-sm border-2 border-dashed border-gray-200 rounded-xl", children: t('profile.card.pricelist.empty') }), priceList.map((group)=>/*#__PURE__*/ _jsxs("div", { className: "border border-gray-200 rounded-xl overflow-hidden", children: [ /*#__PURE__*/ _jsx("div", { className: "flex items-center gap-2 bg-gray-50 px-4 py-2.5 border-b border-gray-200", children: editingGroupId === group.id ? /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx("input", { value: editGroupTitle, onChange: (e)=>setEditGroupTitle(e.target.value), className: "flex-1 border border-gray-300 rounded-lg px-3 py-1.5 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400", onKeyDown: (e)=>{ if (e.key === 'Enter') handleSaveGroupTitle(group.id); }, autoFocus: true }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>handleSaveGroupTitle(group.id), className: "px-3 py-1.5 bg-green-600 text-white rounded-lg text-xs font-medium hover:bg-green-700", children: t('profile.card.pricelist.save_group') }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setEditingGroupId(null), className: "px-2 py-1.5 text-gray-500 hover:text-gray-700 text-xs", children: "✕" }) ] }) : /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx("span", { className: "flex-1 font-semibold text-sm text-gray-800", children: group.title }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>{ setEditingGroupId(group.id); setEditGroupTitle(group.title); }, className: "text-gray-400 hover:text-green-600 text-xs px-2 py-1 rounded hover:bg-green-50", children: "✏" }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>handleDeleteGroup(group.id), className: "text-gray-400 hover:text-red-500 text-xs px-2 py-1 rounded hover:bg-red-50", children: t('profile.card.pricelist.delete_group') }) ] }) }), /*#__PURE__*/ _jsx("div", { className: "divide-y divide-gray-100", children: group.items.map((item)=>/*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 px-4 py-2.5 text-sm group", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ _jsx("p", { className: "font-medium text-gray-800 truncate", children: item.name }), item.description && /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-500 truncate", children: item.description }) ] }), (item.price || item.unit) && /*#__PURE__*/ _jsxs("span", { className: "text-green-700 font-semibold text-sm whitespace-nowrap", children: [ item.price ? "€".concat(item.price) : '', item.unit ? " ".concat(item.unit) : '' ] }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>handleDeleteItem(item.id, group.id), className: "opacity-0 group-hover:opacity-100 text-red-400 hover:text-red-600 text-xs px-1 transition", children: t('profile.card.pricelist.delete_item') }) ] }, item.id)) }), addingGroupId === group.id ? /*#__PURE__*/ _jsxs("div", { className: "p-3 bg-green-50 border-t border-green-100 space-y-2", children: [ /*#__PURE__*/ _jsx("input", { placeholder: t('profile.card.pricelist.item_name'), value: newItem.name, onChange: (e)=>setNewItem((p)=>({ ...p, name: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }), /*#__PURE__*/ _jsx("input", { placeholder: t('profile.card.pricelist.item_desc'), value: newItem.description, onChange: (e)=>setNewItem((p)=>({ ...p, description: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-2", children: [ /*#__PURE__*/ _jsx("input", { placeholder: t('profile.card.pricelist.item_price'), value: newItem.price, onChange: (e)=>setNewItem((p)=>({ ...p, price: e.target.value })), className: "w-28 border border-gray-300 rounded-lg px-3 py-1.5 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }), /*#__PURE__*/ _jsx("input", { placeholder: t('profile.card.pricelist.item_unit'), value: newItem.unit, onChange: (e)=>setNewItem((p)=>({ ...p, unit: e.target.value })), className: "flex-1 border border-gray-300 rounded-lg px-3 py-1.5 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-2", children: [ /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>handleAddItem(group.id), className: "px-4 py-1.5 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700", children: t('profile.card.pricelist.save_item') }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>{ setAddingGroupId(null); setNewItem({ name: '', description: '', price: '', unit: '' }); }, className: "px-3 py-1.5 text-gray-500 hover:text-gray-700 text-sm", children: "✕" }) ] }) ] }) : /*#__PURE__*/ _jsx("div", { className: "px-4 py-2 border-t border-gray-100", children: /*#__PURE__*/ _jsxs("button", { type: "button", onClick: ()=>setAddingGroupId(group.id), className: "text-green-600 hover:text-gray-800 text-sm font-medium", children: [ "+ ", t('profile.card.pricelist.add_item') ] }) }) ] }, group.id)), /*#__PURE__*/ _jsxs("div", { className: "flex gap-2 pt-1", children: [ /*#__PURE__*/ _jsx("input", { placeholder: t('profile.card.pricelist.group_title'), value: newGroupTitle, onChange: (e)=>setNewGroupTitle(e.target.value), onKeyDown: (e)=>{ if (e.key === 'Enter') handleAddGroup(); }, 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" }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: handleAddGroup, className: "px-4 py-2 bg-green-600 hover:bg-green-700 text-white rounded-lg text-sm font-medium", children: t('profile.card.pricelist.add_group') }) ] }) ] }) }), cardTab === 'portfolio' && /*#__PURE__*/ _jsxs("div", { className: "space-y-3", children: [ portfolio.length < 20 && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>{ var _portfolioFileRef_current; return (_portfolioFileRef_current = portfolioFileRef.current) === null || _portfolioFileRef_current === void 0 ? void 0 : _portfolioFileRef_current.click(); }, disabled: portfolioUploading, className: "flex items-center gap-2 px-4 py-2 bg-green-600 hover:bg-green-700 text-white rounded-lg text-sm font-medium disabled:opacity-50", children: portfolioUploading ? /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx("span", { className: "w-4 h-4 border-2 border-white border-t-transparent rounded-full animate-spin" }), t('profile.card.photo.uploading') ] }) : /*#__PURE__*/ _jsxs(_Fragment, { children: [ "\uD83D\uDCF7 ", t('profile.card.photo.add') ] }) }), /*#__PURE__*/ _jsx("input", { ref: portfolioFileRef, type: "file", accept: "image/jpeg,image/png,image/webp", className: "hidden", onChange: handlePortfolioUpload }) ] }), portfolio.length === 0 ? /*#__PURE__*/ _jsx("div", { className: "text-center py-8 text-gray-400 text-sm border-2 border-dashed border-gray-200 rounded-xl", children: t('profile.card.photo.empty') }) : /*#__PURE__*/ _jsx("div", { className: "grid grid-cols-2 sm:grid-cols-3 gap-3", children: portfolio.map((item)=>{ var _item_title; return /*#__PURE__*/ _jsxs("div", { className: "group relative rounded-xl overflow-hidden border border-gray-200 bg-gray-50", children: [ /*#__PURE__*/ _jsx("img", { src: item.imageUrl, alt: (_item_title = item.title) !== null && _item_title !== void 0 ? _item_title : '', className: "w-full aspect-square object-cover" }), /*#__PURE__*/ _jsxs("div", { className: "absolute inset-0 bg-black/0 group-hover:bg-black/50 transition-all flex flex-col justify-between p-2", children: [ /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>handlePortfolioDelete(item.id), className: "self-end opacity-0 group-hover:opacity-100 transition w-7 h-7 rounded-full bg-red-500 text-white text-sm flex items-center justify-center hover:bg-red-600", children: "\xd7" }), /*#__PURE__*/ _jsxs("button", { type: "button", onClick: ()=>{ setEditingItem(item); var _item_title; setEditTitle((_item_title = item.title) !== null && _item_title !== void 0 ? _item_title : ''); var _item_description; setEditDesc((_item_description = item.description) !== null && _item_description !== void 0 ? _item_description : ''); }, className: "opacity-0 group-hover:opacity-100 transition text-xs text-white bg-black/50 hover:bg-black/70 rounded-lg px-2 py-1", children: [ "✏ ", t('profile.card.item.edit') ] }) ] }), item.title && /*#__PURE__*/ _jsx("div", { className: "px-2 py-1.5", children: /*#__PURE__*/ _jsx("p", { className: "text-xs font-medium text-gray-700 truncate", children: item.title }) }) ] }, item.id); }) }) ] }), cardTab !== 'portfolio' && cardTab !== 'pricelist' && /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 mt-4 pt-4 border-t border-gray-100", children: [ /*#__PURE__*/ _jsx("button", { type: "button", disabled: saving, onClick: saveAll, className: "px-5 py-2 bg-green-600 hover:bg-green-700 text-white rounded-lg text-sm font-semibold disabled:opacity-50", children: saving ? '...' : t('profile.card.save') }), savedOk && /*#__PURE__*/ _jsxs("span", { className: "text-sm text-green-600", children: [ "✓ ", t('profile.card.saved') ] }) ] }) ] }) ] }), editingItem && /*#__PURE__*/ _jsx("div", { className: "fixed inset-0 z-50 flex items-center justify-center bg-black/50 px-4", children: /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-2xl shadow-xl p-6 w-full max-w-md", children: [ /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-gray-800 mb-4", children: t('profile.card.item.edit') }), /*#__PURE__*/ _jsx("img", { src: editingItem.imageUrl, alt: "", className: "w-full h-40 object-cover rounded-xl mb-4" }), /*#__PURE__*/ _jsxs("div", { className: "space-y-3", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('profile.card.item.title') }), /*#__PURE__*/ _jsx("input", { value: editTitle, onChange: (e)=>setEditTitle(e.target.value), maxLength: 200, 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" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('profile.card.item.desc') }), /*#__PURE__*/ _jsx("textarea", { value: editDesc, onChange: (e)=>setEditDesc(e.target.value), rows: 3, maxLength: 1000, 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" }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-3 mt-5", children: [ /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>handlePortfolioSave(editingItem.id), className: "flex-1 bg-green-600 hover:bg-green-700 text-white py-2 rounded-lg text-sm font-medium", children: t('profile.card.item.save') }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setEditingItem(null), className: "flex-1 bg-gray-100 hover:bg-gray-200 text-gray-700 py-2 rounded-lg text-sm font-medium", children: t('profile.card.item.cancel') }) ] }) ] }) }) ] }); } // ─── AutoResponseTab ─────────────────────────────────────────────────────── function AutoResponseTab(param) { let { categories, locationTree, loaded, onLoad, settings, saving, saved, onSave, t, catLocale } = param; const { useEffect: _ue, useState: _us } = { useEffect, useState }; const [enabled, setEnabled] = _us(false); const [minBudget, setMinBudget] = _us(''); const [maxBudget, setMaxBudget] = _us(''); const [defaultPrice, setDefaultPrice] = _us(''); const [defaultMessage, setDefaultMessage] = _us(''); const [maxPerDay, setMaxPerDay] = _us(''); const [selCategories, setSelCategories] = _us([]); const [selLocations, setSelLocations] = _us([]); _ue(()=>{ onLoad(); }, []); _ue(()=>{ if (!settings) return; setEnabled(settings.enabled); setMinBudget(settings.minBudget != null ? String(settings.minBudget) : ''); setMaxBudget(settings.maxBudget != null ? String(settings.maxBudget) : ''); setDefaultPrice(settings.defaultPrice != null ? String(settings.defaultPrice) : ''); var _settings_defaultMessage; setDefaultMessage((_settings_defaultMessage = settings.defaultMessage) !== null && _settings_defaultMessage !== void 0 ? _settings_defaultMessage : ''); setMaxPerDay(settings.maxAutoOffersPerDay != null ? String(settings.maxAutoOffersPerDay) : ''); var _settings_categories; setSelCategories((_settings_categories = settings.categories) !== null && _settings_categories !== void 0 ? _settings_categories : []); var _settings_locations; setSelLocations((_settings_locations = settings.locations) !== null && _settings_locations !== void 0 ? _settings_locations : []); }, [ settings ]); if (!loaded) return /*#__PURE__*/ _jsx("div", { className: "text-center py-10 text-white/60", children: t('common.loading') }); const flatLocations = []; function flatten(nodes) { for (const n of nodes){ var _n_children; flatLocations.push({ id: n.id, name: n.name }); if ((_n_children = n.children) === null || _n_children === void 0 ? void 0 : _n_children.length) flatten(n.children); } } flatten(locationTree); return /*#__PURE__*/ _jsxs("div", { className: "space-y-4", children: [ /*#__PURE__*/ _jsx("div", { className: "bg-white rounded-xl border border-gray-200 p-5", children: /*#__PURE__*/ _jsxs("label", { className: "flex items-center justify-between cursor-pointer", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "font-medium text-gray-800", children: t('auto_response.title', 'Auto response') }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-0.5", children: t('auto_response.desc', 'Automatically respond to matching tasks') }) ] }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setEnabled((v)=>!v), className: "relative inline-flex h-6 w-11 items-center rounded-full transition-colors ".concat(enabled ? 'bg-green-500' : 'bg-gray-300'), children: /*#__PURE__*/ _jsx("span", { className: "inline-block h-4 w-4 transform rounded-full bg-white shadow transition-transform ".concat(enabled ? 'translate-x-6' : 'translate-x-1') }) }) ] }) }), /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-5 space-y-4", children: [ /*#__PURE__*/ _jsx("h3", { className: "font-medium text-gray-800 text-sm", children: t('auto_response.budget_range', 'Task budget') }), /*#__PURE__*/ _jsxs("div", { className: "grid grid-cols-2 gap-3", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs text-gray-500 mb-1", children: t('auto_response.min_budget', 'Min €') }), /*#__PURE__*/ _jsx("input", { type: "number", min: "0", value: minBudget, onChange: (e)=>setMinBudget(e.target.value), placeholder: "0", 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" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs text-gray-500 mb-1", children: t('auto_response.max_budget', 'Max €') }), /*#__PURE__*/ _jsx("input", { type: "number", min: "0", value: maxBudget, onChange: (e)=>setMaxBudget(e.target.value), placeholder: "∞", className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs text-gray-500 mb-1", children: t('auto_response.default_price', 'Default price €') }), /*#__PURE__*/ _jsx("input", { type: "number", min: "0", value: defaultPrice, onChange: (e)=>setDefaultPrice(e.target.value), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs text-gray-500 mb-1", children: t('auto_response.max_per_day', 'Max auto-offers/day') }), /*#__PURE__*/ _jsx("input", { type: "number", min: "1", max: "50", value: maxPerDay, onChange: (e)=>setMaxPerDay(e.target.value), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-5", children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs text-gray-500 mb-1", children: t('auto_response.default_message', 'Auto-response text') }), /*#__PURE__*/ _jsx("textarea", { value: defaultMessage, onChange: (e)=>setDefaultMessage(e.target.value), rows: 4, maxLength: 2000, placeholder: t('auto_response.message_placeholder', 'Hello! I can help with this task...'), 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" }) ] }), categories.length > 0 && /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-5", children: [ /*#__PURE__*/ _jsx("h3", { className: "font-medium text-gray-800 text-sm mb-3", children: t('auto_response.categories', 'Task categories') }), /*#__PURE__*/ _jsx("div", { className: "flex flex-wrap gap-2 max-h-40 overflow-y-auto", children: categories.flatMap((cat)=>{ var _cat_children; return [ cat, ...(_cat_children = cat.children) !== null && _cat_children !== void 0 ? _cat_children : [] ]; }).map((cat)=>{ var _cat_names, _cat_names1; var _cat_names_catLocale, _ref; const name = (_ref = (_cat_names_catLocale = (_cat_names = cat.names) === null || _cat_names === void 0 ? void 0 : _cat_names[catLocale]) !== null && _cat_names_catLocale !== void 0 ? _cat_names_catLocale : (_cat_names1 = cat.names) === null || _cat_names1 === void 0 ? void 0 : _cat_names1.el) !== null && _ref !== void 0 ? _ref : cat.slug; const sel = selCategories.includes(cat.slug); return /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setSelCategories(sel ? selCategories.filter((c)=>c !== cat.slug) : [ ...selCategories, cat.slug ]), className: "px-3 py-1.5 rounded-lg text-xs border transition ".concat(sel ? 'bg-green-600 border-green-600 text-white' : 'bg-white border-gray-300 text-gray-700 hover:border-green-400'), children: name }, cat.slug); }) }) ] }), /*#__PURE__*/ _jsx("button", { type: "button", disabled: saving, onClick: ()=>onSave({ enabled, minBudget: minBudget ? Number(minBudget) : null, maxBudget: maxBudget ? Number(maxBudget) : null, defaultPrice: defaultPrice ? Number(defaultPrice) : null, defaultMessage: defaultMessage || null, maxAutoOffersPerDay: maxPerDay ? Number(maxPerDay) : null, categories: selCategories.length > 0 ? selCategories : null, locations: selLocations.length > 0 ? selLocations : null }), className: "w-full bg-green-600 text-white py-3 rounded-xl font-semibold hover:bg-green-700 disabled:opacity-50", children: saving ? t('common.loading') : saved ? t('auto_response.saved', 'Saved ✓') : t('common.save') }) ] }); } export default function ProfilePage() { return /*#__PURE__*/ _jsx(Suspense, { fallback: null, children: /*#__PURE__*/ _jsx(ProfilePageInner, {}) }); } function ProfilePageInner() { var _user_firstName, _user_lastName, _dashData_features, _dashData_features1, _dashData_features2, _user_plan, _user_plan1, _user_plan2, _dashData_features3, _dashData_features4, _dashData_plan, _dashData_plan1, _user_plan3; const router = useRouter(); const searchParams = useSearchParams(); const { data: session, isPending } = useSession(); const { t, locale } = useLocale(); const validTabs = [ 'info', 'finance', 'cards', 'notifications', 'reviews', 'referral', 'auto_response', 'site' ]; var _searchParams_get; const initialTab = (_searchParams_get = searchParams.get('tab')) !== null && _searchParams_get !== void 0 ? _searchParams_get : 'info'; const [activeTab, setActiveTab] = useState(validTabs.includes(initialTab) ? initialTab : 'info'); const [user, setUser] = useState(null); const [loading, setLoading] = useState(true); const [saving, setSaving] = useState(false); const [saved, setSaved] = useState(false); const [error, setError] = useState(''); const [formData, setFormData] = useState({ firstName: '', lastName: '', phone: '', bio: '', locale: 'el' }); const [selectedLanguages, setSelectedLanguages] = useState([]); // Specialist cards const [cards, setCards] = useState([]); const [maxCards, setMaxCards] = useState(1); const [cardsLoading, setCardsLoading] = useState(false); const [cardNotifications, setCardNotifications] = useState([]); const [openCardId, setOpenCardId] = useState(null); const [creatingCard, setCreatingCard] = useState(false); const [newCardTitle, setNewCardTitle] = useState(''); const [showNewCardForm, setShowNewCardForm] = useState(false); const [showUpgradeModal, setShowUpgradeModal] = useState(false); // Reference data const [categories, setCategories] = useState([]); const [locationTree, setLocationTree] = useState([]); // Become specialist const [becomingSpecialist, setBecomingSpecialist] = useState(false); const [avatarUploading, setAvatarUploading] = useState(false); const [backgroundUploading, setBackgroundUploading] = useState(false); const fileRef = useRef(null); const backgroundFileRef = useRef(null); // Notification preferences const [notifyNewTasks, setNotifyNewTasks] = useState(false); const [notifMessages, setNotifMessages] = useState(true); const [notifySaving, setNotifySaving] = useState(false); const [notifySaved, setNotifySaved] = useState(false); // Email verification resend const [resendState, setResendState] = useState('idle'); // Referral info const [referralCode, setReferralCode] = useState(null); const [referralCount, setReferralCount] = useState(0); const [referralCopied, setReferralCopied] = useState(false); const [referralLoaded, setReferralLoaded] = useState(false); // Balance top-up modal const [showTopUpModal, setShowTopUpModal] = useState(false); const [topUpAmount, setTopUpAmount] = useState(10); const [topUpLoading, setTopUpLoading] = useState(false); const [topUpError, setTopUpError] = useState(''); const [balanceHistory, setBalanceHistory] = useState([]); const [planHistory, setPlanHistory] = useState([]); // Plan data + statuses const [dashData, setDashData] = useState(null); const [myStatuses, setMyStatuses] = useState([]); const [statusToggling, setStatusToggling] = useState(null); const [personalSiteSlug, setPersonalSiteSlug] = useState(''); const [slugSaving, setSlugSaving] = useState(false); const [slugSaved, setSlugSaved] = useState(false); const [slugCopied, setSlugCopied] = useState(false); const [slugError, setSlugError] = useState(''); const [showContactInfo, setShowContactInfo] = useState(false); const [siteSettings, setSiteSettings] = useState({}); const [siteSettingsSaving, setSiteSettingsSaving] = useState(false); const [siteStats, setSiteStats] = useState(null); const [siteStatsLoading, setSiteStatsLoading] = useState(false); const [autoResponse, setAutoResponse] = useState(null); const [arLoaded, setArLoaded] = useState(false); const [arSaving, setArSaving] = useState(false); const [arSaved, setArSaved] = useState(false); async function handleTopUp() { const amount = Number(topUpAmount); if (!amount || amount < 1) return; setTopUpLoading(true); setTopUpError(''); try { const { url, params } = await api.initiateTopUp(amount); // Build and auto-submit form to ePay const form = document.createElement('form'); form.method = 'POST'; form.action = url; Object.entries(params).forEach((param)=>{ let [k, v] = param; const input = document.createElement('input'); input.type = 'hidden'; input.name = k; input.value = v; form.appendChild(input); }); document.body.appendChild(form); form.submit(); } catch (e) { setTopUpError((e === null || e === void 0 ? void 0 : e.message) || t('profile.balance.topup.error')); setTopUpLoading(false); } } async function handleResendVerification() { if (!(user === null || user === void 0 ? void 0 : user.email) || resendState !== 'idle') return; setResendState('sending'); const callbackURL = "".concat(window.location.origin, "/profile"); const result = await authClient.sendVerificationEmail({ email: user.email, callbackURL }); if (result === null || result === void 0 ? void 0 : result.error) { setResendState('idle'); } else { setResendState('sent'); } } useEffect(()=>{ if (activeTab !== 'referral' || referralLoaded) return; api.getMyReferralInfo().then((r)=>{ setReferralCode(r.referralCode); setReferralCount(r.referralCount); }).catch(()=>{}).finally(()=>setReferralLoaded(true)); }, [ activeTab ]); // Reviews const [myReviews, setMyReviews] = useState(null); const [reviewsLoading, setReviewsLoading] = useState(false); const [myRating, setMyRating] = useState(null); useEffect(()=>{ if (activeTab !== 'reviews' || myReviews !== null || reviewsLoading) return; setReviewsLoading(true); api.getMyReviews().then(setMyReviews).catch(()=>setMyReviews([])).finally(()=>setReviewsLoading(false)); }, [ activeTab ]); useEffect(()=>{ if (activeTab !== 'site' || siteStats !== null || siteStatsLoading) return; setSiteStatsLoading(true); api.getSiteStats().then((res)=>setSiteStats(res.days)).catch(()=>setSiteStats([])).finally(()=>setSiteStatsLoading(false)); }, [ activeTab ]); useEffect(()=>{ if (!isPending && !session) router.push('/login'); }, [ session, isPending ]); useEffect(()=>{ if (!session) return; Promise.all([ api.request('/users/me'), api.getCategories(), api.getLocations(), api.getMyDashboard().catch(()=>null), api.getMyStatuses().catch(()=>[]), api.getBalanceHistory(8).catch(()=>[]), api.getPlanHistory(20).catch(()=>[]) ]).then((param)=>{ let [u, cats, locs, dash, statusRes, history, phist] = param; setUser(u); var _u_firstName, _u_lastName, _u_phone, _u_bio, _u_locale; setFormData({ firstName: (_u_firstName = u.firstName) !== null && _u_firstName !== void 0 ? _u_firstName : '', lastName: (_u_lastName = u.lastName) !== null && _u_lastName !== void 0 ? _u_lastName : '', phone: (_u_phone = u.phone) !== null && _u_phone !== void 0 ? _u_phone : '', bio: (_u_bio = u.bio) !== null && _u_bio !== void 0 ? _u_bio : '', locale: (_u_locale = u.locale) !== null && _u_locale !== void 0 ? _u_locale : 'el' }); var _u_languages; setSelectedLanguages((_u_languages = u.languages) !== null && _u_languages !== void 0 ? _u_languages : []); var _u_notifyNewTasks; setNotifyNewTasks((_u_notifyNewTasks = u.notifyNewTasks) !== null && _u_notifyNewTasks !== void 0 ? _u_notifyNewTasks : false); var _u_notifMessages; setNotifMessages((_u_notifMessages = u.notifMessages) !== null && _u_notifMessages !== void 0 ? _u_notifMessages : true); setCategories(cats); setLocationTree(locs); setDashData(dash); setMyStatuses((statusRes !== null && statusRes !== void 0 ? statusRes : []).filter((s)=>s.isActive).map((s)=>s.statusType)); setBalanceHistory(history); setPlanHistory(phist); var _u_personalSiteSlug; setPersonalSiteSlug((_u_personalSiteSlug = u.personalSiteSlug) !== null && _u_personalSiteSlug !== void 0 ? _u_personalSiteSlug : ''); var _u_showContactInfo; setShowContactInfo((_u_showContactInfo = u.showContactInfo) !== null && _u_showContactInfo !== void 0 ? _u_showContactInfo : false); var _u_siteSettings; setSiteSettings((_u_siteSettings = u.siteSettings) !== null && _u_siteSettings !== void 0 ? _u_siteSettings : {}); loadCards(); api.getUserRating(u.id).then((r)=>setMyRating(r.avg)).catch(()=>{}); }).catch(()=>{}).finally(()=>setLoading(false)); }, [ session ]); async function loadCards() { setCardsLoading(true); try { const { cards: c, maxCards: m } = await api.getMySpecialistCards(); setCards(c); setMaxCards(m); setOpenCardId((prev)=>{ var _c_; var _c__id; return prev && c.some((card)=>card.id === prev) ? prev : (_c__id = (_c_ = c[0]) === null || _c_ === void 0 ? void 0 : _c_.id) !== null && _c__id !== void 0 ? _c__id : null; }); api.getNotifications().then((rows)=>setCardNotifications(rows.filter((row)=>[ 'specialist_card_submitted', 'specialist_card_approved', 'specialist_card_rejected' ].includes(row.type)))).catch(()=>setCardNotifications([])); } catch (e) {} finally{ setCardsLoading(false); } } async function handleSubmit(e) { e.preventDefault(); setError(''); setSaving(true); try { const updated = await api.request('/users/me', { method: 'PATCH', body: JSON.stringify({ firstName: formData.firstName, lastName: formData.lastName, phone: formData.phone || undefined, bio: formData.bio || undefined, bioLocale: formData.locale, autoTranslateBio: true, locale: formData.locale, languages: selectedLanguages, showContactInfo }) }); setUser(updated); setSaved(true); setTimeout(()=>setSaved(false), 2500); } catch (err) { setError(err.message || t('common.error')); } finally{ setSaving(false); } } async function handleBecomeSpecialist() { setBecomingSpecialist(true); setError(''); try { const updated = await api.request('/users/me/become-specialist', { method: 'POST' }); setUser(updated); setActiveTab('cards'); loadCards(); } catch (err) { setError(err.message || t('common.error')); } finally{ setBecomingSpecialist(false); } } async function handleSaveSiteSlug() { setSlugSaving(true); setSlugError(''); try { const updated = await api.request('/users/me', { method: 'PATCH', body: JSON.stringify({ personalSiteSlug: personalSiteSlug || null }) }); setUser(updated); var _updated_personalSiteSlug; setPersonalSiteSlug((_updated_personalSiteSlug = updated.personalSiteSlug) !== null && _updated_personalSiteSlug !== void 0 ? _updated_personalSiteSlug : ''); setSlugSaved(true); setTimeout(()=>setSlugSaved(false), 2500); } catch (err) { var _err_code; const code = (_err_code = err === null || err === void 0 ? void 0 : err.code) !== null && _err_code !== void 0 ? _err_code : ''; if (code === 'SLUG_TAKEN' || err.message === 'This URL is already taken') { setSlugError(t('profile.site.slug_taken', 'This address is already taken')); } else { setSlugError(err.message || t('common.error')); } } finally{ setSlugSaving(false); } } async function handleSaveSiteSettings(newSettings) { setSiteSettings(newSettings); setSiteSettingsSaving(true); try { await api.request('/users/me', { method: 'PATCH', body: JSON.stringify({ siteSettings: newSettings }) }); } catch (e) {} finally{ setSiteSettingsSaving(false); } } async function handleAvatarChange(e) { var _e_target_files; const file = (_e_target_files = e.target.files) === null || _e_target_files === void 0 ? void 0 : _e_target_files[0]; if (!file) return; setAvatarUploading(true); try { const form = new FormData(); form.append('file', file); const res = await fetch("".concat(process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000', "/api/uploads"), { method: 'POST', credentials: 'include', body: form }); if (!res.ok) throw new Error('Upload failed'); const { url } = await res.json(); const fullUrl = "".concat(process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000').concat(url); await api.request('/users/me', { method: 'PATCH', body: JSON.stringify({ image: fullUrl }) }); setUser((prev)=>({ ...prev, image: fullUrl })); } catch (e) { setError(t('profile.upload.error')); } finally{ setAvatarUploading(false); } } async function handleBackgroundChange(e) { var _e_target_files; const file = (_e_target_files = e.target.files) === null || _e_target_files === void 0 ? void 0 : _e_target_files[0]; if (!file) return; setBackgroundUploading(true); try { const form = new FormData(); form.append('file', file); const res = await fetch("".concat(process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000', "/api/uploads"), { method: 'POST', credentials: 'include', body: form }); if (!res.ok) throw new Error('Upload failed'); const { url } = await res.json(); const fullUrl = "".concat(process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000').concat(url); const nextSettings = { ...siteSettings, profileBackgroundImage: fullUrl }; await api.request('/users/me', { method: 'PATCH', body: JSON.stringify({ siteSettings: nextSettings }) }); setSiteSettings(nextSettings); setSaved(true); setTimeout(()=>setSaved(false), 2500); } catch (e) { setError(t('profile.upload.error')); } finally{ setBackgroundUploading(false); if (backgroundFileRef.current) backgroundFileRef.current.value = ''; } } async function handleRemoveBackground() { setBackgroundUploading(true); try { const nextSettings = { ...siteSettings, profileBackgroundImage: null }; await api.request('/users/me', { method: 'PATCH', body: JSON.stringify({ siteSettings: nextSettings }) }); setSiteSettings(nextSettings); setSaved(true); setTimeout(()=>setSaved(false), 2500); } catch (e) { setError(t('profile.upload.error')); } finally{ setBackgroundUploading(false); } } async function handleCreateCard() { if (!newCardTitle.trim()) return; setCreatingCard(true); try { const card = await api.createSpecialistCard({ title: newCardTitle.trim() }); setCards((prev)=>[ ...prev, card ]); setOpenCardId(card.id); setNewCardTitle(''); setShowNewCardForm(false); } catch (err) { setError(err.message || t('common.error')); } finally{ setCreatingCard(false); } } async function handleDeleteCard(id) { if (!confirm(t('profile.cards.delete_confirm'))) return; try { await api.deleteSpecialistCard(id); setCards((prev)=>{ var _next_; const next = prev.filter((c)=>c.id !== id); var _next__id; if (openCardId === id) setOpenCardId((_next__id = (_next_ = next[0]) === null || _next_ === void 0 ? void 0 : _next_.id) !== null && _next__id !== void 0 ? _next__id : null); return next; }); } catch (err) { setError(err.message || t('common.error')); } } if (isPending || loading) { return /*#__PURE__*/ _jsx("div", { className: "text-center py-20 text-white", children: t('common.loading') }); } const catLocale = locale === 'en' ? 'en' : locale === 'ru' ? 'ru' : locale === 'uk' ? 'uk' : 'el'; const dateLocale = locale === 'en' ? 'en-US' : locale === 'ru' ? 'ru-RU' : 'el-GR'; const isSpecialist = (user === null || user === void 0 ? void 0 : user.role) === 'specialist'; const isAdmin = (user === null || user === void 0 ? void 0 : user.role) === 'admin'; const showSpecialistTabs = isSpecialist || isAdmin; var _user_firstName_, _user_lastName_; const initials = user ? "".concat((_user_firstName_ = (_user_firstName = user.firstName) === null || _user_firstName === void 0 ? void 0 : _user_firstName[0]) !== null && _user_firstName_ !== void 0 ? _user_firstName_ : '').concat((_user_lastName_ = (_user_lastName = user.lastName) === null || _user_lastName === void 0 ? void 0 : _user_lastName[0]) !== null && _user_lastName_ !== void 0 ? _user_lastName_ : '').toUpperCase() : '?'; const hasAutoResponse = !!(dashData === null || dashData === void 0 ? void 0 : (_dashData_features = dashData.features) === null || _dashData_features === void 0 ? void 0 : _dashData_features.hasAutoResponse); var _formData_bio, _ref; const profileBio = String((_ref = (_formData_bio = formData.bio) !== null && _formData_bio !== void 0 ? _formData_bio : user === null || user === void 0 ? void 0 : user.bio) !== null && _ref !== void 0 ? _ref : '').trim(); const publishedCards = cards.filter((c)=>{ var _c_publicationStatus; return ((_c_publicationStatus = c.publicationStatus) !== null && _c_publicationStatus !== void 0 ? _c_publicationStatus : c.isActive ? 'active' : 'inactive') === 'active'; }); const hasPublishedCard = publishedCards.length > 0; const hasCardCategories = publishedCards.some((c)=>{ var _c_categories; var _c_categories_length; return ((_c_categories_length = (_c_categories = c.categories) === null || _c_categories === void 0 ? void 0 : _c_categories.length) !== null && _c_categories_length !== void 0 ? _c_categories_length : 0) > 0; }); const hasCardLocations = publishedCards.some((c)=>{ var _c_locations; var _c_locations_length; return ((_c_locations_length = (_c_locations = c.locations) === null || _c_locations === void 0 ? void 0 : _c_locations.length) !== null && _c_locations_length !== void 0 ? _c_locations_length : 0) > 0; }); const moderationNoticeByCardId = cardNotifications.reduce((acc, row)=>{ if (!row.referenceId || acc[row.referenceId]) return acc; const tone = row.type === 'specialist_card_approved' ? 'green' : row.type === 'specialist_card_rejected' ? 'red' : 'amber'; const localizedTitle = row.type === 'specialist_card_approved' ? t('profile.card.review_approved', 'Card approved') : row.type === 'specialist_card_rejected' ? t('profile.card.review_rejected', 'Card rejected') : t('profile.card.review_pending', 'Pending approval'); const localizedBody = row.type === 'specialist_card_approved' ? t('profile.card.review_approved_hint', 'Your card is now visible in offers.') : row.type === 'specialist_card_rejected' ? t('profile.card.review_rejected_hint', 'Your card was not approved. Please update it and submit again.') : t('profile.card.review_pending_hint', 'Your card is being reviewed by the admin team.'); acc[row.referenceId] = { title: localizedTitle, body: localizedBody, tone }; return acc; }, {}); const listingMissing = []; if (!profileBio) listingMissing.push(t('profile.listing_requirements.bio', 'Add a short bio in the main profile section')); if (!hasPublishedCard) listingMissing.push(t('profile.listing_requirements.published_card', 'Publish at least one card')); if (!hasCardCategories) listingMissing.push(t('profile.listing_requirements.categories', 'Add at least one category to the published card')); if (!hasCardLocations) listingMissing.push(t('profile.listing_requirements.locations', 'Add at least one location to the published card')); const tabNeedsAttention = { info: !profileBio, cards: listingMissing.length > 0 }; const tabIcons = { info: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15.75 6a3.75 3.75 0 11-7.5 0 3.75 3.75 0 017.5 0zM4.501 20.118a7.5 7.5 0 0114.998 0A17.933 17.933 0 0112 21.75c-2.676 0-5.216-.584-7.499-1.632z" }) }), finance: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 6v12m-3-2.818l.879.659c1.171.879 3.07.879 4.242 0 1.172-.879 1.172-2.303 0-3.182C13.536 12.219 12.768 12 12 12c-.725 0-1.45-.22-2.003-.659-1.106-.879-1.106-2.303 0-3.182s2.9-.879 4.006 0l.415.33M21 12a9 9 0 11-18 0 9 9 0 0118 0z" }) }), cards: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M20.25 14.15v4.073a2.25 2.25 0 01-2.25 2.25h-12a2.25 2.25 0 01-2.25-2.25V6a2.25 2.25 0 012.25-2.25h4.073M15.75 3h5.25v5.25M15.75 3l-9 9" }) }), notifications: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M14.857 17.082a23.848 23.848 0 005.454-1.31A8.967 8.967 0 0118 9.75v-.7V9A6 6 0 006 9v.75a8.967 8.967 0 01-2.312 6.022c1.733.64 3.56 1.085 5.455 1.31m5.714 0a24.255 24.255 0 01-5.714 0m5.714 0a3 3 0 11-5.714 0" }) }), reviews: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M11.48 3.499a.562.562 0 011.04 0l2.125 5.111a.563.563 0 00.475.345l5.518.442c.499.04.701.663.321.988l-4.204 3.602a.563.563 0 00-.182.557l1.285 5.385a.562.562 0 01-.84.61l-4.725-2.885a.562.562 0 00-.586 0L6.982 20.54a.562.562 0 01-.84-.61l1.285-5.386a.562.562 0 00-.182-.557l-4.204-3.602a.562.562 0 01.321-.988l5.518-.442a.563.563 0 00.475-.345L11.48 3.5z" }) }), referral: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M13.19 8.688a4.5 4.5 0 011.242 7.244l-4.5 4.5a4.5 4.5 0 01-6.364-6.364l1.757-1.757m13.35-.622l1.757-1.757a4.5 4.5 0 00-6.364-6.364l-4.5 4.5a4.5 4.5 0 001.242 7.244" }) }), auto_response: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9.813 15.904L9 18.75l-.813-2.846a4.5 4.5 0 00-3.09-3.09L2.25 12l2.846-.813a4.5 4.5 0 003.09-3.09L9 5.25l.813 2.846a4.5 4.5 0 003.09 3.09L15.75 12l-2.846.813a4.5 4.5 0 00-3.09 3.09z" }) }), site: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 21a9.004 9.004 0 008.716-6.747M12 21a9.004 9.004 0 01-8.716-6.747M12 21c2.485 0 4.5-4.03 4.5-9S14.485 3 12 3m0 18c-2.485 0-4.5-4.03-4.5-9S9.515 3 12 3m0 0a8.997 8.997 0 017.843 4.582M12 3a8.997 8.997 0 00-7.843 4.582m15.686 0A11.953 11.953 0 0112 10.5c-2.998 0-5.74-1.1-7.843-2.918m15.686 0A8.959 8.959 0 0121 12c0 .778-.099 1.533-.284 2.253m0 0A17.919 17.919 0 0112 16.5c-3.162 0-6.133-.815-8.716-2.247m0 0A9.015 9.015 0 013 12c0-1.605.42-3.113 1.157-4.418" }) }) }; const tabs = showSpecialistTabs ? [ { id: 'info', label: t('profile.tab.info') }, { id: 'cards', label: t('profile.tab.cards') }, { id: 'notifications', label: t('profile.tab.notifications') }, { id: 'reviews', label: t('profile.tab.reviews') }, { id: 'finance', label: t('profile.tab.finance') }, { id: 'referral', label: t('profile.tab.referral') }, ...hasAutoResponse ? [ { id: 'auto_response', label: t('profile.tab.auto_response', 'Auto response') } ] : [], ...(dashData === null || dashData === void 0 ? void 0 : (_dashData_features1 = dashData.features) === null || _dashData_features1 === void 0 ? void 0 : _dashData_features1.hasPersonalSite) ? [ { id: 'site', label: t('profile.tab.site') } ] : [] ] : [ { id: 'info', label: t('profile.tab.info') }, { id: 'cards', label: t('profile.tab.cards') }, { id: 'notifications', label: t('profile.tab.notifications') }, { id: 'reviews', label: t('profile.tab.reviews') }, { id: 'finance', label: t('profile.tab.finance') }, { id: 'referral', label: t('profile.tab.referral') }, ...(dashData === null || dashData === void 0 ? void 0 : (_dashData_features2 = dashData.features) === null || _dashData_features2 === void 0 ? void 0 : _dashData_features2.hasPersonalSite) ? [ { id: 'site', label: t('profile.tab.site') } ] : [] ]; var _user_lastName1, _user_name, _user_balance, _user_plan_features, _user_plan_name; return /*#__PURE__*/ _jsxs("div", { className: "max-w-4xl mx-auto px-4 py-8", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-4 mb-6", children: [ /*#__PURE__*/ _jsx("div", { className: "w-14 h-14 rounded-full flex-shrink-0 overflow-hidden border-2 border-white/40 flex items-center justify-center text-green-700 text-xl font-bold bg-green-100 cursor-pointer", onClick: ()=>{ var _fileRef_current; setActiveTab('info'); (_fileRef_current = fileRef.current) === null || _fileRef_current === void 0 ? void 0 : _fileRef_current.click(); }, title: t('profile.photo.change'), children: (user === null || user === void 0 ? void 0 : user.image) ? /*#__PURE__*/ _jsx("img", { src: user.image, alt: user.name, className: "w-full h-full object-cover" }) : initials }), /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ _jsx("h1", { className: "text-xl font-bold text-white leading-tight", children: (user === null || user === void 0 ? void 0 : user.firstName) ? "".concat(user.firstName, " ").concat((_user_lastName1 = user.lastName) !== null && _user_lastName1 !== void 0 ? _user_lastName1 : '').trim() : (_user_name = user === null || user === void 0 ? void 0 : user.name) !== null && _user_name !== void 0 ? _user_name : t('nav.profile') }), myRating && /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-1 mt-0.5", children: [ /*#__PURE__*/ _jsx("span", { className: "text-yellow-300", children: "★" }), /*#__PURE__*/ _jsx("span", { className: "font-semibold text-white text-sm", children: Number(myRating).toFixed(1) }), myReviews !== null && myReviews.length > 0 && /*#__PURE__*/ _jsxs("span", { className: "text-white/60 text-xs", children: [ "(", myReviews.length, ")" ] }) ] }) ] }) ] }), !cardsLoading && cards.length === 0 && /*#__PURE__*/ _jsx("div", { className: "mb-6 rounded-2xl border border-amber-300 bg-amber-50/95 p-4 sm:p-5 shadow-sm", children: /*#__PURE__*/ _jsxs("div", { className: "flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "text-sm font-semibold text-amber-950", children: t('profile.cards.empty', 'No offers yet') }), /*#__PURE__*/ _jsx("p", { className: "text-xs leading-relaxed text-amber-800 mt-1 max-w-2xl", children: t('profile.cards.empty_hint', 'СПзЎайте первую картПчку, чтПбы пПказать услугО клОеМтаЌ.') }) ] }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>{ setActiveTab('cards'); setShowNewCardForm(true); }, className: "inline-flex items-center justify-center rounded-xl bg-amber-600 px-4 py-2 text-sm font-semibold text-white transition hover:bg-amber-700", children: t('profile.cards.create_first') }) ] }) }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-6 items-start", children: [ tabs.length > 1 && /*#__PURE__*/ _jsx("aside", { className: "w-52 shrink-0 hidden sm:block", children: /*#__PURE__*/ _jsx("nav", { className: "rounded-2xl overflow-hidden bg-white/10 backdrop-blur-sm", children: tabs.map((tab)=>/*#__PURE__*/ _jsxs("button", { type: "button", onClick: ()=>setActiveTab(tab.id), className: "w-full text-left px-4 py-3 text-sm font-medium transition border-b border-white/10 last:border-0 flex items-center gap-3 ".concat(activeTab === tab.id ? 'bg-white text-green-700' : 'text-white/80 hover:bg-white/10 hover:text-white'), children: [ tabIcons[tab.id], /*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-1.5", children: [ tab.label, tabNeedsAttention[tab.id] && /*#__PURE__*/ _jsx("span", { className: "inline-flex items-center justify-center w-4 h-4 rounded-full bg-amber-500 text-white text-[10px] font-bold", children: "!" }) ] }) ] }, tab.id)) }) }), /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-0", children: [ tabs.length > 1 && /*#__PURE__*/ _jsx("div", { className: "flex sm:hidden bg-white/15 backdrop-blur rounded-xl p-1 mb-4 gap-1 overflow-x-auto", children: tabs.map((tab)=>/*#__PURE__*/ _jsxs("button", { type: "button", onClick: ()=>setActiveTab(tab.id), className: "flex-1 min-w-fit px-3 py-2 text-xs font-medium rounded-lg transition whitespace-nowrap flex flex-col items-center gap-0.5 ".concat(activeTab === tab.id ? 'bg-white text-green-700 shadow-sm' : 'text-white/80 hover:text-white hover:bg-white/10'), children: [ tabIcons[tab.id], /*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-1.5", children: [ tab.label, tabNeedsAttention[tab.id] && /*#__PURE__*/ _jsx("span", { className: "inline-flex items-center justify-center w-4 h-4 rounded-full bg-amber-500 text-white text-[10px] font-bold", children: "!" }) ] }) ] }, tab.id)) }), activeTab === 'cards' && /*#__PURE__*/ _jsxs("div", { className: "space-y-4", children: [ error && /*#__PURE__*/ _jsx("div", { className: "bg-red-50 text-red-700 p-3 rounded-lg text-sm", children: error }), listingMissing.length > 0 && /*#__PURE__*/ _jsxs("div", { className: "bg-amber-50 border border-amber-300 rounded-xl p-4", children: [ /*#__PURE__*/ _jsx("p", { className: "text-sm font-semibold text-amber-900", children: t('profile.listing_requirements.title', 'Your profile is not shown yet in offers') }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-amber-800 mt-1", children: t('profile.listing_requirements.hint', 'To make the card visible, complete these conditions:') }), /*#__PURE__*/ _jsx("ul", { className: "mt-2 list-disc pl-5 text-xs text-amber-900 space-y-0.5", children: listingMissing.map((item)=>/*#__PURE__*/ _jsx("li", { children: item }, item)) }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between", children: [ /*#__PURE__*/ _jsxs("p", { className: "text-sm text-white/70", children: [ t('profile.cards.count'), ": ", cards.length, " / ", maxCards === null ? '∞' : maxCards ] }), /*#__PURE__*/ _jsxs("button", { type: "button", onClick: ()=>{ if (maxCards !== null && cards.length >= maxCards) { setShowUpgradeModal(true); } else { setShowNewCardForm(true); } }, className: "flex items-center gap-1.5 text-sm font-medium text-white hover:text-white/80", children: [ "+ ", t('profile.cards.add') ] }) ] }), showNewCardForm && /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-green-200 p-4 space-y-3", children: [ /*#__PURE__*/ _jsx("p", { className: "text-sm font-medium text-gray-800", children: t('profile.cards.new_title') }), /*#__PURE__*/ _jsx("input", { value: newCardTitle, onChange: (e)=>setNewCardTitle(e.target.value), onKeyDown: (e)=>{ if (e.key === 'Enter') handleCreateCard(); }, maxLength: 200, placeholder: t('profile.cards.placeholder'), autoFocus: true, 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" }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-2", children: [ /*#__PURE__*/ _jsx("button", { type: "button", onClick: handleCreateCard, disabled: creatingCard || !newCardTitle.trim(), className: "px-4 py-2 bg-green-600 hover:bg-green-700 text-white rounded-lg text-sm font-medium disabled:opacity-50", children: creatingCard ? '...' : t('profile.cards.create') }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>{ setShowNewCardForm(false); setNewCardTitle(''); }, className: "px-4 py-2 bg-gray-100 hover:bg-gray-200 text-gray-700 rounded-lg text-sm font-medium", children: t('profile.cards.cancel') }) ] }) ] }), cardsLoading && /*#__PURE__*/ _jsx("div", { className: "text-center py-10 text-white/70", children: t('common.loading') }), !cardsLoading && cards.length === 0 && !showNewCardForm && /*#__PURE__*/ _jsxs("div", { className: "text-center py-14 border-2 border-dashed border-white/30 rounded-xl", children: [ /*#__PURE__*/ _jsx("p", { className: "text-white/70 text-sm mb-3", children: t('profile.cards.empty') }), /*#__PURE__*/ _jsxs("button", { type: "button", onClick: ()=>setShowNewCardForm(true), className: "text-sm text-white font-medium hover:underline", children: [ "+ ", t('profile.cards.create_first') ] }) ] }), cards.map((card)=>{ var _dashData_features; const cardIssues = []; if (!profileBio) { cardIssues.push(t('profile.listing_requirements.bio', 'Add a short bio in the main profile section')); } var _card_publicationStatus; const publicationStatus = (_card_publicationStatus = card.publicationStatus) !== null && _card_publicationStatus !== void 0 ? _card_publicationStatus : card.isActive ? 'active' : 'inactive'; if (publicationStatus === 'pending') { cardIssues.push(t('profile.listing_requirements.review_pending', 'Card is under review')); } else if (publicationStatus !== 'active') { cardIssues.push(t('profile.listing_requirements.card_inactive', 'Make the card active')); } if (!card.categories || card.categories.length === 0) { cardIssues.push(t('profile.listing_requirements.categories', 'Add at least one category to the active card')); } if (!card.locations || card.locations.length === 0) { cardIssues.push(t('profile.listing_requirements.locations', 'Add at least one location to the active card')); } var _moderationNoticeByCardId_card_id; return /*#__PURE__*/ _jsx(SpecialistCardEditor, { card: card, isOpen: openCardId === card.id, onToggle: ()=>setOpenCardId(card.id), onUpdate: (updated)=>setCards((prev)=>prev.map((c)=>c.id === updated.id ? updated : c)), onDelete: ()=>handleDeleteCard(card.id), categories: categories, locationTree: locationTree, catLocale: catLocale, locale: locale, hasPriceList: !!(dashData === null || dashData === void 0 ? void 0 : (_dashData_features = dashData.features) === null || _dashData_features === void 0 ? void 0 : _dashData_features.hasPriceList), visibilityIssues: cardIssues, moderationNotice: (_moderationNoticeByCardId_card_id = moderationNoticeByCardId[card.id]) !== null && _moderationNoticeByCardId_card_id !== void 0 ? _moderationNoticeByCardId_card_id : null }, card.id); }) ] }), activeTab === 'site' && /*#__PURE__*/ _jsxs("div", { className: "space-y-5", children: [ /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6 space-y-4", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("h2", { className: "font-semibold text-gray-800 mb-1", children: t('profile.site.title') }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400", children: t('profile.site_slug_hint') }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-500 mb-1.5", children: t('profile.site.url_label') }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 flex-wrap", children: [ /*#__PURE__*/ _jsx("span", { className: "text-sm text-gray-400 shrink-0", children: "canhelp.gr/site/" }), /*#__PURE__*/ _jsx("input", { value: personalSiteSlug, onChange: (e)=>setPersonalSiteSlug(e.target.value.toLowerCase().replace(/[^a-z0-9_-]/g, '')), placeholder: "my-slug", maxLength: 50, className: "flex-1 min-w-32 border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 flex-wrap", children: [ /*#__PURE__*/ _jsx("button", { type: "button", onClick: handleSaveSiteSlug, disabled: slugSaving, className: "px-5 py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700 disabled:opacity-50", children: slugSaving ? t('profile.saving') : t('common.save') }), slugSaved && /*#__PURE__*/ _jsxs("span", { className: "text-sm text-green-600", children: [ "✓ ", t('profile.saved') ] }), personalSiteSlug && /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs("button", { type: "button", onClick: ()=>{ navigator.clipboard.writeText("".concat(window.location.origin, "/site/").concat(personalSiteSlug)); setSlugCopied(true); setTimeout(()=>setSlugCopied(false), 2000); }, className: "px-3 py-2 border border-gray-300 rounded-lg text-sm text-gray-600 hover:bg-gray-50 flex items-center gap-1.5", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z" }) }), slugCopied ? t('profile.site.copied') : t('profile.site.copy') ] }), /*#__PURE__*/ _jsxs("a", { href: "/site/".concat(personalSiteSlug), target: "_blank", rel: "noopener noreferrer", className: "px-3 py-2 border border-green-200 bg-green-50 rounded-lg text-sm text-green-600 hover:bg-green-100 flex items-center gap-1.5", children: [ t('profile.site_open'), /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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" }) }) ] }) ] }) ] }), slugError && /*#__PURE__*/ _jsx("p", { className: "text-xs text-red-500", children: slugError }) ] }), /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between mb-4", children: [ /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-gray-800", children: t('profile.site.visible_title') }), siteSettingsSaving && /*#__PURE__*/ _jsx("span", { className: "text-xs text-gray-400", children: t('profile.saving', 'Saving...') }) ] }), /*#__PURE__*/ _jsx("div", { className: "space-y-3", children: [ { key: 'showBio', label: t('profile.site.visible.bio', 'Biography') }, { key: 'showRating', label: t('profile.site.visible.rating', 'Rating and reviews') }, { key: 'showReviews', label: t('profile.site.visible.reviews', 'Reviews section') }, { key: 'showServices', label: t('profile.site.visible.services', 'Service cards') }, { key: 'showPriceList', label: t('profile.site.visible.price_list', 'Price list') }, { key: 'showPortfolio', label: t('profile.site.visible.portfolio', 'Portfolio') }, { key: 'showPhone', label: t('profile.site.visible.contacts', 'Contact phone') }, { key: 'showFullLastName', label: t('profile.site.visible.full_last_name', 'Show full last name') }, { key: 'showStatus', label: t('profile.site.visible.status', 'Status "Available now"') } ].map((param)=>{ let { key, label } = param; const checked = siteSettings[key] !== false // undefined = true by default ; return /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-3 cursor-pointer group", children: [ /*#__PURE__*/ _jsx("div", { className: "w-5 h-5 rounded border-2 flex items-center justify-center transition shrink-0 ".concat(checked ? 'bg-green-600 border-green-600' : 'bg-white border-gray-300 group-hover:border-green-400'), onClick: ()=>{ const next = { ...siteSettings, [key]: !checked }; handleSaveSiteSettings(next); }, children: checked && /*#__PURE__*/ _jsx("svg", { className: "w-3 h-3 text-white", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 3, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4.5 12.75l6 6 9-13.5" }) }) }), /*#__PURE__*/ _jsx("span", { className: "text-sm text-gray-700 select-none", onClick: ()=>{ const next = { ...siteSettings, [key]: !checked }; handleSaveSiteSettings(next); }, children: label }) ] }, key); }) }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-4", children: t('profile.site.edit_bio_hint', 'Name and photo are always visible') }), /*#__PURE__*/ _jsxs("div", { className: "mt-6 pt-4 border-t border-gray-100", children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: t('profile.site.theme', 'Theme') }), /*#__PURE__*/ _jsx("div", { className: "flex gap-3", children: [ { value: 'dark', label: t('profile.site.theme.dark', 'Dark'), icon: '🌙' }, { value: 'light', label: t('profile.site.theme.light', 'Light'), icon: '☀' } ].map((opt)=>{ var _siteSettings_siteTheme; const selected = ((_siteSettings_siteTheme = siteSettings.siteTheme) !== null && _siteSettings_siteTheme !== void 0 ? _siteSettings_siteTheme : 'dark') === opt.value; return /*#__PURE__*/ _jsxs("button", { onClick: ()=>handleSaveSiteSettings({ ...siteSettings, siteTheme: opt.value }), className: "flex-1 flex items-center justify-center gap-2 px-4 py-2.5 rounded-xl border-2 text-sm font-medium transition ".concat(selected ? 'border-green-500 bg-green-50 text-green-700' : 'border-gray-200 bg-white text-gray-500 hover:border-gray-300'), children: [ /*#__PURE__*/ _jsx("span", { children: opt.icon }), opt.label ] }, opt.value); }) }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ _jsx("div", { className: "flex items-center justify-between mb-4", children: /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-gray-800", children: t('profile.site.stats.title', 'Site analytics') }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-0.5", children: t('profile.site.stats.days', 'last 30 days') }) ] }) }), !personalSiteSlug ? /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-400 py-4 text-center", children: t('profile.site.stats.no_slug', 'Set your site URL to view statistics') }) : siteStatsLoading || siteStats === null ? /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-400 py-4 text-center", children: t('profile.site.stats.loading', 'Loading analytics...') }) : (()=>{ const totalViews = siteStats.reduce((s, d)=>s + d.views, 0); const totalUnique = siteStats.reduce((s, d)=>s + d.unique, 0); const totalMessages = siteStats.reduce((s, d)=>s + d.messages, 0); // Area chart helpers const days = siteStats.map((d)=>d.date); const seriesDef = [ { vals: siteStats.map((d)=>d.views), color: '#3b82f6', fill: '#3b82f615', label: t('profile.site.stats.views', 'Views') }, { vals: siteStats.map((d)=>d.unique), color: '#8b5cf6', fill: '#8b5cf610', label: t('profile.site.stats.unique', 'Unique') }, { vals: siteStats.map((d)=>d.messages), color: '#10b981', fill: '#10b98110', label: t('profile.site.stats.messages', 'Messages') } ]; const maxVal = Math.max(...seriesDef.flatMap((s)=>s.vals), 1); const W = 580; const H = 160; const padL = 36; const padB = 22; const chartW = W - padL - 4; const chartH = H - padB; const stepX = chartW / (days.length - 1); function pts(vals) { return vals.map((v, i)=>[ padL + i * stepX, chartH - v / maxVal * chartH ]); } function smoothPath(points) { if (points.length < 2) return ''; let d = "M ".concat(points[0][0].toFixed(1), " ").concat(points[0][1].toFixed(1)); for(let i = 1; i < points.length; i++){ const cpx = ((points[i - 1][0] + points[i][0]) / 2).toFixed(1); d += " C ".concat(cpx, " ").concat(points[i - 1][1].toFixed(1), " ").concat(cpx, " ").concat(points[i][1].toFixed(1), " ").concat(points[i][0].toFixed(1), " ").concat(points[i][1].toFixed(1)); } return d; } function areaPath(vals) { const points = pts(vals); const line = smoothPath(points); if (!line) return ''; const lastX = points[points.length - 1][0].toFixed(1); return "".concat(line, " L ").concat(lastX, " ").concat(chartH.toFixed(1), " L ").concat(padL.toFixed(1), " ").concat(chartH.toFixed(1), " Z"); } function fmtY(v) { return v >= 1000 ? "".concat(Math.round(v / 1000), "K") : String(v); } const yTicks = [ 0, Math.round(maxVal / 3), Math.round(maxVal * 2 / 3), maxVal ]; const xTicks = days.map((d, i)=>({ i, label: d.slice(8) })).filter((_, i)=>i % 7 === 0 || i === days.length - 1); return /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx("div", { className: "grid grid-cols-3 gap-3 mb-5", children: [ { label: t('profile.site.stats.total_views', 'Views'), value: totalViews, color: 'text-green-600', bg: 'bg-green-50' }, { label: t('profile.site.stats.total_unique', 'Unique visitors'), value: totalUnique, color: 'text-violet-600', bg: 'bg-violet-50' }, { label: t('profile.site.stats.total_messages', 'Messages'), value: totalMessages, color: 'text-emerald-600', bg: 'bg-emerald-50' } ].map((card)=>/*#__PURE__*/ _jsxs("div", { className: "".concat(card.bg, " rounded-xl p-3 text-center"), children: [ /*#__PURE__*/ _jsx("div", { className: "text-2xl font-bold ".concat(card.color), children: card.value }), /*#__PURE__*/ _jsx("div", { className: "text-xs text-gray-500 mt-0.5", children: card.label }) ] }, card.label)) }), /*#__PURE__*/ _jsx("div", { className: "flex items-center gap-4 mb-2", children: seriesDef.map((s)=>/*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-1.5 text-xs text-gray-500", children: [ /*#__PURE__*/ _jsx("span", { className: "w-3 h-0.5 inline-block rounded", style: { background: s.color } }), s.label ] }, s.label)) }), /*#__PURE__*/ _jsx("div", { className: "overflow-x-auto", children: /*#__PURE__*/ _jsxs("svg", { viewBox: "0 0 ".concat(W, " ").concat(H + 12), className: "w-full", style: { minWidth: 320 }, children: [ yTicks.map((v, idx)=>{ const y = chartH - v / maxVal * chartH; return /*#__PURE__*/ _jsxs("g", { children: [ /*#__PURE__*/ _jsx("line", { x1: padL, y1: y, x2: W - 4, y2: y, stroke: "#f3f4f6", strokeWidth: 1 }), /*#__PURE__*/ _jsx("text", { x: padL - 5, y: y + 3.5, textAnchor: "end", fontSize: 9, fill: "#9ca3af", children: fmtY(v) }) ] }, "y-".concat(idx, "-").concat(v)); }), xTicks.map((param)=>{ let { i } = param; return /*#__PURE__*/ _jsx("line", { x1: padL + i * stepX, y1: 0, x2: padL + i * stepX, y2: chartH, stroke: "#f9fafb", strokeWidth: 1 }, "vg-".concat(i)); }), xTicks.map((param)=>{ let { i, label } = param; return /*#__PURE__*/ _jsx("text", { x: padL + i * stepX, y: H + 10, textAnchor: "middle", fontSize: 9, fill: "#9ca3af", children: label }, i); }), seriesDef.map((s, si)=>/*#__PURE__*/ _jsx("path", { d: areaPath(s.vals), fill: s.fill }, "fill-".concat(si))), seriesDef.map((s, si)=>/*#__PURE__*/ _jsx("path", { d: smoothPath(pts(s.vals)), fill: "none", stroke: s.color, strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round" }, "line-".concat(si))), seriesDef.map((s, si)=>{ const points = pts(s.vals); const last = points[points.length - 1]; return /*#__PURE__*/ _jsx("circle", { cx: last[0], cy: last[1], r: 4, fill: "white", stroke: s.color, strokeWidth: 2 }, "dot-".concat(si)); }), /*#__PURE__*/ _jsx("line", { x1: padL, y1: chartH, x2: W - 4, y2: chartH, stroke: "#e5e7eb", strokeWidth: 1 }) ] }) }) ] }); })() ] }) ] }), activeTab === 'reviews' && /*#__PURE__*/ _jsx("div", { className: "space-y-4", children: myReviews === null ? /*#__PURE__*/ _jsx("div", { className: "text-center py-10 text-white/70", children: t('common.loading') }) : myReviews.length === 0 ? /*#__PURE__*/ _jsxs("div", { className: "text-center py-20 text-white/60", children: [ /*#__PURE__*/ _jsx("p", { className: "text-4xl mb-3", children: "⭐" }), /*#__PURE__*/ _jsx("p", { children: t('profile.no_reviews') }) ] }) : myReviews.map((param)=>{ let { review, author } = param; var _author_name_, _author_name; var _author_name__toUpperCase, _author_name1; return /*#__PURE__*/ _jsx("div", { className: "bg-white rounded-xl border border-gray-200 p-4", children: /*#__PURE__*/ _jsxs("div", { className: "flex items-start gap-3", children: [ /*#__PURE__*/ _jsx("div", { className: "w-9 h-9 rounded-full bg-gray-100 flex-shrink-0 flex items-center justify-center text-gray-600 text-sm font-bold overflow-hidden", children: (author === null || author === void 0 ? void 0 : author.image) ? /*#__PURE__*/ _jsx("img", { src: author.image, alt: author.name, className: "w-full h-full object-cover" }) : (_author_name__toUpperCase = author === null || author === void 0 ? void 0 : (_author_name = author.name) === null || _author_name === void 0 ? void 0 : (_author_name_ = _author_name[0]) === null || _author_name_ === void 0 ? void 0 : _author_name_.toUpperCase()) !== null && _author_name__toUpperCase !== void 0 ? _author_name__toUpperCase : '?' }), /*#__PURE__*/ _jsxs("div", { className: "flex-1", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 mb-1", children: [ /*#__PURE__*/ _jsx("span", { className: "text-sm font-medium text-gray-800", children: (_author_name1 = author === null || author === void 0 ? void 0 : author.name) !== null && _author_name1 !== void 0 ? _author_name1 : '—' }), /*#__PURE__*/ _jsxs("span", { className: "text-yellow-400", children: [ '★'.repeat(review.rating), '☆'.repeat(5 - review.rating) ] }) ] }), review.comment && /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-600", children: review.comment }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-1", children: new Date(review.createdAt).toLocaleDateString() }) ] }) ] }) }, review.id); }) }), activeTab === 'finance' && /*#__PURE__*/ _jsxs("div", { className: "space-y-5", children: [ /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between mb-3", children: [ /*#__PURE__*/ _jsx("h2", { className: "font-semibold text-gray-800", children: t('profile.balance') }), /*#__PURE__*/ _jsxs("button", { onClick: ()=>{ setTopUpAmount(10); setTopUpError(''); setShowTopUpModal(true); }, className: "flex items-center gap-1.5 text-sm font-medium text-green-600 hover:text-green-700 hover:bg-green-50 px-3 py-1.5 rounded-lg transition-colors", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 4v16m8-8H4" }) }), t('profile.balance.topup') ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 p-4 bg-green-50 rounded-xl border border-green-100", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-6 h-6 text-green-600 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 8c-1.657 0-3 .895-3 2s1.343 2 3 2 3 .895 3 2-1.343 2-3 2m0-8c1.11 0 2.08.402 2.599 1M12 8V7m0 1v8m0 0v1m0-1c-1.11 0-2.08-.402-2.599-1M21 12a9 9 0 11-18 0 9 9 0 0118 0z" }) }), /*#__PURE__*/ _jsxs("span", { className: "text-xl font-bold text-green-700", children: [ parseFloat((_user_balance = user === null || user === void 0 ? void 0 : user.balance) !== null && _user_balance !== void 0 ? _user_balance : '0').toFixed(2), " EUR" ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "mt-4", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between mb-2", children: [ /*#__PURE__*/ _jsx("h3", { className: "text-sm font-semibold text-gray-800", children: t('profile.balance.history', 'Operation history') }), /*#__PURE__*/ _jsx("span", { className: "text-xs text-gray-400", children: t('profile.balance.history.last', 'Latest operations') }) ] }), balanceHistory.length === 0 ? /*#__PURE__*/ _jsx("div", { className: "rounded-xl border border-dashed border-gray-200 px-4 py-6 text-sm text-gray-400 text-center", children: t('profile.balance.history.empty', 'No operations yet') }) : /*#__PURE__*/ _jsx("div", { className: "space-y-2", children: balanceHistory.map((entry)=>{ const isCredit = entry.direction === 'credit'; const amount = Number(entry.amount).toFixed(2); const badgeClass = isCredit ? 'bg-emerald-50 text-emerald-700 border-emerald-100' : 'bg-rose-50 text-rose-700 border-rose-100'; const title = entry.kind === 'topup' ? t('profile.balance.history.kind.topup', 'Balance top-up') : entry.kind === 'plan_purchase' ? t('profile.balance.history.kind.plan_purchase', 'Plan charge') : entry.kind === 'admin_topup' ? t('profile.balance.history.kind.admin_topup', 'Admin top-up') : t('profile.balance.history.kind.admin_adjustment', 'Admin adjustment'); return /*#__PURE__*/ _jsxs("div", { className: "rounded-xl border border-gray-200 px-4 py-3", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-start justify-between gap-3", children: [ /*#__PURE__*/ _jsxs("div", { className: "min-w-0", children: [ /*#__PURE__*/ _jsx("div", { className: "text-sm font-medium text-gray-900", children: entry.description || title }), /*#__PURE__*/ _jsx("div", { className: "text-xs text-gray-500 mt-1", children: new Date(entry.createdAt).toLocaleString(dateLocale) }) ] }), /*#__PURE__*/ _jsxs("div", { className: "shrink-0 rounded-full border px-2.5 py-1 text-xs font-semibold ".concat(badgeClass), children: [ isCredit ? '+' : '-', amount, " ", entry.currency ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "mt-2 text-xs text-gray-500", children: [ t('profile.balance.history.balance_after', 'Balance after'), ": ", Number(entry.balanceAfter).toFixed(2), " ", entry.currency ] }) ] }, entry.id); }) }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ _jsx("h2", { className: "font-semibold text-gray-800 mb-4", children: t('profile.plan_history.title', 'Plan history') }), planHistory.length === 0 ? /*#__PURE__*/ _jsx("div", { className: "rounded-xl border border-dashed border-gray-200 px-4 py-6 text-sm text-gray-400 text-center", children: t('profile.plan_history.empty', 'Plan change history is empty') }) : /*#__PURE__*/ _jsx("div", { className: "space-y-2", children: planHistory.map((entry)=>{ const eventColors = { activated: 'bg-green-50 text-green-700 border-green-100', renewed: 'bg-emerald-50 text-emerald-700 border-emerald-100', downgraded: 'bg-rose-50 text-rose-700 border-rose-100', referral_reward: 'bg-amber-50 text-amber-700 border-amber-100', admin_change: 'bg-purple-50 text-purple-700 border-purple-100', expired: 'bg-gray-100 text-gray-600 border-gray-200' }; const eventLabels = { activated: t('profile.plan_history.event.activated', 'Activated'), renewed: t('profile.plan_history.event.renewed', 'Renewed'), downgraded: t('profile.plan_history.event.downgraded', 'Downgraded'), referral_reward: t('profile.plan_history.event.referral_reward', 'Referral reward'), admin_change: t('profile.plan_history.event.admin_change', 'Changed by admin'), expired: t('profile.plan_history.event.expired', 'Expired') }; var _eventColors_entry_event; const badgeClass = (_eventColors_entry_event = eventColors[entry.event]) !== null && _eventColors_entry_event !== void 0 ? _eventColors_entry_event : 'bg-gray-100 text-gray-600 border-gray-200'; var _eventLabels_entry_event; const label = (_eventLabels_entry_event = eventLabels[entry.event]) !== null && _eventLabels_entry_event !== void 0 ? _eventLabels_entry_event : entry.event; return /*#__PURE__*/ _jsx("div", { className: "rounded-xl border border-gray-200 px-4 py-3", children: /*#__PURE__*/ _jsxs("div", { className: "flex items-start justify-between gap-3", children: [ /*#__PURE__*/ _jsxs("div", { className: "min-w-0", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 flex-wrap", children: [ /*#__PURE__*/ _jsx("span", { className: "text-sm font-semibold text-gray-900", children: entry.planName }), entry.previousPlanName && entry.previousPlanName !== entry.planName && /*#__PURE__*/ _jsxs("span", { className: "text-xs text-gray-400", children: [ "← ", entry.previousPlanName ] }) ] }), /*#__PURE__*/ _jsx("div", { className: "text-xs text-gray-500 mt-1", children: new Date(entry.createdAt).toLocaleString(dateLocale) }), entry.expiresAt && /*#__PURE__*/ _jsxs("div", { className: "text-xs text-gray-500 mt-0.5", children: [ t('profile.plan_history.expires', 'Until'), ": ", new Date(entry.expiresAt).toLocaleDateString(dateLocale) ] }), entry.daysAdded && entry.event === 'referral_reward' && /*#__PURE__*/ _jsxs("div", { className: "text-xs text-amber-600 mt-0.5", children: [ "+", entry.daysAdded, " ", t('profile.plan_history.days', 'days') ] }), entry.note && /*#__PURE__*/ _jsx("div", { className: "text-xs text-gray-400 mt-0.5", children: entry.note }) ] }), /*#__PURE__*/ _jsx("span", { className: "shrink-0 rounded-full border px-2.5 py-1 text-xs font-semibold ".concat(badgeClass), children: label }) ] }) }, entry.id); }) }) ] }), showTopUpModal && /*#__PURE__*/ _jsx("div", { className: "fixed inset-0 z-50 flex items-end sm:items-center justify-center p-4 bg-black/40 backdrop-blur-sm", children: /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-2xl shadow-2xl w-full max-w-sm p-6", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between mb-5", children: [ /*#__PURE__*/ _jsx("h3", { className: "text-lg font-semibold text-gray-900", children: t('profile.balance.topup.title') }), /*#__PURE__*/ _jsx("button", { onClick: ()=>setShowTopUpModal(false), className: "text-gray-400 hover:text-gray-600", children: /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" }) }) }) ] }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-500 mb-3", children: t('profile.balance.topup.hint') }), /*#__PURE__*/ _jsx("div", { className: "grid grid-cols-4 gap-2 mb-4", children: [ 5, 10, 20, 50 ].map((v)=>/*#__PURE__*/ _jsxs("button", { onClick: ()=>setTopUpAmount(v), className: "py-2 rounded-xl text-sm font-semibold border transition-colors ".concat(Number(topUpAmount) === v ? 'bg-green-600 text-white border-green-600' : 'border-gray-200 text-gray-700 hover:border-green-400'), children: [ "€", v ] }, v)) }), /*#__PURE__*/ _jsxs("div", { className: "mb-5", children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('profile.balance.topup.amount') }), /*#__PURE__*/ _jsxs("div", { className: "relative", children: [ /*#__PURE__*/ _jsx("span", { className: "absolute left-3 top-1/2 -translate-y-1/2 text-gray-400 text-sm", children: "€" }), /*#__PURE__*/ _jsx("input", { type: "number", min: "1", max: "9999", step: "1", value: topUpAmount, onChange: (e)=>setTopUpAmount(e.target.value), className: "w-full pl-7 pr-4 py-2.5 border border-gray-300 rounded-xl text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }) ] }), topUpError && /*#__PURE__*/ _jsx("p", { className: "text-sm text-red-600 mb-3", children: topUpError }), /*#__PURE__*/ _jsx("button", { onClick: handleTopUp, disabled: topUpLoading || !Number(topUpAmount) || Number(topUpAmount) < 1, className: "w-full py-3 bg-green-600 hover:bg-green-700 disabled:bg-gray-300 disabled:cursor-not-allowed text-white font-semibold rounded-xl transition-colors flex items-center justify-center gap-2", children: topUpLoading ? /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs("svg", { className: "w-4 h-4 animate-spin", fill: "none", viewBox: "0 0 24 24", children: [ /*#__PURE__*/ _jsx("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }), /*#__PURE__*/ _jsx("path", { className: "opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8v8z" }) ] }), t('profile.balance.topup.loading') ] }) : t('profile.balance.topup.submit') }) ] }) }), /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ _jsx("h2", { className: "font-semibold text-gray-800 mb-3", children: t('profile.plan.title') }), (user === null || user === void 0 ? void 0 : user.plan) ? /*#__PURE__*/ _jsxs("div", { className: "flex items-start gap-3 p-4 bg-green-50 rounded-xl border border-green-100", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-6 h-6 text-gray-500 shrink-0 mt-0.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M3 10h18M7 15h1m4 0h1m-7 4h12a3 3 0 003-3V8a3 3 0 00-3-3H6a3 3 0 00-3 3v8a3 3 0 003 3z" }) }), /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ _jsx("p", { className: "font-semibold text-gray-900", children: user.plan.name }), user.plan.description && /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-500 mt-0.5", children: user.plan.description }), /*#__PURE__*/ _jsxs("div", { className: "flex flex-wrap gap-3 mt-2 text-xs text-gray-500", children: [ /*#__PURE__*/ _jsxs("span", { className: "font-medium text-green-700", children: [ user.plan.price, " ", user.plan.currency ] }), user.plan.maxCards != null ? /*#__PURE__*/ _jsxs("span", { children: [ t('profile.plan.cards_up_to'), " ", user.plan.maxCards ] }) : /*#__PURE__*/ _jsx("span", { children: t('profile.plan.cards_unlimited') }), user.plan.maxTasks != null && /*#__PURE__*/ _jsxs("span", { children: [ t('profile.plan.tasks_up_to'), " ", user.plan.maxTasks ] }), user.plan.maxOffers != null && /*#__PURE__*/ _jsxs("span", { children: [ t('profile.plan.offers_up_to'), " ", user.plan.maxOffers ] }), /*#__PURE__*/ _jsx("span", { className: user.planExpiresAt && new Date(user.planExpiresAt) < new Date(Date.now() + 7 * 24 * 60 * 60 * 1000) ? 'text-red-500 font-medium' : '', children: user.planExpiresAt ? "".concat(t('profile.plan.valid_until'), " ").concat(new Date(user.planExpiresAt).toLocaleDateString()) : t('profile.plan.no_expiry') }) ] }), ((_user_plan_features = user.plan.features) !== null && _user_plan_features !== void 0 ? _user_plan_features : []).length > 0 && /*#__PURE__*/ _jsx("ul", { className: "mt-2 space-y-0.5", children: user.plan.features.map((f, i)=>/*#__PURE__*/ _jsxs("li", { className: "text-xs text-gray-600 flex items-center gap-1.5", children: [ /*#__PURE__*/ _jsx("span", { className: "text-green-500", children: "✓" }), " ", f ] }, i)) }) ] }) ] }) : /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 p-4 bg-gray-50 rounded-xl border border-gray-100", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" }) }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "text-sm font-medium text-gray-700", children: t('profile.plan.basic') }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-0.5", children: t('profile.plan.contact_upgrade') }) ] }) ] }) ] }), /*#__PURE__*/ _jsx("div", { className: "text-center", children: /*#__PURE__*/ _jsxs("a", { href: "/pricing", className: "inline-flex items-center gap-1.5 text-sm font-medium text-white/70 hover:text-white transition", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M13 7l5 5m0 0l-5 5m5-5H6" }) }), t('pricing.title', 'Pricing') ] }) }) ] }), activeTab !== 'cards' && activeTab !== 'reviews' && activeTab !== 'finance' && activeTab !== 'site' && /*#__PURE__*/ _jsxs("form", { onSubmit: handleSubmit, className: "space-y-6", children: [ error && /*#__PURE__*/ _jsx("div", { className: "bg-red-50 text-red-700 p-3 rounded-lg text-sm", children: error }), saved && /*#__PURE__*/ _jsxs("div", { className: "bg-green-50 text-green-700 p-3 rounded-lg text-sm", children: [ "✓ ", t('profile.saved') ] }), activeTab === 'notifications' && /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6 space-y-6", children: [ /*#__PURE__*/ _jsx("h2", { className: "font-semibold text-gray-800", children: t('notifications.title') }), notifySaved && /*#__PURE__*/ _jsxs("div", { className: "bg-green-50 text-green-700 p-3 rounded-lg text-sm", children: [ "✓ ", t('notifications.saved') ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-start justify-between gap-4", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex-1", children: [ /*#__PURE__*/ _jsx("p", { className: "font-medium text-gray-800 text-sm", children: t('chat.notif_messages') }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-500 mt-0.5", children: t('notifications.messages.desc') }) ] }), /*#__PURE__*/ _jsx("button", { type: "button", disabled: notifySaving, onClick: async ()=>{ const next = !notifMessages; setNotifMessages(next); setNotifySaving(true); try { await api.request('/users/me', { method: 'PATCH', body: JSON.stringify({ notifMessages: next }) }); setNotifySaved(true); setTimeout(()=>setNotifySaved(false), 2500); } catch (e) { setNotifMessages(!next); } finally{ setNotifySaving(false); } }, className: "relative inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full transition-colors focus:outline-none focus:ring-2 focus:ring-green-500 focus:ring-offset-2 disabled:opacity-50 ".concat(notifMessages ? 'bg-green-600' : 'bg-gray-200'), role: "switch", "aria-checked": notifMessages, children: /*#__PURE__*/ _jsx("span", { className: "inline-block h-4 w-4 transform rounded-full bg-white shadow transition-transform ".concat(notifMessages ? 'translate-x-6' : 'translate-x-1') }) }) ] }), showSpecialistTabs && /*#__PURE__*/ _jsxs("div", { className: "flex items-start justify-between gap-4 ".concat(!(user === null || user === void 0 ? void 0 : (_user_plan = user.plan) === null || _user_plan === void 0 ? void 0 : _user_plan.notifyNewTasks) ? 'opacity-60' : ''), children: [ /*#__PURE__*/ _jsxs("div", { className: "flex-1", children: [ /*#__PURE__*/ _jsx("p", { className: "font-medium text-gray-800 text-sm", children: t('notifications.email.new_tasks') }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-500 mt-0.5", children: t('notifications.email.new_tasks.desc') }), !(user === null || user === void 0 ? void 0 : (_user_plan1 = user.plan) === null || _user_plan1 === void 0 ? void 0 : _user_plan1.notifyNewTasks) && /*#__PURE__*/ _jsxs("p", { className: "text-xs text-amber-600 mt-1", children: [ "\uD83D\uDD12 ", t('notifications.plan_required') ] }) ] }), /*#__PURE__*/ _jsx("button", { type: "button", disabled: notifySaving || !(user === null || user === void 0 ? void 0 : (_user_plan2 = user.plan) === null || _user_plan2 === void 0 ? void 0 : _user_plan2.notifyNewTasks), onClick: async ()=>{ const next = !notifyNewTasks; setNotifyNewTasks(next); setNotifySaving(true); try { await api.request('/users/me', { method: 'PATCH', body: JSON.stringify({ notifyNewTasks: next }) }); setNotifySaved(true); setTimeout(()=>setNotifySaved(false), 2500); } catch (e) { setNotifyNewTasks(!next); } finally{ setNotifySaving(false); } }, className: "relative inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full transition-colors focus:outline-none focus:ring-2 focus:ring-green-500 focus:ring-offset-2 disabled:opacity-50 ".concat(notifyNewTasks ? 'bg-green-600' : 'bg-gray-200'), role: "switch", "aria-checked": notifyNewTasks, children: /*#__PURE__*/ _jsx("span", { className: "inline-block h-4 w-4 transform rounded-full bg-white shadow transition-transform ".concat(notifyNewTasks ? 'translate-x-6' : 'translate-x-1') }) }) ] }) ] }), activeTab === 'referral' && /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6 space-y-5", children: [ /*#__PURE__*/ _jsx("h2", { className: "font-semibold text-gray-800", children: t('profile.referral.title') }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-500", children: t('profile.referral.desc') }), !referralLoaded ? /*#__PURE__*/ _jsx("div", { className: "text-sm text-gray-400", children: t('common.loading') }) : referralCode ? /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs font-medium text-gray-500 mb-1.5", children: t('profile.referral.link_label') }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2", children: [ /*#__PURE__*/ _jsx("input", { readOnly: true, value: "".concat("object" !== 'undefined' ? window.location.origin : '', "/register?ref=").concat(referralCode), className: "flex-1 text-sm border border-gray-200 rounded-lg px-3 py-2 bg-gray-50 text-gray-700 focus:outline-none" }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>{ navigator.clipboard.writeText("".concat(window.location.origin, "/register?ref=").concat(referralCode)); setReferralCopied(true); setTimeout(()=>setReferralCopied(false), 2000); }, className: "px-3 py-2 rounded-lg border border-gray-200 text-sm font-medium hover:bg-gray-50 transition whitespace-nowrap", children: referralCopied ? t('profile.referral.copied') : t('profile.referral.copy') }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 p-4 bg-green-50 rounded-xl", children: [ /*#__PURE__*/ _jsx("div", { className: "text-2xl font-bold text-green-700", children: referralCount }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-green-700", children: t('profile.referral.invited_count') }) ] }) ] }) : /*#__PURE__*/ _jsx("div", { className: "text-sm text-gray-400", children: t('profile.referral.no_code') }) ] }), activeTab === 'auto_response' && /*#__PURE__*/ _jsx(AutoResponseTab, { categories: categories, locationTree: locationTree, loaded: arLoaded, onLoad: ()=>{ if (arLoaded) return; api.getAutoResponseSettings().then((s)=>{ setAutoResponse(s); setArLoaded(true); }).catch(()=>setArLoaded(true)); }, settings: autoResponse, saving: arSaving, saved: arSaved, onSave: async (data)=>{ setArSaving(true); setArSaved(false); try { const updated = await api.updateAutoResponseSettings(data); setAutoResponse(updated); setArSaved(true); setTimeout(()=>setArSaved(false), 2500); } catch (e) {} finally{ setArSaving(false); } }, t: t, catLocale: catLocale }), activeTab === 'info' && /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ _jsx("h2", { className: "font-semibold text-gray-800 mb-4", children: t('profile.photo') }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-5", children: [ /*#__PURE__*/ _jsxs("div", { className: "relative", children: [ (user === null || user === void 0 ? void 0 : user.image) ? /*#__PURE__*/ _jsx("img", { src: user.image, alt: user.name, className: "w-20 h-20 rounded-full object-cover border-2 border-gray-200" }) : /*#__PURE__*/ _jsx("div", { className: "w-20 h-20 rounded-full bg-green-100 flex items-center justify-center text-green-700 text-2xl font-bold border-2 border-gray-200", children: initials }), avatarUploading && /*#__PURE__*/ _jsx("div", { className: "absolute inset-0 rounded-full bg-black/40 flex items-center justify-center", children: /*#__PURE__*/ _jsx("div", { className: "w-5 h-5 border-2 border-white border-t-transparent rounded-full animate-spin" }) }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>{ var _fileRef_current; return (_fileRef_current = fileRef.current) === null || _fileRef_current === void 0 ? void 0 : _fileRef_current.click(); }, disabled: avatarUploading, className: "bg-gray-100 hover:bg-gray-200 text-gray-700 px-4 py-2 rounded-lg text-sm font-medium disabled:opacity-50", children: t('profile.photo.change') }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-1", children: t('profile.photo.hint') }), /*#__PURE__*/ _jsx("input", { ref: fileRef, type: "file", accept: "image/jpeg,image/png,image/webp", className: "hidden", onChange: handleAvatarChange }), /*#__PURE__*/ _jsx("div", { className: "mt-3 rounded-lg border border-gray-200 bg-gray-50 px-3 py-2.5", children: isSpecialist ? (dashData === null || dashData === void 0 ? void 0 : (_dashData_features3 = dashData.features) === null || _dashData_features3 === void 0 ? void 0 : _dashData_features3.hasCanHelpNowStatus) ? /*#__PURE__*/ _jsxs("label", { className: "flex items-center justify-between cursor-pointer gap-3", children: [ /*#__PURE__*/ _jsx("span", { className: "text-xs font-medium text-gray-700", children: t('status.can_help_now', 'Available now') }), /*#__PURE__*/ _jsx("button", { type: "button", disabled: statusToggling === 'canhelp_now', onClick: async ()=>{ setStatusToggling('canhelp_now'); const nextActive = !myStatuses.includes('canhelp_now'); try { const res = await api.toggleStatus('canhelp_now', nextActive); setMyStatuses((prev)=>res.isActive ? [ ...prev.filter((s)=>s !== 'canhelp_now'), 'canhelp_now' ] : prev.filter((s)=>s !== 'canhelp_now')); } catch (e) {} finally{ setStatusToggling(null); } }, className: "relative inline-flex h-5 w-10 items-center rounded-full transition-colors ".concat(myStatuses.includes('canhelp_now') ? 'bg-green-500' : 'bg-gray-300', " disabled:opacity-50"), children: /*#__PURE__*/ _jsx("span", { className: "inline-block h-3.5 w-3.5 transform rounded-full bg-white shadow transition-transform ".concat(myStatuses.includes('canhelp_now') ? 'translate-x-5.5' : 'translate-x-1') }) }) ] }) : /*#__PURE__*/ _jsx("p", { className: "text-xs text-amber-700", children: t('status.plan_required', 'Status is unavailable on your current plan') }) : !isAdmin ? (dashData === null || dashData === void 0 ? void 0 : (_dashData_features4 = dashData.features) === null || _dashData_features4 === void 0 ? void 0 : _dashData_features4.hasNeedHelpStatus) ? /*#__PURE__*/ _jsxs("label", { className: "flex items-center justify-between cursor-pointer gap-3", children: [ /*#__PURE__*/ _jsx("span", { className: "text-xs font-medium text-gray-700", children: t('status.need_help', 'Need help') }), /*#__PURE__*/ _jsx("button", { type: "button", disabled: statusToggling === 'need_help', onClick: async ()=>{ setStatusToggling('need_help'); const nextActive = !myStatuses.includes('need_help'); try { const res = await api.toggleStatus('need_help', nextActive); setMyStatuses((prev)=>res.isActive ? [ ...prev.filter((s)=>s !== 'need_help'), 'need_help' ] : prev.filter((s)=>s !== 'need_help')); } catch (e) {} finally{ setStatusToggling(null); } }, className: "relative inline-flex h-5 w-10 items-center rounded-full transition-colors ".concat(myStatuses.includes('need_help') ? 'bg-green-500' : 'bg-gray-300', " disabled:opacity-50"), children: /*#__PURE__*/ _jsx("span", { className: "inline-block h-3.5 w-3.5 transform rounded-full bg-white shadow transition-transform ".concat(myStatuses.includes('need_help') ? 'translate-x-5.5' : 'translate-x-1') }) }) ] }) : /*#__PURE__*/ _jsx("p", { className: "text-xs text-amber-700", children: t('status.plan_required', 'Status is unavailable on your current plan') }) : /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-600", children: t('status.admin_not_applicable', 'User status is not applicable to admin accounts') }) }) ] }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ _jsx("h2", { className: "font-semibold text-gray-800 mb-4", children: t('profile.background.title', 'Profile header background') }), /*#__PURE__*/ _jsx("div", { className: "w-full h-40 rounded-2xl border border-gray-200 overflow-hidden relative", style: { backgroundImage: siteSettings.profileBackgroundImage ? "linear-gradient(135deg, rgba(22,163,74,0.45), rgba(21,128,61,0.65)), url(".concat(siteSettings.profileBackgroundImage, ")") : 'linear-gradient(135deg, #22c55e 0%, #16a34a 45%, #166534 100%)', backgroundSize: 'cover', backgroundPosition: 'center' }, children: backgroundUploading && /*#__PURE__*/ _jsx("div", { className: "absolute inset-0 bg-black/35 flex items-center justify-center", children: /*#__PURE__*/ _jsx("div", { className: "w-6 h-6 border-2 border-white border-t-transparent rounded-full animate-spin" }) }) }), /*#__PURE__*/ _jsxs("div", { className: "mt-4 flex flex-wrap gap-2", children: [ /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>{ var _backgroundFileRef_current; return (_backgroundFileRef_current = backgroundFileRef.current) === null || _backgroundFileRef_current === void 0 ? void 0 : _backgroundFileRef_current.click(); }, disabled: backgroundUploading, className: "bg-gray-100 hover:bg-gray-200 text-gray-700 px-4 py-2 rounded-lg text-sm font-medium disabled:opacity-50", children: backgroundUploading ? t('profile.photo.uploading', 'Uploading...') : t('profile.background.change', 'Change background') }), siteSettings.profileBackgroundImage && /*#__PURE__*/ _jsx("button", { type: "button", onClick: handleRemoveBackground, disabled: backgroundUploading, className: "bg-white hover:bg-gray-50 text-gray-700 px-4 py-2 rounded-lg text-sm font-medium border border-gray-200 disabled:opacity-50", children: t('profile.background.remove', 'Remove background') }), /*#__PURE__*/ _jsx("input", { ref: backgroundFileRef, type: "file", accept: "image/jpeg,image/png,image/webp", className: "hidden", onChange: handleBackgroundChange }) ] }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-2", children: t('profile.background.hint', 'Shown in the public profile header on web and mobile app.') }) ] }), /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6 space-y-4", children: [ /*#__PURE__*/ _jsx("h2", { className: "font-semibold text-gray-800", children: t('profile.basic_info') }), /*#__PURE__*/ _jsxs("div", { className: "grid grid-cols-2 gap-4", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('register.first_name') }), /*#__PURE__*/ _jsx("input", { value: formData.firstName, onChange: (e)=>setFormData({ ...formData, firstName: e.target.value }), required: true, className: "w-full border border-gray-300 rounded-lg px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-400 text-sm" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('register.last_name') }), /*#__PURE__*/ _jsx("input", { value: formData.lastName, onChange: (e)=>setFormData({ ...formData, lastName: e.target.value }), required: true, className: "w-full border border-gray-300 rounded-lg px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-400 text-sm" }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: "Email" }), /*#__PURE__*/ _jsx("input", { value: user === null || user === void 0 ? void 0 : user.email, disabled: true, className: "w-full border border-gray-200 rounded-lg px-3 py-2 text-sm text-gray-400 bg-gray-50 cursor-not-allowed" }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between mt-1.5", children: [ (user === null || user === void 0 ? void 0 : user.emailVerified) ? /*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-1 text-xs text-green-600", children: [ /*#__PURE__*/ _jsx("span", { className: "inline-block w-1.5 h-1.5 rounded-full bg-green-500" }), t('profile.email.verified') ] }) : /*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-1 text-xs text-amber-600", children: [ /*#__PURE__*/ _jsx("span", { className: "inline-block w-1.5 h-1.5 rounded-full bg-amber-500" }), t('profile.email.not_verified') ] }), !(user === null || user === void 0 ? void 0 : user.emailVerified) && /*#__PURE__*/ _jsx("button", { type: "button", disabled: resendState !== 'idle', onClick: handleResendVerification, className: "text-xs text-green-600 hover:underline disabled:opacity-60 disabled:no-underline", children: resendState === 'sending' ? t('login.unverified.sending') : resendState === 'sent' ? t('login.unverified.sent') : t('login.unverified.resend') }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('profile.phone') }), /*#__PURE__*/ _jsx("input", { type: "tel", value: formData.phone, onChange: (e)=>setFormData({ ...formData, phone: e.target.value }), placeholder: t('profile.phone.placeholder'), className: "w-full border border-gray-300 rounded-lg px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-400 text-sm" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('profile.bio') }), /*#__PURE__*/ _jsx("textarea", { value: formData.bio, onChange: (e)=>setFormData({ ...formData, bio: e.target.value }), rows: 3, maxLength: 1000, placeholder: t('profile.bio.placeholder'), className: "w-full border border-gray-300 rounded-lg px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-400 text-sm resize-none" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('profile.language') }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mb-2", children: t('profile.language.hint') }), /*#__PURE__*/ _jsxs("select", { value: formData.locale, onChange: (e)=>setFormData({ ...formData, locale: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400", children: [ /*#__PURE__*/ _jsx("option", { value: "el", children: "ΕλληΜικά" }), /*#__PURE__*/ _jsx("option", { value: "en", children: "English" }), /*#__PURE__*/ _jsx("option", { value: "ru", children: "РусскОй" }), /*#__PURE__*/ _jsx("option", { value: "uk", children: "УкраїМська" }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('profile.languages') }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mb-2", children: t('profile.languages.hint') }), /*#__PURE__*/ _jsx("div", { className: "flex flex-wrap gap-2", children: [ { code: 'el', flag: '🇬🇷', label: 'ΕλληΜικά' }, { code: 'en', flag: '🇬🇧', label: 'English' }, { code: 'ru', flag: '🇷🇺', label: 'РусскОй' }, { code: 'uk', flag: '🇺🇊', label: 'УкраїМська' }, { code: 'de', flag: '🇩🇪', label: 'Deutsch' }, { code: 'fr', flag: '🇫🇷', label: 'Français' }, { code: 'it', flag: '🇮🇹', label: 'Italiano' }, { code: 'es', flag: '🇪🇞', label: 'Español' }, { code: 'ar', flag: '🇞🇊', label: 'العرؚية' }, { code: 'zh', flag: '🇚🇳', label: 'äž­æ–‡' } ].map((param)=>{ let { code, flag, label } = param; const selected = selectedLanguages.includes(code); return /*#__PURE__*/ _jsxs("button", { type: "button", onClick: ()=>setSelectedLanguages(selected ? selectedLanguages.filter((l)=>l !== code) : [ ...selectedLanguages, code ]), className: "flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-sm border transition ".concat(selected ? 'bg-green-600 border-green-600 text-white' : 'bg-white border-gray-300 text-gray-700 hover:border-green-400'), children: [ /*#__PURE__*/ _jsx("span", { children: flag }), /*#__PURE__*/ _jsx("span", { children: label }) ] }, code); }) }) ] }) ] }), !isSpecialist && !isAdmin && /*#__PURE__*/ _jsx("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: /*#__PURE__*/ _jsxs("div", { className: "p-4 bg-purple-50 rounded-xl", children: [ /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-600 mb-3", children: t('profile.become_specialist.desc') }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: handleBecomeSpecialist, disabled: becomingSpecialist, className: "bg-purple-600 hover:bg-purple-700 text-white px-5 py-2 rounded-lg text-sm font-semibold disabled:opacity-50", children: becomingSpecialist ? t('common.loading') : t('profile.become_specialist') }) ] }) }), isSpecialist && ((dashData === null || dashData === void 0 ? void 0 : (_dashData_plan = dashData.plan) === null || _dashData_plan === void 0 ? void 0 : _dashData_plan.tier) === 'pro' || (dashData === null || dashData === void 0 ? void 0 : (_dashData_plan1 = dashData.plan) === null || _dashData_plan1 === void 0 ? void 0 : _dashData_plan1.tier) === 'ultimate') && /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ _jsx("h2", { className: "font-semibold text-gray-800 mb-4", children: t('profile.show_contact', 'Show contacts') }), /*#__PURE__*/ _jsxs("label", { className: "flex items-center justify-between cursor-pointer gap-3", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "text-sm font-medium text-gray-800", children: t('profile.show_contact_hint', 'Clients can see your phone number') }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-0.5", children: t('profile.show_contact_desc', 'Lets clients contact you directly') }) ] }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setShowContactInfo((v)=>!v), className: "relative inline-flex h-6 w-11 items-center rounded-full transition-colors ".concat(showContactInfo ? 'bg-green-500' : 'bg-gray-300'), children: /*#__PURE__*/ _jsx("span", { className: "inline-block h-4 w-4 transform rounded-full bg-white shadow transition-transform ".concat(showContactInfo ? 'translate-x-6' : 'translate-x-1') }) }) ] }) ] }) ] }), /*#__PURE__*/ _jsx("button", { type: "submit", disabled: saving, className: "w-full bg-green-600 text-white py-3 rounded-xl font-semibold hover:bg-green-700 disabled:opacity-50 disabled:cursor-not-allowed ".concat(activeTab === 'notifications' || activeTab === 'referral' || activeTab === 'auto_response' ? 'hidden' : ''), children: saving ? t('profile.saving') : t('common.save') }) ] }), showUpgradeModal && /*#__PURE__*/ _jsx("div", { className: "fixed inset-0 z-50 flex items-center justify-center bg-black/50 px-4", children: /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-2xl shadow-xl p-6 w-full max-w-md", children: [ /*#__PURE__*/ _jsx("div", { className: "text-center mb-5", children: /*#__PURE__*/ _jsx("span", { className: "text-5xl", children: "\uD83D\uDE80" }) }), /*#__PURE__*/ _jsx("h2", { className: "text-lg font-bold text-gray-900 text-center mb-2", children: t('profile.upgrade.cards_limit') }), /*#__PURE__*/ _jsxs("p", { className: "text-sm text-gray-600 text-center mb-4", children: [ (_user_plan_name = user === null || user === void 0 ? void 0 : (_user_plan3 = user.plan) === null || _user_plan3 === void 0 ? void 0 : _user_plan3.name) !== null && _user_plan_name !== void 0 ? _user_plan_name : t('profile.plan.basic'), " — ", t('profile.plan.cards_up_to'), " ", maxCards ] }), (user === null || user === void 0 ? void 0 : user.plan) && /*#__PURE__*/ _jsxs("div", { className: "bg-gray-50 rounded-xl p-4 mb-5 text-sm text-gray-600 text-center", children: [ /*#__PURE__*/ _jsx("span", { className: "font-medium text-gray-800", children: t('profile.upgrade.plan') }), ' ', user.plan.name, " — ", user.plan.price, " ", user.plan.currency ] }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 text-center mb-5", children: t('profile.upgrade.contact') }), /*#__PURE__*/ _jsx("button", { onClick: ()=>setShowUpgradeModal(false), className: "w-full bg-green-600 hover:bg-green-700 text-white py-2.5 rounded-xl text-sm font-semibold", children: t('profile.upgrade.ok') }) ] }) }) ] }) ] }) ] }); } @¶`=_’”ÑÓDFrt”–áÇÏ3:el˜ŸÑØ.5ñøŽ»w~3_:»ÂÎÕ› ¢ v } Ã Ê g n ¢ © Ø ß  5 :  ˆ Ã Ê  > E p _w  BIT\è÷ò Èß„›ÏåQg/7q‡ì8 O p'Ž'“'©'o*_…*À+Ö+ 1 1—1›1o2s2q3t3}4€4667 7w:z:<<g<k<,=/=A>D> ??@@uA_xACCªD­DvEyE…G‰G"H&HÇHÊH S€S%T)TV“VTYWYçZëZß[â[i]l]C`G`aa°a_Žac cŒeeJfMfýij2l5lfnjn†q‰qaueuÞuâuÔv×vyy2z5z7zBz0{@{‚}…}­€_±€»Ÿ „„ΆцƊʊC‹G‹9Œ<ŒjŽmސ!“%“/”2”{–~–:™=™Ë™Î™µš¹š»šÃšH›_K›ºœŸœ·ºÁžÅžÇžÏžjŸmŸ££•¥˜¥ šššš³š¶š+ª.ª}­€­š°°o±s±œ² ²Ÿ³_Á³mµpµ±·µ·oºrºåœéœüŸÿŸ‚ÂÆÆÇÇâÊåÊ&Ï*Ï,Ð/ÐÁÒÄÒsØvØ:Ù>ÙÄÜÈܓÝ_–ÝŒà¿à’ã–ãPäTäÍäÐäè!è#è+è¶è¹èjênêpêxê-ì0ì~îî¢ï¥ïÔðØðëñîñµó¹óýô_õ÷“÷çýêý—þšþ:>,0ADÚÞ„‡`c^ b ÷ û l o ˜ › Æ Ê ;_>fi §ªfiŽ Ÿ–™¯³   “ 9!=!ž!¡! "£"ï#ò#D%G%“&_—&7':'((±(µ()!)8*;*²,¶,-"-9.<.Ü0à091<1@2C2>4B4›4ž4€5§5à7ä7z8_}8f9i9Œ;À;V<Y<==@={A~AcDfDOH]HH“H•HœHÙHÜHJJ:JHJvJJžJŠJ3L:LL_–LÁLÈLñLøL M'MOMVMMˆM0N7NtN{NŠN­NßNæN&O-O\OcO˜OŸOÕOÜOPPZPaP©P_°PãPêPBQIQ…QŒQÐQ×QõQúQ!R&RR†RŸRÅRúRS5S&¡'¥'ä(ç(Ü*à*,",£.Š.å2é2‚3…3ô4÷49 9¹9Œ9);,;§?_«?D@G@¹AŒAC!C;F>F˜G›GôH÷HPJSJ‘L•L.M1M€N§N P PîaòaÖeÙeîfñfðiói³j_·jŠk©kmm×qÛqÑrÔr,t0tHuLuõuøu©w¬wÑyÔyÆ{É{Œ~~BEûÿՂ؂rƒuƒ¢„J¥„ӅׅU‰Y‰UŠXŠADcŽfŽ€€€€€€€Ã(0,_context_locale__WEBPACK_IMPORTED_MODULE_4__/* .useLocale */ .Y)¯(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ­(0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)þþþþþþþ°(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)Œ_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getPriceList */ .CkÄ_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .createPriceListGroup */ .vDÄ_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .deletePriceListGroup */ .IcÄ_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .updatePriceListGroup */ .oDÃ_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .createPriceListItem */ .Z2Ã_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .deletePriceListItem */ .U9ùÃ_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getSkillSuggestions */ .rlÄ_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .updateSpecialistCard */ .zcÿ˜"https://api.canhelp.gr"0Ã_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .deletePortfolioItem */ .zBÃ_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .updatePortfolioItem */ .hl·(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)ÿÿ¶(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)ÿÿÿÿþþÿÿÿþÿÿÿÿþþÿþþÿÿþÿÿþÿþÿþÿÿÿþÿþþÿþÿÌ_components_CategoryIcon__WEBPACK_IMPORTED_MODULE_6__/* .CategoryIcon */ .EzÔ(0,_components_CategoryIcon__WEBPACK_IMPORTED_MODULE_6__/* .isCategoryIconUrl */ .V)ýüýýýüüýýýüýýýýü·react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragmentüûüûÿüüüûÿüüüüûûüüûüûüüûüüûüüüûûüüûûüûÿüûÿüüüûüûüûüüûüûüûüüûûüüûüüûüü®: react__WEBPACK_IMPORTED_MODULE_1__.useEffect­: react__WEBPACK_IMPORTED_MODULE_1__.useStateúùúùùúúúúùúùùúúùúúùúúùúúùúúùúúúú€ú«react__WEBPACK_IMPORTED_MODULE_1__.Suspenseùº(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)À(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useSearchParams)¿(0,_lib_auth__WEBPACK_IMPORTED_MODULE_3__/* .useSession */ .wV)æççççççççççççççççççççççèèççççççççççççççççççççççççççççççççœ_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .initiateTopUp */ .oh»_lib_auth__WEBPACK_IMPORTED_MODULE_3__/* .authClient */ .yKçÁ_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getMyReferralInfo */ .stäääæŒ_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getMyReviews */ .q7åŒ_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getSiteStats */ .RNää·_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Emœ_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getCategories */ .bWŒ_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getLocations */ .Vsœ_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getMyDashboard */ .Hœ_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getMyStatuses */ .z6Á_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getBalanceHistory */ .fmŸ_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getPlanHistory */ .ewœ_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getUserRating */ .BmÄ_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getMySpecialistCards */ .BbÀ_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getNotifications */ .Trööööã0ã0öã0ã0ööÄ_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .createSpecialistCard */ .eRÄ_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .deleteSpecialistCard */ .f5åååååååååååååååååääååäåäååäåääåååäååääåäåääåäåäååååääääååäåååäåäåäääååäåäååäåääèäååäåååääåååäåååååäååäåäåäååååäèåäåååäååääååååååååååäåååäååääåäååäääåäååäååäääååååäääååäääååååäääåäåääåååääååååååääåäååååäèäååäåäååäååäääåääååäåäååäåååäååäåääåäääåååôåääååäåôåäåååäèäåäå… true0äãääääÇ_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getAutoResponseSettings */ .GpÊ_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .updateAutoResponseSettings */ .RQáåáâááââââáââââáââŒ_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .toggleStatus */ .bcááàááÿáááàááááàááááàáààááàááàááààáàááàááàááàááàááááàáááàáááàááàáààááááááàáááààááဆbuffer†source„size„maps„hashÆ__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ ProfilePage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7541); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(1592); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(9906); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(2982); /* harmony import */ var _components_CategoryIcon__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(5940); /* __next_internal_client_entry_do_not_use__ default auto */ function SpecialistCardEditor(param) { let { card, isOpen, onToggle, onUpdate, onDelete, categories, locationTree, catLocale, locale, hasPriceList, visibilityIssues = [], moderationNotice = null } = param; const { t } = (0,_context_locale__WEBPACK_IMPORTED_MODULE_4__/* .useLocale */ .Y)(); const hasVisibilityIssues = visibilityIssues.length > 0; const [cardTab, setCardTab] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)('main'); const [saving, setSaving] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [savedOk, setSavedOk] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [localTitle, setLocalTitle] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(card.title); var _card_descriptionEl; const [localDescEl, setLocalDescEl] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)((_card_descriptionEl = card.descriptionEl) !== null && _card_descriptionEl !== void 0 ? _card_descriptionEl : ''); var _card_descriptionEn; const [localDescEn, setLocalDescEn] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)((_card_descriptionEn = card.descriptionEn) !== null && _card_descriptionEn !== void 0 ? _card_descriptionEn : ''); var _card_descriptionRu; const [localDescRu, setLocalDescRu] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)((_card_descriptionRu = card.descriptionRu) !== null && _card_descriptionRu !== void 0 ? _card_descriptionRu : ''); var _card_descriptionUk; const [localDescUk, setLocalDescUk] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)((_card_descriptionUk = card.descriptionUk) !== null && _card_descriptionUk !== void 0 ? _card_descriptionUk : ''); var _card_skills; const [localSkills, setLocalSkills] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)((_card_skills = card.skills) !== null && _card_skills !== void 0 ? _card_skills : []); const [skillInput, setSkillInput] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); var _card_categories; const [localCategories, setLocalCategories] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)((_card_categories = card.categories) !== null && _card_categories !== void 0 ? _card_categories : []); var _card_locations; const [localLocations, setLocalLocations] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)((_card_locations = card.locations) !== null && _card_locations !== void 0 ? _card_locations : []); var _card_publicationStatus; const [localPublicationStatus, setLocalPublicationStatus] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)((_card_publicationStatus = card.publicationStatus) !== null && _card_publicationStatus !== void 0 ? _card_publicationStatus : card.isActive ? 'active' : 'inactive'); const [apiSkillSugs, setApiSkillSugs] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); var _card_portfolio; const [portfolio, setPortfolio] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)((_card_portfolio = card.portfolio) !== null && _card_portfolio !== void 0 ? _card_portfolio : []); const [portfolioUploading, setPortfolioUploading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [editingItem, setEditingItem] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [editTitle, setEditTitle] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [editDesc, setEditDesc] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const portfolioFileRef = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null); // Price list state const [priceList, setPriceList] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [priceListLoading, setPriceListLoading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [newGroupTitle, setNewGroupTitle] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [addingGroupId, setAddingGroupId] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [newItem, setNewItem] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)({ name: '', description: '', price: '', unit: '' }); const [editingGroupId, setEditingGroupId] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [editGroupTitle, setEditGroupTitle] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (cardTab !== 'pricelist' || priceList.length > 0 || priceListLoading) return; setPriceListLoading(true); _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getPriceList */ .Ck(card.id, locale).then(setPriceList).catch(()=>{}).finally(()=>setPriceListLoading(false)); }, [ cardTab, locale ]); async function handleAddGroup() { if (!newGroupTitle.trim()) return; const group = await _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .createPriceListGroup */ .vD(card.id, { title: newGroupTitle.trim(), locale: [ 'el', 'en', 'ru', 'uk' ].includes(locale) ? locale : 'el', autoTranslate: true }); setPriceList((prev)=>[ ...prev, group ]); setNewGroupTitle(''); } async function handleDeleteGroup(groupId) { await _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .deletePriceListGroup */ .Ic(groupId); setPriceList((prev)=>prev.filter((g)=>g.id !== groupId)); } async function handleSaveGroupTitle(groupId) { const updated = await _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .updatePriceListGroup */ .oD(groupId, { title: editGroupTitle.trim(), locale: [ 'el', 'en', 'ru', 'uk' ].includes(locale) ? locale : 'el', autoTranslate: true }); setPriceList((prev)=>prev.map((g)=>g.id === groupId ? { ...g, title: updated.title } : g)); setEditingGroupId(null); } async function handleAddItem(groupId) { if (!newItem.name.trim()) return; const item = await _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .createPriceListItem */ .Z2(groupId, { name: newItem.name.trim(), description: newItem.description.trim() || null, price: newItem.price.trim() || null, unit: newItem.unit.trim() || null, locale: [ 'el', 'en', 'ru', 'uk' ].includes(locale) ? locale : 'el', autoTranslate: true }); setPriceList((prev)=>prev.map((g)=>g.id === groupId ? { ...g, items: [ ...g.items, item ] } : g)); setNewItem({ name: '', description: '', price: '', unit: '' }); setAddingGroupId(null); } async function handleDeleteItem(itemId, groupId) { await _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .deletePriceListItem */ .U9(itemId); setPriceList((prev)=>prev.map((g)=>g.id === groupId ? { ...g, items: g.items.filter((i)=>i.id !== itemId) } : g)); } (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (cardTab !== 'skills') return; _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getSkillSuggestions */ .rl(localCategories.length > 0 ? localCategories : undefined).then(setApiSkillSugs).catch(()=>setApiSkillSugs([])); }, [ localCategories, cardTab ]); const lbl = (ru, en, el)=>locale === 'ru' ? ru : locale === 'en' ? en : el; async function saveAll() { setSaving(true); try { const activeLocale = [ 'el', 'en', 'ru', 'uk' ].includes(locale) ? locale : 'el'; const cap = activeLocale.charAt(0).toUpperCase() + activeLocale.slice(1); const descField = "description".concat(cap); const descValue = { el: localDescEl, en: localDescEn, ru: localDescRu, uk: localDescUk }[activeLocale] || null; const updated = await _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .updateSpecialistCard */ .zc(card.id, { title: localTitle, [descField]: descValue, descriptionLocale: activeLocale, autoTranslate: !!descValue, skills: localSkills, categories: localCategories, locations: localLocations, publicationStatus: localPublicationStatus, isActive: localPublicationStatus === 'active' }); onUpdate({ ...updated, portfolio }); setSavedOk(true); setTimeout(()=>setSavedOk(false), 2000); } catch (e) {} finally{ setSaving(false); } } async function updatePublicationStatus(next) { setLocalPublicationStatus(next); try { await _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .updateSpecialistCard */ .zc(card.id, { publicationStatus: next, isActive: next === 'active' }); } catch (e) {} } function addSkill(s) { const trimmed = s.trim(); if (trimmed && !localSkills.includes(trimmed)) setLocalSkills([ ...localSkills, trimmed ]); setSkillInput(''); } function toggleCategory(slug) { let childSlugs = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : []; if (localCategories.includes(slug)) { setLocalCategories(localCategories.filter((c)=>c !== slug && !childSlugs.includes(c))); } else { setLocalCategories([ ...new Set([ ...localCategories, slug, ...childSlugs ]) ]); } } function toggleLocation(slug) { let childSlugs = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : []; if (localLocations.includes(slug)) { setLocalLocations(localLocations.filter((c)=>c !== slug && !childSlugs.includes(c))); } else { setLocalLocations([ ...new Set([ ...localLocations, slug, ...childSlugs ]) ]); } } async function handlePortfolioUpload(e) { var _e_target_files; const file = (_e_target_files = e.target.files) === null || _e_target_files === void 0 ? void 0 : _e_target_files[0]; if (!file) return; setPortfolioUploading(true); try { const form = new FormData(); form.append('file', file); form.append('cardId', card.id); const res = await fetch("".concat("https://api.canhelp.gr" || 0, "/api/portfolio"), { method: 'POST', credentials: 'include', body: form }); if (!res.ok) throw new Error('Upload failed'); const item = await res.json(); const next = [ ...portfolio, item ]; setPortfolio(next); onUpdate({ ...card, portfolio: next }); } catch (e) {} finally{ setPortfolioUploading(false); if (portfolioFileRef.current) portfolioFileRef.current.value = ''; } } async function handlePortfolioDelete(id) { try { await _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .deletePortfolioItem */ .zB(id); const next = portfolio.filter((p)=>p.id !== id); setPortfolio(next); onUpdate({ ...card, portfolio: next }); } catch (e) {} } async function handlePortfolioSave(id) { try { const item = await _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .updatePortfolioItem */ .hl(id, { title: editTitle, description: editDesc }); setPortfolio((prev)=>prev.map((p)=>p.id === id ? item : p)); setEditingItem(null); } catch (e) {} } const cardTabs = [ { id: 'main', label: t('profile.card.tab.main') }, { id: 'categories', label: t('profile.card.tab.categories') }, { id: 'skills', label: t('profile.card.tab.skills') }, { id: 'geography', label: t('profile.card.tab.geography') }, { id: 'pricelist', label: t('profile.card.tab.pricelist'), hidden: !hasPriceList }, { id: 'portfolio', label: t('profile.card.tab.portfolio') } ]; const pendingReviewNotice = localPublicationStatus === 'pending' ? { title: t('profile.card.review_pending', 'Pending approval'), body: t('profile.card.review_pending_hint', 'Your card is being reviewed by the admin team.'), tone: 'amber' } : null; const effectiveModerationNotice = moderationNotice !== null && moderationNotice !== void 0 ? moderationNotice : pendingReviewNotice; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 overflow-hidden", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-3 px-4 py-3 border-b border-gray-100 ".concat(hasVisibilityIssues ? 'bg-amber-50' : ''), children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { type: "button", onClick: onToggle, className: "flex-1 flex items-center gap-3 text-left", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-sm font-semibold text-gray-800 flex-1", children: localTitle || card.title }), hasVisibilityIssues && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "inline-flex items-center justify-center w-5 h-5 rounded-full bg-amber-500 text-white text-xs font-bold", title: t('profile.card.visibility_issue', 'Card is not shown in offers'), children: "!" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-gray-400 text-xs", children: isOpen ? '▲' : 'â–Œ' }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>updatePublicationStatus(localPublicationStatus === 'active' ? 'inactive' : localPublicationStatus === 'pending' ? 'inactive' : 'pending'), className: "px-3 py-1.5 rounded-lg text-xs font-medium whitespace-nowrap ".concat(localPublicationStatus === 'active' ? 'bg-red-50 text-red-700 hover:bg-red-100' : localPublicationStatus === 'pending' ? 'bg-amber-50 text-amber-700 hover:bg-amber-100' : 'bg-green-50 text-green-700 hover:bg-green-100'), children: localPublicationStatus === 'active' ? t('profile.card.unpublish', 'Unpublish') : localPublicationStatus === 'pending' ? t('profile.card.withdraw_review', 'Withdraw request') : t('profile.card.submit_review', 'Submit for review') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: onDelete, className: "text-red-400 hover:text-red-600 text-sm px-1 flex-shrink-0", title: t('profile.card.delete'), children: "\uD83D\uDDD1" }) ] }), isOpen && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ hasVisibilityIssues && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "mx-4 mt-4 mb-2 rounded-lg border border-amber-300 bg-amber-50 p-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs font-semibold text-amber-900", children: t('profile.card.visibility_issue', 'Card is not shown in offers') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("ul", { className: "mt-1.5 list-disc pl-4 text-xs text-amber-900 space-y-0.5", children: visibilityIssues.map((issue)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("li", { children: issue }, issue)) }) ] }), effectiveModerationNotice && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "mx-4 mt-4 mb-2 rounded-lg border p-3 ".concat(effectiveModerationNotice.tone === 'green' ? 'border-green-300 bg-green-50' : effectiveModerationNotice.tone === 'red' ? 'border-red-300 bg-red-50' : 'border-amber-300 bg-amber-50'), children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs font-semibold ".concat(effectiveModerationNotice.tone === 'green' ? 'text-green-900' : effectiveModerationNotice.tone === 'red' ? 'text-red-900' : 'text-amber-900'), children: effectiveModerationNotice.title }), effectiveModerationNotice.body && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "mt-1 text-xs ".concat(effectiveModerationNotice.tone === 'green' ? 'text-green-800' : effectiveModerationNotice.tone === 'red' ? 'text-red-800' : 'text-amber-800'), children: effectiveModerationNotice.body }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex overflow-x-auto border-b border-gray-100 bg-gray-50 gap-0", children: cardTabs.filter((t)=>!t.hidden).map((t)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>setCardTab(t.id), className: "px-4 py-2.5 text-xs font-medium whitespace-nowrap border-b-2 transition -mb-px ".concat(cardTab === t.id ? 'border-green-500 text-green-600 bg-white' : 'border-transparent text-gray-500 hover:text-gray-700'), children: t.label }, t.id)) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "p-4", children: [ cardTab === 'main' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: localTitle, onChange: (e)=>setLocalTitle(e.target.value), maxLength: 200, placeholder: t('profile.cards.new_title'), 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" }), (()=>{ const activeLocale = [ 'el', 'en', 'ru', 'uk' ].includes(locale) ? locale : 'el'; const descMap = { el: [ localDescEl, setLocalDescEl ], en: [ localDescEn, setLocalDescEn ], ru: [ localDescRu, setLocalDescRu ], uk: [ localDescUk, setLocalDescUk ] }; const [val, setVal] = descMap[activeLocale]; const flags = { el: '🇬🇷', en: '🇬🇧', ru: '🇷🇺', uk: '🇺🇊' }; const otherLocales = [ 'el', 'en', 'ru', 'uk' ].filter((l)=>l !== activeLocale); const otherHasContent = otherLocales.some((l)=>descMap[l][0]); return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "flex items-center gap-1.5 text-xs font-medium text-gray-500 mb-1", children: [ flags[activeLocale], " ", t('profile.card.description', 'Description') ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("textarea", { value: val, onChange: (e)=>setVal(e.target.value), rows: 4, maxLength: 2000, placeholder: t('profile.bio.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" }), val && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400 mt-1", children: t('profile.card.desc_auto_translate', 'Will be automatically translated into other languages on save') }), otherHasContent && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-1.5 mt-1.5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-xs text-gray-400", children: t('profile.card.desc_translated', 'Translations available:') }), otherLocales.map((l)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-xs px-1.5 py-0.5 rounded-full ".concat(descMap[l][0] ? 'bg-green-50 text-green-600' : 'bg-gray-100 text-gray-400'), children: flags[l] }, l)) ] }) ] }); })() ] }), cardTab === 'skills' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-3", children: [ localSkills.length > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex flex-wrap gap-2", children: localSkills.map((s)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "flex items-center gap-1.5 bg-green-50 text-green-700 text-sm px-3 py-1 rounded-full", children: [ s, /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>setLocalSkills(localSkills.filter((x)=>x !== s)), className: "text-gray-400 hover:text-green-700 leading-none", children: "\xd7" }) ] }, s)) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: skillInput, onChange: (e)=>setSkillInput(e.target.value), onKeyDown: (e)=>{ if (e.key === 'Enter') { e.preventDefault(); addSkill(skillInput); } }, placeholder: t('profile.card.skill.add'), 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" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>addSkill(skillInput), className: "px-3 py-2 bg-gray-100 hover:bg-gray-200 rounded-lg text-sm font-medium", children: "+" }) ] }), apiSkillSugs.length > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex flex-wrap gap-1.5", children: apiSkillSugs.map((s)=>{ var _s_names_catLocale; return (_s_names_catLocale = s.names[catLocale]) !== null && _s_names_catLocale !== void 0 ? _s_names_catLocale : s.names.el; }).filter((name, i, arr)=>arr.indexOf(name) === i && !localSkills.includes(name)).slice(0, 16).map((name)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { type: "button", onClick: ()=>addSkill(name), className: "text-xs px-2.5 py-1 border border-gray-200 rounded-full text-gray-500 hover:border-green-400 hover:text-green-600 transition", children: [ "+ ", name ] }, name)) }) ] }), cardTab === 'categories' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "space-y-3", children: categories.map((cat)=>{ var _cat_names, _cat_names1; var _cat_names_catLocale, _ref; const catName = (_ref = (_cat_names_catLocale = (_cat_names = cat.names) === null || _cat_names === void 0 ? void 0 : _cat_names[catLocale]) !== null && _cat_names_catLocale !== void 0 ? _cat_names_catLocale : (_cat_names1 = cat.names) === null || _cat_names1 === void 0 ? void 0 : _cat_names1.el) !== null && _ref !== void 0 ? _ref : cat.slug; var _cat_children; const children = (_cat_children = cat.children) !== null && _cat_children !== void 0 ? _cat_children : []; const childSlugs = children.map((c)=>c.slug); return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "flex items-center gap-2.5 cursor-pointer", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "checkbox", checked: localCategories.includes(cat.slug), onChange: ()=>toggleCategory(cat.slug, childSlugs), className: "w-4 h-4 rounded border-gray-300 text-green-600 focus:ring-blue-400" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "text-sm font-medium text-gray-800 inline-flex items-center gap-1", children: [ cat.icon && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components_CategoryIcon__WEBPACK_IMPORTED_MODULE_6__/* .CategoryIcon */ .Ez, { icon: cat.icon, alt: catName, className: (0,_components_CategoryIcon__WEBPACK_IMPORTED_MODULE_6__/* .isCategoryIconUrl */ .V)(cat.icon) ? 'h-4 w-4 object-contain' : 'text-sm leading-none', fallback: "\uD83D\uDCE6" }), catName ] }) ] }), children.length > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "ml-6 mt-2 space-y-2", children: children.map((sub)=>{ var _sub_names, _sub_names1; var _sub_names_catLocale, _ref; const subName = (_ref = (_sub_names_catLocale = (_sub_names = sub.names) === null || _sub_names === void 0 ? void 0 : _sub_names[catLocale]) !== null && _sub_names_catLocale !== void 0 ? _sub_names_catLocale : (_sub_names1 = sub.names) === null || _sub_names1 === void 0 ? void 0 : _sub_names1.el) !== null && _ref !== void 0 ? _ref : sub.slug; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "flex items-center gap-2.5 cursor-pointer", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "checkbox", checked: localCategories.includes(sub.slug), onChange: ()=>toggleCategory(sub.slug), className: "w-4 h-4 rounded border-gray-300 text-green-600 focus:ring-blue-400" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-sm text-gray-600", children: subName }) ] }, sub.id); }) }) ] }, cat.id); }) }), cardTab === 'geography' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "space-y-3", children: locationTree.map((city)=>{ var _city_names, _city_names1; var _city_names_catLocale, _ref; const cityName = (_ref = (_city_names_catLocale = (_city_names = city.names) === null || _city_names === void 0 ? void 0 : _city_names[catLocale]) !== null && _city_names_catLocale !== void 0 ? _city_names_catLocale : (_city_names1 = city.names) === null || _city_names1 === void 0 ? void 0 : _city_names1.el) !== null && _ref !== void 0 ? _ref : city.slug; var _city_children; const districts = (_city_children = city.children) !== null && _city_children !== void 0 ? _city_children : []; const districtSlugs = districts.map((d)=>d.slug); return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "flex items-center gap-2.5 cursor-pointer", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "checkbox", checked: localLocations.includes(city.slug), onChange: ()=>toggleLocation(city.slug, districtSlugs), className: "w-4 h-4 rounded border-gray-300 text-green-600 focus:ring-blue-400" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-sm font-medium text-gray-800", children: cityName }) ] }), districts.length > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "ml-6 mt-2 space-y-2", children: districts.map((d)=>{ var _d_names, _d_names1; var _d_names_catLocale, _ref; const dName = (_ref = (_d_names_catLocale = (_d_names = d.names) === null || _d_names === void 0 ? void 0 : _d_names[catLocale]) !== null && _d_names_catLocale !== void 0 ? _d_names_catLocale : (_d_names1 = d.names) === null || _d_names1 === void 0 ? void 0 : _d_names1.el) !== null && _ref !== void 0 ? _ref : d.slug; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "flex items-center gap-2.5 cursor-pointer", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "checkbox", checked: localLocations.includes(d.slug), onChange: ()=>toggleLocation(d.slug), className: "w-4 h-4 rounded border-gray-300 text-green-600 focus:ring-blue-400" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-sm text-gray-600", children: dName }) ] }, d.id); }) }) ] }, city.id); }) }), cardTab === 'pricelist' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "space-y-4", children: priceListLoading ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-center py-6 text-gray-400 text-sm", children: t('common.loading', 'Loading...') }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [ priceList.length === 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-center py-6 text-gray-400 text-sm border-2 border-dashed border-gray-200 rounded-xl", children: t('profile.card.pricelist.empty') }), priceList.map((group)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "border border-gray-200 rounded-xl overflow-hidden", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex items-center gap-2 bg-gray-50 px-4 py-2.5 border-b border-gray-200", children: editingGroupId === group.id ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: editGroupTitle, onChange: (e)=>setEditGroupTitle(e.target.value), className: "flex-1 border border-gray-300 rounded-lg px-3 py-1.5 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400", onKeyDown: (e)=>{ if (e.key === 'Enter') handleSaveGroupTitle(group.id); }, autoFocus: true }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>handleSaveGroupTitle(group.id), className: "px-3 py-1.5 bg-green-600 text-white rounded-lg text-xs font-medium hover:bg-green-700", children: t('profile.card.pricelist.save_group') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>setEditingGroupId(null), className: "px-2 py-1.5 text-gray-500 hover:text-gray-700 text-xs", children: "✕" }) ] }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "flex-1 font-semibold text-sm text-gray-800", children: group.title }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>{ setEditingGroupId(group.id); setEditGroupTitle(group.title); }, className: "text-gray-400 hover:text-green-600 text-xs px-2 py-1 rounded hover:bg-green-50", children: "✏" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>handleDeleteGroup(group.id), className: "text-gray-400 hover:text-red-500 text-xs px-2 py-1 rounded hover:bg-red-50", children: t('profile.card.pricelist.delete_group') }) ] }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "divide-y divide-gray-100", children: group.items.map((item)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-3 px-4 py-2.5 text-sm group", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "font-medium text-gray-800 truncate", children: item.name }), item.description && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-500 truncate", children: item.description }) ] }), (item.price || item.unit) && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "text-green-700 font-semibold text-sm whitespace-nowrap", children: [ item.price ? "€".concat(item.price) : '', item.unit ? " ".concat(item.unit) : '' ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>handleDeleteItem(item.id, group.id), className: "opacity-0 group-hover:opacity-100 text-red-400 hover:text-red-600 text-xs px-1 transition", children: t('profile.card.pricelist.delete_item') }) ] }, item.id)) }), addingGroupId === group.id ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "p-3 bg-green-50 border-t border-green-100 space-y-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { placeholder: t('profile.card.pricelist.item_name'), value: newItem.name, onChange: (e)=>setNewItem((p)=>({ ...p, name: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { placeholder: t('profile.card.pricelist.item_desc'), value: newItem.description, onChange: (e)=>setNewItem((p)=>({ ...p, description: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { placeholder: t('profile.card.pricelist.item_price'), value: newItem.price, onChange: (e)=>setNewItem((p)=>({ ...p, price: e.target.value })), className: "w-28 border border-gray-300 rounded-lg px-3 py-1.5 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { placeholder: t('profile.card.pricelist.item_unit'), value: newItem.unit, onChange: (e)=>setNewItem((p)=>({ ...p, unit: e.target.value })), className: "flex-1 border border-gray-300 rounded-lg px-3 py-1.5 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>handleAddItem(group.id), className: "px-4 py-1.5 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700", children: t('profile.card.pricelist.save_item') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>{ setAddingGroupId(null); setNewItem({ name: '', description: '', price: '', unit: '' }); }, className: "px-3 py-1.5 text-gray-500 hover:text-gray-700 text-sm", children: "✕" }) ] }) ] }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "px-4 py-2 border-t border-gray-100", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { type: "button", onClick: ()=>setAddingGroupId(group.id), className: "text-green-600 hover:text-gray-800 text-sm font-medium", children: [ "+ ", t('profile.card.pricelist.add_item') ] }) }) ] }, group.id)), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-2 pt-1", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { placeholder: t('profile.card.pricelist.group_title'), value: newGroupTitle, onChange: (e)=>setNewGroupTitle(e.target.value), onKeyDown: (e)=>{ if (e.key === 'Enter') handleAddGroup(); }, 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" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: handleAddGroup, className: "px-4 py-2 bg-green-600 hover:bg-green-700 text-white rounded-lg text-sm font-medium", children: t('profile.card.pricelist.add_group') }) ] }) ] }) }), cardTab === 'portfolio' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-3", children: [ portfolio.length < 20 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>{ var _portfolioFileRef_current; return (_portfolioFileRef_current = portfolioFileRef.current) === null || _portfolioFileRef_current === void 0 ? void 0 : _portfolioFileRef_current.click(); }, disabled: portfolioUploading, className: "flex items-center gap-2 px-4 py-2 bg-green-600 hover:bg-green-700 text-white rounded-lg text-sm font-medium disabled:opacity-50", children: portfolioUploading ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "w-4 h-4 border-2 border-white border-t-transparent rounded-full animate-spin" }), t('profile.card.photo.uploading') ] }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [ "\uD83D\uDCF7 ", t('profile.card.photo.add') ] }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { ref: portfolioFileRef, type: "file", accept: "image/jpeg,image/png,image/webp", className: "hidden", onChange: handlePortfolioUpload }) ] }), portfolio.length === 0 ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-center py-8 text-gray-400 text-sm border-2 border-dashed border-gray-200 rounded-xl", children: t('profile.card.photo.empty') }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "grid grid-cols-2 sm:grid-cols-3 gap-3", children: portfolio.map((item)=>{ var _item_title; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "group relative rounded-xl overflow-hidden border border-gray-200 bg-gray-50", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: item.imageUrl, alt: (_item_title = item.title) !== null && _item_title !== void 0 ? _item_title : '', className: "w-full aspect-square object-cover" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "absolute inset-0 bg-black/0 group-hover:bg-black/50 transition-all flex flex-col justify-between p-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>handlePortfolioDelete(item.id), className: "self-end opacity-0 group-hover:opacity-100 transition w-7 h-7 rounded-full bg-red-500 text-white text-sm flex items-center justify-center hover:bg-red-600", children: "\xd7" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { type: "button", onClick: ()=>{ setEditingItem(item); var _item_title; setEditTitle((_item_title = item.title) !== null && _item_title !== void 0 ? _item_title : ''); var _item_description; setEditDesc((_item_description = item.description) !== null && _item_description !== void 0 ? _item_description : ''); }, className: "opacity-0 group-hover:opacity-100 transition text-xs text-white bg-black/50 hover:bg-black/70 rounded-lg px-2 py-1", children: [ "✏ ", t('profile.card.item.edit') ] }) ] }), item.title && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "px-2 py-1.5", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs font-medium text-gray-700 truncate", children: item.title }) }) ] }, item.id); }) }) ] }), cardTab !== 'portfolio' && cardTab !== 'pricelist' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-3 mt-4 pt-4 border-t border-gray-100", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", disabled: saving, onClick: saveAll, className: "px-5 py-2 bg-green-600 hover:bg-green-700 text-white rounded-lg text-sm font-semibold disabled:opacity-50", children: saving ? '...' : t('profile.card.save') }), savedOk && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "text-sm text-green-600", children: [ "✓ ", t('profile.card.saved') ] }) ] }) ] }) ] }), editingItem && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "fixed inset-0 z-50 flex items-center justify-center bg-black/50 px-4", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-2xl shadow-xl p-6 w-full max-w-md", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h3", { className: "font-semibold text-gray-800 mb-4", children: t('profile.card.item.edit') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: editingItem.imageUrl, alt: "", className: "w-full h-40 object-cover rounded-xl mb-4" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('profile.card.item.title') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: editTitle, onChange: (e)=>setEditTitle(e.target.value), maxLength: 200, 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" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('profile.card.item.desc') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("textarea", { value: editDesc, onChange: (e)=>setEditDesc(e.target.value), rows: 3, maxLength: 1000, 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" }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-3 mt-5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>handlePortfolioSave(editingItem.id), className: "flex-1 bg-green-600 hover:bg-green-700 text-white py-2 rounded-lg text-sm font-medium", children: t('profile.card.item.save') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>setEditingItem(null), className: "flex-1 bg-gray-100 hover:bg-gray-200 text-gray-700 py-2 rounded-lg text-sm font-medium", children: t('profile.card.item.cancel') }) ] }) ] }) }) ] }); } // ─── AutoResponseTab ─────────────────────────────────────────────────────── function AutoResponseTab(param) { let { categories, locationTree, loaded, onLoad, settings, saving, saved, onSave, t, catLocale } = param; const { useEffect: _ue, useState: _us } = { useEffect: react__WEBPACK_IMPORTED_MODULE_1__.useEffect, useState: react__WEBPACK_IMPORTED_MODULE_1__.useState }; const [enabled, setEnabled] = _us(false); const [minBudget, setMinBudget] = _us(''); const [maxBudget, setMaxBudget] = _us(''); const [defaultPrice, setDefaultPrice] = _us(''); const [defaultMessage, setDefaultMessage] = _us(''); const [maxPerDay, setMaxPerDay] = _us(''); const [selCategories, setSelCategories] = _us([]); const [selLocations, setSelLocations] = _us([]); _ue(()=>{ onLoad(); }, []); _ue(()=>{ if (!settings) return; setEnabled(settings.enabled); setMinBudget(settings.minBudget != null ? String(settings.minBudget) : ''); setMaxBudget(settings.maxBudget != null ? String(settings.maxBudget) : ''); setDefaultPrice(settings.defaultPrice != null ? String(settings.defaultPrice) : ''); var _settings_defaultMessage; setDefaultMessage((_settings_defaultMessage = settings.defaultMessage) !== null && _settings_defaultMessage !== void 0 ? _settings_defaultMessage : ''); setMaxPerDay(settings.maxAutoOffersPerDay != null ? String(settings.maxAutoOffersPerDay) : ''); var _settings_categories; setSelCategories((_settings_categories = settings.categories) !== null && _settings_categories !== void 0 ? _settings_categories : []); var _settings_locations; setSelLocations((_settings_locations = settings.locations) !== null && _settings_locations !== void 0 ? _settings_locations : []); }, [ settings ]); if (!loaded) return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-center py-10 text-white/60", children: t('common.loading') }); const flatLocations = []; function flatten(nodes) { for (const n of nodes){ var _n_children; flatLocations.push({ id: n.id, name: n.name }); if ((_n_children = n.children) === null || _n_children === void 0 ? void 0 : _n_children.length) flatten(n.children); } } flatten(locationTree); return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "bg-white rounded-xl border border-gray-200 p-5", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "flex items-center justify-between cursor-pointer", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "font-medium text-gray-800", children: t('auto_response.title', 'Auto response') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400 mt-0.5", children: t('auto_response.desc', 'Automatically respond to matching tasks') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>setEnabled((v)=>!v), className: "relative inline-flex h-6 w-11 items-center rounded-full transition-colors ".concat(enabled ? 'bg-green-500' : 'bg-gray-300'), children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "inline-block h-4 w-4 transform rounded-full bg-white shadow transition-transform ".concat(enabled ? 'translate-x-6' : 'translate-x-1') }) }) ] }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-5 space-y-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h3", { className: "font-medium text-gray-800 text-sm", children: t('auto_response.budget_range', 'Task budget') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "grid grid-cols-2 gap-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs text-gray-500 mb-1", children: t('auto_response.min_budget', 'Min €') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "number", min: "0", value: minBudget, onChange: (e)=>setMinBudget(e.target.value), placeholder: "0", 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" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs text-gray-500 mb-1", children: t('auto_response.max_budget', 'Max €') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "number", min: "0", value: maxBudget, onChange: (e)=>setMaxBudget(e.target.value), placeholder: "∞", className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs text-gray-500 mb-1", children: t('auto_response.default_price', 'Default price €') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "number", min: "0", value: defaultPrice, onChange: (e)=>setDefaultPrice(e.target.value), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs text-gray-500 mb-1", children: t('auto_response.max_per_day', 'Max auto-offers/day') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "number", min: "1", max: "50", value: maxPerDay, onChange: (e)=>setMaxPerDay(e.target.value), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs text-gray-500 mb-1", children: t('auto_response.default_message', 'Auto-response text') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("textarea", { value: defaultMessage, onChange: (e)=>setDefaultMessage(e.target.value), rows: 4, maxLength: 2000, placeholder: t('auto_response.message_placeholder', 'Hello! I can help with this task...'), 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" }) ] }), categories.length > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h3", { className: "font-medium text-gray-800 text-sm mb-3", children: t('auto_response.categories', 'Task categories') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex flex-wrap gap-2 max-h-40 overflow-y-auto", children: categories.flatMap((cat)=>{ var _cat_children; return [ cat, ...(_cat_children = cat.children) !== null && _cat_children !== void 0 ? _cat_children : [] ]; }).map((cat)=>{ var _cat_names, _cat_names1; var _cat_names_catLocale, _ref; const name = (_ref = (_cat_names_catLocale = (_cat_names = cat.names) === null || _cat_names === void 0 ? void 0 : _cat_names[catLocale]) !== null && _cat_names_catLocale !== void 0 ? _cat_names_catLocale : (_cat_names1 = cat.names) === null || _cat_names1 === void 0 ? void 0 : _cat_names1.el) !== null && _ref !== void 0 ? _ref : cat.slug; const sel = selCategories.includes(cat.slug); return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>setSelCategories(sel ? selCategories.filter((c)=>c !== cat.slug) : [ ...selCategories, cat.slug ]), className: "px-3 py-1.5 rounded-lg text-xs border transition ".concat(sel ? 'bg-green-600 border-green-600 text-white' : 'bg-white border-gray-300 text-gray-700 hover:border-green-400'), children: name }, cat.slug); }) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", disabled: saving, onClick: ()=>onSave({ enabled, minBudget: minBudget ? Number(minBudget) : null, maxBudget: maxBudget ? Number(maxBudget) : null, defaultPrice: defaultPrice ? Number(defaultPrice) : null, defaultMessage: defaultMessage || null, maxAutoOffersPerDay: maxPerDay ? Number(maxPerDay) : null, categories: selCategories.length > 0 ? selCategories : null, locations: selLocations.length > 0 ? selLocations : null }), className: "w-full bg-green-600 text-white py-3 rounded-xl font-semibold hover:bg-green-700 disabled:opacity-50", children: saving ? t('common.loading') : saved ? t('auto_response.saved', 'Saved ✓') : t('common.save') }) ] }); } function ProfilePage() { return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(react__WEBPACK_IMPORTED_MODULE_1__.Suspense, { fallback: null, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(ProfilePageInner, {}) }); } function ProfilePageInner() { var _user_firstName, _user_lastName, _dashData_features, _dashData_features1, _dashData_features2, _user_plan, _user_plan1, _user_plan2, _dashData_features3, _dashData_features4, _dashData_plan, _dashData_plan1, _user_plan3; const router = (0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)(); const searchParams = (0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useSearchParams)(); const { data: session, isPending } = (0,_lib_auth__WEBPACK_IMPORTED_MODULE_3__/* .useSession */ .wV)(); const { t, locale } = (0,_context_locale__WEBPACK_IMPORTED_MODULE_4__/* .useLocale */ .Y)(); const validTabs = [ 'info', 'finance', 'cards', 'notifications', 'reviews', 'referral', 'auto_response', 'site' ]; var _searchParams_get; const initialTab = (_searchParams_get = searchParams.get('tab')) !== null && _searchParams_get !== void 0 ? _searchParams_get : 'info'; const [activeTab, setActiveTab] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(validTabs.includes(initialTab) ? initialTab : 'info'); const [user, setUser] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [loading, setLoading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(true); const [saving, setSaving] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [saved, setSaved] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [error, setError] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [formData, setFormData] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)({ firstName: '', lastName: '', phone: '', bio: '', locale: 'el' }); const [selectedLanguages, setSelectedLanguages] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); // Specialist cards const [cards, setCards] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [maxCards, setMaxCards] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(1); const [cardsLoading, setCardsLoading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [cardNotifications, setCardNotifications] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [openCardId, setOpenCardId] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [creatingCard, setCreatingCard] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [newCardTitle, setNewCardTitle] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [showNewCardForm, setShowNewCardForm] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [showUpgradeModal, setShowUpgradeModal] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); // Reference data const [categories, setCategories] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [locationTree, setLocationTree] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); // Become specialist const [becomingSpecialist, setBecomingSpecialist] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [avatarUploading, setAvatarUploading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [backgroundUploading, setBackgroundUploading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const fileRef = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null); const backgroundFileRef = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null); // Notification preferences const [notifyNewTasks, setNotifyNewTasks] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [notifMessages, setNotifMessages] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(true); const [notifySaving, setNotifySaving] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [notifySaved, setNotifySaved] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); // Email verification resend const [resendState, setResendState] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)('idle'); // Referral info const [referralCode, setReferralCode] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [referralCount, setReferralCount] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(0); const [referralCopied, setReferralCopied] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [referralLoaded, setReferralLoaded] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); // Balance top-up modal const [showTopUpModal, setShowTopUpModal] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [topUpAmount, setTopUpAmount] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(10); const [topUpLoading, setTopUpLoading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [topUpError, setTopUpError] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [balanceHistory, setBalanceHistory] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [planHistory, setPlanHistory] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); // Plan data + statuses const [dashData, setDashData] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [myStatuses, setMyStatuses] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [statusToggling, setStatusToggling] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [personalSiteSlug, setPersonalSiteSlug] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [slugSaving, setSlugSaving] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [slugSaved, setSlugSaved] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [slugCopied, setSlugCopied] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [slugError, setSlugError] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [showContactInfo, setShowContactInfo] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [siteSettings, setSiteSettings] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)({}); const [siteSettingsSaving, setSiteSettingsSaving] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [siteStats, setSiteStats] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [siteStatsLoading, setSiteStatsLoading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [autoResponse, setAutoResponse] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [arLoaded, setArLoaded] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [arSaving, setArSaving] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [arSaved, setArSaved] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); async function handleTopUp() { const amount = Number(topUpAmount); if (!amount || amount < 1) return; setTopUpLoading(true); setTopUpError(''); try { const { url, params } = await _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .initiateTopUp */ .oh(amount); // Build and auto-submit form to ePay const form = document.createElement('form'); form.method = 'POST'; form.action = url; Object.entries(params).forEach((param)=>{ let [k, v] = param; const input = document.createElement('input'); input.type = 'hidden'; input.name = k; input.value = v; form.appendChild(input); }); document.body.appendChild(form); form.submit(); } catch (e) { setTopUpError((e === null || e === void 0 ? void 0 : e.message) || t('profile.balance.topup.error')); setTopUpLoading(false); } } async function handleResendVerification() { if (!(user === null || user === void 0 ? void 0 : user.email) || resendState !== 'idle') return; setResendState('sending'); const callbackURL = "".concat(window.location.origin, "/profile"); const result = await _lib_auth__WEBPACK_IMPORTED_MODULE_3__/* .authClient */ .yK.sendVerificationEmail({ email: user.email, callbackURL }); if (result === null || result === void 0 ? void 0 : result.error) { setResendState('idle'); } else { setResendState('sent'); } } (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (activeTab !== 'referral' || referralLoaded) return; _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getMyReferralInfo */ .st().then((r)=>{ setReferralCode(r.referralCode); setReferralCount(r.referralCount); }).catch(()=>{}).finally(()=>setReferralLoaded(true)); }, [ activeTab ]); // Reviews const [myReviews, setMyReviews] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [reviewsLoading, setReviewsLoading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [myRating, setMyRating] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (activeTab !== 'reviews' || myReviews !== null || reviewsLoading) return; setReviewsLoading(true); _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getMyReviews */ .q7().then(setMyReviews).catch(()=>setMyReviews([])).finally(()=>setReviewsLoading(false)); }, [ activeTab ]); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (activeTab !== 'site' || siteStats !== null || siteStatsLoading) return; setSiteStatsLoading(true); _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getSiteStats */ .RN().then((res)=>setSiteStats(res.days)).catch(()=>setSiteStats([])).finally(()=>setSiteStatsLoading(false)); }, [ activeTab ]); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!isPending && !session) router.push('/login'); }, [ session, isPending ]); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!session) return; Promise.all([ _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Em('/users/me'), _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getCategories */ .bW(), _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getLocations */ .Vs(), _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getMyDashboard */ .H().catch(()=>null), _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getMyStatuses */ .z6().catch(()=>[]), _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getBalanceHistory */ .fm(8).catch(()=>[]), _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getPlanHistory */ .ew(20).catch(()=>[]) ]).then((param)=>{ let [u, cats, locs, dash, statusRes, history, phist] = param; setUser(u); var _u_firstName, _u_lastName, _u_phone, _u_bio, _u_locale; setFormData({ firstName: (_u_firstName = u.firstName) !== null && _u_firstName !== void 0 ? _u_firstName : '', lastName: (_u_lastName = u.lastName) !== null && _u_lastName !== void 0 ? _u_lastName : '', phone: (_u_phone = u.phone) !== null && _u_phone !== void 0 ? _u_phone : '', bio: (_u_bio = u.bio) !== null && _u_bio !== void 0 ? _u_bio : '', locale: (_u_locale = u.locale) !== null && _u_locale !== void 0 ? _u_locale : 'el' }); var _u_languages; setSelectedLanguages((_u_languages = u.languages) !== null && _u_languages !== void 0 ? _u_languages : []); var _u_notifyNewTasks; setNotifyNewTasks((_u_notifyNewTasks = u.notifyNewTasks) !== null && _u_notifyNewTasks !== void 0 ? _u_notifyNewTasks : false); var _u_notifMessages; setNotifMessages((_u_notifMessages = u.notifMessages) !== null && _u_notifMessages !== void 0 ? _u_notifMessages : true); setCategories(cats); setLocationTree(locs); setDashData(dash); setMyStatuses((statusRes !== null && statusRes !== void 0 ? statusRes : []).filter((s)=>s.isActive).map((s)=>s.statusType)); setBalanceHistory(history); setPlanHistory(phist); var _u_personalSiteSlug; setPersonalSiteSlug((_u_personalSiteSlug = u.personalSiteSlug) !== null && _u_personalSiteSlug !== void 0 ? _u_personalSiteSlug : ''); var _u_showContactInfo; setShowContactInfo((_u_showContactInfo = u.showContactInfo) !== null && _u_showContactInfo !== void 0 ? _u_showContactInfo : false); var _u_siteSettings; setSiteSettings((_u_siteSettings = u.siteSettings) !== null && _u_siteSettings !== void 0 ? _u_siteSettings : {}); loadCards(); _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getUserRating */ .Bm(u.id).then((r)=>setMyRating(r.avg)).catch(()=>{}); }).catch(()=>{}).finally(()=>setLoading(false)); }, [ session ]); async function loadCards() { setCardsLoading(true); try { const { cards: c, maxCards: m } = await _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getMySpecialistCards */ .Bb(); setCards(c); setMaxCards(m); setOpenCardId((prev)=>{ var _c_; var _c__id; return prev && c.some((card)=>card.id === prev) ? prev : (_c__id = (_c_ = c[0]) === null || _c_ === void 0 ? void 0 : _c_.id) !== null && _c__id !== void 0 ? _c__id : null; }); _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getNotifications */ .Tr().then((rows)=>setCardNotifications(rows.filter((row)=>[ 'specialist_card_submitted', 'specialist_card_approved', 'specialist_card_rejected' ].includes(row.type)))).catch(()=>setCardNotifications([])); } catch (e) {} finally{ setCardsLoading(false); } } async function handleSubmit(e) { e.preventDefault(); setError(''); setSaving(true); try { const updated = await _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Em('/users/me', { method: 'PATCH', body: JSON.stringify({ firstName: formData.firstName, lastName: formData.lastName, phone: formData.phone || undefined, bio: formData.bio || undefined, bioLocale: formData.locale, autoTranslateBio: true, locale: formData.locale, languages: selectedLanguages, showContactInfo }) }); setUser(updated); setSaved(true); setTimeout(()=>setSaved(false), 2500); } catch (err) { setError(err.message || t('common.error')); } finally{ setSaving(false); } } async function handleBecomeSpecialist() { setBecomingSpecialist(true); setError(''); try { const updated = await _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Em('/users/me/become-specialist', { method: 'POST' }); setUser(updated); setActiveTab('cards'); loadCards(); } catch (err) { setError(err.message || t('common.error')); } finally{ setBecomingSpecialist(false); } } async function handleSaveSiteSlug() { setSlugSaving(true); setSlugError(''); try { const updated = await _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Em('/users/me', { method: 'PATCH', body: JSON.stringify({ personalSiteSlug: personalSiteSlug || null }) }); setUser(updated); var _updated_personalSiteSlug; setPersonalSiteSlug((_updated_personalSiteSlug = updated.personalSiteSlug) !== null && _updated_personalSiteSlug !== void 0 ? _updated_personalSiteSlug : ''); setSlugSaved(true); setTimeout(()=>setSlugSaved(false), 2500); } catch (err) { var _err_code; const code = (_err_code = err === null || err === void 0 ? void 0 : err.code) !== null && _err_code !== void 0 ? _err_code : ''; if (code === 'SLUG_TAKEN' || err.message === 'This URL is already taken') { setSlugError(t('profile.site.slug_taken', 'This address is already taken')); } else { setSlugError(err.message || t('common.error')); } } finally{ setSlugSaving(false); } } async function handleSaveSiteSettings(newSettings) { setSiteSettings(newSettings); setSiteSettingsSaving(true); try { await _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Em('/users/me', { method: 'PATCH', body: JSON.stringify({ siteSettings: newSettings }) }); } catch (e) {} finally{ setSiteSettingsSaving(false); } } async function handleAvatarChange(e) { var _e_target_files; const file = (_e_target_files = e.target.files) === null || _e_target_files === void 0 ? void 0 : _e_target_files[0]; if (!file) return; setAvatarUploading(true); try { const form = new FormData(); form.append('file', file); const res = await fetch("".concat("https://api.canhelp.gr" || 0, "/api/uploads"), { method: 'POST', credentials: 'include', body: form }); if (!res.ok) throw new Error('Upload failed'); const { url } = await res.json(); const fullUrl = "".concat("https://api.canhelp.gr" || 0).concat(url); await _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Em('/users/me', { method: 'PATCH', body: JSON.stringify({ image: fullUrl }) }); setUser((prev)=>({ ...prev, image: fullUrl })); } catch (e) { setError(t('profile.upload.error')); } finally{ setAvatarUploading(false); } } async function handleBackgroundChange(e) { var _e_target_files; const file = (_e_target_files = e.target.files) === null || _e_target_files === void 0 ? void 0 : _e_target_files[0]; if (!file) return; setBackgroundUploading(true); try { const form = new FormData(); form.append('file', file); const res = await fetch("".concat("https://api.canhelp.gr" || 0, "/api/uploads"), { method: 'POST', credentials: 'include', body: form }); if (!res.ok) throw new Error('Upload failed'); const { url } = await res.json(); const fullUrl = "".concat("https://api.canhelp.gr" || 0).concat(url); const nextSettings = { ...siteSettings, profileBackgroundImage: fullUrl }; await _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Em('/users/me', { method: 'PATCH', body: JSON.stringify({ siteSettings: nextSettings }) }); setSiteSettings(nextSettings); setSaved(true); setTimeout(()=>setSaved(false), 2500); } catch (e) { setError(t('profile.upload.error')); } finally{ setBackgroundUploading(false); if (backgroundFileRef.current) backgroundFileRef.current.value = ''; } } async function handleRemoveBackground() { setBackgroundUploading(true); try { const nextSettings = { ...siteSettings, profileBackgroundImage: null }; await _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Em('/users/me', { method: 'PATCH', body: JSON.stringify({ siteSettings: nextSettings }) }); setSiteSettings(nextSettings); setSaved(true); setTimeout(()=>setSaved(false), 2500); } catch (e) { setError(t('profile.upload.error')); } finally{ setBackgroundUploading(false); } } async function handleCreateCard() { if (!newCardTitle.trim()) return; setCreatingCard(true); try { const card = await _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .createSpecialistCard */ .eR({ title: newCardTitle.trim() }); setCards((prev)=>[ ...prev, card ]); setOpenCardId(card.id); setNewCardTitle(''); setShowNewCardForm(false); } catch (err) { setError(err.message || t('common.error')); } finally{ setCreatingCard(false); } } async function handleDeleteCard(id) { if (!confirm(t('profile.cards.delete_confirm'))) return; try { await _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .deleteSpecialistCard */ .f5(id); setCards((prev)=>{ var _next_; const next = prev.filter((c)=>c.id !== id); var _next__id; if (openCardId === id) setOpenCardId((_next__id = (_next_ = next[0]) === null || _next_ === void 0 ? void 0 : _next_.id) !== null && _next__id !== void 0 ? _next__id : null); return next; }); } catch (err) { setError(err.message || t('common.error')); } } if (isPending || loading) { return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-center py-20 text-white", children: t('common.loading') }); } const catLocale = locale === 'en' ? 'en' : locale === 'ru' ? 'ru' : locale === 'uk' ? 'uk' : 'el'; const dateLocale = locale === 'en' ? 'en-US' : locale === 'ru' ? 'ru-RU' : 'el-GR'; const isSpecialist = (user === null || user === void 0 ? void 0 : user.role) === 'specialist'; const isAdmin = (user === null || user === void 0 ? void 0 : user.role) === 'admin'; const showSpecialistTabs = isSpecialist || isAdmin; var _user_firstName_, _user_lastName_; const initials = user ? "".concat((_user_firstName_ = (_user_firstName = user.firstName) === null || _user_firstName === void 0 ? void 0 : _user_firstName[0]) !== null && _user_firstName_ !== void 0 ? _user_firstName_ : '').concat((_user_lastName_ = (_user_lastName = user.lastName) === null || _user_lastName === void 0 ? void 0 : _user_lastName[0]) !== null && _user_lastName_ !== void 0 ? _user_lastName_ : '').toUpperCase() : '?'; const hasAutoResponse = !!(dashData === null || dashData === void 0 ? void 0 : (_dashData_features = dashData.features) === null || _dashData_features === void 0 ? void 0 : _dashData_features.hasAutoResponse); var _formData_bio, _ref; const profileBio = String((_ref = (_formData_bio = formData.bio) !== null && _formData_bio !== void 0 ? _formData_bio : user === null || user === void 0 ? void 0 : user.bio) !== null && _ref !== void 0 ? _ref : '').trim(); const publishedCards = cards.filter((c)=>{ var _c_publicationStatus; return ((_c_publicationStatus = c.publicationStatus) !== null && _c_publicationStatus !== void 0 ? _c_publicationStatus : c.isActive ? 'active' : 'inactive') === 'active'; }); const hasPublishedCard = publishedCards.length > 0; const hasCardCategories = publishedCards.some((c)=>{ var _c_categories; var _c_categories_length; return ((_c_categories_length = (_c_categories = c.categories) === null || _c_categories === void 0 ? void 0 : _c_categories.length) !== null && _c_categories_length !== void 0 ? _c_categories_length : 0) > 0; }); const hasCardLocations = publishedCards.some((c)=>{ var _c_locations; var _c_locations_length; return ((_c_locations_length = (_c_locations = c.locations) === null || _c_locations === void 0 ? void 0 : _c_locations.length) !== null && _c_locations_length !== void 0 ? _c_locations_length : 0) > 0; }); const moderationNoticeByCardId = cardNotifications.reduce((acc, row)=>{ if (!row.referenceId || acc[row.referenceId]) return acc; const tone = row.type === 'specialist_card_approved' ? 'green' : row.type === 'specialist_card_rejected' ? 'red' : 'amber'; const localizedTitle = row.type === 'specialist_card_approved' ? t('profile.card.review_approved', 'Card approved') : row.type === 'specialist_card_rejected' ? t('profile.card.review_rejected', 'Card rejected') : t('profile.card.review_pending', 'Pending approval'); const localizedBody = row.type === 'specialist_card_approved' ? t('profile.card.review_approved_hint', 'Your card is now visible in offers.') : row.type === 'specialist_card_rejected' ? t('profile.card.review_rejected_hint', 'Your card was not approved. Please update it and submit again.') : t('profile.card.review_pending_hint', 'Your card is being reviewed by the admin team.'); acc[row.referenceId] = { title: localizedTitle, body: localizedBody, tone }; return acc; }, {}); const listingMissing = []; if (!profileBio) listingMissing.push(t('profile.listing_requirements.bio', 'Add a short bio in the main profile section')); if (!hasPublishedCard) listingMissing.push(t('profile.listing_requirements.published_card', 'Publish at least one card')); if (!hasCardCategories) listingMissing.push(t('profile.listing_requirements.categories', 'Add at least one category to the published card')); if (!hasCardLocations) listingMissing.push(t('profile.listing_requirements.locations', 'Add at least one location to the published card')); const tabNeedsAttention = { info: !profileBio, cards: listingMissing.length > 0 }; const tabIcons = { info: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15.75 6a3.75 3.75 0 11-7.5 0 3.75 3.75 0 017.5 0zM4.501 20.118a7.5 7.5 0 0114.998 0A17.933 17.933 0 0112 21.75c-2.676 0-5.216-.584-7.499-1.632z" }) }), finance: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 6v12m-3-2.818l.879.659c1.171.879 3.07.879 4.242 0 1.172-.879 1.172-2.303 0-3.182C13.536 12.219 12.768 12 12 12c-.725 0-1.45-.22-2.003-.659-1.106-.879-1.106-2.303 0-3.182s2.9-.879 4.006 0l.415.33M21 12a9 9 0 11-18 0 9 9 0 0118 0z" }) }), cards: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M20.25 14.15v4.073a2.25 2.25 0 01-2.25 2.25h-12a2.25 2.25 0 01-2.25-2.25V6a2.25 2.25 0 012.25-2.25h4.073M15.75 3h5.25v5.25M15.75 3l-9 9" }) }), notifications: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M14.857 17.082a23.848 23.848 0 005.454-1.31A8.967 8.967 0 0118 9.75v-.7V9A6 6 0 006 9v.75a8.967 8.967 0 01-2.312 6.022c1.733.64 3.56 1.085 5.455 1.31m5.714 0a24.255 24.255 0 01-5.714 0m5.714 0a3 3 0 11-5.714 0" }) }), reviews: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M11.48 3.499a.562.562 0 011.04 0l2.125 5.111a.563.563 0 00.475.345l5.518.442c.499.04.701.663.321.988l-4.204 3.602a.563.563 0 00-.182.557l1.285 5.385a.562.562 0 01-.84.61l-4.725-2.885a.562.562 0 00-.586 0L6.982 20.54a.562.562 0 01-.84-.61l1.285-5.386a.562.562 0 00-.182-.557l-4.204-3.602a.562.562 0 01.321-.988l5.518-.442a.563.563 0 00.475-.345L11.48 3.5z" }) }), referral: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M13.19 8.688a4.5 4.5 0 011.242 7.244l-4.5 4.5a4.5 4.5 0 01-6.364-6.364l1.757-1.757m13.35-.622l1.757-1.757a4.5 4.5 0 00-6.364-6.364l-4.5 4.5a4.5 4.5 0 001.242 7.244" }) }), auto_response: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9.813 15.904L9 18.75l-.813-2.846a4.5 4.5 0 00-3.09-3.09L2.25 12l2.846-.813a4.5 4.5 0 003.09-3.09L9 5.25l.813 2.846a4.5 4.5 0 003.09 3.09L15.75 12l-2.846.813a4.5 4.5 0 00-3.09 3.09z" }) }), site: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 21a9.004 9.004 0 008.716-6.747M12 21a9.004 9.004 0 01-8.716-6.747M12 21c2.485 0 4.5-4.03 4.5-9S14.485 3 12 3m0 18c-2.485 0-4.5-4.03-4.5-9S9.515 3 12 3m0 0a8.997 8.997 0 017.843 4.582M12 3a8.997 8.997 0 00-7.843 4.582m15.686 0A11.953 11.953 0 0112 10.5c-2.998 0-5.74-1.1-7.843-2.918m15.686 0A8.959 8.959 0 0121 12c0 .778-.099 1.533-.284 2.253m0 0A17.919 17.919 0 0112 16.5c-3.162 0-6.133-.815-8.716-2.247m0 0A9.015 9.015 0 013 12c0-1.605.42-3.113 1.157-4.418" }) }) }; const tabs = showSpecialistTabs ? [ { id: 'info', label: t('profile.tab.info') }, { id: 'cards', label: t('profile.tab.cards') }, { id: 'notifications', label: t('profile.tab.notifications') }, { id: 'reviews', label: t('profile.tab.reviews') }, { id: 'finance', label: t('profile.tab.finance') }, { id: 'referral', label: t('profile.tab.referral') }, ...hasAutoResponse ? [ { id: 'auto_response', label: t('profile.tab.auto_response', 'Auto response') } ] : [], ...(dashData === null || dashData === void 0 ? void 0 : (_dashData_features1 = dashData.features) === null || _dashData_features1 === void 0 ? void 0 : _dashData_features1.hasPersonalSite) ? [ { id: 'site', label: t('profile.tab.site') } ] : [] ] : [ { id: 'info', label: t('profile.tab.info') }, { id: 'cards', label: t('profile.tab.cards') }, { id: 'notifications', label: t('profile.tab.notifications') }, { id: 'reviews', label: t('profile.tab.reviews') }, { id: 'finance', label: t('profile.tab.finance') }, { id: 'referral', label: t('profile.tab.referral') }, ...(dashData === null || dashData === void 0 ? void 0 : (_dashData_features2 = dashData.features) === null || _dashData_features2 === void 0 ? void 0 : _dashData_features2.hasPersonalSite) ? [ { id: 'site', label: t('profile.tab.site') } ] : [] ]; var _user_lastName1, _user_name, _user_balance, _user_plan_features, _user_plan_name; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "max-w-4xl mx-auto px-4 py-8", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-4 mb-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "w-14 h-14 rounded-full flex-shrink-0 overflow-hidden border-2 border-white/40 flex items-center justify-center text-green-700 text-xl font-bold bg-green-100 cursor-pointer", onClick: ()=>{ var _fileRef_current; setActiveTab('info'); (_fileRef_current = fileRef.current) === null || _fileRef_current === void 0 ? void 0 : _fileRef_current.click(); }, title: t('profile.photo.change'), children: (user === null || user === void 0 ? void 0 : user.image) ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: user.image, alt: user.name, className: "w-full h-full object-cover" }) : initials }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h1", { className: "text-xl font-bold text-white leading-tight", children: (user === null || user === void 0 ? void 0 : user.firstName) ? "".concat(user.firstName, " ").concat((_user_lastName1 = user.lastName) !== null && _user_lastName1 !== void 0 ? _user_lastName1 : '').trim() : (_user_name = user === null || user === void 0 ? void 0 : user.name) !== null && _user_name !== void 0 ? _user_name : t('nav.profile') }), myRating && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-1 mt-0.5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-yellow-300", children: "★" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "font-semibold text-white text-sm", children: Number(myRating).toFixed(1) }), myReviews !== null && myReviews.length > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "text-white/60 text-xs", children: [ "(", myReviews.length, ")" ] }) ] }) ] }) ] }), !cardsLoading && cards.length === 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "mb-6 rounded-2xl border border-amber-300 bg-amber-50/95 p-4 sm:p-5 shadow-sm", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm font-semibold text-amber-950", children: t('profile.cards.empty', 'No offers yet') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs leading-relaxed text-amber-800 mt-1 max-w-2xl", children: t('profile.cards.empty_hint', 'СПзЎайте первую картПчку, чтПбы пПказать услугО клОеМтаЌ.') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>{ setActiveTab('cards'); setShowNewCardForm(true); }, className: "inline-flex items-center justify-center rounded-xl bg-amber-600 px-4 py-2 text-sm font-semibold text-white transition hover:bg-amber-700", children: t('profile.cards.create_first') }) ] }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-6 items-start", children: [ tabs.length > 1 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("aside", { className: "w-52 shrink-0 hidden sm:block", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("nav", { className: "rounded-2xl overflow-hidden bg-white/10 backdrop-blur-sm", children: tabs.map((tab)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { type: "button", onClick: ()=>setActiveTab(tab.id), className: "w-full text-left px-4 py-3 text-sm font-medium transition border-b border-white/10 last:border-0 flex items-center gap-3 ".concat(activeTab === tab.id ? 'bg-white text-green-700' : 'text-white/80 hover:bg-white/10 hover:text-white'), children: [ tabIcons[tab.id], /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "flex items-center gap-1.5", children: [ tab.label, tabNeedsAttention[tab.id] && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "inline-flex items-center justify-center w-4 h-4 rounded-full bg-amber-500 text-white text-[10px] font-bold", children: "!" }) ] }) ] }, tab.id)) }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex-1 min-w-0", children: [ tabs.length > 1 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex sm:hidden bg-white/15 backdrop-blur rounded-xl p-1 mb-4 gap-1 overflow-x-auto", children: tabs.map((tab)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { type: "button", onClick: ()=>setActiveTab(tab.id), className: "flex-1 min-w-fit px-3 py-2 text-xs font-medium rounded-lg transition whitespace-nowrap flex flex-col items-center gap-0.5 ".concat(activeTab === tab.id ? 'bg-white text-green-700 shadow-sm' : 'text-white/80 hover:text-white hover:bg-white/10'), children: [ tabIcons[tab.id], /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "flex items-center gap-1.5", children: [ tab.label, tabNeedsAttention[tab.id] && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "inline-flex items-center justify-center w-4 h-4 rounded-full bg-amber-500 text-white text-[10px] font-bold", children: "!" }) ] }) ] }, tab.id)) }), activeTab === 'cards' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-4", children: [ error && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "bg-red-50 text-red-700 p-3 rounded-lg text-sm", children: error }), listingMissing.length > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-amber-50 border border-amber-300 rounded-xl p-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm font-semibold text-amber-900", children: t('profile.listing_requirements.title', 'Your profile is not shown yet in offers') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-amber-800 mt-1", children: t('profile.listing_requirements.hint', 'To make the card visible, complete these conditions:') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("ul", { className: "mt-2 list-disc pl-5 text-xs text-amber-900 space-y-0.5", children: listingMissing.map((item)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("li", { children: item }, item)) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-between", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { className: "text-sm text-white/70", children: [ t('profile.cards.count'), ": ", cards.length, " / ", maxCards === null ? '∞' : maxCards ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { type: "button", onClick: ()=>{ if (maxCards !== null && cards.length >= maxCards) { setShowUpgradeModal(true); } else { setShowNewCardForm(true); } }, className: "flex items-center gap-1.5 text-sm font-medium text-white hover:text-white/80", children: [ "+ ", t('profile.cards.add') ] }) ] }), showNewCardForm && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-green-200 p-4 space-y-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm font-medium text-gray-800", children: t('profile.cards.new_title') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: newCardTitle, onChange: (e)=>setNewCardTitle(e.target.value), onKeyDown: (e)=>{ if (e.key === 'Enter') handleCreateCard(); }, maxLength: 200, placeholder: t('profile.cards.placeholder'), autoFocus: true, 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" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: handleCreateCard, disabled: creatingCard || !newCardTitle.trim(), className: "px-4 py-2 bg-green-600 hover:bg-green-700 text-white rounded-lg text-sm font-medium disabled:opacity-50", children: creatingCard ? '...' : t('profile.cards.create') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>{ setShowNewCardForm(false); setNewCardTitle(''); }, className: "px-4 py-2 bg-gray-100 hover:bg-gray-200 text-gray-700 rounded-lg text-sm font-medium", children: t('profile.cards.cancel') }) ] }) ] }), cardsLoading && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-center py-10 text-white/70", children: t('common.loading') }), !cardsLoading && cards.length === 0 && !showNewCardForm && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "text-center py-14 border-2 border-dashed border-white/30 rounded-xl", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-white/70 text-sm mb-3", children: t('profile.cards.empty') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { type: "button", onClick: ()=>setShowNewCardForm(true), className: "text-sm text-white font-medium hover:underline", children: [ "+ ", t('profile.cards.create_first') ] }) ] }), cards.map((card)=>{ var _dashData_features; const cardIssues = []; if (!profileBio) { cardIssues.push(t('profile.listing_requirements.bio', 'Add a short bio in the main profile section')); } var _card_publicationStatus; const publicationStatus = (_card_publicationStatus = card.publicationStatus) !== null && _card_publicationStatus !== void 0 ? _card_publicationStatus : card.isActive ? 'active' : 'inactive'; if (publicationStatus === 'pending') { cardIssues.push(t('profile.listing_requirements.review_pending', 'Card is under review')); } else if (publicationStatus !== 'active') { cardIssues.push(t('profile.listing_requirements.card_inactive', 'Make the card active')); } if (!card.categories || card.categories.length === 0) { cardIssues.push(t('profile.listing_requirements.categories', 'Add at least one category to the active card')); } if (!card.locations || card.locations.length === 0) { cardIssues.push(t('profile.listing_requirements.locations', 'Add at least one location to the active card')); } var _moderationNoticeByCardId_card_id; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(SpecialistCardEditor, { card: card, isOpen: openCardId === card.id, onToggle: ()=>setOpenCardId(card.id), onUpdate: (updated)=>setCards((prev)=>prev.map((c)=>c.id === updated.id ? updated : c)), onDelete: ()=>handleDeleteCard(card.id), categories: categories, locationTree: locationTree, catLocale: catLocale, locale: locale, hasPriceList: !!(dashData === null || dashData === void 0 ? void 0 : (_dashData_features = dashData.features) === null || _dashData_features === void 0 ? void 0 : _dashData_features.hasPriceList), visibilityIssues: cardIssues, moderationNotice: (_moderationNoticeByCardId_card_id = moderationNoticeByCardId[card.id]) !== null && _moderationNoticeByCardId_card_id !== void 0 ? _moderationNoticeByCardId_card_id : null }, card.id); }) ] }), activeTab === 'site' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-6 space-y-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "font-semibold text-gray-800 mb-1", children: t('profile.site.title') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400", children: t('profile.site_slug_hint') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs font-medium text-gray-500 mb-1.5", children: t('profile.site.url_label') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-2 flex-wrap", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-sm text-gray-400 shrink-0", children: "canhelp.gr/site/" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: personalSiteSlug, onChange: (e)=>setPersonalSiteSlug(e.target.value.toLowerCase().replace(/[^a-z0-9_-]/g, '')), placeholder: "my-slug", maxLength: 50, className: "flex-1 min-w-32 border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-3 flex-wrap", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: handleSaveSiteSlug, disabled: slugSaving, className: "px-5 py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700 disabled:opacity-50", children: slugSaving ? t('profile.saving') : t('common.save') }), slugSaved && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "text-sm text-green-600", children: [ "✓ ", t('profile.saved') ] }), personalSiteSlug && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { type: "button", onClick: ()=>{ navigator.clipboard.writeText("".concat(window.location.origin, "/site/").concat(personalSiteSlug)); setSlugCopied(true); setTimeout(()=>setSlugCopied(false), 2000); }, className: "px-3 py-2 border border-gray-300 rounded-lg text-sm text-gray-600 hover:bg-gray-50 flex items-center gap-1.5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z" }) }), slugCopied ? t('profile.site.copied') : t('profile.site.copy') ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("a", { href: "/site/".concat(personalSiteSlug), target: "_blank", rel: "noopener noreferrer", className: "px-3 py-2 border border-green-200 bg-green-50 rounded-lg text-sm text-green-600 hover:bg-green-100 flex items-center gap-1.5", children: [ t('profile.site_open'), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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" }) }) ] }) ] }) ] }), slugError && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-red-500", children: slugError }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-between mb-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h3", { className: "font-semibold text-gray-800", children: t('profile.site.visible_title') }), siteSettingsSaving && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-xs text-gray-400", children: t('profile.saving', 'Saving...') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "space-y-3", children: [ { key: 'showBio', label: t('profile.site.visible.bio', 'Biography') }, { key: 'showRating', label: t('profile.site.visible.rating', 'Rating and reviews') }, { key: 'showReviews', label: t('profile.site.visible.reviews', 'Reviews section') }, { key: 'showServices', label: t('profile.site.visible.services', 'Service cards') }, { key: 'showPriceList', label: t('profile.site.visible.price_list', 'Price list') }, { key: 'showPortfolio', label: t('profile.site.visible.portfolio', 'Portfolio') }, { key: 'showPhone', label: t('profile.site.visible.contacts', 'Contact phone') }, { key: 'showFullLastName', label: t('profile.site.visible.full_last_name', 'Show full last name') }, { key: 'showStatus', label: t('profile.site.visible.status', 'Status "Available now"') } ].map((param)=>{ let { key, label } = param; const checked = siteSettings[key] !== false // undefined = true by default ; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "flex items-center gap-3 cursor-pointer group", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "w-5 h-5 rounded border-2 flex items-center justify-center transition shrink-0 ".concat(checked ? 'bg-green-600 border-green-600' : 'bg-white border-gray-300 group-hover:border-green-400'), onClick: ()=>{ const next = { ...siteSettings, [key]: !checked }; handleSaveSiteSettings(next); }, children: checked && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3 h-3 text-white", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 3, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4.5 12.75l6 6 9-13.5" }) }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-sm text-gray-700 select-none", onClick: ()=>{ const next = { ...siteSettings, [key]: !checked }; handleSaveSiteSettings(next); }, children: label }) ] }, key); }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400 mt-4", children: t('profile.site.edit_bio_hint', 'Name and photo are always visible') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "mt-6 pt-4 border-t border-gray-100", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: t('profile.site.theme', 'Theme') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex gap-3", children: [ { value: 'dark', label: t('profile.site.theme.dark', 'Dark'), icon: '🌙' }, { value: 'light', label: t('profile.site.theme.light', 'Light'), icon: '☀' } ].map((opt)=>{ var _siteSettings_siteTheme; const selected = ((_siteSettings_siteTheme = siteSettings.siteTheme) !== null && _siteSettings_siteTheme !== void 0 ? _siteSettings_siteTheme : 'dark') === opt.value; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { onClick: ()=>handleSaveSiteSettings({ ...siteSettings, siteTheme: opt.value }), className: "flex-1 flex items-center justify-center gap-2 px-4 py-2.5 rounded-xl border-2 text-sm font-medium transition ".concat(selected ? 'border-green-500 bg-green-50 text-green-700' : 'border-gray-200 bg-white text-gray-500 hover:border-gray-300'), children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { children: opt.icon }), opt.label ] }, opt.value); }) }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex items-center justify-between mb-4", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h3", { className: "font-semibold text-gray-800", children: t('profile.site.stats.title', 'Site analytics') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400 mt-0.5", children: t('profile.site.stats.days', 'last 30 days') }) ] }) }), !personalSiteSlug ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-gray-400 py-4 text-center", children: t('profile.site.stats.no_slug', 'Set your site URL to view statistics') }) : siteStatsLoading || siteStats === null ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-gray-400 py-4 text-center", children: t('profile.site.stats.loading', 'Loading analytics...') }) : (()=>{ const totalViews = siteStats.reduce((s, d)=>s + d.views, 0); const totalUnique = siteStats.reduce((s, d)=>s + d.unique, 0); const totalMessages = siteStats.reduce((s, d)=>s + d.messages, 0); // Area chart helpers const days = siteStats.map((d)=>d.date); const seriesDef = [ { vals: siteStats.map((d)=>d.views), color: '#3b82f6', fill: '#3b82f615', label: t('profile.site.stats.views', 'Views') }, { vals: siteStats.map((d)=>d.unique), color: '#8b5cf6', fill: '#8b5cf610', label: t('profile.site.stats.unique', 'Unique') }, { vals: siteStats.map((d)=>d.messages), color: '#10b981', fill: '#10b98110', label: t('profile.site.stats.messages', 'Messages') } ]; const maxVal = Math.max(...seriesDef.flatMap((s)=>s.vals), 1); const W = 580; const H = 160; const padL = 36; const padB = 22; const chartW = W - padL - 4; const chartH = H - padB; const stepX = chartW / (days.length - 1); function pts(vals) { return vals.map((v, i)=>[ padL + i * stepX, chartH - v / maxVal * chartH ]); } function smoothPath(points) { if (points.length < 2) return ''; let d = "M ".concat(points[0][0].toFixed(1), " ").concat(points[0][1].toFixed(1)); for(let i = 1; i < points.length; i++){ const cpx = ((points[i - 1][0] + points[i][0]) / 2).toFixed(1); d += " C ".concat(cpx, " ").concat(points[i - 1][1].toFixed(1), " ").concat(cpx, " ").concat(points[i][1].toFixed(1), " ").concat(points[i][0].toFixed(1), " ").concat(points[i][1].toFixed(1)); } return d; } function areaPath(vals) { const points = pts(vals); const line = smoothPath(points); if (!line) return ''; const lastX = points[points.length - 1][0].toFixed(1); return "".concat(line, " L ").concat(lastX, " ").concat(chartH.toFixed(1), " L ").concat(padL.toFixed(1), " ").concat(chartH.toFixed(1), " Z"); } function fmtY(v) { return v >= 1000 ? "".concat(Math.round(v / 1000), "K") : String(v); } const yTicks = [ 0, Math.round(maxVal / 3), Math.round(maxVal * 2 / 3), maxVal ]; const xTicks = days.map((d, i)=>({ i, label: d.slice(8) })).filter((_, i)=>i % 7 === 0 || i === days.length - 1); return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "grid grid-cols-3 gap-3 mb-5", children: [ { label: t('profile.site.stats.total_views', 'Views'), value: totalViews, color: 'text-green-600', bg: 'bg-green-50' }, { label: t('profile.site.stats.total_unique', 'Unique visitors'), value: totalUnique, color: 'text-violet-600', bg: 'bg-violet-50' }, { label: t('profile.site.stats.total_messages', 'Messages'), value: totalMessages, color: 'text-emerald-600', bg: 'bg-emerald-50' } ].map((card)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "".concat(card.bg, " rounded-xl p-3 text-center"), children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-2xl font-bold ".concat(card.color), children: card.value }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-xs text-gray-500 mt-0.5", children: card.label }) ] }, card.label)) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex items-center gap-4 mb-2", children: seriesDef.map((s)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "flex items-center gap-1.5 text-xs text-gray-500", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "w-3 h-0.5 inline-block rounded", style: { background: s.color } }), s.label ] }, s.label)) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "overflow-x-auto", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { viewBox: "0 0 ".concat(W, " ").concat(H + 12), className: "w-full", style: { minWidth: 320 }, children: [ yTicks.map((v, idx)=>{ const y = chartH - v / maxVal * chartH; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("g", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: padL, y1: y, x2: W - 4, y2: y, stroke: "#f3f4f6", strokeWidth: 1 }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("text", { x: padL - 5, y: y + 3.5, textAnchor: "end", fontSize: 9, fill: "#9ca3af", children: fmtY(v) }) ] }, "y-".concat(idx, "-").concat(v)); }), xTicks.map((param)=>{ let { i } = param; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: padL + i * stepX, y1: 0, x2: padL + i * stepX, y2: chartH, stroke: "#f9fafb", strokeWidth: 1 }, "vg-".concat(i)); }), xTicks.map((param)=>{ let { i, label } = param; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("text", { x: padL + i * stepX, y: H + 10, textAnchor: "middle", fontSize: 9, fill: "#9ca3af", children: label }, i); }), seriesDef.map((s, si)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: areaPath(s.vals), fill: s.fill }, "fill-".concat(si))), seriesDef.map((s, si)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: smoothPath(pts(s.vals)), fill: "none", stroke: s.color, strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round" }, "line-".concat(si))), seriesDef.map((s, si)=>{ const points = pts(s.vals); const last = points[points.length - 1]; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("circle", { cx: last[0], cy: last[1], r: 4, fill: "white", stroke: s.color, strokeWidth: 2 }, "dot-".concat(si)); }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: padL, y1: chartH, x2: W - 4, y2: chartH, stroke: "#e5e7eb", strokeWidth: 1 }) ] }) }) ] }); })() ] }) ] }), activeTab === 'reviews' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "space-y-4", children: myReviews === null ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-center py-10 text-white/70", children: t('common.loading') }) : myReviews.length === 0 ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "text-center py-20 text-white/60", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-4xl mb-3", children: "⭐" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { children: t('profile.no_reviews') }) ] }) : myReviews.map((param)=>{ let { review, author } = param; var _author_name_, _author_name; var _author_name__toUpperCase, _author_name1; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "bg-white rounded-xl border border-gray-200 p-4", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-start gap-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "w-9 h-9 rounded-full bg-gray-100 flex-shrink-0 flex items-center justify-center text-gray-600 text-sm font-bold overflow-hidden", children: (author === null || author === void 0 ? void 0 : author.image) ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: author.image, alt: author.name, className: "w-full h-full object-cover" }) : (_author_name__toUpperCase = author === null || author === void 0 ? void 0 : (_author_name = author.name) === null || _author_name === void 0 ? void 0 : (_author_name_ = _author_name[0]) === null || _author_name_ === void 0 ? void 0 : _author_name_.toUpperCase()) !== null && _author_name__toUpperCase !== void 0 ? _author_name__toUpperCase : '?' }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex-1", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-2 mb-1", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-sm font-medium text-gray-800", children: (_author_name1 = author === null || author === void 0 ? void 0 : author.name) !== null && _author_name1 !== void 0 ? _author_name1 : '—' }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "text-yellow-400", children: [ '★'.repeat(review.rating), '☆'.repeat(5 - review.rating) ] }) ] }), review.comment && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-gray-600", children: review.comment }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400 mt-1", children: new Date(review.createdAt).toLocaleDateString() }) ] }) ] }) }, review.id); }) }), activeTab === 'finance' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-between mb-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "font-semibold text-gray-800", children: t('profile.balance') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { onClick: ()=>{ setTopUpAmount(10); setTopUpError(''); setShowTopUpModal(true); }, className: "flex items-center gap-1.5 text-sm font-medium text-green-600 hover:text-green-700 hover:bg-green-50 px-3 py-1.5 rounded-lg transition-colors", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 4v16m8-8H4" }) }), t('profile.balance.topup') ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-3 p-4 bg-green-50 rounded-xl border border-green-100", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-6 h-6 text-green-600 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 8c-1.657 0-3 .895-3 2s1.343 2 3 2 3 .895 3 2-1.343 2-3 2m0-8c1.11 0 2.08.402 2.599 1M12 8V7m0 1v8m0 0v1m0-1c-1.11 0-2.08-.402-2.599-1M21 12a9 9 0 11-18 0 9 9 0 0118 0z" }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "text-xl font-bold text-green-700", children: [ parseFloat((_user_balance = user === null || user === void 0 ? void 0 : user.balance) !== null && _user_balance !== void 0 ? _user_balance : '0').toFixed(2), " EUR" ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "mt-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-between mb-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h3", { className: "text-sm font-semibold text-gray-800", children: t('profile.balance.history', 'Operation history') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-xs text-gray-400", children: t('profile.balance.history.last', 'Latest operations') }) ] }), balanceHistory.length === 0 ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "rounded-xl border border-dashed border-gray-200 px-4 py-6 text-sm text-gray-400 text-center", children: t('profile.balance.history.empty', 'No operations yet') }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "space-y-2", children: balanceHistory.map((entry)=>{ const isCredit = entry.direction === 'credit'; const amount = Number(entry.amount).toFixed(2); const badgeClass = isCredit ? 'bg-emerald-50 text-emerald-700 border-emerald-100' : 'bg-rose-50 text-rose-700 border-rose-100'; const title = entry.kind === 'topup' ? t('profile.balance.history.kind.topup', 'Balance top-up') : entry.kind === 'plan_purchase' ? t('profile.balance.history.kind.plan_purchase', 'Plan charge') : entry.kind === 'admin_topup' ? t('profile.balance.history.kind.admin_topup', 'Admin top-up') : t('profile.balance.history.kind.admin_adjustment', 'Admin adjustment'); return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "rounded-xl border border-gray-200 px-4 py-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-start justify-between gap-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "min-w-0", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-sm font-medium text-gray-900", children: entry.description || title }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-xs text-gray-500 mt-1", children: new Date(entry.createdAt).toLocaleString(dateLocale) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "shrink-0 rounded-full border px-2.5 py-1 text-xs font-semibold ".concat(badgeClass), children: [ isCredit ? '+' : '-', amount, " ", entry.currency ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "mt-2 text-xs text-gray-500", children: [ t('profile.balance.history.balance_after', 'Balance after'), ": ", Number(entry.balanceAfter).toFixed(2), " ", entry.currency ] }) ] }, entry.id); }) }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "font-semibold text-gray-800 mb-4", children: t('profile.plan_history.title', 'Plan history') }), planHistory.length === 0 ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "rounded-xl border border-dashed border-gray-200 px-4 py-6 text-sm text-gray-400 text-center", children: t('profile.plan_history.empty', 'Plan change history is empty') }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "space-y-2", children: planHistory.map((entry)=>{ const eventColors = { activated: 'bg-green-50 text-green-700 border-green-100', renewed: 'bg-emerald-50 text-emerald-700 border-emerald-100', downgraded: 'bg-rose-50 text-rose-700 border-rose-100', referral_reward: 'bg-amber-50 text-amber-700 border-amber-100', admin_change: 'bg-purple-50 text-purple-700 border-purple-100', expired: 'bg-gray-100 text-gray-600 border-gray-200' }; const eventLabels = { activated: t('profile.plan_history.event.activated', 'Activated'), renewed: t('profile.plan_history.event.renewed', 'Renewed'), downgraded: t('profile.plan_history.event.downgraded', 'Downgraded'), referral_reward: t('profile.plan_history.event.referral_reward', 'Referral reward'), admin_change: t('profile.plan_history.event.admin_change', 'Changed by admin'), expired: t('profile.plan_history.event.expired', 'Expired') }; var _eventColors_entry_event; const badgeClass = (_eventColors_entry_event = eventColors[entry.event]) !== null && _eventColors_entry_event !== void 0 ? _eventColors_entry_event : 'bg-gray-100 text-gray-600 border-gray-200'; var _eventLabels_entry_event; const label = (_eventLabels_entry_event = eventLabels[entry.event]) !== null && _eventLabels_entry_event !== void 0 ? _eventLabels_entry_event : entry.event; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "rounded-xl border border-gray-200 px-4 py-3", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-start justify-between gap-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "min-w-0", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-2 flex-wrap", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-sm font-semibold text-gray-900", children: entry.planName }), entry.previousPlanName && entry.previousPlanName !== entry.planName && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "text-xs text-gray-400", children: [ "← ", entry.previousPlanName ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-xs text-gray-500 mt-1", children: new Date(entry.createdAt).toLocaleString(dateLocale) }), entry.expiresAt && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "text-xs text-gray-500 mt-0.5", children: [ t('profile.plan_history.expires', 'Until'), ": ", new Date(entry.expiresAt).toLocaleDateString(dateLocale) ] }), entry.daysAdded && entry.event === 'referral_reward' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "text-xs text-amber-600 mt-0.5", children: [ "+", entry.daysAdded, " ", t('profile.plan_history.days', 'days') ] }), entry.note && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-xs text-gray-400 mt-0.5", children: entry.note }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "shrink-0 rounded-full border px-2.5 py-1 text-xs font-semibold ".concat(badgeClass), children: label }) ] }) }, entry.id); }) }) ] }), showTopUpModal && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "fixed inset-0 z-50 flex items-end sm:items-center justify-center p-4 bg-black/40 backdrop-blur-sm", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-2xl shadow-2xl w-full max-w-sm p-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-between mb-5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h3", { className: "text-lg font-semibold text-gray-900", children: t('profile.balance.topup.title') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>setShowTopUpModal(false), className: "text-gray-400 hover:text-gray-600", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-5 h-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" }) }) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-gray-500 mb-3", children: t('profile.balance.topup.hint') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "grid grid-cols-4 gap-2 mb-4", children: [ 5, 10, 20, 50 ].map((v)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { onClick: ()=>setTopUpAmount(v), className: "py-2 rounded-xl text-sm font-semibold border transition-colors ".concat(Number(topUpAmount) === v ? 'bg-green-600 text-white border-green-600' : 'border-gray-200 text-gray-700 hover:border-green-400'), children: [ "€", v ] }, v)) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "mb-5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('profile.balance.topup.amount') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "relative", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "absolute left-3 top-1/2 -translate-y-1/2 text-gray-400 text-sm", children: "€" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "number", min: "1", max: "9999", step: "1", value: topUpAmount, onChange: (e)=>setTopUpAmount(e.target.value), className: "w-full pl-7 pr-4 py-2.5 border border-gray-300 rounded-xl text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }) ] }), topUpError && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-red-600 mb-3", children: topUpError }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: handleTopUp, disabled: topUpLoading || !Number(topUpAmount) || Number(topUpAmount) < 1, className: "w-full py-3 bg-green-600 hover:bg-green-700 disabled:bg-gray-300 disabled:cursor-not-allowed text-white font-semibold rounded-xl transition-colors flex items-center justify-center gap-2", children: topUpLoading ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-4 h-4 animate-spin", fill: "none", viewBox: "0 0 24 24", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { className: "opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8v8z" }) ] }), t('profile.balance.topup.loading') ] }) : t('profile.balance.topup.submit') }) ] }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "font-semibold text-gray-800 mb-3", children: t('profile.plan.title') }), (user === null || user === void 0 ? void 0 : user.plan) ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-start gap-3 p-4 bg-green-50 rounded-xl border border-green-100", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-6 h-6 text-gray-500 shrink-0 mt-0.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M3 10h18M7 15h1m4 0h1m-7 4h12a3 3 0 003-3V8a3 3 0 00-3-3H6a3 3 0 00-3 3v8a3 3 0 003 3z" }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "font-semibold text-gray-900", children: user.plan.name }), user.plan.description && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-gray-500 mt-0.5", children: user.plan.description }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex flex-wrap gap-3 mt-2 text-xs text-gray-500", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "font-medium text-green-700", children: [ user.plan.price, " ", user.plan.currency ] }), user.plan.maxCards != null ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { children: [ t('profile.plan.cards_up_to'), " ", user.plan.maxCards ] }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { children: t('profile.plan.cards_unlimited') }), user.plan.maxTasks != null && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { children: [ t('profile.plan.tasks_up_to'), " ", user.plan.maxTasks ] }), user.plan.maxOffers != null && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { children: [ t('profile.plan.offers_up_to'), " ", user.plan.maxOffers ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: user.planExpiresAt && new Date(user.planExpiresAt) < new Date(Date.now() + 7 * 24 * 60 * 60 * 1000) ? 'text-red-500 font-medium' : '', children: user.planExpiresAt ? "".concat(t('profile.plan.valid_until'), " ").concat(new Date(user.planExpiresAt).toLocaleDateString()) : t('profile.plan.no_expiry') }) ] }), ((_user_plan_features = user.plan.features) !== null && _user_plan_features !== void 0 ? _user_plan_features : []).length > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("ul", { className: "mt-2 space-y-0.5", children: user.plan.features.map((f, i)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("li", { className: "text-xs text-gray-600 flex items-center gap-1.5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-green-500", children: "✓" }), " ", f ] }, i)) }) ] }) ] }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-3 p-4 bg-gray-50 rounded-xl border border-gray-100", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-5 h-5 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm font-medium text-gray-700", children: t('profile.plan.basic') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400 mt-0.5", children: t('profile.plan.contact_upgrade') }) ] }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-center", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("a", { href: "/pricing", className: "inline-flex items-center gap-1.5 text-sm font-medium text-white/70 hover:text-white transition", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M13 7l5 5m0 0l-5 5m5-5H6" }) }), t('pricing.title', 'Pricing') ] }) }) ] }), activeTab !== 'cards' && activeTab !== 'reviews' && activeTab !== 'finance' && activeTab !== 'site' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("form", { onSubmit: handleSubmit, className: "space-y-6", children: [ error && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "bg-red-50 text-red-700 p-3 rounded-lg text-sm", children: error }), saved && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-green-50 text-green-700 p-3 rounded-lg text-sm", children: [ "✓ ", t('profile.saved') ] }), activeTab === 'notifications' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-6 space-y-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "font-semibold text-gray-800", children: t('notifications.title') }), notifySaved && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-green-50 text-green-700 p-3 rounded-lg text-sm", children: [ "✓ ", t('notifications.saved') ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-start justify-between gap-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex-1", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "font-medium text-gray-800 text-sm", children: t('chat.notif_messages') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-500 mt-0.5", children: t('notifications.messages.desc') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", disabled: notifySaving, onClick: async ()=>{ const next = !notifMessages; setNotifMessages(next); setNotifySaving(true); try { await _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Em('/users/me', { method: 'PATCH', body: JSON.stringify({ notifMessages: next }) }); setNotifySaved(true); setTimeout(()=>setNotifySaved(false), 2500); } catch (e) { setNotifMessages(!next); } finally{ setNotifySaving(false); } }, className: "relative inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full transition-colors focus:outline-none focus:ring-2 focus:ring-green-500 focus:ring-offset-2 disabled:opacity-50 ".concat(notifMessages ? 'bg-green-600' : 'bg-gray-200'), role: "switch", "aria-checked": notifMessages, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "inline-block h-4 w-4 transform rounded-full bg-white shadow transition-transform ".concat(notifMessages ? 'translate-x-6' : 'translate-x-1') }) }) ] }), showSpecialistTabs && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-start justify-between gap-4 ".concat(!(user === null || user === void 0 ? void 0 : (_user_plan = user.plan) === null || _user_plan === void 0 ? void 0 : _user_plan.notifyNewTasks) ? 'opacity-60' : ''), children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex-1", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "font-medium text-gray-800 text-sm", children: t('notifications.email.new_tasks') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-500 mt-0.5", children: t('notifications.email.new_tasks.desc') }), !(user === null || user === void 0 ? void 0 : (_user_plan1 = user.plan) === null || _user_plan1 === void 0 ? void 0 : _user_plan1.notifyNewTasks) && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { className: "text-xs text-amber-600 mt-1", children: [ "\uD83D\uDD12 ", t('notifications.plan_required') ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", disabled: notifySaving || !(user === null || user === void 0 ? void 0 : (_user_plan2 = user.plan) === null || _user_plan2 === void 0 ? void 0 : _user_plan2.notifyNewTasks), onClick: async ()=>{ const next = !notifyNewTasks; setNotifyNewTasks(next); setNotifySaving(true); try { await _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Em('/users/me', { method: 'PATCH', body: JSON.stringify({ notifyNewTasks: next }) }); setNotifySaved(true); setTimeout(()=>setNotifySaved(false), 2500); } catch (e) { setNotifyNewTasks(!next); } finally{ setNotifySaving(false); } }, className: "relative inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full transition-colors focus:outline-none focus:ring-2 focus:ring-green-500 focus:ring-offset-2 disabled:opacity-50 ".concat(notifyNewTasks ? 'bg-green-600' : 'bg-gray-200'), role: "switch", "aria-checked": notifyNewTasks, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "inline-block h-4 w-4 transform rounded-full bg-white shadow transition-transform ".concat(notifyNewTasks ? 'translate-x-6' : 'translate-x-1') }) }) ] }) ] }), activeTab === 'referral' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-6 space-y-5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "font-semibold text-gray-800", children: t('profile.referral.title') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-gray-500", children: t('profile.referral.desc') }), !referralLoaded ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-sm text-gray-400", children: t('common.loading') }) : referralCode ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs font-medium text-gray-500 mb-1.5", children: t('profile.referral.link_label') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { readOnly: true, value: "".concat( true ? window.location.origin : 0, "/register?ref=").concat(referralCode), className: "flex-1 text-sm border border-gray-200 rounded-lg px-3 py-2 bg-gray-50 text-gray-700 focus:outline-none" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>{ navigator.clipboard.writeText("".concat(window.location.origin, "/register?ref=").concat(referralCode)); setReferralCopied(true); setTimeout(()=>setReferralCopied(false), 2000); }, className: "px-3 py-2 rounded-lg border border-gray-200 text-sm font-medium hover:bg-gray-50 transition whitespace-nowrap", children: referralCopied ? t('profile.referral.copied') : t('profile.referral.copy') }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-3 p-4 bg-green-50 rounded-xl", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-2xl font-bold text-green-700", children: referralCount }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-green-700", children: t('profile.referral.invited_count') }) ] }) ] }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-sm text-gray-400", children: t('profile.referral.no_code') }) ] }), activeTab === 'auto_response' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(AutoResponseTab, { categories: categories, locationTree: locationTree, loaded: arLoaded, onLoad: ()=>{ if (arLoaded) return; _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getAutoResponseSettings */ .Gp().then((s)=>{ setAutoResponse(s); setArLoaded(true); }).catch(()=>setArLoaded(true)); }, settings: autoResponse, saving: arSaving, saved: arSaved, onSave: async (data)=>{ setArSaving(true); setArSaved(false); try { const updated = await _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .updateAutoResponseSettings */ .RQ(data); setAutoResponse(updated); setArSaved(true); setTimeout(()=>setArSaved(false), 2500); } catch (e) {} finally{ setArSaving(false); } }, t: t, catLocale: catLocale }), activeTab === 'info' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "font-semibold text-gray-800 mb-4", children: t('profile.photo') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "relative", children: [ (user === null || user === void 0 ? void 0 : user.image) ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: user.image, alt: user.name, className: "w-20 h-20 rounded-full object-cover border-2 border-gray-200" }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "w-20 h-20 rounded-full bg-green-100 flex items-center justify-center text-green-700 text-2xl font-bold border-2 border-gray-200", children: initials }), avatarUploading && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "absolute inset-0 rounded-full bg-black/40 flex items-center justify-center", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "w-5 h-5 border-2 border-white border-t-transparent rounded-full animate-spin" }) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>{ var _fileRef_current; return (_fileRef_current = fileRef.current) === null || _fileRef_current === void 0 ? void 0 : _fileRef_current.click(); }, disabled: avatarUploading, className: "bg-gray-100 hover:bg-gray-200 text-gray-700 px-4 py-2 rounded-lg text-sm font-medium disabled:opacity-50", children: t('profile.photo.change') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400 mt-1", children: t('profile.photo.hint') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { ref: fileRef, type: "file", accept: "image/jpeg,image/png,image/webp", className: "hidden", onChange: handleAvatarChange }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "mt-3 rounded-lg border border-gray-200 bg-gray-50 px-3 py-2.5", children: isSpecialist ? (dashData === null || dashData === void 0 ? void 0 : (_dashData_features3 = dashData.features) === null || _dashData_features3 === void 0 ? void 0 : _dashData_features3.hasCanHelpNowStatus) ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "flex items-center justify-between cursor-pointer gap-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-xs font-medium text-gray-700", children: t('status.can_help_now', 'Available now') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", disabled: statusToggling === 'canhelp_now', onClick: async ()=>{ setStatusToggling('canhelp_now'); const nextActive = !myStatuses.includes('canhelp_now'); try { const res = await _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .toggleStatus */ .bc('canhelp_now', nextActive); setMyStatuses((prev)=>res.isActive ? [ ...prev.filter((s)=>s !== 'canhelp_now'), 'canhelp_now' ] : prev.filter((s)=>s !== 'canhelp_now')); } catch (e) {} finally{ setStatusToggling(null); } }, className: "relative inline-flex h-5 w-10 items-center rounded-full transition-colors ".concat(myStatuses.includes('canhelp_now') ? 'bg-green-500' : 'bg-gray-300', " disabled:opacity-50"), children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "inline-block h-3.5 w-3.5 transform rounded-full bg-white shadow transition-transform ".concat(myStatuses.includes('canhelp_now') ? 'translate-x-5.5' : 'translate-x-1') }) }) ] }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-amber-700", children: t('status.plan_required', 'Status is unavailable on your current plan') }) : !isAdmin ? (dashData === null || dashData === void 0 ? void 0 : (_dashData_features4 = dashData.features) === null || _dashData_features4 === void 0 ? void 0 : _dashData_features4.hasNeedHelpStatus) ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "flex items-center justify-between cursor-pointer gap-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-xs font-medium text-gray-700", children: t('status.need_help', 'Need help') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", disabled: statusToggling === 'need_help', onClick: async ()=>{ setStatusToggling('need_help'); const nextActive = !myStatuses.includes('need_help'); try { const res = await _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .toggleStatus */ .bc('need_help', nextActive); setMyStatuses((prev)=>res.isActive ? [ ...prev.filter((s)=>s !== 'need_help'), 'need_help' ] : prev.filter((s)=>s !== 'need_help')); } catch (e) {} finally{ setStatusToggling(null); } }, className: "relative inline-flex h-5 w-10 items-center rounded-full transition-colors ".concat(myStatuses.includes('need_help') ? 'bg-green-500' : 'bg-gray-300', " disabled:opacity-50"), children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "inline-block h-3.5 w-3.5 transform rounded-full bg-white shadow transition-transform ".concat(myStatuses.includes('need_help') ? 'translate-x-5.5' : 'translate-x-1') }) }) ] }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-amber-700", children: t('status.plan_required', 'Status is unavailable on your current plan') }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-600", children: t('status.admin_not_applicable', 'User status is not applicable to admin accounts') }) }) ] }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "font-semibold text-gray-800 mb-4", children: t('profile.background.title', 'Profile header background') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "w-full h-40 rounded-2xl border border-gray-200 overflow-hidden relative", style: { backgroundImage: siteSettings.profileBackgroundImage ? "linear-gradient(135deg, rgba(22,163,74,0.45), rgba(21,128,61,0.65)), url(".concat(siteSettings.profileBackgroundImage, ")") : 'linear-gradient(135deg, #22c55e 0%, #16a34a 45%, #166534 100%)', backgroundSize: 'cover', backgroundPosition: 'center' }, children: backgroundUploading && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "absolute inset-0 bg-black/35 flex items-center justify-center", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "w-6 h-6 border-2 border-white border-t-transparent rounded-full animate-spin" }) }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "mt-4 flex flex-wrap gap-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>{ var _backgroundFileRef_current; return (_backgroundFileRef_current = backgroundFileRef.current) === null || _backgroundFileRef_current === void 0 ? void 0 : _backgroundFileRef_current.click(); }, disabled: backgroundUploading, className: "bg-gray-100 hover:bg-gray-200 text-gray-700 px-4 py-2 rounded-lg text-sm font-medium disabled:opacity-50", children: backgroundUploading ? t('profile.photo.uploading', 'Uploading...') : t('profile.background.change', 'Change background') }), siteSettings.profileBackgroundImage && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: handleRemoveBackground, disabled: backgroundUploading, className: "bg-white hover:bg-gray-50 text-gray-700 px-4 py-2 rounded-lg text-sm font-medium border border-gray-200 disabled:opacity-50", children: t('profile.background.remove', 'Remove background') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { ref: backgroundFileRef, type: "file", accept: "image/jpeg,image/png,image/webp", className: "hidden", onChange: handleBackgroundChange }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400 mt-2", children: t('profile.background.hint', 'Shown in the public profile header on web and mobile app.') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-6 space-y-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "font-semibold text-gray-800", children: t('profile.basic_info') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "grid grid-cols-2 gap-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('register.first_name') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: formData.firstName, onChange: (e)=>setFormData({ ...formData, firstName: e.target.value }), required: true, className: "w-full border border-gray-300 rounded-lg px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-400 text-sm" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('register.last_name') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: formData.lastName, onChange: (e)=>setFormData({ ...formData, lastName: e.target.value }), required: true, className: "w-full border border-gray-300 rounded-lg px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-400 text-sm" }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: "Email" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: user === null || user === void 0 ? void 0 : user.email, disabled: true, className: "w-full border border-gray-200 rounded-lg px-3 py-2 text-sm text-gray-400 bg-gray-50 cursor-not-allowed" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-between mt-1.5", children: [ (user === null || user === void 0 ? void 0 : user.emailVerified) ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "flex items-center gap-1 text-xs text-green-600", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "inline-block w-1.5 h-1.5 rounded-full bg-green-500" }), t('profile.email.verified') ] }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "flex items-center gap-1 text-xs text-amber-600", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "inline-block w-1.5 h-1.5 rounded-full bg-amber-500" }), t('profile.email.not_verified') ] }), !(user === null || user === void 0 ? void 0 : user.emailVerified) && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", disabled: resendState !== 'idle', onClick: handleResendVerification, className: "text-xs text-green-600 hover:underline disabled:opacity-60 disabled:no-underline", children: resendState === 'sending' ? t('login.unverified.sending') : resendState === 'sent' ? t('login.unverified.sent') : t('login.unverified.resend') }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('profile.phone') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "tel", value: formData.phone, onChange: (e)=>setFormData({ ...formData, phone: e.target.value }), placeholder: t('profile.phone.placeholder'), className: "w-full border border-gray-300 rounded-lg px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-400 text-sm" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('profile.bio') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("textarea", { value: formData.bio, onChange: (e)=>setFormData({ ...formData, bio: e.target.value }), rows: 3, maxLength: 1000, placeholder: t('profile.bio.placeholder'), className: "w-full border border-gray-300 rounded-lg px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-400 text-sm resize-none" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('profile.language') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400 mb-2", children: t('profile.language.hint') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("select", { value: formData.locale, onChange: (e)=>setFormData({ ...formData, locale: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "el", children: "ΕλληΜικά" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "en", children: "English" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "ru", children: "РусскОй" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "uk", children: "УкраїМська" }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('profile.languages') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400 mb-2", children: t('profile.languages.hint') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex flex-wrap gap-2", children: [ { code: 'el', flag: '🇬🇷', label: 'ΕλληΜικά' }, { code: 'en', flag: '🇬🇧', label: 'English' }, { code: 'ru', flag: '🇷🇺', label: 'РусскОй' }, { code: 'uk', flag: '🇺🇊', label: 'УкраїМська' }, { code: 'de', flag: '🇩🇪', label: 'Deutsch' }, { code: 'fr', flag: '🇫🇷', label: 'Français' }, { code: 'it', flag: '🇮🇹', label: 'Italiano' }, { code: 'es', flag: '🇪🇞', label: 'Español' }, { code: 'ar', flag: '🇞🇊', label: 'العرؚية' }, { code: 'zh', flag: '🇚🇳', label: 'äž­æ–‡' } ].map((param)=>{ let { code, flag, label } = param; const selected = selectedLanguages.includes(code); return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { type: "button", onClick: ()=>setSelectedLanguages(selected ? selectedLanguages.filter((l)=>l !== code) : [ ...selectedLanguages, code ]), className: "flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-sm border transition ".concat(selected ? 'bg-green-600 border-green-600 text-white' : 'bg-white border-gray-300 text-gray-700 hover:border-green-400'), children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { children: flag }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { children: label }) ] }, code); }) }) ] }) ] }), !isSpecialist && !isAdmin && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "p-4 bg-purple-50 rounded-xl", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-gray-600 mb-3", children: t('profile.become_specialist.desc') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: handleBecomeSpecialist, disabled: becomingSpecialist, className: "bg-purple-600 hover:bg-purple-700 text-white px-5 py-2 rounded-lg text-sm font-semibold disabled:opacity-50", children: becomingSpecialist ? t('common.loading') : t('profile.become_specialist') }) ] }) }), isSpecialist && ((dashData === null || dashData === void 0 ? void 0 : (_dashData_plan = dashData.plan) === null || _dashData_plan === void 0 ? void 0 : _dashData_plan.tier) === 'pro' || (dashData === null || dashData === void 0 ? void 0 : (_dashData_plan1 = dashData.plan) === null || _dashData_plan1 === void 0 ? void 0 : _dashData_plan1.tier) === 'ultimate') && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "font-semibold text-gray-800 mb-4", children: t('profile.show_contact', 'Show contacts') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "flex items-center justify-between cursor-pointer gap-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm font-medium text-gray-800", children: t('profile.show_contact_hint', 'Clients can see your phone number') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400 mt-0.5", children: t('profile.show_contact_desc', 'Lets clients contact you directly') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>setShowContactInfo((v)=>!v), className: "relative inline-flex h-6 w-11 items-center rounded-full transition-colors ".concat(showContactInfo ? 'bg-green-500' : 'bg-gray-300'), children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "inline-block h-4 w-4 transform rounded-full bg-white shadow transition-transform ".concat(showContactInfo ? 'translate-x-6' : 'translate-x-1') }) }) ] }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "submit", disabled: saving, className: "w-full bg-green-600 text-white py-3 rounded-xl font-semibold hover:bg-green-700 disabled:opacity-50 disabled:cursor-not-allowed ".concat(activeTab === 'notifications' || activeTab === 'referral' || activeTab === 'auto_response' ? 'hidden' : ''), children: saving ? t('profile.saving') : t('common.save') }) ] }), showUpgradeModal && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "fixed inset-0 z-50 flex items-center justify-center bg-black/50 px-4", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-2xl shadow-xl p-6 w-full max-w-md", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-center mb-5", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-5xl", children: "\uD83D\uDE80" }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "text-lg font-bold text-gray-900 text-center mb-2", children: t('profile.upgrade.cards_limit') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { className: "text-sm text-gray-600 text-center mb-4", children: [ (_user_plan_name = user === null || user === void 0 ? void 0 : (_user_plan3 = user.plan) === null || _user_plan3 === void 0 ? void 0 : _user_plan3.name) !== null && _user_plan_name !== void 0 ? _user_plan_name : t('profile.plan.basic'), " — ", t('profile.plan.cards_up_to'), " ", maxCards ] }), (user === null || user === void 0 ? void 0 : user.plan) && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-gray-50 rounded-xl p-4 mb-5 text-sm text-gray-600 text-center", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "font-medium text-gray-800", children: t('profile.upgrade.plan') }), ' ', user.plan.name, " — ", user.plan.price, " ", user.plan.currency ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400 text-center mb-5", children: t('profile.upgrade.contact') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>setShowUpgradeModal(false), className: "w-full bg-green-600 hover:bg-green-700 text-white py-2.5 rounded-xl text-sm font-semibold", children: t('profile.upgrade.ok') }) ] }) }) ] }) ] }) ] }); } €”{"finalSource":true}ƒmap‹bufferedMap ConcatSourceRawSourcet__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ ProfilePage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7541); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(1592); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(9906); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(2982); /* harmony import */ var _components_CategoryIcon__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(5940); ReplaceSourceRawSource’/* __next_internal_client_entry_do_not_use__ default auto */ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime"; import { useState, useEffect, useRef, Suspense } from 'react'; import { useRouter, useSearchParams } from 'next/navigation'; import { useSession, authClient } from '@/lib/auth'; import { useLocale } from '@/context/locale'; import * as api from '@/lib/api'; import { CategoryIcon, isCategoryIconUrl } from '@/components/CategoryIcon'; function SpecialistCardEditor(param) { let { card, isOpen, onToggle, onUpdate, onDelete, categories, locationTree, catLocale, locale, hasPriceList, visibilityIssues = [], moderationNotice = null } = param; const { t } = useLocale(); const hasVisibilityIssues = visibilityIssues.length > 0; const [cardTab, setCardTab] = useState('main'); const [saving, setSaving] = useState(false); const [savedOk, setSavedOk] = useState(false); const [localTitle, setLocalTitle] = useState(card.title); var _card_descriptionEl; const [localDescEl, setLocalDescEl] = useState((_card_descriptionEl = card.descriptionEl) !== null && _card_descriptionEl !== void 0 ? _card_descriptionEl : ''); var _card_descriptionEn; const [localDescEn, setLocalDescEn] = useState((_card_descriptionEn = card.descriptionEn) !== null && _card_descriptionEn !== void 0 ? _card_descriptionEn : ''); var _card_descriptionRu; const [localDescRu, setLocalDescRu] = useState((_card_descriptionRu = card.descriptionRu) !== null && _card_descriptionRu !== void 0 ? _card_descriptionRu : ''); var _card_descriptionUk; const [localDescUk, setLocalDescUk] = useState((_card_descriptionUk = card.descriptionUk) !== null && _card_descriptionUk !== void 0 ? _card_descriptionUk : ''); var _card_skills; const [localSkills, setLocalSkills] = useState((_card_skills = card.skills) !== null && _card_skills !== void 0 ? _card_skills : []); const [skillInput, setSkillInput] = useState(''); var _card_categories; const [localCategories, setLocalCategories] = useState((_card_categories = card.categories) !== null && _card_categories !== void 0 ? _card_categories : []); var _card_locations; const [localLocations, setLocalLocations] = useState((_card_locations = card.locations) !== null && _card_locations !== void 0 ? _card_locations : []); var _card_publicationStatus; const [localPublicationStatus, setLocalPublicationStatus] = useState((_card_publicationStatus = card.publicationStatus) !== null && _card_publicationStatus !== void 0 ? _card_publicationStatus : card.isActive ? 'active' : 'inactive'); const [apiSkillSugs, setApiSkillSugs] = useState([]); var _card_portfolio; const [portfolio, setPortfolio] = useState((_card_portfolio = card.portfolio) !== null && _card_portfolio !== void 0 ? _card_portfolio : []); const [portfolioUploading, setPortfolioUploading] = useState(false); const [editingItem, setEditingItem] = useState(null); const [editTitle, setEditTitle] = useState(''); const [editDesc, setEditDesc] = useState(''); const portfolioFileRef = useRef(null); // Price list state const [priceList, setPriceList] = useState([]); const [priceListLoading, setPriceListLoading] = useState(false); const [newGroupTitle, setNewGroupTitle] = useState(''); const [addingGroupId, setAddingGroupId] = useState(null); const [newItem, setNewItem] = useState({ name: '', description: '', price: '', unit: '' }); const [editingGroupId, setEditingGroupId] = useState(null); const [editGroupTitle, setEditGroupTitle] = useState(''); useEffect(()=>{ if (cardTab !== 'pricelist' || priceList.length > 0 || priceListLoading) return; setPriceListLoading(true); api.getPriceList(card.id, locale).then(setPriceList).catch(()=>{}).finally(()=>setPriceListLoading(false)); }, [ cardTab, locale ]); async function handleAddGroup() { if (!newGroupTitle.trim()) return; const group = await api.createPriceListGroup(card.id, { title: newGroupTitle.trim(), locale: [ 'el', 'en', 'ru', 'uk' ].includes(locale) ? locale : 'el', autoTranslate: true }); setPriceList((prev)=>[ ...prev, group ]); setNewGroupTitle(''); } async function handleDeleteGroup(groupId) { await api.deletePriceListGroup(groupId); setPriceList((prev)=>prev.filter((g)=>g.id !== groupId)); } async function handleSaveGroupTitle(groupId) { const updated = await api.updatePriceListGroup(groupId, { title: editGroupTitle.trim(), locale: [ 'el', 'en', 'ru', 'uk' ].includes(locale) ? locale : 'el', autoTranslate: true }); setPriceList((prev)=>prev.map((g)=>g.id === groupId ? { ...g, title: updated.title } : g)); setEditingGroupId(null); } async function handleAddItem(groupId) { if (!newItem.name.trim()) return; const item = await api.createPriceListItem(groupId, { name: newItem.name.trim(), description: newItem.description.trim() || null, price: newItem.price.trim() || null, unit: newItem.unit.trim() || null, locale: [ 'el', 'en', 'ru', 'uk' ].includes(locale) ? locale : 'el', autoTranslate: true }); setPriceList((prev)=>prev.map((g)=>g.id === groupId ? { ...g, items: [ ...g.items, item ] } : g)); setNewItem({ name: '', description: '', price: '', unit: '' }); setAddingGroupId(null); } async function handleDeleteItem(itemId, groupId) { await api.deletePriceListItem(itemId); setPriceList((prev)=>prev.map((g)=>g.id === groupId ? { ...g, items: g.items.filter((i)=>i.id !== itemId) } : g)); } useEffect(()=>{ if (cardTab !== 'skills') return; api.getSkillSuggestions(localCategories.length > 0 ? localCategories : undefined).then(setApiSkillSugs).catch(()=>setApiSkillSugs([])); }, [ localCategories, cardTab ]); const lbl = (ru, en, el)=>locale === 'ru' ? ru : locale === 'en' ? en : el; async function saveAll() { setSaving(true); try { const activeLocale = [ 'el', 'en', 'ru', 'uk' ].includes(locale) ? locale : 'el'; const cap = activeLocale.charAt(0).toUpperCase() + activeLocale.slice(1); const descField = "description".concat(cap); const descValue = { el: localDescEl, en: localDescEn, ru: localDescRu, uk: localDescUk }[activeLocale] || null; const updated = await api.updateSpecialistCard(card.id, { title: localTitle, [descField]: descValue, descriptionLocale: activeLocale, autoTranslate: !!descValue, skills: localSkills, categories: localCategories, locations: localLocations, publicationStatus: localPublicationStatus, isActive: localPublicationStatus === 'active' }); onUpdate({ ...updated, portfolio }); setSavedOk(true); setTimeout(()=>setSavedOk(false), 2000); } catch (e) {} finally{ setSaving(false); } } async function updatePublicationStatus(next) { setLocalPublicationStatus(next); try { await api.updateSpecialistCard(card.id, { publicationStatus: next, isActive: next === 'active' }); } catch (e) {} } function addSkill(s) { const trimmed = s.trim(); if (trimmed && !localSkills.includes(trimmed)) setLocalSkills([ ...localSkills, trimmed ]); setSkillInput(''); } function toggleCategory(slug) { let childSlugs = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : []; if (localCategories.includes(slug)) { setLocalCategories(localCategories.filter((c)=>c !== slug && !childSlugs.includes(c))); } else { setLocalCategories([ ...new Set([ ...localCategories, slug, ...childSlugs ]) ]); } } function toggleLocation(slug) { let childSlugs = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : []; if (localLocations.includes(slug)) { setLocalLocations(localLocations.filter((c)=>c !== slug && !childSlugs.includes(c))); } else { setLocalLocations([ ...new Set([ ...localLocations, slug, ...childSlugs ]) ]); } } async function handlePortfolioUpload(e) { var _e_target_files; const file = (_e_target_files = e.target.files) === null || _e_target_files === void 0 ? void 0 : _e_target_files[0]; if (!file) return; setPortfolioUploading(true); try { const form = new FormData(); form.append('file', file); form.append('cardId', card.id); const res = await fetch("".concat(process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000', "/api/portfolio"), { method: 'POST', credentials: 'include', body: form }); if (!res.ok) throw new Error('Upload failed'); const item = await res.json(); const next = [ ...portfolio, item ]; setPortfolio(next); onUpdate({ ...card, portfolio: next }); } catch (e) {} finally{ setPortfolioUploading(false); if (portfolioFileRef.current) portfolioFileRef.current.value = ''; } } async function handlePortfolioDelete(id) { try { await api.deletePortfolioItem(id); const next = portfolio.filter((p)=>p.id !== id); setPortfolio(next); onUpdate({ ...card, portfolio: next }); } catch (e) {} } async function handlePortfolioSave(id) { try { const item = await api.updatePortfolioItem(id, { title: editTitle, description: editDesc }); setPortfolio((prev)=>prev.map((p)=>p.id === id ? item : p)); setEditingItem(null); } catch (e) {} } const cardTabs = [ { id: 'main', label: t('profile.card.tab.main') }, { id: 'categories', label: t('profile.card.tab.categories') }, { id: 'skills', label: t('profile.card.tab.skills') }, { id: 'geography', label: t('profile.card.tab.geography') }, { id: 'pricelist', label: t('profile.card.tab.pricelist'), hidden: !hasPriceList }, { id: 'portfolio', label: t('profile.card.tab.portfolio') } ]; const pendingReviewNotice = localPublicationStatus === 'pending' ? { title: t('profile.card.review_pending', 'Pending approval'), body: t('profile.card.review_pending_hint', 'Your card is being reviewed by the admin team.'), tone: 'amber' } : null; const effectiveModerationNotice = moderationNotice !== null && moderationNotice !== void 0 ? moderationNotice : pendingReviewNotice; return /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 overflow-hidden", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 px-4 py-3 border-b border-gray-100 ".concat(hasVisibilityIssues ? 'bg-amber-50' : ''), children: [ /*#__PURE__*/ _jsxs("button", { type: "button", onClick: onToggle, className: "flex-1 flex items-center gap-3 text-left", children: [ /*#__PURE__*/ _jsx("span", { className: "text-sm font-semibold text-gray-800 flex-1", children: localTitle || card.title }), hasVisibilityIssues && /*#__PURE__*/ _jsx("span", { className: "inline-flex items-center justify-center w-5 h-5 rounded-full bg-amber-500 text-white text-xs font-bold", title: t('profile.card.visibility_issue', 'Card is not shown in offers'), children: "!" }), /*#__PURE__*/ _jsx("span", { className: "text-gray-400 text-xs", children: isOpen ? '▲' : 'â–Œ' }) ] }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>updatePublicationStatus(localPublicationStatus === 'active' ? 'inactive' : localPublicationStatus === 'pending' ? 'inactive' : 'pending'), className: "px-3 py-1.5 rounded-lg text-xs font-medium whitespace-nowrap ".concat(localPublicationStatus === 'active' ? 'bg-red-50 text-red-700 hover:bg-red-100' : localPublicationStatus === 'pending' ? 'bg-amber-50 text-amber-700 hover:bg-amber-100' : 'bg-green-50 text-green-700 hover:bg-green-100'), children: localPublicationStatus === 'active' ? t('profile.card.unpublish', 'Unpublish') : localPublicationStatus === 'pending' ? t('profile.card.withdraw_review', 'Withdraw request') : t('profile.card.submit_review', 'Submit for review') }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: onDelete, className: "text-red-400 hover:text-red-600 text-sm px-1 flex-shrink-0", title: t('profile.card.delete'), children: "\uD83D\uDDD1" }) ] }), isOpen && /*#__PURE__*/ _jsxs("div", { children: [ hasVisibilityIssues && /*#__PURE__*/ _jsxs("div", { className: "mx-4 mt-4 mb-2 rounded-lg border border-amber-300 bg-amber-50 p-3", children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs font-semibold text-amber-900", children: t('profile.card.visibility_issue', 'Card is not shown in offers') }), /*#__PURE__*/ _jsx("ul", { className: "mt-1.5 list-disc pl-4 text-xs text-amber-900 space-y-0.5", children: visibilityIssues.map((issue)=>/*#__PURE__*/ _jsx("li", { children: issue }, issue)) }) ] }), effectiveModerationNotice && /*#__PURE__*/ _jsxs("div", { className: "mx-4 mt-4 mb-2 rounded-lg border p-3 ".concat(effectiveModerationNotice.tone === 'green' ? 'border-green-300 bg-green-50' : effectiveModerationNotice.tone === 'red' ? 'border-red-300 bg-red-50' : 'border-amber-300 bg-amber-50'), children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs font-semibold ".concat(effectiveModerationNotice.tone === 'green' ? 'text-green-900' : effectiveModerationNotice.tone === 'red' ? 'text-red-900' : 'text-amber-900'), children: effectiveModerationNotice.title }), effectiveModerationNotice.body && /*#__PURE__*/ _jsx("p", { className: "mt-1 text-xs ".concat(effectiveModerationNotice.tone === 'green' ? 'text-green-800' : effectiveModerationNotice.tone === 'red' ? 'text-red-800' : 'text-amber-800'), children: effectiveModerationNotice.body }) ] }), /*#__PURE__*/ _jsx("div", { className: "flex overflow-x-auto border-b border-gray-100 bg-gray-50 gap-0", children: cardTabs.filter((t)=>!t.hidden).map((t)=>/*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setCardTab(t.id), className: "px-4 py-2.5 text-xs font-medium whitespace-nowrap border-b-2 transition -mb-px ".concat(cardTab === t.id ? 'border-green-500 text-green-600 bg-white' : 'border-transparent text-gray-500 hover:text-gray-700'), children: t.label }, t.id)) }), /*#__PURE__*/ _jsxs("div", { className: "p-4", children: [ cardTab === 'main' && /*#__PURE__*/ _jsxs("div", { className: "space-y-3", children: [ /*#__PURE__*/ _jsx("input", { value: localTitle, onChange: (e)=>setLocalTitle(e.target.value), maxLength: 200, placeholder: t('profile.cards.new_title'), 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" }), (()=>{ const activeLocale = [ 'el', 'en', 'ru', 'uk' ].includes(locale) ? locale : 'el'; const descMap = { el: [ localDescEl, setLocalDescEl ], en: [ localDescEn, setLocalDescEn ], ru: [ localDescRu, setLocalDescRu ], uk: [ localDescUk, setLocalDescUk ] }; const [val, setVal] = descMap[activeLocale]; const flags = { el: '🇬🇷', en: '🇬🇧', ru: '🇷🇺', uk: '🇺🇊' }; const otherLocales = [ 'el', 'en', 'ru', 'uk' ].filter((l)=>l !== activeLocale); const otherHasContent = otherLocales.some((l)=>descMap[l][0]); return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-1.5 text-xs font-medium text-gray-500 mb-1", children: [ flags[activeLocale], " ", t('profile.card.description', 'Description') ] }), /*#__PURE__*/ _jsx("textarea", { value: val, onChange: (e)=>setVal(e.target.value), rows: 4, maxLength: 2000, placeholder: t('profile.bio.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" }), val && /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-1", children: t('profile.card.desc_auto_translate', 'Will be automatically translated into other languages on save') }), otherHasContent && /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-1.5 mt-1.5", children: [ /*#__PURE__*/ _jsx("span", { className: "text-xs text-gray-400", children: t('profile.card.desc_translated', 'Translations available:') }), otherLocales.map((l)=>/*#__PURE__*/ _jsx("span", { className: "text-xs px-1.5 py-0.5 rounded-full ".concat(descMap[l][0] ? 'bg-green-50 text-green-600' : 'bg-gray-100 text-gray-400'), children: flags[l] }, l)) ] }) ] }); })() ] }), cardTab === 'skills' && /*#__PURE__*/ _jsxs("div", { className: "space-y-3", children: [ localSkills.length > 0 && /*#__PURE__*/ _jsx("div", { className: "flex flex-wrap gap-2", children: localSkills.map((s)=>/*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-1.5 bg-green-50 text-green-700 text-sm px-3 py-1 rounded-full", children: [ s, /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setLocalSkills(localSkills.filter((x)=>x !== s)), className: "text-gray-400 hover:text-green-700 leading-none", children: "\xd7" }) ] }, s)) }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-2", children: [ /*#__PURE__*/ _jsx("input", { value: skillInput, onChange: (e)=>setSkillInput(e.target.value), onKeyDown: (e)=>{ if (e.key === 'Enter') { e.preventDefault(); addSkill(skillInput); } }, placeholder: t('profile.card.skill.add'), 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" }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>addSkill(skillInput), className: "px-3 py-2 bg-gray-100 hover:bg-gray-200 rounded-lg text-sm font-medium", children: "+" }) ] }), apiSkillSugs.length > 0 && /*#__PURE__*/ _jsx("div", { className: "flex flex-wrap gap-1.5", children: apiSkillSugs.map((s)=>{ var _s_names_catLocale; return (_s_names_catLocale = s.names[catLocale]) !== null && _s_names_catLocale !== void 0 ? _s_names_catLocale : s.names.el; }).filter((name, i, arr)=>arr.indexOf(name) === i && !localSkills.includes(name)).slice(0, 16).map((name)=>/*#__PURE__*/ _jsxs("button", { type: "button", onClick: ()=>addSkill(name), className: "text-xs px-2.5 py-1 border border-gray-200 rounded-full text-gray-500 hover:border-green-400 hover:text-green-600 transition", children: [ "+ ", name ] }, name)) }) ] }), cardTab === 'categories' && /*#__PURE__*/ _jsx("div", { className: "space-y-3", children: categories.map((cat)=>{ var _cat_names, _cat_names1; var _cat_names_catLocale, _ref; const catName = (_ref = (_cat_names_catLocale = (_cat_names = cat.names) === null || _cat_names === void 0 ? void 0 : _cat_names[catLocale]) !== null && _cat_names_catLocale !== void 0 ? _cat_names_catLocale : (_cat_names1 = cat.names) === null || _cat_names1 === void 0 ? void 0 : _cat_names1.el) !== null && _ref !== void 0 ? _ref : cat.slug; var _cat_children; const children = (_cat_children = cat.children) !== null && _cat_children !== void 0 ? _cat_children : []; const childSlugs = children.map((c)=>c.slug); return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-2.5 cursor-pointer", children: [ /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: localCategories.includes(cat.slug), onChange: ()=>toggleCategory(cat.slug, childSlugs), className: "w-4 h-4 rounded border-gray-300 text-green-600 focus:ring-blue-400" }), /*#__PURE__*/ _jsxs("span", { className: "text-sm font-medium text-gray-800 inline-flex items-center gap-1", children: [ cat.icon && /*#__PURE__*/ _jsx(CategoryIcon, { icon: cat.icon, alt: catName, className: isCategoryIconUrl(cat.icon) ? 'h-4 w-4 object-contain' : 'text-sm leading-none', fallback: "\uD83D\uDCE6" }), catName ] }) ] }), children.length > 0 && /*#__PURE__*/ _jsx("div", { className: "ml-6 mt-2 space-y-2", children: children.map((sub)=>{ var _sub_names, _sub_names1; var _sub_names_catLocale, _ref; const subName = (_ref = (_sub_names_catLocale = (_sub_names = sub.names) === null || _sub_names === void 0 ? void 0 : _sub_names[catLocale]) !== null && _sub_names_catLocale !== void 0 ? _sub_names_catLocale : (_sub_names1 = sub.names) === null || _sub_names1 === void 0 ? void 0 : _sub_names1.el) !== null && _ref !== void 0 ? _ref : sub.slug; return /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-2.5 cursor-pointer", children: [ /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: localCategories.includes(sub.slug), onChange: ()=>toggleCategory(sub.slug), className: "w-4 h-4 rounded border-gray-300 text-green-600 focus:ring-blue-400" }), /*#__PURE__*/ _jsx("span", { className: "text-sm text-gray-600", children: subName }) ] }, sub.id); }) }) ] }, cat.id); }) }), cardTab === 'geography' && /*#__PURE__*/ _jsx("div", { className: "space-y-3", children: locationTree.map((city)=>{ var _city_names, _city_names1; var _city_names_catLocale, _ref; const cityName = (_ref = (_city_names_catLocale = (_city_names = city.names) === null || _city_names === void 0 ? void 0 : _city_names[catLocale]) !== null && _city_names_catLocale !== void 0 ? _city_names_catLocale : (_city_names1 = city.names) === null || _city_names1 === void 0 ? void 0 : _city_names1.el) !== null && _ref !== void 0 ? _ref : city.slug; var _city_children; const districts = (_city_children = city.children) !== null && _city_children !== void 0 ? _city_children : []; const districtSlugs = districts.map((d)=>d.slug); return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-2.5 cursor-pointer", children: [ /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: localLocations.includes(city.slug), onChange: ()=>toggleLocation(city.slug, districtSlugs), className: "w-4 h-4 rounded border-gray-300 text-green-600 focus:ring-blue-400" }), /*#__PURE__*/ _jsx("span", { className: "text-sm font-medium text-gray-800", children: cityName }) ] }), districts.length > 0 && /*#__PURE__*/ _jsx("div", { className: "ml-6 mt-2 space-y-2", children: districts.map((d)=>{ var _d_names, _d_names1; var _d_names_catLocale, _ref; const dName = (_ref = (_d_names_catLocale = (_d_names = d.names) === null || _d_names === void 0 ? void 0 : _d_names[catLocale]) !== null && _d_names_catLocale !== void 0 ? _d_names_catLocale : (_d_names1 = d.names) === null || _d_names1 === void 0 ? void 0 : _d_names1.el) !== null && _ref !== void 0 ? _ref : d.slug; return /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-2.5 cursor-pointer", children: [ /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: localLocations.includes(d.slug), onChange: ()=>toggleLocation(d.slug), className: "w-4 h-4 rounded border-gray-300 text-green-600 focus:ring-blue-400" }), /*#__PURE__*/ _jsx("span", { className: "text-sm text-gray-600", children: dName }) ] }, d.id); }) }) ] }, city.id); }) }), cardTab === 'pricelist' && /*#__PURE__*/ _jsx("div", { className: "space-y-4", children: priceListLoading ? /*#__PURE__*/ _jsx("div", { className: "text-center py-6 text-gray-400 text-sm", children: t('common.loading', 'Loading...') }) : /*#__PURE__*/ _jsxs(_Fragment, { children: [ priceList.length === 0 && /*#__PURE__*/ _jsx("div", { className: "text-center py-6 text-gray-400 text-sm border-2 border-dashed border-gray-200 rounded-xl", children: t('profile.card.pricelist.empty') }), priceList.map((group)=>/*#__PURE__*/ _jsxs("div", { className: "border border-gray-200 rounded-xl overflow-hidden", children: [ /*#__PURE__*/ _jsx("div", { className: "flex items-center gap-2 bg-gray-50 px-4 py-2.5 border-b border-gray-200", children: editingGroupId === group.id ? /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx("input", { value: editGroupTitle, onChange: (e)=>setEditGroupTitle(e.target.value), className: "flex-1 border border-gray-300 rounded-lg px-3 py-1.5 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400", onKeyDown: (e)=>{ if (e.key === 'Enter') handleSaveGroupTitle(group.id); }, autoFocus: true }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>handleSaveGroupTitle(group.id), className: "px-3 py-1.5 bg-green-600 text-white rounded-lg text-xs font-medium hover:bg-green-700", children: t('profile.card.pricelist.save_group') }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setEditingGroupId(null), className: "px-2 py-1.5 text-gray-500 hover:text-gray-700 text-xs", children: "✕" }) ] }) : /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx("span", { className: "flex-1 font-semibold text-sm text-gray-800", children: group.title }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>{ setEditingGroupId(group.id); setEditGroupTitle(group.title); }, className: "text-gray-400 hover:text-green-600 text-xs px-2 py-1 rounded hover:bg-green-50", children: "✏" }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>handleDeleteGroup(group.id), className: "text-gray-400 hover:text-red-500 text-xs px-2 py-1 rounded hover:bg-red-50", children: t('profile.card.pricelist.delete_group') }) ] }) }), /*#__PURE__*/ _jsx("div", { className: "divide-y divide-gray-100", children: group.items.map((item)=>/*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 px-4 py-2.5 text-sm group", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ _jsx("p", { className: "font-medium text-gray-800 truncate", children: item.name }), item.description && /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-500 truncate", children: item.description }) ] }), (item.price || item.unit) && /*#__PURE__*/ _jsxs("span", { className: "text-green-700 font-semibold text-sm whitespace-nowrap", children: [ item.price ? "€".concat(item.price) : '', item.unit ? " ".concat(item.unit) : '' ] }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>handleDeleteItem(item.id, group.id), className: "opacity-0 group-hover:opacity-100 text-red-400 hover:text-red-600 text-xs px-1 transition", children: t('profile.card.pricelist.delete_item') }) ] }, item.id)) }), addingGroupId === group.id ? /*#__PURE__*/ _jsxs("div", { className: "p-3 bg-green-50 border-t border-green-100 space-y-2", children: [ /*#__PURE__*/ _jsx("input", { placeholder: t('profile.card.pricelist.item_name'), value: newItem.name, onChange: (e)=>setNewItem((p)=>({ ...p, name: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }), /*#__PURE__*/ _jsx("input", { placeholder: t('profile.card.pricelist.item_desc'), value: newItem.description, onChange: (e)=>setNewItem((p)=>({ ...p, description: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-2", children: [ /*#__PURE__*/ _jsx("input", { placeholder: t('profile.card.pricelist.item_price'), value: newItem.price, onChange: (e)=>setNewItem((p)=>({ ...p, price: e.target.value })), className: "w-28 border border-gray-300 rounded-lg px-3 py-1.5 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }), /*#__PURE__*/ _jsx("input", { placeholder: t('profile.card.pricelist.item_unit'), value: newItem.unit, onChange: (e)=>setNewItem((p)=>({ ...p, unit: e.target.value })), className: "flex-1 border border-gray-300 rounded-lg px-3 py-1.5 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-2", children: [ /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>handleAddItem(group.id), className: "px-4 py-1.5 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700", children: t('profile.card.pricelist.save_item') }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>{ setAddingGroupId(null); setNewItem({ name: '', description: '', price: '', unit: '' }); }, className: "px-3 py-1.5 text-gray-500 hover:text-gray-700 text-sm", children: "✕" }) ] }) ] }) : /*#__PURE__*/ _jsx("div", { className: "px-4 py-2 border-t border-gray-100", children: /*#__PURE__*/ _jsxs("button", { type: "button", onClick: ()=>setAddingGroupId(group.id), className: "text-green-600 hover:text-gray-800 text-sm font-medium", children: [ "+ ", t('profile.card.pricelist.add_item') ] }) }) ] }, group.id)), /*#__PURE__*/ _jsxs("div", { className: "flex gap-2 pt-1", children: [ /*#__PURE__*/ _jsx("input", { placeholder: t('profile.card.pricelist.group_title'), value: newGroupTitle, onChange: (e)=>setNewGroupTitle(e.target.value), onKeyDown: (e)=>{ if (e.key === 'Enter') handleAddGroup(); }, 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" }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: handleAddGroup, className: "px-4 py-2 bg-green-600 hover:bg-green-700 text-white rounded-lg text-sm font-medium", children: t('profile.card.pricelist.add_group') }) ] }) ] }) }), cardTab === 'portfolio' && /*#__PURE__*/ _jsxs("div", { className: "space-y-3", children: [ portfolio.length < 20 && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>{ var _portfolioFileRef_current; return (_portfolioFileRef_current = portfolioFileRef.current) === null || _portfolioFileRef_current === void 0 ? void 0 : _portfolioFileRef_current.click(); }, disabled: portfolioUploading, className: "flex items-center gap-2 px-4 py-2 bg-green-600 hover:bg-green-700 text-white rounded-lg text-sm font-medium disabled:opacity-50", children: portfolioUploading ? /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx("span", { className: "w-4 h-4 border-2 border-white border-t-transparent rounded-full animate-spin" }), t('profile.card.photo.uploading') ] }) : /*#__PURE__*/ _jsxs(_Fragment, { children: [ "\uD83D\uDCF7 ", t('profile.card.photo.add') ] }) }), /*#__PURE__*/ _jsx("input", { ref: portfolioFileRef, type: "file", accept: "image/jpeg,image/png,image/webp", className: "hidden", onChange: handlePortfolioUpload }) ] }), portfolio.length === 0 ? /*#__PURE__*/ _jsx("div", { className: "text-center py-8 text-gray-400 text-sm border-2 border-dashed border-gray-200 rounded-xl", children: t('profile.card.photo.empty') }) : /*#__PURE__*/ _jsx("div", { className: "grid grid-cols-2 sm:grid-cols-3 gap-3", children: portfolio.map((item)=>{ var _item_title; return /*#__PURE__*/ _jsxs("div", { className: "group relative rounded-xl overflow-hidden border border-gray-200 bg-gray-50", children: [ /*#__PURE__*/ _jsx("img", { src: item.imageUrl, alt: (_item_title = item.title) !== null && _item_title !== void 0 ? _item_title : '', className: "w-full aspect-square object-cover" }), /*#__PURE__*/ _jsxs("div", { className: "absolute inset-0 bg-black/0 group-hover:bg-black/50 transition-all flex flex-col justify-between p-2", children: [ /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>handlePortfolioDelete(item.id), className: "self-end opacity-0 group-hover:opacity-100 transition w-7 h-7 rounded-full bg-red-500 text-white text-sm flex items-center justify-center hover:bg-red-600", children: "\xd7" }), /*#__PURE__*/ _jsxs("button", { type: "button", onClick: ()=>{ setEditingItem(item); var _item_title; setEditTitle((_item_title = item.title) !== null && _item_title !== void 0 ? _item_title : ''); var _item_description; setEditDesc((_item_description = item.description) !== null && _item_description !== void 0 ? _item_description : ''); }, className: "opacity-0 group-hover:opacity-100 transition text-xs text-white bg-black/50 hover:bg-black/70 rounded-lg px-2 py-1", children: [ "✏ ", t('profile.card.item.edit') ] }) ] }), item.title && /*#__PURE__*/ _jsx("div", { className: "px-2 py-1.5", children: /*#__PURE__*/ _jsx("p", { className: "text-xs font-medium text-gray-700 truncate", children: item.title }) }) ] }, item.id); }) }) ] }), cardTab !== 'portfolio' && cardTab !== 'pricelist' && /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 mt-4 pt-4 border-t border-gray-100", children: [ /*#__PURE__*/ _jsx("button", { type: "button", disabled: saving, onClick: saveAll, className: "px-5 py-2 bg-green-600 hover:bg-green-700 text-white rounded-lg text-sm font-semibold disabled:opacity-50", children: saving ? '...' : t('profile.card.save') }), savedOk && /*#__PURE__*/ _jsxs("span", { className: "text-sm text-green-600", children: [ "✓ ", t('profile.card.saved') ] }) ] }) ] }) ] }), editingItem && /*#__PURE__*/ _jsx("div", { className: "fixed inset-0 z-50 flex items-center justify-center bg-black/50 px-4", children: /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-2xl shadow-xl p-6 w-full max-w-md", children: [ /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-gray-800 mb-4", children: t('profile.card.item.edit') }), /*#__PURE__*/ _jsx("img", { src: editingItem.imageUrl, alt: "", className: "w-full h-40 object-cover rounded-xl mb-4" }), /*#__PURE__*/ _jsxs("div", { className: "space-y-3", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('profile.card.item.title') }), /*#__PURE__*/ _jsx("input", { value: editTitle, onChange: (e)=>setEditTitle(e.target.value), maxLength: 200, 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" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('profile.card.item.desc') }), /*#__PURE__*/ _jsx("textarea", { value: editDesc, onChange: (e)=>setEditDesc(e.target.value), rows: 3, maxLength: 1000, 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" }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-3 mt-5", children: [ /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>handlePortfolioSave(editingItem.id), className: "flex-1 bg-green-600 hover:bg-green-700 text-white py-2 rounded-lg text-sm font-medium", children: t('profile.card.item.save') }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setEditingItem(null), className: "flex-1 bg-gray-100 hover:bg-gray-200 text-gray-700 py-2 rounded-lg text-sm font-medium", children: t('profile.card.item.cancel') }) ] }) ] }) }) ] }); } // ─── AutoResponseTab ─────────────────────────────────────────────────────── function AutoResponseTab(param) { let { categories, locationTree, loaded, onLoad, settings, saving, saved, onSave, t, catLocale } = param; const { useEffect: _ue, useState: _us } = { useEffect, useState }; const [enabled, setEnabled] = _us(false); const [minBudget, setMinBudget] = _us(''); const [maxBudget, setMaxBudget] = _us(''); const [defaultPrice, setDefaultPrice] = _us(''); const [defaultMessage, setDefaultMessage] = _us(''); const [maxPerDay, setMaxPerDay] = _us(''); const [selCategories, setSelCategories] = _us([]); const [selLocations, setSelLocations] = _us([]); _ue(()=>{ onLoad(); }, []); _ue(()=>{ if (!settings) return; setEnabled(settings.enabled); setMinBudget(settings.minBudget != null ? String(settings.minBudget) : ''); setMaxBudget(settings.maxBudget != null ? String(settings.maxBudget) : ''); setDefaultPrice(settings.defaultPrice != null ? String(settings.defaultPrice) : ''); var _settings_defaultMessage; setDefaultMessage((_settings_defaultMessage = settings.defaultMessage) !== null && _settings_defaultMessage !== void 0 ? _settings_defaultMessage : ''); setMaxPerDay(settings.maxAutoOffersPerDay != null ? String(settings.maxAutoOffersPerDay) : ''); var _settings_categories; setSelCategories((_settings_categories = settings.categories) !== null && _settings_categories !== void 0 ? _settings_categories : []); var _settings_locations; setSelLocations((_settings_locations = settings.locations) !== null && _settings_locations !== void 0 ? _settings_locations : []); }, [ settings ]); if (!loaded) return /*#__PURE__*/ _jsx("div", { className: "text-center py-10 text-white/60", children: t('common.loading') }); const flatLocations = []; function flatten(nodes) { for (const n of nodes){ var _n_children; flatLocations.push({ id: n.id, name: n.name }); if ((_n_children = n.children) === null || _n_children === void 0 ? void 0 : _n_children.length) flatten(n.children); } } flatten(locationTree); return /*#__PURE__*/ _jsxs("div", { className: "space-y-4", children: [ /*#__PURE__*/ _jsx("div", { className: "bg-white rounded-xl border border-gray-200 p-5", children: /*#__PURE__*/ _jsxs("label", { className: "flex items-center justify-between cursor-pointer", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "font-medium text-gray-800", children: t('auto_response.title', 'Auto response') }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-0.5", children: t('auto_response.desc', 'Automatically respond to matching tasks') }) ] }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setEnabled((v)=>!v), className: "relative inline-flex h-6 w-11 items-center rounded-full transition-colors ".concat(enabled ? 'bg-green-500' : 'bg-gray-300'), children: /*#__PURE__*/ _jsx("span", { className: "inline-block h-4 w-4 transform rounded-full bg-white shadow transition-transform ".concat(enabled ? 'translate-x-6' : 'translate-x-1') }) }) ] }) }), /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-5 space-y-4", children: [ /*#__PURE__*/ _jsx("h3", { className: "font-medium text-gray-800 text-sm", children: t('auto_response.budget_range', 'Task budget') }), /*#__PURE__*/ _jsxs("div", { className: "grid grid-cols-2 gap-3", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs text-gray-500 mb-1", children: t('auto_response.min_budget', 'Min €') }), /*#__PURE__*/ _jsx("input", { type: "number", min: "0", value: minBudget, onChange: (e)=>setMinBudget(e.target.value), placeholder: "0", 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" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs text-gray-500 mb-1", children: t('auto_response.max_budget', 'Max €') }), /*#__PURE__*/ _jsx("input", { type: "number", min: "0", value: maxBudget, onChange: (e)=>setMaxBudget(e.target.value), placeholder: "∞", className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs text-gray-500 mb-1", children: t('auto_response.default_price', 'Default price €') }), /*#__PURE__*/ _jsx("input", { type: "number", min: "0", value: defaultPrice, onChange: (e)=>setDefaultPrice(e.target.value), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs text-gray-500 mb-1", children: t('auto_response.max_per_day', 'Max auto-offers/day') }), /*#__PURE__*/ _jsx("input", { type: "number", min: "1", max: "50", value: maxPerDay, onChange: (e)=>setMaxPerDay(e.target.value), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-5", children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs text-gray-500 mb-1", children: t('auto_response.default_message', 'Auto-response text') }), /*#__PURE__*/ _jsx("textarea", { value: defaultMessage, onChange: (e)=>setDefaultMessage(e.target.value), rows: 4, maxLength: 2000, placeholder: t('auto_response.message_placeholder', 'Hello! I can help with this task...'), 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" }) ] }), categories.length > 0 && /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-5", children: [ /*#__PURE__*/ _jsx("h3", { className: "font-medium text-gray-800 text-sm mb-3", children: t('auto_response.categories', 'Task categories') }), /*#__PURE__*/ _jsx("div", { className: "flex flex-wrap gap-2 max-h-40 overflow-y-auto", children: categories.flatMap((cat)=>{ var _cat_children; return [ cat, ...(_cat_children = cat.children) !== null && _cat_children !== void 0 ? _cat_children : [] ]; }).map((cat)=>{ var _cat_names, _cat_names1; var _cat_names_catLocale, _ref; const name = (_ref = (_cat_names_catLocale = (_cat_names = cat.names) === null || _cat_names === void 0 ? void 0 : _cat_names[catLocale]) !== null && _cat_names_catLocale !== void 0 ? _cat_names_catLocale : (_cat_names1 = cat.names) === null || _cat_names1 === void 0 ? void 0 : _cat_names1.el) !== null && _ref !== void 0 ? _ref : cat.slug; const sel = selCategories.includes(cat.slug); return /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setSelCategories(sel ? selCategories.filter((c)=>c !== cat.slug) : [ ...selCategories, cat.slug ]), className: "px-3 py-1.5 rounded-lg text-xs border transition ".concat(sel ? 'bg-green-600 border-green-600 text-white' : 'bg-white border-gray-300 text-gray-700 hover:border-green-400'), children: name }, cat.slug); }) }) ] }), /*#__PURE__*/ _jsx("button", { type: "button", disabled: saving, onClick: ()=>onSave({ enabled, minBudget: minBudget ? Number(minBudget) : null, maxBudget: maxBudget ? Number(maxBudget) : null, defaultPrice: defaultPrice ? Number(defaultPrice) : null, defaultMessage: defaultMessage || null, maxAutoOffersPerDay: maxPerDay ? Number(maxPerDay) : null, categories: selCategories.length > 0 ? selCategories : null, locations: selLocations.length > 0 ? selLocations : null }), className: "w-full bg-green-600 text-white py-3 rounded-xl font-semibold hover:bg-green-700 disabled:opacity-50", children: saving ? t('common.loading') : saved ? t('auto_response.saved', 'Saved ✓') : t('common.save') }) ] }); } export default function ProfilePage() { return /*#__PURE__*/ _jsx(Suspense, { fallback: null, children: /*#__PURE__*/ _jsx(ProfilePageInner, {}) }); } function ProfilePageInner() { var _user_firstName, _user_lastName, _dashData_features, _dashData_features1, _dashData_features2, _user_plan, _user_plan1, _user_plan2, _dashData_features3, _dashData_features4, _dashData_plan, _dashData_plan1, _user_plan3; const router = useRouter(); const searchParams = useSearchParams(); const { data: session, isPending } = useSession(); const { t, locale } = useLocale(); const validTabs = [ 'info', 'finance', 'cards', 'notifications', 'reviews', 'referral', 'auto_response', 'site' ]; var _searchParams_get; const initialTab = (_searchParams_get = searchParams.get('tab')) !== null && _searchParams_get !== void 0 ? _searchParams_get : 'info'; const [activeTab, setActiveTab] = useState(validTabs.includes(initialTab) ? initialTab : 'info'); const [user, setUser] = useState(null); const [loading, setLoading] = useState(true); const [saving, setSaving] = useState(false); const [saved, setSaved] = useState(false); const [error, setError] = useState(''); const [formData, setFormData] = useState({ firstName: '', lastName: '', phone: '', bio: '', locale: 'el' }); const [selectedLanguages, setSelectedLanguages] = useState([]); // Specialist cards const [cards, setCards] = useState([]); const [maxCards, setMaxCards] = useState(1); const [cardsLoading, setCardsLoading] = useState(false); const [cardNotifications, setCardNotifications] = useState([]); const [openCardId, setOpenCardId] = useState(null); const [creatingCard, setCreatingCard] = useState(false); const [newCardTitle, setNewCardTitle] = useState(''); const [showNewCardForm, setShowNewCardForm] = useState(false); const [showUpgradeModal, setShowUpgradeModal] = useState(false); // Reference data const [categories, setCategories] = useState([]); const [locationTree, setLocationTree] = useState([]); // Become specialist const [becomingSpecialist, setBecomingSpecialist] = useState(false); const [avatarUploading, setAvatarUploading] = useState(false); const [backgroundUploading, setBackgroundUploading] = useState(false); const fileRef = useRef(null); const backgroundFileRef = useRef(null); // Notification preferences const [notifyNewTasks, setNotifyNewTasks] = useState(false); const [notifMessages, setNotifMessages] = useState(true); const [notifySaving, setNotifySaving] = useState(false); const [notifySaved, setNotifySaved] = useState(false); // Email verification resend const [resendState, setResendState] = useState('idle'); // Referral info const [referralCode, setReferralCode] = useState(null); const [referralCount, setReferralCount] = useState(0); const [referralCopied, setReferralCopied] = useState(false); const [referralLoaded, setReferralLoaded] = useState(false); // Balance top-up modal const [showTopUpModal, setShowTopUpModal] = useState(false); const [topUpAmount, setTopUpAmount] = useState(10); const [topUpLoading, setTopUpLoading] = useState(false); const [topUpError, setTopUpError] = useState(''); const [balanceHistory, setBalanceHistory] = useState([]); const [planHistory, setPlanHistory] = useState([]); // Plan data + statuses const [dashData, setDashData] = useState(null); const [myStatuses, setMyStatuses] = useState([]); const [statusToggling, setStatusToggling] = useState(null); const [personalSiteSlug, setPersonalSiteSlug] = useState(''); const [slugSaving, setSlugSaving] = useState(false); const [slugSaved, setSlugSaved] = useState(false); const [slugCopied, setSlugCopied] = useState(false); const [slugError, setSlugError] = useState(''); const [showContactInfo, setShowContactInfo] = useState(false); const [siteSettings, setSiteSettings] = useState({}); const [siteSettingsSaving, setSiteSettingsSaving] = useState(false); const [siteStats, setSiteStats] = useState(null); const [siteStatsLoading, setSiteStatsLoading] = useState(false); const [autoResponse, setAutoResponse] = useState(null); const [arLoaded, setArLoaded] = useState(false); const [arSaving, setArSaving] = useState(false); const [arSaved, setArSaved] = useState(false); async function handleTopUp() { const amount = Number(topUpAmount); if (!amount || amount < 1) return; setTopUpLoading(true); setTopUpError(''); try { const { url, params } = await api.initiateTopUp(amount); // Build and auto-submit form to ePay const form = document.createElement('form'); form.method = 'POST'; form.action = url; Object.entries(params).forEach((param)=>{ let [k, v] = param; const input = document.createElement('input'); input.type = 'hidden'; input.name = k; input.value = v; form.appendChild(input); }); document.body.appendChild(form); form.submit(); } catch (e) { setTopUpError((e === null || e === void 0 ? void 0 : e.message) || t('profile.balance.topup.error')); setTopUpLoading(false); } } async function handleResendVerification() { if (!(user === null || user === void 0 ? void 0 : user.email) || resendState !== 'idle') return; setResendState('sending'); const callbackURL = "".concat(window.location.origin, "/profile"); const result = await authClient.sendVerificationEmail({ email: user.email, callbackURL }); if (result === null || result === void 0 ? void 0 : result.error) { setResendState('idle'); } else { setResendState('sent'); } } useEffect(()=>{ if (activeTab !== 'referral' || referralLoaded) return; api.getMyReferralInfo().then((r)=>{ setReferralCode(r.referralCode); setReferralCount(r.referralCount); }).catch(()=>{}).finally(()=>setReferralLoaded(true)); }, [ activeTab ]); // Reviews const [myReviews, setMyReviews] = useState(null); const [reviewsLoading, setReviewsLoading] = useState(false); const [myRating, setMyRating] = useState(null); useEffect(()=>{ if (activeTab !== 'reviews' || myReviews !== null || reviewsLoading) return; setReviewsLoading(true); api.getMyReviews().then(setMyReviews).catch(()=>setMyReviews([])).finally(()=>setReviewsLoading(false)); }, [ activeTab ]); useEffect(()=>{ if (activeTab !== 'site' || siteStats !== null || siteStatsLoading) return; setSiteStatsLoading(true); api.getSiteStats().then((res)=>setSiteStats(res.days)).catch(()=>setSiteStats([])).finally(()=>setSiteStatsLoading(false)); }, [ activeTab ]); useEffect(()=>{ if (!isPending && !session) router.push('/login'); }, [ session, isPending ]); useEffect(()=>{ if (!session) return; Promise.all([ api.request('/users/me'), api.getCategories(), api.getLocations(), api.getMyDashboard().catch(()=>null), api.getMyStatuses().catch(()=>[]), api.getBalanceHistory(8).catch(()=>[]), api.getPlanHistory(20).catch(()=>[]) ]).then((param)=>{ let [u, cats, locs, dash, statusRes, history, phist] = param; setUser(u); var _u_firstName, _u_lastName, _u_phone, _u_bio, _u_locale; setFormData({ firstName: (_u_firstName = u.firstName) !== null && _u_firstName !== void 0 ? _u_firstName : '', lastName: (_u_lastName = u.lastName) !== null && _u_lastName !== void 0 ? _u_lastName : '', phone: (_u_phone = u.phone) !== null && _u_phone !== void 0 ? _u_phone : '', bio: (_u_bio = u.bio) !== null && _u_bio !== void 0 ? _u_bio : '', locale: (_u_locale = u.locale) !== null && _u_locale !== void 0 ? _u_locale : 'el' }); var _u_languages; setSelectedLanguages((_u_languages = u.languages) !== null && _u_languages !== void 0 ? _u_languages : []); var _u_notifyNewTasks; setNotifyNewTasks((_u_notifyNewTasks = u.notifyNewTasks) !== null && _u_notifyNewTasks !== void 0 ? _u_notifyNewTasks : false); var _u_notifMessages; setNotifMessages((_u_notifMessages = u.notifMessages) !== null && _u_notifMessages !== void 0 ? _u_notifMessages : true); setCategories(cats); setLocationTree(locs); setDashData(dash); setMyStatuses((statusRes !== null && statusRes !== void 0 ? statusRes : []).filter((s)=>s.isActive).map((s)=>s.statusType)); setBalanceHistory(history); setPlanHistory(phist); var _u_personalSiteSlug; setPersonalSiteSlug((_u_personalSiteSlug = u.personalSiteSlug) !== null && _u_personalSiteSlug !== void 0 ? _u_personalSiteSlug : ''); var _u_showContactInfo; setShowContactInfo((_u_showContactInfo = u.showContactInfo) !== null && _u_showContactInfo !== void 0 ? _u_showContactInfo : false); var _u_siteSettings; setSiteSettings((_u_siteSettings = u.siteSettings) !== null && _u_siteSettings !== void 0 ? _u_siteSettings : {}); loadCards(); api.getUserRating(u.id).then((r)=>setMyRating(r.avg)).catch(()=>{}); }).catch(()=>{}).finally(()=>setLoading(false)); }, [ session ]); async function loadCards() { setCardsLoading(true); try { const { cards: c, maxCards: m } = await api.getMySpecialistCards(); setCards(c); setMaxCards(m); setOpenCardId((prev)=>{ var _c_; var _c__id; return prev && c.some((card)=>card.id === prev) ? prev : (_c__id = (_c_ = c[0]) === null || _c_ === void 0 ? void 0 : _c_.id) !== null && _c__id !== void 0 ? _c__id : null; }); api.getNotifications().then((rows)=>setCardNotifications(rows.filter((row)=>[ 'specialist_card_submitted', 'specialist_card_approved', 'specialist_card_rejected' ].includes(row.type)))).catch(()=>setCardNotifications([])); } catch (e) {} finally{ setCardsLoading(false); } } async function handleSubmit(e) { e.preventDefault(); setError(''); setSaving(true); try { const updated = await api.request('/users/me', { method: 'PATCH', body: JSON.stringify({ firstName: formData.firstName, lastName: formData.lastName, phone: formData.phone || undefined, bio: formData.bio || undefined, bioLocale: formData.locale, autoTranslateBio: true, locale: formData.locale, languages: selectedLanguages, showContactInfo }) }); setUser(updated); setSaved(true); setTimeout(()=>setSaved(false), 2500); } catch (err) { setError(err.message || t('common.error')); } finally{ setSaving(false); } } async function handleBecomeSpecialist() { setBecomingSpecialist(true); setError(''); try { const updated = await api.request('/users/me/become-specialist', { method: 'POST' }); setUser(updated); setActiveTab('cards'); loadCards(); } catch (err) { setError(err.message || t('common.error')); } finally{ setBecomingSpecialist(false); } } async function handleSaveSiteSlug() { setSlugSaving(true); setSlugError(''); try { const updated = await api.request('/users/me', { method: 'PATCH', body: JSON.stringify({ personalSiteSlug: personalSiteSlug || null }) }); setUser(updated); var _updated_personalSiteSlug; setPersonalSiteSlug((_updated_personalSiteSlug = updated.personalSiteSlug) !== null && _updated_personalSiteSlug !== void 0 ? _updated_personalSiteSlug : ''); setSlugSaved(true); setTimeout(()=>setSlugSaved(false), 2500); } catch (err) { var _err_code; const code = (_err_code = err === null || err === void 0 ? void 0 : err.code) !== null && _err_code !== void 0 ? _err_code : ''; if (code === 'SLUG_TAKEN' || err.message === 'This URL is already taken') { setSlugError(t('profile.site.slug_taken', 'This address is already taken')); } else { setSlugError(err.message || t('common.error')); } } finally{ setSlugSaving(false); } } async function handleSaveSiteSettings(newSettings) { setSiteSettings(newSettings); setSiteSettingsSaving(true); try { await api.request('/users/me', { method: 'PATCH', body: JSON.stringify({ siteSettings: newSettings }) }); } catch (e) {} finally{ setSiteSettingsSaving(false); } } async function handleAvatarChange(e) { var _e_target_files; const file = (_e_target_files = e.target.files) === null || _e_target_files === void 0 ? void 0 : _e_target_files[0]; if (!file) return; setAvatarUploading(true); try { const form = new FormData(); form.append('file', file); const res = await fetch("".concat(process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000', "/api/uploads"), { method: 'POST', credentials: 'include', body: form }); if (!res.ok) throw new Error('Upload failed'); const { url } = await res.json(); const fullUrl = "".concat(process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000').concat(url); await api.request('/users/me', { method: 'PATCH', body: JSON.stringify({ image: fullUrl }) }); setUser((prev)=>({ ...prev, image: fullUrl })); } catch (e) { setError(t('profile.upload.error')); } finally{ setAvatarUploading(false); } } async function handleBackgroundChange(e) { var _e_target_files; const file = (_e_target_files = e.target.files) === null || _e_target_files === void 0 ? void 0 : _e_target_files[0]; if (!file) return; setBackgroundUploading(true); try { const form = new FormData(); form.append('file', file); const res = await fetch("".concat(process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000', "/api/uploads"), { method: 'POST', credentials: 'include', body: form }); if (!res.ok) throw new Error('Upload failed'); const { url } = await res.json(); const fullUrl = "".concat(process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000').concat(url); const nextSettings = { ...siteSettings, profileBackgroundImage: fullUrl }; await api.request('/users/me', { method: 'PATCH', body: JSON.stringify({ siteSettings: nextSettings }) }); setSiteSettings(nextSettings); setSaved(true); setTimeout(()=>setSaved(false), 2500); } catch (e) { setError(t('profile.upload.error')); } finally{ setBackgroundUploading(false); if (backgroundFileRef.current) backgroundFileRef.current.value = ''; } } async function handleRemoveBackground() { setBackgroundUploading(true); try { const nextSettings = { ...siteSettings, profileBackgroundImage: null }; await api.request('/users/me', { method: 'PATCH', body: JSON.stringify({ siteSettings: nextSettings }) }); setSiteSettings(nextSettings); setSaved(true); setTimeout(()=>setSaved(false), 2500); } catch (e) { setError(t('profile.upload.error')); } finally{ setBackgroundUploading(false); } } async function handleCreateCard() { if (!newCardTitle.trim()) return; setCreatingCard(true); try { const card = await api.createSpecialistCard({ title: newCardTitle.trim() }); setCards((prev)=>[ ...prev, card ]); setOpenCardId(card.id); setNewCardTitle(''); setShowNewCardForm(false); } catch (err) { setError(err.message || t('common.error')); } finally{ setCreatingCard(false); } } async function handleDeleteCard(id) { if (!confirm(t('profile.cards.delete_confirm'))) return; try { await api.deleteSpecialistCard(id); setCards((prev)=>{ var _next_; const next = prev.filter((c)=>c.id !== id); var _next__id; if (openCardId === id) setOpenCardId((_next__id = (_next_ = next[0]) === null || _next_ === void 0 ? void 0 : _next_.id) !== null && _next__id !== void 0 ? _next__id : null); return next; }); } catch (err) { setError(err.message || t('common.error')); } } if (isPending || loading) { return /*#__PURE__*/ _jsx("div", { className: "text-center py-20 text-white", children: t('common.loading') }); } const catLocale = locale === 'en' ? 'en' : locale === 'ru' ? 'ru' : locale === 'uk' ? 'uk' : 'el'; const dateLocale = locale === 'en' ? 'en-US' : locale === 'ru' ? 'ru-RU' : 'el-GR'; const isSpecialist = (user === null || user === void 0 ? void 0 : user.role) === 'specialist'; const isAdmin = (user === null || user === void 0 ? void 0 : user.role) === 'admin'; const showSpecialistTabs = isSpecialist || isAdmin; var _user_firstName_, _user_lastName_; const initials = user ? "".concat((_user_firstName_ = (_user_firstName = user.firstName) === null || _user_firstName === void 0 ? void 0 : _user_firstName[0]) !== null && _user_firstName_ !== void 0 ? _user_firstName_ : '').concat((_user_lastName_ = (_user_lastName = user.lastName) === null || _user_lastName === void 0 ? void 0 : _user_lastName[0]) !== null && _user_lastName_ !== void 0 ? _user_lastName_ : '').toUpperCase() : '?'; const hasAutoResponse = !!(dashData === null || dashData === void 0 ? void 0 : (_dashData_features = dashData.features) === null || _dashData_features === void 0 ? void 0 : _dashData_features.hasAutoResponse); var _formData_bio, _ref; const profileBio = String((_ref = (_formData_bio = formData.bio) !== null && _formData_bio !== void 0 ? _formData_bio : user === null || user === void 0 ? void 0 : user.bio) !== null && _ref !== void 0 ? _ref : '').trim(); const publishedCards = cards.filter((c)=>{ var _c_publicationStatus; return ((_c_publicationStatus = c.publicationStatus) !== null && _c_publicationStatus !== void 0 ? _c_publicationStatus : c.isActive ? 'active' : 'inactive') === 'active'; }); const hasPublishedCard = publishedCards.length > 0; const hasCardCategories = publishedCards.some((c)=>{ var _c_categories; var _c_categories_length; return ((_c_categories_length = (_c_categories = c.categories) === null || _c_categories === void 0 ? void 0 : _c_categories.length) !== null && _c_categories_length !== void 0 ? _c_categories_length : 0) > 0; }); const hasCardLocations = publishedCards.some((c)=>{ var _c_locations; var _c_locations_length; return ((_c_locations_length = (_c_locations = c.locations) === null || _c_locations === void 0 ? void 0 : _c_locations.length) !== null && _c_locations_length !== void 0 ? _c_locations_length : 0) > 0; }); const moderationNoticeByCardId = cardNotifications.reduce((acc, row)=>{ if (!row.referenceId || acc[row.referenceId]) return acc; const tone = row.type === 'specialist_card_approved' ? 'green' : row.type === 'specialist_card_rejected' ? 'red' : 'amber'; const localizedTitle = row.type === 'specialist_card_approved' ? t('profile.card.review_approved', 'Card approved') : row.type === 'specialist_card_rejected' ? t('profile.card.review_rejected', 'Card rejected') : t('profile.card.review_pending', 'Pending approval'); const localizedBody = row.type === 'specialist_card_approved' ? t('profile.card.review_approved_hint', 'Your card is now visible in offers.') : row.type === 'specialist_card_rejected' ? t('profile.card.review_rejected_hint', 'Your card was not approved. Please update it and submit again.') : t('profile.card.review_pending_hint', 'Your card is being reviewed by the admin team.'); acc[row.referenceId] = { title: localizedTitle, body: localizedBody, tone }; return acc; }, {}); const listingMissing = []; if (!profileBio) listingMissing.push(t('profile.listing_requirements.bio', 'Add a short bio in the main profile section')); if (!hasPublishedCard) listingMissing.push(t('profile.listing_requirements.published_card', 'Publish at least one card')); if (!hasCardCategories) listingMissing.push(t('profile.listing_requirements.categories', 'Add at least one category to the published card')); if (!hasCardLocations) listingMissing.push(t('profile.listing_requirements.locations', 'Add at least one location to the published card')); const tabNeedsAttention = { info: !profileBio, cards: listingMissing.length > 0 }; const tabIcons = { info: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15.75 6a3.75 3.75 0 11-7.5 0 3.75 3.75 0 017.5 0zM4.501 20.118a7.5 7.5 0 0114.998 0A17.933 17.933 0 0112 21.75c-2.676 0-5.216-.584-7.499-1.632z" }) }), finance: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 6v12m-3-2.818l.879.659c1.171.879 3.07.879 4.242 0 1.172-.879 1.172-2.303 0-3.182C13.536 12.219 12.768 12 12 12c-.725 0-1.45-.22-2.003-.659-1.106-.879-1.106-2.303 0-3.182s2.9-.879 4.006 0l.415.33M21 12a9 9 0 11-18 0 9 9 0 0118 0z" }) }), cards: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M20.25 14.15v4.073a2.25 2.25 0 01-2.25 2.25h-12a2.25 2.25 0 01-2.25-2.25V6a2.25 2.25 0 012.25-2.25h4.073M15.75 3h5.25v5.25M15.75 3l-9 9" }) }), notifications: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M14.857 17.082a23.848 23.848 0 005.454-1.31A8.967 8.967 0 0118 9.75v-.7V9A6 6 0 006 9v.75a8.967 8.967 0 01-2.312 6.022c1.733.64 3.56 1.085 5.455 1.31m5.714 0a24.255 24.255 0 01-5.714 0m5.714 0a3 3 0 11-5.714 0" }) }), reviews: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M11.48 3.499a.562.562 0 011.04 0l2.125 5.111a.563.563 0 00.475.345l5.518.442c.499.04.701.663.321.988l-4.204 3.602a.563.563 0 00-.182.557l1.285 5.385a.562.562 0 01-.84.61l-4.725-2.885a.562.562 0 00-.586 0L6.982 20.54a.562.562 0 01-.84-.61l1.285-5.386a.562.562 0 00-.182-.557l-4.204-3.602a.562.562 0 01.321-.988l5.518-.442a.563.563 0 00.475-.345L11.48 3.5z" }) }), referral: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M13.19 8.688a4.5 4.5 0 011.242 7.244l-4.5 4.5a4.5 4.5 0 01-6.364-6.364l1.757-1.757m13.35-.622l1.757-1.757a4.5 4.5 0 00-6.364-6.364l-4.5 4.5a4.5 4.5 0 001.242 7.244" }) }), auto_response: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9.813 15.904L9 18.75l-.813-2.846a4.5 4.5 0 00-3.09-3.09L2.25 12l2.846-.813a4.5 4.5 0 003.09-3.09L9 5.25l.813 2.846a4.5 4.5 0 003.09 3.09L15.75 12l-2.846.813a4.5 4.5 0 00-3.09 3.09z" }) }), site: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 21a9.004 9.004 0 008.716-6.747M12 21a9.004 9.004 0 01-8.716-6.747M12 21c2.485 0 4.5-4.03 4.5-9S14.485 3 12 3m0 18c-2.485 0-4.5-4.03-4.5-9S9.515 3 12 3m0 0a8.997 8.997 0 017.843 4.582M12 3a8.997 8.997 0 00-7.843 4.582m15.686 0A11.953 11.953 0 0112 10.5c-2.998 0-5.74-1.1-7.843-2.918m15.686 0A8.959 8.959 0 0121 12c0 .778-.099 1.533-.284 2.253m0 0A17.919 17.919 0 0112 16.5c-3.162 0-6.133-.815-8.716-2.247m0 0A9.015 9.015 0 013 12c0-1.605.42-3.113 1.157-4.418" }) }) }; const tabs = showSpecialistTabs ? [ { id: 'info', label: t('profile.tab.info') }, { id: 'cards', label: t('profile.tab.cards') }, { id: 'notifications', label: t('profile.tab.notifications') }, { id: 'reviews', label: t('profile.tab.reviews') }, { id: 'finance', label: t('profile.tab.finance') }, { id: 'referral', label: t('profile.tab.referral') }, ...hasAutoResponse ? [ { id: 'auto_response', label: t('profile.tab.auto_response', 'Auto response') } ] : [], ...(dashData === null || dashData === void 0 ? void 0 : (_dashData_features1 = dashData.features) === null || _dashData_features1 === void 0 ? void 0 : _dashData_features1.hasPersonalSite) ? [ { id: 'site', label: t('profile.tab.site') } ] : [] ] : [ { id: 'info', label: t('profile.tab.info') }, { id: 'cards', label: t('profile.tab.cards') }, { id: 'notifications', label: t('profile.tab.notifications') }, { id: 'reviews', label: t('profile.tab.reviews') }, { id: 'finance', label: t('profile.tab.finance') }, { id: 'referral', label: t('profile.tab.referral') }, ...(dashData === null || dashData === void 0 ? void 0 : (_dashData_features2 = dashData.features) === null || _dashData_features2 === void 0 ? void 0 : _dashData_features2.hasPersonalSite) ? [ { id: 'site', label: t('profile.tab.site') } ] : [] ]; var _user_lastName1, _user_name, _user_balance, _user_plan_features, _user_plan_name; return /*#__PURE__*/ _jsxs("div", { className: "max-w-4xl mx-auto px-4 py-8", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-4 mb-6", children: [ /*#__PURE__*/ _jsx("div", { className: "w-14 h-14 rounded-full flex-shrink-0 overflow-hidden border-2 border-white/40 flex items-center justify-center text-green-700 text-xl font-bold bg-green-100 cursor-pointer", onClick: ()=>{ var _fileRef_current; setActiveTab('info'); (_fileRef_current = fileRef.current) === null || _fileRef_current === void 0 ? void 0 : _fileRef_current.click(); }, title: t('profile.photo.change'), children: (user === null || user === void 0 ? void 0 : user.image) ? /*#__PURE__*/ _jsx("img", { src: user.image, alt: user.name, className: "w-full h-full object-cover" }) : initials }), /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ _jsx("h1", { className: "text-xl font-bold text-white leading-tight", children: (user === null || user === void 0 ? void 0 : user.firstName) ? "".concat(user.firstName, " ").concat((_user_lastName1 = user.lastName) !== null && _user_lastName1 !== void 0 ? _user_lastName1 : '').trim() : (_user_name = user === null || user === void 0 ? void 0 : user.name) !== null && _user_name !== void 0 ? _user_name : t('nav.profile') }), myRating && /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-1 mt-0.5", children: [ /*#__PURE__*/ _jsx("span", { className: "text-yellow-300", children: "★" }), /*#__PURE__*/ _jsx("span", { className: "font-semibold text-white text-sm", children: Number(myRating).toFixed(1) }), myReviews !== null && myReviews.length > 0 && /*#__PURE__*/ _jsxs("span", { className: "text-white/60 text-xs", children: [ "(", myReviews.length, ")" ] }) ] }) ] }) ] }), !cardsLoading && cards.length === 0 && /*#__PURE__*/ _jsx("div", { className: "mb-6 rounded-2xl border border-amber-300 bg-amber-50/95 p-4 sm:p-5 shadow-sm", children: /*#__PURE__*/ _jsxs("div", { className: "flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "text-sm font-semibold text-amber-950", children: t('profile.cards.empty', 'No offers yet') }), /*#__PURE__*/ _jsx("p", { className: "text-xs leading-relaxed text-amber-800 mt-1 max-w-2xl", children: t('profile.cards.empty_hint', 'СПзЎайте первую картПчку, чтПбы пПказать услугО клОеМтаЌ.') }) ] }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>{ setActiveTab('cards'); setShowNewCardForm(true); }, className: "inline-flex items-center justify-center rounded-xl bg-amber-600 px-4 py-2 text-sm font-semibold text-white transition hover:bg-amber-700", children: t('profile.cards.create_first') }) ] }) }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-6 items-start", children: [ tabs.length > 1 && /*#__PURE__*/ _jsx("aside", { className: "w-52 shrink-0 hidden sm:block", children: /*#__PURE__*/ _jsx("nav", { className: "rounded-2xl overflow-hidden bg-white/10 backdrop-blur-sm", children: tabs.map((tab)=>/*#__PURE__*/ _jsxs("button", { type: "button", onClick: ()=>setActiveTab(tab.id), className: "w-full text-left px-4 py-3 text-sm font-medium transition border-b border-white/10 last:border-0 flex items-center gap-3 ".concat(activeTab === tab.id ? 'bg-white text-green-700' : 'text-white/80 hover:bg-white/10 hover:text-white'), children: [ tabIcons[tab.id], /*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-1.5", children: [ tab.label, tabNeedsAttention[tab.id] && /*#__PURE__*/ _jsx("span", { className: "inline-flex items-center justify-center w-4 h-4 rounded-full bg-amber-500 text-white text-[10px] font-bold", children: "!" }) ] }) ] }, tab.id)) }) }), /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-0", children: [ tabs.length > 1 && /*#__PURE__*/ _jsx("div", { className: "flex sm:hidden bg-white/15 backdrop-blur rounded-xl p-1 mb-4 gap-1 overflow-x-auto", children: tabs.map((tab)=>/*#__PURE__*/ _jsxs("button", { type: "button", onClick: ()=>setActiveTab(tab.id), className: "flex-1 min-w-fit px-3 py-2 text-xs font-medium rounded-lg transition whitespace-nowrap flex flex-col items-center gap-0.5 ".concat(activeTab === tab.id ? 'bg-white text-green-700 shadow-sm' : 'text-white/80 hover:text-white hover:bg-white/10'), children: [ tabIcons[tab.id], /*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-1.5", children: [ tab.label, tabNeedsAttention[tab.id] && /*#__PURE__*/ _jsx("span", { className: "inline-flex items-center justify-center w-4 h-4 rounded-full bg-amber-500 text-white text-[10px] font-bold", children: "!" }) ] }) ] }, tab.id)) }), activeTab === 'cards' && /*#__PURE__*/ _jsxs("div", { className: "space-y-4", children: [ error && /*#__PURE__*/ _jsx("div", { className: "bg-red-50 text-red-700 p-3 rounded-lg text-sm", children: error }), listingMissing.length > 0 && /*#__PURE__*/ _jsxs("div", { className: "bg-amber-50 border border-amber-300 rounded-xl p-4", children: [ /*#__PURE__*/ _jsx("p", { className: "text-sm font-semibold text-amber-900", children: t('profile.listing_requirements.title', 'Your profile is not shown yet in offers') }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-amber-800 mt-1", children: t('profile.listing_requirements.hint', 'To make the card visible, complete these conditions:') }), /*#__PURE__*/ _jsx("ul", { className: "mt-2 list-disc pl-5 text-xs text-amber-900 space-y-0.5", children: listingMissing.map((item)=>/*#__PURE__*/ _jsx("li", { children: item }, item)) }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between", children: [ /*#__PURE__*/ _jsxs("p", { className: "text-sm text-white/70", children: [ t('profile.cards.count'), ": ", cards.length, " / ", maxCards === null ? '∞' : maxCards ] }), /*#__PURE__*/ _jsxs("button", { type: "button", onClick: ()=>{ if (maxCards !== null && cards.length >= maxCards) { setShowUpgradeModal(true); } else { setShowNewCardForm(true); } }, className: "flex items-center gap-1.5 text-sm font-medium text-white hover:text-white/80", children: [ "+ ", t('profile.cards.add') ] }) ] }), showNewCardForm && /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-green-200 p-4 space-y-3", children: [ /*#__PURE__*/ _jsx("p", { className: "text-sm font-medium text-gray-800", children: t('profile.cards.new_title') }), /*#__PURE__*/ _jsx("input", { value: newCardTitle, onChange: (e)=>setNewCardTitle(e.target.value), onKeyDown: (e)=>{ if (e.key === 'Enter') handleCreateCard(); }, maxLength: 200, placeholder: t('profile.cards.placeholder'), autoFocus: true, 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" }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-2", children: [ /*#__PURE__*/ _jsx("button", { type: "button", onClick: handleCreateCard, disabled: creatingCard || !newCardTitle.trim(), className: "px-4 py-2 bg-green-600 hover:bg-green-700 text-white rounded-lg text-sm font-medium disabled:opacity-50", children: creatingCard ? '...' : t('profile.cards.create') }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>{ setShowNewCardForm(false); setNewCardTitle(''); }, className: "px-4 py-2 bg-gray-100 hover:bg-gray-200 text-gray-700 rounded-lg text-sm font-medium", children: t('profile.cards.cancel') }) ] }) ] }), cardsLoading && /*#__PURE__*/ _jsx("div", { className: "text-center py-10 text-white/70", children: t('common.loading') }), !cardsLoading && cards.length === 0 && !showNewCardForm && /*#__PURE__*/ _jsxs("div", { className: "text-center py-14 border-2 border-dashed border-white/30 rounded-xl", children: [ /*#__PURE__*/ _jsx("p", { className: "text-white/70 text-sm mb-3", children: t('profile.cards.empty') }), /*#__PURE__*/ _jsxs("button", { type: "button", onClick: ()=>setShowNewCardForm(true), className: "text-sm text-white font-medium hover:underline", children: [ "+ ", t('profile.cards.create_first') ] }) ] }), cards.map((card)=>{ var _dashData_features; const cardIssues = []; if (!profileBio) { cardIssues.push(t('profile.listing_requirements.bio', 'Add a short bio in the main profile section')); } var _card_publicationStatus; const publicationStatus = (_card_publicationStatus = card.publicationStatus) !== null && _card_publicationStatus !== void 0 ? _card_publicationStatus : card.isActive ? 'active' : 'inactive'; if (publicationStatus === 'pending') { cardIssues.push(t('profile.listing_requirements.review_pending', 'Card is under review')); } else if (publicationStatus !== 'active') { cardIssues.push(t('profile.listing_requirements.card_inactive', 'Make the card active')); } if (!card.categories || card.categories.length === 0) { cardIssues.push(t('profile.listing_requirements.categories', 'Add at least one category to the active card')); } if (!card.locations || card.locations.length === 0) { cardIssues.push(t('profile.listing_requirements.locations', 'Add at least one location to the active card')); } var _moderationNoticeByCardId_card_id; return /*#__PURE__*/ _jsx(SpecialistCardEditor, { card: card, isOpen: openCardId === card.id, onToggle: ()=>setOpenCardId(card.id), onUpdate: (updated)=>setCards((prev)=>prev.map((c)=>c.id === updated.id ? updated : c)), onDelete: ()=>handleDeleteCard(card.id), categories: categories, locationTree: locationTree, catLocale: catLocale, locale: locale, hasPriceList: !!(dashData === null || dashData === void 0 ? void 0 : (_dashData_features = dashData.features) === null || _dashData_features === void 0 ? void 0 : _dashData_features.hasPriceList), visibilityIssues: cardIssues, moderationNotice: (_moderationNoticeByCardId_card_id = moderationNoticeByCardId[card.id]) !== null && _moderationNoticeByCardId_card_id !== void 0 ? _moderationNoticeByCardId_card_id : null }, card.id); }) ] }), activeTab === 'site' && /*#__PURE__*/ _jsxs("div", { className: "space-y-5", children: [ /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6 space-y-4", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("h2", { className: "font-semibold text-gray-800 mb-1", children: t('profile.site.title') }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400", children: t('profile.site_slug_hint') }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-500 mb-1.5", children: t('profile.site.url_label') }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 flex-wrap", children: [ /*#__PURE__*/ _jsx("span", { className: "text-sm text-gray-400 shrink-0", children: "canhelp.gr/site/" }), /*#__PURE__*/ _jsx("input", { value: personalSiteSlug, onChange: (e)=>setPersonalSiteSlug(e.target.value.toLowerCase().replace(/[^a-z0-9_-]/g, '')), placeholder: "my-slug", maxLength: 50, className: "flex-1 min-w-32 border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 flex-wrap", children: [ /*#__PURE__*/ _jsx("button", { type: "button", onClick: handleSaveSiteSlug, disabled: slugSaving, className: "px-5 py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700 disabled:opacity-50", children: slugSaving ? t('profile.saving') : t('common.save') }), slugSaved && /*#__PURE__*/ _jsxs("span", { className: "text-sm text-green-600", children: [ "✓ ", t('profile.saved') ] }), personalSiteSlug && /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs("button", { type: "button", onClick: ()=>{ navigator.clipboard.writeText("".concat(window.location.origin, "/site/").concat(personalSiteSlug)); setSlugCopied(true); setTimeout(()=>setSlugCopied(false), 2000); }, className: "px-3 py-2 border border-gray-300 rounded-lg text-sm text-gray-600 hover:bg-gray-50 flex items-center gap-1.5", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z" }) }), slugCopied ? t('profile.site.copied') : t('profile.site.copy') ] }), /*#__PURE__*/ _jsxs("a", { href: "/site/".concat(personalSiteSlug), target: "_blank", rel: "noopener noreferrer", className: "px-3 py-2 border border-green-200 bg-green-50 rounded-lg text-sm text-green-600 hover:bg-green-100 flex items-center gap-1.5", children: [ t('profile.site_open'), /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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" }) }) ] }) ] }) ] }), slugError && /*#__PURE__*/ _jsx("p", { className: "text-xs text-red-500", children: slugError }) ] }), /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between mb-4", children: [ /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-gray-800", children: t('profile.site.visible_title') }), siteSettingsSaving && /*#__PURE__*/ _jsx("span", { className: "text-xs text-gray-400", children: t('profile.saving', 'Saving...') }) ] }), /*#__PURE__*/ _jsx("div", { className: "space-y-3", children: [ { key: 'showBio', label: t('profile.site.visible.bio', 'Biography') }, { key: 'showRating', label: t('profile.site.visible.rating', 'Rating and reviews') }, { key: 'showReviews', label: t('profile.site.visible.reviews', 'Reviews section') }, { key: 'showServices', label: t('profile.site.visible.services', 'Service cards') }, { key: 'showPriceList', label: t('profile.site.visible.price_list', 'Price list') }, { key: 'showPortfolio', label: t('profile.site.visible.portfolio', 'Portfolio') }, { key: 'showPhone', label: t('profile.site.visible.contacts', 'Contact phone') }, { key: 'showFullLastName', label: t('profile.site.visible.full_last_name', 'Show full last name') }, { key: 'showStatus', label: t('profile.site.visible.status', 'Status "Available now"') } ].map((param)=>{ let { key, label } = param; const checked = siteSettings[key] !== false // undefined = true by default ; return /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-3 cursor-pointer group", children: [ /*#__PURE__*/ _jsx("div", { className: "w-5 h-5 rounded border-2 flex items-center justify-center transition shrink-0 ".concat(checked ? 'bg-green-600 border-green-600' : 'bg-white border-gray-300 group-hover:border-green-400'), onClick: ()=>{ const next = { ...siteSettings, [key]: !checked }; handleSaveSiteSettings(next); }, children: checked && /*#__PURE__*/ _jsx("svg", { className: "w-3 h-3 text-white", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 3, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4.5 12.75l6 6 9-13.5" }) }) }), /*#__PURE__*/ _jsx("span", { className: "text-sm text-gray-700 select-none", onClick: ()=>{ const next = { ...siteSettings, [key]: !checked }; handleSaveSiteSettings(next); }, children: label }) ] }, key); }) }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-4", children: t('profile.site.edit_bio_hint', 'Name and photo are always visible') }), /*#__PURE__*/ _jsxs("div", { className: "mt-6 pt-4 border-t border-gray-100", children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: t('profile.site.theme', 'Theme') }), /*#__PURE__*/ _jsx("div", { className: "flex gap-3", children: [ { value: 'dark', label: t('profile.site.theme.dark', 'Dark'), icon: '🌙' }, { value: 'light', label: t('profile.site.theme.light', 'Light'), icon: '☀' } ].map((opt)=>{ var _siteSettings_siteTheme; const selected = ((_siteSettings_siteTheme = siteSettings.siteTheme) !== null && _siteSettings_siteTheme !== void 0 ? _siteSettings_siteTheme : 'dark') === opt.value; return /*#__PURE__*/ _jsxs("button", { onClick: ()=>handleSaveSiteSettings({ ...siteSettings, siteTheme: opt.value }), className: "flex-1 flex items-center justify-center gap-2 px-4 py-2.5 rounded-xl border-2 text-sm font-medium transition ".concat(selected ? 'border-green-500 bg-green-50 text-green-700' : 'border-gray-200 bg-white text-gray-500 hover:border-gray-300'), children: [ /*#__PURE__*/ _jsx("span", { children: opt.icon }), opt.label ] }, opt.value); }) }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ _jsx("div", { className: "flex items-center justify-between mb-4", children: /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-gray-800", children: t('profile.site.stats.title', 'Site analytics') }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-0.5", children: t('profile.site.stats.days', 'last 30 days') }) ] }) }), !personalSiteSlug ? /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-400 py-4 text-center", children: t('profile.site.stats.no_slug', 'Set your site URL to view statistics') }) : siteStatsLoading || siteStats === null ? /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-400 py-4 text-center", children: t('profile.site.stats.loading', 'Loading analytics...') }) : (()=>{ const totalViews = siteStats.reduce((s, d)=>s + d.views, 0); const totalUnique = siteStats.reduce((s, d)=>s + d.unique, 0); const totalMessages = siteStats.reduce((s, d)=>s + d.messages, 0); // Area chart helpers const days = siteStats.map((d)=>d.date); const seriesDef = [ { vals: siteStats.map((d)=>d.views), color: '#3b82f6', fill: '#3b82f615', label: t('profile.site.stats.views', 'Views') }, { vals: siteStats.map((d)=>d.unique), color: '#8b5cf6', fill: '#8b5cf610', label: t('profile.site.stats.unique', 'Unique') }, { vals: siteStats.map((d)=>d.messages), color: '#10b981', fill: '#10b98110', label: t('profile.site.stats.messages', 'Messages') } ]; const maxVal = Math.max(...seriesDef.flatMap((s)=>s.vals), 1); const W = 580; const H = 160; const padL = 36; const padB = 22; const chartW = W - padL - 4; const chartH = H - padB; const stepX = chartW / (days.length - 1); function pts(vals) { return vals.map((v, i)=>[ padL + i * stepX, chartH - v / maxVal * chartH ]); } function smoothPath(points) { if (points.length < 2) return ''; let d = "M ".concat(points[0][0].toFixed(1), " ").concat(points[0][1].toFixed(1)); for(let i = 1; i < points.length; i++){ const cpx = ((points[i - 1][0] + points[i][0]) / 2).toFixed(1); d += " C ".concat(cpx, " ").concat(points[i - 1][1].toFixed(1), " ").concat(cpx, " ").concat(points[i][1].toFixed(1), " ").concat(points[i][0].toFixed(1), " ").concat(points[i][1].toFixed(1)); } return d; } function areaPath(vals) { const points = pts(vals); const line = smoothPath(points); if (!line) return ''; const lastX = points[points.length - 1][0].toFixed(1); return "".concat(line, " L ").concat(lastX, " ").concat(chartH.toFixed(1), " L ").concat(padL.toFixed(1), " ").concat(chartH.toFixed(1), " Z"); } function fmtY(v) { return v >= 1000 ? "".concat(Math.round(v / 1000), "K") : String(v); } const yTicks = [ 0, Math.round(maxVal / 3), Math.round(maxVal * 2 / 3), maxVal ]; const xTicks = days.map((d, i)=>({ i, label: d.slice(8) })).filter((_, i)=>i % 7 === 0 || i === days.length - 1); return /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx("div", { className: "grid grid-cols-3 gap-3 mb-5", children: [ { label: t('profile.site.stats.total_views', 'Views'), value: totalViews, color: 'text-green-600', bg: 'bg-green-50' }, { label: t('profile.site.stats.total_unique', 'Unique visitors'), value: totalUnique, color: 'text-violet-600', bg: 'bg-violet-50' }, { label: t('profile.site.stats.total_messages', 'Messages'), value: totalMessages, color: 'text-emerald-600', bg: 'bg-emerald-50' } ].map((card)=>/*#__PURE__*/ _jsxs("div", { className: "".concat(card.bg, " rounded-xl p-3 text-center"), children: [ /*#__PURE__*/ _jsx("div", { className: "text-2xl font-bold ".concat(card.color), children: card.value }), /*#__PURE__*/ _jsx("div", { className: "text-xs text-gray-500 mt-0.5", children: card.label }) ] }, card.label)) }), /*#__PURE__*/ _jsx("div", { className: "flex items-center gap-4 mb-2", children: seriesDef.map((s)=>/*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-1.5 text-xs text-gray-500", children: [ /*#__PURE__*/ _jsx("span", { className: "w-3 h-0.5 inline-block rounded", style: { background: s.color } }), s.label ] }, s.label)) }), /*#__PURE__*/ _jsx("div", { className: "overflow-x-auto", children: /*#__PURE__*/ _jsxs("svg", { viewBox: "0 0 ".concat(W, " ").concat(H + 12), className: "w-full", style: { minWidth: 320 }, children: [ yTicks.map((v, idx)=>{ const y = chartH - v / maxVal * chartH; return /*#__PURE__*/ _jsxs("g", { children: [ /*#__PURE__*/ _jsx("line", { x1: padL, y1: y, x2: W - 4, y2: y, stroke: "#f3f4f6", strokeWidth: 1 }), /*#__PURE__*/ _jsx("text", { x: padL - 5, y: y + 3.5, textAnchor: "end", fontSize: 9, fill: "#9ca3af", children: fmtY(v) }) ] }, "y-".concat(idx, "-").concat(v)); }), xTicks.map((param)=>{ let { i } = param; return /*#__PURE__*/ _jsx("line", { x1: padL + i * stepX, y1: 0, x2: padL + i * stepX, y2: chartH, stroke: "#f9fafb", strokeWidth: 1 }, "vg-".concat(i)); }), xTicks.map((param)=>{ let { i, label } = param; return /*#__PURE__*/ _jsx("text", { x: padL + i * stepX, y: H + 10, textAnchor: "middle", fontSize: 9, fill: "#9ca3af", children: label }, i); }), seriesDef.map((s, si)=>/*#__PURE__*/ _jsx("path", { d: areaPath(s.vals), fill: s.fill }, "fill-".concat(si))), seriesDef.map((s, si)=>/*#__PURE__*/ _jsx("path", { d: smoothPath(pts(s.vals)), fill: "none", stroke: s.color, strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round" }, "line-".concat(si))), seriesDef.map((s, si)=>{ const points = pts(s.vals); const last = points[points.length - 1]; return /*#__PURE__*/ _jsx("circle", { cx: last[0], cy: last[1], r: 4, fill: "white", stroke: s.color, strokeWidth: 2 }, "dot-".concat(si)); }), /*#__PURE__*/ _jsx("line", { x1: padL, y1: chartH, x2: W - 4, y2: chartH, stroke: "#e5e7eb", strokeWidth: 1 }) ] }) }) ] }); })() ] }) ] }), activeTab === 'reviews' && /*#__PURE__*/ _jsx("div", { className: "space-y-4", children: myReviews === null ? /*#__PURE__*/ _jsx("div", { className: "text-center py-10 text-white/70", children: t('common.loading') }) : myReviews.length === 0 ? /*#__PURE__*/ _jsxs("div", { className: "text-center py-20 text-white/60", children: [ /*#__PURE__*/ _jsx("p", { className: "text-4xl mb-3", children: "⭐" }), /*#__PURE__*/ _jsx("p", { children: t('profile.no_reviews') }) ] }) : myReviews.map((param)=>{ let { review, author } = param; var _author_name_, _author_name; var _author_name__toUpperCase, _author_name1; return /*#__PURE__*/ _jsx("div", { className: "bg-white rounded-xl border border-gray-200 p-4", children: /*#__PURE__*/ _jsxs("div", { className: "flex items-start gap-3", children: [ /*#__PURE__*/ _jsx("div", { className: "w-9 h-9 rounded-full bg-gray-100 flex-shrink-0 flex items-center justify-center text-gray-600 text-sm font-bold overflow-hidden", children: (author === null || author === void 0 ? void 0 : author.image) ? /*#__PURE__*/ _jsx("img", { src: author.image, alt: author.name, className: "w-full h-full object-cover" }) : (_author_name__toUpperCase = author === null || author === void 0 ? void 0 : (_author_name = author.name) === null || _author_name === void 0 ? void 0 : (_author_name_ = _author_name[0]) === null || _author_name_ === void 0 ? void 0 : _author_name_.toUpperCase()) !== null && _author_name__toUpperCase !== void 0 ? _author_name__toUpperCase : '?' }), /*#__PURE__*/ _jsxs("div", { className: "flex-1", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 mb-1", children: [ /*#__PURE__*/ _jsx("span", { className: "text-sm font-medium text-gray-800", children: (_author_name1 = author === null || author === void 0 ? void 0 : author.name) !== null && _author_name1 !== void 0 ? _author_name1 : '—' }), /*#__PURE__*/ _jsxs("span", { className: "text-yellow-400", children: [ '★'.repeat(review.rating), '☆'.repeat(5 - review.rating) ] }) ] }), review.comment && /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-600", children: review.comment }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-1", children: new Date(review.createdAt).toLocaleDateString() }) ] }) ] }) }, review.id); }) }), activeTab === 'finance' && /*#__PURE__*/ _jsxs("div", { className: "space-y-5", children: [ /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between mb-3", children: [ /*#__PURE__*/ _jsx("h2", { className: "font-semibold text-gray-800", children: t('profile.balance') }), /*#__PURE__*/ _jsxs("button", { onClick: ()=>{ setTopUpAmount(10); setTopUpError(''); setShowTopUpModal(true); }, className: "flex items-center gap-1.5 text-sm font-medium text-green-600 hover:text-green-700 hover:bg-green-50 px-3 py-1.5 rounded-lg transition-colors", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 4v16m8-8H4" }) }), t('profile.balance.topup') ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 p-4 bg-green-50 rounded-xl border border-green-100", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-6 h-6 text-green-600 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 8c-1.657 0-3 .895-3 2s1.343 2 3 2 3 .895 3 2-1.343 2-3 2m0-8c1.11 0 2.08.402 2.599 1M12 8V7m0 1v8m0 0v1m0-1c-1.11 0-2.08-.402-2.599-1M21 12a9 9 0 11-18 0 9 9 0 0118 0z" }) }), /*#__PURE__*/ _jsxs("span", { className: "text-xl font-bold text-green-700", children: [ parseFloat((_user_balance = user === null || user === void 0 ? void 0 : user.balance) !== null && _user_balance !== void 0 ? _user_balance : '0').toFixed(2), " EUR" ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "mt-4", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between mb-2", children: [ /*#__PURE__*/ _jsx("h3", { className: "text-sm font-semibold text-gray-800", children: t('profile.balance.history', 'Operation history') }), /*#__PURE__*/ _jsx("span", { className: "text-xs text-gray-400", children: t('profile.balance.history.last', 'Latest operations') }) ] }), balanceHistory.length === 0 ? /*#__PURE__*/ _jsx("div", { className: "rounded-xl border border-dashed border-gray-200 px-4 py-6 text-sm text-gray-400 text-center", children: t('profile.balance.history.empty', 'No operations yet') }) : /*#__PURE__*/ _jsx("div", { className: "space-y-2", children: balanceHistory.map((entry)=>{ const isCredit = entry.direction === 'credit'; const amount = Number(entry.amount).toFixed(2); const badgeClass = isCredit ? 'bg-emerald-50 text-emerald-700 border-emerald-100' : 'bg-rose-50 text-rose-700 border-rose-100'; const title = entry.kind === 'topup' ? t('profile.balance.history.kind.topup', 'Balance top-up') : entry.kind === 'plan_purchase' ? t('profile.balance.history.kind.plan_purchase', 'Plan charge') : entry.kind === 'admin_topup' ? t('profile.balance.history.kind.admin_topup', 'Admin top-up') : t('profile.balance.history.kind.admin_adjustment', 'Admin adjustment'); return /*#__PURE__*/ _jsxs("div", { className: "rounded-xl border border-gray-200 px-4 py-3", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-start justify-between gap-3", children: [ /*#__PURE__*/ _jsxs("div", { className: "min-w-0", children: [ /*#__PURE__*/ _jsx("div", { className: "text-sm font-medium text-gray-900", children: entry.description || title }), /*#__PURE__*/ _jsx("div", { className: "text-xs text-gray-500 mt-1", children: new Date(entry.createdAt).toLocaleString(dateLocale) }) ] }), /*#__PURE__*/ _jsxs("div", { className: "shrink-0 rounded-full border px-2.5 py-1 text-xs font-semibold ".concat(badgeClass), children: [ isCredit ? '+' : '-', amount, " ", entry.currency ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "mt-2 text-xs text-gray-500", children: [ t('profile.balance.history.balance_after', 'Balance after'), ": ", Number(entry.balanceAfter).toFixed(2), " ", entry.currency ] }) ] }, entry.id); }) }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ _jsx("h2", { className: "font-semibold text-gray-800 mb-4", children: t('profile.plan_history.title', 'Plan history') }), planHistory.length === 0 ? /*#__PURE__*/ _jsx("div", { className: "rounded-xl border border-dashed border-gray-200 px-4 py-6 text-sm text-gray-400 text-center", children: t('profile.plan_history.empty', 'Plan change history is empty') }) : /*#__PURE__*/ _jsx("div", { className: "space-y-2", children: planHistory.map((entry)=>{ const eventColors = { activated: 'bg-green-50 text-green-700 border-green-100', renewed: 'bg-emerald-50 text-emerald-700 border-emerald-100', downgraded: 'bg-rose-50 text-rose-700 border-rose-100', referral_reward: 'bg-amber-50 text-amber-700 border-amber-100', admin_change: 'bg-purple-50 text-purple-700 border-purple-100', expired: 'bg-gray-100 text-gray-600 border-gray-200' }; const eventLabels = { activated: t('profile.plan_history.event.activated', 'Activated'), renewed: t('profile.plan_history.event.renewed', 'Renewed'), downgraded: t('profile.plan_history.event.downgraded', 'Downgraded'), referral_reward: t('profile.plan_history.event.referral_reward', 'Referral reward'), admin_change: t('profile.plan_history.event.admin_change', 'Changed by admin'), expired: t('profile.plan_history.event.expired', 'Expired') }; var _eventColors_entry_event; const badgeClass = (_eventColors_entry_event = eventColors[entry.event]) !== null && _eventColors_entry_event !== void 0 ? _eventColors_entry_event : 'bg-gray-100 text-gray-600 border-gray-200'; var _eventLabels_entry_event; const label = (_eventLabels_entry_event = eventLabels[entry.event]) !== null && _eventLabels_entry_event !== void 0 ? _eventLabels_entry_event : entry.event; return /*#__PURE__*/ _jsx("div", { className: "rounded-xl border border-gray-200 px-4 py-3", children: /*#__PURE__*/ _jsxs("div", { className: "flex items-start justify-between gap-3", children: [ /*#__PURE__*/ _jsxs("div", { className: "min-w-0", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 flex-wrap", children: [ /*#__PURE__*/ _jsx("span", { className: "text-sm font-semibold text-gray-900", children: entry.planName }), entry.previousPlanName && entry.previousPlanName !== entry.planName && /*#__PURE__*/ _jsxs("span", { className: "text-xs text-gray-400", children: [ "← ", entry.previousPlanName ] }) ] }), /*#__PURE__*/ _jsx("div", { className: "text-xs text-gray-500 mt-1", children: new Date(entry.createdAt).toLocaleString(dateLocale) }), entry.expiresAt && /*#__PURE__*/ _jsxs("div", { className: "text-xs text-gray-500 mt-0.5", children: [ t('profile.plan_history.expires', 'Until'), ": ", new Date(entry.expiresAt).toLocaleDateString(dateLocale) ] }), entry.daysAdded && entry.event === 'referral_reward' && /*#__PURE__*/ _jsxs("div", { className: "text-xs text-amber-600 mt-0.5", children: [ "+", entry.daysAdded, " ", t('profile.plan_history.days', 'days') ] }), entry.note && /*#__PURE__*/ _jsx("div", { className: "text-xs text-gray-400 mt-0.5", children: entry.note }) ] }), /*#__PURE__*/ _jsx("span", { className: "shrink-0 rounded-full border px-2.5 py-1 text-xs font-semibold ".concat(badgeClass), children: label }) ] }) }, entry.id); }) }) ] }), showTopUpModal && /*#__PURE__*/ _jsx("div", { className: "fixed inset-0 z-50 flex items-end sm:items-center justify-center p-4 bg-black/40 backdrop-blur-sm", children: /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-2xl shadow-2xl w-full max-w-sm p-6", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between mb-5", children: [ /*#__PURE__*/ _jsx("h3", { className: "text-lg font-semibold text-gray-900", children: t('profile.balance.topup.title') }), /*#__PURE__*/ _jsx("button", { onClick: ()=>setShowTopUpModal(false), className: "text-gray-400 hover:text-gray-600", children: /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" }) }) }) ] }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-500 mb-3", children: t('profile.balance.topup.hint') }), /*#__PURE__*/ _jsx("div", { className: "grid grid-cols-4 gap-2 mb-4", children: [ 5, 10, 20, 50 ].map((v)=>/*#__PURE__*/ _jsxs("button", { onClick: ()=>setTopUpAmount(v), className: "py-2 rounded-xl text-sm font-semibold border transition-colors ".concat(Number(topUpAmount) === v ? 'bg-green-600 text-white border-green-600' : 'border-gray-200 text-gray-700 hover:border-green-400'), children: [ "€", v ] }, v)) }), /*#__PURE__*/ _jsxs("div", { className: "mb-5", children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('profile.balance.topup.amount') }), /*#__PURE__*/ _jsxs("div", { className: "relative", children: [ /*#__PURE__*/ _jsx("span", { className: "absolute left-3 top-1/2 -translate-y-1/2 text-gray-400 text-sm", children: "€" }), /*#__PURE__*/ _jsx("input", { type: "number", min: "1", max: "9999", step: "1", value: topUpAmount, onChange: (e)=>setTopUpAmount(e.target.value), className: "w-full pl-7 pr-4 py-2.5 border border-gray-300 rounded-xl text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }) ] }), topUpError && /*#__PURE__*/ _jsx("p", { className: "text-sm text-red-600 mb-3", children: topUpError }), /*#__PURE__*/ _jsx("button", { onClick: handleTopUp, disabled: topUpLoading || !Number(topUpAmount) || Number(topUpAmount) < 1, className: "w-full py-3 bg-green-600 hover:bg-green-700 disabled:bg-gray-300 disabled:cursor-not-allowed text-white font-semibold rounded-xl transition-colors flex items-center justify-center gap-2", children: topUpLoading ? /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs("svg", { className: "w-4 h-4 animate-spin", fill: "none", viewBox: "0 0 24 24", children: [ /*#__PURE__*/ _jsx("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }), /*#__PURE__*/ _jsx("path", { className: "opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8v8z" }) ] }), t('profile.balance.topup.loading') ] }) : t('profile.balance.topup.submit') }) ] }) }), /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ _jsx("h2", { className: "font-semibold text-gray-800 mb-3", children: t('profile.plan.title') }), (user === null || user === void 0 ? void 0 : user.plan) ? /*#__PURE__*/ _jsxs("div", { className: "flex items-start gap-3 p-4 bg-green-50 rounded-xl border border-green-100", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-6 h-6 text-gray-500 shrink-0 mt-0.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M3 10h18M7 15h1m4 0h1m-7 4h12a3 3 0 003-3V8a3 3 0 00-3-3H6a3 3 0 00-3 3v8a3 3 0 003 3z" }) }), /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ _jsx("p", { className: "font-semibold text-gray-900", children: user.plan.name }), user.plan.description && /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-500 mt-0.5", children: user.plan.description }), /*#__PURE__*/ _jsxs("div", { className: "flex flex-wrap gap-3 mt-2 text-xs text-gray-500", children: [ /*#__PURE__*/ _jsxs("span", { className: "font-medium text-green-700", children: [ user.plan.price, " ", user.plan.currency ] }), user.plan.maxCards != null ? /*#__PURE__*/ _jsxs("span", { children: [ t('profile.plan.cards_up_to'), " ", user.plan.maxCards ] }) : /*#__PURE__*/ _jsx("span", { children: t('profile.plan.cards_unlimited') }), user.plan.maxTasks != null && /*#__PURE__*/ _jsxs("span", { children: [ t('profile.plan.tasks_up_to'), " ", user.plan.maxTasks ] }), user.plan.maxOffers != null && /*#__PURE__*/ _jsxs("span", { children: [ t('profile.plan.offers_up_to'), " ", user.plan.maxOffers ] }), /*#__PURE__*/ _jsx("span", { className: user.planExpiresAt && new Date(user.planExpiresAt) < new Date(Date.now() + 7 * 24 * 60 * 60 * 1000) ? 'text-red-500 font-medium' : '', children: user.planExpiresAt ? "".concat(t('profile.plan.valid_until'), " ").concat(new Date(user.planExpiresAt).toLocaleDateString()) : t('profile.plan.no_expiry') }) ] }), ((_user_plan_features = user.plan.features) !== null && _user_plan_features !== void 0 ? _user_plan_features : []).length > 0 && /*#__PURE__*/ _jsx("ul", { className: "mt-2 space-y-0.5", children: user.plan.features.map((f, i)=>/*#__PURE__*/ _jsxs("li", { className: "text-xs text-gray-600 flex items-center gap-1.5", children: [ /*#__PURE__*/ _jsx("span", { className: "text-green-500", children: "✓" }), " ", f ] }, i)) }) ] }) ] }) : /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 p-4 bg-gray-50 rounded-xl border border-gray-100", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" }) }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "text-sm font-medium text-gray-700", children: t('profile.plan.basic') }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-0.5", children: t('profile.plan.contact_upgrade') }) ] }) ] }) ] }), /*#__PURE__*/ _jsx("div", { className: "text-center", children: /*#__PURE__*/ _jsxs("a", { href: "/pricing", className: "inline-flex items-center gap-1.5 text-sm font-medium text-white/70 hover:text-white transition", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M13 7l5 5m0 0l-5 5m5-5H6" }) }), t('pricing.title', 'Pricing') ] }) }) ] }), activeTab !== 'cards' && activeTab !== 'reviews' && activeTab !== 'finance' && activeTab !== 'site' && /*#__PURE__*/ _jsxs("form", { onSubmit: handleSubmit, className: "space-y-6", children: [ error && /*#__PURE__*/ _jsx("div", { className: "bg-red-50 text-red-700 p-3 rounded-lg text-sm", children: error }), saved && /*#__PURE__*/ _jsxs("div", { className: "bg-green-50 text-green-700 p-3 rounded-lg text-sm", children: [ "✓ ", t('profile.saved') ] }), activeTab === 'notifications' && /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6 space-y-6", children: [ /*#__PURE__*/ _jsx("h2", { className: "font-semibold text-gray-800", children: t('notifications.title') }), notifySaved && /*#__PURE__*/ _jsxs("div", { className: "bg-green-50 text-green-700 p-3 rounded-lg text-sm", children: [ "✓ ", t('notifications.saved') ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-start justify-between gap-4", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex-1", children: [ /*#__PURE__*/ _jsx("p", { className: "font-medium text-gray-800 text-sm", children: t('chat.notif_messages') }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-500 mt-0.5", children: t('notifications.messages.desc') }) ] }), /*#__PURE__*/ _jsx("button", { type: "button", disabled: notifySaving, onClick: async ()=>{ const next = !notifMessages; setNotifMessages(next); setNotifySaving(true); try { await api.request('/users/me', { method: 'PATCH', body: JSON.stringify({ notifMessages: next }) }); setNotifySaved(true); setTimeout(()=>setNotifySaved(false), 2500); } catch (e) { setNotifMessages(!next); } finally{ setNotifySaving(false); } }, className: "relative inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full transition-colors focus:outline-none focus:ring-2 focus:ring-green-500 focus:ring-offset-2 disabled:opacity-50 ".concat(notifMessages ? 'bg-green-600' : 'bg-gray-200'), role: "switch", "aria-checked": notifMessages, children: /*#__PURE__*/ _jsx("span", { className: "inline-block h-4 w-4 transform rounded-full bg-white shadow transition-transform ".concat(notifMessages ? 'translate-x-6' : 'translate-x-1') }) }) ] }), showSpecialistTabs && /*#__PURE__*/ _jsxs("div", { className: "flex items-start justify-between gap-4 ".concat(!(user === null || user === void 0 ? void 0 : (_user_plan = user.plan) === null || _user_plan === void 0 ? void 0 : _user_plan.notifyNewTasks) ? 'opacity-60' : ''), children: [ /*#__PURE__*/ _jsxs("div", { className: "flex-1", children: [ /*#__PURE__*/ _jsx("p", { className: "font-medium text-gray-800 text-sm", children: t('notifications.email.new_tasks') }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-500 mt-0.5", children: t('notifications.email.new_tasks.desc') }), !(user === null || user === void 0 ? void 0 : (_user_plan1 = user.plan) === null || _user_plan1 === void 0 ? void 0 : _user_plan1.notifyNewTasks) && /*#__PURE__*/ _jsxs("p", { className: "text-xs text-amber-600 mt-1", children: [ "\uD83D\uDD12 ", t('notifications.plan_required') ] }) ] }), /*#__PURE__*/ _jsx("button", { type: "button", disabled: notifySaving || !(user === null || user === void 0 ? void 0 : (_user_plan2 = user.plan) === null || _user_plan2 === void 0 ? void 0 : _user_plan2.notifyNewTasks), onClick: async ()=>{ const next = !notifyNewTasks; setNotifyNewTasks(next); setNotifySaving(true); try { await api.request('/users/me', { method: 'PATCH', body: JSON.stringify({ notifyNewTasks: next }) }); setNotifySaved(true); setTimeout(()=>setNotifySaved(false), 2500); } catch (e) { setNotifyNewTasks(!next); } finally{ setNotifySaving(false); } }, className: "relative inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full transition-colors focus:outline-none focus:ring-2 focus:ring-green-500 focus:ring-offset-2 disabled:opacity-50 ".concat(notifyNewTasks ? 'bg-green-600' : 'bg-gray-200'), role: "switch", "aria-checked": notifyNewTasks, children: /*#__PURE__*/ _jsx("span", { className: "inline-block h-4 w-4 transform rounded-full bg-white shadow transition-transform ".concat(notifyNewTasks ? 'translate-x-6' : 'translate-x-1') }) }) ] }) ] }), activeTab === 'referral' && /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6 space-y-5", children: [ /*#__PURE__*/ _jsx("h2", { className: "font-semibold text-gray-800", children: t('profile.referral.title') }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-500", children: t('profile.referral.desc') }), !referralLoaded ? /*#__PURE__*/ _jsx("div", { className: "text-sm text-gray-400", children: t('common.loading') }) : referralCode ? /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs font-medium text-gray-500 mb-1.5", children: t('profile.referral.link_label') }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2", children: [ /*#__PURE__*/ _jsx("input", { readOnly: true, value: "".concat("object" !== 'undefined' ? window.location.origin : '', "/register?ref=").concat(referralCode), className: "flex-1 text-sm border border-gray-200 rounded-lg px-3 py-2 bg-gray-50 text-gray-700 focus:outline-none" }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>{ navigator.clipboard.writeText("".concat(window.location.origin, "/register?ref=").concat(referralCode)); setReferralCopied(true); setTimeout(()=>setReferralCopied(false), 2000); }, className: "px-3 py-2 rounded-lg border border-gray-200 text-sm font-medium hover:bg-gray-50 transition whitespace-nowrap", children: referralCopied ? t('profile.referral.copied') : t('profile.referral.copy') }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 p-4 bg-green-50 rounded-xl", children: [ /*#__PURE__*/ _jsx("div", { className: "text-2xl font-bold text-green-700", children: referralCount }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-green-700", children: t('profile.referral.invited_count') }) ] }) ] }) : /*#__PURE__*/ _jsx("div", { className: "text-sm text-gray-400", children: t('profile.referral.no_code') }) ] }), activeTab === 'auto_response' && /*#__PURE__*/ _jsx(AutoResponseTab, { categories: categories, locationTree: locationTree, loaded: arLoaded, onLoad: ()=>{ if (arLoaded) return; api.getAutoResponseSettings().then((s)=>{ setAutoResponse(s); setArLoaded(true); }).catch(()=>setArLoaded(true)); }, settings: autoResponse, saving: arSaving, saved: arSaved, onSave: async (data)=>{ setArSaving(true); setArSaved(false); try { const updated = await api.updateAutoResponseSettings(data); setAutoResponse(updated); setArSaved(true); setTimeout(()=>setArSaved(false), 2500); } catch (e) {} finally{ setArSaving(false); } }, t: t, catLocale: catLocale }), activeTab === 'info' && /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ _jsx("h2", { className: "font-semibold text-gray-800 mb-4", children: t('profile.photo') }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-5", children: [ /*#__PURE__*/ _jsxs("div", { className: "relative", children: [ (user === null || user === void 0 ? void 0 : user.image) ? /*#__PURE__*/ _jsx("img", { src: user.image, alt: user.name, className: "w-20 h-20 rounded-full object-cover border-2 border-gray-200" }) : /*#__PURE__*/ _jsx("div", { className: "w-20 h-20 rounded-full bg-green-100 flex items-center justify-center text-green-700 text-2xl font-bold border-2 border-gray-200", children: initials }), avatarUploading && /*#__PURE__*/ _jsx("div", { className: "absolute inset-0 rounded-full bg-black/40 flex items-center justify-center", children: /*#__PURE__*/ _jsx("div", { className: "w-5 h-5 border-2 border-white border-t-transparent rounded-full animate-spin" }) }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>{ var _fileRef_current; return (_fileRef_current = fileRef.current) === null || _fileRef_current === void 0 ? void 0 : _fileRef_current.click(); }, disabled: avatarUploading, className: "bg-gray-100 hover:bg-gray-200 text-gray-700 px-4 py-2 rounded-lg text-sm font-medium disabled:opacity-50", children: t('profile.photo.change') }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-1", children: t('profile.photo.hint') }), /*#__PURE__*/ _jsx("input", { ref: fileRef, type: "file", accept: "image/jpeg,image/png,image/webp", className: "hidden", onChange: handleAvatarChange }), /*#__PURE__*/ _jsx("div", { className: "mt-3 rounded-lg border border-gray-200 bg-gray-50 px-3 py-2.5", children: isSpecialist ? (dashData === null || dashData === void 0 ? void 0 : (_dashData_features3 = dashData.features) === null || _dashData_features3 === void 0 ? void 0 : _dashData_features3.hasCanHelpNowStatus) ? /*#__PURE__*/ _jsxs("label", { className: "flex items-center justify-between cursor-pointer gap-3", children: [ /*#__PURE__*/ _jsx("span", { className: "text-xs font-medium text-gray-700", children: t('status.can_help_now', 'Available now') }), /*#__PURE__*/ _jsx("button", { type: "button", disabled: statusToggling === 'canhelp_now', onClick: async ()=>{ setStatusToggling('canhelp_now'); const nextActive = !myStatuses.includes('canhelp_now'); try { const res = await api.toggleStatus('canhelp_now', nextActive); setMyStatuses((prev)=>res.isActive ? [ ...prev.filter((s)=>s !== 'canhelp_now'), 'canhelp_now' ] : prev.filter((s)=>s !== 'canhelp_now')); } catch (e) {} finally{ setStatusToggling(null); } }, className: "relative inline-flex h-5 w-10 items-center rounded-full transition-colors ".concat(myStatuses.includes('canhelp_now') ? 'bg-green-500' : 'bg-gray-300', " disabled:opacity-50"), children: /*#__PURE__*/ _jsx("span", { className: "inline-block h-3.5 w-3.5 transform rounded-full bg-white shadow transition-transform ".concat(myStatuses.includes('canhelp_now') ? 'translate-x-5.5' : 'translate-x-1') }) }) ] }) : /*#__PURE__*/ _jsx("p", { className: "text-xs text-amber-700", children: t('status.plan_required', 'Status is unavailable on your current plan') }) : !isAdmin ? (dashData === null || dashData === void 0 ? void 0 : (_dashData_features4 = dashData.features) === null || _dashData_features4 === void 0 ? void 0 : _dashData_features4.hasNeedHelpStatus) ? /*#__PURE__*/ _jsxs("label", { className: "flex items-center justify-between cursor-pointer gap-3", children: [ /*#__PURE__*/ _jsx("span", { className: "text-xs font-medium text-gray-700", children: t('status.need_help', 'Need help') }), /*#__PURE__*/ _jsx("button", { type: "button", disabled: statusToggling === 'need_help', onClick: async ()=>{ setStatusToggling('need_help'); const nextActive = !myStatuses.includes('need_help'); try { const res = await api.toggleStatus('need_help', nextActive); setMyStatuses((prev)=>res.isActive ? [ ...prev.filter((s)=>s !== 'need_help'), 'need_help' ] : prev.filter((s)=>s !== 'need_help')); } catch (e) {} finally{ setStatusToggling(null); } }, className: "relative inline-flex h-5 w-10 items-center rounded-full transition-colors ".concat(myStatuses.includes('need_help') ? 'bg-green-500' : 'bg-gray-300', " disabled:opacity-50"), children: /*#__PURE__*/ _jsx("span", { className: "inline-block h-3.5 w-3.5 transform rounded-full bg-white shadow transition-transform ".concat(myStatuses.includes('need_help') ? 'translate-x-5.5' : 'translate-x-1') }) }) ] }) : /*#__PURE__*/ _jsx("p", { className: "text-xs text-amber-700", children: t('status.plan_required', 'Status is unavailable on your current plan') }) : /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-600", children: t('status.admin_not_applicable', 'User status is not applicable to admin accounts') }) }) ] }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ _jsx("h2", { className: "font-semibold text-gray-800 mb-4", children: t('profile.background.title', 'Profile header background') }), /*#__PURE__*/ _jsx("div", { className: "w-full h-40 rounded-2xl border border-gray-200 overflow-hidden relative", style: { backgroundImage: siteSettings.profileBackgroundImage ? "linear-gradient(135deg, rgba(22,163,74,0.45), rgba(21,128,61,0.65)), url(".concat(siteSettings.profileBackgroundImage, ")") : 'linear-gradient(135deg, #22c55e 0%, #16a34a 45%, #166534 100%)', backgroundSize: 'cover', backgroundPosition: 'center' }, children: backgroundUploading && /*#__PURE__*/ _jsx("div", { className: "absolute inset-0 bg-black/35 flex items-center justify-center", children: /*#__PURE__*/ _jsx("div", { className: "w-6 h-6 border-2 border-white border-t-transparent rounded-full animate-spin" }) }) }), /*#__PURE__*/ _jsxs("div", { className: "mt-4 flex flex-wrap gap-2", children: [ /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>{ var _backgroundFileRef_current; return (_backgroundFileRef_current = backgroundFileRef.current) === null || _backgroundFileRef_current === void 0 ? void 0 : _backgroundFileRef_current.click(); }, disabled: backgroundUploading, className: "bg-gray-100 hover:bg-gray-200 text-gray-700 px-4 py-2 rounded-lg text-sm font-medium disabled:opacity-50", children: backgroundUploading ? t('profile.photo.uploading', 'Uploading...') : t('profile.background.change', 'Change background') }), siteSettings.profileBackgroundImage && /*#__PURE__*/ _jsx("button", { type: "button", onClick: handleRemoveBackground, disabled: backgroundUploading, className: "bg-white hover:bg-gray-50 text-gray-700 px-4 py-2 rounded-lg text-sm font-medium border border-gray-200 disabled:opacity-50", children: t('profile.background.remove', 'Remove background') }), /*#__PURE__*/ _jsx("input", { ref: backgroundFileRef, type: "file", accept: "image/jpeg,image/png,image/webp", className: "hidden", onChange: handleBackgroundChange }) ] }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-2", children: t('profile.background.hint', 'Shown in the public profile header on web and mobile app.') }) ] }), /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6 space-y-4", children: [ /*#__PURE__*/ _jsx("h2", { className: "font-semibold text-gray-800", children: t('profile.basic_info') }), /*#__PURE__*/ _jsxs("div", { className: "grid grid-cols-2 gap-4", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('register.first_name') }), /*#__PURE__*/ _jsx("input", { value: formData.firstName, onChange: (e)=>setFormData({ ...formData, firstName: e.target.value }), required: true, className: "w-full border border-gray-300 rounded-lg px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-400 text-sm" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('register.last_name') }), /*#__PURE__*/ _jsx("input", { value: formData.lastName, onChange: (e)=>setFormData({ ...formData, lastName: e.target.value }), required: true, className: "w-full border border-gray-300 rounded-lg px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-400 text-sm" }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: "Email" }), /*#__PURE__*/ _jsx("input", { value: user === null || user === void 0 ? void 0 : user.email, disabled: true, className: "w-full border border-gray-200 rounded-lg px-3 py-2 text-sm text-gray-400 bg-gray-50 cursor-not-allowed" }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between mt-1.5", children: [ (user === null || user === void 0 ? void 0 : user.emailVerified) ? /*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-1 text-xs text-green-600", children: [ /*#__PURE__*/ _jsx("span", { className: "inline-block w-1.5 h-1.5 rounded-full bg-green-500" }), t('profile.email.verified') ] }) : /*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-1 text-xs text-amber-600", children: [ /*#__PURE__*/ _jsx("span", { className: "inline-block w-1.5 h-1.5 rounded-full bg-amber-500" }), t('profile.email.not_verified') ] }), !(user === null || user === void 0 ? void 0 : user.emailVerified) && /*#__PURE__*/ _jsx("button", { type: "button", disabled: resendState !== 'idle', onClick: handleResendVerification, className: "text-xs text-green-600 hover:underline disabled:opacity-60 disabled:no-underline", children: resendState === 'sending' ? t('login.unverified.sending') : resendState === 'sent' ? t('login.unverified.sent') : t('login.unverified.resend') }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('profile.phone') }), /*#__PURE__*/ _jsx("input", { type: "tel", value: formData.phone, onChange: (e)=>setFormData({ ...formData, phone: e.target.value }), placeholder: t('profile.phone.placeholder'), className: "w-full border border-gray-300 rounded-lg px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-400 text-sm" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('profile.bio') }), /*#__PURE__*/ _jsx("textarea", { value: formData.bio, onChange: (e)=>setFormData({ ...formData, bio: e.target.value }), rows: 3, maxLength: 1000, placeholder: t('profile.bio.placeholder'), className: "w-full border border-gray-300 rounded-lg px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-400 text-sm resize-none" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('profile.language') }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mb-2", children: t('profile.language.hint') }), /*#__PURE__*/ _jsxs("select", { value: formData.locale, onChange: (e)=>setFormData({ ...formData, locale: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400", children: [ /*#__PURE__*/ _jsx("option", { value: "el", children: "ΕλληΜικά" }), /*#__PURE__*/ _jsx("option", { value: "en", children: "English" }), /*#__PURE__*/ _jsx("option", { value: "ru", children: "РусскОй" }), /*#__PURE__*/ _jsx("option", { value: "uk", children: "УкраїМська" }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('profile.languages') }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mb-2", children: t('profile.languages.hint') }), /*#__PURE__*/ _jsx("div", { className: "flex flex-wrap gap-2", children: [ { code: 'el', flag: '🇬🇷', label: 'ΕλληΜικά' }, { code: 'en', flag: '🇬🇧', label: 'English' }, { code: 'ru', flag: '🇷🇺', label: 'РусскОй' }, { code: 'uk', flag: '🇺🇊', label: 'УкраїМська' }, { code: 'de', flag: '🇩🇪', label: 'Deutsch' }, { code: 'fr', flag: '🇫🇷', label: 'Français' }, { code: 'it', flag: '🇮🇹', label: 'Italiano' }, { code: 'es', flag: '🇪🇞', label: 'Español' }, { code: 'ar', flag: '🇞🇊', label: 'العرؚية' }, { code: 'zh', flag: '🇚🇳', label: 'äž­æ–‡' } ].map((param)=>{ let { code, flag, label } = param; const selected = selectedLanguages.includes(code); return /*#__PURE__*/ _jsxs("button", { type: "button", onClick: ()=>setSelectedLanguages(selected ? selectedLanguages.filter((l)=>l !== code) : [ ...selectedLanguages, code ]), className: "flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-sm border transition ".concat(selected ? 'bg-green-600 border-green-600 text-white' : 'bg-white border-gray-300 text-gray-700 hover:border-green-400'), children: [ /*#__PURE__*/ _jsx("span", { children: flag }), /*#__PURE__*/ _jsx("span", { children: label }) ] }, code); }) }) ] }) ] }), !isSpecialist && !isAdmin && /*#__PURE__*/ _jsx("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: /*#__PURE__*/ _jsxs("div", { className: "p-4 bg-purple-50 rounded-xl", children: [ /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-600 mb-3", children: t('profile.become_specialist.desc') }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: handleBecomeSpecialist, disabled: becomingSpecialist, className: "bg-purple-600 hover:bg-purple-700 text-white px-5 py-2 rounded-lg text-sm font-semibold disabled:opacity-50", children: becomingSpecialist ? t('common.loading') : t('profile.become_specialist') }) ] }) }), isSpecialist && ((dashData === null || dashData === void 0 ? void 0 : (_dashData_plan = dashData.plan) === null || _dashData_plan === void 0 ? void 0 : _dashData_plan.tier) === 'pro' || (dashData === null || dashData === void 0 ? void 0 : (_dashData_plan1 = dashData.plan) === null || _dashData_plan1 === void 0 ? void 0 : _dashData_plan1.tier) === 'ultimate') && /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ _jsx("h2", { className: "font-semibold text-gray-800 mb-4", children: t('profile.show_contact', 'Show contacts') }), /*#__PURE__*/ _jsxs("label", { className: "flex items-center justify-between cursor-pointer gap-3", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "text-sm font-medium text-gray-800", children: t('profile.show_contact_hint', 'Clients can see your phone number') }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-0.5", children: t('profile.show_contact_desc', 'Lets clients contact you directly') }) ] }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setShowContactInfo((v)=>!v), className: "relative inline-flex h-6 w-11 items-center rounded-full transition-colors ".concat(showContactInfo ? 'bg-green-500' : 'bg-gray-300'), children: /*#__PURE__*/ _jsx("span", { className: "inline-block h-4 w-4 transform rounded-full bg-white shadow transition-transform ".concat(showContactInfo ? 'translate-x-6' : 'translate-x-1') }) }) ] }) ] }) ] }), /*#__PURE__*/ _jsx("button", { type: "submit", disabled: saving, className: "w-full bg-green-600 text-white py-3 rounded-xl font-semibold hover:bg-green-700 disabled:opacity-50 disabled:cursor-not-allowed ".concat(activeTab === 'notifications' || activeTab === 'referral' || activeTab === 'auto_response' ? 'hidden' : ''), children: saving ? t('profile.saving') : t('common.save') }) ] }), showUpgradeModal && /*#__PURE__*/ _jsx("div", { className: "fixed inset-0 z-50 flex items-center justify-center bg-black/50 px-4", children: /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-2xl shadow-xl p-6 w-full max-w-md", children: [ /*#__PURE__*/ _jsx("div", { className: "text-center mb-5", children: /*#__PURE__*/ _jsx("span", { className: "text-5xl", children: "\uD83D\uDE80" }) }), /*#__PURE__*/ _jsx("h2", { className: "text-lg font-bold text-gray-900 text-center mb-2", children: t('profile.upgrade.cards_limit') }), /*#__PURE__*/ _jsxs("p", { className: "text-sm text-gray-600 text-center mb-4", children: [ (_user_plan_name = user === null || user === void 0 ? void 0 : (_user_plan3 = user.plan) === null || _user_plan3 === void 0 ? void 0 : _user_plan3.name) !== null && _user_plan_name !== void 0 ? _user_plan_name : t('profile.plan.basic'), " — ", t('profile.plan.cards_up_to'), " ", maxCards ] }), (user === null || user === void 0 ? void 0 : user.plan) && /*#__PURE__*/ _jsxs("div", { className: "bg-gray-50 rounded-xl p-4 mb-5 text-sm text-gray-600 text-center", children: [ /*#__PURE__*/ _jsx("span", { className: "font-medium text-gray-800", children: t('profile.upgrade.plan') }), ' ', user.plan.name, " — ", user.plan.price, " ", user.plan.currency ] }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 text-center mb-5", children: t('profile.upgrade.contact') }), /*#__PURE__*/ _jsx("button", { onClick: ()=>setShowUpgradeModal(false), className: "w-full bg-green-600 hover:bg-green-700 text-white py-2.5 rounded-xl text-sm font-semibold", children: t('profile.upgrade.ok') }) ] }) }) ] }) ] }) ] }); } ’Ä61146undefined148209undefined211271undefined273324undefined326370undefined372404undefined406481undefined711719(0,_context_locale__WEBPACK_IMPORTED_MODULE_4__/* .useLocale */ .Y)undefined819826(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined869876(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined920927(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined977984(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined10701077(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined12651272(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined14601467(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined16551662(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined18431850(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined19791986(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined20692076(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined22542261(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined24592466(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined26782685(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined27552762(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined29192926(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined29782985(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined30323039(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined30823089(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined31253130(0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)undefined32013208(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined32673274(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined33303337(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined33903397(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined34403447(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined35863593(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined36503657(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined36683676(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined38163831_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getPriceList */ .Ckundefined40824105_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .createPriceListGroup */ .vDundefined45524575_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .deletePriceListGroup */ .Icundefined47404763_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .updatePriceListGroup */ .oDundefined53275349_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .createPriceListItem */ .Z2undefined62256247_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .deletePriceListItem */ .U9undefined64476455(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined65136535_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getSkillSuggestions */ .rlundefined74047427_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .updateSpecialistCard */ .zcundefined82488271_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .updateSpecialistCard */ .zcundefined1009610126"https://api.canhelp.gr"undefined10131101530undefined1086310885_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .deletePortfolioItem */ .zBundefined1120011222_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .updatePortfolioItem */ .hlundefined1255312557(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1269512699(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1291112915(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1316913172(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1343713440(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1382713830(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1408614089(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1496714970(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1536315367(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1546315467(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1566015663(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1593715940(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1613916142(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1639916403(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1675716760(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1716917172(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1757817581(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1778217785(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1830918313(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1846618470(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1863118634(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2140821412(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2154121545(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2216022163(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2286822871(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2327123275(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2351923522(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2391323916(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2464324647(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2483424837(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2500825012(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2535125354(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2599626000(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2618626189(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2713327136(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2769827701(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2826228266(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2906229065(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3004930053(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3017430178(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3042030423(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3097730981(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3128231285(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3128731298_components_CategoryIcon__WEBPACK_IMPORTED_MODULE_6__/* .CategoryIcon */ .Ezundefined3153631552(0,_components_CategoryIcon__WEBPACK_IMPORTED_MODULE_6__/* .isCategoryIconUrl */ .V)undefined3213032133(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3294132945(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3321133214(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3380433807(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3451034513(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3552635530(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3565135655(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3589735900(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3645836461(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3688736890(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3766537669(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3793537938(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3852338526(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3922639229(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3937139374(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3960539609(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3961139619react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragmentundefined3975239755(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4012240126(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined4037540378(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4064140645(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined4064740655react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragmentundefined4081040813(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4174441747(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4238942392(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4301843022(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined4302443032react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragmentundefined4318743190(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4356343566(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4441344416(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4521045213(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4542345427(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined4572445728(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined4601446017(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4644546448(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4702547029(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined4772747730(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4861348617(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined4889248895(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4979149794(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined5070450708(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined5096650969(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined5193851941(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined5303053034(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined5329253295(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined5395353956(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined5541155414(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined5561055614(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined5651656520(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined5672356726(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined5753257535(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined5825858262(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined5844858452(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined5857358576(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined5942159425(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined5942759435react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragmentundefined5957459577(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined6001060014(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined6001660024react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragmentundefined6046160464(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined6105461057(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined6134661349(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined6165261656(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined6193161934(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined6238962393(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined6271762720(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined6337563379(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined6499965002(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined6517565178(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined6585065854(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined6606466067(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined6660466608(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined6713767140(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined6729067294(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined6746067463(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined6768067683(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined6793467938(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined6808768091(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined6820468207(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined6850468507(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined6906269066(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined6917969182(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined6947869481(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined7015270156(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined7031170314(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined7075870761(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined7156671565: react__WEBPACK_IMPORTED_MODULE_1__.useEffectundefined7158471583: react__WEBPACK_IMPORTED_MODULE_1__.useStateundefined7311073113(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined7364773651(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined7374073743(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined7387173875(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined7404174045(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined7414274145(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined7440074403(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined7473574738(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined7507675079(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined7541175415(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined7557575578(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined7579975803(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined7595375957(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined7606276065(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined7634476347(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined7697876982(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined7708777090(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined7736977372(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined7804478048(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined7813778140(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined7840078403(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined7891078914(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined7900379006(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined7926879271(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined7984079844(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined7999479997(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined8023080233(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined8082880832(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined8098280985(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined8121381216(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined8229982302(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined8304383046(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined8404784061undefined8411284115(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined8411784124react__WEBPACK_IMPORTED_MODULE_1__.Suspenseundefined8418584188(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined8450084508(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)undefined8453884552(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useSearchParams)undefined8459884607(0,_lib_auth__WEBPACK_IMPORTED_MODULE_3__/* .useSession */ .wV)undefined8463884646(0,_context_locale__WEBPACK_IMPORTED_MODULE_4__/* .useLocale */ .Y)undefined8504385050(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8513585142(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8518585192(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8523385240(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8528085287(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8532785334(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8537785384(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8555285559(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8562085627(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8567085677(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8572785734(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8579885805(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8585285859(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8591285919(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8597385980(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8603786044(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8610686113(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8618586192(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8624386250(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8633886345(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8640586412(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8648086487(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8651786522(0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)undefined8656186566(0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)undefined8665586662(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8671886725(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8677886785(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8683786844(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8692986936(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8701287019(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8707487081(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8713587142(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8720087207(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8729387300(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8735287359(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8741087417(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8746787474(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8752987536(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8758587592(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8766387670(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8771987726(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8778187788(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8784987856(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8790387910(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8795887965(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8801588022(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8807088077(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8813488141(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8819588202(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8826588272(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8832088327(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8838888395(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8844988456(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8850188508(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8855488561(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8860588612(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8885888874_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .initiateTopUp */ .ohundefined8992389932_lib_auth__WEBPACK_IMPORTED_MODULE_3__/* .authClient */ .yKundefined9021090218(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined9029890318_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getMyReferralInfo */ .stundefined9057790584(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined9064190648(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined9069490701(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined9071490722(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined9085690871_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getMyReviews */ .q7undefined9100091008(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined9114391158_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getSiteStats */ .RNundefined9130691314(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined9143791445(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined9151791527_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Emundefined9155591571_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getCategories */ .bWundefined9158891603_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getLocations */ .Vsundefined9162091637_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getMyDashboard */ .Hundefined9167091686_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getMyStatuses */ .z6undefined9171791737_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getBalanceHistory */ .fmundefined9176991786_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getPlanHistory */ .ewundefined9390793923_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getUserRating */ .Bmundefined9419694219_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getMySpecialistCards */ .Bbundefined9458394602_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getNotifications */ .Trundefined9514295152_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Emundefined9611496124_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Emundefined9659896608_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Emundefined9783197841_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Emundefined9850098530"https://api.canhelp.gr"undefined98535985570undefined9883798867"https://api.canhelp.gr"undefined98872988940undefined9892898938_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Emundefined9976599795"https://api.canhelp.gr"undefined99800998220undefined100102100132"https://api.canhelp.gr"undefined1001371001590undefined100324100334_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Emundefined101101101111_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Emundefined101711101734_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .createSpecialistCard */ .eRundefined102300102323_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .deleteSpecialistCard */ .f5undefined102873102876(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined107226107229(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined107445107448(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined107765107768(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined107984107987(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined108390108393(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined108609108612(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined108926108929(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined109145109148(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined109530109533(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined109749109752(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined110280110283(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined110499110502(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined110844110847(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined111063111066(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined111417111420(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined111636111639(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined114349114353(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined114460114464(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined114596114599(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined115293115296(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined115560115564(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined115706115709(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined116278116282(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined116464116467(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined116693116696(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined117009117013(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined117606117609(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined117767117771(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined117953117957(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined118054118057(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined118323118326(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined118707118710(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined119314119318(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined119463119466(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined119595119598(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined119776119780(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined120359120363(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined120665120668(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined121226121230(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined121391121394(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined121606121610(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined122224122228(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined122546122549(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined123149123153(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined123323123326(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined123612123616(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined123842123845(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined124200124203(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined124561124564(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined124790124793(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined125115125119(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined125328125332(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined125989125993(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined127150127154(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined127387127390(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined127688127691(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined128581128585(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined128795128798(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined129482129485(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined130416130419(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined130735130739(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined130982130985(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined131272131276(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined133860133863(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined135360135364(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined135525135529(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined135761135765(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined135902135905(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined136230136233(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined136639136643(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined136780136783(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined137129137133(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined137390137393(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined137745137748(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined138704138708(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined138941138944(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined139620139624(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined140142140146(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined140148140156react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragmentundefined140303140307(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined141262141265(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined141834141837(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined142731142735(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined143476143479(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined144048144051(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined144979144982(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined145321145325(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined145547145551(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined145789145792(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined146142146145(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined146559146562(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined149815149819(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined150089150092(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined151042151045(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined151597151600(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined152180152183(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined153301153304(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined153635153639(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined153873153876(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined154225154228(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined155634155638(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined156484156487(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined157224157228(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined157450157453(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined157637157641(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined157786157789(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined158149158152(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined158669158672(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined159016159019(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined164916164920(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined164922164930react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragmentundefined165069165072(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined166931166935(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined167242167245(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined167644167647(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined168229168232(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined168449168453(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined168761168764(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined169593169596(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined169781169785(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined170586170590(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined170781170784(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined171547171550(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined172774172777(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined173788173791(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined174615174618(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined175018175021(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined176107176110(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined176908176911(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined178064178067(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined178211178214(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined178449178453(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined178648178651(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined178888178891(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined179397179400(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined179576179580(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined179790179793(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined180139180142(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined180916180920(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined181138181142(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined181406181409(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined181898181902(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined182640182643(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined182963182966(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined183634183638(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined183799183803(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined184025184029(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined184267184270(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined184587184591(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined185332185335(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined185852185855(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined186627186631(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined186905186908(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined187403187406(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined188005188009(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined188746188750(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined188954188958(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined189220189223(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined189609189612(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined190126190129(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined190495190498(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined191593191597(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined191888191892(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined192202192206(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined192509192512(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined192970192973(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined193603193607(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined194662194666(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined196008196012(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined196234196237(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined196581196584(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined196934196937(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined199509199512(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined199717199721(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined199995199999(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined200266200270(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined200587200590(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined201094201098(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined201940201943(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined202391202395(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined203256203260(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined204119204122(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined204640204643(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined205406205409(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined205636205640(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined205879205883(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined206133206136(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined206489206492(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined206797206800(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined207317207320(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined207968207971(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined208281208284(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined208768208772(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined209598209602(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined209818209821(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined210187210191(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined210435210438(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined210823210826(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined211933211936(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined212224212227(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined212785212789(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined212791212799react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragmentundefined212946212950(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined213382213385(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined214080214083(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined215059215063(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined215285215288(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined215639215643(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined215916215919(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined216420216423(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined216937216941(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined217179217182(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined217549217552(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined217902217906(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined218201218205(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined218940218944(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined219484219487(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined219799219803(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined220441220445(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined221054221057(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined221928221931(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined222155222159(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined222477222480(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined223372223376(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined223648223651(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined224145224148(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined224692224696(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined224849224852(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined225209225212(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined225841225844(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined225985225989(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined226331226334(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined226779226782(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined227565227569(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined227796227799(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined228065228069(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined228514228518(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined228750228753(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined229057229061(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined229535229539(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined229777229781(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined230011230014(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined230372230375(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined230841230844(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined231479231489_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Emundefined233107233110(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined233627233631(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined234041234045(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined234275234278(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined234646234649(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined235166235170(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined235856235859(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined236645236655_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Emundefined238277238280(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined238877238881(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined239113239116(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined239408239411(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined239713239716(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined239967239971(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined239973239981react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragmentundefined240112240116(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined240269240272(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined240645240649(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined240920240923(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined241113241136 trueundefined2411652411660undefined241551241554(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined242957242961(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined243235243238(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined243587243590(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined244099244102(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined244497244500(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined244875244901_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getAutoResponseSettings */ .Gpundefined245660245689_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .updateAutoResponseSettings */ .RQundefined246373246377(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined246379246387react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragmentundefined246502246506(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined246752246755(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined247075247079(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined247326247330(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined247645247648(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined248069248072(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined248561248564(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined248832248835(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined249362249366(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined249535249538(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined250649250652(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined251034251037(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined251685251688(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined252150252154(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined252494252497(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined252955252958(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined253775253790_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .toggleStatus */ .bcundefined255134255137(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined255756255759(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined256331256335(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined256675256678(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined257129257132(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined257943257958_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .toggleStatus */ .bcundefined259292259295(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined259912259915(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined260286260289(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined261124261128(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined261374261377(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined261737261740(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined262602262605(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined262836262839(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined263248263252(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined263501263504(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined264723264726(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined265478265481(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined266192266195(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined266668266672(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined266928266931(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined267251267255(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined267501267505(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined267674267677(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined268082268085(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined269136269140(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined269309269312(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined269716269719(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined270873270877(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined271030271033(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined271389271392(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined271930271934(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined272289272293(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined272612272615(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined273116273120(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined273439273442(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined274083274086(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined275173275177(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined275330275333(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined275700275703(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined276764276768(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined276921276924(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined277289277292(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined278439278443(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined278596278599(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined278969278972(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined279325279329(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined280123280126(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined280472280475(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined280820280823(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined281168281171(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined281745281749(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined281902281905(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined282276282279(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined282633282636(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined287214287218(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined288214288217(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined288494288497(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined289264289267(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined289459289463(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined289702289705(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined290051290054(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined291287291291(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined291537291540(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined291884291888(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined292168292172(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined292341292344(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined292777292780(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined293329293332(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined293830293833(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined294540294543(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined295234295237(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined295419295423(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined295637295640(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined295794295797(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined296098296101(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined296403296407(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined297301297305(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined297557297560(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined298305298308(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined298595298598(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined /***/ }) €†buffer†source„size„maps„hash//***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ ProfilePage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7541); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(1592); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(9906); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(2982); /* harmony import */ var _components_CategoryIcon__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(5940); /* __next_internal_client_entry_do_not_use__ default auto */ function SpecialistCardEditor(param) { let { card, isOpen, onToggle, onUpdate, onDelete, categories, locationTree, catLocale, locale, hasPriceList, visibilityIssues = [], moderationNotice = null } = param; const { t } = (0,_context_locale__WEBPACK_IMPORTED_MODULE_4__/* .useLocale */ .Y)(); const hasVisibilityIssues = visibilityIssues.length > 0; const [cardTab, setCardTab] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)('main'); const [saving, setSaving] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [savedOk, setSavedOk] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [localTitle, setLocalTitle] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(card.title); var _card_descriptionEl; const [localDescEl, setLocalDescEl] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)((_card_descriptionEl = card.descriptionEl) !== null && _card_descriptionEl !== void 0 ? _card_descriptionEl : ''); var _card_descriptionEn; const [localDescEn, setLocalDescEn] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)((_card_descriptionEn = card.descriptionEn) !== null && _card_descriptionEn !== void 0 ? _card_descriptionEn : ''); var _card_descriptionRu; const [localDescRu, setLocalDescRu] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)((_card_descriptionRu = card.descriptionRu) !== null && _card_descriptionRu !== void 0 ? _card_descriptionRu : ''); var _card_descriptionUk; const [localDescUk, setLocalDescUk] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)((_card_descriptionUk = card.descriptionUk) !== null && _card_descriptionUk !== void 0 ? _card_descriptionUk : ''); var _card_skills; const [localSkills, setLocalSkills] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)((_card_skills = card.skills) !== null && _card_skills !== void 0 ? _card_skills : []); const [skillInput, setSkillInput] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); var _card_categories; const [localCategories, setLocalCategories] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)((_card_categories = card.categories) !== null && _card_categories !== void 0 ? _card_categories : []); var _card_locations; const [localLocations, setLocalLocations] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)((_card_locations = card.locations) !== null && _card_locations !== void 0 ? _card_locations : []); var _card_publicationStatus; const [localPublicationStatus, setLocalPublicationStatus] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)((_card_publicationStatus = card.publicationStatus) !== null && _card_publicationStatus !== void 0 ? _card_publicationStatus : card.isActive ? 'active' : 'inactive'); const [apiSkillSugs, setApiSkillSugs] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); var _card_portfolio; const [portfolio, setPortfolio] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)((_card_portfolio = card.portfolio) !== null && _card_portfolio !== void 0 ? _card_portfolio : []); const [portfolioUploading, setPortfolioUploading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [editingItem, setEditingItem] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [editTitle, setEditTitle] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [editDesc, setEditDesc] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const portfolioFileRef = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null); // Price list state const [priceList, setPriceList] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [priceListLoading, setPriceListLoading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [newGroupTitle, setNewGroupTitle] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [addingGroupId, setAddingGroupId] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [newItem, setNewItem] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)({ name: '', description: '', price: '', unit: '' }); const [editingGroupId, setEditingGroupId] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [editGroupTitle, setEditGroupTitle] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (cardTab !== 'pricelist' || priceList.length > 0 || priceListLoading) return; setPriceListLoading(true); _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getPriceList */ .Ck(card.id, locale).then(setPriceList).catch(()=>{}).finally(()=>setPriceListLoading(false)); }, [ cardTab, locale ]); async function handleAddGroup() { if (!newGroupTitle.trim()) return; const group = await _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .createPriceListGroup */ .vD(card.id, { title: newGroupTitle.trim(), locale: [ 'el', 'en', 'ru', 'uk' ].includes(locale) ? locale : 'el', autoTranslate: true }); setPriceList((prev)=>[ ...prev, group ]); setNewGroupTitle(''); } async function handleDeleteGroup(groupId) { await _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .deletePriceListGroup */ .Ic(groupId); setPriceList((prev)=>prev.filter((g)=>g.id !== groupId)); } async function handleSaveGroupTitle(groupId) { const updated = await _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .updatePriceListGroup */ .oD(groupId, { title: editGroupTitle.trim(), locale: [ 'el', 'en', 'ru', 'uk' ].includes(locale) ? locale : 'el', autoTranslate: true }); setPriceList((prev)=>prev.map((g)=>g.id === groupId ? { ...g, title: updated.title } : g)); setEditingGroupId(null); } async function handleAddItem(groupId) { if (!newItem.name.trim()) return; const item = await _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .createPriceListItem */ .Z2(groupId, { name: newItem.name.trim(), description: newItem.description.trim() || null, price: newItem.price.trim() || null, unit: newItem.unit.trim() || null, locale: [ 'el', 'en', 'ru', 'uk' ].includes(locale) ? locale : 'el', autoTranslate: true }); setPriceList((prev)=>prev.map((g)=>g.id === groupId ? { ...g, items: [ ...g.items, item ] } : g)); setNewItem({ name: '', description: '', price: '', unit: '' }); setAddingGroupId(null); } async function handleDeleteItem(itemId, groupId) { await _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .deletePriceListItem */ .U9(itemId); setPriceList((prev)=>prev.map((g)=>g.id === groupId ? { ...g, items: g.items.filter((i)=>i.id !== itemId) } : g)); } (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (cardTab !== 'skills') return; _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getSkillSuggestions */ .rl(localCategories.length > 0 ? localCategories : undefined).then(setApiSkillSugs).catch(()=>setApiSkillSugs([])); }, [ localCategories, cardTab ]); const lbl = (ru, en, el)=>locale === 'ru' ? ru : locale === 'en' ? en : el; async function saveAll() { setSaving(true); try { const activeLocale = [ 'el', 'en', 'ru', 'uk' ].includes(locale) ? locale : 'el'; const cap = activeLocale.charAt(0).toUpperCase() + activeLocale.slice(1); const descField = "description".concat(cap); const descValue = { el: localDescEl, en: localDescEn, ru: localDescRu, uk: localDescUk }[activeLocale] || null; const updated = await _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .updateSpecialistCard */ .zc(card.id, { title: localTitle, [descField]: descValue, descriptionLocale: activeLocale, autoTranslate: !!descValue, skills: localSkills, categories: localCategories, locations: localLocations, publicationStatus: localPublicationStatus, isActive: localPublicationStatus === 'active' }); onUpdate({ ...updated, portfolio }); setSavedOk(true); setTimeout(()=>setSavedOk(false), 2000); } catch (e) {} finally{ setSaving(false); } } async function updatePublicationStatus(next) { setLocalPublicationStatus(next); try { await _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .updateSpecialistCard */ .zc(card.id, { publicationStatus: next, isActive: next === 'active' }); } catch (e) {} } function addSkill(s) { const trimmed = s.trim(); if (trimmed && !localSkills.includes(trimmed)) setLocalSkills([ ...localSkills, trimmed ]); setSkillInput(''); } function toggleCategory(slug) { let childSlugs = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : []; if (localCategories.includes(slug)) { setLocalCategories(localCategories.filter((c)=>c !== slug && !childSlugs.includes(c))); } else { setLocalCategories([ ...new Set([ ...localCategories, slug, ...childSlugs ]) ]); } } function toggleLocation(slug) { let childSlugs = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : []; if (localLocations.includes(slug)) { setLocalLocations(localLocations.filter((c)=>c !== slug && !childSlugs.includes(c))); } else { setLocalLocations([ ...new Set([ ...localLocations, slug, ...childSlugs ]) ]); } } async function handlePortfolioUpload(e) { var _e_target_files; const file = (_e_target_files = e.target.files) === null || _e_target_files === void 0 ? void 0 : _e_target_files[0]; if (!file) return; setPortfolioUploading(true); try { const form = new FormData(); form.append('file', file); form.append('cardId', card.id); const res = await fetch("".concat("https://api.canhelp.gr" || 0, "/api/portfolio"), { method: 'POST', credentials: 'include', body: form }); if (!res.ok) throw new Error('Upload failed'); const item = await res.json(); const next = [ ...portfolio, item ]; setPortfolio(next); onUpdate({ ...card, portfolio: next }); } catch (e) {} finally{ setPortfolioUploading(false); if (portfolioFileRef.current) portfolioFileRef.current.value = ''; } } async function handlePortfolioDelete(id) { try { await _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .deletePortfolioItem */ .zB(id); const next = portfolio.filter((p)=>p.id !== id); setPortfolio(next); onUpdate({ ...card, portfolio: next }); } catch (e) {} } async function handlePortfolioSave(id) { try { const item = await _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .updatePortfolioItem */ .hl(id, { title: editTitle, description: editDesc }); setPortfolio((prev)=>prev.map((p)=>p.id === id ? item : p)); setEditingItem(null); } catch (e) {} } const cardTabs = [ { id: 'main', label: t('profile.card.tab.main') }, { id: 'categories', label: t('profile.card.tab.categories') }, { id: 'skills', label: t('profile.card.tab.skills') }, { id: 'geography', label: t('profile.card.tab.geography') }, { id: 'pricelist', label: t('profile.card.tab.pricelist'), hidden: !hasPriceList }, { id: 'portfolio', label: t('profile.card.tab.portfolio') } ]; const pendingReviewNotice = localPublicationStatus === 'pending' ? { title: t('profile.card.review_pending', 'Pending approval'), body: t('profile.card.review_pending_hint', 'Your card is being reviewed by the admin team.'), tone: 'amber' } : null; const effectiveModerationNotice = moderationNotice !== null && moderationNotice !== void 0 ? moderationNotice : pendingReviewNotice; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 overflow-hidden", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-3 px-4 py-3 border-b border-gray-100 ".concat(hasVisibilityIssues ? 'bg-amber-50' : ''), children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { type: "button", onClick: onToggle, className: "flex-1 flex items-center gap-3 text-left", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-sm font-semibold text-gray-800 flex-1", children: localTitle || card.title }), hasVisibilityIssues && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "inline-flex items-center justify-center w-5 h-5 rounded-full bg-amber-500 text-white text-xs font-bold", title: t('profile.card.visibility_issue', 'Card is not shown in offers'), children: "!" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-gray-400 text-xs", children: isOpen ? '▲' : 'â–Œ' }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>updatePublicationStatus(localPublicationStatus === 'active' ? 'inactive' : localPublicationStatus === 'pending' ? 'inactive' : 'pending'), className: "px-3 py-1.5 rounded-lg text-xs font-medium whitespace-nowrap ".concat(localPublicationStatus === 'active' ? 'bg-red-50 text-red-700 hover:bg-red-100' : localPublicationStatus === 'pending' ? 'bg-amber-50 text-amber-700 hover:bg-amber-100' : 'bg-green-50 text-green-700 hover:bg-green-100'), children: localPublicationStatus === 'active' ? t('profile.card.unpublish', 'Unpublish') : localPublicationStatus === 'pending' ? t('profile.card.withdraw_review', 'Withdraw request') : t('profile.card.submit_review', 'Submit for review') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: onDelete, className: "text-red-400 hover:text-red-600 text-sm px-1 flex-shrink-0", title: t('profile.card.delete'), children: "\uD83D\uDDD1" }) ] }), isOpen && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ hasVisibilityIssues && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "mx-4 mt-4 mb-2 rounded-lg border border-amber-300 bg-amber-50 p-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs font-semibold text-amber-900", children: t('profile.card.visibility_issue', 'Card is not shown in offers') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("ul", { className: "mt-1.5 list-disc pl-4 text-xs text-amber-900 space-y-0.5", children: visibilityIssues.map((issue)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("li", { children: issue }, issue)) }) ] }), effectiveModerationNotice && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "mx-4 mt-4 mb-2 rounded-lg border p-3 ".concat(effectiveModerationNotice.tone === 'green' ? 'border-green-300 bg-green-50' : effectiveModerationNotice.tone === 'red' ? 'border-red-300 bg-red-50' : 'border-amber-300 bg-amber-50'), children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs font-semibold ".concat(effectiveModerationNotice.tone === 'green' ? 'text-green-900' : effectiveModerationNotice.tone === 'red' ? 'text-red-900' : 'text-amber-900'), children: effectiveModerationNotice.title }), effectiveModerationNotice.body && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "mt-1 text-xs ".concat(effectiveModerationNotice.tone === 'green' ? 'text-green-800' : effectiveModerationNotice.tone === 'red' ? 'text-red-800' : 'text-amber-800'), children: effectiveModerationNotice.body }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex overflow-x-auto border-b border-gray-100 bg-gray-50 gap-0", children: cardTabs.filter((t)=>!t.hidden).map((t)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>setCardTab(t.id), className: "px-4 py-2.5 text-xs font-medium whitespace-nowrap border-b-2 transition -mb-px ".concat(cardTab === t.id ? 'border-green-500 text-green-600 bg-white' : 'border-transparent text-gray-500 hover:text-gray-700'), children: t.label }, t.id)) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "p-4", children: [ cardTab === 'main' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: localTitle, onChange: (e)=>setLocalTitle(e.target.value), maxLength: 200, placeholder: t('profile.cards.new_title'), 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" }), (()=>{ const activeLocale = [ 'el', 'en', 'ru', 'uk' ].includes(locale) ? locale : 'el'; const descMap = { el: [ localDescEl, setLocalDescEl ], en: [ localDescEn, setLocalDescEn ], ru: [ localDescRu, setLocalDescRu ], uk: [ localDescUk, setLocalDescUk ] }; const [val, setVal] = descMap[activeLocale]; const flags = { el: '🇬🇷', en: '🇬🇧', ru: '🇷🇺', uk: '🇺🇊' }; const otherLocales = [ 'el', 'en', 'ru', 'uk' ].filter((l)=>l !== activeLocale); const otherHasContent = otherLocales.some((l)=>descMap[l][0]); return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "flex items-center gap-1.5 text-xs font-medium text-gray-500 mb-1", children: [ flags[activeLocale], " ", t('profile.card.description', 'Description') ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("textarea", { value: val, onChange: (e)=>setVal(e.target.value), rows: 4, maxLength: 2000, placeholder: t('profile.bio.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" }), val && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400 mt-1", children: t('profile.card.desc_auto_translate', 'Will be automatically translated into other languages on save') }), otherHasContent && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-1.5 mt-1.5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-xs text-gray-400", children: t('profile.card.desc_translated', 'Translations available:') }), otherLocales.map((l)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-xs px-1.5 py-0.5 rounded-full ".concat(descMap[l][0] ? 'bg-green-50 text-green-600' : 'bg-gray-100 text-gray-400'), children: flags[l] }, l)) ] }) ] }); })() ] }), cardTab === 'skills' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-3", children: [ localSkills.length > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex flex-wrap gap-2", children: localSkills.map((s)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "flex items-center gap-1.5 bg-green-50 text-green-700 text-sm px-3 py-1 rounded-full", children: [ s, /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>setLocalSkills(localSkills.filter((x)=>x !== s)), className: "text-gray-400 hover:text-green-700 leading-none", children: "\xd7" }) ] }, s)) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: skillInput, onChange: (e)=>setSkillInput(e.target.value), onKeyDown: (e)=>{ if (e.key === 'Enter') { e.preventDefault(); addSkill(skillInput); } }, placeholder: t('profile.card.skill.add'), 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" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>addSkill(skillInput), className: "px-3 py-2 bg-gray-100 hover:bg-gray-200 rounded-lg text-sm font-medium", children: "+" }) ] }), apiSkillSugs.length > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex flex-wrap gap-1.5", children: apiSkillSugs.map((s)=>{ var _s_names_catLocale; return (_s_names_catLocale = s.names[catLocale]) !== null && _s_names_catLocale !== void 0 ? _s_names_catLocale : s.names.el; }).filter((name, i, arr)=>arr.indexOf(name) === i && !localSkills.includes(name)).slice(0, 16).map((name)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { type: "button", onClick: ()=>addSkill(name), className: "text-xs px-2.5 py-1 border border-gray-200 rounded-full text-gray-500 hover:border-green-400 hover:text-green-600 transition", children: [ "+ ", name ] }, name)) }) ] }), cardTab === 'categories' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "space-y-3", children: categories.map((cat)=>{ var _cat_names, _cat_names1; var _cat_names_catLocale, _ref; const catName = (_ref = (_cat_names_catLocale = (_cat_names = cat.names) === null || _cat_names === void 0 ? void 0 : _cat_names[catLocale]) !== null && _cat_names_catLocale !== void 0 ? _cat_names_catLocale : (_cat_names1 = cat.names) === null || _cat_names1 === void 0 ? void 0 : _cat_names1.el) !== null && _ref !== void 0 ? _ref : cat.slug; var _cat_children; const children = (_cat_children = cat.children) !== null && _cat_children !== void 0 ? _cat_children : []; const childSlugs = children.map((c)=>c.slug); return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "flex items-center gap-2.5 cursor-pointer", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "checkbox", checked: localCategories.includes(cat.slug), onChange: ()=>toggleCategory(cat.slug, childSlugs), className: "w-4 h-4 rounded border-gray-300 text-green-600 focus:ring-blue-400" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "text-sm font-medium text-gray-800 inline-flex items-center gap-1", children: [ cat.icon && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components_CategoryIcon__WEBPACK_IMPORTED_MODULE_6__/* .CategoryIcon */ .Ez, { icon: cat.icon, alt: catName, className: (0,_components_CategoryIcon__WEBPACK_IMPORTED_MODULE_6__/* .isCategoryIconUrl */ .V)(cat.icon) ? 'h-4 w-4 object-contain' : 'text-sm leading-none', fallback: "\uD83D\uDCE6" }), catName ] }) ] }), children.length > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "ml-6 mt-2 space-y-2", children: children.map((sub)=>{ var _sub_names, _sub_names1; var _sub_names_catLocale, _ref; const subName = (_ref = (_sub_names_catLocale = (_sub_names = sub.names) === null || _sub_names === void 0 ? void 0 : _sub_names[catLocale]) !== null && _sub_names_catLocale !== void 0 ? _sub_names_catLocale : (_sub_names1 = sub.names) === null || _sub_names1 === void 0 ? void 0 : _sub_names1.el) !== null && _ref !== void 0 ? _ref : sub.slug; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "flex items-center gap-2.5 cursor-pointer", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "checkbox", checked: localCategories.includes(sub.slug), onChange: ()=>toggleCategory(sub.slug), className: "w-4 h-4 rounded border-gray-300 text-green-600 focus:ring-blue-400" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-sm text-gray-600", children: subName }) ] }, sub.id); }) }) ] }, cat.id); }) }), cardTab === 'geography' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "space-y-3", children: locationTree.map((city)=>{ var _city_names, _city_names1; var _city_names_catLocale, _ref; const cityName = (_ref = (_city_names_catLocale = (_city_names = city.names) === null || _city_names === void 0 ? void 0 : _city_names[catLocale]) !== null && _city_names_catLocale !== void 0 ? _city_names_catLocale : (_city_names1 = city.names) === null || _city_names1 === void 0 ? void 0 : _city_names1.el) !== null && _ref !== void 0 ? _ref : city.slug; var _city_children; const districts = (_city_children = city.children) !== null && _city_children !== void 0 ? _city_children : []; const districtSlugs = districts.map((d)=>d.slug); return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "flex items-center gap-2.5 cursor-pointer", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "checkbox", checked: localLocations.includes(city.slug), onChange: ()=>toggleLocation(city.slug, districtSlugs), className: "w-4 h-4 rounded border-gray-300 text-green-600 focus:ring-blue-400" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-sm font-medium text-gray-800", children: cityName }) ] }), districts.length > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "ml-6 mt-2 space-y-2", children: districts.map((d)=>{ var _d_names, _d_names1; var _d_names_catLocale, _ref; const dName = (_ref = (_d_names_catLocale = (_d_names = d.names) === null || _d_names === void 0 ? void 0 : _d_names[catLocale]) !== null && _d_names_catLocale !== void 0 ? _d_names_catLocale : (_d_names1 = d.names) === null || _d_names1 === void 0 ? void 0 : _d_names1.el) !== null && _ref !== void 0 ? _ref : d.slug; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "flex items-center gap-2.5 cursor-pointer", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "checkbox", checked: localLocations.includes(d.slug), onChange: ()=>toggleLocation(d.slug), className: "w-4 h-4 rounded border-gray-300 text-green-600 focus:ring-blue-400" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-sm text-gray-600", children: dName }) ] }, d.id); }) }) ] }, city.id); }) }), cardTab === 'pricelist' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "space-y-4", children: priceListLoading ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-center py-6 text-gray-400 text-sm", children: t('common.loading', 'Loading...') }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [ priceList.length === 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-center py-6 text-gray-400 text-sm border-2 border-dashed border-gray-200 rounded-xl", children: t('profile.card.pricelist.empty') }), priceList.map((group)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "border border-gray-200 rounded-xl overflow-hidden", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex items-center gap-2 bg-gray-50 px-4 py-2.5 border-b border-gray-200", children: editingGroupId === group.id ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: editGroupTitle, onChange: (e)=>setEditGroupTitle(e.target.value), className: "flex-1 border border-gray-300 rounded-lg px-3 py-1.5 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400", onKeyDown: (e)=>{ if (e.key === 'Enter') handleSaveGroupTitle(group.id); }, autoFocus: true }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>handleSaveGroupTitle(group.id), className: "px-3 py-1.5 bg-green-600 text-white rounded-lg text-xs font-medium hover:bg-green-700", children: t('profile.card.pricelist.save_group') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>setEditingGroupId(null), className: "px-2 py-1.5 text-gray-500 hover:text-gray-700 text-xs", children: "✕" }) ] }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "flex-1 font-semibold text-sm text-gray-800", children: group.title }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>{ setEditingGroupId(group.id); setEditGroupTitle(group.title); }, className: "text-gray-400 hover:text-green-600 text-xs px-2 py-1 rounded hover:bg-green-50", children: "✏" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>handleDeleteGroup(group.id), className: "text-gray-400 hover:text-red-500 text-xs px-2 py-1 rounded hover:bg-red-50", children: t('profile.card.pricelist.delete_group') }) ] }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "divide-y divide-gray-100", children: group.items.map((item)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-3 px-4 py-2.5 text-sm group", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "font-medium text-gray-800 truncate", children: item.name }), item.description && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-500 truncate", children: item.description }) ] }), (item.price || item.unit) && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "text-green-700 font-semibold text-sm whitespace-nowrap", children: [ item.price ? "€".concat(item.price) : '', item.unit ? " ".concat(item.unit) : '' ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>handleDeleteItem(item.id, group.id), className: "opacity-0 group-hover:opacity-100 text-red-400 hover:text-red-600 text-xs px-1 transition", children: t('profile.card.pricelist.delete_item') }) ] }, item.id)) }), addingGroupId === group.id ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "p-3 bg-green-50 border-t border-green-100 space-y-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { placeholder: t('profile.card.pricelist.item_name'), value: newItem.name, onChange: (e)=>setNewItem((p)=>({ ...p, name: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { placeholder: t('profile.card.pricelist.item_desc'), value: newItem.description, onChange: (e)=>setNewItem((p)=>({ ...p, description: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { placeholder: t('profile.card.pricelist.item_price'), value: newItem.price, onChange: (e)=>setNewItem((p)=>({ ...p, price: e.target.value })), className: "w-28 border border-gray-300 rounded-lg px-3 py-1.5 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { placeholder: t('profile.card.pricelist.item_unit'), value: newItem.unit, onChange: (e)=>setNewItem((p)=>({ ...p, unit: e.target.value })), className: "flex-1 border border-gray-300 rounded-lg px-3 py-1.5 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>handleAddItem(group.id), className: "px-4 py-1.5 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700", children: t('profile.card.pricelist.save_item') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>{ setAddingGroupId(null); setNewItem({ name: '', description: '', price: '', unit: '' }); }, className: "px-3 py-1.5 text-gray-500 hover:text-gray-700 text-sm", children: "✕" }) ] }) ] }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "px-4 py-2 border-t border-gray-100", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { type: "button", onClick: ()=>setAddingGroupId(group.id), className: "text-green-600 hover:text-gray-800 text-sm font-medium", children: [ "+ ", t('profile.card.pricelist.add_item') ] }) }) ] }, group.id)), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-2 pt-1", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { placeholder: t('profile.card.pricelist.group_title'), value: newGroupTitle, onChange: (e)=>setNewGroupTitle(e.target.value), onKeyDown: (e)=>{ if (e.key === 'Enter') handleAddGroup(); }, 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" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: handleAddGroup, className: "px-4 py-2 bg-green-600 hover:bg-green-700 text-white rounded-lg text-sm font-medium", children: t('profile.card.pricelist.add_group') }) ] }) ] }) }), cardTab === 'portfolio' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-3", children: [ portfolio.length < 20 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>{ var _portfolioFileRef_current; return (_portfolioFileRef_current = portfolioFileRef.current) === null || _portfolioFileRef_current === void 0 ? void 0 : _portfolioFileRef_current.click(); }, disabled: portfolioUploading, className: "flex items-center gap-2 px-4 py-2 bg-green-600 hover:bg-green-700 text-white rounded-lg text-sm font-medium disabled:opacity-50", children: portfolioUploading ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "w-4 h-4 border-2 border-white border-t-transparent rounded-full animate-spin" }), t('profile.card.photo.uploading') ] }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [ "\uD83D\uDCF7 ", t('profile.card.photo.add') ] }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { ref: portfolioFileRef, type: "file", accept: "image/jpeg,image/png,image/webp", className: "hidden", onChange: handlePortfolioUpload }) ] }), portfolio.length === 0 ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-center py-8 text-gray-400 text-sm border-2 border-dashed border-gray-200 rounded-xl", children: t('profile.card.photo.empty') }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "grid grid-cols-2 sm:grid-cols-3 gap-3", children: portfolio.map((item)=>{ var _item_title; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "group relative rounded-xl overflow-hidden border border-gray-200 bg-gray-50", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: item.imageUrl, alt: (_item_title = item.title) !== null && _item_title !== void 0 ? _item_title : '', className: "w-full aspect-square object-cover" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "absolute inset-0 bg-black/0 group-hover:bg-black/50 transition-all flex flex-col justify-between p-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>handlePortfolioDelete(item.id), className: "self-end opacity-0 group-hover:opacity-100 transition w-7 h-7 rounded-full bg-red-500 text-white text-sm flex items-center justify-center hover:bg-red-600", children: "\xd7" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { type: "button", onClick: ()=>{ setEditingItem(item); var _item_title; setEditTitle((_item_title = item.title) !== null && _item_title !== void 0 ? _item_title : ''); var _item_description; setEditDesc((_item_description = item.description) !== null && _item_description !== void 0 ? _item_description : ''); }, className: "opacity-0 group-hover:opacity-100 transition text-xs text-white bg-black/50 hover:bg-black/70 rounded-lg px-2 py-1", children: [ "✏ ", t('profile.card.item.edit') ] }) ] }), item.title && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "px-2 py-1.5", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs font-medium text-gray-700 truncate", children: item.title }) }) ] }, item.id); }) }) ] }), cardTab !== 'portfolio' && cardTab !== 'pricelist' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-3 mt-4 pt-4 border-t border-gray-100", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", disabled: saving, onClick: saveAll, className: "px-5 py-2 bg-green-600 hover:bg-green-700 text-white rounded-lg text-sm font-semibold disabled:opacity-50", children: saving ? '...' : t('profile.card.save') }), savedOk && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "text-sm text-green-600", children: [ "✓ ", t('profile.card.saved') ] }) ] }) ] }) ] }), editingItem && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "fixed inset-0 z-50 flex items-center justify-center bg-black/50 px-4", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-2xl shadow-xl p-6 w-full max-w-md", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h3", { className: "font-semibold text-gray-800 mb-4", children: t('profile.card.item.edit') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: editingItem.imageUrl, alt: "", className: "w-full h-40 object-cover rounded-xl mb-4" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('profile.card.item.title') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: editTitle, onChange: (e)=>setEditTitle(e.target.value), maxLength: 200, 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" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('profile.card.item.desc') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("textarea", { value: editDesc, onChange: (e)=>setEditDesc(e.target.value), rows: 3, maxLength: 1000, 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" }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-3 mt-5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>handlePortfolioSave(editingItem.id), className: "flex-1 bg-green-600 hover:bg-green-700 text-white py-2 rounded-lg text-sm font-medium", children: t('profile.card.item.save') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>setEditingItem(null), className: "flex-1 bg-gray-100 hover:bg-gray-200 text-gray-700 py-2 rounded-lg text-sm font-medium", children: t('profile.card.item.cancel') }) ] }) ] }) }) ] }); } // ─── AutoResponseTab ─────────────────────────────────────────────────────── function AutoResponseTab(param) { let { categories, locationTree, loaded, onLoad, settings, saving, saved, onSave, t, catLocale } = param; const { useEffect: _ue, useState: _us } = { useEffect: react__WEBPACK_IMPORTED_MODULE_1__.useEffect, useState: react__WEBPACK_IMPORTED_MODULE_1__.useState }; const [enabled, setEnabled] = _us(false); const [minBudget, setMinBudget] = _us(''); const [maxBudget, setMaxBudget] = _us(''); const [defaultPrice, setDefaultPrice] = _us(''); const [defaultMessage, setDefaultMessage] = _us(''); const [maxPerDay, setMaxPerDay] = _us(''); const [selCategories, setSelCategories] = _us([]); const [selLocations, setSelLocations] = _us([]); _ue(()=>{ onLoad(); }, []); _ue(()=>{ if (!settings) return; setEnabled(settings.enabled); setMinBudget(settings.minBudget != null ? String(settings.minBudget) : ''); setMaxBudget(settings.maxBudget != null ? String(settings.maxBudget) : ''); setDefaultPrice(settings.defaultPrice != null ? String(settings.defaultPrice) : ''); var _settings_defaultMessage; setDefaultMessage((_settings_defaultMessage = settings.defaultMessage) !== null && _settings_defaultMessage !== void 0 ? _settings_defaultMessage : ''); setMaxPerDay(settings.maxAutoOffersPerDay != null ? String(settings.maxAutoOffersPerDay) : ''); var _settings_categories; setSelCategories((_settings_categories = settings.categories) !== null && _settings_categories !== void 0 ? _settings_categories : []); var _settings_locations; setSelLocations((_settings_locations = settings.locations) !== null && _settings_locations !== void 0 ? _settings_locations : []); }, [ settings ]); if (!loaded) return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-center py-10 text-white/60", children: t('common.loading') }); const flatLocations = []; function flatten(nodes) { for (const n of nodes){ var _n_children; flatLocations.push({ id: n.id, name: n.name }); if ((_n_children = n.children) === null || _n_children === void 0 ? void 0 : _n_children.length) flatten(n.children); } } flatten(locationTree); return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "bg-white rounded-xl border border-gray-200 p-5", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "flex items-center justify-between cursor-pointer", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "font-medium text-gray-800", children: t('auto_response.title', 'Auto response') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400 mt-0.5", children: t('auto_response.desc', 'Automatically respond to matching tasks') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>setEnabled((v)=>!v), className: "relative inline-flex h-6 w-11 items-center rounded-full transition-colors ".concat(enabled ? 'bg-green-500' : 'bg-gray-300'), children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "inline-block h-4 w-4 transform rounded-full bg-white shadow transition-transform ".concat(enabled ? 'translate-x-6' : 'translate-x-1') }) }) ] }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-5 space-y-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h3", { className: "font-medium text-gray-800 text-sm", children: t('auto_response.budget_range', 'Task budget') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "grid grid-cols-2 gap-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs text-gray-500 mb-1", children: t('auto_response.min_budget', 'Min €') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "number", min: "0", value: minBudget, onChange: (e)=>setMinBudget(e.target.value), placeholder: "0", 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" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs text-gray-500 mb-1", children: t('auto_response.max_budget', 'Max €') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "number", min: "0", value: maxBudget, onChange: (e)=>setMaxBudget(e.target.value), placeholder: "∞", className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs text-gray-500 mb-1", children: t('auto_response.default_price', 'Default price €') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "number", min: "0", value: defaultPrice, onChange: (e)=>setDefaultPrice(e.target.value), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs text-gray-500 mb-1", children: t('auto_response.max_per_day', 'Max auto-offers/day') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "number", min: "1", max: "50", value: maxPerDay, onChange: (e)=>setMaxPerDay(e.target.value), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs text-gray-500 mb-1", children: t('auto_response.default_message', 'Auto-response text') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("textarea", { value: defaultMessage, onChange: (e)=>setDefaultMessage(e.target.value), rows: 4, maxLength: 2000, placeholder: t('auto_response.message_placeholder', 'Hello! I can help with this task...'), 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" }) ] }), categories.length > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h3", { className: "font-medium text-gray-800 text-sm mb-3", children: t('auto_response.categories', 'Task categories') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex flex-wrap gap-2 max-h-40 overflow-y-auto", children: categories.flatMap((cat)=>{ var _cat_children; return [ cat, ...(_cat_children = cat.children) !== null && _cat_children !== void 0 ? _cat_children : [] ]; }).map((cat)=>{ var _cat_names, _cat_names1; var _cat_names_catLocale, _ref; const name = (_ref = (_cat_names_catLocale = (_cat_names = cat.names) === null || _cat_names === void 0 ? void 0 : _cat_names[catLocale]) !== null && _cat_names_catLocale !== void 0 ? _cat_names_catLocale : (_cat_names1 = cat.names) === null || _cat_names1 === void 0 ? void 0 : _cat_names1.el) !== null && _ref !== void 0 ? _ref : cat.slug; const sel = selCategories.includes(cat.slug); return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>setSelCategories(sel ? selCategories.filter((c)=>c !== cat.slug) : [ ...selCategories, cat.slug ]), className: "px-3 py-1.5 rounded-lg text-xs border transition ".concat(sel ? 'bg-green-600 border-green-600 text-white' : 'bg-white border-gray-300 text-gray-700 hover:border-green-400'), children: name }, cat.slug); }) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", disabled: saving, onClick: ()=>onSave({ enabled, minBudget: minBudget ? Number(minBudget) : null, maxBudget: maxBudget ? Number(maxBudget) : null, defaultPrice: defaultPrice ? Number(defaultPrice) : null, defaultMessage: defaultMessage || null, maxAutoOffersPerDay: maxPerDay ? Number(maxPerDay) : null, categories: selCategories.length > 0 ? selCategories : null, locations: selLocations.length > 0 ? selLocations : null }), className: "w-full bg-green-600 text-white py-3 rounded-xl font-semibold hover:bg-green-700 disabled:opacity-50", children: saving ? t('common.loading') : saved ? t('auto_response.saved', 'Saved ✓') : t('common.save') }) ] }); } function ProfilePage() { return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(react__WEBPACK_IMPORTED_MODULE_1__.Suspense, { fallback: null, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(ProfilePageInner, {}) }); } function ProfilePageInner() { var _user_firstName, _user_lastName, _dashData_features, _dashData_features1, _dashData_features2, _user_plan, _user_plan1, _user_plan2, _dashData_features3, _dashData_features4, _dashData_plan, _dashData_plan1, _user_plan3; const router = (0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)(); const searchParams = (0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useSearchParams)(); const { data: session, isPending } = (0,_lib_auth__WEBPACK_IMPORTED_MODULE_3__/* .useSession */ .wV)(); const { t, locale } = (0,_context_locale__WEBPACK_IMPORTED_MODULE_4__/* .useLocale */ .Y)(); const validTabs = [ 'info', 'finance', 'cards', 'notifications', 'reviews', 'referral', 'auto_response', 'site' ]; var _searchParams_get; const initialTab = (_searchParams_get = searchParams.get('tab')) !== null && _searchParams_get !== void 0 ? _searchParams_get : 'info'; const [activeTab, setActiveTab] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(validTabs.includes(initialTab) ? initialTab : 'info'); const [user, setUser] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [loading, setLoading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(true); const [saving, setSaving] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [saved, setSaved] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [error, setError] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [formData, setFormData] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)({ firstName: '', lastName: '', phone: '', bio: '', locale: 'el' }); const [selectedLanguages, setSelectedLanguages] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); // Specialist cards const [cards, setCards] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [maxCards, setMaxCards] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(1); const [cardsLoading, setCardsLoading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [cardNotifications, setCardNotifications] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [openCardId, setOpenCardId] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [creatingCard, setCreatingCard] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [newCardTitle, setNewCardTitle] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [showNewCardForm, setShowNewCardForm] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [showUpgradeModal, setShowUpgradeModal] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); // Reference data const [categories, setCategories] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [locationTree, setLocationTree] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); // Become specialist const [becomingSpecialist, setBecomingSpecialist] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [avatarUploading, setAvatarUploading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [backgroundUploading, setBackgroundUploading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const fileRef = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null); const backgroundFileRef = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null); // Notification preferences const [notifyNewTasks, setNotifyNewTasks] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [notifMessages, setNotifMessages] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(true); const [notifySaving, setNotifySaving] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [notifySaved, setNotifySaved] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); // Email verification resend const [resendState, setResendState] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)('idle'); // Referral info const [referralCode, setReferralCode] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [referralCount, setReferralCount] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(0); const [referralCopied, setReferralCopied] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [referralLoaded, setReferralLoaded] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); // Balance top-up modal const [showTopUpModal, setShowTopUpModal] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [topUpAmount, setTopUpAmount] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(10); const [topUpLoading, setTopUpLoading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [topUpError, setTopUpError] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [balanceHistory, setBalanceHistory] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [planHistory, setPlanHistory] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); // Plan data + statuses const [dashData, setDashData] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [myStatuses, setMyStatuses] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [statusToggling, setStatusToggling] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [personalSiteSlug, setPersonalSiteSlug] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [slugSaving, setSlugSaving] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [slugSaved, setSlugSaved] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [slugCopied, setSlugCopied] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [slugError, setSlugError] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [showContactInfo, setShowContactInfo] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [siteSettings, setSiteSettings] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)({}); const [siteSettingsSaving, setSiteSettingsSaving] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [siteStats, setSiteStats] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [siteStatsLoading, setSiteStatsLoading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [autoResponse, setAutoResponse] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [arLoaded, setArLoaded] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [arSaving, setArSaving] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [arSaved, setArSaved] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); async function handleTopUp() { const amount = Number(topUpAmount); if (!amount || amount < 1) return; setTopUpLoading(true); setTopUpError(''); try { const { url, params } = await _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .initiateTopUp */ .oh(amount); // Build and auto-submit form to ePay const form = document.createElement('form'); form.method = 'POST'; form.action = url; Object.entries(params).forEach((param)=>{ let [k, v] = param; const input = document.createElement('input'); input.type = 'hidden'; input.name = k; input.value = v; form.appendChild(input); }); document.body.appendChild(form); form.submit(); } catch (e) { setTopUpError((e === null || e === void 0 ? void 0 : e.message) || t('profile.balance.topup.error')); setTopUpLoading(false); } } async function handleResendVerification() { if (!(user === null || user === void 0 ? void 0 : user.email) || resendState !== 'idle') return; setResendState('sending'); const callbackURL = "".concat(window.location.origin, "/profile"); const result = await _lib_auth__WEBPACK_IMPORTED_MODULE_3__/* .authClient */ .yK.sendVerificationEmail({ email: user.email, callbackURL }); if (result === null || result === void 0 ? void 0 : result.error) { setResendState('idle'); } else { setResendState('sent'); } } (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (activeTab !== 'referral' || referralLoaded) return; _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getMyReferralInfo */ .st().then((r)=>{ setReferralCode(r.referralCode); setReferralCount(r.referralCount); }).catch(()=>{}).finally(()=>setReferralLoaded(true)); }, [ activeTab ]); // Reviews const [myReviews, setMyReviews] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [reviewsLoading, setReviewsLoading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [myRating, setMyRating] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (activeTab !== 'reviews' || myReviews !== null || reviewsLoading) return; setReviewsLoading(true); _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getMyReviews */ .q7().then(setMyReviews).catch(()=>setMyReviews([])).finally(()=>setReviewsLoading(false)); }, [ activeTab ]); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (activeTab !== 'site' || siteStats !== null || siteStatsLoading) return; setSiteStatsLoading(true); _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getSiteStats */ .RN().then((res)=>setSiteStats(res.days)).catch(()=>setSiteStats([])).finally(()=>setSiteStatsLoading(false)); }, [ activeTab ]); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!isPending && !session) router.push('/login'); }, [ session, isPending ]); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!session) return; Promise.all([ _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Em('/users/me'), _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getCategories */ .bW(), _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getLocations */ .Vs(), _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getMyDashboard */ .H().catch(()=>null), _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getMyStatuses */ .z6().catch(()=>[]), _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getBalanceHistory */ .fm(8).catch(()=>[]), _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getPlanHistory */ .ew(20).catch(()=>[]) ]).then((param)=>{ let [u, cats, locs, dash, statusRes, history, phist] = param; setUser(u); var _u_firstName, _u_lastName, _u_phone, _u_bio, _u_locale; setFormData({ firstName: (_u_firstName = u.firstName) !== null && _u_firstName !== void 0 ? _u_firstName : '', lastName: (_u_lastName = u.lastName) !== null && _u_lastName !== void 0 ? _u_lastName : '', phone: (_u_phone = u.phone) !== null && _u_phone !== void 0 ? _u_phone : '', bio: (_u_bio = u.bio) !== null && _u_bio !== void 0 ? _u_bio : '', locale: (_u_locale = u.locale) !== null && _u_locale !== void 0 ? _u_locale : 'el' }); var _u_languages; setSelectedLanguages((_u_languages = u.languages) !== null && _u_languages !== void 0 ? _u_languages : []); var _u_notifyNewTasks; setNotifyNewTasks((_u_notifyNewTasks = u.notifyNewTasks) !== null && _u_notifyNewTasks !== void 0 ? _u_notifyNewTasks : false); var _u_notifMessages; setNotifMessages((_u_notifMessages = u.notifMessages) !== null && _u_notifMessages !== void 0 ? _u_notifMessages : true); setCategories(cats); setLocationTree(locs); setDashData(dash); setMyStatuses((statusRes !== null && statusRes !== void 0 ? statusRes : []).filter((s)=>s.isActive).map((s)=>s.statusType)); setBalanceHistory(history); setPlanHistory(phist); var _u_personalSiteSlug; setPersonalSiteSlug((_u_personalSiteSlug = u.personalSiteSlug) !== null && _u_personalSiteSlug !== void 0 ? _u_personalSiteSlug : ''); var _u_showContactInfo; setShowContactInfo((_u_showContactInfo = u.showContactInfo) !== null && _u_showContactInfo !== void 0 ? _u_showContactInfo : false); var _u_siteSettings; setSiteSettings((_u_siteSettings = u.siteSettings) !== null && _u_siteSettings !== void 0 ? _u_siteSettings : {}); loadCards(); _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getUserRating */ .Bm(u.id).then((r)=>setMyRating(r.avg)).catch(()=>{}); }).catch(()=>{}).finally(()=>setLoading(false)); }, [ session ]); async function loadCards() { setCardsLoading(true); try { const { cards: c, maxCards: m } = await _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getMySpecialistCards */ .Bb(); setCards(c); setMaxCards(m); setOpenCardId((prev)=>{ var _c_; var _c__id; return prev && c.some((card)=>card.id === prev) ? prev : (_c__id = (_c_ = c[0]) === null || _c_ === void 0 ? void 0 : _c_.id) !== null && _c__id !== void 0 ? _c__id : null; }); _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getNotifications */ .Tr().then((rows)=>setCardNotifications(rows.filter((row)=>[ 'specialist_card_submitted', 'specialist_card_approved', 'specialist_card_rejected' ].includes(row.type)))).catch(()=>setCardNotifications([])); } catch (e) {} finally{ setCardsLoading(false); } } async function handleSubmit(e) { e.preventDefault(); setError(''); setSaving(true); try { const updated = await _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Em('/users/me', { method: 'PATCH', body: JSON.stringify({ firstName: formData.firstName, lastName: formData.lastName, phone: formData.phone || undefined, bio: formData.bio || undefined, bioLocale: formData.locale, autoTranslateBio: true, locale: formData.locale, languages: selectedLanguages, showContactInfo }) }); setUser(updated); setSaved(true); setTimeout(()=>setSaved(false), 2500); } catch (err) { setError(err.message || t('common.error')); } finally{ setSaving(false); } } async function handleBecomeSpecialist() { setBecomingSpecialist(true); setError(''); try { const updated = await _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Em('/users/me/become-specialist', { method: 'POST' }); setUser(updated); setActiveTab('cards'); loadCards(); } catch (err) { setError(err.message || t('common.error')); } finally{ setBecomingSpecialist(false); } } async function handleSaveSiteSlug() { setSlugSaving(true); setSlugError(''); try { const updated = await _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Em('/users/me', { method: 'PATCH', body: JSON.stringify({ personalSiteSlug: personalSiteSlug || null }) }); setUser(updated); var _updated_personalSiteSlug; setPersonalSiteSlug((_updated_personalSiteSlug = updated.personalSiteSlug) !== null && _updated_personalSiteSlug !== void 0 ? _updated_personalSiteSlug : ''); setSlugSaved(true); setTimeout(()=>setSlugSaved(false), 2500); } catch (err) { var _err_code; const code = (_err_code = err === null || err === void 0 ? void 0 : err.code) !== null && _err_code !== void 0 ? _err_code : ''; if (code === 'SLUG_TAKEN' || err.message === 'This URL is already taken') { setSlugError(t('profile.site.slug_taken', 'This address is already taken')); } else { setSlugError(err.message || t('common.error')); } } finally{ setSlugSaving(false); } } async function handleSaveSiteSettings(newSettings) { setSiteSettings(newSettings); setSiteSettingsSaving(true); try { await _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Em('/users/me', { method: 'PATCH', body: JSON.stringify({ siteSettings: newSettings }) }); } catch (e) {} finally{ setSiteSettingsSaving(false); } } async function handleAvatarChange(e) { var _e_target_files; const file = (_e_target_files = e.target.files) === null || _e_target_files === void 0 ? void 0 : _e_target_files[0]; if (!file) return; setAvatarUploading(true); try { const form = new FormData(); form.append('file', file); const res = await fetch("".concat("https://api.canhelp.gr" || 0, "/api/uploads"), { method: 'POST', credentials: 'include', body: form }); if (!res.ok) throw new Error('Upload failed'); const { url } = await res.json(); const fullUrl = "".concat("https://api.canhelp.gr" || 0).concat(url); await _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Em('/users/me', { method: 'PATCH', body: JSON.stringify({ image: fullUrl }) }); setUser((prev)=>({ ...prev, image: fullUrl })); } catch (e) { setError(t('profile.upload.error')); } finally{ setAvatarUploading(false); } } async function handleBackgroundChange(e) { var _e_target_files; const file = (_e_target_files = e.target.files) === null || _e_target_files === void 0 ? void 0 : _e_target_files[0]; if (!file) return; setBackgroundUploading(true); try { const form = new FormData(); form.append('file', file); const res = await fetch("".concat("https://api.canhelp.gr" || 0, "/api/uploads"), { method: 'POST', credentials: 'include', body: form }); if (!res.ok) throw new Error('Upload failed'); const { url } = await res.json(); const fullUrl = "".concat("https://api.canhelp.gr" || 0).concat(url); const nextSettings = { ...siteSettings, profileBackgroundImage: fullUrl }; await _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Em('/users/me', { method: 'PATCH', body: JSON.stringify({ siteSettings: nextSettings }) }); setSiteSettings(nextSettings); setSaved(true); setTimeout(()=>setSaved(false), 2500); } catch (e) { setError(t('profile.upload.error')); } finally{ setBackgroundUploading(false); if (backgroundFileRef.current) backgroundFileRef.current.value = ''; } } async function handleRemoveBackground() { setBackgroundUploading(true); try { const nextSettings = { ...siteSettings, profileBackgroundImage: null }; await _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Em('/users/me', { method: 'PATCH', body: JSON.stringify({ siteSettings: nextSettings }) }); setSiteSettings(nextSettings); setSaved(true); setTimeout(()=>setSaved(false), 2500); } catch (e) { setError(t('profile.upload.error')); } finally{ setBackgroundUploading(false); } } async function handleCreateCard() { if (!newCardTitle.trim()) return; setCreatingCard(true); try { const card = await _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .createSpecialistCard */ .eR({ title: newCardTitle.trim() }); setCards((prev)=>[ ...prev, card ]); setOpenCardId(card.id); setNewCardTitle(''); setShowNewCardForm(false); } catch (err) { setError(err.message || t('common.error')); } finally{ setCreatingCard(false); } } async function handleDeleteCard(id) { if (!confirm(t('profile.cards.delete_confirm'))) return; try { await _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .deleteSpecialistCard */ .f5(id); setCards((prev)=>{ var _next_; const next = prev.filter((c)=>c.id !== id); var _next__id; if (openCardId === id) setOpenCardId((_next__id = (_next_ = next[0]) === null || _next_ === void 0 ? void 0 : _next_.id) !== null && _next__id !== void 0 ? _next__id : null); return next; }); } catch (err) { setError(err.message || t('common.error')); } } if (isPending || loading) { return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-center py-20 text-white", children: t('common.loading') }); } const catLocale = locale === 'en' ? 'en' : locale === 'ru' ? 'ru' : locale === 'uk' ? 'uk' : 'el'; const dateLocale = locale === 'en' ? 'en-US' : locale === 'ru' ? 'ru-RU' : 'el-GR'; const isSpecialist = (user === null || user === void 0 ? void 0 : user.role) === 'specialist'; const isAdmin = (user === null || user === void 0 ? void 0 : user.role) === 'admin'; const showSpecialistTabs = isSpecialist || isAdmin; var _user_firstName_, _user_lastName_; const initials = user ? "".concat((_user_firstName_ = (_user_firstName = user.firstName) === null || _user_firstName === void 0 ? void 0 : _user_firstName[0]) !== null && _user_firstName_ !== void 0 ? _user_firstName_ : '').concat((_user_lastName_ = (_user_lastName = user.lastName) === null || _user_lastName === void 0 ? void 0 : _user_lastName[0]) !== null && _user_lastName_ !== void 0 ? _user_lastName_ : '').toUpperCase() : '?'; const hasAutoResponse = !!(dashData === null || dashData === void 0 ? void 0 : (_dashData_features = dashData.features) === null || _dashData_features === void 0 ? void 0 : _dashData_features.hasAutoResponse); var _formData_bio, _ref; const profileBio = String((_ref = (_formData_bio = formData.bio) !== null && _formData_bio !== void 0 ? _formData_bio : user === null || user === void 0 ? void 0 : user.bio) !== null && _ref !== void 0 ? _ref : '').trim(); const publishedCards = cards.filter((c)=>{ var _c_publicationStatus; return ((_c_publicationStatus = c.publicationStatus) !== null && _c_publicationStatus !== void 0 ? _c_publicationStatus : c.isActive ? 'active' : 'inactive') === 'active'; }); const hasPublishedCard = publishedCards.length > 0; const hasCardCategories = publishedCards.some((c)=>{ var _c_categories; var _c_categories_length; return ((_c_categories_length = (_c_categories = c.categories) === null || _c_categories === void 0 ? void 0 : _c_categories.length) !== null && _c_categories_length !== void 0 ? _c_categories_length : 0) > 0; }); const hasCardLocations = publishedCards.some((c)=>{ var _c_locations; var _c_locations_length; return ((_c_locations_length = (_c_locations = c.locations) === null || _c_locations === void 0 ? void 0 : _c_locations.length) !== null && _c_locations_length !== void 0 ? _c_locations_length : 0) > 0; }); const moderationNoticeByCardId = cardNotifications.reduce((acc, row)=>{ if (!row.referenceId || acc[row.referenceId]) return acc; const tone = row.type === 'specialist_card_approved' ? 'green' : row.type === 'specialist_card_rejected' ? 'red' : 'amber'; const localizedTitle = row.type === 'specialist_card_approved' ? t('profile.card.review_approved', 'Card approved') : row.type === 'specialist_card_rejected' ? t('profile.card.review_rejected', 'Card rejected') : t('profile.card.review_pending', 'Pending approval'); const localizedBody = row.type === 'specialist_card_approved' ? t('profile.card.review_approved_hint', 'Your card is now visible in offers.') : row.type === 'specialist_card_rejected' ? t('profile.card.review_rejected_hint', 'Your card was not approved. Please update it and submit again.') : t('profile.card.review_pending_hint', 'Your card is being reviewed by the admin team.'); acc[row.referenceId] = { title: localizedTitle, body: localizedBody, tone }; return acc; }, {}); const listingMissing = []; if (!profileBio) listingMissing.push(t('profile.listing_requirements.bio', 'Add a short bio in the main profile section')); if (!hasPublishedCard) listingMissing.push(t('profile.listing_requirements.published_card', 'Publish at least one card')); if (!hasCardCategories) listingMissing.push(t('profile.listing_requirements.categories', 'Add at least one category to the published card')); if (!hasCardLocations) listingMissing.push(t('profile.listing_requirements.locations', 'Add at least one location to the published card')); const tabNeedsAttention = { info: !profileBio, cards: listingMissing.length > 0 }; const tabIcons = { info: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15.75 6a3.75 3.75 0 11-7.5 0 3.75 3.75 0 017.5 0zM4.501 20.118a7.5 7.5 0 0114.998 0A17.933 17.933 0 0112 21.75c-2.676 0-5.216-.584-7.499-1.632z" }) }), finance: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 6v12m-3-2.818l.879.659c1.171.879 3.07.879 4.242 0 1.172-.879 1.172-2.303 0-3.182C13.536 12.219 12.768 12 12 12c-.725 0-1.45-.22-2.003-.659-1.106-.879-1.106-2.303 0-3.182s2.9-.879 4.006 0l.415.33M21 12a9 9 0 11-18 0 9 9 0 0118 0z" }) }), cards: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M20.25 14.15v4.073a2.25 2.25 0 01-2.25 2.25h-12a2.25 2.25 0 01-2.25-2.25V6a2.25 2.25 0 012.25-2.25h4.073M15.75 3h5.25v5.25M15.75 3l-9 9" }) }), notifications: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M14.857 17.082a23.848 23.848 0 005.454-1.31A8.967 8.967 0 0118 9.75v-.7V9A6 6 0 006 9v.75a8.967 8.967 0 01-2.312 6.022c1.733.64 3.56 1.085 5.455 1.31m5.714 0a24.255 24.255 0 01-5.714 0m5.714 0a3 3 0 11-5.714 0" }) }), reviews: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M11.48 3.499a.562.562 0 011.04 0l2.125 5.111a.563.563 0 00.475.345l5.518.442c.499.04.701.663.321.988l-4.204 3.602a.563.563 0 00-.182.557l1.285 5.385a.562.562 0 01-.84.61l-4.725-2.885a.562.562 0 00-.586 0L6.982 20.54a.562.562 0 01-.84-.61l1.285-5.386a.562.562 0 00-.182-.557l-4.204-3.602a.562.562 0 01.321-.988l5.518-.442a.563.563 0 00.475-.345L11.48 3.5z" }) }), referral: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M13.19 8.688a4.5 4.5 0 011.242 7.244l-4.5 4.5a4.5 4.5 0 01-6.364-6.364l1.757-1.757m13.35-.622l1.757-1.757a4.5 4.5 0 00-6.364-6.364l-4.5 4.5a4.5 4.5 0 001.242 7.244" }) }), auto_response: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9.813 15.904L9 18.75l-.813-2.846a4.5 4.5 0 00-3.09-3.09L2.25 12l2.846-.813a4.5 4.5 0 003.09-3.09L9 5.25l.813 2.846a4.5 4.5 0 003.09 3.09L15.75 12l-2.846.813a4.5 4.5 0 00-3.09 3.09z" }) }), site: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 21a9.004 9.004 0 008.716-6.747M12 21a9.004 9.004 0 01-8.716-6.747M12 21c2.485 0 4.5-4.03 4.5-9S14.485 3 12 3m0 18c-2.485 0-4.5-4.03-4.5-9S9.515 3 12 3m0 0a8.997 8.997 0 017.843 4.582M12 3a8.997 8.997 0 00-7.843 4.582m15.686 0A11.953 11.953 0 0112 10.5c-2.998 0-5.74-1.1-7.843-2.918m15.686 0A8.959 8.959 0 0121 12c0 .778-.099 1.533-.284 2.253m0 0A17.919 17.919 0 0112 16.5c-3.162 0-6.133-.815-8.716-2.247m0 0A9.015 9.015 0 013 12c0-1.605.42-3.113 1.157-4.418" }) }) }; const tabs = showSpecialistTabs ? [ { id: 'info', label: t('profile.tab.info') }, { id: 'cards', label: t('profile.tab.cards') }, { id: 'notifications', label: t('profile.tab.notifications') }, { id: 'reviews', label: t('profile.tab.reviews') }, { id: 'finance', label: t('profile.tab.finance') }, { id: 'referral', label: t('profile.tab.referral') }, ...hasAutoResponse ? [ { id: 'auto_response', label: t('profile.tab.auto_response', 'Auto response') } ] : [], ...(dashData === null || dashData === void 0 ? void 0 : (_dashData_features1 = dashData.features) === null || _dashData_features1 === void 0 ? void 0 : _dashData_features1.hasPersonalSite) ? [ { id: 'site', label: t('profile.tab.site') } ] : [] ] : [ { id: 'info', label: t('profile.tab.info') }, { id: 'cards', label: t('profile.tab.cards') }, { id: 'notifications', label: t('profile.tab.notifications') }, { id: 'reviews', label: t('profile.tab.reviews') }, { id: 'finance', label: t('profile.tab.finance') }, { id: 'referral', label: t('profile.tab.referral') }, ...(dashData === null || dashData === void 0 ? void 0 : (_dashData_features2 = dashData.features) === null || _dashData_features2 === void 0 ? void 0 : _dashData_features2.hasPersonalSite) ? [ { id: 'site', label: t('profile.tab.site') } ] : [] ]; var _user_lastName1, _user_name, _user_balance, _user_plan_features, _user_plan_name; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "max-w-4xl mx-auto px-4 py-8", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-4 mb-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "w-14 h-14 rounded-full flex-shrink-0 overflow-hidden border-2 border-white/40 flex items-center justify-center text-green-700 text-xl font-bold bg-green-100 cursor-pointer", onClick: ()=>{ var _fileRef_current; setActiveTab('info'); (_fileRef_current = fileRef.current) === null || _fileRef_current === void 0 ? void 0 : _fileRef_current.click(); }, title: t('profile.photo.change'), children: (user === null || user === void 0 ? void 0 : user.image) ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: user.image, alt: user.name, className: "w-full h-full object-cover" }) : initials }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h1", { className: "text-xl font-bold text-white leading-tight", children: (user === null || user === void 0 ? void 0 : user.firstName) ? "".concat(user.firstName, " ").concat((_user_lastName1 = user.lastName) !== null && _user_lastName1 !== void 0 ? _user_lastName1 : '').trim() : (_user_name = user === null || user === void 0 ? void 0 : user.name) !== null && _user_name !== void 0 ? _user_name : t('nav.profile') }), myRating && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-1 mt-0.5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-yellow-300", children: "★" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "font-semibold text-white text-sm", children: Number(myRating).toFixed(1) }), myReviews !== null && myReviews.length > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "text-white/60 text-xs", children: [ "(", myReviews.length, ")" ] }) ] }) ] }) ] }), !cardsLoading && cards.length === 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "mb-6 rounded-2xl border border-amber-300 bg-amber-50/95 p-4 sm:p-5 shadow-sm", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm font-semibold text-amber-950", children: t('profile.cards.empty', 'No offers yet') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs leading-relaxed text-amber-800 mt-1 max-w-2xl", children: t('profile.cards.empty_hint', 'СПзЎайте первую картПчку, чтПбы пПказать услугО клОеМтаЌ.') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>{ setActiveTab('cards'); setShowNewCardForm(true); }, className: "inline-flex items-center justify-center rounded-xl bg-amber-600 px-4 py-2 text-sm font-semibold text-white transition hover:bg-amber-700", children: t('profile.cards.create_first') }) ] }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-6 items-start", children: [ tabs.length > 1 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("aside", { className: "w-52 shrink-0 hidden sm:block", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("nav", { className: "rounded-2xl overflow-hidden bg-white/10 backdrop-blur-sm", children: tabs.map((tab)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { type: "button", onClick: ()=>setActiveTab(tab.id), className: "w-full text-left px-4 py-3 text-sm font-medium transition border-b border-white/10 last:border-0 flex items-center gap-3 ".concat(activeTab === tab.id ? 'bg-white text-green-700' : 'text-white/80 hover:bg-white/10 hover:text-white'), children: [ tabIcons[tab.id], /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "flex items-center gap-1.5", children: [ tab.label, tabNeedsAttention[tab.id] && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "inline-flex items-center justify-center w-4 h-4 rounded-full bg-amber-500 text-white text-[10px] font-bold", children: "!" }) ] }) ] }, tab.id)) }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex-1 min-w-0", children: [ tabs.length > 1 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex sm:hidden bg-white/15 backdrop-blur rounded-xl p-1 mb-4 gap-1 overflow-x-auto", children: tabs.map((tab)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { type: "button", onClick: ()=>setActiveTab(tab.id), className: "flex-1 min-w-fit px-3 py-2 text-xs font-medium rounded-lg transition whitespace-nowrap flex flex-col items-center gap-0.5 ".concat(activeTab === tab.id ? 'bg-white text-green-700 shadow-sm' : 'text-white/80 hover:text-white hover:bg-white/10'), children: [ tabIcons[tab.id], /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "flex items-center gap-1.5", children: [ tab.label, tabNeedsAttention[tab.id] && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "inline-flex items-center justify-center w-4 h-4 rounded-full bg-amber-500 text-white text-[10px] font-bold", children: "!" }) ] }) ] }, tab.id)) }), activeTab === 'cards' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-4", children: [ error && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "bg-red-50 text-red-700 p-3 rounded-lg text-sm", children: error }), listingMissing.length > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-amber-50 border border-amber-300 rounded-xl p-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm font-semibold text-amber-900", children: t('profile.listing_requirements.title', 'Your profile is not shown yet in offers') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-amber-800 mt-1", children: t('profile.listing_requirements.hint', 'To make the card visible, complete these conditions:') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("ul", { className: "mt-2 list-disc pl-5 text-xs text-amber-900 space-y-0.5", children: listingMissing.map((item)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("li", { children: item }, item)) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-between", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { className: "text-sm text-white/70", children: [ t('profile.cards.count'), ": ", cards.length, " / ", maxCards === null ? '∞' : maxCards ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { type: "button", onClick: ()=>{ if (maxCards !== null && cards.length >= maxCards) { setShowUpgradeModal(true); } else { setShowNewCardForm(true); } }, className: "flex items-center gap-1.5 text-sm font-medium text-white hover:text-white/80", children: [ "+ ", t('profile.cards.add') ] }) ] }), showNewCardForm && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-green-200 p-4 space-y-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm font-medium text-gray-800", children: t('profile.cards.new_title') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: newCardTitle, onChange: (e)=>setNewCardTitle(e.target.value), onKeyDown: (e)=>{ if (e.key === 'Enter') handleCreateCard(); }, maxLength: 200, placeholder: t('profile.cards.placeholder'), autoFocus: true, 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" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: handleCreateCard, disabled: creatingCard || !newCardTitle.trim(), className: "px-4 py-2 bg-green-600 hover:bg-green-700 text-white rounded-lg text-sm font-medium disabled:opacity-50", children: creatingCard ? '...' : t('profile.cards.create') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>{ setShowNewCardForm(false); setNewCardTitle(''); }, className: "px-4 py-2 bg-gray-100 hover:bg-gray-200 text-gray-700 rounded-lg text-sm font-medium", children: t('profile.cards.cancel') }) ] }) ] }), cardsLoading && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-center py-10 text-white/70", children: t('common.loading') }), !cardsLoading && cards.length === 0 && !showNewCardForm && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "text-center py-14 border-2 border-dashed border-white/30 rounded-xl", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-white/70 text-sm mb-3", children: t('profile.cards.empty') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { type: "button", onClick: ()=>setShowNewCardForm(true), className: "text-sm text-white font-medium hover:underline", children: [ "+ ", t('profile.cards.create_first') ] }) ] }), cards.map((card)=>{ var _dashData_features; const cardIssues = []; if (!profileBio) { cardIssues.push(t('profile.listing_requirements.bio', 'Add a short bio in the main profile section')); } var _card_publicationStatus; const publicationStatus = (_card_publicationStatus = card.publicationStatus) !== null && _card_publicationStatus !== void 0 ? _card_publicationStatus : card.isActive ? 'active' : 'inactive'; if (publicationStatus === 'pending') { cardIssues.push(t('profile.listing_requirements.review_pending', 'Card is under review')); } else if (publicationStatus !== 'active') { cardIssues.push(t('profile.listing_requirements.card_inactive', 'Make the card active')); } if (!card.categories || card.categories.length === 0) { cardIssues.push(t('profile.listing_requirements.categories', 'Add at least one category to the active card')); } if (!card.locations || card.locations.length === 0) { cardIssues.push(t('profile.listing_requirements.locations', 'Add at least one location to the active card')); } var _moderationNoticeByCardId_card_id; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(SpecialistCardEditor, { card: card, isOpen: openCardId === card.id, onToggle: ()=>setOpenCardId(card.id), onUpdate: (updated)=>setCards((prev)=>prev.map((c)=>c.id === updated.id ? updated : c)), onDelete: ()=>handleDeleteCard(card.id), categories: categories, locationTree: locationTree, catLocale: catLocale, locale: locale, hasPriceList: !!(dashData === null || dashData === void 0 ? void 0 : (_dashData_features = dashData.features) === null || _dashData_features === void 0 ? void 0 : _dashData_features.hasPriceList), visibilityIssues: cardIssues, moderationNotice: (_moderationNoticeByCardId_card_id = moderationNoticeByCardId[card.id]) !== null && _moderationNoticeByCardId_card_id !== void 0 ? _moderationNoticeByCardId_card_id : null }, card.id); }) ] }), activeTab === 'site' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-6 space-y-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "font-semibold text-gray-800 mb-1", children: t('profile.site.title') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400", children: t('profile.site_slug_hint') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs font-medium text-gray-500 mb-1.5", children: t('profile.site.url_label') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-2 flex-wrap", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-sm text-gray-400 shrink-0", children: "canhelp.gr/site/" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: personalSiteSlug, onChange: (e)=>setPersonalSiteSlug(e.target.value.toLowerCase().replace(/[^a-z0-9_-]/g, '')), placeholder: "my-slug", maxLength: 50, className: "flex-1 min-w-32 border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-3 flex-wrap", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: handleSaveSiteSlug, disabled: slugSaving, className: "px-5 py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700 disabled:opacity-50", children: slugSaving ? t('profile.saving') : t('common.save') }), slugSaved && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "text-sm text-green-600", children: [ "✓ ", t('profile.saved') ] }), personalSiteSlug && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { type: "button", onClick: ()=>{ navigator.clipboard.writeText("".concat(window.location.origin, "/site/").concat(personalSiteSlug)); setSlugCopied(true); setTimeout(()=>setSlugCopied(false), 2000); }, className: "px-3 py-2 border border-gray-300 rounded-lg text-sm text-gray-600 hover:bg-gray-50 flex items-center gap-1.5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z" }) }), slugCopied ? t('profile.site.copied') : t('profile.site.copy') ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("a", { href: "/site/".concat(personalSiteSlug), target: "_blank", rel: "noopener noreferrer", className: "px-3 py-2 border border-green-200 bg-green-50 rounded-lg text-sm text-green-600 hover:bg-green-100 flex items-center gap-1.5", children: [ t('profile.site_open'), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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" }) }) ] }) ] }) ] }), slugError && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-red-500", children: slugError }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-between mb-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h3", { className: "font-semibold text-gray-800", children: t('profile.site.visible_title') }), siteSettingsSaving && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-xs text-gray-400", children: t('profile.saving', 'Saving...') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "space-y-3", children: [ { key: 'showBio', label: t('profile.site.visible.bio', 'Biography') }, { key: 'showRating', label: t('profile.site.visible.rating', 'Rating and reviews') }, { key: 'showReviews', label: t('profile.site.visible.reviews', 'Reviews section') }, { key: 'showServices', label: t('profile.site.visible.services', 'Service cards') }, { key: 'showPriceList', label: t('profile.site.visible.price_list', 'Price list') }, { key: 'showPortfolio', label: t('profile.site.visible.portfolio', 'Portfolio') }, { key: 'showPhone', label: t('profile.site.visible.contacts', 'Contact phone') }, { key: 'showFullLastName', label: t('profile.site.visible.full_last_name', 'Show full last name') }, { key: 'showStatus', label: t('profile.site.visible.status', 'Status "Available now"') } ].map((param)=>{ let { key, label } = param; const checked = siteSettings[key] !== false // undefined = true by default ; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "flex items-center gap-3 cursor-pointer group", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "w-5 h-5 rounded border-2 flex items-center justify-center transition shrink-0 ".concat(checked ? 'bg-green-600 border-green-600' : 'bg-white border-gray-300 group-hover:border-green-400'), onClick: ()=>{ const next = { ...siteSettings, [key]: !checked }; handleSaveSiteSettings(next); }, children: checked && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3 h-3 text-white", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 3, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4.5 12.75l6 6 9-13.5" }) }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-sm text-gray-700 select-none", onClick: ()=>{ const next = { ...siteSettings, [key]: !checked }; handleSaveSiteSettings(next); }, children: label }) ] }, key); }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400 mt-4", children: t('profile.site.edit_bio_hint', 'Name and photo are always visible') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "mt-6 pt-4 border-t border-gray-100", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: t('profile.site.theme', 'Theme') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex gap-3", children: [ { value: 'dark', label: t('profile.site.theme.dark', 'Dark'), icon: '🌙' }, { value: 'light', label: t('profile.site.theme.light', 'Light'), icon: '☀' } ].map((opt)=>{ var _siteSettings_siteTheme; const selected = ((_siteSettings_siteTheme = siteSettings.siteTheme) !== null && _siteSettings_siteTheme !== void 0 ? _siteSettings_siteTheme : 'dark') === opt.value; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { onClick: ()=>handleSaveSiteSettings({ ...siteSettings, siteTheme: opt.value }), className: "flex-1 flex items-center justify-center gap-2 px-4 py-2.5 rounded-xl border-2 text-sm font-medium transition ".concat(selected ? 'border-green-500 bg-green-50 text-green-700' : 'border-gray-200 bg-white text-gray-500 hover:border-gray-300'), children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { children: opt.icon }), opt.label ] }, opt.value); }) }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex items-center justify-between mb-4", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h3", { className: "font-semibold text-gray-800", children: t('profile.site.stats.title', 'Site analytics') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400 mt-0.5", children: t('profile.site.stats.days', 'last 30 days') }) ] }) }), !personalSiteSlug ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-gray-400 py-4 text-center", children: t('profile.site.stats.no_slug', 'Set your site URL to view statistics') }) : siteStatsLoading || siteStats === null ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-gray-400 py-4 text-center", children: t('profile.site.stats.loading', 'Loading analytics...') }) : (()=>{ const totalViews = siteStats.reduce((s, d)=>s + d.views, 0); const totalUnique = siteStats.reduce((s, d)=>s + d.unique, 0); const totalMessages = siteStats.reduce((s, d)=>s + d.messages, 0); // Area chart helpers const days = siteStats.map((d)=>d.date); const seriesDef = [ { vals: siteStats.map((d)=>d.views), color: '#3b82f6', fill: '#3b82f615', label: t('profile.site.stats.views', 'Views') }, { vals: siteStats.map((d)=>d.unique), color: '#8b5cf6', fill: '#8b5cf610', label: t('profile.site.stats.unique', 'Unique') }, { vals: siteStats.map((d)=>d.messages), color: '#10b981', fill: '#10b98110', label: t('profile.site.stats.messages', 'Messages') } ]; const maxVal = Math.max(...seriesDef.flatMap((s)=>s.vals), 1); const W = 580; const H = 160; const padL = 36; const padB = 22; const chartW = W - padL - 4; const chartH = H - padB; const stepX = chartW / (days.length - 1); function pts(vals) { return vals.map((v, i)=>[ padL + i * stepX, chartH - v / maxVal * chartH ]); } function smoothPath(points) { if (points.length < 2) return ''; let d = "M ".concat(points[0][0].toFixed(1), " ").concat(points[0][1].toFixed(1)); for(let i = 1; i < points.length; i++){ const cpx = ((points[i - 1][0] + points[i][0]) / 2).toFixed(1); d += " C ".concat(cpx, " ").concat(points[i - 1][1].toFixed(1), " ").concat(cpx, " ").concat(points[i][1].toFixed(1), " ").concat(points[i][0].toFixed(1), " ").concat(points[i][1].toFixed(1)); } return d; } function areaPath(vals) { const points = pts(vals); const line = smoothPath(points); if (!line) return ''; const lastX = points[points.length - 1][0].toFixed(1); return "".concat(line, " L ").concat(lastX, " ").concat(chartH.toFixed(1), " L ").concat(padL.toFixed(1), " ").concat(chartH.toFixed(1), " Z"); } function fmtY(v) { return v >= 1000 ? "".concat(Math.round(v / 1000), "K") : String(v); } const yTicks = [ 0, Math.round(maxVal / 3), Math.round(maxVal * 2 / 3), maxVal ]; const xTicks = days.map((d, i)=>({ i, label: d.slice(8) })).filter((_, i)=>i % 7 === 0 || i === days.length - 1); return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "grid grid-cols-3 gap-3 mb-5", children: [ { label: t('profile.site.stats.total_views', 'Views'), value: totalViews, color: 'text-green-600', bg: 'bg-green-50' }, { label: t('profile.site.stats.total_unique', 'Unique visitors'), value: totalUnique, color: 'text-violet-600', bg: 'bg-violet-50' }, { label: t('profile.site.stats.total_messages', 'Messages'), value: totalMessages, color: 'text-emerald-600', bg: 'bg-emerald-50' } ].map((card)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "".concat(card.bg, " rounded-xl p-3 text-center"), children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-2xl font-bold ".concat(card.color), children: card.value }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-xs text-gray-500 mt-0.5", children: card.label }) ] }, card.label)) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex items-center gap-4 mb-2", children: seriesDef.map((s)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "flex items-center gap-1.5 text-xs text-gray-500", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "w-3 h-0.5 inline-block rounded", style: { background: s.color } }), s.label ] }, s.label)) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "overflow-x-auto", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { viewBox: "0 0 ".concat(W, " ").concat(H + 12), className: "w-full", style: { minWidth: 320 }, children: [ yTicks.map((v, idx)=>{ const y = chartH - v / maxVal * chartH; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("g", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: padL, y1: y, x2: W - 4, y2: y, stroke: "#f3f4f6", strokeWidth: 1 }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("text", { x: padL - 5, y: y + 3.5, textAnchor: "end", fontSize: 9, fill: "#9ca3af", children: fmtY(v) }) ] }, "y-".concat(idx, "-").concat(v)); }), xTicks.map((param)=>{ let { i } = param; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: padL + i * stepX, y1: 0, x2: padL + i * stepX, y2: chartH, stroke: "#f9fafb", strokeWidth: 1 }, "vg-".concat(i)); }), xTicks.map((param)=>{ let { i, label } = param; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("text", { x: padL + i * stepX, y: H + 10, textAnchor: "middle", fontSize: 9, fill: "#9ca3af", children: label }, i); }), seriesDef.map((s, si)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: areaPath(s.vals), fill: s.fill }, "fill-".concat(si))), seriesDef.map((s, si)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: smoothPath(pts(s.vals)), fill: "none", stroke: s.color, strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round" }, "line-".concat(si))), seriesDef.map((s, si)=>{ const points = pts(s.vals); const last = points[points.length - 1]; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("circle", { cx: last[0], cy: last[1], r: 4, fill: "white", stroke: s.color, strokeWidth: 2 }, "dot-".concat(si)); }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: padL, y1: chartH, x2: W - 4, y2: chartH, stroke: "#e5e7eb", strokeWidth: 1 }) ] }) }) ] }); })() ] }) ] }), activeTab === 'reviews' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "space-y-4", children: myReviews === null ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-center py-10 text-white/70", children: t('common.loading') }) : myReviews.length === 0 ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "text-center py-20 text-white/60", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-4xl mb-3", children: "⭐" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { children: t('profile.no_reviews') }) ] }) : myReviews.map((param)=>{ let { review, author } = param; var _author_name_, _author_name; var _author_name__toUpperCase, _author_name1; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "bg-white rounded-xl border border-gray-200 p-4", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-start gap-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "w-9 h-9 rounded-full bg-gray-100 flex-shrink-0 flex items-center justify-center text-gray-600 text-sm font-bold overflow-hidden", children: (author === null || author === void 0 ? void 0 : author.image) ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: author.image, alt: author.name, className: "w-full h-full object-cover" }) : (_author_name__toUpperCase = author === null || author === void 0 ? void 0 : (_author_name = author.name) === null || _author_name === void 0 ? void 0 : (_author_name_ = _author_name[0]) === null || _author_name_ === void 0 ? void 0 : _author_name_.toUpperCase()) !== null && _author_name__toUpperCase !== void 0 ? _author_name__toUpperCase : '?' }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex-1", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-2 mb-1", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-sm font-medium text-gray-800", children: (_author_name1 = author === null || author === void 0 ? void 0 : author.name) !== null && _author_name1 !== void 0 ? _author_name1 : '—' }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "text-yellow-400", children: [ '★'.repeat(review.rating), '☆'.repeat(5 - review.rating) ] }) ] }), review.comment && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-gray-600", children: review.comment }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400 mt-1", children: new Date(review.createdAt).toLocaleDateString() }) ] }) ] }) }, review.id); }) }), activeTab === 'finance' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-between mb-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "font-semibold text-gray-800", children: t('profile.balance') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { onClick: ()=>{ setTopUpAmount(10); setTopUpError(''); setShowTopUpModal(true); }, className: "flex items-center gap-1.5 text-sm font-medium text-green-600 hover:text-green-700 hover:bg-green-50 px-3 py-1.5 rounded-lg transition-colors", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 4v16m8-8H4" }) }), t('profile.balance.topup') ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-3 p-4 bg-green-50 rounded-xl border border-green-100", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-6 h-6 text-green-600 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 8c-1.657 0-3 .895-3 2s1.343 2 3 2 3 .895 3 2-1.343 2-3 2m0-8c1.11 0 2.08.402 2.599 1M12 8V7m0 1v8m0 0v1m0-1c-1.11 0-2.08-.402-2.599-1M21 12a9 9 0 11-18 0 9 9 0 0118 0z" }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "text-xl font-bold text-green-700", children: [ parseFloat((_user_balance = user === null || user === void 0 ? void 0 : user.balance) !== null && _user_balance !== void 0 ? _user_balance : '0').toFixed(2), " EUR" ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "mt-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-between mb-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h3", { className: "text-sm font-semibold text-gray-800", children: t('profile.balance.history', 'Operation history') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-xs text-gray-400", children: t('profile.balance.history.last', 'Latest operations') }) ] }), balanceHistory.length === 0 ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "rounded-xl border border-dashed border-gray-200 px-4 py-6 text-sm text-gray-400 text-center", children: t('profile.balance.history.empty', 'No operations yet') }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "space-y-2", children: balanceHistory.map((entry)=>{ const isCredit = entry.direction === 'credit'; const amount = Number(entry.amount).toFixed(2); const badgeClass = isCredit ? 'bg-emerald-50 text-emerald-700 border-emerald-100' : 'bg-rose-50 text-rose-700 border-rose-100'; const title = entry.kind === 'topup' ? t('profile.balance.history.kind.topup', 'Balance top-up') : entry.kind === 'plan_purchase' ? t('profile.balance.history.kind.plan_purchase', 'Plan charge') : entry.kind === 'admin_topup' ? t('profile.balance.history.kind.admin_topup', 'Admin top-up') : t('profile.balance.history.kind.admin_adjustment', 'Admin adjustment'); return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "rounded-xl border border-gray-200 px-4 py-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-start justify-between gap-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "min-w-0", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-sm font-medium text-gray-900", children: entry.description || title }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-xs text-gray-500 mt-1", children: new Date(entry.createdAt).toLocaleString(dateLocale) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "shrink-0 rounded-full border px-2.5 py-1 text-xs font-semibold ".concat(badgeClass), children: [ isCredit ? '+' : '-', amount, " ", entry.currency ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "mt-2 text-xs text-gray-500", children: [ t('profile.balance.history.balance_after', 'Balance after'), ": ", Number(entry.balanceAfter).toFixed(2), " ", entry.currency ] }) ] }, entry.id); }) }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "font-semibold text-gray-800 mb-4", children: t('profile.plan_history.title', 'Plan history') }), planHistory.length === 0 ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "rounded-xl border border-dashed border-gray-200 px-4 py-6 text-sm text-gray-400 text-center", children: t('profile.plan_history.empty', 'Plan change history is empty') }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "space-y-2", children: planHistory.map((entry)=>{ const eventColors = { activated: 'bg-green-50 text-green-700 border-green-100', renewed: 'bg-emerald-50 text-emerald-700 border-emerald-100', downgraded: 'bg-rose-50 text-rose-700 border-rose-100', referral_reward: 'bg-amber-50 text-amber-700 border-amber-100', admin_change: 'bg-purple-50 text-purple-700 border-purple-100', expired: 'bg-gray-100 text-gray-600 border-gray-200' }; const eventLabels = { activated: t('profile.plan_history.event.activated', 'Activated'), renewed: t('profile.plan_history.event.renewed', 'Renewed'), downgraded: t('profile.plan_history.event.downgraded', 'Downgraded'), referral_reward: t('profile.plan_history.event.referral_reward', 'Referral reward'), admin_change: t('profile.plan_history.event.admin_change', 'Changed by admin'), expired: t('profile.plan_history.event.expired', 'Expired') }; var _eventColors_entry_event; const badgeClass = (_eventColors_entry_event = eventColors[entry.event]) !== null && _eventColors_entry_event !== void 0 ? _eventColors_entry_event : 'bg-gray-100 text-gray-600 border-gray-200'; var _eventLabels_entry_event; const label = (_eventLabels_entry_event = eventLabels[entry.event]) !== null && _eventLabels_entry_event !== void 0 ? _eventLabels_entry_event : entry.event; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "rounded-xl border border-gray-200 px-4 py-3", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-start justify-between gap-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "min-w-0", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-2 flex-wrap", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-sm font-semibold text-gray-900", children: entry.planName }), entry.previousPlanName && entry.previousPlanName !== entry.planName && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "text-xs text-gray-400", children: [ "← ", entry.previousPlanName ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-xs text-gray-500 mt-1", children: new Date(entry.createdAt).toLocaleString(dateLocale) }), entry.expiresAt && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "text-xs text-gray-500 mt-0.5", children: [ t('profile.plan_history.expires', 'Until'), ": ", new Date(entry.expiresAt).toLocaleDateString(dateLocale) ] }), entry.daysAdded && entry.event === 'referral_reward' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "text-xs text-amber-600 mt-0.5", children: [ "+", entry.daysAdded, " ", t('profile.plan_history.days', 'days') ] }), entry.note && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-xs text-gray-400 mt-0.5", children: entry.note }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "shrink-0 rounded-full border px-2.5 py-1 text-xs font-semibold ".concat(badgeClass), children: label }) ] }) }, entry.id); }) }) ] }), showTopUpModal && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "fixed inset-0 z-50 flex items-end sm:items-center justify-center p-4 bg-black/40 backdrop-blur-sm", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-2xl shadow-2xl w-full max-w-sm p-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-between mb-5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h3", { className: "text-lg font-semibold text-gray-900", children: t('profile.balance.topup.title') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>setShowTopUpModal(false), className: "text-gray-400 hover:text-gray-600", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-5 h-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" }) }) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-gray-500 mb-3", children: t('profile.balance.topup.hint') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "grid grid-cols-4 gap-2 mb-4", children: [ 5, 10, 20, 50 ].map((v)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { onClick: ()=>setTopUpAmount(v), className: "py-2 rounded-xl text-sm font-semibold border transition-colors ".concat(Number(topUpAmount) === v ? 'bg-green-600 text-white border-green-600' : 'border-gray-200 text-gray-700 hover:border-green-400'), children: [ "€", v ] }, v)) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "mb-5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('profile.balance.topup.amount') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "relative", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "absolute left-3 top-1/2 -translate-y-1/2 text-gray-400 text-sm", children: "€" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "number", min: "1", max: "9999", step: "1", value: topUpAmount, onChange: (e)=>setTopUpAmount(e.target.value), className: "w-full pl-7 pr-4 py-2.5 border border-gray-300 rounded-xl text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }) ] }), topUpError && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-red-600 mb-3", children: topUpError }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: handleTopUp, disabled: topUpLoading || !Number(topUpAmount) || Number(topUpAmount) < 1, className: "w-full py-3 bg-green-600 hover:bg-green-700 disabled:bg-gray-300 disabled:cursor-not-allowed text-white font-semibold rounded-xl transition-colors flex items-center justify-center gap-2", children: topUpLoading ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-4 h-4 animate-spin", fill: "none", viewBox: "0 0 24 24", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { className: "opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8v8z" }) ] }), t('profile.balance.topup.loading') ] }) : t('profile.balance.topup.submit') }) ] }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "font-semibold text-gray-800 mb-3", children: t('profile.plan.title') }), (user === null || user === void 0 ? void 0 : user.plan) ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-start gap-3 p-4 bg-green-50 rounded-xl border border-green-100", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-6 h-6 text-gray-500 shrink-0 mt-0.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M3 10h18M7 15h1m4 0h1m-7 4h12a3 3 0 003-3V8a3 3 0 00-3-3H6a3 3 0 00-3 3v8a3 3 0 003 3z" }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "font-semibold text-gray-900", children: user.plan.name }), user.plan.description && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-gray-500 mt-0.5", children: user.plan.description }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex flex-wrap gap-3 mt-2 text-xs text-gray-500", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "font-medium text-green-700", children: [ user.plan.price, " ", user.plan.currency ] }), user.plan.maxCards != null ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { children: [ t('profile.plan.cards_up_to'), " ", user.plan.maxCards ] }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { children: t('profile.plan.cards_unlimited') }), user.plan.maxTasks != null && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { children: [ t('profile.plan.tasks_up_to'), " ", user.plan.maxTasks ] }), user.plan.maxOffers != null && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { children: [ t('profile.plan.offers_up_to'), " ", user.plan.maxOffers ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: user.planExpiresAt && new Date(user.planExpiresAt) < new Date(Date.now() + 7 * 24 * 60 * 60 * 1000) ? 'text-red-500 font-medium' : '', children: user.planExpiresAt ? "".concat(t('profile.plan.valid_until'), " ").concat(new Date(user.planExpiresAt).toLocaleDateString()) : t('profile.plan.no_expiry') }) ] }), ((_user_plan_features = user.plan.features) !== null && _user_plan_features !== void 0 ? _user_plan_features : []).length > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("ul", { className: "mt-2 space-y-0.5", children: user.plan.features.map((f, i)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("li", { className: "text-xs text-gray-600 flex items-center gap-1.5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-green-500", children: "✓" }), " ", f ] }, i)) }) ] }) ] }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-3 p-4 bg-gray-50 rounded-xl border border-gray-100", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-5 h-5 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm font-medium text-gray-700", children: t('profile.plan.basic') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400 mt-0.5", children: t('profile.plan.contact_upgrade') }) ] }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-center", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("a", { href: "/pricing", className: "inline-flex items-center gap-1.5 text-sm font-medium text-white/70 hover:text-white transition", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M13 7l5 5m0 0l-5 5m5-5H6" }) }), t('pricing.title', 'Pricing') ] }) }) ] }), activeTab !== 'cards' && activeTab !== 'reviews' && activeTab !== 'finance' && activeTab !== 'site' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("form", { onSubmit: handleSubmit, className: "space-y-6", children: [ error && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "bg-red-50 text-red-700 p-3 rounded-lg text-sm", children: error }), saved && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-green-50 text-green-700 p-3 rounded-lg text-sm", children: [ "✓ ", t('profile.saved') ] }), activeTab === 'notifications' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-6 space-y-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "font-semibold text-gray-800", children: t('notifications.title') }), notifySaved && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-green-50 text-green-700 p-3 rounded-lg text-sm", children: [ "✓ ", t('notifications.saved') ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-start justify-between gap-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex-1", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "font-medium text-gray-800 text-sm", children: t('chat.notif_messages') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-500 mt-0.5", children: t('notifications.messages.desc') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", disabled: notifySaving, onClick: async ()=>{ const next = !notifMessages; setNotifMessages(next); setNotifySaving(true); try { await _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Em('/users/me', { method: 'PATCH', body: JSON.stringify({ notifMessages: next }) }); setNotifySaved(true); setTimeout(()=>setNotifySaved(false), 2500); } catch (e) { setNotifMessages(!next); } finally{ setNotifySaving(false); } }, className: "relative inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full transition-colors focus:outline-none focus:ring-2 focus:ring-green-500 focus:ring-offset-2 disabled:opacity-50 ".concat(notifMessages ? 'bg-green-600' : 'bg-gray-200'), role: "switch", "aria-checked": notifMessages, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "inline-block h-4 w-4 transform rounded-full bg-white shadow transition-transform ".concat(notifMessages ? 'translate-x-6' : 'translate-x-1') }) }) ] }), showSpecialistTabs && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-start justify-between gap-4 ".concat(!(user === null || user === void 0 ? void 0 : (_user_plan = user.plan) === null || _user_plan === void 0 ? void 0 : _user_plan.notifyNewTasks) ? 'opacity-60' : ''), children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex-1", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "font-medium text-gray-800 text-sm", children: t('notifications.email.new_tasks') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-500 mt-0.5", children: t('notifications.email.new_tasks.desc') }), !(user === null || user === void 0 ? void 0 : (_user_plan1 = user.plan) === null || _user_plan1 === void 0 ? void 0 : _user_plan1.notifyNewTasks) && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { className: "text-xs text-amber-600 mt-1", children: [ "\uD83D\uDD12 ", t('notifications.plan_required') ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", disabled: notifySaving || !(user === null || user === void 0 ? void 0 : (_user_plan2 = user.plan) === null || _user_plan2 === void 0 ? void 0 : _user_plan2.notifyNewTasks), onClick: async ()=>{ const next = !notifyNewTasks; setNotifyNewTasks(next); setNotifySaving(true); try { await _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Em('/users/me', { method: 'PATCH', body: JSON.stringify({ notifyNewTasks: next }) }); setNotifySaved(true); setTimeout(()=>setNotifySaved(false), 2500); } catch (e) { setNotifyNewTasks(!next); } finally{ setNotifySaving(false); } }, className: "relative inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full transition-colors focus:outline-none focus:ring-2 focus:ring-green-500 focus:ring-offset-2 disabled:opacity-50 ".concat(notifyNewTasks ? 'bg-green-600' : 'bg-gray-200'), role: "switch", "aria-checked": notifyNewTasks, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "inline-block h-4 w-4 transform rounded-full bg-white shadow transition-transform ".concat(notifyNewTasks ? 'translate-x-6' : 'translate-x-1') }) }) ] }) ] }), activeTab === 'referral' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-6 space-y-5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "font-semibold text-gray-800", children: t('profile.referral.title') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-gray-500", children: t('profile.referral.desc') }), !referralLoaded ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-sm text-gray-400", children: t('common.loading') }) : referralCode ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs font-medium text-gray-500 mb-1.5", children: t('profile.referral.link_label') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { readOnly: true, value: "".concat( true ? window.location.origin : 0, "/register?ref=").concat(referralCode), className: "flex-1 text-sm border border-gray-200 rounded-lg px-3 py-2 bg-gray-50 text-gray-700 focus:outline-none" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>{ navigator.clipboard.writeText("".concat(window.location.origin, "/register?ref=").concat(referralCode)); setReferralCopied(true); setTimeout(()=>setReferralCopied(false), 2000); }, className: "px-3 py-2 rounded-lg border border-gray-200 text-sm font-medium hover:bg-gray-50 transition whitespace-nowrap", children: referralCopied ? t('profile.referral.copied') : t('profile.referral.copy') }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-3 p-4 bg-green-50 rounded-xl", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-2xl font-bold text-green-700", children: referralCount }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-green-700", children: t('profile.referral.invited_count') }) ] }) ] }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-sm text-gray-400", children: t('profile.referral.no_code') }) ] }), activeTab === 'auto_response' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(AutoResponseTab, { categories: categories, locationTree: locationTree, loaded: arLoaded, onLoad: ()=>{ if (arLoaded) return; _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getAutoResponseSettings */ .Gp().then((s)=>{ setAutoResponse(s); setArLoaded(true); }).catch(()=>setArLoaded(true)); }, settings: autoResponse, saving: arSaving, saved: arSaved, onSave: async (data)=>{ setArSaving(true); setArSaved(false); try { const updated = await _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .updateAutoResponseSettings */ .RQ(data); setAutoResponse(updated); setArSaved(true); setTimeout(()=>setArSaved(false), 2500); } catch (e) {} finally{ setArSaving(false); } }, t: t, catLocale: catLocale }), activeTab === 'info' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "font-semibold text-gray-800 mb-4", children: t('profile.photo') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "relative", children: [ (user === null || user === void 0 ? void 0 : user.image) ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: user.image, alt: user.name, className: "w-20 h-20 rounded-full object-cover border-2 border-gray-200" }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "w-20 h-20 rounded-full bg-green-100 flex items-center justify-center text-green-700 text-2xl font-bold border-2 border-gray-200", children: initials }), avatarUploading && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "absolute inset-0 rounded-full bg-black/40 flex items-center justify-center", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "w-5 h-5 border-2 border-white border-t-transparent rounded-full animate-spin" }) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>{ var _fileRef_current; return (_fileRef_current = fileRef.current) === null || _fileRef_current === void 0 ? void 0 : _fileRef_current.click(); }, disabled: avatarUploading, className: "bg-gray-100 hover:bg-gray-200 text-gray-700 px-4 py-2 rounded-lg text-sm font-medium disabled:opacity-50", children: t('profile.photo.change') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400 mt-1", children: t('profile.photo.hint') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { ref: fileRef, type: "file", accept: "image/jpeg,image/png,image/webp", className: "hidden", onChange: handleAvatarChange }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "mt-3 rounded-lg border border-gray-200 bg-gray-50 px-3 py-2.5", children: isSpecialist ? (dashData === null || dashData === void 0 ? void 0 : (_dashData_features3 = dashData.features) === null || _dashData_features3 === void 0 ? void 0 : _dashData_features3.hasCanHelpNowStatus) ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "flex items-center justify-between cursor-pointer gap-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-xs font-medium text-gray-700", children: t('status.can_help_now', 'Available now') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", disabled: statusToggling === 'canhelp_now', onClick: async ()=>{ setStatusToggling('canhelp_now'); const nextActive = !myStatuses.includes('canhelp_now'); try { const res = await _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .toggleStatus */ .bc('canhelp_now', nextActive); setMyStatuses((prev)=>res.isActive ? [ ...prev.filter((s)=>s !== 'canhelp_now'), 'canhelp_now' ] : prev.filter((s)=>s !== 'canhelp_now')); } catch (e) {} finally{ setStatusToggling(null); } }, className: "relative inline-flex h-5 w-10 items-center rounded-full transition-colors ".concat(myStatuses.includes('canhelp_now') ? 'bg-green-500' : 'bg-gray-300', " disabled:opacity-50"), children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "inline-block h-3.5 w-3.5 transform rounded-full bg-white shadow transition-transform ".concat(myStatuses.includes('canhelp_now') ? 'translate-x-5.5' : 'translate-x-1') }) }) ] }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-amber-700", children: t('status.plan_required', 'Status is unavailable on your current plan') }) : !isAdmin ? (dashData === null || dashData === void 0 ? void 0 : (_dashData_features4 = dashData.features) === null || _dashData_features4 === void 0 ? void 0 : _dashData_features4.hasNeedHelpStatus) ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "flex items-center justify-between cursor-pointer gap-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-xs font-medium text-gray-700", children: t('status.need_help', 'Need help') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", disabled: statusToggling === 'need_help', onClick: async ()=>{ setStatusToggling('need_help'); const nextActive = !myStatuses.includes('need_help'); try { const res = await _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .toggleStatus */ .bc('need_help', nextActive); setMyStatuses((prev)=>res.isActive ? [ ...prev.filter((s)=>s !== 'need_help'), 'need_help' ] : prev.filter((s)=>s !== 'need_help')); } catch (e) {} finally{ setStatusToggling(null); } }, className: "relative inline-flex h-5 w-10 items-center rounded-full transition-colors ".concat(myStatuses.includes('need_help') ? 'bg-green-500' : 'bg-gray-300', " disabled:opacity-50"), children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "inline-block h-3.5 w-3.5 transform rounded-full bg-white shadow transition-transform ".concat(myStatuses.includes('need_help') ? 'translate-x-5.5' : 'translate-x-1') }) }) ] }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-amber-700", children: t('status.plan_required', 'Status is unavailable on your current plan') }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-600", children: t('status.admin_not_applicable', 'User status is not applicable to admin accounts') }) }) ] }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "font-semibold text-gray-800 mb-4", children: t('profile.background.title', 'Profile header background') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "w-full h-40 rounded-2xl border border-gray-200 overflow-hidden relative", style: { backgroundImage: siteSettings.profileBackgroundImage ? "linear-gradient(135deg, rgba(22,163,74,0.45), rgba(21,128,61,0.65)), url(".concat(siteSettings.profileBackgroundImage, ")") : 'linear-gradient(135deg, #22c55e 0%, #16a34a 45%, #166534 100%)', backgroundSize: 'cover', backgroundPosition: 'center' }, children: backgroundUploading && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "absolute inset-0 bg-black/35 flex items-center justify-center", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "w-6 h-6 border-2 border-white border-t-transparent rounded-full animate-spin" }) }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "mt-4 flex flex-wrap gap-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>{ var _backgroundFileRef_current; return (_backgroundFileRef_current = backgroundFileRef.current) === null || _backgroundFileRef_current === void 0 ? void 0 : _backgroundFileRef_current.click(); }, disabled: backgroundUploading, className: "bg-gray-100 hover:bg-gray-200 text-gray-700 px-4 py-2 rounded-lg text-sm font-medium disabled:opacity-50", children: backgroundUploading ? t('profile.photo.uploading', 'Uploading...') : t('profile.background.change', 'Change background') }), siteSettings.profileBackgroundImage && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: handleRemoveBackground, disabled: backgroundUploading, className: "bg-white hover:bg-gray-50 text-gray-700 px-4 py-2 rounded-lg text-sm font-medium border border-gray-200 disabled:opacity-50", children: t('profile.background.remove', 'Remove background') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { ref: backgroundFileRef, type: "file", accept: "image/jpeg,image/png,image/webp", className: "hidden", onChange: handleBackgroundChange }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400 mt-2", children: t('profile.background.hint', 'Shown in the public profile header on web and mobile app.') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-6 space-y-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "font-semibold text-gray-800", children: t('profile.basic_info') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "grid grid-cols-2 gap-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('register.first_name') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: formData.firstName, onChange: (e)=>setFormData({ ...formData, firstName: e.target.value }), required: true, className: "w-full border border-gray-300 rounded-lg px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-400 text-sm" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('register.last_name') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: formData.lastName, onChange: (e)=>setFormData({ ...formData, lastName: e.target.value }), required: true, className: "w-full border border-gray-300 rounded-lg px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-400 text-sm" }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: "Email" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: user === null || user === void 0 ? void 0 : user.email, disabled: true, className: "w-full border border-gray-200 rounded-lg px-3 py-2 text-sm text-gray-400 bg-gray-50 cursor-not-allowed" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-between mt-1.5", children: [ (user === null || user === void 0 ? void 0 : user.emailVerified) ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "flex items-center gap-1 text-xs text-green-600", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "inline-block w-1.5 h-1.5 rounded-full bg-green-500" }), t('profile.email.verified') ] }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "flex items-center gap-1 text-xs text-amber-600", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "inline-block w-1.5 h-1.5 rounded-full bg-amber-500" }), t('profile.email.not_verified') ] }), !(user === null || user === void 0 ? void 0 : user.emailVerified) && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", disabled: resendState !== 'idle', onClick: handleResendVerification, className: "text-xs text-green-600 hover:underline disabled:opacity-60 disabled:no-underline", children: resendState === 'sending' ? t('login.unverified.sending') : resendState === 'sent' ? t('login.unverified.sent') : t('login.unverified.resend') }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('profile.phone') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "tel", value: formData.phone, onChange: (e)=>setFormData({ ...formData, phone: e.target.value }), placeholder: t('profile.phone.placeholder'), className: "w-full border border-gray-300 rounded-lg px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-400 text-sm" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('profile.bio') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("textarea", { value: formData.bio, onChange: (e)=>setFormData({ ...formData, bio: e.target.value }), rows: 3, maxLength: 1000, placeholder: t('profile.bio.placeholder'), className: "w-full border border-gray-300 rounded-lg px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-400 text-sm resize-none" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('profile.language') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400 mb-2", children: t('profile.language.hint') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("select", { value: formData.locale, onChange: (e)=>setFormData({ ...formData, locale: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "el", children: "ΕλληΜικά" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "en", children: "English" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "ru", children: "РусскОй" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "uk", children: "УкраїМська" }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('profile.languages') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400 mb-2", children: t('profile.languages.hint') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex flex-wrap gap-2", children: [ { code: 'el', flag: '🇬🇷', label: 'ΕλληΜικά' }, { code: 'en', flag: '🇬🇧', label: 'English' }, { code: 'ru', flag: '🇷🇺', label: 'РусскОй' }, { code: 'uk', flag: '🇺🇊', label: 'УкраїМська' }, { code: 'de', flag: '🇩🇪', label: 'Deutsch' }, { code: 'fr', flag: '🇫🇷', label: 'Français' }, { code: 'it', flag: '🇮🇹', label: 'Italiano' }, { code: 'es', flag: '🇪🇞', label: 'Español' }, { code: 'ar', flag: '🇞🇊', label: 'العرؚية' }, { code: 'zh', flag: '🇚🇳', label: 'äž­æ–‡' } ].map((param)=>{ let { code, flag, label } = param; const selected = selectedLanguages.includes(code); return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { type: "button", onClick: ()=>setSelectedLanguages(selected ? selectedLanguages.filter((l)=>l !== code) : [ ...selectedLanguages, code ]), className: "flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-sm border transition ".concat(selected ? 'bg-green-600 border-green-600 text-white' : 'bg-white border-gray-300 text-gray-700 hover:border-green-400'), children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { children: flag }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { children: label }) ] }, code); }) }) ] }) ] }), !isSpecialist && !isAdmin && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "p-4 bg-purple-50 rounded-xl", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-gray-600 mb-3", children: t('profile.become_specialist.desc') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: handleBecomeSpecialist, disabled: becomingSpecialist, className: "bg-purple-600 hover:bg-purple-700 text-white px-5 py-2 rounded-lg text-sm font-semibold disabled:opacity-50", children: becomingSpecialist ? t('common.loading') : t('profile.become_specialist') }) ] }) }), isSpecialist && ((dashData === null || dashData === void 0 ? void 0 : (_dashData_plan = dashData.plan) === null || _dashData_plan === void 0 ? void 0 : _dashData_plan.tier) === 'pro' || (dashData === null || dashData === void 0 ? void 0 : (_dashData_plan1 = dashData.plan) === null || _dashData_plan1 === void 0 ? void 0 : _dashData_plan1.tier) === 'ultimate') && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "font-semibold text-gray-800 mb-4", children: t('profile.show_contact', 'Show contacts') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "flex items-center justify-between cursor-pointer gap-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm font-medium text-gray-800", children: t('profile.show_contact_hint', 'Clients can see your phone number') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400 mt-0.5", children: t('profile.show_contact_desc', 'Lets clients contact you directly') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>setShowContactInfo((v)=>!v), className: "relative inline-flex h-6 w-11 items-center rounded-full transition-colors ".concat(showContactInfo ? 'bg-green-500' : 'bg-gray-300'), children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "inline-block h-4 w-4 transform rounded-full bg-white shadow transition-transform ".concat(showContactInfo ? 'translate-x-6' : 'translate-x-1') }) }) ] }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "submit", disabled: saving, className: "w-full bg-green-600 text-white py-3 rounded-xl font-semibold hover:bg-green-700 disabled:opacity-50 disabled:cursor-not-allowed ".concat(activeTab === 'notifications' || activeTab === 'referral' || activeTab === 'auto_response' ? 'hidden' : ''), children: saving ? t('profile.saving') : t('common.save') }) ] }), showUpgradeModal && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "fixed inset-0 z-50 flex items-center justify-center bg-black/50 px-4", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-2xl shadow-xl p-6 w-full max-w-md", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-center mb-5", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-5xl", children: "\uD83D\uDE80" }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "text-lg font-bold text-gray-900 text-center mb-2", children: t('profile.upgrade.cards_limit') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { className: "text-sm text-gray-600 text-center mb-4", children: [ (_user_plan_name = user === null || user === void 0 ? void 0 : (_user_plan3 = user.plan) === null || _user_plan3 === void 0 ? void 0 : _user_plan3.name) !== null && _user_plan_name !== void 0 ? _user_plan_name : t('profile.plan.basic'), " — ", t('profile.plan.cards_up_to'), " ", maxCards ] }), (user === null || user === void 0 ? void 0 : user.plan) && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-gray-50 rounded-xl p-4 mb-5 text-sm text-gray-600 text-center", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "font-medium text-gray-800", children: t('profile.upgrade.plan') }), ' ', user.plan.name, " — ", user.plan.price, " ", user.plan.currency ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400 text-center mb-5", children: t('profile.upgrade.contact') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>setShowUpgradeModal(false), className: "w-full bg-green-600 hover:bg-green-700 text-white py-2.5 rounded-xl text-sm font-semibold", children: t('profile.upgrade.ok') }) ] }) }) ] }) ] }) ] }); } /***/ }) €”{"finalSource":true}ƒmap‹bufferedMap  ConcatSourceRawSource_/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; þt__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ ProfilePage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7541); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(1592); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(9906); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(2982); /* harmony import */ var _components_CategoryIcon__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(5940); ReplaceSourceRawSource’/* __next_internal_client_entry_do_not_use__ default auto */ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime"; import { useState, useEffect, useRef, Suspense } from 'react'; import { useRouter, useSearchParams } from 'next/navigation'; import { useSession, authClient } from '@/lib/auth'; import { useLocale } from '@/context/locale'; import * as api from '@/lib/api'; import { CategoryIcon, isCategoryIconUrl } from '@/components/CategoryIcon'; function SpecialistCardEditor(param) { let { card, isOpen, onToggle, onUpdate, onDelete, categories, locationTree, catLocale, locale, hasPriceList, visibilityIssues = [], moderationNotice = null } = param; const { t } = useLocale(); const hasVisibilityIssues = visibilityIssues.length > 0; const [cardTab, setCardTab] = useState('main'); const [saving, setSaving] = useState(false); const [savedOk, setSavedOk] = useState(false); const [localTitle, setLocalTitle] = useState(card.title); var _card_descriptionEl; const [localDescEl, setLocalDescEl] = useState((_card_descriptionEl = card.descriptionEl) !== null && _card_descriptionEl !== void 0 ? _card_descriptionEl : ''); var _card_descriptionEn; const [localDescEn, setLocalDescEn] = useState((_card_descriptionEn = card.descriptionEn) !== null && _card_descriptionEn !== void 0 ? _card_descriptionEn : ''); var _card_descriptionRu; const [localDescRu, setLocalDescRu] = useState((_card_descriptionRu = card.descriptionRu) !== null && _card_descriptionRu !== void 0 ? _card_descriptionRu : ''); var _card_descriptionUk; const [localDescUk, setLocalDescUk] = useState((_card_descriptionUk = card.descriptionUk) !== null && _card_descriptionUk !== void 0 ? _card_descriptionUk : ''); var _card_skills; const [localSkills, setLocalSkills] = useState((_card_skills = card.skills) !== null && _card_skills !== void 0 ? _card_skills : []); const [skillInput, setSkillInput] = useState(''); var _card_categories; const [localCategories, setLocalCategories] = useState((_card_categories = card.categories) !== null && _card_categories !== void 0 ? _card_categories : []); var _card_locations; const [localLocations, setLocalLocations] = useState((_card_locations = card.locations) !== null && _card_locations !== void 0 ? _card_locations : []); var _card_publicationStatus; const [localPublicationStatus, setLocalPublicationStatus] = useState((_card_publicationStatus = card.publicationStatus) !== null && _card_publicationStatus !== void 0 ? _card_publicationStatus : card.isActive ? 'active' : 'inactive'); const [apiSkillSugs, setApiSkillSugs] = useState([]); var _card_portfolio; const [portfolio, setPortfolio] = useState((_card_portfolio = card.portfolio) !== null && _card_portfolio !== void 0 ? _card_portfolio : []); const [portfolioUploading, setPortfolioUploading] = useState(false); const [editingItem, setEditingItem] = useState(null); const [editTitle, setEditTitle] = useState(''); const [editDesc, setEditDesc] = useState(''); const portfolioFileRef = useRef(null); // Price list state const [priceList, setPriceList] = useState([]); const [priceListLoading, setPriceListLoading] = useState(false); const [newGroupTitle, setNewGroupTitle] = useState(''); const [addingGroupId, setAddingGroupId] = useState(null); const [newItem, setNewItem] = useState({ name: '', description: '', price: '', unit: '' }); const [editingGroupId, setEditingGroupId] = useState(null); const [editGroupTitle, setEditGroupTitle] = useState(''); useEffect(()=>{ if (cardTab !== 'pricelist' || priceList.length > 0 || priceListLoading) return; setPriceListLoading(true); api.getPriceList(card.id, locale).then(setPriceList).catch(()=>{}).finally(()=>setPriceListLoading(false)); }, [ cardTab, locale ]); async function handleAddGroup() { if (!newGroupTitle.trim()) return; const group = await api.createPriceListGroup(card.id, { title: newGroupTitle.trim(), locale: [ 'el', 'en', 'ru', 'uk' ].includes(locale) ? locale : 'el', autoTranslate: true }); setPriceList((prev)=>[ ...prev, group ]); setNewGroupTitle(''); } async function handleDeleteGroup(groupId) { await api.deletePriceListGroup(groupId); setPriceList((prev)=>prev.filter((g)=>g.id !== groupId)); } async function handleSaveGroupTitle(groupId) { const updated = await api.updatePriceListGroup(groupId, { title: editGroupTitle.trim(), locale: [ 'el', 'en', 'ru', 'uk' ].includes(locale) ? locale : 'el', autoTranslate: true }); setPriceList((prev)=>prev.map((g)=>g.id === groupId ? { ...g, title: updated.title } : g)); setEditingGroupId(null); } async function handleAddItem(groupId) { if (!newItem.name.trim()) return; const item = await api.createPriceListItem(groupId, { name: newItem.name.trim(), description: newItem.description.trim() || null, price: newItem.price.trim() || null, unit: newItem.unit.trim() || null, locale: [ 'el', 'en', 'ru', 'uk' ].includes(locale) ? locale : 'el', autoTranslate: true }); setPriceList((prev)=>prev.map((g)=>g.id === groupId ? { ...g, items: [ ...g.items, item ] } : g)); setNewItem({ name: '', description: '', price: '', unit: '' }); setAddingGroupId(null); } async function handleDeleteItem(itemId, groupId) { await api.deletePriceListItem(itemId); setPriceList((prev)=>prev.map((g)=>g.id === groupId ? { ...g, items: g.items.filter((i)=>i.id !== itemId) } : g)); } useEffect(()=>{ if (cardTab !== 'skills') return; api.getSkillSuggestions(localCategories.length > 0 ? localCategories : undefined).then(setApiSkillSugs).catch(()=>setApiSkillSugs([])); }, [ localCategories, cardTab ]); const lbl = (ru, en, el)=>locale === 'ru' ? ru : locale === 'en' ? en : el; async function saveAll() { setSaving(true); try { const activeLocale = [ 'el', 'en', 'ru', 'uk' ].includes(locale) ? locale : 'el'; const cap = activeLocale.charAt(0).toUpperCase() + activeLocale.slice(1); const descField = "description".concat(cap); const descValue = { el: localDescEl, en: localDescEn, ru: localDescRu, uk: localDescUk }[activeLocale] || null; const updated = await api.updateSpecialistCard(card.id, { title: localTitle, [descField]: descValue, descriptionLocale: activeLocale, autoTranslate: !!descValue, skills: localSkills, categories: localCategories, locations: localLocations, publicationStatus: localPublicationStatus, isActive: localPublicationStatus === 'active' }); onUpdate({ ...updated, portfolio }); setSavedOk(true); setTimeout(()=>setSavedOk(false), 2000); } catch (e) {} finally{ setSaving(false); } } async function updatePublicationStatus(next) { setLocalPublicationStatus(next); try { await api.updateSpecialistCard(card.id, { publicationStatus: next, isActive: next === 'active' }); } catch (e) {} } function addSkill(s) { const trimmed = s.trim(); if (trimmed && !localSkills.includes(trimmed)) setLocalSkills([ ...localSkills, trimmed ]); setSkillInput(''); } function toggleCategory(slug) { let childSlugs = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : []; if (localCategories.includes(slug)) { setLocalCategories(localCategories.filter((c)=>c !== slug && !childSlugs.includes(c))); } else { setLocalCategories([ ...new Set([ ...localCategories, slug, ...childSlugs ]) ]); } } function toggleLocation(slug) { let childSlugs = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : []; if (localLocations.includes(slug)) { setLocalLocations(localLocations.filter((c)=>c !== slug && !childSlugs.includes(c))); } else { setLocalLocations([ ...new Set([ ...localLocations, slug, ...childSlugs ]) ]); } } async function handlePortfolioUpload(e) { var _e_target_files; const file = (_e_target_files = e.target.files) === null || _e_target_files === void 0 ? void 0 : _e_target_files[0]; if (!file) return; setPortfolioUploading(true); try { const form = new FormData(); form.append('file', file); form.append('cardId', card.id); const res = await fetch("".concat(process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000', "/api/portfolio"), { method: 'POST', credentials: 'include', body: form }); if (!res.ok) throw new Error('Upload failed'); const item = await res.json(); const next = [ ...portfolio, item ]; setPortfolio(next); onUpdate({ ...card, portfolio: next }); } catch (e) {} finally{ setPortfolioUploading(false); if (portfolioFileRef.current) portfolioFileRef.current.value = ''; } } async function handlePortfolioDelete(id) { try { await api.deletePortfolioItem(id); const next = portfolio.filter((p)=>p.id !== id); setPortfolio(next); onUpdate({ ...card, portfolio: next }); } catch (e) {} } async function handlePortfolioSave(id) { try { const item = await api.updatePortfolioItem(id, { title: editTitle, description: editDesc }); setPortfolio((prev)=>prev.map((p)=>p.id === id ? item : p)); setEditingItem(null); } catch (e) {} } const cardTabs = [ { id: 'main', label: t('profile.card.tab.main') }, { id: 'categories', label: t('profile.card.tab.categories') }, { id: 'skills', label: t('profile.card.tab.skills') }, { id: 'geography', label: t('profile.card.tab.geography') }, { id: 'pricelist', label: t('profile.card.tab.pricelist'), hidden: !hasPriceList }, { id: 'portfolio', label: t('profile.card.tab.portfolio') } ]; const pendingReviewNotice = localPublicationStatus === 'pending' ? { title: t('profile.card.review_pending', 'Pending approval'), body: t('profile.card.review_pending_hint', 'Your card is being reviewed by the admin team.'), tone: 'amber' } : null; const effectiveModerationNotice = moderationNotice !== null && moderationNotice !== void 0 ? moderationNotice : pendingReviewNotice; return /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 overflow-hidden", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 px-4 py-3 border-b border-gray-100 ".concat(hasVisibilityIssues ? 'bg-amber-50' : ''), children: [ /*#__PURE__*/ _jsxs("button", { type: "button", onClick: onToggle, className: "flex-1 flex items-center gap-3 text-left", children: [ /*#__PURE__*/ _jsx("span", { className: "text-sm font-semibold text-gray-800 flex-1", children: localTitle || card.title }), hasVisibilityIssues && /*#__PURE__*/ _jsx("span", { className: "inline-flex items-center justify-center w-5 h-5 rounded-full bg-amber-500 text-white text-xs font-bold", title: t('profile.card.visibility_issue', 'Card is not shown in offers'), children: "!" }), /*#__PURE__*/ _jsx("span", { className: "text-gray-400 text-xs", children: isOpen ? '▲' : 'â–Œ' }) ] }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>updatePublicationStatus(localPublicationStatus === 'active' ? 'inactive' : localPublicationStatus === 'pending' ? 'inactive' : 'pending'), className: "px-3 py-1.5 rounded-lg text-xs font-medium whitespace-nowrap ".concat(localPublicationStatus === 'active' ? 'bg-red-50 text-red-700 hover:bg-red-100' : localPublicationStatus === 'pending' ? 'bg-amber-50 text-amber-700 hover:bg-amber-100' : 'bg-green-50 text-green-700 hover:bg-green-100'), children: localPublicationStatus === 'active' ? t('profile.card.unpublish', 'Unpublish') : localPublicationStatus === 'pending' ? t('profile.card.withdraw_review', 'Withdraw request') : t('profile.card.submit_review', 'Submit for review') }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: onDelete, className: "text-red-400 hover:text-red-600 text-sm px-1 flex-shrink-0", title: t('profile.card.delete'), children: "\uD83D\uDDD1" }) ] }), isOpen && /*#__PURE__*/ _jsxs("div", { children: [ hasVisibilityIssues && /*#__PURE__*/ _jsxs("div", { className: "mx-4 mt-4 mb-2 rounded-lg border border-amber-300 bg-amber-50 p-3", children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs font-semibold text-amber-900", children: t('profile.card.visibility_issue', 'Card is not shown in offers') }), /*#__PURE__*/ _jsx("ul", { className: "mt-1.5 list-disc pl-4 text-xs text-amber-900 space-y-0.5", children: visibilityIssues.map((issue)=>/*#__PURE__*/ _jsx("li", { children: issue }, issue)) }) ] }), effectiveModerationNotice && /*#__PURE__*/ _jsxs("div", { className: "mx-4 mt-4 mb-2 rounded-lg border p-3 ".concat(effectiveModerationNotice.tone === 'green' ? 'border-green-300 bg-green-50' : effectiveModerationNotice.tone === 'red' ? 'border-red-300 bg-red-50' : 'border-amber-300 bg-amber-50'), children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs font-semibold ".concat(effectiveModerationNotice.tone === 'green' ? 'text-green-900' : effectiveModerationNotice.tone === 'red' ? 'text-red-900' : 'text-amber-900'), children: effectiveModerationNotice.title }), effectiveModerationNotice.body && /*#__PURE__*/ _jsx("p", { className: "mt-1 text-xs ".concat(effectiveModerationNotice.tone === 'green' ? 'text-green-800' : effectiveModerationNotice.tone === 'red' ? 'text-red-800' : 'text-amber-800'), children: effectiveModerationNotice.body }) ] }), /*#__PURE__*/ _jsx("div", { className: "flex overflow-x-auto border-b border-gray-100 bg-gray-50 gap-0", children: cardTabs.filter((t)=>!t.hidden).map((t)=>/*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setCardTab(t.id), className: "px-4 py-2.5 text-xs font-medium whitespace-nowrap border-b-2 transition -mb-px ".concat(cardTab === t.id ? 'border-green-500 text-green-600 bg-white' : 'border-transparent text-gray-500 hover:text-gray-700'), children: t.label }, t.id)) }), /*#__PURE__*/ _jsxs("div", { className: "p-4", children: [ cardTab === 'main' && /*#__PURE__*/ _jsxs("div", { className: "space-y-3", children: [ /*#__PURE__*/ _jsx("input", { value: localTitle, onChange: (e)=>setLocalTitle(e.target.value), maxLength: 200, placeholder: t('profile.cards.new_title'), 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" }), (()=>{ const activeLocale = [ 'el', 'en', 'ru', 'uk' ].includes(locale) ? locale : 'el'; const descMap = { el: [ localDescEl, setLocalDescEl ], en: [ localDescEn, setLocalDescEn ], ru: [ localDescRu, setLocalDescRu ], uk: [ localDescUk, setLocalDescUk ] }; const [val, setVal] = descMap[activeLocale]; const flags = { el: '🇬🇷', en: '🇬🇧', ru: '🇷🇺', uk: '🇺🇊' }; const otherLocales = [ 'el', 'en', 'ru', 'uk' ].filter((l)=>l !== activeLocale); const otherHasContent = otherLocales.some((l)=>descMap[l][0]); return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-1.5 text-xs font-medium text-gray-500 mb-1", children: [ flags[activeLocale], " ", t('profile.card.description', 'Description') ] }), /*#__PURE__*/ _jsx("textarea", { value: val, onChange: (e)=>setVal(e.target.value), rows: 4, maxLength: 2000, placeholder: t('profile.bio.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" }), val && /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-1", children: t('profile.card.desc_auto_translate', 'Will be automatically translated into other languages on save') }), otherHasContent && /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-1.5 mt-1.5", children: [ /*#__PURE__*/ _jsx("span", { className: "text-xs text-gray-400", children: t('profile.card.desc_translated', 'Translations available:') }), otherLocales.map((l)=>/*#__PURE__*/ _jsx("span", { className: "text-xs px-1.5 py-0.5 rounded-full ".concat(descMap[l][0] ? 'bg-green-50 text-green-600' : 'bg-gray-100 text-gray-400'), children: flags[l] }, l)) ] }) ] }); })() ] }), cardTab === 'skills' && /*#__PURE__*/ _jsxs("div", { className: "space-y-3", children: [ localSkills.length > 0 && /*#__PURE__*/ _jsx("div", { className: "flex flex-wrap gap-2", children: localSkills.map((s)=>/*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-1.5 bg-green-50 text-green-700 text-sm px-3 py-1 rounded-full", children: [ s, /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setLocalSkills(localSkills.filter((x)=>x !== s)), className: "text-gray-400 hover:text-green-700 leading-none", children: "\xd7" }) ] }, s)) }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-2", children: [ /*#__PURE__*/ _jsx("input", { value: skillInput, onChange: (e)=>setSkillInput(e.target.value), onKeyDown: (e)=>{ if (e.key === 'Enter') { e.preventDefault(); addSkill(skillInput); } }, placeholder: t('profile.card.skill.add'), 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" }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>addSkill(skillInput), className: "px-3 py-2 bg-gray-100 hover:bg-gray-200 rounded-lg text-sm font-medium", children: "+" }) ] }), apiSkillSugs.length > 0 && /*#__PURE__*/ _jsx("div", { className: "flex flex-wrap gap-1.5", children: apiSkillSugs.map((s)=>{ var _s_names_catLocale; return (_s_names_catLocale = s.names[catLocale]) !== null && _s_names_catLocale !== void 0 ? _s_names_catLocale : s.names.el; }).filter((name, i, arr)=>arr.indexOf(name) === i && !localSkills.includes(name)).slice(0, 16).map((name)=>/*#__PURE__*/ _jsxs("button", { type: "button", onClick: ()=>addSkill(name), className: "text-xs px-2.5 py-1 border border-gray-200 rounded-full text-gray-500 hover:border-green-400 hover:text-green-600 transition", children: [ "+ ", name ] }, name)) }) ] }), cardTab === 'categories' && /*#__PURE__*/ _jsx("div", { className: "space-y-3", children: categories.map((cat)=>{ var _cat_names, _cat_names1; var _cat_names_catLocale, _ref; const catName = (_ref = (_cat_names_catLocale = (_cat_names = cat.names) === null || _cat_names === void 0 ? void 0 : _cat_names[catLocale]) !== null && _cat_names_catLocale !== void 0 ? _cat_names_catLocale : (_cat_names1 = cat.names) === null || _cat_names1 === void 0 ? void 0 : _cat_names1.el) !== null && _ref !== void 0 ? _ref : cat.slug; var _cat_children; const children = (_cat_children = cat.children) !== null && _cat_children !== void 0 ? _cat_children : []; const childSlugs = children.map((c)=>c.slug); return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-2.5 cursor-pointer", children: [ /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: localCategories.includes(cat.slug), onChange: ()=>toggleCategory(cat.slug, childSlugs), className: "w-4 h-4 rounded border-gray-300 text-green-600 focus:ring-blue-400" }), /*#__PURE__*/ _jsxs("span", { className: "text-sm font-medium text-gray-800 inline-flex items-center gap-1", children: [ cat.icon && /*#__PURE__*/ _jsx(CategoryIcon, { icon: cat.icon, alt: catName, className: isCategoryIconUrl(cat.icon) ? 'h-4 w-4 object-contain' : 'text-sm leading-none', fallback: "\uD83D\uDCE6" }), catName ] }) ] }), children.length > 0 && /*#__PURE__*/ _jsx("div", { className: "ml-6 mt-2 space-y-2", children: children.map((sub)=>{ var _sub_names, _sub_names1; var _sub_names_catLocale, _ref; const subName = (_ref = (_sub_names_catLocale = (_sub_names = sub.names) === null || _sub_names === void 0 ? void 0 : _sub_names[catLocale]) !== null && _sub_names_catLocale !== void 0 ? _sub_names_catLocale : (_sub_names1 = sub.names) === null || _sub_names1 === void 0 ? void 0 : _sub_names1.el) !== null && _ref !== void 0 ? _ref : sub.slug; return /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-2.5 cursor-pointer", children: [ /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: localCategories.includes(sub.slug), onChange: ()=>toggleCategory(sub.slug), className: "w-4 h-4 rounded border-gray-300 text-green-600 focus:ring-blue-400" }), /*#__PURE__*/ _jsx("span", { className: "text-sm text-gray-600", children: subName }) ] }, sub.id); }) }) ] }, cat.id); }) }), cardTab === 'geography' && /*#__PURE__*/ _jsx("div", { className: "space-y-3", children: locationTree.map((city)=>{ var _city_names, _city_names1; var _city_names_catLocale, _ref; const cityName = (_ref = (_city_names_catLocale = (_city_names = city.names) === null || _city_names === void 0 ? void 0 : _city_names[catLocale]) !== null && _city_names_catLocale !== void 0 ? _city_names_catLocale : (_city_names1 = city.names) === null || _city_names1 === void 0 ? void 0 : _city_names1.el) !== null && _ref !== void 0 ? _ref : city.slug; var _city_children; const districts = (_city_children = city.children) !== null && _city_children !== void 0 ? _city_children : []; const districtSlugs = districts.map((d)=>d.slug); return /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-2.5 cursor-pointer", children: [ /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: localLocations.includes(city.slug), onChange: ()=>toggleLocation(city.slug, districtSlugs), className: "w-4 h-4 rounded border-gray-300 text-green-600 focus:ring-blue-400" }), /*#__PURE__*/ _jsx("span", { className: "text-sm font-medium text-gray-800", children: cityName }) ] }), districts.length > 0 && /*#__PURE__*/ _jsx("div", { className: "ml-6 mt-2 space-y-2", children: districts.map((d)=>{ var _d_names, _d_names1; var _d_names_catLocale, _ref; const dName = (_ref = (_d_names_catLocale = (_d_names = d.names) === null || _d_names === void 0 ? void 0 : _d_names[catLocale]) !== null && _d_names_catLocale !== void 0 ? _d_names_catLocale : (_d_names1 = d.names) === null || _d_names1 === void 0 ? void 0 : _d_names1.el) !== null && _ref !== void 0 ? _ref : d.slug; return /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-2.5 cursor-pointer", children: [ /*#__PURE__*/ _jsx("input", { type: "checkbox", checked: localLocations.includes(d.slug), onChange: ()=>toggleLocation(d.slug), className: "w-4 h-4 rounded border-gray-300 text-green-600 focus:ring-blue-400" }), /*#__PURE__*/ _jsx("span", { className: "text-sm text-gray-600", children: dName }) ] }, d.id); }) }) ] }, city.id); }) }), cardTab === 'pricelist' && /*#__PURE__*/ _jsx("div", { className: "space-y-4", children: priceListLoading ? /*#__PURE__*/ _jsx("div", { className: "text-center py-6 text-gray-400 text-sm", children: t('common.loading', 'Loading...') }) : /*#__PURE__*/ _jsxs(_Fragment, { children: [ priceList.length === 0 && /*#__PURE__*/ _jsx("div", { className: "text-center py-6 text-gray-400 text-sm border-2 border-dashed border-gray-200 rounded-xl", children: t('profile.card.pricelist.empty') }), priceList.map((group)=>/*#__PURE__*/ _jsxs("div", { className: "border border-gray-200 rounded-xl overflow-hidden", children: [ /*#__PURE__*/ _jsx("div", { className: "flex items-center gap-2 bg-gray-50 px-4 py-2.5 border-b border-gray-200", children: editingGroupId === group.id ? /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx("input", { value: editGroupTitle, onChange: (e)=>setEditGroupTitle(e.target.value), className: "flex-1 border border-gray-300 rounded-lg px-3 py-1.5 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400", onKeyDown: (e)=>{ if (e.key === 'Enter') handleSaveGroupTitle(group.id); }, autoFocus: true }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>handleSaveGroupTitle(group.id), className: "px-3 py-1.5 bg-green-600 text-white rounded-lg text-xs font-medium hover:bg-green-700", children: t('profile.card.pricelist.save_group') }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setEditingGroupId(null), className: "px-2 py-1.5 text-gray-500 hover:text-gray-700 text-xs", children: "✕" }) ] }) : /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx("span", { className: "flex-1 font-semibold text-sm text-gray-800", children: group.title }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>{ setEditingGroupId(group.id); setEditGroupTitle(group.title); }, className: "text-gray-400 hover:text-green-600 text-xs px-2 py-1 rounded hover:bg-green-50", children: "✏" }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>handleDeleteGroup(group.id), className: "text-gray-400 hover:text-red-500 text-xs px-2 py-1 rounded hover:bg-red-50", children: t('profile.card.pricelist.delete_group') }) ] }) }), /*#__PURE__*/ _jsx("div", { className: "divide-y divide-gray-100", children: group.items.map((item)=>/*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 px-4 py-2.5 text-sm group", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ _jsx("p", { className: "font-medium text-gray-800 truncate", children: item.name }), item.description && /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-500 truncate", children: item.description }) ] }), (item.price || item.unit) && /*#__PURE__*/ _jsxs("span", { className: "text-green-700 font-semibold text-sm whitespace-nowrap", children: [ item.price ? "€".concat(item.price) : '', item.unit ? " ".concat(item.unit) : '' ] }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>handleDeleteItem(item.id, group.id), className: "opacity-0 group-hover:opacity-100 text-red-400 hover:text-red-600 text-xs px-1 transition", children: t('profile.card.pricelist.delete_item') }) ] }, item.id)) }), addingGroupId === group.id ? /*#__PURE__*/ _jsxs("div", { className: "p-3 bg-green-50 border-t border-green-100 space-y-2", children: [ /*#__PURE__*/ _jsx("input", { placeholder: t('profile.card.pricelist.item_name'), value: newItem.name, onChange: (e)=>setNewItem((p)=>({ ...p, name: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }), /*#__PURE__*/ _jsx("input", { placeholder: t('profile.card.pricelist.item_desc'), value: newItem.description, onChange: (e)=>setNewItem((p)=>({ ...p, description: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-2", children: [ /*#__PURE__*/ _jsx("input", { placeholder: t('profile.card.pricelist.item_price'), value: newItem.price, onChange: (e)=>setNewItem((p)=>({ ...p, price: e.target.value })), className: "w-28 border border-gray-300 rounded-lg px-3 py-1.5 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }), /*#__PURE__*/ _jsx("input", { placeholder: t('profile.card.pricelist.item_unit'), value: newItem.unit, onChange: (e)=>setNewItem((p)=>({ ...p, unit: e.target.value })), className: "flex-1 border border-gray-300 rounded-lg px-3 py-1.5 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-2", children: [ /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>handleAddItem(group.id), className: "px-4 py-1.5 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700", children: t('profile.card.pricelist.save_item') }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>{ setAddingGroupId(null); setNewItem({ name: '', description: '', price: '', unit: '' }); }, className: "px-3 py-1.5 text-gray-500 hover:text-gray-700 text-sm", children: "✕" }) ] }) ] }) : /*#__PURE__*/ _jsx("div", { className: "px-4 py-2 border-t border-gray-100", children: /*#__PURE__*/ _jsxs("button", { type: "button", onClick: ()=>setAddingGroupId(group.id), className: "text-green-600 hover:text-gray-800 text-sm font-medium", children: [ "+ ", t('profile.card.pricelist.add_item') ] }) }) ] }, group.id)), /*#__PURE__*/ _jsxs("div", { className: "flex gap-2 pt-1", children: [ /*#__PURE__*/ _jsx("input", { placeholder: t('profile.card.pricelist.group_title'), value: newGroupTitle, onChange: (e)=>setNewGroupTitle(e.target.value), onKeyDown: (e)=>{ if (e.key === 'Enter') handleAddGroup(); }, 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" }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: handleAddGroup, className: "px-4 py-2 bg-green-600 hover:bg-green-700 text-white rounded-lg text-sm font-medium", children: t('profile.card.pricelist.add_group') }) ] }) ] }) }), cardTab === 'portfolio' && /*#__PURE__*/ _jsxs("div", { className: "space-y-3", children: [ portfolio.length < 20 && /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>{ var _portfolioFileRef_current; return (_portfolioFileRef_current = portfolioFileRef.current) === null || _portfolioFileRef_current === void 0 ? void 0 : _portfolioFileRef_current.click(); }, disabled: portfolioUploading, className: "flex items-center gap-2 px-4 py-2 bg-green-600 hover:bg-green-700 text-white rounded-lg text-sm font-medium disabled:opacity-50", children: portfolioUploading ? /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx("span", { className: "w-4 h-4 border-2 border-white border-t-transparent rounded-full animate-spin" }), t('profile.card.photo.uploading') ] }) : /*#__PURE__*/ _jsxs(_Fragment, { children: [ "\uD83D\uDCF7 ", t('profile.card.photo.add') ] }) }), /*#__PURE__*/ _jsx("input", { ref: portfolioFileRef, type: "file", accept: "image/jpeg,image/png,image/webp", className: "hidden", onChange: handlePortfolioUpload }) ] }), portfolio.length === 0 ? /*#__PURE__*/ _jsx("div", { className: "text-center py-8 text-gray-400 text-sm border-2 border-dashed border-gray-200 rounded-xl", children: t('profile.card.photo.empty') }) : /*#__PURE__*/ _jsx("div", { className: "grid grid-cols-2 sm:grid-cols-3 gap-3", children: portfolio.map((item)=>{ var _item_title; return /*#__PURE__*/ _jsxs("div", { className: "group relative rounded-xl overflow-hidden border border-gray-200 bg-gray-50", children: [ /*#__PURE__*/ _jsx("img", { src: item.imageUrl, alt: (_item_title = item.title) !== null && _item_title !== void 0 ? _item_title : '', className: "w-full aspect-square object-cover" }), /*#__PURE__*/ _jsxs("div", { className: "absolute inset-0 bg-black/0 group-hover:bg-black/50 transition-all flex flex-col justify-between p-2", children: [ /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>handlePortfolioDelete(item.id), className: "self-end opacity-0 group-hover:opacity-100 transition w-7 h-7 rounded-full bg-red-500 text-white text-sm flex items-center justify-center hover:bg-red-600", children: "\xd7" }), /*#__PURE__*/ _jsxs("button", { type: "button", onClick: ()=>{ setEditingItem(item); var _item_title; setEditTitle((_item_title = item.title) !== null && _item_title !== void 0 ? _item_title : ''); var _item_description; setEditDesc((_item_description = item.description) !== null && _item_description !== void 0 ? _item_description : ''); }, className: "opacity-0 group-hover:opacity-100 transition text-xs text-white bg-black/50 hover:bg-black/70 rounded-lg px-2 py-1", children: [ "✏ ", t('profile.card.item.edit') ] }) ] }), item.title && /*#__PURE__*/ _jsx("div", { className: "px-2 py-1.5", children: /*#__PURE__*/ _jsx("p", { className: "text-xs font-medium text-gray-700 truncate", children: item.title }) }) ] }, item.id); }) }) ] }), cardTab !== 'portfolio' && cardTab !== 'pricelist' && /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 mt-4 pt-4 border-t border-gray-100", children: [ /*#__PURE__*/ _jsx("button", { type: "button", disabled: saving, onClick: saveAll, className: "px-5 py-2 bg-green-600 hover:bg-green-700 text-white rounded-lg text-sm font-semibold disabled:opacity-50", children: saving ? '...' : t('profile.card.save') }), savedOk && /*#__PURE__*/ _jsxs("span", { className: "text-sm text-green-600", children: [ "✓ ", t('profile.card.saved') ] }) ] }) ] }) ] }), editingItem && /*#__PURE__*/ _jsx("div", { className: "fixed inset-0 z-50 flex items-center justify-center bg-black/50 px-4", children: /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-2xl shadow-xl p-6 w-full max-w-md", children: [ /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-gray-800 mb-4", children: t('profile.card.item.edit') }), /*#__PURE__*/ _jsx("img", { src: editingItem.imageUrl, alt: "", className: "w-full h-40 object-cover rounded-xl mb-4" }), /*#__PURE__*/ _jsxs("div", { className: "space-y-3", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('profile.card.item.title') }), /*#__PURE__*/ _jsx("input", { value: editTitle, onChange: (e)=>setEditTitle(e.target.value), maxLength: 200, 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" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('profile.card.item.desc') }), /*#__PURE__*/ _jsx("textarea", { value: editDesc, onChange: (e)=>setEditDesc(e.target.value), rows: 3, maxLength: 1000, 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" }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-3 mt-5", children: [ /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>handlePortfolioSave(editingItem.id), className: "flex-1 bg-green-600 hover:bg-green-700 text-white py-2 rounded-lg text-sm font-medium", children: t('profile.card.item.save') }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setEditingItem(null), className: "flex-1 bg-gray-100 hover:bg-gray-200 text-gray-700 py-2 rounded-lg text-sm font-medium", children: t('profile.card.item.cancel') }) ] }) ] }) }) ] }); } // ─── AutoResponseTab ─────────────────────────────────────────────────────── function AutoResponseTab(param) { let { categories, locationTree, loaded, onLoad, settings, saving, saved, onSave, t, catLocale } = param; const { useEffect: _ue, useState: _us } = { useEffect, useState }; const [enabled, setEnabled] = _us(false); const [minBudget, setMinBudget] = _us(''); const [maxBudget, setMaxBudget] = _us(''); const [defaultPrice, setDefaultPrice] = _us(''); const [defaultMessage, setDefaultMessage] = _us(''); const [maxPerDay, setMaxPerDay] = _us(''); const [selCategories, setSelCategories] = _us([]); const [selLocations, setSelLocations] = _us([]); _ue(()=>{ onLoad(); }, []); _ue(()=>{ if (!settings) return; setEnabled(settings.enabled); setMinBudget(settings.minBudget != null ? String(settings.minBudget) : ''); setMaxBudget(settings.maxBudget != null ? String(settings.maxBudget) : ''); setDefaultPrice(settings.defaultPrice != null ? String(settings.defaultPrice) : ''); var _settings_defaultMessage; setDefaultMessage((_settings_defaultMessage = settings.defaultMessage) !== null && _settings_defaultMessage !== void 0 ? _settings_defaultMessage : ''); setMaxPerDay(settings.maxAutoOffersPerDay != null ? String(settings.maxAutoOffersPerDay) : ''); var _settings_categories; setSelCategories((_settings_categories = settings.categories) !== null && _settings_categories !== void 0 ? _settings_categories : []); var _settings_locations; setSelLocations((_settings_locations = settings.locations) !== null && _settings_locations !== void 0 ? _settings_locations : []); }, [ settings ]); if (!loaded) return /*#__PURE__*/ _jsx("div", { className: "text-center py-10 text-white/60", children: t('common.loading') }); const flatLocations = []; function flatten(nodes) { for (const n of nodes){ var _n_children; flatLocations.push({ id: n.id, name: n.name }); if ((_n_children = n.children) === null || _n_children === void 0 ? void 0 : _n_children.length) flatten(n.children); } } flatten(locationTree); return /*#__PURE__*/ _jsxs("div", { className: "space-y-4", children: [ /*#__PURE__*/ _jsx("div", { className: "bg-white rounded-xl border border-gray-200 p-5", children: /*#__PURE__*/ _jsxs("label", { className: "flex items-center justify-between cursor-pointer", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "font-medium text-gray-800", children: t('auto_response.title', 'Auto response') }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-0.5", children: t('auto_response.desc', 'Automatically respond to matching tasks') }) ] }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setEnabled((v)=>!v), className: "relative inline-flex h-6 w-11 items-center rounded-full transition-colors ".concat(enabled ? 'bg-green-500' : 'bg-gray-300'), children: /*#__PURE__*/ _jsx("span", { className: "inline-block h-4 w-4 transform rounded-full bg-white shadow transition-transform ".concat(enabled ? 'translate-x-6' : 'translate-x-1') }) }) ] }) }), /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-5 space-y-4", children: [ /*#__PURE__*/ _jsx("h3", { className: "font-medium text-gray-800 text-sm", children: t('auto_response.budget_range', 'Task budget') }), /*#__PURE__*/ _jsxs("div", { className: "grid grid-cols-2 gap-3", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs text-gray-500 mb-1", children: t('auto_response.min_budget', 'Min €') }), /*#__PURE__*/ _jsx("input", { type: "number", min: "0", value: minBudget, onChange: (e)=>setMinBudget(e.target.value), placeholder: "0", 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" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs text-gray-500 mb-1", children: t('auto_response.max_budget', 'Max €') }), /*#__PURE__*/ _jsx("input", { type: "number", min: "0", value: maxBudget, onChange: (e)=>setMaxBudget(e.target.value), placeholder: "∞", className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs text-gray-500 mb-1", children: t('auto_response.default_price', 'Default price €') }), /*#__PURE__*/ _jsx("input", { type: "number", min: "0", value: defaultPrice, onChange: (e)=>setDefaultPrice(e.target.value), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs text-gray-500 mb-1", children: t('auto_response.max_per_day', 'Max auto-offers/day') }), /*#__PURE__*/ _jsx("input", { type: "number", min: "1", max: "50", value: maxPerDay, onChange: (e)=>setMaxPerDay(e.target.value), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-5", children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs text-gray-500 mb-1", children: t('auto_response.default_message', 'Auto-response text') }), /*#__PURE__*/ _jsx("textarea", { value: defaultMessage, onChange: (e)=>setDefaultMessage(e.target.value), rows: 4, maxLength: 2000, placeholder: t('auto_response.message_placeholder', 'Hello! I can help with this task...'), 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" }) ] }), categories.length > 0 && /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-5", children: [ /*#__PURE__*/ _jsx("h3", { className: "font-medium text-gray-800 text-sm mb-3", children: t('auto_response.categories', 'Task categories') }), /*#__PURE__*/ _jsx("div", { className: "flex flex-wrap gap-2 max-h-40 overflow-y-auto", children: categories.flatMap((cat)=>{ var _cat_children; return [ cat, ...(_cat_children = cat.children) !== null && _cat_children !== void 0 ? _cat_children : [] ]; }).map((cat)=>{ var _cat_names, _cat_names1; var _cat_names_catLocale, _ref; const name = (_ref = (_cat_names_catLocale = (_cat_names = cat.names) === null || _cat_names === void 0 ? void 0 : _cat_names[catLocale]) !== null && _cat_names_catLocale !== void 0 ? _cat_names_catLocale : (_cat_names1 = cat.names) === null || _cat_names1 === void 0 ? void 0 : _cat_names1.el) !== null && _ref !== void 0 ? _ref : cat.slug; const sel = selCategories.includes(cat.slug); return /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setSelCategories(sel ? selCategories.filter((c)=>c !== cat.slug) : [ ...selCategories, cat.slug ]), className: "px-3 py-1.5 rounded-lg text-xs border transition ".concat(sel ? 'bg-green-600 border-green-600 text-white' : 'bg-white border-gray-300 text-gray-700 hover:border-green-400'), children: name }, cat.slug); }) }) ] }), /*#__PURE__*/ _jsx("button", { type: "button", disabled: saving, onClick: ()=>onSave({ enabled, minBudget: minBudget ? Number(minBudget) : null, maxBudget: maxBudget ? Number(maxBudget) : null, defaultPrice: defaultPrice ? Number(defaultPrice) : null, defaultMessage: defaultMessage || null, maxAutoOffersPerDay: maxPerDay ? Number(maxPerDay) : null, categories: selCategories.length > 0 ? selCategories : null, locations: selLocations.length > 0 ? selLocations : null }), className: "w-full bg-green-600 text-white py-3 rounded-xl font-semibold hover:bg-green-700 disabled:opacity-50", children: saving ? t('common.loading') : saved ? t('auto_response.saved', 'Saved ✓') : t('common.save') }) ] }); } export default function ProfilePage() { return /*#__PURE__*/ _jsx(Suspense, { fallback: null, children: /*#__PURE__*/ _jsx(ProfilePageInner, {}) }); } function ProfilePageInner() { var _user_firstName, _user_lastName, _dashData_features, _dashData_features1, _dashData_features2, _user_plan, _user_plan1, _user_plan2, _dashData_features3, _dashData_features4, _dashData_plan, _dashData_plan1, _user_plan3; const router = useRouter(); const searchParams = useSearchParams(); const { data: session, isPending } = useSession(); const { t, locale } = useLocale(); const validTabs = [ 'info', 'finance', 'cards', 'notifications', 'reviews', 'referral', 'auto_response', 'site' ]; var _searchParams_get; const initialTab = (_searchParams_get = searchParams.get('tab')) !== null && _searchParams_get !== void 0 ? _searchParams_get : 'info'; const [activeTab, setActiveTab] = useState(validTabs.includes(initialTab) ? initialTab : 'info'); const [user, setUser] = useState(null); const [loading, setLoading] = useState(true); const [saving, setSaving] = useState(false); const [saved, setSaved] = useState(false); const [error, setError] = useState(''); const [formData, setFormData] = useState({ firstName: '', lastName: '', phone: '', bio: '', locale: 'el' }); const [selectedLanguages, setSelectedLanguages] = useState([]); // Specialist cards const [cards, setCards] = useState([]); const [maxCards, setMaxCards] = useState(1); const [cardsLoading, setCardsLoading] = useState(false); const [cardNotifications, setCardNotifications] = useState([]); const [openCardId, setOpenCardId] = useState(null); const [creatingCard, setCreatingCard] = useState(false); const [newCardTitle, setNewCardTitle] = useState(''); const [showNewCardForm, setShowNewCardForm] = useState(false); const [showUpgradeModal, setShowUpgradeModal] = useState(false); // Reference data const [categories, setCategories] = useState([]); const [locationTree, setLocationTree] = useState([]); // Become specialist const [becomingSpecialist, setBecomingSpecialist] = useState(false); const [avatarUploading, setAvatarUploading] = useState(false); const [backgroundUploading, setBackgroundUploading] = useState(false); const fileRef = useRef(null); const backgroundFileRef = useRef(null); // Notification preferences const [notifyNewTasks, setNotifyNewTasks] = useState(false); const [notifMessages, setNotifMessages] = useState(true); const [notifySaving, setNotifySaving] = useState(false); const [notifySaved, setNotifySaved] = useState(false); // Email verification resend const [resendState, setResendState] = useState('idle'); // Referral info const [referralCode, setReferralCode] = useState(null); const [referralCount, setReferralCount] = useState(0); const [referralCopied, setReferralCopied] = useState(false); const [referralLoaded, setReferralLoaded] = useState(false); // Balance top-up modal const [showTopUpModal, setShowTopUpModal] = useState(false); const [topUpAmount, setTopUpAmount] = useState(10); const [topUpLoading, setTopUpLoading] = useState(false); const [topUpError, setTopUpError] = useState(''); const [balanceHistory, setBalanceHistory] = useState([]); const [planHistory, setPlanHistory] = useState([]); // Plan data + statuses const [dashData, setDashData] = useState(null); const [myStatuses, setMyStatuses] = useState([]); const [statusToggling, setStatusToggling] = useState(null); const [personalSiteSlug, setPersonalSiteSlug] = useState(''); const [slugSaving, setSlugSaving] = useState(false); const [slugSaved, setSlugSaved] = useState(false); const [slugCopied, setSlugCopied] = useState(false); const [slugError, setSlugError] = useState(''); const [showContactInfo, setShowContactInfo] = useState(false); const [siteSettings, setSiteSettings] = useState({}); const [siteSettingsSaving, setSiteSettingsSaving] = useState(false); const [siteStats, setSiteStats] = useState(null); const [siteStatsLoading, setSiteStatsLoading] = useState(false); const [autoResponse, setAutoResponse] = useState(null); const [arLoaded, setArLoaded] = useState(false); const [arSaving, setArSaving] = useState(false); const [arSaved, setArSaved] = useState(false); async function handleTopUp() { const amount = Number(topUpAmount); if (!amount || amount < 1) return; setTopUpLoading(true); setTopUpError(''); try { const { url, params } = await api.initiateTopUp(amount); // Build and auto-submit form to ePay const form = document.createElement('form'); form.method = 'POST'; form.action = url; Object.entries(params).forEach((param)=>{ let [k, v] = param; const input = document.createElement('input'); input.type = 'hidden'; input.name = k; input.value = v; form.appendChild(input); }); document.body.appendChild(form); form.submit(); } catch (e) { setTopUpError((e === null || e === void 0 ? void 0 : e.message) || t('profile.balance.topup.error')); setTopUpLoading(false); } } async function handleResendVerification() { if (!(user === null || user === void 0 ? void 0 : user.email) || resendState !== 'idle') return; setResendState('sending'); const callbackURL = "".concat(window.location.origin, "/profile"); const result = await authClient.sendVerificationEmail({ email: user.email, callbackURL }); if (result === null || result === void 0 ? void 0 : result.error) { setResendState('idle'); } else { setResendState('sent'); } } useEffect(()=>{ if (activeTab !== 'referral' || referralLoaded) return; api.getMyReferralInfo().then((r)=>{ setReferralCode(r.referralCode); setReferralCount(r.referralCount); }).catch(()=>{}).finally(()=>setReferralLoaded(true)); }, [ activeTab ]); // Reviews const [myReviews, setMyReviews] = useState(null); const [reviewsLoading, setReviewsLoading] = useState(false); const [myRating, setMyRating] = useState(null); useEffect(()=>{ if (activeTab !== 'reviews' || myReviews !== null || reviewsLoading) return; setReviewsLoading(true); api.getMyReviews().then(setMyReviews).catch(()=>setMyReviews([])).finally(()=>setReviewsLoading(false)); }, [ activeTab ]); useEffect(()=>{ if (activeTab !== 'site' || siteStats !== null || siteStatsLoading) return; setSiteStatsLoading(true); api.getSiteStats().then((res)=>setSiteStats(res.days)).catch(()=>setSiteStats([])).finally(()=>setSiteStatsLoading(false)); }, [ activeTab ]); useEffect(()=>{ if (!isPending && !session) router.push('/login'); }, [ session, isPending ]); useEffect(()=>{ if (!session) return; Promise.all([ api.request('/users/me'), api.getCategories(), api.getLocations(), api.getMyDashboard().catch(()=>null), api.getMyStatuses().catch(()=>[]), api.getBalanceHistory(8).catch(()=>[]), api.getPlanHistory(20).catch(()=>[]) ]).then((param)=>{ let [u, cats, locs, dash, statusRes, history, phist] = param; setUser(u); var _u_firstName, _u_lastName, _u_phone, _u_bio, _u_locale; setFormData({ firstName: (_u_firstName = u.firstName) !== null && _u_firstName !== void 0 ? _u_firstName : '', lastName: (_u_lastName = u.lastName) !== null && _u_lastName !== void 0 ? _u_lastName : '', phone: (_u_phone = u.phone) !== null && _u_phone !== void 0 ? _u_phone : '', bio: (_u_bio = u.bio) !== null && _u_bio !== void 0 ? _u_bio : '', locale: (_u_locale = u.locale) !== null && _u_locale !== void 0 ? _u_locale : 'el' }); var _u_languages; setSelectedLanguages((_u_languages = u.languages) !== null && _u_languages !== void 0 ? _u_languages : []); var _u_notifyNewTasks; setNotifyNewTasks((_u_notifyNewTasks = u.notifyNewTasks) !== null && _u_notifyNewTasks !== void 0 ? _u_notifyNewTasks : false); var _u_notifMessages; setNotifMessages((_u_notifMessages = u.notifMessages) !== null && _u_notifMessages !== void 0 ? _u_notifMessages : true); setCategories(cats); setLocationTree(locs); setDashData(dash); setMyStatuses((statusRes !== null && statusRes !== void 0 ? statusRes : []).filter((s)=>s.isActive).map((s)=>s.statusType)); setBalanceHistory(history); setPlanHistory(phist); var _u_personalSiteSlug; setPersonalSiteSlug((_u_personalSiteSlug = u.personalSiteSlug) !== null && _u_personalSiteSlug !== void 0 ? _u_personalSiteSlug : ''); var _u_showContactInfo; setShowContactInfo((_u_showContactInfo = u.showContactInfo) !== null && _u_showContactInfo !== void 0 ? _u_showContactInfo : false); var _u_siteSettings; setSiteSettings((_u_siteSettings = u.siteSettings) !== null && _u_siteSettings !== void 0 ? _u_siteSettings : {}); loadCards(); api.getUserRating(u.id).then((r)=>setMyRating(r.avg)).catch(()=>{}); }).catch(()=>{}).finally(()=>setLoading(false)); }, [ session ]); async function loadCards() { setCardsLoading(true); try { const { cards: c, maxCards: m } = await api.getMySpecialistCards(); setCards(c); setMaxCards(m); setOpenCardId((prev)=>{ var _c_; var _c__id; return prev && c.some((card)=>card.id === prev) ? prev : (_c__id = (_c_ = c[0]) === null || _c_ === void 0 ? void 0 : _c_.id) !== null && _c__id !== void 0 ? _c__id : null; }); api.getNotifications().then((rows)=>setCardNotifications(rows.filter((row)=>[ 'specialist_card_submitted', 'specialist_card_approved', 'specialist_card_rejected' ].includes(row.type)))).catch(()=>setCardNotifications([])); } catch (e) {} finally{ setCardsLoading(false); } } async function handleSubmit(e) { e.preventDefault(); setError(''); setSaving(true); try { const updated = await api.request('/users/me', { method: 'PATCH', body: JSON.stringify({ firstName: formData.firstName, lastName: formData.lastName, phone: formData.phone || undefined, bio: formData.bio || undefined, bioLocale: formData.locale, autoTranslateBio: true, locale: formData.locale, languages: selectedLanguages, showContactInfo }) }); setUser(updated); setSaved(true); setTimeout(()=>setSaved(false), 2500); } catch (err) { setError(err.message || t('common.error')); } finally{ setSaving(false); } } async function handleBecomeSpecialist() { setBecomingSpecialist(true); setError(''); try { const updated = await api.request('/users/me/become-specialist', { method: 'POST' }); setUser(updated); setActiveTab('cards'); loadCards(); } catch (err) { setError(err.message || t('common.error')); } finally{ setBecomingSpecialist(false); } } async function handleSaveSiteSlug() { setSlugSaving(true); setSlugError(''); try { const updated = await api.request('/users/me', { method: 'PATCH', body: JSON.stringify({ personalSiteSlug: personalSiteSlug || null }) }); setUser(updated); var _updated_personalSiteSlug; setPersonalSiteSlug((_updated_personalSiteSlug = updated.personalSiteSlug) !== null && _updated_personalSiteSlug !== void 0 ? _updated_personalSiteSlug : ''); setSlugSaved(true); setTimeout(()=>setSlugSaved(false), 2500); } catch (err) { var _err_code; const code = (_err_code = err === null || err === void 0 ? void 0 : err.code) !== null && _err_code !== void 0 ? _err_code : ''; if (code === 'SLUG_TAKEN' || err.message === 'This URL is already taken') { setSlugError(t('profile.site.slug_taken', 'This address is already taken')); } else { setSlugError(err.message || t('common.error')); } } finally{ setSlugSaving(false); } } async function handleSaveSiteSettings(newSettings) { setSiteSettings(newSettings); setSiteSettingsSaving(true); try { await api.request('/users/me', { method: 'PATCH', body: JSON.stringify({ siteSettings: newSettings }) }); } catch (e) {} finally{ setSiteSettingsSaving(false); } } async function handleAvatarChange(e) { var _e_target_files; const file = (_e_target_files = e.target.files) === null || _e_target_files === void 0 ? void 0 : _e_target_files[0]; if (!file) return; setAvatarUploading(true); try { const form = new FormData(); form.append('file', file); const res = await fetch("".concat(process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000', "/api/uploads"), { method: 'POST', credentials: 'include', body: form }); if (!res.ok) throw new Error('Upload failed'); const { url } = await res.json(); const fullUrl = "".concat(process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000').concat(url); await api.request('/users/me', { method: 'PATCH', body: JSON.stringify({ image: fullUrl }) }); setUser((prev)=>({ ...prev, image: fullUrl })); } catch (e) { setError(t('profile.upload.error')); } finally{ setAvatarUploading(false); } } async function handleBackgroundChange(e) { var _e_target_files; const file = (_e_target_files = e.target.files) === null || _e_target_files === void 0 ? void 0 : _e_target_files[0]; if (!file) return; setBackgroundUploading(true); try { const form = new FormData(); form.append('file', file); const res = await fetch("".concat(process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000', "/api/uploads"), { method: 'POST', credentials: 'include', body: form }); if (!res.ok) throw new Error('Upload failed'); const { url } = await res.json(); const fullUrl = "".concat(process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000').concat(url); const nextSettings = { ...siteSettings, profileBackgroundImage: fullUrl }; await api.request('/users/me', { method: 'PATCH', body: JSON.stringify({ siteSettings: nextSettings }) }); setSiteSettings(nextSettings); setSaved(true); setTimeout(()=>setSaved(false), 2500); } catch (e) { setError(t('profile.upload.error')); } finally{ setBackgroundUploading(false); if (backgroundFileRef.current) backgroundFileRef.current.value = ''; } } async function handleRemoveBackground() { setBackgroundUploading(true); try { const nextSettings = { ...siteSettings, profileBackgroundImage: null }; await api.request('/users/me', { method: 'PATCH', body: JSON.stringify({ siteSettings: nextSettings }) }); setSiteSettings(nextSettings); setSaved(true); setTimeout(()=>setSaved(false), 2500); } catch (e) { setError(t('profile.upload.error')); } finally{ setBackgroundUploading(false); } } async function handleCreateCard() { if (!newCardTitle.trim()) return; setCreatingCard(true); try { const card = await api.createSpecialistCard({ title: newCardTitle.trim() }); setCards((prev)=>[ ...prev, card ]); setOpenCardId(card.id); setNewCardTitle(''); setShowNewCardForm(false); } catch (err) { setError(err.message || t('common.error')); } finally{ setCreatingCard(false); } } async function handleDeleteCard(id) { if (!confirm(t('profile.cards.delete_confirm'))) return; try { await api.deleteSpecialistCard(id); setCards((prev)=>{ var _next_; const next = prev.filter((c)=>c.id !== id); var _next__id; if (openCardId === id) setOpenCardId((_next__id = (_next_ = next[0]) === null || _next_ === void 0 ? void 0 : _next_.id) !== null && _next__id !== void 0 ? _next__id : null); return next; }); } catch (err) { setError(err.message || t('common.error')); } } if (isPending || loading) { return /*#__PURE__*/ _jsx("div", { className: "text-center py-20 text-white", children: t('common.loading') }); } const catLocale = locale === 'en' ? 'en' : locale === 'ru' ? 'ru' : locale === 'uk' ? 'uk' : 'el'; const dateLocale = locale === 'en' ? 'en-US' : locale === 'ru' ? 'ru-RU' : 'el-GR'; const isSpecialist = (user === null || user === void 0 ? void 0 : user.role) === 'specialist'; const isAdmin = (user === null || user === void 0 ? void 0 : user.role) === 'admin'; const showSpecialistTabs = isSpecialist || isAdmin; var _user_firstName_, _user_lastName_; const initials = user ? "".concat((_user_firstName_ = (_user_firstName = user.firstName) === null || _user_firstName === void 0 ? void 0 : _user_firstName[0]) !== null && _user_firstName_ !== void 0 ? _user_firstName_ : '').concat((_user_lastName_ = (_user_lastName = user.lastName) === null || _user_lastName === void 0 ? void 0 : _user_lastName[0]) !== null && _user_lastName_ !== void 0 ? _user_lastName_ : '').toUpperCase() : '?'; const hasAutoResponse = !!(dashData === null || dashData === void 0 ? void 0 : (_dashData_features = dashData.features) === null || _dashData_features === void 0 ? void 0 : _dashData_features.hasAutoResponse); var _formData_bio, _ref; const profileBio = String((_ref = (_formData_bio = formData.bio) !== null && _formData_bio !== void 0 ? _formData_bio : user === null || user === void 0 ? void 0 : user.bio) !== null && _ref !== void 0 ? _ref : '').trim(); const publishedCards = cards.filter((c)=>{ var _c_publicationStatus; return ((_c_publicationStatus = c.publicationStatus) !== null && _c_publicationStatus !== void 0 ? _c_publicationStatus : c.isActive ? 'active' : 'inactive') === 'active'; }); const hasPublishedCard = publishedCards.length > 0; const hasCardCategories = publishedCards.some((c)=>{ var _c_categories; var _c_categories_length; return ((_c_categories_length = (_c_categories = c.categories) === null || _c_categories === void 0 ? void 0 : _c_categories.length) !== null && _c_categories_length !== void 0 ? _c_categories_length : 0) > 0; }); const hasCardLocations = publishedCards.some((c)=>{ var _c_locations; var _c_locations_length; return ((_c_locations_length = (_c_locations = c.locations) === null || _c_locations === void 0 ? void 0 : _c_locations.length) !== null && _c_locations_length !== void 0 ? _c_locations_length : 0) > 0; }); const moderationNoticeByCardId = cardNotifications.reduce((acc, row)=>{ if (!row.referenceId || acc[row.referenceId]) return acc; const tone = row.type === 'specialist_card_approved' ? 'green' : row.type === 'specialist_card_rejected' ? 'red' : 'amber'; const localizedTitle = row.type === 'specialist_card_approved' ? t('profile.card.review_approved', 'Card approved') : row.type === 'specialist_card_rejected' ? t('profile.card.review_rejected', 'Card rejected') : t('profile.card.review_pending', 'Pending approval'); const localizedBody = row.type === 'specialist_card_approved' ? t('profile.card.review_approved_hint', 'Your card is now visible in offers.') : row.type === 'specialist_card_rejected' ? t('profile.card.review_rejected_hint', 'Your card was not approved. Please update it and submit again.') : t('profile.card.review_pending_hint', 'Your card is being reviewed by the admin team.'); acc[row.referenceId] = { title: localizedTitle, body: localizedBody, tone }; return acc; }, {}); const listingMissing = []; if (!profileBio) listingMissing.push(t('profile.listing_requirements.bio', 'Add a short bio in the main profile section')); if (!hasPublishedCard) listingMissing.push(t('profile.listing_requirements.published_card', 'Publish at least one card')); if (!hasCardCategories) listingMissing.push(t('profile.listing_requirements.categories', 'Add at least one category to the published card')); if (!hasCardLocations) listingMissing.push(t('profile.listing_requirements.locations', 'Add at least one location to the published card')); const tabNeedsAttention = { info: !profileBio, cards: listingMissing.length > 0 }; const tabIcons = { info: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15.75 6a3.75 3.75 0 11-7.5 0 3.75 3.75 0 017.5 0zM4.501 20.118a7.5 7.5 0 0114.998 0A17.933 17.933 0 0112 21.75c-2.676 0-5.216-.584-7.499-1.632z" }) }), finance: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 6v12m-3-2.818l.879.659c1.171.879 3.07.879 4.242 0 1.172-.879 1.172-2.303 0-3.182C13.536 12.219 12.768 12 12 12c-.725 0-1.45-.22-2.003-.659-1.106-.879-1.106-2.303 0-3.182s2.9-.879 4.006 0l.415.33M21 12a9 9 0 11-18 0 9 9 0 0118 0z" }) }), cards: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M20.25 14.15v4.073a2.25 2.25 0 01-2.25 2.25h-12a2.25 2.25 0 01-2.25-2.25V6a2.25 2.25 0 012.25-2.25h4.073M15.75 3h5.25v5.25M15.75 3l-9 9" }) }), notifications: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M14.857 17.082a23.848 23.848 0 005.454-1.31A8.967 8.967 0 0118 9.75v-.7V9A6 6 0 006 9v.75a8.967 8.967 0 01-2.312 6.022c1.733.64 3.56 1.085 5.455 1.31m5.714 0a24.255 24.255 0 01-5.714 0m5.714 0a3 3 0 11-5.714 0" }) }), reviews: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M11.48 3.499a.562.562 0 011.04 0l2.125 5.111a.563.563 0 00.475.345l5.518.442c.499.04.701.663.321.988l-4.204 3.602a.563.563 0 00-.182.557l1.285 5.385a.562.562 0 01-.84.61l-4.725-2.885a.562.562 0 00-.586 0L6.982 20.54a.562.562 0 01-.84-.61l1.285-5.386a.562.562 0 00-.182-.557l-4.204-3.602a.562.562 0 01.321-.988l5.518-.442a.563.563 0 00.475-.345L11.48 3.5z" }) }), referral: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M13.19 8.688a4.5 4.5 0 011.242 7.244l-4.5 4.5a4.5 4.5 0 01-6.364-6.364l1.757-1.757m13.35-.622l1.757-1.757a4.5 4.5 0 00-6.364-6.364l-4.5 4.5a4.5 4.5 0 001.242 7.244" }) }), auto_response: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9.813 15.904L9 18.75l-.813-2.846a4.5 4.5 0 00-3.09-3.09L2.25 12l2.846-.813a4.5 4.5 0 003.09-3.09L9 5.25l.813 2.846a4.5 4.5 0 003.09 3.09L15.75 12l-2.846.813a4.5 4.5 0 00-3.09 3.09z" }) }), site: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 21a9.004 9.004 0 008.716-6.747M12 21a9.004 9.004 0 01-8.716-6.747M12 21c2.485 0 4.5-4.03 4.5-9S14.485 3 12 3m0 18c-2.485 0-4.5-4.03-4.5-9S9.515 3 12 3m0 0a8.997 8.997 0 017.843 4.582M12 3a8.997 8.997 0 00-7.843 4.582m15.686 0A11.953 11.953 0 0112 10.5c-2.998 0-5.74-1.1-7.843-2.918m15.686 0A8.959 8.959 0 0121 12c0 .778-.099 1.533-.284 2.253m0 0A17.919 17.919 0 0112 16.5c-3.162 0-6.133-.815-8.716-2.247m0 0A9.015 9.015 0 013 12c0-1.605.42-3.113 1.157-4.418" }) }) }; const tabs = showSpecialistTabs ? [ { id: 'info', label: t('profile.tab.info') }, { id: 'cards', label: t('profile.tab.cards') }, { id: 'notifications', label: t('profile.tab.notifications') }, { id: 'reviews', label: t('profile.tab.reviews') }, { id: 'finance', label: t('profile.tab.finance') }, { id: 'referral', label: t('profile.tab.referral') }, ...hasAutoResponse ? [ { id: 'auto_response', label: t('profile.tab.auto_response', 'Auto response') } ] : [], ...(dashData === null || dashData === void 0 ? void 0 : (_dashData_features1 = dashData.features) === null || _dashData_features1 === void 0 ? void 0 : _dashData_features1.hasPersonalSite) ? [ { id: 'site', label: t('profile.tab.site') } ] : [] ] : [ { id: 'info', label: t('profile.tab.info') }, { id: 'cards', label: t('profile.tab.cards') }, { id: 'notifications', label: t('profile.tab.notifications') }, { id: 'reviews', label: t('profile.tab.reviews') }, { id: 'finance', label: t('profile.tab.finance') }, { id: 'referral', label: t('profile.tab.referral') }, ...(dashData === null || dashData === void 0 ? void 0 : (_dashData_features2 = dashData.features) === null || _dashData_features2 === void 0 ? void 0 : _dashData_features2.hasPersonalSite) ? [ { id: 'site', label: t('profile.tab.site') } ] : [] ]; var _user_lastName1, _user_name, _user_balance, _user_plan_features, _user_plan_name; return /*#__PURE__*/ _jsxs("div", { className: "max-w-4xl mx-auto px-4 py-8", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-4 mb-6", children: [ /*#__PURE__*/ _jsx("div", { className: "w-14 h-14 rounded-full flex-shrink-0 overflow-hidden border-2 border-white/40 flex items-center justify-center text-green-700 text-xl font-bold bg-green-100 cursor-pointer", onClick: ()=>{ var _fileRef_current; setActiveTab('info'); (_fileRef_current = fileRef.current) === null || _fileRef_current === void 0 ? void 0 : _fileRef_current.click(); }, title: t('profile.photo.change'), children: (user === null || user === void 0 ? void 0 : user.image) ? /*#__PURE__*/ _jsx("img", { src: user.image, alt: user.name, className: "w-full h-full object-cover" }) : initials }), /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ _jsx("h1", { className: "text-xl font-bold text-white leading-tight", children: (user === null || user === void 0 ? void 0 : user.firstName) ? "".concat(user.firstName, " ").concat((_user_lastName1 = user.lastName) !== null && _user_lastName1 !== void 0 ? _user_lastName1 : '').trim() : (_user_name = user === null || user === void 0 ? void 0 : user.name) !== null && _user_name !== void 0 ? _user_name : t('nav.profile') }), myRating && /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-1 mt-0.5", children: [ /*#__PURE__*/ _jsx("span", { className: "text-yellow-300", children: "★" }), /*#__PURE__*/ _jsx("span", { className: "font-semibold text-white text-sm", children: Number(myRating).toFixed(1) }), myReviews !== null && myReviews.length > 0 && /*#__PURE__*/ _jsxs("span", { className: "text-white/60 text-xs", children: [ "(", myReviews.length, ")" ] }) ] }) ] }) ] }), !cardsLoading && cards.length === 0 && /*#__PURE__*/ _jsx("div", { className: "mb-6 rounded-2xl border border-amber-300 bg-amber-50/95 p-4 sm:p-5 shadow-sm", children: /*#__PURE__*/ _jsxs("div", { className: "flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "text-sm font-semibold text-amber-950", children: t('profile.cards.empty', 'No offers yet') }), /*#__PURE__*/ _jsx("p", { className: "text-xs leading-relaxed text-amber-800 mt-1 max-w-2xl", children: t('profile.cards.empty_hint', 'СПзЎайте первую картПчку, чтПбы пПказать услугО клОеМтаЌ.') }) ] }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>{ setActiveTab('cards'); setShowNewCardForm(true); }, className: "inline-flex items-center justify-center rounded-xl bg-amber-600 px-4 py-2 text-sm font-semibold text-white transition hover:bg-amber-700", children: t('profile.cards.create_first') }) ] }) }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-6 items-start", children: [ tabs.length > 1 && /*#__PURE__*/ _jsx("aside", { className: "w-52 shrink-0 hidden sm:block", children: /*#__PURE__*/ _jsx("nav", { className: "rounded-2xl overflow-hidden bg-white/10 backdrop-blur-sm", children: tabs.map((tab)=>/*#__PURE__*/ _jsxs("button", { type: "button", onClick: ()=>setActiveTab(tab.id), className: "w-full text-left px-4 py-3 text-sm font-medium transition border-b border-white/10 last:border-0 flex items-center gap-3 ".concat(activeTab === tab.id ? 'bg-white text-green-700' : 'text-white/80 hover:bg-white/10 hover:text-white'), children: [ tabIcons[tab.id], /*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-1.5", children: [ tab.label, tabNeedsAttention[tab.id] && /*#__PURE__*/ _jsx("span", { className: "inline-flex items-center justify-center w-4 h-4 rounded-full bg-amber-500 text-white text-[10px] font-bold", children: "!" }) ] }) ] }, tab.id)) }) }), /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-0", children: [ tabs.length > 1 && /*#__PURE__*/ _jsx("div", { className: "flex sm:hidden bg-white/15 backdrop-blur rounded-xl p-1 mb-4 gap-1 overflow-x-auto", children: tabs.map((tab)=>/*#__PURE__*/ _jsxs("button", { type: "button", onClick: ()=>setActiveTab(tab.id), className: "flex-1 min-w-fit px-3 py-2 text-xs font-medium rounded-lg transition whitespace-nowrap flex flex-col items-center gap-0.5 ".concat(activeTab === tab.id ? 'bg-white text-green-700 shadow-sm' : 'text-white/80 hover:text-white hover:bg-white/10'), children: [ tabIcons[tab.id], /*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-1.5", children: [ tab.label, tabNeedsAttention[tab.id] && /*#__PURE__*/ _jsx("span", { className: "inline-flex items-center justify-center w-4 h-4 rounded-full bg-amber-500 text-white text-[10px] font-bold", children: "!" }) ] }) ] }, tab.id)) }), activeTab === 'cards' && /*#__PURE__*/ _jsxs("div", { className: "space-y-4", children: [ error && /*#__PURE__*/ _jsx("div", { className: "bg-red-50 text-red-700 p-3 rounded-lg text-sm", children: error }), listingMissing.length > 0 && /*#__PURE__*/ _jsxs("div", { className: "bg-amber-50 border border-amber-300 rounded-xl p-4", children: [ /*#__PURE__*/ _jsx("p", { className: "text-sm font-semibold text-amber-900", children: t('profile.listing_requirements.title', 'Your profile is not shown yet in offers') }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-amber-800 mt-1", children: t('profile.listing_requirements.hint', 'To make the card visible, complete these conditions:') }), /*#__PURE__*/ _jsx("ul", { className: "mt-2 list-disc pl-5 text-xs text-amber-900 space-y-0.5", children: listingMissing.map((item)=>/*#__PURE__*/ _jsx("li", { children: item }, item)) }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between", children: [ /*#__PURE__*/ _jsxs("p", { className: "text-sm text-white/70", children: [ t('profile.cards.count'), ": ", cards.length, " / ", maxCards === null ? '∞' : maxCards ] }), /*#__PURE__*/ _jsxs("button", { type: "button", onClick: ()=>{ if (maxCards !== null && cards.length >= maxCards) { setShowUpgradeModal(true); } else { setShowNewCardForm(true); } }, className: "flex items-center gap-1.5 text-sm font-medium text-white hover:text-white/80", children: [ "+ ", t('profile.cards.add') ] }) ] }), showNewCardForm && /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-green-200 p-4 space-y-3", children: [ /*#__PURE__*/ _jsx("p", { className: "text-sm font-medium text-gray-800", children: t('profile.cards.new_title') }), /*#__PURE__*/ _jsx("input", { value: newCardTitle, onChange: (e)=>setNewCardTitle(e.target.value), onKeyDown: (e)=>{ if (e.key === 'Enter') handleCreateCard(); }, maxLength: 200, placeholder: t('profile.cards.placeholder'), autoFocus: true, 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" }), /*#__PURE__*/ _jsxs("div", { className: "flex gap-2", children: [ /*#__PURE__*/ _jsx("button", { type: "button", onClick: handleCreateCard, disabled: creatingCard || !newCardTitle.trim(), className: "px-4 py-2 bg-green-600 hover:bg-green-700 text-white rounded-lg text-sm font-medium disabled:opacity-50", children: creatingCard ? '...' : t('profile.cards.create') }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>{ setShowNewCardForm(false); setNewCardTitle(''); }, className: "px-4 py-2 bg-gray-100 hover:bg-gray-200 text-gray-700 rounded-lg text-sm font-medium", children: t('profile.cards.cancel') }) ] }) ] }), cardsLoading && /*#__PURE__*/ _jsx("div", { className: "text-center py-10 text-white/70", children: t('common.loading') }), !cardsLoading && cards.length === 0 && !showNewCardForm && /*#__PURE__*/ _jsxs("div", { className: "text-center py-14 border-2 border-dashed border-white/30 rounded-xl", children: [ /*#__PURE__*/ _jsx("p", { className: "text-white/70 text-sm mb-3", children: t('profile.cards.empty') }), /*#__PURE__*/ _jsxs("button", { type: "button", onClick: ()=>setShowNewCardForm(true), className: "text-sm text-white font-medium hover:underline", children: [ "+ ", t('profile.cards.create_first') ] }) ] }), cards.map((card)=>{ var _dashData_features; const cardIssues = []; if (!profileBio) { cardIssues.push(t('profile.listing_requirements.bio', 'Add a short bio in the main profile section')); } var _card_publicationStatus; const publicationStatus = (_card_publicationStatus = card.publicationStatus) !== null && _card_publicationStatus !== void 0 ? _card_publicationStatus : card.isActive ? 'active' : 'inactive'; if (publicationStatus === 'pending') { cardIssues.push(t('profile.listing_requirements.review_pending', 'Card is under review')); } else if (publicationStatus !== 'active') { cardIssues.push(t('profile.listing_requirements.card_inactive', 'Make the card active')); } if (!card.categories || card.categories.length === 0) { cardIssues.push(t('profile.listing_requirements.categories', 'Add at least one category to the active card')); } if (!card.locations || card.locations.length === 0) { cardIssues.push(t('profile.listing_requirements.locations', 'Add at least one location to the active card')); } var _moderationNoticeByCardId_card_id; return /*#__PURE__*/ _jsx(SpecialistCardEditor, { card: card, isOpen: openCardId === card.id, onToggle: ()=>setOpenCardId(card.id), onUpdate: (updated)=>setCards((prev)=>prev.map((c)=>c.id === updated.id ? updated : c)), onDelete: ()=>handleDeleteCard(card.id), categories: categories, locationTree: locationTree, catLocale: catLocale, locale: locale, hasPriceList: !!(dashData === null || dashData === void 0 ? void 0 : (_dashData_features = dashData.features) === null || _dashData_features === void 0 ? void 0 : _dashData_features.hasPriceList), visibilityIssues: cardIssues, moderationNotice: (_moderationNoticeByCardId_card_id = moderationNoticeByCardId[card.id]) !== null && _moderationNoticeByCardId_card_id !== void 0 ? _moderationNoticeByCardId_card_id : null }, card.id); }) ] }), activeTab === 'site' && /*#__PURE__*/ _jsxs("div", { className: "space-y-5", children: [ /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6 space-y-4", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("h2", { className: "font-semibold text-gray-800 mb-1", children: t('profile.site.title') }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400", children: t('profile.site_slug_hint') }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-xs font-medium text-gray-500 mb-1.5", children: t('profile.site.url_label') }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 flex-wrap", children: [ /*#__PURE__*/ _jsx("span", { className: "text-sm text-gray-400 shrink-0", children: "canhelp.gr/site/" }), /*#__PURE__*/ _jsx("input", { value: personalSiteSlug, onChange: (e)=>setPersonalSiteSlug(e.target.value.toLowerCase().replace(/[^a-z0-9_-]/g, '')), placeholder: "my-slug", maxLength: 50, className: "flex-1 min-w-32 border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 flex-wrap", children: [ /*#__PURE__*/ _jsx("button", { type: "button", onClick: handleSaveSiteSlug, disabled: slugSaving, className: "px-5 py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700 disabled:opacity-50", children: slugSaving ? t('profile.saving') : t('common.save') }), slugSaved && /*#__PURE__*/ _jsxs("span", { className: "text-sm text-green-600", children: [ "✓ ", t('profile.saved') ] }), personalSiteSlug && /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs("button", { type: "button", onClick: ()=>{ navigator.clipboard.writeText("".concat(window.location.origin, "/site/").concat(personalSiteSlug)); setSlugCopied(true); setTimeout(()=>setSlugCopied(false), 2000); }, className: "px-3 py-2 border border-gray-300 rounded-lg text-sm text-gray-600 hover:bg-gray-50 flex items-center gap-1.5", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z" }) }), slugCopied ? t('profile.site.copied') : t('profile.site.copy') ] }), /*#__PURE__*/ _jsxs("a", { href: "/site/".concat(personalSiteSlug), target: "_blank", rel: "noopener noreferrer", className: "px-3 py-2 border border-green-200 bg-green-50 rounded-lg text-sm text-green-600 hover:bg-green-100 flex items-center gap-1.5", children: [ t('profile.site_open'), /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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" }) }) ] }) ] }) ] }), slugError && /*#__PURE__*/ _jsx("p", { className: "text-xs text-red-500", children: slugError }) ] }), /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between mb-4", children: [ /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-gray-800", children: t('profile.site.visible_title') }), siteSettingsSaving && /*#__PURE__*/ _jsx("span", { className: "text-xs text-gray-400", children: t('profile.saving', 'Saving...') }) ] }), /*#__PURE__*/ _jsx("div", { className: "space-y-3", children: [ { key: 'showBio', label: t('profile.site.visible.bio', 'Biography') }, { key: 'showRating', label: t('profile.site.visible.rating', 'Rating and reviews') }, { key: 'showReviews', label: t('profile.site.visible.reviews', 'Reviews section') }, { key: 'showServices', label: t('profile.site.visible.services', 'Service cards') }, { key: 'showPriceList', label: t('profile.site.visible.price_list', 'Price list') }, { key: 'showPortfolio', label: t('profile.site.visible.portfolio', 'Portfolio') }, { key: 'showPhone', label: t('profile.site.visible.contacts', 'Contact phone') }, { key: 'showFullLastName', label: t('profile.site.visible.full_last_name', 'Show full last name') }, { key: 'showStatus', label: t('profile.site.visible.status', 'Status "Available now"') } ].map((param)=>{ let { key, label } = param; const checked = siteSettings[key] !== false // undefined = true by default ; return /*#__PURE__*/ _jsxs("label", { className: "flex items-center gap-3 cursor-pointer group", children: [ /*#__PURE__*/ _jsx("div", { className: "w-5 h-5 rounded border-2 flex items-center justify-center transition shrink-0 ".concat(checked ? 'bg-green-600 border-green-600' : 'bg-white border-gray-300 group-hover:border-green-400'), onClick: ()=>{ const next = { ...siteSettings, [key]: !checked }; handleSaveSiteSettings(next); }, children: checked && /*#__PURE__*/ _jsx("svg", { className: "w-3 h-3 text-white", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 3, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4.5 12.75l6 6 9-13.5" }) }) }), /*#__PURE__*/ _jsx("span", { className: "text-sm text-gray-700 select-none", onClick: ()=>{ const next = { ...siteSettings, [key]: !checked }; handleSaveSiteSettings(next); }, children: label }) ] }, key); }) }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-4", children: t('profile.site.edit_bio_hint', 'Name and photo are always visible') }), /*#__PURE__*/ _jsxs("div", { className: "mt-6 pt-4 border-t border-gray-100", children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: t('profile.site.theme', 'Theme') }), /*#__PURE__*/ _jsx("div", { className: "flex gap-3", children: [ { value: 'dark', label: t('profile.site.theme.dark', 'Dark'), icon: '🌙' }, { value: 'light', label: t('profile.site.theme.light', 'Light'), icon: '☀' } ].map((opt)=>{ var _siteSettings_siteTheme; const selected = ((_siteSettings_siteTheme = siteSettings.siteTheme) !== null && _siteSettings_siteTheme !== void 0 ? _siteSettings_siteTheme : 'dark') === opt.value; return /*#__PURE__*/ _jsxs("button", { onClick: ()=>handleSaveSiteSettings({ ...siteSettings, siteTheme: opt.value }), className: "flex-1 flex items-center justify-center gap-2 px-4 py-2.5 rounded-xl border-2 text-sm font-medium transition ".concat(selected ? 'border-green-500 bg-green-50 text-green-700' : 'border-gray-200 bg-white text-gray-500 hover:border-gray-300'), children: [ /*#__PURE__*/ _jsx("span", { children: opt.icon }), opt.label ] }, opt.value); }) }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ _jsx("div", { className: "flex items-center justify-between mb-4", children: /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("h3", { className: "font-semibold text-gray-800", children: t('profile.site.stats.title', 'Site analytics') }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-0.5", children: t('profile.site.stats.days', 'last 30 days') }) ] }) }), !personalSiteSlug ? /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-400 py-4 text-center", children: t('profile.site.stats.no_slug', 'Set your site URL to view statistics') }) : siteStatsLoading || siteStats === null ? /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-400 py-4 text-center", children: t('profile.site.stats.loading', 'Loading analytics...') }) : (()=>{ const totalViews = siteStats.reduce((s, d)=>s + d.views, 0); const totalUnique = siteStats.reduce((s, d)=>s + d.unique, 0); const totalMessages = siteStats.reduce((s, d)=>s + d.messages, 0); // Area chart helpers const days = siteStats.map((d)=>d.date); const seriesDef = [ { vals: siteStats.map((d)=>d.views), color: '#3b82f6', fill: '#3b82f615', label: t('profile.site.stats.views', 'Views') }, { vals: siteStats.map((d)=>d.unique), color: '#8b5cf6', fill: '#8b5cf610', label: t('profile.site.stats.unique', 'Unique') }, { vals: siteStats.map((d)=>d.messages), color: '#10b981', fill: '#10b98110', label: t('profile.site.stats.messages', 'Messages') } ]; const maxVal = Math.max(...seriesDef.flatMap((s)=>s.vals), 1); const W = 580; const H = 160; const padL = 36; const padB = 22; const chartW = W - padL - 4; const chartH = H - padB; const stepX = chartW / (days.length - 1); function pts(vals) { return vals.map((v, i)=>[ padL + i * stepX, chartH - v / maxVal * chartH ]); } function smoothPath(points) { if (points.length < 2) return ''; let d = "M ".concat(points[0][0].toFixed(1), " ").concat(points[0][1].toFixed(1)); for(let i = 1; i < points.length; i++){ const cpx = ((points[i - 1][0] + points[i][0]) / 2).toFixed(1); d += " C ".concat(cpx, " ").concat(points[i - 1][1].toFixed(1), " ").concat(cpx, " ").concat(points[i][1].toFixed(1), " ").concat(points[i][0].toFixed(1), " ").concat(points[i][1].toFixed(1)); } return d; } function areaPath(vals) { const points = pts(vals); const line = smoothPath(points); if (!line) return ''; const lastX = points[points.length - 1][0].toFixed(1); return "".concat(line, " L ").concat(lastX, " ").concat(chartH.toFixed(1), " L ").concat(padL.toFixed(1), " ").concat(chartH.toFixed(1), " Z"); } function fmtY(v) { return v >= 1000 ? "".concat(Math.round(v / 1000), "K") : String(v); } const yTicks = [ 0, Math.round(maxVal / 3), Math.round(maxVal * 2 / 3), maxVal ]; const xTicks = days.map((d, i)=>({ i, label: d.slice(8) })).filter((_, i)=>i % 7 === 0 || i === days.length - 1); return /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx("div", { className: "grid grid-cols-3 gap-3 mb-5", children: [ { label: t('profile.site.stats.total_views', 'Views'), value: totalViews, color: 'text-green-600', bg: 'bg-green-50' }, { label: t('profile.site.stats.total_unique', 'Unique visitors'), value: totalUnique, color: 'text-violet-600', bg: 'bg-violet-50' }, { label: t('profile.site.stats.total_messages', 'Messages'), value: totalMessages, color: 'text-emerald-600', bg: 'bg-emerald-50' } ].map((card)=>/*#__PURE__*/ _jsxs("div", { className: "".concat(card.bg, " rounded-xl p-3 text-center"), children: [ /*#__PURE__*/ _jsx("div", { className: "text-2xl font-bold ".concat(card.color), children: card.value }), /*#__PURE__*/ _jsx("div", { className: "text-xs text-gray-500 mt-0.5", children: card.label }) ] }, card.label)) }), /*#__PURE__*/ _jsx("div", { className: "flex items-center gap-4 mb-2", children: seriesDef.map((s)=>/*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-1.5 text-xs text-gray-500", children: [ /*#__PURE__*/ _jsx("span", { className: "w-3 h-0.5 inline-block rounded", style: { background: s.color } }), s.label ] }, s.label)) }), /*#__PURE__*/ _jsx("div", { className: "overflow-x-auto", children: /*#__PURE__*/ _jsxs("svg", { viewBox: "0 0 ".concat(W, " ").concat(H + 12), className: "w-full", style: { minWidth: 320 }, children: [ yTicks.map((v, idx)=>{ const y = chartH - v / maxVal * chartH; return /*#__PURE__*/ _jsxs("g", { children: [ /*#__PURE__*/ _jsx("line", { x1: padL, y1: y, x2: W - 4, y2: y, stroke: "#f3f4f6", strokeWidth: 1 }), /*#__PURE__*/ _jsx("text", { x: padL - 5, y: y + 3.5, textAnchor: "end", fontSize: 9, fill: "#9ca3af", children: fmtY(v) }) ] }, "y-".concat(idx, "-").concat(v)); }), xTicks.map((param)=>{ let { i } = param; return /*#__PURE__*/ _jsx("line", { x1: padL + i * stepX, y1: 0, x2: padL + i * stepX, y2: chartH, stroke: "#f9fafb", strokeWidth: 1 }, "vg-".concat(i)); }), xTicks.map((param)=>{ let { i, label } = param; return /*#__PURE__*/ _jsx("text", { x: padL + i * stepX, y: H + 10, textAnchor: "middle", fontSize: 9, fill: "#9ca3af", children: label }, i); }), seriesDef.map((s, si)=>/*#__PURE__*/ _jsx("path", { d: areaPath(s.vals), fill: s.fill }, "fill-".concat(si))), seriesDef.map((s, si)=>/*#__PURE__*/ _jsx("path", { d: smoothPath(pts(s.vals)), fill: "none", stroke: s.color, strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round" }, "line-".concat(si))), seriesDef.map((s, si)=>{ const points = pts(s.vals); const last = points[points.length - 1]; return /*#__PURE__*/ _jsx("circle", { cx: last[0], cy: last[1], r: 4, fill: "white", stroke: s.color, strokeWidth: 2 }, "dot-".concat(si)); }), /*#__PURE__*/ _jsx("line", { x1: padL, y1: chartH, x2: W - 4, y2: chartH, stroke: "#e5e7eb", strokeWidth: 1 }) ] }) }) ] }); })() ] }) ] }), activeTab === 'reviews' && /*#__PURE__*/ _jsx("div", { className: "space-y-4", children: myReviews === null ? /*#__PURE__*/ _jsx("div", { className: "text-center py-10 text-white/70", children: t('common.loading') }) : myReviews.length === 0 ? /*#__PURE__*/ _jsxs("div", { className: "text-center py-20 text-white/60", children: [ /*#__PURE__*/ _jsx("p", { className: "text-4xl mb-3", children: "⭐" }), /*#__PURE__*/ _jsx("p", { children: t('profile.no_reviews') }) ] }) : myReviews.map((param)=>{ let { review, author } = param; var _author_name_, _author_name; var _author_name__toUpperCase, _author_name1; return /*#__PURE__*/ _jsx("div", { className: "bg-white rounded-xl border border-gray-200 p-4", children: /*#__PURE__*/ _jsxs("div", { className: "flex items-start gap-3", children: [ /*#__PURE__*/ _jsx("div", { className: "w-9 h-9 rounded-full bg-gray-100 flex-shrink-0 flex items-center justify-center text-gray-600 text-sm font-bold overflow-hidden", children: (author === null || author === void 0 ? void 0 : author.image) ? /*#__PURE__*/ _jsx("img", { src: author.image, alt: author.name, className: "w-full h-full object-cover" }) : (_author_name__toUpperCase = author === null || author === void 0 ? void 0 : (_author_name = author.name) === null || _author_name === void 0 ? void 0 : (_author_name_ = _author_name[0]) === null || _author_name_ === void 0 ? void 0 : _author_name_.toUpperCase()) !== null && _author_name__toUpperCase !== void 0 ? _author_name__toUpperCase : '?' }), /*#__PURE__*/ _jsxs("div", { className: "flex-1", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 mb-1", children: [ /*#__PURE__*/ _jsx("span", { className: "text-sm font-medium text-gray-800", children: (_author_name1 = author === null || author === void 0 ? void 0 : author.name) !== null && _author_name1 !== void 0 ? _author_name1 : '—' }), /*#__PURE__*/ _jsxs("span", { className: "text-yellow-400", children: [ '★'.repeat(review.rating), '☆'.repeat(5 - review.rating) ] }) ] }), review.comment && /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-600", children: review.comment }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-1", children: new Date(review.createdAt).toLocaleDateString() }) ] }) ] }) }, review.id); }) }), activeTab === 'finance' && /*#__PURE__*/ _jsxs("div", { className: "space-y-5", children: [ /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between mb-3", children: [ /*#__PURE__*/ _jsx("h2", { className: "font-semibold text-gray-800", children: t('profile.balance') }), /*#__PURE__*/ _jsxs("button", { onClick: ()=>{ setTopUpAmount(10); setTopUpError(''); setShowTopUpModal(true); }, className: "flex items-center gap-1.5 text-sm font-medium text-green-600 hover:text-green-700 hover:bg-green-50 px-3 py-1.5 rounded-lg transition-colors", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 4v16m8-8H4" }) }), t('profile.balance.topup') ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 p-4 bg-green-50 rounded-xl border border-green-100", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-6 h-6 text-green-600 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 8c-1.657 0-3 .895-3 2s1.343 2 3 2 3 .895 3 2-1.343 2-3 2m0-8c1.11 0 2.08.402 2.599 1M12 8V7m0 1v8m0 0v1m0-1c-1.11 0-2.08-.402-2.599-1M21 12a9 9 0 11-18 0 9 9 0 0118 0z" }) }), /*#__PURE__*/ _jsxs("span", { className: "text-xl font-bold text-green-700", children: [ parseFloat((_user_balance = user === null || user === void 0 ? void 0 : user.balance) !== null && _user_balance !== void 0 ? _user_balance : '0').toFixed(2), " EUR" ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "mt-4", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between mb-2", children: [ /*#__PURE__*/ _jsx("h3", { className: "text-sm font-semibold text-gray-800", children: t('profile.balance.history', 'Operation history') }), /*#__PURE__*/ _jsx("span", { className: "text-xs text-gray-400", children: t('profile.balance.history.last', 'Latest operations') }) ] }), balanceHistory.length === 0 ? /*#__PURE__*/ _jsx("div", { className: "rounded-xl border border-dashed border-gray-200 px-4 py-6 text-sm text-gray-400 text-center", children: t('profile.balance.history.empty', 'No operations yet') }) : /*#__PURE__*/ _jsx("div", { className: "space-y-2", children: balanceHistory.map((entry)=>{ const isCredit = entry.direction === 'credit'; const amount = Number(entry.amount).toFixed(2); const badgeClass = isCredit ? 'bg-emerald-50 text-emerald-700 border-emerald-100' : 'bg-rose-50 text-rose-700 border-rose-100'; const title = entry.kind === 'topup' ? t('profile.balance.history.kind.topup', 'Balance top-up') : entry.kind === 'plan_purchase' ? t('profile.balance.history.kind.plan_purchase', 'Plan charge') : entry.kind === 'admin_topup' ? t('profile.balance.history.kind.admin_topup', 'Admin top-up') : t('profile.balance.history.kind.admin_adjustment', 'Admin adjustment'); return /*#__PURE__*/ _jsxs("div", { className: "rounded-xl border border-gray-200 px-4 py-3", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-start justify-between gap-3", children: [ /*#__PURE__*/ _jsxs("div", { className: "min-w-0", children: [ /*#__PURE__*/ _jsx("div", { className: "text-sm font-medium text-gray-900", children: entry.description || title }), /*#__PURE__*/ _jsx("div", { className: "text-xs text-gray-500 mt-1", children: new Date(entry.createdAt).toLocaleString(dateLocale) }) ] }), /*#__PURE__*/ _jsxs("div", { className: "shrink-0 rounded-full border px-2.5 py-1 text-xs font-semibold ".concat(badgeClass), children: [ isCredit ? '+' : '-', amount, " ", entry.currency ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "mt-2 text-xs text-gray-500", children: [ t('profile.balance.history.balance_after', 'Balance after'), ": ", Number(entry.balanceAfter).toFixed(2), " ", entry.currency ] }) ] }, entry.id); }) }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ _jsx("h2", { className: "font-semibold text-gray-800 mb-4", children: t('profile.plan_history.title', 'Plan history') }), planHistory.length === 0 ? /*#__PURE__*/ _jsx("div", { className: "rounded-xl border border-dashed border-gray-200 px-4 py-6 text-sm text-gray-400 text-center", children: t('profile.plan_history.empty', 'Plan change history is empty') }) : /*#__PURE__*/ _jsx("div", { className: "space-y-2", children: planHistory.map((entry)=>{ const eventColors = { activated: 'bg-green-50 text-green-700 border-green-100', renewed: 'bg-emerald-50 text-emerald-700 border-emerald-100', downgraded: 'bg-rose-50 text-rose-700 border-rose-100', referral_reward: 'bg-amber-50 text-amber-700 border-amber-100', admin_change: 'bg-purple-50 text-purple-700 border-purple-100', expired: 'bg-gray-100 text-gray-600 border-gray-200' }; const eventLabels = { activated: t('profile.plan_history.event.activated', 'Activated'), renewed: t('profile.plan_history.event.renewed', 'Renewed'), downgraded: t('profile.plan_history.event.downgraded', 'Downgraded'), referral_reward: t('profile.plan_history.event.referral_reward', 'Referral reward'), admin_change: t('profile.plan_history.event.admin_change', 'Changed by admin'), expired: t('profile.plan_history.event.expired', 'Expired') }; var _eventColors_entry_event; const badgeClass = (_eventColors_entry_event = eventColors[entry.event]) !== null && _eventColors_entry_event !== void 0 ? _eventColors_entry_event : 'bg-gray-100 text-gray-600 border-gray-200'; var _eventLabels_entry_event; const label = (_eventLabels_entry_event = eventLabels[entry.event]) !== null && _eventLabels_entry_event !== void 0 ? _eventLabels_entry_event : entry.event; return /*#__PURE__*/ _jsx("div", { className: "rounded-xl border border-gray-200 px-4 py-3", children: /*#__PURE__*/ _jsxs("div", { className: "flex items-start justify-between gap-3", children: [ /*#__PURE__*/ _jsxs("div", { className: "min-w-0", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2 flex-wrap", children: [ /*#__PURE__*/ _jsx("span", { className: "text-sm font-semibold text-gray-900", children: entry.planName }), entry.previousPlanName && entry.previousPlanName !== entry.planName && /*#__PURE__*/ _jsxs("span", { className: "text-xs text-gray-400", children: [ "← ", entry.previousPlanName ] }) ] }), /*#__PURE__*/ _jsx("div", { className: "text-xs text-gray-500 mt-1", children: new Date(entry.createdAt).toLocaleString(dateLocale) }), entry.expiresAt && /*#__PURE__*/ _jsxs("div", { className: "text-xs text-gray-500 mt-0.5", children: [ t('profile.plan_history.expires', 'Until'), ": ", new Date(entry.expiresAt).toLocaleDateString(dateLocale) ] }), entry.daysAdded && entry.event === 'referral_reward' && /*#__PURE__*/ _jsxs("div", { className: "text-xs text-amber-600 mt-0.5", children: [ "+", entry.daysAdded, " ", t('profile.plan_history.days', 'days') ] }), entry.note && /*#__PURE__*/ _jsx("div", { className: "text-xs text-gray-400 mt-0.5", children: entry.note }) ] }), /*#__PURE__*/ _jsx("span", { className: "shrink-0 rounded-full border px-2.5 py-1 text-xs font-semibold ".concat(badgeClass), children: label }) ] }) }, entry.id); }) }) ] }), showTopUpModal && /*#__PURE__*/ _jsx("div", { className: "fixed inset-0 z-50 flex items-end sm:items-center justify-center p-4 bg-black/40 backdrop-blur-sm", children: /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-2xl shadow-2xl w-full max-w-sm p-6", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between mb-5", children: [ /*#__PURE__*/ _jsx("h3", { className: "text-lg font-semibold text-gray-900", children: t('profile.balance.topup.title') }), /*#__PURE__*/ _jsx("button", { onClick: ()=>setShowTopUpModal(false), className: "text-gray-400 hover:text-gray-600", children: /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" }) }) }) ] }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-500 mb-3", children: t('profile.balance.topup.hint') }), /*#__PURE__*/ _jsx("div", { className: "grid grid-cols-4 gap-2 mb-4", children: [ 5, 10, 20, 50 ].map((v)=>/*#__PURE__*/ _jsxs("button", { onClick: ()=>setTopUpAmount(v), className: "py-2 rounded-xl text-sm font-semibold border transition-colors ".concat(Number(topUpAmount) === v ? 'bg-green-600 text-white border-green-600' : 'border-gray-200 text-gray-700 hover:border-green-400'), children: [ "€", v ] }, v)) }), /*#__PURE__*/ _jsxs("div", { className: "mb-5", children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('profile.balance.topup.amount') }), /*#__PURE__*/ _jsxs("div", { className: "relative", children: [ /*#__PURE__*/ _jsx("span", { className: "absolute left-3 top-1/2 -translate-y-1/2 text-gray-400 text-sm", children: "€" }), /*#__PURE__*/ _jsx("input", { type: "number", min: "1", max: "9999", step: "1", value: topUpAmount, onChange: (e)=>setTopUpAmount(e.target.value), className: "w-full pl-7 pr-4 py-2.5 border border-gray-300 rounded-xl text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }) ] }), topUpError && /*#__PURE__*/ _jsx("p", { className: "text-sm text-red-600 mb-3", children: topUpError }), /*#__PURE__*/ _jsx("button", { onClick: handleTopUp, disabled: topUpLoading || !Number(topUpAmount) || Number(topUpAmount) < 1, className: "w-full py-3 bg-green-600 hover:bg-green-700 disabled:bg-gray-300 disabled:cursor-not-allowed text-white font-semibold rounded-xl transition-colors flex items-center justify-center gap-2", children: topUpLoading ? /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs("svg", { className: "w-4 h-4 animate-spin", fill: "none", viewBox: "0 0 24 24", children: [ /*#__PURE__*/ _jsx("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }), /*#__PURE__*/ _jsx("path", { className: "opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8v8z" }) ] }), t('profile.balance.topup.loading') ] }) : t('profile.balance.topup.submit') }) ] }) }), /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ _jsx("h2", { className: "font-semibold text-gray-800 mb-3", children: t('profile.plan.title') }), (user === null || user === void 0 ? void 0 : user.plan) ? /*#__PURE__*/ _jsxs("div", { className: "flex items-start gap-3 p-4 bg-green-50 rounded-xl border border-green-100", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-6 h-6 text-gray-500 shrink-0 mt-0.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M3 10h18M7 15h1m4 0h1m-7 4h12a3 3 0 003-3V8a3 3 0 00-3-3H6a3 3 0 00-3 3v8a3 3 0 003 3z" }) }), /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ _jsx("p", { className: "font-semibold text-gray-900", children: user.plan.name }), user.plan.description && /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-500 mt-0.5", children: user.plan.description }), /*#__PURE__*/ _jsxs("div", { className: "flex flex-wrap gap-3 mt-2 text-xs text-gray-500", children: [ /*#__PURE__*/ _jsxs("span", { className: "font-medium text-green-700", children: [ user.plan.price, " ", user.plan.currency ] }), user.plan.maxCards != null ? /*#__PURE__*/ _jsxs("span", { children: [ t('profile.plan.cards_up_to'), " ", user.plan.maxCards ] }) : /*#__PURE__*/ _jsx("span", { children: t('profile.plan.cards_unlimited') }), user.plan.maxTasks != null && /*#__PURE__*/ _jsxs("span", { children: [ t('profile.plan.tasks_up_to'), " ", user.plan.maxTasks ] }), user.plan.maxOffers != null && /*#__PURE__*/ _jsxs("span", { children: [ t('profile.plan.offers_up_to'), " ", user.plan.maxOffers ] }), /*#__PURE__*/ _jsx("span", { className: user.planExpiresAt && new Date(user.planExpiresAt) < new Date(Date.now() + 7 * 24 * 60 * 60 * 1000) ? 'text-red-500 font-medium' : '', children: user.planExpiresAt ? "".concat(t('profile.plan.valid_until'), " ").concat(new Date(user.planExpiresAt).toLocaleDateString()) : t('profile.plan.no_expiry') }) ] }), ((_user_plan_features = user.plan.features) !== null && _user_plan_features !== void 0 ? _user_plan_features : []).length > 0 && /*#__PURE__*/ _jsx("ul", { className: "mt-2 space-y-0.5", children: user.plan.features.map((f, i)=>/*#__PURE__*/ _jsxs("li", { className: "text-xs text-gray-600 flex items-center gap-1.5", children: [ /*#__PURE__*/ _jsx("span", { className: "text-green-500", children: "✓" }), " ", f ] }, i)) }) ] }) ] }) : /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 p-4 bg-gray-50 rounded-xl border border-gray-100", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" }) }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "text-sm font-medium text-gray-700", children: t('profile.plan.basic') }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-0.5", children: t('profile.plan.contact_upgrade') }) ] }) ] }) ] }), /*#__PURE__*/ _jsx("div", { className: "text-center", children: /*#__PURE__*/ _jsxs("a", { href: "/pricing", className: "inline-flex items-center gap-1.5 text-sm font-medium text-white/70 hover:text-white transition", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M13 7l5 5m0 0l-5 5m5-5H6" }) }), t('pricing.title', 'Pricing') ] }) }) ] }), activeTab !== 'cards' && activeTab !== 'reviews' && activeTab !== 'finance' && activeTab !== 'site' && /*#__PURE__*/ _jsxs("form", { onSubmit: handleSubmit, className: "space-y-6", children: [ error && /*#__PURE__*/ _jsx("div", { className: "bg-red-50 text-red-700 p-3 rounded-lg text-sm", children: error }), saved && /*#__PURE__*/ _jsxs("div", { className: "bg-green-50 text-green-700 p-3 rounded-lg text-sm", children: [ "✓ ", t('profile.saved') ] }), activeTab === 'notifications' && /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6 space-y-6", children: [ /*#__PURE__*/ _jsx("h2", { className: "font-semibold text-gray-800", children: t('notifications.title') }), notifySaved && /*#__PURE__*/ _jsxs("div", { className: "bg-green-50 text-green-700 p-3 rounded-lg text-sm", children: [ "✓ ", t('notifications.saved') ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-start justify-between gap-4", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex-1", children: [ /*#__PURE__*/ _jsx("p", { className: "font-medium text-gray-800 text-sm", children: t('chat.notif_messages') }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-500 mt-0.5", children: t('notifications.messages.desc') }) ] }), /*#__PURE__*/ _jsx("button", { type: "button", disabled: notifySaving, onClick: async ()=>{ const next = !notifMessages; setNotifMessages(next); setNotifySaving(true); try { await api.request('/users/me', { method: 'PATCH', body: JSON.stringify({ notifMessages: next }) }); setNotifySaved(true); setTimeout(()=>setNotifySaved(false), 2500); } catch (e) { setNotifMessages(!next); } finally{ setNotifySaving(false); } }, className: "relative inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full transition-colors focus:outline-none focus:ring-2 focus:ring-green-500 focus:ring-offset-2 disabled:opacity-50 ".concat(notifMessages ? 'bg-green-600' : 'bg-gray-200'), role: "switch", "aria-checked": notifMessages, children: /*#__PURE__*/ _jsx("span", { className: "inline-block h-4 w-4 transform rounded-full bg-white shadow transition-transform ".concat(notifMessages ? 'translate-x-6' : 'translate-x-1') }) }) ] }), showSpecialistTabs && /*#__PURE__*/ _jsxs("div", { className: "flex items-start justify-between gap-4 ".concat(!(user === null || user === void 0 ? void 0 : (_user_plan = user.plan) === null || _user_plan === void 0 ? void 0 : _user_plan.notifyNewTasks) ? 'opacity-60' : ''), children: [ /*#__PURE__*/ _jsxs("div", { className: "flex-1", children: [ /*#__PURE__*/ _jsx("p", { className: "font-medium text-gray-800 text-sm", children: t('notifications.email.new_tasks') }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-500 mt-0.5", children: t('notifications.email.new_tasks.desc') }), !(user === null || user === void 0 ? void 0 : (_user_plan1 = user.plan) === null || _user_plan1 === void 0 ? void 0 : _user_plan1.notifyNewTasks) && /*#__PURE__*/ _jsxs("p", { className: "text-xs text-amber-600 mt-1", children: [ "\uD83D\uDD12 ", t('notifications.plan_required') ] }) ] }), /*#__PURE__*/ _jsx("button", { type: "button", disabled: notifySaving || !(user === null || user === void 0 ? void 0 : (_user_plan2 = user.plan) === null || _user_plan2 === void 0 ? void 0 : _user_plan2.notifyNewTasks), onClick: async ()=>{ const next = !notifyNewTasks; setNotifyNewTasks(next); setNotifySaving(true); try { await api.request('/users/me', { method: 'PATCH', body: JSON.stringify({ notifyNewTasks: next }) }); setNotifySaved(true); setTimeout(()=>setNotifySaved(false), 2500); } catch (e) { setNotifyNewTasks(!next); } finally{ setNotifySaving(false); } }, className: "relative inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full transition-colors focus:outline-none focus:ring-2 focus:ring-green-500 focus:ring-offset-2 disabled:opacity-50 ".concat(notifyNewTasks ? 'bg-green-600' : 'bg-gray-200'), role: "switch", "aria-checked": notifyNewTasks, children: /*#__PURE__*/ _jsx("span", { className: "inline-block h-4 w-4 transform rounded-full bg-white shadow transition-transform ".concat(notifyNewTasks ? 'translate-x-6' : 'translate-x-1') }) }) ] }) ] }), activeTab === 'referral' && /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6 space-y-5", children: [ /*#__PURE__*/ _jsx("h2", { className: "font-semibold text-gray-800", children: t('profile.referral.title') }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-500", children: t('profile.referral.desc') }), !referralLoaded ? /*#__PURE__*/ _jsx("div", { className: "text-sm text-gray-400", children: t('common.loading') }) : referralCode ? /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs font-medium text-gray-500 mb-1.5", children: t('profile.referral.link_label') }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2", children: [ /*#__PURE__*/ _jsx("input", { readOnly: true, value: "".concat("object" !== 'undefined' ? window.location.origin : '', "/register?ref=").concat(referralCode), className: "flex-1 text-sm border border-gray-200 rounded-lg px-3 py-2 bg-gray-50 text-gray-700 focus:outline-none" }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>{ navigator.clipboard.writeText("".concat(window.location.origin, "/register?ref=").concat(referralCode)); setReferralCopied(true); setTimeout(()=>setReferralCopied(false), 2000); }, className: "px-3 py-2 rounded-lg border border-gray-200 text-sm font-medium hover:bg-gray-50 transition whitespace-nowrap", children: referralCopied ? t('profile.referral.copied') : t('profile.referral.copy') }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 p-4 bg-green-50 rounded-xl", children: [ /*#__PURE__*/ _jsx("div", { className: "text-2xl font-bold text-green-700", children: referralCount }), /*#__PURE__*/ _jsx("p", { className: "text-sm text-green-700", children: t('profile.referral.invited_count') }) ] }) ] }) : /*#__PURE__*/ _jsx("div", { className: "text-sm text-gray-400", children: t('profile.referral.no_code') }) ] }), activeTab === 'auto_response' && /*#__PURE__*/ _jsx(AutoResponseTab, { categories: categories, locationTree: locationTree, loaded: arLoaded, onLoad: ()=>{ if (arLoaded) return; api.getAutoResponseSettings().then((s)=>{ setAutoResponse(s); setArLoaded(true); }).catch(()=>setArLoaded(true)); }, settings: autoResponse, saving: arSaving, saved: arSaved, onSave: async (data)=>{ setArSaving(true); setArSaved(false); try { const updated = await api.updateAutoResponseSettings(data); setAutoResponse(updated); setArSaved(true); setTimeout(()=>setArSaved(false), 2500); } catch (e) {} finally{ setArSaving(false); } }, t: t, catLocale: catLocale }), activeTab === 'info' && /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ _jsx("h2", { className: "font-semibold text-gray-800 mb-4", children: t('profile.photo') }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-5", children: [ /*#__PURE__*/ _jsxs("div", { className: "relative", children: [ (user === null || user === void 0 ? void 0 : user.image) ? /*#__PURE__*/ _jsx("img", { src: user.image, alt: user.name, className: "w-20 h-20 rounded-full object-cover border-2 border-gray-200" }) : /*#__PURE__*/ _jsx("div", { className: "w-20 h-20 rounded-full bg-green-100 flex items-center justify-center text-green-700 text-2xl font-bold border-2 border-gray-200", children: initials }), avatarUploading && /*#__PURE__*/ _jsx("div", { className: "absolute inset-0 rounded-full bg-black/40 flex items-center justify-center", children: /*#__PURE__*/ _jsx("div", { className: "w-5 h-5 border-2 border-white border-t-transparent rounded-full animate-spin" }) }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>{ var _fileRef_current; return (_fileRef_current = fileRef.current) === null || _fileRef_current === void 0 ? void 0 : _fileRef_current.click(); }, disabled: avatarUploading, className: "bg-gray-100 hover:bg-gray-200 text-gray-700 px-4 py-2 rounded-lg text-sm font-medium disabled:opacity-50", children: t('profile.photo.change') }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-1", children: t('profile.photo.hint') }), /*#__PURE__*/ _jsx("input", { ref: fileRef, type: "file", accept: "image/jpeg,image/png,image/webp", className: "hidden", onChange: handleAvatarChange }), /*#__PURE__*/ _jsx("div", { className: "mt-3 rounded-lg border border-gray-200 bg-gray-50 px-3 py-2.5", children: isSpecialist ? (dashData === null || dashData === void 0 ? void 0 : (_dashData_features3 = dashData.features) === null || _dashData_features3 === void 0 ? void 0 : _dashData_features3.hasCanHelpNowStatus) ? /*#__PURE__*/ _jsxs("label", { className: "flex items-center justify-between cursor-pointer gap-3", children: [ /*#__PURE__*/ _jsx("span", { className: "text-xs font-medium text-gray-700", children: t('status.can_help_now', 'Available now') }), /*#__PURE__*/ _jsx("button", { type: "button", disabled: statusToggling === 'canhelp_now', onClick: async ()=>{ setStatusToggling('canhelp_now'); const nextActive = !myStatuses.includes('canhelp_now'); try { const res = await api.toggleStatus('canhelp_now', nextActive); setMyStatuses((prev)=>res.isActive ? [ ...prev.filter((s)=>s !== 'canhelp_now'), 'canhelp_now' ] : prev.filter((s)=>s !== 'canhelp_now')); } catch (e) {} finally{ setStatusToggling(null); } }, className: "relative inline-flex h-5 w-10 items-center rounded-full transition-colors ".concat(myStatuses.includes('canhelp_now') ? 'bg-green-500' : 'bg-gray-300', " disabled:opacity-50"), children: /*#__PURE__*/ _jsx("span", { className: "inline-block h-3.5 w-3.5 transform rounded-full bg-white shadow transition-transform ".concat(myStatuses.includes('canhelp_now') ? 'translate-x-5.5' : 'translate-x-1') }) }) ] }) : /*#__PURE__*/ _jsx("p", { className: "text-xs text-amber-700", children: t('status.plan_required', 'Status is unavailable on your current plan') }) : !isAdmin ? (dashData === null || dashData === void 0 ? void 0 : (_dashData_features4 = dashData.features) === null || _dashData_features4 === void 0 ? void 0 : _dashData_features4.hasNeedHelpStatus) ? /*#__PURE__*/ _jsxs("label", { className: "flex items-center justify-between cursor-pointer gap-3", children: [ /*#__PURE__*/ _jsx("span", { className: "text-xs font-medium text-gray-700", children: t('status.need_help', 'Need help') }), /*#__PURE__*/ _jsx("button", { type: "button", disabled: statusToggling === 'need_help', onClick: async ()=>{ setStatusToggling('need_help'); const nextActive = !myStatuses.includes('need_help'); try { const res = await api.toggleStatus('need_help', nextActive); setMyStatuses((prev)=>res.isActive ? [ ...prev.filter((s)=>s !== 'need_help'), 'need_help' ] : prev.filter((s)=>s !== 'need_help')); } catch (e) {} finally{ setStatusToggling(null); } }, className: "relative inline-flex h-5 w-10 items-center rounded-full transition-colors ".concat(myStatuses.includes('need_help') ? 'bg-green-500' : 'bg-gray-300', " disabled:opacity-50"), children: /*#__PURE__*/ _jsx("span", { className: "inline-block h-3.5 w-3.5 transform rounded-full bg-white shadow transition-transform ".concat(myStatuses.includes('need_help') ? 'translate-x-5.5' : 'translate-x-1') }) }) ] }) : /*#__PURE__*/ _jsx("p", { className: "text-xs text-amber-700", children: t('status.plan_required', 'Status is unavailable on your current plan') }) : /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-600", children: t('status.admin_not_applicable', 'User status is not applicable to admin accounts') }) }) ] }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ _jsx("h2", { className: "font-semibold text-gray-800 mb-4", children: t('profile.background.title', 'Profile header background') }), /*#__PURE__*/ _jsx("div", { className: "w-full h-40 rounded-2xl border border-gray-200 overflow-hidden relative", style: { backgroundImage: siteSettings.profileBackgroundImage ? "linear-gradient(135deg, rgba(22,163,74,0.45), rgba(21,128,61,0.65)), url(".concat(siteSettings.profileBackgroundImage, ")") : 'linear-gradient(135deg, #22c55e 0%, #16a34a 45%, #166534 100%)', backgroundSize: 'cover', backgroundPosition: 'center' }, children: backgroundUploading && /*#__PURE__*/ _jsx("div", { className: "absolute inset-0 bg-black/35 flex items-center justify-center", children: /*#__PURE__*/ _jsx("div", { className: "w-6 h-6 border-2 border-white border-t-transparent rounded-full animate-spin" }) }) }), /*#__PURE__*/ _jsxs("div", { className: "mt-4 flex flex-wrap gap-2", children: [ /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>{ var _backgroundFileRef_current; return (_backgroundFileRef_current = backgroundFileRef.current) === null || _backgroundFileRef_current === void 0 ? void 0 : _backgroundFileRef_current.click(); }, disabled: backgroundUploading, className: "bg-gray-100 hover:bg-gray-200 text-gray-700 px-4 py-2 rounded-lg text-sm font-medium disabled:opacity-50", children: backgroundUploading ? t('profile.photo.uploading', 'Uploading...') : t('profile.background.change', 'Change background') }), siteSettings.profileBackgroundImage && /*#__PURE__*/ _jsx("button", { type: "button", onClick: handleRemoveBackground, disabled: backgroundUploading, className: "bg-white hover:bg-gray-50 text-gray-700 px-4 py-2 rounded-lg text-sm font-medium border border-gray-200 disabled:opacity-50", children: t('profile.background.remove', 'Remove background') }), /*#__PURE__*/ _jsx("input", { ref: backgroundFileRef, type: "file", accept: "image/jpeg,image/png,image/webp", className: "hidden", onChange: handleBackgroundChange }) ] }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-2", children: t('profile.background.hint', 'Shown in the public profile header on web and mobile app.') }) ] }), /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6 space-y-4", children: [ /*#__PURE__*/ _jsx("h2", { className: "font-semibold text-gray-800", children: t('profile.basic_info') }), /*#__PURE__*/ _jsxs("div", { className: "grid grid-cols-2 gap-4", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('register.first_name') }), /*#__PURE__*/ _jsx("input", { value: formData.firstName, onChange: (e)=>setFormData({ ...formData, firstName: e.target.value }), required: true, className: "w-full border border-gray-300 rounded-lg px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-400 text-sm" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('register.last_name') }), /*#__PURE__*/ _jsx("input", { value: formData.lastName, onChange: (e)=>setFormData({ ...formData, lastName: e.target.value }), required: true, className: "w-full border border-gray-300 rounded-lg px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-400 text-sm" }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: "Email" }), /*#__PURE__*/ _jsx("input", { value: user === null || user === void 0 ? void 0 : user.email, disabled: true, className: "w-full border border-gray-200 rounded-lg px-3 py-2 text-sm text-gray-400 bg-gray-50 cursor-not-allowed" }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between mt-1.5", children: [ (user === null || user === void 0 ? void 0 : user.emailVerified) ? /*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-1 text-xs text-green-600", children: [ /*#__PURE__*/ _jsx("span", { className: "inline-block w-1.5 h-1.5 rounded-full bg-green-500" }), t('profile.email.verified') ] }) : /*#__PURE__*/ _jsxs("span", { className: "flex items-center gap-1 text-xs text-amber-600", children: [ /*#__PURE__*/ _jsx("span", { className: "inline-block w-1.5 h-1.5 rounded-full bg-amber-500" }), t('profile.email.not_verified') ] }), !(user === null || user === void 0 ? void 0 : user.emailVerified) && /*#__PURE__*/ _jsx("button", { type: "button", disabled: resendState !== 'idle', onClick: handleResendVerification, className: "text-xs text-green-600 hover:underline disabled:opacity-60 disabled:no-underline", children: resendState === 'sending' ? t('login.unverified.sending') : resendState === 'sent' ? t('login.unverified.sent') : t('login.unverified.resend') }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('profile.phone') }), /*#__PURE__*/ _jsx("input", { type: "tel", value: formData.phone, onChange: (e)=>setFormData({ ...formData, phone: e.target.value }), placeholder: t('profile.phone.placeholder'), className: "w-full border border-gray-300 rounded-lg px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-400 text-sm" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('profile.bio') }), /*#__PURE__*/ _jsx("textarea", { value: formData.bio, onChange: (e)=>setFormData({ ...formData, bio: e.target.value }), rows: 3, maxLength: 1000, placeholder: t('profile.bio.placeholder'), className: "w-full border border-gray-300 rounded-lg px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-400 text-sm resize-none" }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('profile.language') }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mb-2", children: t('profile.language.hint') }), /*#__PURE__*/ _jsxs("select", { value: formData.locale, onChange: (e)=>setFormData({ ...formData, locale: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400", children: [ /*#__PURE__*/ _jsx("option", { value: "el", children: "ΕλληΜικά" }), /*#__PURE__*/ _jsx("option", { value: "en", children: "English" }), /*#__PURE__*/ _jsx("option", { value: "ru", children: "РусскОй" }), /*#__PURE__*/ _jsx("option", { value: "uk", children: "УкраїМська" }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('profile.languages') }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mb-2", children: t('profile.languages.hint') }), /*#__PURE__*/ _jsx("div", { className: "flex flex-wrap gap-2", children: [ { code: 'el', flag: '🇬🇷', label: 'ΕλληΜικά' }, { code: 'en', flag: '🇬🇧', label: 'English' }, { code: 'ru', flag: '🇷🇺', label: 'РусскОй' }, { code: 'uk', flag: '🇺🇊', label: 'УкраїМська' }, { code: 'de', flag: '🇩🇪', label: 'Deutsch' }, { code: 'fr', flag: '🇫🇷', label: 'Français' }, { code: 'it', flag: '🇮🇹', label: 'Italiano' }, { code: 'es', flag: '🇪🇞', label: 'Español' }, { code: 'ar', flag: '🇞🇊', label: 'العرؚية' }, { code: 'zh', flag: '🇚🇳', label: 'äž­æ–‡' } ].map((param)=>{ let { code, flag, label } = param; const selected = selectedLanguages.includes(code); return /*#__PURE__*/ _jsxs("button", { type: "button", onClick: ()=>setSelectedLanguages(selected ? selectedLanguages.filter((l)=>l !== code) : [ ...selectedLanguages, code ]), className: "flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-sm border transition ".concat(selected ? 'bg-green-600 border-green-600 text-white' : 'bg-white border-gray-300 text-gray-700 hover:border-green-400'), children: [ /*#__PURE__*/ _jsx("span", { children: flag }), /*#__PURE__*/ _jsx("span", { children: label }) ] }, code); }) }) ] }) ] }), !isSpecialist && !isAdmin && /*#__PURE__*/ _jsx("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: /*#__PURE__*/ _jsxs("div", { className: "p-4 bg-purple-50 rounded-xl", children: [ /*#__PURE__*/ _jsx("p", { className: "text-sm text-gray-600 mb-3", children: t('profile.become_specialist.desc') }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: handleBecomeSpecialist, disabled: becomingSpecialist, className: "bg-purple-600 hover:bg-purple-700 text-white px-5 py-2 rounded-lg text-sm font-semibold disabled:opacity-50", children: becomingSpecialist ? t('common.loading') : t('profile.become_specialist') }) ] }) }), isSpecialist && ((dashData === null || dashData === void 0 ? void 0 : (_dashData_plan = dashData.plan) === null || _dashData_plan === void 0 ? void 0 : _dashData_plan.tier) === 'pro' || (dashData === null || dashData === void 0 ? void 0 : (_dashData_plan1 = dashData.plan) === null || _dashData_plan1 === void 0 ? void 0 : _dashData_plan1.tier) === 'ultimate') && /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ _jsx("h2", { className: "font-semibold text-gray-800 mb-4", children: t('profile.show_contact', 'Show contacts') }), /*#__PURE__*/ _jsxs("label", { className: "flex items-center justify-between cursor-pointer gap-3", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("p", { className: "text-sm font-medium text-gray-800", children: t('profile.show_contact_hint', 'Clients can see your phone number') }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 mt-0.5", children: t('profile.show_contact_desc', 'Lets clients contact you directly') }) ] }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setShowContactInfo((v)=>!v), className: "relative inline-flex h-6 w-11 items-center rounded-full transition-colors ".concat(showContactInfo ? 'bg-green-500' : 'bg-gray-300'), children: /*#__PURE__*/ _jsx("span", { className: "inline-block h-4 w-4 transform rounded-full bg-white shadow transition-transform ".concat(showContactInfo ? 'translate-x-6' : 'translate-x-1') }) }) ] }) ] }) ] }), /*#__PURE__*/ _jsx("button", { type: "submit", disabled: saving, className: "w-full bg-green-600 text-white py-3 rounded-xl font-semibold hover:bg-green-700 disabled:opacity-50 disabled:cursor-not-allowed ".concat(activeTab === 'notifications' || activeTab === 'referral' || activeTab === 'auto_response' ? 'hidden' : ''), children: saving ? t('profile.saving') : t('common.save') }) ] }), showUpgradeModal && /*#__PURE__*/ _jsx("div", { className: "fixed inset-0 z-50 flex items-center justify-center bg-black/50 px-4", children: /*#__PURE__*/ _jsxs("div", { className: "bg-white rounded-2xl shadow-xl p-6 w-full max-w-md", children: [ /*#__PURE__*/ _jsx("div", { className: "text-center mb-5", children: /*#__PURE__*/ _jsx("span", { className: "text-5xl", children: "\uD83D\uDE80" }) }), /*#__PURE__*/ _jsx("h2", { className: "text-lg font-bold text-gray-900 text-center mb-2", children: t('profile.upgrade.cards_limit') }), /*#__PURE__*/ _jsxs("p", { className: "text-sm text-gray-600 text-center mb-4", children: [ (_user_plan_name = user === null || user === void 0 ? void 0 : (_user_plan3 = user.plan) === null || _user_plan3 === void 0 ? void 0 : _user_plan3.name) !== null && _user_plan_name !== void 0 ? _user_plan_name : t('profile.plan.basic'), " — ", t('profile.plan.cards_up_to'), " ", maxCards ] }), (user === null || user === void 0 ? void 0 : user.plan) && /*#__PURE__*/ _jsxs("div", { className: "bg-gray-50 rounded-xl p-4 mb-5 text-sm text-gray-600 text-center", children: [ /*#__PURE__*/ _jsx("span", { className: "font-medium text-gray-800", children: t('profile.upgrade.plan') }), ' ', user.plan.name, " — ", user.plan.price, " ", user.plan.currency ] }), /*#__PURE__*/ _jsx("p", { className: "text-xs text-gray-400 text-center mb-5", children: t('profile.upgrade.contact') }), /*#__PURE__*/ _jsx("button", { onClick: ()=>setShowUpgradeModal(false), className: "w-full bg-green-600 hover:bg-green-700 text-white py-2.5 rounded-xl text-sm font-semibold", children: t('profile.upgrade.ok') }) ] }) }) ] }) ] }) ] }); } ’Ä61146undefined148209undefined211271undefined273324undefined326370undefined372404undefined406481undefined711719(0,_context_locale__WEBPACK_IMPORTED_MODULE_4__/* .useLocale */ .Y)undefined819826(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined869876(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined920927(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined977984(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined10701077(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined12651272(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined14601467(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined16551662(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined18431850(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined19791986(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined20692076(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined22542261(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined24592466(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined26782685(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined27552762(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined29192926(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined29782985(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined30323039(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined30823089(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined31253130(0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)undefined32013208(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined32673274(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined33303337(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined33903397(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined34403447(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined35863593(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined36503657(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined36683676(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined38163831_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getPriceList */ .Ckundefined40824105_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .createPriceListGroup */ .vDundefined45524575_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .deletePriceListGroup */ .Icundefined47404763_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .updatePriceListGroup */ .oDundefined53275349_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .createPriceListItem */ .Z2undefined62256247_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .deletePriceListItem */ .U9undefined64476455(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined65136535_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getSkillSuggestions */ .rlundefined74047427_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .updateSpecialistCard */ .zcundefined82488271_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .updateSpecialistCard */ .zcundefined1009610126"https://api.canhelp.gr"undefined10131101530undefined1086310885_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .deletePortfolioItem */ .zBundefined1120011222_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .updatePortfolioItem */ .hlundefined1255312557(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1269512699(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1291112915(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1316913172(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1343713440(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1382713830(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1408614089(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1496714970(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1536315367(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1546315467(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1566015663(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1593715940(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1613916142(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1639916403(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1675716760(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1716917172(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1757817581(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1778217785(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1830918313(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1846618470(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1863118634(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2140821412(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2154121545(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2216022163(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2286822871(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2327123275(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2351923522(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2391323916(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2464324647(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2483424837(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2500825012(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2535125354(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2599626000(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2618626189(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2713327136(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2769827701(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2826228266(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2906229065(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3004930053(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3017430178(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3042030423(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3097730981(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3128231285(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3128731298_components_CategoryIcon__WEBPACK_IMPORTED_MODULE_6__/* .CategoryIcon */ .Ezundefined3153631552(0,_components_CategoryIcon__WEBPACK_IMPORTED_MODULE_6__/* .isCategoryIconUrl */ .V)undefined3213032133(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3294132945(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3321133214(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3380433807(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3451034513(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3552635530(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3565135655(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3589735900(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3645836461(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3688736890(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3766537669(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3793537938(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3852338526(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3922639229(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3937139374(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3960539609(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3961139619react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragmentundefined3975239755(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4012240126(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined4037540378(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4064140645(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined4064740655react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragmentundefined4081040813(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4174441747(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4238942392(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4301843022(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined4302443032react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragmentundefined4318743190(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4356343566(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4441344416(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4521045213(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4542345427(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined4572445728(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined4601446017(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4644546448(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4702547029(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined4772747730(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4861348617(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined4889248895(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4979149794(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined5070450708(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined5096650969(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined5193851941(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined5303053034(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined5329253295(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined5395353956(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined5541155414(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined5561055614(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined5651656520(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined5672356726(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined5753257535(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined5825858262(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined5844858452(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined5857358576(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined5942159425(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined5942759435react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragmentundefined5957459577(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined6001060014(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined6001660024react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragmentundefined6046160464(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined6105461057(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined6134661349(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined6165261656(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined6193161934(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined6238962393(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined6271762720(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined6337563379(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined6499965002(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined6517565178(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined6585065854(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined6606466067(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined6660466608(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined6713767140(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined6729067294(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined6746067463(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined6768067683(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined6793467938(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined6808768091(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined6820468207(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined6850468507(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined6906269066(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined6917969182(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined6947869481(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined7015270156(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined7031170314(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined7075870761(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined7156671565: react__WEBPACK_IMPORTED_MODULE_1__.useEffectundefined7158471583: react__WEBPACK_IMPORTED_MODULE_1__.useStateundefined7311073113(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined7364773651(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined7374073743(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined7387173875(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined7404174045(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined7414274145(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined7440074403(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined7473574738(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined7507675079(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined7541175415(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined7557575578(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined7579975803(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined7595375957(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined7606276065(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined7634476347(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined7697876982(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined7708777090(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined7736977372(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined7804478048(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined7813778140(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined7840078403(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined7891078914(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined7900379006(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined7926879271(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined7984079844(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined7999479997(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined8023080233(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined8082880832(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined8098280985(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined8121381216(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined8229982302(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined8304383046(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined8404784061undefined8411284115(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined8411784124react__WEBPACK_IMPORTED_MODULE_1__.Suspenseundefined8418584188(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined8450084508(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)undefined8453884552(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useSearchParams)undefined8459884607(0,_lib_auth__WEBPACK_IMPORTED_MODULE_3__/* .useSession */ .wV)undefined8463884646(0,_context_locale__WEBPACK_IMPORTED_MODULE_4__/* .useLocale */ .Y)undefined8504385050(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8513585142(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8518585192(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8523385240(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8528085287(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8532785334(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8537785384(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8555285559(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8562085627(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8567085677(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8572785734(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8579885805(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8585285859(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8591285919(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8597385980(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8603786044(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8610686113(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8618586192(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8624386250(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8633886345(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8640586412(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8648086487(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8651786522(0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)undefined8656186566(0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)undefined8665586662(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8671886725(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8677886785(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8683786844(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8692986936(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8701287019(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8707487081(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8713587142(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8720087207(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8729387300(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8735287359(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8741087417(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8746787474(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8752987536(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8758587592(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8766387670(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8771987726(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8778187788(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8784987856(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8790387910(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8795887965(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8801588022(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8807088077(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8813488141(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8819588202(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8826588272(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8832088327(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8838888395(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8844988456(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8850188508(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8855488561(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8860588612(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined8885888874_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .initiateTopUp */ .ohundefined8992389932_lib_auth__WEBPACK_IMPORTED_MODULE_3__/* .authClient */ .yKundefined9021090218(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined9029890318_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getMyReferralInfo */ .stundefined9057790584(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined9064190648(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined9069490701(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined9071490722(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined9085690871_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getMyReviews */ .q7undefined9100091008(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined9114391158_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getSiteStats */ .RNundefined9130691314(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined9143791445(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined9151791527_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Emundefined9155591571_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getCategories */ .bWundefined9158891603_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getLocations */ .Vsundefined9162091637_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getMyDashboard */ .Hundefined9167091686_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getMyStatuses */ .z6undefined9171791737_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getBalanceHistory */ .fmundefined9176991786_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getPlanHistory */ .ewundefined9390793923_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getUserRating */ .Bmundefined9419694219_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getMySpecialistCards */ .Bbundefined9458394602_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getNotifications */ .Trundefined9514295152_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Emundefined9611496124_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Emundefined9659896608_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Emundefined9783197841_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Emundefined9850098530"https://api.canhelp.gr"undefined98535985570undefined9883798867"https://api.canhelp.gr"undefined98872988940undefined9892898938_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Emundefined9976599795"https://api.canhelp.gr"undefined99800998220undefined100102100132"https://api.canhelp.gr"undefined1001371001590undefined100324100334_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Emundefined101101101111_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Emundefined101711101734_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .createSpecialistCard */ .eRundefined102300102323_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .deleteSpecialistCard */ .f5undefined102873102876(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined107226107229(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined107445107448(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined107765107768(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined107984107987(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined108390108393(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined108609108612(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined108926108929(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined109145109148(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined109530109533(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined109749109752(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined110280110283(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined110499110502(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined110844110847(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined111063111066(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined111417111420(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined111636111639(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined114349114353(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined114460114464(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined114596114599(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined115293115296(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined115560115564(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined115706115709(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined116278116282(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined116464116467(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined116693116696(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined117009117013(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined117606117609(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined117767117771(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined117953117957(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined118054118057(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined118323118326(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined118707118710(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined119314119318(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined119463119466(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined119595119598(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined119776119780(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined120359120363(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined120665120668(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined121226121230(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined121391121394(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined121606121610(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined122224122228(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined122546122549(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined123149123153(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined123323123326(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined123612123616(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined123842123845(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined124200124203(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined124561124564(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined124790124793(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined125115125119(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined125328125332(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined125989125993(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined127150127154(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined127387127390(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined127688127691(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined128581128585(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined128795128798(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined129482129485(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined130416130419(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined130735130739(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined130982130985(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined131272131276(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined133860133863(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined135360135364(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined135525135529(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined135761135765(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined135902135905(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined136230136233(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined136639136643(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined136780136783(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined137129137133(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined137390137393(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined137745137748(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined138704138708(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined138941138944(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined139620139624(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined140142140146(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined140148140156react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragmentundefined140303140307(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined141262141265(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined141834141837(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined142731142735(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined143476143479(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined144048144051(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined144979144982(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined145321145325(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined145547145551(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined145789145792(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined146142146145(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined146559146562(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined149815149819(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined150089150092(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined151042151045(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined151597151600(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined152180152183(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined153301153304(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined153635153639(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined153873153876(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined154225154228(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined155634155638(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined156484156487(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined157224157228(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined157450157453(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined157637157641(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined157786157789(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined158149158152(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined158669158672(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined159016159019(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined164916164920(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined164922164930react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragmentundefined165069165072(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined166931166935(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined167242167245(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined167644167647(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined168229168232(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined168449168453(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined168761168764(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined169593169596(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined169781169785(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined170586170590(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined170781170784(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined171547171550(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined172774172777(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined173788173791(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined174615174618(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined175018175021(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined176107176110(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined176908176911(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined178064178067(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined178211178214(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined178449178453(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined178648178651(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined178888178891(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined179397179400(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined179576179580(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined179790179793(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined180139180142(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined180916180920(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined181138181142(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined181406181409(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined181898181902(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined182640182643(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined182963182966(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined183634183638(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined183799183803(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined184025184029(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined184267184270(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined184587184591(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined185332185335(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined185852185855(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined186627186631(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined186905186908(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined187403187406(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined188005188009(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined188746188750(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined188954188958(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined189220189223(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined189609189612(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined190126190129(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined190495190498(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined191593191597(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined191888191892(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined192202192206(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined192509192512(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined192970192973(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined193603193607(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined194662194666(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined196008196012(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined196234196237(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined196581196584(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined196934196937(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined199509199512(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined199717199721(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined199995199999(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined200266200270(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined200587200590(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined201094201098(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined201940201943(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined202391202395(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined203256203260(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined204119204122(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined204640204643(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined205406205409(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined205636205640(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined205879205883(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined206133206136(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined206489206492(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined206797206800(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined207317207320(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined207968207971(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined208281208284(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined208768208772(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined209598209602(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined209818209821(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined210187210191(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined210435210438(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined210823210826(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined211933211936(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined212224212227(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined212785212789(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined212791212799react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragmentundefined212946212950(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined213382213385(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined214080214083(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined215059215063(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined215285215288(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined215639215643(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined215916215919(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined216420216423(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined216937216941(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined217179217182(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined217549217552(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined217902217906(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined218201218205(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined218940218944(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined219484219487(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined219799219803(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined220441220445(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined221054221057(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined221928221931(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined222155222159(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined222477222480(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined223372223376(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined223648223651(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined224145224148(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined224692224696(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined224849224852(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined225209225212(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined225841225844(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined225985225989(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined226331226334(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined226779226782(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined227565227569(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined227796227799(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined228065228069(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined228514228518(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined228750228753(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined229057229061(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined229535229539(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined229777229781(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined230011230014(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined230372230375(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined230841230844(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined231479231489_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Emundefined233107233110(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined233627233631(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined234041234045(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined234275234278(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined234646234649(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined235166235170(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined235856235859(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined236645236655_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Emundefined238277238280(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined238877238881(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined239113239116(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined239408239411(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined239713239716(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined239967239971(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined239973239981react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragmentundefined240112240116(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined240269240272(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined240645240649(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined240920240923(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined241113241136 trueundefined2411652411660undefined241551241554(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined242957242961(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined243235243238(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined243587243590(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined244099244102(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined244497244500(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined244875244901_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getAutoResponseSettings */ .Gpundefined245660245689_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .updateAutoResponseSettings */ .RQundefined246373246377(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined246379246387react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragmentundefined246502246506(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined246752246755(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined247075247079(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined247326247330(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined247645247648(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined248069248072(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined248561248564(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined248832248835(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined249362249366(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined249535249538(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined250649250652(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined251034251037(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined251685251688(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined252150252154(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined252494252497(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined252955252958(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined253775253790_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .toggleStatus */ .bcundefined255134255137(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined255756255759(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined256331256335(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined256675256678(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined257129257132(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined257943257958_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .toggleStatus */ .bcundefined259292259295(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined259912259915(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined260286260289(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined261124261128(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined261374261377(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined261737261740(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined262602262605(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined262836262839(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined263248263252(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined263501263504(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined264723264726(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined265478265481(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined266192266195(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined266668266672(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined266928266931(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined267251267255(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined267501267505(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined267674267677(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined268082268085(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined269136269140(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined269309269312(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined269716269719(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined270873270877(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined271030271033(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined271389271392(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined271930271934(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined272289272293(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined272612272615(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined273116273120(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined273439273442(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined274083274086(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined275173275177(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined275330275333(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined275700275703(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined276764276768(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined276921276924(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined277289277292(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined278439278443(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined278596278599(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined278969278972(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined279325279329(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined280123280126(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined280472280475(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined280820280823(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined281168281171(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined281745281749(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined281902281905(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined282276282279(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined282633282636(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined287214287218(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined288214288217(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined288494288497(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined289264289267(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined289459289463(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined289702289705(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined290051290054(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined291287291291(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined291537291540(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined291884291888(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined292168292172(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined292341292344(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined292777292780(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined293329293332(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined293830293833(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined294540294543(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined295234295237(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined295419295423(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined295637295640(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined295794295797(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined296098296101(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined296403296407(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined297301297305(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined297557297560(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined298305298308(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined298595298598(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined RawSource /***/ }), /***/ 1592:  ú «webpack/lib/util/registerExternalSerializerœwebpack-sources/ConcatSource€«webpack/lib/util/registerExternalSerializer™webpack-sources/RawSource_/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; «webpack/lib/util/registerExternalSerializerœwebpack-sources/CachedSource w«webpack/lib/util/registerExternalSerializerœwebpack-sources/ConcatSource€«webpack/lib/util/registerExternalSerializer™webpack-sources/RawSourceå/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ CI: () => (/* binding */ signOut), /* harmony export */ Hh: () => (/* binding */ signUp), /* harmony export */ Jv: () => (/* binding */ signIn), /* harmony export */ wV: () => (/* binding */ useSession), /* harmony export */ yK: () => (/* binding */ authClient) /* harmony export */ }); /* harmony import */ var better_auth_react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6504); «webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSource import { createAuthClient } from 'better-auth/react'; const API_URL = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; export const authClient = createAuthClient({ baseURL: API_URL }); export const { signIn, signOut, signUp, useSession } = authClient; d4FdiE‚ˆœ«È΀˜"https://api.canhelp.gr"0€Ì(0,better_auth_react__WEBPACK_IMPORTED_MODULE_0__/* .createAuthClient */ .M)€€†buffer†source„size„maps„hashÌ/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ CI: () => (/* binding */ signOut), /* harmony export */ Hh: () => (/* binding */ signUp), /* harmony export */ Jv: () => (/* binding */ signIn), /* harmony export */ wV: () => (/* binding */ useSession), /* harmony export */ yK: () => (/* binding */ authClient) /* harmony export */ }); /* harmony import */ var better_auth_react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6504); const API_URL = "https://api.canhelp.gr" || 0; const authClient = (0,better_auth_react__WEBPACK_IMPORTED_MODULE_0__/* .createAuthClient */ .M)({ baseURL: API_URL }); const { signIn, signOut, signUp, useSession } = authClient; €”{"finalSource":true}ƒmap‹bufferedMap ConcatSourceRawSourceå/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ CI: () => (/* binding */ signOut), /* harmony export */ Hh: () => (/* binding */ signUp), /* harmony export */ Jv: () => (/* binding */ signIn), /* harmony export */ wV: () => (/* binding */ useSession), /* harmony export */ yK: () => (/* binding */ authClient) /* harmony export */ }); /* harmony import */ var better_auth_react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6504); ReplaceSourceRawSource import { createAuthClient } from 'better-auth/react'; const API_URL = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; export const authClient = createAuthClient({ baseURL: API_URL }); export const { signIn, signOut, signUp, useSession } = authClient; »052undefined70100"https://api.canhelp.gr"undefined1051270undefined130136undefined156171(0,better_auth_react__WEBPACK_IMPORTED_MODULE_0__/* .createAuthClient */ .M)undefined200206undefined /***/ }) ë5/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ CI: () => (/* binding */ signOut), /* harmony export */ Hh: () => (/* binding */ signUp), /* harmony export */ Jv: () => (/* binding */ signIn), /* harmony export */ wV: () => (/* binding */ useSession), /* harmony export */ yK: () => (/* binding */ authClient) /* harmony export */ }); /* harmony import */ var better_auth_react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6504); const API_URL = "https://api.canhelp.gr" || 0; const authClient = (0,better_auth_react__WEBPACK_IMPORTED_MODULE_0__/* .createAuthClient */ .M)({ baseURL: API_URL }); const { signIn, signOut, signUp, useSession } = authClient; /***/ }) ìï  ðñðå/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ CI: () => (/* binding */ signOut), /* harmony export */ Hh: () => (/* binding */ signUp), /* harmony export */ Jv: () => (/* binding */ signIn), /* harmony export */ wV: () => (/* binding */ useSession), /* harmony export */ yK: () => (/* binding */ authClient) /* harmony export */ }); /* harmony import */ var better_auth_react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6504); ò import { createAuthClient } from 'better-auth/react'; const API_URL = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; export const authClient = createAuthClient({ baseURL: API_URL }); export const { signIn, signOut, signUp, useSession } = authClient; »052undefined70100"https://api.canhelp.gr"undefined1051270undefined130136undefined156171(0,better_auth_react__WEBPACK_IMPORTED_MODULE_0__/* .createAuthClient */ .M)undefined200206undefinedóô, /***/ 3589:  [«webpack/lib/util/registerExternalSerializerœwebpack-sources/ConcatSource€«webpack/lib/util/registerExternalSerializer™webpack-sources/RawSourceV/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { «webpack/lib/util/registerExternalSerializerœwebpack-sources/CachedSource V«webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSource«webpack/lib/util/registerExternalSerializer™webpack-sources/RawSourceUimport(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/profile/page.tsx"); `RßPromise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 1511))€†buffer†source„size„maps„hashaPromise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 1511)); €”{"finalSource":true}ƒmap‹bufferedMap ReplaceSourceRawSourceUimport(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/profile/page.tsx"); k082Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 1511))undefined /***/ }) àÁ/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 1511)); /***/ }) áä åV/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { çUimport(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/profile/page.tsx"); k082Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 1511))undefinedèé, /***/ 5940:  /"«webpack/lib/util/registerExternalSerializerœwebpack-sources/ConcatSource€«webpack/lib/util/registerExternalSerializer™webpack-sources/RawSource_/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; «webpack/lib/util/registerExternalSerializerœwebpack-sources/CachedSource H «webpack/lib/util/registerExternalSerializerœwebpack-sources/ConcatSource€«webpack/lib/util/registerExternalSerializer™webpack-sources/RawSourceÍ/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ Ez: () => (/* binding */ CategoryIcon), /* harmony export */ V: () => (/* binding */ isCategoryIconUrl) /* harmony export */ }); /* unused harmony export resolveCategoryIconUrl */ /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); «webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSource'import { jsx as _jsx } from "react/jsx-runtime"; import React, { useEffect, useMemo, useState } from 'react'; const API_URL = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; export function isCategoryIconUrl(icon) { if (!icon) return false; const value = icon.trim(); return value.startsWith('http://') || value.startsWith('https://') || value.startsWith('/'); } export function resolveCategoryIconUrl(icon) { if (icon.startsWith('/api/')) return "".concat(API_URL).concat(icon); return icon; } export function CategoryIcon(param) { let { icon, alt = '', className, fallback = '📊' } = param; const value = (icon || '').trim(); const [hasError, setHasError] = useState(false); useEffect(()=>{ setHasError(false); }, [ value ]); const url = useMemo(()=>isCategoryIconUrl(value) ? resolveCategoryIconUrl(value) : '', [ value ]); const fallbackUrl = '/category-icons/package.svg'; if (isCategoryIconUrl(value)) { if (hasError && value !== fallbackUrl) { return /*#__PURE__*/ _jsx("img", { src: fallbackUrl, alt: alt, className: className, loading: "lazy", onError: ()=>setHasError(true) }); } if (hasError && value === fallbackUrl) { return /*#__PURE__*/ _jsx("span", { className: className, children: fallback }); } return /*#__PURE__*/ _jsx("img", { src: url, alt: alt, className: className, loading: "lazy", onError: ()=>setHasError(true) }); } return /*#__PURE__*/ _jsx("span", { className: className, children: value || fallback }); } e/1l~Vœ¡·ºÀƒ‰ÀÇÕÝ06@CloûþÊÍ€€˜"https://api.canhelp.gr"0€€€¯(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)°(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)®(0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)¶(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)ÿÿÿ€†buffer†source„size„maps„hash“ /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ Ez: () => (/* binding */ CategoryIcon), /* harmony export */ V: () => (/* binding */ isCategoryIconUrl) /* harmony export */ }); /* unused harmony export resolveCategoryIconUrl */ /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); const API_URL = "https://api.canhelp.gr" || 0; function isCategoryIconUrl(icon) { if (!icon) return false; const value = icon.trim(); return value.startsWith('http://') || value.startsWith('https://') || value.startsWith('/'); } function resolveCategoryIconUrl(icon) { if (icon.startsWith('/api/')) return "".concat(API_URL).concat(icon); return icon; } function CategoryIcon(param) { let { icon, alt = '', className, fallback = '📊' } = param; const value = (icon || '').trim(); const [hasError, setHasError] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ setHasError(false); }, [ value ]); const url = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(()=>isCategoryIconUrl(value) ? resolveCategoryIconUrl(value) : '', [ value ]); const fallbackUrl = '/category-icons/package.svg'; if (isCategoryIconUrl(value)) { if (hasError && value !== fallbackUrl) { return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: fallbackUrl, alt: alt, className: className, loading: "lazy", onError: ()=>setHasError(true) }); } if (hasError && value === fallbackUrl) { return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: className, children: fallback }); } return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: url, alt: alt, className: className, loading: "lazy", onError: ()=>setHasError(true) }); } return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: className, children: value || fallback }); } €”{"finalSource":true}ƒmap‹bufferedMap ConcatSourceRawSourceÍ/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ Ez: () => (/* binding */ CategoryIcon), /* harmony export */ V: () => (/* binding */ isCategoryIconUrl) /* harmony export */ }); /* unused harmony export resolveCategoryIconUrl */ /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); ReplaceSourceRawSource'import { jsx as _jsx } from "react/jsx-runtime"; import React, { useEffect, useMemo, useState } from 'react'; const API_URL = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; export function isCategoryIconUrl(icon) { if (!icon) return false; const value = icon.trim(); return value.startsWith('http://') || value.startsWith('https://') || value.startsWith('/'); } export function resolveCategoryIconUrl(icon) { if (icon.startsWith('/api/')) return "".concat(API_URL).concat(icon); return icon; } export function CategoryIcon(param) { let { icon, alt = '', className, fallback = '📊' } = param; const value = (icon || '').trim(); const [hasError, setHasError] = useState(false); useEffect(()=>{ setHasError(false); }, [ value ]); const url = useMemo(()=>isCategoryIconUrl(value) ? resolveCategoryIconUrl(value) : '', [ value ]); const fallbackUrl = '/category-icons/package.svg'; if (isCategoryIconUrl(value)) { if (hasError && value !== fallbackUrl) { return /*#__PURE__*/ _jsx("img", { src: fallbackUrl, alt: alt, className: className, loading: "lazy", onError: ()=>setHasError(true) }); } if (hasError && value === fallbackUrl) { return /*#__PURE__*/ _jsx("span", { className: className, children: fallback }); } return /*#__PURE__*/ _jsx("img", { src: url, alt: alt, className: className, loading: "lazy", onError: ()=>setHasError(true) }); } return /*#__PURE__*/ _jsx("span", { className: className, children: value || fallback }); } T047undefined49108undefined126156"https://api.canhelp.gr"undefined1611830undefined186192undefined387393undefined527533undefined704711(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined725733(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined816822(0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)undefined10881091(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined13881391(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined15311534(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined17381741(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined /***/ }) Õü /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ Ez: () => (/* binding */ CategoryIcon), /* harmony export */ V: () => (/* binding */ isCategoryIconUrl) /* harmony export */ }); /* unused harmony export resolveCategoryIconUrl */ /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); const API_URL = "https://api.canhelp.gr" || 0; function isCategoryIconUrl(icon) { if (!icon) return false; const value = icon.trim(); return value.startsWith('http://') || value.startsWith('https://') || value.startsWith('/'); } function resolveCategoryIconUrl(icon) { if (icon.startsWith('/api/')) return "".concat(API_URL).concat(icon); return icon; } function CategoryIcon(param) { let { icon, alt = '', className, fallback = '📊' } = param; const value = (icon || '').trim(); const [hasError, setHasError] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ setHasError(false); }, [ value ]); const url = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(()=>isCategoryIconUrl(value) ? resolveCategoryIconUrl(value) : '', [ value ]); const fallbackUrl = '/category-icons/package.svg'; if (isCategoryIconUrl(value)) { if (hasError && value !== fallbackUrl) { return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: fallbackUrl, alt: alt, className: className, loading: "lazy", onError: ()=>setHasError(true) }); } if (hasError && value === fallbackUrl) { return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: className, children: fallback }); } return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: url, alt: alt, className: className, loading: "lazy", onError: ()=>setHasError(true) }); } return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: className, children: value || fallback }); } /***/ }) ÖÙ  ÚÛÚÍ/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ Ez: () => (/* binding */ CategoryIcon), /* harmony export */ V: () => (/* binding */ isCategoryIconUrl) /* harmony export */ }); /* unused harmony export resolveCategoryIconUrl */ /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); Ü'import { jsx as _jsx } from "react/jsx-runtime"; import React, { useEffect, useMemo, useState } from 'react'; const API_URL = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; export function isCategoryIconUrl(icon) { if (!icon) return false; const value = icon.trim(); return value.startsWith('http://') || value.startsWith('https://') || value.startsWith('/'); } export function resolveCategoryIconUrl(icon) { if (icon.startsWith('/api/')) return "".concat(API_URL).concat(icon); return icon; } export function CategoryIcon(param) { let { icon, alt = '', className, fallback = '📊' } = param; const value = (icon || '').trim(); const [hasError, setHasError] = useState(false); useEffect(()=>{ setHasError(false); }, [ value ]); const url = useMemo(()=>isCategoryIconUrl(value) ? resolveCategoryIconUrl(value) : '', [ value ]); const fallbackUrl = '/category-icons/package.svg'; if (isCategoryIconUrl(value)) { if (hasError && value !== fallbackUrl) { return /*#__PURE__*/ _jsx("img", { src: fallbackUrl, alt: alt, className: className, loading: "lazy", onError: ()=>setHasError(true) }); } if (hasError && value === fallbackUrl) { return /*#__PURE__*/ _jsx("span", { className: className, children: fallback }); } return /*#__PURE__*/ _jsx("img", { src: url, alt: alt, className: className, loading: "lazy", onError: ()=>setHasError(true) }); } return /*#__PURE__*/ _jsx("span", { className: className, children: value || fallback }); } T047undefined49108undefined126156"https://api.canhelp.gr"undefined1611830undefined186192undefined387393undefined527533undefined704711(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined725733(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined816822(0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)undefined10881091(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined13881391(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined15311534(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined17381741(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefinedÝÞ }, «webpack/lib/util/registerExternalSerializerœwebpack-sources/PrefixSource‰/******/ 2__webpack_require__ => { // webpackRuntimeModules èvar __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId)) __webpack_require__.O(0, [1516,9906,2982,587,18,7358], () => (__webpack_exec__(3589))); var __webpack_exports__ = __webpack_require__.O(); _N_E = __webpack_exports__; } ]); ‘þÿÿ"(self["webpackChunk_N_E"] = self["webpackChunk_N_E"] || []).push([[6636],{ /***/ 1511: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ ProfilePage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7541); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(1592); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(9906); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(2982); /* harmony import */ var _components_CategoryIcon__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(5940); /* __next_internal_client_entry_do_not_use__ default auto */ function SpecialistCardEditor(param) { let { card, isOpen, onToggle, onUpdate, onDelete, categories, locationTree, catLocale, locale, hasPriceList, visibilityIssues = [], moderationNotice = null } = param; const { t } = (0,_context_locale__WEBPACK_IMPORTED_MODULE_4__/* .useLocale */ .Y)(); const hasVisibilityIssues = visibilityIssues.length > 0; const [cardTab, setCardTab] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)('main'); const [saving, setSaving] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [savedOk, setSavedOk] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [localTitle, setLocalTitle] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(card.title); var _card_descriptionEl; const [localDescEl, setLocalDescEl] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)((_card_descriptionEl = card.descriptionEl) !== null && _card_descriptionEl !== void 0 ? _card_descriptionEl : ''); var _card_descriptionEn; const [localDescEn, setLocalDescEn] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)((_card_descriptionEn = card.descriptionEn) !== null && _card_descriptionEn !== void 0 ? _card_descriptionEn : ''); var _card_descriptionRu; const [localDescRu, setLocalDescRu] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)((_card_descriptionRu = card.descriptionRu) !== null && _card_descriptionRu !== void 0 ? _card_descriptionRu : ''); var _card_descriptionUk; const [localDescUk, setLocalDescUk] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)((_card_descriptionUk = card.descriptionUk) !== null && _card_descriptionUk !== void 0 ? _card_descriptionUk : ''); var _card_skills; const [localSkills, setLocalSkills] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)((_card_skills = card.skills) !== null && _card_skills !== void 0 ? _card_skills : []); const [skillInput, setSkillInput] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); var _card_categories; const [localCategories, setLocalCategories] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)((_card_categories = card.categories) !== null && _card_categories !== void 0 ? _card_categories : []); var _card_locations; const [localLocations, setLocalLocations] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)((_card_locations = card.locations) !== null && _card_locations !== void 0 ? _card_locations : []); var _card_publicationStatus; const [localPublicationStatus, setLocalPublicationStatus] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)((_card_publicationStatus = card.publicationStatus) !== null && _card_publicationStatus !== void 0 ? _card_publicationStatus : card.isActive ? 'active' : 'inactive'); const [apiSkillSugs, setApiSkillSugs] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); var _card_portfolio; const [portfolio, setPortfolio] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)((_card_portfolio = card.portfolio) !== null && _card_portfolio !== void 0 ? _card_portfolio : []); const [portfolioUploading, setPortfolioUploading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [editingItem, setEditingItem] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [editTitle, setEditTitle] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [editDesc, setEditDesc] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const portfolioFileRef = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null); // Price list state const [priceList, setPriceList] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [priceListLoading, setPriceListLoading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [newGroupTitle, setNewGroupTitle] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [addingGroupId, setAddingGroupId] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [newItem, setNewItem] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)({ name: '', description: '', price: '', unit: '' }); const [editingGroupId, setEditingGroupId] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [editGroupTitle, setEditGroupTitle] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (cardTab !== 'pricelist' || priceList.length > 0 || priceListLoading) return; setPriceListLoading(true); _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getPriceList */ .Ck(card.id, locale).then(setPriceList).catch(()=>{}).finally(()=>setPriceListLoading(false)); }, [ cardTab, locale ]); async function handleAddGroup() { if (!newGroupTitle.trim()) return; const group = await _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .createPriceListGroup */ .vD(card.id, { title: newGroupTitle.trim(), locale: [ 'el', 'en', 'ru', 'uk' ].includes(locale) ? locale : 'el', autoTranslate: true }); setPriceList((prev)=>[ ...prev, group ]); setNewGroupTitle(''); } async function handleDeleteGroup(groupId) { await _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .deletePriceListGroup */ .Ic(groupId); setPriceList((prev)=>prev.filter((g)=>g.id !== groupId)); } async function handleSaveGroupTitle(groupId) { const updated = await _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .updatePriceListGroup */ .oD(groupId, { title: editGroupTitle.trim(), locale: [ 'el', 'en', 'ru', 'uk' ].includes(locale) ? locale : 'el', autoTranslate: true }); setPriceList((prev)=>prev.map((g)=>g.id === groupId ? { ...g, title: updated.title } : g)); setEditingGroupId(null); } async function handleAddItem(groupId) { if (!newItem.name.trim()) return; const item = await _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .createPriceListItem */ .Z2(groupId, { name: newItem.name.trim(), description: newItem.description.trim() || null, price: newItem.price.trim() || null, unit: newItem.unit.trim() || null, locale: [ 'el', 'en', 'ru', 'uk' ].includes(locale) ? locale : 'el', autoTranslate: true }); setPriceList((prev)=>prev.map((g)=>g.id === groupId ? { ...g, items: [ ...g.items, item ] } : g)); setNewItem({ name: '', description: '', price: '', unit: '' }); setAddingGroupId(null); } async function handleDeleteItem(itemId, groupId) { await _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .deletePriceListItem */ .U9(itemId); setPriceList((prev)=>prev.map((g)=>g.id === groupId ? { ...g, items: g.items.filter((i)=>i.id !== itemId) } : g)); } (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (cardTab !== 'skills') return; _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getSkillSuggestions */ .rl(localCategories.length > 0 ? localCategories : undefined).then(setApiSkillSugs).catch(()=>setApiSkillSugs([])); }, [ localCategories, cardTab ]); const lbl = (ru, en, el)=>locale === 'ru' ? ru : locale === 'en' ? en : el; async function saveAll() { setSaving(true); try { const activeLocale = [ 'el', 'en', 'ru', 'uk' ].includes(locale) ? locale : 'el'; const cap = activeLocale.charAt(0).toUpperCase() + activeLocale.slice(1); const descField = "description".concat(cap); const descValue = { el: localDescEl, en: localDescEn, ru: localDescRu, uk: localDescUk }[activeLocale] || null; const updated = await _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .updateSpecialistCard */ .zc(card.id, { title: localTitle, [descField]: descValue, descriptionLocale: activeLocale, autoTranslate: !!descValue, skills: localSkills, categories: localCategories, locations: localLocations, publicationStatus: localPublicationStatus, isActive: localPublicationStatus === 'active' }); onUpdate({ ...updated, portfolio }); setSavedOk(true); setTimeout(()=>setSavedOk(false), 2000); } catch (e) {} finally{ setSaving(false); } } async function updatePublicationStatus(next) { setLocalPublicationStatus(next); try { await _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .updateSpecialistCard */ .zc(card.id, { publicationStatus: next, isActive: next === 'active' }); } catch (e) {} } function addSkill(s) { const trimmed = s.trim(); if (trimmed && !localSkills.includes(trimmed)) setLocalSkills([ ...localSkills, trimmed ]); setSkillInput(''); } function toggleCategory(slug) { let childSlugs = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : []; if (localCategories.includes(slug)) { setLocalCategories(localCategories.filter((c)=>c !== slug && !childSlugs.includes(c))); } else { setLocalCategories([ ...new Set([ ...localCategories, slug, ...childSlugs ]) ]); } } function toggleLocation(slug) { let childSlugs = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : []; if (localLocations.includes(slug)) { setLocalLocations(localLocations.filter((c)=>c !== slug && !childSlugs.includes(c))); } else { setLocalLocations([ ...new Set([ ...localLocations, slug, ...childSlugs ]) ]); } } async function handlePortfolioUpload(e) { var _e_target_files; const file = (_e_target_files = e.target.files) === null || _e_target_files === void 0 ? void 0 : _e_target_files[0]; if (!file) return; setPortfolioUploading(true); try { const form = new FormData(); form.append('file', file); form.append('cardId', card.id); const res = await fetch("".concat("https://api.canhelp.gr" || 0, "/api/portfolio"), { method: 'POST', credentials: 'include', body: form }); if (!res.ok) throw new Error('Upload failed'); const item = await res.json(); const next = [ ...portfolio, item ]; setPortfolio(next); onUpdate({ ...card, portfolio: next }); } catch (e) {} finally{ setPortfolioUploading(false); if (portfolioFileRef.current) portfolioFileRef.current.value = ''; } } async function handlePortfolioDelete(id) { try { await _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .deletePortfolioItem */ .zB(id); const next = portfolio.filter((p)=>p.id !== id); setPortfolio(next); onUpdate({ ...card, portfolio: next }); } catch (e) {} } async function handlePortfolioSave(id) { try { const item = await _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .updatePortfolioItem */ .hl(id, { title: editTitle, description: editDesc }); setPortfolio((prev)=>prev.map((p)=>p.id === id ? item : p)); setEditingItem(null); } catch (e) {} } const cardTabs = [ { id: 'main', label: t('profile.card.tab.main') }, { id: 'categories', label: t('profile.card.tab.categories') }, { id: 'skills', label: t('profile.card.tab.skills') }, { id: 'geography', label: t('profile.card.tab.geography') }, { id: 'pricelist', label: t('profile.card.tab.pricelist'), hidden: !hasPriceList }, { id: 'portfolio', label: t('profile.card.tab.portfolio') } ]; const pendingReviewNotice = localPublicationStatus === 'pending' ? { title: t('profile.card.review_pending', 'Pending approval'), body: t('profile.card.review_pending_hint', 'Your card is being reviewed by the admin team.'), tone: 'amber' } : null; const effectiveModerationNotice = moderationNotice !== null && moderationNotice !== void 0 ? moderationNotice : pendingReviewNotice; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 overflow-hidden", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-3 px-4 py-3 border-b border-gray-100 ".concat(hasVisibilityIssues ? 'bg-amber-50' : ''), children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { type: "button", onClick: onToggle, className: "flex-1 flex items-center gap-3 text-left", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-sm font-semibold text-gray-800 flex-1", children: localTitle || card.title }), hasVisibilityIssues && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "inline-flex items-center justify-center w-5 h-5 rounded-full bg-amber-500 text-white text-xs font-bold", title: t('profile.card.visibility_issue', 'Card is not shown in offers'), children: "!" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-gray-400 text-xs", children: isOpen ? '▲' : 'â–Œ' }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>updatePublicationStatus(localPublicationStatus === 'active' ? 'inactive' : localPublicationStatus === 'pending' ? 'inactive' : 'pending'), className: "px-3 py-1.5 rounded-lg text-xs font-medium whitespace-nowrap ".concat(localPublicationStatus === 'active' ? 'bg-red-50 text-red-700 hover:bg-red-100' : localPublicationStatus === 'pending' ? 'bg-amber-50 text-amber-700 hover:bg-amber-100' : 'bg-green-50 text-green-700 hover:bg-green-100'), children: localPublicationStatus === 'active' ? t('profile.card.unpublish', 'Unpublish') : localPublicationStatus === 'pending' ? t('profile.card.withdraw_review', 'Withdraw request') : t('profile.card.submit_review', 'Submit for review') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: onDelete, className: "text-red-400 hover:text-red-600 text-sm px-1 flex-shrink-0", title: t('profile.card.delete'), children: "\uD83D\uDDD1" }) ] }), isOpen && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ hasVisibilityIssues && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "mx-4 mt-4 mb-2 rounded-lg border border-amber-300 bg-amber-50 p-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs font-semibold text-amber-900", children: t('profile.card.visibility_issue', 'Card is not shown in offers') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("ul", { className: "mt-1.5 list-disc pl-4 text-xs text-amber-900 space-y-0.5", children: visibilityIssues.map((issue)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("li", { children: issue }, issue)) }) ] }), effectiveModerationNotice && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "mx-4 mt-4 mb-2 rounded-lg border p-3 ".concat(effectiveModerationNotice.tone === 'green' ? 'border-green-300 bg-green-50' : effectiveModerationNotice.tone === 'red' ? 'border-red-300 bg-red-50' : 'border-amber-300 bg-amber-50'), children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs font-semibold ".concat(effectiveModerationNotice.tone === 'green' ? 'text-green-900' : effectiveModerationNotice.tone === 'red' ? 'text-red-900' : 'text-amber-900'), children: effectiveModerationNotice.title }), effectiveModerationNotice.body && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "mt-1 text-xs ".concat(effectiveModerationNotice.tone === 'green' ? 'text-green-800' : effectiveModerationNotice.tone === 'red' ? 'text-red-800' : 'text-amber-800'), children: effectiveModerationNotice.body }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex overflow-x-auto border-b border-gray-100 bg-gray-50 gap-0", children: cardTabs.filter((t)=>!t.hidden).map((t)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>setCardTab(t.id), className: "px-4 py-2.5 text-xs font-medium whitespace-nowrap border-b-2 transition -mb-px ".concat(cardTab === t.id ? 'border-green-500 text-green-600 bg-white' : 'border-transparent text-gray-500 hover:text-gray-700'), children: t.label }, t.id)) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "p-4", children: [ cardTab === 'main' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: localTitle, onChange: (e)=>setLocalTitle(e.target.value), maxLength: 200, placeholder: t('profile.cards.new_title'), 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" }), (()=>{ const activeLocale = [ 'el', 'en', 'ru', 'uk' ].includes(locale) ? locale : 'el'; const descMap = { el: [ localDescEl, setLocalDescEl ], en: [ localDescEn, setLocalDescEn ], ru: [ localDescRu, setLocalDescRu ], uk: [ localDescUk, setLocalDescUk ] }; const [val, setVal] = descMap[activeLocale]; const flags = { el: '🇬🇷', en: '🇬🇧', ru: '🇷🇺', uk: '🇺🇊' }; const otherLocales = [ 'el', 'en', 'ru', 'uk' ].filter((l)=>l !== activeLocale); const otherHasContent = otherLocales.some((l)=>descMap[l][0]); return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "flex items-center gap-1.5 text-xs font-medium text-gray-500 mb-1", children: [ flags[activeLocale], " ", t('profile.card.description', 'Description') ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("textarea", { value: val, onChange: (e)=>setVal(e.target.value), rows: 4, maxLength: 2000, placeholder: t('profile.bio.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" }), val && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400 mt-1", children: t('profile.card.desc_auto_translate', 'Will be automatically translated into other languages on save') }), otherHasContent && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-1.5 mt-1.5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-xs text-gray-400", children: t('profile.card.desc_translated', 'Translations available:') }), otherLocales.map((l)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-xs px-1.5 py-0.5 rounded-full ".concat(descMap[l][0] ? 'bg-green-50 text-green-600' : 'bg-gray-100 text-gray-400'), children: flags[l] }, l)) ] }) ] }); })() ] }), cardTab === 'skills' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-3", children: [ localSkills.length > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex flex-wrap gap-2", children: localSkills.map((s)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "flex items-center gap-1.5 bg-green-50 text-green-700 text-sm px-3 py-1 rounded-full", children: [ s, /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>setLocalSkills(localSkills.filter((x)=>x !== s)), className: "text-gray-400 hover:text-green-700 leading-none", children: "\xd7" }) ] }, s)) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: skillInput, onChange: (e)=>setSkillInput(e.target.value), onKeyDown: (e)=>{ if (e.key === 'Enter') { e.preventDefault(); addSkill(skillInput); } }, placeholder: t('profile.card.skill.add'), 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" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>addSkill(skillInput), className: "px-3 py-2 bg-gray-100 hover:bg-gray-200 rounded-lg text-sm font-medium", children: "+" }) ] }), apiSkillSugs.length > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex flex-wrap gap-1.5", children: apiSkillSugs.map((s)=>{ var _s_names_catLocale; return (_s_names_catLocale = s.names[catLocale]) !== null && _s_names_catLocale !== void 0 ? _s_names_catLocale : s.names.el; }).filter((name, i, arr)=>arr.indexOf(name) === i && !localSkills.includes(name)).slice(0, 16).map((name)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { type: "button", onClick: ()=>addSkill(name), className: "text-xs px-2.5 py-1 border border-gray-200 rounded-full text-gray-500 hover:border-green-400 hover:text-green-600 transition", children: [ "+ ", name ] }, name)) }) ] }), cardTab === 'categories' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "space-y-3", children: categories.map((cat)=>{ var _cat_names, _cat_names1; var _cat_names_catLocale, _ref; const catName = (_ref = (_cat_names_catLocale = (_cat_names = cat.names) === null || _cat_names === void 0 ? void 0 : _cat_names[catLocale]) !== null && _cat_names_catLocale !== void 0 ? _cat_names_catLocale : (_cat_names1 = cat.names) === null || _cat_names1 === void 0 ? void 0 : _cat_names1.el) !== null && _ref !== void 0 ? _ref : cat.slug; var _cat_children; const children = (_cat_children = cat.children) !== null && _cat_children !== void 0 ? _cat_children : []; const childSlugs = children.map((c)=>c.slug); return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "flex items-center gap-2.5 cursor-pointer", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "checkbox", checked: localCategories.includes(cat.slug), onChange: ()=>toggleCategory(cat.slug, childSlugs), className: "w-4 h-4 rounded border-gray-300 text-green-600 focus:ring-blue-400" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "text-sm font-medium text-gray-800 inline-flex items-center gap-1", children: [ cat.icon && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components_CategoryIcon__WEBPACK_IMPORTED_MODULE_6__/* .CategoryIcon */ .Ez, { icon: cat.icon, alt: catName, className: (0,_components_CategoryIcon__WEBPACK_IMPORTED_MODULE_6__/* .isCategoryIconUrl */ .V)(cat.icon) ? 'h-4 w-4 object-contain' : 'text-sm leading-none', fallback: "\uD83D\uDCE6" }), catName ] }) ] }), children.length > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "ml-6 mt-2 space-y-2", children: children.map((sub)=>{ var _sub_names, _sub_names1; var _sub_names_catLocale, _ref; const subName = (_ref = (_sub_names_catLocale = (_sub_names = sub.names) === null || _sub_names === void 0 ? void 0 : _sub_names[catLocale]) !== null && _sub_names_catLocale !== void 0 ? _sub_names_catLocale : (_sub_names1 = sub.names) === null || _sub_names1 === void 0 ? void 0 : _sub_names1.el) !== null && _ref !== void 0 ? _ref : sub.slug; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "flex items-center gap-2.5 cursor-pointer", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "checkbox", checked: localCategories.includes(sub.slug), onChange: ()=>toggleCategory(sub.slug), className: "w-4 h-4 rounded border-gray-300 text-green-600 focus:ring-blue-400" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-sm text-gray-600", children: subName }) ] }, sub.id); }) }) ] }, cat.id); }) }), cardTab === 'geography' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "space-y-3", children: locationTree.map((city)=>{ var _city_names, _city_names1; var _city_names_catLocale, _ref; const cityName = (_ref = (_city_names_catLocale = (_city_names = city.names) === null || _city_names === void 0 ? void 0 : _city_names[catLocale]) !== null && _city_names_catLocale !== void 0 ? _city_names_catLocale : (_city_names1 = city.names) === null || _city_names1 === void 0 ? void 0 : _city_names1.el) !== null && _ref !== void 0 ? _ref : city.slug; var _city_children; const districts = (_city_children = city.children) !== null && _city_children !== void 0 ? _city_children : []; const districtSlugs = districts.map((d)=>d.slug); return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "flex items-center gap-2.5 cursor-pointer", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "checkbox", checked: localLocations.includes(city.slug), onChange: ()=>toggleLocation(city.slug, districtSlugs), className: "w-4 h-4 rounded border-gray-300 text-green-600 focus:ring-blue-400" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-sm font-medium text-gray-800", children: cityName }) ] }), districts.length > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "ml-6 mt-2 space-y-2", children: districts.map((d)=>{ var _d_names, _d_names1; var _d_names_catLocale, _ref; const dName = (_ref = (_d_names_catLocale = (_d_names = d.names) === null || _d_names === void 0 ? void 0 : _d_names[catLocale]) !== null && _d_names_catLocale !== void 0 ? _d_names_catLocale : (_d_names1 = d.names) === null || _d_names1 === void 0 ? void 0 : _d_names1.el) !== null && _ref !== void 0 ? _ref : d.slug; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "flex items-center gap-2.5 cursor-pointer", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "checkbox", checked: localLocations.includes(d.slug), onChange: ()=>toggleLocation(d.slug), className: "w-4 h-4 rounded border-gray-300 text-green-600 focus:ring-blue-400" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-sm text-gray-600", children: dName }) ] }, d.id); }) }) ] }, city.id); }) }), cardTab === 'pricelist' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "space-y-4", children: priceListLoading ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-center py-6 text-gray-400 text-sm", children: t('common.loading', 'Loading...') }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [ priceList.length === 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-center py-6 text-gray-400 text-sm border-2 border-dashed border-gray-200 rounded-xl", children: t('profile.card.pricelist.empty') }), priceList.map((group)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "border border-gray-200 rounded-xl overflow-hidden", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex items-center gap-2 bg-gray-50 px-4 py-2.5 border-b border-gray-200", children: editingGroupId === group.id ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: editGroupTitle, onChange: (e)=>setEditGroupTitle(e.target.value), className: "flex-1 border border-gray-300 rounded-lg px-3 py-1.5 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400", onKeyDown: (e)=>{ if (e.key === 'Enter') handleSaveGroupTitle(group.id); }, autoFocus: true }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>handleSaveGroupTitle(group.id), className: "px-3 py-1.5 bg-green-600 text-white rounded-lg text-xs font-medium hover:bg-green-700", children: t('profile.card.pricelist.save_group') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>setEditingGroupId(null), className: "px-2 py-1.5 text-gray-500 hover:text-gray-700 text-xs", children: "✕" }) ] }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "flex-1 font-semibold text-sm text-gray-800", children: group.title }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>{ setEditingGroupId(group.id); setEditGroupTitle(group.title); }, className: "text-gray-400 hover:text-green-600 text-xs px-2 py-1 rounded hover:bg-green-50", children: "✏" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>handleDeleteGroup(group.id), className: "text-gray-400 hover:text-red-500 text-xs px-2 py-1 rounded hover:bg-red-50", children: t('profile.card.pricelist.delete_group') }) ] }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "divide-y divide-gray-100", children: group.items.map((item)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-3 px-4 py-2.5 text-sm group", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "font-medium text-gray-800 truncate", children: item.name }), item.description && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-500 truncate", children: item.description }) ] }), (item.price || item.unit) && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "text-green-700 font-semibold text-sm whitespace-nowrap", children: [ item.price ? "€".concat(item.price) : '', item.unit ? " ".concat(item.unit) : '' ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>handleDeleteItem(item.id, group.id), className: "opacity-0 group-hover:opacity-100 text-red-400 hover:text-red-600 text-xs px-1 transition", children: t('profile.card.pricelist.delete_item') }) ] }, item.id)) }), addingGroupId === group.id ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "p-3 bg-green-50 border-t border-green-100 space-y-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { placeholder: t('profile.card.pricelist.item_name'), value: newItem.name, onChange: (e)=>setNewItem((p)=>({ ...p, name: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { placeholder: t('profile.card.pricelist.item_desc'), value: newItem.description, onChange: (e)=>setNewItem((p)=>({ ...p, description: e.target.value })), className: "w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { placeholder: t('profile.card.pricelist.item_price'), value: newItem.price, onChange: (e)=>setNewItem((p)=>({ ...p, price: e.target.value })), className: "w-28 border border-gray-300 rounded-lg px-3 py-1.5 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { placeholder: t('profile.card.pricelist.item_unit'), value: newItem.unit, onChange: (e)=>setNewItem((p)=>({ ...p, unit: e.target.value })), className: "flex-1 border border-gray-300 rounded-lg px-3 py-1.5 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>handleAddItem(group.id), className: "px-4 py-1.5 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700", children: t('profile.card.pricelist.save_item') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>{ setAddingGroupId(null); setNewItem({ name: '', description: '', price: '', unit: '' }); }, className: "px-3 py-1.5 text-gray-500 hover:text-gray-700 text-sm", children: "✕" }) ] }) ] }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "px-4 py-2 border-t border-gray-100", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { type: "button", onClick: ()=>setAddingGroupId(group.id), className: "text-green-600 hover:text-gray-800 text-sm font-medium", children: [ "+ ", t('profile.card.pricelist.add_item') ] }) }) ] }, group.id)), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-2 pt-1", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { placeholder: t('profile.card.pricelist.group_title'), value: newGroupTitle, onChange: (e)=>setNewGroupTitle(e.target.value), onKeyDown: (e)=>{ if (e.key === 'Enter') handleAddGroup(); }, 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" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: handleAddGroup, className: "px-4 py-2 bg-green-600 hover:bg-green-700 text-white rounded-lg text-sm font-medium", children: t('profile.card.pricelist.add_group') }) ] }) ] }) }), cardTab === 'portfolio' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-3", children: [ portfolio.length < 20 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>{ var _portfolioFileRef_current; return (_portfolioFileRef_current = portfolioFileRef.current) === null || _portfolioFileRef_current === void 0 ? void 0 : _portfolioFileRef_current.click(); }, disabled: portfolioUploading, className: "flex items-center gap-2 px-4 py-2 bg-green-600 hover:bg-green-700 text-white rounded-lg text-sm font-medium disabled:opacity-50", children: portfolioUploading ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "w-4 h-4 border-2 border-white border-t-transparent rounded-full animate-spin" }), t('profile.card.photo.uploading') ] }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [ "\uD83D\uDCF7 ", t('profile.card.photo.add') ] }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { ref: portfolioFileRef, type: "file", accept: "image/jpeg,image/png,image/webp", className: "hidden", onChange: handlePortfolioUpload }) ] }), portfolio.length === 0 ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-center py-8 text-gray-400 text-sm border-2 border-dashed border-gray-200 rounded-xl", children: t('profile.card.photo.empty') }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "grid grid-cols-2 sm:grid-cols-3 gap-3", children: portfolio.map((item)=>{ var _item_title; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "group relative rounded-xl overflow-hidden border border-gray-200 bg-gray-50", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: item.imageUrl, alt: (_item_title = item.title) !== null && _item_title !== void 0 ? _item_title : '', className: "w-full aspect-square object-cover" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "absolute inset-0 bg-black/0 group-hover:bg-black/50 transition-all flex flex-col justify-between p-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>handlePortfolioDelete(item.id), className: "self-end opacity-0 group-hover:opacity-100 transition w-7 h-7 rounded-full bg-red-500 text-white text-sm flex items-center justify-center hover:bg-red-600", children: "\xd7" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { type: "button", onClick: ()=>{ setEditingItem(item); var _item_title; setEditTitle((_item_title = item.title) !== null && _item_title !== void 0 ? _item_title : ''); var _item_description; setEditDesc((_item_description = item.description) !== null && _item_description !== void 0 ? _item_description : ''); }, className: "opacity-0 group-hover:opacity-100 transition text-xs text-white bg-black/50 hover:bg-black/70 rounded-lg px-2 py-1", children: [ "✏ ", t('profile.card.item.edit') ] }) ] }), item.title && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "px-2 py-1.5", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs font-medium text-gray-700 truncate", children: item.title }) }) ] }, item.id); }) }) ] }), cardTab !== 'portfolio' && cardTab !== 'pricelist' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-3 mt-4 pt-4 border-t border-gray-100", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", disabled: saving, onClick: saveAll, className: "px-5 py-2 bg-green-600 hover:bg-green-700 text-white rounded-lg text-sm font-semibold disabled:opacity-50", children: saving ? '...' : t('profile.card.save') }), savedOk && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "text-sm text-green-600", children: [ "✓ ", t('profile.card.saved') ] }) ] }) ] }) ] }), editingItem && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "fixed inset-0 z-50 flex items-center justify-center bg-black/50 px-4", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-2xl shadow-xl p-6 w-full max-w-md", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h3", { className: "font-semibold text-gray-800 mb-4", children: t('profile.card.item.edit') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: editingItem.imageUrl, alt: "", className: "w-full h-40 object-cover rounded-xl mb-4" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('profile.card.item.title') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: editTitle, onChange: (e)=>setEditTitle(e.target.value), maxLength: 200, 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" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('profile.card.item.desc') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("textarea", { value: editDesc, onChange: (e)=>setEditDesc(e.target.value), rows: 3, maxLength: 1000, 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" }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-3 mt-5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>handlePortfolioSave(editingItem.id), className: "flex-1 bg-green-600 hover:bg-green-700 text-white py-2 rounded-lg text-sm font-medium", children: t('profile.card.item.save') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>setEditingItem(null), className: "flex-1 bg-gray-100 hover:bg-gray-200 text-gray-700 py-2 rounded-lg text-sm font-medium", children: t('profile.card.item.cancel') }) ] }) ] }) }) ] }); } // ─── AutoResponseTab ─────────────────────────────────────────────────────── function AutoResponseTab(param) { let { categories, locationTree, loaded, onLoad, settings, saving, saved, onSave, t, catLocale } = param; const { useEffect: _ue, useState: _us } = { useEffect: react__WEBPACK_IMPORTED_MODULE_1__.useEffect, useState: react__WEBPACK_IMPORTED_MODULE_1__.useState }; const [enabled, setEnabled] = _us(false); const [minBudget, setMinBudget] = _us(''); const [maxBudget, setMaxBudget] = _us(''); const [defaultPrice, setDefaultPrice] = _us(''); const [defaultMessage, setDefaultMessage] = _us(''); const [maxPerDay, setMaxPerDay] = _us(''); const [selCategories, setSelCategories] = _us([]); const [selLocations, setSelLocations] = _us([]); _ue(()=>{ onLoad(); }, []); _ue(()=>{ if (!settings) return; setEnabled(settings.enabled); setMinBudget(settings.minBudget != null ? String(settings.minBudget) : ''); setMaxBudget(settings.maxBudget != null ? String(settings.maxBudget) : ''); setDefaultPrice(settings.defaultPrice != null ? String(settings.defaultPrice) : ''); var _settings_defaultMessage; setDefaultMessage((_settings_defaultMessage = settings.defaultMessage) !== null && _settings_defaultMessage !== void 0 ? _settings_defaultMessage : ''); setMaxPerDay(settings.maxAutoOffersPerDay != null ? String(settings.maxAutoOffersPerDay) : ''); var _settings_categories; setSelCategories((_settings_categories = settings.categories) !== null && _settings_categories !== void 0 ? _settings_categories : []); var _settings_locations; setSelLocations((_settings_locations = settings.locations) !== null && _settings_locations !== void 0 ? _settings_locations : []); }, [ settings ]); if (!loaded) return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-center py-10 text-white/60", children: t('common.loading') }); const flatLocations = []; function flatten(nodes) { for (const n of nodes){ var _n_children; flatLocations.push({ id: n.id, name: n.name }); if ((_n_children = n.children) === null || _n_children === void 0 ? void 0 : _n_children.length) flatten(n.children); } } flatten(locationTree); return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "bg-white rounded-xl border border-gray-200 p-5", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "flex items-center justify-between cursor-pointer", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "font-medium text-gray-800", children: t('auto_response.title', 'Auto response') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400 mt-0.5", children: t('auto_response.desc', 'Automatically respond to matching tasks') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>setEnabled((v)=>!v), className: "relative inline-flex h-6 w-11 items-center rounded-full transition-colors ".concat(enabled ? 'bg-green-500' : 'bg-gray-300'), children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "inline-block h-4 w-4 transform rounded-full bg-white shadow transition-transform ".concat(enabled ? 'translate-x-6' : 'translate-x-1') }) }) ] }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-5 space-y-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h3", { className: "font-medium text-gray-800 text-sm", children: t('auto_response.budget_range', 'Task budget') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "grid grid-cols-2 gap-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs text-gray-500 mb-1", children: t('auto_response.min_budget', 'Min €') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "number", min: "0", value: minBudget, onChange: (e)=>setMinBudget(e.target.value), placeholder: "0", 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" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs text-gray-500 mb-1", children: t('auto_response.max_budget', 'Max €') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "number", min: "0", value: maxBudget, onChange: (e)=>setMaxBudget(e.target.value), placeholder: "∞", className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs text-gray-500 mb-1", children: t('auto_response.default_price', 'Default price €') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "number", min: "0", value: defaultPrice, onChange: (e)=>setDefaultPrice(e.target.value), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs text-gray-500 mb-1", children: t('auto_response.max_per_day', 'Max auto-offers/day') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "number", min: "1", max: "50", value: maxPerDay, onChange: (e)=>setMaxPerDay(e.target.value), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs text-gray-500 mb-1", children: t('auto_response.default_message', 'Auto-response text') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("textarea", { value: defaultMessage, onChange: (e)=>setDefaultMessage(e.target.value), rows: 4, maxLength: 2000, placeholder: t('auto_response.message_placeholder', 'Hello! I can help with this task...'), 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" }) ] }), categories.length > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h3", { className: "font-medium text-gray-800 text-sm mb-3", children: t('auto_response.categories', 'Task categories') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex flex-wrap gap-2 max-h-40 overflow-y-auto", children: categories.flatMap((cat)=>{ var _cat_children; return [ cat, ...(_cat_children = cat.children) !== null && _cat_children !== void 0 ? _cat_children : [] ]; }).map((cat)=>{ var _cat_names, _cat_names1; var _cat_names_catLocale, _ref; const name = (_ref = (_cat_names_catLocale = (_cat_names = cat.names) === null || _cat_names === void 0 ? void 0 : _cat_names[catLocale]) !== null && _cat_names_catLocale !== void 0 ? _cat_names_catLocale : (_cat_names1 = cat.names) === null || _cat_names1 === void 0 ? void 0 : _cat_names1.el) !== null && _ref !== void 0 ? _ref : cat.slug; const sel = selCategories.includes(cat.slug); return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>setSelCategories(sel ? selCategories.filter((c)=>c !== cat.slug) : [ ...selCategories, cat.slug ]), className: "px-3 py-1.5 rounded-lg text-xs border transition ".concat(sel ? 'bg-green-600 border-green-600 text-white' : 'bg-white border-gray-300 text-gray-700 hover:border-green-400'), children: name }, cat.slug); }) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", disabled: saving, onClick: ()=>onSave({ enabled, minBudget: minBudget ? Number(minBudget) : null, maxBudget: maxBudget ? Number(maxBudget) : null, defaultPrice: defaultPrice ? Number(defaultPrice) : null, defaultMessage: defaultMessage || null, maxAutoOffersPerDay: maxPerDay ? Number(maxPerDay) : null, categories: selCategories.length > 0 ? selCategories : null, locations: selLocations.length > 0 ? selLocations : null }), className: "w-full bg-green-600 text-white py-3 rounded-xl font-semibold hover:bg-green-700 disabled:opacity-50", children: saving ? t('common.loading') : saved ? t('auto_response.saved', 'Saved ✓') : t('common.save') }) ] }); } function ProfilePage() { return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(react__WEBPACK_IMPORTED_MODULE_1__.Suspense, { fallback: null, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(ProfilePageInner, {}) }); } function ProfilePageInner() { var _user_firstName, _user_lastName, _dashData_features, _dashData_features1, _dashData_features2, _user_plan, _user_plan1, _user_plan2, _dashData_features3, _dashData_features4, _dashData_plan, _dashData_plan1, _user_plan3; const router = (0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)(); const searchParams = (0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useSearchParams)(); const { data: session, isPending } = (0,_lib_auth__WEBPACK_IMPORTED_MODULE_3__/* .useSession */ .wV)(); const { t, locale } = (0,_context_locale__WEBPACK_IMPORTED_MODULE_4__/* .useLocale */ .Y)(); const validTabs = [ 'info', 'finance', 'cards', 'notifications', 'reviews', 'referral', 'auto_response', 'site' ]; var _searchParams_get; const initialTab = (_searchParams_get = searchParams.get('tab')) !== null && _searchParams_get !== void 0 ? _searchParams_get : 'info'; const [activeTab, setActiveTab] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(validTabs.includes(initialTab) ? initialTab : 'info'); const [user, setUser] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [loading, setLoading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(true); const [saving, setSaving] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [saved, setSaved] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [error, setError] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [formData, setFormData] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)({ firstName: '', lastName: '', phone: '', bio: '', locale: 'el' }); const [selectedLanguages, setSelectedLanguages] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); // Specialist cards const [cards, setCards] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [maxCards, setMaxCards] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(1); const [cardsLoading, setCardsLoading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [cardNotifications, setCardNotifications] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [openCardId, setOpenCardId] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [creatingCard, setCreatingCard] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [newCardTitle, setNewCardTitle] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [showNewCardForm, setShowNewCardForm] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [showUpgradeModal, setShowUpgradeModal] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); // Reference data const [categories, setCategories] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [locationTree, setLocationTree] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); // Become specialist const [becomingSpecialist, setBecomingSpecialist] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [avatarUploading, setAvatarUploading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [backgroundUploading, setBackgroundUploading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const fileRef = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null); const backgroundFileRef = (0,react__WEBPACK_IMPORTED_MODULE_1__.useRef)(null); // Notification preferences const [notifyNewTasks, setNotifyNewTasks] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [notifMessages, setNotifMessages] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(true); const [notifySaving, setNotifySaving] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [notifySaved, setNotifySaved] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); // Email verification resend const [resendState, setResendState] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)('idle'); // Referral info const [referralCode, setReferralCode] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [referralCount, setReferralCount] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(0); const [referralCopied, setReferralCopied] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [referralLoaded, setReferralLoaded] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); // Balance top-up modal const [showTopUpModal, setShowTopUpModal] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [topUpAmount, setTopUpAmount] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(10); const [topUpLoading, setTopUpLoading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [topUpError, setTopUpError] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [balanceHistory, setBalanceHistory] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [planHistory, setPlanHistory] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); // Plan data + statuses const [dashData, setDashData] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [myStatuses, setMyStatuses] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)([]); const [statusToggling, setStatusToggling] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [personalSiteSlug, setPersonalSiteSlug] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [slugSaving, setSlugSaving] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [slugSaved, setSlugSaved] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [slugCopied, setSlugCopied] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [slugError, setSlugError] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [showContactInfo, setShowContactInfo] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [siteSettings, setSiteSettings] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)({}); const [siteSettingsSaving, setSiteSettingsSaving] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [siteStats, setSiteStats] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [siteStatsLoading, setSiteStatsLoading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [autoResponse, setAutoResponse] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [arLoaded, setArLoaded] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [arSaving, setArSaving] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [arSaved, setArSaved] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); async function handleTopUp() { const amount = Number(topUpAmount); if (!amount || amount < 1) return; setTopUpLoading(true); setTopUpError(''); try { const { url, params } = await _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .initiateTopUp */ .oh(amount); // Build and auto-submit form to ePay const form = document.createElement('form'); form.method = 'POST'; form.action = url; Object.entries(params).forEach((param)=>{ let [k, v] = param; const input = document.createElement('input'); input.type = 'hidden'; input.name = k; input.value = v; form.appendChild(input); }); document.body.appendChild(form); form.submit(); } catch (e) { setTopUpError((e === null || e === void 0 ? void 0 : e.message) || t('profile.balance.topup.error')); setTopUpLoading(false); } } async function handleResendVerification() { if (!(user === null || user === void 0 ? void 0 : user.email) || resendState !== 'idle') return; setResendState('sending'); const callbackURL = "".concat(window.location.origin, "/profile"); const result = await _lib_auth__WEBPACK_IMPORTED_MODULE_3__/* .authClient */ .yK.sendVerificationEmail({ email: user.email, callbackURL }); if (result === null || result === void 0 ? void 0 : result.error) { setResendState('idle'); } else { setResendState('sent'); } } (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (activeTab !== 'referral' || referralLoaded) return; _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getMyReferralInfo */ .st().then((r)=>{ setReferralCode(r.referralCode); setReferralCount(r.referralCount); }).catch(()=>{}).finally(()=>setReferralLoaded(true)); }, [ activeTab ]); // Reviews const [myReviews, setMyReviews] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [reviewsLoading, setReviewsLoading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [myRating, setMyRating] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (activeTab !== 'reviews' || myReviews !== null || reviewsLoading) return; setReviewsLoading(true); _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getMyReviews */ .q7().then(setMyReviews).catch(()=>setMyReviews([])).finally(()=>setReviewsLoading(false)); }, [ activeTab ]); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (activeTab !== 'site' || siteStats !== null || siteStatsLoading) return; setSiteStatsLoading(true); _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getSiteStats */ .RN().then((res)=>setSiteStats(res.days)).catch(()=>setSiteStats([])).finally(()=>setSiteStatsLoading(false)); }, [ activeTab ]); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!isPending && !session) router.push('/login'); }, [ session, isPending ]); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!session) return; Promise.all([ _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Em('/users/me'), _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getCategories */ .bW(), _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getLocations */ .Vs(), _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getMyDashboard */ .H().catch(()=>null), _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getMyStatuses */ .z6().catch(()=>[]), _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getBalanceHistory */ .fm(8).catch(()=>[]), _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getPlanHistory */ .ew(20).catch(()=>[]) ]).then((param)=>{ let [u, cats, locs, dash, statusRes, history, phist] = param; setUser(u); var _u_firstName, _u_lastName, _u_phone, _u_bio, _u_locale; setFormData({ firstName: (_u_firstName = u.firstName) !== null && _u_firstName !== void 0 ? _u_firstName : '', lastName: (_u_lastName = u.lastName) !== null && _u_lastName !== void 0 ? _u_lastName : '', phone: (_u_phone = u.phone) !== null && _u_phone !== void 0 ? _u_phone : '', bio: (_u_bio = u.bio) !== null && _u_bio !== void 0 ? _u_bio : '', locale: (_u_locale = u.locale) !== null && _u_locale !== void 0 ? _u_locale : 'el' }); var _u_languages; setSelectedLanguages((_u_languages = u.languages) !== null && _u_languages !== void 0 ? _u_languages : []); var _u_notifyNewTasks; setNotifyNewTasks((_u_notifyNewTasks = u.notifyNewTasks) !== null && _u_notifyNewTasks !== void 0 ? _u_notifyNewTasks : false); var _u_notifMessages; setNotifMessages((_u_notifMessages = u.notifMessages) !== null && _u_notifMessages !== void 0 ? _u_notifMessages : true); setCategories(cats); setLocationTree(locs); setDashData(dash); setMyStatuses((statusRes !== null && statusRes !== void 0 ? statusRes : []).filter((s)=>s.isActive).map((s)=>s.statusType)); setBalanceHistory(history); setPlanHistory(phist); var _u_personalSiteSlug; setPersonalSiteSlug((_u_personalSiteSlug = u.personalSiteSlug) !== null && _u_personalSiteSlug !== void 0 ? _u_personalSiteSlug : ''); var _u_showContactInfo; setShowContactInfo((_u_showContactInfo = u.showContactInfo) !== null && _u_showContactInfo !== void 0 ? _u_showContactInfo : false); var _u_siteSettings; setSiteSettings((_u_siteSettings = u.siteSettings) !== null && _u_siteSettings !== void 0 ? _u_siteSettings : {}); loadCards(); _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getUserRating */ .Bm(u.id).then((r)=>setMyRating(r.avg)).catch(()=>{}); }).catch(()=>{}).finally(()=>setLoading(false)); }, [ session ]); async function loadCards() { setCardsLoading(true); try { const { cards: c, maxCards: m } = await _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getMySpecialistCards */ .Bb(); setCards(c); setMaxCards(m); setOpenCardId((prev)=>{ var _c_; var _c__id; return prev && c.some((card)=>card.id === prev) ? prev : (_c__id = (_c_ = c[0]) === null || _c_ === void 0 ? void 0 : _c_.id) !== null && _c__id !== void 0 ? _c__id : null; }); _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getNotifications */ .Tr().then((rows)=>setCardNotifications(rows.filter((row)=>[ 'specialist_card_submitted', 'specialist_card_approved', 'specialist_card_rejected' ].includes(row.type)))).catch(()=>setCardNotifications([])); } catch (e) {} finally{ setCardsLoading(false); } } async function handleSubmit(e) { e.preventDefault(); setError(''); setSaving(true); try { const updated = await _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Em('/users/me', { method: 'PATCH', body: JSON.stringify({ firstName: formData.firstName, lastName: formData.lastName, phone: formData.phone || undefined, bio: formData.bio || undefined, bioLocale: formData.locale, autoTranslateBio: true, locale: formData.locale, languages: selectedLanguages, showContactInfo }) }); setUser(updated); setSaved(true); setTimeout(()=>setSaved(false), 2500); } catch (err) { setError(err.message || t('common.error')); } finally{ setSaving(false); } } async function handleBecomeSpecialist() { setBecomingSpecialist(true); setError(''); try { const updated = await _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Em('/users/me/become-specialist', { method: 'POST' }); setUser(updated); setActiveTab('cards'); loadCards(); } catch (err) { setError(err.message || t('common.error')); } finally{ setBecomingSpecialist(false); } } async function handleSaveSiteSlug() { setSlugSaving(true); setSlugError(''); try { const updated = await _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Em('/users/me', { method: 'PATCH', body: JSON.stringify({ personalSiteSlug: personalSiteSlug || null }) }); setUser(updated); var _updated_personalSiteSlug; setPersonalSiteSlug((_updated_personalSiteSlug = updated.personalSiteSlug) !== null && _updated_personalSiteSlug !== void 0 ? _updated_personalSiteSlug : ''); setSlugSaved(true); setTimeout(()=>setSlugSaved(false), 2500); } catch (err) { var _err_code; const code = (_err_code = err === null || err === void 0 ? void 0 : err.code) !== null && _err_code !== void 0 ? _err_code : ''; if (code === 'SLUG_TAKEN' || err.message === 'This URL is already taken') { setSlugError(t('profile.site.slug_taken', 'This address is already taken')); } else { setSlugError(err.message || t('common.error')); } } finally{ setSlugSaving(false); } } async function handleSaveSiteSettings(newSettings) { setSiteSettings(newSettings); setSiteSettingsSaving(true); try { await _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Em('/users/me', { method: 'PATCH', body: JSON.stringify({ siteSettings: newSettings }) }); } catch (e) {} finally{ setSiteSettingsSaving(false); } } async function handleAvatarChange(e) { var _e_target_files; const file = (_e_target_files = e.target.files) === null || _e_target_files === void 0 ? void 0 : _e_target_files[0]; if (!file) return; setAvatarUploading(true); try { const form = new FormData(); form.append('file', file); const res = await fetch("".concat("https://api.canhelp.gr" || 0, "/api/uploads"), { method: 'POST', credentials: 'include', body: form }); if (!res.ok) throw new Error('Upload failed'); const { url } = await res.json(); const fullUrl = "".concat("https://api.canhelp.gr" || 0).concat(url); await _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Em('/users/me', { method: 'PATCH', body: JSON.stringify({ image: fullUrl }) }); setUser((prev)=>({ ...prev, image: fullUrl })); } catch (e) { setError(t('profile.upload.error')); } finally{ setAvatarUploading(false); } } async function handleBackgroundChange(e) { var _e_target_files; const file = (_e_target_files = e.target.files) === null || _e_target_files === void 0 ? void 0 : _e_target_files[0]; if (!file) return; setBackgroundUploading(true); try { const form = new FormData(); form.append('file', file); const res = await fetch("".concat("https://api.canhelp.gr" || 0, "/api/uploads"), { method: 'POST', credentials: 'include', body: form }); if (!res.ok) throw new Error('Upload failed'); const { url } = await res.json(); const fullUrl = "".concat("https://api.canhelp.gr" || 0).concat(url); const nextSettings = { ...siteSettings, profileBackgroundImage: fullUrl }; await _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Em('/users/me', { method: 'PATCH', body: JSON.stringify({ siteSettings: nextSettings }) }); setSiteSettings(nextSettings); setSaved(true); setTimeout(()=>setSaved(false), 2500); } catch (e) { setError(t('profile.upload.error')); } finally{ setBackgroundUploading(false); if (backgroundFileRef.current) backgroundFileRef.current.value = ''; } } async function handleRemoveBackground() { setBackgroundUploading(true); try { const nextSettings = { ...siteSettings, profileBackgroundImage: null }; await _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Em('/users/me', { method: 'PATCH', body: JSON.stringify({ siteSettings: nextSettings }) }); setSiteSettings(nextSettings); setSaved(true); setTimeout(()=>setSaved(false), 2500); } catch (e) { setError(t('profile.upload.error')); } finally{ setBackgroundUploading(false); } } async function handleCreateCard() { if (!newCardTitle.trim()) return; setCreatingCard(true); try { const card = await _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .createSpecialistCard */ .eR({ title: newCardTitle.trim() }); setCards((prev)=>[ ...prev, card ]); setOpenCardId(card.id); setNewCardTitle(''); setShowNewCardForm(false); } catch (err) { setError(err.message || t('common.error')); } finally{ setCreatingCard(false); } } async function handleDeleteCard(id) { if (!confirm(t('profile.cards.delete_confirm'))) return; try { await _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .deleteSpecialistCard */ .f5(id); setCards((prev)=>{ var _next_; const next = prev.filter((c)=>c.id !== id); var _next__id; if (openCardId === id) setOpenCardId((_next__id = (_next_ = next[0]) === null || _next_ === void 0 ? void 0 : _next_.id) !== null && _next__id !== void 0 ? _next__id : null); return next; }); } catch (err) { setError(err.message || t('common.error')); } } if (isPending || loading) { return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-center py-20 text-white", children: t('common.loading') }); } const catLocale = locale === 'en' ? 'en' : locale === 'ru' ? 'ru' : locale === 'uk' ? 'uk' : 'el'; const dateLocale = locale === 'en' ? 'en-US' : locale === 'ru' ? 'ru-RU' : 'el-GR'; const isSpecialist = (user === null || user === void 0 ? void 0 : user.role) === 'specialist'; const isAdmin = (user === null || user === void 0 ? void 0 : user.role) === 'admin'; const showSpecialistTabs = isSpecialist || isAdmin; var _user_firstName_, _user_lastName_; const initials = user ? "".concat((_user_firstName_ = (_user_firstName = user.firstName) === null || _user_firstName === void 0 ? void 0 : _user_firstName[0]) !== null && _user_firstName_ !== void 0 ? _user_firstName_ : '').concat((_user_lastName_ = (_user_lastName = user.lastName) === null || _user_lastName === void 0 ? void 0 : _user_lastName[0]) !== null && _user_lastName_ !== void 0 ? _user_lastName_ : '').toUpperCase() : '?'; const hasAutoResponse = !!(dashData === null || dashData === void 0 ? void 0 : (_dashData_features = dashData.features) === null || _dashData_features === void 0 ? void 0 : _dashData_features.hasAutoResponse); var _formData_bio, _ref; const profileBio = String((_ref = (_formData_bio = formData.bio) !== null && _formData_bio !== void 0 ? _formData_bio : user === null || user === void 0 ? void 0 : user.bio) !== null && _ref !== void 0 ? _ref : '').trim(); const publishedCards = cards.filter((c)=>{ var _c_publicationStatus; return ((_c_publicationStatus = c.publicationStatus) !== null && _c_publicationStatus !== void 0 ? _c_publicationStatus : c.isActive ? 'active' : 'inactive') === 'active'; }); const hasPublishedCard = publishedCards.length > 0; const hasCardCategories = publishedCards.some((c)=>{ var _c_categories; var _c_categories_length; return ((_c_categories_length = (_c_categories = c.categories) === null || _c_categories === void 0 ? void 0 : _c_categories.length) !== null && _c_categories_length !== void 0 ? _c_categories_length : 0) > 0; }); const hasCardLocations = publishedCards.some((c)=>{ var _c_locations; var _c_locations_length; return ((_c_locations_length = (_c_locations = c.locations) === null || _c_locations === void 0 ? void 0 : _c_locations.length) !== null && _c_locations_length !== void 0 ? _c_locations_length : 0) > 0; }); const moderationNoticeByCardId = cardNotifications.reduce((acc, row)=>{ if (!row.referenceId || acc[row.referenceId]) return acc; const tone = row.type === 'specialist_card_approved' ? 'green' : row.type === 'specialist_card_rejected' ? 'red' : 'amber'; const localizedTitle = row.type === 'specialist_card_approved' ? t('profile.card.review_approved', 'Card approved') : row.type === 'specialist_card_rejected' ? t('profile.card.review_rejected', 'Card rejected') : t('profile.card.review_pending', 'Pending approval'); const localizedBody = row.type === 'specialist_card_approved' ? t('profile.card.review_approved_hint', 'Your card is now visible in offers.') : row.type === 'specialist_card_rejected' ? t('profile.card.review_rejected_hint', 'Your card was not approved. Please update it and submit again.') : t('profile.card.review_pending_hint', 'Your card is being reviewed by the admin team.'); acc[row.referenceId] = { title: localizedTitle, body: localizedBody, tone }; return acc; }, {}); const listingMissing = []; if (!profileBio) listingMissing.push(t('profile.listing_requirements.bio', 'Add a short bio in the main profile section')); if (!hasPublishedCard) listingMissing.push(t('profile.listing_requirements.published_card', 'Publish at least one card')); if (!hasCardCategories) listingMissing.push(t('profile.listing_requirements.categories', 'Add at least one category to the published card')); if (!hasCardLocations) listingMissing.push(t('profile.listing_requirements.locations', 'Add at least one location to the published card')); const tabNeedsAttention = { info: !profileBio, cards: listingMissing.length > 0 }; const tabIcons = { info: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15.75 6a3.75 3.75 0 11-7.5 0 3.75 3.75 0 017.5 0zM4.501 20.118a7.5 7.5 0 0114.998 0A17.933 17.933 0 0112 21.75c-2.676 0-5.216-.584-7.499-1.632z" }) }), finance: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 6v12m-3-2.818l.879.659c1.171.879 3.07.879 4.242 0 1.172-.879 1.172-2.303 0-3.182C13.536 12.219 12.768 12 12 12c-.725 0-1.45-.22-2.003-.659-1.106-.879-1.106-2.303 0-3.182s2.9-.879 4.006 0l.415.33M21 12a9 9 0 11-18 0 9 9 0 0118 0z" }) }), cards: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M20.25 14.15v4.073a2.25 2.25 0 01-2.25 2.25h-12a2.25 2.25 0 01-2.25-2.25V6a2.25 2.25 0 012.25-2.25h4.073M15.75 3h5.25v5.25M15.75 3l-9 9" }) }), notifications: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M14.857 17.082a23.848 23.848 0 005.454-1.31A8.967 8.967 0 0118 9.75v-.7V9A6 6 0 006 9v.75a8.967 8.967 0 01-2.312 6.022c1.733.64 3.56 1.085 5.455 1.31m5.714 0a24.255 24.255 0 01-5.714 0m5.714 0a3 3 0 11-5.714 0" }) }), reviews: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M11.48 3.499a.562.562 0 011.04 0l2.125 5.111a.563.563 0 00.475.345l5.518.442c.499.04.701.663.321.988l-4.204 3.602a.563.563 0 00-.182.557l1.285 5.385a.562.562 0 01-.84.61l-4.725-2.885a.562.562 0 00-.586 0L6.982 20.54a.562.562 0 01-.84-.61l1.285-5.386a.562.562 0 00-.182-.557l-4.204-3.602a.562.562 0 01.321-.988l5.518-.442a.563.563 0 00.475-.345L11.48 3.5z" }) }), referral: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M13.19 8.688a4.5 4.5 0 011.242 7.244l-4.5 4.5a4.5 4.5 0 01-6.364-6.364l1.757-1.757m13.35-.622l1.757-1.757a4.5 4.5 0 00-6.364-6.364l-4.5 4.5a4.5 4.5 0 001.242 7.244" }) }), auto_response: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9.813 15.904L9 18.75l-.813-2.846a4.5 4.5 0 00-3.09-3.09L2.25 12l2.846-.813a4.5 4.5 0 003.09-3.09L9 5.25l.813 2.846a4.5 4.5 0 003.09 3.09L15.75 12l-2.846.813a4.5 4.5 0 00-3.09 3.09z" }) }), site: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 21a9.004 9.004 0 008.716-6.747M12 21a9.004 9.004 0 01-8.716-6.747M12 21c2.485 0 4.5-4.03 4.5-9S14.485 3 12 3m0 18c-2.485 0-4.5-4.03-4.5-9S9.515 3 12 3m0 0a8.997 8.997 0 017.843 4.582M12 3a8.997 8.997 0 00-7.843 4.582m15.686 0A11.953 11.953 0 0112 10.5c-2.998 0-5.74-1.1-7.843-2.918m15.686 0A8.959 8.959 0 0121 12c0 .778-.099 1.533-.284 2.253m0 0A17.919 17.919 0 0112 16.5c-3.162 0-6.133-.815-8.716-2.247m0 0A9.015 9.015 0 013 12c0-1.605.42-3.113 1.157-4.418" }) }) }; const tabs = showSpecialistTabs ? [ { id: 'info', label: t('profile.tab.info') }, { id: 'cards', label: t('profile.tab.cards') }, { id: 'notifications', label: t('profile.tab.notifications') }, { id: 'reviews', label: t('profile.tab.reviews') }, { id: 'finance', label: t('profile.tab.finance') }, { id: 'referral', label: t('profile.tab.referral') }, ...hasAutoResponse ? [ { id: 'auto_response', label: t('profile.tab.auto_response', 'Auto response') } ] : [], ...(dashData === null || dashData === void 0 ? void 0 : (_dashData_features1 = dashData.features) === null || _dashData_features1 === void 0 ? void 0 : _dashData_features1.hasPersonalSite) ? [ { id: 'site', label: t('profile.tab.site') } ] : [] ] : [ { id: 'info', label: t('profile.tab.info') }, { id: 'cards', label: t('profile.tab.cards') }, { id: 'notifications', label: t('profile.tab.notifications') }, { id: 'reviews', label: t('profile.tab.reviews') }, { id: 'finance', label: t('profile.tab.finance') }, { id: 'referral', label: t('profile.tab.referral') }, ...(dashData === null || dashData === void 0 ? void 0 : (_dashData_features2 = dashData.features) === null || _dashData_features2 === void 0 ? void 0 : _dashData_features2.hasPersonalSite) ? [ { id: 'site', label: t('profile.tab.site') } ] : [] ]; var _user_lastName1, _user_name, _user_balance, _user_plan_features, _user_plan_name; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "max-w-4xl mx-auto px-4 py-8", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-4 mb-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "w-14 h-14 rounded-full flex-shrink-0 overflow-hidden border-2 border-white/40 flex items-center justify-center text-green-700 text-xl font-bold bg-green-100 cursor-pointer", onClick: ()=>{ var _fileRef_current; setActiveTab('info'); (_fileRef_current = fileRef.current) === null || _fileRef_current === void 0 ? void 0 : _fileRef_current.click(); }, title: t('profile.photo.change'), children: (user === null || user === void 0 ? void 0 : user.image) ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: user.image, alt: user.name, className: "w-full h-full object-cover" }) : initials }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h1", { className: "text-xl font-bold text-white leading-tight", children: (user === null || user === void 0 ? void 0 : user.firstName) ? "".concat(user.firstName, " ").concat((_user_lastName1 = user.lastName) !== null && _user_lastName1 !== void 0 ? _user_lastName1 : '').trim() : (_user_name = user === null || user === void 0 ? void 0 : user.name) !== null && _user_name !== void 0 ? _user_name : t('nav.profile') }), myRating && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-1 mt-0.5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-yellow-300", children: "★" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "font-semibold text-white text-sm", children: Number(myRating).toFixed(1) }), myReviews !== null && myReviews.length > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "text-white/60 text-xs", children: [ "(", myReviews.length, ")" ] }) ] }) ] }) ] }), !cardsLoading && cards.length === 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "mb-6 rounded-2xl border border-amber-300 bg-amber-50/95 p-4 sm:p-5 shadow-sm", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm font-semibold text-amber-950", children: t('profile.cards.empty', 'No offers yet') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs leading-relaxed text-amber-800 mt-1 max-w-2xl", children: t('profile.cards.empty_hint', 'СПзЎайте первую картПчку, чтПбы пПказать услугО клОеМтаЌ.') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>{ setActiveTab('cards'); setShowNewCardForm(true); }, className: "inline-flex items-center justify-center rounded-xl bg-amber-600 px-4 py-2 text-sm font-semibold text-white transition hover:bg-amber-700", children: t('profile.cards.create_first') }) ] }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-6 items-start", children: [ tabs.length > 1 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("aside", { className: "w-52 shrink-0 hidden sm:block", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("nav", { className: "rounded-2xl overflow-hidden bg-white/10 backdrop-blur-sm", children: tabs.map((tab)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { type: "button", onClick: ()=>setActiveTab(tab.id), className: "w-full text-left px-4 py-3 text-sm font-medium transition border-b border-white/10 last:border-0 flex items-center gap-3 ".concat(activeTab === tab.id ? 'bg-white text-green-700' : 'text-white/80 hover:bg-white/10 hover:text-white'), children: [ tabIcons[tab.id], /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "flex items-center gap-1.5", children: [ tab.label, tabNeedsAttention[tab.id] && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "inline-flex items-center justify-center w-4 h-4 rounded-full bg-amber-500 text-white text-[10px] font-bold", children: "!" }) ] }) ] }, tab.id)) }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex-1 min-w-0", children: [ tabs.length > 1 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex sm:hidden bg-white/15 backdrop-blur rounded-xl p-1 mb-4 gap-1 overflow-x-auto", children: tabs.map((tab)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { type: "button", onClick: ()=>setActiveTab(tab.id), className: "flex-1 min-w-fit px-3 py-2 text-xs font-medium rounded-lg transition whitespace-nowrap flex flex-col items-center gap-0.5 ".concat(activeTab === tab.id ? 'bg-white text-green-700 shadow-sm' : 'text-white/80 hover:text-white hover:bg-white/10'), children: [ tabIcons[tab.id], /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "flex items-center gap-1.5", children: [ tab.label, tabNeedsAttention[tab.id] && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "inline-flex items-center justify-center w-4 h-4 rounded-full bg-amber-500 text-white text-[10px] font-bold", children: "!" }) ] }) ] }, tab.id)) }), activeTab === 'cards' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-4", children: [ error && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "bg-red-50 text-red-700 p-3 rounded-lg text-sm", children: error }), listingMissing.length > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-amber-50 border border-amber-300 rounded-xl p-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm font-semibold text-amber-900", children: t('profile.listing_requirements.title', 'Your profile is not shown yet in offers') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-amber-800 mt-1", children: t('profile.listing_requirements.hint', 'To make the card visible, complete these conditions:') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("ul", { className: "mt-2 list-disc pl-5 text-xs text-amber-900 space-y-0.5", children: listingMissing.map((item)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("li", { children: item }, item)) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-between", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { className: "text-sm text-white/70", children: [ t('profile.cards.count'), ": ", cards.length, " / ", maxCards === null ? '∞' : maxCards ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { type: "button", onClick: ()=>{ if (maxCards !== null && cards.length >= maxCards) { setShowUpgradeModal(true); } else { setShowNewCardForm(true); } }, className: "flex items-center gap-1.5 text-sm font-medium text-white hover:text-white/80", children: [ "+ ", t('profile.cards.add') ] }) ] }), showNewCardForm && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-green-200 p-4 space-y-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm font-medium text-gray-800", children: t('profile.cards.new_title') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: newCardTitle, onChange: (e)=>setNewCardTitle(e.target.value), onKeyDown: (e)=>{ if (e.key === 'Enter') handleCreateCard(); }, maxLength: 200, placeholder: t('profile.cards.placeholder'), autoFocus: true, 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" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex gap-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: handleCreateCard, disabled: creatingCard || !newCardTitle.trim(), className: "px-4 py-2 bg-green-600 hover:bg-green-700 text-white rounded-lg text-sm font-medium disabled:opacity-50", children: creatingCard ? '...' : t('profile.cards.create') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>{ setShowNewCardForm(false); setNewCardTitle(''); }, className: "px-4 py-2 bg-gray-100 hover:bg-gray-200 text-gray-700 rounded-lg text-sm font-medium", children: t('profile.cards.cancel') }) ] }) ] }), cardsLoading && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-center py-10 text-white/70", children: t('common.loading') }), !cardsLoading && cards.length === 0 && !showNewCardForm && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "text-center py-14 border-2 border-dashed border-white/30 rounded-xl", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-white/70 text-sm mb-3", children: t('profile.cards.empty') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { type: "button", onClick: ()=>setShowNewCardForm(true), className: "text-sm text-white font-medium hover:underline", children: [ "+ ", t('profile.cards.create_first') ] }) ] }), cards.map((card)=>{ var _dashData_features; const cardIssues = []; if (!profileBio) { cardIssues.push(t('profile.listing_requirements.bio', 'Add a short bio in the main profile section')); } var _card_publicationStatus; const publicationStatus = (_card_publicationStatus = card.publicationStatus) !== null && _card_publicationStatus !== void 0 ? _card_publicationStatus : card.isActive ? 'active' : 'inactive'; if (publicationStatus === 'pending') { cardIssues.push(t('profile.listing_requirements.review_pending', 'Card is under review')); } else if (publicationStatus !== 'active') { cardIssues.push(t('profile.listing_requirements.card_inactive', 'Make the card active')); } if (!card.categories || card.categories.length === 0) { cardIssues.push(t('profile.listing_requirements.categories', 'Add at least one category to the active card')); } if (!card.locations || card.locations.length === 0) { cardIssues.push(t('profile.listing_requirements.locations', 'Add at least one location to the active card')); } var _moderationNoticeByCardId_card_id; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(SpecialistCardEditor, { card: card, isOpen: openCardId === card.id, onToggle: ()=>setOpenCardId(card.id), onUpdate: (updated)=>setCards((prev)=>prev.map((c)=>c.id === updated.id ? updated : c)), onDelete: ()=>handleDeleteCard(card.id), categories: categories, locationTree: locationTree, catLocale: catLocale, locale: locale, hasPriceList: !!(dashData === null || dashData === void 0 ? void 0 : (_dashData_features = dashData.features) === null || _dashData_features === void 0 ? void 0 : _dashData_features.hasPriceList), visibilityIssues: cardIssues, moderationNotice: (_moderationNoticeByCardId_card_id = moderationNoticeByCardId[card.id]) !== null && _moderationNoticeByCardId_card_id !== void 0 ? _moderationNoticeByCardId_card_id : null }, card.id); }) ] }), activeTab === 'site' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-6 space-y-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "font-semibold text-gray-800 mb-1", children: t('profile.site.title') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400", children: t('profile.site_slug_hint') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-xs font-medium text-gray-500 mb-1.5", children: t('profile.site.url_label') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-2 flex-wrap", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-sm text-gray-400 shrink-0", children: "canhelp.gr/site/" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: personalSiteSlug, onChange: (e)=>setPersonalSiteSlug(e.target.value.toLowerCase().replace(/[^a-z0-9_-]/g, '')), placeholder: "my-slug", maxLength: 50, className: "flex-1 min-w-32 border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-3 flex-wrap", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: handleSaveSiteSlug, disabled: slugSaving, className: "px-5 py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700 disabled:opacity-50", children: slugSaving ? t('profile.saving') : t('common.save') }), slugSaved && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "text-sm text-green-600", children: [ "✓ ", t('profile.saved') ] }), personalSiteSlug && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { type: "button", onClick: ()=>{ navigator.clipboard.writeText("".concat(window.location.origin, "/site/").concat(personalSiteSlug)); setSlugCopied(true); setTimeout(()=>setSlugCopied(false), 2000); }, className: "px-3 py-2 border border-gray-300 rounded-lg text-sm text-gray-600 hover:bg-gray-50 flex items-center gap-1.5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z" }) }), slugCopied ? t('profile.site.copied') : t('profile.site.copy') ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("a", { href: "/site/".concat(personalSiteSlug), target: "_blank", rel: "noopener noreferrer", className: "px-3 py-2 border border-green-200 bg-green-50 rounded-lg text-sm text-green-600 hover:bg-green-100 flex items-center gap-1.5", children: [ t('profile.site_open'), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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" }) }) ] }) ] }) ] }), slugError && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-red-500", children: slugError }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-between mb-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h3", { className: "font-semibold text-gray-800", children: t('profile.site.visible_title') }), siteSettingsSaving && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-xs text-gray-400", children: t('profile.saving', 'Saving...') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "space-y-3", children: [ { key: 'showBio', label: t('profile.site.visible.bio', 'Biography') }, { key: 'showRating', label: t('profile.site.visible.rating', 'Rating and reviews') }, { key: 'showReviews', label: t('profile.site.visible.reviews', 'Reviews section') }, { key: 'showServices', label: t('profile.site.visible.services', 'Service cards') }, { key: 'showPriceList', label: t('profile.site.visible.price_list', 'Price list') }, { key: 'showPortfolio', label: t('profile.site.visible.portfolio', 'Portfolio') }, { key: 'showPhone', label: t('profile.site.visible.contacts', 'Contact phone') }, { key: 'showFullLastName', label: t('profile.site.visible.full_last_name', 'Show full last name') }, { key: 'showStatus', label: t('profile.site.visible.status', 'Status "Available now"') } ].map((param)=>{ let { key, label } = param; const checked = siteSettings[key] !== false // undefined = true by default ; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "flex items-center gap-3 cursor-pointer group", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "w-5 h-5 rounded border-2 flex items-center justify-center transition shrink-0 ".concat(checked ? 'bg-green-600 border-green-600' : 'bg-white border-gray-300 group-hover:border-green-400'), onClick: ()=>{ const next = { ...siteSettings, [key]: !checked }; handleSaveSiteSettings(next); }, children: checked && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3 h-3 text-white", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 3, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4.5 12.75l6 6 9-13.5" }) }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-sm text-gray-700 select-none", onClick: ()=>{ const next = { ...siteSettings, [key]: !checked }; handleSaveSiteSettings(next); }, children: label }) ] }, key); }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400 mt-4", children: t('profile.site.edit_bio_hint', 'Name and photo are always visible') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "mt-6 pt-4 border-t border-gray-100", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: t('profile.site.theme', 'Theme') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex gap-3", children: [ { value: 'dark', label: t('profile.site.theme.dark', 'Dark'), icon: '🌙' }, { value: 'light', label: t('profile.site.theme.light', 'Light'), icon: '☀' } ].map((opt)=>{ var _siteSettings_siteTheme; const selected = ((_siteSettings_siteTheme = siteSettings.siteTheme) !== null && _siteSettings_siteTheme !== void 0 ? _siteSettings_siteTheme : 'dark') === opt.value; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { onClick: ()=>handleSaveSiteSettings({ ...siteSettings, siteTheme: opt.value }), className: "flex-1 flex items-center justify-center gap-2 px-4 py-2.5 rounded-xl border-2 text-sm font-medium transition ".concat(selected ? 'border-green-500 bg-green-50 text-green-700' : 'border-gray-200 bg-white text-gray-500 hover:border-gray-300'), children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { children: opt.icon }), opt.label ] }, opt.value); }) }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex items-center justify-between mb-4", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h3", { className: "font-semibold text-gray-800", children: t('profile.site.stats.title', 'Site analytics') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400 mt-0.5", children: t('profile.site.stats.days', 'last 30 days') }) ] }) }), !personalSiteSlug ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-gray-400 py-4 text-center", children: t('profile.site.stats.no_slug', 'Set your site URL to view statistics') }) : siteStatsLoading || siteStats === null ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-gray-400 py-4 text-center", children: t('profile.site.stats.loading', 'Loading analytics...') }) : (()=>{ const totalViews = siteStats.reduce((s, d)=>s + d.views, 0); const totalUnique = siteStats.reduce((s, d)=>s + d.unique, 0); const totalMessages = siteStats.reduce((s, d)=>s + d.messages, 0); // Area chart helpers const days = siteStats.map((d)=>d.date); const seriesDef = [ { vals: siteStats.map((d)=>d.views), color: '#3b82f6', fill: '#3b82f615', label: t('profile.site.stats.views', 'Views') }, { vals: siteStats.map((d)=>d.unique), color: '#8b5cf6', fill: '#8b5cf610', label: t('profile.site.stats.unique', 'Unique') }, { vals: siteStats.map((d)=>d.messages), color: '#10b981', fill: '#10b98110', label: t('profile.site.stats.messages', 'Messages') } ]; const maxVal = Math.max(...seriesDef.flatMap((s)=>s.vals), 1); const W = 580; const H = 160; const padL = 36; const padB = 22; const chartW = W - padL - 4; const chartH = H - padB; const stepX = chartW / (days.length - 1); function pts(vals) { return vals.map((v, i)=>[ padL + i * stepX, chartH - v / maxVal * chartH ]); } function smoothPath(points) { if (points.length < 2) return ''; let d = "M ".concat(points[0][0].toFixed(1), " ").concat(points[0][1].toFixed(1)); for(let i = 1; i < points.length; i++){ const cpx = ((points[i - 1][0] + points[i][0]) / 2).toFixed(1); d += " C ".concat(cpx, " ").concat(points[i - 1][1].toFixed(1), " ").concat(cpx, " ").concat(points[i][1].toFixed(1), " ").concat(points[i][0].toFixed(1), " ").concat(points[i][1].toFixed(1)); } return d; } function areaPath(vals) { const points = pts(vals); const line = smoothPath(points); if (!line) return ''; const lastX = points[points.length - 1][0].toFixed(1); return "".concat(line, " L ").concat(lastX, " ").concat(chartH.toFixed(1), " L ").concat(padL.toFixed(1), " ").concat(chartH.toFixed(1), " Z"); } function fmtY(v) { return v >= 1000 ? "".concat(Math.round(v / 1000), "K") : String(v); } const yTicks = [ 0, Math.round(maxVal / 3), Math.round(maxVal * 2 / 3), maxVal ]; const xTicks = days.map((d, i)=>({ i, label: d.slice(8) })).filter((_, i)=>i % 7 === 0 || i === days.length - 1); return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "grid grid-cols-3 gap-3 mb-5", children: [ { label: t('profile.site.stats.total_views', 'Views'), value: totalViews, color: 'text-green-600', bg: 'bg-green-50' }, { label: t('profile.site.stats.total_unique', 'Unique visitors'), value: totalUnique, color: 'text-violet-600', bg: 'bg-violet-50' }, { label: t('profile.site.stats.total_messages', 'Messages'), value: totalMessages, color: 'text-emerald-600', bg: 'bg-emerald-50' } ].map((card)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "".concat(card.bg, " rounded-xl p-3 text-center"), children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-2xl font-bold ".concat(card.color), children: card.value }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-xs text-gray-500 mt-0.5", children: card.label }) ] }, card.label)) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex items-center gap-4 mb-2", children: seriesDef.map((s)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "flex items-center gap-1.5 text-xs text-gray-500", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "w-3 h-0.5 inline-block rounded", style: { background: s.color } }), s.label ] }, s.label)) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "overflow-x-auto", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { viewBox: "0 0 ".concat(W, " ").concat(H + 12), className: "w-full", style: { minWidth: 320 }, children: [ yTicks.map((v, idx)=>{ const y = chartH - v / maxVal * chartH; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("g", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: padL, y1: y, x2: W - 4, y2: y, stroke: "#f3f4f6", strokeWidth: 1 }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("text", { x: padL - 5, y: y + 3.5, textAnchor: "end", fontSize: 9, fill: "#9ca3af", children: fmtY(v) }) ] }, "y-".concat(idx, "-").concat(v)); }), xTicks.map((param)=>{ let { i } = param; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: padL + i * stepX, y1: 0, x2: padL + i * stepX, y2: chartH, stroke: "#f9fafb", strokeWidth: 1 }, "vg-".concat(i)); }), xTicks.map((param)=>{ let { i, label } = param; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("text", { x: padL + i * stepX, y: H + 10, textAnchor: "middle", fontSize: 9, fill: "#9ca3af", children: label }, i); }), seriesDef.map((s, si)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: areaPath(s.vals), fill: s.fill }, "fill-".concat(si))), seriesDef.map((s, si)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: smoothPath(pts(s.vals)), fill: "none", stroke: s.color, strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round" }, "line-".concat(si))), seriesDef.map((s, si)=>{ const points = pts(s.vals); const last = points[points.length - 1]; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("circle", { cx: last[0], cy: last[1], r: 4, fill: "white", stroke: s.color, strokeWidth: 2 }, "dot-".concat(si)); }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("line", { x1: padL, y1: chartH, x2: W - 4, y2: chartH, stroke: "#e5e7eb", strokeWidth: 1 }) ] }) }) ] }); })() ] }) ] }), activeTab === 'reviews' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "space-y-4", children: myReviews === null ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-center py-10 text-white/70", children: t('common.loading') }) : myReviews.length === 0 ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "text-center py-20 text-white/60", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-4xl mb-3", children: "⭐" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { children: t('profile.no_reviews') }) ] }) : myReviews.map((param)=>{ let { review, author } = param; var _author_name_, _author_name; var _author_name__toUpperCase, _author_name1; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "bg-white rounded-xl border border-gray-200 p-4", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-start gap-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "w-9 h-9 rounded-full bg-gray-100 flex-shrink-0 flex items-center justify-center text-gray-600 text-sm font-bold overflow-hidden", children: (author === null || author === void 0 ? void 0 : author.image) ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: author.image, alt: author.name, className: "w-full h-full object-cover" }) : (_author_name__toUpperCase = author === null || author === void 0 ? void 0 : (_author_name = author.name) === null || _author_name === void 0 ? void 0 : (_author_name_ = _author_name[0]) === null || _author_name_ === void 0 ? void 0 : _author_name_.toUpperCase()) !== null && _author_name__toUpperCase !== void 0 ? _author_name__toUpperCase : '?' }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex-1", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-2 mb-1", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-sm font-medium text-gray-800", children: (_author_name1 = author === null || author === void 0 ? void 0 : author.name) !== null && _author_name1 !== void 0 ? _author_name1 : '—' }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "text-yellow-400", children: [ '★'.repeat(review.rating), '☆'.repeat(5 - review.rating) ] }) ] }), review.comment && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-gray-600", children: review.comment }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400 mt-1", children: new Date(review.createdAt).toLocaleDateString() }) ] }) ] }) }, review.id); }) }), activeTab === 'finance' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "space-y-5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-between mb-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "font-semibold text-gray-800", children: t('profile.balance') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { onClick: ()=>{ setTopUpAmount(10); setTopUpError(''); setShowTopUpModal(true); }, className: "flex items-center gap-1.5 text-sm font-medium text-green-600 hover:text-green-700 hover:bg-green-50 px-3 py-1.5 rounded-lg transition-colors", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 4v16m8-8H4" }) }), t('profile.balance.topup') ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-3 p-4 bg-green-50 rounded-xl border border-green-100", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-6 h-6 text-green-600 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 8c-1.657 0-3 .895-3 2s1.343 2 3 2 3 .895 3 2-1.343 2-3 2m0-8c1.11 0 2.08.402 2.599 1M12 8V7m0 1v8m0 0v1m0-1c-1.11 0-2.08-.402-2.599-1M21 12a9 9 0 11-18 0 9 9 0 0118 0z" }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "text-xl font-bold text-green-700", children: [ parseFloat((_user_balance = user === null || user === void 0 ? void 0 : user.balance) !== null && _user_balance !== void 0 ? _user_balance : '0').toFixed(2), " EUR" ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "mt-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-between mb-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h3", { className: "text-sm font-semibold text-gray-800", children: t('profile.balance.history', 'Operation history') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-xs text-gray-400", children: t('profile.balance.history.last', 'Latest operations') }) ] }), balanceHistory.length === 0 ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "rounded-xl border border-dashed border-gray-200 px-4 py-6 text-sm text-gray-400 text-center", children: t('profile.balance.history.empty', 'No operations yet') }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "space-y-2", children: balanceHistory.map((entry)=>{ const isCredit = entry.direction === 'credit'; const amount = Number(entry.amount).toFixed(2); const badgeClass = isCredit ? 'bg-emerald-50 text-emerald-700 border-emerald-100' : 'bg-rose-50 text-rose-700 border-rose-100'; const title = entry.kind === 'topup' ? t('profile.balance.history.kind.topup', 'Balance top-up') : entry.kind === 'plan_purchase' ? t('profile.balance.history.kind.plan_purchase', 'Plan charge') : entry.kind === 'admin_topup' ? t('profile.balance.history.kind.admin_topup', 'Admin top-up') : t('profile.balance.history.kind.admin_adjustment', 'Admin adjustment'); return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "rounded-xl border border-gray-200 px-4 py-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-start justify-between gap-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "min-w-0", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-sm font-medium text-gray-900", children: entry.description || title }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-xs text-gray-500 mt-1", children: new Date(entry.createdAt).toLocaleString(dateLocale) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "shrink-0 rounded-full border px-2.5 py-1 text-xs font-semibold ".concat(badgeClass), children: [ isCredit ? '+' : '-', amount, " ", entry.currency ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "mt-2 text-xs text-gray-500", children: [ t('profile.balance.history.balance_after', 'Balance after'), ": ", Number(entry.balanceAfter).toFixed(2), " ", entry.currency ] }) ] }, entry.id); }) }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "font-semibold text-gray-800 mb-4", children: t('profile.plan_history.title', 'Plan history') }), planHistory.length === 0 ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "rounded-xl border border-dashed border-gray-200 px-4 py-6 text-sm text-gray-400 text-center", children: t('profile.plan_history.empty', 'Plan change history is empty') }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "space-y-2", children: planHistory.map((entry)=>{ const eventColors = { activated: 'bg-green-50 text-green-700 border-green-100', renewed: 'bg-emerald-50 text-emerald-700 border-emerald-100', downgraded: 'bg-rose-50 text-rose-700 border-rose-100', referral_reward: 'bg-amber-50 text-amber-700 border-amber-100', admin_change: 'bg-purple-50 text-purple-700 border-purple-100', expired: 'bg-gray-100 text-gray-600 border-gray-200' }; const eventLabels = { activated: t('profile.plan_history.event.activated', 'Activated'), renewed: t('profile.plan_history.event.renewed', 'Renewed'), downgraded: t('profile.plan_history.event.downgraded', 'Downgraded'), referral_reward: t('profile.plan_history.event.referral_reward', 'Referral reward'), admin_change: t('profile.plan_history.event.admin_change', 'Changed by admin'), expired: t('profile.plan_history.event.expired', 'Expired') }; var _eventColors_entry_event; const badgeClass = (_eventColors_entry_event = eventColors[entry.event]) !== null && _eventColors_entry_event !== void 0 ? _eventColors_entry_event : 'bg-gray-100 text-gray-600 border-gray-200'; var _eventLabels_entry_event; const label = (_eventLabels_entry_event = eventLabels[entry.event]) !== null && _eventLabels_entry_event !== void 0 ? _eventLabels_entry_event : entry.event; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "rounded-xl border border-gray-200 px-4 py-3", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-start justify-between gap-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "min-w-0", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-2 flex-wrap", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-sm font-semibold text-gray-900", children: entry.planName }), entry.previousPlanName && entry.previousPlanName !== entry.planName && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "text-xs text-gray-400", children: [ "← ", entry.previousPlanName ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-xs text-gray-500 mt-1", children: new Date(entry.createdAt).toLocaleString(dateLocale) }), entry.expiresAt && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "text-xs text-gray-500 mt-0.5", children: [ t('profile.plan_history.expires', 'Until'), ": ", new Date(entry.expiresAt).toLocaleDateString(dateLocale) ] }), entry.daysAdded && entry.event === 'referral_reward' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "text-xs text-amber-600 mt-0.5", children: [ "+", entry.daysAdded, " ", t('profile.plan_history.days', 'days') ] }), entry.note && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-xs text-gray-400 mt-0.5", children: entry.note }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "shrink-0 rounded-full border px-2.5 py-1 text-xs font-semibold ".concat(badgeClass), children: label }) ] }) }, entry.id); }) }) ] }), showTopUpModal && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "fixed inset-0 z-50 flex items-end sm:items-center justify-center p-4 bg-black/40 backdrop-blur-sm", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-2xl shadow-2xl w-full max-w-sm p-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-between mb-5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h3", { className: "text-lg font-semibold text-gray-900", children: t('profile.balance.topup.title') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>setShowTopUpModal(false), className: "text-gray-400 hover:text-gray-600", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-5 h-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" }) }) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-gray-500 mb-3", children: t('profile.balance.topup.hint') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "grid grid-cols-4 gap-2 mb-4", children: [ 5, 10, 20, 50 ].map((v)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { onClick: ()=>setTopUpAmount(v), className: "py-2 rounded-xl text-sm font-semibold border transition-colors ".concat(Number(topUpAmount) === v ? 'bg-green-600 text-white border-green-600' : 'border-gray-200 text-gray-700 hover:border-green-400'), children: [ "€", v ] }, v)) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "mb-5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('profile.balance.topup.amount') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "relative", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "absolute left-3 top-1/2 -translate-y-1/2 text-gray-400 text-sm", children: "€" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "number", min: "1", max: "9999", step: "1", value: topUpAmount, onChange: (e)=>setTopUpAmount(e.target.value), className: "w-full pl-7 pr-4 py-2.5 border border-gray-300 rounded-xl text-sm focus:outline-none focus:ring-2 focus:ring-blue-400" }) ] }) ] }), topUpError && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-red-600 mb-3", children: topUpError }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: handleTopUp, disabled: topUpLoading || !Number(topUpAmount) || Number(topUpAmount) < 1, className: "w-full py-3 bg-green-600 hover:bg-green-700 disabled:bg-gray-300 disabled:cursor-not-allowed text-white font-semibold rounded-xl transition-colors flex items-center justify-center gap-2", children: topUpLoading ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-4 h-4 animate-spin", fill: "none", viewBox: "0 0 24 24", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { className: "opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8v8z" }) ] }), t('profile.balance.topup.loading') ] }) : t('profile.balance.topup.submit') }) ] }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "font-semibold text-gray-800 mb-3", children: t('profile.plan.title') }), (user === null || user === void 0 ? void 0 : user.plan) ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-start gap-3 p-4 bg-green-50 rounded-xl border border-green-100", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-6 h-6 text-gray-500 shrink-0 mt-0.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M3 10h18M7 15h1m4 0h1m-7 4h12a3 3 0 003-3V8a3 3 0 00-3-3H6a3 3 0 00-3 3v8a3 3 0 003 3z" }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "font-semibold text-gray-900", children: user.plan.name }), user.plan.description && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-gray-500 mt-0.5", children: user.plan.description }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex flex-wrap gap-3 mt-2 text-xs text-gray-500", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "font-medium text-green-700", children: [ user.plan.price, " ", user.plan.currency ] }), user.plan.maxCards != null ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { children: [ t('profile.plan.cards_up_to'), " ", user.plan.maxCards ] }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { children: t('profile.plan.cards_unlimited') }), user.plan.maxTasks != null && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { children: [ t('profile.plan.tasks_up_to'), " ", user.plan.maxTasks ] }), user.plan.maxOffers != null && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { children: [ t('profile.plan.offers_up_to'), " ", user.plan.maxOffers ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: user.planExpiresAt && new Date(user.planExpiresAt) < new Date(Date.now() + 7 * 24 * 60 * 60 * 1000) ? 'text-red-500 font-medium' : '', children: user.planExpiresAt ? "".concat(t('profile.plan.valid_until'), " ").concat(new Date(user.planExpiresAt).toLocaleDateString()) : t('profile.plan.no_expiry') }) ] }), ((_user_plan_features = user.plan.features) !== null && _user_plan_features !== void 0 ? _user_plan_features : []).length > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("ul", { className: "mt-2 space-y-0.5", children: user.plan.features.map((f, i)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("li", { className: "text-xs text-gray-600 flex items-center gap-1.5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-green-500", children: "✓" }), " ", f ] }, i)) }) ] }) ] }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-3 p-4 bg-gray-50 rounded-xl border border-gray-100", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-5 h-5 text-gray-400 shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.8, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm font-medium text-gray-700", children: t('profile.plan.basic') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400 mt-0.5", children: t('profile.plan.contact_upgrade') }) ] }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-center", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("a", { href: "/pricing", className: "inline-flex items-center gap-1.5 text-sm font-medium text-white/70 hover:text-white transition", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M13 7l5 5m0 0l-5 5m5-5H6" }) }), t('pricing.title', 'Pricing') ] }) }) ] }), activeTab !== 'cards' && activeTab !== 'reviews' && activeTab !== 'finance' && activeTab !== 'site' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("form", { onSubmit: handleSubmit, className: "space-y-6", children: [ error && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "bg-red-50 text-red-700 p-3 rounded-lg text-sm", children: error }), saved && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-green-50 text-green-700 p-3 rounded-lg text-sm", children: [ "✓ ", t('profile.saved') ] }), activeTab === 'notifications' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-6 space-y-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "font-semibold text-gray-800", children: t('notifications.title') }), notifySaved && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-green-50 text-green-700 p-3 rounded-lg text-sm", children: [ "✓ ", t('notifications.saved') ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-start justify-between gap-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex-1", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "font-medium text-gray-800 text-sm", children: t('chat.notif_messages') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-500 mt-0.5", children: t('notifications.messages.desc') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", disabled: notifySaving, onClick: async ()=>{ const next = !notifMessages; setNotifMessages(next); setNotifySaving(true); try { await _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Em('/users/me', { method: 'PATCH', body: JSON.stringify({ notifMessages: next }) }); setNotifySaved(true); setTimeout(()=>setNotifySaved(false), 2500); } catch (e) { setNotifMessages(!next); } finally{ setNotifySaving(false); } }, className: "relative inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full transition-colors focus:outline-none focus:ring-2 focus:ring-green-500 focus:ring-offset-2 disabled:opacity-50 ".concat(notifMessages ? 'bg-green-600' : 'bg-gray-200'), role: "switch", "aria-checked": notifMessages, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "inline-block h-4 w-4 transform rounded-full bg-white shadow transition-transform ".concat(notifMessages ? 'translate-x-6' : 'translate-x-1') }) }) ] }), showSpecialistTabs && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-start justify-between gap-4 ".concat(!(user === null || user === void 0 ? void 0 : (_user_plan = user.plan) === null || _user_plan === void 0 ? void 0 : _user_plan.notifyNewTasks) ? 'opacity-60' : ''), children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex-1", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "font-medium text-gray-800 text-sm", children: t('notifications.email.new_tasks') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-500 mt-0.5", children: t('notifications.email.new_tasks.desc') }), !(user === null || user === void 0 ? void 0 : (_user_plan1 = user.plan) === null || _user_plan1 === void 0 ? void 0 : _user_plan1.notifyNewTasks) && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { className: "text-xs text-amber-600 mt-1", children: [ "\uD83D\uDD12 ", t('notifications.plan_required') ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", disabled: notifySaving || !(user === null || user === void 0 ? void 0 : (_user_plan2 = user.plan) === null || _user_plan2 === void 0 ? void 0 : _user_plan2.notifyNewTasks), onClick: async ()=>{ const next = !notifyNewTasks; setNotifyNewTasks(next); setNotifySaving(true); try { await _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Em('/users/me', { method: 'PATCH', body: JSON.stringify({ notifyNewTasks: next }) }); setNotifySaved(true); setTimeout(()=>setNotifySaved(false), 2500); } catch (e) { setNotifyNewTasks(!next); } finally{ setNotifySaving(false); } }, className: "relative inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full transition-colors focus:outline-none focus:ring-2 focus:ring-green-500 focus:ring-offset-2 disabled:opacity-50 ".concat(notifyNewTasks ? 'bg-green-600' : 'bg-gray-200'), role: "switch", "aria-checked": notifyNewTasks, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "inline-block h-4 w-4 transform rounded-full bg-white shadow transition-transform ".concat(notifyNewTasks ? 'translate-x-6' : 'translate-x-1') }) }) ] }) ] }), activeTab === 'referral' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-6 space-y-5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "font-semibold text-gray-800", children: t('profile.referral.title') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-gray-500", children: t('profile.referral.desc') }), !referralLoaded ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-sm text-gray-400", children: t('common.loading') }) : referralCode ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs font-medium text-gray-500 mb-1.5", children: t('profile.referral.link_label') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { readOnly: true, value: "".concat( true ? window.location.origin : 0, "/register?ref=").concat(referralCode), className: "flex-1 text-sm border border-gray-200 rounded-lg px-3 py-2 bg-gray-50 text-gray-700 focus:outline-none" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>{ navigator.clipboard.writeText("".concat(window.location.origin, "/register?ref=").concat(referralCode)); setReferralCopied(true); setTimeout(()=>setReferralCopied(false), 2000); }, className: "px-3 py-2 rounded-lg border border-gray-200 text-sm font-medium hover:bg-gray-50 transition whitespace-nowrap", children: referralCopied ? t('profile.referral.copied') : t('profile.referral.copy') }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-3 p-4 bg-green-50 rounded-xl", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-2xl font-bold text-green-700", children: referralCount }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-green-700", children: t('profile.referral.invited_count') }) ] }) ] }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-sm text-gray-400", children: t('profile.referral.no_code') }) ] }), activeTab === 'auto_response' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(AutoResponseTab, { categories: categories, locationTree: locationTree, loaded: arLoaded, onLoad: ()=>{ if (arLoaded) return; _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getAutoResponseSettings */ .Gp().then((s)=>{ setAutoResponse(s); setArLoaded(true); }).catch(()=>setArLoaded(true)); }, settings: autoResponse, saving: arSaving, saved: arSaved, onSave: async (data)=>{ setArSaving(true); setArSaved(false); try { const updated = await _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .updateAutoResponseSettings */ .RQ(data); setAutoResponse(updated); setArSaved(true); setTimeout(()=>setArSaved(false), 2500); } catch (e) {} finally{ setArSaving(false); } }, t: t, catLocale: catLocale }), activeTab === 'info' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "font-semibold text-gray-800 mb-4", children: t('profile.photo') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "relative", children: [ (user === null || user === void 0 ? void 0 : user.image) ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: user.image, alt: user.name, className: "w-20 h-20 rounded-full object-cover border-2 border-gray-200" }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "w-20 h-20 rounded-full bg-green-100 flex items-center justify-center text-green-700 text-2xl font-bold border-2 border-gray-200", children: initials }), avatarUploading && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "absolute inset-0 rounded-full bg-black/40 flex items-center justify-center", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "w-5 h-5 border-2 border-white border-t-transparent rounded-full animate-spin" }) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>{ var _fileRef_current; return (_fileRef_current = fileRef.current) === null || _fileRef_current === void 0 ? void 0 : _fileRef_current.click(); }, disabled: avatarUploading, className: "bg-gray-100 hover:bg-gray-200 text-gray-700 px-4 py-2 rounded-lg text-sm font-medium disabled:opacity-50", children: t('profile.photo.change') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400 mt-1", children: t('profile.photo.hint') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { ref: fileRef, type: "file", accept: "image/jpeg,image/png,image/webp", className: "hidden", onChange: handleAvatarChange }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "mt-3 rounded-lg border border-gray-200 bg-gray-50 px-3 py-2.5", children: isSpecialist ? (dashData === null || dashData === void 0 ? void 0 : (_dashData_features3 = dashData.features) === null || _dashData_features3 === void 0 ? void 0 : _dashData_features3.hasCanHelpNowStatus) ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "flex items-center justify-between cursor-pointer gap-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-xs font-medium text-gray-700", children: t('status.can_help_now', 'Available now') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", disabled: statusToggling === 'canhelp_now', onClick: async ()=>{ setStatusToggling('canhelp_now'); const nextActive = !myStatuses.includes('canhelp_now'); try { const res = await _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .toggleStatus */ .bc('canhelp_now', nextActive); setMyStatuses((prev)=>res.isActive ? [ ...prev.filter((s)=>s !== 'canhelp_now'), 'canhelp_now' ] : prev.filter((s)=>s !== 'canhelp_now')); } catch (e) {} finally{ setStatusToggling(null); } }, className: "relative inline-flex h-5 w-10 items-center rounded-full transition-colors ".concat(myStatuses.includes('canhelp_now') ? 'bg-green-500' : 'bg-gray-300', " disabled:opacity-50"), children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "inline-block h-3.5 w-3.5 transform rounded-full bg-white shadow transition-transform ".concat(myStatuses.includes('canhelp_now') ? 'translate-x-5.5' : 'translate-x-1') }) }) ] }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-amber-700", children: t('status.plan_required', 'Status is unavailable on your current plan') }) : !isAdmin ? (dashData === null || dashData === void 0 ? void 0 : (_dashData_features4 = dashData.features) === null || _dashData_features4 === void 0 ? void 0 : _dashData_features4.hasNeedHelpStatus) ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "flex items-center justify-between cursor-pointer gap-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-xs font-medium text-gray-700", children: t('status.need_help', 'Need help') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", disabled: statusToggling === 'need_help', onClick: async ()=>{ setStatusToggling('need_help'); const nextActive = !myStatuses.includes('need_help'); try { const res = await _lib_api__WEBPACK_IMPORTED_MODULE_5__/* .toggleStatus */ .bc('need_help', nextActive); setMyStatuses((prev)=>res.isActive ? [ ...prev.filter((s)=>s !== 'need_help'), 'need_help' ] : prev.filter((s)=>s !== 'need_help')); } catch (e) {} finally{ setStatusToggling(null); } }, className: "relative inline-flex h-5 w-10 items-center rounded-full transition-colors ".concat(myStatuses.includes('need_help') ? 'bg-green-500' : 'bg-gray-300', " disabled:opacity-50"), children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "inline-block h-3.5 w-3.5 transform rounded-full bg-white shadow transition-transform ".concat(myStatuses.includes('need_help') ? 'translate-x-5.5' : 'translate-x-1') }) }) ] }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-amber-700", children: t('status.plan_required', 'Status is unavailable on your current plan') }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-600", children: t('status.admin_not_applicable', 'User status is not applicable to admin accounts') }) }) ] }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "font-semibold text-gray-800 mb-4", children: t('profile.background.title', 'Profile header background') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "w-full h-40 rounded-2xl border border-gray-200 overflow-hidden relative", style: { backgroundImage: siteSettings.profileBackgroundImage ? "linear-gradient(135deg, rgba(22,163,74,0.45), rgba(21,128,61,0.65)), url(".concat(siteSettings.profileBackgroundImage, ")") : 'linear-gradient(135deg, #22c55e 0%, #16a34a 45%, #166534 100%)', backgroundSize: 'cover', backgroundPosition: 'center' }, children: backgroundUploading && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "absolute inset-0 bg-black/35 flex items-center justify-center", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "w-6 h-6 border-2 border-white border-t-transparent rounded-full animate-spin" }) }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "mt-4 flex flex-wrap gap-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>{ var _backgroundFileRef_current; return (_backgroundFileRef_current = backgroundFileRef.current) === null || _backgroundFileRef_current === void 0 ? void 0 : _backgroundFileRef_current.click(); }, disabled: backgroundUploading, className: "bg-gray-100 hover:bg-gray-200 text-gray-700 px-4 py-2 rounded-lg text-sm font-medium disabled:opacity-50", children: backgroundUploading ? t('profile.photo.uploading', 'Uploading...') : t('profile.background.change', 'Change background') }), siteSettings.profileBackgroundImage && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: handleRemoveBackground, disabled: backgroundUploading, className: "bg-white hover:bg-gray-50 text-gray-700 px-4 py-2 rounded-lg text-sm font-medium border border-gray-200 disabled:opacity-50", children: t('profile.background.remove', 'Remove background') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { ref: backgroundFileRef, type: "file", accept: "image/jpeg,image/png,image/webp", className: "hidden", onChange: handleBackgroundChange }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400 mt-2", children: t('profile.background.hint', 'Shown in the public profile header on web and mobile app.') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-6 space-y-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "font-semibold text-gray-800", children: t('profile.basic_info') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "grid grid-cols-2 gap-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('register.first_name') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: formData.firstName, onChange: (e)=>setFormData({ ...formData, firstName: e.target.value }), required: true, className: "w-full border border-gray-300 rounded-lg px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-400 text-sm" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('register.last_name') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: formData.lastName, onChange: (e)=>setFormData({ ...formData, lastName: e.target.value }), required: true, className: "w-full border border-gray-300 rounded-lg px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-400 text-sm" }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: "Email" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { value: user === null || user === void 0 ? void 0 : user.email, disabled: true, className: "w-full border border-gray-200 rounded-lg px-3 py-2 text-sm text-gray-400 bg-gray-50 cursor-not-allowed" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-between mt-1.5", children: [ (user === null || user === void 0 ? void 0 : user.emailVerified) ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "flex items-center gap-1 text-xs text-green-600", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "inline-block w-1.5 h-1.5 rounded-full bg-green-500" }), t('profile.email.verified') ] }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "flex items-center gap-1 text-xs text-amber-600", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "inline-block w-1.5 h-1.5 rounded-full bg-amber-500" }), t('profile.email.not_verified') ] }), !(user === null || user === void 0 ? void 0 : user.emailVerified) && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", disabled: resendState !== 'idle', onClick: handleResendVerification, className: "text-xs text-green-600 hover:underline disabled:opacity-60 disabled:no-underline", children: resendState === 'sending' ? t('login.unverified.sending') : resendState === 'sent' ? t('login.unverified.sent') : t('login.unverified.resend') }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('profile.phone') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "tel", value: formData.phone, onChange: (e)=>setFormData({ ...formData, phone: e.target.value }), placeholder: t('profile.phone.placeholder'), className: "w-full border border-gray-300 rounded-lg px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-400 text-sm" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('profile.bio') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("textarea", { value: formData.bio, onChange: (e)=>setFormData({ ...formData, bio: e.target.value }), rows: 3, maxLength: 1000, placeholder: t('profile.bio.placeholder'), className: "w-full border border-gray-300 rounded-lg px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-400 text-sm resize-none" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('profile.language') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400 mb-2", children: t('profile.language.hint') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("select", { value: formData.locale, onChange: (e)=>setFormData({ ...formData, locale: e.target.value }), className: "w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "el", children: "ΕλληΜικά" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "en", children: "English" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "ru", children: "РусскОй" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("option", { value: "uk", children: "УкраїМська" }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-1", children: t('profile.languages') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400 mb-2", children: t('profile.languages.hint') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex flex-wrap gap-2", children: [ { code: 'el', flag: '🇬🇷', label: 'ΕλληΜικά' }, { code: 'en', flag: '🇬🇧', label: 'English' }, { code: 'ru', flag: '🇷🇺', label: 'РусскОй' }, { code: 'uk', flag: '🇺🇊', label: 'УкраїМська' }, { code: 'de', flag: '🇩🇪', label: 'Deutsch' }, { code: 'fr', flag: '🇫🇷', label: 'Français' }, { code: 'it', flag: '🇮🇹', label: 'Italiano' }, { code: 'es', flag: '🇪🇞', label: 'Español' }, { code: 'ar', flag: '🇞🇊', label: 'العرؚية' }, { code: 'zh', flag: '🇚🇳', label: 'äž­æ–‡' } ].map((param)=>{ let { code, flag, label } = param; const selected = selectedLanguages.includes(code); return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { type: "button", onClick: ()=>setSelectedLanguages(selected ? selectedLanguages.filter((l)=>l !== code) : [ ...selectedLanguages, code ]), className: "flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-sm border transition ".concat(selected ? 'bg-green-600 border-green-600 text-white' : 'bg-white border-gray-300 text-gray-700 hover:border-green-400'), children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { children: flag }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { children: label }) ] }, code); }) }) ] }) ] }), !isSpecialist && !isAdmin && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "p-4 bg-purple-50 rounded-xl", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm text-gray-600 mb-3", children: t('profile.become_specialist.desc') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: handleBecomeSpecialist, disabled: becomingSpecialist, className: "bg-purple-600 hover:bg-purple-700 text-white px-5 py-2 rounded-lg text-sm font-semibold disabled:opacity-50", children: becomingSpecialist ? t('common.loading') : t('profile.become_specialist') }) ] }) }), isSpecialist && ((dashData === null || dashData === void 0 ? void 0 : (_dashData_plan = dashData.plan) === null || _dashData_plan === void 0 ? void 0 : _dashData_plan.tier) === 'pro' || (dashData === null || dashData === void 0 ? void 0 : (_dashData_plan1 = dashData.plan) === null || _dashData_plan1 === void 0 ? void 0 : _dashData_plan1.tier) === 'ultimate') && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-xl border border-gray-200 p-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "font-semibold text-gray-800 mb-4", children: t('profile.show_contact', 'Show contacts') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "flex items-center justify-between cursor-pointer gap-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm font-medium text-gray-800", children: t('profile.show_contact_hint', 'Clients can see your phone number') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400 mt-0.5", children: t('profile.show_contact_desc', 'Lets clients contact you directly') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>setShowContactInfo((v)=>!v), className: "relative inline-flex h-6 w-11 items-center rounded-full transition-colors ".concat(showContactInfo ? 'bg-green-500' : 'bg-gray-300'), children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "inline-block h-4 w-4 transform rounded-full bg-white shadow transition-transform ".concat(showContactInfo ? 'translate-x-6' : 'translate-x-1') }) }) ] }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "submit", disabled: saving, className: "w-full bg-green-600 text-white py-3 rounded-xl font-semibold hover:bg-green-700 disabled:opacity-50 disabled:cursor-not-allowed ".concat(activeTab === 'notifications' || activeTab === 'referral' || activeTab === 'auto_response' ? 'hidden' : ''), children: saving ? t('profile.saving') : t('common.save') }) ] }), showUpgradeModal && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "fixed inset-0 z-50 flex items-center justify-center bg-black/50 px-4", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-white rounded-2xl shadow-xl p-6 w-full max-w-md", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "text-center mb-5", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-5xl", children: "\uD83D\uDE80" }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "text-lg font-bold text-gray-900 text-center mb-2", children: t('profile.upgrade.cards_limit') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { className: "text-sm text-gray-600 text-center mb-4", children: [ (_user_plan_name = user === null || user === void 0 ? void 0 : (_user_plan3 = user.plan) === null || _user_plan3 === void 0 ? void 0 : _user_plan3.name) !== null && _user_plan_name !== void 0 ? _user_plan_name : t('profile.plan.basic'), " — ", t('profile.plan.cards_up_to'), " ", maxCards ] }), (user === null || user === void 0 ? void 0 : user.plan) && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-gray-50 rounded-xl p-4 mb-5 text-sm text-gray-600 text-center", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "font-medium text-gray-800", children: t('profile.upgrade.plan') }), ' ', user.plan.name, " — ", user.plan.price, " ", user.plan.currency ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs text-gray-400 text-center mb-5", children: t('profile.upgrade.contact') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>setShowUpgradeModal(false), className: "w-full bg-green-600 hover:bg-green-700 text-white py-2.5 rounded-xl text-sm font-semibold", children: t('profile.upgrade.ok') }) ] }) }) ] }) ] }) ] }); } /***/ }), /***/ 1592: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ CI: () => (/* binding */ signOut), /* harmony export */ Hh: () => (/* binding */ signUp), /* harmony export */ Jv: () => (/* binding */ signIn), /* harmony export */ wV: () => (/* binding */ useSession), /* harmony export */ yK: () => (/* binding */ authClient) /* harmony export */ }); /* harmony import */ var better_auth_react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6504); const API_URL = "https://api.canhelp.gr" || 0; const authClient = (0,better_auth_react__WEBPACK_IMPORTED_MODULE_0__/* .createAuthClient */ .M)({ baseURL: API_URL }); const { signIn, signOut, signUp, useSession } = authClient; /***/ }), /***/ 3589: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 1511)); /***/ }), /***/ 5940: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ Ez: () => (/* binding */ CategoryIcon), /* harmony export */ V: () => (/* binding */ isCategoryIconUrl) /* harmony export */ }); /* unused harmony export resolveCategoryIconUrl */ /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); const API_URL = "https://api.canhelp.gr" || 0; function isCategoryIconUrl(icon) { if (!icon) return false; const value = icon.trim(); return value.startsWith('http://') || value.startsWith('https://') || value.startsWith('/'); } function resolveCategoryIconUrl(icon) { if (icon.startsWith('/api/')) return "".concat(API_URL).concat(icon); return icon; } function CategoryIcon(param) { let { icon, alt = '', className, fallback = '📊' } = param; const value = (icon || '').trim(); const [hasError, setHasError] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ setHasError(false); }, [ value ]); const url = (0,react__WEBPACK_IMPORTED_MODULE_1__.useMemo)(()=>isCategoryIconUrl(value) ? resolveCategoryIconUrl(value) : '', [ value ]); const fallbackUrl = '/category-icons/package.svg'; if (isCategoryIconUrl(value)) { if (hasError && value !== fallbackUrl) { return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: fallbackUrl, alt: alt, className: className, loading: "lazy", onError: ()=>setHasError(true) }); } if (hasError && value === fallbackUrl) { return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: className, children: fallback }); } return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: url, alt: alt, className: className, loading: "lazy", onError: ()=>setHasError(true) }); } return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: className, children: value || fallback }); } /***/ }) }, /******/ __webpack_require__ => { // webpackRuntimeModules /******/ var __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId)) /******/ __webpack_require__.O(0, [1516,9906,2982,587,18,7358], () => (__webpack_exec__(3589))); /******/ var __webpack_exports__ = __webpack_require__.O(); /******/ _N_E = __webpack_exports__; /******/ } ]); 5ÿÿÿ•þÿÿ `4–þÿÿX(self["webpackChunk_N_E"] = self["webpackChunk_N_E"] || []).push([[6636],{ /***/ 1511: •þÿÿ6ÿÿÿ•þÿÿéþÿÿ—þÿÿ)îÿÿêþÿÿ:ÿÿÿ;ÿÿÿ:ÿÿÿ@ÿÿÿ•þÿÿ6ÿÿÿ•þÿÿAÿÿÿ—þÿÿBÿÿÿCÿÿÿ:ÿÿÿ;ÿÿÿ:ÿÿÿ, /***/ 3589: ”þÿÿDÿÿÿ–þÿÿUimport(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/profile/page.tsx"); k082Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 1511))undefined7ÿÿÿ8ÿÿÿ7ÿÿÿÅ’þÿÿ3ÿÿÿ’þÿÿÆ”þÿÿÇÈ7ÿÿÿ8ÿÿÿ7ÿÿÿ€’‚7ÿÿÿèvar __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId)) __webpack_require__.O(0, [1516,9906,2982,587,18,7358], () => (__webpack_exec__(3589))); var __webpack_exports__ = __webpack_require__.O(); 6ÿÿÿƒ„… à§ «webpack/lib/util/registerExternalSerializerœwebpack-sources/ConcatSource€` «webpack/lib/util/registerExternalSerializer™webpack-sources/RawSourceV(self["webpackChunk_N_E"] = self["webpackChunk_N_E"] || []).push([[488],{ /***/ 409: «webpack/lib/util/registerExternalSerializerœwebpack-sources/CachedSource c«webpack/lib/util/registerExternalSerializerœwebpack-sources/ConcatSource€«webpack/lib/util/registerExternalSerializer™webpack-sources/RawSourceV/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { «webpack/lib/util/registerExternalSerializerœwebpack-sources/CachedSource Z«webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSource«webpack/lib/util/registerExternalSerializer™webpack-sources/RawSourceYimport(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/site/[slug]/page.tsx"); `VßPromise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 6235))€†buffer†source„size„maps„hashaPromise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 6235)); €”{"finalSource":true}ƒmap‹bufferedMap ReplaceSourceRawSourceYimport(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/site/[slug]/page.tsx"); k086Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 6235))undefined /***/ }) €†buffer†source„size„maps„hashÁ/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 6235)); /***/ }) €”{"finalSource":true}ƒmap‹bufferedMap ConcatSourceRawSourceV/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { ReplaceSourceRawSourceYimport(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/site/[slug]/page.tsx"); k086Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 6235))undefined RawSource /***/ }), /***/ 1592:  ú «webpack/lib/util/registerExternalSerializerœwebpack-sources/ConcatSource€«webpack/lib/util/registerExternalSerializer™webpack-sources/RawSource_/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; «webpack/lib/util/registerExternalSerializerœwebpack-sources/CachedSource w«webpack/lib/util/registerExternalSerializerœwebpack-sources/ConcatSource€«webpack/lib/util/registerExternalSerializer™webpack-sources/RawSourceå/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ CI: () => (/* binding */ signOut), /* harmony export */ Hh: () => (/* binding */ signUp), /* harmony export */ Jv: () => (/* binding */ signIn), /* harmony export */ wV: () => (/* binding */ useSession), /* harmony export */ yK: () => (/* binding */ authClient) /* harmony export */ }); /* harmony import */ var better_auth_react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6504); «webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSource import { createAuthClient } from 'better-auth/react'; const API_URL = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; export const authClient = createAuthClient({ baseURL: API_URL }); export const { signIn, signOut, signUp, useSession } = authClient; d4FdiE‚ˆœ«È΀˜"https://api.canhelp.gr"0€Ì(0,better_auth_react__WEBPACK_IMPORTED_MODULE_0__/* .createAuthClient */ .M)€€†buffer†source„size„maps„hashÌ/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ CI: () => (/* binding */ signOut), /* harmony export */ Hh: () => (/* binding */ signUp), /* harmony export */ Jv: () => (/* binding */ signIn), /* harmony export */ wV: () => (/* binding */ useSession), /* harmony export */ yK: () => (/* binding */ authClient) /* harmony export */ }); /* harmony import */ var better_auth_react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6504); const API_URL = "https://api.canhelp.gr" || 0; const authClient = (0,better_auth_react__WEBPACK_IMPORTED_MODULE_0__/* .createAuthClient */ .M)({ baseURL: API_URL }); const { signIn, signOut, signUp, useSession } = authClient; €”{"finalSource":true}ƒmap‹bufferedMap ConcatSourceRawSourceå/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ CI: () => (/* binding */ signOut), /* harmony export */ Hh: () => (/* binding */ signUp), /* harmony export */ Jv: () => (/* binding */ signIn), /* harmony export */ wV: () => (/* binding */ useSession), /* harmony export */ yK: () => (/* binding */ authClient) /* harmony export */ }); /* harmony import */ var better_auth_react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6504); ReplaceSourceRawSource import { createAuthClient } from 'better-auth/react'; const API_URL = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; export const authClient = createAuthClient({ baseURL: API_URL }); export const { signIn, signOut, signUp, useSession } = authClient; »052undefined70100"https://api.canhelp.gr"undefined1051270undefined130136undefined156171(0,better_auth_react__WEBPACK_IMPORTED_MODULE_0__/* .createAuthClient */ .M)undefined200206undefined /***/ }) ì5/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ CI: () => (/* binding */ signOut), /* harmony export */ Hh: () => (/* binding */ signUp), /* harmony export */ Jv: () => (/* binding */ signIn), /* harmony export */ wV: () => (/* binding */ useSession), /* harmony export */ yK: () => (/* binding */ authClient) /* harmony export */ }); /* harmony import */ var better_auth_react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6504); const API_URL = "https://api.canhelp.gr" || 0; const authClient = (0,better_auth_react__WEBPACK_IMPORTED_MODULE_0__/* .createAuthClient */ .M)({ baseURL: API_URL }); const { signIn, signOut, signUp, useSession } = authClient; /***/ }) íð  ñ_/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; ðå/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ CI: () => (/* binding */ signOut), /* harmony export */ Hh: () => (/* binding */ signUp), /* harmony export */ Jv: () => (/* binding */ signIn), /* harmony export */ wV: () => (/* binding */ useSession), /* harmony export */ yK: () => (/* binding */ authClient) /* harmony export */ }); /* harmony import */ var better_auth_react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6504); ñ import { createAuthClient } from 'better-auth/react'; const API_URL = process.env.NEXT_PUBLIC_API_URL || 'http://localhost:4000'; export const authClient = createAuthClient({ baseURL: API_URL }); export const { signIn, signOut, signUp, useSession } = authClient; »052undefined70100"https://api.canhelp.gr"undefined1051270undefined130136undefined156171(0,better_auth_react__WEBPACK_IMPORTED_MODULE_0__/* .createAuthClient */ .M)undefined200206undefinedòó, /***/ 2035:  R?«webpack/lib/util/registerExternalSerializerœwebpack-sources/ConcatSource€«webpack/lib/util/registerExternalSerializer™webpack-sources/RawSource_/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; «webpack/lib/util/registerExternalSerializerœwebpack-sources/CachedSource A«webpack/lib/util/registerExternalSerializerœwebpack-sources/ConcatSource€«webpack/lib/util/registerExternalSerializer™webpack-sources/RawSourceú/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ d: () => (/* binding */ PlanBadge) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); «webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourceimport { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; const tierConfig = { free: { label: 'Free', class: 'bg-gray-100 text-gray-500 border border-gray-200', icon: '' }, pro: { label: 'Pro', class: 'bg-green-100 text-green-700 border border-green-200', icon: /*#__PURE__*/ _jsx("svg", { viewBox: "0 0 16 16", fill: "none", className: "w-3 h-3 inline-block mr-0.5 -mt-px", children: /*#__PURE__*/ _jsx("path", { d: "M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z", fill: "currentColor" }) }) }, ultimate: { label: 'Ultimate', class: 'bg-gradient-to-r from-amber-400 via-yellow-400 to-amber-400 text-gray-900 border border-amber-500 shadow-sm shadow-amber-300/50', icon: /*#__PURE__*/ _jsx("svg", { viewBox: "0 0 16 16", fill: "none", className: "w-3 h-3 inline-block mr-0.5 -mt-px", children: /*#__PURE__*/ _jsx("path", { d: "M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z", fill: "currentColor" }) }) } }; export function PlanBadge(param) { let { tier, verified, size = 'sm', className = '' } = param; if (tier === 'free' && !verified) return null; const sizeClass = size === 'sm' ? 'text-[10px] px-1.5 py-0.5' : 'text-xs px-2 py-0.5'; if (verified && tier !== 'free') { return /*#__PURE__*/ _jsxs("span", { className: "inline-flex items-center gap-1 rounded-full font-semibold ".concat(sizeClass, " ").concat(tierConfig[tier].class, " ").concat(className), children: [ tier === 'ultimate' ? /*#__PURE__*/ _jsx(StarIcon, { className: "w-3 h-3 fill-gray-900" }) : /*#__PURE__*/ _jsx(VerifiedIcon, { className: "w-3 h-3" }), tierConfig[tier].label ] }); } if (verified) { return /*#__PURE__*/ _jsx("span", { className: "inline-flex items-center gap-0.5 rounded-full font-semibold ".concat(sizeClass, " bg-green-100 text-green-700 border border-green-200 ").concat(className), children: /*#__PURE__*/ _jsx(VerifiedIcon, { className: "w-3 h-3" }) }); } const cfg = tierConfig[tier]; return /*#__PURE__*/ _jsxs("span", { className: "inline-flex items-center rounded-full font-semibold ".concat(sizeClass, " ").concat(cfg.class, " ").concat(className), children: [ tier === 'pro' && /*#__PURE__*/ _jsx(StarIcon, { className: "w-3 h-3 mr-0.5 -mt-px" }), tier === 'ultimate' && /*#__PURE__*/ _jsx(StarIcon, { className: "w-3 h-3 mr-0.5 -mt-px fill-gray-900" }), cfg.label ] }); } function StarIcon(param) { let { className = '' } = param; return /*#__PURE__*/ _jsx("svg", { viewBox: "0 0 16 16", fill: "none", className: className, children: /*#__PURE__*/ _jsx("path", { d: "M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z", fill: "currentColor" }) }); } function VerifiedIcon(param) { let { className = '' } = param; return /*#__PURE__*/ _jsxs("svg", { viewBox: "0 0 16 16", fill: "none", className: className, children: [ /*#__PURE__*/ _jsx("path", { d: "M8 1l2 1.4 2.4-.4 1 2.2 2 1.2-.4 2.4L16 10l-1.8 1.6.4 2.4-2.2.8L10.8 17 8 16.2 5.2 17l-1.2-2.2-2.2-.8.4-2.4L0 10l1-2.2-.4-2.4 2-1.2 1-2.2 2.4.4L8 1z", fill: "#3B82F6" }), /*#__PURE__*/ _jsx("path", { d: "M5.5 8.5l1.5 1.5 3-3", stroke: "white", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) ] }); } b>_VYŽ‘9<ïõ%)#&Ž‘X[? B Õ Ù ° ³ 5 8   ™ œ • ™ C$'(+€¶(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)ÿÿÿ€·(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)þþþþÿþþþþÿþþ€†buffer†source„size„maps„hash /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ d: () => (/* binding */ PlanBadge) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); const tierConfig = { free: { label: 'Free', class: 'bg-gray-100 text-gray-500 border border-gray-200', icon: '' }, pro: { label: 'Pro', class: 'bg-green-100 text-green-700 border border-green-200', icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { viewBox: "0 0 16 16", fill: "none", className: "w-3 h-3 inline-block mr-0.5 -mt-px", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z", fill: "currentColor" }) }) }, ultimate: { label: 'Ultimate', class: 'bg-gradient-to-r from-amber-400 via-yellow-400 to-amber-400 text-gray-900 border border-amber-500 shadow-sm shadow-amber-300/50', icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { viewBox: "0 0 16 16", fill: "none", className: "w-3 h-3 inline-block mr-0.5 -mt-px", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z", fill: "currentColor" }) }) } }; function PlanBadge(param) { let { tier, verified, size = 'sm', className = '' } = param; if (tier === 'free' && !verified) return null; const sizeClass = size === 'sm' ? 'text-[10px] px-1.5 py-0.5' : 'text-xs px-2 py-0.5'; if (verified && tier !== 'free') { return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "inline-flex items-center gap-1 rounded-full font-semibold ".concat(sizeClass, " ").concat(tierConfig[tier].class, " ").concat(className), children: [ tier === 'ultimate' ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(StarIcon, { className: "w-3 h-3 fill-gray-900" }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(VerifiedIcon, { className: "w-3 h-3" }), tierConfig[tier].label ] }); } if (verified) { return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "inline-flex items-center gap-0.5 rounded-full font-semibold ".concat(sizeClass, " bg-green-100 text-green-700 border border-green-200 ").concat(className), children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(VerifiedIcon, { className: "w-3 h-3" }) }); } const cfg = tierConfig[tier]; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "inline-flex items-center rounded-full font-semibold ".concat(sizeClass, " ").concat(cfg.class, " ").concat(className), children: [ tier === 'pro' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(StarIcon, { className: "w-3 h-3 mr-0.5 -mt-px" }), tier === 'ultimate' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(StarIcon, { className: "w-3 h-3 mr-0.5 -mt-px fill-gray-900" }), cfg.label ] }); } function StarIcon(param) { let { className = '' } = param; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { viewBox: "0 0 16 16", fill: "none", className: className, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z", fill: "currentColor" }) }); } function VerifiedIcon(param) { let { className = '' } = param; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { viewBox: "0 0 16 16", fill: "none", className: className, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M8 1l2 1.4 2.4-.4 1 2.2 2 1.2-.4 2.4L16 10l-1.8 1.6.4 2.4-2.2.8L10.8 17 8 16.2 5.2 17l-1.2-2.2-2.2-.8.4-2.4L0 10l1-2.2-.4-2.4 2-1.2 1-2.2 2.4.4L8 1z", fill: "#3B82F6" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M5.5 8.5l1.5 1.5 3-3", stroke: "white", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) ] }); } €”{"finalSource":true}ƒmap‹bufferedMap ConcatSourceRawSourceú/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ d: () => (/* binding */ PlanBadge) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); ReplaceSourceRawSourceimport { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; const tierConfig = { free: { label: 'Free', class: 'bg-gray-100 text-gray-500 border border-gray-200', icon: '' }, pro: { label: 'Pro', class: 'bg-green-100 text-green-700 border border-green-200', icon: /*#__PURE__*/ _jsx("svg", { viewBox: "0 0 16 16", fill: "none", className: "w-3 h-3 inline-block mr-0.5 -mt-px", children: /*#__PURE__*/ _jsx("path", { d: "M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z", fill: "currentColor" }) }) }, ultimate: { label: 'Ultimate', class: 'bg-gradient-to-r from-amber-400 via-yellow-400 to-amber-400 text-gray-900 border border-amber-500 shadow-sm shadow-amber-300/50', icon: /*#__PURE__*/ _jsx("svg", { viewBox: "0 0 16 16", fill: "none", className: "w-3 h-3 inline-block mr-0.5 -mt-px", children: /*#__PURE__*/ _jsx("path", { d: "M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z", fill: "currentColor" }) }) } }; export function PlanBadge(param) { let { tier, verified, size = 'sm', className = '' } = param; if (tier === 'free' && !verified) return null; const sizeClass = size === 'sm' ? 'text-[10px] px-1.5 py-0.5' : 'text-xs px-2 py-0.5'; if (verified && tier !== 'free') { return /*#__PURE__*/ _jsxs("span", { className: "inline-flex items-center gap-1 rounded-full font-semibold ".concat(sizeClass, " ").concat(tierConfig[tier].class, " ").concat(className), children: [ tier === 'ultimate' ? /*#__PURE__*/ _jsx(StarIcon, { className: "w-3 h-3 fill-gray-900" }) : /*#__PURE__*/ _jsx(VerifiedIcon, { className: "w-3 h-3" }), tierConfig[tier].label ] }); } if (verified) { return /*#__PURE__*/ _jsx("span", { className: "inline-flex items-center gap-0.5 rounded-full font-semibold ".concat(sizeClass, " bg-green-100 text-green-700 border border-green-200 ").concat(className), children: /*#__PURE__*/ _jsx(VerifiedIcon, { className: "w-3 h-3" }) }); } const cfg = tierConfig[tier]; return /*#__PURE__*/ _jsxs("span", { className: "inline-flex items-center rounded-full font-semibold ".concat(sizeClass, " ").concat(cfg.class, " ").concat(className), children: [ tier === 'pro' && /*#__PURE__*/ _jsx(StarIcon, { className: "w-3 h-3 mr-0.5 -mt-px" }), tier === 'ultimate' && /*#__PURE__*/ _jsx(StarIcon, { className: "w-3 h-3 mr-0.5 -mt-px fill-gray-900" }), cfg.label ] }); } function StarIcon(param) { let { className = '' } = param; return /*#__PURE__*/ _jsx("svg", { viewBox: "0 0 16 16", fill: "none", className: className, children: /*#__PURE__*/ _jsx("path", { d: "M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z", fill: "currentColor" }) }); } function VerifiedIcon(param) { let { className = '' } = param; return /*#__PURE__*/ _jsxs("svg", { viewBox: "0 0 16 16", fill: "none", className: className, children: [ /*#__PURE__*/ _jsx("path", { d: "M8 1l2 1.4 2.4-.4 1 2.2 2 1.2-.4 2.4L16 10l-1.8 1.6.4 2.4-2.2.8L10.8 17 8 16.2 5.2 17l-1.2-2.2-2.2-.8.4-2.4L0 10l1-2.2-.4-2.4 2-1.2 1-2.2 2.4.4L8 1z", fill: "#3B82F6" }), /*#__PURE__*/ _jsx("path", { d: "M5.5 8.5l1.5 1.5 3-3", stroke: "white", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) ] }); } Ñ062undefined342345(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined513516(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined910913(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined10811084(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined12631269undefined15731577(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined18271830(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined19341937(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined21362139(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined23672370(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined25172521(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined27362739(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined28692872(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined30973100(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined32253228(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined34773481(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined36203623(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined38803883(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined /***/ }) à‰/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ d: () => (/* binding */ PlanBadge) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); const tierConfig = { free: { label: 'Free', class: 'bg-gray-100 text-gray-500 border border-gray-200', icon: '' }, pro: { label: 'Pro', class: 'bg-green-100 text-green-700 border border-green-200', icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { viewBox: "0 0 16 16", fill: "none", className: "w-3 h-3 inline-block mr-0.5 -mt-px", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z", fill: "currentColor" }) }) }, ultimate: { label: 'Ultimate', class: 'bg-gradient-to-r from-amber-400 via-yellow-400 to-amber-400 text-gray-900 border border-amber-500 shadow-sm shadow-amber-300/50', icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { viewBox: "0 0 16 16", fill: "none", className: "w-3 h-3 inline-block mr-0.5 -mt-px", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z", fill: "currentColor" }) }) } }; function PlanBadge(param) { let { tier, verified, size = 'sm', className = '' } = param; if (tier === 'free' && !verified) return null; const sizeClass = size === 'sm' ? 'text-[10px] px-1.5 py-0.5' : 'text-xs px-2 py-0.5'; if (verified && tier !== 'free') { return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "inline-flex items-center gap-1 rounded-full font-semibold ".concat(sizeClass, " ").concat(tierConfig[tier].class, " ").concat(className), children: [ tier === 'ultimate' ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(StarIcon, { className: "w-3 h-3 fill-gray-900" }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(VerifiedIcon, { className: "w-3 h-3" }), tierConfig[tier].label ] }); } if (verified) { return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "inline-flex items-center gap-0.5 rounded-full font-semibold ".concat(sizeClass, " bg-green-100 text-green-700 border border-green-200 ").concat(className), children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(VerifiedIcon, { className: "w-3 h-3" }) }); } const cfg = tierConfig[tier]; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "inline-flex items-center rounded-full font-semibold ".concat(sizeClass, " ").concat(cfg.class, " ").concat(className), children: [ tier === 'pro' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(StarIcon, { className: "w-3 h-3 mr-0.5 -mt-px" }), tier === 'ultimate' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(StarIcon, { className: "w-3 h-3 mr-0.5 -mt-px fill-gray-900" }), cfg.label ] }); } function StarIcon(param) { let { className = '' } = param; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { viewBox: "0 0 16 16", fill: "none", className: className, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z", fill: "currentColor" }) }); } function VerifiedIcon(param) { let { className = '' } = param; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { viewBox: "0 0 16 16", fill: "none", className: className, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M8 1l2 1.4 2.4-.4 1 2.2 2 1.2-.4 2.4L16 10l-1.8 1.6.4 2.4-2.2.8L10.8 17 8 16.2 5.2 17l-1.2-2.2-2.2-.8.4-2.4L0 10l1-2.2-.4-2.4 2-1.2 1-2.2 2.4.4L8 1z", fill: "#3B82F6" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M5.5 8.5l1.5 1.5 3-3", stroke: "white", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) ] }); } /***/ }) áä  åôåú/* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ d: () => (/* binding */ PlanBadge) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); æimport { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; const tierConfig = { free: { label: 'Free', class: 'bg-gray-100 text-gray-500 border border-gray-200', icon: '' }, pro: { label: 'Pro', class: 'bg-green-100 text-green-700 border border-green-200', icon: /*#__PURE__*/ _jsx("svg", { viewBox: "0 0 16 16", fill: "none", className: "w-3 h-3 inline-block mr-0.5 -mt-px", children: /*#__PURE__*/ _jsx("path", { d: "M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z", fill: "currentColor" }) }) }, ultimate: { label: 'Ultimate', class: 'bg-gradient-to-r from-amber-400 via-yellow-400 to-amber-400 text-gray-900 border border-amber-500 shadow-sm shadow-amber-300/50', icon: /*#__PURE__*/ _jsx("svg", { viewBox: "0 0 16 16", fill: "none", className: "w-3 h-3 inline-block mr-0.5 -mt-px", children: /*#__PURE__*/ _jsx("path", { d: "M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z", fill: "currentColor" }) }) } }; export function PlanBadge(param) { let { tier, verified, size = 'sm', className = '' } = param; if (tier === 'free' && !verified) return null; const sizeClass = size === 'sm' ? 'text-[10px] px-1.5 py-0.5' : 'text-xs px-2 py-0.5'; if (verified && tier !== 'free') { return /*#__PURE__*/ _jsxs("span", { className: "inline-flex items-center gap-1 rounded-full font-semibold ".concat(sizeClass, " ").concat(tierConfig[tier].class, " ").concat(className), children: [ tier === 'ultimate' ? /*#__PURE__*/ _jsx(StarIcon, { className: "w-3 h-3 fill-gray-900" }) : /*#__PURE__*/ _jsx(VerifiedIcon, { className: "w-3 h-3" }), tierConfig[tier].label ] }); } if (verified) { return /*#__PURE__*/ _jsx("span", { className: "inline-flex items-center gap-0.5 rounded-full font-semibold ".concat(sizeClass, " bg-green-100 text-green-700 border border-green-200 ").concat(className), children: /*#__PURE__*/ _jsx(VerifiedIcon, { className: "w-3 h-3" }) }); } const cfg = tierConfig[tier]; return /*#__PURE__*/ _jsxs("span", { className: "inline-flex items-center rounded-full font-semibold ".concat(sizeClass, " ").concat(cfg.class, " ").concat(className), children: [ tier === 'pro' && /*#__PURE__*/ _jsx(StarIcon, { className: "w-3 h-3 mr-0.5 -mt-px" }), tier === 'ultimate' && /*#__PURE__*/ _jsx(StarIcon, { className: "w-3 h-3 mr-0.5 -mt-px fill-gray-900" }), cfg.label ] }); } function StarIcon(param) { let { className = '' } = param; return /*#__PURE__*/ _jsx("svg", { viewBox: "0 0 16 16", fill: "none", className: className, children: /*#__PURE__*/ _jsx("path", { d: "M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z", fill: "currentColor" }) }); } function VerifiedIcon(param) { let { className = '' } = param; return /*#__PURE__*/ _jsxs("svg", { viewBox: "0 0 16 16", fill: "none", className: className, children: [ /*#__PURE__*/ _jsx("path", { d: "M8 1l2 1.4 2.4-.4 1 2.2 2 1.2-.4 2.4L16 10l-1.8 1.6.4 2.4-2.2.8L10.8 17 8 16.2 5.2 17l-1.2-2.2-2.2-.8.4-2.4L0 10l1-2.2-.4-2.4 2-1.2 1-2.2 2.4.4L8 1z", fill: "#3B82F6" }), /*#__PURE__*/ _jsx("path", { d: "M5.5 8.5l1.5 1.5 3-3", stroke: "white", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) ] }); } Ñ062undefined342345(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined513516(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined910913(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined10811084(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined12631269undefined15731577(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined18271830(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined19341937(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined21362139(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined23672370(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined25172521(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined27362739(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined28692872(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined30973100(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined32253228(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined34773481(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined36203623(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined38803883(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefinedçè, /***/ 6235:  bÿ«webpack/lib/util/registerExternalSerializerœwebpack-sources/ConcatSource€«webpack/lib/util/registerExternalSerializer™webpack-sources/RawSource_/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; «webpack/lib/util/registerExternalSerializerœwebpack-sources/CachedSource eÞ«webpack/lib/util/registerExternalSerializerœwebpack-sources/ConcatSource€«webpack/lib/util/registerExternalSerializer™webpack-sources/RawSourcev__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ PersonalSitePage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7541); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(9906); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(1592); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(2982); /* harmony import */ var _components_PlanBadge__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(2035); «webpack/lib/util/registerExternalSerializerwebpack-sources/ReplaceSourceóÈ/* __next_internal_client_entry_do_not_use__ default auto */ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime"; import { useEffect, useState, useCallback } from 'react'; import { useParams, useRouter } from 'next/navigation'; import { useLocale } from '@/context/locale'; import { useSession } from '@/lib/auth'; import { getPublicSiteProfile, getOrCreateDirectRoom, sendMessage, request, getCategories, getLocations, trackSiteMessage, getPriceList } from '@/lib/api'; import { PlanBadge } from '@/components/PlanBadge'; export default function PersonalSitePage() { var _profile_portfolio, _profile_firstName, _profile_lastName, _profile_name_, _profile_name, _profile_siteSettings, _profile_siteSettings1, _profile_siteSettings2, _profile_portfolio1, _profile_portfolio2, _SITE_LOCALES_find; const { slug } = useParams(); const { t, locale, setLocale } = useLocale(); const { data: session } = useSession(); const router = useRouter(); const [profile, setProfile] = useState(null); const [loading, setLoading] = useState(true); const [notFound, setNotFound] = useState(false); const [msgLoading, setMsgLoading] = useState(false); const [linkCopied, setLinkCopied] = useState(false); const [lightbox, setLightbox] = useState(null); const [contactSent, setContactSent] = useState(false); const [contactForm, setContactForm] = useState({ name: '', email: '', message: '' }); const [contactLoading, setContactLoading] = useState(false); const [langOpen, setLangOpen] = useState(false); const [msgModal, setMsgModal] = useState(false); const [authModal, setAuthModal] = useState(false); const [msgText, setMsgText] = useState(''); const [msgSent, setMsgSent] = useState(false); const [catMap, setCatMap] = useState({}); const [locMap, setLocMap] = useState({}); const [locParentMap, setLocParentMap] = useState({}); const [priceLists, setPriceLists] = useState({}); const [scrolled, setScrolled] = useState(false); const dateLocale = locale === 'ru' ? 'ru-RU' : locale === 'uk' ? 'uk-UA' : locale === 'en' ? 'en-US' : 'el-GR'; useEffect(()=>{ const onScroll = ()=>setScrolled(window.scrollY > 100); window.addEventListener('scroll', onScroll, { passive: true }); return ()=>window.removeEventListener('scroll', onScroll); }, []); const LANG_MAP = { el: { flag: '🇬🇷', label: 'ΕλληΜικά' }, en: { flag: '🇬🇧', label: 'English' }, ru: { flag: '🇷🇺', label: 'РусскОй' }, uk: { flag: '🇺🇊', label: 'УкраїМська' }, de: { flag: '🇩🇪', label: 'Deutsch' }, fr: { flag: '🇫🇷', label: 'Français' }, it: { flag: '🇮🇹', label: 'Italiano' }, es: { flag: '🇪🇞', label: 'Español' }, ar: { flag: '🇞🇊', label: 'العرؚية' }, zh: { flag: '🇚🇳', label: 'äž­æ–‡' } }; const SITE_LOCALES = [ { code: 'el', flag: '🇬🇷', label: 'ΕλληΜικά' }, { code: 'en', flag: '🇬🇧', label: 'English' }, { code: 'ru', flag: '🇷🇺', label: 'РусскОй' } ]; useEffect(()=>{ if (!slug) return; getPublicSiteProfile(slug).then(setProfile).catch(()=>setNotFound(true)).finally(()=>setLoading(false)); }, [ slug ]); useEffect(()=>{ var _profile_siteSettings; const shouldShowPriceList = (profile === null || profile === void 0 ? void 0 : (_profile_siteSettings = profile.siteSettings) === null || _profile_siteSettings === void 0 ? void 0 : _profile_siteSettings.showPriceList) !== false; const cards = Array.isArray(profile === null || profile === void 0 ? void 0 : profile.cards) ? profile.cards : []; if (!profile || !shouldShowPriceList || cards.length === 0) { setPriceLists({}); return; } let cancelled = false; Promise.all(cards.map(async (card)=>[ card.id, await getPriceList(card.id, locale) ])).then((entries)=>{ if (cancelled) return; setPriceLists(Object.fromEntries(entries.filter((param)=>{ let [, groups] = param; return groups.length > 0; }))); }).catch(()=>{ if (!cancelled) setPriceLists({}); }); return ()=>{ cancelled = true; }; }, [ profile, locale ]); useEffect(()=>{ const catLocale = locale; getCategories().then((cats)=>{ const m = {}; for (const c of cats){ var _c_names_catLocale; m[c.slug] = (_c_names_catLocale = c.names[catLocale]) !== null && _c_names_catLocale !== void 0 ? _c_names_catLocale : c.names.el; var _c_children; for (const sub of (_c_children = c.children) !== null && _c_children !== void 0 ? _c_children : []){ var _sub_names_catLocale; m[sub.slug] = (_sub_names_catLocale = sub.names[catLocale]) !== null && _sub_names_catLocale !== void 0 ? _sub_names_catLocale : sub.names.el; } } setCatMap(m); }).catch(()=>{}); getLocations().then((locs)=>{ const m = {}; const pm = {}; for (const loc of locs){ var _loc_names, _loc_names1; var _loc_names_catLocale, _ref; const parentName = (_ref = (_loc_names_catLocale = (_loc_names = loc.names) === null || _loc_names === void 0 ? void 0 : _loc_names[catLocale]) !== null && _loc_names_catLocale !== void 0 ? _loc_names_catLocale : (_loc_names1 = loc.names) === null || _loc_names1 === void 0 ? void 0 : _loc_names1.el) !== null && _ref !== void 0 ? _ref : loc.slug; m[loc.slug] = parentName; var _loc_children; for (const child of (_loc_children = loc.children) !== null && _loc_children !== void 0 ? _loc_children : []){ var _child_names, _child_names1; var _child_names_catLocale, _ref1; m[child.slug] = (_ref1 = (_child_names_catLocale = (_child_names = child.names) === null || _child_names === void 0 ? void 0 : _child_names[catLocale]) !== null && _child_names_catLocale !== void 0 ? _child_names_catLocale : (_child_names1 = child.names) === null || _child_names1 === void 0 ? void 0 : _child_names1.el) !== null && _ref1 !== void 0 ? _ref1 : child.slug; pm[child.slug] = parentName; } } setLocMap(m); setLocParentMap(pm); }).catch(()=>{}); }, [ locale ]); function handleMessage() { if (!session) { setAuthModal(true); return; } setMsgModal(true); } async function handleSendMessage(e) { e.preventDefault(); if (!msgText.trim()) return; setMsgLoading(true); try { const { room } = await getOrCreateDirectRoom(profile.id); await sendMessage(room.id, msgText.trim()); trackSiteMessage(slug); setMsgSent(true); setMsgText(''); } catch (e) {} finally{ setMsgLoading(false); } } const handleContactSubmit = useCallback(async (e)=>{ e.preventDefault(); if (!contactForm.name.trim() || !contactForm.message.trim()) return; setContactLoading(true); try { await request("/users/site/".concat(slug, "/contact"), { method: 'POST', body: JSON.stringify(contactForm) }); setContactSent(true); setContactForm({ name: '', email: '', message: '' }); } catch (e) {} finally{ setContactLoading(false); } }, [ contactForm, slug ]); // Lightbox keyboard nav useEffect(()=>{ if (lightbox === null) return; const handler = (e)=>{ if (e.key === 'Escape') setLightbox(null); if (e.key === 'ArrowRight') setLightbox((i)=>{ var _profile_portfolio; var _profile_portfolio_length; return i !== null ? Math.min(i + 1, ((_profile_portfolio_length = profile === null || profile === void 0 ? void 0 : (_profile_portfolio = profile.portfolio) === null || _profile_portfolio === void 0 ? void 0 : _profile_portfolio.length) !== null && _profile_portfolio_length !== void 0 ? _profile_portfolio_length : 1) - 1) : null; }); if (e.key === 'ArrowLeft') setLightbox((i)=>i !== null ? Math.max(i - 1, 0) : null); }; document.addEventListener('keydown', handler); return ()=>document.removeEventListener('keydown', handler); }, [ lightbox, profile === null || profile === void 0 ? void 0 : (_profile_portfolio = profile.portfolio) === null || _profile_portfolio === void 0 ? void 0 : _profile_portfolio.length ]); if (loading) return /*#__PURE__*/ _jsx("div", { className: "min-h-screen flex items-center justify-center", style: { background: 'var(--site-bg)' }, children: /*#__PURE__*/ _jsxs("div", { className: "relative w-12 h-12", children: [ /*#__PURE__*/ _jsx("div", { className: "absolute inset-0 rounded-full border-2 border-green-500/20" }), /*#__PURE__*/ _jsx("div", { className: "absolute inset-0 rounded-full border-2 border-transparent border-t-blue-500 animate-spin" }) ] }) }); if (notFound || !profile) return /*#__PURE__*/ _jsxs("div", { className: "min-h-screen flex flex-col items-center justify-center gap-6", style: { background: 'var(--site-bg)' }, children: [ /*#__PURE__*/ _jsx("div", { className: "w-20 h-20 rounded-full flex items-center justify-center", style: { background: 'var(--site-surface)' }, children: /*#__PURE__*/ _jsx("svg", { className: "w-10 h-10 text-gray-500", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15.182 16.318A4.486 4.486 0 0012.016 15a4.486 4.486 0 00-3.198 1.318M21 12a9 9 0 11-18 0 9 9 0 0118 0zM9.75 9.75c0 .414-.168.75-.375.75S9 10.164 9 9.75 9.168 9 9.375 9s.375.336.375.75zm-.375 0h.008v.015h-.008V9.75zm5.625 0c0 .414-.168.75-.375.75s-.375-.336-.375-.75.168-.75.375-.75.375.336.375.75zm-.375 0h.008v.015h-.008V9.75z" }) }) }), /*#__PURE__*/ _jsx("p", { className: "text-gray-400 text-lg", children: t('common.not_found', 'Page not found') }), /*#__PURE__*/ _jsx("a", { href: "/", className: "text-gray-400 hover:text-gray-300 text-sm transition", children: t('nav.home', 'Home') }) ] }); var _profile_firstName_, _profile_lastName_; const initials = "".concat((_profile_firstName_ = (_profile_firstName = profile.firstName) === null || _profile_firstName === void 0 ? void 0 : _profile_firstName[0]) !== null && _profile_firstName_ !== void 0 ? _profile_firstName_ : '').concat((_profile_lastName_ = (_profile_lastName = profile.lastName) === null || _profile_lastName === void 0 ? void 0 : _profile_lastName[0]) !== null && _profile_lastName_ !== void 0 ? _profile_lastName_ : '').toUpperCase() || ((_profile_name = profile.name) === null || _profile_name === void 0 ? void 0 : (_profile_name_ = _profile_name[0]) === null || _profile_name_ === void 0 ? void 0 : _profile_name_.toUpperCase()) || '?'; const displayName = [ profile.firstName, profile.lastName ].filter(Boolean).join(' ') || profile.name || ''; const memberYear = profile.memberSince ? new Date(profile.memberSince).getFullYear() : null; const hasStats = profile.completedTasks > 0 || profile.rating || profile.reviewCount && profile.reviewCount > 0; const isLight = ((_profile_siteSettings = profile.siteSettings) === null || _profile_siteSettings === void 0 ? void 0 : _profile_siteSettings.siteTheme) === 'light'; const showServices = ((_profile_siteSettings1 = profile.siteSettings) === null || _profile_siteSettings1 === void 0 ? void 0 : _profile_siteSettings1.showServices) !== false; const showPriceList = ((_profile_siteSettings2 = profile.siteSettings) === null || _profile_siteSettings2 === void 0 ? void 0 : _profile_siteSettings2.showPriceList) !== false; const showCardsSection = showServices || showPriceList; var _profile_portfolio_length, _profile_portfolio_lightbox_title, _SITE_LOCALES_find_flag; return /*#__PURE__*/ _jsxs("div", { className: "site-theme min-h-screen selection:bg-green-500/30 ".concat(isLight ? 'site-light' : ''), style: { background: 'var(--site-bg)', color: 'var(--site-text)' }, children: [ lightbox !== null && ((_profile_portfolio1 = profile.portfolio) === null || _profile_portfolio1 === void 0 ? void 0 : _profile_portfolio1[lightbox]) && /*#__PURE__*/ _jsxs("div", { className: "fixed inset-0 z-50 bg-black/90 backdrop-blur-xl flex items-center justify-center p-4", onClick: ()=>setLightbox(null), children: [ /*#__PURE__*/ _jsx("button", { onClick: ()=>setLightbox(null), className: "absolute top-6 right-6 w-10 h-10 rounded-full bg-white/10 hover:bg-white/20 flex items-center justify-center transition", children: /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" }) }) }), lightbox > 0 && /*#__PURE__*/ _jsx("button", { onClick: (e)=>{ e.stopPropagation(); setLightbox(lightbox - 1); }, className: "absolute left-4 top-1/2 -translate-y-1/2 w-10 h-10 rounded-full bg-white/10 hover:bg-white/20 flex items-center justify-center transition", children: /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 19l-7-7 7-7" }) }) }), lightbox < ((_profile_portfolio_length = (_profile_portfolio2 = profile.portfolio) === null || _profile_portfolio2 === void 0 ? void 0 : _profile_portfolio2.length) !== null && _profile_portfolio_length !== void 0 ? _profile_portfolio_length : 1) - 1 && /*#__PURE__*/ _jsx("button", { onClick: (e)=>{ e.stopPropagation(); setLightbox(lightbox + 1); }, className: "absolute right-4 top-1/2 -translate-y-1/2 w-10 h-10 rounded-full bg-white/10 hover:bg-white/20 flex items-center justify-center transition", children: /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 5l7 7-7 7" }) }) }), /*#__PURE__*/ _jsx("img", { src: profile.portfolio[lightbox].imageUrl, alt: (_profile_portfolio_lightbox_title = profile.portfolio[lightbox].title) !== null && _profile_portfolio_lightbox_title !== void 0 ? _profile_portfolio_lightbox_title : '', className: "max-w-full max-h-[85vh] rounded-2xl object-contain", onClick: (e)=>e.stopPropagation() }), profile.portfolio[lightbox].title && /*#__PURE__*/ _jsx("div", { className: "absolute bottom-6 left-1/2 -translate-x-1/2 bg-black/60 backdrop-blur-md px-5 py-2.5 rounded-full text-sm", children: profile.portfolio[lightbox].title }) ] }), authModal && /*#__PURE__*/ _jsx("div", { className: "fixed inset-0 z-50 bg-black/70 backdrop-blur-sm flex items-center justify-center p-4", onClick: ()=>setAuthModal(false), children: /*#__PURE__*/ _jsxs("div", { className: "relative w-full max-w-sm rounded-2xl shadow-2xl p-6", style: { background: 'var(--site-modal-bg)', border: '1px solid var(--site-border)' }, onClick: (e)=>e.stopPropagation(), children: [ /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setAuthModal(false), className: "absolute top-4 right-4 w-8 h-8 rounded-full flex items-center justify-center transition", style: { background: 'var(--site-surface)', color: 'var(--site-text-muted)' }, children: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" }) }) }), /*#__PURE__*/ _jsx("div", { className: "w-12 h-12 rounded-full bg-green-500/10 flex items-center justify-center mb-4", children: /*#__PURE__*/ _jsx("svg", { className: "w-6 h-6 text-gray-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }) }), /*#__PURE__*/ _jsx("h3", { className: "text-base font-semibold mb-2", style: { color: 'var(--site-text)' }, children: t('site.auth_required_title', 'Authorization required') }), /*#__PURE__*/ _jsx("p", { className: "text-sm mb-5", style: { color: 'var(--site-text-muted)' }, children: t('site.auth_required_desc', 'To write in chat, sign in to your CanHelp account.') }), /*#__PURE__*/ _jsxs("div", { className: "flex flex-col gap-2.5", children: [ /*#__PURE__*/ _jsxs("a", { href: "/login", className: "w-full flex items-center justify-center gap-2 bg-green-600 hover:bg-green-500 text-white font-medium text-sm px-4 py-2.5 rounded-xl transition", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M11 16l-4-4m0 0l4-4m-4 4h14m-5 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h7a3 3 0 013 3v1" }) }), t('site.auth_login_btn', 'Sign in') ] }), /*#__PURE__*/ _jsxs("button", { type: "button", onClick: ()=>{ setAuthModal(false); setTimeout(()=>{ var _document_getElementById; (_document_getElementById = document.getElementById('contact')) === null || _document_getElementById === void 0 ? void 0 : _document_getElementById.scrollIntoView({ behavior: 'smooth', block: 'start' }); }, 100); }, className: "w-full flex items-center justify-center gap-2 text-sm font-medium px-4 py-2.5 rounded-xl transition", style: { background: 'var(--site-surface)', color: 'var(--site-text-secondary)', border: '1px solid var(--site-border)' }, children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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" }) }), t('site.auth_contact_form_btn', 'Write via contact form') ] }) ] }) ] }) }), msgModal && /*#__PURE__*/ _jsx("div", { className: "fixed inset-0 z-50 bg-black/70 backdrop-blur-sm flex items-center justify-center p-4", onClick: ()=>{ if (!msgLoading) { setMsgModal(false); setMsgSent(false); } }, children: /*#__PURE__*/ _jsxs("div", { className: "relative w-full max-w-md rounded-2xl shadow-2xl", style: { background: 'var(--site-modal-bg)', border: '1px solid var(--site-border)' }, onClick: (e)=>e.stopPropagation(), children: [ /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>{ setMsgModal(false); setMsgSent(false); }, className: "absolute top-4 right-4 w-8 h-8 rounded-full flex items-center justify-center transition", style: { background: 'var(--site-surface)', color: 'var(--site-text-muted)' }, children: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" }) }) }), /*#__PURE__*/ _jsxs("div", { className: "p-6", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 mb-5", children: [ /*#__PURE__*/ _jsx("div", { className: "w-10 h-10 rounded-full bg-green-500/10 flex items-center justify-center", children: /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5 text-gray-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }) }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("h3", { className: "text-base font-semibold", style: { color: 'var(--site-text)' }, children: t('site.write_to_chat', 'Write in chat') }), /*#__PURE__*/ _jsx("p", { className: "text-xs", style: { color: 'var(--site-text-muted)' }, children: displayName }) ] }) ] }), msgSent ? /*#__PURE__*/ _jsxs("div", { className: "text-center py-6", children: [ /*#__PURE__*/ _jsx("div", { className: "w-12 h-12 rounded-full bg-emerald-500/20 flex items-center justify-center mx-auto mb-3", children: /*#__PURE__*/ _jsx("svg", { className: "w-6 h-6 text-emerald-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" }) }) }), /*#__PURE__*/ _jsx("p", { className: "text-emerald-400 font-medium mb-1", children: t('site.message_sent', 'Message sent!') }), /*#__PURE__*/ _jsx("p", { className: "text-sm mb-4", style: { color: 'var(--site-text-muted)' }, children: t('site.message_sent_desc', 'The specialist will receive it in chat') }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>{ setMsgModal(false); setMsgSent(false); }, className: "text-sm text-gray-400 hover:text-gray-300 transition", children: t('common.close', 'Close') }) ] }) : /*#__PURE__*/ _jsxs("form", { onSubmit: handleSendMessage, children: [ /*#__PURE__*/ _jsx("textarea", { autoFocus: true, rows: 4, value: msgText, onChange: (e)=>setMsgText(e.target.value), className: "w-full rounded-xl px-4 py-3 text-sm focus:outline-none focus:border-green-500/50 transition resize-none mb-4", style: { background: 'var(--site-input-bg)', border: '1px solid var(--site-input-border)', color: 'var(--site-input-text)' }, placeholder: t('site.message_placeholder', 'Write your message...') }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-end gap-3", children: [ /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setMsgModal(false), className: "text-sm transition px-4 py-2", style: { color: 'var(--site-text-muted)' }, children: t('common.cancel', 'Cancel') }), /*#__PURE__*/ _jsxs("button", { type: "submit", disabled: msgLoading || !msgText.trim(), className: "inline-flex items-center gap-2 bg-green-600 hover:bg-green-500 text-white font-medium text-sm px-5 py-2.5 rounded-xl transition disabled:opacity-50", children: [ msgLoading ? /*#__PURE__*/ _jsx("div", { className: "w-4 h-4 rounded-full border-2 border-white/30 border-t-white animate-spin" }) : /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 19l9 2-9-18-9 18 9-2zm0 0v-8" }) }), t('site.contact_send', 'Send') ] }) ] }) ] }) ] }) ] }) }), /*#__PURE__*/ _jsx("nav", { className: "sticky top-0 z-40 backdrop-blur-xl", style: { background: 'var(--site-nav-bg)', borderBottom: '1px solid var(--site-border)' }, children: /*#__PURE__*/ _jsxs("div", { className: "max-w-5xl mx-auto px-4 sm:px-6 h-14 flex items-center justify-between", children: [ /*#__PURE__*/ _jsx("a", { href: "/", className: "logo-text-mini tracking-tight".concat(scrolled ? ' scrolled' : ''), style: { color: 'var(--site-text-secondary)' }, children: "CanHelp" }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2", children: [ (profile === null || profile === void 0 ? void 0 : profile.rating) && /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-1 text-xs mr-1", style: { color: 'var(--site-text-secondary)' }, children: [ /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5 text-amber-400", fill: "currentColor", viewBox: "0 0 20 20", children: /*#__PURE__*/ _jsx("path", { d: "M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 00-1.175 0l-2.8 2.034c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 00.951-.69l1.07-3.292z" }) }), /*#__PURE__*/ _jsx("span", { className: "font-medium", children: Number(profile.rating).toFixed(1) }) ] }), /*#__PURE__*/ _jsxs("div", { className: "relative", children: [ /*#__PURE__*/ _jsxs("button", { type: "button", onClick: ()=>setLangOpen(!langOpen), className: "flex items-center gap-1.5 text-xs transition px-2 py-1 rounded-lg", style: { color: 'var(--site-text-muted)' }, children: [ /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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" }) }), (_SITE_LOCALES_find_flag = (_SITE_LOCALES_find = SITE_LOCALES.find((l)=>l.code === locale)) === null || _SITE_LOCALES_find === void 0 ? void 0 : _SITE_LOCALES_find.flag) !== null && _SITE_LOCALES_find_flag !== void 0 ? _SITE_LOCALES_find_flag : '🌐' ] }), langOpen && /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx("div", { className: "fixed inset-0 z-40", onClick: ()=>setLangOpen(false) }), /*#__PURE__*/ _jsx("div", { className: "absolute right-0 top-full mt-1 z-50 rounded-xl shadow-xl overflow-hidden min-w-[140px]", style: { background: 'var(--site-lang-dropdown)', border: '1px solid var(--site-border)' }, children: SITE_LOCALES.map((l)=>/*#__PURE__*/ _jsxs("button", { type: "button", onClick: ()=>{ setLocale(l.code); setLangOpen(false); }, className: "w-full flex items-center gap-2 px-3 py-2 text-xs transition ".concat(locale === l.code ? 'text-gray-400 bg-green-500/10' : ''), style: locale === l.code ? {} : { color: 'var(--site-text-secondary)' }, children: [ /*#__PURE__*/ _jsx("span", { children: l.flag }), /*#__PURE__*/ _jsx("span", { children: l.label }) ] }, l.code)) }) ] }) ] }), /*#__PURE__*/ _jsx("div", { className: "w-px h-4", style: { background: 'var(--site-divider)' } }), /*#__PURE__*/ _jsxs("button", { type: "button", onClick: async ()=>{ const url = window.location.href; if (navigator.share) { try { await navigator.share({ title: displayName, url }); } catch (e) {} } else { navigator.clipboard.writeText(url); setLinkCopied(true); setTimeout(()=>setLinkCopied(false), 2000); } }, className: "flex items-center gap-1.5 text-xs transition", style: { color: 'var(--site-text-muted)' }, children: [ /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8.684 13.342C8.886 12.938 9 12.482 9 12c0-.482-.114-.938-.316-1.342m0 2.684a3 3 0 110-2.684m0 2.684l6.632 3.316m-6.632-6l6.632-3.316m0 0a3 3 0 105.367-2.684 3 3 0 00-5.367 2.684zm0 9.316a3 3 0 105.368 2.684 3 3 0 00-5.368-2.684z" }) }), linkCopied ? t('profile.site.copied') : t('site.share', 'Share') ] }) ] }) ] }) }), /*#__PURE__*/ _jsxs("section", { className: "relative overflow-hidden", children: [ /*#__PURE__*/ _jsx("div", { className: "absolute top-0 left-1/4 w-[500px] h-[500px] bg-green-600/10 rounded-full blur-[120px] pointer-events-none" }), /*#__PURE__*/ _jsx("div", { className: "absolute top-20 right-1/4 w-[400px] h-[400px] bg-purple-600/8 rounded-full blur-[100px] pointer-events-none" }), /*#__PURE__*/ _jsx("div", { className: "relative max-w-5xl mx-auto px-4 sm:px-6 pt-16 pb-20 sm:pt-24 sm:pb-28", children: /*#__PURE__*/ _jsxs("div", { className: "flex flex-col items-center text-center", children: [ /*#__PURE__*/ _jsxs("div", { className: "relative group mb-6", children: [ /*#__PURE__*/ _jsx("div", { className: "absolute -inset-1 bg-gradient-to-br from-green-600 to-purple-500 rounded-full opacity-60 blur group-hover:opacity-80 transition-opacity" }), /*#__PURE__*/ _jsx("div", { className: "relative w-28 h-28 sm:w-32 sm:h-32 rounded-full overflow-hidden border-2 flex items-center justify-center text-4xl font-bold", style: { borderColor: 'var(--site-avatar-border)', background: 'var(--site-avatar-bg)', color: 'var(--site-text)' }, children: profile.image ? /*#__PURE__*/ _jsx("img", { src: profile.image, alt: displayName, className: "w-full h-full object-cover" }) : initials }), Array.isArray(profile.activeStatuses) && profile.activeStatuses.includes('canhelp_now') && /*#__PURE__*/ _jsx("div", { className: "absolute bottom-1 right-1 w-5 h-5 bg-emerald-500 rounded-full border-2 flex items-center justify-center", style: { borderColor: 'var(--site-status-border-color)' }, children: /*#__PURE__*/ _jsx("span", { className: "w-2 h-2 rounded-full bg-white animate-pulse" }) }) ] }), /*#__PURE__*/ _jsx("h1", { className: "text-3xl sm:text-5xl font-bold tracking-tight bg-clip-text text-transparent mb-3 pb-1", style: { backgroundImage: 'linear-gradient(to bottom, var(--site-name-from), var(--site-name-to))' }, children: displayName }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-center gap-2 flex-wrap mb-4", children: [ profile.planTier && profile.planTier !== 'free' && /*#__PURE__*/ _jsx(PlanBadge, { tier: profile.planTier, verified: profile.hasVerifiedBadge, size: "md" }), Array.isArray(profile.activeStatuses) && profile.activeStatuses.includes('canhelp_now') && /*#__PURE__*/ _jsxs("span", { className: "inline-flex items-center gap-1.5 text-xs font-medium text-emerald-400 bg-emerald-500/10 border border-emerald-500/20 px-3 py-1.5 rounded-full", children: [ /*#__PURE__*/ _jsx("span", { className: "w-1.5 h-1.5 rounded-full bg-emerald-400 animate-pulse" }), t('status.can_help_now', 'Available now') ] }), memberYear && /*#__PURE__*/ _jsxs("span", { className: "text-xs px-3 py-1.5 rounded-full", style: { color: 'var(--site-text-muted)', background: 'var(--site-surface)' }, children: [ t('site.member_since', 'Member since'), " ", memberYear ] }) ] }), profile.bio && /*#__PURE__*/ _jsx("p", { className: "max-w-xl text-base sm:text-lg leading-relaxed mb-8", style: { color: 'var(--site-text-secondary)' }, children: profile.bio }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 flex-wrap justify-center", children: [ /*#__PURE__*/ _jsxs("button", { onClick: handleMessage, disabled: msgLoading, className: "group inline-flex items-center gap-2.5 bg-green-600 hover:bg-green-500 text-white font-semibold px-7 py-3.5 rounded-full transition-all hover:shadow-lg hover:shadow-blue-500/25 disabled:opacity-50", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5 group-hover:scale-110 transition-transform", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }), t('site.write_to_chat', 'Write in chat') ] }), profile.phone && /*#__PURE__*/ _jsxs("a", { href: "tel:".concat(profile.phone), className: "group inline-flex items-center gap-2.5 border font-medium px-7 py-3.5 rounded-full transition-all", style: { background: 'var(--site-phone-bg)', borderColor: 'var(--site-phone-border)', color: 'var(--site-phone-text)' }, children: [ /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5 group-hover:scale-110 transition-transform", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M3 5a2 2 0 012-2h3.28a1 1 0 01.948.684l1.498 4.493a1 1 0 01-.502 1.21l-2.257 1.13a11.042 11.042 0 005.516 5.516l1.13-2.257a1 1 0 011.21-.502l4.493 1.498a1 1 0 01.684.949V19a2 2 0 01-2 2h-1C9.716 21 3 14.284 3 6V5z" }) }), profile.phone ] }) ] }) ] }) }) ] }), hasStats && /*#__PURE__*/ _jsx("section", { className: "border-y", style: { borderColor: 'var(--site-border)', background: 'var(--site-surface)' }, children: /*#__PURE__*/ _jsx("div", { className: "max-w-5xl mx-auto px-4 sm:px-6 py-8", children: /*#__PURE__*/ _jsxs("div", { className: "grid grid-cols-2 sm:grid-cols-4 gap-6", children: [ profile.rating && /*#__PURE__*/ _jsxs("div", { className: "text-center", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-center gap-1 mb-1", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5 text-amber-400", fill: "currentColor", viewBox: "0 0 20 20", children: /*#__PURE__*/ _jsx("path", { d: "M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 00-1.175 0l-2.8 2.034c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 00.951-.69l1.07-3.292z" }) }), /*#__PURE__*/ _jsx("span", { className: "text-2xl font-bold", children: Number(profile.rating).toFixed(1) }) ] }), /*#__PURE__*/ _jsx("p", { className: "text-xs uppercase tracking-wider", style: { color: 'var(--site-text-muted)' }, children: t('site.rating', 'Rating') }) ] }), profile.reviewCount > 0 && /*#__PURE__*/ _jsxs("div", { className: "text-center", children: [ /*#__PURE__*/ _jsx("p", { className: "text-2xl font-bold mb-1", children: profile.reviewCount }), /*#__PURE__*/ _jsx("p", { className: "text-xs uppercase tracking-wider", style: { color: 'var(--site-text-muted)' }, children: t('profile.reviews') }) ] }), profile.completedTasks > 0 && /*#__PURE__*/ _jsxs("div", { className: "text-center", children: [ /*#__PURE__*/ _jsx("p", { className: "text-2xl font-bold mb-1", children: profile.completedTasks }), /*#__PURE__*/ _jsx("p", { className: "text-xs uppercase tracking-wider", style: { color: 'var(--site-text-muted)' }, children: t('site.completed_tasks', 'Completed') }) ] }), Array.isArray(profile.languages) && profile.languages.length > 0 && /*#__PURE__*/ _jsxs("div", { className: "text-center", children: [ /*#__PURE__*/ _jsx("p", { className: "text-2xl font-bold mb-1", children: profile.languages.length }), /*#__PURE__*/ _jsx("p", { className: "text-xs uppercase tracking-wider", style: { color: 'var(--site-text-muted)' }, children: t('site.languages', 'Languages') }) ] }) ] }) }) }), Array.isArray(profile.languages) && profile.languages.length > 0 && /*#__PURE__*/ _jsxs("section", { className: "max-w-5xl mx-auto px-4 sm:px-6 pt-10", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 mb-3", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", style: { color: 'var(--site-text-muted)' }, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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" }) }), /*#__PURE__*/ _jsx("span", { className: "text-sm", style: { color: 'var(--site-text-muted)' }, children: t('site.speaks_languages', 'Speaks languages') }) ] }), /*#__PURE__*/ _jsx("div", { className: "flex items-center gap-2 flex-wrap", children: profile.languages.map((lang)=>{ const info = LANG_MAP[lang]; return /*#__PURE__*/ _jsx("span", { className: "text-xs px-3 py-1.5 rounded-full flex items-center gap-1.5", style: { color: 'var(--site-tag-text)', background: 'var(--site-tag-bg)', border: '1px solid var(--site-tag-border)' }, children: info ? /*#__PURE__*/ _jsxs(_Fragment, { children: [ info.flag, " ", info.label ] }) : lang }, lang); }) }) ] }), /*#__PURE__*/ _jsxs("div", { className: "max-w-5xl mx-auto px-4 sm:px-6 pb-20 space-y-16 mt-10", children: [ showServices && Array.isArray(profile.cards) && profile.cards.length > 0 && /*#__PURE__*/ _jsxs("section", { children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 mb-6", children: [ /*#__PURE__*/ _jsx("div", { className: "w-8 h-8 rounded-lg bg-green-500/10 flex items-center justify-center", children: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-gray-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M21 13.255A23.931 23.931 0 0112 15c-3.183 0-6.22-.62-9-1.745M16 6V4a2 2 0 00-2-2h-4a2 2 0 00-2 2v2m4 6h.01M5 20h14a2 2 0 002-2V8a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z" }) }) }), /*#__PURE__*/ _jsx("h2", { className: "text-xl font-bold", children: t('specialist.services', 'Services') }) ] }), /*#__PURE__*/ _jsx("div", { className: "grid gap-4 sm:grid-cols-2", children: profile.cards.map((card)=>{ // Group locations by parent const grouped = {}; if (Array.isArray(card.locations)) { for (const slug of card.locations){ const parent = locParentMap[slug]; if (parent) { if (!grouped[parent]) grouped[parent] = []; grouped[parent].push(locMap[slug] || slug); } else { const name = locMap[slug] || slug; if (!grouped[name]) grouped[name] = []; } } } return /*#__PURE__*/ _jsxs("div", { className: "group relative rounded-2xl p-6 transition-all", style: { background: 'var(--site-card-bg)', border: '1px solid var(--site-card-border)' }, children: [ /*#__PURE__*/ _jsx("h3", { className: "font-semibold mb-2", style: { color: 'var(--site-text)' }, children: card.title }), showServices && (()=>{ const desc = (locale === 'el' ? card.descriptionEl : locale === 'en' ? card.descriptionEn : locale === 'ru' ? card.descriptionRu : card.descriptionUk) || card.descriptionEl || card.descriptionEn || card.descriptionRu || card.descriptionUk || card.description; return desc ? /*#__PURE__*/ _jsx("p", { className: "text-sm leading-relaxed mb-3", style: { color: 'var(--site-text-muted)' }, children: desc }) : null; })(), showServices && Array.isArray(card.categories) && card.categories.length > 0 && /*#__PURE__*/ _jsx("div", { className: "flex flex-wrap gap-1.5 mb-3", children: card.categories.map((slug)=>/*#__PURE__*/ _jsx("span", { className: "text-[11px] px-2.5 py-1 rounded-full bg-purple-500/10 text-purple-400 border border-purple-500/10", children: catMap[slug] || slug }, slug)) }), showServices && Object.keys(grouped).length > 0 && /*#__PURE__*/ _jsx("div", { className: "mb-3 space-y-1", children: Object.entries(grouped).map((param)=>{ let [parent, children] = param; return /*#__PURE__*/ _jsxs("div", { className: "flex items-start gap-1.5 text-xs", style: { color: 'var(--site-text-muted)' }, children: [ /*#__PURE__*/ _jsxs("svg", { className: "w-3.5 h-3.5 shrink-0 mt-0.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ _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" }), /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 11a3 3 0 11-6 0 3 3 0 016 0z" }) ] }), /*#__PURE__*/ _jsxs("span", { children: [ /*#__PURE__*/ _jsx("span", { className: "font-medium", style: { color: 'var(--site-text-secondary)' }, children: parent }), children.length > 0 && /*#__PURE__*/ _jsxs("span", { style: { color: 'var(--site-text-hint)' }, children: [ " — ", children.join(', ') ] }) ] }) ] }, parent); }) }), showServices && Array.isArray(card.skills) && card.skills.length > 0 && /*#__PURE__*/ _jsx("div", { className: "flex flex-wrap gap-1.5", children: card.skills.map((s)=>/*#__PURE__*/ _jsx("span", { className: "text-[11px] px-2.5 py-1 rounded-full bg-green-500/10 text-gray-400 border border-green-500/10", children: s }, s)) }), showPriceList && Array.isArray(priceLists[card.id]) && priceLists[card.id].length > 0 && /*#__PURE__*/ _jsxs("div", { className: "".concat(showServices ? 'mt-4 pt-4 border-t' : ''), style: { borderColor: 'var(--site-card-border)' }, children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs font-semibold uppercase tracking-wider mb-3", style: { color: 'var(--site-text-muted)' }, children: t('site.pricelist', 'Price list') }), /*#__PURE__*/ _jsx("div", { className: "space-y-3", children: priceLists[card.id].map((group)=>/*#__PURE__*/ _jsxs("div", { className: "rounded-xl p-4", style: { background: 'var(--site-surface)', border: '1px solid var(--site-card-border)' }, children: [ /*#__PURE__*/ _jsx("p", { className: "font-semibold mb-3", style: { color: 'var(--site-text)' }, children: group.title }), /*#__PURE__*/ _jsx("div", { className: "space-y-3", children: group.items.map((item)=>/*#__PURE__*/ _jsxs("div", { className: "flex items-start justify-between gap-4", children: [ /*#__PURE__*/ _jsxs("div", { className: "min-w-0", children: [ /*#__PURE__*/ _jsx("p", { className: "text-sm font-medium", style: { color: 'var(--site-text-secondary)' }, children: item.name }), item.description && /*#__PURE__*/ _jsx("p", { className: "text-xs mt-0.5", style: { color: 'var(--site-text-muted)' }, children: item.description }) ] }), (item.price || item.unit) && /*#__PURE__*/ _jsxs("div", { className: "shrink-0 text-sm font-semibold", style: { color: 'var(--site-text)' }, children: [ item.price ? "€".concat(item.price) : '', item.unit ? " ".concat(item.unit) : '' ] }) ] }, item.id)) }) ] }, group.id)) }) ] }) ] }, card.id); }) }) ] }), Array.isArray(profile.portfolio) && profile.portfolio.length > 0 && /*#__PURE__*/ _jsxs("section", { children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 mb-6", children: [ /*#__PURE__*/ _jsx("div", { className: "w-8 h-8 rounded-lg bg-purple-500/10 flex items-center justify-center", children: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-purple-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z" }) }) }), /*#__PURE__*/ _jsx("h2", { className: "text-xl font-bold", children: t('portfolio.title', 'Portfolio') }), /*#__PURE__*/ _jsxs("span", { className: "text-xs ml-auto", style: { color: 'var(--site-text-hint)' }, children: [ profile.portfolio.length, " ", t('site.photos', 'photos') ] }) ] }), /*#__PURE__*/ _jsx("div", { className: "grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 gap-3", children: profile.portfolio.map((item, idx)=>{ var _item_title; return /*#__PURE__*/ _jsxs("button", { onClick: ()=>item.imageUrl && setLightbox(idx), className: "group relative aspect-square rounded-xl overflow-hidden transition-all", style: { background: 'var(--site-surface)', border: '1px solid var(--site-card-border)' }, children: [ item.imageUrl && /*#__PURE__*/ _jsx("img", { src: item.imageUrl, alt: (_item_title = item.title) !== null && _item_title !== void 0 ? _item_title : '', className: "w-full h-full object-cover group-hover:scale-105 transition-transform duration-500" }), /*#__PURE__*/ _jsx("div", { className: "absolute inset-0 bg-gradient-to-t from-black/60 via-transparent to-transparent opacity-0 group-hover:opacity-100 transition-opacity flex items-end p-3", children: item.title && /*#__PURE__*/ _jsx("p", { className: "text-xs font-medium text-white truncate", children: item.title }) }), /*#__PURE__*/ _jsx("div", { className: "absolute top-2 right-2 w-7 h-7 rounded-full bg-black/40 backdrop-blur-md flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity", children: /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5 text-white/80", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0zM10 7v3m0 0v3m0-3h3m-3 0H7" }) }) }) ] }, item.id); }) }) ] }), Array.isArray(profile.reviews) && profile.reviews.length > 0 && /*#__PURE__*/ _jsxs("section", { children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 mb-6", children: [ /*#__PURE__*/ _jsx("div", { className: "w-8 h-8 rounded-lg bg-amber-500/10 flex items-center justify-center", children: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-amber-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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" }) }) }), /*#__PURE__*/ _jsx("h2", { className: "text-xl font-bold", children: t('profile.reviews') }), /*#__PURE__*/ _jsx("span", { className: "text-xs ml-auto", style: { color: 'var(--site-text-hint)' }, children: profile.reviewCount }) ] }), /*#__PURE__*/ _jsx("div", { className: "space-y-3", children: profile.reviews.slice(0, 6).map((review)=>{ var _review_authorFirstName, _review_authorName; const authorName = [ review.authorFirstName, review.authorLastName ].filter(Boolean).join(' ') || review.authorName || null; var _review_authorFirstName_, _ref; return /*#__PURE__*/ _jsxs("div", { className: "rounded-2xl p-5", style: { background: 'var(--site-card-bg)', border: '1px solid var(--site-card-border)' }, children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-start gap-3 mb-3", children: [ /*#__PURE__*/ _jsx("div", { className: "w-9 h-9 rounded-full flex items-center justify-center text-xs font-bold overflow-hidden shrink-0", style: { background: 'var(--site-surface)', color: 'var(--site-text-muted)' }, children: review.authorImage ? /*#__PURE__*/ _jsx("img", { src: review.authorImage, alt: "", className: "w-full h-full object-cover" }) : ((_ref = (_review_authorFirstName_ = (_review_authorFirstName = review.authorFirstName) === null || _review_authorFirstName === void 0 ? void 0 : _review_authorFirstName[0]) !== null && _review_authorFirstName_ !== void 0 ? _review_authorFirstName_ : (_review_authorName = review.authorName) === null || _review_authorName === void 0 ? void 0 : _review_authorName[0]) !== null && _ref !== void 0 ? _ref : '?').toUpperCase() }), /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between gap-2", children: [ /*#__PURE__*/ _jsx("p", { className: "text-sm font-medium", style: { color: 'var(--site-text-secondary)' }, children: authorName !== null && authorName !== void 0 ? authorName : t('common.anonymous', 'Anonymous') }), /*#__PURE__*/ _jsx("span", { className: "shrink-0 text-[11px]", style: { color: 'var(--site-text-hint)' }, children: new Date(review.createdAt).toLocaleDateString(dateLocale) }) ] }), /*#__PURE__*/ _jsx("div", { className: "flex gap-0.5 mt-0.5", children: Array.from({ length: 5 }).map((_, i)=>/*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5 ".concat(i < Math.round(review.rating) ? 'text-amber-400' : ''), style: i < Math.round(review.rating) ? {} : { color: 'var(--site-border)' }, fill: "currentColor", viewBox: "0 0 20 20", children: /*#__PURE__*/ _jsx("path", { d: "M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 00-1.175 0l-2.8 2.034c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 00.951-.69l1.07-3.292z" }) }, i)) }) ] }) ] }), review.comment && /*#__PURE__*/ _jsx("p", { className: "text-sm leading-relaxed pl-12", style: { color: 'var(--site-text-muted)' }, children: review.comment }) ] }, review.id); }) }) ] }), /*#__PURE__*/ _jsxs("section", { id: "contact", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 mb-6", children: [ /*#__PURE__*/ _jsx("div", { className: "w-8 h-8 rounded-lg bg-emerald-500/10 flex items-center justify-center", children: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-emerald-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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" }) }) }), /*#__PURE__*/ _jsx("h2", { className: "text-xl font-bold", children: t('site.contact_form', 'Contact') }) ] }), contactSent ? /*#__PURE__*/ _jsxs("div", { className: "bg-emerald-500/10 border border-emerald-500/20 rounded-2xl p-8 text-center", children: [ /*#__PURE__*/ _jsx("div", { className: "w-12 h-12 rounded-full bg-emerald-500/20 flex items-center justify-center mx-auto mb-3", children: /*#__PURE__*/ _jsx("svg", { className: "w-6 h-6 text-emerald-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" }) }) }), /*#__PURE__*/ _jsx("p", { className: "text-emerald-400 font-medium", children: t('site.contact_sent', 'Message sent!') }), /*#__PURE__*/ _jsx("p", { className: "text-sm mt-1", style: { color: 'var(--site-text-muted)' }, children: t('site.contact_sent_desc', 'The specialist will contact you shortly') }) ] }) : /*#__PURE__*/ _jsxs("form", { onSubmit: handleContactSubmit, className: "rounded-2xl p-6 space-y-4", style: { background: 'var(--site-card-bg)', border: '1px solid var(--site-card-border)' }, children: [ /*#__PURE__*/ _jsxs("div", { className: "grid gap-4 sm:grid-cols-2", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("label", { className: "text-xs uppercase tracking-wider mb-1.5 block", style: { color: 'var(--site-text-muted)' }, children: [ t('site.contact_name', 'Name'), " *" ] }), /*#__PURE__*/ _jsx("input", { type: "text", required: true, value: contactForm.name, onChange: (e)=>setContactForm((f)=>({ ...f, name: e.target.value })), className: "w-full rounded-xl px-4 py-3 text-sm focus:outline-none focus:border-green-500/50 transition", style: { background: 'var(--site-input-bg)', border: '1px solid var(--site-input-border)', color: 'var(--site-input-text)' }, placeholder: t('site.contact_name_ph', 'Your name') }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "text-xs uppercase tracking-wider mb-1.5 block", style: { color: 'var(--site-text-muted)' }, children: "Email" }), /*#__PURE__*/ _jsx("input", { type: "email", value: contactForm.email, onChange: (e)=>setContactForm((f)=>({ ...f, email: e.target.value })), className: "w-full rounded-xl px-4 py-3 text-sm focus:outline-none focus:border-green-500/50 transition", style: { background: 'var(--site-input-bg)', border: '1px solid var(--site-input-border)', color: 'var(--site-input-text)' }, placeholder: t('site.contact_email_ph', 'your@email.com') }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("label", { className: "text-xs uppercase tracking-wider mb-1.5 block", style: { color: 'var(--site-text-muted)' }, children: [ t('site.contact_message', 'Message'), " *" ] }), /*#__PURE__*/ _jsx("textarea", { required: true, rows: 4, value: contactForm.message, onChange: (e)=>setContactForm((f)=>({ ...f, message: e.target.value })), className: "w-full rounded-xl px-4 py-3 text-sm focus:outline-none focus:border-green-500/50 transition resize-none", style: { background: 'var(--site-input-bg)', border: '1px solid var(--site-input-border)', color: 'var(--site-input-text)' }, placeholder: t('site.contact_message_ph', 'Describe your task...') }) ] }), /*#__PURE__*/ _jsxs("button", { type: "submit", disabled: contactLoading, className: "inline-flex items-center gap-2 bg-green-600 hover:bg-green-500 text-white font-medium px-6 py-3 rounded-xl transition disabled:opacity-50", children: [ contactLoading ? /*#__PURE__*/ _jsx("div", { className: "w-4 h-4 rounded-full border-2 border-white/30 border-t-white animate-spin" }) : /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 19l9 2-9-18-9 18 9-2zm0 0v-8" }) }), t('site.contact_send', 'Send') ] }) ] }) ] }), /*#__PURE__*/ _jsx("footer", { className: "border-t pt-8 pb-4", style: { borderColor: 'var(--site-border)' }, children: /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between text-xs", style: { color: 'var(--site-footer-text)' }, children: [ /*#__PURE__*/ _jsx("a", { href: "/", className: "transition", children: "CanHelp.gr" }), /*#__PURE__*/ _jsxs("p", { children: [ "\xa9 ", new Date().getFullYear() ] }) ] }) }) ] }), /*#__PURE__*/ _jsx("button", { onClick: ()=>window.scrollTo({ top: 0, behavior: 'smooth' }), className: "fixed bottom-6 right-6 z-50 w-10 h-10 rounded-full flex items-center justify-center backdrop-blur-sm transition-all duration-300 ".concat(scrolled ? 'opacity-100 translate-y-0' : 'opacity-0 translate-y-4 pointer-events-none'), style: { background: 'var(--site-scroll-btn-bg)', border: '1px solid var(--site-scroll-btn-border)', color: 'var(--site-scroll-btn-text)' }, "aria-label": "Scroll to top", children: /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 15l7-7 7 7" }) }) }) ] }); } @$`=_’”ÌÎ24[]÷ù+-;V^ˆ³ŒÔÜ 5<ip¢©Û_âJQ…Œ6=kr¢©ÕÜ 6=dkž¥ÔÛ —_"M`Øàs~FN€ŒZep„¥¯×曥^d7!?!¥%š%\&`&Î&Ñ&j'_m'Y(](.)1)**.+1+X-[-..Â5Æ5p7t7`8c8w9z9§:ª:å;è;=„=±>Ž>Ø@Û@uB_xB¥CšCËDÎDÖFÙFHHóH÷H„J‡J|LLÄMÇMOOÇOÊOQ QðRóRbTeTäUèU‰VVñW_ôWY„YÒ[Ö[a!a®b±b†e‰eõfùf‚h…híjðj5l8lmƒmnnÖnÙnªo­o`qcq£s§s(t_+t.v1všx¬x`ycyCzFzü{ÿ{°}³}Ø~Û~œ€À€?ƒCƒöƒùƒí‡ñ‡ÐˆÓˆr‹v‹Ž‘zŽ}Žj_mù“ü“••Еӕi—m—V˜Z˜Â™Å™íšðškžožŸŸ`¡c¡$£'£žŠŒŠŸŠÆŠA§D§jš_mš§ª«ª•®˜®‹¯Ž¯¹±Œ±ñ²õ².ž1žÂ¹Å¹œœžœ¡œuŸxŸN¿Q¿ø¿ü¿®À²ÀiÁlÁšÂÂÅ_ÅóÆöƪȭÈôÉ÷ÉëËïËûÌþÌÍ͕ΙÎãÏæÏ•Ñ™ÑçÔêԄֈÖ\×`×iÙlÙTÛWÛDÞHÞá_áÿâã¥æšæŸç¢çè#èÚèÞèé…é`êcê—ëšëÕíØíDïGïJñNñññôñëòîòîôòô•õ˜õ’ö_•öÍøÑøtùwùsúvúëüïüýƒýþ"þ”—587: Ìйœ  Ò _Õ š  8 ; nq­°/3cfÔ× £‰ŒâæŸ!Â!!$$$+&.&|(€(*)_-)±+µ+@0C011õ2ù2¹4Œ4õ6ø6Ä7È71:4: <£<†=Š=Ø>Ü>#@&@WCZC;G?GjNnNËN_ÏNƒO†OLPOPìQïQTTUUŸWÁWìXðXU[X[(]+]a^d^œ_À_ð`ó`ÂbÅb¿eÃe f$fØf_Ûf g£g?iBi0l3l&m)mûnþn‚q†qHsLs/t2t€vƒvëyïyÝzáz||Í~Ð~íð_ƒbƒS†_V†ŠŠ“Œ—ŒӍ֍Ž Ž>A,’/’v“z“\”_”7•:•ؖۖp˜s˜ƒ™†™k›o›CGž_žž¡ž¡’¡G§K§Ô§×§ô©÷©¶¯º¯3°7°Û²Þ²"ž&ží¹ð¹ÁºĺiŒlŒÿŸ¿ó¿÷¿1Á4Á6ÂF:ºÜÜƟƜǟǀ€€€€€€€º(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useParams)Ã(0,_context_locale__WEBPACK_IMPORTED_MODULE_3__/* .useLocale */ .Y)¿(0,_lib_auth__WEBPACK_IMPORTED_MODULE_4__/* .useSession */ .wV)º(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)¯(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ°(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)ÿÈ(0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getPublicSiteProfile */ .S$)þÀ(0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getPriceList */ .Ck)ýÁ(0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getCategories */ .bW)À(0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getLocations */ .Vs)É(0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getOrCreateDirectRoom */ .QN)¿(0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .sendMessage */ ._z)Ä(0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .trackSiteMessage */ .UE)²(0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)»(0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Em)ö¶(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)·(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)þþÿþþþþþÿÿþþþþþþþþþþþþÿþþþþþþþþÿÿþþÿþþþÿþþþÿÿþþþÿþþÿþþþþþþÿþÿþÿþþþþÿþÿÿþþþÿÿþþÿ·react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.FragmentýýþýýýþýýþýýýþþýýýýýýþýÅ_components_PlanBadge__WEBPACK_IMPORTED_MODULE_6__/* .PlanBadge */ .dýüýüýýüüýüüüüýýýüüüüýüüýüüýüüýýüüüüüýþýýýüüüüüýüüüüüýýüüýüýüüýüüýüüýýüüýýýüüüüýüýüüüüüüýýüüüüüüýýüüýýüüüüüüýýüüüüýüüüüüýýýýüýüüýýüýüüüüýüýüüü€†buffer†source„size„maps„hashñ__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ PersonalSitePage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7541); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(9906); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(1592); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(2982); /* harmony import */ var _components_PlanBadge__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(2035); /* __next_internal_client_entry_do_not_use__ default auto */ function PersonalSitePage() { var _profile_portfolio, _profile_firstName, _profile_lastName, _profile_name_, _profile_name, _profile_siteSettings, _profile_siteSettings1, _profile_siteSettings2, _profile_portfolio1, _profile_portfolio2, _SITE_LOCALES_find; const { slug } = (0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useParams)(); const { t, locale, setLocale } = (0,_context_locale__WEBPACK_IMPORTED_MODULE_3__/* .useLocale */ .Y)(); const { data: session } = (0,_lib_auth__WEBPACK_IMPORTED_MODULE_4__/* .useSession */ .wV)(); const router = (0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)(); const [profile, setProfile] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [loading, setLoading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(true); const [notFound, setNotFound] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [msgLoading, setMsgLoading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [linkCopied, setLinkCopied] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [lightbox, setLightbox] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [contactSent, setContactSent] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [contactForm, setContactForm] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)({ name: '', email: '', message: '' }); const [contactLoading, setContactLoading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [langOpen, setLangOpen] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [msgModal, setMsgModal] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [authModal, setAuthModal] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [msgText, setMsgText] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [msgSent, setMsgSent] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [catMap, setCatMap] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)({}); const [locMap, setLocMap] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)({}); const [locParentMap, setLocParentMap] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)({}); const [priceLists, setPriceLists] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)({}); const [scrolled, setScrolled] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const dateLocale = locale === 'ru' ? 'ru-RU' : locale === 'uk' ? 'uk-UA' : locale === 'en' ? 'en-US' : 'el-GR'; (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ const onScroll = ()=>setScrolled(window.scrollY > 100); window.addEventListener('scroll', onScroll, { passive: true }); return ()=>window.removeEventListener('scroll', onScroll); }, []); const LANG_MAP = { el: { flag: '🇬🇷', label: 'ΕλληΜικά' }, en: { flag: '🇬🇧', label: 'English' }, ru: { flag: '🇷🇺', label: 'РусскОй' }, uk: { flag: '🇺🇊', label: 'УкраїМська' }, de: { flag: '🇩🇪', label: 'Deutsch' }, fr: { flag: '🇫🇷', label: 'Français' }, it: { flag: '🇮🇹', label: 'Italiano' }, es: { flag: '🇪🇞', label: 'Español' }, ar: { flag: '🇞🇊', label: 'العرؚية' }, zh: { flag: '🇚🇳', label: 'äž­æ–‡' } }; const SITE_LOCALES = [ { code: 'el', flag: '🇬🇷', label: 'ΕλληΜικά' }, { code: 'en', flag: '🇬🇧', label: 'English' }, { code: 'ru', flag: '🇷🇺', label: 'РусскОй' } ]; (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!slug) return; (0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getPublicSiteProfile */ .S$)(slug).then(setProfile).catch(()=>setNotFound(true)).finally(()=>setLoading(false)); }, [ slug ]); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ var _profile_siteSettings; const shouldShowPriceList = (profile === null || profile === void 0 ? void 0 : (_profile_siteSettings = profile.siteSettings) === null || _profile_siteSettings === void 0 ? void 0 : _profile_siteSettings.showPriceList) !== false; const cards = Array.isArray(profile === null || profile === void 0 ? void 0 : profile.cards) ? profile.cards : []; if (!profile || !shouldShowPriceList || cards.length === 0) { setPriceLists({}); return; } let cancelled = false; Promise.all(cards.map(async (card)=>[ card.id, await (0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getPriceList */ .Ck)(card.id, locale) ])).then((entries)=>{ if (cancelled) return; setPriceLists(Object.fromEntries(entries.filter((param)=>{ let [, groups] = param; return groups.length > 0; }))); }).catch(()=>{ if (!cancelled) setPriceLists({}); }); return ()=>{ cancelled = true; }; }, [ profile, locale ]); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ const catLocale = locale; (0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getCategories */ .bW)().then((cats)=>{ const m = {}; for (const c of cats){ var _c_names_catLocale; m[c.slug] = (_c_names_catLocale = c.names[catLocale]) !== null && _c_names_catLocale !== void 0 ? _c_names_catLocale : c.names.el; var _c_children; for (const sub of (_c_children = c.children) !== null && _c_children !== void 0 ? _c_children : []){ var _sub_names_catLocale; m[sub.slug] = (_sub_names_catLocale = sub.names[catLocale]) !== null && _sub_names_catLocale !== void 0 ? _sub_names_catLocale : sub.names.el; } } setCatMap(m); }).catch(()=>{}); (0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getLocations */ .Vs)().then((locs)=>{ const m = {}; const pm = {}; for (const loc of locs){ var _loc_names, _loc_names1; var _loc_names_catLocale, _ref; const parentName = (_ref = (_loc_names_catLocale = (_loc_names = loc.names) === null || _loc_names === void 0 ? void 0 : _loc_names[catLocale]) !== null && _loc_names_catLocale !== void 0 ? _loc_names_catLocale : (_loc_names1 = loc.names) === null || _loc_names1 === void 0 ? void 0 : _loc_names1.el) !== null && _ref !== void 0 ? _ref : loc.slug; m[loc.slug] = parentName; var _loc_children; for (const child of (_loc_children = loc.children) !== null && _loc_children !== void 0 ? _loc_children : []){ var _child_names, _child_names1; var _child_names_catLocale, _ref1; m[child.slug] = (_ref1 = (_child_names_catLocale = (_child_names = child.names) === null || _child_names === void 0 ? void 0 : _child_names[catLocale]) !== null && _child_names_catLocale !== void 0 ? _child_names_catLocale : (_child_names1 = child.names) === null || _child_names1 === void 0 ? void 0 : _child_names1.el) !== null && _ref1 !== void 0 ? _ref1 : child.slug; pm[child.slug] = parentName; } } setLocMap(m); setLocParentMap(pm); }).catch(()=>{}); }, [ locale ]); function handleMessage() { if (!session) { setAuthModal(true); return; } setMsgModal(true); } async function handleSendMessage(e) { e.preventDefault(); if (!msgText.trim()) return; setMsgLoading(true); try { const { room } = await (0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getOrCreateDirectRoom */ .QN)(profile.id); await (0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .sendMessage */ ._z)(room.id, msgText.trim()); (0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .trackSiteMessage */ .UE)(slug); setMsgSent(true); setMsgText(''); } catch (e) {} finally{ setMsgLoading(false); } } const handleContactSubmit = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)(async (e)=>{ e.preventDefault(); if (!contactForm.name.trim() || !contactForm.message.trim()) return; setContactLoading(true); try { await (0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Em)("/users/site/".concat(slug, "/contact"), { method: 'POST', body: JSON.stringify(contactForm) }); setContactSent(true); setContactForm({ name: '', email: '', message: '' }); } catch (e) {} finally{ setContactLoading(false); } }, [ contactForm, slug ]); // Lightbox keyboard nav (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (lightbox === null) return; const handler = (e)=>{ if (e.key === 'Escape') setLightbox(null); if (e.key === 'ArrowRight') setLightbox((i)=>{ var _profile_portfolio; var _profile_portfolio_length; return i !== null ? Math.min(i + 1, ((_profile_portfolio_length = profile === null || profile === void 0 ? void 0 : (_profile_portfolio = profile.portfolio) === null || _profile_portfolio === void 0 ? void 0 : _profile_portfolio.length) !== null && _profile_portfolio_length !== void 0 ? _profile_portfolio_length : 1) - 1) : null; }); if (e.key === 'ArrowLeft') setLightbox((i)=>i !== null ? Math.max(i - 1, 0) : null); }; document.addEventListener('keydown', handler); return ()=>document.removeEventListener('keydown', handler); }, [ lightbox, profile === null || profile === void 0 ? void 0 : (_profile_portfolio = profile.portfolio) === null || _profile_portfolio === void 0 ? void 0 : _profile_portfolio.length ]); if (loading) return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "min-h-screen flex items-center justify-center", style: { background: 'var(--site-bg)' }, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "relative w-12 h-12", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "absolute inset-0 rounded-full border-2 border-green-500/20" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "absolute inset-0 rounded-full border-2 border-transparent border-t-blue-500 animate-spin" }) ] }) }); if (notFound || !profile) return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "min-h-screen flex flex-col items-center justify-center gap-6", style: { background: 'var(--site-bg)' }, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "w-20 h-20 rounded-full flex items-center justify-center", style: { background: 'var(--site-surface)' }, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-10 h-10 text-gray-500", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15.182 16.318A4.486 4.486 0 0012.016 15a4.486 4.486 0 00-3.198 1.318M21 12a9 9 0 11-18 0 9 9 0 0118 0zM9.75 9.75c0 .414-.168.75-.375.75S9 10.164 9 9.75 9.168 9 9.375 9s.375.336.375.75zm-.375 0h.008v.015h-.008V9.75zm5.625 0c0 .414-.168.75-.375.75s-.375-.336-.375-.75.168-.75.375-.75.375.336.375.75zm-.375 0h.008v.015h-.008V9.75z" }) }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-gray-400 text-lg", children: t('common.not_found', 'Page not found') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("a", { href: "/", className: "text-gray-400 hover:text-gray-300 text-sm transition", children: t('nav.home', 'Home') }) ] }); var _profile_firstName_, _profile_lastName_; const initials = "".concat((_profile_firstName_ = (_profile_firstName = profile.firstName) === null || _profile_firstName === void 0 ? void 0 : _profile_firstName[0]) !== null && _profile_firstName_ !== void 0 ? _profile_firstName_ : '').concat((_profile_lastName_ = (_profile_lastName = profile.lastName) === null || _profile_lastName === void 0 ? void 0 : _profile_lastName[0]) !== null && _profile_lastName_ !== void 0 ? _profile_lastName_ : '').toUpperCase() || ((_profile_name = profile.name) === null || _profile_name === void 0 ? void 0 : (_profile_name_ = _profile_name[0]) === null || _profile_name_ === void 0 ? void 0 : _profile_name_.toUpperCase()) || '?'; const displayName = [ profile.firstName, profile.lastName ].filter(Boolean).join(' ') || profile.name || ''; const memberYear = profile.memberSince ? new Date(profile.memberSince).getFullYear() : null; const hasStats = profile.completedTasks > 0 || profile.rating || profile.reviewCount && profile.reviewCount > 0; const isLight = ((_profile_siteSettings = profile.siteSettings) === null || _profile_siteSettings === void 0 ? void 0 : _profile_siteSettings.siteTheme) === 'light'; const showServices = ((_profile_siteSettings1 = profile.siteSettings) === null || _profile_siteSettings1 === void 0 ? void 0 : _profile_siteSettings1.showServices) !== false; const showPriceList = ((_profile_siteSettings2 = profile.siteSettings) === null || _profile_siteSettings2 === void 0 ? void 0 : _profile_siteSettings2.showPriceList) !== false; const showCardsSection = showServices || showPriceList; var _profile_portfolio_length, _profile_portfolio_lightbox_title, _SITE_LOCALES_find_flag; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "site-theme min-h-screen selection:bg-green-500/30 ".concat(isLight ? 'site-light' : ''), style: { background: 'var(--site-bg)', color: 'var(--site-text)' }, children: [ lightbox !== null && ((_profile_portfolio1 = profile.portfolio) === null || _profile_portfolio1 === void 0 ? void 0 : _profile_portfolio1[lightbox]) && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "fixed inset-0 z-50 bg-black/90 backdrop-blur-xl flex items-center justify-center p-4", onClick: ()=>setLightbox(null), children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>setLightbox(null), className: "absolute top-6 right-6 w-10 h-10 rounded-full bg-white/10 hover:bg-white/20 flex items-center justify-center transition", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-5 h-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" }) }) }), lightbox > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: (e)=>{ e.stopPropagation(); setLightbox(lightbox - 1); }, className: "absolute left-4 top-1/2 -translate-y-1/2 w-10 h-10 rounded-full bg-white/10 hover:bg-white/20 flex items-center justify-center transition", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-5 h-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 19l-7-7 7-7" }) }) }), lightbox < ((_profile_portfolio_length = (_profile_portfolio2 = profile.portfolio) === null || _profile_portfolio2 === void 0 ? void 0 : _profile_portfolio2.length) !== null && _profile_portfolio_length !== void 0 ? _profile_portfolio_length : 1) - 1 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: (e)=>{ e.stopPropagation(); setLightbox(lightbox + 1); }, className: "absolute right-4 top-1/2 -translate-y-1/2 w-10 h-10 rounded-full bg-white/10 hover:bg-white/20 flex items-center justify-center transition", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-5 h-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 5l7 7-7 7" }) }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: profile.portfolio[lightbox].imageUrl, alt: (_profile_portfolio_lightbox_title = profile.portfolio[lightbox].title) !== null && _profile_portfolio_lightbox_title !== void 0 ? _profile_portfolio_lightbox_title : '', className: "max-w-full max-h-[85vh] rounded-2xl object-contain", onClick: (e)=>e.stopPropagation() }), profile.portfolio[lightbox].title && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "absolute bottom-6 left-1/2 -translate-x-1/2 bg-black/60 backdrop-blur-md px-5 py-2.5 rounded-full text-sm", children: profile.portfolio[lightbox].title }) ] }), authModal && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "fixed inset-0 z-50 bg-black/70 backdrop-blur-sm flex items-center justify-center p-4", onClick: ()=>setAuthModal(false), children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "relative w-full max-w-sm rounded-2xl shadow-2xl p-6", style: { background: 'var(--site-modal-bg)', border: '1px solid var(--site-border)' }, onClick: (e)=>e.stopPropagation(), children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>setAuthModal(false), className: "absolute top-4 right-4 w-8 h-8 rounded-full flex items-center justify-center transition", style: { background: 'var(--site-surface)', color: 'var(--site-text-muted)' }, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" }) }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "w-12 h-12 rounded-full bg-green-500/10 flex items-center justify-center mb-4", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-6 h-6 text-gray-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h3", { className: "text-base font-semibold mb-2", style: { color: 'var(--site-text)' }, children: t('site.auth_required_title', 'Authorization required') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm mb-5", style: { color: 'var(--site-text-muted)' }, children: t('site.auth_required_desc', 'To write in chat, sign in to your CanHelp account.') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex flex-col gap-2.5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("a", { href: "/login", className: "w-full flex items-center justify-center gap-2 bg-green-600 hover:bg-green-500 text-white font-medium text-sm px-4 py-2.5 rounded-xl transition", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M11 16l-4-4m0 0l4-4m-4 4h14m-5 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h7a3 3 0 013 3v1" }) }), t('site.auth_login_btn', 'Sign in') ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { type: "button", onClick: ()=>{ setAuthModal(false); setTimeout(()=>{ var _document_getElementById; (_document_getElementById = document.getElementById('contact')) === null || _document_getElementById === void 0 ? void 0 : _document_getElementById.scrollIntoView({ behavior: 'smooth', block: 'start' }); }, 100); }, className: "w-full flex items-center justify-center gap-2 text-sm font-medium px-4 py-2.5 rounded-xl transition", style: { background: 'var(--site-surface)', color: 'var(--site-text-secondary)', border: '1px solid var(--site-border)' }, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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" }) }), t('site.auth_contact_form_btn', 'Write via contact form') ] }) ] }) ] }) }), msgModal && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "fixed inset-0 z-50 bg-black/70 backdrop-blur-sm flex items-center justify-center p-4", onClick: ()=>{ if (!msgLoading) { setMsgModal(false); setMsgSent(false); } }, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "relative w-full max-w-md rounded-2xl shadow-2xl", style: { background: 'var(--site-modal-bg)', border: '1px solid var(--site-border)' }, onClick: (e)=>e.stopPropagation(), children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>{ setMsgModal(false); setMsgSent(false); }, className: "absolute top-4 right-4 w-8 h-8 rounded-full flex items-center justify-center transition", style: { background: 'var(--site-surface)', color: 'var(--site-text-muted)' }, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" }) }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "p-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-3 mb-5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "w-10 h-10 rounded-full bg-green-500/10 flex items-center justify-center", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-5 h-5 text-gray-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h3", { className: "text-base font-semibold", style: { color: 'var(--site-text)' }, children: t('site.write_to_chat', 'Write in chat') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs", style: { color: 'var(--site-text-muted)' }, children: displayName }) ] }) ] }), msgSent ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "text-center py-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "w-12 h-12 rounded-full bg-emerald-500/20 flex items-center justify-center mx-auto mb-3", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-6 h-6 text-emerald-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" }) }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-emerald-400 font-medium mb-1", children: t('site.message_sent', 'Message sent!') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm mb-4", style: { color: 'var(--site-text-muted)' }, children: t('site.message_sent_desc', 'The specialist will receive it in chat') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>{ setMsgModal(false); setMsgSent(false); }, className: "text-sm text-gray-400 hover:text-gray-300 transition", children: t('common.close', 'Close') }) ] }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("form", { onSubmit: handleSendMessage, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("textarea", { autoFocus: true, rows: 4, value: msgText, onChange: (e)=>setMsgText(e.target.value), className: "w-full rounded-xl px-4 py-3 text-sm focus:outline-none focus:border-green-500/50 transition resize-none mb-4", style: { background: 'var(--site-input-bg)', border: '1px solid var(--site-input-border)', color: 'var(--site-input-text)' }, placeholder: t('site.message_placeholder', 'Write your message...') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-end gap-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>setMsgModal(false), className: "text-sm transition px-4 py-2", style: { color: 'var(--site-text-muted)' }, children: t('common.cancel', 'Cancel') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { type: "submit", disabled: msgLoading || !msgText.trim(), className: "inline-flex items-center gap-2 bg-green-600 hover:bg-green-500 text-white font-medium text-sm px-5 py-2.5 rounded-xl transition disabled:opacity-50", children: [ msgLoading ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "w-4 h-4 rounded-full border-2 border-white/30 border-t-white animate-spin" }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 19l9 2-9-18-9 18 9-2zm0 0v-8" }) }), t('site.contact_send', 'Send') ] }) ] }) ] }) ] }) ] }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("nav", { className: "sticky top-0 z-40 backdrop-blur-xl", style: { background: 'var(--site-nav-bg)', borderBottom: '1px solid var(--site-border)' }, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "max-w-5xl mx-auto px-4 sm:px-6 h-14 flex items-center justify-between", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("a", { href: "/", className: "logo-text-mini tracking-tight".concat(scrolled ? ' scrolled' : ''), style: { color: 'var(--site-text-secondary)' }, children: "CanHelp" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-2", children: [ (profile === null || profile === void 0 ? void 0 : profile.rating) && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-1 text-xs mr-1", style: { color: 'var(--site-text-secondary)' }, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3.5 h-3.5 text-amber-400", fill: "currentColor", viewBox: "0 0 20 20", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 00-1.175 0l-2.8 2.034c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 00.951-.69l1.07-3.292z" }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "font-medium", children: Number(profile.rating).toFixed(1) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "relative", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { type: "button", onClick: ()=>setLangOpen(!langOpen), className: "flex items-center gap-1.5 text-xs transition px-2 py-1 rounded-lg", style: { color: 'var(--site-text-muted)' }, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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" }) }), (_SITE_LOCALES_find_flag = (_SITE_LOCALES_find = SITE_LOCALES.find((l)=>l.code === locale)) === null || _SITE_LOCALES_find === void 0 ? void 0 : _SITE_LOCALES_find.flag) !== null && _SITE_LOCALES_find_flag !== void 0 ? _SITE_LOCALES_find_flag : '🌐' ] }), langOpen && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "fixed inset-0 z-40", onClick: ()=>setLangOpen(false) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "absolute right-0 top-full mt-1 z-50 rounded-xl shadow-xl overflow-hidden min-w-[140px]", style: { background: 'var(--site-lang-dropdown)', border: '1px solid var(--site-border)' }, children: SITE_LOCALES.map((l)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { type: "button", onClick: ()=>{ setLocale(l.code); setLangOpen(false); }, className: "w-full flex items-center gap-2 px-3 py-2 text-xs transition ".concat(locale === l.code ? 'text-gray-400 bg-green-500/10' : ''), style: locale === l.code ? {} : { color: 'var(--site-text-secondary)' }, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { children: l.flag }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { children: l.label }) ] }, l.code)) }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "w-px h-4", style: { background: 'var(--site-divider)' } }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { type: "button", onClick: async ()=>{ const url = window.location.href; if (navigator.share) { try { await navigator.share({ title: displayName, url }); } catch (e) {} } else { navigator.clipboard.writeText(url); setLinkCopied(true); setTimeout(()=>setLinkCopied(false), 2000); } }, className: "flex items-center gap-1.5 text-xs transition", style: { color: 'var(--site-text-muted)' }, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8.684 13.342C8.886 12.938 9 12.482 9 12c0-.482-.114-.938-.316-1.342m0 2.684a3 3 0 110-2.684m0 2.684l6.632 3.316m-6.632-6l6.632-3.316m0 0a3 3 0 105.367-2.684 3 3 0 00-5.367 2.684zm0 9.316a3 3 0 105.368 2.684 3 3 0 00-5.368-2.684z" }) }), linkCopied ? t('profile.site.copied') : t('site.share', 'Share') ] }) ] }) ] }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("section", { className: "relative overflow-hidden", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "absolute top-0 left-1/4 w-[500px] h-[500px] bg-green-600/10 rounded-full blur-[120px] pointer-events-none" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "absolute top-20 right-1/4 w-[400px] h-[400px] bg-purple-600/8 rounded-full blur-[100px] pointer-events-none" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "relative max-w-5xl mx-auto px-4 sm:px-6 pt-16 pb-20 sm:pt-24 sm:pb-28", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex flex-col items-center text-center", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "relative group mb-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "absolute -inset-1 bg-gradient-to-br from-green-600 to-purple-500 rounded-full opacity-60 blur group-hover:opacity-80 transition-opacity" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "relative w-28 h-28 sm:w-32 sm:h-32 rounded-full overflow-hidden border-2 flex items-center justify-center text-4xl font-bold", style: { borderColor: 'var(--site-avatar-border)', background: 'var(--site-avatar-bg)', color: 'var(--site-text)' }, children: profile.image ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: profile.image, alt: displayName, className: "w-full h-full object-cover" }) : initials }), Array.isArray(profile.activeStatuses) && profile.activeStatuses.includes('canhelp_now') && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "absolute bottom-1 right-1 w-5 h-5 bg-emerald-500 rounded-full border-2 flex items-center justify-center", style: { borderColor: 'var(--site-status-border-color)' }, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "w-2 h-2 rounded-full bg-white animate-pulse" }) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h1", { className: "text-3xl sm:text-5xl font-bold tracking-tight bg-clip-text text-transparent mb-3 pb-1", style: { backgroundImage: 'linear-gradient(to bottom, var(--site-name-from), var(--site-name-to))' }, children: displayName }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-center gap-2 flex-wrap mb-4", children: [ profile.planTier && profile.planTier !== 'free' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components_PlanBadge__WEBPACK_IMPORTED_MODULE_6__/* .PlanBadge */ .d, { tier: profile.planTier, verified: profile.hasVerifiedBadge, size: "md" }), Array.isArray(profile.activeStatuses) && profile.activeStatuses.includes('canhelp_now') && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "inline-flex items-center gap-1.5 text-xs font-medium text-emerald-400 bg-emerald-500/10 border border-emerald-500/20 px-3 py-1.5 rounded-full", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "w-1.5 h-1.5 rounded-full bg-emerald-400 animate-pulse" }), t('status.can_help_now', 'Available now') ] }), memberYear && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "text-xs px-3 py-1.5 rounded-full", style: { color: 'var(--site-text-muted)', background: 'var(--site-surface)' }, children: [ t('site.member_since', 'Member since'), " ", memberYear ] }) ] }), profile.bio && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "max-w-xl text-base sm:text-lg leading-relaxed mb-8", style: { color: 'var(--site-text-secondary)' }, children: profile.bio }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-3 flex-wrap justify-center", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { onClick: handleMessage, disabled: msgLoading, className: "group inline-flex items-center gap-2.5 bg-green-600 hover:bg-green-500 text-white font-semibold px-7 py-3.5 rounded-full transition-all hover:shadow-lg hover:shadow-blue-500/25 disabled:opacity-50", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-5 h-5 group-hover:scale-110 transition-transform", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }), t('site.write_to_chat', 'Write in chat') ] }), profile.phone && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("a", { href: "tel:".concat(profile.phone), className: "group inline-flex items-center gap-2.5 border font-medium px-7 py-3.5 rounded-full transition-all", style: { background: 'var(--site-phone-bg)', borderColor: 'var(--site-phone-border)', color: 'var(--site-phone-text)' }, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-5 h-5 group-hover:scale-110 transition-transform", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M3 5a2 2 0 012-2h3.28a1 1 0 01.948.684l1.498 4.493a1 1 0 01-.502 1.21l-2.257 1.13a11.042 11.042 0 005.516 5.516l1.13-2.257a1 1 0 011.21-.502l4.493 1.498a1 1 0 01.684.949V19a2 2 0 01-2 2h-1C9.716 21 3 14.284 3 6V5z" }) }), profile.phone ] }) ] }) ] }) }) ] }), hasStats && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("section", { className: "border-y", style: { borderColor: 'var(--site-border)', background: 'var(--site-surface)' }, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "max-w-5xl mx-auto px-4 sm:px-6 py-8", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "grid grid-cols-2 sm:grid-cols-4 gap-6", children: [ profile.rating && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "text-center", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-center gap-1 mb-1", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-5 h-5 text-amber-400", fill: "currentColor", viewBox: "0 0 20 20", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 00-1.175 0l-2.8 2.034c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 00.951-.69l1.07-3.292z" }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-2xl font-bold", children: Number(profile.rating).toFixed(1) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs uppercase tracking-wider", style: { color: 'var(--site-text-muted)' }, children: t('site.rating', 'Rating') }) ] }), profile.reviewCount > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "text-center", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-2xl font-bold mb-1", children: profile.reviewCount }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs uppercase tracking-wider", style: { color: 'var(--site-text-muted)' }, children: t('profile.reviews') }) ] }), profile.completedTasks > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "text-center", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-2xl font-bold mb-1", children: profile.completedTasks }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs uppercase tracking-wider", style: { color: 'var(--site-text-muted)' }, children: t('site.completed_tasks', 'Completed') }) ] }), Array.isArray(profile.languages) && profile.languages.length > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "text-center", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-2xl font-bold mb-1", children: profile.languages.length }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs uppercase tracking-wider", style: { color: 'var(--site-text-muted)' }, children: t('site.languages', 'Languages') }) ] }) ] }) }) }), Array.isArray(profile.languages) && profile.languages.length > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("section", { className: "max-w-5xl mx-auto px-4 sm:px-6 pt-10", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-3 mb-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 shrink-0", style: { color: 'var(--site-text-muted)' }, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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" }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-sm", style: { color: 'var(--site-text-muted)' }, children: t('site.speaks_languages', 'Speaks languages') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex items-center gap-2 flex-wrap", children: profile.languages.map((lang)=>{ const info = LANG_MAP[lang]; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-xs px-3 py-1.5 rounded-full flex items-center gap-1.5", style: { color: 'var(--site-tag-text)', background: 'var(--site-tag-bg)', border: '1px solid var(--site-tag-border)' }, children: info ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [ info.flag, " ", info.label ] }) : lang }, lang); }) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "max-w-5xl mx-auto px-4 sm:px-6 pb-20 space-y-16 mt-10", children: [ showServices && Array.isArray(profile.cards) && profile.cards.length > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("section", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-3 mb-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "w-8 h-8 rounded-lg bg-green-500/10 flex items-center justify-center", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 text-gray-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M21 13.255A23.931 23.931 0 0112 15c-3.183 0-6.22-.62-9-1.745M16 6V4a2 2 0 00-2-2h-4a2 2 0 00-2 2v2m4 6h.01M5 20h14a2 2 0 002-2V8a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z" }) }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "text-xl font-bold", children: t('specialist.services', 'Services') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "grid gap-4 sm:grid-cols-2", children: profile.cards.map((card)=>{ // Group locations by parent const grouped = {}; if (Array.isArray(card.locations)) { for (const slug of card.locations){ const parent = locParentMap[slug]; if (parent) { if (!grouped[parent]) grouped[parent] = []; grouped[parent].push(locMap[slug] || slug); } else { const name = locMap[slug] || slug; if (!grouped[name]) grouped[name] = []; } } } return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "group relative rounded-2xl p-6 transition-all", style: { background: 'var(--site-card-bg)', border: '1px solid var(--site-card-border)' }, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h3", { className: "font-semibold mb-2", style: { color: 'var(--site-text)' }, children: card.title }), showServices && (()=>{ const desc = (locale === 'el' ? card.descriptionEl : locale === 'en' ? card.descriptionEn : locale === 'ru' ? card.descriptionRu : card.descriptionUk) || card.descriptionEl || card.descriptionEn || card.descriptionRu || card.descriptionUk || card.description; return desc ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm leading-relaxed mb-3", style: { color: 'var(--site-text-muted)' }, children: desc }) : null; })(), showServices && Array.isArray(card.categories) && card.categories.length > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex flex-wrap gap-1.5 mb-3", children: card.categories.map((slug)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-[11px] px-2.5 py-1 rounded-full bg-purple-500/10 text-purple-400 border border-purple-500/10", children: catMap[slug] || slug }, slug)) }), showServices && Object.keys(grouped).length > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "mb-3 space-y-1", children: Object.entries(grouped).map((param)=>{ let [parent, children] = param; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-start gap-1.5 text-xs", style: { color: 'var(--site-text-muted)' }, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-3.5 h-3.5 shrink-0 mt-0.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 11a3 3 0 11-6 0 3 3 0 016 0z" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "font-medium", style: { color: 'var(--site-text-secondary)' }, children: parent }), children.length > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { style: { color: 'var(--site-text-hint)' }, children: [ " — ", children.join(', ') ] }) ] }) ] }, parent); }) }), showServices && Array.isArray(card.skills) && card.skills.length > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex flex-wrap gap-1.5", children: card.skills.map((s)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-[11px] px-2.5 py-1 rounded-full bg-green-500/10 text-gray-400 border border-green-500/10", children: s }, s)) }), showPriceList && Array.isArray(priceLists[card.id]) && priceLists[card.id].length > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "".concat(showServices ? 'mt-4 pt-4 border-t' : ''), style: { borderColor: 'var(--site-card-border)' }, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs font-semibold uppercase tracking-wider mb-3", style: { color: 'var(--site-text-muted)' }, children: t('site.pricelist', 'Price list') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "space-y-3", children: priceLists[card.id].map((group)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "rounded-xl p-4", style: { background: 'var(--site-surface)', border: '1px solid var(--site-card-border)' }, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "font-semibold mb-3", style: { color: 'var(--site-text)' }, children: group.title }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "space-y-3", children: group.items.map((item)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-start justify-between gap-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "min-w-0", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm font-medium", style: { color: 'var(--site-text-secondary)' }, children: item.name }), item.description && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs mt-0.5", style: { color: 'var(--site-text-muted)' }, children: item.description }) ] }), (item.price || item.unit) && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "shrink-0 text-sm font-semibold", style: { color: 'var(--site-text)' }, children: [ item.price ? "€".concat(item.price) : '', item.unit ? " ".concat(item.unit) : '' ] }) ] }, item.id)) }) ] }, group.id)) }) ] }) ] }, card.id); }) }) ] }), Array.isArray(profile.portfolio) && profile.portfolio.length > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("section", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-3 mb-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "w-8 h-8 rounded-lg bg-purple-500/10 flex items-center justify-center", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 text-purple-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z" }) }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "text-xl font-bold", children: t('portfolio.title', 'Portfolio') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "text-xs ml-auto", style: { color: 'var(--site-text-hint)' }, children: [ profile.portfolio.length, " ", t('site.photos', 'photos') ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 gap-3", children: profile.portfolio.map((item, idx)=>{ var _item_title; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { onClick: ()=>item.imageUrl && setLightbox(idx), className: "group relative aspect-square rounded-xl overflow-hidden transition-all", style: { background: 'var(--site-surface)', border: '1px solid var(--site-card-border)' }, children: [ item.imageUrl && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: item.imageUrl, alt: (_item_title = item.title) !== null && _item_title !== void 0 ? _item_title : '', className: "w-full h-full object-cover group-hover:scale-105 transition-transform duration-500" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "absolute inset-0 bg-gradient-to-t from-black/60 via-transparent to-transparent opacity-0 group-hover:opacity-100 transition-opacity flex items-end p-3", children: item.title && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs font-medium text-white truncate", children: item.title }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "absolute top-2 right-2 w-7 h-7 rounded-full bg-black/40 backdrop-blur-md flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3.5 h-3.5 text-white/80", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0zM10 7v3m0 0v3m0-3h3m-3 0H7" }) }) }) ] }, item.id); }) }) ] }), Array.isArray(profile.reviews) && profile.reviews.length > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("section", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-3 mb-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "w-8 h-8 rounded-lg bg-amber-500/10 flex items-center justify-center", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 text-amber-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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" }) }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "text-xl font-bold", children: t('profile.reviews') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-xs ml-auto", style: { color: 'var(--site-text-hint)' }, children: profile.reviewCount }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "space-y-3", children: profile.reviews.slice(0, 6).map((review)=>{ var _review_authorFirstName, _review_authorName; const authorName = [ review.authorFirstName, review.authorLastName ].filter(Boolean).join(' ') || review.authorName || null; var _review_authorFirstName_, _ref; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "rounded-2xl p-5", style: { background: 'var(--site-card-bg)', border: '1px solid var(--site-card-border)' }, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-start gap-3 mb-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "w-9 h-9 rounded-full flex items-center justify-center text-xs font-bold overflow-hidden shrink-0", style: { background: 'var(--site-surface)', color: 'var(--site-text-muted)' }, children: review.authorImage ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: review.authorImage, alt: "", className: "w-full h-full object-cover" }) : ((_ref = (_review_authorFirstName_ = (_review_authorFirstName = review.authorFirstName) === null || _review_authorFirstName === void 0 ? void 0 : _review_authorFirstName[0]) !== null && _review_authorFirstName_ !== void 0 ? _review_authorFirstName_ : (_review_authorName = review.authorName) === null || _review_authorName === void 0 ? void 0 : _review_authorName[0]) !== null && _ref !== void 0 ? _ref : '?').toUpperCase() }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-between gap-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm font-medium", style: { color: 'var(--site-text-secondary)' }, children: authorName !== null && authorName !== void 0 ? authorName : t('common.anonymous', 'Anonymous') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "shrink-0 text-[11px]", style: { color: 'var(--site-text-hint)' }, children: new Date(review.createdAt).toLocaleDateString(dateLocale) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex gap-0.5 mt-0.5", children: Array.from({ length: 5 }).map((_, i)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3.5 h-3.5 ".concat(i < Math.round(review.rating) ? 'text-amber-400' : ''), style: i < Math.round(review.rating) ? {} : { color: 'var(--site-border)' }, fill: "currentColor", viewBox: "0 0 20 20", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 00-1.175 0l-2.8 2.034c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 00.951-.69l1.07-3.292z" }) }, i)) }) ] }) ] }), review.comment && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm leading-relaxed pl-12", style: { color: 'var(--site-text-muted)' }, children: review.comment }) ] }, review.id); }) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("section", { id: "contact", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-3 mb-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "w-8 h-8 rounded-lg bg-emerald-500/10 flex items-center justify-center", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 text-emerald-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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" }) }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "text-xl font-bold", children: t('site.contact_form', 'Contact') }) ] }), contactSent ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-emerald-500/10 border border-emerald-500/20 rounded-2xl p-8 text-center", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "w-12 h-12 rounded-full bg-emerald-500/20 flex items-center justify-center mx-auto mb-3", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-6 h-6 text-emerald-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" }) }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-emerald-400 font-medium", children: t('site.contact_sent', 'Message sent!') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm mt-1", style: { color: 'var(--site-text-muted)' }, children: t('site.contact_sent_desc', 'The specialist will contact you shortly') }) ] }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("form", { onSubmit: handleContactSubmit, className: "rounded-2xl p-6 space-y-4", style: { background: 'var(--site-card-bg)', border: '1px solid var(--site-card-border)' }, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "grid gap-4 sm:grid-cols-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "text-xs uppercase tracking-wider mb-1.5 block", style: { color: 'var(--site-text-muted)' }, children: [ t('site.contact_name', 'Name'), " *" ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "text", required: true, value: contactForm.name, onChange: (e)=>setContactForm((f)=>({ ...f, name: e.target.value })), className: "w-full rounded-xl px-4 py-3 text-sm focus:outline-none focus:border-green-500/50 transition", style: { background: 'var(--site-input-bg)', border: '1px solid var(--site-input-border)', color: 'var(--site-input-text)' }, placeholder: t('site.contact_name_ph', 'Your name') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "text-xs uppercase tracking-wider mb-1.5 block", style: { color: 'var(--site-text-muted)' }, children: "Email" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "email", value: contactForm.email, onChange: (e)=>setContactForm((f)=>({ ...f, email: e.target.value })), className: "w-full rounded-xl px-4 py-3 text-sm focus:outline-none focus:border-green-500/50 transition", style: { background: 'var(--site-input-bg)', border: '1px solid var(--site-input-border)', color: 'var(--site-input-text)' }, placeholder: t('site.contact_email_ph', 'your@email.com') }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "text-xs uppercase tracking-wider mb-1.5 block", style: { color: 'var(--site-text-muted)' }, children: [ t('site.contact_message', 'Message'), " *" ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("textarea", { required: true, rows: 4, value: contactForm.message, onChange: (e)=>setContactForm((f)=>({ ...f, message: e.target.value })), className: "w-full rounded-xl px-4 py-3 text-sm focus:outline-none focus:border-green-500/50 transition resize-none", style: { background: 'var(--site-input-bg)', border: '1px solid var(--site-input-border)', color: 'var(--site-input-text)' }, placeholder: t('site.contact_message_ph', 'Describe your task...') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { type: "submit", disabled: contactLoading, className: "inline-flex items-center gap-2 bg-green-600 hover:bg-green-500 text-white font-medium px-6 py-3 rounded-xl transition disabled:opacity-50", children: [ contactLoading ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "w-4 h-4 rounded-full border-2 border-white/30 border-t-white animate-spin" }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 19l9 2-9-18-9 18 9-2zm0 0v-8" }) }), t('site.contact_send', 'Send') ] }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("footer", { className: "border-t pt-8 pb-4", style: { borderColor: 'var(--site-border)' }, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-between text-xs", style: { color: 'var(--site-footer-text)' }, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("a", { href: "/", className: "transition", children: "CanHelp.gr" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { children: [ "\xa9 ", new Date().getFullYear() ] }) ] }) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>window.scrollTo({ top: 0, behavior: 'smooth' }), className: "fixed bottom-6 right-6 z-50 w-10 h-10 rounded-full flex items-center justify-center backdrop-blur-sm transition-all duration-300 ".concat(scrolled ? 'opacity-100 translate-y-0' : 'opacity-0 translate-y-4 pointer-events-none'), style: { background: 'var(--site-scroll-btn-bg)', border: '1px solid var(--site-scroll-btn-border)', color: 'var(--site-scroll-btn-text)' }, "aria-label": "Scroll to top", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-5 h-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 15l7-7 7 7" }) }) }) ] }); } €”{"finalSource":true}ƒmap‹bufferedMap ConcatSourceRawSourcev__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ PersonalSitePage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7541); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(9906); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(1592); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(2982); /* harmony import */ var _components_PlanBadge__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(2035); ReplaceSourceRawSourceóÈ/* __next_internal_client_entry_do_not_use__ default auto */ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime"; import { useEffect, useState, useCallback } from 'react'; import { useParams, useRouter } from 'next/navigation'; import { useLocale } from '@/context/locale'; import { useSession } from '@/lib/auth'; import { getPublicSiteProfile, getOrCreateDirectRoom, sendMessage, request, getCategories, getLocations, trackSiteMessage, getPriceList } from '@/lib/api'; import { PlanBadge } from '@/components/PlanBadge'; export default function PersonalSitePage() { var _profile_portfolio, _profile_firstName, _profile_lastName, _profile_name_, _profile_name, _profile_siteSettings, _profile_siteSettings1, _profile_siteSettings2, _profile_portfolio1, _profile_portfolio2, _SITE_LOCALES_find; const { slug } = useParams(); const { t, locale, setLocale } = useLocale(); const { data: session } = useSession(); const router = useRouter(); const [profile, setProfile] = useState(null); const [loading, setLoading] = useState(true); const [notFound, setNotFound] = useState(false); const [msgLoading, setMsgLoading] = useState(false); const [linkCopied, setLinkCopied] = useState(false); const [lightbox, setLightbox] = useState(null); const [contactSent, setContactSent] = useState(false); const [contactForm, setContactForm] = useState({ name: '', email: '', message: '' }); const [contactLoading, setContactLoading] = useState(false); const [langOpen, setLangOpen] = useState(false); const [msgModal, setMsgModal] = useState(false); const [authModal, setAuthModal] = useState(false); const [msgText, setMsgText] = useState(''); const [msgSent, setMsgSent] = useState(false); const [catMap, setCatMap] = useState({}); const [locMap, setLocMap] = useState({}); const [locParentMap, setLocParentMap] = useState({}); const [priceLists, setPriceLists] = useState({}); const [scrolled, setScrolled] = useState(false); const dateLocale = locale === 'ru' ? 'ru-RU' : locale === 'uk' ? 'uk-UA' : locale === 'en' ? 'en-US' : 'el-GR'; useEffect(()=>{ const onScroll = ()=>setScrolled(window.scrollY > 100); window.addEventListener('scroll', onScroll, { passive: true }); return ()=>window.removeEventListener('scroll', onScroll); }, []); const LANG_MAP = { el: { flag: '🇬🇷', label: 'ΕλληΜικά' }, en: { flag: '🇬🇧', label: 'English' }, ru: { flag: '🇷🇺', label: 'РусскОй' }, uk: { flag: '🇺🇊', label: 'УкраїМська' }, de: { flag: '🇩🇪', label: 'Deutsch' }, fr: { flag: '🇫🇷', label: 'Français' }, it: { flag: '🇮🇹', label: 'Italiano' }, es: { flag: '🇪🇞', label: 'Español' }, ar: { flag: '🇞🇊', label: 'العرؚية' }, zh: { flag: '🇚🇳', label: 'äž­æ–‡' } }; const SITE_LOCALES = [ { code: 'el', flag: '🇬🇷', label: 'ΕλληΜικά' }, { code: 'en', flag: '🇬🇧', label: 'English' }, { code: 'ru', flag: '🇷🇺', label: 'РусскОй' } ]; useEffect(()=>{ if (!slug) return; getPublicSiteProfile(slug).then(setProfile).catch(()=>setNotFound(true)).finally(()=>setLoading(false)); }, [ slug ]); useEffect(()=>{ var _profile_siteSettings; const shouldShowPriceList = (profile === null || profile === void 0 ? void 0 : (_profile_siteSettings = profile.siteSettings) === null || _profile_siteSettings === void 0 ? void 0 : _profile_siteSettings.showPriceList) !== false; const cards = Array.isArray(profile === null || profile === void 0 ? void 0 : profile.cards) ? profile.cards : []; if (!profile || !shouldShowPriceList || cards.length === 0) { setPriceLists({}); return; } let cancelled = false; Promise.all(cards.map(async (card)=>[ card.id, await getPriceList(card.id, locale) ])).then((entries)=>{ if (cancelled) return; setPriceLists(Object.fromEntries(entries.filter((param)=>{ let [, groups] = param; return groups.length > 0; }))); }).catch(()=>{ if (!cancelled) setPriceLists({}); }); return ()=>{ cancelled = true; }; }, [ profile, locale ]); useEffect(()=>{ const catLocale = locale; getCategories().then((cats)=>{ const m = {}; for (const c of cats){ var _c_names_catLocale; m[c.slug] = (_c_names_catLocale = c.names[catLocale]) !== null && _c_names_catLocale !== void 0 ? _c_names_catLocale : c.names.el; var _c_children; for (const sub of (_c_children = c.children) !== null && _c_children !== void 0 ? _c_children : []){ var _sub_names_catLocale; m[sub.slug] = (_sub_names_catLocale = sub.names[catLocale]) !== null && _sub_names_catLocale !== void 0 ? _sub_names_catLocale : sub.names.el; } } setCatMap(m); }).catch(()=>{}); getLocations().then((locs)=>{ const m = {}; const pm = {}; for (const loc of locs){ var _loc_names, _loc_names1; var _loc_names_catLocale, _ref; const parentName = (_ref = (_loc_names_catLocale = (_loc_names = loc.names) === null || _loc_names === void 0 ? void 0 : _loc_names[catLocale]) !== null && _loc_names_catLocale !== void 0 ? _loc_names_catLocale : (_loc_names1 = loc.names) === null || _loc_names1 === void 0 ? void 0 : _loc_names1.el) !== null && _ref !== void 0 ? _ref : loc.slug; m[loc.slug] = parentName; var _loc_children; for (const child of (_loc_children = loc.children) !== null && _loc_children !== void 0 ? _loc_children : []){ var _child_names, _child_names1; var _child_names_catLocale, _ref1; m[child.slug] = (_ref1 = (_child_names_catLocale = (_child_names = child.names) === null || _child_names === void 0 ? void 0 : _child_names[catLocale]) !== null && _child_names_catLocale !== void 0 ? _child_names_catLocale : (_child_names1 = child.names) === null || _child_names1 === void 0 ? void 0 : _child_names1.el) !== null && _ref1 !== void 0 ? _ref1 : child.slug; pm[child.slug] = parentName; } } setLocMap(m); setLocParentMap(pm); }).catch(()=>{}); }, [ locale ]); function handleMessage() { if (!session) { setAuthModal(true); return; } setMsgModal(true); } async function handleSendMessage(e) { e.preventDefault(); if (!msgText.trim()) return; setMsgLoading(true); try { const { room } = await getOrCreateDirectRoom(profile.id); await sendMessage(room.id, msgText.trim()); trackSiteMessage(slug); setMsgSent(true); setMsgText(''); } catch (e) {} finally{ setMsgLoading(false); } } const handleContactSubmit = useCallback(async (e)=>{ e.preventDefault(); if (!contactForm.name.trim() || !contactForm.message.trim()) return; setContactLoading(true); try { await request("/users/site/".concat(slug, "/contact"), { method: 'POST', body: JSON.stringify(contactForm) }); setContactSent(true); setContactForm({ name: '', email: '', message: '' }); } catch (e) {} finally{ setContactLoading(false); } }, [ contactForm, slug ]); // Lightbox keyboard nav useEffect(()=>{ if (lightbox === null) return; const handler = (e)=>{ if (e.key === 'Escape') setLightbox(null); if (e.key === 'ArrowRight') setLightbox((i)=>{ var _profile_portfolio; var _profile_portfolio_length; return i !== null ? Math.min(i + 1, ((_profile_portfolio_length = profile === null || profile === void 0 ? void 0 : (_profile_portfolio = profile.portfolio) === null || _profile_portfolio === void 0 ? void 0 : _profile_portfolio.length) !== null && _profile_portfolio_length !== void 0 ? _profile_portfolio_length : 1) - 1) : null; }); if (e.key === 'ArrowLeft') setLightbox((i)=>i !== null ? Math.max(i - 1, 0) : null); }; document.addEventListener('keydown', handler); return ()=>document.removeEventListener('keydown', handler); }, [ lightbox, profile === null || profile === void 0 ? void 0 : (_profile_portfolio = profile.portfolio) === null || _profile_portfolio === void 0 ? void 0 : _profile_portfolio.length ]); if (loading) return /*#__PURE__*/ _jsx("div", { className: "min-h-screen flex items-center justify-center", style: { background: 'var(--site-bg)' }, children: /*#__PURE__*/ _jsxs("div", { className: "relative w-12 h-12", children: [ /*#__PURE__*/ _jsx("div", { className: "absolute inset-0 rounded-full border-2 border-green-500/20" }), /*#__PURE__*/ _jsx("div", { className: "absolute inset-0 rounded-full border-2 border-transparent border-t-blue-500 animate-spin" }) ] }) }); if (notFound || !profile) return /*#__PURE__*/ _jsxs("div", { className: "min-h-screen flex flex-col items-center justify-center gap-6", style: { background: 'var(--site-bg)' }, children: [ /*#__PURE__*/ _jsx("div", { className: "w-20 h-20 rounded-full flex items-center justify-center", style: { background: 'var(--site-surface)' }, children: /*#__PURE__*/ _jsx("svg", { className: "w-10 h-10 text-gray-500", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15.182 16.318A4.486 4.486 0 0012.016 15a4.486 4.486 0 00-3.198 1.318M21 12a9 9 0 11-18 0 9 9 0 0118 0zM9.75 9.75c0 .414-.168.75-.375.75S9 10.164 9 9.75 9.168 9 9.375 9s.375.336.375.75zm-.375 0h.008v.015h-.008V9.75zm5.625 0c0 .414-.168.75-.375.75s-.375-.336-.375-.75.168-.75.375-.75.375.336.375.75zm-.375 0h.008v.015h-.008V9.75z" }) }) }), /*#__PURE__*/ _jsx("p", { className: "text-gray-400 text-lg", children: t('common.not_found', 'Page not found') }), /*#__PURE__*/ _jsx("a", { href: "/", className: "text-gray-400 hover:text-gray-300 text-sm transition", children: t('nav.home', 'Home') }) ] }); var _profile_firstName_, _profile_lastName_; const initials = "".concat((_profile_firstName_ = (_profile_firstName = profile.firstName) === null || _profile_firstName === void 0 ? void 0 : _profile_firstName[0]) !== null && _profile_firstName_ !== void 0 ? _profile_firstName_ : '').concat((_profile_lastName_ = (_profile_lastName = profile.lastName) === null || _profile_lastName === void 0 ? void 0 : _profile_lastName[0]) !== null && _profile_lastName_ !== void 0 ? _profile_lastName_ : '').toUpperCase() || ((_profile_name = profile.name) === null || _profile_name === void 0 ? void 0 : (_profile_name_ = _profile_name[0]) === null || _profile_name_ === void 0 ? void 0 : _profile_name_.toUpperCase()) || '?'; const displayName = [ profile.firstName, profile.lastName ].filter(Boolean).join(' ') || profile.name || ''; const memberYear = profile.memberSince ? new Date(profile.memberSince).getFullYear() : null; const hasStats = profile.completedTasks > 0 || profile.rating || profile.reviewCount && profile.reviewCount > 0; const isLight = ((_profile_siteSettings = profile.siteSettings) === null || _profile_siteSettings === void 0 ? void 0 : _profile_siteSettings.siteTheme) === 'light'; const showServices = ((_profile_siteSettings1 = profile.siteSettings) === null || _profile_siteSettings1 === void 0 ? void 0 : _profile_siteSettings1.showServices) !== false; const showPriceList = ((_profile_siteSettings2 = profile.siteSettings) === null || _profile_siteSettings2 === void 0 ? void 0 : _profile_siteSettings2.showPriceList) !== false; const showCardsSection = showServices || showPriceList; var _profile_portfolio_length, _profile_portfolio_lightbox_title, _SITE_LOCALES_find_flag; return /*#__PURE__*/ _jsxs("div", { className: "site-theme min-h-screen selection:bg-green-500/30 ".concat(isLight ? 'site-light' : ''), style: { background: 'var(--site-bg)', color: 'var(--site-text)' }, children: [ lightbox !== null && ((_profile_portfolio1 = profile.portfolio) === null || _profile_portfolio1 === void 0 ? void 0 : _profile_portfolio1[lightbox]) && /*#__PURE__*/ _jsxs("div", { className: "fixed inset-0 z-50 bg-black/90 backdrop-blur-xl flex items-center justify-center p-4", onClick: ()=>setLightbox(null), children: [ /*#__PURE__*/ _jsx("button", { onClick: ()=>setLightbox(null), className: "absolute top-6 right-6 w-10 h-10 rounded-full bg-white/10 hover:bg-white/20 flex items-center justify-center transition", children: /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" }) }) }), lightbox > 0 && /*#__PURE__*/ _jsx("button", { onClick: (e)=>{ e.stopPropagation(); setLightbox(lightbox - 1); }, className: "absolute left-4 top-1/2 -translate-y-1/2 w-10 h-10 rounded-full bg-white/10 hover:bg-white/20 flex items-center justify-center transition", children: /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 19l-7-7 7-7" }) }) }), lightbox < ((_profile_portfolio_length = (_profile_portfolio2 = profile.portfolio) === null || _profile_portfolio2 === void 0 ? void 0 : _profile_portfolio2.length) !== null && _profile_portfolio_length !== void 0 ? _profile_portfolio_length : 1) - 1 && /*#__PURE__*/ _jsx("button", { onClick: (e)=>{ e.stopPropagation(); setLightbox(lightbox + 1); }, className: "absolute right-4 top-1/2 -translate-y-1/2 w-10 h-10 rounded-full bg-white/10 hover:bg-white/20 flex items-center justify-center transition", children: /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 5l7 7-7 7" }) }) }), /*#__PURE__*/ _jsx("img", { src: profile.portfolio[lightbox].imageUrl, alt: (_profile_portfolio_lightbox_title = profile.portfolio[lightbox].title) !== null && _profile_portfolio_lightbox_title !== void 0 ? _profile_portfolio_lightbox_title : '', className: "max-w-full max-h-[85vh] rounded-2xl object-contain", onClick: (e)=>e.stopPropagation() }), profile.portfolio[lightbox].title && /*#__PURE__*/ _jsx("div", { className: "absolute bottom-6 left-1/2 -translate-x-1/2 bg-black/60 backdrop-blur-md px-5 py-2.5 rounded-full text-sm", children: profile.portfolio[lightbox].title }) ] }), authModal && /*#__PURE__*/ _jsx("div", { className: "fixed inset-0 z-50 bg-black/70 backdrop-blur-sm flex items-center justify-center p-4", onClick: ()=>setAuthModal(false), children: /*#__PURE__*/ _jsxs("div", { className: "relative w-full max-w-sm rounded-2xl shadow-2xl p-6", style: { background: 'var(--site-modal-bg)', border: '1px solid var(--site-border)' }, onClick: (e)=>e.stopPropagation(), children: [ /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setAuthModal(false), className: "absolute top-4 right-4 w-8 h-8 rounded-full flex items-center justify-center transition", style: { background: 'var(--site-surface)', color: 'var(--site-text-muted)' }, children: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" }) }) }), /*#__PURE__*/ _jsx("div", { className: "w-12 h-12 rounded-full bg-green-500/10 flex items-center justify-center mb-4", children: /*#__PURE__*/ _jsx("svg", { className: "w-6 h-6 text-gray-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }) }), /*#__PURE__*/ _jsx("h3", { className: "text-base font-semibold mb-2", style: { color: 'var(--site-text)' }, children: t('site.auth_required_title', 'Authorization required') }), /*#__PURE__*/ _jsx("p", { className: "text-sm mb-5", style: { color: 'var(--site-text-muted)' }, children: t('site.auth_required_desc', 'To write in chat, sign in to your CanHelp account.') }), /*#__PURE__*/ _jsxs("div", { className: "flex flex-col gap-2.5", children: [ /*#__PURE__*/ _jsxs("a", { href: "/login", className: "w-full flex items-center justify-center gap-2 bg-green-600 hover:bg-green-500 text-white font-medium text-sm px-4 py-2.5 rounded-xl transition", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M11 16l-4-4m0 0l4-4m-4 4h14m-5 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h7a3 3 0 013 3v1" }) }), t('site.auth_login_btn', 'Sign in') ] }), /*#__PURE__*/ _jsxs("button", { type: "button", onClick: ()=>{ setAuthModal(false); setTimeout(()=>{ var _document_getElementById; (_document_getElementById = document.getElementById('contact')) === null || _document_getElementById === void 0 ? void 0 : _document_getElementById.scrollIntoView({ behavior: 'smooth', block: 'start' }); }, 100); }, className: "w-full flex items-center justify-center gap-2 text-sm font-medium px-4 py-2.5 rounded-xl transition", style: { background: 'var(--site-surface)', color: 'var(--site-text-secondary)', border: '1px solid var(--site-border)' }, children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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" }) }), t('site.auth_contact_form_btn', 'Write via contact form') ] }) ] }) ] }) }), msgModal && /*#__PURE__*/ _jsx("div", { className: "fixed inset-0 z-50 bg-black/70 backdrop-blur-sm flex items-center justify-center p-4", onClick: ()=>{ if (!msgLoading) { setMsgModal(false); setMsgSent(false); } }, children: /*#__PURE__*/ _jsxs("div", { className: "relative w-full max-w-md rounded-2xl shadow-2xl", style: { background: 'var(--site-modal-bg)', border: '1px solid var(--site-border)' }, onClick: (e)=>e.stopPropagation(), children: [ /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>{ setMsgModal(false); setMsgSent(false); }, className: "absolute top-4 right-4 w-8 h-8 rounded-full flex items-center justify-center transition", style: { background: 'var(--site-surface)', color: 'var(--site-text-muted)' }, children: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" }) }) }), /*#__PURE__*/ _jsxs("div", { className: "p-6", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 mb-5", children: [ /*#__PURE__*/ _jsx("div", { className: "w-10 h-10 rounded-full bg-green-500/10 flex items-center justify-center", children: /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5 text-gray-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }) }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("h3", { className: "text-base font-semibold", style: { color: 'var(--site-text)' }, children: t('site.write_to_chat', 'Write in chat') }), /*#__PURE__*/ _jsx("p", { className: "text-xs", style: { color: 'var(--site-text-muted)' }, children: displayName }) ] }) ] }), msgSent ? /*#__PURE__*/ _jsxs("div", { className: "text-center py-6", children: [ /*#__PURE__*/ _jsx("div", { className: "w-12 h-12 rounded-full bg-emerald-500/20 flex items-center justify-center mx-auto mb-3", children: /*#__PURE__*/ _jsx("svg", { className: "w-6 h-6 text-emerald-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" }) }) }), /*#__PURE__*/ _jsx("p", { className: "text-emerald-400 font-medium mb-1", children: t('site.message_sent', 'Message sent!') }), /*#__PURE__*/ _jsx("p", { className: "text-sm mb-4", style: { color: 'var(--site-text-muted)' }, children: t('site.message_sent_desc', 'The specialist will receive it in chat') }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>{ setMsgModal(false); setMsgSent(false); }, className: "text-sm text-gray-400 hover:text-gray-300 transition", children: t('common.close', 'Close') }) ] }) : /*#__PURE__*/ _jsxs("form", { onSubmit: handleSendMessage, children: [ /*#__PURE__*/ _jsx("textarea", { autoFocus: true, rows: 4, value: msgText, onChange: (e)=>setMsgText(e.target.value), className: "w-full rounded-xl px-4 py-3 text-sm focus:outline-none focus:border-green-500/50 transition resize-none mb-4", style: { background: 'var(--site-input-bg)', border: '1px solid var(--site-input-border)', color: 'var(--site-input-text)' }, placeholder: t('site.message_placeholder', 'Write your message...') }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-end gap-3", children: [ /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setMsgModal(false), className: "text-sm transition px-4 py-2", style: { color: 'var(--site-text-muted)' }, children: t('common.cancel', 'Cancel') }), /*#__PURE__*/ _jsxs("button", { type: "submit", disabled: msgLoading || !msgText.trim(), className: "inline-flex items-center gap-2 bg-green-600 hover:bg-green-500 text-white font-medium text-sm px-5 py-2.5 rounded-xl transition disabled:opacity-50", children: [ msgLoading ? /*#__PURE__*/ _jsx("div", { className: "w-4 h-4 rounded-full border-2 border-white/30 border-t-white animate-spin" }) : /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 19l9 2-9-18-9 18 9-2zm0 0v-8" }) }), t('site.contact_send', 'Send') ] }) ] }) ] }) ] }) ] }) }), /*#__PURE__*/ _jsx("nav", { className: "sticky top-0 z-40 backdrop-blur-xl", style: { background: 'var(--site-nav-bg)', borderBottom: '1px solid var(--site-border)' }, children: /*#__PURE__*/ _jsxs("div", { className: "max-w-5xl mx-auto px-4 sm:px-6 h-14 flex items-center justify-between", children: [ /*#__PURE__*/ _jsx("a", { href: "/", className: "logo-text-mini tracking-tight".concat(scrolled ? ' scrolled' : ''), style: { color: 'var(--site-text-secondary)' }, children: "CanHelp" }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2", children: [ (profile === null || profile === void 0 ? void 0 : profile.rating) && /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-1 text-xs mr-1", style: { color: 'var(--site-text-secondary)' }, children: [ /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5 text-amber-400", fill: "currentColor", viewBox: "0 0 20 20", children: /*#__PURE__*/ _jsx("path", { d: "M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 00-1.175 0l-2.8 2.034c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 00.951-.69l1.07-3.292z" }) }), /*#__PURE__*/ _jsx("span", { className: "font-medium", children: Number(profile.rating).toFixed(1) }) ] }), /*#__PURE__*/ _jsxs("div", { className: "relative", children: [ /*#__PURE__*/ _jsxs("button", { type: "button", onClick: ()=>setLangOpen(!langOpen), className: "flex items-center gap-1.5 text-xs transition px-2 py-1 rounded-lg", style: { color: 'var(--site-text-muted)' }, children: [ /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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" }) }), (_SITE_LOCALES_find_flag = (_SITE_LOCALES_find = SITE_LOCALES.find((l)=>l.code === locale)) === null || _SITE_LOCALES_find === void 0 ? void 0 : _SITE_LOCALES_find.flag) !== null && _SITE_LOCALES_find_flag !== void 0 ? _SITE_LOCALES_find_flag : '🌐' ] }), langOpen && /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx("div", { className: "fixed inset-0 z-40", onClick: ()=>setLangOpen(false) }), /*#__PURE__*/ _jsx("div", { className: "absolute right-0 top-full mt-1 z-50 rounded-xl shadow-xl overflow-hidden min-w-[140px]", style: { background: 'var(--site-lang-dropdown)', border: '1px solid var(--site-border)' }, children: SITE_LOCALES.map((l)=>/*#__PURE__*/ _jsxs("button", { type: "button", onClick: ()=>{ setLocale(l.code); setLangOpen(false); }, className: "w-full flex items-center gap-2 px-3 py-2 text-xs transition ".concat(locale === l.code ? 'text-gray-400 bg-green-500/10' : ''), style: locale === l.code ? {} : { color: 'var(--site-text-secondary)' }, children: [ /*#__PURE__*/ _jsx("span", { children: l.flag }), /*#__PURE__*/ _jsx("span", { children: l.label }) ] }, l.code)) }) ] }) ] }), /*#__PURE__*/ _jsx("div", { className: "w-px h-4", style: { background: 'var(--site-divider)' } }), /*#__PURE__*/ _jsxs("button", { type: "button", onClick: async ()=>{ const url = window.location.href; if (navigator.share) { try { await navigator.share({ title: displayName, url }); } catch (e) {} } else { navigator.clipboard.writeText(url); setLinkCopied(true); setTimeout(()=>setLinkCopied(false), 2000); } }, className: "flex items-center gap-1.5 text-xs transition", style: { color: 'var(--site-text-muted)' }, children: [ /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8.684 13.342C8.886 12.938 9 12.482 9 12c0-.482-.114-.938-.316-1.342m0 2.684a3 3 0 110-2.684m0 2.684l6.632 3.316m-6.632-6l6.632-3.316m0 0a3 3 0 105.367-2.684 3 3 0 00-5.367 2.684zm0 9.316a3 3 0 105.368 2.684 3 3 0 00-5.368-2.684z" }) }), linkCopied ? t('profile.site.copied') : t('site.share', 'Share') ] }) ] }) ] }) }), /*#__PURE__*/ _jsxs("section", { className: "relative overflow-hidden", children: [ /*#__PURE__*/ _jsx("div", { className: "absolute top-0 left-1/4 w-[500px] h-[500px] bg-green-600/10 rounded-full blur-[120px] pointer-events-none" }), /*#__PURE__*/ _jsx("div", { className: "absolute top-20 right-1/4 w-[400px] h-[400px] bg-purple-600/8 rounded-full blur-[100px] pointer-events-none" }), /*#__PURE__*/ _jsx("div", { className: "relative max-w-5xl mx-auto px-4 sm:px-6 pt-16 pb-20 sm:pt-24 sm:pb-28", children: /*#__PURE__*/ _jsxs("div", { className: "flex flex-col items-center text-center", children: [ /*#__PURE__*/ _jsxs("div", { className: "relative group mb-6", children: [ /*#__PURE__*/ _jsx("div", { className: "absolute -inset-1 bg-gradient-to-br from-green-600 to-purple-500 rounded-full opacity-60 blur group-hover:opacity-80 transition-opacity" }), /*#__PURE__*/ _jsx("div", { className: "relative w-28 h-28 sm:w-32 sm:h-32 rounded-full overflow-hidden border-2 flex items-center justify-center text-4xl font-bold", style: { borderColor: 'var(--site-avatar-border)', background: 'var(--site-avatar-bg)', color: 'var(--site-text)' }, children: profile.image ? /*#__PURE__*/ _jsx("img", { src: profile.image, alt: displayName, className: "w-full h-full object-cover" }) : initials }), Array.isArray(profile.activeStatuses) && profile.activeStatuses.includes('canhelp_now') && /*#__PURE__*/ _jsx("div", { className: "absolute bottom-1 right-1 w-5 h-5 bg-emerald-500 rounded-full border-2 flex items-center justify-center", style: { borderColor: 'var(--site-status-border-color)' }, children: /*#__PURE__*/ _jsx("span", { className: "w-2 h-2 rounded-full bg-white animate-pulse" }) }) ] }), /*#__PURE__*/ _jsx("h1", { className: "text-3xl sm:text-5xl font-bold tracking-tight bg-clip-text text-transparent mb-3 pb-1", style: { backgroundImage: 'linear-gradient(to bottom, var(--site-name-from), var(--site-name-to))' }, children: displayName }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-center gap-2 flex-wrap mb-4", children: [ profile.planTier && profile.planTier !== 'free' && /*#__PURE__*/ _jsx(PlanBadge, { tier: profile.planTier, verified: profile.hasVerifiedBadge, size: "md" }), Array.isArray(profile.activeStatuses) && profile.activeStatuses.includes('canhelp_now') && /*#__PURE__*/ _jsxs("span", { className: "inline-flex items-center gap-1.5 text-xs font-medium text-emerald-400 bg-emerald-500/10 border border-emerald-500/20 px-3 py-1.5 rounded-full", children: [ /*#__PURE__*/ _jsx("span", { className: "w-1.5 h-1.5 rounded-full bg-emerald-400 animate-pulse" }), t('status.can_help_now', 'Available now') ] }), memberYear && /*#__PURE__*/ _jsxs("span", { className: "text-xs px-3 py-1.5 rounded-full", style: { color: 'var(--site-text-muted)', background: 'var(--site-surface)' }, children: [ t('site.member_since', 'Member since'), " ", memberYear ] }) ] }), profile.bio && /*#__PURE__*/ _jsx("p", { className: "max-w-xl text-base sm:text-lg leading-relaxed mb-8", style: { color: 'var(--site-text-secondary)' }, children: profile.bio }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 flex-wrap justify-center", children: [ /*#__PURE__*/ _jsxs("button", { onClick: handleMessage, disabled: msgLoading, className: "group inline-flex items-center gap-2.5 bg-green-600 hover:bg-green-500 text-white font-semibold px-7 py-3.5 rounded-full transition-all hover:shadow-lg hover:shadow-blue-500/25 disabled:opacity-50", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5 group-hover:scale-110 transition-transform", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }), t('site.write_to_chat', 'Write in chat') ] }), profile.phone && /*#__PURE__*/ _jsxs("a", { href: "tel:".concat(profile.phone), className: "group inline-flex items-center gap-2.5 border font-medium px-7 py-3.5 rounded-full transition-all", style: { background: 'var(--site-phone-bg)', borderColor: 'var(--site-phone-border)', color: 'var(--site-phone-text)' }, children: [ /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5 group-hover:scale-110 transition-transform", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M3 5a2 2 0 012-2h3.28a1 1 0 01.948.684l1.498 4.493a1 1 0 01-.502 1.21l-2.257 1.13a11.042 11.042 0 005.516 5.516l1.13-2.257a1 1 0 011.21-.502l4.493 1.498a1 1 0 01.684.949V19a2 2 0 01-2 2h-1C9.716 21 3 14.284 3 6V5z" }) }), profile.phone ] }) ] }) ] }) }) ] }), hasStats && /*#__PURE__*/ _jsx("section", { className: "border-y", style: { borderColor: 'var(--site-border)', background: 'var(--site-surface)' }, children: /*#__PURE__*/ _jsx("div", { className: "max-w-5xl mx-auto px-4 sm:px-6 py-8", children: /*#__PURE__*/ _jsxs("div", { className: "grid grid-cols-2 sm:grid-cols-4 gap-6", children: [ profile.rating && /*#__PURE__*/ _jsxs("div", { className: "text-center", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-center gap-1 mb-1", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5 text-amber-400", fill: "currentColor", viewBox: "0 0 20 20", children: /*#__PURE__*/ _jsx("path", { d: "M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 00-1.175 0l-2.8 2.034c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 00.951-.69l1.07-3.292z" }) }), /*#__PURE__*/ _jsx("span", { className: "text-2xl font-bold", children: Number(profile.rating).toFixed(1) }) ] }), /*#__PURE__*/ _jsx("p", { className: "text-xs uppercase tracking-wider", style: { color: 'var(--site-text-muted)' }, children: t('site.rating', 'Rating') }) ] }), profile.reviewCount > 0 && /*#__PURE__*/ _jsxs("div", { className: "text-center", children: [ /*#__PURE__*/ _jsx("p", { className: "text-2xl font-bold mb-1", children: profile.reviewCount }), /*#__PURE__*/ _jsx("p", { className: "text-xs uppercase tracking-wider", style: { color: 'var(--site-text-muted)' }, children: t('profile.reviews') }) ] }), profile.completedTasks > 0 && /*#__PURE__*/ _jsxs("div", { className: "text-center", children: [ /*#__PURE__*/ _jsx("p", { className: "text-2xl font-bold mb-1", children: profile.completedTasks }), /*#__PURE__*/ _jsx("p", { className: "text-xs uppercase tracking-wider", style: { color: 'var(--site-text-muted)' }, children: t('site.completed_tasks', 'Completed') }) ] }), Array.isArray(profile.languages) && profile.languages.length > 0 && /*#__PURE__*/ _jsxs("div", { className: "text-center", children: [ /*#__PURE__*/ _jsx("p", { className: "text-2xl font-bold mb-1", children: profile.languages.length }), /*#__PURE__*/ _jsx("p", { className: "text-xs uppercase tracking-wider", style: { color: 'var(--site-text-muted)' }, children: t('site.languages', 'Languages') }) ] }) ] }) }) }), Array.isArray(profile.languages) && profile.languages.length > 0 && /*#__PURE__*/ _jsxs("section", { className: "max-w-5xl mx-auto px-4 sm:px-6 pt-10", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 mb-3", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", style: { color: 'var(--site-text-muted)' }, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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" }) }), /*#__PURE__*/ _jsx("span", { className: "text-sm", style: { color: 'var(--site-text-muted)' }, children: t('site.speaks_languages', 'Speaks languages') }) ] }), /*#__PURE__*/ _jsx("div", { className: "flex items-center gap-2 flex-wrap", children: profile.languages.map((lang)=>{ const info = LANG_MAP[lang]; return /*#__PURE__*/ _jsx("span", { className: "text-xs px-3 py-1.5 rounded-full flex items-center gap-1.5", style: { color: 'var(--site-tag-text)', background: 'var(--site-tag-bg)', border: '1px solid var(--site-tag-border)' }, children: info ? /*#__PURE__*/ _jsxs(_Fragment, { children: [ info.flag, " ", info.label ] }) : lang }, lang); }) }) ] }), /*#__PURE__*/ _jsxs("div", { className: "max-w-5xl mx-auto px-4 sm:px-6 pb-20 space-y-16 mt-10", children: [ showServices && Array.isArray(profile.cards) && profile.cards.length > 0 && /*#__PURE__*/ _jsxs("section", { children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 mb-6", children: [ /*#__PURE__*/ _jsx("div", { className: "w-8 h-8 rounded-lg bg-green-500/10 flex items-center justify-center", children: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-gray-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M21 13.255A23.931 23.931 0 0112 15c-3.183 0-6.22-.62-9-1.745M16 6V4a2 2 0 00-2-2h-4a2 2 0 00-2 2v2m4 6h.01M5 20h14a2 2 0 002-2V8a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z" }) }) }), /*#__PURE__*/ _jsx("h2", { className: "text-xl font-bold", children: t('specialist.services', 'Services') }) ] }), /*#__PURE__*/ _jsx("div", { className: "grid gap-4 sm:grid-cols-2", children: profile.cards.map((card)=>{ // Group locations by parent const grouped = {}; if (Array.isArray(card.locations)) { for (const slug of card.locations){ const parent = locParentMap[slug]; if (parent) { if (!grouped[parent]) grouped[parent] = []; grouped[parent].push(locMap[slug] || slug); } else { const name = locMap[slug] || slug; if (!grouped[name]) grouped[name] = []; } } } return /*#__PURE__*/ _jsxs("div", { className: "group relative rounded-2xl p-6 transition-all", style: { background: 'var(--site-card-bg)', border: '1px solid var(--site-card-border)' }, children: [ /*#__PURE__*/ _jsx("h3", { className: "font-semibold mb-2", style: { color: 'var(--site-text)' }, children: card.title }), showServices && (()=>{ const desc = (locale === 'el' ? card.descriptionEl : locale === 'en' ? card.descriptionEn : locale === 'ru' ? card.descriptionRu : card.descriptionUk) || card.descriptionEl || card.descriptionEn || card.descriptionRu || card.descriptionUk || card.description; return desc ? /*#__PURE__*/ _jsx("p", { className: "text-sm leading-relaxed mb-3", style: { color: 'var(--site-text-muted)' }, children: desc }) : null; })(), showServices && Array.isArray(card.categories) && card.categories.length > 0 && /*#__PURE__*/ _jsx("div", { className: "flex flex-wrap gap-1.5 mb-3", children: card.categories.map((slug)=>/*#__PURE__*/ _jsx("span", { className: "text-[11px] px-2.5 py-1 rounded-full bg-purple-500/10 text-purple-400 border border-purple-500/10", children: catMap[slug] || slug }, slug)) }), showServices && Object.keys(grouped).length > 0 && /*#__PURE__*/ _jsx("div", { className: "mb-3 space-y-1", children: Object.entries(grouped).map((param)=>{ let [parent, children] = param; return /*#__PURE__*/ _jsxs("div", { className: "flex items-start gap-1.5 text-xs", style: { color: 'var(--site-text-muted)' }, children: [ /*#__PURE__*/ _jsxs("svg", { className: "w-3.5 h-3.5 shrink-0 mt-0.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ _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" }), /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 11a3 3 0 11-6 0 3 3 0 016 0z" }) ] }), /*#__PURE__*/ _jsxs("span", { children: [ /*#__PURE__*/ _jsx("span", { className: "font-medium", style: { color: 'var(--site-text-secondary)' }, children: parent }), children.length > 0 && /*#__PURE__*/ _jsxs("span", { style: { color: 'var(--site-text-hint)' }, children: [ " — ", children.join(', ') ] }) ] }) ] }, parent); }) }), showServices && Array.isArray(card.skills) && card.skills.length > 0 && /*#__PURE__*/ _jsx("div", { className: "flex flex-wrap gap-1.5", children: card.skills.map((s)=>/*#__PURE__*/ _jsx("span", { className: "text-[11px] px-2.5 py-1 rounded-full bg-green-500/10 text-gray-400 border border-green-500/10", children: s }, s)) }), showPriceList && Array.isArray(priceLists[card.id]) && priceLists[card.id].length > 0 && /*#__PURE__*/ _jsxs("div", { className: "".concat(showServices ? 'mt-4 pt-4 border-t' : ''), style: { borderColor: 'var(--site-card-border)' }, children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs font-semibold uppercase tracking-wider mb-3", style: { color: 'var(--site-text-muted)' }, children: t('site.pricelist', 'Price list') }), /*#__PURE__*/ _jsx("div", { className: "space-y-3", children: priceLists[card.id].map((group)=>/*#__PURE__*/ _jsxs("div", { className: "rounded-xl p-4", style: { background: 'var(--site-surface)', border: '1px solid var(--site-card-border)' }, children: [ /*#__PURE__*/ _jsx("p", { className: "font-semibold mb-3", style: { color: 'var(--site-text)' }, children: group.title }), /*#__PURE__*/ _jsx("div", { className: "space-y-3", children: group.items.map((item)=>/*#__PURE__*/ _jsxs("div", { className: "flex items-start justify-between gap-4", children: [ /*#__PURE__*/ _jsxs("div", { className: "min-w-0", children: [ /*#__PURE__*/ _jsx("p", { className: "text-sm font-medium", style: { color: 'var(--site-text-secondary)' }, children: item.name }), item.description && /*#__PURE__*/ _jsx("p", { className: "text-xs mt-0.5", style: { color: 'var(--site-text-muted)' }, children: item.description }) ] }), (item.price || item.unit) && /*#__PURE__*/ _jsxs("div", { className: "shrink-0 text-sm font-semibold", style: { color: 'var(--site-text)' }, children: [ item.price ? "€".concat(item.price) : '', item.unit ? " ".concat(item.unit) : '' ] }) ] }, item.id)) }) ] }, group.id)) }) ] }) ] }, card.id); }) }) ] }), Array.isArray(profile.portfolio) && profile.portfolio.length > 0 && /*#__PURE__*/ _jsxs("section", { children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 mb-6", children: [ /*#__PURE__*/ _jsx("div", { className: "w-8 h-8 rounded-lg bg-purple-500/10 flex items-center justify-center", children: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-purple-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z" }) }) }), /*#__PURE__*/ _jsx("h2", { className: "text-xl font-bold", children: t('portfolio.title', 'Portfolio') }), /*#__PURE__*/ _jsxs("span", { className: "text-xs ml-auto", style: { color: 'var(--site-text-hint)' }, children: [ profile.portfolio.length, " ", t('site.photos', 'photos') ] }) ] }), /*#__PURE__*/ _jsx("div", { className: "grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 gap-3", children: profile.portfolio.map((item, idx)=>{ var _item_title; return /*#__PURE__*/ _jsxs("button", { onClick: ()=>item.imageUrl && setLightbox(idx), className: "group relative aspect-square rounded-xl overflow-hidden transition-all", style: { background: 'var(--site-surface)', border: '1px solid var(--site-card-border)' }, children: [ item.imageUrl && /*#__PURE__*/ _jsx("img", { src: item.imageUrl, alt: (_item_title = item.title) !== null && _item_title !== void 0 ? _item_title : '', className: "w-full h-full object-cover group-hover:scale-105 transition-transform duration-500" }), /*#__PURE__*/ _jsx("div", { className: "absolute inset-0 bg-gradient-to-t from-black/60 via-transparent to-transparent opacity-0 group-hover:opacity-100 transition-opacity flex items-end p-3", children: item.title && /*#__PURE__*/ _jsx("p", { className: "text-xs font-medium text-white truncate", children: item.title }) }), /*#__PURE__*/ _jsx("div", { className: "absolute top-2 right-2 w-7 h-7 rounded-full bg-black/40 backdrop-blur-md flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity", children: /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5 text-white/80", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0zM10 7v3m0 0v3m0-3h3m-3 0H7" }) }) }) ] }, item.id); }) }) ] }), Array.isArray(profile.reviews) && profile.reviews.length > 0 && /*#__PURE__*/ _jsxs("section", { children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 mb-6", children: [ /*#__PURE__*/ _jsx("div", { className: "w-8 h-8 rounded-lg bg-amber-500/10 flex items-center justify-center", children: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-amber-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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" }) }) }), /*#__PURE__*/ _jsx("h2", { className: "text-xl font-bold", children: t('profile.reviews') }), /*#__PURE__*/ _jsx("span", { className: "text-xs ml-auto", style: { color: 'var(--site-text-hint)' }, children: profile.reviewCount }) ] }), /*#__PURE__*/ _jsx("div", { className: "space-y-3", children: profile.reviews.slice(0, 6).map((review)=>{ var _review_authorFirstName, _review_authorName; const authorName = [ review.authorFirstName, review.authorLastName ].filter(Boolean).join(' ') || review.authorName || null; var _review_authorFirstName_, _ref; return /*#__PURE__*/ _jsxs("div", { className: "rounded-2xl p-5", style: { background: 'var(--site-card-bg)', border: '1px solid var(--site-card-border)' }, children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-start gap-3 mb-3", children: [ /*#__PURE__*/ _jsx("div", { className: "w-9 h-9 rounded-full flex items-center justify-center text-xs font-bold overflow-hidden shrink-0", style: { background: 'var(--site-surface)', color: 'var(--site-text-muted)' }, children: review.authorImage ? /*#__PURE__*/ _jsx("img", { src: review.authorImage, alt: "", className: "w-full h-full object-cover" }) : ((_ref = (_review_authorFirstName_ = (_review_authorFirstName = review.authorFirstName) === null || _review_authorFirstName === void 0 ? void 0 : _review_authorFirstName[0]) !== null && _review_authorFirstName_ !== void 0 ? _review_authorFirstName_ : (_review_authorName = review.authorName) === null || _review_authorName === void 0 ? void 0 : _review_authorName[0]) !== null && _ref !== void 0 ? _ref : '?').toUpperCase() }), /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between gap-2", children: [ /*#__PURE__*/ _jsx("p", { className: "text-sm font-medium", style: { color: 'var(--site-text-secondary)' }, children: authorName !== null && authorName !== void 0 ? authorName : t('common.anonymous', 'Anonymous') }), /*#__PURE__*/ _jsx("span", { className: "shrink-0 text-[11px]", style: { color: 'var(--site-text-hint)' }, children: new Date(review.createdAt).toLocaleDateString(dateLocale) }) ] }), /*#__PURE__*/ _jsx("div", { className: "flex gap-0.5 mt-0.5", children: Array.from({ length: 5 }).map((_, i)=>/*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5 ".concat(i < Math.round(review.rating) ? 'text-amber-400' : ''), style: i < Math.round(review.rating) ? {} : { color: 'var(--site-border)' }, fill: "currentColor", viewBox: "0 0 20 20", children: /*#__PURE__*/ _jsx("path", { d: "M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 00-1.175 0l-2.8 2.034c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 00.951-.69l1.07-3.292z" }) }, i)) }) ] }) ] }), review.comment && /*#__PURE__*/ _jsx("p", { className: "text-sm leading-relaxed pl-12", style: { color: 'var(--site-text-muted)' }, children: review.comment }) ] }, review.id); }) }) ] }), /*#__PURE__*/ _jsxs("section", { id: "contact", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 mb-6", children: [ /*#__PURE__*/ _jsx("div", { className: "w-8 h-8 rounded-lg bg-emerald-500/10 flex items-center justify-center", children: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-emerald-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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" }) }) }), /*#__PURE__*/ _jsx("h2", { className: "text-xl font-bold", children: t('site.contact_form', 'Contact') }) ] }), contactSent ? /*#__PURE__*/ _jsxs("div", { className: "bg-emerald-500/10 border border-emerald-500/20 rounded-2xl p-8 text-center", children: [ /*#__PURE__*/ _jsx("div", { className: "w-12 h-12 rounded-full bg-emerald-500/20 flex items-center justify-center mx-auto mb-3", children: /*#__PURE__*/ _jsx("svg", { className: "w-6 h-6 text-emerald-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" }) }) }), /*#__PURE__*/ _jsx("p", { className: "text-emerald-400 font-medium", children: t('site.contact_sent', 'Message sent!') }), /*#__PURE__*/ _jsx("p", { className: "text-sm mt-1", style: { color: 'var(--site-text-muted)' }, children: t('site.contact_sent_desc', 'The specialist will contact you shortly') }) ] }) : /*#__PURE__*/ _jsxs("form", { onSubmit: handleContactSubmit, className: "rounded-2xl p-6 space-y-4", style: { background: 'var(--site-card-bg)', border: '1px solid var(--site-card-border)' }, children: [ /*#__PURE__*/ _jsxs("div", { className: "grid gap-4 sm:grid-cols-2", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("label", { className: "text-xs uppercase tracking-wider mb-1.5 block", style: { color: 'var(--site-text-muted)' }, children: [ t('site.contact_name', 'Name'), " *" ] }), /*#__PURE__*/ _jsx("input", { type: "text", required: true, value: contactForm.name, onChange: (e)=>setContactForm((f)=>({ ...f, name: e.target.value })), className: "w-full rounded-xl px-4 py-3 text-sm focus:outline-none focus:border-green-500/50 transition", style: { background: 'var(--site-input-bg)', border: '1px solid var(--site-input-border)', color: 'var(--site-input-text)' }, placeholder: t('site.contact_name_ph', 'Your name') }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "text-xs uppercase tracking-wider mb-1.5 block", style: { color: 'var(--site-text-muted)' }, children: "Email" }), /*#__PURE__*/ _jsx("input", { type: "email", value: contactForm.email, onChange: (e)=>setContactForm((f)=>({ ...f, email: e.target.value })), className: "w-full rounded-xl px-4 py-3 text-sm focus:outline-none focus:border-green-500/50 transition", style: { background: 'var(--site-input-bg)', border: '1px solid var(--site-input-border)', color: 'var(--site-input-text)' }, placeholder: t('site.contact_email_ph', 'your@email.com') }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("label", { className: "text-xs uppercase tracking-wider mb-1.5 block", style: { color: 'var(--site-text-muted)' }, children: [ t('site.contact_message', 'Message'), " *" ] }), /*#__PURE__*/ _jsx("textarea", { required: true, rows: 4, value: contactForm.message, onChange: (e)=>setContactForm((f)=>({ ...f, message: e.target.value })), className: "w-full rounded-xl px-4 py-3 text-sm focus:outline-none focus:border-green-500/50 transition resize-none", style: { background: 'var(--site-input-bg)', border: '1px solid var(--site-input-border)', color: 'var(--site-input-text)' }, placeholder: t('site.contact_message_ph', 'Describe your task...') }) ] }), /*#__PURE__*/ _jsxs("button", { type: "submit", disabled: contactLoading, className: "inline-flex items-center gap-2 bg-green-600 hover:bg-green-500 text-white font-medium px-6 py-3 rounded-xl transition disabled:opacity-50", children: [ contactLoading ? /*#__PURE__*/ _jsx("div", { className: "w-4 h-4 rounded-full border-2 border-white/30 border-t-white animate-spin" }) : /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 19l9 2-9-18-9 18 9-2zm0 0v-8" }) }), t('site.contact_send', 'Send') ] }) ] }) ] }), /*#__PURE__*/ _jsx("footer", { className: "border-t pt-8 pb-4", style: { borderColor: 'var(--site-border)' }, children: /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between text-xs", style: { color: 'var(--site-footer-text)' }, children: [ /*#__PURE__*/ _jsx("a", { href: "/", className: "transition", children: "CanHelp.gr" }), /*#__PURE__*/ _jsxs("p", { children: [ "\xa9 ", new Date().getFullYear() ] }) ] }) }) ] }), /*#__PURE__*/ _jsx("button", { onClick: ()=>window.scrollTo({ top: 0, behavior: 'smooth' }), className: "fixed bottom-6 right-6 z-50 w-10 h-10 rounded-full flex items-center justify-center backdrop-blur-sm transition-all duration-300 ".concat(scrolled ? 'opacity-100 translate-y-0' : 'opacity-0 translate-y-4 pointer-events-none'), style: { background: 'var(--site-scroll-btn-bg)', border: '1px solid var(--site-scroll-btn-border)', color: 'var(--site-scroll-btn-text)' }, "aria-label": "Scroll to top", children: /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 15l7-7 7 7" }) }) }) ] }); } —Q61146undefined148204undefined206260undefined262306undefined308347undefined349503undefined505555undefined557571undefined854862(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useParams)undefined904912(0,_context_locale__WEBPACK_IMPORTED_MODULE_3__/* .useLocale */ .Y)undefined947956(0,_lib_auth__WEBPACK_IMPORTED_MODULE_4__/* .useSession */ .wV)undefined980988(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)undefined10271034(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined10771084(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined11291136(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined11861193(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined12431250(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined12961303(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined13541361(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined14131420(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined15371544(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined15901597(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined16431650(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined16981705(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined17491756(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined17971804(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined18461853(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined18921899(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined19501957(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined20042011(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined20542061(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined21912199(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined36103618(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined36613680(0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getPublicSiteProfile */ .S$)undefined38003808(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined44674478(0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getPriceList */ .Ck)undefined49344942(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined49925004(0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getCategories */ .bW)undefined57225733(0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getLocations */ .Vs)undefined75367556(0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getOrCreateDirectRoom */ .QN)undefined75897599(0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .sendMessage */ ._z)undefined76397654(0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .trackSiteMessage */ .UE)undefined78357845(0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)undefined80308036(0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Em)undefined85038511(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined96379640(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined98209824(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined99349937(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1009010093(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1032910333(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1054210545(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1078010783(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1105411057(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1160811611(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1178011783(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1376213766(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1419214196(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1443214435(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1471114714(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1501515018(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1533315336(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1574515748(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1604916052(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1660016603(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1701317016(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1731717320(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1761117614(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1813418137(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1845618459(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1867518679(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1907619079(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1958019583(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1990819911(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2023820241(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2042320426(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2076520768(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2123221235(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2160221605(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2198821992(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2215322157(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2251322516(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2291322916(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2350623510(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2486224865(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2526225265(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2599025993(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2635726361(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2675426757(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2737327376(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2770127704(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2803128035(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2817828182(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2837428377(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2858628589(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2902429027(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2960329607(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2973629739(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3025430257(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3088830892(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3107231075(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3129931302(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3174031743(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3217632179(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3247232475(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3295732960(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3359933603(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3378233785(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3479734801(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3502435027(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3569835702(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3623836241(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3647436477(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3697036973(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3788137884(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3816338167(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3835238355(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3876138765(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3899839002(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3936239365(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3966139664(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4021940222(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4055540559(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined4073140735(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined4131241315(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4176441767(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4268042684(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined4268642694react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragmentundefined4281742820(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4311443117(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4368743691(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined4469344696(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4493944942(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4549745500(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4580945813(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined4715047153(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4755447557(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4840648410(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined4854248545(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4875748760(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4897448977(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4914449148(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined4932649330(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined4951349516(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4981849821(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined5044850451(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined5093150934(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined5137051373(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined5170051703(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined5220352207(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined5247552478(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined5248052488_components_PlanBadge__WEBPACK_IMPORTED_MODULE_6__/* .PlanBadge */ .dundefined5288552889(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined5321953222(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined5365353657(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined5450354506(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined5491654920(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined5513255136(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined5565755660(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined5614856151(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined5690056904(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined5762057623(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined5811158114(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined5904559048(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined5929559298(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined5942359427(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined5961059614(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined5977759781(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined6000060003(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined6031160314(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined6088560888(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined6125261255(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined6177061774(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined6193761940(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined6218762190(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined6270262706(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined6286962872(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined6312263125(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined6369363697(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined6386063863(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined6411564118(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined6474764751(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined6489564899(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined6505565058(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined6553665539(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined6594065943(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined6635766360(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined6661566618(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined6709067094(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined6709667104react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragmentundefined6753267536(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined6776967773(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined6786667870(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined6805068053(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined6825068253(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined6866468667(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined6923069233(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined6954969552(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined7070370707(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined7118771190(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined7203572038(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined7266072663(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined7286472867(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined7335373356(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined7369873702(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined7417474178(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined7478574788(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined7530775310(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined7590075904(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined7607476077(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined7672176725(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined7788877891(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined7808078083(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined7858178585(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined7903379036(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined7960579608(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined7981279816(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined8043380436(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined8105681059(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined8128681290(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined8162481628(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined8195581958(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined8277582778(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined8377183775(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined8561085614(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined8570785711(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined8589185894(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined8609286095(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined8650886511(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined8705587058(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined8731487318(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined8799888001(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined8830088304(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined8891788920(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined8938489387(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined8969789700(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined9004590048(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined9035290355(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined9081890821(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined9158391587(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined9168091684(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined9186491867(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined9206492067(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined9247992482(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined9323293235(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined9347893481(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined9394793950(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined9459494598(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined9504895052(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined9527995282(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined9587295875(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined9674796751(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined9698996993(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined9728097283(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined9799798000(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined9879798800(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined9916799170(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined9992399926(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined100864100867(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined101523101527(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined101659101663(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined101843101846(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined102045102048(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined102462102465(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined102956102959(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined103286103290(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined103516103519(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined103735103738(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined104152104155(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined104560104563(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined104835104838(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined105323105327(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined105795105799(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined106000106004(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined106141106145(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined106895106898(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined108359108363(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined108500108503(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined109044109047(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined110518110522(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined110643110647(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined111323111326(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined112674112678(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined113133113136(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined113345113348(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined113769113772(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined114431114434(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined114675114679(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined114993114996(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined115254115258(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined115642115645(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined116380116383(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined116636116639(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined /***/ }) ÕZ/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ PersonalSitePage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7541); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(9906); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(1592); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(2982); /* harmony import */ var _components_PlanBadge__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(2035); /* __next_internal_client_entry_do_not_use__ default auto */ function PersonalSitePage() { var _profile_portfolio, _profile_firstName, _profile_lastName, _profile_name_, _profile_name, _profile_siteSettings, _profile_siteSettings1, _profile_siteSettings2, _profile_portfolio1, _profile_portfolio2, _SITE_LOCALES_find; const { slug } = (0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useParams)(); const { t, locale, setLocale } = (0,_context_locale__WEBPACK_IMPORTED_MODULE_3__/* .useLocale */ .Y)(); const { data: session } = (0,_lib_auth__WEBPACK_IMPORTED_MODULE_4__/* .useSession */ .wV)(); const router = (0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)(); const [profile, setProfile] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [loading, setLoading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(true); const [notFound, setNotFound] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [msgLoading, setMsgLoading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [linkCopied, setLinkCopied] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [lightbox, setLightbox] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [contactSent, setContactSent] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [contactForm, setContactForm] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)({ name: '', email: '', message: '' }); const [contactLoading, setContactLoading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [langOpen, setLangOpen] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [msgModal, setMsgModal] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [authModal, setAuthModal] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [msgText, setMsgText] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [msgSent, setMsgSent] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [catMap, setCatMap] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)({}); const [locMap, setLocMap] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)({}); const [locParentMap, setLocParentMap] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)({}); const [priceLists, setPriceLists] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)({}); const [scrolled, setScrolled] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const dateLocale = locale === 'ru' ? 'ru-RU' : locale === 'uk' ? 'uk-UA' : locale === 'en' ? 'en-US' : 'el-GR'; (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ const onScroll = ()=>setScrolled(window.scrollY > 100); window.addEventListener('scroll', onScroll, { passive: true }); return ()=>window.removeEventListener('scroll', onScroll); }, []); const LANG_MAP = { el: { flag: '🇬🇷', label: 'ΕλληΜικά' }, en: { flag: '🇬🇧', label: 'English' }, ru: { flag: '🇷🇺', label: 'РусскОй' }, uk: { flag: '🇺🇊', label: 'УкраїМська' }, de: { flag: '🇩🇪', label: 'Deutsch' }, fr: { flag: '🇫🇷', label: 'Français' }, it: { flag: '🇮🇹', label: 'Italiano' }, es: { flag: '🇪🇞', label: 'Español' }, ar: { flag: '🇞🇊', label: 'العرؚية' }, zh: { flag: '🇚🇳', label: 'äž­æ–‡' } }; const SITE_LOCALES = [ { code: 'el', flag: '🇬🇷', label: 'ΕλληΜικά' }, { code: 'en', flag: '🇬🇧', label: 'English' }, { code: 'ru', flag: '🇷🇺', label: 'РусскОй' } ]; (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!slug) return; (0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getPublicSiteProfile */ .S$)(slug).then(setProfile).catch(()=>setNotFound(true)).finally(()=>setLoading(false)); }, [ slug ]); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ var _profile_siteSettings; const shouldShowPriceList = (profile === null || profile === void 0 ? void 0 : (_profile_siteSettings = profile.siteSettings) === null || _profile_siteSettings === void 0 ? void 0 : _profile_siteSettings.showPriceList) !== false; const cards = Array.isArray(profile === null || profile === void 0 ? void 0 : profile.cards) ? profile.cards : []; if (!profile || !shouldShowPriceList || cards.length === 0) { setPriceLists({}); return; } let cancelled = false; Promise.all(cards.map(async (card)=>[ card.id, await (0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getPriceList */ .Ck)(card.id, locale) ])).then((entries)=>{ if (cancelled) return; setPriceLists(Object.fromEntries(entries.filter((param)=>{ let [, groups] = param; return groups.length > 0; }))); }).catch(()=>{ if (!cancelled) setPriceLists({}); }); return ()=>{ cancelled = true; }; }, [ profile, locale ]); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ const catLocale = locale; (0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getCategories */ .bW)().then((cats)=>{ const m = {}; for (const c of cats){ var _c_names_catLocale; m[c.slug] = (_c_names_catLocale = c.names[catLocale]) !== null && _c_names_catLocale !== void 0 ? _c_names_catLocale : c.names.el; var _c_children; for (const sub of (_c_children = c.children) !== null && _c_children !== void 0 ? _c_children : []){ var _sub_names_catLocale; m[sub.slug] = (_sub_names_catLocale = sub.names[catLocale]) !== null && _sub_names_catLocale !== void 0 ? _sub_names_catLocale : sub.names.el; } } setCatMap(m); }).catch(()=>{}); (0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getLocations */ .Vs)().then((locs)=>{ const m = {}; const pm = {}; for (const loc of locs){ var _loc_names, _loc_names1; var _loc_names_catLocale, _ref; const parentName = (_ref = (_loc_names_catLocale = (_loc_names = loc.names) === null || _loc_names === void 0 ? void 0 : _loc_names[catLocale]) !== null && _loc_names_catLocale !== void 0 ? _loc_names_catLocale : (_loc_names1 = loc.names) === null || _loc_names1 === void 0 ? void 0 : _loc_names1.el) !== null && _ref !== void 0 ? _ref : loc.slug; m[loc.slug] = parentName; var _loc_children; for (const child of (_loc_children = loc.children) !== null && _loc_children !== void 0 ? _loc_children : []){ var _child_names, _child_names1; var _child_names_catLocale, _ref1; m[child.slug] = (_ref1 = (_child_names_catLocale = (_child_names = child.names) === null || _child_names === void 0 ? void 0 : _child_names[catLocale]) !== null && _child_names_catLocale !== void 0 ? _child_names_catLocale : (_child_names1 = child.names) === null || _child_names1 === void 0 ? void 0 : _child_names1.el) !== null && _ref1 !== void 0 ? _ref1 : child.slug; pm[child.slug] = parentName; } } setLocMap(m); setLocParentMap(pm); }).catch(()=>{}); }, [ locale ]); function handleMessage() { if (!session) { setAuthModal(true); return; } setMsgModal(true); } async function handleSendMessage(e) { e.preventDefault(); if (!msgText.trim()) return; setMsgLoading(true); try { const { room } = await (0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getOrCreateDirectRoom */ .QN)(profile.id); await (0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .sendMessage */ ._z)(room.id, msgText.trim()); (0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .trackSiteMessage */ .UE)(slug); setMsgSent(true); setMsgText(''); } catch (e) {} finally{ setMsgLoading(false); } } const handleContactSubmit = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)(async (e)=>{ e.preventDefault(); if (!contactForm.name.trim() || !contactForm.message.trim()) return; setContactLoading(true); try { await (0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Em)("/users/site/".concat(slug, "/contact"), { method: 'POST', body: JSON.stringify(contactForm) }); setContactSent(true); setContactForm({ name: '', email: '', message: '' }); } catch (e) {} finally{ setContactLoading(false); } }, [ contactForm, slug ]); // Lightbox keyboard nav (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (lightbox === null) return; const handler = (e)=>{ if (e.key === 'Escape') setLightbox(null); if (e.key === 'ArrowRight') setLightbox((i)=>{ var _profile_portfolio; var _profile_portfolio_length; return i !== null ? Math.min(i + 1, ((_profile_portfolio_length = profile === null || profile === void 0 ? void 0 : (_profile_portfolio = profile.portfolio) === null || _profile_portfolio === void 0 ? void 0 : _profile_portfolio.length) !== null && _profile_portfolio_length !== void 0 ? _profile_portfolio_length : 1) - 1) : null; }); if (e.key === 'ArrowLeft') setLightbox((i)=>i !== null ? Math.max(i - 1, 0) : null); }; document.addEventListener('keydown', handler); return ()=>document.removeEventListener('keydown', handler); }, [ lightbox, profile === null || profile === void 0 ? void 0 : (_profile_portfolio = profile.portfolio) === null || _profile_portfolio === void 0 ? void 0 : _profile_portfolio.length ]); if (loading) return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "min-h-screen flex items-center justify-center", style: { background: 'var(--site-bg)' }, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "relative w-12 h-12", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "absolute inset-0 rounded-full border-2 border-green-500/20" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "absolute inset-0 rounded-full border-2 border-transparent border-t-blue-500 animate-spin" }) ] }) }); if (notFound || !profile) return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "min-h-screen flex flex-col items-center justify-center gap-6", style: { background: 'var(--site-bg)' }, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "w-20 h-20 rounded-full flex items-center justify-center", style: { background: 'var(--site-surface)' }, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-10 h-10 text-gray-500", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15.182 16.318A4.486 4.486 0 0012.016 15a4.486 4.486 0 00-3.198 1.318M21 12a9 9 0 11-18 0 9 9 0 0118 0zM9.75 9.75c0 .414-.168.75-.375.75S9 10.164 9 9.75 9.168 9 9.375 9s.375.336.375.75zm-.375 0h.008v.015h-.008V9.75zm5.625 0c0 .414-.168.75-.375.75s-.375-.336-.375-.75.168-.75.375-.75.375.336.375.75zm-.375 0h.008v.015h-.008V9.75z" }) }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-gray-400 text-lg", children: t('common.not_found', 'Page not found') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("a", { href: "/", className: "text-gray-400 hover:text-gray-300 text-sm transition", children: t('nav.home', 'Home') }) ] }); var _profile_firstName_, _profile_lastName_; const initials = "".concat((_profile_firstName_ = (_profile_firstName = profile.firstName) === null || _profile_firstName === void 0 ? void 0 : _profile_firstName[0]) !== null && _profile_firstName_ !== void 0 ? _profile_firstName_ : '').concat((_profile_lastName_ = (_profile_lastName = profile.lastName) === null || _profile_lastName === void 0 ? void 0 : _profile_lastName[0]) !== null && _profile_lastName_ !== void 0 ? _profile_lastName_ : '').toUpperCase() || ((_profile_name = profile.name) === null || _profile_name === void 0 ? void 0 : (_profile_name_ = _profile_name[0]) === null || _profile_name_ === void 0 ? void 0 : _profile_name_.toUpperCase()) || '?'; const displayName = [ profile.firstName, profile.lastName ].filter(Boolean).join(' ') || profile.name || ''; const memberYear = profile.memberSince ? new Date(profile.memberSince).getFullYear() : null; const hasStats = profile.completedTasks > 0 || profile.rating || profile.reviewCount && profile.reviewCount > 0; const isLight = ((_profile_siteSettings = profile.siteSettings) === null || _profile_siteSettings === void 0 ? void 0 : _profile_siteSettings.siteTheme) === 'light'; const showServices = ((_profile_siteSettings1 = profile.siteSettings) === null || _profile_siteSettings1 === void 0 ? void 0 : _profile_siteSettings1.showServices) !== false; const showPriceList = ((_profile_siteSettings2 = profile.siteSettings) === null || _profile_siteSettings2 === void 0 ? void 0 : _profile_siteSettings2.showPriceList) !== false; const showCardsSection = showServices || showPriceList; var _profile_portfolio_length, _profile_portfolio_lightbox_title, _SITE_LOCALES_find_flag; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "site-theme min-h-screen selection:bg-green-500/30 ".concat(isLight ? 'site-light' : ''), style: { background: 'var(--site-bg)', color: 'var(--site-text)' }, children: [ lightbox !== null && ((_profile_portfolio1 = profile.portfolio) === null || _profile_portfolio1 === void 0 ? void 0 : _profile_portfolio1[lightbox]) && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "fixed inset-0 z-50 bg-black/90 backdrop-blur-xl flex items-center justify-center p-4", onClick: ()=>setLightbox(null), children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>setLightbox(null), className: "absolute top-6 right-6 w-10 h-10 rounded-full bg-white/10 hover:bg-white/20 flex items-center justify-center transition", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-5 h-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" }) }) }), lightbox > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: (e)=>{ e.stopPropagation(); setLightbox(lightbox - 1); }, className: "absolute left-4 top-1/2 -translate-y-1/2 w-10 h-10 rounded-full bg-white/10 hover:bg-white/20 flex items-center justify-center transition", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-5 h-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 19l-7-7 7-7" }) }) }), lightbox < ((_profile_portfolio_length = (_profile_portfolio2 = profile.portfolio) === null || _profile_portfolio2 === void 0 ? void 0 : _profile_portfolio2.length) !== null && _profile_portfolio_length !== void 0 ? _profile_portfolio_length : 1) - 1 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: (e)=>{ e.stopPropagation(); setLightbox(lightbox + 1); }, className: "absolute right-4 top-1/2 -translate-y-1/2 w-10 h-10 rounded-full bg-white/10 hover:bg-white/20 flex items-center justify-center transition", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-5 h-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 5l7 7-7 7" }) }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: profile.portfolio[lightbox].imageUrl, alt: (_profile_portfolio_lightbox_title = profile.portfolio[lightbox].title) !== null && _profile_portfolio_lightbox_title !== void 0 ? _profile_portfolio_lightbox_title : '', className: "max-w-full max-h-[85vh] rounded-2xl object-contain", onClick: (e)=>e.stopPropagation() }), profile.portfolio[lightbox].title && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "absolute bottom-6 left-1/2 -translate-x-1/2 bg-black/60 backdrop-blur-md px-5 py-2.5 rounded-full text-sm", children: profile.portfolio[lightbox].title }) ] }), authModal && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "fixed inset-0 z-50 bg-black/70 backdrop-blur-sm flex items-center justify-center p-4", onClick: ()=>setAuthModal(false), children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "relative w-full max-w-sm rounded-2xl shadow-2xl p-6", style: { background: 'var(--site-modal-bg)', border: '1px solid var(--site-border)' }, onClick: (e)=>e.stopPropagation(), children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>setAuthModal(false), className: "absolute top-4 right-4 w-8 h-8 rounded-full flex items-center justify-center transition", style: { background: 'var(--site-surface)', color: 'var(--site-text-muted)' }, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" }) }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "w-12 h-12 rounded-full bg-green-500/10 flex items-center justify-center mb-4", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-6 h-6 text-gray-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h3", { className: "text-base font-semibold mb-2", style: { color: 'var(--site-text)' }, children: t('site.auth_required_title', 'Authorization required') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm mb-5", style: { color: 'var(--site-text-muted)' }, children: t('site.auth_required_desc', 'To write in chat, sign in to your CanHelp account.') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex flex-col gap-2.5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("a", { href: "/login", className: "w-full flex items-center justify-center gap-2 bg-green-600 hover:bg-green-500 text-white font-medium text-sm px-4 py-2.5 rounded-xl transition", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M11 16l-4-4m0 0l4-4m-4 4h14m-5 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h7a3 3 0 013 3v1" }) }), t('site.auth_login_btn', 'Sign in') ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { type: "button", onClick: ()=>{ setAuthModal(false); setTimeout(()=>{ var _document_getElementById; (_document_getElementById = document.getElementById('contact')) === null || _document_getElementById === void 0 ? void 0 : _document_getElementById.scrollIntoView({ behavior: 'smooth', block: 'start' }); }, 100); }, className: "w-full flex items-center justify-center gap-2 text-sm font-medium px-4 py-2.5 rounded-xl transition", style: { background: 'var(--site-surface)', color: 'var(--site-text-secondary)', border: '1px solid var(--site-border)' }, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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" }) }), t('site.auth_contact_form_btn', 'Write via contact form') ] }) ] }) ] }) }), msgModal && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "fixed inset-0 z-50 bg-black/70 backdrop-blur-sm flex items-center justify-center p-4", onClick: ()=>{ if (!msgLoading) { setMsgModal(false); setMsgSent(false); } }, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "relative w-full max-w-md rounded-2xl shadow-2xl", style: { background: 'var(--site-modal-bg)', border: '1px solid var(--site-border)' }, onClick: (e)=>e.stopPropagation(), children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>{ setMsgModal(false); setMsgSent(false); }, className: "absolute top-4 right-4 w-8 h-8 rounded-full flex items-center justify-center transition", style: { background: 'var(--site-surface)', color: 'var(--site-text-muted)' }, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" }) }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "p-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-3 mb-5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "w-10 h-10 rounded-full bg-green-500/10 flex items-center justify-center", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-5 h-5 text-gray-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h3", { className: "text-base font-semibold", style: { color: 'var(--site-text)' }, children: t('site.write_to_chat', 'Write in chat') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs", style: { color: 'var(--site-text-muted)' }, children: displayName }) ] }) ] }), msgSent ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "text-center py-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "w-12 h-12 rounded-full bg-emerald-500/20 flex items-center justify-center mx-auto mb-3", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-6 h-6 text-emerald-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" }) }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-emerald-400 font-medium mb-1", children: t('site.message_sent', 'Message sent!') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm mb-4", style: { color: 'var(--site-text-muted)' }, children: t('site.message_sent_desc', 'The specialist will receive it in chat') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>{ setMsgModal(false); setMsgSent(false); }, className: "text-sm text-gray-400 hover:text-gray-300 transition", children: t('common.close', 'Close') }) ] }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("form", { onSubmit: handleSendMessage, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("textarea", { autoFocus: true, rows: 4, value: msgText, onChange: (e)=>setMsgText(e.target.value), className: "w-full rounded-xl px-4 py-3 text-sm focus:outline-none focus:border-green-500/50 transition resize-none mb-4", style: { background: 'var(--site-input-bg)', border: '1px solid var(--site-input-border)', color: 'var(--site-input-text)' }, placeholder: t('site.message_placeholder', 'Write your message...') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-end gap-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>setMsgModal(false), className: "text-sm transition px-4 py-2", style: { color: 'var(--site-text-muted)' }, children: t('common.cancel', 'Cancel') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { type: "submit", disabled: msgLoading || !msgText.trim(), className: "inline-flex items-center gap-2 bg-green-600 hover:bg-green-500 text-white font-medium text-sm px-5 py-2.5 rounded-xl transition disabled:opacity-50", children: [ msgLoading ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "w-4 h-4 rounded-full border-2 border-white/30 border-t-white animate-spin" }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 19l9 2-9-18-9 18 9-2zm0 0v-8" }) }), t('site.contact_send', 'Send') ] }) ] }) ] }) ] }) ] }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("nav", { className: "sticky top-0 z-40 backdrop-blur-xl", style: { background: 'var(--site-nav-bg)', borderBottom: '1px solid var(--site-border)' }, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "max-w-5xl mx-auto px-4 sm:px-6 h-14 flex items-center justify-between", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("a", { href: "/", className: "logo-text-mini tracking-tight".concat(scrolled ? ' scrolled' : ''), style: { color: 'var(--site-text-secondary)' }, children: "CanHelp" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-2", children: [ (profile === null || profile === void 0 ? void 0 : profile.rating) && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-1 text-xs mr-1", style: { color: 'var(--site-text-secondary)' }, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3.5 h-3.5 text-amber-400", fill: "currentColor", viewBox: "0 0 20 20", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 00-1.175 0l-2.8 2.034c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 00.951-.69l1.07-3.292z" }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "font-medium", children: Number(profile.rating).toFixed(1) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "relative", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { type: "button", onClick: ()=>setLangOpen(!langOpen), className: "flex items-center gap-1.5 text-xs transition px-2 py-1 rounded-lg", style: { color: 'var(--site-text-muted)' }, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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" }) }), (_SITE_LOCALES_find_flag = (_SITE_LOCALES_find = SITE_LOCALES.find((l)=>l.code === locale)) === null || _SITE_LOCALES_find === void 0 ? void 0 : _SITE_LOCALES_find.flag) !== null && _SITE_LOCALES_find_flag !== void 0 ? _SITE_LOCALES_find_flag : '🌐' ] }), langOpen && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "fixed inset-0 z-40", onClick: ()=>setLangOpen(false) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "absolute right-0 top-full mt-1 z-50 rounded-xl shadow-xl overflow-hidden min-w-[140px]", style: { background: 'var(--site-lang-dropdown)', border: '1px solid var(--site-border)' }, children: SITE_LOCALES.map((l)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { type: "button", onClick: ()=>{ setLocale(l.code); setLangOpen(false); }, className: "w-full flex items-center gap-2 px-3 py-2 text-xs transition ".concat(locale === l.code ? 'text-gray-400 bg-green-500/10' : ''), style: locale === l.code ? {} : { color: 'var(--site-text-secondary)' }, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { children: l.flag }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { children: l.label }) ] }, l.code)) }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "w-px h-4", style: { background: 'var(--site-divider)' } }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { type: "button", onClick: async ()=>{ const url = window.location.href; if (navigator.share) { try { await navigator.share({ title: displayName, url }); } catch (e) {} } else { navigator.clipboard.writeText(url); setLinkCopied(true); setTimeout(()=>setLinkCopied(false), 2000); } }, className: "flex items-center gap-1.5 text-xs transition", style: { color: 'var(--site-text-muted)' }, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8.684 13.342C8.886 12.938 9 12.482 9 12c0-.482-.114-.938-.316-1.342m0 2.684a3 3 0 110-2.684m0 2.684l6.632 3.316m-6.632-6l6.632-3.316m0 0a3 3 0 105.367-2.684 3 3 0 00-5.367 2.684zm0 9.316a3 3 0 105.368 2.684 3 3 0 00-5.368-2.684z" }) }), linkCopied ? t('profile.site.copied') : t('site.share', 'Share') ] }) ] }) ] }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("section", { className: "relative overflow-hidden", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "absolute top-0 left-1/4 w-[500px] h-[500px] bg-green-600/10 rounded-full blur-[120px] pointer-events-none" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "absolute top-20 right-1/4 w-[400px] h-[400px] bg-purple-600/8 rounded-full blur-[100px] pointer-events-none" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "relative max-w-5xl mx-auto px-4 sm:px-6 pt-16 pb-20 sm:pt-24 sm:pb-28", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex flex-col items-center text-center", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "relative group mb-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "absolute -inset-1 bg-gradient-to-br from-green-600 to-purple-500 rounded-full opacity-60 blur group-hover:opacity-80 transition-opacity" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "relative w-28 h-28 sm:w-32 sm:h-32 rounded-full overflow-hidden border-2 flex items-center justify-center text-4xl font-bold", style: { borderColor: 'var(--site-avatar-border)', background: 'var(--site-avatar-bg)', color: 'var(--site-text)' }, children: profile.image ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: profile.image, alt: displayName, className: "w-full h-full object-cover" }) : initials }), Array.isArray(profile.activeStatuses) && profile.activeStatuses.includes('canhelp_now') && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "absolute bottom-1 right-1 w-5 h-5 bg-emerald-500 rounded-full border-2 flex items-center justify-center", style: { borderColor: 'var(--site-status-border-color)' }, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "w-2 h-2 rounded-full bg-white animate-pulse" }) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h1", { className: "text-3xl sm:text-5xl font-bold tracking-tight bg-clip-text text-transparent mb-3 pb-1", style: { backgroundImage: 'linear-gradient(to bottom, var(--site-name-from), var(--site-name-to))' }, children: displayName }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-center gap-2 flex-wrap mb-4", children: [ profile.planTier && profile.planTier !== 'free' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components_PlanBadge__WEBPACK_IMPORTED_MODULE_6__/* .PlanBadge */ .d, { tier: profile.planTier, verified: profile.hasVerifiedBadge, size: "md" }), Array.isArray(profile.activeStatuses) && profile.activeStatuses.includes('canhelp_now') && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "inline-flex items-center gap-1.5 text-xs font-medium text-emerald-400 bg-emerald-500/10 border border-emerald-500/20 px-3 py-1.5 rounded-full", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "w-1.5 h-1.5 rounded-full bg-emerald-400 animate-pulse" }), t('status.can_help_now', 'Available now') ] }), memberYear && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "text-xs px-3 py-1.5 rounded-full", style: { color: 'var(--site-text-muted)', background: 'var(--site-surface)' }, children: [ t('site.member_since', 'Member since'), " ", memberYear ] }) ] }), profile.bio && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "max-w-xl text-base sm:text-lg leading-relaxed mb-8", style: { color: 'var(--site-text-secondary)' }, children: profile.bio }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-3 flex-wrap justify-center", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { onClick: handleMessage, disabled: msgLoading, className: "group inline-flex items-center gap-2.5 bg-green-600 hover:bg-green-500 text-white font-semibold px-7 py-3.5 rounded-full transition-all hover:shadow-lg hover:shadow-blue-500/25 disabled:opacity-50", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-5 h-5 group-hover:scale-110 transition-transform", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }), t('site.write_to_chat', 'Write in chat') ] }), profile.phone && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("a", { href: "tel:".concat(profile.phone), className: "group inline-flex items-center gap-2.5 border font-medium px-7 py-3.5 rounded-full transition-all", style: { background: 'var(--site-phone-bg)', borderColor: 'var(--site-phone-border)', color: 'var(--site-phone-text)' }, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-5 h-5 group-hover:scale-110 transition-transform", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M3 5a2 2 0 012-2h3.28a1 1 0 01.948.684l1.498 4.493a1 1 0 01-.502 1.21l-2.257 1.13a11.042 11.042 0 005.516 5.516l1.13-2.257a1 1 0 011.21-.502l4.493 1.498a1 1 0 01.684.949V19a2 2 0 01-2 2h-1C9.716 21 3 14.284 3 6V5z" }) }), profile.phone ] }) ] }) ] }) }) ] }), hasStats && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("section", { className: "border-y", style: { borderColor: 'var(--site-border)', background: 'var(--site-surface)' }, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "max-w-5xl mx-auto px-4 sm:px-6 py-8", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "grid grid-cols-2 sm:grid-cols-4 gap-6", children: [ profile.rating && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "text-center", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-center gap-1 mb-1", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-5 h-5 text-amber-400", fill: "currentColor", viewBox: "0 0 20 20", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 00-1.175 0l-2.8 2.034c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 00.951-.69l1.07-3.292z" }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-2xl font-bold", children: Number(profile.rating).toFixed(1) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs uppercase tracking-wider", style: { color: 'var(--site-text-muted)' }, children: t('site.rating', 'Rating') }) ] }), profile.reviewCount > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "text-center", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-2xl font-bold mb-1", children: profile.reviewCount }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs uppercase tracking-wider", style: { color: 'var(--site-text-muted)' }, children: t('profile.reviews') }) ] }), profile.completedTasks > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "text-center", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-2xl font-bold mb-1", children: profile.completedTasks }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs uppercase tracking-wider", style: { color: 'var(--site-text-muted)' }, children: t('site.completed_tasks', 'Completed') }) ] }), Array.isArray(profile.languages) && profile.languages.length > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "text-center", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-2xl font-bold mb-1", children: profile.languages.length }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs uppercase tracking-wider", style: { color: 'var(--site-text-muted)' }, children: t('site.languages', 'Languages') }) ] }) ] }) }) }), Array.isArray(profile.languages) && profile.languages.length > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("section", { className: "max-w-5xl mx-auto px-4 sm:px-6 pt-10", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-3 mb-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 shrink-0", style: { color: 'var(--site-text-muted)' }, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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" }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-sm", style: { color: 'var(--site-text-muted)' }, children: t('site.speaks_languages', 'Speaks languages') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex items-center gap-2 flex-wrap", children: profile.languages.map((lang)=>{ const info = LANG_MAP[lang]; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-xs px-3 py-1.5 rounded-full flex items-center gap-1.5", style: { color: 'var(--site-tag-text)', background: 'var(--site-tag-bg)', border: '1px solid var(--site-tag-border)' }, children: info ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [ info.flag, " ", info.label ] }) : lang }, lang); }) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "max-w-5xl mx-auto px-4 sm:px-6 pb-20 space-y-16 mt-10", children: [ showServices && Array.isArray(profile.cards) && profile.cards.length > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("section", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-3 mb-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "w-8 h-8 rounded-lg bg-green-500/10 flex items-center justify-center", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 text-gray-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M21 13.255A23.931 23.931 0 0112 15c-3.183 0-6.22-.62-9-1.745M16 6V4a2 2 0 00-2-2h-4a2 2 0 00-2 2v2m4 6h.01M5 20h14a2 2 0 002-2V8a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z" }) }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "text-xl font-bold", children: t('specialist.services', 'Services') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "grid gap-4 sm:grid-cols-2", children: profile.cards.map((card)=>{ // Group locations by parent const grouped = {}; if (Array.isArray(card.locations)) { for (const slug of card.locations){ const parent = locParentMap[slug]; if (parent) { if (!grouped[parent]) grouped[parent] = []; grouped[parent].push(locMap[slug] || slug); } else { const name = locMap[slug] || slug; if (!grouped[name]) grouped[name] = []; } } } return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "group relative rounded-2xl p-6 transition-all", style: { background: 'var(--site-card-bg)', border: '1px solid var(--site-card-border)' }, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h3", { className: "font-semibold mb-2", style: { color: 'var(--site-text)' }, children: card.title }), showServices && (()=>{ const desc = (locale === 'el' ? card.descriptionEl : locale === 'en' ? card.descriptionEn : locale === 'ru' ? card.descriptionRu : card.descriptionUk) || card.descriptionEl || card.descriptionEn || card.descriptionRu || card.descriptionUk || card.description; return desc ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm leading-relaxed mb-3", style: { color: 'var(--site-text-muted)' }, children: desc }) : null; })(), showServices && Array.isArray(card.categories) && card.categories.length > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex flex-wrap gap-1.5 mb-3", children: card.categories.map((slug)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-[11px] px-2.5 py-1 rounded-full bg-purple-500/10 text-purple-400 border border-purple-500/10", children: catMap[slug] || slug }, slug)) }), showServices && Object.keys(grouped).length > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "mb-3 space-y-1", children: Object.entries(grouped).map((param)=>{ let [parent, children] = param; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-start gap-1.5 text-xs", style: { color: 'var(--site-text-muted)' }, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-3.5 h-3.5 shrink-0 mt-0.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 11a3 3 0 11-6 0 3 3 0 016 0z" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "font-medium", style: { color: 'var(--site-text-secondary)' }, children: parent }), children.length > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { style: { color: 'var(--site-text-hint)' }, children: [ " — ", children.join(', ') ] }) ] }) ] }, parent); }) }), showServices && Array.isArray(card.skills) && card.skills.length > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex flex-wrap gap-1.5", children: card.skills.map((s)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-[11px] px-2.5 py-1 rounded-full bg-green-500/10 text-gray-400 border border-green-500/10", children: s }, s)) }), showPriceList && Array.isArray(priceLists[card.id]) && priceLists[card.id].length > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "".concat(showServices ? 'mt-4 pt-4 border-t' : ''), style: { borderColor: 'var(--site-card-border)' }, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs font-semibold uppercase tracking-wider mb-3", style: { color: 'var(--site-text-muted)' }, children: t('site.pricelist', 'Price list') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "space-y-3", children: priceLists[card.id].map((group)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "rounded-xl p-4", style: { background: 'var(--site-surface)', border: '1px solid var(--site-card-border)' }, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "font-semibold mb-3", style: { color: 'var(--site-text)' }, children: group.title }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "space-y-3", children: group.items.map((item)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-start justify-between gap-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "min-w-0", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm font-medium", style: { color: 'var(--site-text-secondary)' }, children: item.name }), item.description && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs mt-0.5", style: { color: 'var(--site-text-muted)' }, children: item.description }) ] }), (item.price || item.unit) && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "shrink-0 text-sm font-semibold", style: { color: 'var(--site-text)' }, children: [ item.price ? "€".concat(item.price) : '', item.unit ? " ".concat(item.unit) : '' ] }) ] }, item.id)) }) ] }, group.id)) }) ] }) ] }, card.id); }) }) ] }), Array.isArray(profile.portfolio) && profile.portfolio.length > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("section", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-3 mb-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "w-8 h-8 rounded-lg bg-purple-500/10 flex items-center justify-center", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 text-purple-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z" }) }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "text-xl font-bold", children: t('portfolio.title', 'Portfolio') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "text-xs ml-auto", style: { color: 'var(--site-text-hint)' }, children: [ profile.portfolio.length, " ", t('site.photos', 'photos') ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 gap-3", children: profile.portfolio.map((item, idx)=>{ var _item_title; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { onClick: ()=>item.imageUrl && setLightbox(idx), className: "group relative aspect-square rounded-xl overflow-hidden transition-all", style: { background: 'var(--site-surface)', border: '1px solid var(--site-card-border)' }, children: [ item.imageUrl && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: item.imageUrl, alt: (_item_title = item.title) !== null && _item_title !== void 0 ? _item_title : '', className: "w-full h-full object-cover group-hover:scale-105 transition-transform duration-500" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "absolute inset-0 bg-gradient-to-t from-black/60 via-transparent to-transparent opacity-0 group-hover:opacity-100 transition-opacity flex items-end p-3", children: item.title && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs font-medium text-white truncate", children: item.title }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "absolute top-2 right-2 w-7 h-7 rounded-full bg-black/40 backdrop-blur-md flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3.5 h-3.5 text-white/80", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0zM10 7v3m0 0v3m0-3h3m-3 0H7" }) }) }) ] }, item.id); }) }) ] }), Array.isArray(profile.reviews) && profile.reviews.length > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("section", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-3 mb-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "w-8 h-8 rounded-lg bg-amber-500/10 flex items-center justify-center", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 text-amber-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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" }) }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "text-xl font-bold", children: t('profile.reviews') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-xs ml-auto", style: { color: 'var(--site-text-hint)' }, children: profile.reviewCount }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "space-y-3", children: profile.reviews.slice(0, 6).map((review)=>{ var _review_authorFirstName, _review_authorName; const authorName = [ review.authorFirstName, review.authorLastName ].filter(Boolean).join(' ') || review.authorName || null; var _review_authorFirstName_, _ref; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "rounded-2xl p-5", style: { background: 'var(--site-card-bg)', border: '1px solid var(--site-card-border)' }, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-start gap-3 mb-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "w-9 h-9 rounded-full flex items-center justify-center text-xs font-bold overflow-hidden shrink-0", style: { background: 'var(--site-surface)', color: 'var(--site-text-muted)' }, children: review.authorImage ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: review.authorImage, alt: "", className: "w-full h-full object-cover" }) : ((_ref = (_review_authorFirstName_ = (_review_authorFirstName = review.authorFirstName) === null || _review_authorFirstName === void 0 ? void 0 : _review_authorFirstName[0]) !== null && _review_authorFirstName_ !== void 0 ? _review_authorFirstName_ : (_review_authorName = review.authorName) === null || _review_authorName === void 0 ? void 0 : _review_authorName[0]) !== null && _ref !== void 0 ? _ref : '?').toUpperCase() }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-between gap-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm font-medium", style: { color: 'var(--site-text-secondary)' }, children: authorName !== null && authorName !== void 0 ? authorName : t('common.anonymous', 'Anonymous') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "shrink-0 text-[11px]", style: { color: 'var(--site-text-hint)' }, children: new Date(review.createdAt).toLocaleDateString(dateLocale) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex gap-0.5 mt-0.5", children: Array.from({ length: 5 }).map((_, i)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3.5 h-3.5 ".concat(i < Math.round(review.rating) ? 'text-amber-400' : ''), style: i < Math.round(review.rating) ? {} : { color: 'var(--site-border)' }, fill: "currentColor", viewBox: "0 0 20 20", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 00-1.175 0l-2.8 2.034c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 00.951-.69l1.07-3.292z" }) }, i)) }) ] }) ] }), review.comment && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm leading-relaxed pl-12", style: { color: 'var(--site-text-muted)' }, children: review.comment }) ] }, review.id); }) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("section", { id: "contact", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-3 mb-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "w-8 h-8 rounded-lg bg-emerald-500/10 flex items-center justify-center", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 text-emerald-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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" }) }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "text-xl font-bold", children: t('site.contact_form', 'Contact') }) ] }), contactSent ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-emerald-500/10 border border-emerald-500/20 rounded-2xl p-8 text-center", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "w-12 h-12 rounded-full bg-emerald-500/20 flex items-center justify-center mx-auto mb-3", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-6 h-6 text-emerald-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" }) }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-emerald-400 font-medium", children: t('site.contact_sent', 'Message sent!') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm mt-1", style: { color: 'var(--site-text-muted)' }, children: t('site.contact_sent_desc', 'The specialist will contact you shortly') }) ] }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("form", { onSubmit: handleContactSubmit, className: "rounded-2xl p-6 space-y-4", style: { background: 'var(--site-card-bg)', border: '1px solid var(--site-card-border)' }, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "grid gap-4 sm:grid-cols-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "text-xs uppercase tracking-wider mb-1.5 block", style: { color: 'var(--site-text-muted)' }, children: [ t('site.contact_name', 'Name'), " *" ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "text", required: true, value: contactForm.name, onChange: (e)=>setContactForm((f)=>({ ...f, name: e.target.value })), className: "w-full rounded-xl px-4 py-3 text-sm focus:outline-none focus:border-green-500/50 transition", style: { background: 'var(--site-input-bg)', border: '1px solid var(--site-input-border)', color: 'var(--site-input-text)' }, placeholder: t('site.contact_name_ph', 'Your name') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "text-xs uppercase tracking-wider mb-1.5 block", style: { color: 'var(--site-text-muted)' }, children: "Email" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "email", value: contactForm.email, onChange: (e)=>setContactForm((f)=>({ ...f, email: e.target.value })), className: "w-full rounded-xl px-4 py-3 text-sm focus:outline-none focus:border-green-500/50 transition", style: { background: 'var(--site-input-bg)', border: '1px solid var(--site-input-border)', color: 'var(--site-input-text)' }, placeholder: t('site.contact_email_ph', 'your@email.com') }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "text-xs uppercase tracking-wider mb-1.5 block", style: { color: 'var(--site-text-muted)' }, children: [ t('site.contact_message', 'Message'), " *" ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("textarea", { required: true, rows: 4, value: contactForm.message, onChange: (e)=>setContactForm((f)=>({ ...f, message: e.target.value })), className: "w-full rounded-xl px-4 py-3 text-sm focus:outline-none focus:border-green-500/50 transition resize-none", style: { background: 'var(--site-input-bg)', border: '1px solid var(--site-input-border)', color: 'var(--site-input-text)' }, placeholder: t('site.contact_message_ph', 'Describe your task...') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { type: "submit", disabled: contactLoading, className: "inline-flex items-center gap-2 bg-green-600 hover:bg-green-500 text-white font-medium px-6 py-3 rounded-xl transition disabled:opacity-50", children: [ contactLoading ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "w-4 h-4 rounded-full border-2 border-white/30 border-t-white animate-spin" }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 19l9 2-9-18-9 18 9-2zm0 0v-8" }) }), t('site.contact_send', 'Send') ] }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("footer", { className: "border-t pt-8 pb-4", style: { borderColor: 'var(--site-border)' }, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-between text-xs", style: { color: 'var(--site-footer-text)' }, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("a", { href: "/", className: "transition", children: "CanHelp.gr" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { children: [ "\xa9 ", new Date().getFullYear() ] }) ] }) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>window.scrollTo({ top: 0, behavior: 'smooth' }), className: "fixed bottom-6 right-6 z-50 w-10 h-10 rounded-full flex items-center justify-center backdrop-blur-sm transition-all duration-300 ".concat(scrolled ? 'opacity-100 translate-y-0' : 'opacity-0 translate-y-4 pointer-events-none'), style: { background: 'var(--site-scroll-btn-bg)', border: '1px solid var(--site-scroll-btn-border)', color: 'var(--site-scroll-btn-text)' }, "aria-label": "Scroll to top", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-5 h-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 15l7-7 7 7" }) }) }) ] }); } /***/ }) ÖÙ  ÚéÚv__webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ PersonalSitePage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7541); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(9906); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(1592); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(2982); /* harmony import */ var _components_PlanBadge__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(2035); ÛóÈ/* __next_internal_client_entry_do_not_use__ default auto */ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime"; import { useEffect, useState, useCallback } from 'react'; import { useParams, useRouter } from 'next/navigation'; import { useLocale } from '@/context/locale'; import { useSession } from '@/lib/auth'; import { getPublicSiteProfile, getOrCreateDirectRoom, sendMessage, request, getCategories, getLocations, trackSiteMessage, getPriceList } from '@/lib/api'; import { PlanBadge } from '@/components/PlanBadge'; export default function PersonalSitePage() { var _profile_portfolio, _profile_firstName, _profile_lastName, _profile_name_, _profile_name, _profile_siteSettings, _profile_siteSettings1, _profile_siteSettings2, _profile_portfolio1, _profile_portfolio2, _SITE_LOCALES_find; const { slug } = useParams(); const { t, locale, setLocale } = useLocale(); const { data: session } = useSession(); const router = useRouter(); const [profile, setProfile] = useState(null); const [loading, setLoading] = useState(true); const [notFound, setNotFound] = useState(false); const [msgLoading, setMsgLoading] = useState(false); const [linkCopied, setLinkCopied] = useState(false); const [lightbox, setLightbox] = useState(null); const [contactSent, setContactSent] = useState(false); const [contactForm, setContactForm] = useState({ name: '', email: '', message: '' }); const [contactLoading, setContactLoading] = useState(false); const [langOpen, setLangOpen] = useState(false); const [msgModal, setMsgModal] = useState(false); const [authModal, setAuthModal] = useState(false); const [msgText, setMsgText] = useState(''); const [msgSent, setMsgSent] = useState(false); const [catMap, setCatMap] = useState({}); const [locMap, setLocMap] = useState({}); const [locParentMap, setLocParentMap] = useState({}); const [priceLists, setPriceLists] = useState({}); const [scrolled, setScrolled] = useState(false); const dateLocale = locale === 'ru' ? 'ru-RU' : locale === 'uk' ? 'uk-UA' : locale === 'en' ? 'en-US' : 'el-GR'; useEffect(()=>{ const onScroll = ()=>setScrolled(window.scrollY > 100); window.addEventListener('scroll', onScroll, { passive: true }); return ()=>window.removeEventListener('scroll', onScroll); }, []); const LANG_MAP = { el: { flag: '🇬🇷', label: 'ΕλληΜικά' }, en: { flag: '🇬🇧', label: 'English' }, ru: { flag: '🇷🇺', label: 'РусскОй' }, uk: { flag: '🇺🇊', label: 'УкраїМська' }, de: { flag: '🇩🇪', label: 'Deutsch' }, fr: { flag: '🇫🇷', label: 'Français' }, it: { flag: '🇮🇹', label: 'Italiano' }, es: { flag: '🇪🇞', label: 'Español' }, ar: { flag: '🇞🇊', label: 'العرؚية' }, zh: { flag: '🇚🇳', label: 'äž­æ–‡' } }; const SITE_LOCALES = [ { code: 'el', flag: '🇬🇷', label: 'ΕλληΜικά' }, { code: 'en', flag: '🇬🇧', label: 'English' }, { code: 'ru', flag: '🇷🇺', label: 'РусскОй' } ]; useEffect(()=>{ if (!slug) return; getPublicSiteProfile(slug).then(setProfile).catch(()=>setNotFound(true)).finally(()=>setLoading(false)); }, [ slug ]); useEffect(()=>{ var _profile_siteSettings; const shouldShowPriceList = (profile === null || profile === void 0 ? void 0 : (_profile_siteSettings = profile.siteSettings) === null || _profile_siteSettings === void 0 ? void 0 : _profile_siteSettings.showPriceList) !== false; const cards = Array.isArray(profile === null || profile === void 0 ? void 0 : profile.cards) ? profile.cards : []; if (!profile || !shouldShowPriceList || cards.length === 0) { setPriceLists({}); return; } let cancelled = false; Promise.all(cards.map(async (card)=>[ card.id, await getPriceList(card.id, locale) ])).then((entries)=>{ if (cancelled) return; setPriceLists(Object.fromEntries(entries.filter((param)=>{ let [, groups] = param; return groups.length > 0; }))); }).catch(()=>{ if (!cancelled) setPriceLists({}); }); return ()=>{ cancelled = true; }; }, [ profile, locale ]); useEffect(()=>{ const catLocale = locale; getCategories().then((cats)=>{ const m = {}; for (const c of cats){ var _c_names_catLocale; m[c.slug] = (_c_names_catLocale = c.names[catLocale]) !== null && _c_names_catLocale !== void 0 ? _c_names_catLocale : c.names.el; var _c_children; for (const sub of (_c_children = c.children) !== null && _c_children !== void 0 ? _c_children : []){ var _sub_names_catLocale; m[sub.slug] = (_sub_names_catLocale = sub.names[catLocale]) !== null && _sub_names_catLocale !== void 0 ? _sub_names_catLocale : sub.names.el; } } setCatMap(m); }).catch(()=>{}); getLocations().then((locs)=>{ const m = {}; const pm = {}; for (const loc of locs){ var _loc_names, _loc_names1; var _loc_names_catLocale, _ref; const parentName = (_ref = (_loc_names_catLocale = (_loc_names = loc.names) === null || _loc_names === void 0 ? void 0 : _loc_names[catLocale]) !== null && _loc_names_catLocale !== void 0 ? _loc_names_catLocale : (_loc_names1 = loc.names) === null || _loc_names1 === void 0 ? void 0 : _loc_names1.el) !== null && _ref !== void 0 ? _ref : loc.slug; m[loc.slug] = parentName; var _loc_children; for (const child of (_loc_children = loc.children) !== null && _loc_children !== void 0 ? _loc_children : []){ var _child_names, _child_names1; var _child_names_catLocale, _ref1; m[child.slug] = (_ref1 = (_child_names_catLocale = (_child_names = child.names) === null || _child_names === void 0 ? void 0 : _child_names[catLocale]) !== null && _child_names_catLocale !== void 0 ? _child_names_catLocale : (_child_names1 = child.names) === null || _child_names1 === void 0 ? void 0 : _child_names1.el) !== null && _ref1 !== void 0 ? _ref1 : child.slug; pm[child.slug] = parentName; } } setLocMap(m); setLocParentMap(pm); }).catch(()=>{}); }, [ locale ]); function handleMessage() { if (!session) { setAuthModal(true); return; } setMsgModal(true); } async function handleSendMessage(e) { e.preventDefault(); if (!msgText.trim()) return; setMsgLoading(true); try { const { room } = await getOrCreateDirectRoom(profile.id); await sendMessage(room.id, msgText.trim()); trackSiteMessage(slug); setMsgSent(true); setMsgText(''); } catch (e) {} finally{ setMsgLoading(false); } } const handleContactSubmit = useCallback(async (e)=>{ e.preventDefault(); if (!contactForm.name.trim() || !contactForm.message.trim()) return; setContactLoading(true); try { await request("/users/site/".concat(slug, "/contact"), { method: 'POST', body: JSON.stringify(contactForm) }); setContactSent(true); setContactForm({ name: '', email: '', message: '' }); } catch (e) {} finally{ setContactLoading(false); } }, [ contactForm, slug ]); // Lightbox keyboard nav useEffect(()=>{ if (lightbox === null) return; const handler = (e)=>{ if (e.key === 'Escape') setLightbox(null); if (e.key === 'ArrowRight') setLightbox((i)=>{ var _profile_portfolio; var _profile_portfolio_length; return i !== null ? Math.min(i + 1, ((_profile_portfolio_length = profile === null || profile === void 0 ? void 0 : (_profile_portfolio = profile.portfolio) === null || _profile_portfolio === void 0 ? void 0 : _profile_portfolio.length) !== null && _profile_portfolio_length !== void 0 ? _profile_portfolio_length : 1) - 1) : null; }); if (e.key === 'ArrowLeft') setLightbox((i)=>i !== null ? Math.max(i - 1, 0) : null); }; document.addEventListener('keydown', handler); return ()=>document.removeEventListener('keydown', handler); }, [ lightbox, profile === null || profile === void 0 ? void 0 : (_profile_portfolio = profile.portfolio) === null || _profile_portfolio === void 0 ? void 0 : _profile_portfolio.length ]); if (loading) return /*#__PURE__*/ _jsx("div", { className: "min-h-screen flex items-center justify-center", style: { background: 'var(--site-bg)' }, children: /*#__PURE__*/ _jsxs("div", { className: "relative w-12 h-12", children: [ /*#__PURE__*/ _jsx("div", { className: "absolute inset-0 rounded-full border-2 border-green-500/20" }), /*#__PURE__*/ _jsx("div", { className: "absolute inset-0 rounded-full border-2 border-transparent border-t-blue-500 animate-spin" }) ] }) }); if (notFound || !profile) return /*#__PURE__*/ _jsxs("div", { className: "min-h-screen flex flex-col items-center justify-center gap-6", style: { background: 'var(--site-bg)' }, children: [ /*#__PURE__*/ _jsx("div", { className: "w-20 h-20 rounded-full flex items-center justify-center", style: { background: 'var(--site-surface)' }, children: /*#__PURE__*/ _jsx("svg", { className: "w-10 h-10 text-gray-500", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15.182 16.318A4.486 4.486 0 0012.016 15a4.486 4.486 0 00-3.198 1.318M21 12a9 9 0 11-18 0 9 9 0 0118 0zM9.75 9.75c0 .414-.168.75-.375.75S9 10.164 9 9.75 9.168 9 9.375 9s.375.336.375.75zm-.375 0h.008v.015h-.008V9.75zm5.625 0c0 .414-.168.75-.375.75s-.375-.336-.375-.75.168-.75.375-.75.375.336.375.75zm-.375 0h.008v.015h-.008V9.75z" }) }) }), /*#__PURE__*/ _jsx("p", { className: "text-gray-400 text-lg", children: t('common.not_found', 'Page not found') }), /*#__PURE__*/ _jsx("a", { href: "/", className: "text-gray-400 hover:text-gray-300 text-sm transition", children: t('nav.home', 'Home') }) ] }); var _profile_firstName_, _profile_lastName_; const initials = "".concat((_profile_firstName_ = (_profile_firstName = profile.firstName) === null || _profile_firstName === void 0 ? void 0 : _profile_firstName[0]) !== null && _profile_firstName_ !== void 0 ? _profile_firstName_ : '').concat((_profile_lastName_ = (_profile_lastName = profile.lastName) === null || _profile_lastName === void 0 ? void 0 : _profile_lastName[0]) !== null && _profile_lastName_ !== void 0 ? _profile_lastName_ : '').toUpperCase() || ((_profile_name = profile.name) === null || _profile_name === void 0 ? void 0 : (_profile_name_ = _profile_name[0]) === null || _profile_name_ === void 0 ? void 0 : _profile_name_.toUpperCase()) || '?'; const displayName = [ profile.firstName, profile.lastName ].filter(Boolean).join(' ') || profile.name || ''; const memberYear = profile.memberSince ? new Date(profile.memberSince).getFullYear() : null; const hasStats = profile.completedTasks > 0 || profile.rating || profile.reviewCount && profile.reviewCount > 0; const isLight = ((_profile_siteSettings = profile.siteSettings) === null || _profile_siteSettings === void 0 ? void 0 : _profile_siteSettings.siteTheme) === 'light'; const showServices = ((_profile_siteSettings1 = profile.siteSettings) === null || _profile_siteSettings1 === void 0 ? void 0 : _profile_siteSettings1.showServices) !== false; const showPriceList = ((_profile_siteSettings2 = profile.siteSettings) === null || _profile_siteSettings2 === void 0 ? void 0 : _profile_siteSettings2.showPriceList) !== false; const showCardsSection = showServices || showPriceList; var _profile_portfolio_length, _profile_portfolio_lightbox_title, _SITE_LOCALES_find_flag; return /*#__PURE__*/ _jsxs("div", { className: "site-theme min-h-screen selection:bg-green-500/30 ".concat(isLight ? 'site-light' : ''), style: { background: 'var(--site-bg)', color: 'var(--site-text)' }, children: [ lightbox !== null && ((_profile_portfolio1 = profile.portfolio) === null || _profile_portfolio1 === void 0 ? void 0 : _profile_portfolio1[lightbox]) && /*#__PURE__*/ _jsxs("div", { className: "fixed inset-0 z-50 bg-black/90 backdrop-blur-xl flex items-center justify-center p-4", onClick: ()=>setLightbox(null), children: [ /*#__PURE__*/ _jsx("button", { onClick: ()=>setLightbox(null), className: "absolute top-6 right-6 w-10 h-10 rounded-full bg-white/10 hover:bg-white/20 flex items-center justify-center transition", children: /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" }) }) }), lightbox > 0 && /*#__PURE__*/ _jsx("button", { onClick: (e)=>{ e.stopPropagation(); setLightbox(lightbox - 1); }, className: "absolute left-4 top-1/2 -translate-y-1/2 w-10 h-10 rounded-full bg-white/10 hover:bg-white/20 flex items-center justify-center transition", children: /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 19l-7-7 7-7" }) }) }), lightbox < ((_profile_portfolio_length = (_profile_portfolio2 = profile.portfolio) === null || _profile_portfolio2 === void 0 ? void 0 : _profile_portfolio2.length) !== null && _profile_portfolio_length !== void 0 ? _profile_portfolio_length : 1) - 1 && /*#__PURE__*/ _jsx("button", { onClick: (e)=>{ e.stopPropagation(); setLightbox(lightbox + 1); }, className: "absolute right-4 top-1/2 -translate-y-1/2 w-10 h-10 rounded-full bg-white/10 hover:bg-white/20 flex items-center justify-center transition", children: /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 5l7 7-7 7" }) }) }), /*#__PURE__*/ _jsx("img", { src: profile.portfolio[lightbox].imageUrl, alt: (_profile_portfolio_lightbox_title = profile.portfolio[lightbox].title) !== null && _profile_portfolio_lightbox_title !== void 0 ? _profile_portfolio_lightbox_title : '', className: "max-w-full max-h-[85vh] rounded-2xl object-contain", onClick: (e)=>e.stopPropagation() }), profile.portfolio[lightbox].title && /*#__PURE__*/ _jsx("div", { className: "absolute bottom-6 left-1/2 -translate-x-1/2 bg-black/60 backdrop-blur-md px-5 py-2.5 rounded-full text-sm", children: profile.portfolio[lightbox].title }) ] }), authModal && /*#__PURE__*/ _jsx("div", { className: "fixed inset-0 z-50 bg-black/70 backdrop-blur-sm flex items-center justify-center p-4", onClick: ()=>setAuthModal(false), children: /*#__PURE__*/ _jsxs("div", { className: "relative w-full max-w-sm rounded-2xl shadow-2xl p-6", style: { background: 'var(--site-modal-bg)', border: '1px solid var(--site-border)' }, onClick: (e)=>e.stopPropagation(), children: [ /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setAuthModal(false), className: "absolute top-4 right-4 w-8 h-8 rounded-full flex items-center justify-center transition", style: { background: 'var(--site-surface)', color: 'var(--site-text-muted)' }, children: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" }) }) }), /*#__PURE__*/ _jsx("div", { className: "w-12 h-12 rounded-full bg-green-500/10 flex items-center justify-center mb-4", children: /*#__PURE__*/ _jsx("svg", { className: "w-6 h-6 text-gray-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }) }), /*#__PURE__*/ _jsx("h3", { className: "text-base font-semibold mb-2", style: { color: 'var(--site-text)' }, children: t('site.auth_required_title', 'Authorization required') }), /*#__PURE__*/ _jsx("p", { className: "text-sm mb-5", style: { color: 'var(--site-text-muted)' }, children: t('site.auth_required_desc', 'To write in chat, sign in to your CanHelp account.') }), /*#__PURE__*/ _jsxs("div", { className: "flex flex-col gap-2.5", children: [ /*#__PURE__*/ _jsxs("a", { href: "/login", className: "w-full flex items-center justify-center gap-2 bg-green-600 hover:bg-green-500 text-white font-medium text-sm px-4 py-2.5 rounded-xl transition", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M11 16l-4-4m0 0l4-4m-4 4h14m-5 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h7a3 3 0 013 3v1" }) }), t('site.auth_login_btn', 'Sign in') ] }), /*#__PURE__*/ _jsxs("button", { type: "button", onClick: ()=>{ setAuthModal(false); setTimeout(()=>{ var _document_getElementById; (_document_getElementById = document.getElementById('contact')) === null || _document_getElementById === void 0 ? void 0 : _document_getElementById.scrollIntoView({ behavior: 'smooth', block: 'start' }); }, 100); }, className: "w-full flex items-center justify-center gap-2 text-sm font-medium px-4 py-2.5 rounded-xl transition", style: { background: 'var(--site-surface)', color: 'var(--site-text-secondary)', border: '1px solid var(--site-border)' }, children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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" }) }), t('site.auth_contact_form_btn', 'Write via contact form') ] }) ] }) ] }) }), msgModal && /*#__PURE__*/ _jsx("div", { className: "fixed inset-0 z-50 bg-black/70 backdrop-blur-sm flex items-center justify-center p-4", onClick: ()=>{ if (!msgLoading) { setMsgModal(false); setMsgSent(false); } }, children: /*#__PURE__*/ _jsxs("div", { className: "relative w-full max-w-md rounded-2xl shadow-2xl", style: { background: 'var(--site-modal-bg)', border: '1px solid var(--site-border)' }, onClick: (e)=>e.stopPropagation(), children: [ /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>{ setMsgModal(false); setMsgSent(false); }, className: "absolute top-4 right-4 w-8 h-8 rounded-full flex items-center justify-center transition", style: { background: 'var(--site-surface)', color: 'var(--site-text-muted)' }, children: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" }) }) }), /*#__PURE__*/ _jsxs("div", { className: "p-6", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 mb-5", children: [ /*#__PURE__*/ _jsx("div", { className: "w-10 h-10 rounded-full bg-green-500/10 flex items-center justify-center", children: /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5 text-gray-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }) }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("h3", { className: "text-base font-semibold", style: { color: 'var(--site-text)' }, children: t('site.write_to_chat', 'Write in chat') }), /*#__PURE__*/ _jsx("p", { className: "text-xs", style: { color: 'var(--site-text-muted)' }, children: displayName }) ] }) ] }), msgSent ? /*#__PURE__*/ _jsxs("div", { className: "text-center py-6", children: [ /*#__PURE__*/ _jsx("div", { className: "w-12 h-12 rounded-full bg-emerald-500/20 flex items-center justify-center mx-auto mb-3", children: /*#__PURE__*/ _jsx("svg", { className: "w-6 h-6 text-emerald-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" }) }) }), /*#__PURE__*/ _jsx("p", { className: "text-emerald-400 font-medium mb-1", children: t('site.message_sent', 'Message sent!') }), /*#__PURE__*/ _jsx("p", { className: "text-sm mb-4", style: { color: 'var(--site-text-muted)' }, children: t('site.message_sent_desc', 'The specialist will receive it in chat') }), /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>{ setMsgModal(false); setMsgSent(false); }, className: "text-sm text-gray-400 hover:text-gray-300 transition", children: t('common.close', 'Close') }) ] }) : /*#__PURE__*/ _jsxs("form", { onSubmit: handleSendMessage, children: [ /*#__PURE__*/ _jsx("textarea", { autoFocus: true, rows: 4, value: msgText, onChange: (e)=>setMsgText(e.target.value), className: "w-full rounded-xl px-4 py-3 text-sm focus:outline-none focus:border-green-500/50 transition resize-none mb-4", style: { background: 'var(--site-input-bg)', border: '1px solid var(--site-input-border)', color: 'var(--site-input-text)' }, placeholder: t('site.message_placeholder', 'Write your message...') }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-end gap-3", children: [ /*#__PURE__*/ _jsx("button", { type: "button", onClick: ()=>setMsgModal(false), className: "text-sm transition px-4 py-2", style: { color: 'var(--site-text-muted)' }, children: t('common.cancel', 'Cancel') }), /*#__PURE__*/ _jsxs("button", { type: "submit", disabled: msgLoading || !msgText.trim(), className: "inline-flex items-center gap-2 bg-green-600 hover:bg-green-500 text-white font-medium text-sm px-5 py-2.5 rounded-xl transition disabled:opacity-50", children: [ msgLoading ? /*#__PURE__*/ _jsx("div", { className: "w-4 h-4 rounded-full border-2 border-white/30 border-t-white animate-spin" }) : /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 19l9 2-9-18-9 18 9-2zm0 0v-8" }) }), t('site.contact_send', 'Send') ] }) ] }) ] }) ] }) ] }) }), /*#__PURE__*/ _jsx("nav", { className: "sticky top-0 z-40 backdrop-blur-xl", style: { background: 'var(--site-nav-bg)', borderBottom: '1px solid var(--site-border)' }, children: /*#__PURE__*/ _jsxs("div", { className: "max-w-5xl mx-auto px-4 sm:px-6 h-14 flex items-center justify-between", children: [ /*#__PURE__*/ _jsx("a", { href: "/", className: "logo-text-mini tracking-tight".concat(scrolled ? ' scrolled' : ''), style: { color: 'var(--site-text-secondary)' }, children: "CanHelp" }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-2", children: [ (profile === null || profile === void 0 ? void 0 : profile.rating) && /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-1 text-xs mr-1", style: { color: 'var(--site-text-secondary)' }, children: [ /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5 text-amber-400", fill: "currentColor", viewBox: "0 0 20 20", children: /*#__PURE__*/ _jsx("path", { d: "M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 00-1.175 0l-2.8 2.034c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 00.951-.69l1.07-3.292z" }) }), /*#__PURE__*/ _jsx("span", { className: "font-medium", children: Number(profile.rating).toFixed(1) }) ] }), /*#__PURE__*/ _jsxs("div", { className: "relative", children: [ /*#__PURE__*/ _jsxs("button", { type: "button", onClick: ()=>setLangOpen(!langOpen), className: "flex items-center gap-1.5 text-xs transition px-2 py-1 rounded-lg", style: { color: 'var(--site-text-muted)' }, children: [ /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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" }) }), (_SITE_LOCALES_find_flag = (_SITE_LOCALES_find = SITE_LOCALES.find((l)=>l.code === locale)) === null || _SITE_LOCALES_find === void 0 ? void 0 : _SITE_LOCALES_find.flag) !== null && _SITE_LOCALES_find_flag !== void 0 ? _SITE_LOCALES_find_flag : '🌐' ] }), langOpen && /*#__PURE__*/ _jsxs(_Fragment, { children: [ /*#__PURE__*/ _jsx("div", { className: "fixed inset-0 z-40", onClick: ()=>setLangOpen(false) }), /*#__PURE__*/ _jsx("div", { className: "absolute right-0 top-full mt-1 z-50 rounded-xl shadow-xl overflow-hidden min-w-[140px]", style: { background: 'var(--site-lang-dropdown)', border: '1px solid var(--site-border)' }, children: SITE_LOCALES.map((l)=>/*#__PURE__*/ _jsxs("button", { type: "button", onClick: ()=>{ setLocale(l.code); setLangOpen(false); }, className: "w-full flex items-center gap-2 px-3 py-2 text-xs transition ".concat(locale === l.code ? 'text-gray-400 bg-green-500/10' : ''), style: locale === l.code ? {} : { color: 'var(--site-text-secondary)' }, children: [ /*#__PURE__*/ _jsx("span", { children: l.flag }), /*#__PURE__*/ _jsx("span", { children: l.label }) ] }, l.code)) }) ] }) ] }), /*#__PURE__*/ _jsx("div", { className: "w-px h-4", style: { background: 'var(--site-divider)' } }), /*#__PURE__*/ _jsxs("button", { type: "button", onClick: async ()=>{ const url = window.location.href; if (navigator.share) { try { await navigator.share({ title: displayName, url }); } catch (e) {} } else { navigator.clipboard.writeText(url); setLinkCopied(true); setTimeout(()=>setLinkCopied(false), 2000); } }, className: "flex items-center gap-1.5 text-xs transition", style: { color: 'var(--site-text-muted)' }, children: [ /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8.684 13.342C8.886 12.938 9 12.482 9 12c0-.482-.114-.938-.316-1.342m0 2.684a3 3 0 110-2.684m0 2.684l6.632 3.316m-6.632-6l6.632-3.316m0 0a3 3 0 105.367-2.684 3 3 0 00-5.367 2.684zm0 9.316a3 3 0 105.368 2.684 3 3 0 00-5.368-2.684z" }) }), linkCopied ? t('profile.site.copied') : t('site.share', 'Share') ] }) ] }) ] }) }), /*#__PURE__*/ _jsxs("section", { className: "relative overflow-hidden", children: [ /*#__PURE__*/ _jsx("div", { className: "absolute top-0 left-1/4 w-[500px] h-[500px] bg-green-600/10 rounded-full blur-[120px] pointer-events-none" }), /*#__PURE__*/ _jsx("div", { className: "absolute top-20 right-1/4 w-[400px] h-[400px] bg-purple-600/8 rounded-full blur-[100px] pointer-events-none" }), /*#__PURE__*/ _jsx("div", { className: "relative max-w-5xl mx-auto px-4 sm:px-6 pt-16 pb-20 sm:pt-24 sm:pb-28", children: /*#__PURE__*/ _jsxs("div", { className: "flex flex-col items-center text-center", children: [ /*#__PURE__*/ _jsxs("div", { className: "relative group mb-6", children: [ /*#__PURE__*/ _jsx("div", { className: "absolute -inset-1 bg-gradient-to-br from-green-600 to-purple-500 rounded-full opacity-60 blur group-hover:opacity-80 transition-opacity" }), /*#__PURE__*/ _jsx("div", { className: "relative w-28 h-28 sm:w-32 sm:h-32 rounded-full overflow-hidden border-2 flex items-center justify-center text-4xl font-bold", style: { borderColor: 'var(--site-avatar-border)', background: 'var(--site-avatar-bg)', color: 'var(--site-text)' }, children: profile.image ? /*#__PURE__*/ _jsx("img", { src: profile.image, alt: displayName, className: "w-full h-full object-cover" }) : initials }), Array.isArray(profile.activeStatuses) && profile.activeStatuses.includes('canhelp_now') && /*#__PURE__*/ _jsx("div", { className: "absolute bottom-1 right-1 w-5 h-5 bg-emerald-500 rounded-full border-2 flex items-center justify-center", style: { borderColor: 'var(--site-status-border-color)' }, children: /*#__PURE__*/ _jsx("span", { className: "w-2 h-2 rounded-full bg-white animate-pulse" }) }) ] }), /*#__PURE__*/ _jsx("h1", { className: "text-3xl sm:text-5xl font-bold tracking-tight bg-clip-text text-transparent mb-3 pb-1", style: { backgroundImage: 'linear-gradient(to bottom, var(--site-name-from), var(--site-name-to))' }, children: displayName }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-center gap-2 flex-wrap mb-4", children: [ profile.planTier && profile.planTier !== 'free' && /*#__PURE__*/ _jsx(PlanBadge, { tier: profile.planTier, verified: profile.hasVerifiedBadge, size: "md" }), Array.isArray(profile.activeStatuses) && profile.activeStatuses.includes('canhelp_now') && /*#__PURE__*/ _jsxs("span", { className: "inline-flex items-center gap-1.5 text-xs font-medium text-emerald-400 bg-emerald-500/10 border border-emerald-500/20 px-3 py-1.5 rounded-full", children: [ /*#__PURE__*/ _jsx("span", { className: "w-1.5 h-1.5 rounded-full bg-emerald-400 animate-pulse" }), t('status.can_help_now', 'Available now') ] }), memberYear && /*#__PURE__*/ _jsxs("span", { className: "text-xs px-3 py-1.5 rounded-full", style: { color: 'var(--site-text-muted)', background: 'var(--site-surface)' }, children: [ t('site.member_since', 'Member since'), " ", memberYear ] }) ] }), profile.bio && /*#__PURE__*/ _jsx("p", { className: "max-w-xl text-base sm:text-lg leading-relaxed mb-8", style: { color: 'var(--site-text-secondary)' }, children: profile.bio }), /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 flex-wrap justify-center", children: [ /*#__PURE__*/ _jsxs("button", { onClick: handleMessage, disabled: msgLoading, className: "group inline-flex items-center gap-2.5 bg-green-600 hover:bg-green-500 text-white font-semibold px-7 py-3.5 rounded-full transition-all hover:shadow-lg hover:shadow-blue-500/25 disabled:opacity-50", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5 group-hover:scale-110 transition-transform", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }), t('site.write_to_chat', 'Write in chat') ] }), profile.phone && /*#__PURE__*/ _jsxs("a", { href: "tel:".concat(profile.phone), className: "group inline-flex items-center gap-2.5 border font-medium px-7 py-3.5 rounded-full transition-all", style: { background: 'var(--site-phone-bg)', borderColor: 'var(--site-phone-border)', color: 'var(--site-phone-text)' }, children: [ /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5 group-hover:scale-110 transition-transform", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M3 5a2 2 0 012-2h3.28a1 1 0 01.948.684l1.498 4.493a1 1 0 01-.502 1.21l-2.257 1.13a11.042 11.042 0 005.516 5.516l1.13-2.257a1 1 0 011.21-.502l4.493 1.498a1 1 0 01.684.949V19a2 2 0 01-2 2h-1C9.716 21 3 14.284 3 6V5z" }) }), profile.phone ] }) ] }) ] }) }) ] }), hasStats && /*#__PURE__*/ _jsx("section", { className: "border-y", style: { borderColor: 'var(--site-border)', background: 'var(--site-surface)' }, children: /*#__PURE__*/ _jsx("div", { className: "max-w-5xl mx-auto px-4 sm:px-6 py-8", children: /*#__PURE__*/ _jsxs("div", { className: "grid grid-cols-2 sm:grid-cols-4 gap-6", children: [ profile.rating && /*#__PURE__*/ _jsxs("div", { className: "text-center", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-center gap-1 mb-1", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5 text-amber-400", fill: "currentColor", viewBox: "0 0 20 20", children: /*#__PURE__*/ _jsx("path", { d: "M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 00-1.175 0l-2.8 2.034c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 00.951-.69l1.07-3.292z" }) }), /*#__PURE__*/ _jsx("span", { className: "text-2xl font-bold", children: Number(profile.rating).toFixed(1) }) ] }), /*#__PURE__*/ _jsx("p", { className: "text-xs uppercase tracking-wider", style: { color: 'var(--site-text-muted)' }, children: t('site.rating', 'Rating') }) ] }), profile.reviewCount > 0 && /*#__PURE__*/ _jsxs("div", { className: "text-center", children: [ /*#__PURE__*/ _jsx("p", { className: "text-2xl font-bold mb-1", children: profile.reviewCount }), /*#__PURE__*/ _jsx("p", { className: "text-xs uppercase tracking-wider", style: { color: 'var(--site-text-muted)' }, children: t('profile.reviews') }) ] }), profile.completedTasks > 0 && /*#__PURE__*/ _jsxs("div", { className: "text-center", children: [ /*#__PURE__*/ _jsx("p", { className: "text-2xl font-bold mb-1", children: profile.completedTasks }), /*#__PURE__*/ _jsx("p", { className: "text-xs uppercase tracking-wider", style: { color: 'var(--site-text-muted)' }, children: t('site.completed_tasks', 'Completed') }) ] }), Array.isArray(profile.languages) && profile.languages.length > 0 && /*#__PURE__*/ _jsxs("div", { className: "text-center", children: [ /*#__PURE__*/ _jsx("p", { className: "text-2xl font-bold mb-1", children: profile.languages.length }), /*#__PURE__*/ _jsx("p", { className: "text-xs uppercase tracking-wider", style: { color: 'var(--site-text-muted)' }, children: t('site.languages', 'Languages') }) ] }) ] }) }) }), Array.isArray(profile.languages) && profile.languages.length > 0 && /*#__PURE__*/ _jsxs("section", { className: "max-w-5xl mx-auto px-4 sm:px-6 pt-10", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 mb-3", children: [ /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 shrink-0", style: { color: 'var(--site-text-muted)' }, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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" }) }), /*#__PURE__*/ _jsx("span", { className: "text-sm", style: { color: 'var(--site-text-muted)' }, children: t('site.speaks_languages', 'Speaks languages') }) ] }), /*#__PURE__*/ _jsx("div", { className: "flex items-center gap-2 flex-wrap", children: profile.languages.map((lang)=>{ const info = LANG_MAP[lang]; return /*#__PURE__*/ _jsx("span", { className: "text-xs px-3 py-1.5 rounded-full flex items-center gap-1.5", style: { color: 'var(--site-tag-text)', background: 'var(--site-tag-bg)', border: '1px solid var(--site-tag-border)' }, children: info ? /*#__PURE__*/ _jsxs(_Fragment, { children: [ info.flag, " ", info.label ] }) : lang }, lang); }) }) ] }), /*#__PURE__*/ _jsxs("div", { className: "max-w-5xl mx-auto px-4 sm:px-6 pb-20 space-y-16 mt-10", children: [ showServices && Array.isArray(profile.cards) && profile.cards.length > 0 && /*#__PURE__*/ _jsxs("section", { children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 mb-6", children: [ /*#__PURE__*/ _jsx("div", { className: "w-8 h-8 rounded-lg bg-green-500/10 flex items-center justify-center", children: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-gray-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M21 13.255A23.931 23.931 0 0112 15c-3.183 0-6.22-.62-9-1.745M16 6V4a2 2 0 00-2-2h-4a2 2 0 00-2 2v2m4 6h.01M5 20h14a2 2 0 002-2V8a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z" }) }) }), /*#__PURE__*/ _jsx("h2", { className: "text-xl font-bold", children: t('specialist.services', 'Services') }) ] }), /*#__PURE__*/ _jsx("div", { className: "grid gap-4 sm:grid-cols-2", children: profile.cards.map((card)=>{ // Group locations by parent const grouped = {}; if (Array.isArray(card.locations)) { for (const slug of card.locations){ const parent = locParentMap[slug]; if (parent) { if (!grouped[parent]) grouped[parent] = []; grouped[parent].push(locMap[slug] || slug); } else { const name = locMap[slug] || slug; if (!grouped[name]) grouped[name] = []; } } } return /*#__PURE__*/ _jsxs("div", { className: "group relative rounded-2xl p-6 transition-all", style: { background: 'var(--site-card-bg)', border: '1px solid var(--site-card-border)' }, children: [ /*#__PURE__*/ _jsx("h3", { className: "font-semibold mb-2", style: { color: 'var(--site-text)' }, children: card.title }), showServices && (()=>{ const desc = (locale === 'el' ? card.descriptionEl : locale === 'en' ? card.descriptionEn : locale === 'ru' ? card.descriptionRu : card.descriptionUk) || card.descriptionEl || card.descriptionEn || card.descriptionRu || card.descriptionUk || card.description; return desc ? /*#__PURE__*/ _jsx("p", { className: "text-sm leading-relaxed mb-3", style: { color: 'var(--site-text-muted)' }, children: desc }) : null; })(), showServices && Array.isArray(card.categories) && card.categories.length > 0 && /*#__PURE__*/ _jsx("div", { className: "flex flex-wrap gap-1.5 mb-3", children: card.categories.map((slug)=>/*#__PURE__*/ _jsx("span", { className: "text-[11px] px-2.5 py-1 rounded-full bg-purple-500/10 text-purple-400 border border-purple-500/10", children: catMap[slug] || slug }, slug)) }), showServices && Object.keys(grouped).length > 0 && /*#__PURE__*/ _jsx("div", { className: "mb-3 space-y-1", children: Object.entries(grouped).map((param)=>{ let [parent, children] = param; return /*#__PURE__*/ _jsxs("div", { className: "flex items-start gap-1.5 text-xs", style: { color: 'var(--site-text-muted)' }, children: [ /*#__PURE__*/ _jsxs("svg", { className: "w-3.5 h-3.5 shrink-0 mt-0.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ _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" }), /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 11a3 3 0 11-6 0 3 3 0 016 0z" }) ] }), /*#__PURE__*/ _jsxs("span", { children: [ /*#__PURE__*/ _jsx("span", { className: "font-medium", style: { color: 'var(--site-text-secondary)' }, children: parent }), children.length > 0 && /*#__PURE__*/ _jsxs("span", { style: { color: 'var(--site-text-hint)' }, children: [ " — ", children.join(', ') ] }) ] }) ] }, parent); }) }), showServices && Array.isArray(card.skills) && card.skills.length > 0 && /*#__PURE__*/ _jsx("div", { className: "flex flex-wrap gap-1.5", children: card.skills.map((s)=>/*#__PURE__*/ _jsx("span", { className: "text-[11px] px-2.5 py-1 rounded-full bg-green-500/10 text-gray-400 border border-green-500/10", children: s }, s)) }), showPriceList && Array.isArray(priceLists[card.id]) && priceLists[card.id].length > 0 && /*#__PURE__*/ _jsxs("div", { className: "".concat(showServices ? 'mt-4 pt-4 border-t' : ''), style: { borderColor: 'var(--site-card-border)' }, children: [ /*#__PURE__*/ _jsx("p", { className: "text-xs font-semibold uppercase tracking-wider mb-3", style: { color: 'var(--site-text-muted)' }, children: t('site.pricelist', 'Price list') }), /*#__PURE__*/ _jsx("div", { className: "space-y-3", children: priceLists[card.id].map((group)=>/*#__PURE__*/ _jsxs("div", { className: "rounded-xl p-4", style: { background: 'var(--site-surface)', border: '1px solid var(--site-card-border)' }, children: [ /*#__PURE__*/ _jsx("p", { className: "font-semibold mb-3", style: { color: 'var(--site-text)' }, children: group.title }), /*#__PURE__*/ _jsx("div", { className: "space-y-3", children: group.items.map((item)=>/*#__PURE__*/ _jsxs("div", { className: "flex items-start justify-between gap-4", children: [ /*#__PURE__*/ _jsxs("div", { className: "min-w-0", children: [ /*#__PURE__*/ _jsx("p", { className: "text-sm font-medium", style: { color: 'var(--site-text-secondary)' }, children: item.name }), item.description && /*#__PURE__*/ _jsx("p", { className: "text-xs mt-0.5", style: { color: 'var(--site-text-muted)' }, children: item.description }) ] }), (item.price || item.unit) && /*#__PURE__*/ _jsxs("div", { className: "shrink-0 text-sm font-semibold", style: { color: 'var(--site-text)' }, children: [ item.price ? "€".concat(item.price) : '', item.unit ? " ".concat(item.unit) : '' ] }) ] }, item.id)) }) ] }, group.id)) }) ] }) ] }, card.id); }) }) ] }), Array.isArray(profile.portfolio) && profile.portfolio.length > 0 && /*#__PURE__*/ _jsxs("section", { children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 mb-6", children: [ /*#__PURE__*/ _jsx("div", { className: "w-8 h-8 rounded-lg bg-purple-500/10 flex items-center justify-center", children: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-purple-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z" }) }) }), /*#__PURE__*/ _jsx("h2", { className: "text-xl font-bold", children: t('portfolio.title', 'Portfolio') }), /*#__PURE__*/ _jsxs("span", { className: "text-xs ml-auto", style: { color: 'var(--site-text-hint)' }, children: [ profile.portfolio.length, " ", t('site.photos', 'photos') ] }) ] }), /*#__PURE__*/ _jsx("div", { className: "grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 gap-3", children: profile.portfolio.map((item, idx)=>{ var _item_title; return /*#__PURE__*/ _jsxs("button", { onClick: ()=>item.imageUrl && setLightbox(idx), className: "group relative aspect-square rounded-xl overflow-hidden transition-all", style: { background: 'var(--site-surface)', border: '1px solid var(--site-card-border)' }, children: [ item.imageUrl && /*#__PURE__*/ _jsx("img", { src: item.imageUrl, alt: (_item_title = item.title) !== null && _item_title !== void 0 ? _item_title : '', className: "w-full h-full object-cover group-hover:scale-105 transition-transform duration-500" }), /*#__PURE__*/ _jsx("div", { className: "absolute inset-0 bg-gradient-to-t from-black/60 via-transparent to-transparent opacity-0 group-hover:opacity-100 transition-opacity flex items-end p-3", children: item.title && /*#__PURE__*/ _jsx("p", { className: "text-xs font-medium text-white truncate", children: item.title }) }), /*#__PURE__*/ _jsx("div", { className: "absolute top-2 right-2 w-7 h-7 rounded-full bg-black/40 backdrop-blur-md flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity", children: /*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5 text-white/80", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0zM10 7v3m0 0v3m0-3h3m-3 0H7" }) }) }) ] }, item.id); }) }) ] }), Array.isArray(profile.reviews) && profile.reviews.length > 0 && /*#__PURE__*/ _jsxs("section", { children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 mb-6", children: [ /*#__PURE__*/ _jsx("div", { className: "w-8 h-8 rounded-lg bg-amber-500/10 flex items-center justify-center", children: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-amber-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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" }) }) }), /*#__PURE__*/ _jsx("h2", { className: "text-xl font-bold", children: t('profile.reviews') }), /*#__PURE__*/ _jsx("span", { className: "text-xs ml-auto", style: { color: 'var(--site-text-hint)' }, children: profile.reviewCount }) ] }), /*#__PURE__*/ _jsx("div", { className: "space-y-3", children: profile.reviews.slice(0, 6).map((review)=>{ var _review_authorFirstName, _review_authorName; const authorName = [ review.authorFirstName, review.authorLastName ].filter(Boolean).join(' ') || review.authorName || null; var _review_authorFirstName_, _ref; return /*#__PURE__*/ _jsxs("div", { className: "rounded-2xl p-5", style: { background: 'var(--site-card-bg)', border: '1px solid var(--site-card-border)' }, children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-start gap-3 mb-3", children: [ /*#__PURE__*/ _jsx("div", { className: "w-9 h-9 rounded-full flex items-center justify-center text-xs font-bold overflow-hidden shrink-0", style: { background: 'var(--site-surface)', color: 'var(--site-text-muted)' }, children: review.authorImage ? /*#__PURE__*/ _jsx("img", { src: review.authorImage, alt: "", className: "w-full h-full object-cover" }) : ((_ref = (_review_authorFirstName_ = (_review_authorFirstName = review.authorFirstName) === null || _review_authorFirstName === void 0 ? void 0 : _review_authorFirstName[0]) !== null && _review_authorFirstName_ !== void 0 ? _review_authorFirstName_ : (_review_authorName = review.authorName) === null || _review_authorName === void 0 ? void 0 : _review_authorName[0]) !== null && _ref !== void 0 ? _ref : '?').toUpperCase() }), /*#__PURE__*/ _jsxs("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between gap-2", children: [ /*#__PURE__*/ _jsx("p", { className: "text-sm font-medium", style: { color: 'var(--site-text-secondary)' }, children: authorName !== null && authorName !== void 0 ? authorName : t('common.anonymous', 'Anonymous') }), /*#__PURE__*/ _jsx("span", { className: "shrink-0 text-[11px]", style: { color: 'var(--site-text-hint)' }, children: new Date(review.createdAt).toLocaleDateString(dateLocale) }) ] }), /*#__PURE__*/ _jsx("div", { className: "flex gap-0.5 mt-0.5", children: Array.from({ length: 5 }).map((_, i)=>/*#__PURE__*/ _jsx("svg", { className: "w-3.5 h-3.5 ".concat(i < Math.round(review.rating) ? 'text-amber-400' : ''), style: i < Math.round(review.rating) ? {} : { color: 'var(--site-border)' }, fill: "currentColor", viewBox: "0 0 20 20", children: /*#__PURE__*/ _jsx("path", { d: "M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 00-1.175 0l-2.8 2.034c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 00.951-.69l1.07-3.292z" }) }, i)) }) ] }) ] }), review.comment && /*#__PURE__*/ _jsx("p", { className: "text-sm leading-relaxed pl-12", style: { color: 'var(--site-text-muted)' }, children: review.comment }) ] }, review.id); }) }) ] }), /*#__PURE__*/ _jsxs("section", { id: "contact", children: [ /*#__PURE__*/ _jsxs("div", { className: "flex items-center gap-3 mb-6", children: [ /*#__PURE__*/ _jsx("div", { className: "w-8 h-8 rounded-lg bg-emerald-500/10 flex items-center justify-center", children: /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4 text-emerald-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _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" }) }) }), /*#__PURE__*/ _jsx("h2", { className: "text-xl font-bold", children: t('site.contact_form', 'Contact') }) ] }), contactSent ? /*#__PURE__*/ _jsxs("div", { className: "bg-emerald-500/10 border border-emerald-500/20 rounded-2xl p-8 text-center", children: [ /*#__PURE__*/ _jsx("div", { className: "w-12 h-12 rounded-full bg-emerald-500/20 flex items-center justify-center mx-auto mb-3", children: /*#__PURE__*/ _jsx("svg", { className: "w-6 h-6 text-emerald-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" }) }) }), /*#__PURE__*/ _jsx("p", { className: "text-emerald-400 font-medium", children: t('site.contact_sent', 'Message sent!') }), /*#__PURE__*/ _jsx("p", { className: "text-sm mt-1", style: { color: 'var(--site-text-muted)' }, children: t('site.contact_sent_desc', 'The specialist will contact you shortly') }) ] }) : /*#__PURE__*/ _jsxs("form", { onSubmit: handleContactSubmit, className: "rounded-2xl p-6 space-y-4", style: { background: 'var(--site-card-bg)', border: '1px solid var(--site-card-border)' }, children: [ /*#__PURE__*/ _jsxs("div", { className: "grid gap-4 sm:grid-cols-2", children: [ /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("label", { className: "text-xs uppercase tracking-wider mb-1.5 block", style: { color: 'var(--site-text-muted)' }, children: [ t('site.contact_name', 'Name'), " *" ] }), /*#__PURE__*/ _jsx("input", { type: "text", required: true, value: contactForm.name, onChange: (e)=>setContactForm((f)=>({ ...f, name: e.target.value })), className: "w-full rounded-xl px-4 py-3 text-sm focus:outline-none focus:border-green-500/50 transition", style: { background: 'var(--site-input-bg)', border: '1px solid var(--site-input-border)', color: 'var(--site-input-text)' }, placeholder: t('site.contact_name_ph', 'Your name') }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsx("label", { className: "text-xs uppercase tracking-wider mb-1.5 block", style: { color: 'var(--site-text-muted)' }, children: "Email" }), /*#__PURE__*/ _jsx("input", { type: "email", value: contactForm.email, onChange: (e)=>setContactForm((f)=>({ ...f, email: e.target.value })), className: "w-full rounded-xl px-4 py-3 text-sm focus:outline-none focus:border-green-500/50 transition", style: { background: 'var(--site-input-bg)', border: '1px solid var(--site-input-border)', color: 'var(--site-input-text)' }, placeholder: t('site.contact_email_ph', 'your@email.com') }) ] }) ] }), /*#__PURE__*/ _jsxs("div", { children: [ /*#__PURE__*/ _jsxs("label", { className: "text-xs uppercase tracking-wider mb-1.5 block", style: { color: 'var(--site-text-muted)' }, children: [ t('site.contact_message', 'Message'), " *" ] }), /*#__PURE__*/ _jsx("textarea", { required: true, rows: 4, value: contactForm.message, onChange: (e)=>setContactForm((f)=>({ ...f, message: e.target.value })), className: "w-full rounded-xl px-4 py-3 text-sm focus:outline-none focus:border-green-500/50 transition resize-none", style: { background: 'var(--site-input-bg)', border: '1px solid var(--site-input-border)', color: 'var(--site-input-text)' }, placeholder: t('site.contact_message_ph', 'Describe your task...') }) ] }), /*#__PURE__*/ _jsxs("button", { type: "submit", disabled: contactLoading, className: "inline-flex items-center gap-2 bg-green-600 hover:bg-green-500 text-white font-medium px-6 py-3 rounded-xl transition disabled:opacity-50", children: [ contactLoading ? /*#__PURE__*/ _jsx("div", { className: "w-4 h-4 rounded-full border-2 border-white/30 border-t-white animate-spin" }) : /*#__PURE__*/ _jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 19l9 2-9-18-9 18 9-2zm0 0v-8" }) }), t('site.contact_send', 'Send') ] }) ] }) ] }), /*#__PURE__*/ _jsx("footer", { className: "border-t pt-8 pb-4", style: { borderColor: 'var(--site-border)' }, children: /*#__PURE__*/ _jsxs("div", { className: "flex items-center justify-between text-xs", style: { color: 'var(--site-footer-text)' }, children: [ /*#__PURE__*/ _jsx("a", { href: "/", className: "transition", children: "CanHelp.gr" }), /*#__PURE__*/ _jsxs("p", { children: [ "\xa9 ", new Date().getFullYear() ] }) ] }) }) ] }), /*#__PURE__*/ _jsx("button", { onClick: ()=>window.scrollTo({ top: 0, behavior: 'smooth' }), className: "fixed bottom-6 right-6 z-50 w-10 h-10 rounded-full flex items-center justify-center backdrop-blur-sm transition-all duration-300 ".concat(scrolled ? 'opacity-100 translate-y-0' : 'opacity-0 translate-y-4 pointer-events-none'), style: { background: 'var(--site-scroll-btn-bg)', border: '1px solid var(--site-scroll-btn-border)', color: 'var(--site-scroll-btn-text)' }, "aria-label": "Scroll to top", children: /*#__PURE__*/ _jsx("svg", { className: "w-5 h-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 15l7-7 7 7" }) }) }) ] }); } —Q61146undefined148204undefined206260undefined262306undefined308347undefined349503undefined505555undefined557571undefined854862(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useParams)undefined904912(0,_context_locale__WEBPACK_IMPORTED_MODULE_3__/* .useLocale */ .Y)undefined947956(0,_lib_auth__WEBPACK_IMPORTED_MODULE_4__/* .useSession */ .wV)undefined980988(0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)undefined10271034(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined10771084(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined11291136(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined11861193(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined12431250(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined12961303(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined13541361(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined14131420(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined15371544(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined15901597(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined16431650(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined16981705(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined17491756(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined17971804(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined18461853(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined18921899(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined19501957(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined20042011(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined20542061(0,react__WEBPACK_IMPORTED_MODULE_1__.useState)undefined21912199(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined36103618(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined36613680(0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getPublicSiteProfile */ .S$)undefined38003808(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined44674478(0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getPriceList */ .Ck)undefined49344942(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined49925004(0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getCategories */ .bW)undefined57225733(0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getLocations */ .Vs)undefined75367556(0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getOrCreateDirectRoom */ .QN)undefined75897599(0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .sendMessage */ ._z)undefined76397654(0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .trackSiteMessage */ .UE)undefined78357845(0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)undefined80308036(0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Em)undefined85038511(0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)undefined96379640(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined98209824(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined99349937(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1009010093(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1032910333(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1054210545(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1078010783(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1105411057(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1160811611(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1178011783(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1376213766(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1419214196(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1443214435(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1471114714(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1501515018(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1533315336(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1574515748(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1604916052(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1660016603(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1701317016(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1731717320(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1761117614(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1813418137(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1845618459(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1867518679(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined1907619079(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1958019583(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined1990819911(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2023820241(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2042320426(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2076520768(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2123221235(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2160221605(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2198821992(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2215322157(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2251322516(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2291322916(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2350623510(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2486224865(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2526225265(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2599025993(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2635726361(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2675426757(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2737327376(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2770127704(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2803128035(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2817828182(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2837428377(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2858628589(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2902429027(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined2960329607(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined2973629739(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3025430257(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3088830892(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3107231075(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3129931302(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3174031743(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3217632179(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3247232475(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3295732960(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3359933603(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3378233785(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3479734801(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3502435027(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3569835702(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3623836241(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3647436477(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3697036973(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3788137884(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3816338167(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3835238355(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3876138765(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3899839002(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined3936239365(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined3966139664(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4021940222(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4055540559(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined4073140735(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined4131241315(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4176441767(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4268042684(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined4268642694react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragmentundefined4281742820(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4311443117(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4368743691(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined4469344696(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4493944942(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4549745500(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4580945813(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined4715047153(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4755447557(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4840648410(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined4854248545(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4875748760(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4897448977(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4914449148(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined4932649330(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined4951349516(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined4981849821(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined5044850451(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined5093150934(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined5137051373(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined5170051703(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined5220352207(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined5247552478(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined5248052488_components_PlanBadge__WEBPACK_IMPORTED_MODULE_6__/* .PlanBadge */ .dundefined5288552889(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined5321953222(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined5365353657(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined5450354506(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined5491654920(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined5513255136(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined5565755660(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined5614856151(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined5690056904(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined5762057623(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined5811158114(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined5904559048(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined5929559298(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined5942359427(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined5961059614(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined5977759781(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined6000060003(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined6031160314(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined6088560888(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined6125261255(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined6177061774(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined6193761940(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined6218762190(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined6270262706(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined6286962872(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined6312263125(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined6369363697(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined6386063863(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined6411564118(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined6474764751(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined6489564899(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined6505565058(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined6553665539(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined6594065943(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined6635766360(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined6661566618(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined6709067094(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined6709667104react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragmentundefined6753267536(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined6776967773(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined6786667870(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined6805068053(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined6825068253(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined6866468667(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined6923069233(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined6954969552(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined7070370707(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined7118771190(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined7203572038(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined7266072663(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined7286472867(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined7335373356(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined7369873702(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined7417474178(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined7478574788(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined7530775310(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined7590075904(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined7607476077(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined7672176725(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined7788877891(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined7808078083(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined7858178585(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined7903379036(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined7960579608(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined7981279816(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined8043380436(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined8105681059(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined8128681290(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined8162481628(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined8195581958(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined8277582778(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined8377183775(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined8561085614(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined8570785711(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined8589185894(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined8609286095(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined8650886511(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined8705587058(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined8731487318(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined8799888001(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined8830088304(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined8891788920(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined8938489387(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined8969789700(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined9004590048(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined9035290355(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined9081890821(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined9158391587(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined9168091684(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined9186491867(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined9206492067(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined9247992482(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined9323293235(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined9347893481(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined9394793950(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined9459494598(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined9504895052(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined9527995282(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined9587295875(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined9674796751(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined9698996993(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined9728097283(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined9799798000(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined9879798800(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined9916799170(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined9992399926(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined100864100867(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined101523101527(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined101659101663(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined101843101846(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined102045102048(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined102462102465(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined102956102959(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined103286103290(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined103516103519(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined103735103738(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined104152104155(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined104560104563(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined104835104838(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined105323105327(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined105795105799(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined106000106004(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined106141106145(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined106895106898(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined108359108363(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined108500108503(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined109044109047(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined110518110522(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined110643110647(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined111323111326(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined112674112678(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined113133113136(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined113345113348(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined113769113772(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined114431114434(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined114675114679(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined114993114996(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined115254115258(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)undefined115642115645(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined116380116383(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefined116636116639(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)undefinedÜÝ }, «webpack/lib/util/registerExternalSerializerœwebpack-sources/PrefixSource‰/******/ 2__webpack_require__ => { // webpackRuntimeModules çvar __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId)) __webpack_require__.O(0, [1516,9906,2982,587,18,7358], () => (__webpack_exec__(409))); var __webpack_exports__ = __webpack_require__.O(); _N_E = __webpack_exports__; } ]); †þÿÿÑ(self["webpackChunk_N_E"] = self["webpackChunk_N_E"] || []).push([[488],{ /***/ 409: /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 6235)); /***/ }), /***/ 1592: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ CI: () => (/* binding */ signOut), /* harmony export */ Hh: () => (/* binding */ signUp), /* harmony export */ Jv: () => (/* binding */ signIn), /* harmony export */ wV: () => (/* binding */ useSession), /* harmony export */ yK: () => (/* binding */ authClient) /* harmony export */ }); /* harmony import */ var better_auth_react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6504); const API_URL = "https://api.canhelp.gr" || 0; const authClient = (0,better_auth_react__WEBPACK_IMPORTED_MODULE_0__/* .createAuthClient */ .M)({ baseURL: API_URL }); const { signIn, signOut, signUp, useSession } = authClient; /***/ }), /***/ 2035: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ d: () => (/* binding */ PlanBadge) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); const tierConfig = { free: { label: 'Free', class: 'bg-gray-100 text-gray-500 border border-gray-200', icon: '' }, pro: { label: 'Pro', class: 'bg-green-100 text-green-700 border border-green-200', icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { viewBox: "0 0 16 16", fill: "none", className: "w-3 h-3 inline-block mr-0.5 -mt-px", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z", fill: "currentColor" }) }) }, ultimate: { label: 'Ultimate', class: 'bg-gradient-to-r from-amber-400 via-yellow-400 to-amber-400 text-gray-900 border border-amber-500 shadow-sm shadow-amber-300/50', icon: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { viewBox: "0 0 16 16", fill: "none", className: "w-3 h-3 inline-block mr-0.5 -mt-px", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z", fill: "currentColor" }) }) } }; function PlanBadge(param) { let { tier, verified, size = 'sm', className = '' } = param; if (tier === 'free' && !verified) return null; const sizeClass = size === 'sm' ? 'text-[10px] px-1.5 py-0.5' : 'text-xs px-2 py-0.5'; if (verified && tier !== 'free') { return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "inline-flex items-center gap-1 rounded-full font-semibold ".concat(sizeClass, " ").concat(tierConfig[tier].class, " ").concat(className), children: [ tier === 'ultimate' ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(StarIcon, { className: "w-3 h-3 fill-gray-900" }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(VerifiedIcon, { className: "w-3 h-3" }), tierConfig[tier].label ] }); } if (verified) { return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "inline-flex items-center gap-0.5 rounded-full font-semibold ".concat(sizeClass, " bg-green-100 text-green-700 border border-green-200 ").concat(className), children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(VerifiedIcon, { className: "w-3 h-3" }) }); } const cfg = tierConfig[tier]; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "inline-flex items-center rounded-full font-semibold ".concat(sizeClass, " ").concat(cfg.class, " ").concat(className), children: [ tier === 'pro' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(StarIcon, { className: "w-3 h-3 mr-0.5 -mt-px" }), tier === 'ultimate' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(StarIcon, { className: "w-3 h-3 mr-0.5 -mt-px fill-gray-900" }), cfg.label ] }); } function StarIcon(param) { let { className = '' } = param; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { viewBox: "0 0 16 16", fill: "none", className: className, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z", fill: "currentColor" }) }); } function VerifiedIcon(param) { let { className = '' } = param; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { viewBox: "0 0 16 16", fill: "none", className: className, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M8 1l2 1.4 2.4-.4 1 2.2 2 1.2-.4 2.4L16 10l-1.8 1.6.4 2.4-2.2.8L10.8 17 8 16.2 5.2 17l-1.2-2.2-2.2-.8.4-2.4L0 10l1-2.2-.4-2.4 2-1.2 1-2.2 2.4.4L8 1z", fill: "#3B82F6" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M5.5 8.5l1.5 1.5 3-3", stroke: "white", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) ] }); } /***/ }), /***/ 6235: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ PersonalSitePage) /* harmony export */ }); /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4568); /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7620); /* harmony import */ var next_navigation__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7541); /* harmony import */ var _context_locale__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(9906); /* harmony import */ var _lib_auth__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(1592); /* harmony import */ var _lib_api__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(2982); /* harmony import */ var _components_PlanBadge__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(2035); /* __next_internal_client_entry_do_not_use__ default auto */ function PersonalSitePage() { var _profile_portfolio, _profile_firstName, _profile_lastName, _profile_name_, _profile_name, _profile_siteSettings, _profile_siteSettings1, _profile_siteSettings2, _profile_portfolio1, _profile_portfolio2, _SITE_LOCALES_find; const { slug } = (0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useParams)(); const { t, locale, setLocale } = (0,_context_locale__WEBPACK_IMPORTED_MODULE_3__/* .useLocale */ .Y)(); const { data: session } = (0,_lib_auth__WEBPACK_IMPORTED_MODULE_4__/* .useSession */ .wV)(); const router = (0,next_navigation__WEBPACK_IMPORTED_MODULE_2__.useRouter)(); const [profile, setProfile] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [loading, setLoading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(true); const [notFound, setNotFound] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [msgLoading, setMsgLoading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [linkCopied, setLinkCopied] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [lightbox, setLightbox] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(null); const [contactSent, setContactSent] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [contactForm, setContactForm] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)({ name: '', email: '', message: '' }); const [contactLoading, setContactLoading] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [langOpen, setLangOpen] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [msgModal, setMsgModal] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [authModal, setAuthModal] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [msgText, setMsgText] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(''); const [msgSent, setMsgSent] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const [catMap, setCatMap] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)({}); const [locMap, setLocMap] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)({}); const [locParentMap, setLocParentMap] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)({}); const [priceLists, setPriceLists] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)({}); const [scrolled, setScrolled] = (0,react__WEBPACK_IMPORTED_MODULE_1__.useState)(false); const dateLocale = locale === 'ru' ? 'ru-RU' : locale === 'uk' ? 'uk-UA' : locale === 'en' ? 'en-US' : 'el-GR'; (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ const onScroll = ()=>setScrolled(window.scrollY > 100); window.addEventListener('scroll', onScroll, { passive: true }); return ()=>window.removeEventListener('scroll', onScroll); }, []); const LANG_MAP = { el: { flag: '🇬🇷', label: 'ΕλληΜικά' }, en: { flag: '🇬🇧', label: 'English' }, ru: { flag: '🇷🇺', label: 'РусскОй' }, uk: { flag: '🇺🇊', label: 'УкраїМська' }, de: { flag: '🇩🇪', label: 'Deutsch' }, fr: { flag: '🇫🇷', label: 'Français' }, it: { flag: '🇮🇹', label: 'Italiano' }, es: { flag: '🇪🇞', label: 'Español' }, ar: { flag: '🇞🇊', label: 'العرؚية' }, zh: { flag: '🇚🇳', label: 'äž­æ–‡' } }; const SITE_LOCALES = [ { code: 'el', flag: '🇬🇷', label: 'ΕλληΜικά' }, { code: 'en', flag: '🇬🇧', label: 'English' }, { code: 'ru', flag: '🇷🇺', label: 'РусскОй' } ]; (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (!slug) return; (0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getPublicSiteProfile */ .S$)(slug).then(setProfile).catch(()=>setNotFound(true)).finally(()=>setLoading(false)); }, [ slug ]); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ var _profile_siteSettings; const shouldShowPriceList = (profile === null || profile === void 0 ? void 0 : (_profile_siteSettings = profile.siteSettings) === null || _profile_siteSettings === void 0 ? void 0 : _profile_siteSettings.showPriceList) !== false; const cards = Array.isArray(profile === null || profile === void 0 ? void 0 : profile.cards) ? profile.cards : []; if (!profile || !shouldShowPriceList || cards.length === 0) { setPriceLists({}); return; } let cancelled = false; Promise.all(cards.map(async (card)=>[ card.id, await (0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getPriceList */ .Ck)(card.id, locale) ])).then((entries)=>{ if (cancelled) return; setPriceLists(Object.fromEntries(entries.filter((param)=>{ let [, groups] = param; return groups.length > 0; }))); }).catch(()=>{ if (!cancelled) setPriceLists({}); }); return ()=>{ cancelled = true; }; }, [ profile, locale ]); (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ const catLocale = locale; (0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getCategories */ .bW)().then((cats)=>{ const m = {}; for (const c of cats){ var _c_names_catLocale; m[c.slug] = (_c_names_catLocale = c.names[catLocale]) !== null && _c_names_catLocale !== void 0 ? _c_names_catLocale : c.names.el; var _c_children; for (const sub of (_c_children = c.children) !== null && _c_children !== void 0 ? _c_children : []){ var _sub_names_catLocale; m[sub.slug] = (_sub_names_catLocale = sub.names[catLocale]) !== null && _sub_names_catLocale !== void 0 ? _sub_names_catLocale : sub.names.el; } } setCatMap(m); }).catch(()=>{}); (0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getLocations */ .Vs)().then((locs)=>{ const m = {}; const pm = {}; for (const loc of locs){ var _loc_names, _loc_names1; var _loc_names_catLocale, _ref; const parentName = (_ref = (_loc_names_catLocale = (_loc_names = loc.names) === null || _loc_names === void 0 ? void 0 : _loc_names[catLocale]) !== null && _loc_names_catLocale !== void 0 ? _loc_names_catLocale : (_loc_names1 = loc.names) === null || _loc_names1 === void 0 ? void 0 : _loc_names1.el) !== null && _ref !== void 0 ? _ref : loc.slug; m[loc.slug] = parentName; var _loc_children; for (const child of (_loc_children = loc.children) !== null && _loc_children !== void 0 ? _loc_children : []){ var _child_names, _child_names1; var _child_names_catLocale, _ref1; m[child.slug] = (_ref1 = (_child_names_catLocale = (_child_names = child.names) === null || _child_names === void 0 ? void 0 : _child_names[catLocale]) !== null && _child_names_catLocale !== void 0 ? _child_names_catLocale : (_child_names1 = child.names) === null || _child_names1 === void 0 ? void 0 : _child_names1.el) !== null && _ref1 !== void 0 ? _ref1 : child.slug; pm[child.slug] = parentName; } } setLocMap(m); setLocParentMap(pm); }).catch(()=>{}); }, [ locale ]); function handleMessage() { if (!session) { setAuthModal(true); return; } setMsgModal(true); } async function handleSendMessage(e) { e.preventDefault(); if (!msgText.trim()) return; setMsgLoading(true); try { const { room } = await (0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .getOrCreateDirectRoom */ .QN)(profile.id); await (0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .sendMessage */ ._z)(room.id, msgText.trim()); (0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .trackSiteMessage */ .UE)(slug); setMsgSent(true); setMsgText(''); } catch (e) {} finally{ setMsgLoading(false); } } const handleContactSubmit = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)(async (e)=>{ e.preventDefault(); if (!contactForm.name.trim() || !contactForm.message.trim()) return; setContactLoading(true); try { await (0,_lib_api__WEBPACK_IMPORTED_MODULE_5__/* .request */ .Em)("/users/site/".concat(slug, "/contact"), { method: 'POST', body: JSON.stringify(contactForm) }); setContactSent(true); setContactForm({ name: '', email: '', message: '' }); } catch (e) {} finally{ setContactLoading(false); } }, [ contactForm, slug ]); // Lightbox keyboard nav (0,react__WEBPACK_IMPORTED_MODULE_1__.useEffect)(()=>{ if (lightbox === null) return; const handler = (e)=>{ if (e.key === 'Escape') setLightbox(null); if (e.key === 'ArrowRight') setLightbox((i)=>{ var _profile_portfolio; var _profile_portfolio_length; return i !== null ? Math.min(i + 1, ((_profile_portfolio_length = profile === null || profile === void 0 ? void 0 : (_profile_portfolio = profile.portfolio) === null || _profile_portfolio === void 0 ? void 0 : _profile_portfolio.length) !== null && _profile_portfolio_length !== void 0 ? _profile_portfolio_length : 1) - 1) : null; }); if (e.key === 'ArrowLeft') setLightbox((i)=>i !== null ? Math.max(i - 1, 0) : null); }; document.addEventListener('keydown', handler); return ()=>document.removeEventListener('keydown', handler); }, [ lightbox, profile === null || profile === void 0 ? void 0 : (_profile_portfolio = profile.portfolio) === null || _profile_portfolio === void 0 ? void 0 : _profile_portfolio.length ]); if (loading) return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "min-h-screen flex items-center justify-center", style: { background: 'var(--site-bg)' }, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "relative w-12 h-12", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "absolute inset-0 rounded-full border-2 border-green-500/20" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "absolute inset-0 rounded-full border-2 border-transparent border-t-blue-500 animate-spin" }) ] }) }); if (notFound || !profile) return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "min-h-screen flex flex-col items-center justify-center gap-6", style: { background: 'var(--site-bg)' }, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "w-20 h-20 rounded-full flex items-center justify-center", style: { background: 'var(--site-surface)' }, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-10 h-10 text-gray-500", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 1.5, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15.182 16.318A4.486 4.486 0 0012.016 15a4.486 4.486 0 00-3.198 1.318M21 12a9 9 0 11-18 0 9 9 0 0118 0zM9.75 9.75c0 .414-.168.75-.375.75S9 10.164 9 9.75 9.168 9 9.375 9s.375.336.375.75zm-.375 0h.008v.015h-.008V9.75zm5.625 0c0 .414-.168.75-.375.75s-.375-.336-.375-.75.168-.75.375-.75.375.336.375.75zm-.375 0h.008v.015h-.008V9.75z" }) }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-gray-400 text-lg", children: t('common.not_found', 'Page not found') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("a", { href: "/", className: "text-gray-400 hover:text-gray-300 text-sm transition", children: t('nav.home', 'Home') }) ] }); var _profile_firstName_, _profile_lastName_; const initials = "".concat((_profile_firstName_ = (_profile_firstName = profile.firstName) === null || _profile_firstName === void 0 ? void 0 : _profile_firstName[0]) !== null && _profile_firstName_ !== void 0 ? _profile_firstName_ : '').concat((_profile_lastName_ = (_profile_lastName = profile.lastName) === null || _profile_lastName === void 0 ? void 0 : _profile_lastName[0]) !== null && _profile_lastName_ !== void 0 ? _profile_lastName_ : '').toUpperCase() || ((_profile_name = profile.name) === null || _profile_name === void 0 ? void 0 : (_profile_name_ = _profile_name[0]) === null || _profile_name_ === void 0 ? void 0 : _profile_name_.toUpperCase()) || '?'; const displayName = [ profile.firstName, profile.lastName ].filter(Boolean).join(' ') || profile.name || ''; const memberYear = profile.memberSince ? new Date(profile.memberSince).getFullYear() : null; const hasStats = profile.completedTasks > 0 || profile.rating || profile.reviewCount && profile.reviewCount > 0; const isLight = ((_profile_siteSettings = profile.siteSettings) === null || _profile_siteSettings === void 0 ? void 0 : _profile_siteSettings.siteTheme) === 'light'; const showServices = ((_profile_siteSettings1 = profile.siteSettings) === null || _profile_siteSettings1 === void 0 ? void 0 : _profile_siteSettings1.showServices) !== false; const showPriceList = ((_profile_siteSettings2 = profile.siteSettings) === null || _profile_siteSettings2 === void 0 ? void 0 : _profile_siteSettings2.showPriceList) !== false; const showCardsSection = showServices || showPriceList; var _profile_portfolio_length, _profile_portfolio_lightbox_title, _SITE_LOCALES_find_flag; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "site-theme min-h-screen selection:bg-green-500/30 ".concat(isLight ? 'site-light' : ''), style: { background: 'var(--site-bg)', color: 'var(--site-text)' }, children: [ lightbox !== null && ((_profile_portfolio1 = profile.portfolio) === null || _profile_portfolio1 === void 0 ? void 0 : _profile_portfolio1[lightbox]) && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "fixed inset-0 z-50 bg-black/90 backdrop-blur-xl flex items-center justify-center p-4", onClick: ()=>setLightbox(null), children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>setLightbox(null), className: "absolute top-6 right-6 w-10 h-10 rounded-full bg-white/10 hover:bg-white/20 flex items-center justify-center transition", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-5 h-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" }) }) }), lightbox > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: (e)=>{ e.stopPropagation(); setLightbox(lightbox - 1); }, className: "absolute left-4 top-1/2 -translate-y-1/2 w-10 h-10 rounded-full bg-white/10 hover:bg-white/20 flex items-center justify-center transition", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-5 h-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 19l-7-7 7-7" }) }) }), lightbox < ((_profile_portfolio_length = (_profile_portfolio2 = profile.portfolio) === null || _profile_portfolio2 === void 0 ? void 0 : _profile_portfolio2.length) !== null && _profile_portfolio_length !== void 0 ? _profile_portfolio_length : 1) - 1 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: (e)=>{ e.stopPropagation(); setLightbox(lightbox + 1); }, className: "absolute right-4 top-1/2 -translate-y-1/2 w-10 h-10 rounded-full bg-white/10 hover:bg-white/20 flex items-center justify-center transition", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-5 h-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 5l7 7-7 7" }) }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: profile.portfolio[lightbox].imageUrl, alt: (_profile_portfolio_lightbox_title = profile.portfolio[lightbox].title) !== null && _profile_portfolio_lightbox_title !== void 0 ? _profile_portfolio_lightbox_title : '', className: "max-w-full max-h-[85vh] rounded-2xl object-contain", onClick: (e)=>e.stopPropagation() }), profile.portfolio[lightbox].title && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "absolute bottom-6 left-1/2 -translate-x-1/2 bg-black/60 backdrop-blur-md px-5 py-2.5 rounded-full text-sm", children: profile.portfolio[lightbox].title }) ] }), authModal && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "fixed inset-0 z-50 bg-black/70 backdrop-blur-sm flex items-center justify-center p-4", onClick: ()=>setAuthModal(false), children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "relative w-full max-w-sm rounded-2xl shadow-2xl p-6", style: { background: 'var(--site-modal-bg)', border: '1px solid var(--site-border)' }, onClick: (e)=>e.stopPropagation(), children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>setAuthModal(false), className: "absolute top-4 right-4 w-8 h-8 rounded-full flex items-center justify-center transition", style: { background: 'var(--site-surface)', color: 'var(--site-text-muted)' }, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" }) }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "w-12 h-12 rounded-full bg-green-500/10 flex items-center justify-center mb-4", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-6 h-6 text-gray-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h3", { className: "text-base font-semibold mb-2", style: { color: 'var(--site-text)' }, children: t('site.auth_required_title', 'Authorization required') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm mb-5", style: { color: 'var(--site-text-muted)' }, children: t('site.auth_required_desc', 'To write in chat, sign in to your CanHelp account.') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex flex-col gap-2.5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("a", { href: "/login", className: "w-full flex items-center justify-center gap-2 bg-green-600 hover:bg-green-500 text-white font-medium text-sm px-4 py-2.5 rounded-xl transition", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M11 16l-4-4m0 0l4-4m-4 4h14m-5 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h7a3 3 0 013 3v1" }) }), t('site.auth_login_btn', 'Sign in') ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { type: "button", onClick: ()=>{ setAuthModal(false); setTimeout(()=>{ var _document_getElementById; (_document_getElementById = document.getElementById('contact')) === null || _document_getElementById === void 0 ? void 0 : _document_getElementById.scrollIntoView({ behavior: 'smooth', block: 'start' }); }, 100); }, className: "w-full flex items-center justify-center gap-2 text-sm font-medium px-4 py-2.5 rounded-xl transition", style: { background: 'var(--site-surface)', color: 'var(--site-text-secondary)', border: '1px solid var(--site-border)' }, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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" }) }), t('site.auth_contact_form_btn', 'Write via contact form') ] }) ] }) ] }) }), msgModal && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "fixed inset-0 z-50 bg-black/70 backdrop-blur-sm flex items-center justify-center p-4", onClick: ()=>{ if (!msgLoading) { setMsgModal(false); setMsgSent(false); } }, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "relative w-full max-w-md rounded-2xl shadow-2xl", style: { background: 'var(--site-modal-bg)', border: '1px solid var(--site-border)' }, onClick: (e)=>e.stopPropagation(), children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>{ setMsgModal(false); setMsgSent(false); }, className: "absolute top-4 right-4 w-8 h-8 rounded-full flex items-center justify-center transition", style: { background: 'var(--site-surface)', color: 'var(--site-text-muted)' }, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" }) }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "p-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-3 mb-5", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "w-10 h-10 rounded-full bg-green-500/10 flex items-center justify-center", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-5 h-5 text-gray-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h3", { className: "text-base font-semibold", style: { color: 'var(--site-text)' }, children: t('site.write_to_chat', 'Write in chat') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs", style: { color: 'var(--site-text-muted)' }, children: displayName }) ] }) ] }), msgSent ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "text-center py-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "w-12 h-12 rounded-full bg-emerald-500/20 flex items-center justify-center mx-auto mb-3", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-6 h-6 text-emerald-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" }) }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-emerald-400 font-medium mb-1", children: t('site.message_sent', 'Message sent!') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm mb-4", style: { color: 'var(--site-text-muted)' }, children: t('site.message_sent_desc', 'The specialist will receive it in chat') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>{ setMsgModal(false); setMsgSent(false); }, className: "text-sm text-gray-400 hover:text-gray-300 transition", children: t('common.close', 'Close') }) ] }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("form", { onSubmit: handleSendMessage, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("textarea", { autoFocus: true, rows: 4, value: msgText, onChange: (e)=>setMsgText(e.target.value), className: "w-full rounded-xl px-4 py-3 text-sm focus:outline-none focus:border-green-500/50 transition resize-none mb-4", style: { background: 'var(--site-input-bg)', border: '1px solid var(--site-input-border)', color: 'var(--site-input-text)' }, placeholder: t('site.message_placeholder', 'Write your message...') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-end gap-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { type: "button", onClick: ()=>setMsgModal(false), className: "text-sm transition px-4 py-2", style: { color: 'var(--site-text-muted)' }, children: t('common.cancel', 'Cancel') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { type: "submit", disabled: msgLoading || !msgText.trim(), className: "inline-flex items-center gap-2 bg-green-600 hover:bg-green-500 text-white font-medium text-sm px-5 py-2.5 rounded-xl transition disabled:opacity-50", children: [ msgLoading ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "w-4 h-4 rounded-full border-2 border-white/30 border-t-white animate-spin" }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 19l9 2-9-18-9 18 9-2zm0 0v-8" }) }), t('site.contact_send', 'Send') ] }) ] }) ] }) ] }) ] }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("nav", { className: "sticky top-0 z-40 backdrop-blur-xl", style: { background: 'var(--site-nav-bg)', borderBottom: '1px solid var(--site-border)' }, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "max-w-5xl mx-auto px-4 sm:px-6 h-14 flex items-center justify-between", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("a", { href: "/", className: "logo-text-mini tracking-tight".concat(scrolled ? ' scrolled' : ''), style: { color: 'var(--site-text-secondary)' }, children: "CanHelp" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-2", children: [ (profile === null || profile === void 0 ? void 0 : profile.rating) && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-1 text-xs mr-1", style: { color: 'var(--site-text-secondary)' }, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3.5 h-3.5 text-amber-400", fill: "currentColor", viewBox: "0 0 20 20", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 00-1.175 0l-2.8 2.034c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 00.951-.69l1.07-3.292z" }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "font-medium", children: Number(profile.rating).toFixed(1) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "relative", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { type: "button", onClick: ()=>setLangOpen(!langOpen), className: "flex items-center gap-1.5 text-xs transition px-2 py-1 rounded-lg", style: { color: 'var(--site-text-muted)' }, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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" }) }), (_SITE_LOCALES_find_flag = (_SITE_LOCALES_find = SITE_LOCALES.find((l)=>l.code === locale)) === null || _SITE_LOCALES_find === void 0 ? void 0 : _SITE_LOCALES_find.flag) !== null && _SITE_LOCALES_find_flag !== void 0 ? _SITE_LOCALES_find_flag : '🌐' ] }), langOpen && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "fixed inset-0 z-40", onClick: ()=>setLangOpen(false) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "absolute right-0 top-full mt-1 z-50 rounded-xl shadow-xl overflow-hidden min-w-[140px]", style: { background: 'var(--site-lang-dropdown)', border: '1px solid var(--site-border)' }, children: SITE_LOCALES.map((l)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { type: "button", onClick: ()=>{ setLocale(l.code); setLangOpen(false); }, className: "w-full flex items-center gap-2 px-3 py-2 text-xs transition ".concat(locale === l.code ? 'text-gray-400 bg-green-500/10' : ''), style: locale === l.code ? {} : { color: 'var(--site-text-secondary)' }, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { children: l.flag }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { children: l.label }) ] }, l.code)) }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "w-px h-4", style: { background: 'var(--site-divider)' } }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { type: "button", onClick: async ()=>{ const url = window.location.href; if (navigator.share) { try { await navigator.share({ title: displayName, url }); } catch (e) {} } else { navigator.clipboard.writeText(url); setLinkCopied(true); setTimeout(()=>setLinkCopied(false), 2000); } }, className: "flex items-center gap-1.5 text-xs transition", style: { color: 'var(--site-text-muted)' }, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3.5 h-3.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8.684 13.342C8.886 12.938 9 12.482 9 12c0-.482-.114-.938-.316-1.342m0 2.684a3 3 0 110-2.684m0 2.684l6.632 3.316m-6.632-6l6.632-3.316m0 0a3 3 0 105.367-2.684 3 3 0 00-5.367 2.684zm0 9.316a3 3 0 105.368 2.684 3 3 0 00-5.368-2.684z" }) }), linkCopied ? t('profile.site.copied') : t('site.share', 'Share') ] }) ] }) ] }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("section", { className: "relative overflow-hidden", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "absolute top-0 left-1/4 w-[500px] h-[500px] bg-green-600/10 rounded-full blur-[120px] pointer-events-none" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "absolute top-20 right-1/4 w-[400px] h-[400px] bg-purple-600/8 rounded-full blur-[100px] pointer-events-none" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "relative max-w-5xl mx-auto px-4 sm:px-6 pt-16 pb-20 sm:pt-24 sm:pb-28", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex flex-col items-center text-center", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "relative group mb-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "absolute -inset-1 bg-gradient-to-br from-green-600 to-purple-500 rounded-full opacity-60 blur group-hover:opacity-80 transition-opacity" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "relative w-28 h-28 sm:w-32 sm:h-32 rounded-full overflow-hidden border-2 flex items-center justify-center text-4xl font-bold", style: { borderColor: 'var(--site-avatar-border)', background: 'var(--site-avatar-bg)', color: 'var(--site-text)' }, children: profile.image ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: profile.image, alt: displayName, className: "w-full h-full object-cover" }) : initials }), Array.isArray(profile.activeStatuses) && profile.activeStatuses.includes('canhelp_now') && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "absolute bottom-1 right-1 w-5 h-5 bg-emerald-500 rounded-full border-2 flex items-center justify-center", style: { borderColor: 'var(--site-status-border-color)' }, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "w-2 h-2 rounded-full bg-white animate-pulse" }) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h1", { className: "text-3xl sm:text-5xl font-bold tracking-tight bg-clip-text text-transparent mb-3 pb-1", style: { backgroundImage: 'linear-gradient(to bottom, var(--site-name-from), var(--site-name-to))' }, children: displayName }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-center gap-2 flex-wrap mb-4", children: [ profile.planTier && profile.planTier !== 'free' && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components_PlanBadge__WEBPACK_IMPORTED_MODULE_6__/* .PlanBadge */ .d, { tier: profile.planTier, verified: profile.hasVerifiedBadge, size: "md" }), Array.isArray(profile.activeStatuses) && profile.activeStatuses.includes('canhelp_now') && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "inline-flex items-center gap-1.5 text-xs font-medium text-emerald-400 bg-emerald-500/10 border border-emerald-500/20 px-3 py-1.5 rounded-full", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "w-1.5 h-1.5 rounded-full bg-emerald-400 animate-pulse" }), t('status.can_help_now', 'Available now') ] }), memberYear && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "text-xs px-3 py-1.5 rounded-full", style: { color: 'var(--site-text-muted)', background: 'var(--site-surface)' }, children: [ t('site.member_since', 'Member since'), " ", memberYear ] }) ] }), profile.bio && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "max-w-xl text-base sm:text-lg leading-relaxed mb-8", style: { color: 'var(--site-text-secondary)' }, children: profile.bio }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-3 flex-wrap justify-center", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { onClick: handleMessage, disabled: msgLoading, className: "group inline-flex items-center gap-2.5 bg-green-600 hover:bg-green-500 text-white font-semibold px-7 py-3.5 rounded-full transition-all hover:shadow-lg hover:shadow-blue-500/25 disabled:opacity-50", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-5 h-5 group-hover:scale-110 transition-transform", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z" }) }), t('site.write_to_chat', 'Write in chat') ] }), profile.phone && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("a", { href: "tel:".concat(profile.phone), className: "group inline-flex items-center gap-2.5 border font-medium px-7 py-3.5 rounded-full transition-all", style: { background: 'var(--site-phone-bg)', borderColor: 'var(--site-phone-border)', color: 'var(--site-phone-text)' }, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-5 h-5 group-hover:scale-110 transition-transform", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M3 5a2 2 0 012-2h3.28a1 1 0 01.948.684l1.498 4.493a1 1 0 01-.502 1.21l-2.257 1.13a11.042 11.042 0 005.516 5.516l1.13-2.257a1 1 0 011.21-.502l4.493 1.498a1 1 0 01.684.949V19a2 2 0 01-2 2h-1C9.716 21 3 14.284 3 6V5z" }) }), profile.phone ] }) ] }) ] }) }) ] }), hasStats && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("section", { className: "border-y", style: { borderColor: 'var(--site-border)', background: 'var(--site-surface)' }, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "max-w-5xl mx-auto px-4 sm:px-6 py-8", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "grid grid-cols-2 sm:grid-cols-4 gap-6", children: [ profile.rating && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "text-center", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-center gap-1 mb-1", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-5 h-5 text-amber-400", fill: "currentColor", viewBox: "0 0 20 20", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 00-1.175 0l-2.8 2.034c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 00.951-.69l1.07-3.292z" }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-2xl font-bold", children: Number(profile.rating).toFixed(1) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs uppercase tracking-wider", style: { color: 'var(--site-text-muted)' }, children: t('site.rating', 'Rating') }) ] }), profile.reviewCount > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "text-center", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-2xl font-bold mb-1", children: profile.reviewCount }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs uppercase tracking-wider", style: { color: 'var(--site-text-muted)' }, children: t('profile.reviews') }) ] }), profile.completedTasks > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "text-center", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-2xl font-bold mb-1", children: profile.completedTasks }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs uppercase tracking-wider", style: { color: 'var(--site-text-muted)' }, children: t('site.completed_tasks', 'Completed') }) ] }), Array.isArray(profile.languages) && profile.languages.length > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "text-center", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-2xl font-bold mb-1", children: profile.languages.length }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs uppercase tracking-wider", style: { color: 'var(--site-text-muted)' }, children: t('site.languages', 'Languages') }) ] }) ] }) }) }), Array.isArray(profile.languages) && profile.languages.length > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("section", { className: "max-w-5xl mx-auto px-4 sm:px-6 pt-10", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-3 mb-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 shrink-0", style: { color: 'var(--site-text-muted)' }, fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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" }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-sm", style: { color: 'var(--site-text-muted)' }, children: t('site.speaks_languages', 'Speaks languages') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex items-center gap-2 flex-wrap", children: profile.languages.map((lang)=>{ const info = LANG_MAP[lang]; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-xs px-3 py-1.5 rounded-full flex items-center gap-1.5", style: { color: 'var(--site-tag-text)', background: 'var(--site-tag-bg)', border: '1px solid var(--site-tag-border)' }, children: info ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, { children: [ info.flag, " ", info.label ] }) : lang }, lang); }) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "max-w-5xl mx-auto px-4 sm:px-6 pb-20 space-y-16 mt-10", children: [ showServices && Array.isArray(profile.cards) && profile.cards.length > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("section", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-3 mb-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "w-8 h-8 rounded-lg bg-green-500/10 flex items-center justify-center", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 text-gray-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M21 13.255A23.931 23.931 0 0112 15c-3.183 0-6.22-.62-9-1.745M16 6V4a2 2 0 00-2-2h-4a2 2 0 00-2 2v2m4 6h.01M5 20h14a2 2 0 002-2V8a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z" }) }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "text-xl font-bold", children: t('specialist.services', 'Services') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "grid gap-4 sm:grid-cols-2", children: profile.cards.map((card)=>{ // Group locations by parent const grouped = {}; if (Array.isArray(card.locations)) { for (const slug of card.locations){ const parent = locParentMap[slug]; if (parent) { if (!grouped[parent]) grouped[parent] = []; grouped[parent].push(locMap[slug] || slug); } else { const name = locMap[slug] || slug; if (!grouped[name]) grouped[name] = []; } } } return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "group relative rounded-2xl p-6 transition-all", style: { background: 'var(--site-card-bg)', border: '1px solid var(--site-card-border)' }, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h3", { className: "font-semibold mb-2", style: { color: 'var(--site-text)' }, children: card.title }), showServices && (()=>{ const desc = (locale === 'el' ? card.descriptionEl : locale === 'en' ? card.descriptionEn : locale === 'ru' ? card.descriptionRu : card.descriptionUk) || card.descriptionEl || card.descriptionEn || card.descriptionRu || card.descriptionUk || card.description; return desc ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm leading-relaxed mb-3", style: { color: 'var(--site-text-muted)' }, children: desc }) : null; })(), showServices && Array.isArray(card.categories) && card.categories.length > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex flex-wrap gap-1.5 mb-3", children: card.categories.map((slug)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-[11px] px-2.5 py-1 rounded-full bg-purple-500/10 text-purple-400 border border-purple-500/10", children: catMap[slug] || slug }, slug)) }), showServices && Object.keys(grouped).length > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "mb-3 space-y-1", children: Object.entries(grouped).map((param)=>{ let [parent, children] = param; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-start gap-1.5 text-xs", style: { color: 'var(--site-text-muted)' }, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("svg", { className: "w-3.5 h-3.5 shrink-0 mt-0.5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M15 11a3 3 0 11-6 0 3 3 0 016 0z" }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "font-medium", style: { color: 'var(--site-text-secondary)' }, children: parent }), children.length > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { style: { color: 'var(--site-text-hint)' }, children: [ " — ", children.join(', ') ] }) ] }) ] }, parent); }) }), showServices && Array.isArray(card.skills) && card.skills.length > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex flex-wrap gap-1.5", children: card.skills.map((s)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-[11px] px-2.5 py-1 rounded-full bg-green-500/10 text-gray-400 border border-green-500/10", children: s }, s)) }), showPriceList && Array.isArray(priceLists[card.id]) && priceLists[card.id].length > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "".concat(showServices ? 'mt-4 pt-4 border-t' : ''), style: { borderColor: 'var(--site-card-border)' }, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs font-semibold uppercase tracking-wider mb-3", style: { color: 'var(--site-text-muted)' }, children: t('site.pricelist', 'Price list') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "space-y-3", children: priceLists[card.id].map((group)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "rounded-xl p-4", style: { background: 'var(--site-surface)', border: '1px solid var(--site-card-border)' }, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "font-semibold mb-3", style: { color: 'var(--site-text)' }, children: group.title }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "space-y-3", children: group.items.map((item)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-start justify-between gap-4", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "min-w-0", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm font-medium", style: { color: 'var(--site-text-secondary)' }, children: item.name }), item.description && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs mt-0.5", style: { color: 'var(--site-text-muted)' }, children: item.description }) ] }), (item.price || item.unit) && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "shrink-0 text-sm font-semibold", style: { color: 'var(--site-text)' }, children: [ item.price ? "€".concat(item.price) : '', item.unit ? " ".concat(item.unit) : '' ] }) ] }, item.id)) }) ] }, group.id)) }) ] }) ] }, card.id); }) }) ] }), Array.isArray(profile.portfolio) && profile.portfolio.length > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("section", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-3 mb-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "w-8 h-8 rounded-lg bg-purple-500/10 flex items-center justify-center", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 text-purple-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z" }) }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "text-xl font-bold", children: t('portfolio.title', 'Portfolio') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("span", { className: "text-xs ml-auto", style: { color: 'var(--site-text-hint)' }, children: [ profile.portfolio.length, " ", t('site.photos', 'photos') ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 gap-3", children: profile.portfolio.map((item, idx)=>{ var _item_title; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { onClick: ()=>item.imageUrl && setLightbox(idx), className: "group relative aspect-square rounded-xl overflow-hidden transition-all", style: { background: 'var(--site-surface)', border: '1px solid var(--site-card-border)' }, children: [ item.imageUrl && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: item.imageUrl, alt: (_item_title = item.title) !== null && _item_title !== void 0 ? _item_title : '', className: "w-full h-full object-cover group-hover:scale-105 transition-transform duration-500" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "absolute inset-0 bg-gradient-to-t from-black/60 via-transparent to-transparent opacity-0 group-hover:opacity-100 transition-opacity flex items-end p-3", children: item.title && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-xs font-medium text-white truncate", children: item.title }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "absolute top-2 right-2 w-7 h-7 rounded-full bg-black/40 backdrop-blur-md flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3.5 h-3.5 text-white/80", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0zM10 7v3m0 0v3m0-3h3m-3 0H7" }) }) }) ] }, item.id); }) }) ] }), Array.isArray(profile.reviews) && profile.reviews.length > 0 && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("section", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-3 mb-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "w-8 h-8 rounded-lg bg-amber-500/10 flex items-center justify-center", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 text-amber-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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" }) }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "text-xl font-bold", children: t('profile.reviews') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "text-xs ml-auto", style: { color: 'var(--site-text-hint)' }, children: profile.reviewCount }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "space-y-3", children: profile.reviews.slice(0, 6).map((review)=>{ var _review_authorFirstName, _review_authorName; const authorName = [ review.authorFirstName, review.authorLastName ].filter(Boolean).join(' ') || review.authorName || null; var _review_authorFirstName_, _ref; return /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "rounded-2xl p-5", style: { background: 'var(--site-card-bg)', border: '1px solid var(--site-card-border)' }, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-start gap-3 mb-3", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "w-9 h-9 rounded-full flex items-center justify-center text-xs font-bold overflow-hidden shrink-0", style: { background: 'var(--site-surface)', color: 'var(--site-text-muted)' }, children: review.authorImage ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("img", { src: review.authorImage, alt: "", className: "w-full h-full object-cover" }) : ((_ref = (_review_authorFirstName_ = (_review_authorFirstName = review.authorFirstName) === null || _review_authorFirstName === void 0 ? void 0 : _review_authorFirstName[0]) !== null && _review_authorFirstName_ !== void 0 ? _review_authorFirstName_ : (_review_authorName = review.authorName) === null || _review_authorName === void 0 ? void 0 : _review_authorName[0]) !== null && _ref !== void 0 ? _ref : '?').toUpperCase() }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex-1 min-w-0", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-between gap-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm font-medium", style: { color: 'var(--site-text-secondary)' }, children: authorName !== null && authorName !== void 0 ? authorName : t('common.anonymous', 'Anonymous') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", { className: "shrink-0 text-[11px]", style: { color: 'var(--site-text-hint)' }, children: new Date(review.createdAt).toLocaleDateString(dateLocale) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "flex gap-0.5 mt-0.5", children: Array.from({ length: 5 }).map((_, i)=>/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-3.5 h-3.5 ".concat(i < Math.round(review.rating) ? 'text-amber-400' : ''), style: i < Math.round(review.rating) ? {} : { color: 'var(--site-border)' }, fill: "currentColor", viewBox: "0 0 20 20", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { d: "M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 00-1.175 0l-2.8 2.034c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 00.951-.69l1.07-3.292z" }) }, i)) }) ] }) ] }), review.comment && /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm leading-relaxed pl-12", style: { color: 'var(--site-text-muted)' }, children: review.comment }) ] }, review.id); }) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("section", { id: "contact", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center gap-3 mb-6", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "w-8 h-8 rounded-lg bg-emerald-500/10 flex items-center justify-center", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4 text-emerald-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.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" }) }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("h2", { className: "text-xl font-bold", children: t('site.contact_form', 'Contact') }) ] }), contactSent ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "bg-emerald-500/10 border border-emerald-500/20 rounded-2xl p-8 text-center", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "w-12 h-12 rounded-full bg-emerald-500/20 flex items-center justify-center mx-auto mb-3", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-6 h-6 text-emerald-400", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" }) }) }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-emerald-400 font-medium", children: t('site.contact_sent', 'Message sent!') }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", { className: "text-sm mt-1", style: { color: 'var(--site-text-muted)' }, children: t('site.contact_sent_desc', 'The specialist will contact you shortly') }) ] }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("form", { onSubmit: handleContactSubmit, className: "rounded-2xl p-6 space-y-4", style: { background: 'var(--site-card-bg)', border: '1px solid var(--site-card-border)' }, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "grid gap-4 sm:grid-cols-2", children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "text-xs uppercase tracking-wider mb-1.5 block", style: { color: 'var(--site-text-muted)' }, children: [ t('site.contact_name', 'Name'), " *" ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "text", required: true, value: contactForm.name, onChange: (e)=>setContactForm((f)=>({ ...f, name: e.target.value })), className: "w-full rounded-xl px-4 py-3 text-sm focus:outline-none focus:border-green-500/50 transition", style: { background: 'var(--site-input-bg)', border: '1px solid var(--site-input-border)', color: 'var(--site-input-text)' }, placeholder: t('site.contact_name_ph', 'Your name') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("label", { className: "text-xs uppercase tracking-wider mb-1.5 block", style: { color: 'var(--site-text-muted)' }, children: "Email" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("input", { type: "email", value: contactForm.email, onChange: (e)=>setContactForm((f)=>({ ...f, email: e.target.value })), className: "w-full rounded-xl px-4 py-3 text-sm focus:outline-none focus:border-green-500/50 transition", style: { background: 'var(--site-input-bg)', border: '1px solid var(--site-input-border)', color: 'var(--site-input-text)' }, placeholder: t('site.contact_email_ph', 'your@email.com') }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("label", { className: "text-xs uppercase tracking-wider mb-1.5 block", style: { color: 'var(--site-text-muted)' }, children: [ t('site.contact_message', 'Message'), " *" ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("textarea", { required: true, rows: 4, value: contactForm.message, onChange: (e)=>setContactForm((f)=>({ ...f, message: e.target.value })), className: "w-full rounded-xl px-4 py-3 text-sm focus:outline-none focus:border-green-500/50 transition resize-none", style: { background: 'var(--site-input-bg)', border: '1px solid var(--site-input-border)', color: 'var(--site-input-text)' }, placeholder: t('site.contact_message_ph', 'Describe your task...') }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("button", { type: "submit", disabled: contactLoading, className: "inline-flex items-center gap-2 bg-green-600 hover:bg-green-500 text-white font-medium px-6 py-3 rounded-xl transition disabled:opacity-50", children: [ contactLoading ? /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", { className: "w-4 h-4 rounded-full border-2 border-white/30 border-t-white animate-spin" }) : /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M12 19l9 2-9-18-9 18 9-2zm0 0v-8" }) }), t('site.contact_send', 'Send') ] }) ] }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("footer", { className: "border-t pt-8 pb-4", style: { borderColor: 'var(--site-border)' }, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", { className: "flex items-center justify-between text-xs", style: { color: 'var(--site-footer-text)' }, children: [ /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("a", { href: "/", className: "transition", children: "CanHelp.gr" }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("p", { children: [ "\xa9 ", new Date().getFullYear() ] }) ] }) }) ] }), /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("button", { onClick: ()=>window.scrollTo({ top: 0, behavior: 'smooth' }), className: "fixed bottom-6 right-6 z-50 w-10 h-10 rounded-full flex items-center justify-center backdrop-blur-sm transition-all duration-300 ".concat(scrolled ? 'opacity-100 translate-y-0' : 'opacity-0 translate-y-4 pointer-events-none'), style: { background: 'var(--site-scroll-btn-bg)', border: '1px solid var(--site-scroll-btn-border)', color: 'var(--site-scroll-btn-text)' }, "aria-label": "Scroll to top", children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("svg", { className: "w-5 h-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", strokeWidth: 2, children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 15l7-7 7 7" }) }) }) ] }); } /***/ }) }, /******/ __webpack_require__ => { // webpackRuntimeModules /******/ var __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId)) /******/ __webpack_require__.O(0, [1516,9906,2982,587,18,7358], () => (__webpack_exec__(409))); /******/ var __webpack_exports__ = __webpack_require__.O(); /******/ _N_E = __webpack_exports__; /******/ } ]); *ÿÿÿŠþÿÿ `4‹þÿÿV(self["webpackChunk_N_E"] = self["webpackChunk_N_E"] || []).push([[488],{ /***/ 409: Šþÿÿ:ÿÿÿŒþÿÿYimport(/* webpackMode: "eager" */ "/opt/canhelp/apps/web/src/app/site/[slug]/page.tsx"); k086Promise.resolve(/* import() eager */).then(__webpack_require__.bind(__webpack_require__, 6235))undefined-ÿÿÿ.ÿÿÿ-ÿÿÿ3ÿÿÿˆþÿÿ)ÿÿÿˆþÿÿ4ÿÿÿŠþÿÿ5ÿÿÿ6ÿÿÿ-ÿÿÿ.ÿÿÿ-ÿÿÿ‘ˆþÿÿ)ÿÿÿˆþÿÿ’Šþÿÿ“”-ÿÿÿ.ÿÿÿ-ÿÿÿ, /***/ 6235: ‡þÿÿ(ÿÿÿ‡þÿÿæþÿÿ‰þÿÿ$ùÿÿçþÿÿ,ÿÿÿ-ÿÿÿ,ÿÿÿuÿÿÿ‡wÿÿÿ,ÿÿÿçvar __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId)) __webpack_require__.O(0, [1516,9906,2982,587,18,7358], () => (__webpack_exec__(409))); var __webpack_exports__ = __webpack_require__.O(); +ÿÿÿxÿÿÿyÿÿÿzÿÿÿxþÿÿ E§(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7177],{300:(e,t,r)=>{"use strict";r.d(t,{AdminRolePreview:()=>d});var n=r(4568),s=r(1592),a=r(7541),l=r(7620),o=r(2982);let i="canhelp_admin_orig_plan",c={free:"bg-slate-100 text-slate-600",pro:"bg-green-100 text-green-700",ultimate:"bg-amber-100 text-amber-700"};function d(){var e,t;let{data:r}=(0,s.wV)(),d=(0,a.useRouter)(),h=(null==r||null==(e=r.user)?void 0:e.role)==="admin",u=null==r||null==(t=r.user)?void 0:t.id,[x,m]=(0,l.useState)(!1),[f,p]=(0,l.useState)([]),[g,v]=(0,l.useState)(null),[j,k]=(0,l.useState)(!1),[b,w]=(0,l.useState)(!1),y=(0,l.useRef)(null);if((0,l.useEffect)(()=>m(!0),[]),(0,l.useEffect)(()=>{y.current=localStorage.getItem(i)},[]),(0,l.useEffect)(()=>{h&&(0,o.T9)().then(p).catch(()=>{})},[h]),(0,l.useEffect)(()=>{var e,t;v(null!=(t=null==r||null==(e=r.user)?void 0:e.planId)?t:null)},[r]),!x||!h)return null;let N=async e=>{if(u){k(!0);try{!y.current&&g&&(localStorage.setItem(i,g),y.current=g),await (0,o.wl)(u,{planId:e}),v(e),window.dispatchEvent(new CustomEvent("canhelp:plan-changed",{detail:{planId:e}})),d.refresh()}catch(e){}k(!1)}},C=async()=>{let e=y.current;localStorage.removeItem(i),y.current=null,await N(null!=e?e:null)},L=!!y.current;return(0,n.jsxs)("div",{className:"fixed bottom-20 right-4 z-50 bg-white border border-slate-200 rounded-2xl shadow-lg text-xs font-medium select-none",style:{minWidth:130},children:[(0,n.jsxs)("button",{onClick:()=>w(e=>!e),className:"flex items-center justify-between gap-2 w-full px-3 py-2 text-slate-500 hover:text-slate-700 transition rounded-2xl",children:[(0,n.jsx)("span",{children:"\uD83D\uDC41 Preview"}),(0,n.jsx)("span",{className:"text-slate-300",children:b?"▲":"â–Œ"})]}),b&&(0,n.jsx)("div",{className:"flex flex-col gap-1 px-2 pb-2 border-t border-slate-100 pt-2",children:f.length>0&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{className:"text-slate-400 px-1 mt-2 mb-0.5",children:"Plan"}),f.map(e=>{var t;return(0,n.jsxs)("button",{disabled:j,onClick:()=>N(e.id===g?null:e.id),className:"flex items-center justify-between gap-2 px-3 py-1.5 rounded-xl transition text-left ".concat(g===e.id?"bg-indigo-600 text-white":"text-slate-600 hover:bg-slate-100"," ").concat(j?"opacity-50":""),children:[(0,n.jsx)("span",{className:"truncate max-w-[90px]",children:e.name}),(0,n.jsx)("span",{className:"px-1.5 py-0.5 rounded-full text-[10px] font-semibold ".concat(g===e.id?"bg-white/20 text-white":null!=(t=c[e.tier])?t:c.free),children:e.tier})]},e.id)}),g&&(0,n.jsx)("button",{disabled:j,onClick:()=>N(null),className:"px-3 py-1 rounded-xl text-slate-400 hover:text-red-500 hover:bg-red-50 transition text-left",children:"✕ No plan"}),L&&(0,n.jsx)("button",{disabled:j,onClick:C,className:"px-3 py-1 rounded-xl text-green-600 hover:bg-green-50 transition text-left",children:"↩ Restore"})]})})]})}},1258:(e,t,r)=>{"use strict";function n(e){if(!(null==e?void 0:e.trim()))return"—";let t=e.trim().split(/\s+/);return t.length<2||!t[1]?t[0]:"".concat(t[0]," ").concat(t[1][0].toUpperCase(),".")}function s(e,t,r){if(null==e?void 0:e.trim()){let r=null==t?void 0:t.trim();return r?"".concat(e.trim()," ").concat(r[0].toUpperCase(),"."):e.trim()}return n(r)}r.d(t,{E:()=>n,H:()=>s})},1592:(e,t,r)=>{"use strict";r.d(t,{CI:()=>a,Hh:()=>l,Jv:()=>s,wV:()=>o,yK:()=>n});let n=(0,r(6504).M)({baseURL:"https://api.canhelp.gr"}),{signIn:s,signOut:a,signUp:l,useSession:o}=n},2568:(e,t,r)=>{Promise.resolve().then(r.t.bind(r,8761,23)),Promise.resolve().then(r.bind(r,300)),Promise.resolve().then(r.bind(r,9808)),Promise.resolve().then(r.bind(r,9649)),Promise.resolve().then(r.bind(r,7380)),Promise.resolve().then(r.bind(r,9906)),Promise.resolve().then(r.bind(r,4029))},3042:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"workAsyncStorage",{enumerable:!0,get:function(){return n.workAsyncStorageInstance}});let n=r(6035)},3625:(e,t,r)=>{"use strict";function n(e){let{moduleIds:t}=e;return null}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"PreloadChunks",{enumerable:!0,get:function(){return n}}),r(4568),r(7509),r(3042),r(1271)},4029:(e,t,r)=>{"use strict";r.d(t,{LocationProvider:()=>o,z:()=>i});var n=r(4568),s=r(7620),a=r(2982);let l=(0,s.createContext)({locationSlug:"",locationTree:[],locationLoading:!0,setLocation:()=>{},getLabel:()=>""});function o(e){let{children:t,initialSlug:r=""}=e,[o,i]=(0,s.useState)(r),[c,d]=(0,s.useState)([]),[h,u]=(0,s.useState)(!0);(0,s.useEffect)(()=>{i(function(){if("undefined"==typeof document)return"";let e=document.cookie.match(/(?:^|;\s*)canhelp_location=([^;]+)/);return(null==e?void 0:e[1])?decodeURIComponent(e[1]):""}())},[]),(0,s.useEffect)(()=>{(0,a.Vs)().then(e=>d(e)).catch(()=>{}).finally(()=>u(!1))},[]);let x=(0,s.useCallback)(e=>{i(e);let t=encodeURIComponent(e);document.cookie="canhelp_location=".concat(t,"; path=/; max-age=31536000; SameSite=Lax")},[]),m=(0,s.useCallback)(e=>{if(!o)return"";for(let s of c){var t,r,n;if(s.slug===o)return null!=(t=s.names[e])?t:s.names.el;for(let t of null!=(r=s.children)?r:[])if(t.slug===o)return null!=(n=t.names[e])?n:t.names.el}return o},[o,c]);return(0,n.jsx)(l.Provider,{value:{locationSlug:o,locationTree:c,locationLoading:h,setLocation:x,getLabel:m},children:t})}function i(){return(0,s.useContext)(l)}},5575:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return s}});let n=r(4931)._(r(7007));function s(e,t){var r;let s={};"function"==typeof e&&(s.loader=e);let a={...s,...t};return(0,n.default)({...a,modules:null==(r=a.loadableGenerated)?void 0:r.modules})}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},6035:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"workAsyncStorageInstance",{enumerable:!0,get:function(){return n}});let n=(0,r(9113).createAsyncLocalStorage)()},6442:(e,t,r)=>{"use strict";r.d(t,{default:()=>s.a});var n=r(5575),s=r.n(n)},6452:(e,t,r)=>{"use strict";function n(e){let{reason:t,children:r}=e;return r}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"BailoutToCSR",{enumerable:!0,get:function(){return n}}),r(9800)},7007:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return i}});let n=r(4568),s=r(7620),a=r(6452);function l(e){return{default:e&&"default"in e?e.default:e}}r(3625);let o={loader:()=>Promise.resolve(l(()=>null)),loading:null,ssr:!0},i=function(e){let t={...o,...e},r=(0,s.lazy)(()=>t.loader().then(l)),i=t.loading;function c(e){let l=i?(0,n.jsx)(i,{isLoading:!0,pastDelay:!0,error:null}):null,o=!t.ssr||!!t.loading,c=o?s.Suspense:s.Fragment,d=t.ssr?(0,n.jsxs)(n.Fragment,{children:[null,(0,n.jsx)(r,{...e})]}):(0,n.jsx)(a.BailoutToCSR,{reason:"next/dynamic",children:(0,n.jsx)(r,{...e})});return(0,n.jsx)(c,{...o?{fallback:l}:{},children:d})}return c.displayName="LoadableComponent",c}},7380:(e,t,r)=>{"use strict";r.d(t,{ScrollToTopButton:()=>a});var n=r(4568),s=r(7620);function a(){let[e,t]=(0,s.useState)(!1);return(0,s.useEffect)(()=>{let e=()=>{t(window.scrollY>200)};return window.addEventListener("scroll",e),()=>window.removeEventListener("scroll",e)},[]),(0,n.jsx)("button",{className:"scroll-to-top-btn".concat(e?" visible":""),"aria-label":"Back to top",onClick:()=>window.scrollTo({top:0,behavior:"smooth"}),children:(0,n.jsx)("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,n.jsx)("path",{d:"M10 16V4M10 4L4 10M10 4L16 10",stroke:"white",strokeWidth:"2.8",strokeLinecap:"round",strokeLinejoin:"round"})})})}},8761:()=>{},9113:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{bindSnapshot:function(){return l},createAsyncLocalStorage:function(){return a},createSnapshot:function(){return o}});let r=Object.defineProperty(Error("Invariant: AsyncLocalStorage accessed in runtime where it is not available"),"__NEXT_ERROR_CODE",{value:"E504",enumerable:!1,configurable:!0});class n{disable(){throw r}getStore(){}run(){throw r}exit(){throw r}enterWith(){throw r}static bind(e){return e}}let s="undefined"!=typeof globalThis&&globalThis.AsyncLocalStorage;function a(){return s?new s:new n}function l(e){return s?s.bind(e):n.bind(e)}function o(){return s?s.snapshot():function(e,...t){return e(...t)}}},9649:(e,t,r)=>{"use strict";r.d(t,{Header:()=>g});var n=r(4568),s=r(9664),a=r.n(s),l=r(7541),o=r(1592),i=r(9906),c=r(1258),d=r(7620),h=r(4962);function u(){var e;let{locale:t,setLocale:r}=(0,i.Y)(),[s,a]=(0,d.useState)(!1),l=(0,d.useRef)(null),o=null!=(e=h.YZ.find(e=>e.code===t))?e:h.YZ[0];return(0,d.useEffect)(()=>{function e(e){l.current&&!l.current.contains(e.target)&&a(!1)}return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]),(0,n.jsxs)("div",{ref:l,className:"relative",children:[(0,n.jsxs)("button",{onClick:()=>a(!s),className:"flex items-center gap-1.5 px-2.5 py-1.5 rounded-lg border border-gray-200 hover:border-green-400 hover:bg-green-50 transition text-sm font-medium text-gray-700","aria-label":"Change language",children:[(0,n.jsx)("span",{children:o.code.toUpperCase()}),(0,n.jsx)("svg",{className:"w-3.5 h-3.5 text-gray-400 transition-transform ".concat(s?"rotate-180":""),fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"})})]}),s&&(0,n.jsx)("div",{className:"absolute right-0 mt-1 w-40 bg-white border border-gray-200 rounded-xl shadow-lg z-50 overflow-hidden",children:h.YZ.map(e=>(0,n.jsxs)("button",{onClick:()=>{r(e.code),a(!1)},className:"w-full flex items-center gap-2.5 px-3.5 py-2.5 text-sm hover:bg-green-50 transition ".concat(t===e.code?"bg-green-50 text-green-700 font-medium":"text-gray-700"),children:[(0,n.jsx)("span",{children:e.label}),t===e.code&&(0,n.jsx)("svg",{className:"w-3.5 h-3.5 ml-auto text-green-600",fill:"currentColor",viewBox:"0 0 20 20",children:(0,n.jsx)("path",{fillRule:"evenodd",d:"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z",clipRule:"evenodd"})})]},e.code))})]})}var x=r(2982),m=r(2838);function f(){var e;if("undefined"==typeof document)return null;let t=document.cookie.match(/(?:^|;\s*)canhelp_preview_role=([^;]+)/);return null!=(e=null==t?void 0:t[1])?e:null}let p=(0,r(6442).default)(()=>r.e(6467).then(r.bind(r,6467)),{loadableGenerated:{webpack:()=>[6467]},ssr:!1});function g(){var e;(0,l.useRouter)();let t=(0,l.usePathname)(),{data:r}=(0,o.wV)(),{t:s,locale:h}=(0,i.Y)(),[g,v]=(0,d.useState)(!1),[j,k]=(0,d.useState)(!1),[b,w]=(0,d.useState)(!1),[y,N]=(0,d.useState)(0),[C,L]=(0,d.useState)(0),[M,_]=(0,d.useState)(null),[z,E]=(0,d.useState)(null),S=(0,d.useRef)(null),B=(0,d.useRef)(null),W=(0,d.useRef)(null),P=(0,d.useRef)(t);(0,d.useEffect)(()=>{P.current=t},[t]),(0,d.useEffect)(()=>{function e(e){S.current&&!S.current.contains(e.target)&&k(!1)}return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]);let H=(null==r||null==(e=r.user)?void 0:e.role)==="admin",V="specialist"===function(){var e;let{data:t}=(0,o.wV)(),r=null==t||null==(e=t.user)?void 0:e.role,n="admin"===r,[s,a]=(0,d.useState)(null);return((0,d.useEffect)(()=>{if(!n)return;a(f());let e=()=>a(f());return window.addEventListener("canhelp:preview-role",e),document.addEventListener("visibilitychange",e),()=>{window.removeEventListener("canhelp:preview-role",e),document.removeEventListener("visibilitychange",e)}},[n]),r)?n&&s?s:r:null}(),O=function(e){let r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return r?t===e:t===e||t.startsWith(e+"/")},A=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return"font-medium text-sm transition ".concat(O(e,t)?"text-green-600":"text-gray-600 hover:text-green-600")},R=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return"flex items-center gap-2 font-medium py-1 ".concat(O(e,t)?"text-green-600":"text-gray-700")};return(0,d.useEffect)(()=>{"/chat"===t&&L(0)},[t]),(0,d.useEffect)(()=>{if(!r)return;let e=(0,m.io)("https://api.canhelp.gr",{withCredentials:!0,transports:["websocket","polling"]});return e.on("new_message",e=>{"/chat"!==P.current&&(L(e=>e+1),W.current&&clearTimeout(W.current),_(e),W.current=setTimeout(()=>_(null),5e3))}),()=>{e.disconnect(),W.current&&clearTimeout(W.current)}},[r]),(0,d.useEffect)(()=>{if(!r)return void N(0);let e=()=>(0,x.$M)().then(e=>N(e.count)).catch(()=>{});e();let t=setInterval(e,3e4);return()=>clearInterval(t)},[r]),(0,d.useEffect)(()=>{if(!r)return void E(null);(0,x.H)().then(e=>{var t,r;return E(null!=(r=null==(t=e.plan)?void 0:t.tier)?r:null)}).catch(()=>{})},[r]),(0,d.useEffect)(()=>{let e=()=>{B.current&&(window.scrollY>40?B.current.classList.add("header-shrink"):B.current.classList.remove("header-shrink"))};return window.addEventListener("scroll",e),()=>window.removeEventListener("scroll",e)},[]),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("header",{ref:B,className:"header-base bg-white border-b border-gray-200 sticky top-0 z-50 transition-all duration-300",children:(0,n.jsxs)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:[(0,n.jsxs)("div",{className:"flex items-center justify-between h-16 header-content transition-all duration-300",children:[(0,n.jsxs)(a(),{href:"/",className:"flex items-center gap-2 shrink-0",children:[(0,n.jsx)("img",{src:"/logo.png",alt:"CanHelp",className:"w-8 h-8 object-contain"}),(0,n.jsx)("span",{className:"logo-text text-2xl font-bold text-green-600 transition-all duration-300",children:"CanHelp"})]}),(0,n.jsxs)("nav",{className:"hidden md:flex items-center gap-5 ml-auto",children:[V?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(a(),{href:"/tasks",className:A("/tasks"),children:s("nav.find_tasks")}),(0,n.jsx)(a(),{href:"/dashboard",className:A("/dashboard"),children:s("nav.dashboard")})]}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(a(),{href:"/tasks/new",className:A("/tasks/new",!0),children:s("dashboard.new_task")})," ",(0,n.jsx)(a(),{href:"/tasks",className:A("/tasks"),children:s("nav.tasks")})," ",(0,n.jsx)(a(),{href:"/specialists",className:A("/specialists"),children:s("nav.specialists")})]}),(0,n.jsx)(a(),{href:"/pricing",className:A("/pricing",!0),children:s("nav.pricing","Pricing")}),r?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(a(),{href:"/notifications",className:"relative text-gray-600 hover:text-gray-900 flex items-center",children:[(0,n.jsx)("svg",{className:"w-5 h-5 ".concat(y>0?"text-green-600":""),fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M14.857 17.082a23.848 23.848 0 005.454-1.31A8.967 8.967 0 0118 9.75v-.7V9A6 6 0 006 9v.75a8.967 8.967 0 01-2.312 6.022c1.733.64 3.56 1.085 5.455 1.31m5.714 0a24.255 24.255 0 01-5.714 0m5.714 0a3 3 0 11-5.714 0"})}),y>0&&(0,n.jsx)("span",{className:"absolute -top-1.5 -right-1.5 min-w-[16px] h-4 px-0.5 bg-red-500 text-white text-[10px] font-bold rounded-full flex items-center justify-center leading-none",children:y>99?"99+":y})]}),(0,n.jsxs)(a(),{href:"/chat",className:"relative text-gray-600 hover:text-gray-900 flex items-center",children:[(0,n.jsx)("svg",{className:"w-5 h-5 ".concat(C>0?"text-green-500":""),fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z"})}),C>0&&(0,n.jsx)("span",{className:"absolute -top-1.5 -right-1.5 min-w-[16px] h-4 px-0.5 bg-green-500 text-white text-[10px] font-bold rounded-full flex items-center justify-center leading-none",children:C>99?"99+":C})]}),(0,n.jsxs)("div",{className:"relative",ref:S,children:[(0,n.jsxs)("button",{onClick:()=>k(!j),className:"flex items-center gap-1.5 text-sm font-medium text-gray-600 hover:text-green-600",children:[(0,n.jsx)("span",{className:"truncate max-w-[100px]",children:(0,c.H)(r.user.firstName,r.user.lastName,r.user.name)}),"pro"===z&&(0,n.jsx)("span",{className:"inline-flex items-center px-1.5 py-0.5 rounded-full text-[10px] font-bold bg-green-100 text-green-700 leading-none",children:"Pro"}),"ultimate"===z&&(0,n.jsx)("span",{className:"inline-flex items-center px-1.5 py-0.5 rounded-full text-[10px] font-bold bg-gradient-to-r from-amber-400 via-yellow-400 to-amber-400 text-gray-900 shadow-sm shadow-amber-300/50 leading-none",children:"★"}),(0,n.jsx)("svg",{className:"w-4 h-4 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"})})]}),j&&(0,n.jsxs)("div",{className:"absolute right-0 mt-2 w-52 bg-white border border-gray-200 rounded-xl shadow-lg py-1 z-50",children:[V?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(a(),{href:"/tasks/new",className:"flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50",onClick:()=>k(!1),children:[(0,n.jsx)("svg",{className:"w-4 h-4 text-gray-400 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 4v16m8-8H4"})}),s("nav.new_task")]}),(0,n.jsxs)(a(),{href:"/specialists",className:"flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50",onClick:()=>k(!1),children:[(0,n.jsx)("svg",{className:"w-4 h-4 text-gray-400 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0z"})}),s("nav.specialists")]})]}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(a(),{href:"/notifications",className:"flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50",onClick:()=>k(!1),children:[(0,n.jsx)("svg",{className:"w-4 h-4 shrink-0 ".concat(y>0?"text-green-600":"text-gray-400"),fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M14.857 17.082a23.848 23.848 0 005.454-1.31A8.967 8.967 0 0118 9.75v-.7V9A6 6 0 006 9v.75a8.967 8.967 0 01-2.312 6.022c1.733.64 3.56 1.085 5.455 1.31m5.714 0a24.255 24.255 0 01-5.714 0m5.714 0a3 3 0 11-5.714 0"})}),(0,n.jsxs)("span",{className:"flex items-center gap-1.5",children:[s("nav.notifications"),y>0&&(0,n.jsx)("span",{className:"px-1.5 py-0.5 bg-red-500 text-white text-[10px] font-bold rounded-full leading-none",children:y>99?"99+":y})]})]}),(0,n.jsxs)(a(),{href:"/chat",className:"flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50",onClick:()=>k(!1),children:[(0,n.jsx)("svg",{className:"w-4 h-4 shrink-0 ".concat(C>0?"text-green-500":"text-gray-400"),fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z"})}),(0,n.jsxs)("span",{className:"flex items-center gap-1.5",children:[s("nav.chat"),C>0&&(0,n.jsx)("span",{className:"px-1.5 py-0.5 bg-green-500 text-white text-[10px] font-bold rounded-full leading-none",children:C>99?"99+":C})]})]}),(0,n.jsxs)(a(),{href:"/dashboard",className:"flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50",onClick:()=>k(!1),children:[(0,n.jsx)("svg",{className:"w-4 h-4 text-gray-400 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6"})}),s("nav.dashboard")]})]}),(V||H)&&(0,n.jsxs)(a(),{href:"/schedule",className:"flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50",onClick:()=>k(!1),children:[(0,n.jsx)("svg",{className:"w-4 h-4 text-gray-400 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"})}),s("nav.schedule")]}),H&&(0,n.jsxs)(a(),{href:"/admin",className:"flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50",onClick:()=>k(!1),children:[(0,n.jsxs)("svg",{className:"w-4 h-4 text-gray-400 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:[(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"}),(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"})]}),s("nav.admin")]}),(0,n.jsxs)(a(),{href:"/profile",className:"flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50",onClick:()=>k(!1),children:[(0,n.jsx)("svg",{className:"w-4 h-4 text-gray-400 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z"})}),s("nav.profile")]}),(0,n.jsxs)(a(),{href:"/favorites",className:"flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50",onClick:()=>k(!1),children:[(0,n.jsx)("svg",{className:"w-4 h-4 text-gray-400 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4.318 6.318a4.5 4.5 0 000 6.364L12 20.364l7.682-7.682a4.5 4.5 0 00-6.364-6.364L12 7.636l-1.318-1.318a4.5 4.5 0 00-6.364 0z"})}),s("nav.favorites")]}),(0,n.jsx)("hr",{className:"my-1 border-gray-100"}),(0,n.jsxs)("button",{className:"w-full flex items-center gap-2.5 px-4 py-2 text-sm text-gray-700 hover:bg-green-50",onClick:()=>{k(!1),w(!0)},children:[(0,n.jsx)("svg",{className:"w-4 h-4 text-gray-400 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M18.364 5.636l-3.536 3.536m0 5.656l3.536 3.536M9.172 9.172L5.636 5.636m3.536 9.192l-3.536 3.536M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-5 0a4 4 0 11-8 0 4 4 0 018 0z"})}),s("support.title")]}),(0,n.jsx)("hr",{className:"my-1 border-gray-100"}),(0,n.jsxs)("button",{className:"w-full flex items-center gap-2.5 px-4 py-2 text-sm text-red-500 hover:bg-red-50",onClick:()=>{k(!1),(0,o.CI)().then(()=>{window.location.href="/"})},children:[(0,n.jsx)("svg",{className:"w-4 h-4 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M17 16l4-4m0 0l-4-4m4 4H7m6 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h4a3 3 0 013 3v1"})}),s("nav.logout")]})]})]})]}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(a(),{href:"/login",className:"text-gray-600 hover:text-green-600 font-medium text-sm",children:s("nav.login")}),(0,n.jsx)(a(),{href:"/register",className:"bg-green-600 text-white px-4 py-2 rounded-lg hover:bg-green-700 font-medium text-sm",children:s("nav.register")})]}),(0,n.jsx)(u,{})]}),(0,n.jsxs)("div",{className:"md:hidden flex items-center gap-2",children:[(0,n.jsx)(u,{}),(0,n.jsx)("button",{className:"p-2",onClick:()=>v(!g),"aria-label":"Toggle menu",children:(0,n.jsx)("svg",{className:"w-5 h-5 text-gray-600",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:g?(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"}):(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 6h16M4 12h16M4 18h16"})})})]})]}),g&&(0,n.jsxs)("div",{className:"md:hidden py-4 border-t border-gray-100 flex flex-col gap-3",children:[V?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(a(),{href:"/tasks",className:R("/tasks"),onClick:()=>v(!1),children:[(0,n.jsx)("svg",{className:"w-4 h-4 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})}),s("nav.find_tasks")]}),(0,n.jsxs)(a(),{href:"/dashboard",className:R("/dashboard"),onClick:()=>v(!1),children:[(0,n.jsx)("svg",{className:"w-4 h-4 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6"})}),s("nav.dashboard")]})]}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(a(),{href:"/tasks/new",className:R("/tasks/new",!0),onClick:()=>v(!1),children:[(0,n.jsx)("svg",{className:"w-4 h-4 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 4v16m8-8H4"})}),s("nav.new_task")]}),(0,n.jsxs)(a(),{href:"/tasks",className:R("/tasks"),onClick:()=>v(!1),children:[(0,n.jsx)("svg",{className:"w-4 h-4 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"})}),s("nav.tasks")]}),(0,n.jsxs)(a(),{href:"/specialists",className:R("/specialists"),onClick:()=>v(!1),children:[(0,n.jsx)("svg",{className:"w-4 h-4 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0z"})}),s("nav.specialists")]})]}),r?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(a(),{href:"/chat",className:R("/chat",!0),onClick:()=>v(!1),children:[(0,n.jsx)("svg",{className:"w-4 h-4 shrink-0 ".concat(C>0?"text-green-500":""),fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8 10h.01M12 10h.01M16 10h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z"})}),s("nav.chat"),C>0&&(0,n.jsx)("span",{className:"ml-1 px-1.5 py-0.5 bg-green-500 text-white text-[10px] font-bold rounded-full",children:C})]}),V?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(a(),{href:"/tasks/new",className:R("/tasks/new",!0),onClick:()=>v(!1),children:[(0,n.jsx)("svg",{className:"w-4 h-4 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 4v16m8-8H4"})}),s("nav.new_task")]}),(0,n.jsxs)(a(),{href:"/specialists",className:R("/specialists"),onClick:()=>v(!1),children:[(0,n.jsx)("svg",{className:"w-4 h-4 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0z"})}),s("nav.specialists")]})]}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(a(),{href:"/notifications",className:R("/notifications",!0),onClick:()=>v(!1),children:[(0,n.jsx)("svg",{className:"w-4 h-4 shrink-0 ".concat(y>0?"text-green-600":""),fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M14.857 17.082a23.848 23.848 0 005.454-1.31A8.967 8.967 0 0118 9.75v-.7V9A6 6 0 006 9v.75a8.967 8.967 0 01-2.312 6.022c1.733.64 3.56 1.085 5.455 1.31m5.714 0a24.255 24.255 0 01-5.714 0m5.714 0a3 3 0 11-5.714 0"})}),(0,n.jsxs)("span",{className:"flex items-center gap-1.5",children:[s("nav.notifications"),y>0&&(0,n.jsx)("span",{className:"px-1.5 py-0.5 bg-red-500 text-white text-[10px] font-bold rounded-full",children:y>99?"99+":y})]})]}),(0,n.jsxs)(a(),{href:"/dashboard",className:R("/dashboard"),onClick:()=>v(!1),children:[(0,n.jsx)("svg",{className:"w-4 h-4 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6"})}),s("nav.dashboard")]})]}),(0,n.jsxs)(a(),{href:"/favorites",className:R("/favorites",!0),onClick:()=>v(!1),children:[(0,n.jsx)("svg",{className:"w-4 h-4 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4.318 6.318a4.5 4.5 0 000 6.364L12 20.364l7.682-7.682a4.5 4.5 0 00-6.364-6.364L12 7.636l-1.318-1.318a4.5 4.5 0 00-6.364 0z"})}),s("nav.favorites")]}),(V||H)&&(0,n.jsxs)(a(),{href:"/schedule",className:R("/schedule",!0),onClick:()=>v(!1),children:[(0,n.jsx)("svg",{className:"w-4 h-4 text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"})}),s("nav.schedule")]}),H&&(0,n.jsxs)(a(),{href:"/admin",className:R("/admin"),onClick:()=>v(!1),children:[(0,n.jsxs)("svg",{className:"w-4 h-4 text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:[(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"}),(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"})]}),s("nav.admin")]}),(0,n.jsxs)(a(),{href:"/profile",className:R("/profile",!0),onClick:()=>v(!1),children:[(0,n.jsx)("svg",{className:"w-4 h-4 text-gray-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z"})}),s("nav.profile")]}),(0,n.jsxs)("button",{onClick:()=>{v(!1),(0,o.CI)().then(()=>{window.location.href="/"})},className:"flex items-center gap-2 text-left text-red-500 py-1 font-medium",children:[(0,n.jsx)("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M17 16l4-4m0 0l-4-4m4 4H7m6 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h4a3 3 0 013 3v1"})}),s("nav.logout")]})]}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(a(),{href:"/login",className:"text-gray-700 font-medium py-1",onClick:()=>v(!1),children:s("nav.login")}),(0,n.jsx)(a(),{href:"/register",className:"text-green-600 font-medium py-1",onClick:()=>v(!1),children:s("nav.register")})]})]})]})}),M&&(0,n.jsx)("div",{className:"fixed bottom-5 right-5 z-[200] max-w-sm w-full",children:(0,n.jsxs)("div",{className:"bg-white border border-gray-200 rounded-xl shadow-xl p-4 flex items-start gap-3 animate-fade-in",children:[(0,n.jsx)("span",{className:"text-2xl shrink-0",children:"\uD83D\uDCAC"}),(0,n.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,n.jsx)("p",{className:"font-semibold text-gray-900 text-sm",children:s("chat.toast_title")}),(0,n.jsx)("p",{className:"text-xs text-gray-500 truncate mt-0.5",children:M.body})]}),(0,n.jsxs)("div",{className:"flex flex-col items-end gap-2 shrink-0",children:[(0,n.jsx)("button",{onClick:()=>_(null),className:"text-gray-400 hover:text-gray-600 text-lg leading-none","aria-label":"close",children:"\xd7"}),(0,n.jsx)(a(),{href:"/chat?room=".concat(M.roomId),onClick:()=>_(null),className:"text-xs text-green-600 hover:underline font-medium",children:s("chat.toast_open")})]})]})}),b&&(0,n.jsx)(p,{onClose:()=>w(!1)})]})}},9808:(e,t,r)=>{"use strict";r.d(t,{Footer:()=>d});var n=r(4568),s=r(9906),a=r(7620),l=r(9664),o=r.n(l);let i=[{key:"telegram",label:"Telegram",hoverClass:"hover:text-sky-500",svg:''},{key:"instagram",label:"Instagram",hoverClass:"hover:text-pink-500",svg:''},{key:"facebook",label:"Facebook",hoverClass:"hover:text-green-600",svg:''},{key:"twitter",label:"X",hoverClass:"hover:text-gray-900",svg:''},{key:"youtube",label:"YouTube",hoverClass:"hover:text-red-600",svg:''},{key:"tiktok",label:"TikTok",hoverClass:"hover:text-black",svg:''},{key:"whatsapp",label:"WhatsApp",hoverClass:"hover:text-green-500",svg:''},{key:"viber",label:"Viber",hoverClass:"hover:text-purple-600",svg:''}];function c(e){let{className:t="",links:r}=e,s=i.filter(e=>{let{key:t}=e;return null==r?void 0:r[t]});return 0===s.length?null:(0,n.jsx)("div",{className:"flex gap-4 flex-wrap ".concat(t),children:s.map(e=>{let{key:t,label:s,hoverClass:a,svg:l}=e;return(0,n.jsx)("a",{href:r[t],target:"_blank",rel:"noopener noreferrer","aria-label":s,className:"text-gray-500 transition ".concat(a),children:(0,n.jsx)("svg",{width:"22",height:"22",viewBox:"0 0 24 24",fill:"currentColor",dangerouslySetInnerHTML:{__html:l}})},t)})})}function d(){let{t:e}=(0,s.Y)(),t=new Date().getFullYear(),[r,l]=(0,a.useState)({});return(0,a.useEffect)(()=>{fetch("".concat("https://api.canhelp.gr","/api/admin/social-public")).then(e=>e.ok?e.json():{}).then(e=>{let t={};for(let[r,n]of Object.entries(e))n&&(t[r.replace("social.","")]=n);l(t)}).catch(()=>{})},[]),(0,n.jsx)("footer",{className:"bg-white border-t border-gray-200 mt-16",children:(0,n.jsxs)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-12",children:[(0,n.jsxs)("div",{className:"flex flex-col md:flex-row justify-between items-start gap-10",children:[(0,n.jsxs)("div",{className:"flex-1 min-w-[200px] flex flex-col items-start",children:[(0,n.jsx)("span",{className:"logo-text text-3xl text-green-700 font-bold mb-2",children:"CanHelp"}),(0,n.jsx)("p",{className:"text-base text-gray-600 mb-4",children:e("footer.slogan")})]}),(0,n.jsxs)("div",{className:"flex-1 min-w-[180px]",children:[(0,n.jsx)("h3",{className:"text-lg font-semibold text-gray-900 mb-3",children:e("footer.links")}),(0,n.jsxs)("ul",{className:"space-y-2",children:[(0,n.jsx)("li",{children:(0,n.jsx)(o(),{href:"/",className:"hover:text-green-600 transition",children:e("nav.home")})}),(0,n.jsx)("li",{children:(0,n.jsx)(o(),{href:"/tasks",className:"hover:text-green-600 transition",children:e("nav.tasks")})}),(0,n.jsx)("li",{children:(0,n.jsx)(o(),{href:"/specialists",className:"hover:text-green-600 transition",children:e("nav.specialists")})}),(0,n.jsx)("li",{children:(0,n.jsx)(o(),{href:"/pricing",className:"hover:text-green-600 transition",children:e("nav.pricing")})}),(0,n.jsx)("li",{children:(0,n.jsx)(o(),{href:"/support",className:"hover:text-green-600 transition",children:e("support.title")})}),(0,n.jsx)("li",{children:(0,n.jsx)(o(),{href:"/privacy",className:"hover:text-green-600 transition",children:e("nav.privacy")})}),(0,n.jsx)("li",{children:(0,n.jsx)(o(),{href:"/delete-account",className:"hover:text-red-500 transition",children:e("nav.delete_account")})})]})]}),(0,n.jsxs)("div",{className:"flex-1 min-w-[180px]",children:[(0,n.jsx)("h3",{className:"text-lg font-semibold text-gray-900 mb-3",children:e("footer.socials")}),(0,n.jsx)("p",{className:"text-gray-500 text-sm mb-2",children:"info@canhelp.gr"}),(0,n.jsx)(c,{className:"mt-2",links:r})]})]}),(0,n.jsxs)("div",{className:"mt-10 border-t border-gray-100 pt-6 text-center text-gray-400 text-sm",children:["\xa9 ",t," CanHelp. ",e("footer.rights")]})]})})}}},e=>{e.O(0,[9950,1516,9664,2838,9906,2982,587,18,7358],()=>e(e.s=2568)),_N_E=e.O()}]); uþÿÿ ,=(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8457],{1258:(e,t,r)=>{"use strict";function l(e){if(!(null==e?void 0:e.trim()))return"—";let t=e.trim().split(/\s+/);return t.length<2||!t[1]?t[0]:"".concat(t[0]," ").concat(t[1][0].toUpperCase(),".")}function s(e,t,r){if(null==e?void 0:e.trim()){let r=null==t?void 0:t.trim();return r?"".concat(e.trim()," ").concat(r[0].toUpperCase(),"."):e.trim()}return l(r)}r.d(t,{E:()=>l,H:()=>s})},1592:(e,t,r)=>{"use strict";r.d(t,{CI:()=>a,Hh:()=>n,Jv:()=>s,wV:()=>i,yK:()=>l});let l=(0,r(6504).M)({baseURL:"https://api.canhelp.gr"}),{signIn:s,signOut:a,signUp:n,useSession:i}=l},4251:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>g});var l=r(4568),s=r(7620),a=r(7541),n=r(9664),i=r.n(n),o=r(1592),c=r(9906),d=r(2982),u=r(1258),x=r(2838);let m="https://api.canhelp.gr";function h(){var e,t,r,n,h,g,f;let p=(0,a.useRouter)(),v=(0,a.useSearchParams)(),{data:b,isPending:j}=(0,o.wV)(),{t:y,locale:w}=(0,c.Y)(),[N,k]=(0,s.useState)([]),[C,L]=(0,s.useState)(!0),[M,_]=(0,s.useState)(null),[S,U]=(0,s.useState)([]),[D,E]=(0,s.useState)(!1),[T,A]=(0,s.useState)(""),[R,B]=(0,s.useState)(!1),[H,W]=(0,s.useState)(null),[I,z]=(0,s.useState)(!1),[V,P]=(0,s.useState)(null),K=(0,s.useRef)(null),O=(0,s.useRef)(null),F=(0,s.useRef)(null),G=(0,s.useRef)(null);(0,s.useEffect)(()=>{j||b||p.push("/login")},[b,j]),(0,s.useEffect)(()=>{b&&((0,d.Zp)().then(e=>{k(e);let t=v.get("room");t&&_(t)}).catch(e=>console.error("[chat] getChatRooms error:",e)).finally(()=>L(!1)),(0,d.z4)().then(e=>W({left:e.messagesLeft,sent:e.messagesSent})).catch(e=>console.error("[chat] getDailyUsage error:",e)))},[b]),(0,s.useEffect)(()=>{if(!b)return;let e=(0,x.io)(m,{withCredentials:!0,transports:["websocket","polling"]});return K.current=e,e.on("connect",()=>B(!0)),e.on("disconnect",()=>B(!1)),e.on("new_message",e=>{U(t=>{var r,l;if(t.some(t=>t.message.id===e.id))return t;let s=b.user&&b.user.id===e.senderId?{id:b.user.id,name:null!=(r=b.user.name)?r:"",image:null!=(l=b.user.image)?l:void 0}:null;return[...t,{message:e,sender:s}]}),k(t=>t.map(t=>{var r,l;return t.room.id===e.roomId?{...t,lastMessage:{body:e.body,createdAt:e.createdAt,translations:null!=(r=e.translations)?r:null,imageUrl:null!=(l=e.imageUrl)?l:null}}:t}).sort((e,t)=>{var r,l;let s=(null==(r=e.lastMessage)?void 0:r.createdAt)?new Date(e.lastMessage.createdAt).getTime():new Date(e.room.createdAt).getTime();return((null==(l=t.lastMessage)?void 0:l.createdAt)?new Date(t.lastMessage.createdAt).getTime():new Date(t.room.createdAt).getTime())-s}))}),e.on("message_translated",e=>{let{id:t,roomId:r,translations:l}=e;U(e=>e.map(e=>e.message.id===t?{...e,message:{...e.message,translations:l}}:e)),r&&k(e=>e.map(e=>e.room.id===r&&e.lastMessage?{...e,lastMessage:{...e.lastMessage,translations:l}}:e))}),()=>{e.disconnect(),K.current=null}},[b]),(0,s.useEffect)(()=>{var e,t;M&&(E(!0),U([]),(0,d.VL)(M).then(U).catch(e=>console.error("[chat] getMessages error:",e)).finally(()=>E(!1)),null==(e=K.current)||e.emit("join_room",M),null==(t=K.current)||t.emit("mark_read",M))},[M]),(0,s.useEffect)(()=>{if(!M)return;let e=setTimeout(()=>{var e;return null==(e=F.current)?void 0:e.focus()},50);return()=>clearTimeout(e)},[M]),(0,s.useEffect)(()=>{var e;null==(e=O.current)||e.scrollIntoView({behavior:"smooth",block:"nearest"})},[S]),(0,s.useEffect)(()=>{let e=e=>{"Escape"===e.key&&P(null)};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[]);let J=(0,s.useCallback)(()=>{let e=T.trim();e&&M&&K.current&&(H&&null!==H.left&&H.left<=0||(K.current.emit("send_message",{roomId:M,body:e,locale:w}),A(""),W(e=>e&&null!==e.left?{...e,left:e.left-1,sent:e.sent+1}:e)))},[T,M,H]),Y=(0,s.useCallback)(async e=>{if(M&&K.current){z(!0);try{let t=new FormData;t.append("file",e);let r=await fetch("".concat(m,"/api/uploads"),{method:"POST",credentials:"include",body:t});if(!r.ok)throw Error("Upload failed");let{url:l}=await r.json();K.current.emit("send_message",{roomId:M,body:"",imageUrl:l,locale:w})}catch(e){}finally{z(!1),G.current&&(G.current.value="")}}},[M,w]),Z=null!=(g=({ru:"ru-RU",en:"en-US",el:"el-GR"})[w])?g:"el-GR";if(j||C)return(0,l.jsx)("div",{className:"text-center py-20 text-white",children:y("common.loading")});let q=N.find(e=>e.room.id===M),Q=null==b||null==(e=b.user)?void 0:e.id;return(0,l.jsxs)("div",{className:"max-w-5xl mx-auto px-4 py-6 h-[calc(100vh-80px)] flex gap-4",children:[(0,l.jsxs)("div",{className:"w-72 flex-shrink-0 bg-white rounded-xl border border-gray-200 overflow-hidden flex flex-col",children:[(0,l.jsxs)("div",{className:"p-4 border-b border-gray-100",children:[(0,l.jsx)("h1",{className:"font-bold text-gray-900 text-lg",children:y("nav.chat")}),(0,l.jsxs)("div",{className:"flex items-center gap-1.5 mt-1",children:[(0,l.jsx)("span",{className:"w-2 h-2 rounded-full ".concat(R?"bg-green-400":"bg-gray-300")}),(0,l.jsx)("span",{className:"text-xs text-gray-400",children:R?y("chat.connected"):y("chat.disconnected")})]})]}),(0,l.jsx)("div",{className:"flex-1 overflow-y-auto",children:0===N.length?(0,l.jsx)("div",{className:"p-6 text-center text-gray-400 text-sm",children:y("chat.no_rooms")}):N.map(e=>{var t,r,s;let{room:a,task:n,otherUser:i,lastMessage:o}=e,c=null!=(r=null==n?void 0:n.title)?r:(0,u.H)(null==i?void 0:i.firstName,null==i?void 0:i.lastName,null==i?void 0:i.name)||y("chat.direct_chat"),d=n?(0,u.H)(null==i?void 0:i.firstName,null==i?void 0:i.lastName,null==i?void 0:i.name)||"":y("chat.direct_chat");return(0,l.jsxs)("button",{onClick:()=>{_(a.id),setTimeout(()=>{var e;return null==(e=F.current)?void 0:e.focus()},50)},className:"w-full text-left px-4 py-3 border-b border-gray-50 hover:bg-gray-50 transition ".concat(M===a.id?"bg-green-50 border-l-2 border-l-green-500":""),children:[(0,l.jsxs)("div",{className:"flex items-start justify-between gap-1",children:[(0,l.jsx)("p",{className:"text-sm font-medium text-gray-800 line-clamp-1 flex-1",children:c}),o&&(0,l.jsx)("span",{className:"text-[10px] text-gray-400 shrink-0 mt-0.5",children:function(e){let t=new Date(e),r=new Date,l=Math.floor((r.getTime()-t.getTime())/6e4);return l<1?y("chat.just_now"):l<60?"".concat(l).concat(y("chat.min_ago")):t.toDateString()===r.toDateString()?t.toLocaleTimeString(Z,{hour:"2-digit",minute:"2-digit"}):t.toLocaleDateString(Z,{day:"2-digit",month:"2-digit"})}(o.createdAt)})]}),o?(0,l.jsx)("p",{className:"text-xs text-gray-400 mt-0.5 line-clamp-1",children:o.imageUrl&&!o.body?"\uD83D\uDCF7":null!=(s=null==(t=o.translations)?void 0:t[w])?s:o.body}):n?(0,l.jsx)("p",{className:"text-xs text-gray-400 mt-0.5 line-clamp-1",children:d}):null]},a.id)})})]}),(0,l.jsx)("div",{className:"flex-1 bg-white rounded-xl border border-gray-200 flex flex-col overflow-hidden",children:M?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("div",{className:"px-5 py-4 border-b border-gray-100",children:(0,l.jsx)("p",{className:"font-semibold text-gray-800 text-sm",children:null!=(f=null==q||null==(t=q.task)?void 0:t.title)?f:(0,u.H)(null==q||null==(r=q.otherUser)?void 0:r.firstName,null==q||null==(n=q.otherUser)?void 0:n.lastName,null==q||null==(h=q.otherUser)?void 0:h.name)||y("chat.direct_chat")})}),(null==q?void 0:q.task)&&(0,l.jsxs)(i(),{href:"/tasks/".concat(q.task.id),className:"flex items-center gap-3 mx-5 mt-4 px-4 py-3 bg-green-50 border border-green-200 rounded-xl hover:bg-green-100 transition group",children:[(0,l.jsx)("div",{className:"w-8 h-8 rounded-lg bg-green-600 flex items-center justify-center flex-shrink-0",children:(0,l.jsxs)("svg",{className:"w-4 h-4 text-white",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",children:[(0,l.jsx)("path",{d:"M16 4h2a2 2 0 012 2v14a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2h2"}),(0,l.jsx)("rect",{x:"8",y:"2",width:"8",height:"4",rx:"1",ry:"1"})]})}),(0,l.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,l.jsx)("p",{className:"text-xs text-gray-500 font-medium",children:y("chat.linked_task")}),(0,l.jsx)("p",{className:"text-sm font-semibold text-gray-800 truncate group-hover:underline",children:q.task.title})]}),(0,l.jsx)("svg",{className:"w-4 h-4 text-gray-400 flex-shrink-0",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",children:(0,l.jsx)("polyline",{points:"9 18 15 12 9 6"})})]}),(0,l.jsxs)("div",{className:"flex-1 overflow-y-auto px-5 py-4 space-y-3",children:[D?(0,l.jsx)("div",{className:"text-center text-gray-400 text-sm py-10",children:y("common.loading")}):0===S.length?(0,l.jsx)("div",{className:"text-center text-gray-400 text-sm py-10",children:y("chat.no_messages")}):S.map(e=>{var t,r,s,a,n;let{message:i,sender:o}=e,c=i.senderId===Q;return(0,l.jsxs)("div",{className:"flex gap-2.5 ".concat(c?"flex-row-reverse":""),children:[(0,l.jsx)("div",{className:"w-8 h-8 rounded-full bg-green-100 flex-shrink-0 flex items-center justify-center text-green-700 text-xs font-bold overflow-hidden",children:(null==o?void 0:o.image)?(0,l.jsx)("img",{src:o.image,alt:o.name,className:"w-full h-full object-cover"}):null!=(a=null==o||null==(r=o.name)||null==(t=r[0])?void 0:t.toUpperCase())?a:"?"}),(0,l.jsxs)("div",{className:"max-w-[70%] ".concat(c?"items-end":"items-start"," flex flex-col gap-1"),children:[!c&&(0,l.jsx)("span",{className:"text-xs text-gray-400 px-1",children:(0,u.H)(null==o?void 0:o.firstName,null==o?void 0:o.lastName,null==o?void 0:o.name)}),i.imageUrl?(0,l.jsx)("button",{type:"button",onClick:()=>P("".concat(m).concat(i.imageUrl)),className:"block focus:outline-none",children:(0,l.jsx)("img",{src:"".concat(m).concat(i.imageUrl),alt:"photo",className:"rounded-2xl max-w-[240px] max-h-[320px] object-cover cursor-pointer hover:opacity-90 transition"})}):(0,l.jsx)("div",{className:"px-4 py-2 rounded-2xl text-sm leading-relaxed ".concat(c?"bg-green-600 text-white rounded-tr-sm":"bg-gray-100 text-gray-800 rounded-tl-sm"),children:null!=(n=null==(s=i.translations)?void 0:s[w])?n:i.body}),(0,l.jsx)("span",{className:"text-xs text-gray-300 px-1",children:new Date(i.createdAt).toLocaleTimeString(Z,{hour:"2-digit",minute:"2-digit"})})]})]},i.id)}),(0,l.jsx)("div",{ref:O})]}),V&&(0,l.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/80 backdrop-blur-sm",onClick:()=>P(null),children:(0,l.jsxs)("div",{className:"relative max-w-[90vw] max-h-[90vh]",onClick:e=>e.stopPropagation(),children:[(0,l.jsx)("img",{src:V,alt:"photo",className:"max-w-[90vw] max-h-[90vh] rounded-2xl object-contain shadow-2xl"}),(0,l.jsx)("button",{onClick:()=>P(null),className:"absolute -top-3 -right-3 w-8 h-8 bg-white rounded-full flex items-center justify-center shadow-lg hover:bg-gray-100 transition","aria-label":"Close",children:(0,l.jsx)("svg",{className:"w-4 h-4 text-gray-700",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2.5,children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})}),(0,l.jsx)("a",{href:V,download:!0,target:"_blank",rel:"noreferrer",className:"absolute -bottom-3 -right-3 w-8 h-8 bg-white rounded-full flex items-center justify-center shadow-lg hover:bg-gray-100 transition","aria-label":"Download",onClick:e=>e.stopPropagation(),children:(0,l.jsx)("svg",{className:"w-4 h-4 text-gray-700",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 16v2a2 2 0 002 2h12a2 2 0 002-2v-2M7 10l5 5 5-5M12 15V3"})})})]})}),(0,l.jsxs)("div",{className:"px-4 py-3 border-t border-gray-100",children:[" ",(0,l.jsx)("input",{ref:G,type:"file",accept:"image/jpeg,image/png,image/gif,image/webp",className:"hidden",onChange:e=>{var t;let r=null==(t=e.target.files)?void 0:t[0];r&&Y(r)}})," ",H&&null!==H.left&&H.left<=0&&(0,l.jsxs)("div",{className:"mb-2 flex items-center gap-2 bg-red-50 border border-red-200 rounded-xl px-3 py-2",children:[(0,l.jsx)("svg",{className:"w-4 h-4 text-red-400 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v2m0 4h.01M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z"})}),(0,l.jsx)("span",{className:"text-xs text-red-700 flex-1",children:y("chat.limit_reached","Daily message limit reached")}),(0,l.jsx)(i(),{href:"/pricing",className:"text-xs font-medium text-red-700 underline",children:y("dashboard.plan.upgrade","Upgrade plan")})]}),H&&null!==H.left&&H.left>0&&H.left<=Math.ceil((H.left+H.sent)*.2)&&(0,l.jsxs)("div",{className:"mb-2 flex items-center gap-2 bg-amber-50 border border-amber-200 rounded-xl px-3 py-2",children:[(0,l.jsx)("svg",{className:"w-4 h-4 text-amber-400 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v2m0 4h.01M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z"})}),(0,l.jsx)("span",{className:"text-xs text-amber-700 flex-1",children:y("chat.limit_warning","{n} messages left today").replace("{n}",String(H.left))}),(0,l.jsx)(i(),{href:"/pricing",className:"text-xs font-medium text-amber-700 underline",children:y("dashboard.plan.upgrade","Upgrade plan")})]}),(0,l.jsxs)("div",{className:"flex gap-2 items-end",children:[(0,l.jsx)("button",{type:"button",onClick:()=>{var e;return null==(e=G.current)?void 0:e.click()},disabled:I||!R||!!(H&&null!==H.left&&H.left<=0),className:"h-10 w-10 text-gray-400 hover:text-gray-500 disabled:opacity-40 disabled:cursor-not-allowed flex-shrink-0 flex items-center justify-center rounded-xl hover:bg-gray-50 transition",title:"Send photo",children:I?(0,l.jsxs)("svg",{className:"w-5 h-5 animate-spin",fill:"none",viewBox:"0 0 24 24",children:[(0,l.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,l.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v8H4z"})]}):(0,l.jsxs)("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.8,children:[(0,l.jsx)("rect",{x:"3",y:"3",width:"18",height:"18",rx:"3",ry:"3"}),(0,l.jsx)("circle",{cx:"8.5",cy:"8.5",r:"1.5"}),(0,l.jsx)("polyline",{points:"21 15 16 10 5 21"})]})}),(0,l.jsx)("textarea",{ref:F,value:T,onChange:e=>A(e.target.value),onKeyDown:e=>{"Enter"!==e.key||e.shiftKey||(e.preventDefault(),J())},rows:1,placeholder:y("chat.placeholder"),disabled:!!(H&&null!==H.left&&H.left<=0),className:"flex-1 border border-gray-300 rounded-xl px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 resize-none max-h-32 disabled:bg-gray-50 disabled:text-gray-400",style:{minHeight:"40px"}}),(0,l.jsx)("button",{onClick:J,disabled:!T.trim()||!R||!!(H&&null!==H.left&&H.left<=0),className:"h-10 w-10 bg-green-600 text-white rounded-xl hover:bg-green-700 disabled:opacity-40 disabled:cursor-not-allowed flex-shrink-0 flex items-center justify-center",children:(0,l.jsx)("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2.2,children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 12h14M12 5l7 7-7 7"})})})]})]})]}):(0,l.jsx)("div",{className:"flex-1 flex items-center justify-center text-gray-400 text-sm",children:y("chat.select")})})]})}function g(){return(0,l.jsx)(s.Suspense,{fallback:(0,l.jsx)("div",{className:"text-center py-20 text-white",children:"..."}),children:(0,l.jsx)(h,{})})}},7016:(e,t,r)=>{Promise.resolve().then(r.bind(r,4251))}},e=>{e.O(0,[1516,9664,2838,9906,2982,587,18,7358],()=>e(e.s=7016)),_N_E=e.O()}]); rþÿÿ +^(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5105],{252:(e,s,t)=>{"use strict";t.r(s),t.d(s,{default:()=>g});var a=t(4568),r=t(7620),l=t(7541),n=t(9664),i=t.n(n),d=t(1592),c=t(9906),o=t(2982),x=t(4017),m=t(2035);function h(e){let{current:s,limit:t,label:r,className:l=""}=e;if(null===t)return(0,a.jsxs)("div",{className:"".concat(l),children:[(0,a.jsxs)("div",{className:"flex justify-between items-center mb-1",children:[(0,a.jsx)("span",{className:"text-xs text-gray-500",children:r}),(0,a.jsx)("span",{className:"text-xs font-semibold text-green-600",children:"∞"})]}),(0,a.jsx)("div",{className:"h-1.5 rounded-full bg-green-100",children:(0,a.jsx)("div",{className:"h-full w-full rounded-full bg-green-400"})})]});let n=t>0?Math.min(100,Math.round(s/t*100)):100,i=Math.max(0,t-s);return(0,a.jsxs)("div",{className:l,children:[(0,a.jsxs)("div",{className:"flex justify-between items-center mb-1",children:[(0,a.jsx)("span",{className:"text-xs text-gray-500",children:r}),(0,a.jsxs)("span",{className:"text-xs font-semibold ".concat(n>=100?"text-red-600":n>=80?"text-amber-600":"text-gray-600"),children:[i," / ",t]})]}),(0,a.jsx)("div",{className:"h-1.5 rounded-full bg-gray-100",children:(0,a.jsx)("div",{className:"h-full rounded-full transition-all ".concat(n>=100?"bg-red-500":n>=80?"bg-amber-400":"bg-green-500"),style:{width:"".concat(n,"%")}})})]})}function u(e){let{dashboard:s,t}=e,r=s.plan,l=s.planExpiration,n=s.usage,d=s.stats,c=l?Math.max(0,Math.min(100,Math.round(l.daysLeft/30*100))):100,o=l?l.daysLeft<=3?"bg-red-500":l.daysLeft<=7?"bg-amber-400":"bg-green-400":"bg-green-400";return(0,a.jsxs)("div",{className:"bg-white rounded-2xl border border-gray-200 p-5 mb-6",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("h2",{className:"font-semibold text-gray-800 text-sm",children:t("dashboard.plan.title","My Plan")}),r?(0,a.jsx)(m.d,{tier:r.tier,size:"sm"}):(0,a.jsx)("span",{className:"text-xs text-gray-400",children:t("dashboard.plan.no_plan","Free")})]}),(0,a.jsx)(i(),{href:"/pricing",className:"text-xs font-medium text-green-600 hover:underline",children:(null==r?void 0:r.tier)==="ultimate"?null:t("dashboard.plan.upgrade","Upgrade")})]}),l&&(0,a.jsxs)("div",{className:"mb-4",children:[(0,a.jsxs)("div",{className:"flex justify-between text-xs text-gray-500 mb-1",children:[(0,a.jsx)("span",{children:t("dashboard.plan.expires","Expires in {n} days").replace("{n}",String(l.daysLeft))}),(0,a.jsxs)("span",{children:[l.daysLeft," ",t("pricing.days","days")]})]}),(0,a.jsx)("div",{className:"h-1.5 rounded-full bg-gray-100",children:(0,a.jsx)("div",{className:"h-full rounded-full transition-all ".concat(o),style:{width:"".concat(c,"%")}})})]}),(void 0!==n.messagesSent||void 0!==n.ordersMade)&&(0,a.jsxs)("div",{className:"space-y-2 mb-4",children:[(0,a.jsx)("p",{className:"text-xs font-medium text-gray-500 uppercase tracking-wide",children:t("dashboard.plan.limits","Daily limits")}),(0,a.jsx)(h,{current:n.messagesSent,limit:null!==n.messagesLeft?n.messagesSent+n.messagesLeft:null,label:t("dashboard.plan.messages","Messages")}),(0,a.jsx)(h,{current:n.ordersMade,limit:null!==n.ordersLeft?n.ordersMade+n.ordersLeft:null,label:t("dashboard.plan.orders","Orders")})]}),Object.keys(d).length>0&&(0,a.jsx)("div",{className:"grid grid-cols-2 gap-2",children:Object.entries(d).map(e=>{let[s,r]=e;return(0,a.jsxs)("div",{className:"bg-gray-50 rounded-xl px-3 py-2 text-center",children:[(0,a.jsx)("p",{className:"text-lg font-bold text-gray-800",children:r}),(0,a.jsx)("p",{className:"text-[10px] text-gray-400 uppercase tracking-wide",children:t("dashboard.stats.".concat(s),s)})]},s)})})]})}function g(){var e,s,t;let{data:n,isPending:m}=(0,d.wV)(),h=(0,l.useRouter)(),g=(0,l.useSearchParams)(),{t:p,locale:b}=(0,c.Y)(),[f,j]=(0,r.useState)([]),[N,v]=(0,r.useState)([]),[y,w]=(0,r.useState)([]),[k,L]=(0,r.useState)([]),[M,_]=(0,r.useState)(!0),[C,E]=(0,r.useState)(null),[S,D]=(0,r.useState)(null),[B,R]=(0,r.useState)(null);if((0,r.useEffect)(()=>{m||n||h.push("/login")},[n,m]),(0,r.useEffect)(()=>{if(!n)return;let e=g.get("ref");if(!e)return;(0,o.C0)(e).catch(()=>{});let s=new URLSearchParams(g.toString());s.delete("ref");let t=s.toString()?"?".concat(s.toString()):window.location.pathname;h.replace(t)},[n]),(0,r.useEffect)(()=>{n&&(0,o.Bb)().then(e=>{let{cards:s}=e;return R(s.length>0)}).catch(()=>R(null))},[n]),(0,r.useEffect)(()=>{n&&Promise.all([(0,o.Fu)(),(0,o.aT)(),(0,o.q7)(),(0,o.Tr)(),(0,o.H)()]).then(e=>{let[s,t,a,r,l]=e;j(s),v(t),w(a),L(r.filter(e=>"task_invite"===e.type)),E(l)}).catch(()=>{}).finally(()=>_(!1))},[n]),(0,r.useEffect)(()=>{var e;n&&("specialist"===(null==(e=n.user)?void 0:e.role)?(0,o.zk)().then(D).catch(()=>{}):(0,o.ML)().then(D).catch(()=>{}))},[n]),m||M)return(0,a.jsx)("div",{className:"text-center py-20 text-white",children:p("common.loading")});let z="ru"===b?"ru-RU":"uk"===b?"uk-UA":"en"===b?"en-US":"el-GR",O=f.filter(e=>"completed"!==e.status&&"cancelled"!==e.status),P=f.filter(e=>"completed"===e.status||"cancelled"===e.status),F=N.filter(e=>{let s=e.offer||e,t=e.task;return"other_accepted"!==s.status&&(null==t?void 0:t.status)!=="completed"&&(null==t?void 0:t.status)!=="cancelled"}),H=N.filter(e=>{let s=e.offer||e,t=e.task;return"other_accepted"===s.status||(null==t?void 0:t.status)==="completed"||(null==t?void 0:t.status)==="cancelled"});function U(e){var s,t;let{task:r}=e,l=null!=(s=r.offerCount)?s:0,n=null!=(t=r.declinedCount)?t:0;return(0,a.jsx)(i(),{href:"/tasks/".concat(r.id),className:"block bg-white rounded-xl border border-gray-200 p-4 hover:shadow-sm hover:border-green-300 transition",children:(0,a.jsxs)("div",{className:"flex justify-between items-start",children:[(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("p",{className:"font-medium text-gray-900 truncate",children:(0,x.Oj)(r,b)}),(0,a.jsx)("p",{className:"text-xs text-gray-400 mt-1",children:new Date(r.createdAt).toLocaleDateString(z)}),l>0&&(0,a.jsxs)("div",{className:"flex items-center gap-2 mt-1.5",children:[(0,a.jsxs)("span",{className:"text-xs text-green-600 font-medium",children:["\uD83D\uDCBC ",l," ",p("dashboard.offers_count","offers")]}),n>0&&(0,a.jsxs)("span",{className:"text-xs text-red-400",children:["✕ ",n," ",p("dashboard.declined_count","declined")]})]})]}),(0,a.jsxs)("div",{className:"ml-3 text-right shrink-0",children:[(0,a.jsx)("span",{className:"text-xs px-2 py-0.5 rounded-full ".concat("open"===r.status||"in_progress"===r.status?"bg-green-100 text-green-700":"completed"===r.status?"bg-gray-100 text-gray-600":"bg-red-100 text-red-600"),children:p("task.status.".concat(r.status),r.status)}),r.budget&&(0,a.jsxs)("p",{className:"text-sm font-bold text-green-600 mt-1",children:[(0,x.$g)(r.budget),"€"]})]})]})})}function W(e){var s,t;let{row:r}=e,l=r.offer||r,n=r.task,d=(null==n?void 0:n.status)==="completed"&&"accepted"===l.status&&null!=(t=null==(s=y.find(e=>{var s;return(null==(s=e.review)?void 0:s.taskId)===(null==n?void 0:n.id)}))?void 0:s.review)?t:null;return(0,a.jsxs)(i(),{href:n?"/tasks/".concat(n.id):"#",className:"block bg-white rounded-xl border border-gray-200 p-4 hover:shadow-sm hover:border-green-300 transition",children:[(0,a.jsxs)("div",{className:"flex justify-between items-start",children:[(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("p",{className:"font-medium text-gray-900 truncate",children:(null==n?void 0:n.title)||p("chat.task_fallback")}),(0,a.jsx)("p",{className:"text-xs text-gray-400 mt-1",children:new Date(l.createdAt).toLocaleDateString(z)})]}),(0,a.jsxs)("div",{className:"ml-3 text-right shrink-0",children:[(0,a.jsxs)("p",{className:"font-bold text-green-600",children:[(0,x.$g)(l.price),"€"]}),(0,a.jsx)("span",{className:"text-xs px-2 py-0.5 rounded-full mt-1 inline-block ".concat("accepted"===l.status?"bg-green-100 text-green-700":"declined"===l.status?"bg-red-100 text-red-700":"other_accepted"===l.status?"bg-green-100 text-green-600":"bg-gray-100 text-gray-700"),children:p("offer.status.".concat(l.status),l.status)})]})]}),d&&(0,a.jsxs)("div",{className:"mt-3 pt-3 border-t border-gray-100 flex items-center gap-2",children:[(0,a.jsx)("div",{className:"flex gap-0.5",children:[1,2,3,4,5].map(e=>(0,a.jsx)("span",{className:"text-sm ".concat(e<=d.rating?"text-yellow-400":"text-gray-200"),children:"★"},e))}),(0,a.jsxs)("span",{className:"text-sm font-semibold text-gray-700",children:[d.rating,"/5"]}),d.comment&&(0,a.jsx)("span",{className:"text-xs text-gray-500 truncate",children:d.comment})]}),(null==n?void 0:n.status)==="completed"&&"accepted"===l.status&&!d&&(0,a.jsx)("p",{className:"mt-2 text-xs text-gray-400",children:p("dashboard.review_pending")})]})}let A=(null==n||null==(e=n.user)?void 0:e.role)==="specialist";return(0,a.jsxs)("div",{className:"max-w-5xl mx-auto px-4 py-8",children:[(0,a.jsxs)("div",{className:"flex justify-between items-center mb-8",children:[(0,a.jsx)("h1",{className:"text-2xl font-bold text-white",children:p("dashboard.title")}),(0,a.jsx)(i(),{href:"/tasks/new",className:"bg-green-600 text-white px-4 py-2 rounded-lg text-sm font-medium hover:bg-green-700",children:p("dashboard.new_task")})]}),!1===B&&(0,a.jsxs)("div",{className:"mb-6 bg-white rounded-2xl border border-gray-200 overflow-hidden",children:[(0,a.jsxs)("div",{className:"px-5 pt-5 pb-3",children:[(0,a.jsx)("h2",{className:"text-lg font-bold text-gray-900",children:p("dashboard.onboarding.title")}),(0,a.jsx)("p",{className:"text-sm text-gray-500 mt-1",children:p("dashboard.onboarding.subtitle")})]}),(0,a.jsxs)("div",{className:"grid sm:grid-cols-2 gap-3 p-5 pt-2",children:[(0,a.jsxs)(i(),{href:"/specialist-setup",className:"group flex flex-col rounded-xl border-2 border-green-500 bg-green-50 p-4 hover:bg-green-100 transition",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,a.jsx)("span",{className:"text-xl",children:"\uD83D\uDEE0"}),(0,a.jsx)("span",{className:"font-semibold text-gray-800",children:p("dashboard.onboarding.helper.title")})]}),(0,a.jsx)("p",{className:"text-sm text-green-700/80 mb-3 flex-1",children:p("dashboard.onboarding.helper.desc")}),(0,a.jsxs)("span",{className:"inline-flex items-center gap-1 text-sm font-semibold text-green-700",children:[p("dashboard.onboarding.helper.cta")," →"]})]}),(0,a.jsxs)(i(),{href:"/tasks/new",className:"group flex flex-col rounded-xl border border-gray-200 bg-gray-50 p-4 hover:bg-gray-100 transition",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,a.jsx)("span",{className:"text-xl",children:"\uD83D\uDCDD"}),(0,a.jsx)("span",{className:"font-semibold text-gray-800",children:p("dashboard.onboarding.requester.title")})]}),(0,a.jsx)("p",{className:"text-sm text-gray-500 mb-3 flex-1",children:p("dashboard.onboarding.requester.desc")}),(0,a.jsxs)("span",{className:"inline-flex items-center gap-1 text-sm font-semibold text-gray-700",children:[p("dashboard.onboarding.requester.cta")," →"]})]})]})]}),C&&(0,a.jsx)(u,{dashboard:C,t:p}),S&&(A?(S.missedCount>0||S.missedEarnings>0)&&(0,a.jsxs)("div",{className:"mb-6 bg-amber-50 border border-amber-200 rounded-xl px-5 py-4 flex items-start gap-3",children:[(0,a.jsx)("div",{className:"shrink-0 mt-0.5",children:(0,a.jsx)("svg",{className:"w-5 h-5 text-amber-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v2m0 4h.01M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z"})})}),(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsxs)("p",{className:"text-base font-semibold text-amber-800",children:[p("fomo.specialist_missed","You missed {n} tasks").replace("{n}",String(null!=(t=S.missedCount)?t:0)),S.missedEarnings>0&&(0,a.jsxs)("span",{className:"ml-1 text-amber-600",children:["for €",S.missedEarnings]})]}),(null==(s=S.topCategories)?void 0:s.length)>0&&(0,a.jsxs)("p",{className:"text-sm text-amber-600 mt-0.5",children:[p("fomo.top_categories","Categories"),": ",S.topCategories.slice(0,3).join(", ")]})]}),(0,a.jsx)(i(),{href:"/pricing",className:"shrink-0 text-xs font-medium text-amber-700 bg-amber-100 px-3 py-1.5 rounded-lg hover:bg-amber-200 transition",children:p("dashboard.plan.upgrade")})]}):S.totalTasks>0&&(0,a.jsx)("div",{className:"mb-6 bg-green-50 border border-green-200 rounded-xl px-5 py-4",children:(0,a.jsxs)("div",{className:"flex items-center justify-between gap-4 flex-wrap",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("div",{className:"shrink-0 bg-green-100 rounded-xl p-2",children:(0,a.jsx)("svg",{className:"w-5 h-5 text-green-600",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z"})})}),(0,a.jsxs)("div",{children:[(0,a.jsxs)("p",{className:"text-base font-semibold text-gray-800",children:[S.totalOffers," ",p("fomo.offers_received","offers received")]}),S.avgOffersPerTask>0&&(0,a.jsx)("p",{className:"text-sm text-gray-500",children:p("fomo.avg_offers","Average {n}/task").replace("{n}",Number(S.avgOffersPerTask).toFixed(1))})]})]}),void 0!==S.completionRate&&(0,a.jsxs)("div",{className:"text-right",children:[(0,a.jsxs)("p",{className:"text-2xl font-bold text-green-700",children:[Math.round(100*S.completionRate),"%"]}),(0,a.jsx)("p",{className:"text-sm text-gray-400",children:p("fomo.completion_rate","completed")})]})]})})),A&&(0,a.jsxs)(i(),{href:"/tasks",className:"flex items-center justify-between gap-4 bg-green-600 text-white rounded-xl px-5 py-4 mb-8 hover:bg-green-700 transition",children:[(0,a.jsxs)("div",{className:"flex items-center gap-4",children:[(0,a.jsx)("div",{className:"shrink-0 bg-white/20 rounded-xl p-2.5",children:(0,a.jsxs)("svg",{className:"w-6 h-6 text-white",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:[(0,a.jsx)("circle",{cx:"11",cy:"11",r:"7"}),(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 21l-4.35-4.35"})]})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-semibold text-base",children:p("find_tasks.title")}),(0,a.jsx)("p",{className:"text-green-100 text-sm mt-0.5",children:p("find_tasks.banner_hint")})]})]}),(0,a.jsx)("svg",{className:"w-5 h-5 shrink-0 text-white/70",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5l7 7-7 7"})})]}),(0,a.jsxs)("div",{className:"grid md:grid-cols-2 gap-8",children:[(0,a.jsxs)("div",{className:"space-y-8",children:[(0,a.jsxs)("div",{children:[(0,a.jsxs)("h2",{className:"text-lg font-semibold text-white mb-4",children:[p("dashboard.my_tasks")," ",(0,a.jsxs)("span",{className:"text-white/60 font-normal text-base",children:["(",O.length,")"]})]}),0===O.length?(0,a.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 p-6 text-center text-gray-500",children:[(0,a.jsx)("p",{children:p("dashboard.tasks.empty")}),(0,a.jsx)(i(),{href:"/tasks/new",className:"text-green-600 hover:underline text-sm mt-2 inline-block",children:p("dashboard.tasks.empty.cta")})]}):(0,a.jsx)("div",{className:"space-y-3",children:O.map(e=>(0,a.jsx)(U,{task:e},e.id))})]}),P.length>0&&(0,a.jsxs)("div",{children:[(0,a.jsxs)("h2",{className:"text-lg font-semibold text-white/70 mb-4",children:[p("dashboard.completed_tasks")," ",(0,a.jsxs)("span",{className:"font-normal text-base text-white/50",children:["(",P.length,")"]})]}),(0,a.jsx)("div",{className:"space-y-3 opacity-75",children:P.map(e=>(0,a.jsx)(U,{task:e},e.id))})]})]}),(0,a.jsx)("div",{className:"space-y-8",children:A?(0,a.jsxs)(a.Fragment,{children:[k.length>0&&(0,a.jsxs)("div",{children:[(0,a.jsxs)("h2",{className:"text-lg font-semibold text-white mb-4",children:[p("dashboard.invitations")," ",(0,a.jsxs)("span",{className:"text-white/60 font-normal text-base",children:["(",k.length,")"]})]}),(0,a.jsx)("div",{className:"space-y-3",children:k.map(e=>(0,a.jsxs)(i(),{href:e.referenceId?"/tasks/".concat(e.referenceId):"/tasks",className:"flex items-start gap-3 p-4 rounded-xl border transition cursor-pointer ".concat(e.isRead?"bg-white/90 border-white/20 hover:bg-white":"bg-white border-amber-300 shadow-sm hover:bg-amber-50"),children:[(0,a.jsx)("span",{className:"text-2xl",children:"\uD83D\uDCCB"}),(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("p",{className:"font-medium truncate ".concat(e.isRead?"text-gray-600":"text-gray-900"),children:p("notif.type.task_invite",e.title)}),e.body&&(0,a.jsx)("p",{className:"text-sm text-gray-500 mt-0.5 truncate",children:(()=>{let s=function(e){var s;if(!e)return null;let t=e.match(/[«""](.+?)[»""]/);return null!=(s=null==t?void 0:t[1])?s:null}(e.body),t=p("notif.body.task_invite","");return s&&t?t.replace("{title}",s):e.body})()}),(0,a.jsx)("p",{className:"text-xs text-gray-400 mt-1",children:new Date(e.createdAt).toLocaleDateString(z)})]}),(0,a.jsxs)("div",{className:"flex flex-col items-end gap-1.5 shrink-0",children:[!e.isRead&&(0,a.jsx)("span",{className:"w-2 h-2 bg-amber-400 rounded-full mt-2"}),(0,a.jsx)("span",{className:"text-xs text-gray-400",children:"→"})]})]},e.id))})]}),(0,a.jsxs)("div",{children:[(0,a.jsxs)("h2",{className:"text-lg font-semibold text-white mb-4",children:[p("dashboard.my_offers")," ",(0,a.jsxs)("span",{className:"text-white/60 font-normal text-base",children:["(",F.length,")"]})]}),0===F.length?(0,a.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 p-6 text-center text-gray-500",children:[(0,a.jsx)("p",{children:p("dashboard.offers.empty")}),(0,a.jsx)(i(),{href:"/tasks",className:"text-green-600 hover:underline text-sm mt-2 inline-block",children:p("dashboard.offers.empty.cta")})]}):(0,a.jsx)("div",{className:"space-y-3",children:F.map(e=>(0,a.jsx)(W,{row:e},(e.offer||e).id))})]}),H.length>0&&(0,a.jsxs)("div",{children:[(0,a.jsxs)("h2",{className:"text-lg font-semibold text-white/70 mb-4",children:[p("dashboard.completed_offers")," ",(0,a.jsxs)("span",{className:"font-normal text-base text-white/50",children:["(",H.length,")"]})]}),(0,a.jsx)("div",{className:"space-y-3 opacity-75",children:H.map(e=>(0,a.jsx)(W,{row:e},(e.offer||e).id))})]})]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(i(),{href:"/specialists",className:"flex items-center justify-between gap-4 bg-green-600 text-white rounded-xl px-5 py-4 hover:bg-green-700 transition",children:[(0,a.jsxs)("div",{className:"flex items-center gap-4",children:[(0,a.jsx)("div",{className:"shrink-0 bg-white/20 rounded-xl p-2.5",children:(0,a.jsx)("svg",{className:"w-6 h-6 text-white",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0z"})})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-semibold text-base",children:p("dashboard.customer.specialists_title")}),(0,a.jsx)("p",{className:"text-green-100 text-sm mt-0.5",children:p("dashboard.customer.specialists_hint")})]})]}),(0,a.jsx)("svg",{className:"w-5 h-5 shrink-0 text-white/70",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5l7 7-7 7"})})]}),(0,a.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 p-5",children:[(0,a.jsx)("h2",{className:"text-base font-semibold text-gray-800 mb-4",children:p("dashboard.customer.how_title")}),(0,a.jsx)("div",{className:"space-y-3",children:[{num:"1",text:p("dashboard.customer.step1"),icon:"M12 4v16m8-8H4"},{num:"2",text:p("dashboard.customer.step2"),icon:"M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"},{num:"3",text:p("dashboard.customer.step3"),icon:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"}].map(e=>{let{num:s,text:t,icon:r}=e;return(0,a.jsxs)("div",{className:"flex items-start gap-3",children:[(0,a.jsx)("span",{className:"shrink-0 w-7 h-7 rounded-full bg-green-100 text-green-600 text-sm font-bold flex items-center justify-center",children:s}),(0,a.jsx)("p",{className:"text-sm text-gray-600 pt-1",children:t})]},s)})}),(0,a.jsxs)(i(),{href:"/tasks/new",className:"mt-4 inline-block text-sm font-medium text-green-600 hover:underline",children:[f.length>0?p("dashboard.tasks.add_new"):p("dashboard.tasks.empty.cta")," →"]})]})]})})]})]})}},1592:(e,s,t)=>{"use strict";t.d(s,{CI:()=>l,Hh:()=>n,Jv:()=>r,wV:()=>i,yK:()=>a});let a=(0,t(6504).M)({baseURL:"https://api.canhelp.gr"}),{signIn:r,signOut:l,signUp:n,useSession:i}=a},2035:(e,s,t)=>{"use strict";t.d(s,{d:()=>l});var a=t(4568);let r={free:{label:"Free",class:"bg-gray-100 text-gray-500 border border-gray-200",icon:""},pro:{label:"Pro",class:"bg-green-100 text-green-700 border border-green-200",icon:(0,a.jsx)("svg",{viewBox:"0 0 16 16",fill:"none",className:"w-3 h-3 inline-block mr-0.5 -mt-px",children:(0,a.jsx)("path",{d:"M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z",fill:"currentColor"})})},ultimate:{label:"Ultimate",class:"bg-gradient-to-r from-amber-400 via-yellow-400 to-amber-400 text-gray-900 border border-amber-500 shadow-sm shadow-amber-300/50",icon:(0,a.jsx)("svg",{viewBox:"0 0 16 16",fill:"none",className:"w-3 h-3 inline-block mr-0.5 -mt-px",children:(0,a.jsx)("path",{d:"M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z",fill:"currentColor"})})}};function l(e){let{tier:s,verified:t,size:l="sm",className:d=""}=e;if("free"===s&&!t)return null;let c="sm"===l?"text-[10px] px-1.5 py-0.5":"text-xs px-2 py-0.5";if(t&&"free"!==s)return(0,a.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-full font-semibold ".concat(c," ").concat(r[s].class," ").concat(d),children:["ultimate"===s?(0,a.jsx)(n,{className:"w-3 h-3 fill-gray-900"}):(0,a.jsx)(i,{className:"w-3 h-3"}),r[s].label]});if(t)return(0,a.jsx)("span",{className:"inline-flex items-center gap-0.5 rounded-full font-semibold ".concat(c," bg-green-100 text-green-700 border border-green-200 ").concat(d),children:(0,a.jsx)(i,{className:"w-3 h-3"})});let o=r[s];return(0,a.jsxs)("span",{className:"inline-flex items-center rounded-full font-semibold ".concat(c," ").concat(o.class," ").concat(d),children:["pro"===s&&(0,a.jsx)(n,{className:"w-3 h-3 mr-0.5 -mt-px"}),"ultimate"===s&&(0,a.jsx)(n,{className:"w-3 h-3 mr-0.5 -mt-px fill-gray-900"}),o.label]})}function n(e){let{className:s=""}=e;return(0,a.jsx)("svg",{viewBox:"0 0 16 16",fill:"none",className:s,children:(0,a.jsx)("path",{d:"M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z",fill:"currentColor"})})}function i(e){let{className:s=""}=e;return(0,a.jsxs)("svg",{viewBox:"0 0 16 16",fill:"none",className:s,children:[(0,a.jsx)("path",{d:"M8 1l2 1.4 2.4-.4 1 2.2 2 1.2-.4 2.4L16 10l-1.8 1.6.4 2.4-2.2.8L10.8 17 8 16.2 5.2 17l-1.2-2.2-2.2-.8.4-2.4L0 10l1-2.2-.4-2.4 2-1.2 1-2.2 2.4.4L8 1z",fill:"#3B82F6"}),(0,a.jsx)("path",{d:"M5.5 8.5l1.5 1.5 3-3",stroke:"white",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})}},4017:(e,s,t)=>{"use strict";function a(e,s){return"el"===s&&e.titleEl?e.titleEl:"en"===s&&e.titleEn?e.titleEn:"ru"===s&&e.titleRu?e.titleRu:e.title}function r(e){return null==e||""===e?"":Math.round(Number(e)).toString()}function l(e,s){return"el"===s&&e.descriptionEl?e.descriptionEl:"en"===s&&e.descriptionEn?e.descriptionEn:"ru"===s&&e.descriptionRu?e.descriptionRu:e.description}t.d(s,{$g:()=>r,GZ:()=>l,Oj:()=>a})},4658:(e,s,t)=>{Promise.resolve().then(t.bind(t,252))}},e=>{e.O(0,[1516,9664,9906,2982,587,18,7358],()=>e(e.s=4658)),_N_E=e.O()}]); oþÿÿ 1"(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6173],{1592:(e,t,r)=>{"use strict";r.d(t,{CI:()=>i,Hh:()=>o,Jv:()=>s,wV:()=>a,yK:()=>n});let n=(0,r(6504).M)({baseURL:"https://api.canhelp.gr"}),{signIn:s,signOut:i,signUp:o,useSession:a}=n},3854:(e,t,r)=>{Promise.resolve().then(r.bind(r,8666))},8666:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>x});var n=r(4568),s=r(7620),i=r(7541),o=r(1592),a=r(9906),l=r(2982);function c(e){let{type:t}=e,r="w-5 h-5";switch(t){case"new_offer":return(0,n.jsxs)("svg",{className:r,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",children:[(0,n.jsx)("rect",{x:"2",y:"7",width:"20",height:"14",rx:"2"}),(0,n.jsx)("path",{d:"M16 21V5a2 2 0 00-2-2h-4a2 2 0 00-2 2v16"})]});case"offer_accepted":return(0,n.jsxs)("svg",{className:r,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",children:[(0,n.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,n.jsx)("polyline",{points:"9 12 11 14 15 10"})]});case"offer_declined":return(0,n.jsxs)("svg",{className:r,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",children:[(0,n.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,n.jsx)("line",{x1:"15",y1:"9",x2:"9",y2:"15"}),(0,n.jsx)("line",{x1:"9",y1:"9",x2:"15",y2:"15"})]});case"task_completed":return(0,n.jsx)("svg",{className:r,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",children:(0,n.jsx)("polyline",{points:"20 6 9 17 4 12"})});case"task_cancelled":return(0,n.jsxs)("svg",{className:r,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",children:[(0,n.jsx)("path",{d:"M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z"}),(0,n.jsx)("line",{x1:"12",y1:"9",x2:"12",y2:"13"}),(0,n.jsx)("line",{x1:"12",y1:"17",x2:"12.01",y2:"17"})]});case"new_message":return(0,n.jsx)("svg",{className:r,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",children:(0,n.jsx)("path",{d:"M21 15a2 2 0 01-2 2H7l-4 4V5a2 2 0 012-2h14a2 2 0 012 2z"})});case"new_review":return(0,n.jsx)("svg",{className:r,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",children:(0,n.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"})});case"task_invite":return(0,n.jsxs)("svg",{className:r,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",children:[(0,n.jsx)("path",{d:"M16 4h2a2 2 0 012 2v14a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2h2"}),(0,n.jsx)("rect",{x:"8",y:"2",width:"8",height:"4",rx:"1",ry:"1"})]});default:return(0,n.jsxs)("svg",{className:r,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",children:[(0,n.jsx)("path",{d:"M18 8A6 6 0 006 8c0 7-3 9-3 9h18s-3-2-3-9"}),(0,n.jsx)("path",{d:"M13.73 21a2 2 0 01-3.46 0"})]})}}let d={new_offer:"bg-green-100 text-green-600",offer_accepted:"bg-green-100 text-green-600",offer_declined:"bg-red-100 text-red-600",task_completed:"bg-emerald-100 text-emerald-600",task_cancelled:"bg-amber-100 text-amber-600",new_message:"bg-purple-100 text-purple-600",new_review:"bg-yellow-100 text-yellow-600",task_invite:"bg-indigo-100 text-indigo-600",referral_reward:"bg-cyan-100 text-cyan-700",specialist_card_submitted:"bg-amber-100 text-amber-700",specialist_card_approved:"bg-green-100 text-green-700",specialist_card_rejected:"bg-rose-100 text-rose-700"};function u(e){var t;if(!e)return null;let r=e.match(/[«""](.+?)[»""]/);return null!=(t=null==r?void 0:r[1])?t:null}function x(){let{data:e,isPending:t}=(0,o.wV)(),r=(0,i.useRouter)(),{t:x,locale:f}=(0,a.Y)(),[h,p]=(0,s.useState)([]),[m,y]=(0,s.useState)(!0);async function g(){await (0,l.NL)(),p(e=>e.map(e=>({...e,isRead:!0})))}async function k(e){await (0,l.Ip)(e),p(t=>t.map(t=>t.id===e?{...t,isRead:!0}:t))}async function w(e,t){e.stopPropagation(),await (0,l.yk)(t).catch(()=>{}),p(e=>e.filter(e=>e.id!==t))}if((0,s.useEffect)(()=>{t||e||r.push("/login")},[e,t]),(0,s.useEffect)(()=>{e&&(0,l.Tr)().then(p).catch(()=>{}).finally(()=>y(!1))},[e]),t||m)return(0,n.jsx)("div",{className:"text-center py-20 text-white",children:x("common.loading")});let j=h.filter(e=>!e.isRead).length,v="ru"===f?"ru-RU":"uk"===f?"uk-UA":"en"===f?"en-US":"el-GR";return(0,n.jsxs)("div",{className:"max-w-2xl mx-auto px-4 py-8",children:[(0,n.jsxs)("div",{className:"flex justify-between items-center mb-6",children:[(0,n.jsxs)("h1",{className:"text-2xl font-bold text-white",children:[x("notif.title")," ",j>0&&(0,n.jsxs)("span",{className:"text-white/70 font-normal text-xl",children:["(",j,")"]})]}),j>0&&(0,n.jsx)("button",{onClick:g,className:"text-sm text-white/80 hover:text-white hover:underline transition",children:x("notif.mark_all")})]}),0===h.length?(0,n.jsx)("div",{className:"text-center py-20 text-white/60",children:x("notif.empty")}):(0,n.jsx)("div",{className:"space-y-2",children:h.map(e=>{var t;let s="referral_reward"===e.type?"/profile?tab=referral":e.referenceId?"new_message"===e.type?"/chat?room=".concat(e.referenceId):"/tasks/".concat(e.referenceId):null,i=async()=>{e.isRead||await k(e.id),s&&r.push(s)};return(0,n.jsxs)("div",{onClick:i,className:"flex items-start gap-3 p-4 rounded-xl border transition ".concat(s?"cursor-pointer":"cursor-default"," ").concat(e.isRead?"bg-white/90 border-white/20 hover:bg-white":"bg-white border-green-300 shadow-sm hover:bg-green-50"),children:[(0,n.jsx)("div",{className:"p-2.5 rounded-xl flex-shrink-0 ".concat(null!=(t=d[e.type])?t:"bg-gray-100 text-gray-500"),children:(0,n.jsx)(c,{type:e.type})}),(0,n.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,n.jsx)("p",{className:"font-medium ".concat(e.isRead?"text-gray-600":"text-gray-900"),children:x("notif.type.".concat(e.type),x("notif.type.generic","Notification"))}),e.body&&(0,n.jsx)("p",{className:"text-sm text-gray-500 mt-0.5 truncate",children:(()=>{if("new_message"===e.type)return e.body;if("new_review"===e.type){let t=function(e){var t;if(!e)return null;let r=e.match(/(\d+)\s*[★\*]/);return null!=(t=null==r?void 0:r[1])?t:null}(e.body),r=x("notif.body.new_review","");return t&&r?r.replace("{rating}",t):e.body}if("referral_reward"===e.type){let t=function(e){var t;if(!e)return null;let r=e.match(/(\d+)/);return null!=(t=null==r?void 0:r[1])?t:null}(e.body),r=u(e.body),n=x("notif.body.referral_reward","");return n&&t&&r?n.replace("{days}",t).replace("{plan}",r):n||e.body}let t=u(e.body),r=x("notif.body.".concat(e.type),"");return r&&t?r.replace("{title}",t):r||e.body})()}),(0,n.jsx)("p",{className:"text-xs text-gray-400 mt-1",children:function(e){let t=Math.floor((Date.now()-new Date(e).getTime())/1e3),r=Math.floor(t/60),n=Math.floor(r/60),s=Math.floor(n/24);if("ru"===f){if(t<60)return"тПлькП чтП";if(r<60)return"".concat(r," ЌОМ. МазаЎ");if(n<24)return"".concat(n," ч. МазаЎ");if(1===s)return"вчера";if(s<7)return"".concat(s," ЎМ. МазаЎ")}else if("uk"===f){if(t<60)return"щПйМП";if(r<60)return"".concat(r," хв. тПЌу");if(n<24)return"".concat(n," гПЎ. тПЌу");if(1===s)return"вчПра";if(s<7)return"".concat(s," ЎМ. тПЌу")}else if("en"===f){if(t<60)return"just now";if(r<60)return"".concat(r,"m ago");if(n<24)return"".concat(n,"h ago");if(1===s)return"yesterday";if(s<7)return"".concat(s,"d ago")}else{if(t<60)return"Όόλις τώρα";if(r<60)return"".concat(r," λ. πριΜ");if(n<24)return"".concat(n," ω. πριΜ");if(1===s)return"χΞες";if(s<7)return"".concat(s," ÎŒ. πριΜ")}return new Date(e).toLocaleDateString(v,{day:"numeric",month:"short",year:s>365?"numeric":void 0})}(e.createdAt)})]}),(0,n.jsxs)("div",{className:"flex flex-col items-end gap-2 shrink-0",onClick:e=>e.stopPropagation(),children:[(0,n.jsx)("button",{onClick:t=>w(t,e.id),className:"p-1 rounded-md text-gray-300 hover:text-red-400 hover:bg-red-50 transition",title:x("common.delete","Delete"),children:(0,n.jsxs)("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",children:[(0,n.jsx)("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),(0,n.jsx)("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}),(0,n.jsx)("div",{className:"flex items-center gap-1.5",children:!e.isRead&&(0,n.jsx)("span",{className:"w-2 h-2 bg-green-500 rounded-full"})})]})]},e.id)})})]})}}},e=>{e.O(0,[1516,9906,2982,587,18,7358],()=>e(e.s=3854)),_N_E=e.O()}]); lþÿÿ ‹6(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6907],{160:(e,t,r)=>{Promise.resolve().then(r.bind(r,8880))},1592:(e,t,r)=>{"use strict";r.d(t,{CI:()=>l,Hh:()=>s,Jv:()=>n,wV:()=>i,yK:()=>a});let a=(0,r(6504).M)({baseURL:"https://api.canhelp.gr"}),{signIn:n,signOut:l,signUp:s,useSession:i}=a},2035:(e,t,r)=>{"use strict";r.d(t,{d:()=>l});var a=r(4568);let n={free:{label:"Free",class:"bg-gray-100 text-gray-500 border border-gray-200",icon:""},pro:{label:"Pro",class:"bg-green-100 text-green-700 border border-green-200",icon:(0,a.jsx)("svg",{viewBox:"0 0 16 16",fill:"none",className:"w-3 h-3 inline-block mr-0.5 -mt-px",children:(0,a.jsx)("path",{d:"M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z",fill:"currentColor"})})},ultimate:{label:"Ultimate",class:"bg-gradient-to-r from-amber-400 via-yellow-400 to-amber-400 text-gray-900 border border-amber-500 shadow-sm shadow-amber-300/50",icon:(0,a.jsx)("svg",{viewBox:"0 0 16 16",fill:"none",className:"w-3 h-3 inline-block mr-0.5 -mt-px",children:(0,a.jsx)("path",{d:"M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z",fill:"currentColor"})})}};function l(e){let{tier:t,verified:r,size:l="sm",className:c=""}=e;if("free"===t&&!r)return null;let o="sm"===l?"text-[10px] px-1.5 py-0.5":"text-xs px-2 py-0.5";if(r&&"free"!==t)return(0,a.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-full font-semibold ".concat(o," ").concat(n[t].class," ").concat(c),children:["ultimate"===t?(0,a.jsx)(s,{className:"w-3 h-3 fill-gray-900"}):(0,a.jsx)(i,{className:"w-3 h-3"}),n[t].label]});if(r)return(0,a.jsx)("span",{className:"inline-flex items-center gap-0.5 rounded-full font-semibold ".concat(o," bg-green-100 text-green-700 border border-green-200 ").concat(c),children:(0,a.jsx)(i,{className:"w-3 h-3"})});let d=n[t];return(0,a.jsxs)("span",{className:"inline-flex items-center rounded-full font-semibold ".concat(o," ").concat(d.class," ").concat(c),children:["pro"===t&&(0,a.jsx)(s,{className:"w-3 h-3 mr-0.5 -mt-px"}),"ultimate"===t&&(0,a.jsx)(s,{className:"w-3 h-3 mr-0.5 -mt-px fill-gray-900"}),d.label]})}function s(e){let{className:t=""}=e;return(0,a.jsx)("svg",{viewBox:"0 0 16 16",fill:"none",className:t,children:(0,a.jsx)("path",{d:"M8 1l1.8 3.6L14 5.5l-3 2.9.7 4.1L8 10.5l-3.7 1.9.7-4.1-3-2.9 4.2-.9L8 1z",fill:"currentColor"})})}function i(e){let{className:t=""}=e;return(0,a.jsxs)("svg",{viewBox:"0 0 16 16",fill:"none",className:t,children:[(0,a.jsx)("path",{d:"M8 1l2 1.4 2.4-.4 1 2.2 2 1.2-.4 2.4L16 10l-1.8 1.6.4 2.4-2.2.8L10.8 17 8 16.2 5.2 17l-1.2-2.2-2.2-.8.4-2.4L0 10l1-2.2-.4-2.4 2-1.2 1-2.2 2.4.4L8 1z",fill:"#3B82F6"}),(0,a.jsx)("path",{d:"M5.5 8.5l1.5 1.5 3-3",stroke:"white",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})}},8880:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>b});var a=r(4568),n=r(7620),l=r(9664),s=r.n(l),i=r(7541),c=r(1592),o=r(9906),d=r(2982),x=r(2035);let m=[{key:"maxMessagesPerDay",labelKey:"pricing.feat.messages",format:e=>null===e?"∞":String(e)},{key:"maxOrdersPerDay",labelKey:"pricing.feat.orders",format:e=>null===e?"∞":String(e)},{key:"canContactAll",labelKey:"pricing.feat.contact_all"},{key:"canViewPhone",labelKey:"pricing.feat.view_phone"},{key:"canShowContactInfo",labelKey:"pricing.feat.show_contact"},{key:"hasFavorites",labelKey:"pricing.feat.favorites"},{key:"hasVerifiedBadge",labelKey:"pricing.feat.verified_badge"},{key:"hasGoogleCalendar",labelKey:"pricing.feat.google_calendar"},{key:"hasPersonalSite",labelKey:"pricing.feat.personal_site"},{key:"hasAutoResponse",labelKey:"pricing.feat.auto_response"},{key:"hasAutoMatch",labelKey:"pricing.feat.auto_match"},{key:"highlightedReviews",labelKey:"pricing.feat.highlighted_reviews"},{key:"maxCards",labelKey:"pricing.feat.cards",format:e=>null===e?"∞":String(e)},{key:"notifyNewTasks",labelKey:"pricing.feat.notify_tasks"},{key:"canUploadVideo",labelKey:"pricing.feat.video"}];function g(){return(0,a.jsx)("svg",{viewBox:"0 0 20 20",fill:"currentColor",className:"w-5 h-5 text-green-500 mx-auto",children:(0,a.jsx)("path",{fillRule:"evenodd",d:"M16.704 4.153a.75.75 0 01.143 1.052l-8 10.5a.75.75 0 01-1.127.075l-4.5-4.5a.75.75 0 011.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 011.05-.143z",clipRule:"evenodd"})})}function p(){return(0,a.jsx)("svg",{viewBox:"0 0 20 20",fill:"currentColor",className:"w-4 h-4 text-gray-300 mx-auto",children:(0,a.jsx)("path",{d:"M6.28 5.22a.75.75 0 00-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 101.06 1.06L10 11.06l3.72 3.72a.75.75 0 101.06-1.06L11.06 10l3.72-3.72a.75.75 0 00-1.06-1.06L10 8.94 6.28 5.22z"})})}let h=["free","pro","ultimate"],u={free:"text-gray-700",pro:"text-green-700",ultimate:"text-amber-600"},f={free:"bg-gray-100 text-gray-700 hover:bg-gray-200",pro:"bg-green-600 text-white hover:bg-green-700",ultimate:"bg-gradient-to-r from-amber-500 to-yellow-500 text-white hover:from-amber-600 hover:to-yellow-600"};function b(){let{data:e}=(0,c.wV)(),{t}=(0,o.Y)(),r=(0,i.useRouter)(),[l,b]=(0,n.useState)([]),[y,j]=(0,n.useState)(null),[w,N]=(0,n.useState)(!0),[v,k]=(0,n.useState)(null),[L,_]=(0,n.useState)(null),[C,P]=(0,n.useState)(!1),[K,S]=(0,n.useState)(!1);(0,n.useEffect)(()=>{let e=!1;return N(!0),(0,d.T9)().then(t=>{e||b(t.sort((e,t)=>h.indexOf(e.tier)-h.indexOf(t.tier)))}).catch(()=>{}).finally(()=>{e||N(!1)}),()=>{e=!0}},[]);let F=()=>{e&&(0,d.H)().then(e=>{var t,r;return j(null!=(r=null==(t=e.plan)?void 0:t.id)?r:null)}).catch(()=>{})};async function B(t){if(!e)return void r.push("/sign-in");k(t),_(null),P(!0);try{let e=await (0,d.Cs)(t.id);_(e)}catch(e){k(null)}finally{P(!1)}}async function E(){if(v&&L){S(!0);try{let e=await (0,d.Je)(v.id,L.canPayFromBalance);if(e.url&&e.params){let t=document.createElement("form");t.method="POST",t.action=e.url,Object.entries(e.params).forEach(e=>{let[r,a]=e,n=document.createElement("input");n.type="hidden",n.name=r,n.value=a,t.appendChild(n)}),document.body.appendChild(t),t.submit();return}j(v.id),k(null),_(null)}catch(e){}finally{S(!1)}}}return(0,n.useEffect)(F,[e]),(0,n.useEffect)(()=>{let e=()=>F();return window.addEventListener("canhelp:plan-changed",e),document.addEventListener("visibilitychange",e),()=>{window.removeEventListener("canhelp:plan-changed",e),document.removeEventListener("visibilitychange",e)}},[e]),(0,a.jsxs)("main",{className:"min-h-screen py-12 px-4",children:[(0,a.jsxs)("div",{className:"max-w-5xl mx-auto",children:[(0,a.jsxs)("div",{className:"text-center mb-10",children:[(0,a.jsx)("h1",{className:"text-4xl font-bold text-white mb-3",children:t("pricing.title","Pricing")}),(0,a.jsx)("p",{className:"text-white/70 text-lg",children:t("pricing.subtitle")})]}),w?(0,a.jsx)("div",{className:"text-center text-white/60 py-20",children:t("common.loading","Loading...")}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6 mb-12",children:l.map(e=>{let r=e.id===y,n="free"===e.tier;return(0,a.jsxs)("div",{className:"rounded-2xl border-2 p-6 bg-white flex flex-col transition ".concat(r?"ring-2 ring-green-500 ring-offset-2":""," ").concat("ultimate"===e.tier?"border-amber-300 shadow-lg shadow-amber-100":"border-gray-200"),children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 mb-4",children:[(0,a.jsx)(x.d,{tier:e.tier,size:"md"}),r&&(0,a.jsx)("span",{className:"text-xs font-medium text-green-600 bg-green-50 border border-green-200 px-2 py-0.5 rounded-full",children:t("pricing.current_plan","Your plan")}),"pro"===e.tier&&!r&&(0,a.jsx)("span",{className:"text-xs font-medium text-green-600 bg-green-50 border border-green-100 px-2 py-0.5 rounded-full",children:t("pricing.popular","Popular")})]}),(0,a.jsx)("h2",{className:"text-xl font-bold text-gray-900 mb-1",children:e.name}),(0,a.jsx)("p",{className:"text-gray-500 text-sm mb-4 min-h-[40px]",children:e.description}),(0,a.jsxs)("div",{className:"text-3xl font-extrabold mb-1 ".concat(u[e.tier]),children:[n?t("pricing.free","Free"):(0,a.jsxs)(a.Fragment,{children:[e.oldPrice&&(0,a.jsxs)("span",{className:"text-lg font-normal text-gray-400 line-through mr-2",children:["€",e.oldPrice]}),"€",e.price]}),!n&&(0,a.jsxs)("span",{className:"text-base font-normal text-gray-400",children:["/",t("pricing.per_month","month")]})]}),e.durationDays&&!n&&(0,a.jsxs)("p",{className:"text-xs text-gray-400 mb-5",children:[t("pricing.duration","Duration"),": ",e.durationDays," ",t("pricing.days","days")]}),n&&(0,a.jsx)("div",{className:"mb-5"}),(0,a.jsx)("div",{className:"mt-auto",children:r?(0,a.jsx)("div",{className:"w-full py-2.5 text-center text-sm font-semibold text-green-700 bg-green-50 border border-green-200 rounded-xl",children:t("pricing.your_plan","Current plan")}):n?(0,a.jsx)("div",{className:"w-full py-2.5 text-center text-sm font-medium text-gray-400 bg-gray-50 border border-gray-200 rounded-xl",children:t("pricing.free_default","Default")}):(0,a.jsxs)("button",{onClick:()=>B(e),className:"block w-full py-2.5 text-center text-sm font-semibold rounded-xl transition ".concat(f[e.tier]),children:[t("pricing.choose","Choose")," ",e.name]})})]},e.id)})}),(0,a.jsxs)("div",{className:"bg-white rounded-2xl border border-gray-200 overflow-hidden",children:[(0,a.jsx)("div",{className:"px-6 py-4 border-b border-gray-100",children:(0,a.jsx)("h3",{className:"font-semibold text-gray-900",children:t("pricing.compare","Feature comparison")})}),(0,a.jsx)("div",{className:"overflow-x-auto",children:(0,a.jsxs)("table",{className:"w-full text-sm",children:[(0,a.jsx)("thead",{children:(0,a.jsxs)("tr",{className:"border-b border-gray-100",children:[(0,a.jsx)("th",{className:"text-left px-6 py-3 text-gray-500 font-medium w-1/2",children:t("pricing.feature","Feature")}),l.map(e=>(0,a.jsx)("th",{className:"text-center px-4 py-3 font-medium text-gray-700",children:(0,a.jsxs)("div",{className:"flex flex-col items-center gap-1",children:[(0,a.jsx)(x.d,{tier:e.tier,size:"sm"}),(0,a.jsx)("span",{className:"text-xs text-gray-400",children:"free"===e.tier?t("pricing.free","Free"):"€".concat(e.price)})]})},e.id))]})}),(0,a.jsx)("tbody",{children:m.map(e=>{let{key:r,labelKey:n,format:s}=e;return(0,a.jsxs)("tr",{className:"border-b border-gray-50 hover:bg-gray-50/50 transition",children:[(0,a.jsx)("td",{className:"px-6 py-3 text-gray-600",children:t(n,n)}),l.map(e=>{let t,n=e[r];return t=s?(0,a.jsx)("span",{className:"text-gray-700 font-medium",children:s(n)}):"boolean"==typeof n?n?(0,a.jsx)(g,{}):(0,a.jsx)(p,{}):(0,a.jsx)("span",{className:"text-gray-700",children:null===n?"∞":String(null!=n?n:"—")}),(0,a.jsx)("td",{className:"text-center px-4 py-3",children:t},e.id)})]},r)})})]})})]}),(0,a.jsx)("p",{className:"text-center text-white/50 text-sm mt-8",children:t("pricing.faq_note","Payment is deducted from your CanHelp balance. Top up is available in Payments.")})]})]}),v&&(0,a.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 px-4",children:(0,a.jsxs)("div",{className:"bg-white rounded-2xl shadow-2xl w-full max-w-md p-6",children:[(0,a.jsx)("h2",{className:"text-lg font-bold text-gray-900 mb-4",children:t("pricing.confirm.title","Confirm plan selection")}),C?(0,a.jsx)("div",{className:"py-10 text-center text-gray-400",children:t("common.loading","Loading...")}):L?(0,a.jsxs)("div",{className:"space-y-3 text-sm text-gray-700",children:[(0,a.jsxs)("div",{className:"flex justify-between",children:[(0,a.jsx)("span",{className:"text-gray-500",children:t("pricing.confirm.plan","Plan")}),(0,a.jsx)("span",{className:"font-semibold",children:v.name})]}),"upgrade"===L.type&&Number(L.prorated)>0&&(0,a.jsxs)("div",{className:"flex justify-between",children:[(0,a.jsx)("span",{className:"text-gray-500",children:t("pricing.confirm.prorated","Prorated credit")}),(0,a.jsxs)("span",{className:"text-green-600 font-medium",children:["−€",L.prorated]})]}),"downgrade"!==L.type&&(0,a.jsxs)("div",{className:"flex justify-between",children:[(0,a.jsx)("span",{className:"text-gray-500",children:t("pricing.confirm.effective_price","To pay")}),(0,a.jsxs)("span",{className:"font-bold text-gray-900",children:["€",L.effectivePrice]})]}),"downgrade"!==L.type&&(0,a.jsxs)("div",{className:"flex justify-between",children:[(0,a.jsx)("span",{className:"text-gray-500",children:t("pricing.confirm.your_balance","Your balance")}),(0,a.jsxs)("span",{className:L.canPayFromBalance?"text-green-600":"text-red-500",children:["€",L.currentBalance]})]}),"downgrade"===L.type&&(0,a.jsxs)("div",{className:"bg-orange-50 border border-orange-200 rounded-xl p-3 text-orange-800 text-xs",children:[t("pricing.confirm.downgrade_info","The switch to the new plan will happen automatically after the current period ends."),L.scheduledDate&&(0,a.jsxs)(a.Fragment,{children:[" ",new Date(L.scheduledDate).toLocaleDateString("ru-RU")]})]}),"downgrade"!==L.type&&!L.canPayFromBalance&&(0,a.jsxs)("div",{className:"bg-red-50 border border-red-200 rounded-xl p-3 text-red-700 text-xs",children:[t("pricing.confirm.insufficient","Insufficient balance.")," ",(0,a.jsx)(s(),{href:"/payment",className:"underline font-medium",onClick:()=>k(null),children:t("pricing.confirm.top_up","Top up")})]}),(0,a.jsxs)("div",{className:"flex gap-3 pt-2",children:[(0,a.jsx)("button",{onClick:()=>{k(null),_(null)},className:"flex-1 py-2.5 rounded-xl border border-gray-200 text-sm font-medium text-gray-600 hover:bg-gray-50 transition",children:t("common.cancel","Cancel")}),("downgrade"===L.type||L.canPayFromBalance)&&(0,a.jsx)("button",{onClick:E,disabled:K,className:"flex-1 py-2.5 rounded-xl text-sm font-semibold text-white transition ".concat("downgrade"===L.type?"bg-orange-500 hover:bg-orange-600":f[v.tier].replace("block w-full","").trim()," disabled:opacity-50"),children:K?t("common.loading","Loading..."):"downgrade"===L.type?t("pricing.confirm.schedule_downgrade","Schedule switch"):t("pricing.confirm.pay","Pay")})]})]}):null]})})]})}}},e=>{e.O(0,[1516,9664,9906,2982,587,18,7358],()=>e(e.s=160)),_N_E=e.O()}]); iþÿÿ £0(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3698],{1258:(e,t,a)=>{"use strict";function s(e){if(!(null==e?void 0:e.trim()))return"—";let t=e.trim().split(/\s+/);return t.length<2||!t[1]?t[0]:"".concat(t[0]," ").concat(t[1][0].toUpperCase(),".")}function l(e,t,a){if(null==e?void 0:e.trim()){let a=null==t?void 0:t.trim();return a?"".concat(e.trim()," ").concat(a[0].toUpperCase(),"."):e.trim()}return s(a)}a.d(t,{E:()=>s,H:()=>l})},1592:(e,t,a)=>{"use strict";a.d(t,{CI:()=>n,Hh:()=>r,Jv:()=>l,wV:()=>i,yK:()=>s});let s=(0,a(6504).M)({baseURL:"https://api.canhelp.gr"}),{signIn:l,signOut:n,signUp:r,useSession:i}=s},4017:(e,t,a)=>{"use strict";function s(e,t){return"el"===t&&e.titleEl?e.titleEl:"en"===t&&e.titleEn?e.titleEn:"ru"===t&&e.titleRu?e.titleRu:e.title}function l(e){return null==e||""===e?"":Math.round(Number(e)).toString()}function n(e,t){return"el"===t&&e.descriptionEl?e.descriptionEl:"en"===t&&e.descriptionEn?e.descriptionEn:"ru"===t&&e.descriptionRu?e.descriptionRu:e.description}a.d(t,{$g:()=>l,GZ:()=>n,Oj:()=>s})},5940:(e,t,a)=>{"use strict";a.d(t,{Ez:()=>r,V:()=>n});var s=a(4568),l=a(7620);function n(e){if(!e)return!1;let t=e.trim();return t.startsWith("http://")||t.startsWith("https://")||t.startsWith("/")}function r(e){let{icon:t,alt:a="",className:r,fallback:i="\uD83D\uDCE6"}=e,o=(t||"").trim(),[d,c]=(0,l.useState)(!1);(0,l.useEffect)(()=>{c(!1)},[o]);let m=(0,l.useMemo)(()=>n(o)?o.startsWith("/api/")?"".concat("https://api.canhelp.gr").concat(o):o:"",[o]),x="/category-icons/package.svg";return n(o)?d&&o!==x?(0,s.jsx)("img",{src:x,alt:a,className:r,loading:"lazy",onError:()=>c(!0)}):d&&o===x?(0,s.jsx)("span",{className:r,children:i}):(0,s.jsx)("img",{src:m,alt:a,className:r,loading:"lazy",onError:()=>c(!0)}):(0,s.jsx)("span",{className:r,children:o||i})}},6961:(e,t,a)=>{"use strict";a.r(t),a.d(t,{default:()=>N});var s=a(4568),l=a(7620),n=a(7541),r=a(9664),i=a.n(r),o=a(1592),d=a(9906),c=a(2982),m=a(1258),x=a(4017),u=a(5940);let g={registration_success:["userName","link","siteName","siteUrl"],email_verification:["userName","link","siteName","siteUrl"],password_reset:["userName","link","siteName","siteUrl"],new_offer:["userName","taskTitle","taskId","specialistName","price","link"],new_task:["userName","taskTitle","taskId","customerName","link"],offer_accepted:["userName","taskTitle","price","link"],new_message:["userName","senderName","preview","link"],offer_declined:["userName","taskTitle","taskId","link"],offer_other_accepted:["userName","taskTitle","taskId","link"],task_updated:["userName","taskTitle","taskId","link"],deadline_reminder:["userName","taskTitle","taskId","link"],task_archived:["userName","taskTitle","taskId","link"],referral_reward:["userName","days","planName","link"],plan_activated:["userName","planName","price","expiresAt","link"],plan_upgraded:["userName","oldPlanName","newPlanName","charged","expiresAt","link"],plan_downgrade_scheduled:["userName","currentPlanName","newPlanName","scheduledDate","link"],plan_downgrade_applied:["userName","planName","link"],plan_renewal_reminder:["userName","planName","amount","expiresAt","link"],plan_insufficient_funds:["userName","currentPlanName","requiredAmount","currentBalance","expiresAt","topUpLink"]},p=Array.from(new Set(Object.values(g).flat())),h=[{value:"/category-icons/repairs.svg",label:"Repairs & Construction"},{value:"/category-icons/repairs-alt-wrench.svg",label:"Repairs Alt: Wrench"},{value:"/category-icons/repairs-alt-hard-hat.svg",label:"Repairs Alt: Hard Hat"},{value:"/category-icons/cleaning.svg",label:"Cleaning"},{value:"/category-icons/cleaning-alt-broom.svg",label:"Cleaning Alt: Broom"},{value:"/category-icons/cleaning-alt-sparkles.svg",label:"Cleaning Alt: Sparkles"},{value:"/category-icons/moving.svg",label:"Moving & Transport"},{value:"/category-icons/moving-alt-bus.svg",label:"Moving Alt: Bus"},{value:"/category-icons/moving-alt-train.svg",label:"Moving Alt: Train"},{value:"/category-icons/tutoring.svg",label:"Tutoring & Education"},{value:"/category-icons/tutoring-alt-book-open.svg",label:"Tutoring Alt: Book Open"},{value:"/category-icons/tutoring-alt-notebook.svg",label:"Tutoring Alt: Notebook"},{value:"/category-icons/it.svg",label:"IT & Technology"},{value:"/category-icons/it-alt-monitor.svg",label:"IT Alt: Monitor"},{value:"/category-icons/it-alt-settings.svg",label:"IT Alt: Settings"},{value:"/category-icons/design.svg",label:"Design"},{value:"/category-icons/design-alt-brush.svg",label:"Design Alt: Brush"},{value:"/category-icons/design-alt-paintbrush.svg",label:"Design Alt: Paintbrush"},{value:"/category-icons/beauty.svg",label:"Beauty & Health"},{value:"/category-icons/beauty-alt-heart.svg",label:"Beauty Alt: Heart"},{value:"/category-icons/beauty-alt-stethoscope.svg",label:"Beauty Alt: Stethoscope"},{value:"/category-icons/tech-repair.svg",label:"Device Repair"},{value:"/category-icons/tech-repair-alt-smartphone.svg",label:"Device Repair Alt: Smartphone"},{value:"/category-icons/tech-repair-alt-wrench.svg",label:"Device Repair Alt: Wrench"},{value:"/category-icons/events.svg",label:"Events"},{value:"/category-icons/events-alt-calendar.svg",label:"Events Alt: Calendar"},{value:"/category-icons/events-alt-clock.svg",label:"Events Alt: Clock"},{value:"/category-icons/photo-video.svg",label:"Photo & Video"},{value:"/category-icons/photo-video-alt-image.svg",label:"Photo & Video Alt: Image"},{value:"/category-icons/photo-video-alt-video.svg",label:"Photo & Video Alt: Video"},{value:"/category-icons/pets.svg",label:"Pets"},{value:"/category-icons/pets-alt-dog.svg",label:"Pets Alt: Dog"},{value:"/category-icons/pets-alt-cat.svg",label:"Pets Alt: Cat"},{value:"/category-icons/auto.svg",label:"Automotive"},{value:"/category-icons/auto-alt-carfront.svg",label:"Automotive Alt: Car Front"},{value:"/category-icons/auto-alt-car.svg",label:"Automotive Alt: Car"},{value:"/category-icons/legal.svg",label:"Legal Services"},{value:"/category-icons/legal-alt-gavel.svg",label:"Legal Alt: Gavel"},{value:"/category-icons/legal-alt-landmark.svg",label:"Legal Alt: Landmark"},{value:"/category-icons/accounting.svg",label:"Accounting"},{value:"/category-icons/accounting-alt-receipt.svg",label:"Accounting Alt: Receipt"},{value:"/category-icons/accounting-alt-wallet.svg",label:"Accounting Alt: Wallet"},{value:"/category-icons/other.svg",label:"Other"},{value:"/category-icons/other-alt-briefcase.svg",label:"Other Alt: Briefcase"},{value:"/category-icons/other-alt-search.svg",label:"Other Alt: Search"}];function b(e,t){return e?"en"===t?e.namesEn||e.namesEl||e.slug||"":"ru"===t?e.namesRu||e.namesEl||e.slug||"":"uk"===t?e.namesUk||e.namesEl||e.slug||"":e.namesEl||e.namesEn||e.slug||"":""}function f(e,t){return e?"en"===t?e.nameEn||e.nameEl||e.slug||"":"ru"===t?e.nameRu||e.nameEl||e.slug||"":"uk"===t?e.nameUk||e.nameEl||e.slug||"":e.nameEl||e.nameEn||e.slug||"":""}function y(e){let{value:t,onChange:a,onUpload:l,uploading:n,error:r,presets:i}=e;return(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3 rounded-xl border border-gray-200 bg-white px-3 py-2",children:[(0,s.jsx)("div",{className:"flex h-12 w-12 items-center justify-center rounded-lg bg-green-50",children:(0,s.jsx)(u.Ez,{icon:t,alt:"category icon",className:"h-9 w-9 object-contain text-3xl leading-none",fallback:"\uD83D\uDCE6"})}),(0,s.jsx)("input",{value:t,onChange:e=>a(e.target.value),className:"flex-1 border-0 bg-transparent p-0 text-sm outline-none ring-0",placeholder:"/category-icons/package.svg"})]}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsxs)("label",{className:"inline-flex cursor-pointer items-center rounded-lg border px-3 py-1.5 text-xs font-medium transition ".concat(n?"border-gray-200 bg-gray-100 text-gray-400":"border-green-300 bg-green-50 text-green-700 hover:bg-green-100"),children:[n?"Uploading...":"Upload SVG",(0,s.jsx)("input",{type:"file",accept:".svg,image/svg+xml",className:"hidden",disabled:n,onChange:async e=>{var t;let a=null==(t=e.target.files)?void 0:t[0];a&&(await l(a),e.target.value="")}})]}),(0,s.jsx)("span",{className:"text-xs text-gray-500",children:"or choose from presets"})]}),(0,s.jsx)("p",{className:"text-[11px] text-gray-500",children:"Preset source: /public/category-icons/presets.json"}),r?(0,s.jsx)("p",{className:"text-xs text-red-600",children:r}):null,(0,s.jsx)("div",{className:"grid grid-cols-2 gap-2 sm:grid-cols-3 lg:grid-cols-4",children:i.map(e=>{let l=t===e.value;return(0,s.jsxs)("button",{type:"button",onClick:()=>a(e.value),className:"flex h-20 flex-col items-center justify-center gap-1 rounded-lg border px-2 transition ".concat(l?"border-green-500 bg-green-50 shadow-sm":"border-gray-200 bg-white hover:border-green-300 hover:bg-green-50"),"aria-label":e.label,title:e.label,children:[(0,s.jsx)(u.Ez,{icon:e.value,alt:e.label,className:"h-8 w-8 object-contain text-3xl leading-none",fallback:"\uD83D\uDCE6"}),(0,s.jsx)("span",{className:"max-w-full truncate text-[11px] font-medium text-gray-600 leading-tight",children:e.label})]},e.value)})})]})}function v(e){let{catRows:t,locale:a,selected:n,onAdd:r,addLabel:i}=e,[o,d]=(0,l.useState)(!1),[c,m]=(0,l.useState)(""),[x,g]=(0,l.useState)(null),p=(0,l.useRef)(null);(0,l.useEffect)(()=>{function e(e){p.current&&!p.current.contains(e.target)&&(d(!1),m(""))}return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]);let h=t.filter(e=>!e.parentId),f=c.toLowerCase(),y=e=>{var t;return!c||b(e,a).toLowerCase().includes(f)||(null!=(t=e.slug)?t:"").toLowerCase().includes(f)};return(0,s.jsxs)("div",{className:"relative",ref:p,children:[(0,s.jsxs)("button",{type:"button",onClick:()=>d(e=>!e),className:"w-full flex items-center gap-1.5 px-3 py-1.5 text-xs transition-colors ".concat(o?"rounded-t-lg border border-green-400 bg-white text-gray-900":"rounded-lg border border-gray-300 bg-white hover:bg-gray-50 text-gray-500 hover:text-gray-700"),children:[(0,s.jsx)("svg",{className:"w-3.5 h-3.5 text-gray-400 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 6h16M4 10h16M4 14h16M4 18h16"})}),(0,s.jsx)("span",{className:"flex-1 text-left truncate",children:i}),(0,s.jsx)("svg",{className:"w-3 h-3 text-gray-400 shrink-0 transition-transform ".concat(o?"rotate-180":""),fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2.5,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"})})]}),o&&(0,s.jsxs)("div",{className:"absolute left-0 top-full w-full min-w-[240px] bg-white border border-t-0 border-green-400 rounded-b-xl shadow-lg z-50 max-h-72 overflow-y-auto",children:[(0,s.jsx)("div",{className:"sticky top-0 bg-white px-3 py-2 border-b border-gray-100",children:(0,s.jsx)("input",{autoFocus:!0,value:c,onChange:e=>m(e.target.value),placeholder:"ППОск...",className:"w-full text-xs border border-gray-200 rounded-lg px-2.5 py-1.5 focus:outline-none focus:ring-2 focus:ring-blue-300"})}),h.map(e=>{let l=t.filter(t=>t.parentId===e.id),i=b(e,a),o=x===e.id,p=l.filter(e=>!n.includes(e.slug)&&y(e)),h=!n.includes(e.slug)&&y(e),f=l.length>0;return!h&&0===p.length&&c?null:(0,s.jsxs)("div",{children:[(0,s.jsxs)("button",{type:"button",className:"w-full flex items-center gap-2 px-3 py-2 text-xs text-left hover:bg-gray-50 text-gray-800",onClick:()=>{f&&!c?g(o?null:e.id):h&&(r(e.slug),d(!1),m(""))},children:[e.icon?(0,s.jsx)(u.Ez,{icon:e.icon,alt:i,className:"h-5 w-5 shrink-0 object-contain text-sm leading-none",fallback:"\uD83D\uDCE6"}):null,(0,s.jsx)("span",{className:"flex-1 font-medium",children:i}),f&&!c?(0,s.jsx)("svg",{className:"w-3.5 h-3.5 text-gray-400 shrink-0 transition-transform ".concat(o?"rotate-90":""),fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2.5,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5l7 7-7 7"})}):null]}),(o||!!c)&&p.map(e=>(0,s.jsxs)("button",{type:"button",className:"w-full flex items-center gap-2 pl-8 pr-3 py-1.5 text-xs text-left bg-gray-50 hover:bg-gray-100 text-gray-600",onClick:()=>{r(e.slug),d(!1),m("")},children:[(0,s.jsx)("span",{className:"w-1.5 h-1.5 rounded-full bg-gray-300 shrink-0"}),(0,s.jsx)("span",{className:"flex-1",children:b(e,a)})]},e.id))]},e.id)})]})]})}function j(e){let{locRows:t,locale:a,selected:n,onAdd:r,addLabel:i}=e,[o,d]=(0,l.useState)(!1),[c,m]=(0,l.useState)(""),[x,u]=(0,l.useState)(null),g=(0,l.useRef)(null);(0,l.useEffect)(()=>{function e(e){g.current&&!g.current.contains(e.target)&&(d(!1),m(""))}return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]);let p=t.filter(e=>!e.parentId),h=c.toLowerCase(),b=e=>{var t;return!c||f(e,a).toLowerCase().includes(h)||(null!=(t=e.slug)?t:"").toLowerCase().includes(h)};return(0,s.jsxs)("div",{className:"relative",ref:g,children:[(0,s.jsxs)("button",{type:"button",onClick:()=>d(e=>!e),className:"w-full flex items-center gap-1.5 px-3 py-1.5 text-xs transition-colors ".concat(o?"rounded-t-lg border border-green-400 bg-white text-gray-900":"rounded-lg border border-gray-300 bg-white hover:bg-gray-50 text-gray-500 hover:text-gray-700"),children:[(0,s.jsxs)("svg",{className:"w-3.5 h-3.5 text-gray-400 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:[(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z"}),(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 11a3 3 0 11-6 0 3 3 0 016 0z"})]}),(0,s.jsx)("span",{className:"flex-1 text-left truncate",children:i}),(0,s.jsx)("svg",{className:"w-3 h-3 text-gray-400 shrink-0 transition-transform ".concat(o?"rotate-180":""),fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2.5,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"})})]}),o&&(0,s.jsxs)("div",{className:"absolute left-0 top-full w-full min-w-[220px] bg-white border border-t-0 border-green-400 rounded-b-xl shadow-lg z-50 max-h-72 overflow-y-auto",children:[(0,s.jsx)("div",{className:"sticky top-0 bg-white px-3 py-2 border-b border-gray-100",children:(0,s.jsx)("input",{autoFocus:!0,value:c,onChange:e=>m(e.target.value),placeholder:"ППОск...",className:"w-full text-xs border border-gray-200 rounded-lg px-2.5 py-1.5 focus:outline-none focus:ring-2 focus:ring-blue-300"})}),p.map(e=>{let l=t.filter(t=>t.parentId===e.id),i=f(e,a),o=x===e.id,g=l.length>0,p=l.filter(e=>!n.includes(e.slug)&&b(e)),h=!n.includes(e.slug)&&b(e);return!h&&0===p.length&&c?null:(0,s.jsxs)("div",{children:[(0,s.jsxs)("button",{type:"button",className:"w-full flex items-center gap-2 px-3 py-2 text-xs text-left hover:bg-gray-50 text-gray-800",onClick:()=>{g&&!c?u(o?null:e.id):h&&(r(e.slug),d(!1),m(""))},children:[(0,s.jsx)("svg",{className:"w-3 h-3 text-gray-300 shrink-0",fill:"currentColor",viewBox:"0 0 24 24",children:(0,s.jsx)("path",{d:"M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5z"})}),(0,s.jsx)("span",{className:"flex-1 font-medium",children:i}),g&&!c?(0,s.jsx)("svg",{className:"w-3.5 h-3.5 text-gray-400 shrink-0 transition-transform ".concat(o?"rotate-90":""),fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2.5,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5l7 7-7 7"})}):null]}),(o||!!c)&&p.map(e=>(0,s.jsxs)("button",{type:"button",className:"w-full flex items-center gap-2 pl-8 pr-3 py-1.5 text-xs text-left bg-gray-50 hover:bg-gray-100 text-gray-600",onClick:()=>{r(e.slug),d(!1),m("")},children:[(0,s.jsx)("span",{className:"w-1.5 h-1.5 rounded-full bg-gray-300 shrink-0"}),(0,s.jsx)("span",{className:"flex-1",children:f(e,a)})]},e.id))]},e.id)})]})]})}function N(){var e,t,a,r,u,N,_,S,L,M,T,I,R,W,P,z,F,H,V,O,K,q,G,X,Y,J,$,Q,Z,ee,et,ea,es,el,en;let er=(0,n.useRouter)(),{data:ei,isPending:eo}=(0,o.wV)(),{t:ed,locale:ec}=(0,d.Y)(),[em,ex]=(0,l.useState)("stats"),[eu,eg]=(0,l.useState)(!1);(0,l.useEffect)(()=>{eg(window.innerWidth<1024)},[]);let[ep,eh]=(0,l.useState)(null),[eb,ef]=(0,l.useState)([]),[ey,ev]=(0,l.useState)(1),[ej,eN]=(0,l.useState)(0),[ek,ew]=(0,l.useState)(""),[eC,e_]=(0,l.useState)(""),[eS,eL]=(0,l.useState)(""),[eE,eD]=(0,l.useState)([]),[eM,eA]=(0,l.useState)(1),[eB,eT]=(0,l.useState)(0),[eI,eU]=(0,l.useState)(""),[eR,eW]=(0,l.useState)(""),[eP,ez]=(0,l.useState)(""),[eF,eH]=(0,l.useState)([]),[eV,eO]=(0,l.useState)(1),[eK,eq]=(0,l.useState)(0),[eG,eX]=(0,l.useState)(0),[eY,eJ]=(0,l.useState)([]),[e$,eQ]=(0,l.useState)(1),[eZ,e0]=(0,l.useState)(0),[e1,e2]=(0,l.useState)(!1),[e4,e5]=(0,l.useState)(0),[e3,e6]=(0,l.useState)([]),[e7,e8]=(0,l.useState)(1),[e9,te]=(0,l.useState)(0),[tt,ta]=(0,l.useState)(""),[ts,tl]=(0,l.useState)(""),[tn,tr]=(0,l.useState)(""),[ti,to]=(0,l.useState)(""),[td,tc]=(0,l.useState)(null),[tm,tx]=(0,l.useState)(""),[tu,tg]=(0,l.useState)(!1),[tp,th]=(0,l.useState)([]),[tb,tf]=(0,l.useState)(1),[ty,tv]=(0,l.useState)(0),[tj,tN]=(0,l.useState)([]),[tk,tw]=(0,l.useState)(0),[tC,t_]=(0,l.useState)(1),[tS,tL]=(0,l.useState)(""),[tE,tD]=(0,l.useState)(""),[tM,tA]=(0,l.useState)(""),[tB,tT]=(0,l.useState)(""),[tI,tU]=(0,l.useState)([]),[tR,tW]=(0,l.useState)([]),[tP,tz]=(0,l.useState)(0),[tF,tH]=(0,l.useState)(1),[tV,tO]=(0,l.useState)(""),[tK,tq]=(0,l.useState)(""),[tG,tX]=(0,l.useState)(""),[tY,tJ]=(0,l.useState)([]),[t$,tQ]=(0,l.useState)("ai"),[tZ,t0]=(0,l.useState)([]),[t1,t2]=(0,l.useState)(1),[t4,t5]=(0,l.useState)(0),[t3,t6]=(0,l.useState)(""),[t7,t8]=(0,l.useState)([]),[t9,ae]=(0,l.useState)(""),[at,aa]=(0,l.useState)(""),[as,al]=(0,l.useState)([]),[an,ar]=(0,l.useState)([]),[ai,ao]=(0,l.useState)([]),[ad,ac]=(0,l.useState)(0),[am,ax]=(0,l.useState)(1),[au,ag]=(0,l.useState)(""),[ap,ah]=(0,l.useState)(""),[ab,af]=(0,l.useState)(!1),[ay,av]=(0,l.useState)(!1),[aj,aN]=(0,l.useState)(null),[ak,aw]=(0,l.useState)(!1),[aC,a_]=(0,l.useState)(!1),[aS,aL]=(0,l.useState)("profile"),[aE,aD]=(0,l.useState)(null),[aM,aA]=(0,l.useState)(""),[aB,aT]=(0,l.useState)([]),[aI,aU]=(0,l.useState)(!1),[aR,aW]=(0,l.useState)({}),[aP,az]=(0,l.useState)({}),[aF,aH]=(0,l.useState)({}),[aV,aO]=(0,l.useState)({}),[aK,aq]=(0,l.useState)([]),[aG,aX]=(0,l.useState)(null),[aY,aJ]=(0,l.useState)(!1),[a$,aQ]=(0,l.useState)([]),[aZ,a0]=(0,l.useState)(null),[a1,a2]=(0,l.useState)(!1),[a4,a5]=(0,l.useState)(new Set),[a3,a6]=(0,l.useState)([]),[a7,a8]=(0,l.useState)(null),[a9,se]=(0,l.useState)(!1),[st,sa]=(0,l.useState)(new Set),[ss,sl]=(0,l.useState)(!1),[sn,sr]=(0,l.useState)(null),[si,so]=(0,l.useState)(h),[sd,sc]=(0,l.useState)(new Set),[sm,sx]=(0,l.useState)({}),[su,sg]=(0,l.useState)(new Set),[sp,sh]=(0,l.useState)(null),[sb,sf]=(0,l.useState)(!1),[sy,sv]=(0,l.useState)("general"),[sj,sN]=(0,l.useState)({siteName:"CanHelp",siteUrl:"",contactEmail:"",supportPhone:""}),[sk,sw]=(0,l.useState)(!1),[sC,s_]=(0,l.useState)(!1),[sS,sL]=(0,l.useState)({host:"",port:"587",username:"",password:"",fromName:"CanHelp",fromEmail:"",encryption:"tls"}),[sE,sD]=(0,l.useState)(!1),[sM,sA]=(0,l.useState)(!1),[sB,sT]=(0,l.useState)(!1),[sI,sU]=(0,l.useState)(null),[sR,sW]=(0,l.useState)({email_verification:{subject:"ППЎтверЎОте ваш email — {{siteName}}",body:""},registration_success:{subject:"ДПбрП пПжалПвать в {{siteName}}!",body:""},password_reset:{subject:"ВПсстаМПвлеМОе парПля — {{siteName}}",body:""},new_offer:{subject:"НПвПе преЎлПжеМОе пП вашей заЎаче \xab{{taskTitle}}\xbb",body:""},new_task:{subject:"НПвая заЎача: {{taskTitle}}",body:""},offer_accepted:{subject:"Ваше преЎлПжеМОе прОМятП: {{taskTitle}}",body:'

Ваше преЎлПжеМОе прОМятП! \uD83C\uDF89

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

ЗаказчОк прОМял ваше преЎлПжеМОе Ма выпПлМеМОе заЎачО:

{{taskTitle}}

СуЌЌа: {{price}}€

Открыть чат →'},new_message:{subject:"НПвПе сППбщеМОе Пт {{senderName}}",body:'

НПвПе сППбщеМОе

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

ВаЌ МапОсал(а) {{senderName}}:

"{{preview}}"

ОтветОть →'},offer_declined:{subject:"Ваше преЎлПжеМОе ПтклПМеМП: {{taskTitle}}",body:'

Ваше преЎлПжеМОе ПтклПМеМП

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

К сПжалеМОю, заказчОк ПтклПМОл ваше преЎлПжеМОе Ма:

{{taskTitle}}

НайтО ЎругОе заказы →'},offer_other_accepted:{subject:"ВыбраМ ЎругПй ОспПлМОтель: {{taskTitle}}",body:'

ВыбраМ ЎругПй ОспПлМОтель

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

ЗаказчОк выбрал ЎругПгП ОспПлМОтеля Ўля заЎаМОя:

{{taskTitle}}

НайтО ЎругОе заказы →'},task_updated:{subject:"ЗаЎаМОе ПбМПвлеМП: {{taskTitle}}",body:'

ЗаЎаМОе ПбМПвлеМП

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

ЗаказчОк ПбМПвОл ЎеталО заЎаМОя:

{{taskTitle}}

СЌПтреть заказ →'},deadline_reminder:{subject:"ЗаЎаМОе Остекает завтра: {{taskTitle}}",body:'

НапПЌОМаМОе П ЎеЎлайМе

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

Ваше заЎаМОе Остекает через 24 часа. ОбМПвОте ЎеЎлайМ, ОМаче заЎаМОе буЎет автПЌатОческО сМятП с публОкацОО.

{{taskTitle}}

РеЎактОрПвать заЎаМОе →'},task_archived:{subject:"ЗаЎаМОе сМятП с публОкацОО: {{taskTitle}}",body:'

ЗаЎаМОе перевеЎеМП в черМПвОк

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

Ваше заЎаМОе ОстеклП О былП автПЌатОческО перевеЎеМП в черМПвОк. ОбМПвОте ЎеЎлайМ, чтПбы ПпублОкПвать егП сМПва.

{{taskTitle}}

РеЎактОрПвать заЎаМОе →'},referral_reward:{subject:"Вы пПлучОлО реферальМую МаграЎу — {{siteName}}",body:'

Вы пПлучОлО реферальМую МаграЎу! \uD83C\uDF81

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

Друг зарегОстрОрПвался пП вашей реферальМПй ссылке. На ваш аккауМт ЎПбавлеМП {{days}} ЎМей ЎПступа к плаМу {{planName}}!

+{{days}} ЎМей — {{planName}}

ПерейтО к аккауМту →'},referral_reward_el:{subject:"Λάβατε αΜταΌοιβή παραποΌπής — {{siteName}}",body:'

Λάβατε αΜταΌοιβή παραποΌπής! \uD83C\uDF81

Γεια {{userName}},

ΈΜας φίλος εγγράφηκε χρησιΌοποιώΜτας τοΜ σύΜΎεσΌο παραποΌπής σας. ΣτοΜ λογαριασΌό σας προστέΞηκαΜ {{days}} ηΌέρες πρόσβασης στο πλάΜο {{planName}}!

+{{days}} ηΌέρες — {{planName}}

Δες τοΜ λογαριασΌό σου →'},referral_reward_en:{subject:"You received a referral reward — {{siteName}}",body:'

You received a referral reward! \uD83C\uDF81

Hi {{userName}},

A friend registered using your referral link. {{days}} days of {{planName}} access have been added to your account!

+{{days}} days — {{planName}}

View your account →'},referral_reward_ru:{subject:"Вы пПлучОлО реферальМую МаграЎу — {{siteName}}",body:'

Вы пПлучОлО реферальМую МаграЎу! \uD83C\uDF81

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

Друг зарегОстрОрПвался пП вашей реферальМПй ссылке. На ваш аккауМт ЎПбавлеМП {{days}} ЎМей ЎПступа к плаМу {{planName}}!

+{{days}} ЎМей — {{planName}}

ПерейтО к аккауМту →'}}),[sP,sz]=(0,l.useState)(null),[sF,sH]=(0,l.useState)("el"),[sV,sO]=(0,l.useState)(!1),[sK,sq]=(0,l.useState)(!1),[sG,sX]=(0,l.useState)({merchantId:"",apiUser:"",apiPassword:"",environment:"test",confirmationUrl:"",cancelUrl:"",enabled:!1}),[sY,sJ]=(0,l.useState)(!1),[s$,sQ]=(0,l.useState)(!1),[sZ,s0]=(0,l.useState)({enabled:!1,planId:"",days:"30"}),[s1,s2]=(0,l.useState)(!1),[s4,s5]=(0,l.useState)(!1),[s3,s6]=(0,l.useState)({maintenanceMode:!1,indexingEnabled:!0,headScripts:"",siteTitleEl:"",siteTitleEn:"",siteTitleRu:"",siteTitleUk:"",siteDescriptionEl:"",siteDescriptionEn:"",siteDescriptionRu:"",siteDescriptionUk:""}),[s7,s8]=(0,l.useState)(!1),[s9,le]=(0,l.useState)(!1),[lt,la]=(0,l.useState)("el"),[ls,ll]=(0,l.useState)({telegram:"",instagram:"",facebook:"",twitter:"",youtube:"",tiktok:"",whatsapp:"",viber:""}),[ln,lr]=(0,l.useState)(!1),[li,lo]=(0,l.useState)(!1),[ld,lc]=(0,l.useState)({botToken:"",adminChatId:"",channelIdEl:"",channelIdEn:"",channelIdRu:"",channelIdUk:"",notifyRegistrations:!1,postNewTasks:!1}),[lm,lx]=(0,l.useState)(!1),[lu,lg]=(0,l.useState)(!1),[lp,lh]=(0,l.useState)(!1),[lb,lf]=(0,l.useState)(!1),[ly,lv]=(0,l.useState)(null),[lj,lN]=(0,l.useState)(null),[lk,lw]=(0,l.useState)(null),[lC,l_]=(0,l.useState)({}),[lS,lL]=(0,l.useState)(!1),[lE,lD]=(0,l.useState)(null),[lM,lA]=(0,l.useState)(!1),[lB,lT]=(0,l.useState)(!1),[lI,lU]=(0,l.useState)([]),[lR,lW]=(0,l.useState)(!1),[lP,lz]=(0,l.useState)([]),[lF,lH]=(0,l.useState)(!1),[lV,lO]=(0,l.useState)(null),[lK,lq]=(0,l.useState)(null),[lG,lX]=(0,l.useState)(null),[lY,lJ]=(0,l.useState)(!1),l$=e=>{lX(e),lJ(!1)},lQ=e=>{lX(e),lJ(!0)},[lZ,l0]=(0,l.useState)(null),[l1,l2]=(0,l.useState)(!1),[l4,l5]=(0,l.useState)("uk"),[l3,l6]=(0,l.useState)("el"),[l7,l8]=(0,l.useState)({}),[l9,ne]=(0,l.useState)(null),[nt,na]=(0,l.useState)(null),[ns,nl]=(0,l.useState)(null),[nn,nr]=(0,l.useState)(!1),[ni,no]=(0,l.useState)(new Set),[nd,nc]=(0,l.useState)("broadcast"),[nm,nx]=(0,l.useState)(""),[nu,ng]=(0,l.useState)(""),[np,nh]=(0,l.useState)(""),[nb,nf]=(0,l.useState)("general"),[ny,nv]=(0,l.useState)(""),[nj,nN]=(0,l.useState)(!0),[nk,nw]=(0,l.useState)(!1),[nC,n_]=(0,l.useState)(null),[nS,nL]=(0,l.useState)(null),[nE,nD]=(0,l.useState)(!1),nM=!eo&&ei&&(null==(e=ei.user)?void 0:e.role)==="admin";async function nA(){if(nu.trim()){if("user"===nd&&!nm.trim())return void nL("УкажОте ID пПльзПвателя");nw(!0),nL(null),n_(null);try{let e={title:nu.trim(),body:np.trim()||void 0,type:nb.trim()||void 0,referenceId:ny.trim()||void 0};if("broadcast"===nd){let t=await c.V7({...e,onlyActive:nj});n_(t)}else{let t=await c.g1(nm.trim(),e);n_(t)}}catch(e){nL((null==e?void 0:e.message)||"Не уЎалПсь ПтправОть push")}finally{nw(!1)}}}async function nB(e,t){let a=t?c.Wi:c.He,s=await a(e).catch(()=>null);s&&ef(t=>t.map(t=>t.id===e?s:t))}function nT(e,t){return e?"THIRD_PARTY_AUTH_ERROR"===e?"ОшОбка APNs/Firebase iOS: прПверьте Apple APNs Auth Key (.p8) О связку Firebase прПекта Ўля iOS-прОлПжеМОя":"UNREGISTERED"===e?"ТПкеМ устрПйства бПльше Ме валОЎеМ":"INVALID_ARGUMENT"===e?"НекПрректМый тПкеМ ОлО payload":"REQUEST_FAILED"===e?t||"FCM request failed before response":t?"".concat(e,": ").concat(t):e:t||"FCM прОМял 0 сППбщеМОй"}async function nI(){if(aj){aw(!0);try{var e,t,a,s,l,n;let r=await c.wl(aj.id,{firstName:aj.firstName,lastName:aj.lastName,phone:aj.phone||null,bio:aj.bio||null,role:aj.role,planId:aj.planId||null,isActive:aj.isActive,locale:aj.locale,languages:null!=(e=aj.languages)?e:[],personalSiteSlug:aj.personalSiteSlug||null,showContactInfo:null!=(t=aj.showContactInfo)&&t,notifyNewTasks:null!=(a=aj.notifyNewTasks)&&a,notifMessages:null==(s=aj.notifMessages)||s,skills:null!=(l=aj.skills)?l:[],siteSettings:null!=(n=aj.siteSettings)?n:{}});await Promise.all(aB.map(e=>{var t,a,s;return c.oq(e.id,{title:e.title,description:e.description||null,skills:null!=(t=e.skills)?t:[],categories:null!=(a=e.categories)?a:[],locations:null!=(s=e.locations)?s:[],publicationStatus:e.publicationStatus,isActive:e.isActive}).catch(()=>null)})),ef(e=>e.map(e=>e.id===aj.id?r:e)),aN(null)}catch(e){}finally{aw(!1)}}}async function nU(){if(aj){a_(!0);try{let e=await c.uQ(aj.id);aN(t=>t?{...t,emailVerified:e.emailVerified}:t),ef(t=>t.map(t=>t.id===aj.id?{...t,emailVerified:e.emailVerified}:t))}catch(e){}finally{a_(!1)}}}async function nR(){if(!aj)return;let e=Number(aj.topUpAmount);if(e&&!(e<=0)){af(!0);try{let t=await c.P0(aj.id,{amount:e,description:aj.topUpDescription||void 0});ef(e=>e.map(e=>e.id===aj.id?t.user:e)),aN(e=>e?{...e,...t.user,topUpAmount:"",topUpDescription:""}:e),"balances"===em&&c.g0({page:am,userId:au||void 0,kind:ap||void 0}).then(e=>{ao(e.data),ac(e.total)}).catch(()=>{})}catch(e){}finally{af(!1)}}}async function nW(){if(!aj)return;let e=Number(aj.withdrawAmount);if(e&&!(e<=0)){av(!0);try{let t=await c.hD(aj.id,{amount:e,description:aj.withdrawDescription||void 0});ef(e=>e.map(e=>e.id===aj.id?t.user:e)),aN(e=>e?{...e,...t.user,withdrawAmount:"",withdrawDescription:""}:e),"balances"===em&&c.g0({page:am,userId:au||void 0,kind:ap||void 0}).then(e=>{ao(e.data),ac(e.total)}).catch(()=>{})}catch(e){}finally{av(!1)}}}async function nP(e){let t=aB.find(t=>t.id===e);if(t){az(t=>({...t,[e]:!0}));try{var a,s,l;let n=await c.oq(e,{title:t.title,description:t.description||null,skills:null!=(a=t.skills)?a:[],categories:null!=(s=t.categories)?s:[],locations:null!=(l=t.locations)?l:[],publicationStatus:t.publicationStatus,isActive:t.isActive});aT(t=>t.map(t=>t.id===e?n:t))}catch(e){}finally{az(t=>({...t,[e]:!1}))}}}async function nz(e,t){let a=await c.oq(e,{publicationStatus:t,isActive:"active"===t}).catch(()=>null);a&&(eJ(t=>t.map(t=>t.id===e?a:t)),(null==aj?void 0:aj.id)===a.specialistId&&aT(t=>t.map(t=>t.id===e?a:t)),c.z5(1,"pending").then(e=>eX(e.total)).catch(()=>{}),c.s_(1,"pending").then(e=>e5(e.total)).catch(()=>{}))}async function nF(e){let t=await c.nf(e).catch(()=>null);if(t){let a=t.task||t;eD(t=>t.map(t=>(t.task||t).id===e?{...t,task:a}:t))}}async function nH(e,t){window.confirm("".concat(ed("admin.tasks.delete.confirm"),'\n"').concat(t,'"'))&&await c.GB(e).catch(()=>null)&&eD(t=>t.filter(t=>{var a;return((null==(a=t.task)?void 0:a.id)||t.id)!==e}))}async function nV(e,t){let a=await c.eU(e,t).catch(()=>null);a&&eH(t=>t.map(t=>t.id===e?{...t,...a}:t))}function nO(e){a0({parentId:null!=e?e:null,slug:"",nameEl:"",nameEn:"",nameRu:"",nameUk:"",order:0,isActive:!0})}async function nK(){if(aZ){a2(!0);try{if(aZ.id){let e=await c.Nt(aZ.id,aZ);aQ(t=>t.map(t=>t.id===aZ.id?e:t))}else{let e=await c.yJ({slug:aZ.slug,nameEl:aZ.nameEl,nameEn:aZ.nameEn,nameRu:aZ.nameRu,nameUk:aZ.nameUk,parentId:aZ.parentId,order:aZ.order});aQ(t=>[...t,e])}a0(null)}catch(e){}finally{a2(!1)}}}async function nq(e,t){window.confirm("".concat(ed("admin.loc.delete.confirm"),'\n"').concat(t,'"'))&&await c.zR(e).catch(()=>null)&&aQ(t=>t.filter(t=>t.id!==e))}function nG(e){sr(null),a8({parentId:null!=e?e:null,slug:"",icon:"/category-icons/package.svg",namesEl:"",namesEn:"",namesRu:"",namesUk:"",order:0,isActive:!0})}async function nX(e){if("image/svg+xml"!==e.type)return void sr("Only SVG files are allowed");sl(!0),sr(null);try{let t=new FormData;t.append("file",e);let a=await fetch("".concat("https://api.canhelp.gr","/api/uploads"),{method:"POST",credentials:"include",body:t});if(!a.ok){let e=await a.json().catch(()=>({error:"Upload failed"}));throw Error(e.error||"Upload failed")}let s=await a.json();a8(e=>e?{...e,icon:s.url}:e)}catch(e){sr((null==e?void 0:e.message)||"Upload failed")}finally{sl(!1)}}async function nY(){if(a7){se(!0);try{if(a7.id){let e=await c.$7(a7.id,a7);a6(t=>t.map(t=>t.id===a7.id?e:t))}else{let e=await c.zZ({slug:a7.slug,icon:a7.icon,namesEl:a7.namesEl,namesEn:a7.namesEn,namesRu:a7.namesRu,namesUk:a7.namesUk,parentId:a7.parentId,order:a7.order});a6(t=>[...t,e])}a8(null)}catch(e){}finally{se(!1)}}}async function nJ(e,t){window.confirm("".concat(ed("admin.cat.delete.confirm"),'\n"').concat(t,'"'))&&await c.K7(e).catch(()=>null)&&a6(t=>t.filter(t=>t.id!==e))}async function n$(e){let t=e.id,a=e.slug;if(sc(e=>{let a=new Set(e);return a.has(t)?a.delete(t):a.add(t),a}),!sm[a]){sg(e=>new Set(e).add(t));try{let e=await c.i_(a);sx(t=>({...t,[a]:e}))}catch(e){}finally{sg(e=>{let a=new Set(e);return a.delete(t),a})}}}async function nQ(){if(sp){sf(!0);try{if(sp.id){let e=await c.fP(sp.id,{nameEl:sp.nameEl,nameEn:sp.nameEn,nameRu:sp.nameRu,nameUk:sp.nameUk,order:sp.order});sx(t=>{var a;return{...t,[sp.catSlug]:(null!=(a=t[sp.catSlug])?a:[]).map(t=>t.id===sp.id?e:t)}})}else{let e=await c.S9({categorySlug:sp.catSlug,nameEl:sp.nameEl,nameEn:sp.nameEn,nameRu:sp.nameRu,nameUk:sp.nameUk,order:sp.order});sx(t=>{var a;return{...t,[sp.catSlug]:[...null!=(a=t[sp.catSlug])?a:[],e]}})}sh(null)}catch(e){}finally{sf(!1)}}}async function nZ(e,t){(e._skipConfirm||window.confirm('УЎалОть Мавык "'.concat(e.nameEl,'"?')))&&(e._skipConfirm||await c.hp(e.id).catch(()=>null))&&sx(a=>{var s;return{...a,[t]:(null!=(s=a[t])?s:[]).filter(t=>t.id!==e.id)}})}async function n0(){if(aG){aJ(!0);try{let e={name:aG.name,description:aG.description||void 0,role:aG.role,tier:aG.tier,price:aG.price,oldPrice:aG.oldPrice||null,currency:aG.currency,maxTasks:aG.maxTasks?Number(aG.maxTasks):null,maxOffers:aG.maxOffers?Number(aG.maxOffers):null,maxCards:aG.maxCards?Number(aG.maxCards):null,maxMessagesPerDay:aG.maxMessagesPerDay?Number(aG.maxMessagesPerDay):null,maxOrdersPerDay:aG.maxOrdersPerDay?Number(aG.maxOrdersPerDay):null,maxSkills:aG.maxSkills?Number(aG.maxSkills):null,durationDays:aG.durationDays?Number(aG.durationDays):null,notifyNewTasks:aG.notifyNewTasks,searchBoost:aG.searchBoost,offersMultiplier:aG.offersMultiplier,canContactFreePlan:aG.canContactFreePlan,canContactProPlan:aG.canContactProPlan,canContactAll:aG.canContactAll,canShowContactInfo:aG.canShowContactInfo,canViewPhone:aG.canViewPhone,canUploadVideo:aG.canUploadVideo,hasFavorites:aG.hasFavorites,hasGoogleCalendar:aG.hasGoogleCalendar,hasVerifiedBadge:aG.hasVerifiedBadge,highlightedReviews:aG.highlightedReviews,hasPersonalSite:aG.hasPersonalSite,hasCanHelpNowStatus:aG.hasCanHelpNowStatus,hasNeedHelpStatus:aG.hasNeedHelpStatus,hasAutoResponse:aG.hasAutoResponse,hasAutoMatch:aG.hasAutoMatch,hasPriceList:aG.hasPriceList,receiveInstantDispatchFree:aG.receiveInstantDispatchFree,receiveInstantDispatchPro:aG.receiveInstantDispatchPro,features:aG.features?aG.features.split("\n").map(e=>e.trim()).filter(Boolean):[],isDefault:aG.isDefault,isActive:aG.isActive,order:aG.order};if(aG.id){let t=await c.td(aG.id,e);aq(e=>e.map(e=>e.id===aG.id?t:e))}else{let t=await c.qT(e);aq(e=>[...e,t])}aG.isDefault&&c.OX().then(aq).catch(()=>{}),aX(null)}catch(e){}finally{aJ(!1)}}}async function n1(e,t){window.confirm('Delete plan "'.concat(t,'"?'))&&await c.bR(e).catch(()=>null)&&aq(t=>t.filter(t=>t.id!==e))}async function n2(){sw(!0);try{await c.CX({"general.siteName":sj.siteName,"general.siteUrl":sj.siteUrl,"general.contactEmail":sj.contactEmail,"general.supportPhone":sj.supportPhone}),s_(!0),setTimeout(()=>s_(!1),2500)}catch(e){}finally{sw(!1)}}async function n4(){sD(!0);try{await c.CX({"smtp.host":sS.host,"smtp.port":sS.port,"smtp.username":sS.username,"smtp.password":sS.password,"smtp.fromName":sS.fromName,"smtp.fromEmail":sS.fromEmail,"smtp.encryption":sS.encryption}),sA(!0),setTimeout(()=>sA(!1),2500)}catch(e){}finally{sD(!1)}}async function n5(e){var t,a;let s="".concat(e,"_").concat(sF),l=null!=(a=null!=(t=sR[s])?t:sR[e])?a:{subject:"",body:""};if(l.subject||l.body){sq(!0);try{await c.jg(s,l);let t=await c.wc({subject:l.subject,body:l.body,fromLocale:sF});sW(a=>{let n={...a,[s]:l};for(let[a,s]of Object.entries(t))n["".concat(e,"_").concat(a)]=s;return n}),await Promise.all(Object.entries(t).map(t=>{let[a,s]=t;return c.jg("".concat(e,"_").concat(a),s)}))}catch(e){}finally{sq(!1)}}}async function n3(e){let t="".concat(e,"_").concat(sF);sO(!0);try{var a;await c.jg(t,null!=(a=sR[t])?a:{subject:"",body:""}),sz(null)}catch(e){}finally{sO(!1)}}async function n6(){sJ(!0);try{await c.CX({"payment.epay.merchantId":sG.merchantId,"payment.epay.apiUser":sG.apiUser,"payment.epay.apiPassword":sG.apiPassword,"payment.epay.environment":sG.environment,"payment.epay.confirmationUrl":sG.confirmationUrl,"payment.epay.cancelUrl":sG.cancelUrl,"payment.epay.enabled":String(sG.enabled)}),sQ(!0),setTimeout(()=>sQ(!1),2500)}catch(e){}finally{sJ(!1)}}async function n7(){s2(!0);try{await c.CX({referral_enabled:String(sZ.enabled),referral_plan_id:sZ.planId,referral_days:sZ.days}),s5(!0),setTimeout(()=>s5(!1),2500)}catch(e){}finally{s2(!1)}}async function n8(){s8(!0);try{await c.CX({"seo.maintenanceMode":String(s3.maintenanceMode),"seo.indexingEnabled":String(s3.indexingEnabled),"seo.headScripts":s3.headScripts,"seo.siteTitle.el":s3.siteTitleEl,"seo.siteTitle.en":s3.siteTitleEn,"seo.siteTitle.ru":s3.siteTitleRu,"seo.siteTitle.uk":s3.siteTitleUk,"seo.siteDescription.el":s3.siteDescriptionEl,"seo.siteDescription.en":s3.siteDescriptionEn,"seo.siteDescription.ru":s3.siteDescriptionRu,"seo.siteDescription.uk":s3.siteDescriptionUk}),le(!0),setTimeout(()=>le(!1),2500)}catch(e){}finally{s8(!1)}}async function n9(){lr(!0);try{await c.CX({"social.telegram":ls.telegram,"social.instagram":ls.instagram,"social.facebook":ls.facebook,"social.twitter":ls.twitter,"social.youtube":ls.youtube,"social.tiktok":ls.tiktok,"social.whatsapp":ls.whatsapp,"social.viber":ls.viber}),lo(!0),setTimeout(()=>lo(!1),2500)}catch(e){}finally{lr(!1)}}async function re(){lx(!0);try{await c.CX({"telegram.botToken":ld.botToken,"telegram.adminChatId":ld.adminChatId,"telegram.channelId.el":ld.channelIdEl,"telegram.channelId.en":ld.channelIdEn,"telegram.channelId.ru":ld.channelIdRu,"telegram.channelId.uk":ld.channelIdUk,"telegram.notifyRegistrations":String(ld.notifyRegistrations),"telegram.postNewTasks":String(ld.postNewTasks)}),lg(!0),setTimeout(()=>lg(!1),2500)}catch(e){}finally{lx(!1)}}async function rt(e){var t,a;let s=null!=(t=({admin:ld.adminChatId,el:ld.channelIdEl,en:ld.channelIdEn,ru:ld.channelIdRu,uk:ld.channelIdUk})[e])?t:"";"admin"===e?(lh(!0),lv(null)):(lw(e),l_(t=>{let a={...t};return delete a[e],a}));try{let t=await c.qX(ld.botToken,s),l={ok:t.ok,msg:t.ok?t.botName?"@".concat(t.botName):ed("admin.settings.telegram.test_ok"):null!=(a=t.error)?a:ed("admin.settings.telegram.test_fail")};"admin"===e?lv(l):l_(t=>({...t,[e]:l}))}catch(a){let t={ok:!1,msg:ed("admin.settings.telegram.test_fail")};"admin"===e?lv(t):l_(a=>({...a,[e]:t}))}finally{"admin"===e?lh(!1):lw(null)}}async function ra(){lL(!0),lD(null);try{var e;let t=await c.cl(ld.botToken);lD({ok:t.ok,msg:t.ok?"@".concat(t.botName):null!=(e=t.error)?e:ed("admin.settings.telegram.test_fail")})}catch(e){lD({ok:!1,msg:ed("admin.settings.telegram.test_fail")})}finally{lL(!1)}}if((0,l.useEffect)(()=>{var e;eo||ei||er.push("/login"),!eo&&ei&&(null==(e=ei.user)?void 0:e.role)!=="admin"&&er.push("/")},[ei,eo]),(0,l.useEffect)(()=>{nM&&(c.dE().then(eh).catch(()=>{}),c.bi().then(al).catch(()=>{}),c.u4().then(ar).catch(()=>{}),c.z5(1,"pending").then(e=>eX(e.total)).catch(()=>{}),c.s_(1,"pending").then(e=>e5(e.total)).catch(()=>{}))},[nM]),(0,l.useEffect)(()=>{nM&&"users"===em&&(nD(!0),c.cS(ey,ek||void 0,eS||void 0).then(e=>{ef(e.data),eN(e.total)}).catch(()=>{}).finally(()=>nD(!1)))},[nM,em,ey,ek,eS]),(0,l.useEffect)(()=>{nM&&"tasks"===em&&(nD(!0),c.Yj(eM,eI||void 0,eP||void 0).then(e=>{eD(e.data),eT(e.total)}).catch(()=>{}).finally(()=>nD(!1)))},[nM,em,eM,eI,eP]),(0,l.useEffect)(()=>{nM&&"reports"===em&&(nD(!0),c.z5(eV).then(e=>{eH(e.data),eq(e.total)}).catch(()=>{}).finally(()=>nD(!1)))},[nM,em,eV]),(0,l.useEffect)(()=>{nM&&"moderation"===em&&(e2(!0),c.s_(e$,"review").then(e=>{eJ(e.data),e0(e.total)}).catch(()=>{}).finally(()=>e2(!1)))},[nM,em,e$]),(0,l.useEffect)(()=>{if(!nM||"support"!==em)return;nD(!0);let e={page:String(e7),limit:"30"};tt&&(e.status=tt),ts&&(e.type=ts),tn&&(e.q=tn),c.KZ(e).then(e=>{e6(e.data),te(e.total)}).catch(()=>{}).finally(()=>nD(!1))},[nM,em,e7,tt,ts,tn]),(0,l.useEffect)(()=>{nM&&"balances"===em&&(nD(!0),c.g0({page:am,userId:au||void 0,kind:ap||void 0}).then(e=>{ao(e.data),ac(e.total)}).catch(()=>{}).finally(()=>nD(!1)))},[nM,em,am,au,ap]),(0,l.useEffect)(()=>{nM&&"logs"===em&&("ai"===t$?(nD(!0),c.j_(tb).then(e=>{th(e.data),tv(e.total)}).catch(()=>{}).finally(()=>nD(!1))):"activity"===t$?c.yO({page:tC,event:tS||void 0,userId:tE||void 0,dateFrom:tM||void 0,dateTo:tB||void 0}).then(e=>{var t;tN(e.data),tw(e.total),(null==(t=e.eventTypes)?void 0:t.length)&&tU(e.eventTypes)}).catch(()=>{}):"mail"===t$?c.qt({page:tF,event:tV||void 0,dateFrom:tK||void 0,dateTo:tG||void 0}).then(e=>{var t;tW(e.data),tz(e.total),(null==(t=e.eventTypes)?void 0:t.length)&&tJ(e.eventTypes)}).catch(()=>{}):"notifications"===t$&&c.Br({page:t1,type:t3||void 0,dateFrom:t9||void 0,dateTo:at||void 0}).then(e=>{var t;t0(e.data),t5(e.total),(null==(t=e.notifTypes)?void 0:t.length)&&t8(e.notifTypes)}).catch(()=>{}))},[nM,em,t$,tb,tC,tS,tE,tM,tB,tF,tV,tK,tG,t1,t3,t9,at]),(0,l.useEffect)(()=>{t_(1)},[tS,tE,tM,tB]),(0,l.useEffect)(()=>{tH(1)},[tV,tK,tG]),(0,l.useEffect)(()=>{t2(1)},[t3,t9,at]),(0,l.useEffect)(()=>{nM&&"plans"===em&&c.OX().then(aq).catch(()=>{})},[nM,em]),(0,l.useEffect)(()=>{nM&&"translations"===em&&(l2(!0),c.YQ().then(e=>l0(e.tables)).catch(()=>{}).finally(()=>l2(!1)))},[nM,em]),(0,l.useEffect)(()=>{nM&&"backup"===em&&((0,c.Em)("/admin/backup/settings").then(e=>lA(!!e.autoEnabled)).catch(()=>{}),lW(!0),(0,c.Em)("/admin/backup/tables").then(e=>lU(e.tables||[])).catch(()=>{}).finally(()=>lW(!1)),(0,c.Em)("/admin/backup/list").then(e=>lz(e.files||[])).catch(()=>{}))},[nM,em]),(0,l.useEffect)(()=>{nM&&"referrals"===em&&(nr(!0),c.cJ().then(e=>nl(e)).catch(()=>{}).finally(()=>nr(!1)))},[nM,em]),(0,l.useEffect)(()=>{nM&&"users"===em&&0===aK.length&&c.OX().then(aq).catch(()=>{})},[nM,em]),(0,l.useEffect)(()=>{ev(1)},[ek,eS]),(0,l.useEffect)(()=>{eA(1)},[eI,eP]),(0,l.useEffect)(()=>{ax(1)},[au,ap]),(0,l.useEffect)(()=>{nM&&"locations"===em&&c.k_().then(aQ).catch(()=>{})},[nM,em]),(0,l.useEffect)(()=>{nM&&"categories"===em&&c.KD().then(a6).catch(()=>{})},[nM,em]),(0,l.useEffect)(()=>{nM&&fetch("/category-icons/presets.json").then(e=>e.ok?e.json():Promise.reject(Error("Failed to load presets"))).then(e=>{if(!Array.isArray(e))return;let t=e.filter(e=>!!e&&"object"==typeof e&&"string"==typeof e.value&&"string"==typeof e.label).filter(e=>e.value.startsWith("/category-icons/"));t.length>0&&so(t)}).catch(()=>{})},[nM]),(0,l.useEffect)(()=>{nM&&"settings"===em&&(0===aK.length&&c.OX().then(aq).catch(()=>{}),c.rC().then(e=>{var t,a,s,l,n,r,i,o,d,c,m,x,u,g,p,h,b,f,y,v,j,N,k,w,C,_,S,L,E,D,M,A,B,T,I,U,R,W,P,z,F,H,V,O,K,q,G,X;sN({siteName:null!=(t=e["general.siteName"])?t:"CanHelp",siteUrl:null!=(a=e["general.siteUrl"])?a:"",contactEmail:null!=(s=e["general.contactEmail"])?s:"",supportPhone:null!=(l=e["general.supportPhone"])?l:""}),sL({host:null!=(n=e["smtp.host"])?n:"",port:null!=(r=e["smtp.port"])?r:"587",username:null!=(i=e["smtp.username"])?i:"",password:null!=(o=e["smtp.password"])?o:"",fromName:null!=(d=e["smtp.fromName"])?d:"CanHelp",fromEmail:null!=(c=e["smtp.fromEmail"])?c:"",encryption:null!=(m=e["smtp.encryption"])?m:"tls"}),sX({merchantId:null!=(x=e["payment.epay.merchantId"])?x:"",apiUser:null!=(u=e["payment.epay.apiUser"])?u:"",apiPassword:null!=(g=e["payment.epay.apiPassword"])?g:"",environment:null!=(p=e["payment.epay.environment"])?p:"test",confirmationUrl:null!=(h=e["payment.epay.confirmationUrl"])?h:"",cancelUrl:null!=(b=e["payment.epay.cancelUrl"])?b:"",enabled:"true"===e["payment.epay.enabled"]}),s0({enabled:"true"===e.referral_enabled,planId:null!=(v=null!=(y=null!=(f=e.referral_plan_id)?f:e.referral_customer_plan_id)?y:e.referral_specialist_plan_id)?v:"",days:null!=(k=null!=(N=null!=(j=e.referral_days)?j:e.referral_customer_days)?N:e.referral_specialist_days)?k:"30"}),s6({maintenanceMode:"true"===e["seo.maintenanceMode"],indexingEnabled:"false"!==e["seo.indexingEnabled"],headScripts:null!=(w=e["seo.headScripts"])?w:"",siteTitleEl:null!=(_=null!=(C=e["seo.siteTitle.el"])?C:e["seo.siteTitle"])?_:"",siteTitleEn:null!=(S=e["seo.siteTitle.en"])?S:"",siteTitleRu:null!=(L=e["seo.siteTitle.ru"])?L:"",siteTitleUk:null!=(E=e["seo.siteTitle.uk"])?E:"",siteDescriptionEl:null!=(M=null!=(D=e["seo.siteDescription.el"])?D:e["seo.siteDescription"])?M:"",siteDescriptionEn:null!=(A=e["seo.siteDescription.en"])?A:"",siteDescriptionRu:null!=(B=e["seo.siteDescription.ru"])?B:"",siteDescriptionUk:null!=(T=e["seo.siteDescription.uk"])?T:""}),ll({telegram:null!=(I=e["social.telegram"])?I:"",instagram:null!=(U=e["social.instagram"])?U:"",facebook:null!=(R=e["social.facebook"])?R:"",twitter:null!=(W=e["social.twitter"])?W:"",youtube:null!=(P=e["social.youtube"])?P:"",tiktok:null!=(z=e["social.tiktok"])?z:"",whatsapp:null!=(F=e["social.whatsapp"])?F:"",viber:null!=(H=e["social.viber"])?H:""}),lc({botToken:null!=(V=e["telegram.botToken"])?V:"",adminChatId:null!=(O=e["telegram.adminChatId"])?O:"",channelIdEl:null!=(K=e["telegram.channelId.el"])?K:"",channelIdEn:null!=(q=e["telegram.channelId.en"])?q:"",channelIdRu:null!=(G=e["telegram.channelId.ru"])?G:"",channelIdUk:null!=(X=e["telegram.channelId.uk"])?X:"",notifyRegistrations:"true"===e["telegram.notifyRegistrations"],postNewTasks:"true"===e["telegram.postNewTasks"]})}).catch(()=>{}),c.Lp().then(e=>{let t={};for(let a of e)t[a.key]={subject:a.subject,body:a.body};sW(e=>({...e,...t}))}).catch(()=>{}))},[nM,em]),eo)return(0,s.jsx)("div",{className:"text-center py-20 text-gray-500",children:ed("common.loading")});let rs="ru"===ec?"ru-RU":"en"===ec?"en-US":"el-GR",rl=[{key:"stats",label:ed("admin.tab.stats"),icon:(0,s.jsx)("svg",{className:"w-4 h-4 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z"})})},{key:"users",label:ed("admin.tab.users"),icon:(0,s.jsxs)("svg",{className:"w-4 h-4 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:[(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M17 21v-2a4 4 0 00-4-4H5a4 4 0 00-4 4v2"}),(0,s.jsx)("circle",{cx:"9",cy:"7",r:"4"}),(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M23 21v-2a4 4 0 00-3-3.87M16 3.13a4 4 0 010 7.75"})]})},{key:"tasks",label:ed("admin.tab.tasks"),icon:(0,s.jsx)("svg",{className:"w-4 h-4 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-3 7h3m-3 4h3m-6-4h.01M9 16h.01"})})},{key:"reports",label:ed("admin.tab.reports"),badge:eG||void 0,icon:(0,s.jsx)("svg",{className:"w-4 h-4 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})})},{key:"moderation",label:ed("admin.tab.moderation"),badge:e4||void 0,icon:(0,s.jsxs)("svg",{className:"w-4 h-4 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:[(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 8c-1.1 0-2 .9-2 2v1H9a1 1 0 00-1 1v5a1 1 0 001 1h6a1 1 0 001-1v-5a1 1 0 00-1-1h-1v-1c0-1.1-.9-2-2-2zm0 0V6m0 12v-2"}),(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 20h12"})]})},{key:"categories",label:ed("admin.tab.categories"),icon:(0,s.jsx)("svg",{className:"w-4 h-4 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 6a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2H6a2 2 0 01-2-2V6zm10 0a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2h-2a2 2 0 01-2-2V6zM4 16a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2H6a2 2 0 01-2-2v-2zm10 0a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2h-2a2 2 0 01-2-2v-2z"})})},{key:"locations",label:ed("admin.tab.locations"),icon:(0,s.jsxs)("svg",{className:"w-4 h-4 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:[(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z"}),(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 11a3 3 0 11-6 0 3 3 0 016 0z"})]})},{key:"balances",label:ed("admin.tab.balances","Balance"),icon:(0,s.jsxs)("svg",{className:"w-4 h-4 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:[(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M17 9V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-2"}),(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M20 12h-6m0 0a2 2 0 100 4h6v-8h-6a2 2 0 100 4z"})]})},{key:"plans",label:ed("admin.tab.plans"),icon:(0,s.jsxs)("svg",{className:"w-4 h-4 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:[(0,s.jsx)("rect",{x:"1",y:"4",width:"22",height:"16",rx:"2",ry:"2"}),(0,s.jsx)("line",{x1:"1",y1:"10",x2:"23",y2:"10"})]})},{key:"logs",label:ed("admin.tab.logs"),icon:(0,s.jsxs)("svg",{className:"w-4 h-4 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:[(0,s.jsx)("polyline",{points:"4 17 10 11 4 5"}),(0,s.jsx)("line",{x1:"12",y1:"19",x2:"20",y2:"19"})]})},{key:"settings",label:ed("admin.tab.settings"),icon:(0,s.jsxs)("svg",{className:"w-4 h-4 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:[(0,s.jsx)("circle",{cx:"12",cy:"12",r:"3"}),(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.4 15a1.65 1.65 0 00.33 1.82l.06.06a2 2 0 010 2.83 2 2 0 01-2.83 0l-.06-.06a1.65 1.65 0 00-1.82-.33 1.65 1.65 0 00-1 1.51V21a2 2 0 01-4 0v-.09A1.65 1.65 0 009 19.4a1.65 1.65 0 00-1.82.33l-.06.06a2 2 0 01-2.83-2.83l.06-.06A1.65 1.65 0 004.68 15a1.65 1.65 0 00-1.51-1H3a2 2 0 010-4h.09A1.65 1.65 0 004.6 9a1.65 1.65 0 00-.33-1.82l-.06-.06a2 2 0 012.83-2.83l.06.06A1.65 1.65 0 009 4.68a1.65 1.65 0 001-1.51V3a2 2 0 014 0v.09a1.65 1.65 0 001 1.51 1.65 1.65 0 001.82-.33l.06-.06a2 2 0 012.83 2.83l-.06.06A1.65 1.65 0 0019.4 9a1.65 1.65 0 001.51 1H21a2 2 0 010 4h-.09a1.65 1.65 0 00-1.51 1z"})]})},{key:"support",label:ed("admin.tab.support","Support"),icon:(0,s.jsx)("svg",{className:"w-4 h-4 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M18.364 5.636l-3.536 3.536m0 5.656l3.536 3.536M9.172 9.172L5.636 5.636m3.536 9.192l-3.536 3.536M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-5 0a4 4 0 11-8 0 4 4 0 018 0z"})})},{key:"push",label:ed("admin.tab.push","Push"),icon:(0,s.jsx)("svg",{className:"w-4 h-4 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 17h5l-1.4-1.4A2 2 0 0118 14.17V11a6 6 0 10-12 0v3.17a2 2 0 01-.6 1.43L4 17h5m6 0v1a3 3 0 11-6 0v-1m6 0H9"})})},{key:"backup",label:ed("admin.tab.backup","Backup"),icon:(0,s.jsx)("svg",{className:"w-4 h-4 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-8l-4-4m0 0L8 8m4-4v12"})})},{key:"translations",label:ed("admin.tab.translations","Translations"),icon:(0,s.jsx)("svg",{className:"w-4 h-4 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 5h12M9 3v2m1.048 9.5A18.022 18.022 0 016.412 9m6.088 9h7M11 21l5-10 5 10M12.751 5C11.783 10.77 8.07 15.61 3 18.129"})})},{key:"dbcheck",label:ed("admin.tab.dbcheck","DB check"),icon:(0,s.jsxs)("svg",{className:"w-4 h-4 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:[(0,s.jsx)("ellipse",{cx:"12",cy:"5",rx:"9",ry:"3"}),(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 12c0 1.66-4.03 3-9 3S3 13.66 3 12"}),(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 5v14c0 1.66 4.03 3 9 3s9-1.34 9-3V5"}),(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 12l2 2 4-4"})]})},{key:"referrals",label:ed("admin.tab.referrals","Referrals"),icon:(0,s.jsx)("svg",{className:"w-4 h-4 flex-shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0zm6 3a2 2 0 11-4 0 2 2 0 014 0zM7 10a2 2 0 11-4 0 2 2 0 014 0z"})})}],rn={open:"bg-green-100 text-green-700",in_progress:"bg-green-100 text-green-700",completed:"bg-gray-100 text-gray-600",cancelled:"bg-red-100 text-red-600",draft:"bg-yellow-100 text-yellow-700"},rr={pending:"bg-yellow-100 text-yellow-700",reviewed:"bg-green-100 text-green-700",dismissed:"bg-gray-100 text-gray-500"},ri={spam:"bg-green-100 text-green-700",inappropriate:"bg-red-100 text-red-700",fraud:"bg-purple-100 text-purple-700",duplicate:"bg-green-100 text-green-700",other:"bg-gray-100 text-gray-600"},ro=e=>{var t;return null!=(t=e.publicationStatus)?t:e.isActive?"active":"inactive"},rd=eY.filter(e=>"pending"===ro(e)),rc=eY.filter(e=>"active"===ro(e));return(0,s.jsx)("div",{className:"min-h-screen bg-gray-50",children:(0,s.jsxs)("div",{className:"max-w-7xl mx-auto px-4 py-8",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between mb-6",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsx)("svg",{className:"w-7 h-7 text-yellow-500",fill:"currentColor",viewBox:"0 0 24 24",children:(0,s.jsx)("path",{d:"M5 16L3 5l5.5 5L12 4l3.5 6L21 5l-2 11H5zm0 3a1 1 0 000 2h14a1 1 0 000-2H5z"})}),(0,s.jsx)("h1",{className:"text-2xl font-bold text-gray-900",children:ed("admin.title")})]}),(0,s.jsxs)(i(),{href:"/",className:"flex items-center gap-1.5 text-sm text-gray-500 hover:text-green-600 transition",children:[(0,s.jsx)("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 19l-7-7 7-7"})}),ed("admin.back_home")]})]}),(0,s.jsxs)("div",{className:"flex gap-6",children:[(0,s.jsx)("aside",{className:"shrink-0 transition-all duration-200 ".concat(eu?"w-12":"w-52"),children:(0,s.jsxs)("nav",{className:"bg-white rounded-xl border border-gray-200 overflow-hidden",children:[(0,s.jsx)("button",{type:"button",onClick:()=>eg(e=>!e),title:eu?"РазверМуть ЌеМю":"СверМуть ЌеМю",className:"w-full flex items-center justify-center py-2.5 text-gray-400 hover:text-gray-600 hover:bg-gray-50 border-b border-gray-100 transition",children:(0,s.jsx)("svg",{className:"w-4 h-4 transition-transform duration-200 ".concat(eu?"rotate-180":""),fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 19l-7-7 7-7"})})}),rl.map(e=>{let{key:t,label:a,icon:l,badge:n}=e;return(0,s.jsxs)("button",{onClick:()=>ex(t),title:eu?a:void 0,className:"w-full flex items-center py-3 text-sm font-medium text-left transition ".concat(em===t?"bg-green-50 text-green-700 border-r-2 border-green-600":"text-gray-600 hover:bg-gray-50 hover:text-gray-900"," ").concat(eu?"justify-center px-3":"gap-3 px-4"),children:[(0,s.jsx)("span",{className:"w-4 h-4 flex-shrink-0 flex items-center justify-center",children:l}),!eu&&(0,s.jsxs)("span",{className:"flex items-center gap-2 min-w-0",children:[(0,s.jsx)("span",{children:a}),n?(0,s.jsx)("span",{className:"ml-auto inline-flex min-w-5 h-5 items-center justify-center rounded-full bg-red-100 px-1.5 text-[11px] font-semibold text-red-700",children:n}):null]})]},t)})]})}),(0,s.jsxs)("div",{className:"flex-1 min-w-0",children:["stats"===em&&(0,s.jsxs)("div",{className:"space-y-6",children:[(0,s.jsx)("div",{className:"grid grid-cols-2 md:grid-cols-5 gap-4",children:[{label:ed("admin.stats.users"),value:null==ep?void 0:ep.userCount,icon:(0,s.jsx)("svg",{className:"w-8 h-8",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z"})}),color:"text-green-600"},{label:ed("admin.stats.specialists"),value:null==ep?void 0:ep.specialistCount,icon:(0,s.jsxs)("svg",{className:"w-8 h-8",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:[(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"}),(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"})]}),color:"text-purple-600"},{label:ed("admin.stats.tasks"),value:null==ep?void 0:ep.taskCount,icon:(0,s.jsx)("svg",{className:"w-8 h-8",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"})}),color:"text-green-600"},{label:ed("admin.stats.offers"),value:null==ep?void 0:ep.offerCount,icon:(0,s.jsx)("svg",{className:"w-8 h-8",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z"})}),color:"text-green-600"},{label:ed("admin.stats.reviews"),value:null==ep?void 0:ep.reviewCount,icon:(0,s.jsx)("svg",{className:"w-8 h-8",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11.049 2.927c.3-.921 1.603-.921 1.902 0l1.519 4.674a1 1 0 00.95.69h4.915c.969 0 1.371 1.24.588 1.81l-3.976 2.888a1 1 0 00-.363 1.118l1.518 4.674c.3.922-.755 1.688-1.538 1.118l-3.976-2.888a1 1 0 00-1.176 0l-3.976 2.888c-.783.57-1.838-.197-1.538-1.118l1.518-4.674a1 1 0 00-.363-1.118l-3.976-2.888c-.784-.57-.38-1.81.588-1.81h4.914a1 1 0 00.951-.69l1.519-4.674z"})}),color:"text-yellow-500"}].map(e=>{let{label:t,value:a,icon:l,color:n}=e;return(0,s.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 p-5",children:[(0,s.jsx)("div",{className:"mb-2 ".concat(n),children:l}),(0,s.jsx)("div",{className:"text-3xl font-bold ".concat(n),children:null!=a?a:"—"}),(0,s.jsx)("div",{className:"text-sm text-gray-500 mt-1",children:t})]},t)})}),(null==ep?void 0:ep.tasksByDay)&&(0,s.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 p-6",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,s.jsx)("h2",{className:"font-semibold text-gray-800",children:ed("admin.stats.activity_30d")}),(0,s.jsxs)("div",{className:"flex gap-4 text-xs text-gray-500",children:[(0,s.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,s.jsx)("span",{className:"w-3 h-0.5 bg-green-500 inline-block rounded"}),ed("admin.stats.users_label")]}),(0,s.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,s.jsx)("span",{className:"w-3 h-0.5 bg-purple-400 inline-block rounded"}),ed("admin.stats.specialists_label")]}),(0,s.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,s.jsx)("span",{className:"w-3 h-0.5 bg-green-500 inline-block rounded"}),ed("admin.stats.tasks_label")]})]})]}),(0,s.jsx)(U,{series:[{data:ep.usersByDay,color:"#3b82f6",fill:"#3b82f615",label:ed("admin.stats.users_label")},{data:ep.specialistsByDay,color:"#a855f7",fill:"#a855f710",label:ed("admin.stats.specialists_label")},{data:ep.tasksByDay,color:"#22c55e",fill:"#22c55e10",label:ed("admin.stats.tasks_label")}]})]}),(null==ep?void 0:ep.tasksByStatus)&&(0,s.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 p-6",children:[(0,s.jsx)("h2",{className:"font-semibold text-gray-800 mb-5",children:ed("admin.stats.tasks_by_status")}),(0,s.jsx)("div",{className:"space-y-3",children:(()=>{let e=ep.tasksByStatus.reduce((e,t)=>e+Number(t.count),0)||1,t={open:{label:ed("admin.task_status.open"),bg:"bg-green-50",bar:"bg-green-500"},in_progress:{label:ed("admin.task_status.in_progress"),bg:"bg-green-50",bar:"bg-green-500"},completed:{label:ed("admin.task_status.completed"),bg:"bg-gray-50",bar:"bg-gray-400"},cancelled:{label:ed("admin.task_status.cancelled"),bg:"bg-red-50",bar:"bg-red-400"},draft:{label:ed("admin.task_status.draft"),bg:"bg-yellow-50",bar:"bg-yellow-400"}},a=["open","in_progress","completed","draft","cancelled"];return[...ep.tasksByStatus].sort((e,t)=>a.indexOf(e.status)-a.indexOf(t.status)).map(a=>{var l;let{status:n,count:r}=a,i=null!=(l=t[n])?l:{label:n,bg:"bg-gray-50",bar:"bg-gray-300"},o=Math.round(Number(r)/e*100);return(0,s.jsxs)("div",{className:"flex items-center gap-3 px-3 py-2 rounded-lg ".concat(i.bg),children:[(0,s.jsx)("span",{className:"text-sm text-gray-600 w-28 shrink-0",children:i.label}),(0,s.jsx)("div",{className:"flex-1 bg-gray-200 rounded-full h-2 overflow-hidden",children:(0,s.jsx)("div",{className:"h-full rounded-full ".concat(i.bar," transition-all"),style:{width:"".concat(o,"%")}})}),(0,s.jsx)("span",{className:"text-sm font-semibold text-gray-700 w-8 text-right",children:r}),(0,s.jsxs)("span",{className:"text-xs text-gray-400 w-8",children:[o,"%"]})]},n)})})()})]}),as.length>0&&(0,s.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 p-6",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,s.jsx)("h2",{className:"font-semibold text-gray-800",children:ed("admin.stats.notif_chart_title")}),(0,s.jsxs)("span",{className:"flex items-center gap-1.5 text-xs text-gray-500",children:[(0,s.jsx)("span",{className:"w-3 h-0.5 bg-orange-500 inline-block rounded"}),ed("admin.stats.notif_label")]})]}),(0,s.jsx)(U,{series:[{data:as,color:"#f97316",fill:"#f9731615",label:ed("admin.stats.notif_label")}]})]}),an.length>0&&(0,s.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 p-6",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,s.jsx)("h2",{className:"font-semibold text-gray-800",children:ed("admin.stats.mail_chart_title")}),(0,s.jsxs)("span",{className:"flex items-center gap-1.5 text-xs text-gray-500",children:[(0,s.jsx)("span",{className:"w-3 h-0.5 bg-sky-500 inline-block rounded"}),ed("admin.stats.mail_label")]})]}),(0,s.jsx)(U,{series:[{data:an,color:"#0ea5e9",fill:"#0ea5e915",label:ed("admin.stats.mail_label")}]})]}),ep&&(0,s.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 p-6 space-y-5",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsx)("h2",{className:"font-semibold text-gray-800",children:ed("admin.stats.tokens_title")}),(0,s.jsxs)("div",{className:"flex gap-4 text-xs text-gray-500",children:[(0,s.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,s.jsx)("span",{className:"w-3 h-0.5 bg-violet-500 inline-block rounded"}),ed("admin.stats.tokens_out")]}),(0,s.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,s.jsx)("span",{className:"w-3 h-0.5 bg-sky-500 inline-block rounded"}),ed("admin.stats.tokens_in")]})]})]}),(0,s.jsxs)("div",{className:"grid grid-cols-3 gap-4",children:[(0,s.jsxs)("div",{className:"rounded-lg bg-violet-50 border border-violet-100 px-4 py-3",children:[(0,s.jsx)("div",{className:"text-xs text-violet-600 mb-1",children:ed("admin.stats.tokens_out_label")}),(0,s.jsx)("div",{className:"text-2xl font-bold text-violet-700",children:Number(ep.totalOutputTokens).toLocaleString()})]}),(0,s.jsxs)("div",{className:"rounded-lg bg-sky-50 border border-sky-100 px-4 py-3",children:[(0,s.jsx)("div",{className:"text-xs text-sky-600 mb-1",children:ed("admin.stats.tokens_in_label")}),(0,s.jsx)("div",{className:"text-2xl font-bold text-sky-700",children:Number(ep.totalInputTokens).toLocaleString()})]}),(0,s.jsxs)("div",{className:"rounded-lg bg-emerald-50 border border-emerald-100 px-4 py-3",children:[(0,s.jsx)("div",{className:"text-xs text-emerald-600 mb-1",children:ed("admin.stats.cost_label")}),(0,s.jsxs)("div",{className:"text-2xl font-bold text-emerald-700",children:["$",Number(null!=(a=ep.totalCostUsd)?a:0).toFixed(4)]})]})]}),(null==(t=ep.tokensByMonth)?void 0:t.length)>0&&(0,s.jsx)(B,{dateLocale:rs,series:[{data:ep.tokensByMonth.map(e=>({month:e.month,count:Number(e.output)})),color:"#8b5cf6",fill:"#8b5cf610",label:ed("admin.stats.tokens_out_label")},{data:ep.tokensByMonth.map(e=>({month:e.month,count:Number(e.input)})),color:"#0ea5e9",fill:"#0ea5e915",label:ed("admin.stats.tokens_in_label")}]})]})]}),"users"===em&&(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"flex gap-3 mb-4",children:[(0,s.jsxs)("form",{className:"flex gap-2 flex-1",onSubmit:e=>{e.preventDefault(),ew(eC)},children:[(0,s.jsx)("input",{value:eC,onChange:e=>e_(e.target.value),placeholder:ed("admin.users.search.placeholder"),className:"flex-1 border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400"}),(0,s.jsx)("button",{type:"submit",className:"px-4 py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700",children:ed("tasks.search.btn")})]}),(0,s.jsxs)("select",{value:eS,onChange:e=>eL(e.target.value),className:"border border-gray-300 rounded-lg px-3 py-2 text-sm",children:[(0,s.jsx)("option",{value:"",children:ed("admin.filter.all_roles")}),(0,s.jsx)("option",{value:"user",children:ed("admin.user_edit.role.user")}),(0,s.jsx)("option",{value:"admin",children:ed("profile.role.admin")})]})]}),(0,s.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 overflow-hidden",children:[(0,s.jsxs)("table",{className:"w-full text-sm",children:[(0,s.jsx)("thead",{className:"bg-gray-50 text-left",children:(0,s.jsxs)("tr",{children:[(0,s.jsx)("th",{className:"px-4 py-3 font-medium text-gray-600",children:ed("admin.col.user")}),(0,s.jsx)("th",{className:"px-4 py-3 font-medium text-gray-600",children:ed("admin.col.email")}),(0,s.jsx)("th",{className:"px-4 py-3 font-medium text-gray-600",children:ed("admin.col.role")}),(0,s.jsx)("th",{className:"px-4 py-3 font-medium text-gray-600",children:ed("admin.col.plan","Plan")}),(0,s.jsx)("th",{className:"px-4 py-3 font-medium text-gray-600",children:ed("admin.col.registered")}),(0,s.jsx)("th",{className:"px-4 py-3 font-medium text-gray-600",children:ed("admin.col.status")}),(0,s.jsx)("th",{className:"px-4 py-3"})]})}),(0,s.jsx)("tbody",{className:"divide-y divide-gray-100",children:nE?(0,s.jsx)("tr",{children:(0,s.jsx)("td",{colSpan:6,className:"px-4 py-8 text-center text-gray-400",children:ed("common.loading")})}):0===eb.length?(0,s.jsx)("tr",{children:(0,s.jsx)("td",{colSpan:6,className:"px-4 py-8 text-center text-gray-400",children:"—"})}):eb.map(e=>{var t,a;return(0,s.jsxs)("tr",{className:"hover:bg-gray-50",children:[(0,s.jsx)("td",{className:"px-4 py-3 font-medium text-gray-800",children:(0,m.H)(e.firstName,e.lastName,e.name)}),(0,s.jsx)("td",{className:"px-4 py-3 text-gray-500",children:e.email}),(0,s.jsx)("td",{className:"px-4 py-3",children:(0,s.jsx)("span",{className:"px-2 py-0.5 rounded-full text-xs font-medium ".concat("admin"===e.role?"bg-red-100 text-red-700":"specialist"===e.role?"bg-green-100 text-green-700":"bg-gray-100 text-gray-600"),children:ed("profile.role.".concat(e.role))||e.role})}),(0,s.jsx)("td",{className:"px-4 py-3 text-gray-400 text-xs",children:e.planId?null!=(a=null==(t=aK.find(t=>t.id===e.planId))?void 0:t.name)?a:(0,s.jsxs)("span",{className:"font-mono",children:[e.planId.slice(0,8),"
"]}):(0,s.jsx)("span",{className:"text-gray-300",children:"—"})}),(0,s.jsx)("td",{className:"px-4 py-3 text-gray-400",children:new Date(e.createdAt).toLocaleDateString(rs)}),(0,s.jsx)("td",{className:"px-4 py-3",children:(0,s.jsx)("span",{className:"px-2 py-0.5 rounded-full text-xs font-medium ".concat(!1!==e.isActive?"bg-green-100 text-green-700":"bg-red-100 text-red-600"),children:!1!==e.isActive?ed("admin.users.active"):ed("admin.users.inactive")})}),(0,s.jsx)("td",{className:"px-4 py-3 text-right",children:(0,s.jsxs)("div",{className:"flex items-center justify-end gap-1.5",children:[(0,s.jsx)("button",{onClick:()=>{aL("profile"),aA(""),aD(null),aT([]),aW({}),az({}),aH({}),aO({}),aN({...e,topUpAmount:"",topUpDescription:"",withdrawAmount:"",withdrawDescription:""}),c.jd(e.id).then(e=>aN(t=>t&&t.id===e.id?{...e,topUpAmount:"",topUpDescription:"",withdrawAmount:"",withdrawDescription:""}:t)).catch(()=>{})},className:"text-xs px-2.5 py-1 rounded-lg font-medium bg-gray-50 text-gray-600 hover:bg-gray-100 border border-gray-200",children:(0,s.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"})})}),"admin"!==e.role&&(0,s.jsx)("button",{onClick:()=>nB(e.id,!1!==e.isActive),className:"text-xs px-3 py-1 rounded-lg font-medium ".concat(!1!==e.isActive?"bg-red-50 text-red-600 hover:bg-red-100":"bg-green-50 text-green-600 hover:bg-green-100"),children:!1!==e.isActive?ed("admin.users.deactivate"):ed("admin.users.activate")})]})})]},e.id)})})]}),(0,s.jsx)(E,{page:ey,total:ej,limit:20,onChange:ev,totalLabel:ed("admin.pagination.total")})]})]}),"balances"===em&&(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"flex flex-wrap gap-3 mb-4",children:[(0,s.jsx)("input",{value:au,onChange:e=>ag(e.target.value),placeholder:ed("admin.balance.filter.user_id","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,s.jsxs)("select",{value:ap,onChange:e=>ah(e.target.value),className:"border border-gray-300 rounded-lg px-3 py-2 text-sm",children:[(0,s.jsx)("option",{value:"",children:ed("admin.balance.filter.all","All operations")}),(0,s.jsx)("option",{value:"topup",children:ed("admin.balance.kind.topup","Top-up")}),(0,s.jsx)("option",{value:"plan_purchase",children:ed("admin.balance.kind.plan_purchase","Plan charge")}),(0,s.jsx)("option",{value:"admin_topup",children:ed("admin.balance.kind.admin_topup","Admin top-up")}),(0,s.jsx)("option",{value:"admin_adjustment",children:ed("admin.balance.kind.admin_adjustment","Adjustment")})]})]}),(0,s.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 overflow-hidden",children:[(0,s.jsxs)("table",{className:"w-full text-sm",children:[(0,s.jsx)("thead",{className:"bg-gray-50 text-left",children:(0,s.jsxs)("tr",{children:[(0,s.jsx)("th",{className:"px-4 py-3 font-medium text-gray-600",children:ed("admin.col.user")}),(0,s.jsx)("th",{className:"px-4 py-3 font-medium text-gray-600",children:ed("admin.balance.col.operation","Operation")}),(0,s.jsx)("th",{className:"px-4 py-3 font-medium text-gray-600",children:ed("admin.balance.col.amount","Amount")}),(0,s.jsx)("th",{className:"px-4 py-3 font-medium text-gray-600",children:ed("admin.balance.col.result","Balance")}),(0,s.jsx)("th",{className:"px-4 py-3 font-medium text-gray-600",children:ed("admin.balance.col.description","Description")}),(0,s.jsx)("th",{className:"px-4 py-3 font-medium text-gray-600",children:ed("admin.balance.col.date","Date")})]})}),(0,s.jsx)("tbody",{className:"divide-y divide-gray-100",children:nE?(0,s.jsx)("tr",{children:(0,s.jsx)("td",{colSpan:6,className:"px-4 py-8 text-center text-gray-400",children:ed("common.loading")})}):0===ai.length?(0,s.jsx)("tr",{children:(0,s.jsx)("td",{colSpan:6,className:"px-4 py-8 text-center text-gray-400",children:ed("admin.balance.empty","No records yet")})}):ai.map(e=>{let t="credit"===e.direction,a="topup"===e.kind?ed("admin.balance.kind.topup","Top-up"):"plan_purchase"===e.kind?ed("admin.balance.kind.plan_purchase","Plan charge"):"admin_topup"===e.kind?ed("admin.balance.kind.admin_topup","Admin top-up"):ed("admin.balance.kind.admin_adjustment","Adjustment");return(0,s.jsxs)("tr",{className:"hover:bg-gray-50 align-top",children:[(0,s.jsxs)("td",{className:"px-4 py-3",children:[(0,s.jsx)("div",{className:"font-medium text-gray-800",children:e.userName||"—"}),(0,s.jsx)("div",{className:"text-xs text-gray-500 mt-0.5",children:e.userEmail||e.userId})]}),(0,s.jsx)("td",{className:"px-4 py-3",children:(0,s.jsx)("span",{className:"inline-flex rounded-full px-2 py-0.5 text-xs font-medium ".concat(t?"bg-emerald-50 text-emerald-700":"bg-rose-50 text-rose-700"),children:a})}),(0,s.jsxs)("td",{className:"px-4 py-3 font-semibold ".concat(t?"text-emerald-700":"text-rose-700"),children:[t?"+":"-",Number(e.amount).toFixed(2)," ",e.currency]}),(0,s.jsx)("td",{className:"px-4 py-3 text-gray-600",children:(0,s.jsxs)("div",{children:[Number(e.balanceBefore).toFixed(2)," → ",Number(e.balanceAfter).toFixed(2)," ",e.currency]})}),(0,s.jsx)("td",{className:"px-4 py-3 text-gray-500 max-w-sm",children:e.description||"—"}),(0,s.jsx)("td",{className:"px-4 py-3 text-gray-500 whitespace-nowrap",children:new Date(e.createdAt).toLocaleString(rs)})]},e.id)})})]}),(0,s.jsx)(E,{page:am,total:ad,limit:50,onChange:ax,totalLabel:ed("admin.pagination.total")})]})]}),"tasks"===em&&(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"flex gap-3 mb-4",children:[(0,s.jsxs)("form",{className:"flex gap-2 flex-1",onSubmit:e=>{e.preventDefault(),eU(eR)},children:[(0,s.jsx)("input",{value:eR,onChange:e=>eW(e.target.value),placeholder:ed("admin.tasks.search.placeholder"),className:"flex-1 border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400"}),(0,s.jsx)("button",{type:"submit",className:"px-4 py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700",children:ed("tasks.search.btn")})]}),(0,s.jsxs)("select",{value:eP,onChange:e=>ez(e.target.value),className:"border border-gray-300 rounded-lg px-3 py-2 text-sm",children:[(0,s.jsx)("option",{value:"",children:ed("admin.filter.all_statuses")}),["open","in_progress","completed","cancelled","draft"].map(e=>(0,s.jsx)("option",{value:e,children:ed("task.status.".concat(e),e)},e))]})]}),(0,s.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 overflow-hidden",children:[(0,s.jsxs)("table",{className:"w-full text-sm",children:[(0,s.jsx)("thead",{className:"bg-gray-50 text-left",children:(0,s.jsxs)("tr",{children:[(0,s.jsx)("th",{className:"px-4 py-3 font-medium text-gray-600",children:ed("admin.col.title")}),(0,s.jsx)("th",{className:"px-4 py-3 font-medium text-gray-600",children:ed("admin.col.customer")}),(0,s.jsx)("th",{className:"px-4 py-3 font-medium text-gray-600",children:ed("admin.col.status")}),(0,s.jsx)("th",{className:"px-4 py-3 font-medium text-gray-600",children:ed("admin.col.budget")}),(0,s.jsx)("th",{className:"px-4 py-3 font-medium text-gray-600",children:ed("admin.col.created")}),(0,s.jsx)("th",{className:"px-4 py-3"})]})}),(0,s.jsx)("tbody",{className:"divide-y divide-gray-100",children:nE?(0,s.jsx)("tr",{children:(0,s.jsx)("td",{colSpan:6,className:"px-4 py-8 text-center text-gray-400",children:ed("common.loading")})}):0===eE.length?(0,s.jsx)("tr",{children:(0,s.jsx)("td",{colSpan:6,className:"px-4 py-8 text-center text-gray-400",children:"—"})}):eE.map(e=>{var t,a;let l=e.task||e,n=e.customer;return(0,s.jsxs)("tr",{className:"hover:bg-gray-50",children:[(0,s.jsx)("td",{className:"px-4 py-3 font-medium text-gray-800 max-w-xs",children:(0,s.jsx)(i(),{href:"/tasks/".concat(l.id),className:"hover:text-green-600 truncate block",target:"_blank",children:"en"===ec&&l.titleEn||"ru"===ec&&l.titleRu||"uk"===ec&&l.titleUk||l.titleEl||l.title})}),(0,s.jsx)("td",{className:"px-4 py-3 text-gray-500 text-xs",children:null!=(t=null==n?void 0:n.name)?t:"—"}),(0,s.jsx)("td",{className:"px-4 py-3",children:(0,s.jsx)("span",{className:"px-2 py-0.5 rounded-full text-xs font-medium ".concat(null!=(a=rn[l.status])?a:"bg-gray-100 text-gray-600"),children:ed("task.status.".concat(l.status),l.status)})}),(0,s.jsx)("td",{className:"px-4 py-3 text-gray-500",children:l.budget?"".concat((0,x.$g)(l.budget),"€"):"—"}),(0,s.jsx)("td",{className:"px-4 py-3 text-gray-400",children:new Date(l.createdAt).toLocaleDateString(rs)}),(0,s.jsx)("td",{className:"px-4 py-3 text-right",children:(0,s.jsxs)("div",{className:"flex gap-1.5 justify-end",children:["cancelled"!==l.status&&"completed"!==l.status&&(0,s.jsx)("button",{onClick:()=>nF(l.id),className:"text-xs px-2.5 py-1 rounded-lg font-medium bg-yellow-50 text-yellow-700 hover:bg-yellow-100",children:ed("admin.tasks.cancel")}),(0,s.jsx)("button",{onClick:()=>nH(l.id,"en"===ec&&l.titleEn||"ru"===ec&&l.titleRu||"uk"===ec&&l.titleUk||l.titleEl||l.title),className:"text-xs px-2.5 py-1 rounded-lg font-medium bg-red-50 text-red-600 hover:bg-red-100",children:ed("admin.tasks.delete")})]})})]},l.id)})})]}),(0,s.jsx)(E,{page:eM,total:eB,limit:20,onChange:eA,totalLabel:ed("admin.pagination.total")})]})]}),"categories"===em&&(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,s.jsx)("p",{className:"text-sm text-gray-500",children:ed("admin.cat.hint")}),(0,s.jsxs)("button",{onClick:()=>nG(null),className:"px-4 py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700",children:["+ ",ed("admin.cat.add_root")]})]}),a7&&(0,s.jsxs)("div",{className:"bg-green-50 border border-green-200 rounded-xl p-5 mb-4",children:[(0,s.jsxs)("h3",{className:"font-semibold text-gray-800 mb-4",children:[a7.id?ed("admin.cat.edit"):ed("admin.cat.new"),a7.parentId&&(0,s.jsxs)("span",{className:"text-xs text-gray-400 ml-2",children:["(",ed("admin.cat.subcategory"),")"]})]}),(0,s.jsxs)("div",{className:"grid grid-cols-2 md:grid-cols-3 gap-3 mb-3",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:ed("admin.cat.slug")}),(0,s.jsx)("input",{value:a7.slug,onChange:e=>a8(t=>t&&{...t,slug:e.target.value}),className:"w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm",placeholder:"e.g. repairs"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:ed("admin.cat.icon")}),(0,s.jsx)(y,{value:a7.icon,onChange:e=>a8(t=>t&&{...t,icon:e}),onUpload:nX,uploading:ss,error:sn,presets:si})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:ed("admin.cat.order")}),(0,s.jsx)("input",{type:"number",value:a7.order,onChange:e=>a8(t=>t&&{...t,order:Number(e.target.value)}),className:"w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm"})]}),(0,s.jsxs)("div",{children:[(0,s.jsxs)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:[ed("admin.cat.name_el")," \uD83C\uDDEC\uD83C\uDDF7"]}),(0,s.jsx)("input",{value:a7.namesEl,onChange:e=>a8(t=>t&&{...t,namesEl:e.target.value}),className:"w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm"})]}),(0,s.jsxs)("div",{children:[(0,s.jsxs)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:[ed("admin.cat.name_en")," \uD83C\uDDEC\uD83C\uDDE7"]}),(0,s.jsx)("input",{value:a7.namesEn,onChange:e=>a8(t=>t&&{...t,namesEn:e.target.value}),className:"w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm"})]}),(0,s.jsxs)("div",{children:[(0,s.jsxs)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:[ed("admin.cat.name_ru")," \uD83C\uDDF7\uD83C\uDDFA"]}),(0,s.jsx)("input",{value:a7.namesRu,onChange:e=>a8(t=>t&&{...t,namesRu:e.target.value}),className:"w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm"})]}),(0,s.jsxs)("div",{children:[(0,s.jsxs)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:[ed("admin.cat.name_uk")," \uD83C\uDDFA\uD83C\uDDE6"]}),(0,s.jsx)("input",{value:a7.namesUk,onChange:e=>a8(t=>t&&{...t,namesUk:e.target.value}),className:"w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm"})]})]}),a7.id&&(0,s.jsxs)("label",{className:"flex items-center gap-2 text-sm text-gray-700 mb-3",children:[(0,s.jsx)("input",{type:"checkbox",checked:a7.isActive,onChange:e=>a8(t=>t&&{...t,isActive:e.target.checked})}),ed("admin.cat.active")]}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)("button",{onClick:nY,disabled:a9,className:"px-4 py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700 disabled:opacity-50",children:a9?ed("common.saving"):ed("common.save")}),(0,s.jsx)("button",{onClick:()=>a8(null),className:"px-4 py-2 bg-white border border-gray-300 text-gray-700 rounded-lg text-sm font-medium hover:bg-gray-50",children:ed("common.cancel")})]})]}),(0,s.jsx)("div",{className:"bg-white rounded-xl border border-gray-200 divide-y divide-gray-100",children:0===a3.length?(0,s.jsx)("div",{className:"px-4 py-8 text-center text-gray-400",children:ed("admin.cat.empty")}):(0,s.jsx)(C,{rows:a3,parentId:null,depth:0,locale:ec,expanded:st,onToggle:function(e){sa(t=>{let a=new Set(t);return a.has(e)?a.delete(e):a.add(e),a})},onEdit:function(e){var t,a,s,l,n,r,i,o,d,c,m,x,u,g,p;let h="string"==typeof e.icon?e.icon:"",b=new Set(si.map(e=>e.value)),f=h.startsWith("/category-icons/")&&!b.has(h)?"/category-icons/package.svg":h||"/category-icons/package.svg";sr(null),a8({id:e.id,parentId:null!=(n=e.parentId)?n:null,slug:e.slug,icon:f,namesEl:null!=(i=null!=(r=e.namesEl)?r:null==(t=e.names)?void 0:t.el)?i:"",namesEn:null!=(d=null!=(o=e.namesEn)?o:null==(a=e.names)?void 0:a.en)?d:"",namesRu:null!=(m=null!=(c=e.namesRu)?c:null==(s=e.names)?void 0:s.ru)?m:"",namesUk:null!=(u=null!=(x=e.namesUk)?x:null==(l=e.names)?void 0:l.uk)?u:"",order:null!=(g=e.order)?g:0,isActive:null==(p=e.isActive)||p})},onDelete:nJ,onAddChild:nG,skillsExpanded:sd,skillsCache:sm,skillsLoading:su,onToggleSkills:n$,skillForm:sp,skillSaving:sb,onOpenAddSkill:function(e){sh({catSlug:e,nameEl:"",nameEn:"",nameRu:"",nameUk:"",order:0})},onOpenEditSkill:function(e,t){var a,s,l,n,r;sh({id:e.id,catSlug:t,nameEl:null!=(a=e.nameEl)?a:"",nameEn:null!=(s=e.nameEn)?s:"",nameRu:null!=(l=e.nameRu)?l:"",nameUk:null!=(n=e.nameUk)?n:"",order:null!=(r=e.order)?r:0})},onSaveSkill:nQ,onDeleteSkill:nZ,onCancelSkillForm:()=>sh(null),onSkillFormChange:sh,t:ed})})]}),"locations"===em&&(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,s.jsx)("p",{className:"text-sm text-gray-500",children:ed("admin.loc.hint")}),(0,s.jsxs)("button",{onClick:()=>nO(null),className:"px-4 py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700",children:["+ ",ed("admin.loc.add_city")]})]}),aZ&&(0,s.jsxs)("div",{className:"bg-green-50 border border-green-200 rounded-xl p-5 mb-4",children:[(0,s.jsxs)("h3",{className:"font-semibold text-gray-800 mb-4",children:[aZ.id?ed("admin.loc.edit"):ed("admin.loc.new"),aZ.parentId&&(0,s.jsxs)("span",{className:"text-xs text-gray-400 ml-2",children:["(",ed("admin.loc.district"),")"]})]}),(0,s.jsxs)("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-3 mb-3",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:ed("admin.cat.slug")}),(0,s.jsx)("input",{value:aZ.slug,onChange:e=>a0(t=>t&&{...t,slug:e.target.value}),className:"w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm",placeholder:"e.g. athens-center"})]}),(0,s.jsxs)("div",{children:[(0,s.jsxs)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:[ed("admin.cat.name_el")," \uD83C\uDDEC\uD83C\uDDF7"]}),(0,s.jsx)("input",{value:aZ.nameEl,onChange:e=>a0(t=>t&&{...t,nameEl:e.target.value}),className:"w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm"})]}),(0,s.jsxs)("div",{children:[(0,s.jsxs)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:[ed("admin.cat.name_en")," \uD83C\uDDEC\uD83C\uDDE7"]}),(0,s.jsx)("input",{value:aZ.nameEn,onChange:e=>a0(t=>t&&{...t,nameEn:e.target.value}),className:"w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm"})]}),(0,s.jsxs)("div",{children:[(0,s.jsxs)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:[ed("admin.cat.name_ru")," \uD83C\uDDF7\uD83C\uDDFA"]}),(0,s.jsx)("input",{value:aZ.nameRu,onChange:e=>a0(t=>t&&{...t,nameRu:e.target.value}),className:"w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm"})]}),(0,s.jsxs)("div",{children:[(0,s.jsxs)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:[ed("admin.cat.name_uk")," \uD83C\uDDFA\uD83C\uDDE6"]}),(0,s.jsx)("input",{value:aZ.nameUk,onChange:e=>a0(t=>t&&{...t,nameUk:e.target.value}),className:"w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm"})]})]}),(0,s.jsxs)("div",{className:"flex items-center gap-4 mb-3",children:[(0,s.jsxs)("div",{className:"w-24",children:[(0,s.jsx)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:ed("admin.cat.order")}),(0,s.jsx)("input",{type:"number",value:aZ.order,onChange:e=>a0(t=>t&&{...t,order:Number(e.target.value)}),className:"w-full border border-gray-300 rounded-lg px-3 py-1.5 text-sm"})]}),aZ.id&&(0,s.jsxs)("label",{className:"flex items-center gap-2 text-sm text-gray-700 mt-4",children:[(0,s.jsx)("input",{type:"checkbox",checked:aZ.isActive,onChange:e=>a0(t=>t&&{...t,isActive:e.target.checked})}),ed("admin.cat.active")]})]}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)("button",{onClick:nK,disabled:a1,className:"px-4 py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700 disabled:opacity-50",children:a1?ed("common.saving"):ed("common.save")}),(0,s.jsx)("button",{onClick:()=>a0(null),className:"px-4 py-2 bg-white border border-gray-300 text-gray-700 rounded-lg text-sm font-medium hover:bg-gray-50",children:ed("common.cancel")})]})]}),(0,s.jsx)("div",{className:"bg-white rounded-xl border border-gray-200 divide-y divide-gray-100",children:0===a$.length?(0,s.jsx)("div",{className:"px-4 py-8 text-center text-gray-400",children:ed("admin.loc.empty")}):(0,s.jsx)(w,{rows:a$,parentId:null,depth:0,locale:ec,expanded:a4,onToggle:function(e){a5(t=>{let a=new Set(t);return a.has(e)?a.delete(e):a.add(e),a})},onEdit:function(e){var t,a,s,l,n,r,i,o,d,c,m,x,u,g,p;a0({id:e.id,parentId:null!=(n=e.parentId)?n:null,slug:e.slug,nameEl:null!=(i=null!=(r=e.nameEl)?r:null==(t=e.names)?void 0:t.el)?i:"",nameEn:null!=(d=null!=(o=e.nameEn)?o:null==(a=e.names)?void 0:a.en)?d:"",nameRu:null!=(m=null!=(c=e.nameRu)?c:null==(s=e.names)?void 0:s.ru)?m:"",nameUk:null!=(u=null!=(x=e.nameUk)?x:null==(l=e.names)?void 0:l.uk)?u:"",order:null!=(g=e.order)?g:0,isActive:null==(p=e.isActive)||p})},onDelete:nq,onAddChild:nO,t:ed})})]}),"reports"===em&&(0,s.jsxs)("div",{className:"space-y-3",children:[nE?(0,s.jsx)("div",{className:"text-center py-10 text-gray-400",children:ed("common.loading")}):0===eF.length?(0,s.jsx)("div",{className:"text-center py-10 text-gray-400",children:ed("admin.reports.none")}):eF.map(e=>{var t,a,l;return(0,s.jsx)("div",{className:"bg-white rounded-xl border border-gray-200 p-5",children:(0,s.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,s.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 flex-wrap mb-2",children:[(0,s.jsx)("span",{className:"px-2 py-0.5 rounded-full text-xs font-medium ".concat(null!=(a=rr[e.status])?a:"bg-gray-100 text-gray-500"),children:e.status}),(0,s.jsx)("span",{className:"px-2 py-0.5 rounded-full text-xs font-medium ".concat(null!=(l=ri[e.reason])?l:"bg-gray-100 text-gray-600"),children:e.reason}),(0,s.jsxs)("span",{className:"text-xs text-gray-400",children:["task"===e.targetType?ed("admin.reports.target.task"):ed("admin.reports.target.user"),":"," ",e.targetTitle?(0,s.jsx)(i(),{href:"task"===e.targetType?"/tasks/".concat(e.targetId):"/users/".concat(e.targetId),className:"text-green-600 hover:underline font-medium",target:"_blank",children:e.targetTitle}):(0,s.jsxs)("span",{className:"font-mono",children:["#",null==(t=e.targetId)?void 0:t.slice(0,8)]})]})]}),e.reporterName&&(0,s.jsxs)("p",{className:"text-xs text-gray-400 mb-1",children:[ed("admin.col.reporter"),": ",(0,s.jsx)("span",{className:"font-medium text-gray-600",children:e.reporterName})]}),e.description&&(0,s.jsx)("p",{className:"text-sm text-gray-700",children:e.description}),(0,s.jsx)("p",{className:"text-xs text-gray-400 mt-1.5",children:new Date(e.createdAt).toLocaleString(rs)})]}),"pending"===e.status&&(0,s.jsxs)("div",{className:"flex gap-2 flex-shrink-0",children:[(0,s.jsx)("button",{onClick:()=>nV(e.id,"reviewed"),className:"text-xs px-3 py-1.5 rounded-lg font-medium bg-green-50 text-green-700 hover:bg-green-100",children:ed("admin.reports.reviewed")}),(0,s.jsx)("button",{onClick:()=>nV(e.id,"dismissed"),className:"text-xs px-3 py-1.5 rounded-lg font-medium bg-gray-100 text-gray-600 hover:bg-gray-200",children:ed("admin.reports.dismiss")})]})]})},e.id)}),(0,s.jsx)(E,{page:eV,total:eK,limit:20,onChange:eO,totalLabel:ed("admin.pagination.total")})]}),"moderation"===em&&(0,s.jsxs)("div",{className:"space-y-6",children:[(0,s.jsxs)("div",{className:"grid md:grid-cols-2 gap-4",children:[(0,s.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 p-5",children:[(0,s.jsx)("div",{className:"text-sm text-gray-500",children:ed("admin.moderation.pending_count","Pending")}),(0,s.jsx)("div",{className:"text-3xl font-bold text-gray-900 mt-1",children:rd.length}),(0,s.jsx)("div",{className:"text-xs text-gray-400 mt-1",children:ed("admin.moderation.pending_hint","New proposals waiting for approval")})]}),(0,s.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 p-5",children:[(0,s.jsx)("div",{className:"text-sm text-gray-500",children:ed("admin.moderation.active_count","Active")}),(0,s.jsx)("div",{className:"text-3xl font-bold text-gray-900 mt-1",children:rc.length}),(0,s.jsx)("div",{className:"text-xs text-gray-400 mt-1",children:ed("admin.moderation.active_hint","Visible cards that can be blocked")})]})]}),e1?(0,s.jsx)("div",{className:"text-center py-10 text-gray-400",children:ed("common.loading")}):0===eY.length?(0,s.jsx)("div",{className:"text-center py-10 text-gray-400",children:ed("admin.moderation.none","No specialist cards found")}):(0,s.jsxs)("div",{className:"space-y-6",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h3",{className:"font-semibold text-gray-800 mb-3",children:ed("admin.moderation.pending_title","Pending approval")}),(0,s.jsx)("div",{className:"space-y-3",children:0===rd.length?(0,s.jsx)("div",{className:"text-sm text-gray-400 bg-white border border-dashed border-gray-200 rounded-xl p-4",children:ed("admin.moderation.pending_empty","No pending proposals right now")}):rd.map(e=>{var t,a;return(0,s.jsx)("div",{className:"bg-white rounded-xl border border-gray-200 p-4",children:(0,s.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 flex-wrap mb-1",children:[(0,s.jsx)("span",{className:"px-2 py-0.5 rounded-full text-xs font-medium bg-yellow-100 text-yellow-700",children:ed("admin.moderation.pending","Pending")}),(0,s.jsx)("span",{className:"text-sm font-semibold text-gray-800 truncate",children:e.title})]}),(0,s.jsx)("div",{className:"text-xs text-gray-500 mb-2",children:(0,s.jsx)(i(),{href:"/users/".concat(e.specialistId),className:"hover:text-green-600 hover:underline font-medium",children:null!=(a=null!=(t=e.specialistName)?t:e.specialistEmail)?a:e.specialistId})}),e.description&&(0,s.jsx)("p",{className:"text-sm text-gray-700 line-clamp-3",children:e.description})]}),(0,s.jsxs)("div",{className:"flex gap-2 flex-shrink-0",children:[(0,s.jsx)("button",{onClick:()=>nz(e.id,"active"),className:"px-3 py-1.5 rounded-lg text-xs font-medium bg-green-600 text-white hover:bg-green-700",children:ed("admin.moderation.approve","Approve")}),(0,s.jsx)("button",{onClick:()=>nz(e.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:ed("admin.moderation.block","Block")})]})]})},e.id)})})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("h3",{className:"font-semibold text-gray-800 mb-3",children:ed("admin.moderation.active_title","Active cards")}),(0,s.jsx)("div",{className:"space-y-3",children:0===rc.length?(0,s.jsx)("div",{className:"text-sm text-gray-400 bg-white border border-dashed border-gray-200 rounded-xl p-4",children:ed("admin.moderation.active_empty","No active cards found")}):rc.map(e=>{var t,a;return(0,s.jsx)("div",{className:"bg-white rounded-xl border border-gray-200 p-4",children:(0,s.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 flex-wrap mb-1",children:[(0,s.jsx)("span",{className:"px-2 py-0.5 rounded-full text-xs font-medium bg-green-100 text-green-700",children:ed("admin.moderation.active","Active")}),(0,s.jsx)("span",{className:"text-sm font-semibold text-gray-800 truncate",children:e.title})]}),(0,s.jsx)("div",{className:"text-xs text-gray-500 mb-2",children:(0,s.jsx)(i(),{href:"/users/".concat(e.specialistId),className:"hover:text-green-600 hover:underline font-medium",children:null!=(a=null!=(t=e.specialistName)?t:e.specialistEmail)?a:e.specialistId})}),e.description&&(0,s.jsx)("p",{className:"text-sm text-gray-700 line-clamp-3",children:e.description})]}),(0,s.jsx)("button",{onClick:()=>nz(e.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:ed("admin.moderation.block","Block")})]})},e.id)})})]}),(0,s.jsx)(E,{page:e$,total:eZ,limit:20,onChange:eQ,totalLabel:ed("admin.pagination.total")})]})]}),"logs"===em&&(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"flex gap-1 bg-gray-100 rounded-xl p-1 mb-5 w-fit",children:[{key:"ai",label:ed("admin.logs.subtab.ai")},{key:"activity",label:ed("admin.logs.subtab.activity")},{key:"mail",label:ed("admin.logs.subtab.mail")},{key:"notifications",label:ed("admin.logs.subtab.notifications")}].map(e=>{let{key:t,label:a}=e;return(0,s.jsx)("button",{onClick:()=>tQ(t),className:"px-4 py-1.5 rounded-lg text-sm font-medium transition-colors ".concat(t$===t?"bg-white text-gray-900 shadow-sm":"text-gray-500 hover:text-gray-700"),children:a},t)})}),"ai"===t$&&(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,s.jsxs)("p",{className:"text-sm text-gray-500",children:[ed("admin.pagination.total"),": ",ty]}),(0,s.jsxs)("button",{onClick:()=>{tf(1),c.j_(1).then(e=>{th(e.data),tv(e.total)}).catch(()=>{})},className:"text-xs px-3 py-1.5 rounded-lg bg-gray-100 text-gray-600 hover:bg-gray-200 flex items-center gap-1.5",children:[(0,s.jsxs)("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:[(0,s.jsx)("polyline",{points:"23 4 23 10 17 10"}),(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M20.49 15a9 9 0 11-2.12-9.36L23 10"})]}),ed("common.refresh")]})]}),nE?(0,s.jsx)("div",{className:"text-center py-10 text-gray-400",children:ed("common.loading")}):0===tp.length?(0,s.jsx)("div",{className:"text-center py-10 text-gray-400",children:ed("admin.logs.empty")}):(0,s.jsx)("div",{className:"overflow-x-auto rounded-xl border border-gray-200",children:(0,s.jsxs)("table",{className:"w-full text-sm",children:[(0,s.jsx)("thead",{className:"bg-gray-50 text-gray-500 text-xs uppercase",children:(0,s.jsxs)("tr",{children:[(0,s.jsx)("th",{className:"px-4 py-3 text-left",children:ed("admin.logs.date")}),(0,s.jsx)("th",{className:"px-4 py-3 text-left",children:ed("admin.logs.provider")}),(0,s.jsx)("th",{className:"px-4 py-3 text-left",children:ed("admin.logs.model")}),(0,s.jsx)("th",{className:"px-4 py-3 text-left",children:ed("admin.logs.action")}),(0,s.jsx)("th",{className:"px-4 py-3 text-left",children:ed("admin.logs.langs")}),(0,s.jsx)("th",{className:"px-4 py-3 text-right",children:ed("admin.logs.in")}),(0,s.jsx)("th",{className:"px-4 py-3 text-right",children:ed("admin.logs.out")}),(0,s.jsx)("th",{className:"px-4 py-3 text-right",children:ed("admin.logs.total")}),(0,s.jsx)("th",{className:"px-4 py-3 text-right",children:ed("admin.logs.ms")}),(0,s.jsx)("th",{className:"px-4 py-3 text-center",children:ed("admin.logs.status")})]})}),(0,s.jsx)("tbody",{className:"divide-y divide-gray-100",children:tp.map(e=>{var t,a,l,n,r;return(0,s.jsxs)("tr",{className:"bg-white hover:bg-gray-50",children:[(0,s.jsx)("td",{className:"px-4 py-3 text-gray-500 whitespace-nowrap",children:new Date(e.createdAt).toLocaleString(rs)}),(0,s.jsx)("td",{className:"px-4 py-3",children:(0,s.jsx)("span",{className:"px-2 py-0.5 rounded-full text-xs font-medium ".concat("anthropic"===e.provider?"bg-purple-100 text-purple-700":"bg-green-100 text-green-700"),children:e.provider})}),(0,s.jsx)("td",{className:"px-4 py-3 text-gray-600 font-mono text-xs",children:e.model}),(0,s.jsx)("td",{className:"px-4 py-3 text-gray-600",children:e.action}),(0,s.jsx)("td",{className:"px-4 py-3 text-gray-500",children:e.fromLocale&&e.toLocale?"".concat(e.fromLocale," → ").concat(e.toLocale):"—"}),(0,s.jsx)("td",{className:"px-4 py-3 text-right text-gray-600",children:null!=(t=e.inputTokens)?t:"—"}),(0,s.jsx)("td",{className:"px-4 py-3 text-right text-gray-600",children:null!=(a=e.outputTokens)?a:"—"}),(0,s.jsx)("td",{className:"px-4 py-3 text-right font-medium",children:null!=(l=e.totalTokens)?l:"—"}),(0,s.jsx)("td",{className:"px-4 py-3 text-right text-gray-500",children:null!=(n=e.durationMs)?n:"—"}),(0,s.jsx)("td",{className:"px-4 py-3 text-center",children:e.success?(0,s.jsx)("span",{className:"text-green-600 flex justify-center",children:(0,s.jsx)("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2.5,children:(0,s.jsx)("polyline",{points:"20 6 9 17 4 12"})})}):(0,s.jsx)("span",{className:"text-red-500 flex justify-center",title:null!=(r=e.error)?r:"",children:(0,s.jsxs)("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2.5,children:[(0,s.jsx)("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),(0,s.jsx)("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})})]},e.id)})})]})}),(0,s.jsx)(E,{page:tb,total:ty,limit:50,onChange:tf,totalLabel:ed("admin.pagination.total")})]}),"activity"===t$&&(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 p-4 mb-4 flex flex-wrap gap-3 items-end",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-xs font-medium text-gray-500 mb-1",children:ed("admin.activity.event")}),(0,s.jsxs)("select",{value:tS,onChange:e=>tL(e.target.value),className:"border border-gray-300 rounded-lg px-3 py-1.5 text-sm min-w-[180px]",children:[(0,s.jsx)("option",{value:"",children:ed("admin.activity.all_events")}),tI.map(e=>(0,s.jsx)("option",{value:e,children:e},e))]})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-xs font-medium text-gray-500 mb-1",children:ed("admin.activity.from")}),(0,s.jsx)("input",{type:"date",value:tM,onChange:e=>tA(e.target.value),className:"border border-gray-300 rounded-lg px-3 py-1.5 text-sm"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-xs font-medium text-gray-500 mb-1",children:ed("admin.activity.to")}),(0,s.jsx)("input",{type:"date",value:tB,onChange:e=>tT(e.target.value),className:"border border-gray-300 rounded-lg px-3 py-1.5 text-sm"})]}),(tS||tM||tB||tE)&&(0,s.jsxs)("button",{onClick:()=>{tL(""),tA(""),tT(""),tD("")},className:"text-xs px-3 py-1.5 rounded-lg bg-gray-100 text-gray-500 hover:bg-gray-200 self-end flex items-center gap-1.5",children:[(0,s.jsxs)("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2.5,children:[(0,s.jsx)("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),(0,s.jsx)("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]}),ed("admin.activity.reset")]}),(0,s.jsxs)("p",{className:"text-xs text-gray-400 self-end ml-auto",children:[ed("admin.activity.total"),": ",tk]})]}),0===tj.length?(0,s.jsx)("div",{className:"text-center py-10 text-gray-400",children:ed("admin.activity.empty")}):(0,s.jsx)("div",{className:"space-y-2",children:tj.map(e=>(0,s.jsx)(A,{entry:e,dateLocale:rs,onFilterUser:e=>{tD(e),tL("")},t:ed},e.id))}),(0,s.jsx)(E,{page:tC,total:tk,limit:50,onChange:t_,totalLabel:ed("admin.pagination.total")})]}),"mail"===t$&&(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 p-4 mb-4 flex flex-wrap gap-3 items-end",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-xs font-medium text-gray-500 mb-1",children:ed("admin.mail.event")}),(0,s.jsxs)("select",{value:tV,onChange:e=>tO(e.target.value),className:"border border-gray-300 rounded-lg px-3 py-1.5 text-sm min-w-[200px]",children:[(0,s.jsx)("option",{value:"",children:ed("admin.mail.all_events")}),tY.map(e=>(0,s.jsx)("option",{value:e,children:ed("admin.event.".concat(e.replace(/\./g,"_")),e)},e))]})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-xs font-medium text-gray-500 mb-1",children:ed("admin.mail.from")}),(0,s.jsx)("input",{type:"date",value:tK,onChange:e=>tq(e.target.value),className:"border border-gray-300 rounded-lg px-3 py-1.5 text-sm"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-xs font-medium text-gray-500 mb-1",children:ed("admin.mail.to")}),(0,s.jsx)("input",{type:"date",value:tG,onChange:e=>tX(e.target.value),className:"border border-gray-300 rounded-lg px-3 py-1.5 text-sm"})]}),(tV||tK||tG)&&(0,s.jsxs)("button",{onClick:()=>{tO(""),tq(""),tX("")},className:"text-xs px-3 py-1.5 rounded-lg bg-gray-100 text-gray-500 hover:bg-gray-200 self-end flex items-center gap-1.5",children:[(0,s.jsxs)("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2.5,children:[(0,s.jsx)("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),(0,s.jsx)("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]}),ed("admin.mail.reset")]}),(0,s.jsxs)("p",{className:"text-xs text-gray-400 self-end ml-auto",children:[ed("admin.mail.total"),": ",tP]})]}),0===tR.length?(0,s.jsx)("div",{className:"text-center py-10 text-gray-400",children:ed("admin.mail.empty")}):(0,s.jsx)("div",{className:"overflow-x-auto rounded-xl border border-gray-200",children:(0,s.jsxs)("table",{className:"w-full text-sm",children:[(0,s.jsx)("thead",{className:"bg-gray-50 text-gray-500 text-xs uppercase",children:(0,s.jsxs)("tr",{children:[(0,s.jsx)("th",{className:"px-4 py-3 text-left",children:ed("admin.logs.date")}),(0,s.jsx)("th",{className:"px-4 py-3 text-left",children:ed("admin.mail.recipient")}),(0,s.jsx)("th",{className:"px-4 py-3 text-left",children:ed("admin.mail.event")}),(0,s.jsx)("th",{className:"px-4 py-3 text-left",children:ed("admin.mail.provider")}),(0,s.jsx)("th",{className:"px-4 py-3 text-left",children:ed("admin.mail.details")}),(0,s.jsx)("th",{className:"px-4 py-3 text-center",children:ed("admin.mail.status")})]})}),(0,s.jsx)("tbody",{className:"divide-y divide-gray-100",children:tR.map(e=>{let t=D(e.details),a="string"==typeof(null==t?void 0:t.provider)?t.provider:"—",l="string"==typeof(null==t?void 0:t.to)?t.to:e.userEmail||"—",n="string"==typeof(null==t?void 0:t.subject)?t.subject:"",r="string"==typeof(null==t?void 0:t.error)?t.error:"",i="email.sent"===e.event||"admin.email.test.sent"===e.event;return(0,s.jsxs)("tr",{className:"bg-white hover:bg-gray-50 align-top",children:[(0,s.jsx)("td",{className:"px-4 py-3 text-gray-500 whitespace-nowrap",children:new Date(e.createdAt).toLocaleString(rs)}),(0,s.jsx)("td",{className:"px-4 py-3 text-gray-700",children:l}),(0,s.jsx)("td",{className:"px-4 py-3",children:(0,s.jsx)("span",{className:"px-2 py-0.5 rounded-full text-xs font-medium bg-sky-50 text-sky-700",children:ed("admin.event.".concat(e.event.replace(/\./g,"_")),e.event)})}),(0,s.jsx)("td",{className:"px-4 py-3 text-gray-600",children:a}),(0,s.jsx)("td",{className:"px-4 py-3 text-gray-600 max-w-md",children:(0,s.jsx)("div",{className:"truncate",title:n||r||void 0,children:n||r||"—"})}),(0,s.jsx)("td",{className:"px-4 py-3 text-center",children:i?(0,s.jsx)("span",{className:"text-green-600 inline-flex justify-center",title:ed("admin.mail.success"),children:(0,s.jsx)("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2.5,children:(0,s.jsx)("polyline",{points:"20 6 9 17 4 12"})})}):(0,s.jsx)("span",{className:"text-red-500 inline-flex justify-center",title:r||ed("admin.mail.failed"),children:(0,s.jsxs)("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2.5,children:[(0,s.jsx)("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),(0,s.jsx)("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})})]},e.id)})})]})}),(0,s.jsx)(E,{page:tF,total:tP,limit:50,onChange:tH,totalLabel:ed("admin.pagination.total")})]}),"notifications"===t$&&(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 p-4 mb-4 flex flex-wrap gap-3 items-end",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-xs font-medium text-gray-500 mb-1",children:ed("admin.notif_logs.type")}),(0,s.jsxs)("select",{value:t3,onChange:e=>t6(e.target.value),className:"border border-gray-300 rounded-lg px-3 py-1.5 text-sm min-w-[200px]",children:[(0,s.jsx)("option",{value:"",children:ed("admin.filter.all")}),t7.map(e=>(0,s.jsx)("option",{value:e,children:e},e))]})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-xs font-medium text-gray-500 mb-1",children:ed("admin.activity.from")}),(0,s.jsx)("input",{type:"date",value:t9,onChange:e=>ae(e.target.value),className:"border border-gray-300 rounded-lg px-3 py-1.5 text-sm"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-xs font-medium text-gray-500 mb-1",children:ed("admin.activity.to")}),(0,s.jsx)("input",{type:"date",value:at,onChange:e=>aa(e.target.value),className:"border border-gray-300 rounded-lg px-3 py-1.5 text-sm"})]}),(t3||t9||at)&&(0,s.jsxs)("button",{onClick:()=>{t6(""),ae(""),aa("")},className:"text-xs px-3 py-1.5 rounded-lg bg-gray-100 text-gray-500 hover:bg-gray-200 self-end flex items-center gap-1.5",children:[(0,s.jsxs)("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2.5,children:[(0,s.jsx)("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),(0,s.jsx)("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]}),ed("admin.activity.reset")]}),(0,s.jsxs)("p",{className:"text-xs text-gray-400 self-end ml-auto",children:[ed("admin.pagination.total"),": ",t4]})]}),0===tZ.length?(0,s.jsx)("div",{className:"text-center py-10 text-gray-400",children:ed("admin.notif_logs.empty")}):(0,s.jsx)("div",{className:"overflow-x-auto rounded-xl border border-gray-200",children:(0,s.jsxs)("table",{className:"w-full text-sm",children:[(0,s.jsx)("thead",{className:"bg-gray-50 text-gray-500 text-xs uppercase",children:(0,s.jsxs)("tr",{children:[(0,s.jsx)("th",{className:"px-4 py-3 text-left",children:ed("admin.logs.date")}),(0,s.jsx)("th",{className:"px-4 py-3 text-left",children:ed("admin.col.user")}),(0,s.jsx)("th",{className:"px-4 py-3 text-left",children:ed("admin.notif_logs.type")}),(0,s.jsx)("th",{className:"px-4 py-3 text-left",children:ed("admin.notif_logs.title")}),(0,s.jsx)("th",{className:"px-4 py-3 text-center",children:ed("admin.notif_logs.read")})]})}),(0,s.jsx)("tbody",{className:"divide-y divide-gray-100",children:tZ.map(e=>{var t,a;return(0,s.jsxs)("tr",{className:"bg-white hover:bg-gray-50",children:[(0,s.jsx)("td",{className:"px-4 py-3 text-gray-500 whitespace-nowrap",children:new Date(e.createdAt).toLocaleString(rs)}),(0,s.jsx)("td",{className:"px-4 py-3 text-gray-700",children:null!=(a=null!=(t=e.recipientName)?t:e.recipientEmail)?a:e.recipientId}),(0,s.jsx)("td",{className:"px-4 py-3",children:(0,s.jsx)("span",{className:"px-2 py-0.5 rounded-full text-xs font-medium bg-green-50 text-green-700",children:e.type})}),(0,s.jsx)("td",{className:"px-4 py-3 text-gray-600 max-w-xs truncate",children:e.title}),(0,s.jsx)("td",{className:"px-4 py-3 text-center",children:e.isRead?(0,s.jsx)("span",{className:"text-green-600 flex justify-center",children:(0,s.jsx)("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2.5,children:(0,s.jsx)("polyline",{points:"20 6 9 17 4 12"})})}):(0,s.jsx)("span",{className:"text-gray-400 flex justify-center",children:(0,s.jsx)("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,s.jsx)("circle",{cx:"12",cy:"12",r:"10"})})})})]},e.id)})})]})}),(0,s.jsx)(E,{page:t1,total:t4,limit:50,onChange:t2,totalLabel:ed("admin.pagination.total")})]})]}),"plans"===em&&(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,s.jsxs)("h2",{className:"text-lg font-semibold text-gray-800 flex items-center gap-2",children:[(0,s.jsxs)("svg",{className:"w-5 h-5 text-green-600",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:[(0,s.jsx)("rect",{x:"1",y:"4",width:"22",height:"16",rx:"2",ry:"2"}),(0,s.jsx)("line",{x1:"1",y1:"10",x2:"23",y2:"10"})]}),ed("admin.plans.title")]}),(0,s.jsx)("button",{onClick:function(){aX({name:"",description:"",role:"customer",tier:"free",price:"0",oldPrice:"",currency:"EUR",maxTasks:"",maxOffers:"",maxCards:"",maxMessagesPerDay:"",maxOrdersPerDay:"",maxSkills:"",durationDays:"",searchBoost:0,offersMultiplier:"1.00",features:"",isDefault:!1,isActive:!0,order:0,notifyNewTasks:!1,canContactFreePlan:!1,canContactProPlan:!0,canContactAll:!1,canShowContactInfo:!1,canViewPhone:!1,canUploadVideo:!1,hasFavorites:!1,hasGoogleCalendar:!1,hasVerifiedBadge:!1,highlightedReviews:!1,hasPersonalSite:!1,hasCanHelpNowStatus:!1,hasNeedHelpStatus:!1,hasAutoResponse:!1,hasAutoMatch:!1,hasPriceList:!1,receiveInstantDispatchFree:!1,receiveInstantDispatchPro:!1})},className:"bg-green-600 text-white text-sm px-4 py-2 rounded-lg hover:bg-green-700 font-medium",children:ed("admin.plans.add")})]}),aG&&(0,s.jsxs)("div",{className:"bg-white border border-gray-200 rounded-xl p-5 mb-4 space-y-3",children:[(0,s.jsx)("h3",{className:"font-semibold text-gray-800",children:aG.id?ed("admin.plans.form.edit"):ed("admin.plans.form.new")}),(0,s.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:ed("admin.plans.form.name")}),(0,s.jsx)("input",{value:aG.name,onChange:e=>aX({...aG,name:e.target.value}),className:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:ed("admin.plans.form.price")}),(0,s.jsx)("input",{type:"number",min:"0",step:"0.01",value:aG.price,onChange:e=>aX({...aG,price:e.target.value}),className:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:ed("admin.plans.form.old_price")}),(0,s.jsx)("input",{type:"number",min:"0",step:"0.01",value:null!=(r=aG.oldPrice)?r:"",onChange:e=>aX({...aG,oldPrice:e.target.value}),placeholder:"—",className:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:ed("admin.plans.form.tier")}),(0,s.jsxs)("select",{value:aG.tier,onChange:e=>aX({...aG,tier:e.target.value}),className:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400",children:[(0,s.jsx)("option",{value:"free",children:ed("admin.plans.form.tier.free")}),(0,s.jsx)("option",{value:"pro",children:ed("admin.plans.form.tier.pro")}),(0,s.jsx)("option",{value:"ultimate",children:ed("admin.plans.form.tier.ultimate")})]})]})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:ed("admin.plans.form.description")}),(0,s.jsx)("input",{value:aG.description,onChange:e=>aX({...aG,description:e.target.value}),className:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400"})]}),(0,s.jsx)("p",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wide pt-1",children:ed("admin.plans.form.section.limits")}),(0,s.jsxs)("div",{className:"grid grid-cols-3 gap-3",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:ed("admin.plans.form.max_tasks")}),(0,s.jsx)("input",{type:"number",min:"0",placeholder:"∞",value:aG.maxTasks,onChange:e=>aX({...aG,maxTasks:e.target.value}),className:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:ed("admin.plans.form.max_offers")}),(0,s.jsx)("input",{type:"number",min:"0",placeholder:"∞",value:aG.maxOffers,onChange:e=>aX({...aG,maxOffers:e.target.value}),className:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:ed("admin.plans.form.max_cards")}),(0,s.jsx)("input",{type:"number",min:"0",placeholder:"∞",value:aG.maxCards,onChange:e=>aX({...aG,maxCards:e.target.value}),className:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:ed("admin.plans.form.max_messages_day")}),(0,s.jsx)("input",{type:"number",min:"0",placeholder:"∞",value:aG.maxMessagesPerDay,onChange:e=>aX({...aG,maxMessagesPerDay:e.target.value}),className:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:ed("admin.plans.form.max_orders_day")}),(0,s.jsx)("input",{type:"number",min:"0",placeholder:"∞",value:aG.maxOrdersPerDay,onChange:e=>aX({...aG,maxOrdersPerDay:e.target.value}),className:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:ed("admin.plans.form.max_skills")}),(0,s.jsx)("input",{type:"number",min:"0",placeholder:"∞",value:aG.maxSkills,onChange:e=>aX({...aG,maxSkills:e.target.value}),className:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:ed("admin.plans.form.duration_days")}),(0,s.jsx)("input",{type:"number",min:"0",placeholder:"∞",value:aG.durationDays,onChange:e=>aX({...aG,durationDays:e.target.value}),className:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400"})]})]}),(0,s.jsx)("p",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wide pt-1",children:ed("admin.plans.form.section.boost")}),(0,s.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:ed("admin.plans.form.search_boost")}),(0,s.jsx)("input",{type:"number",min:"0",value:aG.searchBoost,onChange:e=>aX({...aG,searchBoost:Number(e.target.value)}),className:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:ed("admin.plans.form.offers_multiplier")}),(0,s.jsx)("input",{type:"number",min:"0",step:"0.01",value:aG.offersMultiplier,onChange:e=>aX({...aG,offersMultiplier:e.target.value}),className:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400"})]})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:ed("admin.plans.form.features")}),(0,s.jsx)("textarea",{rows:3,value:aG.features,onChange:e=>aX({...aG,features:e.target.value}),className:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 resize-none"})]}),(0,s.jsx)("p",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wide pt-1",children:ed("admin.plans.form.section.contact")}),(0,s.jsx)("div",{className:"grid grid-cols-2 gap-2",children:[["canContactFreePlan",ed("admin.plans.form.can_contact_free")],["canContactProPlan",ed("admin.plans.form.can_contact_pro")],["canContactAll",ed("admin.plans.form.can_contact_all")],["canShowContactInfo",ed("admin.plans.form.can_show_contact")],["canViewPhone",ed("admin.plans.form.can_view_phone")]].map(e=>{let[t,a]=e;return(0,s.jsxs)("label",{className:"flex items-center gap-2 cursor-pointer text-sm text-gray-700",children:[(0,s.jsx)("input",{type:"checkbox",checked:aG[t],onChange:e=>aX({...aG,[t]:e.target.checked}),className:"w-4 h-4 rounded text-green-600"}),a]},t)})}),(0,s.jsx)("p",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wide pt-1",children:ed("admin.plans.form.section.features")}),(0,s.jsx)("div",{className:"grid grid-cols-2 gap-2",children:[["notifyNewTasks",ed("admin.plans.form.notify")],["canUploadVideo",ed("admin.plans.form.upload_video")],["hasFavorites",ed("admin.plans.form.favorites")],["hasGoogleCalendar",ed("admin.plans.form.google_calendar")],["hasVerifiedBadge",ed("admin.plans.form.verified_badge")],["highlightedReviews",ed("admin.plans.form.highlighted_reviews")],["hasPersonalSite",ed("admin.plans.form.personal_site")],["hasCanHelpNowStatus",ed("admin.plans.form.can_help_now")],["hasNeedHelpStatus",ed("admin.plans.form.need_help")],["hasAutoResponse",ed("admin.plans.form.auto_response")],["hasAutoMatch",ed("admin.plans.form.auto_match")],["hasPriceList",ed("admin.plans.form.price_list")],["receiveInstantDispatchFree",ed("admin.plans.form.instant_dispatch_free")],["receiveInstantDispatchPro",ed("admin.plans.form.instant_dispatch_pro")]].map(e=>{let[t,a]=e;return(0,s.jsxs)("label",{className:"flex items-center gap-2 cursor-pointer text-sm text-gray-700",children:[(0,s.jsx)("input",{type:"checkbox",checked:aG[t],onChange:e=>aX({...aG,[t]:e.target.checked}),className:"w-4 h-4 rounded text-green-600"}),a]},t)})}),(0,s.jsxs)("div",{className:"flex items-center gap-6 pt-1",children:[(0,s.jsxs)("label",{className:"flex items-center gap-2 cursor-pointer text-sm text-gray-700",children:[(0,s.jsx)("input",{type:"checkbox",checked:aG.isDefault,onChange:e=>aX({...aG,isDefault:e.target.checked}),className:"w-4 h-4 rounded text-green-600"}),ed("admin.plans.form.default")]}),(0,s.jsxs)("label",{className:"flex items-center gap-2 cursor-pointer text-sm text-gray-700",children:[(0,s.jsx)("input",{type:"checkbox",checked:aG.isActive,onChange:e=>aX({...aG,isActive:e.target.checked}),className:"w-4 h-4 rounded text-green-600"}),ed("admin.plans.form.active")]}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("label",{className:"text-xs text-gray-600",children:ed("admin.plans.form.order")}),(0,s.jsx)("input",{type:"number",value:aG.order,onChange:e=>aX({...aG,order:Number(e.target.value)}),className:"w-16 border border-gray-300 rounded-lg px-2 py-1 text-sm focus:outline-none"})]})]}),(0,s.jsxs)("div",{className:"flex gap-2 pt-1",children:[(0,s.jsx)("button",{onClick:n0,disabled:aY||!aG.name,className:"bg-green-600 text-white px-4 py-2 rounded-lg text-sm font-medium hover:bg-green-700 disabled:opacity-50",children:aY?"...":ed("common.save")}),(0,s.jsx)("button",{onClick:()=>aX(null),className:"px-4 py-2 rounded-lg text-sm font-medium text-gray-600 hover:bg-gray-100",children:ed("common.cancel")})]})]}),(0,s.jsx)("div",{className:"bg-white rounded-xl border border-gray-200 overflow-hidden",children:0===aK.length?(0,s.jsx)("div",{className:"px-4 py-8 text-center text-gray-400 text-sm",children:ed("admin.plans.empty")}):(0,s.jsx)("div",{className:"divide-y divide-gray-100",children:aK.sort((e,t)=>{var a,s;return(null!=(a=e.order)?a:0)-(null!=(s=t.order)?s:0)}).map(e=>{var t;return(0,s.jsxs)("div",{className:"flex items-start gap-4 px-4 py-4 ".concat(e.isActive?"":"opacity-50"),children:[(0,s.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[(0,s.jsx)("span",{className:"font-semibold text-gray-900",children:e.name}),e.isDefault&&(0,s.jsx)("span",{className:"bg-green-100 text-green-700 text-xs px-2 py-0.5 rounded-full font-medium",children:ed("admin.plans.badge.default")}),!e.isActive&&(0,s.jsx)("span",{className:"bg-gray-100 text-gray-500 text-xs px-2 py-0.5 rounded-full",children:ed("admin.plans.badge.inactive")})]}),e.description&&(0,s.jsx)("p",{className:"text-sm text-gray-500 mt-0.5",children:e.description}),(0,s.jsxs)("div",{className:"flex flex-wrap gap-3 mt-1 text-xs text-gray-500",children:[(0,s.jsxs)("span",{className:"flex items-center gap-1.5 font-semibold text-gray-800",children:[e.oldPrice&&(0,s.jsxs)("span",{className:"font-normal text-gray-400 line-through",children:[e.oldPrice," ",e.currency]}),(0,s.jsxs)("span",{children:[e.price," ",e.currency]})]}),null!=e.maxTasks&&(0,s.jsxs)("span",{children:[ed("admin.plans.tasks"),": ",e.maxTasks]}),null!=e.maxOffers&&(0,s.jsxs)("span",{children:[ed("admin.plans.offers"),": ",e.maxOffers]}),null!=e.maxCards&&(0,s.jsxs)("span",{children:[ed("admin.plans.cards"),": ",e.maxCards]}),e.notifyNewTasks&&(0,s.jsxs)("span",{className:"text-green-700 flex items-center gap-1",children:[(0,s.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"})}),ed("admin.plans.notify_tasks")]})]}),(null!=(t=e.features)?t:[]).length>0&&(0,s.jsx)("ul",{className:"mt-1.5 space-y-0.5",children:e.features.map((e,t)=>(0,s.jsxs)("li",{className:"text-xs text-gray-600 flex items-center gap-1.5",children:[(0,s.jsx)("span",{className:"text-green-500",children:(0,s.jsx)("svg",{className:"w-3 h-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2.5,children:(0,s.jsx)("polyline",{points:"20 6 9 17 4 12"})})})," ",e]},t))})]}),(0,s.jsxs)("div",{className:"flex gap-1 shrink-0",children:[!e.isDefault&&(0,s.jsx)("button",{onClick:()=>c.td(e.id,{isDefault:!0}).then(()=>c.OX().then(aq)).catch(()=>{}),className:"text-xs px-2 py-1 rounded-lg bg-green-50 text-green-600 hover:bg-green-100 font-medium",title:ed("admin.plans.make_default"),children:(0,s.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,s.jsx)("polygon",{points:"12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2"})})}),(0,s.jsx)("button",{onClick:()=>{var t,a,s,l,n,r,i,o,d,c,m,x,u,g,p,h,b,f,y,v,j,N,k,w,C,_,S,L,E,D,M;aX({id:e.id,name:e.name,description:null!=(t=e.description)?t:"",role:null!=(a=e.role)?a:"customer",tier:null!=(s=e.tier)?s:"free",price:null!=(l=e.price)?l:"0",oldPrice:null!=(n=e.oldPrice)?n:"",currency:null!=(r=e.currency)?r:"EUR",maxTasks:null!=e.maxTasks?String(e.maxTasks):"",maxOffers:null!=e.maxOffers?String(e.maxOffers):"",maxCards:null!=e.maxCards?String(e.maxCards):"",maxMessagesPerDay:null!=e.maxMessagesPerDay?String(e.maxMessagesPerDay):"",maxOrdersPerDay:null!=e.maxOrdersPerDay?String(e.maxOrdersPerDay):"",maxSkills:null!=e.maxSkills?String(e.maxSkills):"",durationDays:null!=e.durationDays?String(e.durationDays):"",searchBoost:null!=(i=e.searchBoost)?i:0,offersMultiplier:null!=(o=e.offersMultiplier)?o:"1.00",features:(null!=(d=e.features)?d:[]).join("\n"),isDefault:null!=(c=e.isDefault)&&c,isActive:null==(m=e.isActive)||m,order:null!=(x=e.order)?x:0,notifyNewTasks:null!=(u=e.notifyNewTasks)&&u,canContactFreePlan:null!=(g=e.canContactFreePlan)&&g,canContactProPlan:null==(p=e.canContactProPlan)||p,canContactAll:null!=(h=e.canContactAll)&&h,canShowContactInfo:null!=(b=e.canShowContactInfo)&&b,canViewPhone:null!=(f=e.canViewPhone)&&f,canUploadVideo:null!=(y=e.canUploadVideo)&&y,hasFavorites:null!=(v=e.hasFavorites)&&v,hasGoogleCalendar:null!=(j=e.hasGoogleCalendar)&&j,hasVerifiedBadge:null!=(N=e.hasVerifiedBadge)&&N,highlightedReviews:null!=(k=e.highlightedReviews)&&k,hasPersonalSite:null!=(w=e.hasPersonalSite)&&w,hasCanHelpNowStatus:null!=(C=e.hasCanHelpNowStatus)&&C,hasNeedHelpStatus:null!=(_=e.hasNeedHelpStatus)&&_,hasAutoResponse:null!=(S=e.hasAutoResponse)&&S,hasAutoMatch:null!=(L=e.hasAutoMatch)&&L,hasPriceList:null!=(E=e.hasPriceList)&&E,receiveInstantDispatchFree:null!=(D=e.receiveInstantDispatchFree)&&D,receiveInstantDispatchPro:null!=(M=e.receiveInstantDispatchPro)&&M})},className:"text-xs px-2 py-1 rounded-lg bg-gray-100 text-gray-600 hover:bg-gray-200 font-medium",children:ed("common.edit")}),(0,s.jsx)("button",{onClick:()=>n1(e.id,e.name),className:"text-xs px-2 py-1 rounded-lg bg-red-50 text-red-600 hover:bg-red-100 font-medium",children:ed("common.delete")})]})]},e.id)})})})]}),"settings"===em&&(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"flex gap-1 mb-6 bg-white rounded-xl border border-gray-200 p-1 w-fit",children:["general","smtp","notifications","payment","referral","seo","socials","telegram"].map(e=>{let t={general:ed("admin.settings.tab.general"),smtp:ed("admin.settings.tab.smtp"),notifications:ed("admin.settings.tab.notifications"),payment:ed("admin.settings.tab.payment"),referral:ed("admin.settings.tab.referral"),seo:ed("admin.settings.tab.seo"),socials:ed("admin.settings.tab.socials"),telegram:ed("admin.settings.tab.telegram")};return(0,s.jsx)("button",{onClick:()=>sv(e),className:"px-4 py-2 rounded-lg text-sm font-medium transition ".concat(sy===e?"bg-green-600 text-white shadow-sm":"text-gray-600 hover:bg-gray-100"),children:t[e]},e)})}),"general"===sy&&(0,s.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 p-6 max-w-lg",children:[(0,s.jsx)("h3",{className:"font-semibold text-gray-800 mb-5",children:ed("admin.settings.general.title")}),(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:ed("admin.settings.general.site_name")}),(0,s.jsx)("input",{value:sj.siteName,onChange:e=>sN(t=>({...t,siteName:e.target.value})),className:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400",placeholder:"CanHelp"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:ed("admin.settings.general.site_url")}),(0,s.jsx)("input",{value:sj.siteUrl,onChange:e=>sN(t=>({...t,siteUrl:e.target.value})),className:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400",placeholder:"https://canhelp.com"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:ed("admin.settings.general.contact_email")}),(0,s.jsx)("input",{type:"email",value:sj.contactEmail,onChange:e=>sN(t=>({...t,contactEmail:e.target.value})),className:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400",placeholder:"contact@canhelp.com"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:ed("admin.settings.general.support_phone")}),(0,s.jsx)("input",{value:sj.supportPhone,onChange:e=>sN(t=>({...t,supportPhone:e.target.value})),className:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400",placeholder:"+30 21 000 0000"})]}),(0,s.jsx)("button",{onClick:n2,disabled:sk,className:"w-full py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700 disabled:opacity-50 transition",children:sk?ed("admin.settings.saving"):sC?ed("admin.settings.saved"):ed("common.save")})]})]}),"smtp"===sy&&(0,s.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 p-6 max-w-lg",children:[(0,s.jsx)("h3",{className:"font-semibold text-gray-800 mb-1",children:ed("admin.settings.smtp.title")}),(0,s.jsx)("p",{className:"text-sm text-gray-400 mb-5",children:ed("admin.settings.smtp.hint")}),(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{className:"grid grid-cols-3 gap-3",children:[(0,s.jsxs)("div",{className:"col-span-2",children:[(0,s.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:ed("admin.settings.smtp.host")}),(0,s.jsx)("input",{value:sS.host,onChange:e=>sL(t=>({...t,host:e.target.value})),className:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400",placeholder:"smtp.gmail.com"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:ed("admin.settings.smtp.port")}),(0,s.jsx)("input",{value:sS.port,onChange:e=>sL(t=>({...t,port:e.target.value})),className:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400",placeholder:"587"})]})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:ed("admin.settings.smtp.encryption")}),(0,s.jsxs)("select",{value:sS.encryption,onChange:e=>sL(t=>({...t,encryption:e.target.value})),className:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400",children:[(0,s.jsx)("option",{value:"none",children:ed("admin.settings.smtp.enc.none")}),(0,s.jsx)("option",{value:"tls",children:"STARTTLS (587)"}),(0,s.jsx)("option",{value:"ssl",children:"SSL/TLS (465)"})]})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:ed("admin.settings.smtp.username")}),(0,s.jsx)("input",{value:sS.username,onChange:e=>sL(t=>({...t,username:e.target.value})),className:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400",placeholder:"user@gmail.com",autoComplete:"off"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:ed("admin.settings.smtp.password")}),(0,s.jsx)("input",{type:"password",value:sS.password,onChange:e=>sL(t=>({...t,password:e.target.value})),className:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400",autoComplete:"new-password",placeholder:"••••••••••••"})]}),(0,s.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:ed("admin.settings.smtp.from_name")}),(0,s.jsx)("input",{value:sS.fromName,onChange:e=>sL(t=>({...t,fromName:e.target.value})),className:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400",placeholder:"CanHelp"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:ed("admin.settings.smtp.from_email")}),(0,s.jsx)("input",{type:"email",value:sS.fromEmail,onChange:e=>sL(t=>({...t,fromEmail:e.target.value})),className:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400",placeholder:"noreply@canhelp.com"})]})]}),(0,s.jsx)("button",{onClick:n4,disabled:sE,className:"w-full py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700 disabled:opacity-50 transition",children:sE?ed("admin.settings.saving"):sM?ed("admin.settings.saved"):ed("common.save")}),(0,s.jsx)("button",{onClick:async()=>{sT(!0),sU(null);try{let e=await c.FI();sU("✓ Sent to ".concat(e.to))}catch(e){sU("✗ Error: ".concat(e.message))}finally{sT(!1),setTimeout(()=>sU(null),5e3)}},disabled:sB,className:"w-full py-2 bg-gray-100 text-gray-700 rounded-lg text-sm font-medium hover:bg-gray-200 disabled:opacity-50 transition",children:sB?ed("admin.settings.smtp.sending"):(0,s.jsxs)("span",{className:"flex items-center justify-center gap-2",children:[(0,s.jsx)("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"})}),ed("admin.settings.smtp.test")]})}),sI&&(0,s.jsx)("p",{className:"text-sm text-center font-medium ".concat(sI.startsWith("✓")?"text-green-600":"text-red-500"),children:sI})]})]}),"payment"===sy&&(0,s.jsxs)("div",{className:"space-y-6 max-w-lg",children:[(0,s.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 p-6",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between mb-5",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsx)("div",{className:"w-10 h-10 rounded-lg bg-[#003087] flex items-center justify-center text-white text-xs font-bold shrink-0",children:"PB"}),(0,s.jsxs)("div",{children:[(0,s.jsx)("h3",{className:"font-semibold text-gray-800",children:"ePay — Piraeus Bank"}),(0,s.jsx)("p",{className:"text-xs text-gray-400",children:"ГреческОй платёжМый шлюз"})]})]}),(0,s.jsxs)("label",{className:"flex items-center gap-2 cursor-pointer",children:[(0,s.jsx)("span",{className:"text-sm text-gray-500",children:ed("admin.settings.active")}),(0,s.jsx)("button",{type:"button",onClick:()=>sX(e=>({...e,enabled:!e.enabled})),className:"relative w-10 h-6 rounded-full p-0 transition-colors cursor-pointer ".concat(sG.enabled?"bg-green-600":"bg-gray-300"),children:(0,s.jsx)("span",{className:"absolute left-0 top-1 w-4 h-4 bg-white rounded-full shadow transition-transform ".concat(sG.enabled?"translate-x-5":"translate-x-1")})})]})]}),(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:ed("admin.settings.env.label")}),(0,s.jsxs)("select",{value:sG.environment,onChange:e=>sX(t=>({...t,environment:e.target.value})),className:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm",children:[(0,s.jsx)("option",{value:"test",children:ed("admin.settings.env.test")}),(0,s.jsx)("option",{value:"production",children:ed("admin.settings.env.prod")})]})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:ed("admin.settings.merchant_id")}),(0,s.jsx)("input",{value:sG.merchantId,onChange:e=>sX(t=>({...t,merchantId:e.target.value})),placeholder:ed("admin.settings.merchant_id"),className:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400"})]}),(0,s.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"API User"}),(0,s.jsx)("input",{value:sG.apiUser,onChange:e=>sX(t=>({...t,apiUser:e.target.value})),autoComplete:"off",className:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"API Password"}),(0,s.jsx)("input",{type:"password",value:sG.apiPassword,onChange:e=>sX(t=>({...t,apiPassword:e.target.value})),autoComplete:"new-password",className:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400"})]})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Confirmation URL (webhook)"}),(0,s.jsx)("input",{value:sG.confirmationUrl,onChange:e=>sX(t=>({...t,confirmationUrl:e.target.value})),placeholder:"https://yoursite.com/api/payments/epay/confirm",className:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Cancel URL"}),(0,s.jsx)("input",{value:sG.cancelUrl,onChange:e=>sX(t=>({...t,cancelUrl:e.target.value})),placeholder:"https://yoursite.com/payment/cancelled",className:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400"})]})]}),(0,s.jsxs)("div",{className:"flex items-center gap-3 mt-5",children:[(0,s.jsx)("button",{onClick:n6,disabled:sY,className:"px-5 py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700 disabled:opacity-50",children:sY?ed("admin.settings.saving"):ed("common.save")}),s$&&(0,s.jsx)("span",{className:"text-sm text-green-600",children:ed("admin.settings.saved")})]})]}),(0,s.jsxs)("div",{className:"p-3 bg-amber-50 border border-amber-200 rounded-xl text-xs text-amber-700 flex items-start gap-2",children:[(0,s.jsxs)("svg",{className:"w-4 h-4 shrink-0 mt-0.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:[(0,s.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,s.jsx)("line",{x1:"12",y1:"8",x2:"12",y2:"12"}),(0,s.jsx)("line",{x1:"12",y1:"16",x2:"12.01",y2:"16"})]}),(0,s.jsx)("span",{children:ed("admin.settings.payment.hint")})]})]}),"notifications"===sy&&(0,s.jsxs)("div",{className:"space-y-3 max-w-2xl",children:[(0,s.jsxs)("div",{className:"flex items-start gap-2 mb-4 p-3 bg-green-50 border border-green-100 rounded-xl text-sm text-green-700",children:[(0,s.jsxs)("svg",{className:"w-4 h-4 shrink-0 mt-0.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:[(0,s.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,s.jsx)("line",{x1:"12",y1:"8",x2:"12",y2:"12"}),(0,s.jsx)("line",{x1:"12",y1:"16",x2:"12.01",y2:"16"})]}),(0,s.jsxs)("p",{children:[ed("admin.notif.vars_hint")," ",p.map(e=>{let t="{{".concat(e,"}}");return(0,s.jsx)("code",{className:"mx-0.5 bg-green-100 text-gray-800 px-1.5 py-0.5 rounded text-xs font-mono",children:t},t)})]})]}),[{key:"email_verification",label:ed("admin.notif.email_verification"),icon:(0,s.jsx)("svg",{className:"w-5 h-5 text-gray-500 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"})})},{key:"registration_success",label:ed("admin.notif.registration_success"),icon:(0,s.jsx)("svg",{className:"w-5 h-5 text-green-500 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"})})},{key:"password_reset",label:ed("admin.notif.password_reset"),icon:(0,s.jsx)("svg",{className:"w-5 h-5 text-amber-500 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1121 9z"})})},{key:"new_offer",label:ed("admin.notif.new_offer"),icon:(0,s.jsx)("svg",{className:"w-5 h-5 text-purple-500 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8 10h.01M12 10h.01M16 10h.01M9 16H5a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v8a2 2 0 01-2 2h-5l-5 5v-5z"})})},{key:"new_task",label:ed("admin.notif.new_task"),icon:(0,s.jsx)("svg",{className:"w-5 h-5 text-indigo-500 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"})})},{key:"offer_accepted",label:ed("admin.notif.offer_accepted"),icon:(0,s.jsx)("svg",{className:"w-5 h-5 text-green-600 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})})},{key:"new_message",label:ed("admin.notif.new_message"),icon:(0,s.jsx)("svg",{className:"w-5 h-5 text-pink-500 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"})})},{key:"offer_declined",label:ed("admin.notif.offer_declined"),icon:(0,s.jsx)("svg",{className:"w-5 h-5 text-red-500 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z"})})},{key:"offer_other_accepted",label:ed("admin.notif.offer_other_accepted"),icon:(0,s.jsx)("svg",{className:"w-5 h-5 text-green-600 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0z"})})},{key:"task_updated",label:ed("admin.notif.task_updated"),icon:(0,s.jsx)("svg",{className:"w-5 h-5 text-gray-500 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"})})},{key:"deadline_reminder",label:ed("admin.notif.deadline_reminder"),icon:(0,s.jsx)("svg",{className:"w-5 h-5 text-yellow-500 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"})})},{key:"task_archived",label:ed("admin.notif.task_archived"),icon:(0,s.jsx)("svg",{className:"w-5 h-5 text-red-400 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 8h14M5 8a2 2 0 110-4h14a2 2 0 110 4M5 8l1 12a2 2 0 002 2h8a2 2 0 002-2l1-12M10 12v6m4-6v6"})})},{key:"referral_reward",label:ed("admin.notif.referral_reward"),icon:(0,s.jsx)("svg",{className:"w-5 h-5 text-emerald-500 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 8v13m0-13V6a2 2 0 112.83 2.83l-2.83 2.83zm0 0V5.5A2.5 2.5 0 119.27 8H12zm-7 4h14M5 12a2 2 0 110-4h3.586a1 1 0 01.707.293l2.414 2.414M19 12a2 2 0 110-4h-3.586a1 1 0 00-.707.293l-2.414 2.414"})})},{key:"plan_activated",label:ed("admin.email_template.plan_activated"),icon:(0,s.jsx)("svg",{className:"w-5 h-5 text-gray-500 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"})})},{key:"plan_upgraded",label:ed("admin.email_template.plan_upgraded"),icon:(0,s.jsx)("svg",{className:"w-5 h-5 text-green-500 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 10l7-7m0 0l7 7m-7-7v18"})})},{key:"plan_downgrade_scheduled",label:ed("admin.email_template.plan_downgrade_scheduled"),icon:(0,s.jsx)("svg",{className:"w-5 h-5 text-orange-400 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"})})},{key:"plan_downgrade_applied",label:ed("admin.email_template.plan_downgrade_applied"),icon:(0,s.jsx)("svg",{className:"w-5 h-5 text-green-600 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 14l-7 7m0 0l-7-7m7 7V3"})})},{key:"plan_renewal_reminder",label:ed("admin.email_template.plan_renewal_reminder"),icon:(0,s.jsx)("svg",{className:"w-5 h-5 text-yellow-500 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 17h5l-1.405-1.405A2.032 2.032 0 0118 14.158V11a6.002 6.002 0 00-4-5.659V5a2 2 0 10-4 0v.341C7.67 6.165 6 8.388 6 11v3.159c0 .538-.214 1.055-.595 1.436L4 17h5m6 0v1a3 3 0 11-6 0v-1m6 0H9"})})},{key:"plan_insufficient_funds",label:ed("admin.email_template.plan_insufficient_funds"),icon:(0,s.jsx)("svg",{className:"w-5 h-5 text-red-500 shrink-0",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})})}].map(e=>{var t,a,l;let{key:n,label:r,icon:i}=e,o="".concat(n,"_").concat(sF),d=null!=(a=null!=(t=sR[o])?t:sR[n])?a:{subject:"",body:""},c=sP===n,m=null!=(l=g[n])?l:[];return(0,s.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 overflow-hidden",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3 px-5 py-4 cursor-pointer hover:bg-gray-50 select-none",onClick:()=>sz(c?null:n),children:[(0,s.jsx)("span",{className:"text-xl shrink-0",children:i}),(0,s.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,s.jsx)("div",{className:"font-medium text-gray-800 text-sm",children:r}),d.subject?(0,s.jsxs)("div",{className:"text-xs text-gray-400 mt-0.5 truncate",children:[ed("admin.notif.tmpl.subject_label"),": ",d.subject]}):(0,s.jsx)("div",{className:"text-xs text-gray-300 mt-0.5 italic",children:ed("admin.notif.tmpl.not_set")})]}),(0,s.jsx)("span",{className:"text-gray-400 transition-transform ".concat(c?"rotate-90":""),children:(0,s.jsx)("svg",{className:"w-4 h-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2.5,children:(0,s.jsx)("polyline",{points:"9 18 15 12 9 6"})})})]}),c&&(0,s.jsxs)("div",{className:"px-5 pb-5 border-t border-gray-100 pt-4 space-y-3",children:[(0,s.jsx)("div",{className:"flex gap-1 pb-2",children:["el","en","uk","ru"].map(e=>(0,s.jsx)("button",{type:"button",onClick:()=>sH(e),className:"px-3 py-1 text-xs font-medium rounded-md transition-colors ".concat(sF===e?"bg-green-600 text-white":"bg-gray-100 text-gray-600 hover:bg-gray-200"),children:"el"===e?"ΕλληΜικά":"en"===e?"English":"uk"===e?"УкраїМська":"РусскОй"},e))}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:ed("admin.notif.tmpl.subject_label")}),(0,s.jsx)("input",{value:d.subject,onChange:e=>sW(t=>{var a;return{...t,[o]:{...null!=(a=t[o])?a:{subject:"",body:""},subject:e.target.value}}}),className:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-xs font-medium text-gray-600 mb-1",children:ed("admin.notif.tmpl.body_label")}),(0,s.jsx)("textarea",{rows:7,value:d.body,onChange:e=>sW(t=>{var a;return{...t,[o]:{...null!=(a=t[o])?a:{subject:"",body:""},body:e.target.value}}}),className:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 font-mono resize-y",placeholder:"

УважаеЌый {{userName}},

..."})]}),m.length>0&&(0,s.jsxs)("div",{className:"rounded-lg border border-amber-200 bg-amber-50 px-3 py-2",children:[(0,s.jsx)("div",{className:"text-xs font-medium text-amber-800 mb-1",children:ed("admin.notif.vars_hint")}),(0,s.jsx)("div",{className:"flex flex-wrap gap-1.5",children:m.map(e=>{let t="{{".concat(e,"}}");return(0,s.jsx)("code",{className:"bg-amber-100 text-amber-900 px-1.5 py-0.5 rounded text-xs font-mono",children:t},t)})})]}),(0,s.jsxs)("div",{className:"flex gap-2 flex-wrap",children:[(0,s.jsx)("button",{onClick:()=>n3(n),disabled:sV||sK,className:"px-4 py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700 disabled:opacity-50",children:sV?ed("admin.notif.tmpl.saving"):ed("admin.notif.tmpl.save")}),(0,s.jsxs)("button",{onClick:()=>n5(n),disabled:sV||sK,className:"px-4 py-2 bg-purple-600 text-white rounded-lg text-sm font-medium hover:bg-purple-700 disabled:opacity-50 flex items-center gap-1.5",children:[(0,s.jsx)("svg",{className:"w-3.5 h-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 5h12M9 3v2m1.048 9.5A18.022 18.022 0 016.412 9m6.088 9h7M11 21l5-10 5 10M12.751 5C11.783 10.77 8.07 15.61 3 18.129"})}),sK?ed("admin.notif.tmpl.translating"):ed("admin.notif.tmpl.translate")]}),(0,s.jsx)("button",{onClick:()=>sz(null),className:"px-4 py-2 bg-gray-100 text-gray-700 rounded-lg text-sm font-medium hover:bg-gray-200",children:ed("admin.notif.tmpl.close")})]})]})]},n)})]}),"referral"===sy&&(0,s.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 p-6 max-w-lg space-y-5",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h3",{className:"font-semibold text-gray-800",children:ed("admin.settings.referral.title")}),(0,s.jsx)("p",{className:"text-sm text-gray-400 mt-1",children:ed("admin.settings.referral.hint")})]}),(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"text-sm font-medium text-gray-700",children:ed("admin.settings.referral.enabled_label")}),(0,s.jsx)("p",{className:"text-xs text-gray-400",children:ed("admin.settings.referral.enabled_hint")})]}),(0,s.jsx)("button",{type:"button",onClick:()=>s0(e=>({...e,enabled:!e.enabled})),className:"relative w-10 h-6 rounded-full p-0 transition-colors cursor-pointer ".concat(sZ.enabled?"bg-green-600":"bg-gray-300"),children:(0,s.jsx)("span",{className:"absolute left-0 top-1 w-4 h-4 bg-white rounded-full shadow transition-transform ".concat(sZ.enabled?"translate-x-5":"translate-x-1")})})]}),(0,s.jsxs)("div",{className:"border border-gray-100 rounded-lg p-4 space-y-4",children:[(0,s.jsx)("p",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wide",children:ed("admin.settings.referral.shared_section")}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:ed("admin.settings.referral.plan_label")}),(0,s.jsxs)("select",{value:sZ.planId,onChange:e=>s0(t=>({...t,planId:e.target.value})),className:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400",children:[(0,s.jsx)("option",{value:"",children:ed("admin.settings.referral.no_plan")}),aK.map(e=>(0,s.jsx)("option",{value:e.id,children:e.name},e.id))]}),(0,s.jsx)("p",{className:"text-xs text-gray-400 mt-1",children:ed("admin.settings.referral.plan_hint")})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:ed("admin.settings.referral.days_label")}),(0,s.jsx)("input",{type:"number",min:"1",max:"365",value:sZ.days,onChange:e=>s0(t=>({...t,days:e.target.value})),className:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400"}),(0,s.jsx)("p",{className:"text-xs text-gray-400 mt-1",children:ed("admin.settings.referral.days_hint")})]})]}),(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsx)("button",{onClick:n7,disabled:s1,className:"px-5 py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700 disabled:opacity-50",children:s1?ed("admin.settings.saving"):ed("common.save")}),s4&&(0,s.jsx)("span",{className:"text-sm text-green-600",children:ed("admin.settings.saved")})]})]}),"socials"===sy&&(0,s.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 p-6 max-w-lg space-y-5",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h3",{className:"font-semibold text-gray-800 mb-1",children:ed("admin.settings.socials.title")}),(0,s.jsx)("p",{className:"text-xs text-gray-400",children:ed("admin.settings.socials.hint")})]}),[{key:"telegram",label:"Telegram",placeholder:"https://t.me/yourname",icon:(0,s.jsx)("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"currentColor",children:(0,s.jsx)("path",{d:"M11.944 0A12 12 0 0 0 0 12a12 12 0 0 0 12 12 12 12 0 0 0 12-12A12 12 0 0 0 12 0a12 12 0 0 0-.056 0zm4.962 7.224c.1-.002.321.023.465.14a.506.506 0 0 1 .171.325c.016.093.036.306.02.472-.18 1.898-.962 6.502-1.36 8.627-.168.9-.499 1.201-.82 1.23-.696.065-1.225-.46-1.9-.902-1.056-.693-1.653-1.124-2.678-1.8-1.185-.78-.417-1.21.258-1.91.177-.184 3.247-2.977 3.307-3.23.007-.032.014-.15-.056-.212s-.174-.041-.249-.024c-.106.024-1.793 1.14-5.061 3.345-.48.33-.913.49-1.302.48-.428-.008-1.252-.241-1.865-.44-.752-.245-1.349-.374-1.297-.789.027-.216.325-.437.893-.663 3.498-1.524 5.83-2.529 6.998-3.014 3.332-1.386 4.025-1.627 4.476-1.635z"})})},{key:"instagram",label:"Instagram",placeholder:"https://instagram.com/yourname",icon:(0,s.jsx)("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"currentColor",children:(0,s.jsx)("path",{d:"M12 2.163c3.204 0 3.584.012 4.85.07 3.252.148 4.771 1.691 4.919 4.919.058 1.265.069 1.645.069 4.849 0 3.205-.012 3.584-.069 4.849-.149 3.225-1.664 4.771-4.919 4.919-1.266.058-1.644.07-4.85.07-3.204 0-3.584-.012-4.849-.07-3.26-.149-4.771-1.699-4.919-4.92-.058-1.265-.07-1.644-.07-4.849 0-3.204.013-3.583.07-4.849.149-3.227 1.664-4.771 4.919-4.919 1.266-.057 1.645-.069 4.849-.069zm0-2.163c-3.259 0-3.667.014-4.947.072-4.358.2-6.78 2.618-6.98 6.98-.059 1.281-.073 1.689-.073 4.948 0 3.259.014 3.668.072 4.948.2 4.358 2.618 6.78 6.98 6.98 1.281.058 1.689.072 4.948.072 3.259 0 3.668-.014 4.948-.072 4.354-.2 6.782-2.618 6.979-6.98.059-1.28.073-1.689.073-4.948 0-3.259-.014-3.667-.072-4.947-.196-4.354-2.617-6.78-6.979-6.98-1.281-.059-1.69-.073-4.949-.073zm0 5.838a6.162 6.162 0 1 0 0 12.324 6.162 6.162 0 0 0 0-12.324zM12 16a4 4 0 1 1 0-8 4 4 0 0 1 0 8zm6.406-11.845a1.44 1.44 0 1 0 0 2.881 1.44 1.44 0 0 0 0-2.881z"})})},{key:"facebook",label:"Facebook",placeholder:"https://facebook.com/yourpage",icon:(0,s.jsx)("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"currentColor",children:(0,s.jsx)("path",{d:"M24 12.073c0-6.627-5.373-12-12-12s-12 5.373-12 12c0 5.99 4.388 10.954 10.125 11.854v-8.385H7.078v-3.47h3.047V9.43c0-3.007 1.792-4.669 4.533-4.669 1.312 0 2.686.235 2.686.235v2.953H15.83c-1.491 0-1.956.925-1.956 1.874v2.25h3.328l-.532 3.47h-2.796v8.385C19.612 23.027 24 18.062 24 12.073z"})})},{key:"twitter",label:"X (Twitter)",placeholder:"https://x.com/yourname",icon:(0,s.jsx)("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"currentColor",children:(0,s.jsx)("path",{d:"M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"})})},{key:"youtube",label:"YouTube",placeholder:"https://youtube.com/@yourchannel",icon:(0,s.jsx)("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"currentColor",children:(0,s.jsx)("path",{d:"M23.498 6.186a3.016 3.016 0 0 0-2.122-2.136C19.505 3.545 12 3.545 12 3.545s-7.505 0-9.377.505A3.017 3.017 0 0 0 .502 6.186C0 8.07 0 12 0 12s0 3.93.502 5.814a3.016 3.016 0 0 0 2.122 2.136c1.871.505 9.376.505 9.376.505s7.505 0 9.377-.505a3.015 3.015 0 0 0 2.122-2.136C24 15.93 24 12 24 12s0-3.93-.502-5.814zM9.545 15.568V8.432L15.818 12l-6.273 3.568z"})})},{key:"tiktok",label:"TikTok",placeholder:"https://tiktok.com/@yourname",icon:(0,s.jsx)("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"currentColor",children:(0,s.jsx)("path",{d:"M19.59 6.69a4.83 4.83 0 0 1-3.77-4.25V2h-3.45v13.67a2.89 2.89 0 0 1-2.88 2.5 2.89 2.89 0 0 1-2.89-2.89 2.89 2.89 0 0 1 2.89-2.89c.28 0 .54.04.79.1V9.01a6.27 6.27 0 0 0-.79-.05 6.34 6.34 0 0 0-6.34 6.34 6.34 6.34 0 0 0 6.34 6.34 6.34 6.34 0 0 0 6.33-6.34V8.73a8.16 8.16 0 0 0 4.77 1.52V6.79a4.85 4.85 0 0 1-1-.1z"})})},{key:"whatsapp",label:"WhatsApp",placeholder:"https://wa.me/30xxxxxxxxxx",icon:(0,s.jsx)("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"currentColor",children:(0,s.jsx)("path",{d:"M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347m-5.421 7.403h-.004a9.87 9.87 0 0 1-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 0 1-1.51-5.26c.001-5.45 4.436-9.884 9.888-9.884 2.64 0 5.122 1.03 6.988 2.898a9.825 9.825 0 0 1 2.893 6.994c-.003 5.45-4.437 9.884-9.885 9.884m8.413-18.297A11.815 11.815 0 0 0 12.05 0C5.495 0 .16 5.335.157 11.892c0 2.096.547 4.142 1.588 5.945L.057 24l6.305-1.654a11.882 11.882 0 0 0 5.683 1.448h.005c6.554 0 11.89-5.335 11.893-11.893a11.821 11.821 0 0 0-3.48-8.413z"})})},{key:"viber",label:"Viber",placeholder:"viber://chat?number=30xxxxxxxxxx",icon:(0,s.jsx)("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",fill:"currentColor",children:(0,s.jsx)("path",{d:"M11.398.002C8.473.028 4.414.625 2.138 4.15.2 7.044-.054 10.74.009 13.092c.064 2.352.277 4.799 1.97 6.758 1.32 1.527 3.276 2.39 5.262 2.674l.006 1.92c0 .307.368.47.592.257l2.245-2.143c.666.037 1.338.046 2.001.023 3.05-.107 6.238-.671 8.39-2.988 2.27-2.45 2.476-5.915 2.515-9.093.038-3.178-.15-6.648-2.467-9.052C18.337.606 14.323-.024 11.398.002zm.11 1.55c2.73-.023 6.267.538 8.3 2.688 1.878 2.004 2.034 5.155 2.001 8.172-.033 3.017-.245 5.967-2.069 7.944-1.792 1.943-4.607 2.44-7.265 2.533a18.35 18.35 0 0 1-2.198-.051l-.301-.028L7.8 24.51l-.004-2.463-.359-.064c-1.875-.333-3.693-1.152-4.832-2.47-1.377-1.597-1.574-3.702-1.632-5.915-.058-2.213.173-5.593 1.85-8.145C4.519 2.967 8.03 1.576 11.508 1.552zm-.082 2.19a8.79 8.79 0 0 0-2.65.399c-1.567.494-2.953 1.497-3.9 2.786C3.67 8.347 3.19 10.01 3.16 11.704c-.03 1.695.392 3.435 1.465 4.754.767.94 1.833 1.603 2.978 1.95l.004 1.232 1.197-1.143c.545.094 1.102.139 1.655.134 1.614-.015 3.27-.444 4.584-1.46 1.314-1.016 2.14-2.578 2.355-4.217.216-1.64-.017-3.369-.85-4.773-.832-1.403-2.23-2.412-3.773-2.74a8.777 8.777 0 0 0-1.459-.12zm.076 1.56c.39.003.784.049 1.165.14 1.215.27 2.319 1.066 2.975 2.17.657 1.103.843 2.518.66 3.857-.183 1.339-.826 2.596-1.87 3.408-1.044.813-2.41 1.172-3.76 1.185a10.75 10.75 0 0 1-1.675-.131l-.395-.064-1.017.97-.003-1.02-.384-.117c-1.027-.314-1.95-.925-2.574-1.693-.893-1.095-1.225-2.58-1.198-4.017.028-1.437.427-2.866 1.236-3.98.809-1.113 1.959-1.905 3.236-2.296a7.298 7.298 0 0 1 1.609-.412z"})})}].map(e=>{let{key:t,label:a,placeholder:l,icon:n}=e;return(0,s.jsxs)("div",{children:[(0,s.jsxs)("label",{className:"block text-sm font-medium text-gray-700 mb-1 flex items-center gap-2",children:[(0,s.jsx)("span",{className:"".concat(ls[t]?"text-green-600":"text-gray-300"),children:n}),a,!ls[t]&&(0,s.jsx)("span",{className:"text-xs font-normal text-gray-400 ml-auto",children:"Ме запПлМеМП"})]}),(0,s.jsx)("input",{type:"url",value:ls[t],onChange:e=>ll(a=>({...a,[t]:e.target.value})),placeholder:l,className:"w-full border rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 ".concat(ls[t]?"border-green-300 bg-green-50/30":"border-gray-300")})]},t)}),(0,s.jsxs)("div",{className:"flex items-center gap-3 pt-2",children:[(0,s.jsx)("button",{onClick:n9,disabled:ln,className:"px-5 py-2 bg-green-600 text-white rounded-lg text-sm font-medium hover:bg-green-700 disabled:opacity-50",children:ln?ed("admin.settings.saving"):ed("common.save")}),li&&(0,s.jsx)("span",{className:"text-sm text-green-600",children:ed("admin.settings.saved")})]})]}),"seo"===sy&&(0,s.jsxs)("div",{className:"bg-white rounded-xl border border-gray-200 p-6 max-w-lg space-y-6",children:[(0,s.jsx)("h3",{className:"font-semibold text-gray-800",children:ed("admin.settings.seo.title")}),(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"text-sm font-medium text-gray-700",children:ed("admin.settings.seo.maintenance_label")}),(0,s.jsx)("p",{className:"text-xs text-gray-400 mt-0.5",children:ed("admin.settings.seo.maintenance_hint")})]}),(0,s.jsx)("button",{type:"button",onClick:()=>s6(e=>({...e,maintenanceMode:!e.maintenanceMode})),className:"relative w-10 h-6 rounded-full p-0 transition-colors cursor-pointer flex-shrink-0 ".concat(s3.maintenanceMode?"bg-red-500":"bg-gray-300"),children:(0,s.jsx)("span",{className:"absolute left-0 top-1 w-4 h-4 bg-white rounded-full shadow transition-transform ".concat(s3.maintenanceMode?"translate-x-5":"translate-x-1")})})]}),(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"text-sm font-medium text-gray-700",children:ed("admin.settings.seo.indexing_label")}),(0,s.jsx)("p",{className:"text-xs text-gray-400 mt-0.5",children:ed("admin.settings.seo.indexing_hint")})]}),(0,s.jsx)("button",{type:"button",onClick:()=>s6(e=>({...e,indexingEnabled:!e.indexingEnabled})),className:"relative w-10 h-6 rounded-full p-0 transition-colors cursor-pointer flex-shrink-0 ".concat(s3.indexingEnabled?"bg-green-600":"bg-gray-300"),children:(0,s.jsx)("span",{className:"absolute left-0 top-1 w-4 h-4 bg-white rounded-full shadow transition-transform ".concat(s3.indexingEnabled?"translate-x-5":"translate-x-1")})})]}),(0,s.jsx)("div",{className:"space-y-4",children:(0,s.jsxs)("div",{children:[(0,s.jsxs)("p",{className:"text-sm font-medium text-gray-700 mb-2",children:[ed("admin.settings.seo.site_title_label")," / ",ed("admin.settings.seo.site_description_label")]}),(0,s.jsx)("div",{className:"flex gap-1 mb-3",children:[{code:"el",flag:"\uD83C\uDDEC\uD83C\uDDF7",label:"EL"},{code:"en",flag:"\uD83C\uDDEC\uD83C\uDDE7",label:"EN"},{code:"ru",flag:"\uD83C\uDDF7\uD83C\uDDFA",label:"RU"},{code:"uk",flag:"\uD83C\uDDFA\uD83C\uDDE6",label:"UK"}].map(e=>{let{code:t,flag:a,label:l}=e;return(0,s.jsxs)("button",{type:"button",onClick:()=>la(t),className:"flex items-center gap-1 px-3 py-1.5 rounded-lg text-sm font-medium transition-colors ".concat(lt===t?"bg-green-600 text-white":"bg-gray-100 text-gray-600 hover:bg-gray-200"),children:[a," ",l]},t)})}),(0,s.jsx)("label",{className:"block text-xs font-medium text-gray-500 mb-1",children:ed("admin.settings.seo.site_title_label")}),(0,s.jsx)("input",{value:s3["siteTitle".concat(lt.charAt(0).toUpperCase()+lt.slice(1))],onChange:e=>s6(t=>({...t,["siteTitle".concat(lt.charAt(0).toUpperCase()+lt.slice(1))]:e.target.value})),className:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 mb-3",placeholder:"el"===lt?"CanHelp — ΚάΞε άΜΞρωπος έχει κάτι Μα προσφέρει":"en"===lt?"CanHelp — Everyone has something valuable to offer":"ru"===lt?"CanHelp — КажЎый челПвек ЌПжет чеЌ-тП пПЌПчь":"CanHelp — КПжеМ Ќає МавОчку, яка ЌПже ЎПпПЌПгтО іМшПЌу"}),(0,s.jsx)("label",{className:"block text-xs font-medium text-gray-500 mb-1",children:ed("admin.settings.seo.site_description_label")}),(0,s.jsx)("textarea",{rows:3,value:s3["siteDescription".concat(lt.charAt(0).toUpperCase()+lt.slice(1))],onChange:e=>s6(t=>({...t,["siteDescription".concat(lt.charAt(0).toUpperCase()+lt.slice(1))]:e.target.value})),className:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 resize-none",placeholder:"el"===lt?"Η ελληΜική πλατφόρΌα για online αΜάΞεση εργασιώΜ...":"en"===lt?"The Greek platform for online task delegation...":"ru"===lt?"Греческая платфПрЌа Ўля ПМлайМ-пПОска спецОалОстПв...":"Грецька платфПрЌа Ўля пПшуку фахівців ПМлайМ..."})]})}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:ed("admin.settings.seo.head_scripts_label")}),(0,s.jsx)("p",{className:"text-xs text-gray-400 mb-2",children:ed("admin.settings.seo.head_scripts_hint")}),(0,s.jsx)("textarea",{rows:6,value:s3.headScripts,onChange:e=>s6(t=>({...t,headScripts:e.target.value})),className:"w-full border border-gray-300 rounded-lg px-3 py-2 text-sm font-mono focus:outline-none focus:ring-2 focus:ring-blue-400 resize-y",placeholder:"\x3c!-- Google Tag Manager --\x3e\n